@datalayer/core 1.1.60 → 1.1.66
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 +2 -2
- package/lib/api/DatalayerApi.d.ts +42 -1
- package/lib/api/DatalayerApi.js +90 -3
- package/lib/api/constants.d.ts +18 -0
- package/lib/api/constants.js +18 -0
- package/lib/api/contents/attachments.d.ts +9 -0
- package/lib/api/contents/attachments.js +43 -0
- package/lib/api/contents/bridges.d.ts +22 -0
- package/lib/api/contents/bridges.js +79 -0
- package/lib/api/contents/capabilities.d.ts +11 -0
- package/lib/api/contents/capabilities.js +21 -0
- package/lib/api/contents/cloudStorage.d.ts +31 -0
- package/lib/api/contents/cloudStorage.js +89 -0
- package/lib/api/contents/dataservers.d.ts +37 -0
- package/lib/api/contents/dataservers.js +121 -0
- package/lib/api/contents/datasets.d.ts +15 -0
- package/lib/api/contents/datasets.js +45 -0
- package/lib/api/contents/datasources.d.ts +70 -0
- package/lib/api/contents/datasources.js +149 -0
- package/lib/api/contents/generated.d.ts +1070 -0
- package/lib/api/contents/index.d.ts +16 -0
- package/lib/api/contents/index.js +20 -0
- package/lib/api/contents/mcp.d.ts +46 -0
- package/lib/api/contents/mcp.js +157 -0
- package/lib/api/contents/objects.d.ts +31 -0
- package/lib/api/contents/objects.js +88 -0
- package/lib/api/contents/operations.d.ts +3 -0
- package/lib/api/contents/operations.js +19 -0
- package/lib/api/contents/runtimeMounts.d.ts +40 -0
- package/lib/api/contents/runtimeMounts.js +59 -0
- package/lib/api/contents/sandboxUid.d.ts +53 -0
- package/lib/api/contents/sandboxUid.js +78 -0
- package/lib/api/contents/sources.d.ts +19 -0
- package/lib/api/contents/sources.js +119 -0
- package/lib/api/contents/sync.d.ts +18 -0
- package/lib/api/contents/sync.js +69 -0
- package/lib/api/contents/transfers.d.ts +38 -0
- package/lib/api/contents/transfers.js +123 -0
- package/lib/api/iam/connectedAgents.d.ts +39 -0
- package/lib/api/iam/connectedAgents.js +52 -0
- package/lib/api/iam/index.d.ts +2 -1
- package/lib/api/iam/index.js +2 -1
- package/lib/api/iam/mcpAlertRules.d.ts +51 -0
- package/lib/api/iam/mcpAlertRules.js +198 -0
- package/lib/api/iam/mcpAuditSettings.d.ts +46 -0
- package/lib/api/iam/mcpAuditSettings.js +120 -0
- package/lib/api/iam/mcpPolicy.d.ts +80 -0
- package/lib/api/iam/mcpPolicy.js +132 -0
- package/lib/api/iam/organizationTeams.d.ts +13 -0
- package/lib/api/iam/organizationTeams.js +43 -0
- package/lib/api/iam/serviceAgents.d.ts +68 -0
- package/lib/api/iam/serviceAgents.js +119 -0
- package/lib/api/index.d.ts +4 -1
- package/lib/api/index.js +3 -1
- package/lib/api/mcp/activity.d.ts +37 -0
- package/lib/api/mcp/activity.js +26 -0
- package/lib/api/mcp/alerts.d.ts +25 -0
- package/lib/api/mcp/alerts.js +51 -0
- package/lib/api/mcp/audit.d.ts +29 -0
- package/lib/api/mcp/audit.js +55 -0
- package/lib/api/mcp/bindings.d.ts +18 -0
- package/lib/api/mcp/bindings.js +42 -0
- package/lib/api/mcp/forwarding.d.ts +25 -0
- package/lib/api/mcp/forwarding.js +46 -0
- package/lib/api/mcp/gateway.d.ts +16 -0
- package/lib/api/mcp/gateway.js +70 -0
- package/lib/api/mcp/generated.d.ts +22 -0
- package/lib/api/mcp/generated.js +213 -0
- package/lib/api/mcp/index.d.ts +17 -0
- package/lib/api/mcp/index.js +25 -0
- package/lib/api/mcp/observability.d.ts +125 -0
- package/lib/api/mcp/observability.js +254 -0
- package/lib/api/mcp/operations.d.ts +83 -0
- package/lib/api/mcp/operations.js +50 -0
- package/lib/api/mcp/organizations.d.ts +102 -0
- package/lib/api/mcp/organizations.js +46 -0
- package/lib/api/mcp/policy.d.ts +9 -0
- package/lib/api/mcp/policy.js +23 -0
- package/lib/api/mcp/tasks.d.ts +49 -0
- package/lib/api/mcp/tasks.js +147 -0
- package/lib/api/utils/validation.d.ts +1 -1
- package/lib/api/utils/validation.js +1 -1
- package/lib/client/auth/index.js +0 -5
- package/lib/client/auth/storage.js +0 -5
- package/lib/client/auth/strategies.js +0 -5
- package/lib/client/base.d.ts +6 -0
- package/lib/client/base.js +8 -0
- package/lib/client/index.d.ts +0 -10
- package/lib/client/index.js +2 -2
- package/lib/client/mixins/ContentsMixin.d.ts +71 -0
- package/lib/client/mixins/ContentsMixin.js +157 -0
- package/lib/client/mixins/IAMMixin.d.ts +0 -31
- package/lib/client/mixins/IAMMixin.js +0 -58
- package/lib/components/animation/AnimatedText.d.ts +1 -0
- package/lib/components/animation/AnimatedText.js +0 -4
- package/lib/components/auth/SigInAPIKey.d.ts +1 -0
- package/lib/components/auth/SigInAPIKey.js +0 -6
- package/lib/components/auth/SignIn.d.ts +1 -0
- package/lib/components/auth/SignIn.js +0 -4
- package/lib/components/auth/SignIn.stories.d.ts +2 -2
- package/lib/components/avatars/BoringAvatar.d.ts +1 -1
- package/lib/components/avatars/BoringAvatar.stories.d.ts +1 -1
- package/lib/components/avatars/DLAvatar.d.ts +1 -1
- package/lib/components/avatars/DLAvatar.js +0 -4
- package/lib/components/avatars/UserAvatar.d.ts +9 -0
- package/lib/components/avatars/UserAvatar.js +0 -12
- package/lib/components/avatars/UserProfileAvatar.d.ts +1 -1
- package/lib/components/banners/NoAutomationBanner.d.ts +1 -1
- package/lib/components/billing/BillingEntitySelect.d.ts +10 -0
- package/lib/components/billing/BillingEntitySelect.js +0 -17
- package/lib/components/billing/index.js +0 -4
- package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
- package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
- package/lib/components/buttons/LongActionButton.d.ts +1 -0
- package/lib/components/buttons/LongActionButton.js +0 -4
- package/lib/components/buttons/UploadButton.d.ts +1 -0
- package/lib/components/buttons/UploadButton.js +0 -4
- package/lib/components/checkout/StripeCheckout.d.ts +1 -1
- package/lib/components/collaboration/LiveEditorCollaborators.d.ts +31 -0
- package/lib/components/collaboration/LiveEditorCollaborators.js +86 -53
- package/lib/components/collaboration/index.js +0 -4
- package/lib/components/confetti/ConfettiSuccess.d.ts +1 -1
- package/lib/components/contents/ContentSourceCard.d.ts +8 -0
- package/lib/components/contents/ContentSourceCard.js +23 -0
- package/lib/components/contents/HomeFolderObjectsBrowser.d.ts +10 -0
- package/lib/components/contents/HomeFolderObjectsBrowser.js +148 -0
- package/lib/components/contents/index.d.ts +2 -0
- package/lib/components/contents/index.js +6 -0
- package/lib/components/context/OrganizationSelect.d.ts +1 -1
- package/lib/components/display/AvatarSkeleton.d.ts +1 -1
- package/lib/components/display/BusyDots.d.ts +1 -1
- package/lib/components/display/CenteredSpinner.d.ts +1 -1
- package/lib/components/display/CodePreview.d.ts +1 -1
- package/lib/components/display/DatalayerBox.d.ts +7 -2
- package/lib/components/display/DatalayerBox.js +6 -6
- package/lib/components/display/HorizontalCenter.d.ts +1 -1
- package/lib/components/display/JupyterDialog.d.ts +1 -0
- package/lib/components/display/JupyterDialog.js +1 -7
- package/lib/components/display/Markdown.d.ts +1 -0
- package/lib/components/display/NotebookSkeleton.d.ts +1 -1
- package/lib/components/display/Placeholder.d.ts +1 -1
- package/lib/components/display/ToTopBranded.d.ts +1 -1
- package/lib/components/echarts/EChartsReact.d.ts +1 -1
- package/lib/components/flashes/FlashClosable.d.ts +1 -0
- package/lib/components/flashes/FlashClosable.js +0 -4
- package/lib/components/flashes/FlashGuest.d.ts +1 -1
- package/lib/components/flashes/FlashSurveys.d.ts +1 -1
- package/lib/components/flashes/FlashUnauthorized.d.ts +1 -0
- package/lib/components/flashes/FlashUnauthorized.js +0 -6
- package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
- package/lib/components/iam/ExternalTokenSilentLogin.d.ts +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/labels/StatusLabels.d.ts +1 -0
- package/lib/components/labels/VisibilityLabel.d.ts +1 -1
- package/lib/components/landings/StepBlock.d.ts +1 -1
- package/lib/components/mcp/ClientBadge.d.ts +41 -0
- package/lib/components/mcp/ClientBadge.js +33 -0
- package/lib/components/mcp/McpErrorBlankslate.d.ts +21 -0
- package/lib/components/mcp/McpErrorBlankslate.js +17 -0
- package/lib/components/mcp/ScopeList.d.ts +28 -0
- package/lib/components/mcp/ScopeList.js +14 -0
- package/lib/components/mcp/index.d.ts +10 -0
- package/lib/components/mcp/index.js +18 -0
- package/lib/components/navbar/NavigationVisbilityObserver.d.ts +2 -1
- package/lib/components/navbar/SubdomainNavBar.d.ts +10 -5
- package/lib/components/navbar/SubdomainNavBar.js +2 -1
- package/lib/components/notebooks/JupyterNotebook.d.ts +1 -1
- package/lib/components/notebooks/JupyterNotebookToolbar.d.ts +1 -1
- package/lib/components/principal/PrincipalAppearance.d.ts +1 -0
- package/lib/components/principal/PrincipalAppearance.js +0 -8
- package/lib/components/principal/PrincipalAvatar.d.ts +1 -0
- package/lib/components/principal/PrincipalAvatar.js +17 -9
- package/lib/components/principal/PrincipalBadge.d.ts +1 -1
- package/lib/components/principal/PrincipalBanner.d.ts +1 -1
- package/lib/components/principal/PrincipalDetailsOverlay.d.ts +31 -1
- package/lib/components/principal/PrincipalDetailsOverlay.js +64 -33
- package/lib/components/principal/PrincipalHoverCard.d.ts +31 -0
- package/lib/components/principal/PrincipalHoverCard.js +52 -0
- package/lib/components/principal/PrincipalSwitcherMenu.d.ts +1 -0
- package/lib/components/principal/PrincipalSwitcherMenu.js +5 -14
- package/lib/components/principal/index.d.ts +2 -1
- package/lib/components/principal/index.js +2 -1
- package/lib/components/progress/ConsumptionBar.d.ts +1 -0
- package/lib/components/progress/ConsumptionBar.js +0 -4
- package/lib/components/progress/ProgressRing.d.ts +1 -0
- package/lib/components/progress/SpinnerBar.d.ts +1 -1
- package/lib/components/progress/Timer.d.ts +1 -0
- package/lib/components/progress/Timer.js +0 -4
- package/lib/components/screencapture/ScreencaptureButton.d.ts +1 -1
- package/lib/components/sharing/ShareAccessComponent.d.ts +15 -1
- package/lib/components/sharing/ShareAccessComponent.js +36 -23
- package/lib/components/sharing/SharingEditor.d.ts +17 -0
- package/lib/components/sharing/SharingEditor.js +0 -24
- package/lib/components/sparklines/Sparklines.js +3 -4
- package/lib/components/sparklines/index.js +0 -4
- package/lib/components/storage/ContentsBrowser.d.ts +25 -1
- package/lib/components/storage/ContentsBrowser.js +145 -52
- package/lib/components/storage/ContentsBrowserMock.d.ts +3 -0
- package/lib/components/storage/ContentsBrowserMock.js +75 -0
- package/lib/components/storage/ContentsItems.d.ts +2 -1
- package/lib/components/storage/ContentsItems.js +0 -4
- package/lib/components/storage/ContentsTable.d.ts +50 -0
- package/lib/components/storage/ContentsTable.js +134 -0
- package/lib/components/storage/HomeFolderDrive.d.ts +71 -0
- package/lib/components/storage/HomeFolderDrive.js +248 -0
- package/lib/components/storage/index.d.ts +2 -0
- package/lib/components/storage/index.js +2 -0
- package/lib/components/students/StudentItemStatus.d.ts +1 -1
- package/lib/components/students/StudentResultCircle.d.ts +1 -1
- package/lib/components/subnav/SubNav.d.ts +5 -5
- package/lib/components/subnav/SubNav.js +11 -9
- package/lib/components/tables/DataTable.d.ts +1 -1
- package/lib/components/text-reveal/TextRevealAnimation.d.ts +2 -2
- package/lib/components/text-reveal/useTextRevealAnimationLines.d.ts +1 -1
- package/lib/components/time/LiveRelativeTime.d.ts +1 -0
- package/lib/components/time/LiveRelativeTime.js +0 -8
- package/lib/components/time/index.js +0 -4
- package/lib/components/timeline/Timeline.d.ts +1 -1
- package/lib/components/timeline/index.js +0 -4
- package/lib/components/users/PeerIndicator.d.ts +1 -0
- package/lib/components/users/PeerIndicator.js +0 -4
- package/lib/config/Configuration.d.ts +15 -17
- package/lib/config/Configuration.js +7 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/layouts/LayoutBackdrop.d.ts +1 -1
- package/lib/hooks/layouts/LayoutScreencapture.d.ts +1 -1
- package/lib/hooks/useBackdrop.d.ts +1 -1
- package/lib/hooks/useBackdropJupyterLab.d.ts +3 -2
- package/lib/hooks/useBackdropJupyterLab.js +0 -4
- package/lib/hooks/useCache.d.ts +310 -105
- package/lib/hooks/useCache.js +142 -355
- package/lib/hooks/useContainsFocus.d.ts +1 -1
- package/lib/hooks/useContents.d.ts +313 -0
- package/lib/hooks/useContents.js +964 -0
- package/lib/hooks/useFocusTrap.d.ts +4 -4
- package/lib/hooks/useFocusTrap.js +1 -1
- package/lib/hooks/useMcp.d.ts +229 -0
- package/lib/hooks/useMcp.js +656 -0
- package/lib/hooks/useMobile.js +0 -5
- package/lib/hooks/useProjectStore.d.ts +3 -3
- package/lib/hooks/useProjectStore.js +4 -4
- package/lib/hooks/useRef.d.ts +1 -1
- package/lib/hooks/useRef.js +3 -0
- package/lib/hooks/useScreencapture.d.ts +2 -1
- package/lib/hooks/useScreencapture.js +0 -4
- package/lib/hooks/useToast.js +0 -4
- package/lib/hooks/useVisibilityObserver.d.ts +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +3 -1
- package/lib/mocks/components/FlashMock.d.ts +1 -1
- package/lib/mocks/views/ActionMenuMock.d.ts +1 -1
- package/lib/mocks/views/ChartMock.d.ts +1 -1
- package/lib/mocks/views/DashboardMock.d.ts +1 -1
- package/lib/mocks/views/FormMock.d.ts +1 -1
- package/lib/mocks/views/TableMock.d.ts +1 -1
- package/lib/mocks/views/WipMock.d.ts +1 -1
- package/lib/models/Credits.d.ts +16 -0
- package/lib/models/Credits.js +22 -0
- package/lib/models/McpAuditEvent.d.ts +52 -0
- package/lib/models/McpAuditEvent.js +5 -0
- package/lib/models/McpBinding.d.ts +51 -0
- package/lib/models/McpBinding.js +5 -0
- package/lib/models/McpPolicy.d.ts +77 -0
- package/lib/models/McpPolicy.js +5 -0
- package/lib/models/McpTask.d.ts +94 -0
- package/lib/models/McpTask.js +7 -0
- package/lib/models/StartedBy.d.ts +57 -0
- package/lib/models/StartedBy.js +81 -0
- package/lib/models/UserDTO.js +4 -2
- package/lib/models/contents/__fixtures__/solr-codec.json +57 -0
- package/lib/models/contents/__fixtures__/v1-contracts.json +66 -0
- package/lib/models/contents/fieldCase.d.ts +8 -0
- package/lib/models/contents/fieldCase.js +37 -0
- package/lib/models/contents/index.d.ts +2 -0
- package/lib/models/contents/index.js +6 -0
- package/lib/models/contents/permissions.d.ts +16 -0
- package/lib/models/contents/permissions.js +34 -0
- package/lib/models/index.d.ts +5 -1
- package/lib/models/index.js +5 -1
- package/lib/state/substates/CoreState.d.ts +15 -7
- package/lib/state/substates/CoreState.js +18 -14
- package/lib/state/substates/IAMState.d.ts +1 -1
- package/lib/state/substates/IAMState.js +5 -5
- package/lib/state/substates/ProfileState.js +0 -4
- package/lib/state/substates/index.d.ts +0 -1
- package/lib/state/substates/index.js +0 -1
- package/lib/utils/Jwt.d.ts +26 -0
- package/lib/utils/Jwt.js +37 -0
- package/lib/utils/WithSuspense.d.ts +1 -1
- package/lib/views/api-keys/APIKeyEdit.d.ts +1 -1
- package/lib/views/api-keys/APIKeyNew.d.ts +1 -1
- package/lib/views/api-keys/APIKeys.d.ts +1 -1
- package/lib/views/api-keys/APIKeys.js +30 -4
- package/lib/views/api-keys/APIKeysStandalone.d.ts +5 -1
- package/lib/views/api-keys/APIKeysStandalone.js +2 -2
- package/lib/views/datasources/DatasourceDetail.d.ts +12 -5
- package/lib/views/datasources/DatasourceDetail.js +80 -110
- package/lib/views/datasources/DatasourceNew.d.ts +14 -8
- package/lib/views/datasources/DatasourceNew.js +129 -118
- package/lib/views/datasources/Datasources.d.ts +39 -7
- package/lib/views/datasources/Datasources.js +95 -40
- package/lib/views/datasources/DatasourcesMock.d.ts +3 -0
- package/lib/views/datasources/DatasourcesMock.js +57 -0
- package/lib/views/iam/SignInSimple.d.ts +12 -0
- package/lib/views/iam/SignInSimple.js +4 -4
- package/lib/views/index.d.ts +1 -0
- package/lib/views/index.js +1 -0
- package/lib/views/mcp/AlertDestinations.d.ts +34 -0
- package/lib/views/mcp/AlertDestinations.js +75 -0
- package/lib/views/mcp/AlertRules.d.ts +32 -0
- package/lib/views/mcp/AlertRules.js +245 -0
- package/lib/views/mcp/AuditLog.d.ts +42 -0
- package/lib/views/mcp/AuditLog.js +144 -0
- package/lib/views/mcp/ConnectedAgents.d.ts +34 -0
- package/lib/views/mcp/ConnectedAgents.js +100 -0
- package/lib/views/mcp/EnterpriseConsole.d.ts +74 -0
- package/lib/views/mcp/EnterpriseConsole.js +173 -0
- package/lib/views/mcp/McpDashboard.d.ts +50 -0
- package/lib/views/mcp/McpDashboard.js +347 -0
- package/lib/views/mcp/McpHome.d.ts +92 -0
- package/lib/views/mcp/McpHome.js +153 -0
- package/lib/views/mcp/McpObservability.d.ts +50 -0
- package/lib/views/mcp/McpObservability.js +150 -0
- package/lib/views/mcp/OrganizationPolicy.d.ts +45 -0
- package/lib/views/mcp/OrganizationPolicy.js +107 -0
- package/lib/views/mcp/OrganizationUsage.d.ts +69 -0
- package/lib/views/mcp/OrganizationUsage.js +113 -0
- package/lib/views/mcp/PersonalPolicy.d.ts +54 -0
- package/lib/views/mcp/PersonalPolicy.js +125 -0
- package/lib/views/mcp/Policies.d.ts +53 -0
- package/lib/views/mcp/Policies.js +210 -0
- package/lib/views/mcp/PolicyForm.d.ts +67 -0
- package/lib/views/mcp/PolicyForm.js +91 -0
- package/lib/views/mcp/PolicyHistory.d.ts +45 -0
- package/lib/views/mcp/PolicyHistory.js +62 -0
- package/lib/views/mcp/ServiceAgents.d.ts +46 -0
- package/lib/views/mcp/ServiceAgents.js +194 -0
- package/lib/views/mcp/TeamPolicies.d.ts +33 -0
- package/lib/views/mcp/TeamPolicies.js +98 -0
- package/lib/views/mcp/format.d.ts +25 -0
- package/lib/views/mcp/format.js +77 -0
- package/lib/views/mcp/index.d.ts +29 -0
- package/lib/views/mcp/index.js +37 -0
- package/lib/views/mcp/types.d.ts +66 -0
- package/lib/views/mcp/types.js +5 -0
- package/lib/views/secrets/SecretEdit.d.ts +5 -1
- package/lib/views/secrets/SecretEdit.js +2 -2
- package/lib/views/secrets/SecretNew.d.ts +11 -1
- package/lib/views/secrets/SecretNew.js +2 -2
- package/lib/views/secrets/Secrets.d.ts +12 -1
- package/lib/views/secrets/Secrets.js +2 -2
- package/package.json +28 -24
- package/scripts/generate-contents-types.py +169 -0
- package/scripts/generate-mcp-types.py +233 -0
- package/lib/api/iam/datasources.d.ts +0 -86
- package/lib/api/iam/datasources.js +0 -185
- package/lib/components/toolbars/index.d.ts +0 -1
- package/lib/models/Datasource.d.ts +0 -181
- package/lib/models/Datasource.js +0 -154
- package/lib/state/substates/DatasourceState.d.ts +0 -11
- package/lib/state/substates/DatasourceState.js +0 -16
- /package/lib/{components/toolbars/index.js → api/contents/generated.js} +0 -0
package/lib/hooks/useCache.js
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
import { useQuery, useQueries, useMutation, useQueryClient, } from '@tanstack/react-query';
|
|
40
|
-
import { BOOTSTRAP_USER_ONBOARDING, asContact,
|
|
40
|
+
import { BOOTSTRAP_USER_ONBOARDING, asContact, asInvite, asOrganization, asSecret, asTeam, asToken, asUser, } from '../models/index.js';
|
|
41
41
|
import { asPage, asSpace } from './cacheConverters.js';
|
|
42
42
|
import { useCoreStore, useIAMStore, profileStore } from '../state/index.js';
|
|
43
43
|
import { asDisplayName, namesAsInitials, asArray } from '../utils/index.js';
|
|
@@ -66,6 +66,120 @@ const DEFAULT_QUERY_OPTIONS = {
|
|
|
66
66
|
* @see https://tanstack.com/query/latest/docs/framework/react/guides/query-keys
|
|
67
67
|
*/
|
|
68
68
|
export const queryKeys = {
|
|
69
|
+
// Contents catalog
|
|
70
|
+
contents: {
|
|
71
|
+
all: () => ['contents'],
|
|
72
|
+
sources: () => [...queryKeys.contents.all(), 'sources'],
|
|
73
|
+
capabilities: () => [...queryKeys.contents.all(), 'capabilities'],
|
|
74
|
+
sourceList: (filters) => [...queryKeys.contents.sources(), 'list', filters ?? {}],
|
|
75
|
+
source: (sourceUid) => [...queryKeys.contents.sources(), 'detail', sourceUid],
|
|
76
|
+
sourceSharing: (sourceUid) => [...queryKeys.contents.source(sourceUid), 'sharing'],
|
|
77
|
+
datasetRevisions: (sourceUid) => [...queryKeys.contents.source(sourceUid), 'revisions'],
|
|
78
|
+
datasetRevision: (sourceUid, revisionUid) => [...queryKeys.contents.datasetRevisions(sourceUid), revisionUid],
|
|
79
|
+
datasetPublications: (sourceUid) => [...queryKeys.contents.source(sourceUid), 'publications'],
|
|
80
|
+
publishedDatasets: () => [...queryKeys.contents.all(), 'publications', 'datasets'],
|
|
81
|
+
cloudObjects: (sourceUid, prefix, cursor) => [
|
|
82
|
+
...queryKeys.contents.source(sourceUid),
|
|
83
|
+
'cloud',
|
|
84
|
+
'objects',
|
|
85
|
+
prefix ?? '',
|
|
86
|
+
cursor ?? '',
|
|
87
|
+
],
|
|
88
|
+
credentialDiagnostics: (sourceUid) => [...queryKeys.contents.source(sourceUid), 'diagnostics'],
|
|
89
|
+
homeFolder: () => [...queryKeys.contents.sources(), 'user-folder'],
|
|
90
|
+
homeFolderQuota: () => [...queryKeys.contents.homeFolder(), 'quota'],
|
|
91
|
+
homeFolderObjects: (filters) => [
|
|
92
|
+
...queryKeys.contents.homeFolder(),
|
|
93
|
+
'objects',
|
|
94
|
+
'list',
|
|
95
|
+
filters ?? {},
|
|
96
|
+
],
|
|
97
|
+
homeFolderObject: (path) => [...queryKeys.contents.homeFolder(), 'objects', 'stat', path],
|
|
98
|
+
homeFolderObjectVersions: (objectUid, cursor) => [
|
|
99
|
+
...queryKeys.contents.homeFolder(),
|
|
100
|
+
'objects',
|
|
101
|
+
objectUid,
|
|
102
|
+
'versions',
|
|
103
|
+
cursor ?? '',
|
|
104
|
+
],
|
|
105
|
+
operations: () => [...queryKeys.contents.all(), 'operations'],
|
|
106
|
+
operation: (operationUid) => [...queryKeys.contents.operations(), operationUid],
|
|
107
|
+
transfers: () => [...queryKeys.contents.all(), 'transfers'],
|
|
108
|
+
transferList: (filters) => [...queryKeys.contents.transfers(), 'list', filters ?? {}],
|
|
109
|
+
transfer: (transferUid) => [...queryKeys.contents.transfers(), transferUid],
|
|
110
|
+
syncSessions: () => [...queryKeys.contents.all(), 'sync'],
|
|
111
|
+
syncSessionList: (filters) => [...queryKeys.contents.syncSessions(), 'list', filters ?? {}],
|
|
112
|
+
syncSession: (sessionUid) => [...queryKeys.contents.syncSessions(), sessionUid],
|
|
113
|
+
syncConflicts: (sessionUid) => [...queryKeys.contents.syncSession(sessionUid), 'conflicts'],
|
|
114
|
+
attachments: () => [...queryKeys.contents.all(), 'attachments'],
|
|
115
|
+
attachmentList: (filters) => [...queryKeys.contents.attachments(), 'list', filters ?? {}],
|
|
116
|
+
attachmentManifest: (sandboxUid) => [...queryKeys.contents.attachments(), 'manifest', sandboxUid],
|
|
117
|
+
// The session of one attachment lives under the attachments key on
|
|
118
|
+
// purpose: revoking or refreshing an attachment refreshes its bridge.
|
|
119
|
+
bridgeSession: (attachmentUid) => [...queryKeys.contents.attachments(), 'bridge', attachmentUid],
|
|
120
|
+
bridges: () => [...queryKeys.contents.all(), 'bridges'],
|
|
121
|
+
bridgeList: (filters) => [...queryKeys.contents.bridges(), 'list', filters ?? {}],
|
|
122
|
+
bridge: (bridgeUid) => [...queryKeys.contents.bridges(), bridgeUid],
|
|
123
|
+
// What a running Runtime has mounted. Under the Contents key rather than
|
|
124
|
+
// a Runtimes one because attaching and detaching a source is what changes
|
|
125
|
+
// it, and those invalidate from here.
|
|
126
|
+
runtimeMounts: (runtimeName) => [...queryKeys.contents.all(), 'runtime-mounts', runtimeName],
|
|
127
|
+
mcpTools: (sourceUid) => [...queryKeys.contents.source(sourceUid), 'mcp', 'tools'],
|
|
128
|
+
mcpSessions: () => [...queryKeys.contents.all(), 'mcp-sessions'],
|
|
129
|
+
mcpSessionList: (filters) => [...queryKeys.contents.mcpSessions(), 'list', filters ?? {}],
|
|
130
|
+
mcpSession: (sessionUid) => [...queryKeys.contents.mcpSessions(), sessionUid],
|
|
131
|
+
mcpCalls: (sessionUid) => [...queryKeys.contents.mcpSession(sessionUid), 'calls'],
|
|
132
|
+
mcpCall: (sessionUid, callUid) => [...queryKeys.contents.mcpCalls(sessionUid), callUid],
|
|
133
|
+
mcpApprovals: () => [...queryKeys.contents.all(), 'mcp-approvals'],
|
|
134
|
+
mcpApprovalList: (filters) => [...queryKeys.contents.mcpApprovals(), 'list', filters ?? {}],
|
|
135
|
+
datasourceSchema: (sourceUid) => [...queryKeys.contents.source(sourceUid), 'datasource', 'schema'],
|
|
136
|
+
datasourceCapabilities: (sourceUid) => [...queryKeys.contents.source(sourceUid), 'datasource', 'capabilities'],
|
|
137
|
+
datasourceQueries: (sourceUid) => [...queryKeys.contents.source(sourceUid), 'queries'],
|
|
138
|
+
// A query is addressed by its own uid, not under its source: a
|
|
139
|
+
// notebook reconnects to one by uid alone.
|
|
140
|
+
queries: () => [...queryKeys.contents.all(), 'queries'],
|
|
141
|
+
query: (queryUid) => [...queryKeys.contents.queries(), queryUid],
|
|
142
|
+
dataserverStatus: (sourceUid) => [...queryKeys.contents.source(sourceUid), 'dataserver', 'status'],
|
|
143
|
+
},
|
|
144
|
+
// The Jupyter MCP Server: what the agents did, and what they may do
|
|
145
|
+
mcp: {
|
|
146
|
+
all: () => ['mcp'],
|
|
147
|
+
tasks: () => [...queryKeys.mcp.all(), 'tasks'],
|
|
148
|
+
taskList: (filters) => [...queryKeys.mcp.tasks(), 'list', filters ?? {}],
|
|
149
|
+
task: (taskUid) => [...queryKeys.mcp.tasks(), taskUid],
|
|
150
|
+
notebookTasks: (notebookUid, filters) => [...queryKeys.mcp.tasks(), 'notebook', notebookUid, filters ?? {}],
|
|
151
|
+
bindings: () => [...queryKeys.mcp.all(), 'bindings'],
|
|
152
|
+
bindingList: (filters) => [...queryKeys.mcp.bindings(), 'list', filters ?? {}],
|
|
153
|
+
activity: (filters) => [...queryKeys.mcp.all(), 'activity', filters ?? {}],
|
|
154
|
+
audit: () => [...queryKeys.mcp.all(), 'audit'],
|
|
155
|
+
auditList: (filters) => [...queryKeys.mcp.audit(), 'list', filters ?? {}],
|
|
156
|
+
policy: (filters) => [...queryKeys.mcp.all(), 'policy', filters ?? {}],
|
|
157
|
+
connectedAgents: () => [...queryKeys.mcp.all(), 'connected-agents'],
|
|
158
|
+
// Service agents are an organization's, never an account's: two
|
|
159
|
+
// organizations' lists must not share a cache entry.
|
|
160
|
+
serviceAgents: (orgUid) => [...queryKeys.mcp.all(), 'service-agents', orgUid],
|
|
161
|
+
// The layer IAM stores, keyed by the scope *and* the subject: an
|
|
162
|
+
// organization's policy and a team's are different documents, and a
|
|
163
|
+
// shared entry would show one under the other's name.
|
|
164
|
+
policyLayer: (scope, subjectUid) => [...queryKeys.mcp.all(), 'policy-layer', scope, subjectUid],
|
|
165
|
+
alertRules: (orgUid) => [...queryKeys.mcp.all(), 'alert-rules', orgUid],
|
|
166
|
+
forwarding: (orgUid) => [...queryKeys.mcp.all(), 'audit-forwarding', orgUid],
|
|
167
|
+
auditSettings: (orgUid) => [...queryKeys.mcp.all(), 'audit-settings', orgUid],
|
|
168
|
+
organizationTeams: (orgUid) => [...queryKeys.mcp.all(), 'organization-teams', orgUid],
|
|
169
|
+
// Observability, over the OTEL service, keyed by the task it describes.
|
|
170
|
+
trace: (taskUid) => [...queryKeys.mcp.task(taskUid), 'trace'],
|
|
171
|
+
// A trace named directly: a synchronous call has one and no task.
|
|
172
|
+
traceById: (traceId) => [...queryKeys.mcp.all(), 'traces', traceId],
|
|
173
|
+
logs: (taskUid) => [...queryKeys.mcp.task(taskUid), 'logs'],
|
|
174
|
+
metrics: (filters) => [...queryKeys.mcp.all(), 'metrics', filters ?? {}],
|
|
175
|
+
operations: () => [...queryKeys.mcp.all(), 'operations'],
|
|
176
|
+
workers: () => [...queryKeys.mcp.operations(), 'workers'],
|
|
177
|
+
workflows: () => [...queryKeys.mcp.operations(), 'workflows'],
|
|
178
|
+
gatewayVersion: () => [...queryKeys.mcp.all(), 'version'],
|
|
179
|
+
// The Enterprise console: one answer per organization, narrowed by team.
|
|
180
|
+
orgOverview: (orgUid, filters) => [...queryKeys.mcp.all(), 'organizations', orgUid, 'overview', filters ?? {}],
|
|
181
|
+
orgUsage: (orgUid, filters) => [...queryKeys.mcp.all(), 'organizations', orgUid, 'usage', filters ?? {}],
|
|
182
|
+
},
|
|
69
183
|
// Authentication & Profile
|
|
70
184
|
auth: {
|
|
71
185
|
me: () => ['auth', 'me'],
|
|
@@ -155,13 +269,6 @@ export const queryKeys = {
|
|
|
155
269
|
detail: (id) => [...queryKeys.cells.details(), id],
|
|
156
270
|
bySpace: (spaceId) => [...queryKeys.cells.all(), 'space', spaceId],
|
|
157
271
|
},
|
|
158
|
-
// Datasets
|
|
159
|
-
datasets: {
|
|
160
|
-
all: () => ['datasets'],
|
|
161
|
-
details: () => [...queryKeys.datasets.all(), 'detail'],
|
|
162
|
-
detail: (id) => [...queryKeys.datasets.details(), id],
|
|
163
|
-
bySpace: (spaceId) => [...queryKeys.datasets.all(), 'space', spaceId],
|
|
164
|
-
},
|
|
165
272
|
// Lessons
|
|
166
273
|
lessons: {
|
|
167
274
|
all: () => ['lessons'],
|
|
@@ -207,12 +314,6 @@ export const queryKeys = {
|
|
|
207
314
|
details: () => [...queryKeys.pages.all(), 'detail'],
|
|
208
315
|
detail: (id) => [...queryKeys.pages.details(), id],
|
|
209
316
|
},
|
|
210
|
-
// Datasources
|
|
211
|
-
datasources: {
|
|
212
|
-
all: () => ['datasources'],
|
|
213
|
-
details: () => [...queryKeys.datasources.all(), 'detail'],
|
|
214
|
-
detail: (id) => [...queryKeys.datasources.details(), id],
|
|
215
|
-
},
|
|
216
317
|
// Secrets
|
|
217
318
|
secrets: {
|
|
218
319
|
all: () => ['secrets'],
|
|
@@ -456,11 +557,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
456
557
|
return asPage(s);
|
|
457
558
|
}
|
|
458
559
|
};
|
|
459
|
-
const toDatasource = (s) => {
|
|
460
|
-
if (s) {
|
|
461
|
-
return asDatasource(s);
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
560
|
const toSecret = (s) => {
|
|
465
561
|
if (s) {
|
|
466
562
|
return asSecret(s);
|
|
@@ -516,35 +612,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
516
612
|
};
|
|
517
613
|
// Kept for potential future use
|
|
518
614
|
// Kept for potential future use
|
|
519
|
-
const toDataset = (raw_dataset) => {
|
|
520
|
-
const owner = toItemOwner(raw_dataset);
|
|
521
|
-
return {
|
|
522
|
-
id: raw_dataset.uid,
|
|
523
|
-
type: 'dataset',
|
|
524
|
-
name: raw_dataset.name_t,
|
|
525
|
-
description: raw_dataset.description_t,
|
|
526
|
-
fileName: raw_dataset.file_name_s,
|
|
527
|
-
datasetExtension: raw_dataset.dataset_extension_s,
|
|
528
|
-
contentLength: raw_dataset.content_length_i,
|
|
529
|
-
contentType: raw_dataset.content_type_s,
|
|
530
|
-
mimeType: raw_dataset.mimetype_s,
|
|
531
|
-
path: raw_dataset.s3_path_s,
|
|
532
|
-
cdnUrl: raw_dataset.cdn_url_s,
|
|
533
|
-
creationDate: new Date(raw_dataset.creation_ts_dt),
|
|
534
|
-
public: raw_dataset.is_public_b ?? false,
|
|
535
|
-
lastPublicationDate: raw_dataset.creation_ts_dt
|
|
536
|
-
? new Date(raw_dataset.creation_ts_dt)
|
|
537
|
-
: undefined,
|
|
538
|
-
owner,
|
|
539
|
-
space: {
|
|
540
|
-
handle: raw_dataset.handle_s,
|
|
541
|
-
},
|
|
542
|
-
organization: {
|
|
543
|
-
id: raw_dataset.organization_uid_s,
|
|
544
|
-
handle: raw_dataset.organization_handle_s,
|
|
545
|
-
},
|
|
546
|
-
};
|
|
547
|
-
};
|
|
548
615
|
const toCell = (cl) => {
|
|
549
616
|
const owner = toItemOwner(cl);
|
|
550
617
|
return {
|
|
@@ -816,8 +883,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
816
883
|
},
|
|
817
884
|
};
|
|
818
885
|
}
|
|
819
|
-
case 'dataset':
|
|
820
|
-
return toDataset(item);
|
|
821
886
|
case 'document':
|
|
822
887
|
return toDocument(item);
|
|
823
888
|
case 'exercise':
|
|
@@ -1682,7 +1747,7 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
1682
1747
|
};
|
|
1683
1748
|
/**
|
|
1684
1749
|
* Update space with optimistic update.
|
|
1685
|
-
* Any extra fields (e.g.
|
|
1750
|
+
* Any extra fields (e.g. attached_agent_runtime_name_s) are forwarded to the backend.
|
|
1686
1751
|
*/
|
|
1687
1752
|
const useUpdateSpace = () => {
|
|
1688
1753
|
return useMutation({
|
|
@@ -2208,67 +2273,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
2208
2273
|
},
|
|
2209
2274
|
});
|
|
2210
2275
|
};
|
|
2211
|
-
/**
|
|
2212
|
-
* Get all datasources
|
|
2213
|
-
*/
|
|
2214
|
-
const useDatasources = (options) => {
|
|
2215
|
-
const principalUid = options?.principalUid;
|
|
2216
|
-
const principalKind = options?.principalKind;
|
|
2217
|
-
return useQuery({
|
|
2218
|
-
queryKey: [
|
|
2219
|
-
...queryKeys.datasources.all(),
|
|
2220
|
-
principalUid || 'self',
|
|
2221
|
-
principalKind || '',
|
|
2222
|
-
],
|
|
2223
|
-
queryFn: async () => {
|
|
2224
|
-
const resp = await requestDatalayer({
|
|
2225
|
-
url: withAccountUidQuery(`${configuration.iamUrl}/api/iam/v1/datasources`, principalUid, principalKind),
|
|
2226
|
-
method: 'GET',
|
|
2227
|
-
});
|
|
2228
|
-
if (resp.success && resp.datasources) {
|
|
2229
|
-
const datasources = resp.datasources
|
|
2230
|
-
.map((d) => {
|
|
2231
|
-
const datasource = toDatasource(d);
|
|
2232
|
-
if (datasource) {
|
|
2233
|
-
queryClient.setQueryData(queryKeys.datasources.detail(datasource.id), datasource);
|
|
2234
|
-
}
|
|
2235
|
-
return datasource;
|
|
2236
|
-
})
|
|
2237
|
-
.filter(Boolean);
|
|
2238
|
-
return datasources;
|
|
2239
|
-
}
|
|
2240
|
-
return [];
|
|
2241
|
-
},
|
|
2242
|
-
...DEFAULT_QUERY_OPTIONS,
|
|
2243
|
-
});
|
|
2244
|
-
};
|
|
2245
|
-
/**
|
|
2246
|
-
* Create datasource
|
|
2247
|
-
*/
|
|
2248
|
-
const useCreateDatasource = (options) => {
|
|
2249
|
-
const principalUid = options?.principalUid;
|
|
2250
|
-
const principalKind = options?.principalKind;
|
|
2251
|
-
return useMutation({
|
|
2252
|
-
mutationFn: async (datasource) => {
|
|
2253
|
-
return requestDatalayer({
|
|
2254
|
-
url: withAccountUidQuery(`${configuration.iamUrl}/api/iam/v1/datasources`, principalUid, principalKind),
|
|
2255
|
-
method: 'POST',
|
|
2256
|
-
body: { ...datasource },
|
|
2257
|
-
});
|
|
2258
|
-
},
|
|
2259
|
-
onSuccess: resp => {
|
|
2260
|
-
if (resp.success && resp.datasource) {
|
|
2261
|
-
const ds = toDatasource(resp.datasource);
|
|
2262
|
-
if (ds) {
|
|
2263
|
-
queryClient.setQueryData(queryKeys.datasources.detail(ds.id), ds);
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
queryClient.invalidateQueries({
|
|
2267
|
-
queryKey: queryKeys.datasources.all(),
|
|
2268
|
-
});
|
|
2269
|
-
},
|
|
2270
|
-
});
|
|
2271
|
-
};
|
|
2272
2276
|
/**
|
|
2273
2277
|
* Get all secrets
|
|
2274
2278
|
*/
|
|
@@ -2562,9 +2566,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
2562
2566
|
queryKey: queryKeys.documents.detail(itemId),
|
|
2563
2567
|
});
|
|
2564
2568
|
queryClient.removeQueries({ queryKey: queryKeys.cells.detail(itemId) });
|
|
2565
|
-
queryClient.removeQueries({
|
|
2566
|
-
queryKey: queryKeys.datasets.detail(itemId),
|
|
2567
|
-
});
|
|
2568
2569
|
queryClient.removeQueries({
|
|
2569
2570
|
queryKey: queryKeys.lessons.detail(itemId),
|
|
2570
2571
|
});
|
|
@@ -2578,7 +2579,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
2578
2579
|
queryClient.invalidateQueries({ queryKey: queryKeys.notebooks.all() });
|
|
2579
2580
|
queryClient.invalidateQueries({ queryKey: queryKeys.documents.all() });
|
|
2580
2581
|
queryClient.invalidateQueries({ queryKey: queryKeys.cells.all() });
|
|
2581
|
-
queryClient.invalidateQueries({ queryKey: queryKeys.datasets.all() });
|
|
2582
2582
|
queryClient.invalidateQueries({ queryKey: queryKeys.lessons.all() });
|
|
2583
2583
|
queryClient.invalidateQueries({ queryKey: queryKeys.exercises.all() });
|
|
2584
2584
|
queryClient.invalidateQueries({
|
|
@@ -2592,59 +2592,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
2592
2592
|
// ============================================================================
|
|
2593
2593
|
// Core CRUD Operations - Refresh & Get Methods
|
|
2594
2594
|
// ============================================================================
|
|
2595
|
-
/**
|
|
2596
|
-
* Get single datasource by ID
|
|
2597
|
-
*/
|
|
2598
|
-
const useDatasource = (datasourceId, options) => {
|
|
2599
|
-
const principalUid = options?.principalUid;
|
|
2600
|
-
const principalKind = options?.principalKind;
|
|
2601
|
-
return useQuery({
|
|
2602
|
-
queryKey: [
|
|
2603
|
-
...queryKeys.datasources.detail(datasourceId),
|
|
2604
|
-
principalUid || 'self',
|
|
2605
|
-
principalKind || '',
|
|
2606
|
-
],
|
|
2607
|
-
queryFn: async () => {
|
|
2608
|
-
const resp = await requestDatalayer({
|
|
2609
|
-
url: withAccountUidQuery(`${configuration.iamUrl}/api/iam/v1/datasources/${datasourceId}`, principalUid, principalKind),
|
|
2610
|
-
method: 'GET',
|
|
2611
|
-
});
|
|
2612
|
-
if (resp.success && resp.datasource) {
|
|
2613
|
-
return toDatasource(resp.datasource);
|
|
2614
|
-
}
|
|
2615
|
-
return null;
|
|
2616
|
-
},
|
|
2617
|
-
...DEFAULT_QUERY_OPTIONS,
|
|
2618
|
-
enabled: !!datasourceId,
|
|
2619
|
-
});
|
|
2620
|
-
};
|
|
2621
|
-
/**
|
|
2622
|
-
* Update datasource
|
|
2623
|
-
*/
|
|
2624
|
-
const useUpdateDatasource = (options) => {
|
|
2625
|
-
const principalUid = options?.principalUid;
|
|
2626
|
-
const principalKind = options?.principalKind;
|
|
2627
|
-
return useMutation({
|
|
2628
|
-
mutationFn: async (datasource) => {
|
|
2629
|
-
return requestDatalayer({
|
|
2630
|
-
url: withAccountUidQuery(`${configuration.iamUrl}/api/iam/v1/datasources/${datasource.id}`, principalUid, principalKind),
|
|
2631
|
-
method: 'PUT',
|
|
2632
|
-
body: { ...datasource },
|
|
2633
|
-
});
|
|
2634
|
-
},
|
|
2635
|
-
onSuccess: resp => {
|
|
2636
|
-
if (resp.success && resp.datasource) {
|
|
2637
|
-
const ds = toDatasource(resp.datasource);
|
|
2638
|
-
if (ds) {
|
|
2639
|
-
queryClient.setQueryData(queryKeys.datasources.detail(ds.id), ds);
|
|
2640
|
-
}
|
|
2641
|
-
}
|
|
2642
|
-
queryClient.invalidateQueries({
|
|
2643
|
-
queryKey: queryKeys.datasources.all(),
|
|
2644
|
-
});
|
|
2645
|
-
},
|
|
2646
|
-
});
|
|
2647
|
-
};
|
|
2648
2595
|
/**
|
|
2649
2596
|
* Get single secret by ID
|
|
2650
2597
|
*/
|
|
@@ -3973,105 +3920,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
3973
3920
|
},
|
|
3974
3921
|
});
|
|
3975
3922
|
};
|
|
3976
|
-
/**
|
|
3977
|
-
* Get dataset by ID
|
|
3978
|
-
*/
|
|
3979
|
-
const useDataset = (datasetId, scope) => {
|
|
3980
|
-
return useQuery({
|
|
3981
|
-
queryKey: [
|
|
3982
|
-
...queryKeys.datasets.detail(datasetId),
|
|
3983
|
-
scope?.selectedPrincipalUid || '',
|
|
3984
|
-
scope?.selectedPrincipalKind || '',
|
|
3985
|
-
],
|
|
3986
|
-
queryFn: async () => {
|
|
3987
|
-
const params = new URLSearchParams();
|
|
3988
|
-
if (scope?.selectedPrincipalUid) {
|
|
3989
|
-
params.set('selected_principal_uid', scope.selectedPrincipalUid);
|
|
3990
|
-
}
|
|
3991
|
-
if (scope?.selectedPrincipalKind) {
|
|
3992
|
-
params.set('selected_principal_kind', scope.selectedPrincipalKind);
|
|
3993
|
-
}
|
|
3994
|
-
const query = params.toString();
|
|
3995
|
-
const resp = await requestDatalayer({
|
|
3996
|
-
url: `${configuration.runtimesUrl}/api/runtimes/v1/spaces/items/${datasetId}${query ? `?${query}` : ''}`,
|
|
3997
|
-
method: 'GET',
|
|
3998
|
-
});
|
|
3999
|
-
if (resp.success && resp.item) {
|
|
4000
|
-
return toDataset(resp.item);
|
|
4001
|
-
}
|
|
4002
|
-
return undefined;
|
|
4003
|
-
},
|
|
4004
|
-
enabled: !!datasetId,
|
|
4005
|
-
...DEFAULT_QUERY_OPTIONS,
|
|
4006
|
-
});
|
|
4007
|
-
};
|
|
4008
|
-
/**
|
|
4009
|
-
* Get datasets by space
|
|
4010
|
-
*/
|
|
4011
|
-
const useDatasetsBySpace = (spaceId, scope) => {
|
|
4012
|
-
return useQuery({
|
|
4013
|
-
queryKey: [
|
|
4014
|
-
...queryKeys.datasets.bySpace(spaceId),
|
|
4015
|
-
scope?.selectedPrincipalUid || '',
|
|
4016
|
-
scope?.selectedPrincipalKind || '',
|
|
4017
|
-
],
|
|
4018
|
-
queryFn: async () => {
|
|
4019
|
-
const params = new URLSearchParams();
|
|
4020
|
-
if (scope?.selectedPrincipalUid) {
|
|
4021
|
-
params.set('selected_principal_uid', scope.selectedPrincipalUid);
|
|
4022
|
-
}
|
|
4023
|
-
if (scope?.selectedPrincipalKind) {
|
|
4024
|
-
params.set('selected_principal_kind', scope.selectedPrincipalKind);
|
|
4025
|
-
}
|
|
4026
|
-
const query = params.toString();
|
|
4027
|
-
const resp = await requestDatalayer({
|
|
4028
|
-
url: `${configuration.runtimesUrl}/api/runtimes/v1/spaces/${spaceId}/items/types/dataset${query ? `?${query}` : ''}`,
|
|
4029
|
-
method: 'GET',
|
|
4030
|
-
});
|
|
4031
|
-
if (resp.success && resp.items) {
|
|
4032
|
-
return resp.items.map((item) => toDataset(item));
|
|
4033
|
-
}
|
|
4034
|
-
return [];
|
|
4035
|
-
},
|
|
4036
|
-
enabled: !!spaceId,
|
|
4037
|
-
...DEFAULT_QUERY_OPTIONS,
|
|
4038
|
-
});
|
|
4039
|
-
};
|
|
4040
|
-
/**
|
|
4041
|
-
* Update dataset
|
|
4042
|
-
*/
|
|
4043
|
-
const useUpdateDataset = () => {
|
|
4044
|
-
return useMutation({
|
|
4045
|
-
mutationFn: async ({ id, name, description, selectedPrincipalUid, selectedPrincipalKind, }) => {
|
|
4046
|
-
const params = new URLSearchParams();
|
|
4047
|
-
if (selectedPrincipalUid) {
|
|
4048
|
-
params.set('selected_principal_uid', selectedPrincipalUid);
|
|
4049
|
-
}
|
|
4050
|
-
if (selectedPrincipalKind) {
|
|
4051
|
-
params.set('selected_principal_kind', selectedPrincipalKind);
|
|
4052
|
-
}
|
|
4053
|
-
const query = params.toString();
|
|
4054
|
-
return requestDatalayer({
|
|
4055
|
-
url: `${configuration.runtimesUrl}/api/runtimes/v1/datasets/${id}${query ? `?${query}` : ''}`,
|
|
4056
|
-
method: 'PUT',
|
|
4057
|
-
body: { name, description },
|
|
4058
|
-
});
|
|
4059
|
-
},
|
|
4060
|
-
onSuccess: (resp, { id, spaceId }) => {
|
|
4061
|
-
if (resp.success) {
|
|
4062
|
-
// Invalidate detail and list queries
|
|
4063
|
-
queryClient.invalidateQueries({
|
|
4064
|
-
queryKey: queryKeys.datasets.detail(id),
|
|
4065
|
-
});
|
|
4066
|
-
if (spaceId) {
|
|
4067
|
-
queryClient.invalidateQueries({
|
|
4068
|
-
queryKey: queryKeys.datasets.bySpace(spaceId),
|
|
4069
|
-
});
|
|
4070
|
-
}
|
|
4071
|
-
}
|
|
4072
|
-
},
|
|
4073
|
-
});
|
|
4074
|
-
};
|
|
4075
3923
|
/**
|
|
4076
3924
|
* Get environment by ID
|
|
4077
3925
|
*/
|
|
@@ -4730,6 +4578,31 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
4730
4578
|
/**
|
|
4731
4579
|
* Launch bulk emails for outbound campaign (production mode)
|
|
4732
4580
|
*/
|
|
4581
|
+
/**
|
|
4582
|
+
* Mark an outbound as launched without sending — for launches that
|
|
4583
|
+
* happened outside the browser (curl, the CLI).
|
|
4584
|
+
*/
|
|
4585
|
+
const useMarkOutboundLaunched = () => {
|
|
4586
|
+
const queryClient = useQueryClient();
|
|
4587
|
+
return useMutation({
|
|
4588
|
+
mutationFn: async (outboundId) => {
|
|
4589
|
+
return requestDatalayer({
|
|
4590
|
+
url: `${configuration.growthUrl}/api/growth/v1/outbounds/${outboundId}/mark-launched`,
|
|
4591
|
+
method: 'POST',
|
|
4592
|
+
body: {},
|
|
4593
|
+
});
|
|
4594
|
+
},
|
|
4595
|
+
onSuccess: (_, outboundId) => {
|
|
4596
|
+
queryClient.removeQueries({
|
|
4597
|
+
queryKey: ['outbounds', outboundId],
|
|
4598
|
+
});
|
|
4599
|
+
queryClient.invalidateQueries({
|
|
4600
|
+
queryKey: ['outbounds'],
|
|
4601
|
+
refetchType: 'inactive',
|
|
4602
|
+
});
|
|
4603
|
+
},
|
|
4604
|
+
});
|
|
4605
|
+
};
|
|
4733
4606
|
const useLaunchBulkEmailsOutbounds = () => {
|
|
4734
4607
|
const queryClient = useQueryClient();
|
|
4735
4608
|
return useMutation({
|
|
@@ -6572,82 +6445,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
6572
6445
|
...options,
|
|
6573
6446
|
});
|
|
6574
6447
|
};
|
|
6575
|
-
/**
|
|
6576
|
-
* Refresh a specific dataset
|
|
6577
|
-
* @param options - Mutation options
|
|
6578
|
-
*/
|
|
6579
|
-
const useRefreshDataset = (options) => {
|
|
6580
|
-
const queryClient = useQueryClient();
|
|
6581
|
-
return useMutation({
|
|
6582
|
-
mutationFn: async (variables) => {
|
|
6583
|
-
const datasetId = typeof variables === 'string' ? variables : variables.datasetId;
|
|
6584
|
-
const selectedPrincipalUid = typeof variables === 'string'
|
|
6585
|
-
? undefined
|
|
6586
|
-
: variables.selectedPrincipalUid;
|
|
6587
|
-
const selectedPrincipalKind = typeof variables === 'string'
|
|
6588
|
-
? undefined
|
|
6589
|
-
: variables.selectedPrincipalKind;
|
|
6590
|
-
const params = new URLSearchParams();
|
|
6591
|
-
if (selectedPrincipalUid) {
|
|
6592
|
-
params.set('selected_principal_uid', selectedPrincipalUid);
|
|
6593
|
-
}
|
|
6594
|
-
if (selectedPrincipalKind) {
|
|
6595
|
-
params.set('selected_principal_kind', selectedPrincipalKind);
|
|
6596
|
-
}
|
|
6597
|
-
const query = params.toString();
|
|
6598
|
-
const resp = await requestDatalayer({
|
|
6599
|
-
url: `${configuration.runtimesUrl}/api/runtimes/v1/spaces/items/${datasetId}${query ? `?${query}` : ''}`,
|
|
6600
|
-
method: 'GET',
|
|
6601
|
-
});
|
|
6602
|
-
return resp;
|
|
6603
|
-
},
|
|
6604
|
-
onSuccess: (data, variables) => {
|
|
6605
|
-
const datasetId = typeof variables === 'string' ? variables : variables.datasetId;
|
|
6606
|
-
queryClient.invalidateQueries({
|
|
6607
|
-
queryKey: queryKeys.datasets.detail(datasetId),
|
|
6608
|
-
});
|
|
6609
|
-
},
|
|
6610
|
-
...options,
|
|
6611
|
-
});
|
|
6612
|
-
};
|
|
6613
|
-
/**
|
|
6614
|
-
* Refresh space datasets
|
|
6615
|
-
* @param options - Mutation options
|
|
6616
|
-
*/
|
|
6617
|
-
const useRefreshSpaceDatasets = (options) => {
|
|
6618
|
-
const queryClient = useQueryClient();
|
|
6619
|
-
return useMutation({
|
|
6620
|
-
mutationFn: async (variables) => {
|
|
6621
|
-
const spaceId = typeof variables === 'string' ? variables : variables.spaceId;
|
|
6622
|
-
const selectedPrincipalUid = typeof variables === 'string'
|
|
6623
|
-
? undefined
|
|
6624
|
-
: variables.selectedPrincipalUid;
|
|
6625
|
-
const selectedPrincipalKind = typeof variables === 'string'
|
|
6626
|
-
? undefined
|
|
6627
|
-
: variables.selectedPrincipalKind;
|
|
6628
|
-
const params = new URLSearchParams();
|
|
6629
|
-
if (selectedPrincipalUid) {
|
|
6630
|
-
params.set('selected_principal_uid', selectedPrincipalUid);
|
|
6631
|
-
}
|
|
6632
|
-
if (selectedPrincipalKind) {
|
|
6633
|
-
params.set('selected_principal_kind', selectedPrincipalKind);
|
|
6634
|
-
}
|
|
6635
|
-
const query = params.toString();
|
|
6636
|
-
const resp = await requestDatalayer({
|
|
6637
|
-
url: `${configuration.runtimesUrl}/api/runtimes/v1/spaces/${spaceId}/items/types/dataset${query ? `?${query}` : ''}`,
|
|
6638
|
-
method: 'GET',
|
|
6639
|
-
});
|
|
6640
|
-
return resp;
|
|
6641
|
-
},
|
|
6642
|
-
onSuccess: (data, variables) => {
|
|
6643
|
-
const spaceId = typeof variables === 'string' ? variables : variables.spaceId;
|
|
6644
|
-
queryClient.invalidateQueries({
|
|
6645
|
-
queryKey: queryKeys.datasets.bySpace(spaceId),
|
|
6646
|
-
});
|
|
6647
|
-
},
|
|
6648
|
-
...options,
|
|
6649
|
-
});
|
|
6650
|
-
};
|
|
6651
6448
|
/**
|
|
6652
6449
|
* Refresh schools list
|
|
6653
6450
|
* @param options - Mutation options
|
|
@@ -7553,12 +7350,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
7553
7350
|
useCloneCell,
|
|
7554
7351
|
useRefreshCell,
|
|
7555
7352
|
useRefreshSpaceCells,
|
|
7556
|
-
// Datasets
|
|
7557
|
-
useDataset,
|
|
7558
|
-
useDatasetsBySpace,
|
|
7559
|
-
useUpdateDataset,
|
|
7560
|
-
useRefreshDataset,
|
|
7561
|
-
useRefreshSpaceDatasets,
|
|
7562
7353
|
// Environments
|
|
7563
7354
|
useEnvironment,
|
|
7564
7355
|
useEnvironmentsBySpace,
|
|
@@ -7608,11 +7399,6 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
7608
7399
|
useCreatePage,
|
|
7609
7400
|
useUpdatePage,
|
|
7610
7401
|
useDeletePage,
|
|
7611
|
-
// Datasources
|
|
7612
|
-
useDatasource,
|
|
7613
|
-
useDatasources,
|
|
7614
|
-
useCreateDatasource,
|
|
7615
|
-
useUpdateDatasource,
|
|
7616
7402
|
// Secrets
|
|
7617
7403
|
useSecret,
|
|
7618
7404
|
useSecrets,
|
|
@@ -7661,6 +7447,7 @@ export const useCache = ({ loginRoute = '/login' } = {}) => {
|
|
|
7661
7447
|
useDraftBulkEmailsOutbounds,
|
|
7662
7448
|
useTryBulkEmailsOutbounds,
|
|
7663
7449
|
useLaunchBulkEmailsOutbounds,
|
|
7450
|
+
useMarkOutboundLaunched,
|
|
7664
7451
|
useSendOutboundEmailToUser,
|
|
7665
7452
|
useDeleteOutbound,
|
|
7666
7453
|
useSubscribeUserToOutbounds,
|
|
@@ -6,4 +6,4 @@ import { type RefObject } from 'react';
|
|
|
6
6
|
* @type T The type of the container element.
|
|
7
7
|
* @returns The ref to be applied to the container element.
|
|
8
8
|
*/
|
|
9
|
-
export declare const useContainsFocus: <T extends HTMLElement>(containerRef?: RefObject<T>, onFocusChange?: (isFocussed: boolean) => void) => void;
|
|
9
|
+
export declare const useContainsFocus: <T extends HTMLElement>(containerRef?: RefObject<T | null>, onFocusChange?: (isFocussed: boolean) => void) => void;
|