@burdenoff/microfe-channel 2026.513.2 → 2026.514.1
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/channel/ChannelRoot.js +1 -1
- package/dist/channel/ChannelRoot.js.map +1 -1
- package/dist/channel/hooks/useChannelSubscription.d.ts +4 -4
- package/dist/channel/hooks/useChannelSubscription.d.ts.map +1 -1
- package/dist/channel/hooks/useChannelSubscription.js +2 -2
- package/dist/channel/hooks/useChannelSubscription.js.map +1 -1
- package/dist/channel/hooks/useChannels.d.ts.map +1 -1
- package/dist/channel/hooks/useChannels.js +130 -124
- package/dist/channel/hooks/useChannels.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js +5 -5
- package/dist/channel/modules/channels/pages/ChannelSettingsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js +25 -7
- package/dist/channel/modules/channels/pages/ChannelUsersPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js +7 -7
- package/dist/channel/modules/channels/pages/ConnectionDetailsPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionsListPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js +137 -133
- package/dist/channel/modules/channels/pages/ConnectionsListPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js +162 -158
- package/dist/channel/modules/channels/pages/DeliveryHistoryPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/EditChannelPage.js +5 -5
- package/dist/channel/modules/channels/pages/EditChannelPage.js.map +1 -1
- package/dist/channel/modules/channels/pages/SendMessagePage.js +2 -2
- package/dist/channel/modules/channels/pages/SendMessagePage.js.map +1 -1
- package/dist/channel/modules/channels/pages/WebhookEventsPage.d.ts.map +1 -1
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js +11 -3
- package/dist/channel/modules/channels/pages/WebhookEventsPage.js.map +1 -1
- package/dist/translations/en.d.ts +260 -0
- package/dist/translations/en.d.ts.map +1 -0
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelRoot.js","names":[],"sources":["../../src/channel/ChannelRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect, useCallback } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Radio, Cable, Send, Settings } from 'lucide-react';\nimport { ChannelProvider } from './providers/ChannelProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { NavItem, ChannelRootProps } from './types';\nimport { ChannelRoutes } from './ChannelRoutes';\n\n/**\n * Root component for the Channel microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { ChannelRoot, type ChannelRootProps } from '@burdenoff/microfe-channel';\n *\n * function App() {\n * const props: ChannelRootProps = {\n * basePath: '/channels',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com', firstName: 'John', lastName: 'Doe' },\n * workspaceId: 'ws-123',\n * organizationId: 'org-123',\n * apiGatewayUrl: 'https://api.example.com/workspaces/graphql',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <ChannelRoot {...props} />;\n * }\n * ```\n */\nexport const ChannelRoot: FC<ChannelRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const tr = useCallback(\n (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n },\n [t]\n );\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'channel-channels',\n label: tr('channel.channels', 'Channels'),\n path: basePath === '/' ? '/' : joinPath(basePath, 'list'),\n icon: <Radio size={20} />,\n order: 100,\n group: 'channel',\n },\n {\n id: 'channel-connections',\n label: tr('channel.connections', 'Connections'),\n path: joinPath(basePath, 'connections'),\n icon: <Cable size={20} />,\n order: 110,\n group: 'channel',\n },\n {\n id: 'channel-send',\n label: tr('channel.sendMessage', 'Send Message'),\n path: joinPath(basePath, 'send'),\n icon: <Send size={20} />,\n order: 120,\n group: 'channel',\n },\n {\n id: 'channel-settings',\n label: tr('channel.settings', 'Settings'),\n path: joinPath(basePath, 'settings'),\n icon: <Settings size={20} />,\n order: 130,\n group: 'channel',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath, tr]);\n\n // Register footer items (example: Channel status indicator in left section)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'channel-status',\n label: tr('channel.channelsReady', 'Channels Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, tr]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={
|
|
1
|
+
{"version":3,"file":"ChannelRoot.js","names":[],"sources":["../../src/channel/ChannelRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect, useCallback } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Radio, Cable, Send, Settings } from 'lucide-react';\nimport { ChannelProvider } from './providers/ChannelProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { NavItem, ChannelRootProps } from './types';\nimport { ChannelRoutes } from './ChannelRoutes';\n\n/**\n * Root component for the Channel microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { ChannelRoot, type ChannelRootProps } from '@burdenoff/microfe-channel';\n *\n * function App() {\n * const props: ChannelRootProps = {\n * basePath: '/channels',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com', firstName: 'John', lastName: 'Doe' },\n * workspaceId: 'ws-123',\n * organizationId: 'org-123',\n * apiGatewayUrl: 'https://api.example.com/workspaces/graphql',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <ChannelRoot {...props} />;\n * }\n * ```\n */\nexport const ChannelRoot: FC<ChannelRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const tr = useCallback(\n (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n },\n [t]\n );\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'channel-channels',\n label: tr('channel.channels', 'Channels'),\n path: basePath === '/' ? '/' : joinPath(basePath, 'list'),\n icon: <Radio size={20} />,\n order: 100,\n group: 'channel',\n },\n {\n id: 'channel-connections',\n label: tr('channel.connections', 'Connections'),\n path: joinPath(basePath, 'connections'),\n icon: <Cable size={20} />,\n order: 110,\n group: 'channel',\n },\n {\n id: 'channel-send',\n label: tr('channel.sendMessage', 'Send Message'),\n path: joinPath(basePath, 'send'),\n icon: <Send size={20} />,\n order: 120,\n group: 'channel',\n },\n {\n id: 'channel-settings',\n label: tr('channel.settings', 'Settings'),\n path: joinPath(basePath, 'settings'),\n icon: <Settings size={20} />,\n order: 130,\n group: 'channel',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath, tr]);\n\n // Register footer items (example: Channel status indicator in left section)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'channel-status',\n label: tr('channel.channelsReady', 'Channels Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, tr]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={false}>\n <ChannelProvider {...props}>\n <ChannelRoutes />\n </ChannelProvider>\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;AAqCA,IAAa,KAAqC,MAAU;CAC1D,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,SAAM,GAAS,EACjB,IAAK,GACR,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAE,EAAI;AACpB,SAAO,MAAU,IAAM,IAAW;IAEpC,CAAC,EAAE,CACJ,EAGK,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AAoEtD,QA/DA,QAAgB;AACT,QAyCL,QAHgB,EApCY;GAC1B;IACE,IAAI;IACJ,OAAO,EAAG,oBAAoB,WAAW;IACzC,MAAM,MAAa,MAAM,MAAM,EAAS,GAAU,OAAO;IACzD,MAAM,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;IACzB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,uBAAuB,cAAc;IAC/C,MAAM,EAAS,GAAU,cAAc;IACvC,MAAM,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;IACzB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,uBAAuB,eAAe;IAChD,MAAM,EAAS,GAAU,OAAO;IAChC,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;IACxB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,oBAAoB,WAAW;IACzC,MAAM,EAAS,GAAU,WAAW;IACpC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACF,CAGyC;IAIzC;EAAC;EAAkB;EAAU;EAAG,CAAC,EAGpC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAG,yBAAyB,iBAAiB;GACpD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAG,CAAC,EAG3B,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAAsC;GAE/C,CAAA;YAGR,kBAAC,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD;IAAiB,GAAI;cACnB,kBAAC,GAAD,EAAiB,CAAA;IACD,CAAA;GACE,CAAA;EACR,CAAA"}
|
|
@@ -29,8 +29,8 @@ export interface UseChannelSubscriptionArgs<TData> {
|
|
|
29
29
|
enabled?: boolean;
|
|
30
30
|
}
|
|
31
31
|
export declare function useChannelSubscription<TData = unknown>({ query, variables, operationName, onData, pollFn, pollIntervalMs, enabled, }: UseChannelSubscriptionArgs<TData>): void;
|
|
32
|
-
export declare const CHANNEL_HEALTH_CHANGED_SUBSCRIPTION = "\n subscription ChannelHealthChanged($organizationId: ID!) {\n channelHealthChanged(organizationId: $organizationId) {\n channelId\n previousHealth\n
|
|
33
|
-
export declare const
|
|
34
|
-
export declare const WEBHOOK_RECEIVED_SUBSCRIPTION = "\n subscription WebhookReceived($channelId: ID!) {\n webhookReceived(channelId: $channelId) {\n
|
|
35
|
-
export declare const CONNECTION_STATUS_CHANGED_SUBSCRIPTION = "\n subscription ConnectionStatusChanged($
|
|
32
|
+
export declare const CHANNEL_HEALTH_CHANGED_SUBSCRIPTION = "\n subscription ChannelHealthChanged($organizationId: ID!) {\n channelHealthChanged(organizationId: $organizationId) {\n channelId\n previousHealth\n newHealth\n changedAt\n reason\n }\n }\n";
|
|
33
|
+
export declare const DELIVERY_STATUS_UPDATE_SUBSCRIPTION = "\n subscription OnDeliveryStatusUpdate($notificationId: ID!, $organizationId: ID!) {\n onDeliveryStatusUpdate(notificationId: $notificationId, organizationId: $organizationId) {\n notificationId\n messageId\n status\n timestamp\n }\n }\n";
|
|
34
|
+
export declare const WEBHOOK_RECEIVED_SUBSCRIPTION = "\n subscription WebhookReceived($channelId: ID!) {\n webhookReceived(channelId: $channelId) {\n channelId\n organizationId\n webhookEventId\n receivedAt\n platform\n processingStatus\n }\n }\n";
|
|
35
|
+
export declare const CONNECTION_STATUS_CHANGED_SUBSCRIPTION = "\n subscription ConnectionStatusChanged($channelId: ID!) {\n connectionStatusChanged(channelId: $channelId) {\n channelId\n organizationId\n connectionId\n isActive\n isHealthy\n changedAt\n reason\n }\n }\n";
|
|
36
36
|
//# sourceMappingURL=useChannelSubscription.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChannelSubscription.d.ts","sourceRoot":"","sources":["../../../src/channel/hooks/useChannelSubscription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,MAAM,WAAW,0BAA0B,CAAC,KAAK;IAC/C,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAC9B,0EAA0E;IAC1E,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACnC,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAmBD,wBAAgB,sBAAsB,CAAC,KAAK,GAAG,OAAO,EAAE,EACtD,KAAK,EACL,SAAS,EACT,aAAa,EACb,MAAM,EACN,MAAM,EACN,cAAuB,EACvB,OAAc,GACf,EAAE,0BAA0B,CAAC,KAAK,CAAC,QAgInC;AAMD,eAAO,MAAM,mCAAmC,
|
|
1
|
+
{"version":3,"file":"useChannelSubscription.d.ts","sourceRoot":"","sources":["../../../src/channel/hooks/useChannelSubscription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,MAAM,WAAW,0BAA0B,CAAC,KAAK;IAC/C,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAC9B,0EAA0E;IAC1E,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACnC,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAmBD,wBAAgB,sBAAsB,CAAC,KAAK,GAAG,OAAO,EAAE,EACtD,KAAK,EACL,SAAS,EACT,aAAa,EACb,MAAM,EACN,MAAM,EACN,cAAuB,EACvB,OAAc,GACf,EAAE,0BAA0B,CAAC,KAAK,CAAC,QAgInC;AAMD,eAAO,MAAM,mCAAmC,oOAU/C,CAAC;AAEF,eAAO,MAAM,mCAAmC,8QAS/C,CAAC;AAEF,eAAO,MAAM,6BAA6B,2OAWzC,CAAC;AAEF,eAAO,MAAM,sCAAsC,+PAYlD,CAAC"}
|
|
@@ -104,8 +104,8 @@ function o({ query: o, variables: s, operationName: c, onData: l, pollFn: u, pol
|
|
|
104
104
|
d
|
|
105
105
|
]);
|
|
106
106
|
}
|
|
107
|
-
var s = "\n subscription ChannelHealthChanged($organizationId: ID!) {\n channelHealthChanged(organizationId: $organizationId) {\n channelId\n previousHealth\n
|
|
107
|
+
var s = "\n subscription ChannelHealthChanged($organizationId: ID!) {\n channelHealthChanged(organizationId: $organizationId) {\n channelId\n previousHealth\n newHealth\n changedAt\n reason\n }\n }\n", c = "\n subscription WebhookReceived($channelId: ID!) {\n webhookReceived(channelId: $channelId) {\n channelId\n organizationId\n webhookEventId\n receivedAt\n platform\n processingStatus\n }\n }\n";
|
|
108
108
|
//#endregion
|
|
109
|
-
export { s as CHANNEL_HEALTH_CHANGED_SUBSCRIPTION,
|
|
109
|
+
export { s as CHANNEL_HEALTH_CHANGED_SUBSCRIPTION, c as WEBHOOK_RECEIVED_SUBSCRIPTION, o as useChannelSubscription };
|
|
110
110
|
|
|
111
111
|
//# sourceMappingURL=useChannelSubscription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChannelSubscription.js","names":[],"sources":["../../../src/channel/hooks/useChannelSubscription.ts"],"sourcesContent":["/**\n * useChannelSubscription\n *\n * Defensive subscription wrapper. Probes the shell-provided graphql-ws client\n * (`globalThis.__burdenoffShell.graphqlWsClient`); if present, opens a\n * subscription and dispatches each payload to `onData`. If absent — or if the\n * subscription errors with a clear \"unknown field\" / \"not implemented\" signal\n * (the operation isn't on the gateway yet) — silently falls back to a polling\n * loop driven by the caller's `pollFn` at `pollIntervalMs`.\n *\n * Per task 5: backends may grow `webhookReceived`, `connectionStatusChanged`\n * etc. independently; this hook lets the FE wire all four pages without\n * crashing when a subscription isn't yet on the federated schema.\n */\n\nimport { useEffect, useMemo, useRef } from 'react';\nimport { getGraphqlWsClient } from '../utils/shellBridge';\nimport { reportShellError } from '../utils/shellBridge';\n\nexport interface UseChannelSubscriptionArgs<TData> {\n /** GraphQL subscription document (string SDL). */\n query: string;\n /** Variables for the subscription. */\n variables?: Record<string, unknown>;\n /** Stable identifier for this subscription, used in error context. */\n operationName: string;\n /** Called for each payload received from the subscription. */\n onData: (data: TData) => void;\n /** Polling fallback invoked when subscription is unavailable / failed. */\n pollFn: () => Promise<void> | void;\n /** Polling interval in ms (default 15s). */\n pollIntervalMs?: number;\n /** Whether to enable the hook at all. */\n enabled?: boolean;\n}\n\n/** Best-effort detector for \"subscription field not found\" errors. */\nfunction isUnknownFieldError(err: unknown): boolean {\n const msg =\n err instanceof Error\n ? err.message\n : typeof err === 'string'\n ? err\n : ((err as { message?: string } | null)?.message ?? '');\n const lower = msg.toLowerCase();\n return (\n lower.includes('cannot query field') ||\n lower.includes('unknown field') ||\n lower.includes('subscription not supported') ||\n lower.includes('not implemented')\n );\n}\n\nexport function useChannelSubscription<TData = unknown>({\n query,\n variables,\n operationName,\n onData,\n pollFn,\n pollIntervalMs = 15_000,\n enabled = true,\n}: UseChannelSubscriptionArgs<TData>) {\n // Refs to onData / pollFn / variables so we don't re-subscribe on every\n // render. Updates happen inside an effect (not during render) per\n // react-hooks/refs.\n const onDataRef = useRef(onData);\n const pollFnRef = useRef(pollFn);\n const variablesRef = useRef(variables);\n useEffect(() => {\n onDataRef.current = onData;\n pollFnRef.current = pollFn;\n variablesRef.current = variables;\n }, [onData, pollFn, variables]);\n\n // Stable JSON of variables for the dependency array — avoids re-subscribing\n // when callers pass a new object literal each render with the same shape.\n const variablesKey = useMemo(() => JSON.stringify(variables ?? {}), [variables]);\n\n useEffect(() => {\n if (!enabled) return;\n\n const wsClient = getGraphqlWsClient();\n let pollTimer: ReturnType<typeof setInterval> | null = null;\n let unsubSub: (() => void) | null = null;\n let cancelled = false;\n\n const startPolling = () => {\n if (pollTimer) return;\n // Kick once immediately, then on interval.\n void Promise.resolve(pollFnRef.current()).catch(() => {});\n pollTimer = setInterval(() => {\n if (cancelled) return;\n void Promise.resolve(pollFnRef.current()).catch(() => {});\n }, pollIntervalMs);\n };\n\n if (!wsClient) {\n // No graphql-ws on the shell yet — fall back to polling.\n startPolling();\n return () => {\n cancelled = true;\n if (pollTimer) clearInterval(pollTimer);\n };\n }\n\n try {\n unsubSub = wsClient.subscribe(\n { query, variables: variablesRef.current, operationName },\n {\n next: (msg) => {\n if (cancelled) return;\n if (msg?.errors && msg.errors.length > 0) {\n // Probe error: if the field doesn't exist, fall back to polling.\n if (msg.errors.some(isUnknownFieldError)) {\n if (unsubSub) {\n try {\n unsubSub();\n } catch {\n /* noop */\n }\n unsubSub = null;\n }\n startPolling();\n return;\n }\n // Other errors — surface to SRE but keep the subscription open.\n reportShellError(\n new Error(`Subscription ${operationName} returned errors`),\n { module: 'channel', context: { operationName, errors: msg.errors } },\n `[channel] subscription ${operationName} errors`\n );\n return;\n }\n if (msg?.data) {\n try {\n onDataRef.current(msg.data as TData);\n } catch (handlerErr) {\n reportShellError(\n handlerErr,\n { module: 'channel', context: { operationName, phase: 'handler' } },\n `[channel] subscription ${operationName} handler threw`\n );\n }\n }\n },\n error: (err) => {\n // Subscription couldn't be opened (closed/unknown-field/etc).\n if (isUnknownFieldError(err)) {\n startPolling();\n return;\n }\n // Real transport error — log and fall back to polling defensively.\n reportShellError(\n err,\n { module: 'channel', context: { operationName, phase: 'transport' } },\n `[channel] subscription ${operationName} transport error`\n );\n startPolling();\n },\n complete: () => {\n // Server closed the stream cleanly — keep data fresh via polling.\n if (!cancelled) startPolling();\n },\n }\n );\n } catch (err) {\n // Defensive: client.subscribe threw synchronously — fall back.\n reportShellError(\n err,\n { module: 'channel', context: { operationName, phase: 'subscribe' } },\n `[channel] subscription ${operationName} subscribe threw`\n );\n startPolling();\n }\n\n return () => {\n cancelled = true;\n if (unsubSub) {\n try {\n unsubSub();\n } catch {\n /* noop */\n }\n }\n if (pollTimer) clearInterval(pollTimer);\n };\n // Only re-create when key inputs change. variablesKey is the stable\n // JSON projection of variables.\n }, [enabled, query, operationName, variablesKey, pollIntervalMs]);\n}\n\n// Subscription documents — kept inline as strings to avoid coupling codegen\n// to subscriptions that aren't always on the gateway. The defensive hook\n// detects \"unknown field\" responses and falls back to polling automatically.\n\nexport const CHANNEL_HEALTH_CHANGED_SUBSCRIPTION = /* GraphQL */ `\n subscription ChannelHealthChanged($organizationId: ID!) {\n channelHealthChanged(organizationId: $organizationId) {\n channelId\n previousHealth\n currentHealth\n timestamp\n }\n }\n`;\n\nexport const DELIVERY_UPDATED_SUBSCRIPTION = /* GraphQL */ `\n subscription DeliveryUpdated($channelId: ID!) {\n deliveryUpdated(channelId: $channelId) {\n id\n channelId\n status\n }\n }\n`;\n\nexport const WEBHOOK_RECEIVED_SUBSCRIPTION = /* GraphQL */ `\n subscription WebhookReceived($channelId: ID!) {\n webhookReceived(channelId: $channelId) {\n id\n channelId\n eventType\n status\n }\n }\n`;\n\nexport const CONNECTION_STATUS_CHANGED_SUBSCRIPTION = /* GraphQL */ `\n subscription ConnectionStatusChanged($organizationId: ID!) {\n connectionStatusChanged(organizationId: $organizationId) {\n id\n channelId\n isHealthy\n isActive\n }\n }\n`;\n"],"mappings":";;;AAqCA,SAAS,EAAoB,GAAuB;CAOlD,IAAM,KALJ,aAAe,QACX,EAAI,UACJ,OAAO,KAAQ,WACb,IACE,GAAqC,WAAW,IACxC,aAAa;AAC/B,QACE,EAAM,SAAS,qBA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A;QAAE,QAAQ;QAAW,SAAS;SAAE;SAAe,OAAO;SAAW;QAAE,EACnE,0BAA0B,EAAc,gBACzC;;;;IAIP,QAAQ,MAAQ;AAEd,SAAI,EAAoB,EAAI,EAAE;AAC5B,SAAc;AACd;;AAQF,KALA,EACE,GACA;MAAE,QAAQ;MAAW,SAAS;OAAE;OAAe,OAAO;OAAa;MAAE,EACrE,0BAA0B,EAAc,kBACzC,EACD,GAAc;;IAEhB,gBAAgB;AAEd,KAAK,KAAW,GAAc;;IAEjC,CACF;WACM,GAAK;AAOZ,GALA,EACE,GACA;IAAE,QAAQ;IAAW,SAAS;KAAE;KAAe,OAAO;KAAa;IAAE,EACrE,0BAA0B,EAAc,kBACzC,EACD,GAAc;;AAGhB,eAAa;AAEX,OADA,IAAY,IACR,EACF,KAAI;AACF,OAAU;WACJ;AAIV,GAAI,KAAW,cAAc,EAAU;;IAIxC;EAAC;EAAS;EAAO;EAhHC,QAAc,KAAK,UAAU,KAAa,EAAE,CAAC,EAAE,CAAC,EAAU,CAAC;EAgH/B;EAAe,CAAC;;AAOnE,IAAa,IAAoD,yNAWpD,IAA8C,4JAU9C,IAA8C,6KAW9C,IAAuD"}
|
|
1
|
+
{"version":3,"file":"useChannelSubscription.js","names":[],"sources":["../../../src/channel/hooks/useChannelSubscription.ts"],"sourcesContent":["/**\n * useChannelSubscription\n *\n * Defensive subscription wrapper. Probes the shell-provided graphql-ws client\n * (`globalThis.__burdenoffShell.graphqlWsClient`); if present, opens a\n * subscription and dispatches each payload to `onData`. If absent — or if the\n * subscription errors with a clear \"unknown field\" / \"not implemented\" signal\n * (the operation isn't on the gateway yet) — silently falls back to a polling\n * loop driven by the caller's `pollFn` at `pollIntervalMs`.\n *\n * Per task 5: backends may grow `webhookReceived`, `connectionStatusChanged`\n * etc. independently; this hook lets the FE wire all four pages without\n * crashing when a subscription isn't yet on the federated schema.\n */\n\nimport { useEffect, useMemo, useRef } from 'react';\nimport { getGraphqlWsClient } from '../utils/shellBridge';\nimport { reportShellError } from '../utils/shellBridge';\n\nexport interface UseChannelSubscriptionArgs<TData> {\n /** GraphQL subscription document (string SDL). */\n query: string;\n /** Variables for the subscription. */\n variables?: Record<string, unknown>;\n /** Stable identifier for this subscription, used in error context. */\n operationName: string;\n /** Called for each payload received from the subscription. */\n onData: (data: TData) => void;\n /** Polling fallback invoked when subscription is unavailable / failed. */\n pollFn: () => Promise<void> | void;\n /** Polling interval in ms (default 15s). */\n pollIntervalMs?: number;\n /** Whether to enable the hook at all. */\n enabled?: boolean;\n}\n\n/** Best-effort detector for \"subscription field not found\" errors. */\nfunction isUnknownFieldError(err: unknown): boolean {\n const msg =\n err instanceof Error\n ? err.message\n : typeof err === 'string'\n ? err\n : ((err as { message?: string } | null)?.message ?? '');\n const lower = msg.toLowerCase();\n return (\n lower.includes('cannot query field') ||\n lower.includes('unknown field') ||\n lower.includes('subscription not supported') ||\n lower.includes('not implemented')\n );\n}\n\nexport function useChannelSubscription<TData = unknown>({\n query,\n variables,\n operationName,\n onData,\n pollFn,\n pollIntervalMs = 15_000,\n enabled = true,\n}: UseChannelSubscriptionArgs<TData>) {\n // Refs to onData / pollFn / variables so we don't re-subscribe on every\n // render. Updates happen inside an effect (not during render) per\n // react-hooks/refs.\n const onDataRef = useRef(onData);\n const pollFnRef = useRef(pollFn);\n const variablesRef = useRef(variables);\n useEffect(() => {\n onDataRef.current = onData;\n pollFnRef.current = pollFn;\n variablesRef.current = variables;\n }, [onData, pollFn, variables]);\n\n // Stable JSON of variables for the dependency array — avoids re-subscribing\n // when callers pass a new object literal each render with the same shape.\n const variablesKey = useMemo(() => JSON.stringify(variables ?? {}), [variables]);\n\n useEffect(() => {\n if (!enabled) return;\n\n const wsClient = getGraphqlWsClient();\n let pollTimer: ReturnType<typeof setInterval> | null = null;\n let unsubSub: (() => void) | null = null;\n let cancelled = false;\n\n const startPolling = () => {\n if (pollTimer) return;\n // Kick once immediately, then on interval.\n void Promise.resolve(pollFnRef.current()).catch(() => {});\n pollTimer = setInterval(() => {\n if (cancelled) return;\n void Promise.resolve(pollFnRef.current()).catch(() => {});\n }, pollIntervalMs);\n };\n\n if (!wsClient) {\n // No graphql-ws on the shell yet — fall back to polling.\n startPolling();\n return () => {\n cancelled = true;\n if (pollTimer) clearInterval(pollTimer);\n };\n }\n\n try {\n unsubSub = wsClient.subscribe(\n { query, variables: variablesRef.current, operationName },\n {\n next: (msg) => {\n if (cancelled) return;\n if (msg?.errors && msg.errors.length > 0) {\n // Probe error: if the field doesn't exist, fall back to polling.\n if (msg.errors.some(isUnknownFieldError)) {\n if (unsubSub) {\n try {\n unsubSub();\n } catch {\n /* noop */\n }\n unsubSub = null;\n }\n startPolling();\n return;\n }\n // Other errors — surface to SRE but keep the subscription open.\n reportShellError(\n new Error(`Subscription ${operationName} returned errors`),\n { module: 'channel', context: { operationName, errors: msg.errors } },\n `[channel] subscription ${operationName} errors`\n );\n return;\n }\n if (msg?.data) {\n try {\n onDataRef.current(msg.data as TData);\n } catch (handlerErr) {\n reportShellError(\n handlerErr,\n { module: 'channel', context: { operationName, phase: 'handler' } },\n `[channel] subscription ${operationName} handler threw`\n );\n }\n }\n },\n error: (err) => {\n // Subscription couldn't be opened (closed/unknown-field/etc).\n if (isUnknownFieldError(err)) {\n startPolling();\n return;\n }\n // Real transport error — log and fall back to polling defensively.\n reportShellError(\n err,\n { module: 'channel', context: { operationName, phase: 'transport' } },\n `[channel] subscription ${operationName} transport error`\n );\n startPolling();\n },\n complete: () => {\n // Server closed the stream cleanly — keep data fresh via polling.\n if (!cancelled) startPolling();\n },\n }\n );\n } catch (err) {\n // Defensive: client.subscribe threw synchronously — fall back.\n reportShellError(\n err,\n { module: 'channel', context: { operationName, phase: 'subscribe' } },\n `[channel] subscription ${operationName} subscribe threw`\n );\n startPolling();\n }\n\n return () => {\n cancelled = true;\n if (unsubSub) {\n try {\n unsubSub();\n } catch {\n /* noop */\n }\n }\n if (pollTimer) clearInterval(pollTimer);\n };\n // Only re-create when key inputs change. variablesKey is the stable\n // JSON projection of variables.\n }, [enabled, query, operationName, variablesKey, pollIntervalMs]);\n}\n\n// Subscription documents — kept inline as strings to avoid coupling codegen\n// to subscriptions that aren't always on the gateway. The defensive hook\n// detects \"unknown field\" responses and falls back to polling automatically.\n\nexport const CHANNEL_HEALTH_CHANGED_SUBSCRIPTION = /* GraphQL */ `\n subscription ChannelHealthChanged($organizationId: ID!) {\n channelHealthChanged(organizationId: $organizationId) {\n channelId\n previousHealth\n newHealth\n changedAt\n reason\n }\n }\n`;\n\nexport const DELIVERY_STATUS_UPDATE_SUBSCRIPTION = /* GraphQL */ `\n subscription OnDeliveryStatusUpdate($notificationId: ID!, $organizationId: ID!) {\n onDeliveryStatusUpdate(notificationId: $notificationId, organizationId: $organizationId) {\n notificationId\n messageId\n status\n timestamp\n }\n }\n`;\n\nexport const WEBHOOK_RECEIVED_SUBSCRIPTION = /* GraphQL */ `\n subscription WebhookReceived($channelId: ID!) {\n webhookReceived(channelId: $channelId) {\n channelId\n organizationId\n webhookEventId\n receivedAt\n platform\n processingStatus\n }\n }\n`;\n\nexport const CONNECTION_STATUS_CHANGED_SUBSCRIPTION = /* GraphQL */ `\n subscription ConnectionStatusChanged($channelId: ID!) {\n connectionStatusChanged(channelId: $channelId) {\n channelId\n organizationId\n connectionId\n isActive\n isHealthy\n changedAt\n reason\n }\n }\n`;\n"],"mappings":";;;AAqCA,SAAS,EAAoB,GAAuB;CAOlD,IAAM,KALJ,aAAe,QACX,EAAI,UACJ,OAAO,KAAQ,WACb,IACE,GAAqC,WAAW,IACxC,aAAa;AAC/B,QACE,EAAM,SAAS,qBAAqB,IACpC,EAAM,SAAS,gBAAgB,IAC/B,EAAM,SAAS,6BAA6B,IAC5C,EAAM,SAAS,kBAAkB;;AAIrC,SAAgB,EAAwC,EACtD,UACA,cACA,kBACA,WACA,WACA,oBAAiB,MACjB,aAAU,MAC0B;CAIpC,IAAM,IAAY,EAAO,EAAO,EAC1B,IAAY,EAAO,EAAO,EAC1B,IAAe,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