@omniumretail/shared-resources 0.2.11 → 0.2.13
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/OSUA/get/documentos/getSitooDocumentos.hook.d.ts +2 -1
- package/dist/types/hooks/OSUA/mutate/postCreateIntegrationRequest.hook.d.ts +9 -1
- package/dist/types/hooks/index.d.ts +0 -1
- package/package.json +1 -1
- package/src/hooks/OSUA/get/documentos/getSitooDocumentos.hook.ts +7 -5
- package/src/hooks/OSUA/mutate/postCreateIntegrationRequest.hook.ts +14 -7
- package/src/hooks/index.ts +0 -1
- package/src/hooks/OSUA/get/documentos/getDocumentIntegrationRequestStatus.hook.ts +0 -22
|
@@ -3,6 +3,7 @@ import { ResponseList, SitooDocumentoResponse } from '../../../../interfaces';
|
|
|
3
3
|
interface GetSitooDocumentosProps extends UseQueryOptions<ResponseList<"SitooDocumentos", SitooDocumentoResponse>> {
|
|
4
4
|
fields?: string;
|
|
5
5
|
externalid?: string;
|
|
6
|
+
num?: number;
|
|
6
7
|
}
|
|
7
|
-
export declare const getSitooDocumentos: ({ fields, externalid }: GetSitooDocumentosProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"SitooDocumentos", SitooDocumentoResponse>, unknown>;
|
|
8
|
+
export declare const getSitooDocumentos: ({ fields, externalid, num }: GetSitooDocumentosProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"SitooDocumentos", SitooDocumentoResponse>, unknown>;
|
|
8
9
|
export {};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
1
2
|
import { IntegrationRequestStatus } from '../../../interfaces';
|
|
2
|
-
|
|
3
|
+
interface PostCreateIntegrationRequestProps extends UseQueryOptions<IntegrationRequestStatus> {
|
|
4
|
+
integrationType?: string;
|
|
5
|
+
sourcePlatformId?: string;
|
|
6
|
+
destinations?: string;
|
|
7
|
+
query?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const postCreateIntegrationRequest: ({ integrationType, sourcePlatformId, destinations, query }: PostCreateIntegrationRequestProps) => import("@tanstack/react-query").UseMutationResult<IntegrationRequestStatus, unknown, IntegrationRequestStatus, unknown>;
|
|
10
|
+
export {};
|
|
@@ -112,7 +112,6 @@ export * from './BigWin/others/publishMonthsEmployeeQuery.hook';
|
|
|
112
112
|
export * from './BigWin/others/publishMonthsManagerQuery.hook';
|
|
113
113
|
export * from './OSUA/get/documentos/getGngDocumentos.hook';
|
|
114
114
|
export * from './OSUA/get/documentos/getSitooDocumentos.hook';
|
|
115
|
-
export * from './OSUA/get/documentos/getDocumentIntegrationRequestStatus.hook';
|
|
116
115
|
export * from './OSUA/get/vouchers/getGngVoucher.hook';
|
|
117
116
|
export * from './OSUA/get/vouchers/getSitooVouchers.hook';
|
|
118
117
|
export * from './OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook';
|
package/package.json
CHANGED
|
@@ -5,14 +5,16 @@ import { ResponseList, SitooDocumentoResponse } from '../../../../interfaces';
|
|
|
5
5
|
interface GetSitooDocumentosProps extends UseQueryOptions<ResponseList<"SitooDocumentos", SitooDocumentoResponse>> {
|
|
6
6
|
fields?: string;
|
|
7
7
|
externalid?: string;
|
|
8
|
+
num?: number;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export const getSitooDocumentos = ({ fields, externalid}: GetSitooDocumentosProps) => {
|
|
11
|
+
export const getSitooDocumentos = ({ fields, externalid, num}: GetSitooDocumentosProps) => {
|
|
11
12
|
return useQuery(
|
|
12
|
-
['SITOO_DOCUMENTOS', fields, externalid],
|
|
13
|
-
() => get<ResponseList<"SitooDocumentos", SitooDocumentoResponse>>('/
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
['SITOO_DOCUMENTOS', fields, externalid, num],
|
|
14
|
+
() => get<ResponseList<"SitooDocumentos", SitooDocumentoResponse>>('/Sitoo/Orders', {
|
|
15
|
+
pFields: fields || "externalid,orderid",
|
|
16
|
+
pExternalid: externalid ,
|
|
17
|
+
pNum: num
|
|
16
18
|
}),
|
|
17
19
|
{
|
|
18
20
|
keepPreviousData: true,
|
|
@@ -4,15 +4,22 @@ import { useMutation, useQueryClient, UseQueryOptions } from '@tanstack/react-qu
|
|
|
4
4
|
import { IntegrationRequestStatus } from '../../../interfaces';
|
|
5
5
|
import { postWithParameters } from "../../../services/ApiService";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
interface PostCreateIntegrationRequestProps extends UseQueryOptions<IntegrationRequestStatus> {
|
|
8
|
+
integrationType?: string;
|
|
9
|
+
sourcePlatformId?: string;
|
|
10
|
+
destinations?: string;
|
|
11
|
+
query?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const postCreateIntegrationRequest = ({integrationType, sourcePlatformId, destinations, query}: PostCreateIntegrationRequestProps) => {
|
|
8
15
|
const queryClient = useQueryClient();
|
|
9
|
-
return useMutation<IntegrationRequestStatus, unknown, IntegrationRequestStatus>((
|
|
16
|
+
return useMutation<IntegrationRequestStatus, unknown, IntegrationRequestStatus>(() => {
|
|
10
17
|
return postWithParameters('/Document/IntegrationRequests', {
|
|
11
|
-
pIntegrationType:
|
|
12
|
-
pSourcePlatformId:
|
|
13
|
-
pDestinations:
|
|
14
|
-
pQuery:
|
|
15
|
-
}
|
|
18
|
+
pIntegrationType: integrationType ,
|
|
19
|
+
pSourcePlatformId: sourcePlatformId ,
|
|
20
|
+
pDestinations: destinations,
|
|
21
|
+
pQuery: query,
|
|
22
|
+
});
|
|
16
23
|
}, {
|
|
17
24
|
onSuccess: (data: IntegrationRequestStatus) => {
|
|
18
25
|
queryClient.setQueryData(['CREATE_INTEGRATION_REQUEST'], data);
|
package/src/hooks/index.ts
CHANGED
|
@@ -149,7 +149,6 @@ export * from './BigWin/others/publishMonthsManagerQuery.hook';
|
|
|
149
149
|
//OSUA
|
|
150
150
|
export * from './OSUA/get/documentos/getGngDocumentos.hook';
|
|
151
151
|
export * from './OSUA/get/documentos/getSitooDocumentos.hook';
|
|
152
|
-
export * from './OSUA/get/documentos/getDocumentIntegrationRequestStatus.hook';
|
|
153
152
|
|
|
154
153
|
export * from './OSUA/get/vouchers/getGngVoucher.hook';
|
|
155
154
|
export * from './OSUA/get/vouchers/getSitooVouchers.hook';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import { get } from "../../../../services/ApiService";
|
|
3
|
-
import { IntegrationRequestStatus } from '../../../../interfaces';
|
|
4
|
-
|
|
5
|
-
interface GetDocumentIntegrationRequestStatusProps extends UseQueryOptions<IntegrationRequestStatus> {
|
|
6
|
-
pIntegrationType?: string;
|
|
7
|
-
pSourcePlatformId?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const getDocumentIntegrationRequestStatus = ({ pIntegrationType, pSourcePlatformId }: GetDocumentIntegrationRequestStatusProps) => {
|
|
11
|
-
return useQuery(
|
|
12
|
-
['INTEGRATION_REQUEST_STATUS', pIntegrationType, pSourcePlatformId],
|
|
13
|
-
() => get<IntegrationRequestStatus>('/Document/IntegrationRequests/latestIntegration', {
|
|
14
|
-
pIntegrationType: pIntegrationType,
|
|
15
|
-
pSourcePlatformId: pSourcePlatformId
|
|
16
|
-
}),
|
|
17
|
-
{
|
|
18
|
-
keepPreviousData: true,
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
}
|