@omniumretail/shared-resources 0.1.20 → 0.1.22

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.
@@ -0,0 +1,2 @@
1
+ import { Checkout } from '../../interfaces';
2
+ export declare const postCheckoutsMutateQueryHook: () => import("@tanstack/react-query").UseMutationResult<Checkout, unknown, Checkout, unknown>;
@@ -1,7 +1,7 @@
1
1
  import { UseQueryOptions } from "@tanstack/react-query";
2
2
  import { ContractStates, ResponseList } from "../../interfaces";
3
- interface ContractStatesQueryProps extends UseQueryOptions<ContractStates> {
3
+ interface ContractStatesQueryProps extends Omit<UseQueryOptions<ResponseList<"ContractStates", ContractStates>>, "queryKey"> {
4
4
  records: string;
5
5
  }
6
- export declare const useContractStatesQuery: ({ records }: ContractStatesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"ContractStates", ContractStates>, unknown>;
6
+ export declare const useContractStatesQuery: ({ records, ...options }: ContractStatesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"ContractStates", ContractStates>, unknown>;
7
7
  export {};
@@ -1,7 +1,7 @@
1
1
  import { UseQueryOptions } from "@tanstack/react-query";
2
2
  import { Countries, ResponseList } from "../../interfaces";
3
- interface CountriesQueryProps extends UseQueryOptions<Countries> {
3
+ interface CountriesQueryProps extends Omit<UseQueryOptions<ResponseList<"Countries", Countries>>, "queryKey"> {
4
4
  records: string;
5
5
  }
6
- export declare const useCountriesQuery: ({ records }: CountriesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Countries", Countries>, unknown>;
6
+ export declare const useCountriesQuery: ({ records, ...options }: CountriesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Countries", Countries>, unknown>;
7
7
  export {};
@@ -1,7 +1,7 @@
1
1
  import { UseQueryOptions } from "@tanstack/react-query";
2
2
  import { JobTitles, ResponseList } from "../../interfaces";
3
- interface JobTitlesQueryProps extends UseQueryOptions<JobTitles> {
3
+ interface JobTitlesQueryProps extends Omit<UseQueryOptions<ResponseList<"JobTitles", JobTitles>>, "queryKey"> {
4
4
  records: string;
5
5
  }
6
- export declare const useJobTitlesQuery: ({ records }: JobTitlesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"JobTitles", JobTitles>, unknown>;
6
+ export declare const useJobTitlesQuery: ({ records, ...options }: JobTitlesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"JobTitles", JobTitles>, unknown>;
7
7
  export {};
@@ -4,5 +4,5 @@ interface StoreQueryProps extends UseQueryOptions<Store> {
4
4
  code: string;
5
5
  shouldFetch?: boolean;
6
6
  }
7
- export declare const useStoreByCodeQuery: ({ code, shouldFetch }: StoreQueryProps) => import("@tanstack/react-query").UseQueryResult<Store, unknown>;
7
+ export declare const useStoreByCodeQuery: ({ code, shouldFetch, ...options }: StoreQueryProps) => import("@tanstack/react-query").UseQueryResult<Store, unknown>;
8
8
  export {};
@@ -49,3 +49,4 @@ export * from './Others/useTermNotificationQuery.hook';
49
49
  export * from './Others/useCustomersQuery.hook';
50
50
  export * from './Others/useCountriesQuery.hook';
51
51
  export * from './Others/useCreateNotification.hook';
52
+ export * from './Others/postCheckoutsMutateQuery.hook';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -1,6 +1,6 @@
1
1
  import { useMutation, useQueryClient } from '@tanstack/react-query';
2
- import { Checkout } from '../../../interfaces';
3
- import { post } from '../../../services/ApiService';
2
+ import { Checkout } from '../../interfaces';
3
+ import { post } from '../../services/ApiService';
4
4
 
5
5
  export const postCheckoutsMutateQueryHook = () => {
6
6
  const queryClient = useQueryClient();
@@ -2,13 +2,14 @@ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
2
  import { ContractStates, ResponseList } from "../../interfaces";
3
3
  import { getAuth0 } from "../../services/ApiService";
4
4
 
5
- interface ContractStatesQueryProps extends UseQueryOptions<ContractStates> {
5
+ interface ContractStatesQueryProps extends Omit<UseQueryOptions<ResponseList<"ContractStates", ContractStates>>, "queryKey"> {
6
6
  records: string;
7
7
  }
8
8
 
9
- export const useContractStatesQuery = ({ records }: ContractStatesQueryProps) => {
9
+ export const useContractStatesQuery = ({ records, ...options }: ContractStatesQueryProps) => {
10
10
  return useQuery(
11
11
  ['CONTRACTSTATES_QUERY', records],
12
- () => getAuth0<ResponseList<"ContractStates", ContractStates>>(`/AACP/ContractStates`, { pPage: 1, pRecords: records || 195 })
12
+ () => getAuth0<ResponseList<"ContractStates", ContractStates>>(`/AACP/ContractStates`, { pPage: 1, pRecords: records || 195 }),
13
+ options
13
14
  );
14
15
  }
@@ -2,13 +2,14 @@ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
2
  import { Countries, ResponseList } from "../../interfaces";
3
3
  import { get } from "../../services";
4
4
 
5
- interface CountriesQueryProps extends UseQueryOptions<Countries> {
5
+ interface CountriesQueryProps extends Omit<UseQueryOptions<ResponseList<"Countries", Countries>>, "queryKey"> {
6
6
  records: string;
7
7
  }
8
8
 
9
- export const useCountriesQuery = ({ records }: CountriesQueryProps) => {
9
+ export const useCountriesQuery = ({ records, ...options }: CountriesQueryProps) => {
10
10
  return useQuery(
11
11
  ['COUNTRIES_QUERY', records],
12
- () => get<ResponseList<"Countries", Countries>>(`/Franchise/Countries`, { pPage: 1, pRecords: records || 195 })
12
+ () => get<ResponseList<"Countries", Countries>>(`/Franchise/Countries`, { pPage: 1, pRecords: records || 195 }),
13
+ options
13
14
  );
14
15
  }
@@ -2,13 +2,14 @@ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
2
  import { JobTitles, ResponseList } from "../../interfaces";
3
3
  import { getAuth0 } from "../../services";
4
4
 
5
- interface JobTitlesQueryProps extends UseQueryOptions<JobTitles> {
5
+ interface JobTitlesQueryProps extends Omit<UseQueryOptions<ResponseList<"JobTitles", JobTitles>>, "queryKey"> {
6
6
  records: string;
7
7
  }
8
8
 
9
- export const useJobTitlesQuery = ({ records }: JobTitlesQueryProps) => {
9
+ export const useJobTitlesQuery = ({ records, ...options }: JobTitlesQueryProps) => {
10
10
  return useQuery(
11
11
  ['JOBTITLES_QUERY', records],
12
- () => getAuth0<ResponseList<"JobTitles", JobTitles>>(`/AACP/JobTitles`, { pPage: 1, pRecords: records || 195 })
12
+ () => getAuth0<ResponseList<"JobTitles", JobTitles>>(`/AACP/JobTitles`, { pPage: 1, pRecords: records || 195 }),
13
+ options
13
14
  );
14
15
  }
@@ -7,15 +7,15 @@ interface StoreQueryProps extends UseQueryOptions<Store> {
7
7
  shouldFetch?: boolean;
8
8
  }
9
9
 
10
- export const useStoreByCodeQuery = ({ code, shouldFetch }: StoreQueryProps) => {
10
+ export const useStoreByCodeQuery = ({ code, shouldFetch, ...options }: StoreQueryProps) => {
11
11
  return useQuery(
12
12
  ['STORE_CODE_QUERY', code, shouldFetch],
13
13
  () => get<Store>('/Franchise/Locations/findByCode', {
14
14
  pCode: code,
15
-
16
15
  }),
17
16
  {
18
17
  enabled: shouldFetch,
18
+ ...options,
19
19
  }
20
20
  );
21
21
  };
@@ -67,4 +67,5 @@ export * from './Others/useApplicationDataQuery.hook';
67
67
  export * from './Others/useTermNotificationQuery.hook';
68
68
  export * from './Others/useCustomersQuery.hook';
69
69
  export * from './Others/useCountriesQuery.hook';
70
- export * from './Others/useCreateNotification.hook'
70
+ export * from './Others/useCreateNotification.hook';
71
+ export * from './Others/postCheckoutsMutateQuery.hook';