@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.
@@ -0,0 +1,2 @@
1
+ import { BwgExcel } from '../../../interfaces';
2
+ export declare const importABWGQuery: (integrationType: string, bodyType?: string) => import("@tanstack/react-query").UseMutationResult<string, unknown, BwgExcel, unknown>;
@@ -0,0 +1,2 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ export declare const getAuth0ConfigQueryHook: ({ ...options }: UseQueryOptions) => import("@tanstack/react-query").UseQueryResult<unknown, unknown>;
@@ -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>;
@@ -0,0 +1,2 @@
1
+ import { Permissions } from '../../../interfaces';
2
+ export declare const usePermissionsIdMutateQuery: (bodyType?: string) => import("@tanstack/react-query").UseMutationResult<Permissions, unknown, 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";
@@ -0,0 +1,5 @@
1
+ export interface Auth0Config {
2
+ Auth0ClientId: string;
3
+ Audience: string;
4
+ TenantDomain: string;
5
+ }
@@ -15,3 +15,7 @@ export interface BwgFile {
15
15
  Country: string;
16
16
  File: any;
17
17
  }
18
+ export interface BwgExcel {
19
+ pIntegrationType: string;
20
+ pCSVDocument: any;
21
+ }
@@ -0,0 +1,10 @@
1
+ export interface MacroInstance {
2
+ Id: string;
3
+ UserId: string;
4
+ MacroId: string;
5
+ Type: string;
6
+ State: string;
7
+ CreateDate: number;
8
+ UpdateDate: number;
9
+ Status: string;
10
+ }
@@ -0,0 +1,8 @@
1
+ export interface Permissions {
2
+ Id: string;
3
+ RoleName: string;
4
+ Permission: string;
5
+ Description: string;
6
+ Status: string;
7
+ Tags: string[];
8
+ }
@@ -63,3 +63,6 @@ export * from './Bwg';
63
63
  export * from './ReasonCodes';
64
64
  export * from './BellNotification';
65
65
  export * from './VacationPlan';
66
+ export * from './Permissions';
67
+ export * from './Auth0Config';
68
+ export * from './MacroInstance';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.2.76",
3
+ "version": "0.2.78",
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,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
+ }
@@ -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";
@@ -0,0 +1,6 @@
1
+
2
+ export interface Auth0Config {
3
+ Auth0ClientId: string;
4
+ Audience: string;
5
+ TenantDomain: string;
6
+ }
@@ -17,3 +17,9 @@ export interface BwgFile {
17
17
  Country: string;
18
18
  File: any;
19
19
  }
20
+
21
+ export interface BwgExcel {
22
+ pIntegrationType: string;
23
+ pCSVDocument: any;
24
+ }
25
+
@@ -0,0 +1,11 @@
1
+
2
+ export interface MacroInstance {
3
+ Id: string;
4
+ UserId: string;
5
+ MacroId: string;
6
+ Type: string;
7
+ State: string;
8
+ CreateDate: number;
9
+ UpdateDate: number;
10
+ Status: string;
11
+ }
@@ -0,0 +1,8 @@
1
+ export interface Permissions {
2
+ Id: string;
3
+ RoleName: string;
4
+ Permission: string;
5
+ Description: string;
6
+ Status: string;
7
+ Tags: string[];
8
+ }
@@ -63,3 +63,6 @@ export * from './Bwg';
63
63
  export * from './ReasonCodes';
64
64
  export * from './BellNotification';
65
65
  export * from './VacationPlan';
66
+ export * from './Permissions';
67
+ export * from './Auth0Config';
68
+ export * from './MacroInstance';