export * from 'json-logic-js'; import { C as Context, S as SeverityLevelEnum, T as TagsFilter, N as Notification, a as NotificationFilter } from './inbox-service-C1TlfPSW.mjs'; export { A as AgentMessage, B as BaseDeleteSubscriptionArgs, b as BaseUpdateSubscriptionArgs, c as ChannelConnectionResponse, d as ChannelEndpointResponse, e as ChannelPreference, f as ChannelType, g as CreateChannelConnectionArgs, h as CreateChannelEndpointArgs, i as CreateSubscriptionArgs, D as DaySchedule, j as DefaultSchedule, k as DeleteChannelConnectionArgs, l as DeleteChannelEndpointArgs, m as DeleteSubscriptionArgs, E as EventHandler, n as Events, F as FiltersCountResponse, G as GenerateChatOAuthUrlArgs, o as GetChannelConnectionArgs, p as GetChannelEndpointArgs, q as GetSubscriptionArgs, I as InboxNotification, r as InstanceDeleteSubscriptionArgs, s as InstanceUpdateSubscriptionArgs, L as LinkChannelEndpointArgs, t as LinkChannelEndpointResponse, u as ListChannelConnectionsArgs, v as ListChannelEndpointsArgs, w as ListNotificationsResponse, x as ListSubscriptionsArgs, y as LoadConversationArgs, z as LoadConversationResult, H as NotificationStatus, J as NovuError, K as NovuOptions, M as NovuSocketOptions, P as Preference, O as PreferenceFilter, Q as PreferenceLevel, R as PreferencesResponse, U as Schedule, V as SendMessageArgs, W as SendMessageResult, X as SocketEventNames, Y as SocketTypeOption, Z as StandardNovuOptions, _ as Subscriber, $ as SubscriptionPreference, a0 as TagsFilterAndForm, a1 as TagsFilterOrGroup, a2 as TimeRange, a3 as TopicSubscription, a4 as UnreadCount, a5 as UpdateSubscriptionArgs, a6 as UpdateSubscriptionPreferenceArgs, a7 as WebSocketEvent, a8 as WeeklySchedule, a9 as WorkflowCriticalityEnum, aa as WorkflowFilter, ab as WorkflowGroupFilter, ac as WorkflowIdentifierOrId } from './inbox-service-C1TlfPSW.mjs'; export { N as Novu } from './novu-Bl8Jn6C8.mjs'; declare const NOTIFICATION_COUNT_SYNC_EVENTS: readonly ["notification.read.resolved", "notification.unread.resolved", "notification.seen.resolved", "notification.archive.resolved", "notification.unarchive.resolved", "notification.snooze.resolved", "notification.unsnooze.resolved", "notification.delete.resolved", "notifications.read_all.resolved", "notifications.seen_all.resolved", "notifications.archive_all.resolved", "notifications.archive_all_read.resolved", "notifications.delete_all.resolved"]; type TelegramSubscriberLinkStatus = 'loading' | 'pending' | 'connected' | 'expired'; type TelegramSubscriberLinkResponse = { deepLinkUrl: string; botUsername: string; expiresAt: string; }; type TelegramSubscriberLinkOptions = { /** * Base URL of the Novu API (or your backend proxy). * Defaults to `https://api.novu.co`. */ apiUrl?: string; /** * Novu server-side secret key (`Authorization: ApiKey `). * Required when calling the Novu API directly. * Omit when routing through a backend proxy that injects its own auth. */ secretKey?: string; /** Integration identifier (the `identifier` field on the Telegram integration, not `_id`). */ integrationIdentifier: string; /** External subscriber ID to link to the Telegram chat. */ subscriberId: string; /** * Context bound to the Telegram endpoint created when the subscriber taps * `/start`. */ context?: Context; /** * Polling interval in milliseconds to check for connection confirmation. * Defaults to `2000` (2 seconds). */ pollIntervalMs?: number; /** * Custom fetch function. Defaults to the global `fetch`. * Useful for injecting auth headers in a backend-proxy scenario. */ fetchFn?: typeof fetch; }; type TelegramSubscriberLinkState = { status: TelegramSubscriberLinkStatus; deepLinkUrl: string | null; botUsername: string | null; expiresAt: string | null; error: Error | null; }; type StateListener = (state: TelegramSubscriberLinkState) => void; /** * Framework-agnostic helper that manages the full Telegram subscriber-link * lifecycle: issue a deep link, poll for the subscriber's `/start` tap, and * re-issue automatically when the 10-minute code expires. * * **Important:** The subscriber-link endpoint requires `INTEGRATION_WRITE` * permission and must be called from a trusted server or via a backend proxy — * never directly from an untrusted browser with end-user credentials. * * @example * ```ts * import { TelegramSubscriberLink } from '@novu/js'; * * const link = new TelegramSubscriberLink({ * secretKey: process.env.NOVU_SECRET_KEY, * integrationIdentifier: '', * subscriberId: 'user-42', * }); * * link.onStateChange((state) => { * console.log(state.status, state.deepLinkUrl); * }); * * await link.start(); * // … later … * link.stop(); * ``` */ declare class TelegramSubscriberLink { #private; constructor(options: TelegramSubscriberLinkOptions); get state(): Readonly; onStateChange(listener: StateListener): () => void; /** * Check whether the subscriber is already connected; if not, issue a deep * link and begin polling for connection. Call {@link stop} to cancel polling * and timers. */ start(): Promise; /** Re-issue a fresh deep link (e.g. after expiry or on-demand refresh). */ refresh(): Promise; /** Stop all polling and expiry timers. */ stop(): void; } /** * Normalizes inbox tag filters to CNF: `string[][]` where each inner array is one OR-group. * A flat list `['a','b']` is normalized to one OR-group `[['a','b']]`. Empty input → `[]` (no tag filter). */ declare function normalizeTagGroups(tags: TagsFilter | undefined): string[][]; declare const areTagsEqual: (tags1?: TagsFilter, tags2?: TagsFilter) => boolean; declare const areSeveritiesEqual: (el1?: SeverityLevelEnum | SeverityLevelEnum[], el2?: SeverityLevelEnum | SeverityLevelEnum[]) => boolean; declare const isSameFilter: (filter1: NotificationFilter, filter2: NotificationFilter) => boolean; /** * Check whether a notification's `data` matches the supplied filter shape. * * Supports per-key: * - scalar (exact equality) * - `Scalar[]` (OR — match any) * - `{ or: Scalar[] }` (explicit OR) * - `{ and: [{ or: Scalar[] }, ...] }` (AND of OR-groups) * - 1 level of nested objects whose sub-keys follow the same rules * * Mirrors the server-side semantics from `@novu/shared#checkDataFilterMatches` * so realtime, cache, and counts stay consistent. */ declare function checkNotificationDataFilter(notificationData: Notification['data'], filterData: NotificationFilter['data']): boolean; /** * Complete notification filter check combining all criteria. * This is the main function that should be used by both React and SolidJS implementations. */ declare function checkNotificationMatchesFilter(notification: Notification, filter: NotificationFilter): boolean; export { Context, NOTIFICATION_COUNT_SYNC_EVENTS, Notification, NotificationFilter, SeverityLevelEnum, TagsFilter, TelegramSubscriberLink, type TelegramSubscriberLinkOptions, type TelegramSubscriberLinkResponse, type TelegramSubscriberLinkState, type TelegramSubscriberLinkStatus, areSeveritiesEqual, areTagsEqual, checkNotificationDataFilter, checkNotificationMatchesFilter, isSameFilter, normalizeTagGroups };