@datalayer/core 1.1.66 → 1.2.10
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 +41 -18
- package/lib/api/constants.d.ts +1 -1
- package/lib/api/constants.js +1 -1
- package/lib/api/contents/attachments.js +3 -7
- package/lib/api/contents/datasets.d.ts +48 -0
- package/lib/api/contents/datasets.js +44 -7
- package/lib/api/contents/runtimeMounts.js +1 -1
- package/lib/api/contents/sandboxUid.d.ts +13 -45
- package/lib/api/contents/sandboxUid.js +14 -65
- package/lib/api/evals/client.d.ts +402 -0
- package/lib/api/evals/client.js +359 -0
- package/lib/api/evals/index.d.ts +10 -0
- package/lib/api/evals/index.js +18 -0
- package/lib/api/evals/request.d.ts +43 -0
- package/lib/api/evals/request.js +67 -0
- package/lib/api/evals/status.d.ts +27 -0
- package/lib/api/evals/status.js +122 -0
- package/lib/api/evals/types.d.ts +1335 -0
- package/lib/api/evals/types.js +5 -0
- package/lib/api/iam/connectedAgents.d.ts +29 -0
- package/lib/api/iam/connectedAgents.js +35 -0
- package/lib/api/iam/identityProviders.d.ts +76 -0
- package/lib/api/iam/identityProviders.js +187 -0
- package/lib/api/iam/index.d.ts +1 -0
- package/lib/api/iam/index.js +1 -0
- package/lib/api/iam/mcpPolicy.d.ts +102 -1
- package/lib/api/iam/mcpPolicy.js +38 -2
- package/lib/api/iam/profile.d.ts +17 -1
- package/lib/api/iam/profile.js +27 -0
- package/lib/api/iam/scimTokens.d.ts +79 -0
- package/lib/api/iam/scimTokens.js +141 -0
- package/lib/api/iam/secrets.js +9 -21
- package/lib/api/iam/trials.d.ts +38 -0
- package/lib/api/iam/trials.js +66 -0
- package/lib/api/index.d.ts +4 -0
- package/lib/api/index.js +4 -0
- package/lib/api/mcp/observability.d.ts +25 -9
- package/lib/api/mcp/observability.js +63 -50
- package/lib/api/orchestration/client.d.ts +53 -0
- package/lib/api/orchestration/client.js +105 -0
- package/lib/api/orchestration/events.d.ts +88 -0
- package/lib/api/orchestration/events.js +245 -0
- package/lib/api/orchestration/generated.d.ts +693 -0
- package/lib/api/orchestration/generated.js +687 -0
- package/lib/api/orchestration/index.d.ts +30 -0
- package/lib/api/orchestration/index.js +34 -0
- package/lib/api/orchestration/lifecycle.d.ts +39 -0
- package/lib/api/orchestration/lifecycle.js +57 -0
- package/lib/api/orchestration/measures.d.ts +55 -0
- package/lib/api/orchestration/measures.js +99 -0
- package/lib/api/otel/dashboards.d.ts +56 -0
- package/lib/api/otel/dashboards.js +50 -0
- package/lib/api/otel/index.d.ts +1 -0
- package/lib/api/otel/index.js +1 -0
- package/lib/api/otel/metrics.d.ts +16 -0
- package/lib/api/otel/metrics.js +15 -0
- package/lib/api/scheduler/client.d.ts +32 -0
- package/lib/api/scheduler/client.js +42 -0
- package/lib/api/scheduler/index.d.ts +8 -0
- package/lib/api/scheduler/index.js +16 -0
- package/lib/api/scheduler/request.d.ts +28 -0
- package/lib/api/scheduler/request.js +50 -0
- package/lib/api/scheduler/types.d.ts +88 -0
- package/lib/api/scheduler/types.js +5 -0
- package/lib/api/spacer/comments.d.ts +97 -0
- package/lib/api/spacer/comments.js +45 -0
- package/lib/api/spacer/index.d.ts +9 -0
- package/lib/api/spacer/index.js +17 -0
- package/lib/api/spacer/notebooks.d.ts +33 -0
- package/lib/api/spacer/notebooks.js +39 -0
- package/lib/api/spacer/request.d.ts +25 -0
- package/lib/api/spacer/request.js +46 -0
- package/lib/api/spacer/spaces.d.ts +68 -0
- package/lib/api/spacer/spaces.js +45 -0
- package/lib/api/utils/validation.d.ts +4 -4
- package/lib/api/utils/validation.js +10 -7
- package/lib/client/constants.d.ts +1 -0
- package/lib/client/constants.js +1 -0
- package/lib/components/animation/AnimatedText.d.ts +1 -44
- package/lib/components/animation/AnimatedText.js +6 -122
- package/lib/components/anonymous/AnonymousKeyExpired.d.ts +56 -0
- package/lib/components/anonymous/AnonymousKeyExpired.js +96 -0
- package/lib/components/anonymous/AnonymousKeyTimer.d.ts +63 -0
- package/lib/components/anonymous/AnonymousKeyTimer.js +140 -0
- package/lib/components/anonymous/index.d.ts +7 -0
- package/lib/components/anonymous/index.js +15 -0
- package/lib/components/avatars/UserAvatar.d.ts +7 -1
- package/lib/components/avatars/UserAvatar.js +15 -1
- package/lib/components/billing/BillingEntitySelect.d.ts +6 -0
- package/lib/components/billing/BillingEntitySelect.js +49 -10
- package/lib/components/billing/eligibility.d.ts +22 -0
- package/lib/components/billing/eligibility.js +27 -0
- package/lib/components/billing/index.d.ts +1 -0
- package/lib/components/billing/index.js +1 -0
- package/lib/components/collaboration/LiveEditorCollaborators.d.ts +5 -0
- package/lib/components/collaboration/LiveEditorCollaborators.js +3 -1
- package/lib/components/display/DatalayerBox.d.ts +2 -3
- package/lib/components/display/DatalayerBox.js +1 -1
- package/lib/components/display/NavLink.js +3 -2
- package/lib/components/labels/StatusLabels.d.ts +2 -10
- package/lib/components/labels/StatusLabels.js +2 -26
- package/lib/components/principal/PrincipalAppearance.d.ts +21 -42
- package/lib/components/principal/PrincipalAppearance.js +232 -174
- package/lib/components/principal/PrincipalAvatar.d.ts +8 -1
- package/lib/components/principal/PrincipalAvatar.js +2 -2
- package/lib/components/principal/PrincipalDetailsOverlay.d.ts +8 -1
- package/lib/components/principal/PrincipalDetailsOverlay.js +2 -2
- package/lib/components/screencapture/Screencapture.js +46 -3
- package/lib/components/sharing/ShareAccessComponent.d.ts +45 -4
- package/lib/components/sharing/ShareAccessComponent.js +110 -78
- package/lib/components/sharing/SharingEditor.d.ts +5 -1
- package/lib/components/sharing/SharingEditor.js +9 -4
- package/lib/components/sharing/index.d.ts +1 -0
- package/lib/components/sharing/index.js +1 -0
- package/lib/components/sharing/sandboxSharing.d.ts +26 -0
- package/lib/components/sharing/sandboxSharing.js +41 -0
- package/lib/components/spaces/SpaceDetailsOverlay.d.ts +39 -0
- package/lib/components/spaces/SpaceDetailsOverlay.js +80 -0
- package/lib/components/spaces/SpaceDisplay.d.ts +38 -0
- package/lib/components/spaces/SpaceDisplay.js +92 -0
- package/lib/components/spaces/index.d.ts +4 -0
- package/lib/components/spaces/index.js +7 -0
- package/lib/components/spaces/spaceDisplayModel.d.ts +93 -0
- package/lib/components/spaces/spaceDisplayModel.js +170 -0
- package/lib/hooks/cacheConverters.d.ts +0 -7
- package/lib/hooks/cacheConverters.js +0 -25
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/useBillingEntityStore.js +3 -0
- package/lib/hooks/useCache.d.ts +168 -25
- package/lib/hooks/useCache.js +1424 -307
- package/lib/hooks/useContents.d.ts +22 -1
- package/lib/hooks/useContents.js +90 -21
- package/lib/hooks/useMcp.d.ts +87 -1
- package/lib/hooks/useMcp.js +247 -12
- package/lib/hooks/useNavigate.d.ts +41 -3
- package/lib/hooks/useNavigate.js +106 -52
- package/lib/hooks/usePrincipalCacheStore.js +3 -0
- package/lib/hooks/usePrincipalStore.js +3 -0
- package/lib/hooks/useSpaceCacheStore.d.ts +50 -0
- package/lib/hooks/useSpaceCacheStore.js +85 -0
- package/lib/models/CreditsDTO.d.ts +6 -5
- package/lib/models/CreditsDTO.js +7 -5
- package/lib/models/McpBinding.d.ts +6 -0
- package/lib/models/Organization.d.ts +69 -0
- package/lib/models/Organization.js +96 -0
- package/lib/models/Secret.d.ts +1 -2
- package/lib/models/Secret.js +2 -18
- package/lib/models/StartedBy.d.ts +34 -0
- package/lib/models/StartedBy.js +36 -0
- package/lib/models/Team.d.ts +2 -0
- package/lib/models/Team.js +2 -0
- package/lib/models/User.d.ts +4 -0
- package/lib/models/User.js +3 -0
- package/lib/models/UserSettings.d.ts +13 -0
- package/lib/models/UserSettings.js +9 -0
- package/lib/models/contents/__fixtures__/v1-contracts.json +158 -30
- package/lib/navigation/components.js +2 -3
- package/lib/routes/publicPaths.js +4 -0
- package/lib/state/index.d.ts +1 -0
- package/lib/state/index.js +1 -0
- package/lib/state/sessionEnd.d.ts +55 -0
- package/lib/state/sessionEnd.js +162 -0
- package/lib/state/substates/CoreState.js +3 -3
- package/lib/state/substates/IAMState.js +7 -0
- package/lib/state/substates/LayoutState.js +12 -0
- package/lib/state/substates/ProfileState.d.ts +1 -0
- package/lib/state/substates/ProfileState.js +1 -0
- package/lib/utils/Lazy.d.ts +20 -0
- package/lib/utils/Lazy.js +32 -6
- package/lib/utils/Screencapture.js +3 -0
- package/lib/utils/WithSuspense.d.ts +11 -1
- package/lib/utils/WithSuspense.js +11 -1
- package/lib/views/mcp/AdmittedClients.d.ts +44 -0
- package/lib/views/mcp/AdmittedClients.js +59 -0
- package/lib/views/mcp/ApprovalQueue.d.ts +66 -0
- package/lib/views/mcp/ApprovalQueue.js +95 -0
- package/lib/views/mcp/ConnectedAgents.js +38 -3
- package/lib/views/mcp/EnterpriseConsole.d.ts +1 -1
- package/lib/views/mcp/EnterpriseConsole.js +23 -1
- package/lib/views/mcp/IdentityProviders.d.ts +33 -0
- package/lib/views/mcp/IdentityProviders.js +299 -0
- package/lib/views/mcp/McpDashboard.js +90 -7
- package/lib/views/mcp/McpObservability.d.ts +30 -1
- package/lib/views/mcp/McpObservability.js +105 -19
- package/lib/views/mcp/NotebookRuns.d.ts +39 -0
- package/lib/views/mcp/NotebookRuns.js +44 -0
- package/lib/views/mcp/OrganizationPolicy.js +2 -1
- package/lib/views/mcp/PersonalPolicy.js +2 -1
- package/lib/views/mcp/PolicyForm.d.ts +17 -1
- package/lib/views/mcp/PolicyForm.js +25 -3
- package/lib/views/mcp/PolicyHistory.d.ts +13 -0
- package/lib/views/mcp/PolicyHistory.js +14 -1
- package/lib/views/mcp/RunDetail.d.ts +87 -0
- package/lib/views/mcp/RunDetail.js +186 -0
- package/lib/views/mcp/ScimProvisioning.d.ts +54 -0
- package/lib/views/mcp/ScimProvisioning.js +173 -0
- package/lib/views/mcp/TeamPolicies.js +66 -5
- package/lib/views/mcp/ToolAccess.d.ts +60 -0
- package/lib/views/mcp/ToolAccess.js +101 -0
- package/lib/views/mcp/TraceTimeline.d.ts +81 -0
- package/lib/views/mcp/TraceTimeline.js +132 -0
- package/lib/views/mcp/index.d.ts +5 -0
- package/lib/views/mcp/index.js +5 -0
- package/lib/views/otel/simpleAuthStore.js +3 -0
- package/lib/views/secrets/SecretEdit.js +3 -2
- package/lib/views/secrets/SecretNew.js +5 -1
- package/package.json +269 -264
- package/scripts/generate-mcp-types.py +1 -1
- package/scripts/generate-orchestration-types.py +920 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BridgeList, type BridgeSession, type DownloadedObject, type AttachmentCreate, type AttachmentList, type ContentAttachment, type ContentAttachmentManifest, type DatasetRevision, type DatasetRevisionCreate, type DatasetRevisionList, type DatasetPublication, type DatasetPublicationCreate, type DatasetPublicationList, type ConditionalCatalogSource, type ContentObject, type ContentSource, type ContentSourceCreate, type ContentSourceUpdate, type Sharing, type ObjectList, type OperationView, type TransferView, type TransferList, type UploadProgress, type VersionList, type HomeFolderQuota, type SourceList, type McpApproval, type McpApprovalList, type McpApprovalStatus, type McpCall, type McpCallCreate, type McpCallList, type McpHealth, type McpSession, type McpSessionCreate, type McpSessionList, type McpToolManifest, type DatasourceCapabilities, type DatasourceQuery, type DatasourceQueryCreate, type DatasourceQueryList, type DatasourceQueryResultBytes, type DatasourceSchema, type DatasourceTest } from '../api/contents';
|
|
1
|
+
import { type BridgeList, type BridgeSession, type DownloadedObject, type AttachmentCreate, type AttachmentList, type ContentAttachment, type ContentAttachmentManifest, type DatasetRevision, type DatasetRevisionCreate, type DatasetRevisionList, type DataServerAttachment, type DatasetClone, type DatasetPublication, type DatasetPublicationCreate, type DatasetPublicationList, type ConditionalCatalogSource, type ContentObject, type ContentSource, type ContentSourceCreate, type ContentSourceUpdate, type Sharing, type ObjectList, type OperationView, type TransferView, type TransferList, type UploadProgress, type VersionList, type HomeFolderQuota, type SourceList, type McpApproval, type McpApprovalList, type McpApprovalStatus, type McpCall, type McpCallCreate, type McpCallList, type McpHealth, type McpSession, type McpSessionCreate, type McpSessionList, type McpToolManifest, type DatasourceCapabilities, type DatasourceQuery, type DatasourceQueryCreate, type DatasourceQueryList, type DatasourceQueryResultBytes, type DatasourceSchema, type DatasourceTest } from '../api/contents';
|
|
2
2
|
import type { CapabilityTicket, CapabilityTicketRequest, DataServerConnectivity, DataServerStatus, IssuedIdentity, CloudObjectList, ConnectionTest, CredentialDiagnostics, ContentsCapabilities, SyncConflictList, SyncSessionList, SyncSessionView, RuntimeMounts } from '../api/contents';
|
|
3
3
|
export type ContentSourceKind = ContentSource['kind'];
|
|
4
4
|
export declare const useDatasetRevisions: (sourceUid?: string) => import("@tanstack/react-query").UseQueryResult<DatasetRevisionList, Error>;
|
|
@@ -14,6 +14,27 @@ export declare const useCreateDatasetPublication: () => import("@tanstack/react-
|
|
|
14
14
|
request: DatasetPublicationCreate;
|
|
15
15
|
idempotencyKey: string;
|
|
16
16
|
}, unknown>;
|
|
17
|
+
/**
|
|
18
|
+
* Clone a published Dataset into the caller's own catalog.
|
|
19
|
+
*
|
|
20
|
+
* The idempotency key is derived from the publication rather than random: a
|
|
21
|
+
* retried click finds the clone it already made instead of making a second
|
|
22
|
+
* one.
|
|
23
|
+
*/
|
|
24
|
+
export declare const useCloneDatasetPublication: () => import("@tanstack/react-query").UseMutationResult<DatasetClone, Error, {
|
|
25
|
+
sourceUid: string;
|
|
26
|
+
publicationUid: string;
|
|
27
|
+
}, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Attach a published Data Server as a Datasource of the caller's own.
|
|
30
|
+
*
|
|
31
|
+
* The idempotency key is derived from the publication: a retried click finds
|
|
32
|
+
* the Datasource it already made rather than making a second one.
|
|
33
|
+
*/
|
|
34
|
+
export declare const useAttachDataServerPublication: () => import("@tanstack/react-query").UseMutationResult<DataServerAttachment, Error, {
|
|
35
|
+
sourceUid: string;
|
|
36
|
+
publicationUid: string;
|
|
37
|
+
}, unknown>;
|
|
17
38
|
export declare const useUnpublishDataset: () => import("@tanstack/react-query").UseMutationResult<DatasetPublication, Error, {
|
|
18
39
|
sourceUid: string;
|
|
19
40
|
publicationUid: string;
|
package/lib/hooks/useContents.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
5
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { cancelSyncSession, createAttachment, getBridge, getBridgeSession, isBridgeEnded, listBridges, revokeBridge, createSource, getCapabilities, getSyncSession, listSyncConflicts, listSyncSessions, resolveSyncConflict, createDatasetRevision, createDatasetPublication, cancelOperation, cancelTransfer, deleteHomeFolderObject, downloadHomeFolderObject, getOperation, getAttachmentManifest, getDatasetRevision, getTransfer, getSource, getSourceSharing, getHomeFolderQuota, getHomeFolder, listHomeFolderObjects, listHomeFolderObjectVersions, listSources, listAttachments, listDatasetRevisions, listDatasetPublications, listTransfers, restoreHomeFolderObject, revokeAttachment, unpublishDataset, archiveSource, replaceSourceSharing, statHomeFolderObject, uploadHomeFolderFile, updateSource, listCloudObjects, getCredentialDiagnostics, testCloudConnection, listPublishedDatasets, callMcpTool, createMcpSession, decideMcpApproval, discoverMcpTools, getMcpCall, getMcpSession, isMcpCallTerminal, listMcpApprovals, listMcpCalls, listMcpSessions, revokeMcpSession, testMcpSource, cancelDatasourceQuery, createDatasourceQuery, createDatasourceQueryTicket, discoverDatasourceSchema, downloadDatasourceQueryResults, drainDataserver, getDatasourceCapabilities, getDatasourceQuery, getDataserverStatus, isDatasourceQueryTerminal, listDatasourceQueries, resumeDataserver, revokeDataserver, rotateDataserverIdentity, saveDatasourceQueryAsDataset, testDatasource, testDataserver, attachRuntimeMounts, detachRuntimeMount, getRuntimeMounts, isRuntimeMountsSettled, } from '../api/contents/index.js';
|
|
6
|
+
import { cancelSyncSession, createAttachment, getBridge, getBridgeSession, isBridgeEnded, listBridges, revokeBridge, createSource, getCapabilities, getSyncSession, listSyncConflicts, listSyncSessions, resolveSyncConflict, createDatasetRevision, attachDataServerPublication, cloneDatasetPublication, createDatasetPublication, cancelOperation, cancelTransfer, deleteHomeFolderObject, downloadHomeFolderObject, getOperation, getAttachmentManifest, getDatasetRevision, getTransfer, getSource, getSourceSharing, getHomeFolderQuota, getHomeFolder, listHomeFolderObjects, listHomeFolderObjectVersions, listSources, listAttachments, listDatasetRevisions, listDatasetPublications, listTransfers, restoreHomeFolderObject, revokeAttachment, unpublishDataset, archiveSource, replaceSourceSharing, statHomeFolderObject, uploadHomeFolderFile, updateSource, listCloudObjects, getCredentialDiagnostics, testCloudConnection, listPublishedDatasets, callMcpTool, createMcpSession, decideMcpApproval, discoverMcpTools, getMcpCall, getMcpSession, isMcpCallTerminal, listMcpApprovals, listMcpCalls, listMcpSessions, revokeMcpSession, testMcpSource, cancelDatasourceQuery, createDatasourceQuery, createDatasourceQueryTicket, discoverDatasourceSchema, downloadDatasourceQueryResults, drainDataserver, getDatasourceCapabilities, getDatasourceQuery, getDataserverStatus, isDatasourceQueryTerminal, listDatasourceQueries, resumeDataserver, revokeDataserver, rotateDataserverIdentity, saveDatasourceQueryAsDataset, testDatasource, testDataserver, attachRuntimeMounts, detachRuntimeMount, getRuntimeMounts, isRuntimeMountsSettled, } from '../api/contents/index.js';
|
|
7
7
|
import { useCoreStore, useIAMStore } from '../state/index.js';
|
|
8
8
|
import { queryKeys } from './useCache.js';
|
|
9
9
|
export const useDatasetRevisions = (sourceUid) => {
|
|
@@ -31,8 +31,12 @@ export const useCreateDatasetRevision = () => {
|
|
|
31
31
|
return useMutation({
|
|
32
32
|
mutationFn: ({ sourceUid, request, idempotencyKey }) => createDatasetRevision(token ?? '', sourceUid, request, idempotencyKey, contentsUrl),
|
|
33
33
|
onSuccess: revision => {
|
|
34
|
-
queryClient.invalidateQueries({
|
|
35
|
-
|
|
34
|
+
queryClient.invalidateQueries({
|
|
35
|
+
queryKey: queryKeys.contents.datasetRevisions(revision.sourceUid),
|
|
36
|
+
});
|
|
37
|
+
queryClient.invalidateQueries({
|
|
38
|
+
queryKey: queryKeys.contents.source(revision.sourceUid),
|
|
39
|
+
});
|
|
36
40
|
},
|
|
37
41
|
});
|
|
38
42
|
};
|
|
@@ -56,6 +60,37 @@ export const useCreateDatasetPublication = () => {
|
|
|
56
60
|
}),
|
|
57
61
|
});
|
|
58
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Clone a published Dataset into the caller's own catalog.
|
|
65
|
+
*
|
|
66
|
+
* The idempotency key is derived from the publication rather than random: a
|
|
67
|
+
* retried click finds the clone it already made instead of making a second
|
|
68
|
+
* one.
|
|
69
|
+
*/
|
|
70
|
+
export const useCloneDatasetPublication = () => {
|
|
71
|
+
const queryClient = useQueryClient();
|
|
72
|
+
const token = useIAMStore(state => state.token);
|
|
73
|
+
const contentsUrl = useCoreStore(state => state.configuration.contentsUrl || state.configuration.runtimesUrl);
|
|
74
|
+
return useMutation({
|
|
75
|
+
mutationFn: ({ sourceUid, publicationUid }) => cloneDatasetPublication(token ?? '', sourceUid, publicationUid, `dataset-clone:${publicationUid}`, contentsUrl),
|
|
76
|
+
onSuccess: () => queryClient.invalidateQueries({ queryKey: queryKeys.contents.all() }),
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Attach a published Data Server as a Datasource of the caller's own.
|
|
81
|
+
*
|
|
82
|
+
* The idempotency key is derived from the publication: a retried click finds
|
|
83
|
+
* the Datasource it already made rather than making a second one.
|
|
84
|
+
*/
|
|
85
|
+
export const useAttachDataServerPublication = () => {
|
|
86
|
+
const queryClient = useQueryClient();
|
|
87
|
+
const token = useIAMStore(state => state.token);
|
|
88
|
+
const contentsUrl = useCoreStore(state => state.configuration.contentsUrl || state.configuration.runtimesUrl);
|
|
89
|
+
return useMutation({
|
|
90
|
+
mutationFn: ({ sourceUid, publicationUid }) => attachDataServerPublication(token ?? '', sourceUid, publicationUid, `dataserver-attach:${publicationUid}`, contentsUrl),
|
|
91
|
+
onSuccess: () => queryClient.invalidateQueries({ queryKey: queryKeys.contents.all() }),
|
|
92
|
+
});
|
|
93
|
+
};
|
|
59
94
|
export const useUnpublishDataset = () => {
|
|
60
95
|
const queryClient = useQueryClient();
|
|
61
96
|
const token = useIAMStore(state => state.token);
|
|
@@ -419,8 +454,12 @@ export const useResolveSyncConflict = () => {
|
|
|
419
454
|
mutationFn: ({ sessionUid, conflictUid, use }) => resolveSyncConflict(token ?? '', sessionUid, conflictUid, { use }, contentsUrl),
|
|
420
455
|
onSuccess: session => {
|
|
421
456
|
queryClient.setQueryData(queryKeys.contents.syncSession(session.uid), session);
|
|
422
|
-
queryClient.invalidateQueries({
|
|
423
|
-
|
|
457
|
+
queryClient.invalidateQueries({
|
|
458
|
+
queryKey: queryKeys.contents.syncConflicts(session.uid),
|
|
459
|
+
});
|
|
460
|
+
queryClient.invalidateQueries({
|
|
461
|
+
queryKey: queryKeys.contents.syncSessions(),
|
|
462
|
+
});
|
|
424
463
|
},
|
|
425
464
|
});
|
|
426
465
|
};
|
|
@@ -433,7 +472,9 @@ export const useCancelSyncSession = () => {
|
|
|
433
472
|
mutationFn: sessionUid => cancelSyncSession(token ?? '', sessionUid, contentsUrl),
|
|
434
473
|
onSuccess: session => {
|
|
435
474
|
queryClient.setQueryData(queryKeys.contents.syncSession(session.uid), session);
|
|
436
|
-
queryClient.invalidateQueries({
|
|
475
|
+
queryClient.invalidateQueries({
|
|
476
|
+
queryKey: queryKeys.contents.syncSessions(),
|
|
477
|
+
});
|
|
437
478
|
},
|
|
438
479
|
});
|
|
439
480
|
};
|
|
@@ -491,7 +532,9 @@ export const useRevokeBridge = () => {
|
|
|
491
532
|
queryClient.setQueryData(queryKeys.contents.bridge(bridge.uid), bridge);
|
|
492
533
|
queryClient.setQueryData(queryKeys.contents.bridgeSession(bridge.attachmentUid), bridge);
|
|
493
534
|
queryClient.invalidateQueries({ queryKey: queryKeys.contents.bridges() });
|
|
494
|
-
queryClient.invalidateQueries({
|
|
535
|
+
queryClient.invalidateQueries({
|
|
536
|
+
queryKey: queryKeys.contents.attachments(),
|
|
537
|
+
});
|
|
495
538
|
},
|
|
496
539
|
});
|
|
497
540
|
};
|
|
@@ -620,7 +663,9 @@ export const useCreateMcpSession = () => {
|
|
|
620
663
|
return useMutation({
|
|
621
664
|
mutationFn: ({ request, idempotencyKey }) => createMcpSession(token ?? '', request, idempotencyKey, contentsUrl),
|
|
622
665
|
onSuccess: () => {
|
|
623
|
-
queryClient.invalidateQueries({
|
|
666
|
+
queryClient.invalidateQueries({
|
|
667
|
+
queryKey: queryKeys.contents.mcpSessions(),
|
|
668
|
+
});
|
|
624
669
|
},
|
|
625
670
|
});
|
|
626
671
|
};
|
|
@@ -631,7 +676,9 @@ export const useRevokeMcpSession = () => {
|
|
|
631
676
|
return useMutation({
|
|
632
677
|
mutationFn: sessionUid => revokeMcpSession(token ?? '', sessionUid, contentsUrl),
|
|
633
678
|
onSuccess: () => {
|
|
634
|
-
queryClient.invalidateQueries({
|
|
679
|
+
queryClient.invalidateQueries({
|
|
680
|
+
queryKey: queryKeys.contents.mcpSessions(),
|
|
681
|
+
});
|
|
635
682
|
},
|
|
636
683
|
});
|
|
637
684
|
};
|
|
@@ -648,7 +695,9 @@ export const useMcpCall = (sessionUid, callUid) => {
|
|
|
648
695
|
queryKey: queryKeys.contents.mcpCall(sessionUid ?? '', callUid ?? ''),
|
|
649
696
|
queryFn: () => getMcpCall(token ?? '', sessionUid, callUid, contentsUrl),
|
|
650
697
|
enabled: Boolean(token && contentsUrl && sessionUid && callUid),
|
|
651
|
-
refetchInterval: query => query.state.data && isMcpCallTerminal(query.state.data.status)
|
|
698
|
+
refetchInterval: query => query.state.data && isMcpCallTerminal(query.state.data.status)
|
|
699
|
+
? false
|
|
700
|
+
: 2_000,
|
|
652
701
|
});
|
|
653
702
|
};
|
|
654
703
|
/** The calls made through a session — the provenance of what they acquired. */
|
|
@@ -674,7 +723,9 @@ export const useCallMcpTool = () => {
|
|
|
674
723
|
queryKey: queryKeys.contents.mcpCalls(call.sessionUid),
|
|
675
724
|
});
|
|
676
725
|
if (call.status === 'pending-approval') {
|
|
677
|
-
queryClient.invalidateQueries({
|
|
726
|
+
queryClient.invalidateQueries({
|
|
727
|
+
queryKey: queryKeys.contents.mcpApprovals(),
|
|
728
|
+
});
|
|
678
729
|
}
|
|
679
730
|
},
|
|
680
731
|
});
|
|
@@ -710,7 +761,9 @@ export const useDecideMcpApproval = () => {
|
|
|
710
761
|
return useMutation({
|
|
711
762
|
mutationFn: ({ approvalUid, decision, note }) => decideMcpApproval(token ?? '', approvalUid, decision, note, contentsUrl),
|
|
712
763
|
onSuccess: approval => {
|
|
713
|
-
queryClient.invalidateQueries({
|
|
764
|
+
queryClient.invalidateQueries({
|
|
765
|
+
queryKey: queryKeys.contents.mcpApprovals(),
|
|
766
|
+
});
|
|
714
767
|
queryClient.invalidateQueries({
|
|
715
768
|
queryKey: queryKeys.contents.mcpCalls(approval.sessionUid),
|
|
716
769
|
});
|
|
@@ -781,7 +834,9 @@ export const useDatasourceQuery = (queryUid) => {
|
|
|
781
834
|
queryKey: queryKeys.contents.query(queryUid ?? ''),
|
|
782
835
|
queryFn: () => getDatasourceQuery(token ?? '', queryUid, contentsUrl),
|
|
783
836
|
enabled: Boolean(token && contentsUrl && queryUid),
|
|
784
|
-
refetchInterval: query => query.state.data && isDatasourceQueryTerminal(query.state.data.status)
|
|
837
|
+
refetchInterval: query => query.state.data && isDatasourceQueryTerminal(query.state.data.status)
|
|
838
|
+
? false
|
|
839
|
+
: 1_000,
|
|
785
840
|
refetchOnWindowFocus: true,
|
|
786
841
|
});
|
|
787
842
|
};
|
|
@@ -830,7 +885,9 @@ export const useSaveQueryAsDataset = () => {
|
|
|
830
885
|
queryClient.invalidateQueries({
|
|
831
886
|
queryKey: queryKeys.contents.datasetRevisions(revision.sourceUid),
|
|
832
887
|
});
|
|
833
|
-
queryClient.invalidateQueries({
|
|
888
|
+
queryClient.invalidateQueries({
|
|
889
|
+
queryKey: queryKeys.contents.source(revision.sourceUid),
|
|
890
|
+
});
|
|
834
891
|
},
|
|
835
892
|
});
|
|
836
893
|
};
|
|
@@ -858,7 +915,9 @@ export const useDataserverStatus = (sourceUid, options = {}) => {
|
|
|
858
915
|
queryFn: () => getDataserverStatus(token ?? '', sourceUid, contentsUrl),
|
|
859
916
|
enabled: Boolean(token && contentsUrl && sourceUid) && (options.enabled ?? true),
|
|
860
917
|
placeholderData: previous => previous,
|
|
861
|
-
refetchInterval: query => query.state.data?.state === 'revoked'
|
|
918
|
+
refetchInterval: query => query.state.data?.state === 'revoked'
|
|
919
|
+
? false
|
|
920
|
+
: (options.intervalMs ?? 10_000),
|
|
862
921
|
refetchOnWindowFocus: true,
|
|
863
922
|
});
|
|
864
923
|
};
|
|
@@ -875,7 +934,9 @@ export const useDataserverAction = () => {
|
|
|
875
934
|
: revokeDataserver)(token ?? '', sourceUid, contentsUrl),
|
|
876
935
|
onSuccess: (status, { sourceUid }) => {
|
|
877
936
|
queryClient.setQueryData(queryKeys.contents.dataserverStatus(sourceUid), status);
|
|
878
|
-
queryClient.invalidateQueries({
|
|
937
|
+
queryClient.invalidateQueries({
|
|
938
|
+
queryKey: queryKeys.contents.source(sourceUid),
|
|
939
|
+
});
|
|
879
940
|
queryClient.invalidateQueries({ queryKey: queryKeys.contents.sources() });
|
|
880
941
|
},
|
|
881
942
|
});
|
|
@@ -896,8 +957,12 @@ export const useRotateDataserverIdentity = () => {
|
|
|
896
957
|
return useMutation({
|
|
897
958
|
mutationFn: ({ sourceUid, csr }) => rotateDataserverIdentity(token ?? '', sourceUid, { csr }, contentsUrl),
|
|
898
959
|
onSuccess: (_identity, { sourceUid }) => {
|
|
899
|
-
queryClient.invalidateQueries({
|
|
900
|
-
|
|
960
|
+
queryClient.invalidateQueries({
|
|
961
|
+
queryKey: queryKeys.contents.dataserverStatus(sourceUid),
|
|
962
|
+
});
|
|
963
|
+
queryClient.invalidateQueries({
|
|
964
|
+
queryKey: queryKeys.contents.source(sourceUid),
|
|
965
|
+
});
|
|
901
966
|
},
|
|
902
967
|
});
|
|
903
968
|
};
|
|
@@ -920,7 +985,7 @@ export const useRuntimeMounts = (runtimeName, enabled = true) => {
|
|
|
920
985
|
queryKey: queryKeys.contents.runtimeMounts(runtimeName ?? ''),
|
|
921
986
|
queryFn: () => getRuntimeMounts(token ?? '', runtimeName, runtimesUrl),
|
|
922
987
|
enabled: Boolean(token && runtimesUrl && runtimeName && enabled),
|
|
923
|
-
refetchInterval: query =>
|
|
988
|
+
refetchInterval: query => isRuntimeMountsSettled(query.state.data) ? false : 2_000,
|
|
924
989
|
});
|
|
925
990
|
};
|
|
926
991
|
/**
|
|
@@ -943,7 +1008,9 @@ export const useAttachRuntimeMounts = () => {
|
|
|
943
1008
|
});
|
|
944
1009
|
// The Home Folder browser shows the same folders; a mount that appeared
|
|
945
1010
|
// in a sandbox and not on the page is the disagreement to avoid.
|
|
946
|
-
queryClient.invalidateQueries({
|
|
1011
|
+
queryClient.invalidateQueries({
|
|
1012
|
+
queryKey: queryKeys.contents.attachments(),
|
|
1013
|
+
});
|
|
947
1014
|
},
|
|
948
1015
|
});
|
|
949
1016
|
};
|
|
@@ -958,7 +1025,9 @@ export const useDetachRuntimeMount = () => {
|
|
|
958
1025
|
queryClient.invalidateQueries({
|
|
959
1026
|
queryKey: queryKeys.contents.runtimeMounts(runtimeName),
|
|
960
1027
|
});
|
|
961
|
-
queryClient.invalidateQueries({
|
|
1028
|
+
queryClient.invalidateQueries({
|
|
1029
|
+
queryKey: queryKeys.contents.attachments(),
|
|
1030
|
+
});
|
|
962
1031
|
},
|
|
963
1032
|
});
|
|
964
1033
|
};
|
package/lib/hooks/useMcp.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ import { setAuditSettings, type McpAuditSettings } from '../api/iam/mcpAuditSett
|
|
|
5
5
|
import { type McpForwarding } from '../api/mcp/forwarding';
|
|
6
6
|
import { type McpAlertRuleTrial } from '../api/mcp/alerts';
|
|
7
7
|
import { type McpAlertRule, type McpAlertRuleDraft } from '../api/iam/mcpAlertRules';
|
|
8
|
-
import { type
|
|
8
|
+
import { type DomainVerification, type IdentityProvider, type IdentityProviderDraft } from '../api/iam/identityProviders';
|
|
9
|
+
import type { MintedScimToken, ScimToken } from '../api/iam/scimTokens';
|
|
10
|
+
import { type AdmittedClients, type McpPolicy, type McpPolicyRules, type McpPolicyScope } from '../api/iam/mcpPolicy';
|
|
9
11
|
import { type ServiceAgent, type ServiceAgentWithKey } from '../api/iam/serviceAgents';
|
|
10
12
|
import type { McpAuditEventList, McpAuditExportFormat } from '../models/McpAuditEvent';
|
|
11
13
|
import type { McpBinding, McpBindingList } from '../models/McpBinding';
|
|
@@ -85,6 +87,24 @@ export declare const useDisconnectAgent: () => import("@tanstack/react-query").U
|
|
|
85
87
|
success: boolean;
|
|
86
88
|
message?: string;
|
|
87
89
|
}, Error, string, unknown>;
|
|
90
|
+
/**
|
|
91
|
+
* Disconnect every agent of this person — and so force the next
|
|
92
|
+
* authorization through the consent screen.
|
|
93
|
+
*
|
|
94
|
+
* The grant *is* the consent, so there is no separate "ask again" to keep in
|
|
95
|
+
* step: ending them all is what forcing re-consent means.
|
|
96
|
+
*/
|
|
97
|
+
export declare const useDisconnectEveryAgent: () => import("@tanstack/react-query").UseMutationResult<{
|
|
98
|
+
success: boolean;
|
|
99
|
+
revoked: number;
|
|
100
|
+
message?: string;
|
|
101
|
+
}, Error, void, unknown>;
|
|
102
|
+
/** The same for one team's agents, for whoever may manage that team. */
|
|
103
|
+
export declare const useDisconnectEveryAgentInTeam: () => import("@tanstack/react-query").UseMutationResult<{
|
|
104
|
+
success: boolean;
|
|
105
|
+
revoked: number;
|
|
106
|
+
message?: string;
|
|
107
|
+
}, Error, string, unknown>;
|
|
88
108
|
/** One organization's teams, for the console's team policy page. */
|
|
89
109
|
export declare const useOrganizationTeams: (orgUid: string, options?: {
|
|
90
110
|
enabled?: boolean;
|
|
@@ -137,6 +157,72 @@ export declare const useUpdateAlertRule: (orgUid: string) => import("@tanstack/r
|
|
|
137
157
|
rule: McpAlertRuleDraft;
|
|
138
158
|
}, unknown>;
|
|
139
159
|
export declare const useDeleteAlertRule: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
|
|
160
|
+
/** One organization's identity providers, disabled ones included. */
|
|
161
|
+
export declare const useIdentityProviders: (orgUid: string, options?: {
|
|
162
|
+
enabled?: boolean;
|
|
163
|
+
}) => import("@tanstack/react-query").UseQueryResult<IdentityProvider[], Error>;
|
|
164
|
+
export declare const useCreateIdentityProvider: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<IdentityProvider, Error, IdentityProviderDraft, unknown>;
|
|
165
|
+
export declare const useUpdateIdentityProvider: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<IdentityProvider, Error, {
|
|
166
|
+
uid: string;
|
|
167
|
+
provider: IdentityProviderDraft;
|
|
168
|
+
}, unknown>;
|
|
169
|
+
export declare const useSetIdentityProviderEnabled: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<IdentityProvider, Error, {
|
|
170
|
+
uid: string;
|
|
171
|
+
enabled: boolean;
|
|
172
|
+
}, unknown>;
|
|
173
|
+
/**
|
|
174
|
+
* What one layer's `allowedClients` entries actually name.
|
|
175
|
+
*
|
|
176
|
+
* Deliberately *not* folded into `useMcpPolicyLayer`. That query is read
|
|
177
|
+
* whenever a policy form mounts; this one may make the server fetch a client
|
|
178
|
+
* document per entry, and an editor typing in a textarea must not set that
|
|
179
|
+
* off on every keystroke — so it is fetched from what is **stored**, and goes
|
|
180
|
+
* stale until the draft is saved.
|
|
181
|
+
*/
|
|
182
|
+
export declare const useAdmittedClients: (scope: McpPolicyScope, subjectUid: string, options?: {
|
|
183
|
+
enabled?: boolean;
|
|
184
|
+
}) => import("@tanstack/react-query").UseQueryResult<AdmittedClients, Error>;
|
|
185
|
+
/**
|
|
186
|
+
* One organization's SCIM tokens, revoked ones included.
|
|
187
|
+
*
|
|
188
|
+
* Revoked ones are *not* filtered out here. A console that hid them would
|
|
189
|
+
* make an organization whose every token is revoked look identical to one
|
|
190
|
+
* that never had any — and those are different problems with different
|
|
191
|
+
* fixes, only one of which is "nobody is being deprovisioned right now".
|
|
192
|
+
*/
|
|
193
|
+
export declare const useScimTokens: (orgUid: string, options?: {
|
|
194
|
+
enabled?: boolean;
|
|
195
|
+
}) => import("@tanstack/react-query").UseQueryResult<ScimToken[], Error>;
|
|
196
|
+
/**
|
|
197
|
+
* Mint one. The secret is in the result and nowhere else, ever again.
|
|
198
|
+
*
|
|
199
|
+
* The mutation result is deliberately not written into the query cache: a
|
|
200
|
+
* secret that lived in a cache would be re-rendered on every refetch of the
|
|
201
|
+
* list, and outlive the dialog it was shown in.
|
|
202
|
+
*/
|
|
203
|
+
export declare const useCreateScimToken: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<MintedScimToken, Error, string, unknown>;
|
|
204
|
+
export declare const useRotateScimToken: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<MintedScimToken, Error, string, unknown>;
|
|
205
|
+
export declare const useRevokeScimToken: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<ScimToken, Error, string, unknown>;
|
|
206
|
+
export declare const useDeleteIdentityProvider: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
|
|
207
|
+
/**
|
|
208
|
+
* What to publish in DNS, fetched on demand rather than kept fresh.
|
|
209
|
+
*
|
|
210
|
+
* A mutation, not a query with a `refetch`: this is asked for once when
|
|
211
|
+
* somebody opens the verification panel, and the value never changes for a
|
|
212
|
+
* given provider and domain — what changes is `verified`, which the
|
|
213
|
+
* `verify` call below answers directly from the provider it returns.
|
|
214
|
+
*/
|
|
215
|
+
export declare const useDomainVerification: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<{
|
|
216
|
+
verification: DomainVerification;
|
|
217
|
+
verified: boolean;
|
|
218
|
+
}, Error, {
|
|
219
|
+
uid: string;
|
|
220
|
+
domain: string;
|
|
221
|
+
}, unknown>;
|
|
222
|
+
export declare const useVerifyDomain: (orgUid: string) => import("@tanstack/react-query").UseMutationResult<IdentityProvider, Error, {
|
|
223
|
+
uid: string;
|
|
224
|
+
domain: string;
|
|
225
|
+
}, unknown>;
|
|
140
226
|
/**
|
|
141
227
|
* One layer's rules, or `null` where nobody has written one.
|
|
142
228
|
*
|