@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.
@@ -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 {};
@@ -0,0 +1,2 @@
1
+ import { AnotInterface } from '../../../interfaces/Anot';
2
+ export declare const createNotificationTypeQuery: () => import("@tanstack/react-query").UseMutationResult<AnotInterface, unknown, AnotInterface, unknown>;
@@ -0,0 +1,2 @@
1
+ import { AnotInterface } from '../../../interfaces/Anot';
2
+ export declare const editNotificationTypeQuery: () => import("@tanstack/react-query").UseMutationResult<AnotInterface, unknown, AnotInterface, unknown>;
@@ -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
+ }
@@ -78,3 +78,4 @@ export * from './CustomerHistory';
78
78
  export * from './CustomerVoucher';
79
79
  export * from './AsttReconciliationDocuments';
80
80
  export * from './ASAECustomer';
81
+ export * from './Anot';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.69",
3
+ "version": "0.3.70",
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,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
+ }
@@ -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
+ }
@@ -78,3 +78,4 @@ export * from './CustomerHistory';
78
78
  export * from './CustomerVoucher';
79
79
  export * from './AsttReconciliationDocuments';
80
80
  export * from './ASAECustomer';
81
+ export * from './Anot';