@shipengine/react-api 1.12.2 → 1.12.4

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.
@@ -6,7 +6,6 @@ export * from "./use-get-countries-by-carrier";
6
6
  export * from "./use-get-currencies-by-carrier";
7
7
  export * from "./use-get-package-rating-group-by-carrier";
8
8
  export * from "./use-get-services-by-carrier";
9
- export * from "./use-get-wallet-history";
10
9
  export * from "./use-list-carriers";
11
10
  export * from "./use-update-auto-funding";
12
11
  export * from "./use-get-zones-by-carrier";
@@ -1,5 +1,7 @@
1
- import { PageableQuery } from "@shipengine/js-api";
1
+ import { PageableQuery, SortableQuery } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category ShipEngine API Hooks
4
4
  */
5
- export declare const useGetFundingSourceTransactions: (fundingSourceId: string, params?: PageableQuery) => import("@tanstack/react-query").UseQueryResult<import("@shipengine/js-api").FundingSourceTransactionsResponse, import("@shipengine/js-api").CodedError[]>;
5
+ export declare const useGetFundingSourceTransactions: (fundingSourceId: string, params?: {
6
+ category?: string;
7
+ } & PageableQuery & SortableQuery<"amount" | "category">) => import("@tanstack/react-query").UseQueryResult<import("@shipengine/js-api").FundingSourceTransactionsResponse, unknown>;
package/index.js CHANGED
@@ -490,24 +490,6 @@ const useGetServicesByCarrier = (carrierId) => {
490
490
  });
491
491
  };
492
492
 
493
- const useGetWalletHistory = ({
494
- enabled,
495
- page,
496
- range
497
- }) => {
498
- const { client } = useShipEngine();
499
- const [startDate, endDate] = range;
500
- return reactQuery.useQuery({
501
- enabled,
502
- keepPreviousData: true,
503
- // See https://react-query-v3.tanstack.com/guides/paginated-queries#better-paginated-queries-with-keeppreviousdata
504
- onError,
505
- queryFn: () => client.carriers.getWalletHistory(startDate, endDate, page),
506
- queryKey: ["useGetWalletHistory", startDate, endDate, page],
507
- select: (result) => result.data
508
- });
509
- };
510
-
511
493
  const useListCarriers = () => {
512
494
  const { client } = useShipEngine();
513
495
  return reactQuery.useQuery({
@@ -750,8 +732,8 @@ const useGetFundingSourceMetadata = () => {
750
732
  const useGetFundingSourceTransactions = (fundingSourceId, params) => {
751
733
  const { client } = useShipEngine();
752
734
  return reactQuery.useQuery({
735
+ enabled: !!fundingSourceId,
753
736
  keepPreviousData: true,
754
- onError,
755
737
  queryFn: () => client.fundingSources.transactions(fundingSourceId, params),
756
738
  queryKey: ["useGetFundingSourceTransactions", fundingSourceId, params],
757
739
  select: (result) => result.data
@@ -1868,7 +1850,6 @@ exports.useGetShipmentRates = useGetShipmentRates;
1868
1850
  exports.useGetShippingRuleById = useGetShippingRuleById;
1869
1851
  exports.useGetShippingRuleConditionsOptions = useGetShippingRuleConditionsOptions;
1870
1852
  exports.useGetThemeById = useGetThemeById;
1871
- exports.useGetWalletHistory = useGetWalletHistory;
1872
1853
  exports.useGetZonesByCarrier = useGetZonesByCarrier;
1873
1854
  exports.useListCarriers = useListCarriers;
1874
1855
  exports.useListCustomPackageTypes = useListCustomPackageTypes;
package/index.mjs CHANGED
@@ -487,24 +487,6 @@ const useGetServicesByCarrier = (carrierId) => {
487
487
  });
488
488
  };
489
489
 
490
- const useGetWalletHistory = ({
491
- enabled,
492
- page,
493
- range
494
- }) => {
495
- const { client } = useShipEngine();
496
- const [startDate, endDate] = range;
497
- return useQuery({
498
- enabled,
499
- keepPreviousData: true,
500
- // See https://react-query-v3.tanstack.com/guides/paginated-queries#better-paginated-queries-with-keeppreviousdata
501
- onError,
502
- queryFn: () => client.carriers.getWalletHistory(startDate, endDate, page),
503
- queryKey: ["useGetWalletHistory", startDate, endDate, page],
504
- select: (result) => result.data
505
- });
506
- };
507
-
508
490
  const useListCarriers = () => {
509
491
  const { client } = useShipEngine();
510
492
  return useQuery({
@@ -747,8 +729,8 @@ const useGetFundingSourceMetadata = () => {
747
729
  const useGetFundingSourceTransactions = (fundingSourceId, params) => {
748
730
  const { client } = useShipEngine();
749
731
  return useQuery({
732
+ enabled: !!fundingSourceId,
750
733
  keepPreviousData: true,
751
- onError,
752
734
  queryFn: () => client.fundingSources.transactions(fundingSourceId, params),
753
735
  queryKey: ["useGetFundingSourceTransactions", fundingSourceId, params],
754
736
  select: (result) => result.data
@@ -1819,4 +1801,4 @@ const useUpdateAccountBillingPlan = () => {
1819
1801
  });
1820
1802
  };
1821
1803
 
1822
- export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, 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, useGetWalletHistory, useGetZonesByCarrier, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListShippingRules, useListWarehouses, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };
1804
+ export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, 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, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListShippingRules, useListWarehouses, 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/react-api",
3
- "version": "1.12.2",
3
+ "version": "1.12.4",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -1,10 +0,0 @@
1
- /**
2
- * @category ShipEngine API Hooks
3
- *
4
- * @see https://react-query-v3.tanstack.com/guides/paginated-queries
5
- */
6
- export declare const useGetWalletHistory: ({ enabled, page, range, }: {
7
- enabled: boolean;
8
- page: number;
9
- range: [Date, Date];
10
- }) => import("@tanstack/react-query").UseQueryResult<import("@shipengine/js-api").WalletTransactionHistory, import("@shipengine/js-api").CodedError[]>;