@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.
- package/dist/bundle.js +1 -1
- package/dist/types/hooks/Others/getBellNotificationsQuery.hook.d.ts +13 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/interfaces/BellNotification.d.ts +15 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Others/getBellNotificationsQuery.hook.ts +28 -0
- package/src/hooks/index.ts +1 -0
- package/src/interfaces/BellNotification.ts +17 -0
- package/src/interfaces/index.ts +1 -0
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -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
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -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
|
+
|
package/src/interfaces/index.ts
CHANGED