/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
packages/react/src/server/index.tsx
235 строк
6 KB
Adam Chmara
feat(api-service,js): emit MCP connection events for agent chat fixes NV-8578 (#12321)
12 авг 2026, 15:27
Не верифицирован
12 авг 2026, 15:27
e835896
Код
Авторство
О чём код?
import type { InboxProps } from '../components/Inbox'; import { ShadowRootDetector } from '../components/ShadowRootDetector'; import type { UseAgentChatProps, UseAgentChatResult, UseCreateSubscriptionProps, UseCreateSubscriptionResult, UseNotificationsProps, UseNotificationsResult, UsePreferencesProps, UsePreferencesResult, UseRemoveSubscriptionProps, UseRemoveSubscriptionResult, UseScheduleProps, UseScheduleResult, UseSubscriptionProps, UseSubscriptionResult, UseSubscriptionsProps, UseSubscriptionsResult, UseUpdateSubscriptionProps, UseUpdateSubscriptionResult, } from '../hooks'; import type { NovuProviderProps } from '../hooks/NovuProvider'; import type { UseCountsProps, UseCountsResult } from '../hooks/useCounts'; /** * Exporting all components from the components folder * as empty functions to fix build errors in SSR * This will be replaced with actual components * when we implement the SSR components in @novu/js/ui */ export function Inbox(props: InboxProps) { return <ShadowRootDetector />; } export function InboxContent() {} export function Notifications() {} export function Preferences() {} export function Bell() {} export function NovuProvider(props: NovuProviderProps) { return <>{props.children}</>; } export function Subscription() { return <ShadowRootDetector />; } export function SubscriptionButton() {} export function SubscriptionPreferences() {} export function SlackConnectButton() { return <ShadowRootDetector />; } export function SlackLinkUser() { return <ShadowRootDetector />; } export function MsTeamsConnectButton() { return <ShadowRootDetector />; } export function MsTeamsLinkUser() { return <ShadowRootDetector />; } export function TelegramConnectButton() { return <ShadowRootDetector />; } export function useNovu() { return null; } export function useAgentChat(_: UseAgentChatProps): UseAgentChatResult { return { messages: [], pendingActions: [], isLoading: false, isFetching: false, isRunning: false, typing: undefined, status: 'active', hasMore: false, refetch: () => Promise.resolve(), fetchMore: () => Promise.resolve({ data: undefined, error: undefined }), sendMessage: () => Promise.resolve({ data: undefined, error: undefined }), respondToAction: () => Promise.resolve({ data: undefined, error: undefined }), }; } export function useCounts(_: UseCountsProps): UseCountsResult { return { isLoading: false, isFetching: false, refetch: () => Promise.resolve(), }; } export function useNotifications(_: UseNotificationsProps): UseNotificationsResult { return { isLoading: false, isFetching: false, hasMore: false, readAll: () => Promise.resolve({ data: undefined, error: undefined }), seenAll: () => Promise.resolve({ data: undefined, error: undefined }), archiveAll: () => Promise.resolve({ data: undefined, error: undefined }), archiveAllRead: () => Promise.resolve({ data: undefined, error: undefined }), refetch: () => Promise.resolve(), fetchMore: () => Promise.resolve(), }; } export function usePreferences(_: UsePreferencesProps): UsePreferencesResult { return { isLoading: false, isFetching: false, refetch: () => Promise.resolve(), }; } export function useSchedule(_: UseScheduleProps): UseScheduleResult { return { isLoading: false, isFetching: false, refetch: () => Promise.resolve(), }; } export function useSubscription(_: UseSubscriptionProps): UseSubscriptionResult { return { isLoading: false, isFetching: false, refetch: () => Promise.resolve(), }; } export function useCreateSubscription(_: UseCreateSubscriptionProps = {}): UseCreateSubscriptionResult { return { isCreating: false, error: undefined, create: () => Promise.resolve({ data: undefined, error: undefined }), }; } export function useUpdateSubscription(_: UseUpdateSubscriptionProps = {}): UseUpdateSubscriptionResult { return { isUpdating: false, error: undefined, update: () => Promise.resolve({ data: undefined, error: undefined }), }; } export function useRemoveSubscription(_: UseRemoveSubscriptionProps = {}): UseRemoveSubscriptionResult { return { isRemoving: false, error: undefined, remove: () => Promise.resolve({ data: undefined, error: undefined }), }; } export function useSubscriptions(_: UseSubscriptionsProps): UseSubscriptionsResult { return { isLoading: false, isFetching: false, refetch: () => Promise.resolve(), }; } export type * from '@novu/js'; export { PreferenceLevel, SeverityLevelEnum, WorkflowCriticalityEnum } from '@novu/js'; export type { AllLocalization, AllLocalizationKey, ElementStyles, InboxAppearance, InboxAppearanceCallback, InboxAppearanceCallbackFunction, InboxAppearanceCallbackKeys, InboxAppearanceKey, InboxElements, InboxLocalization, InboxLocalizationKey, InboxTheme, NotificationActionClickHandler, NotificationClickHandler, NotificationRenderer, PreferenceGroups, PreferencesFilter, RouterPush, SubscriptionAppearance, SubscriptionAppearanceCallback, SubscriptionAppearanceCallbackFunction, SubscriptionAppearanceCallbackKeys, SubscriptionAppearanceKey, SubscriptionElements, SubscriptionLocalization, SubscriptionLocalizationKey, SubscriptionTheme, Tab, Variables, } from '@novu/js/ui'; export type { BellProps, InboxContentProps, InboxProps, NotificationProps, NovuProviderProps } from '../components'; export type { UseAgentChatProps, UseAgentChatResult, UseCountsProps, UseCountsResult, UseNotificationsProps, UseNotificationsResult, UsePreferencesResult, UseScheduleProps as UsePreferencesProps, } from '../hooks'; export type { BaseProps, BellRenderer, BodyRenderer, DefaultInboxProps, DefaultProps, NoRendererProps, NotificationRendererProps, NotificationsRenderer, SubjectBodyRendererProps, SubjectRenderer, WithChildrenProps, } from '../utils/types';