@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.
- package/dist/bundle.js +1 -1
- package/dist/types/hooks/Aexp/get/getFlowExecutionByIdQuery.hook.d.ts +3 -0
- package/dist/types/hooks/Aexp/get/getFlowListByIdQuery.hook.d.ts +3 -0
- package/dist/types/hooks/Aexp/mutate/deleteFlowConfigurationQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Aexp/mutate/runFlowExecutionQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Aexp/mutate/useFlowConfigurationQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Aexp/mutate/useFlowExecutionQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Aexp/mutate/validateExecutionFileQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +7 -0
- package/dist/types/interfaces/FlowList.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Aexp/get/getFlowExecutionByIdQuery.hook.ts +13 -0
- package/src/hooks/Aexp/get/getFlowListByIdQuery.hook.ts +13 -0
- package/src/hooks/Aexp/mutate/deleteFlowConfigurationQuery.hook.ts +18 -0
- package/src/hooks/Aexp/mutate/runFlowExecutionQuery.hook.ts +18 -0
- package/src/hooks/Aexp/mutate/useFlowConfigurationQuery.hook.ts +17 -0
- package/src/hooks/Aexp/mutate/useFlowExecutionQuery.hook.ts +21 -0
- package/src/hooks/Aexp/mutate/validateExecutionFileQuery.hook.ts +15 -0
- package/src/hooks/index.ts +7 -0
- package/src/interfaces/FlowList.ts +1 -0
|
@@ -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>;
|
|
@@ -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";
|
package/package.json
CHANGED
|
@@ -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
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -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";
|