@omniumretail/shared-resources 0.3.14 → 0.3.15

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,3 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { FlowExecution } from "../../../interfaces";
3
+ export declare const getFlowExecutionById: (executionId: string, { ...options }: UseQueryOptions<FlowExecution>) => import("@tanstack/react-query").UseQueryResult<FlowExecution, unknown>;
@@ -0,0 +1,3 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { FlowList } from "../../../interfaces";
3
+ export declare const getFlowListById: (flowId: string, { ...options }: UseQueryOptions<FlowList>) => import("@tanstack/react-query").UseQueryResult<FlowList, unknown>;
@@ -0,0 +1,2 @@
1
+ import { FlowList } from '../../../interfaces';
2
+ export declare const deleteFlowConfigurationQuery: () => import("@tanstack/react-query").UseMutationResult<FlowList, unknown, FlowList, unknown>;
@@ -0,0 +1,2 @@
1
+ import { FlowExecution } from '../../../interfaces';
2
+ export declare const runFlowExecutionQuery: () => import("@tanstack/react-query").UseMutationResult<FlowExecution, unknown, FlowExecution, unknown>;
@@ -0,0 +1,2 @@
1
+ import { FlowList } from '../../../interfaces';
2
+ export declare const useFlowConfigurationQuery: (bodyType?: string) => import("@tanstack/react-query").UseMutationResult<FlowList, unknown, FlowList, unknown>;
@@ -0,0 +1,2 @@
1
+ import { FlowExecution } from '../../../interfaces';
2
+ export declare const useFlowExecutionQuery: () => import("@tanstack/react-query").UseMutationResult<FlowExecution, unknown, FlowExecution, unknown>;
@@ -0,0 +1,2 @@
1
+ import { FlowExecution } from '../../../interfaces';
2
+ export declare const validateExecutionFileQuery: (bodyType?: string) => import("@tanstack/react-query").UseMutationResult<FlowExecution, unknown, FlowExecution, unknown>;
@@ -356,6 +356,13 @@ export * from "./ATIM/BackOffice/mutate/useAttendancesById.hook";
356
356
  export * from "./ATIM/BackOffice/mutate/useScheduleMutateQuery.hook";
357
357
  export * from "./Aexp/get/getFlowExecutionQuery.hook";
358
358
  export * from "./Aexp/get/getFlowListQuery.hook";
359
+ export * from "./Aexp/get/getFlowListByIdQuery.hook";
360
+ export * from "./Aexp/get/getFlowExecutionByIdQuery.hook";
361
+ export * from "./Aexp/mutate/deleteFlowConfigurationQuery.hook";
362
+ export * from "./Aexp/mutate/runFlowExecutionQuery.hook";
363
+ export * from "./Aexp/mutate/useFlowConfigurationQuery.hook";
364
+ export * from "./Aexp/mutate/useFlowExecutionQuery.hook";
365
+ export * from "./Aexp/mutate/validateExecutionFileQuery.hook";
359
366
  export * from "./Others/useJobTitlesQuery.hook";
360
367
  export * from "./Others/useContractStatesQuery.hook";
361
368
  export * from "./Others/useApplicationDataQuery.hook";
@@ -12,6 +12,7 @@ export interface FlowList {
12
12
  TimeOutDuration: string;
13
13
  Parameters: Parameter[];
14
14
  State: string;
15
+ IsActive: any;
15
16
  }
