@burdenoff/microfe-semanticfed 2026.1109.7 → 2026.1109.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/semanticfed/api/clientAnalytics.d.ts +13 -0
- package/dist/semanticfed/api/clientAnalytics.js +53 -0
- package/dist/semanticfed/api/clientAnalytics.js.map +1 -0
- package/dist/semanticfed/api/scopedRequest.d.ts +12 -0
- package/dist/semanticfed/api/scopedRequest.js +36 -0
- package/dist/semanticfed/api/scopedRequest.js.map +1 -0
- package/dist/semanticfed/api/semanticfedGraphql.d.ts +2 -1
- package/dist/semanticfed/api/semanticfedGraphql.js +39 -20
- package/dist/semanticfed/api/semanticfedGraphql.js.map +1 -1
- package/dist/semanticfed/components/OnboardingChecklist.js +92 -84
- package/dist/semanticfed/components/OnboardingChecklist.js.map +1 -1
- package/dist/semanticfed/hooks/useClientAnalytics.d.ts +7 -0
- package/dist/semanticfed/hooks/useClientAnalytics.js +25 -0
- package/dist/semanticfed/hooks/useClientAnalytics.js.map +1 -0
- package/dist/semanticfed/hooks/useOnboarding.d.ts +8 -2
- package/dist/semanticfed/hooks/useOnboarding.js +40 -21
- package/dist/semanticfed/hooks/useOnboarding.js.map +1 -1
- package/dist/semanticfed/hooks/useQueryRuns.d.ts +4 -1
- package/dist/semanticfed/hooks/useQueryRuns.js +103 -86
- package/dist/semanticfed/hooks/useQueryRuns.js.map +1 -1
- package/dist/semanticfed/hooks/useSemRequest.d.ts +5 -0
- package/dist/semanticfed/hooks/useSemRequest.js +25 -0
- package/dist/semanticfed/hooks/useSemRequest.js.map +1 -0
- package/dist/semanticfed/hooks/useSqlConsole.js +35 -23
- package/dist/semanticfed/hooks/useSqlConsole.js.map +1 -1
- package/dist/semanticfed/providers/SemanticFedProvider.js +2 -1
- package/dist/semanticfed/providers/SemanticFedProvider.js.map +1 -1
- package/dist/semanticfed/types/index.d.ts +1 -0
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryRuns.js","names":["SAVED_QUERY_PICKER_LIMIT","RUN_HISTORY_LIMIT","RUN_POLL_INTERVAL_MS","RUN_POLL_MAX_MS","TERMINAL_STATUSES","isTerminalRunStatus","status","isRunPollExpired","run","created","now","RUN_FIELDS","LIST_QUERIES_QUERY","RUN_QUERY_MUTATION","QUERY_RUN_QUERY","QUERY_RUNS_QUERY","QUERY_RUN_RESULT_QUERY","useSemSavedQueries","useSemanticFed","useQuery","workspaceId","modelId","semRequest","apiGatewayUrl","q","useSemRunSavedQuery","queryClient","useQueryClient","useMutation","queryId","useSemQueryRun","runId","query","useSemQueryRuns","clearGraphqlReadCaches","useSemQueryRunResult","offset","asRecord","value","optionalString","runGovernance","governance","planSummary","outcome","decisions","d","raw","RESTRICTIVE_ACTIONS","restrictiveDecisions"],"sources":["../../../src/semanticfed/hooks/useQueryRuns.ts"],"sourcesContent":["/**\n * Saved-query run hooks (BOFF-9754), wired to the `wspace-semanticfed-svc`\n * query-run API:\n *\n * - `semListQueries` lists the workspace's saved federated queries.\n * - `semRunQuery` enqueues a run and returns it QUEUED; an async worker plans\n * and executes it, so `semQueryRun` is polled until the run is terminal\n * (SUCCEEDED / FAILED / CANCELLED).\n * - `semQueryRunResult` returns one page of the governed rows of a SUCCEEDED\n * run: columns in SELECT order with each column's access-policy mask, and\n * offset pagination through `nextOffset` (BOFF-9650).\n * - `semListQueryRuns` is the run history of a saved query, newest first.\n */\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { clearGraphqlReadCaches, semRequest } from '../api/semanticfedGraphql';\nimport { useSemanticFed } from '../providers/SemanticFedProvider';\n\nexport type SemQueryRunStatus =\n 'QUEUED' | 'PLANNING' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED';\n\nexport type SemSavedQueryStatus = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';\n\nexport interface SemSavedQuery {\n id: string;\n name: string;\n description: string | null;\n modelId: string | null;\n queryText: string;\n status: SemSavedQueryStatus;\n tags: string[];\n updatedAt: string;\n}\n\nexport interface SemQueryRun {\n id: string;\n queryId: string;\n status: SemQueryRunStatus;\n errorMessage: string | null;\n planSummary: unknown;\n rowCount: number | null;\n durationMs: number | null;\n sourcesTouched: number;\n fromCache: boolean;\n runById: string | null;\n createdAt: string;\n startedAt: string | null;\n finishedAt: string | null;\n}\n\nexport interface SemQueryRunResultColumn {\n name: string;\n entity: string;\n field: string;\n aggregation: string | null;\n masked: boolean;\n mask: string | null;\n}\n\nexport interface SemQueryRunResultPage {\n runId: string;\n queryId: string;\n columns: SemQueryRunResultColumn[];\n rows: Array<Record<string, unknown>>;\n rowCount: number;\n totalRowCount: number;\n truncated: boolean;\n offset: number;\n limit: number;\n nextOffset: number | null;\n expiresAt: string;\n}\n\n/** Rows per results page (the service allows up to 500). */\nexport const RUN_RESULT_PAGE_SIZE = 100;\n/** Saved queries offered in the picker (the picker is not paginated). */\nconst SAVED_QUERY_PICKER_LIMIT = 100;\n/** Runs shown in a saved query's history. */\nconst RUN_HISTORY_LIMIT = 20;\n/** How often an active run is polled. */\nexport const RUN_POLL_INTERVAL_MS = 1500;\n/**\n * How long after a run was created it is still polled automatically. A run\n * that is still not terminal by then (for example because the worker died\n * without marking it FAILED) is left for the user to re-check by hand.\n */\nexport const RUN_POLL_MAX_MS = 10 * 60 * 1000;\n\nconst TERMINAL_STATUSES: ReadonlySet<SemQueryRunStatus> = new Set([\n 'SUCCEEDED',\n 'FAILED',\n 'CANCELLED',\n]);\n\nexport function isTerminalRunStatus(status: SemQueryRunStatus): boolean {\n return TERMINAL_STATUSES.has(status);\n}\n\n/** True once a non-terminal run has been active longer than {@link RUN_POLL_MAX_MS}. */\nexport function isRunPollExpired(\n run: Pick<SemQueryRun, 'status' | 'createdAt'>,\n now: number = Date.now()\n): boolean {\n if (isTerminalRunStatus(run.status)) return false;\n const created = Date.parse(run.createdAt);\n return Number.isFinite(created) && now - created > RUN_POLL_MAX_MS;\n}\n\nconst RUN_FIELDS = `id\n queryId\n status\n errorMessage\n planSummary\n rowCount\n durationMs\n sourcesTouched\n fromCache\n runById\n createdAt\n startedAt\n finishedAt`;\n\nconst LIST_QUERIES_QUERY = `query SemConsoleSavedQueries($modelId: ID, $pagination: PaginationInput) {\n semListQueries(modelId: $modelId, pagination: $pagination) {\n items {\n id\n name\n description\n modelId\n queryText\n status\n tags\n updatedAt\n }\n }\n}`;\n\nconst RUN_QUERY_MUTATION = `mutation SemConsoleRunQuery($id: ID!) {\n semRunQuery(id: $id) {\n ${RUN_FIELDS}\n }\n}`;\n\nconst QUERY_RUN_QUERY = `query SemConsoleQueryRun($id: ID!) {\n semQueryRun(id: $id) {\n ${RUN_FIELDS}\n }\n}`;\n\nconst QUERY_RUNS_QUERY = `query SemConsoleQueryRuns($queryId: ID!, $pagination: PaginationInput) {\n semListQueryRuns(queryId: $queryId, pagination: $pagination) {\n items {\n ${RUN_FIELDS}\n }\n }\n}`;\n\nconst QUERY_RUN_RESULT_QUERY = `query SemConsoleQueryRunResult($runId: ID!, $pagination: PaginationInput) {\n semQueryRunResult(runId: $runId, pagination: $pagination) {\n runId\n queryId\n columns {\n name\n entity\n field\n aggregation\n masked\n mask\n }\n rows\n rowCount\n totalRowCount\n truncated\n offset\n limit\n nextOffset\n expiresAt\n }\n}`;\n\nexport function useSemSavedQueries(modelId: string | null) {\n const { apiGatewayUrl, workspaceId } = useSemanticFed();\n return useQuery({\n queryKey: ['semanticfed', 'savedQueries', workspaceId ?? 'no-workspace', modelId] as const,\n enabled: Boolean(workspaceId),\n queryFn: async () => {\n const data = await semRequest<{ semListQueries: { items: SemSavedQuery[] } }>(\n LIST_QUERIES_QUERY,\n { modelId, pagination: { limit: SAVED_QUERY_PICKER_LIMIT } },\n apiGatewayUrl\n );\n // Archived queries are deleted on the service and cannot be run.\n return data.semListQueries.items.filter((q) => q.status !== 'ARCHIVED');\n },\n });\n}\n\nexport function useSemRunSavedQuery() {\n const { apiGatewayUrl, workspaceId } = useSemanticFed();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (queryId: string) => {\n const data = await semRequest<{ semRunQuery: SemQueryRun }>(\n RUN_QUERY_MUTATION,\n { id: queryId },\n apiGatewayUrl\n );\n return data.semRunQuery;\n },\n onSuccess: (run) => {\n queryClient.setQueryData(\n ['semanticfed', 'queryRun', workspaceId ?? 'no-workspace', run.id],\n run\n );\n void queryClient.invalidateQueries({\n queryKey: ['semanticfed', 'queryRuns', workspaceId ?? 'no-workspace', run.queryId],\n });\n },\n });\n}\n\n/**\n * One run, polled every {@link RUN_POLL_INTERVAL_MS} until it is terminal (or\n * for at most {@link RUN_POLL_MAX_MS}). Each poll clears the shell's\n * short-lived (15 s) read cache, which would otherwise replay the QUEUED\n * response for its whole TTL. That cache is keyed by operation and variables\n * with no per-entry eviction, so it is cleared as a whole; other reads on the\n * page are held by React Query, so clearing it does not trigger refetches.\n */\nexport function useSemQueryRun(runId: string | null) {\n const { apiGatewayUrl, workspaceId } = useSemanticFed();\n const queryClient = useQueryClient();\n return useQuery({\n queryKey: ['semanticfed', 'queryRun', workspaceId ?? 'no-workspace', runId] as const,\n enabled: Boolean(workspaceId && runId),\n staleTime: 0,\n queryFn: async () => {\n clearGraphqlReadCaches();\n const data = await semRequest<{ semQueryRun: SemQueryRun | null }>(\n QUERY_RUN_QUERY,\n { id: runId },\n apiGatewayUrl\n );\n const run = data.semQueryRun;\n if (run && isTerminalRunStatus(run.status)) {\n void queryClient.invalidateQueries({\n queryKey: ['semanticfed', 'queryRuns', workspaceId ?? 'no-workspace', run.queryId],\n });\n }\n return run;\n },\n refetchInterval: (query) => {\n const run = query.state.data;\n if (run === null) return false;\n if (run && (isTerminalRunStatus(run.status) || isRunPollExpired(run))) return false;\n return RUN_POLL_INTERVAL_MS;\n },\n });\n}\n\nexport function useSemQueryRuns(queryId: string | null) {\n const { apiGatewayUrl, workspaceId } = useSemanticFed();\n return useQuery({\n queryKey: ['semanticfed', 'queryRuns', workspaceId ?? 'no-workspace', queryId] as const,\n enabled: Boolean(workspaceId && queryId),\n staleTime: 0,\n queryFn: async () => {\n clearGraphqlReadCaches();\n const data = await semRequest<{ semListQueryRuns: { items: SemQueryRun[] } }>(\n QUERY_RUNS_QUERY,\n { queryId, pagination: { limit: RUN_HISTORY_LIMIT } },\n apiGatewayUrl\n );\n return data.semListQueryRuns.items;\n },\n });\n}\n\n/** One page of a SUCCEEDED run's governed rows; `runId` null keeps it idle. */\nexport function useSemQueryRunResult(runId: string | null, offset: number) {\n const { apiGatewayUrl, workspaceId } = useSemanticFed();\n return useQuery({\n queryKey: [\n 'semanticfed',\n 'queryRunResult',\n workspaceId ?? 'no-workspace',\n runId,\n offset,\n ] as const,\n enabled: Boolean(workspaceId && runId),\n retry: false,\n queryFn: async () => {\n const data = await semRequest<{ semQueryRunResult: SemQueryRunResultPage }>(\n QUERY_RUN_RESULT_QUERY,\n { runId, pagination: { limit: RUN_RESULT_PAGE_SIZE, offset } },\n apiGatewayUrl\n );\n return data.semQueryRunResult;\n },\n });\n}\n\n/** One access-policy decision recorded on `planSummary.governance`. */\nexport interface SemGovernanceDecision {\n action: string;\n entity: string;\n field: string | null;\n policyName: string | null;\n mask: string | null;\n detail: string | null;\n}\n\nexport interface SemRunGovernance {\n outcome: 'ALLOWED' | 'DENIED';\n policiesEvaluated: number;\n reason: string | null;\n decisions: SemGovernanceDecision[];\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nfunction optionalString(value: unknown): string | null {\n return typeof value === 'string' && value !== '' ? value : null;\n}\n\n/**\n * The access-policy record of a run (`planSummary.governance`), or null when\n * the run was not governed. `planSummary` is untyped JSON, so every field is\n * checked before use.\n */\nexport function runGovernance(planSummary: unknown): SemRunGovernance | null {\n const governance = asRecord(asRecord(planSummary)?.governance);\n if (!governance) return null;\n // Anything other than an explicit ALLOWED is shown as a denial, so an outcome\n // the console does not know yet can never hide a refusal.\n const outcome = governance.outcome === 'ALLOWED' ? 'ALLOWED' : 'DENIED';\n const decisions = Array.isArray(governance.decisions) ? governance.decisions : [];\n return {\n outcome,\n policiesEvaluated:\n typeof governance.policiesEvaluated === 'number' ? governance.policiesEvaluated : 0,\n reason: optionalString(governance.reason),\n decisions: decisions.flatMap((raw) => {\n const d = asRecord(raw);\n if (!d || typeof d.action !== 'string') return [];\n return [\n {\n action: d.action,\n entity: optionalString(d.entity) ?? '',\n field: optionalString(d.field),\n policyName: optionalString(d.policyName),\n mask: optionalString(d.mask),\n detail: optionalString(d.detail),\n },\n ];\n }),\n };\n}\n\n/** Decisions that removed or hid data, which a failed or partial run explains with. */\nconst RESTRICTIVE_ACTIONS: ReadonlySet<string> = new Set([\n 'ENTITY_DENIED',\n 'ROWS_BLOCKED',\n 'COLUMN_DENIED',\n 'EVALUATION_FAILED',\n]);\n\nexport function restrictiveDecisions(governance: SemRunGovernance): SemGovernanceDecision[] {\n return governance.decisions.filter((d) => RESTRICTIVE_ACTIONS.has(d.action));\n}\n"],"mappings":";;;AA4EA,IAAMA,IAA2B,KAE3BC,IAAoB,IAEbC,IAAuB,MAMvBC,IAAkB,KAEzBC,oBAAoD,IAAI,IAAI;CAChE;CACA;CACA;AACF,CAAC;AAED,SAAgBC,EAAoB,GAAoC;CACtE,OAAOD,EAAkB,IAAIE,CAAM;AACrC;AAGA,SAAgBC,EACd,GACA,IAAc,KAAK,IAAI,GACd;CACT,IAAIF,EAAoBG,EAAI,MAAM,GAAG,OAAO;CAC5C,IAAMC,IAAU,KAAK,MAAMD,EAAI,SAAS;CACxC,OAAO,OAAO,SAASC,CAAO,KAAKC,IAAMD,IAAA;AAC3C;AAEA,IAAME,IAAa,8LAcbC,IAAqB,8RAerBC,IAAqB;;MAErBF,EAAW;;IAIXG,IAAkB;;MAElBH,EAAW;;IAIXI,IAAmB;;;QAGjBJ,EAAW;;;IAKbK,IAAyB;AAuB/B,SAAgBC,E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,EAAW,oBAAoB;EACpF,QAAQF,EAAeE,EAAW,MAAM;EACxC,WAAWG,EAAU,SAAS,MAAQ;GACpC,IAAMC,IAAIR,EAASS,CAAG;GAEtB,OADI,CAACD,KAAK,OAAOA,EAAE,UAAW,WAAiB,CAAC,IACzC,CACL;IACE,QAAQA,EAAE;IACV,QAAQN,EAAeM,EAAE,MAAM,KAAK;IACpC,OAAON,EAAeM,EAAE,KAAK;IAC7B,YAAYN,EAAeM,EAAE,UAAU;IACvC,MAAMN,EAAeM,EAAE,IAAI;IAC3B,QAAQN,EAAeM,EAAE,MAAM;GACjC,CACF;EACF,CAAC;CACH;AACF;AAGA,IAAME,oBAA2C,IAAI,IAAI;CACvD;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgBC,EAAqB,GAAuD;CAC1F,OAAOP,EAAW,UAAU,QAAQ,MAAMM,EAAoB,IAAIF,EAAE,MAAM,CAAC;AAC7E"}
|
|
1
|
+
{"version":3,"file":"useQueryRuns.js","names":["SAVED_QUERY_PICKER_LIMIT","RUN_HISTORY_LIMIT","RUN_POLL_INTERVAL_MS","RUN_POLL_MAX_MS","TERMINAL_STATUSES","isTerminalRunStatus","status","isRunPollExpired","run","created","now","RUN_FIELDS","LIST_QUERIES_QUERY","RUN_QUERY_MUTATION","QUERY_RUN_QUERY","QUERY_RUNS_QUERY","QUERY_RUN_RESULT_QUERY","useSemSavedQueries","useSemanticFed","useSemRequest","useQuery","workspaceId","modelId","ready","request","signal","q","useSemRunSavedQuery","queryClient","useQueryClient","analytics","useClientAnalytics","useMutation","data","queryId","captured","clearGraphqlReadCaches","useSemQueryRun","runId","query","useSemQueryRuns","useSemQueryRunResult","offset","asRecord","value","optionalString","runGovernance","governance","planSummary","outcome","decisions","d","raw","RESTRICTIVE_ACTIONS","restrictiveDecisions"],"sources":["../../../src/semanticfed/hooks/useQueryRuns.ts"],"sourcesContent":["import { useSemRequest } from './useSemRequest';\nimport { useClientAnalytics } from './useClientAnalytics';\n/**\n * Saved-query run hooks (BOFF-9754), wired to the `wspace-semanticfed-svc`\n * query-run API:\n *\n * - `semListQueries` lists the workspace's saved federated queries.\n * - `semRunQuery` enqueues a run and returns it QUEUED; an async worker plans\n * and executes it, so `semQueryRun` is polled until the run is terminal\n * (SUCCEEDED / FAILED / CANCELLED).\n * - `semQueryRunResult` returns one page of the governed rows of a SUCCEEDED\n * run: columns in SELECT order with each column's access-policy mask, and\n * offset pagination through `nextOffset` (BOFF-9650).\n * - `semListQueryRuns` is the run history of a saved query, newest first.\n */\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { clearGraphqlReadCaches } from '../api/semanticfedGraphql';\nimport { useSemanticFed } from '../providers/SemanticFedProvider';\n\nexport type SemQueryRunStatus =\n 'QUEUED' | 'PLANNING' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED';\n\nexport type SemSavedQueryStatus = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';\n\nexport interface SemSavedQuery {\n id: string;\n name: string;\n description: string | null;\n modelId: string | null;\n queryText: string;\n status: SemSavedQueryStatus;\n tags: string[];\n updatedAt: string;\n}\n\nexport interface SemQueryRun {\n id: string;\n queryId: string;\n status: SemQueryRunStatus;\n errorMessage: string | null;\n planSummary: unknown;\n rowCount: number | null;\n durationMs: number | null;\n sourcesTouched: number;\n fromCache: boolean;\n runById: string | null;\n createdAt: string;\n startedAt: string | null;\n finishedAt: string | null;\n}\n\nexport interface SemQueryRunResultColumn {\n name: string;\n entity: string;\n field: string;\n aggregation: string | null;\n masked: boolean;\n mask: string | null;\n}\n\nexport interface SemQueryRunResultPage {\n runId: string;\n queryId: string;\n columns: SemQueryRunResultColumn[];\n rows: Array<Record<string, unknown>>;\n rowCount: number;\n totalRowCount: number;\n truncated: boolean;\n offset: number;\n limit: number;\n nextOffset: number | null;\n expiresAt: string;\n}\n\n/** Rows per results page (the service allows up to 500). */\nexport const RUN_RESULT_PAGE_SIZE = 100;\n/** Saved queries offered in the picker (the picker is not paginated). */\nconst SAVED_QUERY_PICKER_LIMIT = 100;\n/** Runs shown in a saved query's history. */\nconst RUN_HISTORY_LIMIT = 20;\n/** How often an active run is polled. */\nexport const RUN_POLL_INTERVAL_MS = 1500;\n/**\n * How long after a run was created it is still polled automatically. A run\n * that is still not terminal by then (for example because the worker died\n * without marking it FAILED) is left for the user to re-check by hand.\n */\nexport const RUN_POLL_MAX_MS = 10 * 60 * 1000;\n\nconst TERMINAL_STATUSES: ReadonlySet<SemQueryRunStatus> = new Set([\n 'SUCCEEDED',\n 'FAILED',\n 'CANCELLED',\n]);\n\nexport function isTerminalRunStatus(status: SemQueryRunStatus): boolean {\n return TERMINAL_STATUSES.has(status);\n}\n\n/** True once a non-terminal run has been active longer than {@link RUN_POLL_MAX_MS}. */\nexport function isRunPollExpired(\n run: Pick<SemQueryRun, 'status' | 'createdAt'>,\n now: number = Date.now()\n): boolean {\n if (isTerminalRunStatus(run.status)) return false;\n const created = Date.parse(run.createdAt);\n return Number.isFinite(created) && now - created > RUN_POLL_MAX_MS;\n}\n\nconst RUN_FIELDS = `id\n queryId\n status\n errorMessage\n planSummary\n rowCount\n durationMs\n sourcesTouched\n fromCache\n runById\n createdAt\n startedAt\n finishedAt`;\n\nconst LIST_QUERIES_QUERY = `query SemConsoleSavedQueries($modelId: ID, $pagination: PaginationInput) {\n semListQueries(modelId: $modelId, pagination: $pagination) {\n items {\n id\n name\n description\n modelId\n queryText\n status\n tags\n updatedAt\n }\n }\n}`;\n\nconst RUN_QUERY_MUTATION = `mutation SemConsoleRunQuery($id: ID!) {\n semRunQuery(id: $id) {\n ${RUN_FIELDS}\n }\n}`;\n\nconst QUERY_RUN_QUERY = `query SemConsoleQueryRun($id: ID!) {\n semQueryRun(id: $id) {\n ${RUN_FIELDS}\n }\n}`;\n\nconst QUERY_RUNS_QUERY = `query SemConsoleQueryRuns($queryId: ID!, $pagination: PaginationInput) {\n semListQueryRuns(queryId: $queryId, pagination: $pagination) {\n items {\n ${RUN_FIELDS}\n }\n }\n}`;\n\nconst QUERY_RUN_RESULT_QUERY = `query SemConsoleQueryRunResult($runId: ID!, $pagination: PaginationInput) {\n semQueryRunResult(runId: $runId, pagination: $pagination) {\n runId\n queryId\n columns {\n name\n entity\n field\n aggregation\n masked\n mask\n }\n rows\n rowCount\n totalRowCount\n truncated\n offset\n limit\n nextOffset\n expiresAt\n }\n}`;\n\nexport function useSemSavedQueries(modelId: string | null) {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n return useQuery({\n queryKey: ['semanticfed', 'savedQueries', workspaceId ?? 'no-workspace', modelId] as const,\n enabled: ready && Boolean(workspaceId),\n queryFn: async ({ signal }) => {\n const data = await request<{ semListQueries: { items: SemSavedQuery[] } }>(\n LIST_QUERIES_QUERY,\n { modelId, pagination: { limit: SAVED_QUERY_PICKER_LIMIT } },\n signal\n );\n // Archived queries are deleted on the service and cannot be run.\n return data.semListQueries.items.filter((q) => q.status !== 'ARCHIVED');\n },\n });\n}\n\nexport function useSemRunSavedQuery() {\n const { workspaceId } = useSemanticFed();\n const { request } = useSemRequest();\n const queryClient = useQueryClient();\n const analytics = useClientAnalytics();\n return useMutation({\n retry: false,\n mutationFn: async (queryId: string) => {\n const data = await request<{ semRunQuery: SemQueryRun }>(RUN_QUERY_MUTATION, { id: queryId });\n analytics.runRequested();\n return data.semRunQuery;\n },\n onMutate: () => ({ queryClient, workspaceId }),\n onSuccess: (run, _queryId, captured) => {\n captured?.queryClient.setQueryData(\n ['semanticfed', 'queryRun', captured.workspaceId ?? 'no-workspace', run.id],\n run\n );\n },\n onSettled: (_run, _error, queryId, captured) => {\n clearGraphqlReadCaches();\n if (!captured) return;\n void captured.queryClient.invalidateQueries({\n queryKey: ['semanticfed', 'queryRuns', captured.workspaceId ?? 'no-workspace', queryId],\n });\n void captured.queryClient.invalidateQueries({\n queryKey: ['semanticfed', 'queryRun', captured.workspaceId ?? 'no-workspace'],\n });\n },\n });\n}\n\n/**\n * One run, polled every {@link RUN_POLL_INTERVAL_MS} until it is terminal (or\n * for at most {@link RUN_POLL_MAX_MS}). Each poll clears the shell's\n * short-lived (15 s) read cache, which would otherwise replay the QUEUED\n * response for its whole TTL. That cache is keyed by operation and variables\n * with no per-entry eviction, so it is cleared as a whole; other reads on the\n * page are held by React Query, so clearing it does not trigger refetches.\n */\nexport function useSemQueryRun(runId: string | null) {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n const queryClient = useQueryClient();\n return useQuery({\n queryKey: ['semanticfed', 'queryRun', workspaceId ?? 'no-workspace', runId] as const,\n enabled: ready && Boolean(workspaceId && runId),\n staleTime: 0,\n queryFn: async ({ signal }) => {\n clearGraphqlReadCaches();\n const data = await request<{ semQueryRun: SemQueryRun | null }>(\n QUERY_RUN_QUERY,\n { id: runId },\n signal\n );\n const run = data.semQueryRun;\n if (run && isTerminalRunStatus(run.status)) {\n void queryClient.invalidateQueries({\n queryKey: ['semanticfed', 'queryRuns', workspaceId ?? 'no-workspace', run.queryId],\n });\n }\n return run;\n },\n refetchInterval: (query) => {\n const run = query.state.data;\n if (run === null) return false;\n if (run && (isTerminalRunStatus(run.status) || isRunPollExpired(run))) return false;\n return RUN_POLL_INTERVAL_MS;\n },\n });\n}\n\nexport function useSemQueryRuns(queryId: string | null) {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n return useQuery({\n queryKey: ['semanticfed', 'queryRuns', workspaceId ?? 'no-workspace', queryId] as const,\n enabled: ready && Boolean(workspaceId && queryId),\n staleTime: 0,\n queryFn: async ({ signal }) => {\n clearGraphqlReadCaches();\n const data = await request<{ semListQueryRuns: { items: SemQueryRun[] } }>(\n QUERY_RUNS_QUERY,\n { queryId, pagination: { limit: RUN_HISTORY_LIMIT } },\n signal\n );\n return data.semListQueryRuns.items;\n },\n });\n}\n\n/** One page of a SUCCEEDED run's governed rows; `runId` null keeps it idle. */\nexport function useSemQueryRunResult(runId: string | null, offset: number) {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n return useQuery({\n queryKey: [\n 'semanticfed',\n 'queryRunResult',\n workspaceId ?? 'no-workspace',\n runId,\n offset,\n ] as const,\n enabled: ready && Boolean(workspaceId && runId),\n retry: false,\n queryFn: async ({ signal }) => {\n const data = await request<{ semQueryRunResult: SemQueryRunResultPage }>(\n QUERY_RUN_RESULT_QUERY,\n { runId, pagination: { limit: RUN_RESULT_PAGE_SIZE, offset } },\n signal\n );\n return data.semQueryRunResult;\n },\n });\n}\n\n/** One access-policy decision recorded on `planSummary.governance`. */\nexport interface SemGovernanceDecision {\n action: string;\n entity: string;\n field: string | null;\n policyName: string | null;\n mask: string | null;\n detail: string | null;\n}\n\nexport interface SemRunGovernance {\n outcome: 'ALLOWED' | 'DENIED';\n policiesEvaluated: number;\n reason: string | null;\n decisions: SemGovernanceDecision[];\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nfunction optionalString(value: unknown): string | null {\n return typeof value === 'string' && value !== '' ? value : null;\n}\n\n/**\n * The access-policy record of a run (`planSummary.governance`), or null when\n * the run was not governed. `planSummary` is untyped JSON, so every field is\n * checked before use.\n */\nexport function runGovernance(planSummary: unknown): SemRunGovernance | null {\n const governance = asRecord(asRecord(planSummary)?.governance);\n if (!governance) return null;\n // Anything other than an explicit ALLOWED is shown as a denial, so an outcome\n // the console does not know yet can never hide a refusal.\n const outcome = governance.outcome === 'ALLOWED' ? 'ALLOWED' : 'DENIED';\n const decisions = Array.isArray(governance.decisions) ? governance.decisions : [];\n return {\n outcome,\n policiesEvaluated:\n typeof governance.policiesEvaluated === 'number' ? governance.policiesEvaluated : 0,\n reason: optionalString(governance.reason),\n decisions: decisions.flatMap((raw) => {\n const d = asRecord(raw);\n if (!d || typeof d.action !== 'string') return [];\n return [\n {\n action: d.action,\n entity: optionalString(d.entity) ?? '',\n field: optionalString(d.field),\n policyName: optionalString(d.policyName),\n mask: optionalString(d.mask),\n detail: optionalString(d.detail),\n },\n ];\n }),\n };\n}\n\n/** Decisions that removed or hid data, which a failed or partial run explains with. */\nconst RESTRICTIVE_ACTIONS: ReadonlySet<string> = new Set([\n 'ENTITY_DENIED',\n 'ROWS_BLOCKED',\n 'COLUMN_DENIED',\n 'EVALUATION_FAILED',\n]);\n\nexport function restrictiveDecisions(governance: SemRunGovernance): SemGovernanceDecision[] {\n return governance.decisions.filter((d) => RESTRICTIVE_ACTIONS.has(d.action));\n}\n"],"mappings":";;;;;AA8EA,IAAMA,IAA2B,KAE3BC,IAAoB,IAEbC,IAAuB,MAMvBC,IAAkB,KAEzBC,oBAAoD,IAAI,IAAI;CAChE;CACA;CACA;AACF,CAAC;AAED,SAAgBC,EAAoB,GAAoC;CACtE,OAAOD,EAAkB,IAAIE,CAAM;AACrC;AAGA,SAAgBC,EACd,GACA,IAAc,KAAK,IAAI,GACd;CACT,IAAIF,EAAoBG,EAAI,MAAM,GAAG,OAAO;CAC5C,IAAMC,IAAU,KAAK,MAAMD,EAAI,SAAS;CACxC,OAAO,OAAO,SAASC,CAAO,KAAKC,IAAMD,IAAA;AAC3C;AAEA,IAAME,IAAa,8LAcbC,IAAqB,8RAerBC,IAAqB;;MAErBF,EAAW;;IAIXG,IAAkB;;MAElBH,EAAW;;IAIXI,IAAmB;;;QAGjBJ,EAAW;;;IAKbK,IAAyB;AAuB/B,SAAgBC,EAAmB,GAAwB;CACzD,IAAM,EAAE,mBAAgBC,EAAe,GACjC,EAAE,YAAS,aAAUC,EAAc;CACzC,OAAOC,EAAS;EACd,UAAU;GAAC;GAAe;GAAgBC,KAAe;GAAgBC;EAAO;EAChF,SAASC,KAAS,EAAQF;EAC1B,SAAS,OAAO,EAAE,iBAOT,MANYG,EACjBZ,GACA;GAAE;GAAS,YAAY,EAAE,OAAOZ,EAAyB;EAAE,GAC3DyB,CACF,EAAA,CAEY,eAAe,MAAM,QAAQ,MAAMC,EAAE,WAAW,UAAU;CAE1E,CAAC;A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F,EAAW,YAAY,YAAY,YAAY,UACzDG,IAAY,MAAM,QAAQH,EAAW,SAAS,IAAIA,EAAW,YAAY,CAAC;CAChF,OAAO;EACL;EACA,mBACE,OAAOA,EAAW,qBAAsB,WAAWA,EAAW,oBAAoB;EACpF,QAAQF,EAAeE,EAAW,MAAM;EACxC,WAAWG,EAAU,SAAS,MAAQ;GACpC,IAAMC,IAAIR,EAASS,CAAG;GAEtB,OADI,CAACD,KAAK,OAAOA,EAAE,UAAW,WAAiB,CAAC,IACzC,CACL;IACE,QAAQA,EAAE;IACV,QAAQN,EAAeM,EAAE,MAAM,KAAK;IACpC,OAAON,EAAeM,EAAE,KAAK;IAC7B,YAAYN,EAAeM,EAAE,UAAU;IACvC,MAAMN,EAAeM,EAAE,IAAI;IAC3B,QAAQN,EAAeM,EAAE,MAAM;GACjC,CACF;EACF,CAAC;CACH;AACF;AAGA,IAAME,oBAA2C,IAAI,IAAI;CACvD;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgBC,EAAqB,GAAuD;CAC1F,OAAOP,EAAW,UAAU,QAAQ,MAAMM,EAAoB,IAAIF,EAAE,MAAM,CAAC;AAC7E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { semRequest as e } from "../api/semanticfedGraphql.js";
|
|
2
|
+
import { useSemanticFed as t } from "../providers/SemanticFedProvider.js";
|
|
3
|
+
// src/semanticfed/hooks/useSemRequest.ts
|
|
4
|
+
function n() {
|
|
5
|
+
let { apiGatewayUrl: n, authToken: r, currentUser: i, workspaceId: a, organizationId: o, tenantId: s, projectId: c, workspaceToken: l } = t();
|
|
6
|
+
return {
|
|
7
|
+
request: (t, u = {}, d) => {
|
|
8
|
+
if (!n || !r || !i?.id || !a) throw Error("The account context is not ready.");
|
|
9
|
+
return e(t, u, n, {
|
|
10
|
+
apiGatewayUrl: n,
|
|
11
|
+
authToken: r,
|
|
12
|
+
actorId: i.id,
|
|
13
|
+
workspaceId: a,
|
|
14
|
+
organizationId: o,
|
|
15
|
+
tenantId: s,
|
|
16
|
+
projectId: c,
|
|
17
|
+
workspaceToken: l
|
|
18
|
+
}, d);
|
|
19
|
+
},
|
|
20
|
+
ready: !!(n && r && i?.id && a)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export { n as useSemRequest };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=useSemRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSemRequest.js","names":["useSemRequest","useSemanticFed","apiGatewayUrl","authToken","currentUser","workspaceId","semRequest","query","variables","signal"],"sources":["../../../src/semanticfed/hooks/useSemRequest.ts"],"sourcesContent":["import { semRequest } from '../api/semanticfedGraphql';\nimport { useSemanticFed } from '../providers/SemanticFedProvider';\n\n/** Capture mounted native context before any asynchronous preparation. */\nexport function useSemRequest() {\n const {\n apiGatewayUrl,\n authToken,\n currentUser,\n workspaceId,\n organizationId,\n tenantId,\n projectId,\n workspaceToken,\n } = useSemanticFed();\n const ready = Boolean(apiGatewayUrl && authToken && currentUser?.id && workspaceId);\n const request = <T>(\n query: string,\n variables: Record<string, unknown> = {},\n signal?: AbortSignal\n ): Promise<T> => {\n if (!apiGatewayUrl || !authToken || !currentUser?.id || !workspaceId)\n throw new Error('The account context is not ready.');\n return semRequest<T>(\n query,\n variables,\n apiGatewayUrl,\n {\n apiGatewayUrl,\n authToken,\n actorId: currentUser.id,\n workspaceId,\n organizationId,\n tenantId,\n projectId,\n workspaceToken,\n },\n signal\n );\n };\n return { request, ready };\n}\n"],"mappings":";;;AAIA,SAAgBA,IAAgB;CAC9B,IAAM,EACJ,kBACA,cACA,gBACA,gBACA,mBACA,aACA,cACA,sBACEC,EAAe;CA0BnB,OAAO;EAAE,UAvBP,GACA,IAAqC,CAAC,GACtC,MACe;GACf,IAAI,CAACC,KAAiB,CAACC,KAAa,CAACC,GAAa,MAAM,CAACC,GACvD,MAAU,MAAM,mCAAmC;GACrD,OAAOC,EACLC,GACAC,GACAN,GACA;IACE;IACA;IACA,SAASE,EAAY;IACrB;IACA;IACA;IACA;IACA;GACF,GACAK,CACF;EACF;EACkB,QAzBJ,EAAQP,KAAiBC,KAAaC,GAAa,MAAMC;CAyB/C;AAC1B"}
|
|
@@ -1,42 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useSemRequest as e } from "./useSemRequest.js";
|
|
2
|
+
import { useClientAnalytics as t } from "./useClientAnalytics.js";
|
|
3
|
+
import { SemRequestError as n } from "../api/semanticfedGraphql.js";
|
|
4
|
+
import { useSemanticFed as r } from "../providers/SemanticFedProvider.js";
|
|
5
|
+
import { useMutation as i, useQuery as a } from "@tanstack/react-query";
|
|
4
6
|
// src/semanticfed/hooks/useSqlConsole.ts
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
let {
|
|
8
|
-
return
|
|
7
|
+
var o = "query SemSqlConsoleModels($pagination: PaginationInput) {\n semListModels(pagination: $pagination) {\n items {\n id\n name\n status\n }\n }\n}", s = "query SemSqlCatalog($modelId: ID) {\n semSqlCatalog(modelId: $modelId) {\n modelId\n modelName\n tables {\n name\n kind\n description\n primaryKey\n columns {\n name\n kind\n dataType\n aggregation\n description\n isPrimary\n }\n }\n }\n}", c = "mutation SemExecuteSql($input: SemExecuteSqlInput!) {\n semExecuteSql(input: $input) {\n modelId\n columns {\n name\n entity\n field\n aggregation\n dataType\n masked\n mask\n }\n rows\n rowCount\n truncated\n durationMs\n sourcesTouched\n }\n}", l = 100;
|
|
8
|
+
function u() {
|
|
9
|
+
let { workspaceId: t } = r(), { request: n, ready: i } = e();
|
|
10
|
+
return a({
|
|
9
11
|
queryKey: [
|
|
10
12
|
"semanticfed",
|
|
11
13
|
"sql",
|
|
12
14
|
"models",
|
|
13
|
-
|
|
15
|
+
t ?? "no-workspace"
|
|
14
16
|
],
|
|
15
|
-
enabled: !!
|
|
16
|
-
queryFn: async () => (await
|
|
17
|
+
enabled: i && !!t,
|
|
18
|
+
queryFn: async ({ signal: e }) => (await n(o, { pagination: { limit: l } }, e)).semListModels.items
|
|
17
19
|
});
|
|
18
20
|
}
|
|
19
|
-
function
|
|
20
|
-
let {
|
|
21
|
-
return
|
|
21
|
+
function d(t) {
|
|
22
|
+
let { workspaceId: n } = r(), { request: i, ready: o } = e();
|
|
23
|
+
return a({
|
|
22
24
|
queryKey: [
|
|
23
25
|
"semanticfed",
|
|
24
26
|
"sql",
|
|
25
27
|
"catalog",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
n ?? "no-workspace",
|
|
29
|
+
t
|
|
28
30
|
],
|
|
29
|
-
enabled: !!(
|
|
30
|
-
queryFn: async () => (await
|
|
31
|
+
enabled: o && !!(n && t),
|
|
32
|
+
queryFn: async ({ signal: e }) => (await i(s, { modelId: t }, e)).semSqlCatalog
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
let {
|
|
35
|
-
return
|
|
35
|
+
function f() {
|
|
36
|
+
let { request: n } = e(), r = t();
|
|
37
|
+
return i({
|
|
38
|
+
retry: !1,
|
|
39
|
+
mutationFn: async (e) => {
|
|
40
|
+
try {
|
|
41
|
+
let t = await n(c, { input: e });
|
|
42
|
+
return r.sqlExecuted(t.semExecuteSql.rowCount, t.semExecuteSql.truncated), t.semExecuteSql;
|
|
43
|
+
} catch (e) {
|
|
44
|
+
throw r.sqlFailed(e), e;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
36
48
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
49
|
+
function p(e) {
|
|
50
|
+
return e instanceof n && e.detail && e.code !== "INTERNAL_SERVER_ERROR" ? e.detail : e instanceof Error ? e.message : String(e);
|
|
39
51
|
}
|
|
40
|
-
export {
|
|
52
|
+
export { p as sqlErrorMessage, f as useSemExecuteSql, d as useSemSqlCatalog, u as useSemSqlModels };
|
|
41
53
|
|
|
42
54
|
//# sourceMappingURL=useSqlConsole.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSqlConsole.js","names":["LIST_MODELS_QUERY","SQL_CATALOG_QUERY","EXECUTE_SQL_MUTATION","MODEL_PICKER_LIMIT","useSemSqlModels","useSemanticFed","useQuery","workspaceId","
|
|
1
|
+
{"version":3,"file":"useSqlConsole.js","names":["LIST_MODELS_QUERY","SQL_CATALOG_QUERY","EXECUTE_SQL_MUTATION","MODEL_PICKER_LIMIT","useSemSqlModels","useSemanticFed","useSemRequest","useQuery","workspaceId","ready","request","signal","useSemSqlCatalog","modelId","useSemExecuteSql","analytics","useClientAnalytics","useMutation","data","error","sqlErrorMessage","SemRequestError"],"sources":["../../../src/semanticfed/hooks/useSqlConsole.ts"],"sourcesContent":["import { useSemRequest } from './useSemRequest';\nimport { useClientAnalytics } from './useClientAnalytics';\n/**\n * SQL console hooks, wired to the real `wspace-semanticfed-svc` SQL endpoint\n * (BOFF-4271): `semListModels` to pick a semantic model, `semSqlCatalog` for\n * the table/column browser and `semExecuteSql` to run a read-only SELECT\n * through the federated query engine with the caller's access policies.\n */\nimport { useMutation, useQuery } from '@tanstack/react-query';\n\nimport { SemRequestError } from '../api/semanticfedGraphql';\nimport { useSemanticFed } from '../providers/SemanticFedProvider';\n\nexport type SemSqlDataType =\n 'STRING' | 'INTEGER' | 'DECIMAL' | 'BOOLEAN' | 'DATE' | 'TIMESTAMP' | 'JSON' | 'GEO' | 'UNKNOWN';\n\nexport interface SemModelSummary {\n id: string;\n name: string;\n status: string;\n}\n\nexport interface SemSqlCatalogColumn {\n name: string;\n kind: 'DIMENSION' | 'METRIC';\n dataType: SemSqlDataType;\n aggregation: string | null;\n description: string | null;\n isPrimary: boolean;\n}\n\nexport interface SemSqlCatalogTable {\n name: string;\n kind: string;\n description: string | null;\n primaryKey: string | null;\n columns: SemSqlCatalogColumn[];\n}\n\nexport interface SemSqlCatalog {\n modelId: string;\n modelName: string;\n tables: SemSqlCatalogTable[];\n}\n\nexport interface SemSqlResultColumn {\n name: string;\n entity: string;\n field: string;\n aggregation: string | null;\n dataType: SemSqlDataType;\n masked: boolean;\n mask: string | null;\n}\n\nexport interface SemSqlResult {\n modelId: string;\n columns: SemSqlResultColumn[];\n rows: Array<Record<string, unknown>>;\n rowCount: number;\n truncated: boolean;\n durationMs: number;\n sourcesTouched: number;\n}\n\nexport interface SemExecuteSqlInput {\n sql: string;\n modelId: string;\n maxRows?: number;\n}\n\nconst LIST_MODELS_QUERY = `query SemSqlConsoleModels($pagination: PaginationInput) {\n semListModels(pagination: $pagination) {\n items {\n id\n name\n status\n }\n }\n}`;\n\nconst SQL_CATALOG_QUERY = `query SemSqlCatalog($modelId: ID) {\n semSqlCatalog(modelId: $modelId) {\n modelId\n modelName\n tables {\n name\n kind\n description\n primaryKey\n columns {\n name\n kind\n dataType\n aggregation\n description\n isPrimary\n }\n }\n }\n}`;\n\nconst EXECUTE_SQL_MUTATION = `mutation SemExecuteSql($input: SemExecuteSqlInput!) {\n semExecuteSql(input: $input) {\n modelId\n columns {\n name\n entity\n field\n aggregation\n dataType\n masked\n mask\n }\n rows\n rowCount\n truncated\n durationMs\n sourcesTouched\n }\n}`;\n\n/** Largest model list the console offers (the picker is not paginated). */\nconst MODEL_PICKER_LIMIT = 100;\n\nexport function useSemSqlModels() {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n return useQuery({\n queryKey: ['semanticfed', 'sql', 'models', workspaceId ?? 'no-workspace'] as const,\n enabled: ready && Boolean(workspaceId),\n queryFn: async ({ signal }) => {\n const data = await request<{ semListModels: { items: SemModelSummary[] } }>(\n LIST_MODELS_QUERY,\n { pagination: { limit: MODEL_PICKER_LIMIT } },\n signal\n );\n return data.semListModels.items;\n },\n });\n}\n\nexport function useSemSqlCatalog(modelId: string | null) {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n return useQuery({\n queryKey: ['semanticfed', 'sql', 'catalog', workspaceId ?? 'no-workspace', modelId] as const,\n enabled: ready && Boolean(workspaceId && modelId),\n queryFn: async ({ signal }) => {\n const data = await request<{ semSqlCatalog: SemSqlCatalog }>(\n SQL_CATALOG_QUERY,\n { modelId },\n signal\n );\n return data.semSqlCatalog;\n },\n });\n}\n\nexport function useSemExecuteSql() {\n const { request } = useSemRequest();\n const analytics = useClientAnalytics();\n return useMutation({\n retry: false,\n mutationFn: async (input: SemExecuteSqlInput) => {\n try {\n const data = await request<{ semExecuteSql: SemSqlResult }>(EXECUTE_SQL_MUTATION, {\n input,\n });\n analytics.sqlExecuted(data.semExecuteSql.rowCount, data.semExecuteSql.truncated);\n return data.semExecuteSql;\n } catch (error: unknown) {\n analytics.sqlFailed(error);\n throw error;\n }\n },\n });\n}\n\n/**\n * The text to show for a failed SQL statement. The gateway generalises client\n * errors, so the service's own explanation (syntax position, unknown column,\n * policy denial) is preferred whenever the service sent one.\n */\nexport function sqlErrorMessage(error: unknown): string {\n if (error instanceof SemRequestError && error.detail && error.code !== 'INTERNAL_SERVER_ERROR') {\n return error.detail;\n }\n return error instanceof Error ? error.message : String(error);\n}\n"],"mappings":";;;;;;AAuEA,IAAMA,IAAoB,yKAUpBC,IAAoB,wUAqBpBC,IAAuB,qTAqBvBC,IAAqB;AAE3B,SAAgBC,IAAkB;CAChC,IAAM,EAAE,mBAAgBC,EAAe,GACjC,EAAE,YAAS,aAAUC,EAAc;CACzC,OAAOC,EAAS;EACd,UAAU;GAAC;GAAe;GAAO;GAAUC,KAAe;EAAc;EACxE,SAASC,KAAS,EAAQD;EAC1B,SAAS,OAAO,EAAE,iBAMT,MALYE,EACjBV,GACA,EAAE,YAAY,EAAE,OAAOG,EAAmB,EAAE,GAC5CQ,CACF,EAAA,CACY,cAAc;CAE9B,CAAC;AACH;AAEA,SAAgBC,EAAiB,GAAwB;CACvD,IAAM,EAAE,mBAAgBP,EAAe,GACjC,EAAE,YAAS,aAAUC,EAAc;CACzC,OAAOC,EAAS;EACd,UAAU;GAAC;GAAe;GAAO;GAAWC,KAAe;GAAgBK;EAAO;EAClF,SAASJ,KAAS,GAAQD,KAAeK;EACzC,SAAS,OAAO,EAAE,iBAMT,MALYH,EACjBT,GACA,EAAE,WAAQ,GACVU,CACF,EAAA,CACY;CAEhB,CAAC;AACH;AAEA,SAAgBG,IAAmB;CACjC,IAAM,EAAE,eAAYR,EAAc,GAC5BS,IAAYC,EAAmB;CACrC,OAAOC,EAAY;EACjB,OAAO;EACP,YAAY,OAAO,MAA8B;GAC/C,IAAI;IACF,IAAMC,IAAO,MAAMR,EAAyCR,GAAsB,EAChF,SACF,CAAC;IAED,OADAa,EAAU,YAAYG,EAAK,cAAc,UAAUA,EAAK,cAAc,SAAS,GACxEA,EAAK;GACd,SAASC,GAAgB;IAEvB,MADAJ,EAAU,UAAUI,CAAK,GACnBA;GACR;EACF;CACF,CAAC;AACH;AAOA,SAAgBC,EAAgB,GAAwB;CAItD,OAHID,aAAiBE,KAAmBF,EAAM,UAAUA,EAAM,SAAS,0BAC9DA,EAAM,SAERA,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK;AAC9D"}
|
|
@@ -20,6 +20,7 @@ var u = ({ children: e, ...t }) => {
|
|
|
20
20
|
t.currentUser?.id ?? "",
|
|
21
21
|
t.organizationId ?? "",
|
|
22
22
|
t.tenantId ?? "",
|
|
23
|
+
t.projectId ?? "",
|
|
23
24
|
t.workspaceId ?? "",
|
|
24
25
|
t.apiGatewayUrl ?? ""
|
|
25
26
|
]), [c, u] = n(() => ({
|
|
@@ -36,7 +37,7 @@ var u = ({ children: e, ...t }) => {
|
|
|
36
37
|
value: t,
|
|
37
38
|
children: e
|
|
38
39
|
})
|
|
39
|
-
});
|
|
40
|
+
}, i);
|
|
40
41
|
return t.basePath ? f : /* @__PURE__ */ o(r, { children: f });
|
|
41
42
|
};
|
|
42
43
|
export { u as SemanticFedProvider, c as useSemanticFed };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SemanticFedProvider.js","names":["SemanticFedContext","createContext","useSemanticFed","context","useContext","createQueryClient","QueryClient","SemanticFedProvider","props","scope","cache","setCache","useState","queryClient","content","QueryClientProvider","MemoryRouter"],"sources":["../../../src/semanticfed/providers/SemanticFedProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { SemanticFedRootProps } from '../types';\n\ntype SemanticFedContextValue = SemanticFedRootProps;\n\nconst SemanticFedContext = createContext<SemanticFedContextValue | null>(null);\n\nexport const useSemanticFed = () => {\n const context = useContext(SemanticFedContext);\n if (!context) throw new Error('useSemanticFed must be used within SemanticFedProvider');\n return context;\n};\n\nfunction createQueryClient(): QueryClient {\n return new QueryClient({\n defaultOptions: {\n queries: { retry: 1, refetchOnWindowFocus: false, staleTime: 5 * 60 * 1000 },\n },\n });\n}\n\nexport const SemanticFedProvider: FC<PropsWithChildren<SemanticFedRootProps>> = ({\n children,\n ...props\n}) => {\n // The cache holds actor-scoped data (for example governed query-run rows),\n // so a different signed-in actor or workspace gets a fresh, empty cache\n // instead of the previous one's responses. The client is swapped during\n // render (React's \"adjust state when a prop changes\" pattern), so no\n // render ever shows the previous actor's data.\n const scope = JSON.stringify([\n props.currentUser?.id ?? '',\n props.organizationId ?? '',\n props.tenantId ?? '',\n props.workspaceId ?? '',\n props.apiGatewayUrl ?? '',\n ]);\n const [cache, setCache] = useState(() => ({ scope, client: createQueryClient() }));\n let queryClient = cache.client;\n if (cache.scope !== scope) {\n queryClient = createQueryClient();\n setCache({ scope, client: queryClient });\n }\n\n const content = (\n <QueryClientProvider client={queryClient}>\n <SemanticFedContext.Provider value={props}>{children}</SemanticFedContext.Provider>\n </QueryClientProvider>\n );\n\n if (props.basePath) return content;\n return <MemoryRouter>{content}</MemoryRouter>;\n};\n"],"mappings":";;;;;AAQA,IAAMA,IAAqBC,EAA8C,IAAI,GAEhEC,UAAuB;CAClC,IAAMC,IAAUC,EAAWJ,CAAkB;CAC7C,IAAI,CAACG,GAAS,MAAU,MAAM,wDAAwD;CACtF,OAAOA;AACT;AAEA,SAASE,IAAiC;CACxC,OAAO,IAAIC,EAAY,EACrB,gBAAgB,EACd,SAAS;EAAE,OAAO;EAAG,sBAAsB;EAAO,WAAW;CAAc,EAC7E,EACF,CAAC;AACH;AAEA,IAAaC,KAAoE,EAC/E,aACA,GAAGC,QACC;CAMJ,IAAMC,IAAQ,KAAK,UAAU;EAC3BD,EAAM,aAAa,MAAM;EACzBA,EAAM,kBAAkB;EACxBA,EAAM,YAAY;EAClBA,EAAM,eAAe;EACrBA,EAAM,iBAAiB;CACzB,CAAC,GACK,CAACE,GAAOC,KAAYC,SAAgB;EAAE;EAAO,QAAQP,EAAkB;CAAE,EAAE,GAC7EQ,IAAcH,EAAM;CACxB,AAAIA,EAAM,UAAUD,MAClB,IAAcJ,EAAkB,GAChCM,EAAS;EAAE;EAAO,QAAQE;CAAY,CAAC;CAGzC,IAAMC,
|
|
1
|
+
{"version":3,"file":"SemanticFedProvider.js","names":["SemanticFedContext","createContext","useSemanticFed","context","useContext","createQueryClient","QueryClient","SemanticFedProvider","props","scope","cache","setCache","useState","queryClient","content","QueryClientProvider","MemoryRouter"],"sources":["../../../src/semanticfed/providers/SemanticFedProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { SemanticFedRootProps } from '../types';\n\ntype SemanticFedContextValue = SemanticFedRootProps;\n\nconst SemanticFedContext = createContext<SemanticFedContextValue | null>(null);\n\nexport const useSemanticFed = () => {\n const context = useContext(SemanticFedContext);\n if (!context) throw new Error('useSemanticFed must be used within SemanticFedProvider');\n return context;\n};\n\nfunction createQueryClient(): QueryClient {\n return new QueryClient({\n defaultOptions: {\n queries: { retry: 1, refetchOnWindowFocus: false, staleTime: 5 * 60 * 1000 },\n },\n });\n}\n\nexport const SemanticFedProvider: FC<PropsWithChildren<SemanticFedRootProps>> = ({\n children,\n ...props\n}) => {\n // The cache holds actor-scoped data (for example governed query-run rows),\n // so a different signed-in actor or workspace gets a fresh, empty cache\n // instead of the previous one's responses. The client is swapped during\n // render (React's \"adjust state when a prop changes\" pattern), so no\n // render ever shows the previous actor's data.\n const scope = JSON.stringify([\n props.currentUser?.id ?? '',\n props.organizationId ?? '',\n props.tenantId ?? '',\n props.projectId ?? '',\n props.workspaceId ?? '',\n props.apiGatewayUrl ?? '',\n ]);\n const [cache, setCache] = useState(() => ({ scope, client: createQueryClient() }));\n let queryClient = cache.client;\n if (cache.scope !== scope) {\n queryClient = createQueryClient();\n setCache({ scope, client: queryClient });\n }\n\n const content = (\n // A context change also resets local result/editor/history state below the\n // provider; swapping only the query client leaves old local rows mounted.\n <QueryClientProvider key={scope} client={queryClient}>\n <SemanticFedContext.Provider value={props}>{children}</SemanticFedContext.Provider>\n </QueryClientProvider>\n );\n\n if (props.basePath) return content;\n return <MemoryRouter>{content}</MemoryRouter>;\n};\n"],"mappings":";;;;;AAQA,IAAMA,IAAqBC,EAA8C,IAAI,GAEhEC,UAAuB;CAClC,IAAMC,IAAUC,EAAWJ,CAAkB;CAC7C,IAAI,CAACG,GAAS,MAAU,MAAM,wDAAwD;CACtF,OAAOA;AACT;AAEA,SAASE,IAAiC;CACxC,OAAO,IAAIC,EAAY,EACrB,gBAAgB,EACd,SAAS;EAAE,OAAO;EAAG,sBAAsB;EAAO,WAAW;CAAc,EAC7E,EACF,CAAC;AACH;AAEA,IAAaC,KAAoE,EAC/E,aACA,GAAGC,QACC;CAMJ,IAAMC,IAAQ,KAAK,UAAU;EAC3BD,EAAM,aAAa,MAAM;EACzBA,EAAM,kBAAkB;EACxBA,EAAM,YAAY;EAClBA,EAAM,aAAa;EACnBA,EAAM,eAAe;EACrBA,EAAM,iBAAiB;CACzB,CAAC,GACK,CAACE,GAAOC,KAAYC,SAAgB;EAAE;EAAO,QAAQP,EAAkB;CAAE,EAAE,GAC7EQ,IAAcH,EAAM;CACxB,AAAIA,EAAM,UAAUD,MAClB,IAAcJ,EAAkB,GAChCM,EAAS;EAAE;EAAO,QAAQE;CAAY,CAAC;CAGzC,IAAMC,IAGJ,kBAACC,GAAD;EAAiC,QAAQF;EACvC,UAAA,kBAACb,EAAmB,UAApB;GAA6B,OAAOQ;GAAQ;EAAsC,CAAA;CAC/D,GAFKC,CAEL;CAIvB,OADID,EAAM,WAAiBM,IACpB,kBAACE,GAAD,EAAA,UAAeF,EAAsB,CAAA;AAC9C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-semanticfed",
|
|
3
|
-
"version": "2026.1109.
|
|
3
|
+
"version": "2026.1109.9",
|
|
4
4
|
"description": "Burdenoff SemanticFed Microfrontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lint": "eslint .",
|
|
27
27
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
28
28
|
"type:check": "tsc --noEmit",
|
|
29
|
-
"sanity": "bun run test:dependency-backports && bun run test:release-contract && bun run codegen && bun run lint && bun run format && bun run type:check && bun run build",
|
|
29
|
+
"sanity": "bun run test:dependency-backports && bun run test:release-contract && bun run test:client-scope && bun run codegen && bun run lint && bun run format && bun run type:check && bun run build",
|
|
30
30
|
"schema:pull": "graphql-codegen --project schema-wspace && graphql-codegen --project schema-global",
|
|
31
31
|
"codegen": "graphql-codegen --project wspace && graphql-codegen --project global",
|
|
32
32
|
"codegen:all": "bun run schema:pull && bun run codegen",
|
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
"prepare": "lefthook install || true",
|
|
38
38
|
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
|
|
39
39
|
"test:dependency-backports": "bun scripts/test-dependency-backports.mjs",
|
|
40
|
-
"test:release-contract": "bun test scripts/check-release-package.test.ts"
|
|
40
|
+
"test:release-contract": "bun test scripts/check-release-package.test.ts",
|
|
41
|
+
"test:client-scope": "bun test --preload ./scripts/offline-browser-network.ts scripts/client-analytics.test.ts scripts/scoped-request.test.ts scripts/provider-scope.test.tsx"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@apollo/client": "^4.0.11",
|
|
44
|
-
"@burdenoff/fe-libs": "2026.
|
|
45
|
+
"@burdenoff/fe-libs": "2026.1109.1",
|
|
45
46
|
"@tanstack/react-query": "^5.90.16",
|
|
46
47
|
"clsx": "^2.1.1",
|
|
47
48
|
"framer-motion": "^12.0.0",
|