@savantlink/sdk 2.2.29 → 2.2.30
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/context/NotificationProvider.d.ts +3 -2
- package/dist/context/NotificationProvider.d.ts.map +1 -1
- package/dist/context/NotificationProvider.js +1 -1
- package/dist/context/NotificationProvider.js.map +1 -1
- package/dist/hooks/use-notification-stream.d.ts +3 -1
- package/dist/hooks/use-notification-stream.d.ts.map +1 -1
- package/dist/hooks/use-notification-stream.js +1 -1
- package/dist/hooks/use-notification-stream.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { Notification } from "../hooks/use-notification-stream";
|
|
2
|
+
import type { Notification, NotificationAuthClient } from "../hooks/use-notification-stream";
|
|
3
3
|
export declare type NotificationContextValue = {
|
|
4
4
|
notifications: Notification[];
|
|
5
5
|
unreadCount: number;
|
|
@@ -10,10 +10,11 @@ export declare type NotificationContextValue = {
|
|
|
10
10
|
export declare type NotificationProviderProps = {
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
baseAPIUrl: string;
|
|
13
|
+
authClient?: NotificationAuthClient;
|
|
13
14
|
notificationsData: Notification[];
|
|
14
15
|
markNotificationAsRead: (id: string) => void;
|
|
15
16
|
markAllNotificationsAsRead: () => void;
|
|
16
17
|
};
|
|
17
|
-
export declare const NotificationProvider: ({ children, notificationsData, markNotificationAsRead, markAllNotificationsAsRead, baseAPIUrl, }: NotificationProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const NotificationProvider: ({ children, notificationsData, markNotificationAsRead, markAllNotificationsAsRead, baseAPIUrl, authClient, }: NotificationProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export declare const useNotifications: () => NotificationContextValue;
|
|
19
20
|
//# sourceMappingURL=NotificationProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationProvider.d.ts","sourceRoot":"","sources":["../../src/context/NotificationProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAStC,OAAO,KAAK,EAAE,YAAY,EAAE,yCAAuC;
|
|
1
|
+
{"version":3,"file":"NotificationProvider.d.ts","sourceRoot":"","sources":["../../src/context/NotificationProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAStC,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,yCAAuC;AAI3F,oBAAY,wBAAwB,GAAG;IACrC,aAAa,EAAE,YAAY,EAAE,CAAA;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;IACpB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,oBAAoB,EAAE,MAAM,IAAI,CAAA;CACjC,CAAA;AAED,oBAAY,yBAAyB,GAAG;IACtC,QAAQ,EAAE,SAAS,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,sBAAsB,CAAA;IACnC,iBAAiB,EAAE,YAAY,EAAE,CAAA;IACjC,sBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,0BAA0B,EAAE,MAAM,IAAI,CAAA;CACvC,CAAA;AAID,eAAO,MAAM,oBAAoB,iHAO9B,yBAAyB,4CAoH3B,CAAA;AAED,eAAO,MAAM,gBAAgB,gCAQ5B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../hooks/use-notification-stream.js"),o=require("../hooks/use-sound.js");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../hooks/use-notification-stream.js"),o=require("../hooks/use-sound.js");const a=t.createContext(void 0);exports.NotificationProvider=({children:r,notificationsData:n,markNotificationAsRead:s,markAllNotificationsAsRead:c,baseAPIUrl:u,authClient:d="dashboard"})=>{const[l,f]=t.useState([]),[h,m]=t.useState(new Set),{playNotificationSound:C}=o.default(),N=t.useCallback(e=>{f(t=>t.some(t=>t.id===e.id)?t:[e,...t]),C()},[C]),{isConnected:b}=i.default({baseAPIUrl:u,authClient:d,onNotification:N}),v=t.useMemo(()=>{const e=null!=n?n:[],t=new Map;for(const i of[...l,...e])h.has(i.id)||t.set(i.id,i);return Array.from(t.values()).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())},[l,n,h]),w=v.length,A=t.useCallback(e=>{m(t=>{const i=new Set(t);return i.add(e),i}),s(e)},[s]),k=t.useCallback(()=>{const e=v.map(e=>e.id);m(t=>{const i=new Set(t);return e.forEach(e=>i.add(e)),i}),c()},[v,c]);return e.jsx(a.Provider,Object.assign({value:{notifications:v,unreadCount:w,isConnected:b,readNotification:A,readAllNotifications:k}},{children:r}),void 0)},exports.useNotifications=()=>{const e=t.useContext(a);if(!e)throw new Error("useNotifications must be used within NotificationProvider");return e};
|
|
2
2
|
//# sourceMappingURL=NotificationProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationProvider.js","sources":["../../src/context/NotificationProvider.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useMemo, useState } from 'react'\nimport type { ReactNode } from 'react'\n\n// import { useNotificationStream } from \"@/hooks/useNotificationStream\";\n// import {\n// useGetNotifications,\n// useReadAllNotification,\n// useReadNotification,\n// } from \"@/hooks/apis/notifications\";\n\nimport type { Notification } from '@/hooks/use-notification-stream'\nimport useNotificationStream from '@/hooks/use-notification-stream'\nimport useSound from '@/hooks/use-sound'\n\nexport type NotificationContextValue = {\n notifications: Notification[]\n unreadCount: number\n isConnected: boolean\n readNotification: (id: string) => void\n readAllNotifications: () => void\n}\n\nexport type NotificationProviderProps = {\n children: ReactNode\n baseAPIUrl: string\n notificationsData: Notification[]\n markNotificationAsRead: (id: string) => void\n markAllNotificationsAsRead: () => void\n}\n\nconst NotificationContext = createContext<NotificationContextValue | undefined>(undefined)\n\nexport const NotificationProvider = ({\n children,\n notificationsData,\n markNotificationAsRead,\n markAllNotificationsAsRead,\n baseAPIUrl,\n}: NotificationProviderProps) => {\n /**\n * Notifications received during the current SSE session.\n */\n const [realtimeNotifications, setRealtimeNotifications] = useState<Notification[]>([])\n\n /**\n * Allows us to optimistically hide notifications immediately\n * without waiting for the notifications query to refetch.\n */\n const [readNotificationIds, setReadNotificationIds] = useState<Set<string>>(new Set())\n\n const { playNotificationSound } = useSound()\n const handleNotification = useCallback(\n (notification: Notification) => {\n setRealtimeNotifications((current) => {\n /**\n * Protect against the same SSE notification being\n * received more than once.\n */\n if (current.some((item) => item.id === notification.id)) {\n return current\n }\n\n return [notification, ...current]\n })\n\n playNotificationSound()\n },\n [playNotificationSound]\n )\n\n const { isConnected } = useNotificationStream({\n baseAPIUrl,\n onNotification: handleNotification,\n })\n\n /**\n * Merge:\n *\n * 1. Newly received SSE notifications\n * 2. Persisted notifications returned by the API\n *\n * Map prevents duplicates when an SSE notification later\n * appears in a query/refetch response.\n */\n const notifications = useMemo(() => {\n const persistedNotifications = notificationsData ?? []\n\n const notificationMap = new Map<string, Notification>()\n\n for (const notification of [...realtimeNotifications, ...persistedNotifications]) {\n if (readNotificationIds.has(notification.id)) {\n continue\n }\n\n notificationMap.set(notification.id, notification)\n }\n\n return Array.from(notificationMap.values()).sort(\n (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()\n )\n }, [realtimeNotifications, notificationsData, readNotificationIds])\n\n const unreadCount = notifications.length\n\n const readNotification = useCallback(\n (id: string) => {\n /**\n * Optimistically remove it from the UI.\n */\n setReadNotificationIds((current) => {\n const updated = new Set(current)\n\n updated.add(id)\n\n return updated\n })\n\n markNotificationAsRead(id)\n },\n [markNotificationAsRead]\n )\n\n const readAllNotifications = useCallback(() => {\n const notificationIds = notifications.map((notification) => notification.id)\n\n /**\n * Optimistically mark everything currently visible\n * as read.\n */\n setReadNotificationIds((current) => {\n const updated = new Set(current)\n\n notificationIds.forEach((id) => updated.add(id))\n\n return updated\n })\n\n markAllNotificationsAsRead()\n }, [notifications, markAllNotificationsAsRead])\n\n return (\n <NotificationContext.Provider\n value={{\n notifications,\n unreadCount,\n isConnected,\n readNotification,\n readAllNotifications,\n }}\n >\n {children}\n </NotificationContext.Provider>\n )\n}\n\nexport const useNotifications = () => {\n const context = useContext(NotificationContext)\n\n if (!context) {\n throw new Error('useNotifications must be used within NotificationProvider')\n }\n\n return context\n}\n"],"names":["NotificationContext","createContext","undefined","children","notificationsData","markNotificationAsRead","markAllNotificationsAsRead","baseAPIUrl","realtimeNotifications","setRealtimeNotifications","useState","readNotificationIds","setReadNotificationIds","Set","playNotificationSound","useSound","handleNotification","useCallback","notification","current","some","item","id","isConnected","useNotificationStream","onNotification","notifications","useMemo","persistedNotifications","notificationMap","Map","has","set","Array","from","values","sort","a","b","Date","createdAt","getTime","unreadCount","length","readNotification","updated","add","readAllNotifications","notificationIds","map","forEach","_jsx","Provider","value","context","useContext","Error"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotificationProvider.js","sources":["../../src/context/NotificationProvider.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useMemo, useState } from 'react'\nimport type { ReactNode } from 'react'\n\n// import { useNotificationStream } from \"@/hooks/useNotificationStream\";\n// import {\n// useGetNotifications,\n// useReadAllNotification,\n// useReadNotification,\n// } from \"@/hooks/apis/notifications\";\n\nimport type { Notification, NotificationAuthClient } from '@/hooks/use-notification-stream'\nimport useNotificationStream from '@/hooks/use-notification-stream'\nimport useSound from '@/hooks/use-sound'\n\nexport type NotificationContextValue = {\n notifications: Notification[]\n unreadCount: number\n isConnected: boolean\n readNotification: (id: string) => void\n readAllNotifications: () => void\n}\n\nexport type NotificationProviderProps = {\n children: ReactNode\n baseAPIUrl: string\n authClient?: NotificationAuthClient\n notificationsData: Notification[]\n markNotificationAsRead: (id: string) => void\n markAllNotificationsAsRead: () => void\n}\n\nconst NotificationContext = createContext<NotificationContextValue | undefined>(undefined)\n\nexport const NotificationProvider = ({\n children,\n notificationsData,\n markNotificationAsRead,\n markAllNotificationsAsRead,\n baseAPIUrl,\n authClient = 'dashboard',\n}: NotificationProviderProps) => {\n /**\n * Notifications received during the current SSE session.\n */\n const [realtimeNotifications, setRealtimeNotifications] = useState<Notification[]>([])\n\n /**\n * Allows us to optimistically hide notifications immediately\n * without waiting for the notifications query to refetch.\n */\n const [readNotificationIds, setReadNotificationIds] = useState<Set<string>>(new Set())\n\n const { playNotificationSound } = useSound()\n const handleNotification = useCallback(\n (notification: Notification) => {\n setRealtimeNotifications((current) => {\n /**\n * Protect against the same SSE notification being\n * received more than once.\n */\n if (current.some((item) => item.id === notification.id)) {\n return current\n }\n\n return [notification, ...current]\n })\n\n playNotificationSound()\n },\n [playNotificationSound]\n )\n\n const { isConnected } = useNotificationStream({\n baseAPIUrl,\n authClient,\n onNotification: handleNotification,\n })\n\n /**\n * Merge:\n *\n * 1. Newly received SSE notifications\n * 2. Persisted notifications returned by the API\n *\n * Map prevents duplicates when an SSE notification later\n * appears in a query/refetch response.\n */\n const notifications = useMemo(() => {\n const persistedNotifications = notificationsData ?? []\n\n const notificationMap = new Map<string, Notification>()\n\n for (const notification of [...realtimeNotifications, ...persistedNotifications]) {\n if (readNotificationIds.has(notification.id)) {\n continue\n }\n\n notificationMap.set(notification.id, notification)\n }\n\n return Array.from(notificationMap.values()).sort(\n (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()\n )\n }, [realtimeNotifications, notificationsData, readNotificationIds])\n\n const unreadCount = notifications.length\n\n const readNotification = useCallback(\n (id: string) => {\n /**\n * Optimistically remove it from the UI.\n */\n setReadNotificationIds((current) => {\n const updated = new Set(current)\n\n updated.add(id)\n\n return updated\n })\n\n markNotificationAsRead(id)\n },\n [markNotificationAsRead]\n )\n\n const readAllNotifications = useCallback(() => {\n const notificationIds = notifications.map((notification) => notification.id)\n\n /**\n * Optimistically mark everything currently visible\n * as read.\n */\n setReadNotificationIds((current) => {\n const updated = new Set(current)\n\n notificationIds.forEach((id) => updated.add(id))\n\n return updated\n })\n\n markAllNotificationsAsRead()\n }, [notifications, markAllNotificationsAsRead])\n\n return (\n <NotificationContext.Provider\n value={{\n notifications,\n unreadCount,\n isConnected,\n readNotification,\n readAllNotifications,\n }}\n >\n {children}\n </NotificationContext.Provider>\n )\n}\n\nexport const useNotifications = () => {\n const context = useContext(NotificationContext)\n\n if (!context) {\n throw new Error('useNotifications must be used within NotificationProvider')\n }\n\n return context\n}\n"],"names":["NotificationContext","createContext","undefined","children","notificationsData","markNotificationAsRead","markAllNotificationsAsRead","baseAPIUrl","authClient","realtimeNotifications","setRealtimeNotifications","useState","readNotificationIds","setReadNotificationIds","Set","playNotificationSound","useSound","handleNotification","useCallback","notification","current","some","item","id","isConnected","useNotificationStream","onNotification","notifications","useMemo","persistedNotifications","notificationMap","Map","has","set","Array","from","values","sort","a","b","Date","createdAt","getTime","unreadCount","length","readNotification","updated","add","readAllNotifications","notificationIds","map","forEach","_jsx","Provider","value","context","useContext","Error"],"mappings":"8MA+BA,MAAMA,EAAsBC,qBAAoDC,gCAE5C,EAClCC,WACAC,oBACAC,yBACAC,6BACAC,aACAC,aAAa,gBAKb,MAAOC,EAAuBC,GAA4BC,WAAyB,KAM5EC,EAAqBC,GAA0BF,WAAsB,IAAIG,MAE1EC,sBAAEA,GAA0BC,YAC5BC,EAAqBC,cACxBC,IACCT,EAA0BU,GAKpBA,EAAQC,KAAMC,GAASA,EAAKC,KAAOJ,EAAaI,IAC3CH,EAGF,CAACD,KAAiBC,IAG3BL,KAEF,CAACA,KAGGS,YAAEA,GAAgBC,UAAsB,CAC5ClB,aACAC,aACAkB,eAAgBT,IAYZU,EAAgBC,UAAQ,KAC5B,MAAMC,EAAyBzB,QAAAA,EAAqB,GAE9C0B,EAAkB,IAAIC,IAE5B,IAAK,MAAMZ,IAAgB,IAAIV,KAA0BoB,GACnDjB,EAAoBoB,IAAIb,EAAaI,KAIzCO,EAAgBG,IAAId,EAAaI,GAAIJ,GAGvC,OAAOe,MAAMC,KAAKL,EAAgBM,UAAUC,KAC1C,CAACC,EAAGC,IAAM,IAAIC,KAAKD,EAAEE,WAAWC,UAAY,IAAIF,KAAKF,EAAEG,WAAWC,YAEnE,CAACjC,EAAuBL,EAAmBQ,IAExC+B,EAAchB,EAAciB,OAE5BC,EAAmB3B,cACtBK,IAICV,EAAwBO,IACtB,MAAM0B,EAAU,IAAIhC,IAAIM,GAIxB,OAFA0B,EAAQC,IAAIxB,GAELuB,IAGTzC,EAAuBkB,IAEzB,CAAClB,IAGG2C,EAAuB9B,cAAY,KACvC,MAAM+B,EAAkBtB,EAAcuB,IAAK/B,GAAiBA,EAAaI,IAMzEV,EAAwBO,IACtB,MAAM0B,EAAU,IAAIhC,IAAIM,GAIxB,OAFA6B,EAAgBE,QAAS5B,GAAOuB,EAAQC,IAAIxB,IAErCuB,IAGTxC,KACC,CAACqB,EAAerB,IAEnB,OACE8C,MAACpD,EAAoBqD,wBACnBC,MAAO,CACL3B,gBACAgB,cACAnB,cACAqB,mBACAG,mCAGD7C,sCAKyB,KAC9B,MAAMoD,EAAUC,aAAWxD,GAE3B,IAAKuD,EACH,MAAM,IAAIE,MAAM,6DAGlB,OAAOF"}
|
|
@@ -6,12 +6,14 @@ export declare type Notification = {
|
|
|
6
6
|
actionUrl: string;
|
|
7
7
|
createdAt: string;
|
|
8
8
|
};
|
|
9
|
+
export declare type NotificationAuthClient = 'dashboard' | 'pos' | 'platform';
|
|
9
10
|
declare type UseNotificationStreamOptions = {
|
|
11
|
+
authClient?: NotificationAuthClient;
|
|
10
12
|
baseAPIUrl: string;
|
|
11
13
|
onNotification: (notification: Notification) => void;
|
|
12
14
|
enabled?: boolean;
|
|
13
15
|
};
|
|
14
|
-
declare const useNotificationStream: ({ baseAPIUrl, enabled, onNotification }: UseNotificationStreamOptions) => {
|
|
16
|
+
declare const useNotificationStream: ({ baseAPIUrl, authClient, enabled, onNotification, }: UseNotificationStreamOptions) => {
|
|
15
17
|
status: "idle" | "connecting" | "connected" | "error";
|
|
16
18
|
isConnected: boolean;
|
|
17
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-notification-stream.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-stream.ts"],"names":[],"mappings":"AAEA,oBAAY,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,aAAK,4BAA4B,GAAG;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAA;IACpD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,QAAA,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"use-notification-stream.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-stream.ts"],"names":[],"mappings":"AAEA,oBAAY,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,oBAAY,sBAAsB,GAAG,WAAW,GAAG,KAAK,GAAG,UAAU,CAAA;AAErE,aAAK,4BAA4B,GAAG;IAClC,UAAU,CAAC,EAAE,sBAAsB,CAAA;IACnC,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAA;IACpD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,QAAA,MAAM,qBAAqB,yDAKxB,4BAA4B;;;CA4B9B,CAAA;AAED,eAAe,qBAAqB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./use-sse.js");exports.default=({baseAPIUrl:n,enabled:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./use-sse.js");exports.default=({baseAPIUrl:n,authClient:t="dashboard",enabled:o=!0,onNotification:a})=>e.useSSE({url:`${n}/api/v1/notifications/stream?authClient=${encodeURIComponent(t)}`,event:"notification",enabled:o,withCredentials:!0,onMessage:a,onOpen:()=>{},onConnected:()=>{},onError:()=>{}});
|
|
2
2
|
//# sourceMappingURL=use-notification-stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-notification-stream.js","sources":["../../src/hooks/use-notification-stream.ts"],"sourcesContent":["import { useSSE } from './use-sse'\n\nexport type Notification = {\n id: string\n type: string\n title: string\n message: string\n actionUrl: string\n createdAt: string\n}\n\ntype UseNotificationStreamOptions = {\n baseAPIUrl: string\n onNotification: (notification: Notification) => void\n enabled?: boolean\n}\n\nconst useNotificationStream = ({
|
|
1
|
+
{"version":3,"file":"use-notification-stream.js","sources":["../../src/hooks/use-notification-stream.ts"],"sourcesContent":["import { useSSE } from './use-sse'\n\nexport type Notification = {\n id: string\n type: string\n title: string\n message: string\n actionUrl: string\n createdAt: string\n}\n\nexport type NotificationAuthClient = 'dashboard' | 'pos' | 'platform'\n\ntype UseNotificationStreamOptions = {\n authClient?: NotificationAuthClient\n baseAPIUrl: string\n onNotification: (notification: Notification) => void\n enabled?: boolean\n}\n\nconst useNotificationStream = ({\n baseAPIUrl,\n authClient = 'dashboard',\n enabled = true,\n onNotification,\n}: UseNotificationStreamOptions) => {\n return useSSE<Notification>({\n url: `${baseAPIUrl}/api/v1/notifications/stream?authClient=${encodeURIComponent(authClient)}`,\n\n event: 'notification',\n\n enabled,\n\n withCredentials: true,\n\n onMessage: onNotification,\n\n onOpen: () => {\n // console.log(\"Notification SSE request opened\");\n },\n\n onConnected: () => {\n // console.log(\n // \"Notification stream confirmed by server\",\n // );\n },\n\n onError: () => {\n // console.warn(\n // \"Notification stream disconnected or reconnecting\",\n // );\n },\n })\n}\n\nexport default useNotificationStream\n"],"names":["baseAPIUrl","authClient","enabled","onNotification","useSSE","url","encodeURIComponent","event","withCredentials","onMessage","onOpen","onConnected","onError"],"mappings":"kHAoB8B,EAC5BA,aACAC,aAAa,YACbC,WAAU,EACVC,oBAEOC,SAAqB,CAC1BC,IAAK,GAAGL,4CAAqDM,mBAAmBL,KAEhFM,MAAO,eAEPL,UAEAM,iBAAiB,EAEjBC,UAAWN,EAEXO,OAAQ,OAIRC,YAAa,OAMbC,QAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savantlink/sdk",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.30",
|
|
4
4
|
"description": "A package that contains reusable components and services for the SavantLink design system and architecture.",
|
|
5
5
|
"homepage": "https://github.com/savantlink/savantlink-sdk",
|
|
6
6
|
"repository": {
|