@omniumretail/shared-resources 0.2.76 → 0.2.78
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/dist/bundle.js +1 -1
- package/dist/types/hooks/BigWin/others/importABWGQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Orch/get/getAuth0ConfigQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Orch/get/getMacrosInstancesQuery.hook.d.ts +8 -0
- package/dist/types/hooks/Users/get/usePermissionByIdQuery.hook.d.ts +3 -0
- package/dist/types/hooks/Users/get/usePermissionsQuery.hook.d.ts +11 -0
- package/dist/types/hooks/Users/mutate/useUpdatePermissionsMutateQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +6 -0
- package/dist/types/interfaces/Auth0Config.d.ts +5 -0
- package/dist/types/interfaces/Bwg.d.ts +4 -0
- package/dist/types/interfaces/MacroInstance.d.ts +10 -0
- package/dist/types/interfaces/Permissions.d.ts +8 -0
- package/dist/types/interfaces/index.d.ts +3 -0
- package/package.json +1 -1
- package/src/hooks/BigWin/others/importABWGQuery.hook.ts +20 -0
- package/src/hooks/Orch/get/getAuth0ConfigQuery.hook.ts +11 -0
- package/src/hooks/Orch/get/getMacrosInstancesQuery.hook.ts +19 -0
- package/src/hooks/Users/get/usePermissionByIdQuery.hook.ts +15 -0
- package/src/hooks/Users/get/usePermissionsQuery.hook.ts +28 -0
- package/src/hooks/Users/mutate/useUpdatePermissionsMutateQuery.hook.ts +17 -0
- package/src/hooks/index.ts +8 -0
- package/src/interfaces/Auth0Config.ts +6 -0
- package/src/interfaces/Bwg.ts +6 -0
- package/src/interfaces/MacroInstance.ts +11 -0
- package/src/interfaces/Permissions.ts +8 -0
- package/src/interfaces/index.ts +3 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { MacroInstance } from "../../../interfaces";
|
|
3
|
+
interface MacrosInstancesProps extends Omit<UseQueryOptions<MacroInstance>, "queryKey"> {
|
|
4
|
+
costumerId?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const getMacrosInstancesQueryHook: ({ costumerId, type, ...options }: MacrosInstancesProps) => import("@tanstack/react-query").UseQueryResult<MacroInstance, unknown>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Permissions } from "../../../interfaces";
|
|
3
|
+
export declare const usePermissionIdQueryHook: (Id: string, options?: UseQueryOptions<Permissions, Error>) => import("@tanstack/react-query").UseQueryResult<Permissions, Error>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Permissions, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface PermissionQuery extends UseQueryOptions<ResponseList<"Permissions", Permissions>> {
|
|
4
|
+
tags?: string;
|
|
5
|
+
page?: number;
|
|
6
|
+
records?: number;
|
|
7
|
+
queryField?: string;
|
|
8
|
+
sortBy?: string;
|
|
9
|
+
sortDirection?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const usePermissionsQuery: ({ tags, page, records, queryField, sortBy, sortDirection }: PermissionQuery) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Permissions", Permissions>, unknown>;
|
|
@@ -60,6 +60,9 @@ export * from "./Users/mutate/useSingleUserIdMutateQuery.hook";
|
|
|
60
60
|
export * from "./Users/get/useUserIdQuery.hook";
|
|
61
61
|
export * from "./Users/others/useUserResetPassByEmail.hook";
|
|
62
62
|
export * from "./Users/get/getUserAndSupervisorQuery.hook";
|
|
63
|
+
export * from "./Users/get/usePermissionsQuery.hook";
|
|
64
|
+
export * from "./Users/mutate/useUpdatePermissionsMutateQuery.hook";
|
|
65
|
+
export * from "./Users/get/usePermissionByIdQuery.hook";
|
|
63
66
|
export * from "./Analytics/get/useAnalyticsEvaluationCyclesQuery.hook";
|
|
64
67
|
export * from "./Analytics/get/useAnalyticsUserIdQuery.hook";
|
|
65
68
|
export * from "./Analytics/get/useAnalyticsQuestionsQuery.hook";
|
|
@@ -244,6 +247,7 @@ export * from "./BigWin/others/publishMonthsManagerQuery.hook";
|
|
|
244
247
|
export * from "./BigWin/get/getBwgAllEmployeesQuery.hook";
|
|
245
248
|
export * from "./BigWin/get/getBwgBackOfficeQuery.hook";
|
|
246
249
|
export * from "./BigWin/others/importRegulationQuery.hook";
|
|
250
|
+
export * from "./BigWin/others/importABWGQuery.hook";
|
|
247
251
|
export * from "./OSUA/get/documentos/getGngDocumentos.hook";
|
|
248
252
|
export * from "./OSUA/get/documentos/getSitooDocumentos.hook";
|
|
249
253
|
export * from "./OSUA/get/vouchers/getGngVoucher.hook";
|
|
@@ -278,6 +282,8 @@ export * from "./ACB/get/getClientBalance.hook";
|
|
|
278
282
|
export * from "./ACB/mutate/postClientBalance.hook";
|
|
279
283
|
export * from "./ACB/get/getClientBalance.hook";
|
|
280
284
|
export * from "./ACB/mutate/postClientBalance.hook";
|
|
285
|
+
export * from './Orch/get/getAuth0ConfigQuery.hook';
|
|
286
|
+
export * from './Orch/get/getMacrosInstancesQuery.hook';
|
|
281
287
|
export * from "./ATIM/BackOffice/get/useEmployeeWorklogDetails.hook";
|
|
282
288
|
export * from "./ATIM/BackOffice/get/useEmployeeQueryHook.hook";
|
|
283
289
|
export * from "./ATIM/BackOffice/get/useStoresQueryHook.hook";
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { BwgExcel } from '../../../interfaces';
|
|
3
|
+
import { postAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export const importABWGQuery = (integrationType: string, bodyType?: string) => {
|
|
8
|
+
const queryClient = useQueryClient();
|
|
9
|
+
return useMutation<string, unknown, BwgExcel>((data: BwgExcel | any) => {
|
|
10
|
+
return postAuth0(`/ABWG/IntegrationRequests?`, {
|
|
11
|
+
pIntegrationType: integrationType,
|
|
12
|
+
}, data, bodyType);
|
|
13
|
+
}, {
|
|
14
|
+
onSuccess: (data: string) => {
|
|
15
|
+
queryClient.setQueryData(
|
|
16
|
+
['INTEGRATION_REQUEST_QUERY'], data);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Auth0Config } from "../../../interfaces";
|
|
3
|
+
import { get } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export const getAuth0ConfigQueryHook = ({...options} : UseQueryOptions) => {
|
|
6
|
+
return useQuery(
|
|
7
|
+
['AUTH0_CONFIG_QUERY', options],
|
|
8
|
+
() => get<Auth0Config>(`/AACP/Authentication/Configuration`),
|
|
9
|
+
options
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { MacroInstance } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
interface MacrosInstancesProps extends Omit<UseQueryOptions<MacroInstance>, "queryKey"> {
|
|
6
|
+
costumerId?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const getMacrosInstancesQueryHook = ({ costumerId, type, ...options }: MacrosInstancesProps) => {
|
|
11
|
+
return useQuery(
|
|
12
|
+
['MACROS_INSTANCES_QUERY', costumerId, type, options],
|
|
13
|
+
() => getAuth0<MacroInstance>(`/ORQ/Instances/Last`, {
|
|
14
|
+
pCustomerId: costumerId || "GNG",
|
|
15
|
+
pType: type || "Product"
|
|
16
|
+
}),
|
|
17
|
+
options
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Permissions } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export const usePermissionIdQueryHook = (Id: string, options?: UseQueryOptions<Permissions, Error>) => {
|
|
6
|
+
return useQuery(
|
|
7
|
+
['PERMISSIONS_ID_QUERY', Id],
|
|
8
|
+
() => getAuth0<Permissions>(`/AACP/Permissions/${Id}`),
|
|
9
|
+
{
|
|
10
|
+
enabled: !!(Id),
|
|
11
|
+
...options,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Permissions, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface PermissionQuery extends UseQueryOptions<ResponseList<"Permissions", Permissions>> {
|
|
6
|
+
tags?: string;
|
|
7
|
+
page?: number;
|
|
8
|
+
records?: number;
|
|
9
|
+
queryField?: string;
|
|
10
|
+
sortBy?: string;
|
|
11
|
+
sortDirection?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const usePermissionsQuery = ({ tags, page, records, queryField, sortBy, sortDirection }: PermissionQuery) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['USER_QUERY', tags, page, records, queryField],
|
|
17
|
+
() => getAuth0<ResponseList<"Permissions", Permissions>>('/AACP/Permissions', {
|
|
18
|
+
pPage: page,
|
|
19
|
+
pRecords: records,
|
|
20
|
+
pSortBy: sortBy,
|
|
21
|
+
pSortDirection: sortDirection ,
|
|
22
|
+
pQuery: queryField
|
|
23
|
+
}),
|
|
24
|
+
{
|
|
25
|
+
keepPreviousData: true,
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Permissions } from '../../../interfaces';
|
|
3
|
+
import { putAuth0, postAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const usePermissionsIdMutateQuery = (bodyType?: string) => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<Permissions, unknown, Permissions>((data: Permissions | any) => {
|
|
8
|
+
return data.Id
|
|
9
|
+
? putAuth0(`/AACP/Permissions/${data.Id}`, undefined, data)
|
|
10
|
+
: postAuth0('/AACP/Permissions', undefined, data);
|
|
11
|
+
}, {
|
|
12
|
+
onSuccess: (data: Permissions) => {
|
|
13
|
+
queryClient.setQueryData(
|
|
14
|
+
['UPDATE_PERMISSIONS_ID_QUERY'], data);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -67,6 +67,9 @@ export * from "./Users/mutate/useSingleUserIdMutateQuery.hook";
|
|
|
67
67
|
export * from "./Users/get/useUserIdQuery.hook";
|
|
68
68
|
export * from "./Users/others/useUserResetPassByEmail.hook";
|
|
69
69
|
export * from "./Users/get/getUserAndSupervisorQuery.hook";
|
|
70
|
+
export * from "./Users/get/usePermissionsQuery.hook";
|
|
71
|
+
export * from "./Users/mutate/useUpdatePermissionsMutateQuery.hook";
|
|
72
|
+
export * from "./Users/get/usePermissionByIdQuery.hook";
|
|
70
73
|
|
|
71
74
|
//Analytics
|
|
72
75
|
export * from "./Analytics/get/useAnalyticsEvaluationCyclesQuery.hook";
|
|
@@ -283,6 +286,7 @@ export * from "./BigWin/others/publishMonthsManagerQuery.hook";
|
|
|
283
286
|
export * from "./BigWin/get/getBwgAllEmployeesQuery.hook";
|
|
284
287
|
export * from "./BigWin/get/getBwgBackOfficeQuery.hook";
|
|
285
288
|
export * from "./BigWin/others/importRegulationQuery.hook";
|
|
289
|
+
export * from "./BigWin/others/importABWGQuery.hook";
|
|
286
290
|
|
|
287
291
|
//OSUA
|
|
288
292
|
export * from "./OSUA/get/documentos/getGngDocumentos.hook";
|
|
@@ -336,6 +340,10 @@ export * from "./ACB/mutate/postClientBalance.hook";
|
|
|
336
340
|
export * from "./ACB/get/getClientBalance.hook";
|
|
337
341
|
export * from "./ACB/mutate/postClientBalance.hook";
|
|
338
342
|
|
|
343
|
+
//Orch
|
|
344
|
+
export * from './Orch/get/getAuth0ConfigQuery.hook'
|
|
345
|
+
export * from './Orch/get/getMacrosInstancesQuery.hook'
|
|
346
|
+
|
|
339
347
|
//BackofficeAtim
|
|
340
348
|
export * from "./ATIM/BackOffice/get/useEmployeeWorklogDetails.hook";
|
|
341
349
|
export * from "./ATIM/BackOffice/get/useEmployeeQueryHook.hook";
|
package/src/interfaces/Bwg.ts
CHANGED
package/src/interfaces/index.ts
CHANGED