@omniumretail/shared-resources 0.3.69 → 0.3.70
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/Anot/get/getNotificationsTypeQuery.hook.d.ts +12 -0
- package/dist/types/hooks/Anot/mutate/createNotificationTypeQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Anot/mutate/editNotificationTypeQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +6 -3
- package/dist/types/interfaces/Anot.d.ts +23 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Anot/get/getNotificationsTypeQuery.hook.ts +27 -0
- package/src/hooks/Anot/mutate/createNotificationTypeQuery.hook.ts +15 -0
- package/src/hooks/Anot/mutate/editNotificationTypeQuery.hook.ts +15 -0
- package/src/hooks/index.ts +10 -6
- package/src/interfaces/Anot.ts +25 -0
- package/src/interfaces/index.ts +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AnotInterface, ResponseList } from "../../../interfaces";
|
|
3
|
+
interface NotificationsTypeProps extends Omit<UseQueryOptions<ResponseList<"NotificationTypes", AnotInterface>>, "queryKey"> {
|
|
4
|
+
page: number;
|
|
5
|
+
records: number;
|
|
6
|
+
sortBy: string;
|
|
7
|
+
sortDirection: string;
|
|
8
|
+
terms?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getNotificationsTypeQuery: ({ page, records, sortBy, sortDirection, terms, query, ...options }: NotificationsTypeProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"NotificationTypes", AnotInterface>, unknown>;
|
|
12
|
+
export {};
|
|
@@ -394,6 +394,12 @@ export * from "./Aexp/mutate/useFlowExecutionQuery.hook";
|
|
|
394
394
|
export * from "./Aexp/mutate/validateExecutionFileQuery.hook";
|
|
395
395
|
export * from "./Aexp/mutate/inactivateFlowConfigurationQuery.hook";
|
|
396
396
|
export * from "./Aexp/get/getTagsFlowQuery.hook";
|
|
397
|
+
export * from "./ASAEGNG/get/getCustomerHistoryQuery.hook";
|
|
398
|
+
export * from "./ASAEGNG/get/getCustomerVouchersQuery.hook";
|
|
399
|
+
export * from "./ASAEGNG/get/getCustomersQuery.hook";
|
|
400
|
+
export * from "./Anot/get/getNotificationsTypeQuery.hook";
|
|
401
|
+
export * from "./Anot/mutate/createNotificationTypeQuery.hook";
|
|
402
|
+
export * from "./Anot/mutate/editNotificationTypeQuery.hook";
|
|
397
403
|
export * from "./Others/useJobTitlesQuery.hook";
|
|
398
404
|
export * from "./Others/useContractStatesQuery.hook";
|
|
399
405
|
export * from "./Others/useApplicationDataQuery.hook";
|
|
@@ -421,6 +427,3 @@ export * from "./Others/Vacation/get/getVacationTemplateQuery.hook";
|
|
|
421
427
|
export * from "./Others/changePasswordQuery.hook";
|
|
422
428
|
export * from "./Others/unblockUserQuery.hook";
|
|
423
429
|
export * from "./Others/oneSignalUserQuery.hook";
|
|
424
|
-
export * from "./ASAEGNG/get/getCustomerHistoryQuery.hook";
|
|
425
|
-
export * from "./ASAEGNG/get/getCustomerVouchersQuery.hook";
|
|
426
|
-
export * from "./ASAEGNG/get/getCustomersQuery.hook";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface AnotInterface {
|
|
2
|
+
Id: string;
|
|
3
|
+
OperationName: string;
|
|
4
|
+
ExpirationDays: number;
|
|
5
|
+
Application: string;
|
|
6
|
+
RedirectURL: string;
|
|
7
|
+
Icon: string;
|
|
8
|
+
Status: string;
|
|
9
|
+
CreateDate: number;
|
|
10
|
+
UpdateDate: number;
|
|
11
|
+
Criticality: CriticalityInterface;
|
|
12
|
+
NotificationContents: NotificationContentsInterface[];
|
|
13
|
+
}
|
|
14
|
+
export interface CriticalityInterface {
|
|
15
|
+
Id: string;
|
|
16
|
+
Name: string;
|
|
17
|
+
ColorHex: string;
|
|
18
|
+
}
|
|
19
|
+
export interface NotificationContentsInterface {
|
|
20
|
+
Title: string;
|
|
21
|
+
Description: string;
|
|
22
|
+
LanguageISO2: string;
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AnotInterface, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
interface NotificationsTypeProps extends Omit<UseQueryOptions<ResponseList<"NotificationTypes", AnotInterface>>, "queryKey"> {
|
|
6
|
+
page: number;
|
|
7
|
+
records: number;
|
|
8
|
+
sortBy: string;
|
|
9
|
+
sortDirection: string;
|
|
10
|
+
terms?: string;
|
|
11
|
+
query?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getNotificationsTypeQuery = ({ page, records, sortBy, sortDirection, terms, query, ...options }: NotificationsTypeProps) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['NOTIFICATIONS_TYPE_QUERY', page, records, sortBy, sortDirection, terms, query, options],
|
|
17
|
+
() => getAuth0<ResponseList<"NotificationTypes", AnotInterface>>(`/ANOT/NotificationTypes?pPage=1&pRecords=10&pSortBy=Name&pSortDirection=asc`, {
|
|
18
|
+
pPage: page || 1,
|
|
19
|
+
pRecords: records || 50,
|
|
20
|
+
pSortBy: sortBy || "Name",
|
|
21
|
+
pSortDirection: sortDirection || "asc",
|
|
22
|
+
pTerms: terms || "",
|
|
23
|
+
pQuery: query || ""
|
|
24
|
+
}),
|
|
25
|
+
options
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { postAuth0 } from '../../../services/ApiService';
|
|
3
|
+
import { AnotInterface } from '../../../interfaces/Anot';
|
|
4
|
+
|
|
5
|
+
export const createNotificationTypeQuery = () => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<AnotInterface, unknown, AnotInterface>((data: AnotInterface) => {
|
|
8
|
+
return postAuth0('/ANOT/NotificationTypes', undefined, data);
|
|
9
|
+
}, {
|
|
10
|
+
onSuccess: (data: AnotInterface) => {
|
|
11
|
+
queryClient.setQueryData(
|
|
12
|
+
['CREATE_NOTIFICATION_TYPE_QUERY'], data);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { putAuth0 } from '../../../services/ApiService';
|
|
3
|
+
import { AnotInterface } from '../../../interfaces/Anot';
|
|
4
|
+
|
|
5
|
+
export const editNotificationTypeQuery = () => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<AnotInterface, unknown, AnotInterface>((data: AnotInterface) => {
|
|
8
|
+
return putAuth0(`/ANOT/NotificationTypes/${data.Id}`, undefined, data);
|
|
9
|
+
}, {
|
|
10
|
+
onSuccess: (data: AnotInterface) => {
|
|
11
|
+
queryClient.setQueryData(
|
|
12
|
+
['EDIT_NOTIFICATION_TYPE_QUERY'], data);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -460,6 +460,16 @@ export * from "./Aexp/mutate/validateExecutionFileQuery.hook";
|
|
|
460
460
|
export * from "./Aexp/mutate/inactivateFlowConfigurationQuery.hook";
|
|
461
461
|
export * from "./Aexp/get/getTagsFlowQuery.hook";
|
|
462
462
|
|
|
463
|
+
//ASAEGNG
|
|
464
|
+
export * from "./ASAEGNG/get/getCustomerHistoryQuery.hook";
|
|
465
|
+
export * from "./ASAEGNG/get/getCustomerVouchersQuery.hook";
|
|
466
|
+
export * from "./ASAEGNG/get/getCustomersQuery.hook";
|
|
467
|
+
|
|
468
|
+
//ANOT
|
|
469
|
+
export * from "./Anot/get/getNotificationsTypeQuery.hook";
|
|
470
|
+
export * from "./Anot/mutate/createNotificationTypeQuery.hook";
|
|
471
|
+
export * from "./Anot/mutate/editNotificationTypeQuery.hook";
|
|
472
|
+
|
|
463
473
|
//Others
|
|
464
474
|
export * from "./Others/useJobTitlesQuery.hook";
|
|
465
475
|
export * from "./Others/useContractStatesQuery.hook";
|
|
@@ -488,9 +498,3 @@ export * from "./Others/Vacation/get/getVacationTemplateQuery.hook";
|
|
|
488
498
|
export * from "./Others/changePasswordQuery.hook";
|
|
489
499
|
export * from "./Others/unblockUserQuery.hook";
|
|
490
500
|
export * from "./Others/oneSignalUserQuery.hook";
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
//ASAEGNG
|
|
494
|
-
export * from "./ASAEGNG/get/getCustomerHistoryQuery.hook";
|
|
495
|
-
export * from "./ASAEGNG/get/getCustomerVouchersQuery.hook";
|
|
496
|
-
export * from "./ASAEGNG/get/getCustomersQuery.hook";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface AnotInterface {
|
|
2
|
+
Id: string;
|
|
3
|
+
OperationName: string;
|
|
4
|
+
ExpirationDays: number;
|
|
5
|
+
Application: string;
|
|
6
|
+
RedirectURL: string;
|
|
7
|
+
Icon: string;
|
|
8
|
+
Status: string;
|
|
9
|
+
CreateDate: number;
|
|
10
|
+
UpdateDate: number;
|
|
11
|
+
Criticality: CriticalityInterface;
|
|
12
|
+
NotificationContents: NotificationContentsInterface[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CriticalityInterface {
|
|
16
|
+
Id: string;
|
|
17
|
+
Name: string;
|
|
18
|
+
ColorHex: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface NotificationContentsInterface {
|
|
22
|
+
Title: string;
|
|
23
|
+
Description: string;
|
|
24
|
+
LanguageISO2: string;
|
|
25
|
+
}
|
package/src/interfaces/index.ts
CHANGED