@shipengine/alchemy 0.4.19 → 0.4.20
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/index.js +27 -5
- package/index.mjs +26 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7598,13 +7598,13 @@ class FundingSourcesAPI {
|
|
|
7598
7598
|
endUserIpAddress
|
|
7599
7599
|
}, fundingSource));
|
|
7600
7600
|
});
|
|
7601
|
-
this.update = (billingInfo,
|
|
7601
|
+
this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$o(this, null, function* () {
|
|
7602
7602
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7603
7603
|
if (!endUserIpAddress)
|
|
7604
7604
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7605
7605
|
return yield this.client.put(
|
|
7606
7606
|
`/v1/funding_sources/${fundingSourceId}`,
|
|
7607
|
-
{ billingInfo, endUserIpAddress, paymentMethod }
|
|
7607
|
+
{ billingInfo, endUserIpAddress, paymentMethod: { creditCardInfo } }
|
|
7608
7608
|
);
|
|
7609
7609
|
});
|
|
7610
7610
|
this.registerCarrier = (carrier) => __async$o(this, null, function* () {
|
|
@@ -8195,7 +8195,7 @@ const useCreateFundingSource = () => {
|
|
|
8195
8195
|
return reactQuery.useMutation({
|
|
8196
8196
|
mutationFn: (fundingSource) => __async$i(void 0, null, function* () {
|
|
8197
8197
|
const result = yield client.fundingSources.create(fundingSource);
|
|
8198
|
-
return result.data;
|
|
8198
|
+
return result.data.fundingSource.fundingSourceId;
|
|
8199
8199
|
}),
|
|
8200
8200
|
mutationKey: ["useCreateFundingSource"],
|
|
8201
8201
|
onError
|
|
@@ -8404,6 +8404,16 @@ const useGetCarrierById = (carrierId) => {
|
|
|
8404
8404
|
});
|
|
8405
8405
|
};
|
|
8406
8406
|
|
|
8407
|
+
const useGetFundingSourceById = (fundingSourceId) => {
|
|
8408
|
+
const { client } = useShipEngine();
|
|
8409
|
+
return reactQuery.useQuery({
|
|
8410
|
+
onError,
|
|
8411
|
+
queryFn: () => client.fundingSources.get(fundingSourceId),
|
|
8412
|
+
queryKey: ["getFundingSourceById"],
|
|
8413
|
+
select: (result) => result.data
|
|
8414
|
+
});
|
|
8415
|
+
};
|
|
8416
|
+
|
|
8407
8417
|
const useGetInsuranceAccount = (insuranceProvider) => {
|
|
8408
8418
|
const { client } = useShipEngine();
|
|
8409
8419
|
return reactQuery.useQuery({
|
|
@@ -8518,6 +8528,16 @@ const useListCustomPackageTypes = () => {
|
|
|
8518
8528
|
});
|
|
8519
8529
|
};
|
|
8520
8530
|
|
|
8531
|
+
const useListFundingSources = () => {
|
|
8532
|
+
const { client } = useShipEngine();
|
|
8533
|
+
return reactQuery.useQuery({
|
|
8534
|
+
onError,
|
|
8535
|
+
queryFn: () => client.fundingSources.list(),
|
|
8536
|
+
queryKey: ["useListFundingSources"],
|
|
8537
|
+
select: (result) => result.data.fundingSources
|
|
8538
|
+
});
|
|
8539
|
+
};
|
|
8540
|
+
|
|
8521
8541
|
const useListLabels = (params) => {
|
|
8522
8542
|
const { client } = useShipEngine();
|
|
8523
8543
|
return reactQuery.useQuery({
|
|
@@ -8842,12 +8862,12 @@ const useUpdateFundingSource = () => {
|
|
|
8842
8862
|
return reactQuery.useMutation({
|
|
8843
8863
|
mutationFn: (_0) => __async$7(void 0, [_0], function* ({
|
|
8844
8864
|
billingInfo,
|
|
8845
|
-
|
|
8865
|
+
creditCardInfo,
|
|
8846
8866
|
fundingSourceId
|
|
8847
8867
|
}) {
|
|
8848
8868
|
const result = yield client.fundingSources.update(
|
|
8849
8869
|
billingInfo,
|
|
8850
|
-
|
|
8870
|
+
creditCardInfo,
|
|
8851
8871
|
fundingSourceId
|
|
8852
8872
|
);
|
|
8853
8873
|
return result.data;
|
|
@@ -9832,6 +9852,7 @@ exports.useDeleteWarehouse = useDeleteWarehouse;
|
|
|
9832
9852
|
exports.useGetAccountSettings = useGetAccountSettings;
|
|
9833
9853
|
exports.useGetAutoFundingConfiguration = useGetAutoFundingConfiguration;
|
|
9834
9854
|
exports.useGetCarrierById = useGetCarrierById;
|
|
9855
|
+
exports.useGetFundingSourceById = useGetFundingSourceById;
|
|
9835
9856
|
exports.useGetInsuranceAccount = useGetInsuranceAccount;
|
|
9836
9857
|
exports.useGetLabel = useGetLabel;
|
|
9837
9858
|
exports.useGetSalesOrder = useGetSalesOrder;
|
|
@@ -9842,6 +9863,7 @@ exports.useGetWalletHistory = useGetWalletHistory;
|
|
|
9842
9863
|
exports.useI18n = useI18n;
|
|
9843
9864
|
exports.useListCarriers = useListCarriers;
|
|
9844
9865
|
exports.useListCustomPackageTypes = useListCustomPackageTypes;
|
|
9866
|
+
exports.useListFundingSources = useListFundingSources;
|
|
9845
9867
|
exports.useListLabels = useListLabels;
|
|
9846
9868
|
exports.useListOrderSources = useListOrderSources;
|
|
9847
9869
|
exports.useListSalesOrderShipments = useListSalesOrderShipments;
|
package/index.mjs
CHANGED
|
@@ -7576,13 +7576,13 @@ class FundingSourcesAPI {
|
|
|
7576
7576
|
endUserIpAddress
|
|
7577
7577
|
}, fundingSource));
|
|
7578
7578
|
});
|
|
7579
|
-
this.update = (billingInfo,
|
|
7579
|
+
this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$o(this, null, function* () {
|
|
7580
7580
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7581
7581
|
if (!endUserIpAddress)
|
|
7582
7582
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7583
7583
|
return yield this.client.put(
|
|
7584
7584
|
`/v1/funding_sources/${fundingSourceId}`,
|
|
7585
|
-
{ billingInfo, endUserIpAddress, paymentMethod }
|
|
7585
|
+
{ billingInfo, endUserIpAddress, paymentMethod: { creditCardInfo } }
|
|
7586
7586
|
);
|
|
7587
7587
|
});
|
|
7588
7588
|
this.registerCarrier = (carrier) => __async$o(this, null, function* () {
|
|
@@ -8173,7 +8173,7 @@ const useCreateFundingSource = () => {
|
|
|
8173
8173
|
return useMutation({
|
|
8174
8174
|
mutationFn: (fundingSource) => __async$i(void 0, null, function* () {
|
|
8175
8175
|
const result = yield client.fundingSources.create(fundingSource);
|
|
8176
|
-
return result.data;
|
|
8176
|
+
return result.data.fundingSource.fundingSourceId;
|
|
8177
8177
|
}),
|
|
8178
8178
|
mutationKey: ["useCreateFundingSource"],
|
|
8179
8179
|
onError
|
|
@@ -8382,6 +8382,16 @@ const useGetCarrierById = (carrierId) => {
|
|
|
8382
8382
|
});
|
|
8383
8383
|
};
|
|
8384
8384
|
|
|
8385
|
+
const useGetFundingSourceById = (fundingSourceId) => {
|
|
8386
|
+
const { client } = useShipEngine();
|
|
8387
|
+
return useQuery({
|
|
8388
|
+
onError,
|
|
8389
|
+
queryFn: () => client.fundingSources.get(fundingSourceId),
|
|
8390
|
+
queryKey: ["getFundingSourceById"],
|
|
8391
|
+
select: (result) => result.data
|
|
8392
|
+
});
|
|
8393
|
+
};
|
|
8394
|
+
|
|
8385
8395
|
const useGetInsuranceAccount = (insuranceProvider) => {
|
|
8386
8396
|
const { client } = useShipEngine();
|
|
8387
8397
|
return useQuery({
|
|
@@ -8496,6 +8506,16 @@ const useListCustomPackageTypes = () => {
|
|
|
8496
8506
|
});
|
|
8497
8507
|
};
|
|
8498
8508
|
|
|
8509
|
+
const useListFundingSources = () => {
|
|
8510
|
+
const { client } = useShipEngine();
|
|
8511
|
+
return useQuery({
|
|
8512
|
+
onError,
|
|
8513
|
+
queryFn: () => client.fundingSources.list(),
|
|
8514
|
+
queryKey: ["useListFundingSources"],
|
|
8515
|
+
select: (result) => result.data.fundingSources
|
|
8516
|
+
});
|
|
8517
|
+
};
|
|
8518
|
+
|
|
8499
8519
|
const useListLabels = (params) => {
|
|
8500
8520
|
const { client } = useShipEngine();
|
|
8501
8521
|
return useQuery({
|
|
@@ -8820,12 +8840,12 @@ const useUpdateFundingSource = () => {
|
|
|
8820
8840
|
return useMutation({
|
|
8821
8841
|
mutationFn: (_0) => __async$7(void 0, [_0], function* ({
|
|
8822
8842
|
billingInfo,
|
|
8823
|
-
|
|
8843
|
+
creditCardInfo,
|
|
8824
8844
|
fundingSourceId
|
|
8825
8845
|
}) {
|
|
8826
8846
|
const result = yield client.fundingSources.update(
|
|
8827
8847
|
billingInfo,
|
|
8828
|
-
|
|
8848
|
+
creditCardInfo,
|
|
8829
8849
|
fundingSourceId
|
|
8830
8850
|
);
|
|
8831
8851
|
return result.data;
|
|
@@ -9761,4 +9781,4 @@ const alchemy = {
|
|
|
9761
9781
|
createElement
|
|
9762
9782
|
};
|
|
9763
9783
|
|
|
9764
|
-
export { AccountSettingsAPI, AddressesAPI, Alchemy, AlchemyContext, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, WarehousesAPI, alchemy as default, delay, getEndUserIpAddress, isCodedError, isCodedErrors, logger, memoizedCreateCache, onError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateFundingSource, useCreateLabel, useCreateSalesOrderShipment, useCreateWarehouse, useDeleteWarehouse, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetInsuranceAccount, useGetLabel, useGetSalesOrder, useGetSalesOrderShipment, useGetShipment, useGetShipmentRates, useGetWalletHistory, useI18n, useListCarriers, useListCustomPackageTypes, useListLabels, useListOrderSources, useListSalesOrderShipments, useListSalesOrders, useListWarehouses, useLoadFonts, useLoadIcons, useLoadTheme, useNotifySalesOrderShipped, useParseAddress, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateSalesOrderShipment, useUpdateWarehouse, useValidateAddresses, useVoidLabel };
|
|
9784
|
+
export { AccountSettingsAPI, AddressesAPI, Alchemy, AlchemyContext, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, WarehousesAPI, alchemy as default, delay, getEndUserIpAddress, isCodedError, isCodedErrors, logger, memoizedCreateCache, onError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateFundingSource, useCreateLabel, useCreateSalesOrderShipment, useCreateWarehouse, useDeleteWarehouse, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetFundingSourceById, useGetInsuranceAccount, useGetLabel, useGetSalesOrder, useGetSalesOrderShipment, useGetShipment, useGetShipmentRates, useGetWalletHistory, useI18n, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListSalesOrderShipments, useListSalesOrders, useListWarehouses, useLoadFonts, useLoadIcons, useLoadTheme, useNotifySalesOrderShipped, useParseAddress, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateSalesOrderShipment, useUpdateWarehouse, useValidateAddresses, useVoidLabel };
|