@burdenoff/microfe-integrations 2026.1117.1 → 2026.1117.2

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.
@@ -25,17 +25,17 @@ function y(e) {
25
25
  };
26
26
  }
27
27
  function b(e) {
28
- let { workspaceId: t } = p(), { data: n, loading: r, error: i, refetch: o } = a({
28
+ let { workspaceId: t } = p(), { data: n, previousData: r, loading: i, error: o, refetch: s } = a({
29
29
  variables: { id: e },
30
30
  skip: !t || !e,
31
31
  errorPolicy: "all"
32
- }), s = n?.getConnection !== void 0;
32
+ }), c = r?.getConnection, l = n?.getConnection == null && o && c?.id === e ? c : n?.getConnection, u = l !== void 0;
33
33
  return {
34
- connection: n?.getConnection ? h(n.getConnection) : null,
35
- loading: r,
36
- answered: s,
37
- error: i,
38
- refetch: o
34
+ connection: l ? h(l) : null,
35
+ loading: i,
36
+ answered: u,
37
+ error: o,
38
+ refetch: s
39
39
  };
40
40
  }
41
41
  function x(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"useConnections.js","names":["useConnections","useIntegrations","useGetConnectionsQuery","workspaceId","answered","data","mapConnection","item","useConnection","useGetConnectionQuery","id","useConnectionsByProvider","useGetConnectionsByProviderQuery","providerId","useCreateConnection","mutate","useCreateConnectionMutation","eventBus","useIntegrationsEventBus","useCallback","input","useDeleteConnection","useDeleteConnectionMutation","useSetConnectionSelfHostedRelease","useSetConnectionSelfHostedReleaseMutation","updated","useInitiateOAuth","useInitiateOAuthMutation","result","useAuthenticateWithApiKey","useAuthenticateWithApiKeyMutation","useAuthenticateWithBasicAuth","useAuthenticateWithBasicAuthMutation","useAuthenticateWithBearerToken","useAuthenticateWithBearerTokenMutation","AUTHENTICATE_WITH_SERVICE_ACCOUNT","useAuthenticateWithServiceAccount","useMutation","AUTHENTICATE_WITH_CUSTOM_CONFIG","useAuthenticateWithCustomConfig","useRefreshToken","useRefreshConnectionTokenMutation","useRevokeConnection","useRevokeConnectionMutation","useTestConnection","useTestConnectionMutation"],"sources":["../../../src/integrations/hooks/useConnections.ts"],"sourcesContent":["/**\n * Custom hooks wrapping GraphQL queries and mutations for connections.\n */\n\nimport { useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n useGetConnectionsQuery,\n useGetConnectionQuery,\n useGetConnectionsByProviderQuery,\n useCreateConnectionMutation,\n useInitiateOAuthMutation,\n useAuthenticateConnectionMutation,\n useAuthenticateWithApiKeyMutation,\n useAuthenticateWithBasicAuthMutation,\n useAuthenticateWithBearerTokenMutation,\n useRefreshConnectionTokenMutation,\n useRevokeConnectionMutation,\n useTestConnectionMutation,\n useDeleteConnectionMutation,\n useSetConnectionSelfHostedReleaseMutation,\n} from '../../generated/wspace-operations';\nimport type { ConnectionAccessFilter } from '../../generated/wspace-types';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { useIntegrationsEventBus } from '../events/useIntegrationsEventBus';\nimport { mapConnection } from '../utils/mappers';\nimport type {\n IntegrationConnection,\n ConnectionStatus,\n OAuthInitiationResult,\n ConnectionTestResult,\n} from '../types';\n\n/**\n * A query we never asked is NOT an empty result.\n *\n * ★★ THE BUG THIS EXISTS TO PREVENT. Apollo returns `loading: false`,\n * `error: undefined`, `data: undefined` for a SKIPPED query — identical, from a\n * caller's point of view, to a query that ran and found nothing. Pages then\n * render their empty state and tell the user, definitively, that they have no\n * connections.\n *\n * Measured in production 2026-09-13: `/integrations/connections` showed\n * \"No connections yet\" while the workspace held **46** connections — 8 ACTIVE\n * (Gmail, GitHub, Google Sheets, Linear, Anthropic), 1 EXPIRED, 37 PENDING_AUTH.\n * The assistant, asked the same question through the API, listed all 46. No\n * request left the browser and no error appeared anywhere.\n *\n * `workspaceId` is falsy whenever the active context has not resolved — and the\n * shell passes `activeContext.workspaceId ?? \"\"`, so \"not yet known\" arrives as\n * an empty string, which is falsy. Any render in that window produces a\n * confident, wrong answer.\n *\n * So `notReady` is returned separately and callers MUST NOT treat it as empty.\n * It is deliberately not folded into `loading`: a caller that shows a spinner is\n * right, and a caller that ignores it still cannot mistake it for \"none\".\n */\n\n// ─── Query Hooks ────────────────────────────────────────────────────────────\n\ninterface ConnectionFilterOptions {\n status?: ConnectionStatus;\n providerId?: string;\n search?: string;\n /** BOFF-9726: only the caller's own connections, or those shared with them. */\n access?: ConnectionAccessFilter;\n}\n\nexport function useConnections(filter?: ConnectionFilterOptions) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsQuery({\n variables: { filter, pagination: { limit: 100 } },\n skip: !workspaceId,\n errorPolicy: 'all',\n });\n\n // ★ Keyed on the ABSENCE OF DATA, not on why it is absent. A skipped query, a\n // query still in flight and a query that resolved from an empty cache entry all\n // land here, and none of them is evidence that the workspace has no connections.\n const answered = data?.getConnections !== undefined;\n\n const connections: IntegrationConnection[] = (data?.getConnections?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return {\n connections,\n total: data?.getConnections?.total ?? 0,\n loading,\n // ★ False until the server has actually told us. Callers MUST gate their\n // empty state on this — see the note above.\n answered,\n error,\n refetch,\n };\n}\n\nexport function useConnection(id: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionQuery({\n variables: { id },\n skip: !workspaceId || !id,\n errorPolicy: 'all',\n });\n\n const answered = data?.getConnection !== undefined;\n\n const connection: IntegrationConnection | null = data?.getConnection\n ? mapConnection(data.getConnection as Record<string, unknown>)\n : null;\n\n return { connection, loading, answered, error, refetch };\n}\n\nexport function useConnectionsByProvider(providerId: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsByProviderQuery({\n variables: { providerId, pagination: { limit: 100 } },\n skip: !workspaceId || !providerId,\n errorPolicy: 'all',\n });\n\n const connections: IntegrationConnection[] = (data?.getConnectionsByProvider?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return {\n connections,\n total: data?.getConnectionsByProvider?.total ?? 0,\n loading,\n error,\n refetch,\n };\n}\n\n// ─── Mutation Hooks ─────────────────────────────────────────────────────────\n\nexport function useCreateConnection() {\n const [mutate, { loading }] = useCreateConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const createConnection = useCallback(\n async (input: {\n name: string;\n description?: string;\n providerId: string;\n authMethodKey?: string;\n vaultId?: string;\n credentialSecretId?: string;\n managedSecretName?: string;\n config?: Record<string, unknown>;\n }) => {\n const result = await mutate({ variables: { input } });\n const id = result.data?.createConnection?.id as string | undefined;\n if (id) {\n eventBus.emit('integrations:connection-created', {\n connectionId: id,\n providerKey: input.providerId,\n });\n }\n return id;\n },\n [mutate, eventBus]\n );\n\n return { createConnection, loading };\n}\n\nexport function useDeleteConnection() {\n const [mutate, { loading }] = useDeleteConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const deleteConnection = useCallback(\n async (id: string, deleteVaultSecret = false) => {\n await mutate({ variables: { id, deleteVaultSecret } });\n eventBus.emit('integrations:connection-deleted', { connectionId: id });\n },\n [mutate, eventBus]\n );\n\n return { deleteConnection, loading };\n}\n\n/**\n * BOFF-13612: let self-hosted FluidGrids workers receive a connection's\n * long-lived credential, or stop them. Workspace administrators only; the\n * answer updates the cached connection, so the detail page re-renders.\n */\nexport function useSetConnectionSelfHostedRelease() {\n const [mutate, { loading }] = useSetConnectionSelfHostedReleaseMutation();\n\n const setSelfHostedRelease = useCallback(\n async (connectionId: string, allow: boolean): Promise<boolean> => {\n const result = await mutate({ variables: { connectionId, allow } });\n const updated = result.data?.setConnectionSelfHostedRelease;\n if (!updated) throw new Error('The connection did not answer with its new setting');\n return updated.allowSelfHosted;\n },\n [mutate]\n );\n\n return { setSelfHostedRelease, loading };\n}\n\nexport function useInitiateOAuth() {\n const [mutate, { loading }] = useInitiateOAuthMutation();\n const eventBus = useIntegrationsEventBus();\n\n const initiateOAuth = useCallback(\n async (\n connectionId: string,\n redirectUri: string,\n providerKey: string,\n scopes?: string[]\n ): Promise<OAuthInitiationResult | null> => {\n eventBus.emit('integrations:oauth-started', { connectionId, providerKey });\n const result = await mutate({ variables: { input: { connectionId, redirectUri, scopes } } });\n if (result.error) {\n eventBus.emit('integrations:oauth-failed', {\n connectionId,\n providerKey,\n error: result.error.message,\n });\n }\n return result.data?.initiateOAuth ?? null;\n },\n [mutate, eventBus]\n );\n\n return { initiateOAuth, loading };\n}\n\n/**\n * Authenticate a connection with values shaped by its auth method's schema.\n *\n * Generic replacement for the per-auth-type hooks below: the caller passes\n * whatever the rendered form collected, so a new auth type needs no new hook,\n * no new mutation document and no new branch at the call site.\n */\nexport function useAuthenticateConnection() {\n const [mutate, { loading }] = useAuthenticateConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateConnection = useCallback(\n async (\n connectionId: string,\n authMethodKey: string | undefined,\n values: Record<string, unknown>\n ) => {\n const result = await mutate({\n variables: { input: { connectionId, authMethodKey, values } },\n });\n return result.data?.authenticateConnection;\n },\n [mutate]\n );\n\n return { authenticateConnection, loading };\n}\n\nexport function useAuthenticateWithApiKey() {\n const [mutate, { loading }] = useAuthenticateWithApiKeyMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithApiKey = useCallback(\n async (connectionId: string, apiKey: string) => {\n const result = await mutate({ variables: { input: { connectionId, apiKey } } });\n return result.data?.authenticateWithApiKey;\n },\n [mutate]\n );\n\n return { authenticateWithApiKey, loading };\n}\n\nexport function useAuthenticateWithBasicAuth() {\n const [mutate, { loading }] = useAuthenticateWithBasicAuthMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBasicAuth = useCallback(\n async (connectionId: string, username: string, password: string) => {\n const result = await mutate({ variables: { input: { connectionId, username, password } } });\n return result.data?.authenticateWithBasicAuth;\n },\n [mutate]\n );\n\n return { authenticateWithBasicAuth, loading };\n}\n\nexport function useAuthenticateWithBearerToken() {\n const [mutate, { loading }] = useAuthenticateWithBearerTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBearerToken = useCallback(\n async (connectionId: string, token: string) => {\n const result = await mutate({ variables: { input: { connectionId, token } } });\n return result.data?.authenticateWithBearerToken;\n },\n [mutate]\n );\n\n return { authenticateWithBearerToken, loading };\n}\n\n/**\n * GraphQL document for the first-party SERVICE_ACCOUNT auth flow. Defined inline\n * (rather than via codegen) so it does not depend on a fresh `schema:pull` from\n * a gateway that already exposes the new `authenticateWithServiceAccount`\n * mutation. Once the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_SERVICE_ACCOUNT = gql`\n mutation AuthenticateWithServiceAccount($input: ServiceAccountAuthInput!) {\n authenticateWithServiceAccount(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a first-party SERVICE_ACCOUNT provider (e.g. Burdenoff). No user\n * credentials are collected — the platform mints an app-as-user token per\n * execution. Calling this records the user's consent (delegation) for the\n * reserved app and activates the connection.\n */\nexport function useAuthenticateWithServiceAccount() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithServiceAccount: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; scopes?: string[] } }\n >(AUTHENTICATE_WITH_SERVICE_ACCOUNT, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithServiceAccount = useCallback(\n async (connectionId: string, scopes?: string[]) => {\n const result = await mutate({ variables: { input: { connectionId, scopes } } });\n return result.data?.authenticateWithServiceAccount;\n },\n [mutate]\n );\n\n return { authenticateWithServiceAccount, loading };\n}\n\n/**\n * GraphQL document for CUSTOM provider auth (configSchema-driven config, e.g.\n * Google Workspace Admin domain-wide delegation). Defined inline (rather than\n * via codegen) so it does not depend on a fresh `schema:pull` from a gateway\n * that already exposes the new `authenticateWithCustomConfig` mutation. Once\n * the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_CUSTOM_CONFIG = gql`\n mutation AuthenticateWithCustomConfig($input: CustomConfigAuthInput!) {\n authenticateWithCustomConfig(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a CUSTOM provider with a configSchema-shaped config object. The full\n * config is stored inside the encrypted credential payload (secrets never hit\n * plain columns); the connection becomes ACTIVE immediately.\n */\nexport function useAuthenticateWithCustomConfig() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithCustomConfig: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; config: Record<string, unknown> } }\n >(AUTHENTICATE_WITH_CUSTOM_CONFIG, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithCustomConfig = useCallback(\n async (connectionId: string, config: Record<string, unknown>) => {\n const result = await mutate({ variables: { input: { connectionId, config } } });\n return result.data?.authenticateWithCustomConfig;\n },\n [mutate]\n );\n\n return { authenticateWithCustomConfig, loading };\n}\n\nexport function useRefreshToken() {\n const [mutate, { loading }] = useRefreshConnectionTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const refreshToken = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.refreshConnectionToken) {\n eventBus.emit('integrations:token-refreshed', { connectionId });\n }\n return result.data?.refreshConnectionToken;\n },\n [mutate, eventBus]\n );\n\n return { refreshToken, loading };\n}\n\nexport function useRevokeConnection() {\n const [mutate, { loading }] = useRevokeConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const revokeConnection = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.revokeConnection) {\n eventBus.emit('integrations:token-revoked', { connectionId });\n }\n return result.data?.revokeConnection;\n },\n [mutate, eventBus]\n );\n\n return { revokeConnection, loading };\n}\n\nexport function useTestConnection() {\n const [mutate, { loading }] = useTestConnectionMutation();\n\n const testConnection = useCallback(\n async (connectionId: string): Promise<ConnectionTestResult | null> => {\n const result = await mutate({ variables: { connectionId } });\n return result.data?.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wB;CAazC,OAAO;EAAE,kBAXgBC,EACvB,OAAO,MAAyB;GAC9B,IAAMS,IAAS,MAAMb,EAAO,EAAE,WAAW,EAAE,gBAAa,EAAE,CAAC;GAI3D,OAHIa,EAAO,MAAM,oBACfX,EAAS,KAAK,8BAA8B,EAAE,gBAAa,CAAC,GAEvDW,EAAO,MAAM;EACtB,GACA,CAACb,GAAQE,CAAQ,CAGV;EAAkB;CAAQ;AACrC;AAEA,SAAgB2B,IAAoB;CAClC,IAAM,CAAC7B,GAAQ,EAAE,gBAAa8B,EAA0B;CAUxD,OAAO;EAAE,gBARc1B,EACrB,OAAO,OAEE,MADcJ,EAAO,EAAE,WAAW,EAAE,gBAAa,EAAE,CAAC,EAAA,CAC7C,MAAM,kBAAkB,MAExC,CAACA,CAAM,CAGA;EAAgB;CAAQ;AACnC"}
1
+ {"version":3,"file":"useConnections.js","names":["useConnections","useIntegrations","useGetConnectionsQuery","workspaceId","answered","data","mapConnection","item","useConnection","useGetConnectionQuery","id","previous","previousData","current","error","useConnectionsByProvider","useGetConnectionsByProviderQuery","providerId","useCreateConnection","mutate","useCreateConnectionMutation","eventBus","useIntegrationsEventBus","useCallback","input","useDeleteConnection","useDeleteConnectionMutation","useSetConnectionSelfHostedRelease","useSetConnectionSelfHostedReleaseMutation","updated","useInitiateOAuth","useInitiateOAuthMutation","result","useAuthenticateWithApiKey","useAuthenticateWithApiKeyMutation","useAuthenticateWithBasicAuth","useAuthenticateWithBasicAuthMutation","useAuthenticateWithBearerToken","useAuthenticateWithBearerTokenMutation","AUTHENTICATE_WITH_SERVICE_ACCOUNT","useAuthenticateWithServiceAccount","useMutation","AUTHENTICATE_WITH_CUSTOM_CONFIG","useAuthenticateWithCustomConfig","useRefreshToken","useRefreshConnectionTokenMutation","useRevokeConnection","useRevokeConnectionMutation","useTestConnection","useTestConnectionMutation"],"sources":["../../../src/integrations/hooks/useConnections.ts"],"sourcesContent":["/**\n * Custom hooks wrapping GraphQL queries and mutations for connections.\n */\n\nimport { useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n useGetConnectionsQuery,\n useGetConnectionQuery,\n useGetConnectionsByProviderQuery,\n useCreateConnectionMutation,\n useInitiateOAuthMutation,\n useAuthenticateConnectionMutation,\n useAuthenticateWithApiKeyMutation,\n useAuthenticateWithBasicAuthMutation,\n useAuthenticateWithBearerTokenMutation,\n useRefreshConnectionTokenMutation,\n useRevokeConnectionMutation,\n useTestConnectionMutation,\n useDeleteConnectionMutation,\n useSetConnectionSelfHostedReleaseMutation,\n} from '../../generated/wspace-operations';\nimport type { ConnectionAccessFilter } from '../../generated/wspace-types';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { useIntegrationsEventBus } from '../events/useIntegrationsEventBus';\nimport { mapConnection } from '../utils/mappers';\nimport type {\n IntegrationConnection,\n ConnectionStatus,\n OAuthInitiationResult,\n ConnectionTestResult,\n} from '../types';\n\n/**\n * A query we never asked is NOT an empty result.\n *\n * ★★ THE BUG THIS EXISTS TO PREVENT. Apollo returns `loading: false`,\n * `error: undefined`, `data: undefined` for a SKIPPED query — identical, from a\n * caller's point of view, to a query that ran and found nothing. Pages then\n * render their empty state and tell the user, definitively, that they have no\n * connections.\n *\n * Measured in production 2026-09-13: `/integrations/connections` showed\n * \"No connections yet\" while the workspace held **46** connections — 8 ACTIVE\n * (Gmail, GitHub, Google Sheets, Linear, Anthropic), 1 EXPIRED, 37 PENDING_AUTH.\n * The assistant, asked the same question through the API, listed all 46. No\n * request left the browser and no error appeared anywhere.\n *\n * `workspaceId` is falsy whenever the active context has not resolved — and the\n * shell passes `activeContext.workspaceId ?? \"\"`, so \"not yet known\" arrives as\n * an empty string, which is falsy. Any render in that window produces a\n * confident, wrong answer.\n *\n * So `notReady` is returned separately and callers MUST NOT treat it as empty.\n * It is deliberately not folded into `loading`: a caller that shows a spinner is\n * right, and a caller that ignores it still cannot mistake it for \"none\".\n */\n\n// ─── Query Hooks ────────────────────────────────────────────────────────────\n\ninterface ConnectionFilterOptions {\n status?: ConnectionStatus;\n providerId?: string;\n search?: string;\n /** BOFF-9726: only the caller's own connections, or those shared with them. */\n access?: ConnectionAccessFilter;\n}\n\nexport function useConnections(filter?: ConnectionFilterOptions) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsQuery({\n variables: { filter, pagination: { limit: 100 } },\n skip: !workspaceId,\n errorPolicy: 'all',\n });\n\n // ★ Keyed on the ABSENCE OF DATA, not on why it is absent. A skipped query, a\n // query still in flight and a query that resolved from an empty cache entry all\n // land here, and none of them is evidence that the workspace has no connections.\n const answered = data?.getConnections !== undefined;\n\n const connections: IntegrationConnection[] = (data?.getConnections?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return {\n connections,\n total: data?.getConnections?.total ?? 0,\n loading,\n // ★ False until the server has actually told us. Callers MUST gate their\n // empty state on this — see the note above.\n answered,\n error,\n refetch,\n };\n}\n\nexport function useConnection(id: string) {\n const { workspaceId } = useIntegrations();\n const { data, previousData, loading, error, refetch } = useGetConnectionQuery({\n variables: { id },\n skip: !workspaceId || !id,\n errorPolicy: 'all',\n });\n\n // A failed background refetch (errorPolicy 'all') can come back with no\n // data. Keep showing the connection already loaded for this same id, so the\n // detail page — and an open Reconnect sign-in — survives a transient error\n // (BOFF-11875). A different id never reuses the previous record.\n const previous = previousData?.getConnection;\n const keepPrevious = data?.getConnection == null && Boolean(error) && previous?.id === id;\n const current = keepPrevious ? previous : data?.getConnection;\n\n const answered = current !== undefined;\n\n const connection: IntegrationConnection | null = current\n ? mapConnection(current as Record<string, unknown>)\n : null;\n\n return { connection, loading, answered, error, refetch };\n}\n\nexport function useConnectionsByProvider(providerId: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsByProviderQuery({\n variables: { providerId, pagination: { limit: 100 } },\n skip: !workspaceId || !providerId,\n errorPolicy: 'all',\n });\n\n const connections: IntegrationConnection[] = (data?.getConnectionsByProvider?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return {\n connections,\n total: data?.getConnectionsByProvider?.total ?? 0,\n loading,\n error,\n refetch,\n };\n}\n\n// ─── Mutation Hooks ─────────────────────────────────────────────────────────\n\nexport function useCreateConnection() {\n const [mutate, { loading }] = useCreateConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const createConnection = useCallback(\n async (input: {\n name: string;\n description?: string;\n providerId: string;\n authMethodKey?: string;\n vaultId?: string;\n credentialSecretId?: string;\n managedSecretName?: string;\n config?: Record<string, unknown>;\n }) => {\n const result = await mutate({ variables: { input } });\n const id = result.data?.createConnection?.id as string | undefined;\n if (id) {\n eventBus.emit('integrations:connection-created', {\n connectionId: id,\n providerKey: input.providerId,\n });\n }\n return id;\n },\n [mutate, eventBus]\n );\n\n return { createConnection, loading };\n}\n\nexport function useDeleteConnection() {\n const [mutate, { loading }] = useDeleteConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const deleteConnection = useCallback(\n async (id: string, deleteVaultSecret = false) => {\n await mutate({ variables: { id, deleteVaultSecret } });\n eventBus.emit('integrations:connection-deleted', { connectionId: id });\n },\n [mutate, eventBus]\n );\n\n return { deleteConnection, loading };\n}\n\n/**\n * BOFF-13612: let self-hosted FluidGrids workers receive a connection's\n * long-lived credential, or stop them. Workspace administrators only; the\n * answer updates the cached connection, so the detail page re-renders.\n */\nexport function useSetConnectionSelfHostedRelease() {\n const [mutate, { loading }] = useSetConnectionSelfHostedReleaseMutation();\n\n const setSelfHostedRelease = useCallback(\n async (connectionId: string, allow: boolean): Promise<boolean> => {\n const result = await mutate({ variables: { connectionId, allow } });\n const updated = result.data?.setConnectionSelfHostedRelease;\n if (!updated) throw new Error('The connection did not answer with its new setting');\n return updated.allowSelfHosted;\n },\n [mutate]\n );\n\n return { setSelfHostedRelease, loading };\n}\n\nexport function useInitiateOAuth() {\n const [mutate, { loading }] = useInitiateOAuthMutation();\n const eventBus = useIntegrationsEventBus();\n\n const initiateOAuth = useCallback(\n async (\n connectionId: string,\n redirectUri: string,\n providerKey: string,\n scopes?: string[]\n ): Promise<OAuthInitiationResult | null> => {\n eventBus.emit('integrations:oauth-started', { connectionId, providerKey });\n const result = await mutate({ variables: { input: { connectionId, redirectUri, scopes } } });\n if (result.error) {\n eventBus.emit('integrations:oauth-failed', {\n connectionId,\n providerKey,\n error: result.error.message,\n });\n }\n return result.data?.initiateOAuth ?? null;\n },\n [mutate, eventBus]\n );\n\n return { initiateOAuth, loading };\n}\n\n/**\n * Authenticate a connection with values shaped by its auth method's schema.\n *\n * Generic replacement for the per-auth-type hooks below: the caller passes\n * whatever the rendered form collected, so a new auth type needs no new hook,\n * no new mutation document and no new branch at the call site.\n */\nexport function useAuthenticateConnection() {\n const [mutate, { loading }] = useAuthenticateConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateConnection = useCallback(\n async (\n connectionId: string,\n authMethodKey: string | undefined,\n values: Record<string, unknown>\n ) => {\n const result = await mutate({\n variables: { input: { connectionId, authMethodKey, values } },\n });\n return result.data?.authenticateConnection;\n },\n [mutate]\n );\n\n return { authenticateConnection, loading };\n}\n\nexport function useAuthenticateWithApiKey() {\n const [mutate, { loading }] = useAuthenticateWithApiKeyMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithApiKey = useCallback(\n async (connectionId: string, apiKey: string) => {\n const result = await mutate({ variables: { input: { connectionId, apiKey } } });\n return result.data?.authenticateWithApiKey;\n },\n [mutate]\n );\n\n return { authenticateWithApiKey, loading };\n}\n\nexport function useAuthenticateWithBasicAuth() {\n const [mutate, { loading }] = useAuthenticateWithBasicAuthMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBasicAuth = useCallback(\n async (connectionId: string, username: string, password: string) => {\n const result = await mutate({ variables: { input: { connectionId, username, password } } });\n return result.data?.authenticateWithBasicAuth;\n },\n [mutate]\n );\n\n return { authenticateWithBasicAuth, loading };\n}\n\nexport function useAuthenticateWithBearerToken() {\n const [mutate, { loading }] = useAuthenticateWithBearerTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBearerToken = useCallback(\n async (connectionId: string, token: string) => {\n const result = await mutate({ variables: { input: { connectionId, token } } });\n return result.data?.authenticateWithBearerToken;\n },\n [mutate]\n );\n\n return { authenticateWithBearerToken, loading };\n}\n\n/**\n * GraphQL document for the first-party SERVICE_ACCOUNT auth flow. Defined inline\n * (rather than via codegen) so it does not depend on a fresh `schema:pull` from\n * a gateway that already exposes the new `authenticateWithServiceAccount`\n * mutation. Once the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_SERVICE_ACCOUNT = gql`\n mutation AuthenticateWithServiceAccount($input: ServiceAccountAuthInput!) {\n authenticateWithServiceAccount(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a first-party SERVICE_ACCOUNT provider (e.g. Burdenoff). No user\n * credentials are collected — the platform mints an app-as-user token per\n * execution. Calling this records the user's consent (delegation) for the\n * reserved app and activates the connection.\n */\nexport function useAuthenticateWithServiceAccount() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithServiceAccount: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; scopes?: string[] } }\n >(AUTHENTICATE_WITH_SERVICE_ACCOUNT, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithServiceAccount = useCallback(\n async (connectionId: string, scopes?: string[]) => {\n const result = await mutate({ variables: { input: { connectionId, scopes } } });\n return result.data?.authenticateWithServiceAccount;\n },\n [mutate]\n );\n\n return { authenticateWithServiceAccount, loading };\n}\n\n/**\n * GraphQL document for CUSTOM provider auth (configSchema-driven config, e.g.\n * Google Workspace Admin domain-wide delegation). Defined inline (rather than\n * via codegen) so it does not depend on a fresh `schema:pull` from a gateway\n * that already exposes the new `authenticateWithCustomConfig` mutation. Once\n * the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_CUSTOM_CONFIG = gql`\n mutation AuthenticateWithCustomConfig($input: CustomConfigAuthInput!) {\n authenticateWithCustomConfig(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a CUSTOM provider with a configSchema-shaped config object. The full\n * config is stored inside the encrypted credential payload (secrets never hit\n * plain columns); the connection becomes ACTIVE immediately.\n */\nexport function useAuthenticateWithCustomConfig() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithCustomConfig: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; config: Record<string, unknown> } }\n >(AUTHENTICATE_WITH_CUSTOM_CONFIG, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithCustomConfig = useCallback(\n async (connectionId: string, config: Record<string, unknown>) => {\n const result = await mutate({ variables: { input: { connectionId, config } } });\n return result.data?.authenticateWithCustomConfig;\n },\n [mutate]\n );\n\n return { authenticateWithCustomConfig, loading };\n}\n\nexport function useRefreshToken() {\n const [mutate, { loading }] = useRefreshConnectionTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const refreshToken = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.refreshConnectionToken) {\n eventBus.emit('integrations:token-refreshed', { connectionId });\n }\n return result.data?.refreshConnectionToken;\n },\n [mutate, eventBus]\n );\n\n return { refreshToken, loading };\n}\n\nexport function useRevokeConnection() {\n const [mutate, { loading }] = useRevokeConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const revokeConnection = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.revokeConnection) {\n eventBus.emit('integrations:token-revoked', { connectionId });\n }\n return result.data?.revokeConnection;\n },\n [mutate, eventBus]\n );\n\n return { revokeConnection, loading };\n}\n\nexport function useTestConnection() {\n const [mutate, { loading }] = useTestConnectionMutation();\n\n const testConnection = useCallback(\n async (connectionId: string): Promise<ConnectionTestResult | null> => {\n const result = await mutate({ variables: { connectionId } });\n return result.data?.testConnection ?? null;\n },\n [mutate]\n );\n\n return { testConnection, loading };\n}\n"],"mappings":";;;;;;;;AAqEA,SAAgBA,EAAe,GAAkC;CAC/D,IAAM,EAAE,mBAAgBC,EAAgB,GAClC,EAAE,SAAM,YAAS,UAAO,eAAYC,EAAuB;EAC/D,WAAW;GAAE;GAAQ,YAAY,EAAE,OAAO,IAAI;EAAE;EAChD,MAAM,CAACC;EACP,aAAa;CACf,CAAC,GAKKC,IAAWC,GAAM,mBAAmB,KAAA;CAM1C,OAAO;EACL,cAL4CA,GAAM,gBAAgB,SAAS,CAAC,EAAA,CAAG,KAC9E,MAAkCC,EAAcC,CAAI,CAIrD;EACA,OAAOF,GAAM,gBAAgB,SAAS;EACtC;EAGA;EACA;EACA;CACF;AACF;AAEA,SAAgBG,EAAc,GAAY;CACxC,IAAM,EAAE,mBAAgBP,EAAgB,GAClC,EAAE,SAAM,iBAAc,YAAS,UAAO,eAAYQ,EAAsB;EAC5E,WAAW,EAAE,MAAG;EAChB,MAAM,CAACN,KAAe,CAACO;EACvB,aAAa;CACf,CAAC,GAMKC,IAAWC,GAAc,eAEzBC,IADeR,GAAM,iBAAiB,QAAgBS,KAAUH,GAAU,OAAOD,IACxDC,IAAWN,GAAM,eAE1CD,IAAWS,MAAY,KAAA;CAM7B,OAAO;EAAE,YAJwCA,IAC7CP,EAAcO,CAAkC,IAChD;EAEiB;EAAS;EAAU;EAAO;CAAQ;AACzD;AAEA,SAAgBE,EAAyB,GAAoB;CAC3D,IAAM,EAAE,mBAAgBd,EAAgB,GAClC,EAAE,SAAM,YAAS,UAAO,eAAYe,EAAiC;EACzE,WAAW;GAAE;GAAY,YAAY,EAAE,OAAO,IAAI;EAAE;EACpD,MAAM,CAACb,KAAe,CAACc;EACvB,aAAa;CACf,CAAC;CAMD,OAAO;EACL,cAL4CZ,GAAM,0BA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A,CAACb,GAAQE,CAAQ,CAGV;EAAc;CAAQ;AACjC;AAEA,SAAgByB,IAAsB;CACpC,IAAM,CAAC3B,GAAQ,EAAE,gBAAa4B,EAA4B,EACxD,gBAAgB,CAAC,eAAe,EAClC,CAAC,GACK1B,IAAWC,EAAwB;CAazC,OAAO;EAAE,kBAXgBC,EACvB,OAAO,MAAyB;GAC9B,IAAMS,IAAS,MAAMb,EAAO,EAAE,WAAW,EAAE,gBAAa,EAAE,CAAC;GAI3D,OAHIa,EAAO,MAAM,oBACfX,EAAS,KAAK,8BAA8B,EAAE,gBAAa,CAAC,GAEvDW,EAAO,MAAM;EACtB,GACA,CAACb,GAAQE,CAAQ,CAGV;EAAkB;CAAQ;AACrC;AAEA,SAAgB2B,IAAoB;CAClC,IAAM,CAAC7B,GAAQ,EAAE,gBAAa8B,EAA0B;CAUxD,OAAO;EAAE,gBARc1B,EACrB,OAAO,OAEE,MADcJ,EAAO,EAAE,WAAW,EAAE,gBAAa,EAAE,CAAC,EAAA,CAC7C,MAAM,kBAAkB,MAExC,CAACA,CAAM,CAGA;EAAgB;CAAQ;AACnC"}
@@ -28,13 +28,13 @@ import { AlertDialog as Pe, AlertDialogAction as Fe, AlertDialogCancel as Ie, Al
28
28
  import { suggestAnchorProps as C } from "@burdenoff/fe-libs/shared/proactive";
29
29
  // src/integrations/pages/ConnectionDetail.tsx
30
30
  function w() {
31
- let { connectionId: w } = ke(), { basePath: T = "/", navigate: E, navigationV2: D = !1 } = re(), O = t(), k = ee(), A = te(), j = ne(), { connection: M, loading: Ke, error: N, refetch: P } = ae(w ?? ""), { testConnection: qe, loading: F } = le(), { refreshToken: Je, loading: Ye } = se(), { revokeConnection: Xe, loading: Ze } = ce(), { deleteConnection: Qe, loading: I } = oe(), L = Me(ie.OAUTH_REFRESH, !0), { hasPermission: R, isLoading: $e } = Ae(), z = R(n.CONNECTION_UPDATE), B = R(n.CONNECTION_DELETE), et = R(n.CONNECTION_SHARE), tt = R(n.CONNECTION_CREATE), [nt, V] = a(!1), [H, rt] = a(null), [U, it] = a(null), [at, W] = a(!1), [ot, G] = a(!1), [st, K] = a(!1), [ct, lt] = a(!1), ut = _e(M?.vaultId), q = (e, t) => {
31
+ let { connectionId: w } = ke(), { basePath: T = "/", navigate: E, navigationV2: D = !1 } = re(), O = t(), k = ee(), A = te(), j = ne(), { connection: M, loading: Ke, error: qe, refetch: N } = ae(w ?? ""), { testConnection: Je, loading: P } = le(), { refreshToken: Ye, loading: Xe } = se(), { revokeConnection: Ze, loading: F } = ce(), { deleteConnection: Qe, loading: I } = oe(), L = Me(ie.OAUTH_REFRESH, !0), { hasPermission: R, isLoading: $e } = Ae(), z = R(n.CONNECTION_UPDATE), B = R(n.CONNECTION_DELETE), et = R(n.CONNECTION_SHARE), tt = R(n.CONNECTION_CREATE), [nt, V] = a(!1), [H, rt] = a(null), [U, it] = a(null), [at, W] = a(!1), [ot, G] = a(!1), [st, K] = a(!1), [ct, lt] = a(!1), ut = _e(M?.vaultId), q = (e, t) => {
32
32
  it({
33
33
  type: e,
34
34
  message: t
35
35
  }), setTimeout(() => it(null), 5e3);
36
36
  };
37
- if (Ke || $e) return /* @__PURE__ */ g("div", {
37
+ if (Ke && !M || $e) return /* @__PURE__ */ g("div", {
38
38
  className: "flex flex-col items-center justify-center py-20",
39
39
  children: [/* @__PURE__ */ h(l, {
40
40
  size: 48,
@@ -44,7 +44,7 @@ function w() {
44
44
  children: O("integrations.connectionDetail.loading", "Loading connection details...")
45
45
  })]
46
46
  });
47
- if (N || !M) return /* @__PURE__ */ h("div", {
47
+ if (!M) return /* @__PURE__ */ h("div", {
48
48
  className: "p-6 max-w-4xl mx-auto",
49
49
  children: /* @__PURE__ */ g("div", {
50
50
  className: "rounded-xl border border-border-default bg-status-error-bg-subtle p-6 flex items-start gap-4",
@@ -60,13 +60,13 @@ function w() {
60
60
  }),
61
61
  /* @__PURE__ */ h("p", {
62
62
  className: "text-sm text-status-error-text mb-3",
63
- children: N?.message || O("integrations.connectionDetail.error.description", "The requested connection could not be loaded.")
63
+ children: qe?.message || O("integrations.connectionDetail.error.description", "The requested connection could not be loaded.")
64
64
  }),
65
65
  /* @__PURE__ */ g("div", {
66
66
  className: "flex gap-2",
67
67
  children: [/* @__PURE__ */ g("button", {
68
68
  type: "button",
69
- onClick: () => P(),
69
+ onClick: () => N(),
70
70
  className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors",
71
71
  children: [
72
72
  /* @__PURE__ */ h(Ee, { size: 14 }),
@@ -89,21 +89,21 @@ function w() {
89
89
  })
90
90
  });
91
91
  let J = async () => {
92
- let e = await qe(M.id);
92
+ let e = await Je(M.id);
93
93
  e && (rt(e), q(e.success ? "success" : "error", e.message));
94
94
  }, Y = async () => {
95
95
  try {
96
- let e = await Je(M.id);
96
+ let e = await Ye(M.id);
97
97
  xe(e) ? q("success", O("integrations.connectionDetail.notifications.refreshSuccess", "Token refreshed successfully")) : q("error", O("integrations.connectionDetail.notifications.refreshFailed", "The token could not be refreshed. Reconnect to sign in again."));
98
98
  } catch (e) {
99
99
  q("error", e instanceof Error ? e.message : O("integrations.connectionDetail.notifications.refreshFailed", "The token could not be refreshed. Reconnect to sign in again."));
100
100
  } finally {
101
- P();
101
+ N();
102
102
  }
103
103
  }, dt = async () => {
104
104
  K(!0);
105
105
  }, ft = async () => {
106
- await Xe(M.id), q("success", O("integrations.connectionDetail.notifications.revokeSuccess", "Connection revoked")), K(!1), P();
106
+ await Ze(M.id), q("success", O("integrations.connectionDetail.notifications.revokeSuccess", "Connection revoked")), K(!1), N();
107
107
  }, pt = async () => {
108
108
  ge("medium");
109
109
  let e = await he({
@@ -121,7 +121,7 @@ function w() {
121
121
  }
122
122
  }, ht = (e) => {
123
123
  e.ok ? (q("success", e.allow ? O("integrations.connectionDetail.selfHosted.allowed", "Self-hosted workers may now receive this connection’s key.") : O("integrations.connectionDetail.selfHosted.stopped", "Self-hosted workers no longer receive this connection’s key.")), i("success")) : (q("error", e.message), i("error"));
124
- }, X = F || Ye || Ze || I, Z = et && Ne(M.myAccess ?? null), Q = !!(M.vaultId || M.credentialSecretId), gt = [
124
+ }, X = P || Xe || F || I, Z = et && Ne(M.myAccess ?? null), Q = !!(M.vaultId || M.credentialSecretId), gt = [
125
125
  {
126
126
  id: "test",
127
127
  label: O("integrations.connectionDetail.nextSteps.test.label", "Test the connection"),
@@ -209,7 +209,7 @@ function w() {
209
209
  description: O("integrations.connectionDetail.confirm.revoke", "Are you sure you want to revoke this connection? This will disconnect the external service."),
210
210
  confirmLabel: O("integrations.connectionDetail.actions.revoke", "Revoke"),
211
211
  cancelLabel: O("integrations.connectionDetail.actions.cancel", "Cancel"),
212
- loading: Ze,
212
+ loading: F,
213
213
  destructive: !0,
214
214
  icon: /* @__PURE__ */ h(d, { size: 20 }),
215
215
  onConfirm: ft,
@@ -220,7 +220,7 @@ function w() {
220
220
  open: nt,
221
221
  onClose: () => V(!1),
222
222
  onShared: () => {
223
- q("success", O("integrations.connectionDetail.notifications.shareSuccess", "Sharing updated")), P();
223
+ q("success", O("integrations.connectionDetail.notifications.shareSuccess", "Sharing updated")), N();
224
224
  }
225
225
  })
226
226
  ] }), vt = tt && be(M.status), yt = M.externalAccountEmail || M.externalAccountName, $ = vt ? /* @__PURE__ */ g(v, {
@@ -245,7 +245,7 @@ function w() {
245
245
  authMethodKey: M.authMethodKey ?? null
246
246
  } : null,
247
247
  onConnectionCreated: () => {
248
- P();
248
+ N();
249
249
  }
250
250
  }),
251
251
  /* @__PURE__ */ h("div", {
@@ -306,7 +306,7 @@ function w() {
306
306
  J();
307
307
  },
308
308
  disabled: X,
309
- icon: F ? /* @__PURE__ */ h(l, {
309
+ icon: P ? /* @__PURE__ */ h(l, {
310
310
  size: 14,
311
311
  className: "animate-spin"
312
312
  }) : /* @__PURE__ */ h(m, { size: 14 })
@@ -757,7 +757,7 @@ function w() {
757
757
  J();
758
758
  },
759
759
  disabled: X,
760
- icon: F ? /* @__PURE__ */ h(l, {
760
+ icon: P ? /* @__PURE__ */ h(l, {
761
761
  size: 14,
762
762
  className: "animate-spin"
763
763
  }) : /* @__PURE__ */ h(m, { size: 14 })
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionDetail.js","names":["_Fragment","ConnectionDetail","useParams","useIntegrations","tr","useTr","getAuthTypeLabel","useAuthTypeLabel","formatLastUsed","useFormatLastUsed","formatDate","useFormatDate","useConnection","connectionId","testing","useTestConnection","refreshing","useRefreshToken","revoking","useRevokeConnection","deleting","useDeleteConnection","canRefreshToken","useFeatureFlag","INTEGRATION_FEATURE_FLAGS","permissionsLoading","usePermissions","canUpdate","hasPermission","INTEGRATION_PERMISSIONS","canDelete","canShareRole","canCreateConnection","shareOpen","setShareOpen","useState","testResult","setTestResult","notification","setNotification","deleteDialogOpen","setDeleteDialogOpen","deleteVaultSecret","setDeleteVaultSecret","revokeDialogOpen","setRevokeDialogOpen","reconnectOpen","setReconnectOpen","vaultName","useVaultName","connection","showNotification","loading","Loader2","error","AlertCircle","refetch","RefreshCw","navigate","joinPath","basePath","ArrowLeft","handleTest","result","testConnection","handleRefresh","refreshToken","isRefreshed","refreshError","handleRevoke","confirmRevoke","revokeConnection","handleDelete","nativeConfirm","confirmDelete","deleteConnection","nativeNotify","handleSelfHostedResult","outcome","actionLoading","canShare","canManageSharing","usesVaultCredentials","nextSteps","Zap","RotateCcw","Activity","overlays","Fragment","cn","CheckCircle2","XCircle","AlertDialog","next","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","navigationV2","event","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","Trash2","ConfirmDialog","Shield","ConnectionShareDialog","reconnectNow","canReconnect","signedInAs","reconnectButton","Button","AddConnectionDialog","ProviderIcon","suggestAnchorProps","ConnectionStatusBadge","PrivateConnectionBadge","CTAOverflowMenu","Share2","nativeImpact","OptionalFields","row","ShowMore","scope","SelfHostedReleaseSetting","NextSteps","ShowTechnicalDetails","RecentActivity","PagePurpose","EmphasisPanel","Mail","User","Clock","GlassCard","Key"],"sources":["../../../src/integrations/pages/ConnectionDetail.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router';\nimport {\n ArrowLeft,\n Loader2,\n AlertCircle,\n RefreshCw,\n Shield,\n Clock,\n Activity,\n CheckCircle2,\n XCircle,\n Key,\n RotateCcw,\n Zap,\n Mail,\n User,\n Trash2,\n Share2,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { useAuthTypeLabel } from '../hooks/useLabel';\nimport { useFormatLastUsed } from '../hooks/useFormatLastUsed';\nimport { useFormatDate } from '../hooks/useFormatDate';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { INTEGRATION_FEATURE_FLAGS } from '../constants/featureFlags';\nimport { joinPath } from '../utils/navigation';\nimport {\n useConnection,\n useTestConnection,\n useRefreshToken,\n useRevokeConnection,\n useDeleteConnection,\n} from '../hooks/useConnections';\nimport { ProviderIcon, canManageSharing } from '@burdenoff/fe-libs/connections';\nimport { ConnectionStatusBadge } from '../components/ConnectionStatusBadge';\nimport { ConnectionShareDialog, PrivateConnectionBadge } from '../components/ConnectionSharing';\nimport { SelfHostedReleaseSetting } from '../components/SelfHostedReleaseSetting';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n Button,\n GlassCard,\n EmphasisPanel,\n ShowMore,\n CTAOverflowMenu,\n PagePurpose,\n NextSteps,\n OptionalFields,\n ShowTechnicalDetails,\n type NextStep,\n type CTAAction,\n} from '@burdenoff/fe-libs/ui';\nimport { suggestAnchorProps } from '@burdenoff/fe-libs/shared/proactive';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { useVaultName } from '../hooks/useVaultName';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { RecentActivity } from '../components/RecentActivity';\nimport { canReconnect, isRefreshed } from '../utils/connectedApps';\n\n/**\n * Connection Detail — Single connection view with info, scopes, and action buttons.\n */\nexport function ConnectionDetail() {\n const { connectionId } = useParams<{ connectionId: string }>();\n const { basePath = '/', navigate, navigationV2 = false } = useIntegrations();\n const tr = useTr();\n const getAuthTypeLabel = useAuthTypeLabel();\n const formatLastUsed = useFormatLastUsed();\n const formatDate = useFormatDate();\n\n const { connection, loading, error, refetch } = useConnection(connectionId ?? '');\n const { testConnection, loading: testing } = useTestConnection();\n const { refreshToken, loading: refreshing } = useRefreshToken();\n const { revokeConnection, loading: revoking } = useRevokeConnection();\n const { deleteConnection, loading: deleting } = useDeleteConnection();\n const canRefreshToken = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.OAUTH_REFRESH, true);\n\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canUpdate = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_UPDATE);\n const canDelete = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_DELETE);\n const canShareRole = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_SHARE);\n // Reconnect runs the same sign-in a new connection does.\n const canCreateConnection = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n const [shareOpen, setShareOpen] = useState(false);\n\n const [testResult, setTestResult] = useState<{\n success: boolean;\n message: string;\n latencyMs: number;\n } | null>(null);\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);\n const [deleteVaultSecret, setDeleteVaultSecret] = useState(false);\n const [revokeDialogOpen, setRevokeDialogOpen] = useState(false);\n const [reconnectOpen, setReconnectOpen] = useState(false);\n const vaultName = useVaultName(connection?.vaultId);\n\n const showNotification = (type: 'success' | 'error', message: string) => {\n setNotification({ type, message });\n setTimeout(() => setNotification(null), 5000);\n };\n\n if (loading || permissionsLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n <span className=\"mt-6 text-sm font-medium text-text-secondary\">\n {tr('integrations.connectionDetail.loading', 'Loading connection details...')}\n </span>\n </div>\n );\n }\n\n if (error || !connection) {\n return (\n <div className=\"p-6 max-w-4xl mx-auto\">\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-6 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.connectionDetail.error.title', 'Connection not found')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">\n {error?.message ||\n tr(\n 'integrations.connectionDetail.error.description',\n 'The requested connection could not be loaded.'\n )}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />{' '}\n {tr('integrations.connectionDetail.error.retry', 'Try Again')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={14} />{' '}\n {tr('integrations.connectionDetail.error.back', 'Back to Connections')}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n const handleTest = async () => {\n const result = await testConnection(connection.id);\n if (result) {\n setTestResult(result);\n showNotification(result.success ? 'success' : 'error', result.message);\n }\n };\n\n // The service answers with the connection's status after the refresh; only\n // ACTIVE is a refreshed token. It used to report success whatever happened,\n // and a thrown error went unhandled.\n const handleRefresh = async () => {\n try {\n const result = await refreshToken(connection.id);\n if (isRefreshed(result)) {\n showNotification(\n 'success',\n tr(\n 'integrations.connectionDetail.notifications.refreshSuccess',\n 'Token refreshed successfully'\n )\n );\n } else {\n showNotification(\n 'error',\n tr(\n 'integrations.connectionDetail.notifications.refreshFailed',\n 'The token could not be refreshed. Reconnect to sign in again.'\n )\n );\n }\n } catch (refreshError) {\n showNotification(\n 'error',\n refreshError instanceof Error\n ? refreshError.message\n : tr(\n 'integrations.connectionDetail.notifications.refreshFailed',\n 'The token could not be refreshed. Reconnect to sign in again.'\n )\n );\n } finally {\n void refetch();\n }\n };\n\n const handleRevoke = async () => {\n setRevokeDialogOpen(true);\n };\n\n const confirmRevoke = async () => {\n await revokeConnection(connection.id);\n showNotification(\n 'success',\n tr('integrations.connectionDetail.notifications.revokeSuccess', 'Connection revoked')\n );\n setRevokeDialogOpen(false);\n refetch();\n };\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: tr('integrations.connectionDetail.deleteDialog.title', 'Delete Connection'),\n message: tr(\n 'integrations.connectionDetail.deleteDialog.message',\n // One text on every confirm path; a literal, so i18n:extract reads it.\n 'Delete this connection? This cannot be undone.'\n ),\n okButtonTitle: tr('integrations.connectionDetail.deleteDialog.confirm', 'Delete'),\n cancelButtonTitle: tr('integrations.connectionDetail.deleteDialog.cancel', 'Cancel'),\n });\n if (result === null) {\n setDeleteDialogOpen(true);\n return;\n }\n if (result) {\n await confirmDelete();\n }\n };\n\n const confirmDelete = async () => {\n try {\n await deleteConnection(connection.id, deleteVaultSecret);\n showNotification(\n 'success',\n tr('integrations.connectionDetail.notifications.deleteSuccess', 'Connection deleted')\n );\n void nativeNotify('success');\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n navigate?.(joinPath(basePath, 'connections'));\n } catch (error) {\n showNotification(\n 'error',\n error instanceof Error ? error.message : 'Failed to delete connection'\n );\n void nativeNotify('error');\n }\n };\n\n const handleSelfHostedResult = (\n outcome: { ok: true; allow: boolean } | { ok: false; message: string }\n ) => {\n if (outcome.ok) {\n showNotification(\n 'success',\n outcome.allow\n ? tr(\n 'integrations.connectionDetail.selfHosted.allowed',\n 'Self-hosted workers may now receive this connection’s key.'\n )\n : tr(\n 'integrations.connectionDetail.selfHosted.stopped',\n 'Self-hosted workers no longer receive this connection’s key.'\n )\n );\n void nativeNotify('success');\n } else {\n showNotification('error', outcome.message);\n void nativeNotify('error');\n }\n };\n\n const actionLoading = testing || refreshing || revoking || deleting;\n // BOFF-9726: the owner, editors and workspace admins choose who can use it.\n const canShare = canShareRole && canManageSharing(connection.myAccess ?? null);\n const usesVaultCredentials = Boolean(connection.vaultId || connection.credentialSecretId);\n\n const nextSteps: NextStep[] = [\n {\n id: 'test',\n label: tr('integrations.connectionDetail.nextSteps.test.label', 'Test the connection'),\n description: tr(\n 'integrations.connectionDetail.nextSteps.test.description',\n 'Run a live check to confirm credentials still work before relying on it.'\n ),\n icon: <Zap size={16} />,\n onClick: () => {\n void handleTest();\n },\n done: connection.status === 'active' && Boolean(testResult?.success),\n },\n ...(canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken\n ? [\n {\n id: 'refresh',\n label: tr(\n 'integrations.connectionDetail.nextSteps.refresh.label',\n 'Refresh the access token'\n ),\n description: tr(\n 'integrations.connectionDetail.nextSteps.refresh.description',\n 'Renew OAuth credentials if requests start failing with an auth error.'\n ),\n icon: <RotateCcw size={16} />,\n onClick: () => {\n void handleRefresh();\n },\n } satisfies NextStep,\n ]\n : []),\n {\n id: 'logs',\n label: tr('integrations.connectionDetail.nextSteps.logs.label', 'Review activity logs'),\n description: tr(\n 'integrations.connectionDetail.nextSteps.logs.description',\n 'See recent requests and errors for this connection to debug issues.'\n ),\n icon: <Activity size={16} />,\n onClick: () => navigate?.(joinPath(basePath, 'logs')),\n },\n ];\n\n const overlays = (\n <>\n {/* Notification */}\n {notification && (\n <div\n className={cn(\n 'fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200',\n notification.type === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text border-border-default'\n : 'bg-status-error-bg-subtle text-status-error-text border-border-default'\n )}\n >\n {notification.type === 'success' ? <CheckCircle2 size={20} /> : <XCircle size={20} />}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n <AlertDialog\n open={deleteDialogOpen}\n onOpenChange={(next) => {\n if (!next) {\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n }\n }}\n >\n <AlertDialogContent className=\"max-w-md\">\n <AlertDialogHeader>\n <AlertDialogTitle>\n {tr('integrations.connectionDetail.deleteDialog.title', 'Delete Connection')}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {/* One message for both confirm paths: the native confirm used a\n different default text for the same key. */}\n {navigationV2\n ? tr(\n 'integrations.connectedApps.removeMessage',\n 'Remove {{name}}? Workflows that use it stop working until you connect {{provider}} again.',\n { name: connection.name, provider: connection.provider.name }\n )\n : tr(\n 'integrations.connectionDetail.deleteDialog.message',\n // One text on every confirm path; a literal, so i18n:extract reads it.\n 'Delete this connection? This cannot be undone.'\n )}\n {usesVaultCredentials &&\n ` ${tr(\n 'integrations.connectionDetail.deleteDialog.vaultHint',\n 'You can also remove the mapped vault secret if you no longer need it.'\n )}`}\n </AlertDialogDescription>\n </AlertDialogHeader>\n\n {usesVaultCredentials && (\n <label className=\"flex items-start gap-3 rounded-lg border border-border-subtle/60 bg-bg-surface px-4 py-3 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={deleteVaultSecret}\n onChange={(event) => setDeleteVaultSecret(event.target.checked)}\n className=\"mt-0.5\"\n aria-label={tr(\n 'integrations.connectionDetail.deleteDialog.removeVaultSecret',\n 'Also remove mapped vault secret'\n )}\n />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {tr(\n 'integrations.connectionDetail.deleteDialog.removeVaultSecret',\n 'Also remove mapped vault secret'\n )}\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr(\n 'integrations.connectionDetail.deleteDialog.removeVaultSecretHint',\n 'Use this only if no other connections rely on the same secret.'\n )}\n </p>\n </div>\n </label>\n )}\n\n <AlertDialogFooter>\n <AlertDialogCancel\n onClick={() => {\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n }}\n >\n {tr('integrations.connectionDetail.deleteDialog.cancel', 'Cancel')}\n </AlertDialogCancel>\n <AlertDialogAction\n disabled={deleting}\n onClick={(event) => {\n event.preventDefault();\n confirmDelete();\n }}\n className=\"inline-flex items-center gap-2 bg-status-error-bg text-action-primary-text disabled:opacity-50\"\n >\n {deleting ? <Loader2 size={14} className=\"animate-spin\" /> : <Trash2 size={14} />}\n {tr(\n 'integrations.connectionDetail.deleteDialog.deleteConnection',\n 'Delete connection'\n )}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n\n <ConfirmDialog\n open={revokeDialogOpen}\n title={tr('integrations.connectionDetail.confirm.revokeTitle', 'Revoke connection')}\n description={tr(\n 'integrations.connectionDetail.confirm.revoke',\n 'Are you sure you want to revoke this connection? This will disconnect the external service.'\n )}\n confirmLabel={tr('integrations.connectionDetail.actions.revoke', 'Revoke')}\n cancelLabel={tr('integrations.connectionDetail.actions.cancel', 'Cancel')}\n loading={revoking}\n destructive\n icon={<Shield size={20} />}\n onConfirm={confirmRevoke}\n onCancel={() => setRevokeDialogOpen(false)}\n />\n\n {canShare && (\n <ConnectionShareDialog\n connection={connection}\n open={shareOpen}\n onClose={() => setShareOpen(false)}\n onShared={() => {\n showNotification(\n 'success',\n tr('integrations.connectionDetail.notifications.shareSuccess', 'Sharing updated')\n );\n void refetch();\n }}\n />\n )}\n </>\n );\n\n const reconnectNow = canCreateConnection && canReconnect(connection.status);\n const signedInAs = connection.externalAccountEmail || connection.externalAccountName;\n const reconnectButton = reconnectNow ? (\n <Button onClick={() => setReconnectOpen(true)} data-testid=\"connection-detail-reconnect\">\n <RotateCcw size={14} aria-hidden=\"true\" />\n {tr('integrations.connectedApps.reconnect', 'Reconnect')}\n </Button>\n ) : null;\n\n if (navigationV2) {\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n {overlays}\n <AddConnectionDialog\n open={reconnectOpen}\n onClose={() => setReconnectOpen(false)}\n reconnect={\n reconnectOpen\n ? {\n connectionId: connection.id,\n name: connection.name,\n providerId: connection.provider.id,\n authMethodKey: connection.authMethodKey ?? null,\n }\n : null\n }\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n\n {/* Level 1: name, status, who it signs in as, last used, and what to do. */}\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-6\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center\">\n <div className=\"flex min-w-0 flex-1 items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"shrink-0\"\n onClick={() => navigate?.(basePath)}\n aria-label={tr('integrations.connectionDetail.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <ProviderIcon provider={connection.provider} size={56} />\n <div className=\"min-w-0 flex-1\">\n <div\n className=\"flex flex-wrap items-center gap-3\"\n {...suggestAnchorProps({ entityType: 'connection', entityId: connection.id })}\n >\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary break-words\">\n {connection.name}\n </h1>\n <ConnectionStatusBadge status={connection.status} size=\"md\" />\n <PrivateConnectionBadge connection={connection} />\n </div>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {signedInAs\n ? tr('integrations.connectedApps.signedInAs', 'Signed in as {{account}}', {\n account: signedInAs,\n })\n : connection.provider.name}\n {' · '}\n {tr('integrations.connectionCard.lastUsed', 'Last used {{time}}', {\n time: formatLastUsed(connection.lastUsedAt),\n })}\n </p>\n </div>\n </div>\n <div className=\"flex shrink-0 flex-wrap items-center gap-2\">\n {reconnectButton}\n {/* Test is a read: anyone who can see the connection may run it. */}\n <CTAOverflowMenu\n align=\"end\"\n primary={{\n label: tr('integrations.connectedApps.test', 'Test'),\n onSelect: () => {\n void handleTest();\n },\n disabled: actionLoading,\n icon: testing ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Zap size={14} />\n ),\n }}\n actions={[\n ...(canShare\n ? [\n {\n label: tr('integrations.connectionDetail.actions.share', 'Share'),\n onSelect: () => setShareOpen(true),\n disabled: actionLoading,\n icon: <Share2 size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ...(canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken\n ? [\n {\n label: tr(\n 'integrations.connectionDetail.actions.refreshToken',\n 'Refresh Token'\n ),\n onSelect: () => {\n void handleRefresh();\n },\n disabled: actionLoading,\n icon: <RotateCcw size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ...(canDelete\n ? [\n {\n label: tr('integrations.connectionDetail.actions.revoke', 'Revoke'),\n onSelect: () => {\n void handleRevoke();\n },\n disabled: actionLoading,\n icon: <Shield size={14} />,\n } satisfies CTAAction,\n {\n label: tr('integrations.connectedApps.remove', 'Remove'),\n onSelect: () => {\n void nativeImpact('medium');\n setDeleteDialogOpen(true);\n },\n intent: 'destructive',\n disabled: actionLoading,\n icon: <Trash2 size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ]}\n />\n </div>\n </div>\n </div>\n\n {connection.errorMessage && (\n <div\n role=\"alert\"\n className=\"flex flex-col gap-3 rounded-xl border border-border-default bg-status-error-bg-subtle p-4 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex items-start gap-3\">\n <AlertCircle size={20} className=\"mt-0.5 shrink-0 text-status-error-text\" />\n <div className=\"min-w-0\">\n <p className=\"font-semibold text-status-error-text\">\n {tr('integrations.connectedApps.brokenTitle', '{{provider}} stopped working', {\n provider: connection.provider.name,\n })}\n </p>\n <p className=\"text-sm text-status-error-text break-words\">\n {connection.errorMessage}\n </p>\n </div>\n </div>\n {reconnectButton}\n </div>\n )}\n\n {testResult && (\n <div\n role=\"status\"\n className={cn(\n 'rounded-xl border p-4',\n testResult.success\n ? 'border-border-default bg-status-success-bg-subtle'\n : 'border-border-default bg-status-error-bg-subtle'\n )}\n >\n <p\n className={cn(\n 'font-semibold flex items-center gap-2',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.success ? <CheckCircle2 size={18} /> : <XCircle size={18} />}\n {testResult.success\n ? tr('integrations.connectionDetail.testResult.passed', 'Connection Test Passed')\n : tr('integrations.connectionDetail.testResult.failed', 'Connection Test Failed')}\n </p>\n <p\n className={cn(\n 'text-sm mt-1',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.message}\n </p>\n </div>\n )}\n\n {/* Level 2: one click away, remembered per person. */}\n <OptionalFields\n storageKey=\"integrations.connection-detail.more-details\"\n label={tr('integrations.connectedApps.moreDetails', 'More details')}\n >\n <div className=\"space-y-4\">\n <div className=\"space-y-3 text-sm\">\n {connection.description && (\n <div className=\"py-2 border-b border-border-seam\">\n <span className=\"text-xs text-text-secondary uppercase tracking-wide\">\n {tr('integrations.connectionDetail.fields.description', 'Description')}\n </span>\n <p className=\"text-text-primary mt-0.5\">{connection.description}</p>\n </div>\n )}\n {[\n {\n id: 'app',\n label: tr('integrations.connectionDetail.fields.provider', 'Provider'),\n value: `${connection.provider.name} · ${getAuthTypeLabel(connection.provider.authType)}`,\n },\n ...(connection.externalAccountName && connection.externalAccountEmail\n ? [\n {\n id: 'name',\n label: tr('integrations.connectionDetail.fields.name', 'Name'),\n value: connection.externalAccountName,\n },\n ]\n : []),\n {\n id: 'health',\n label: tr('integrations.connectionDetail.fields.healthCheck', 'Health Check'),\n value: formatDate(connection.lastHealthCheck),\n },\n {\n id: 'created',\n label: tr('integrations.connectionDetail.fields.created', 'Created'),\n value: formatDate(connection.createdAt),\n },\n ...(testResult\n ? [\n {\n id: 'latency',\n label: tr('integrations.connectedApps.testLatency', 'Test latency'),\n value: tr(\n 'integrations.connectionDetail.testResult.latency',\n 'Latency: {{latency}}ms',\n { latency: testResult.latencyMs }\n ),\n },\n ]\n : []),\n ...(usesVaultCredentials\n ? [\n {\n id: 'storage',\n label: tr(\n 'integrations.connectionDetail.sections.credentialStorage',\n 'Credential Storage'\n ),\n value: [vaultName ?? connection.vaultId, connection.credentialSecretName]\n .filter(Boolean)\n .join(' · '),\n },\n ]\n : []),\n ].map((row) => (\n <div\n key={row.id}\n className=\"flex items-center justify-between gap-3 py-2 border-b border-border-seam\"\n >\n <span className=\"text-text-secondary\">{row.label}</span>\n <span className=\"text-text-primary text-end break-all\">{row.value}</span>\n </div>\n ))}\n </div>\n <div>\n <h3 className=\"text-sm font-medium text-text-primary mb-2 flex items-center gap-2\">\n <Shield size={16} className=\"text-primary\" aria-hidden=\"true\" />\n {tr('integrations.connectionDetail.sections.scopes', 'Granted Scopes')}\n </h3>\n {connection.grantedScopes.length > 0 ? (\n <ShowMore collapsedHeight={88} label=\"Show all scopes\">\n <div className=\"flex flex-wrap gap-2\">\n {connection.grantedScopes.map((scope) => (\n <span\n key={scope}\n className=\"text-xs px-2.5 py-1 rounded-full bg-bg-sunken text-text-secondary font-mono\"\n >\n {scope}\n </span>\n ))}\n </div>\n </ShowMore>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.scopes.empty', 'No scopes granted.')}\n </p>\n )}\n </div>\n <SelfHostedReleaseSetting connection={connection} onResult={handleSelfHostedResult} />\n {(canUpdate || canDelete) && (\n <NextSteps storageKey=\"integrations-connection-detail\" steps={nextSteps} />\n )}\n <ShowTechnicalDetails copyable>\n {[\n `connectionId: ${connection.id}`,\n `providerKey: ${connection.provider.key}`,\n `status: ${connection.status}`,\n ...(connection.vaultId ? [`vaultId: ${connection.vaultId}`] : []),\n ...(connection.credentialSecretId\n ? [`secretId: ${connection.credentialSecretId}`]\n : []),\n ].join('\\n')}\n </ShowTechnicalDetails>\n </div>\n </OptionalFields>\n\n <RecentActivity\n connectionId={connection.id}\n onShowAll={() =>\n navigate?.(joinPath(basePath, `logs?connectionId=${encodeURIComponent(connection.id)}`))\n }\n />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n {overlays}\n\n {/* Header */}\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-6\">\n <div className=\"flex items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n aria-label={tr('integrations.connectionDetail.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <ProviderIcon provider={connection.provider} size={56} />\n <div className=\"flex-1\">\n {/* A proactive suggestion about this connection pins here (BOFF-13166). */}\n <div\n className=\"flex items-center gap-3\"\n {...suggestAnchorProps({ entityType: 'connection', entityId: connection.id })}\n >\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {connection.name}\n </h1>\n <ConnectionStatusBadge status={connection.status} size=\"md\" />\n <PrivateConnectionBadge connection={connection} />\n </div>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {connection.provider.name} · {getAuthTypeLabel(connection.provider.authType)}\n </p>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Activity size={16} />}>\n {tr(\n 'integrations.connectionDetail.purpose',\n 'This is a single live link to {{provider}}. From here you can confirm it is healthy, see which account and scopes were granted, test it on demand, refresh or revoke its access, and review where its credentials are stored.',\n { provider: connection.provider.name }\n )}\n </PagePurpose>\n\n {/* Next steps — guidance for managing this connection */}\n {(canUpdate || canDelete) && (\n <NextSteps storageKey=\"integrations-connection-detail\" steps={nextSteps} />\n )}\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {/* Connection Info — the page's primary emphasis zone */}\n <EmphasisPanel className=\"p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Activity size={18} className=\"text-primary\" />\n {tr('integrations.connectionDetail.sections.info', 'Connection Info')}\n </h2>\n <div className=\"space-y-3\">\n {connection.description && (\n <div className=\"py-2 border-b border-border-seam\">\n <span className=\"text-xs text-text-secondary uppercase tracking-wide\">\n {tr('integrations.connectionDetail.fields.description', 'Description')}\n </span>\n <p className=\"text-sm text-text-primary mt-0.5\">{connection.description}</p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.fields.provider', 'Provider')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.provider.name}\n </span>\n </div>\n {connection.externalAccountEmail && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Mail size={14} /> {tr('integrations.connectionDetail.fields.account', 'Account')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountEmail}\n </span>\n </div>\n )}\n {connection.externalAccountName && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <User size={14} /> {tr('integrations.connectionDetail.fields.name', 'Name')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountName}\n </span>\n </div>\n )}\n {connection.errorMessage && (\n <div className=\"py-2 border-b border-border-seam\">\n <span className=\"text-xs text-status-error-text uppercase tracking-wide\">\n {tr('integrations.connectionDetail.fields.error', 'Error')}\n </span>\n <p className=\"text-sm text-status-error-text mt-0.5 bg-status-error-bg-subtle rounded-lg p-2\">\n {connection.errorMessage}\n </p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Clock size={14} />{' '}\n {tr('integrations.connectionDetail.fields.lastUsed', 'Last Used')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatLastUsed(connection.lastUsedAt)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.fields.healthCheck', 'Health Check')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatDate(connection.lastHealthCheck)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2\">\n <span className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.fields.created', 'Created')}\n </span>\n <span className=\"text-sm text-text-primary\">{formatDate(connection.createdAt)}</span>\n </div>\n </div>\n </EmphasisPanel>\n\n {/* Scopes & Actions */}\n <div className=\"space-y-4\">\n {/* Granted Scopes */}\n <GlassCard className=\"border-border-seam p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Shield size={18} className=\"text-primary\" />\n {tr('integrations.connectionDetail.sections.scopes', 'Granted Scopes')}\n </h2>\n {connection.grantedScopes.length > 0 ? (\n <ShowMore collapsedHeight={88} label=\"Show all scopes\">\n <div className=\"flex flex-wrap gap-2\">\n {connection.grantedScopes.map((scope) => (\n <span\n key={scope}\n className=\"text-xs px-2.5 py-1 rounded-full bg-bg-sunken text-text-secondary font-mono\"\n >\n {scope}\n </span>\n ))}\n </div>\n </ShowMore>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.scopes.empty', 'No scopes granted.')}\n </p>\n )}\n </GlassCard>\n\n <SelfHostedReleaseSetting connection={connection} onResult={handleSelfHostedResult} />\n\n {/* Test Result */}\n {testResult && (\n <div\n className={cn(\n 'rounded-xl border p-5',\n testResult.success\n ? 'border-border-default bg-status-success-bg-subtle'\n : 'border-border-default bg-status-error-bg-subtle'\n )}\n >\n <h2\n className={cn(\n 'font-semibold flex items-center gap-2 mb-2',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.success ? <CheckCircle2 size={18} /> : <XCircle size={18} />}\n {testResult.success\n ? tr('integrations.connectionDetail.testResult.passed', 'Connection Test Passed')\n : tr('integrations.connectionDetail.testResult.failed', 'Connection Test Failed')}\n </h2>\n <p\n className={cn(\n 'text-sm',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.message}\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr('integrations.connectionDetail.testResult.latency', 'Latency: {{latency}}ms', {\n latency: testResult.latencyMs,\n })}\n </p>\n </div>\n )}\n\n {usesVaultCredentials && (\n <GlassCard className=\"border-border-seam p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n {tr(\n 'integrations.connectionDetail.sections.credentialStorage',\n 'Credential Storage'\n )}\n </h2>\n <div className=\"space-y-2 text-sm\">\n {connection.vaultId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">\n {tr('integrations.connectionDetail.fields.vault', 'Vault')}\n </span>\n <span className=\"font-medium text-text-primary break-all\">\n {vaultName ?? connection.vaultId}\n </span>\n </div>\n )}\n {connection.credentialSecretName && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">\n {tr('integrations.connectionDetail.fields.secret', 'Secret')}\n </span>\n <span className=\"font-medium text-text-primary break-all\">\n {connection.credentialSecretName}\n </span>\n </div>\n )}\n {connection.credentialSecretId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">\n {tr('integrations.connectionDetail.fields.secretId', 'Secret ID')}\n </span>\n <span className=\"font-mono text-xs text-text-primary break-all\">\n {connection.credentialSecretId}\n </span>\n </div>\n )}\n </div>\n </GlassCard>\n )}\n\n {/* Actions — hidden entirely when user has no action permissions */}\n {(canUpdate || canDelete || canShare) && (\n <GlassCard className=\"border-border-seam p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n {tr('integrations.connectionDetail.sections.actions', 'Actions')}\n </h2>\n <CTAOverflowMenu\n align=\"start\"\n primary={{\n label: tr('integrations.connectionDetail.actions.test', 'Test Connection'),\n onSelect: () => {\n void handleTest();\n },\n disabled: actionLoading,\n icon: testing ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Zap size={14} />\n ),\n }}\n actions={[\n ...(canShare\n ? [\n {\n label: tr('integrations.connectionDetail.actions.share', 'Share'),\n onSelect: () => setShareOpen(true),\n disabled: actionLoading,\n icon: <Share2 size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ...(canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken\n ? [\n {\n label: tr(\n 'integrations.connectionDetail.actions.refreshToken',\n 'Refresh Token'\n ),\n onSelect: () => {\n void handleRefresh();\n },\n disabled: actionLoading,\n icon: <RotateCcw size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ...(canDelete\n ? [\n {\n label: tr('integrations.connectionDetail.actions.revoke', 'Revoke'),\n onSelect: () => {\n void handleRevoke();\n },\n disabled: actionLoading,\n icon: <Shield size={14} />,\n } satisfies CTAAction,\n {\n label: tr('integrations.connectionDetail.actions.delete', 'Delete'),\n onSelect: () => {\n void handleDelete();\n },\n intent: 'destructive',\n disabled: actionLoading,\n icon: <Trash2 size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ]}\n />\n </GlassCard>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,SAAgBC,IAAmB;CACjC,IAAM,EAAE,oBAAiBC,GAAoC,GACvD,EAAE,cAAW,KAAK,aAAU,kBAAe,OAAUC,GAAgB,GACrEC,IAAKC,EAAM,GACXC,IAAmBC,GAAiB,GACpCC,IAAiBC,GAAkB,GACnCC,IAAaC,GAAc,GAE3B,EAAE,eAAY,aAAS,UAAO,eAAYC,GAAcC,KAAgB,EAAE,GAC1E,EAAE,oBAAgB,SAASC,MAAYC,GAAkB,GACzD,EAAE,kBAAc,SAASC,OAAeC,GAAgB,GACxD,EAAE,sBAAkB,SAASC,OAAaC,GAAoB,GAC9D,EAAE,sBAAkB,SAASC,MAAaC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,EAAG,gDAAgD,QAAQ;UAClE,gBAAgB;WACd,GAAkB;UACpB;UACA,QAAQ;UACR,UAAU2E;UACV,MAAM,kBAACwB,GAAD,EAAQ,MAAM,GAAK,CAAA;SAC3B,CACF,IACA,CAAC;QACP;OACD,CAAA,CACQ;;KAEV;IACF,CAAA,CAAA;;EACF;;AAET"}
1
+ {"version":3,"file":"ConnectionDetail.js","names":["_Fragment","ConnectionDetail","useParams","useIntegrations","tr","useTr","getAuthTypeLabel","useAuthTypeLabel","formatLastUsed","useFormatLastUsed","formatDate","useFormatDate","useConnection","connectionId","testing","useTestConnection","refreshing","useRefreshToken","revoking","useRevokeConnection","deleting","useDeleteConnection","canRefreshToken","useFeatureFlag","INTEGRATION_FEATURE_FLAGS","permissionsLoading","usePermissions","canUpdate","hasPermission","INTEGRATION_PERMISSIONS","canDelete","canShareRole","canCreateConnection","shareOpen","setShareOpen","useState","testResult","setTestResult","notification","setNotification","deleteDialogOpen","setDeleteDialogOpen","deleteVaultSecret","setDeleteVaultSecret","revokeDialogOpen","setRevokeDialogOpen","reconnectOpen","setReconnectOpen","vaultName","useVaultName","connection","showNotification","loading","Loader2","AlertCircle","error","refetch","RefreshCw","navigate","joinPath","basePath","ArrowLeft","handleTest","result","testConnection","handleRefresh","refreshToken","isRefreshed","refreshError","handleRevoke","confirmRevoke","revokeConnection","handleDelete","nativeConfirm","confirmDelete","deleteConnection","nativeNotify","handleSelfHostedResult","outcome","actionLoading","canShare","canManageSharing","usesVaultCredentials","nextSteps","Zap","RotateCcw","Activity","overlays","Fragment","cn","CheckCircle2","XCircle","AlertDialog","next","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","navigationV2","event","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","Trash2","ConfirmDialog","Shield","ConnectionShareDialog","reconnectNow","canReconnect","signedInAs","reconnectButton","Button","AddConnectionDialog","ProviderIcon","suggestAnchorProps","ConnectionStatusBadge","PrivateConnectionBadge","CTAOverflowMenu","Share2","nativeImpact","OptionalFields","row","ShowMore","scope","SelfHostedReleaseSetting","NextSteps","ShowTechnicalDetails","RecentActivity","PagePurpose","EmphasisPanel","Mail","User","Clock","GlassCard","Key"],"sources":["../../../src/integrations/pages/ConnectionDetail.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router';\nimport {\n ArrowLeft,\n Loader2,\n AlertCircle,\n RefreshCw,\n Shield,\n Clock,\n Activity,\n CheckCircle2,\n XCircle,\n Key,\n RotateCcw,\n Zap,\n Mail,\n User,\n Trash2,\n Share2,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { useAuthTypeLabel } from '../hooks/useLabel';\nimport { useFormatLastUsed } from '../hooks/useFormatLastUsed';\nimport { useFormatDate } from '../hooks/useFormatDate';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { INTEGRATION_FEATURE_FLAGS } from '../constants/featureFlags';\nimport { joinPath } from '../utils/navigation';\nimport {\n useConnection,\n useTestConnection,\n useRefreshToken,\n useRevokeConnection,\n useDeleteConnection,\n} from '../hooks/useConnections';\nimport { ProviderIcon, canManageSharing } from '@burdenoff/fe-libs/connections';\nimport { ConnectionStatusBadge } from '../components/ConnectionStatusBadge';\nimport { ConnectionShareDialog, PrivateConnectionBadge } from '../components/ConnectionSharing';\nimport { SelfHostedReleaseSetting } from '../components/SelfHostedReleaseSetting';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n Button,\n GlassCard,\n EmphasisPanel,\n ShowMore,\n CTAOverflowMenu,\n PagePurpose,\n NextSteps,\n OptionalFields,\n ShowTechnicalDetails,\n type NextStep,\n type CTAAction,\n} from '@burdenoff/fe-libs/ui';\nimport { suggestAnchorProps } from '@burdenoff/fe-libs/shared/proactive';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { useVaultName } from '../hooks/useVaultName';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { RecentActivity } from '../components/RecentActivity';\nimport { canReconnect, isRefreshed } from '../utils/connectedApps';\n\n/**\n * Connection Detail — Single connection view with info, scopes, and action buttons.\n */\nexport function ConnectionDetail() {\n const { connectionId } = useParams<{ connectionId: string }>();\n const { basePath = '/', navigate, navigationV2 = false } = useIntegrations();\n const tr = useTr();\n const getAuthTypeLabel = useAuthTypeLabel();\n const formatLastUsed = useFormatLastUsed();\n const formatDate = useFormatDate();\n\n const { connection, loading, error, refetch } = useConnection(connectionId ?? '');\n const { testConnection, loading: testing } = useTestConnection();\n const { refreshToken, loading: refreshing } = useRefreshToken();\n const { revokeConnection, loading: revoking } = useRevokeConnection();\n const { deleteConnection, loading: deleting } = useDeleteConnection();\n const canRefreshToken = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.OAUTH_REFRESH, true);\n\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canUpdate = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_UPDATE);\n const canDelete = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_DELETE);\n const canShareRole = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_SHARE);\n // Reconnect runs the same sign-in a new connection does.\n const canCreateConnection = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n const [shareOpen, setShareOpen] = useState(false);\n\n const [testResult, setTestResult] = useState<{\n success: boolean;\n message: string;\n latencyMs: number;\n } | null>(null);\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);\n const [deleteVaultSecret, setDeleteVaultSecret] = useState(false);\n const [revokeDialogOpen, setRevokeDialogOpen] = useState(false);\n const [reconnectOpen, setReconnectOpen] = useState(false);\n const vaultName = useVaultName(connection?.vaultId);\n\n const showNotification = (type: 'success' | 'error', message: string) => {\n setNotification({ type, message });\n setTimeout(() => setNotification(null), 5000);\n };\n\n // The full-page loading state is for the first load only (no connection\n // yet). The shell refetches every active query after any mutation —\n // initiateOAuth included — and with Apollo 4 a refetch sets `loading` again\n // while keeping the data. Swapping the page for the spinner then unmounted\n // the Reconnect dialog, whose cleanup closed the sign-in window the moment\n // it opened (BOFF-11875). A background refetch keeps the page mounted.\n if ((loading && !connection) || permissionsLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n <span className=\"mt-6 text-sm font-medium text-text-secondary\">\n {tr('integrations.connectionDetail.loading', 'Loading connection details...')}\n </span>\n </div>\n );\n }\n\n // Only a load that produced no connection is fatal. A failed background\n // refetch keeps the connection already on screen, for the same reason as\n // above: replacing the page would close an open Reconnect sign-in window.\n if (!connection) {\n return (\n <div className=\"p-6 max-w-4xl mx-auto\">\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-6 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.connectionDetail.error.title', 'Connection not found')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">\n {error?.message ||\n tr(\n 'integrations.connectionDetail.error.description',\n 'The requested connection could not be loaded.'\n )}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />{' '}\n {tr('integrations.connectionDetail.error.retry', 'Try Again')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={14} />{' '}\n {tr('integrations.connectionDetail.error.back', 'Back to Connections')}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n const handleTest = async () => {\n const result = await testConnection(connection.id);\n if (result) {\n setTestResult(result);\n showNotification(result.success ? 'success' : 'error', result.message);\n }\n };\n\n // The service answers with the connection's status after the refresh; only\n // ACTIVE is a refreshed token. It used to report success whatever happened,\n // and a thrown error went unhandled.\n const handleRefresh = async () => {\n try {\n const result = await refreshToken(connection.id);\n if (isRefreshed(result)) {\n showNotification(\n 'success',\n tr(\n 'integrations.connectionDetail.notifications.refreshSuccess',\n 'Token refreshed successfully'\n )\n );\n } else {\n showNotification(\n 'error',\n tr(\n 'integrations.connectionDetail.notifications.refreshFailed',\n 'The token could not be refreshed. Reconnect to sign in again.'\n )\n );\n }\n } catch (refreshError) {\n showNotification(\n 'error',\n refreshError instanceof Error\n ? refreshError.message\n : tr(\n 'integrations.connectionDetail.notifications.refreshFailed',\n 'The token could not be refreshed. Reconnect to sign in again.'\n )\n );\n } finally {\n void refetch();\n }\n };\n\n const handleRevoke = async () => {\n setRevokeDialogOpen(true);\n };\n\n const confirmRevoke = async () => {\n await revokeConnection(connection.id);\n showNotification(\n 'success',\n tr('integrations.connectionDetail.notifications.revokeSuccess', 'Connection revoked')\n );\n setRevokeDialogOpen(false);\n refetch();\n };\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: tr('integrations.connectionDetail.deleteDialog.title', 'Delete Connection'),\n message: tr(\n 'integrations.connectionDetail.deleteDialog.message',\n // One text on every confirm path; a literal, so i18n:extract reads it.\n 'Delete this connection? This cannot be undone.'\n ),\n okButtonTitle: tr('integrations.connectionDetail.deleteDialog.confirm', 'Delete'),\n cancelButtonTitle: tr('integrations.connectionDetail.deleteDialog.cancel', 'Cancel'),\n });\n if (result === null) {\n setDeleteDialogOpen(true);\n return;\n }\n if (result) {\n await confirmDelete();\n }\n };\n\n const confirmDelete = async () => {\n try {\n await deleteConnection(connection.id, deleteVaultSecret);\n showNotification(\n 'success',\n tr('integrations.connectionDetail.notifications.deleteSuccess', 'Connection deleted')\n );\n void nativeNotify('success');\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n navigate?.(joinPath(basePath, 'connections'));\n } catch (error) {\n showNotification(\n 'error',\n error instanceof Error ? error.message : 'Failed to delete connection'\n );\n void nativeNotify('error');\n }\n };\n\n const handleSelfHostedResult = (\n outcome: { ok: true; allow: boolean } | { ok: false; message: string }\n ) => {\n if (outcome.ok) {\n showNotification(\n 'success',\n outcome.allow\n ? tr(\n 'integrations.connectionDetail.selfHosted.allowed',\n 'Self-hosted workers may now receive this connection’s key.'\n )\n : tr(\n 'integrations.connectionDetail.selfHosted.stopped',\n 'Self-hosted workers no longer receive this connection’s key.'\n )\n );\n void nativeNotify('success');\n } else {\n showNotification('error', outcome.message);\n void nativeNotify('error');\n }\n };\n\n const actionLoading = testing || refreshing || revoking || deleting;\n // BOFF-9726: the owner, editors and workspace admins choose who can use it.\n const canShare = canShareRole && canManageSharing(connection.myAccess ?? null);\n const usesVaultCredentials = Boolean(connection.vaultId || connection.credentialSecretId);\n\n const nextSteps: NextStep[] = [\n {\n id: 'test',\n label: tr('integrations.connectionDetail.nextSteps.test.label', 'Test the connection'),\n description: tr(\n 'integrations.connectionDetail.nextSteps.test.description',\n 'Run a live check to confirm credentials still work before relying on it.'\n ),\n icon: <Zap size={16} />,\n onClick: () => {\n void handleTest();\n },\n done: connection.status === 'active' && Boolean(testResult?.success),\n },\n ...(canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken\n ? [\n {\n id: 'refresh',\n label: tr(\n 'integrations.connectionDetail.nextSteps.refresh.label',\n 'Refresh the access token'\n ),\n description: tr(\n 'integrations.connectionDetail.nextSteps.refresh.description',\n 'Renew OAuth credentials if requests start failing with an auth error.'\n ),\n icon: <RotateCcw size={16} />,\n onClick: () => {\n void handleRefresh();\n },\n } satisfies NextStep,\n ]\n : []),\n {\n id: 'logs',\n label: tr('integrations.connectionDetail.nextSteps.logs.label', 'Review activity logs'),\n description: tr(\n 'integrations.connectionDetail.nextSteps.logs.description',\n 'See recent requests and errors for this connection to debug issues.'\n ),\n icon: <Activity size={16} />,\n onClick: () => navigate?.(joinPath(basePath, 'logs')),\n },\n ];\n\n const overlays = (\n <>\n {/* Notification */}\n {notification && (\n <div\n className={cn(\n 'fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200',\n notification.type === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text border-border-default'\n : 'bg-status-error-bg-subtle text-status-error-text border-border-default'\n )}\n >\n {notification.type === 'success' ? <CheckCircle2 size={20} /> : <XCircle size={20} />}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n <AlertDialog\n open={deleteDialogOpen}\n onOpenChange={(next) => {\n if (!next) {\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n }\n }}\n >\n <AlertDialogContent className=\"max-w-md\">\n <AlertDialogHeader>\n <AlertDialogTitle>\n {tr('integrations.connectionDetail.deleteDialog.title', 'Delete Connection')}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {/* One message for both confirm paths: the native confirm used a\n different default text for the same key. */}\n {navigationV2\n ? tr(\n 'integrations.connectedApps.removeMessage',\n 'Remove {{name}}? Workflows that use it stop working until you connect {{provider}} again.',\n { name: connection.name, provider: connection.provider.name }\n )\n : tr(\n 'integrations.connectionDetail.deleteDialog.message',\n // One text on every confirm path; a literal, so i18n:extract reads it.\n 'Delete this connection? This cannot be undone.'\n )}\n {usesVaultCredentials &&\n ` ${tr(\n 'integrations.connectionDetail.deleteDialog.vaultHint',\n 'You can also remove the mapped vault secret if you no longer need it.'\n )}`}\n </AlertDialogDescription>\n </AlertDialogHeader>\n\n {usesVaultCredentials && (\n <label className=\"flex items-start gap-3 rounded-lg border border-border-subtle/60 bg-bg-surface px-4 py-3 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={deleteVaultSecret}\n onChange={(event) => setDeleteVaultSecret(event.target.checked)}\n className=\"mt-0.5\"\n aria-label={tr(\n 'integrations.connectionDetail.deleteDialog.removeVaultSecret',\n 'Also remove mapped vault secret'\n )}\n />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {tr(\n 'integrations.connectionDetail.deleteDialog.removeVaultSecret',\n 'Also remove mapped vault secret'\n )}\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr(\n 'integrations.connectionDetail.deleteDialog.removeVaultSecretHint',\n 'Use this only if no other connections rely on the same secret.'\n )}\n </p>\n </div>\n </label>\n )}\n\n <AlertDialogFooter>\n <AlertDialogCancel\n onClick={() => {\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n }}\n >\n {tr('integrations.connectionDetail.deleteDialog.cancel', 'Cancel')}\n </AlertDialogCancel>\n <AlertDialogAction\n disabled={deleting}\n onClick={(event) => {\n event.preventDefault();\n confirmDelete();\n }}\n className=\"inline-flex items-center gap-2 bg-status-error-bg text-action-primary-text disabled:opacity-50\"\n >\n {deleting ? <Loader2 size={14} className=\"animate-spin\" /> : <Trash2 size={14} />}\n {tr(\n 'integrations.connectionDetail.deleteDialog.deleteConnection',\n 'Delete connection'\n )}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n\n <ConfirmDialog\n open={revokeDialogOpen}\n title={tr('integrations.connectionDetail.confirm.revokeTitle', 'Revoke connection')}\n description={tr(\n 'integrations.connectionDetail.confirm.revoke',\n 'Are you sure you want to revoke this connection? This will disconnect the external service.'\n )}\n confirmLabel={tr('integrations.connectionDetail.actions.revoke', 'Revoke')}\n cancelLabel={tr('integrations.connectionDetail.actions.cancel', 'Cancel')}\n loading={revoking}\n destructive\n icon={<Shield size={20} />}\n onConfirm={confirmRevoke}\n onCancel={() => setRevokeDialogOpen(false)}\n />\n\n {canShare && (\n <ConnectionShareDialog\n connection={connection}\n open={shareOpen}\n onClose={() => setShareOpen(false)}\n onShared={() => {\n showNotification(\n 'success',\n tr('integrations.connectionDetail.notifications.shareSuccess', 'Sharing updated')\n );\n void refetch();\n }}\n />\n )}\n </>\n );\n\n const reconnectNow = canCreateConnection && canReconnect(connection.status);\n const signedInAs = connection.externalAccountEmail || connection.externalAccountName;\n const reconnectButton = reconnectNow ? (\n <Button onClick={() => setReconnectOpen(true)} data-testid=\"connection-detail-reconnect\">\n <RotateCcw size={14} aria-hidden=\"true\" />\n {tr('integrations.connectedApps.reconnect', 'Reconnect')}\n </Button>\n ) : null;\n\n if (navigationV2) {\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n {overlays}\n <AddConnectionDialog\n open={reconnectOpen}\n onClose={() => setReconnectOpen(false)}\n reconnect={\n reconnectOpen\n ? {\n connectionId: connection.id,\n name: connection.name,\n providerId: connection.provider.id,\n authMethodKey: connection.authMethodKey ?? null,\n }\n : null\n }\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n\n {/* Level 1: name, status, who it signs in as, last used, and what to do. */}\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-6\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center\">\n <div className=\"flex min-w-0 flex-1 items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"shrink-0\"\n onClick={() => navigate?.(basePath)}\n aria-label={tr('integrations.connectionDetail.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <ProviderIcon provider={connection.provider} size={56} />\n <div className=\"min-w-0 flex-1\">\n <div\n className=\"flex flex-wrap items-center gap-3\"\n {...suggestAnchorProps({ entityType: 'connection', entityId: connection.id })}\n >\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary break-words\">\n {connection.name}\n </h1>\n <ConnectionStatusBadge status={connection.status} size=\"md\" />\n <PrivateConnectionBadge connection={connection} />\n </div>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {signedInAs\n ? tr('integrations.connectedApps.signedInAs', 'Signed in as {{account}}', {\n account: signedInAs,\n })\n : connection.provider.name}\n {' · '}\n {tr('integrations.connectionCard.lastUsed', 'Last used {{time}}', {\n time: formatLastUsed(connection.lastUsedAt),\n })}\n </p>\n </div>\n </div>\n <div className=\"flex shrink-0 flex-wrap items-center gap-2\">\n {reconnectButton}\n {/* Test is a read: anyone who can see the connection may run it. */}\n <CTAOverflowMenu\n align=\"end\"\n primary={{\n label: tr('integrations.connectedApps.test', 'Test'),\n onSelect: () => {\n void handleTest();\n },\n disabled: actionLoading,\n icon: testing ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Zap size={14} />\n ),\n }}\n actions={[\n ...(canShare\n ? [\n {\n label: tr('integrations.connectionDetail.actions.share', 'Share'),\n onSelect: () => setShareOpen(true),\n disabled: actionLoading,\n icon: <Share2 size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ...(canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken\n ? [\n {\n label: tr(\n 'integrations.connectionDetail.actions.refreshToken',\n 'Refresh Token'\n ),\n onSelect: () => {\n void handleRefresh();\n },\n disabled: actionLoading,\n icon: <RotateCcw size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ...(canDelete\n ? [\n {\n label: tr('integrations.connectionDetail.actions.revoke', 'Revoke'),\n onSelect: () => {\n void handleRevoke();\n },\n disabled: actionLoading,\n icon: <Shield size={14} />,\n } satisfies CTAAction,\n {\n label: tr('integrations.connectedApps.remove', 'Remove'),\n onSelect: () => {\n void nativeImpact('medium');\n setDeleteDialogOpen(true);\n },\n intent: 'destructive',\n disabled: actionLoading,\n icon: <Trash2 size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ]}\n />\n </div>\n </div>\n </div>\n\n {connection.errorMessage && (\n <div\n role=\"alert\"\n className=\"flex flex-col gap-3 rounded-xl border border-border-default bg-status-error-bg-subtle p-4 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex items-start gap-3\">\n <AlertCircle size={20} className=\"mt-0.5 shrink-0 text-status-error-text\" />\n <div className=\"min-w-0\">\n <p className=\"font-semibold text-status-error-text\">\n {tr('integrations.connectedApps.brokenTitle', '{{provider}} stopped working', {\n provider: connection.provider.name,\n })}\n </p>\n <p className=\"text-sm text-status-error-text break-words\">\n {connection.errorMessage}\n </p>\n </div>\n </div>\n {reconnectButton}\n </div>\n )}\n\n {testResult && (\n <div\n role=\"status\"\n className={cn(\n 'rounded-xl border p-4',\n testResult.success\n ? 'border-border-default bg-status-success-bg-subtle'\n : 'border-border-default bg-status-error-bg-subtle'\n )}\n >\n <p\n className={cn(\n 'font-semibold flex items-center gap-2',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.success ? <CheckCircle2 size={18} /> : <XCircle size={18} />}\n {testResult.success\n ? tr('integrations.connectionDetail.testResult.passed', 'Connection Test Passed')\n : tr('integrations.connectionDetail.testResult.failed', 'Connection Test Failed')}\n </p>\n <p\n className={cn(\n 'text-sm mt-1',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.message}\n </p>\n </div>\n )}\n\n {/* Level 2: one click away, remembered per person. */}\n <OptionalFields\n storageKey=\"integrations.connection-detail.more-details\"\n label={tr('integrations.connectedApps.moreDetails', 'More details')}\n >\n <div className=\"space-y-4\">\n <div className=\"space-y-3 text-sm\">\n {connection.description && (\n <div className=\"py-2 border-b border-border-seam\">\n <span className=\"text-xs text-text-secondary uppercase tracking-wide\">\n {tr('integrations.connectionDetail.fields.description', 'Description')}\n </span>\n <p className=\"text-text-primary mt-0.5\">{connection.description}</p>\n </div>\n )}\n {[\n {\n id: 'app',\n label: tr('integrations.connectionDetail.fields.provider', 'Provider'),\n value: `${connection.provider.name} · ${getAuthTypeLabel(connection.provider.authType)}`,\n },\n ...(connection.externalAccountName && connection.externalAccountEmail\n ? [\n {\n id: 'name',\n label: tr('integrations.connectionDetail.fields.name', 'Name'),\n value: connection.externalAccountName,\n },\n ]\n : []),\n {\n id: 'health',\n label: tr('integrations.connectionDetail.fields.healthCheck', 'Health Check'),\n value: formatDate(connection.lastHealthCheck),\n },\n {\n id: 'created',\n label: tr('integrations.connectionDetail.fields.created', 'Created'),\n value: formatDate(connection.createdAt),\n },\n ...(testResult\n ? [\n {\n id: 'latency',\n label: tr('integrations.connectedApps.testLatency', 'Test latency'),\n value: tr(\n 'integrations.connectionDetail.testResult.latency',\n 'Latency: {{latency}}ms',\n { latency: testResult.latencyMs }\n ),\n },\n ]\n : []),\n ...(usesVaultCredentials\n ? [\n {\n id: 'storage',\n label: tr(\n 'integrations.connectionDetail.sections.credentialStorage',\n 'Credential Storage'\n ),\n value: [vaultName ?? connection.vaultId, connection.credentialSecretName]\n .filter(Boolean)\n .join(' · '),\n },\n ]\n : []),\n ].map((row) => (\n <div\n key={row.id}\n className=\"flex items-center justify-between gap-3 py-2 border-b border-border-seam\"\n >\n <span className=\"text-text-secondary\">{row.label}</span>\n <span className=\"text-text-primary text-end break-all\">{row.value}</span>\n </div>\n ))}\n </div>\n <div>\n <h3 className=\"text-sm font-medium text-text-primary mb-2 flex items-center gap-2\">\n <Shield size={16} className=\"text-primary\" aria-hidden=\"true\" />\n {tr('integrations.connectionDetail.sections.scopes', 'Granted Scopes')}\n </h3>\n {connection.grantedScopes.length > 0 ? (\n <ShowMore collapsedHeight={88} label=\"Show all scopes\">\n <div className=\"flex flex-wrap gap-2\">\n {connection.grantedScopes.map((scope) => (\n <span\n key={scope}\n className=\"text-xs px-2.5 py-1 rounded-full bg-bg-sunken text-text-secondary font-mono\"\n >\n {scope}\n </span>\n ))}\n </div>\n </ShowMore>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.scopes.empty', 'No scopes granted.')}\n </p>\n )}\n </div>\n <SelfHostedReleaseSetting connection={connection} onResult={handleSelfHostedResult} />\n {(canUpdate || canDelete) && (\n <NextSteps storageKey=\"integrations-connection-detail\" steps={nextSteps} />\n )}\n <ShowTechnicalDetails copyable>\n {[\n `connectionId: ${connection.id}`,\n `providerKey: ${connection.provider.key}`,\n `status: ${connection.status}`,\n ...(connection.vaultId ? [`vaultId: ${connection.vaultId}`] : []),\n ...(connection.credentialSecretId\n ? [`secretId: ${connection.credentialSecretId}`]\n : []),\n ].join('\\n')}\n </ShowTechnicalDetails>\n </div>\n </OptionalFields>\n\n <RecentActivity\n connectionId={connection.id}\n onShowAll={() =>\n navigate?.(joinPath(basePath, `logs?connectionId=${encodeURIComponent(connection.id)}`))\n }\n />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n {overlays}\n\n {/* Header */}\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-6\">\n <div className=\"flex items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n aria-label={tr('integrations.connectionDetail.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <ProviderIcon provider={connection.provider} size={56} />\n <div className=\"flex-1\">\n {/* A proactive suggestion about this connection pins here (BOFF-13166). */}\n <div\n className=\"flex items-center gap-3\"\n {...suggestAnchorProps({ entityType: 'connection', entityId: connection.id })}\n >\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {connection.name}\n </h1>\n <ConnectionStatusBadge status={connection.status} size=\"md\" />\n <PrivateConnectionBadge connection={connection} />\n </div>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {connection.provider.name} · {getAuthTypeLabel(connection.provider.authType)}\n </p>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Activity size={16} />}>\n {tr(\n 'integrations.connectionDetail.purpose',\n 'This is a single live link to {{provider}}. From here you can confirm it is healthy, see which account and scopes were granted, test it on demand, refresh or revoke its access, and review where its credentials are stored.',\n { provider: connection.provider.name }\n )}\n </PagePurpose>\n\n {/* Next steps — guidance for managing this connection */}\n {(canUpdate || canDelete) && (\n <NextSteps storageKey=\"integrations-connection-detail\" steps={nextSteps} />\n )}\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {/* Connection Info — the page's primary emphasis zone */}\n <EmphasisPanel className=\"p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Activity size={18} className=\"text-primary\" />\n {tr('integrations.connectionDetail.sections.info', 'Connection Info')}\n </h2>\n <div className=\"space-y-3\">\n {connection.description && (\n <div className=\"py-2 border-b border-border-seam\">\n <span className=\"text-xs text-text-secondary uppercase tracking-wide\">\n {tr('integrations.connectionDetail.fields.description', 'Description')}\n </span>\n <p className=\"text-sm text-text-primary mt-0.5\">{connection.description}</p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.fields.provider', 'Provider')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.provider.name}\n </span>\n </div>\n {connection.externalAccountEmail && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Mail size={14} /> {tr('integrations.connectionDetail.fields.account', 'Account')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountEmail}\n </span>\n </div>\n )}\n {connection.externalAccountName && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <User size={14} /> {tr('integrations.connectionDetail.fields.name', 'Name')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountName}\n </span>\n </div>\n )}\n {connection.errorMessage && (\n <div className=\"py-2 border-b border-border-seam\">\n <span className=\"text-xs text-status-error-text uppercase tracking-wide\">\n {tr('integrations.connectionDetail.fields.error', 'Error')}\n </span>\n <p className=\"text-sm text-status-error-text mt-0.5 bg-status-error-bg-subtle rounded-lg p-2\">\n {connection.errorMessage}\n </p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Clock size={14} />{' '}\n {tr('integrations.connectionDetail.fields.lastUsed', 'Last Used')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatLastUsed(connection.lastUsedAt)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2 border-b border-border-seam\">\n <span className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.fields.healthCheck', 'Health Check')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatDate(connection.lastHealthCheck)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2\">\n <span className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.fields.created', 'Created')}\n </span>\n <span className=\"text-sm text-text-primary\">{formatDate(connection.createdAt)}</span>\n </div>\n </div>\n </EmphasisPanel>\n\n {/* Scopes & Actions */}\n <div className=\"space-y-4\">\n {/* Granted Scopes */}\n <GlassCard className=\"border-border-seam p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Shield size={18} className=\"text-primary\" />\n {tr('integrations.connectionDetail.sections.scopes', 'Granted Scopes')}\n </h2>\n {connection.grantedScopes.length > 0 ? (\n <ShowMore collapsedHeight={88} label=\"Show all scopes\">\n <div className=\"flex flex-wrap gap-2\">\n {connection.grantedScopes.map((scope) => (\n <span\n key={scope}\n className=\"text-xs px-2.5 py-1 rounded-full bg-bg-sunken text-text-secondary font-mono\"\n >\n {scope}\n </span>\n ))}\n </div>\n </ShowMore>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n {tr('integrations.connectionDetail.scopes.empty', 'No scopes granted.')}\n </p>\n )}\n </GlassCard>\n\n <SelfHostedReleaseSetting connection={connection} onResult={handleSelfHostedResult} />\n\n {/* Test Result */}\n {testResult && (\n <div\n className={cn(\n 'rounded-xl border p-5',\n testResult.success\n ? 'border-border-default bg-status-success-bg-subtle'\n : 'border-border-default bg-status-error-bg-subtle'\n )}\n >\n <h2\n className={cn(\n 'font-semibold flex items-center gap-2 mb-2',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.success ? <CheckCircle2 size={18} /> : <XCircle size={18} />}\n {testResult.success\n ? tr('integrations.connectionDetail.testResult.passed', 'Connection Test Passed')\n : tr('integrations.connectionDetail.testResult.failed', 'Connection Test Failed')}\n </h2>\n <p\n className={cn(\n 'text-sm',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.message}\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tr('integrations.connectionDetail.testResult.latency', 'Latency: {{latency}}ms', {\n latency: testResult.latencyMs,\n })}\n </p>\n </div>\n )}\n\n {usesVaultCredentials && (\n <GlassCard className=\"border-border-seam p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n {tr(\n 'integrations.connectionDetail.sections.credentialStorage',\n 'Credential Storage'\n )}\n </h2>\n <div className=\"space-y-2 text-sm\">\n {connection.vaultId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">\n {tr('integrations.connectionDetail.fields.vault', 'Vault')}\n </span>\n <span className=\"font-medium text-text-primary break-all\">\n {vaultName ?? connection.vaultId}\n </span>\n </div>\n )}\n {connection.credentialSecretName && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">\n {tr('integrations.connectionDetail.fields.secret', 'Secret')}\n </span>\n <span className=\"font-medium text-text-primary break-all\">\n {connection.credentialSecretName}\n </span>\n </div>\n )}\n {connection.credentialSecretId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">\n {tr('integrations.connectionDetail.fields.secretId', 'Secret ID')}\n </span>\n <span className=\"font-mono text-xs text-text-primary break-all\">\n {connection.credentialSecretId}\n </span>\n </div>\n )}\n </div>\n </GlassCard>\n )}\n\n {/* Actions — hidden entirely when user has no action permissions */}\n {(canUpdate || canDelete || canShare) && (\n <GlassCard className=\"border-border-seam p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n {tr('integrations.connectionDetail.sections.actions', 'Actions')}\n </h2>\n <CTAOverflowMenu\n align=\"start\"\n primary={{\n label: tr('integrations.connectionDetail.actions.test', 'Test Connection'),\n onSelect: () => {\n void handleTest();\n },\n disabled: actionLoading,\n icon: testing ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Zap size={14} />\n ),\n }}\n actions={[\n ...(canShare\n ? [\n {\n label: tr('integrations.connectionDetail.actions.share', 'Share'),\n onSelect: () => setShareOpen(true),\n disabled: actionLoading,\n icon: <Share2 size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ...(canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken\n ? [\n {\n label: tr(\n 'integrations.connectionDetail.actions.refreshToken',\n 'Refresh Token'\n ),\n onSelect: () => {\n void handleRefresh();\n },\n disabled: actionLoading,\n icon: <RotateCcw size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ...(canDelete\n ? [\n {\n label: tr('integrations.connectionDetail.actions.revoke', 'Revoke'),\n onSelect: () => {\n void handleRevoke();\n },\n disabled: actionLoading,\n icon: <Shield size={14} />,\n } satisfies CTAAction,\n {\n label: tr('integrations.connectionDetail.actions.delete', 'Delete'),\n onSelect: () => {\n void handleDelete();\n },\n intent: 'destructive',\n disabled: actionLoading,\n icon: <Trash2 size={14} />,\n } satisfies CTAAction,\n ]\n : []),\n ]}\n />\n </GlassCard>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,SAAgBC,IAAmB;CACjC,IAAM,EAAE,oBAAiBC,GAAoC,GACvD,EAAE,c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,YAAY5B,IAC1D,CACE;UACE,OAAOlB,EACL,sDACA,eACF;UACA,gBAAgB;WACd,EAAmB;UACrB;UACA,UAAU2E;UACV,MAAM,kBAACM,GAAD,EAAW,MAAM,GAAK,CAAA;SAC9B,CACF,IACA,CAAC;SACL,GAAIvD,IACA,CACE;UACE,OAAO1B,EAAG,gDAAgD,QAAQ;UAClE,gBAAgB;WACd,GAAkB;UACpB;UACA,UAAU2E;UACV,MAAM,kBAAC0B,GAAD,EAAQ,MAAM,GAAK,CAAA;SAC3B,GACA;UACE,OAAOrG,EAAG,gDAAgD,QAAQ;UAClE,gBAAgB;WACd,GAAkB;UACpB;UACA,QAAQ;UACR,UAAU2E;UACV,MAAM,kBAACwB,GAAD,EAAQ,MAAM,GAAK,CAAA;SAC3B,CACF,IACA,CAAC;QACP;OACD,CAAA,CACQ;;KAEV;IACF,CAAA,CAAA;;EACF;;AAET"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-integrations",
3
- "version": "2026.1117.1",
3
+ "version": "2026.1117.2",
4
4
  "description": "Burdenoff Integrations Microfrontend - Plugin-based provider and connection management interface",
5
5
  "type": "module",
6
6
  "files": [