@omniumretail/shared-resources 0.1.91 → 0.1.93

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,5 @@
1
+ import { UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
2
+ import { PrinceChange } from "../../../interfaces";
3
+ type PriceChangePinQueryOptions = Omit<UseQueryOptions<PrinceChange, unknown>, 'queryKey' | 'queryFn'>;
4
+ export declare const getPriceChangePinQueryHook: (storeId: string, options?: PriceChangePinQueryOptions) => UseQueryResult<PrinceChange, unknown>;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { PrinceChange } from "../../../interfaces";
3
+ export interface PriceChangeProps extends UseQueryOptions<PrinceChange> {
4
+ storeId: string;
5
+ }
6
+ export declare const postPriceChangePinQueryHook: ({ storeId }: PriceChangeProps) => import("@tanstack/react-query").UseMutationResult<PrinceChange, unknown, PrinceChange, unknown>;
@@ -0,0 +1,6 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { PrinceChange } from "../../../interfaces";
3
+ export interface EmailWithPinChangeProps extends UseQueryOptions<PrinceChange> {
4
+ storeId: string;
5
+ }
6
+ export declare const sendEmailWithPinQueryHook: ({ storeId }: EmailWithPinChangeProps) => import("@tanstack/react-query").UseMutationResult<PrinceChange, unknown, PrinceChange, unknown>;
@@ -99,6 +99,9 @@ export * from './Asta/Actions/others/deleteActionQuery.hook';
99
99
  export * from './Asta/Actions/others/extractActionQuery.hook';
100
100
  export * from './Asta/Actions/others/archiveActionQuery.hook';
101
101
  export * from './Asta/Actions/others/finishActionQuery.hook';
102
+ export * from './Aprc/get/getPriceChangePinQuery.hook';
103
+ export * from './Aprc/others/postPriceChangePinQuery.hook';
104
+ export * from './Aprc/others/sendEmailWithPinQuery.hook';
102
105
  export * from './Others/useJobTitlesQuery.hook';
103
106
  export * from './Others/useContractStatesQuery.hook';
104
107
  export * from './Others/useApplicationDataQuery.hook';
@@ -111,6 +114,5 @@ export * from './Others/postVerifyImageQuery.hook';
111
114
  export * from './Others/getWeeklyWorkloadQuery.hook';
112
115
  export * from './Others/getNotificationTitleQuery.hook';
113
116
  export * from './Others/getUserEmailStatusQuery.hook';
114
- export * from './Others/getPriceChangePinQuery.hook';
115
117
  export * from './Others/getRegulationQuery.hook';
116
118
  export * from './Others/useRegulationQuery.hook';
@@ -2,4 +2,5 @@ export interface PrinceChange {
2
2
  Pin: string;
3
3
  ExpirationDate: number;
4
4
  CreationDate: number;
5
+ StoreExternalId: string;
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.91",
3
+ "version": "0.1.93",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -0,0 +1,16 @@
1
+ import { useQuery, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
2
+ import { PrinceChange } from "../../../interfaces";
3
+ import { getAuth0 } from "../../../services/ApiService";
4
+
5
+ type PriceChangePinQueryOptions = Omit<UseQueryOptions<PrinceChange, unknown>, 'queryKey' | 'queryFn'>;
6
+
7
+ export const getPriceChangePinQueryHook = (storeId: string, options?: PriceChangePinQueryOptions): UseQueryResult<PrinceChange, unknown> => {
8
+ return useQuery(
9
+ ['PRICE_CHANGE_PIN_QUERY', storeId],
10
+ () => getAuth0<PrinceChange>(`/GNG/Users/Pin/${storeId}`),
11
+ {
12
+ enabled: !!storeId,
13
+ ...options,
14
+ },
15
+ );
16
+ }
@@ -0,0 +1,19 @@
1
+ import { UseQueryOptions, useMutation, useQueryClient } from "@tanstack/react-query";
2
+ import { PrinceChange } from "../../../interfaces";
3
+ import { postAuth0 } from "../../../services/ApiService";
4
+
5
+ export interface PriceChangeProps extends UseQueryOptions<PrinceChange> {
6
+ storeId: string;
7
+ }
8
+
9
+ export const postPriceChangePinQueryHook = ({ storeId }: PriceChangeProps) => {
10
+ const queryClient = useQueryClient();
11
+ return useMutation<PrinceChange, unknown, PrinceChange>(() => {
12
+ return postAuth0(`/GNG/Users/Pin/${storeId}`)
13
+ }, {
14
+ onSuccess: (data: PrinceChange) => {
15
+ queryClient.setQueryData(
16
+ ['PRICE_CHANGE_PIN_QUERY'], data);
17
+ },
18
+ });
19
+ }
@@ -0,0 +1,19 @@
1
+ import { UseQueryOptions, useMutation, useQueryClient } from "@tanstack/react-query";
2
+ import { PrinceChange } from "../../../interfaces";
3
+ import { postAuth0 } from "../../../services/ApiService";
4
+
5
+ export interface EmailWithPinChangeProps extends UseQueryOptions<PrinceChange> {
6
+ storeId: string;
7
+ }
8
+
9
+ export const sendEmailWithPinQueryHook = ({ storeId }: EmailWithPinChangeProps) => {
10
+ const queryClient = useQueryClient();
11
+ return useMutation<PrinceChange, unknown, PrinceChange>(() => {
12
+ return postAuth0(`/GNG/Users/Pin/Email/${storeId}`)
13
+ }, {
14
+ onSuccess: (data: PrinceChange) => {
15
+ queryClient.setQueryData(
16
+ ['EMAIL_PIN_QUERY'], data);
17
+ },
18
+ });
19
+ }
@@ -129,6 +129,11 @@ export * from './Asta/Actions/others/extractActionQuery.hook';
129
129
  export * from './Asta/Actions/others/archiveActionQuery.hook';
130
130
  export * from './Asta/Actions/others/finishActionQuery.hook';
131
131
 
132
+ //APRC
133
+ export * from './Aprc/get/getPriceChangePinQuery.hook';
134
+ export * from './Aprc/others/postPriceChangePinQuery.hook';
135
+ export * from './Aprc/others/sendEmailWithPinQuery.hook';
136
+
132
137
  //Others
133
138
  export * from './Others/useJobTitlesQuery.hook';
134
139
  export * from './Others/useContractStatesQuery.hook';
@@ -142,6 +147,5 @@ export * from './Others/postVerifyImageQuery.hook';
142
147
  export * from './Others/getWeeklyWorkloadQuery.hook';
143
148
  export * from './Others/getNotificationTitleQuery.hook';
144
149
  export * from './Others/getUserEmailStatusQuery.hook';
145
- export * from './Others/getPriceChangePinQuery.hook';
146
150
  export * from './Others/getRegulationQuery.hook';
147
151
  export * from './Others/useRegulationQuery.hook';
@@ -3,4 +3,5 @@ export interface PrinceChange {
3
3
  Pin: string;
4
4
  ExpirationDate: number;
5
5
  CreationDate: number;
6
+ StoreExternalId: string;
6
7
  }
@@ -1,11 +0,0 @@
1
- import { useQuery } from "@tanstack/react-query";
2
- import { PrinceChange } from "../../interfaces";
3
- import { getAuth0 } from "../../services/ApiService";
4
-
5
- export const getPriceChangePinQueryHook = () => {
6
- return useQuery(
7
- ['PRICE_CHANGE_PIN_QUERY'],
8
- () => getAuth0<PrinceChange>(`/GNG/Users/Pin`),
9
- );
10
- }
11
-