16
17
  interface Parameter {
17
18
  Id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.14",
3
+ "version": "0.3.15",
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,13 @@
1
+ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
+ import { FlowExecution } from "../../../interfaces";
3
+ import { getAuth0 } from "../../../services/ApiService";
4
+
5
+ export const getFlowExecutionById = (executionId: string, {...options} : UseQueryOptions<FlowExecution>) => {
6
+ return useQuery(
7
+ ['FLOW_EXECUTION_QUERY', options],
8
+ () => getAuth0<FlowExecution>(`/AEXP/Execution/GetById`, {
9
+ pId: executionId,
10
+ }),
11
+ options
12
+ );
13
+ }
@@ -0,0 +1,13 @@
1
+ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
+ import { FlowList } from "../../../interfaces";
3
+ import { getAuth0 } from "../../../services/ApiService";
4
+
5
+ export const getFlowListById = (flowId: string, {...options} : UseQueryOptions<FlowList>) => {
6
+ return useQuery(
7
+ ['FLOW_QUERY', options],
8
+ () => getAuth0<FlowList>(`/AEXP/FlowConfiguration/GetById`, {
9
+ pId: flowId,
10
+ }),
11
+ options
12
+ );
13
+ }
@@ -0,0 +1,18 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { FlowList } from '../../../interfaces';
3
+ import { putAuth0 } from '../../../services/ApiService';
4
+
5
+ export const deleteFlowConfigurationQuery = () => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<FlowList, unknown, FlowList>((data: FlowList) => {
8
+ return putAuth0(`/AEXP/FlowConfiguration/Deleted?`, {
9
+ pId: data.Id,
10
+ pIsActive: data.IsActive
11
+ }, data)
12
+ }, {
13
+ onSuccess: (data: FlowList) => {
14
+ queryClient.setQueryData(
15
+ ['FLOW_DELETE_QUERY'], data);
16
+ },
17
+ });
18
+ }
@@ -0,0 +1,18 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { FlowExecution } from '../../../interfaces';
3
+ import { postAuth0 } from '../../../services/ApiService';
4
+
5
+ export const runFlowExecutionQuery = () => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<FlowExecution, unknown, FlowExecution>((data: FlowExecution) => {
8
+ return postAuth0('/AEXP/Execution/RunExecution', {
9
+ pExecutionId: data.Id,
10
+ pUserId: data.UserId
11
+ }, data);
12
+ }, {
13
+ onSuccess: (data: FlowExecution) => {
14
+ queryClient.setQueryData(
15
+ ['RUN_FLOW_EXECUTION_QUERY'], data);
16
+ },
17
+ });
18
+ }
@@ -0,0 +1,17 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { FlowList } from '../../../interfaces';
3
+ import { putAuth0, postAuth0 } from '../../../services/ApiService';
4
+
5
+ export const useFlowConfigurationQuery = (bodyType?: string) => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<FlowList, unknown, FlowList>((data: FlowList | any) => {
8
+ return data.Id ?
9
+ putAuth0(`/AEXP/FlowConfiguration`, undefined, data, bodyType) :
10
+ postAuth0('/AEXP/FlowConfiguration', undefined, data, bodyType);
11
+ }, {
12
+ onSuccess: (data: FlowList) => {
13
+ queryClient.setQueryData(
14
+ ['FLOW_CONFIGURATION_QUERY'], data);
15
+ },
16
+ });
17
+ }
@@ -0,0 +1,21 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { FlowExecution } from '../../../interfaces';
3
+ import { putAuth0, postAuth0 } from '../../../services/ApiService';
4
+
5
+ export const useFlowExecutionQuery = () => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<FlowExecution, unknown, FlowExecution>((data: FlowExecution) => {
8
+ return data.Id ?
9
+ putAuth0(`/AEXP/Execution`, undefined, data)
10
+ :
11
+ postAuth0('/AEXP/Execution', {
12
+ pUserId: data.UserId,
13
+ pFlowId: data.FlowId
14
+ }, data);
15
+ }, {
16
+ onSuccess: (data: FlowExecution) => {
17
+ queryClient.setQueryData(
18
+ ['FLOW_EXECUTION_QUERY'], data);
19
+ },
20
+ });
21
+ }
@@ -0,0 +1,15 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { FlowExecution } from '../../../interfaces';
3
+ import { postAuth0 } from '../../../services/ApiService';
4
+
5
+ export const validateExecutionFileQuery = (bodyType?: string) => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<FlowExecution, unknown, FlowExecution>((data: FlowExecution | any) => {
8
+ return postAuth0('/AEXP/Execution/FileValidation', undefined, data, bodyType);
9
+ }, {
10
+ onSuccess: (data: FlowExecution) => {
11
+ queryClient.setQueryData(
12
+ ['VALIDATE_EXECUTION_FILE_QUERY'], data);
13
+ },
14
+ });
15
+ }
@@ -419,6 +419,13 @@ export * from "./ATIM/BackOffice/mutate/useScheduleMutateQuery.hook";
419
419
  //Aexp
420
420
  export * from "./Aexp/get/getFlowExecutionQuery.hook";
421
421
  export * from "./Aexp/get/getFlowListQuery.hook";
422
+ export * from "./Aexp/get/getFlowListByIdQuery.hook";
423
+ export * from "./Aexp/get/getFlowExecutionByIdQuery.hook";
424
+ export * from "./Aexp/mutate/deleteFlowConfigurationQuery.hook";
425
+ export * from "./Aexp/mutate/runFlowExecutionQuery.hook";
426
+ export * from "./Aexp/mutate/useFlowConfigurationQuery.hook";
427
+ export * from "./Aexp/mutate/useFlowExecutionQuery.hook";
428
+ export * from "./Aexp/mutate/validateExecutionFileQuery.hook";
422
429
 
423
430
  //Others
424
431
  export * from "./Others/useJobTitlesQuery.hook";
@@ -12,6 +12,7 @@ export interface FlowList {
12
12
  TimeOutDuration: string;
13
13
  Parameters: Parameter[];
14
14
  State: string;
15
+ IsActive;
15
16
  }
16
17
 
17
18
  interface Parameter {