@omniumretail/shared-resources 0.2.66 → 0.2.68

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,13 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { BellNotification, ResponseList } from "../../interfaces";
3
+ interface BellNotificationProps extends Omit<UseQueryOptions<ResponseList<"Notifications", BellNotification>>, "queryKey"> {
4
+ page?: number;
5
+ records?: number;
6
+ sortBy?: string;
7
+ sortDirection?: string;
8
+ query?: string;
9
+ language?: string;
10
+ userId: string;
11
+ }
12
+ export declare const getBellNotificationQueryHook: ({ page, records, sortBy, sortDirection, query, language, userId, ...options }: BellNotificationProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Notifications", BellNotification>, unknown>;
13
+ export {};
@@ -311,3 +311,4 @@ export * from "./Others/getRegulationQuery.hook";
311
311
  export * from "./Others/useRegulationQuery.hook";
312
312
  export * from "./Others/postUserAuthenticationQuery.hook";
313
313
  export * from "./Others//editFieldsByBulkQuery.hook";
314
+ export * from "./Others/getBellNotificationsQuery.hook";
@@ -0,0 +1,15 @@
1
+ export interface Criticality {
2
+ Id: string;
3
+ Name: string;
4
+ ColorHex: string;
5
+ }
6
+ export interface BellNotification {
7
+ Id: string;
8
+ Title: string;
9
+ Description: string;
10
+ RedirectURL: string;
11
+ Icon: string;
12
+ ExpirationDate: number;
13
+ Criticality: Criticality;
14
+ IsRead: boolean;
15
+ }
@@ -61,3 +61,4 @@ export * from './Bulk';
61
61
  export * from './AttendanceIssues';
62
62
  export * from './Bwg';
63
63
  export * from './ReasonCodes';
64
+ export * from './BellNotification';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.2.66",
3
+ "version": "0.2.68",
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,28 @@
1
+ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
+ import { BellNotification, ResponseList } from "../../interfaces";
3
+ import { getAuth0 } from "../../services/ApiService";
4
+
5
+ interface BellNotificationProps extends Omit<UseQueryOptions<ResponseList<"Notifications", BellNotification>>, "queryKey"> {
6
+ page?: number;
7
+ records?: number;
8
+ sortBy?: string;
9
+ sortDirection?: string;
10
+ query?: string;
11
+ language?: string;
12
+ userId: string;
13
+ }
14
+
15
+ export const getBellNotificationQueryHook = ({ page, records, sortBy, sortDirection, query, language, userId, ...options }: BellNotificationProps) => {
16
+ return useQuery(
17
+ ['BELL_NOTIFICATION_QUERY', page, records, sortBy, sortDirection, query, language, userId, options],
18
+ () => getAuth0<ResponseList<"Notifications", BellNotification>>(`/ANOT/Notifications/${userId}`, {
19
+ pPage: page || 1,
20
+ pRecords: records || 50,
21
+ pSortBy: sortBy || "Name",
22
+ pSortDirection: sortDirection || "asc",
23
+ pQuery: query || "",
24
+ pLanguage: language || "PT"
25
+ }),
26
+ options
27
+ );
28
+ }
@@ -373,3 +373,4 @@ export * from "./Others/getRegulationQuery.hook";
373
373
  export * from "./Others/useRegulationQuery.hook";
374
374
  export * from "./Others/postUserAuthenticationQuery.hook";
375
375
  export * from "./Others//editFieldsByBulkQuery.hook";
376
+ export * from "./Others/getBellNotificationsQuery.hook";
@@ -0,0 +1,17 @@
1
+ export interface Criticality {
2
+ Id: string;
3
+ Name: string;
4
+ ColorHex: string;
5
+ }
6
+
7
+ export interface BellNotification {
8
+ Id: string;
9
+ Title: string;
10
+ Description: string;
11
+ RedirectURL: string;
12
+ Icon: string;
13
+ ExpirationDate: number;
14
+ Criticality: Criticality;
15
+ IsRead: boolean;
16
+ }
17
+
@@ -61,3 +61,4 @@ export * from './Bulk';
61
61
  export * from './AttendanceIssues';
62
62
  export * from './Bwg';
63
63
  export * from './ReasonCodes';
64
+ export * from './BellNotification';