@datalayer/core 1.1.60 → 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/DatalayerApi.d.ts +42 -1
- package/lib/api/DatalayerApi.js +90 -3
- package/lib/api/constants.d.ts +19 -1
- package/lib/api/constants.js +19 -1
- package/lib/api/contents/attachments.d.ts +9 -0
- package/lib/api/contents/attachments.js +39 -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 +63 -0
- package/lib/api/contents/datasets.js +82 -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 +21 -0
- package/lib/api/contents/sandboxUid.js +27 -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/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 +68 -0
- package/lib/api/iam/connectedAgents.js +87 -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 +3 -1
- package/lib/api/iam/index.js +3 -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 +181 -0
- package/lib/api/iam/mcpPolicy.js +168 -0
- package/lib/api/iam/organizationTeams.d.ts +13 -0
- package/lib/api/iam/organizationTeams.js +43 -0
- 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/serviceAgents.d.ts +68 -0
- package/lib/api/iam/serviceAgents.js +119 -0
- package/lib/api/iam/trials.d.ts +38 -0
- package/lib/api/iam/trials.js +66 -0
- package/lib/api/index.d.ts +8 -1
- package/lib/api/index.js +7 -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 +141 -0
- package/lib/api/mcp/observability.js +267 -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/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/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/constants.d.ts +1 -0
- package/lib/client/constants.js +1 -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 +2 -44
- package/lib/components/animation/AnimatedText.js +6 -126
- 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/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 +16 -1
- package/lib/components/avatars/UserAvatar.js +15 -13
- 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 +16 -0
- package/lib/components/billing/BillingEntitySelect.js +49 -27
- 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 -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 +36 -0
- package/lib/components/collaboration/LiveEditorCollaborators.js +88 -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 -3
- package/lib/components/display/DatalayerBox.js +7 -7
- 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/NavLink.js +3 -2
- 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 +2 -9
- package/lib/components/labels/StatusLabels.js +2 -26
- 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 +22 -42
- package/lib/components/principal/PrincipalAppearance.js +232 -182
- package/lib/components/principal/PrincipalAvatar.d.ts +9 -1
- package/lib/components/principal/PrincipalAvatar.js +18 -10
- 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 +38 -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/Screencapture.js +46 -3
- package/lib/components/screencapture/ScreencaptureButton.d.ts +1 -1
- package/lib/components/sharing/ShareAccessComponent.d.ts +58 -3
- package/lib/components/sharing/ShareAccessComponent.js +143 -98
- package/lib/components/sharing/SharingEditor.d.ts +21 -0
- package/lib/components/sharing/SharingEditor.js +9 -28
- 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/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/cacheConverters.d.ts +0 -7
- package/lib/hooks/cacheConverters.js +0 -25
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.js +3 -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/useBillingEntityStore.js +3 -0
- package/lib/hooks/useCache.d.ts +478 -130
- package/lib/hooks/useCache.js +1580 -676
- package/lib/hooks/useContainsFocus.d.ts +1 -1
- package/lib/hooks/useContents.d.ts +334 -0
- package/lib/hooks/useContents.js +1033 -0
- package/lib/hooks/useFocusTrap.d.ts +4 -4
- package/lib/hooks/useFocusTrap.js +1 -1
- package/lib/hooks/useMcp.d.ts +315 -0
- package/lib/hooks/useMcp.js +891 -0
- package/lib/hooks/useMobile.js +0 -5
- 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/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/useSpaceCacheStore.d.ts +50 -0
- package/lib/hooks/useSpaceCacheStore.js +85 -0
- 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/CreditsDTO.d.ts +6 -5
- package/lib/models/CreditsDTO.js +7 -5
- package/lib/models/McpAuditEvent.d.ts +52 -0
- package/lib/models/McpAuditEvent.js +5 -0
- package/lib/models/McpBinding.d.ts +57 -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/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 +91 -0
- package/lib/models/StartedBy.js +117 -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/UserDTO.js +4 -2
- package/lib/models/UserSettings.d.ts +13 -0
- package/lib/models/UserSettings.js +9 -0
- package/lib/models/contents/__fixtures__/solr-codec.json +57 -0
- package/lib/models/contents/__fixtures__/v1-contracts.json +194 -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/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.d.ts +15 -7
- package/lib/state/substates/CoreState.js +21 -17
- package/lib/state/substates/IAMState.d.ts +1 -1
- package/lib/state/substates/IAMState.js +12 -5
- package/lib/state/substates/LayoutState.js +12 -0
- package/lib/state/substates/ProfileState.d.ts +1 -0
- package/lib/state/substates/ProfileState.js +1 -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/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/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/AdmittedClients.d.ts +44 -0
- package/lib/views/mcp/AdmittedClients.js +59 -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/ApprovalQueue.d.ts +66 -0
- package/lib/views/mcp/ApprovalQueue.js +95 -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 +135 -0
- package/lib/views/mcp/EnterpriseConsole.d.ts +74 -0
- package/lib/views/mcp/EnterpriseConsole.js +195 -0
- package/lib/views/mcp/IdentityProviders.d.ts +33 -0
- package/lib/views/mcp/IdentityProviders.js +299 -0
- package/lib/views/mcp/McpDashboard.d.ts +50 -0
- package/lib/views/mcp/McpDashboard.js +430 -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 +79 -0
- package/lib/views/mcp/McpObservability.js +236 -0
- package/lib/views/mcp/NotebookRuns.d.ts +39 -0
- package/lib/views/mcp/NotebookRuns.js +44 -0
- package/lib/views/mcp/OrganizationPolicy.d.ts +45 -0
- package/lib/views/mcp/OrganizationPolicy.js +108 -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 +126 -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 +83 -0
- package/lib/views/mcp/PolicyForm.js +113 -0
- package/lib/views/mcp/PolicyHistory.d.ts +58 -0
- package/lib/views/mcp/PolicyHistory.js +75 -0
- 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/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 +159 -0
- 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/format.d.ts +25 -0
- package/lib/views/mcp/format.js +77 -0
- package/lib/views/mcp/index.d.ts +34 -0
- package/lib/views/mcp/index.js +42 -0
- package/lib/views/mcp/types.d.ts +66 -0
- package/lib/views/mcp/types.js +5 -0
- package/lib/views/otel/simpleAuthStore.js +3 -0
- package/lib/views/secrets/SecretEdit.d.ts +5 -1
- package/lib/views/secrets/SecretEdit.js +5 -4
- package/lib/views/secrets/SecretNew.d.ts +11 -1
- package/lib/views/secrets/SecretNew.js +7 -3
- package/lib/views/secrets/Secrets.d.ts +12 -1
- package/lib/views/secrets/Secrets.js +2 -2
- package/package.json +269 -260
- package/scripts/generate-contents-types.py +169 -0
- package/scripts/generate-mcp-types.py +233 -0
- package/scripts/generate-orchestration-types.py +920 -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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import { type MutableRefObject } from 'react';
|
|
3
|
+
import { IContentsView } from './ContentsItems';
|
|
4
|
+
/**
|
|
5
|
+
* Contents table component properties.
|
|
6
|
+
*/
|
|
7
|
+
export interface IContentsTableProps {
|
|
8
|
+
/**
|
|
9
|
+
* Path of the folder listed by the table; the empty string is the root.
|
|
10
|
+
*/
|
|
11
|
+
path: string;
|
|
12
|
+
/**
|
|
13
|
+
* Items of the listed folder.
|
|
14
|
+
*/
|
|
15
|
+
items: IContentsView[];
|
|
16
|
+
/**
|
|
17
|
+
* Currently selected item.
|
|
18
|
+
*/
|
|
19
|
+
current: IContentsView | null;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the folder content is being (re)fetched; a spinner replaces the
|
|
22
|
+
* rows while it is.
|
|
23
|
+
*/
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Callback when a folder is opened, either from a row, the `..` row or the
|
|
27
|
+
* path bar. Navigating to the listed folder reloads it.
|
|
28
|
+
*/
|
|
29
|
+
onNavigate: (path: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Callback on item selection.
|
|
32
|
+
*/
|
|
33
|
+
onSelect: (item: IContentsView) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Callback on context menu event.
|
|
36
|
+
*/
|
|
37
|
+
onContextMenu: (ref: MutableRefObject<HTMLElement | null>) => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Format a byte count for display.
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatSize(size?: number | null): string;
|
|
43
|
+
/**
|
|
44
|
+
* Table listing the content of one folder.
|
|
45
|
+
*
|
|
46
|
+
* Folder rows open the folder, the `..` row goes to the parent folder and
|
|
47
|
+
* the path bar jumps to any ancestor (or reloads the listed folder).
|
|
48
|
+
*/
|
|
49
|
+
export declare function ContentsTable(props: IContentsTableProps): JSX.Element;
|
|
50
|
+
export default ContentsTable;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, useRef, } from 'react';
|
|
3
|
+
import { PathExt } from '@jupyterlab/coreutils';
|
|
4
|
+
import { Link, RelativeTime, Spinner, Text } from '@primer/react';
|
|
5
|
+
import { Table } from '@primer/react/experimental';
|
|
6
|
+
import { Box } from '@datalayer/primer-addons';
|
|
7
|
+
import { FileDirectoryFillIcon, FileDirectoryIcon, FileIcon, } from '@primer/octicons-react';
|
|
8
|
+
const SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
9
|
+
/**
|
|
10
|
+
* Format a byte count for display.
|
|
11
|
+
*/
|
|
12
|
+
export function formatSize(size) {
|
|
13
|
+
if (size === undefined || size === null) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
let value = size;
|
|
17
|
+
let unit = 0;
|
|
18
|
+
while (value >= 1024 && unit < SIZE_UNITS.length - 1) {
|
|
19
|
+
value /= 1024;
|
|
20
|
+
unit += 1;
|
|
21
|
+
}
|
|
22
|
+
return `${unit === 0 ? value : value.toFixed(1)} ${SIZE_UNITS[unit]}`;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Split a folder path into its ancestors, root first.
|
|
26
|
+
*/
|
|
27
|
+
function pathSegments(path) {
|
|
28
|
+
const segments = [];
|
|
29
|
+
if (path) {
|
|
30
|
+
path.split('/').forEach(name => {
|
|
31
|
+
const parent = segments[segments.length - 1]?.path ?? '';
|
|
32
|
+
segments.push({
|
|
33
|
+
name,
|
|
34
|
+
path: parent ? PathExt.join(parent, name) : name,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return segments;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* One clickable part of the path bar.
|
|
42
|
+
*/
|
|
43
|
+
function PathSegment(props) {
|
|
44
|
+
const { name, path, current, title, onNavigate } = props;
|
|
45
|
+
return (_jsx(Link, { as: "button", type: "button", title: title, "aria-current": current ? 'location' : undefined, onClick: () => onNavigate(path), sx: current ? { color: 'fg.default', fontWeight: 'semibold' } : undefined, children: name }));
|
|
46
|
+
}
|
|
47
|
+
const ROW_STYLE = { cursor: 'pointer' };
|
|
48
|
+
const SELECTED_ROW_STYLE = {
|
|
49
|
+
...ROW_STYLE,
|
|
50
|
+
backgroundColor: 'var(--bgColor-accent-muted)',
|
|
51
|
+
};
|
|
52
|
+
function isActivationKey(event) {
|
|
53
|
+
return event.key === 'Enter' || event.key === ' ';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The `..` row navigating to the parent folder.
|
|
57
|
+
*/
|
|
58
|
+
function ParentRow(props) {
|
|
59
|
+
const { path, onNavigate } = props;
|
|
60
|
+
const goUp = () => onNavigate(path);
|
|
61
|
+
return (_jsxs(Table.Row, { tabIndex: 0, style: ROW_STYLE, title: "Go to the parent folder.", onClick: goUp, onKeyDown: event => {
|
|
62
|
+
if (isActivationKey(event)) {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
goUp();
|
|
65
|
+
}
|
|
66
|
+
}, children: [_jsx(Table.Cell, { scope: "row", children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(FileDirectoryIcon, {}), _jsx("span", { children: ".." })] }) }), _jsx(Table.Cell, {}), _jsx(Table.Cell, {})] }));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A folder or file row.
|
|
70
|
+
*/
|
|
71
|
+
function ContentsRow(props) {
|
|
72
|
+
const { item, current, onNavigate, onSelect, onContextMenu } = props;
|
|
73
|
+
const ref = useRef(null);
|
|
74
|
+
const isDirectory = item.type === 'directory';
|
|
75
|
+
const icon = item.fileType?.icon;
|
|
76
|
+
const activate = () => {
|
|
77
|
+
if (isDirectory) {
|
|
78
|
+
onNavigate(item.path);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
onSelect(item);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return (_jsxs(Table.Row, { tabIndex: 0, "aria-selected": current, style: current ? SELECTED_ROW_STYLE : ROW_STYLE, title: isDirectory ? `Open ${item.path}` : item.path, onClick: activate, onKeyDown: event => {
|
|
85
|
+
if (isActivationKey(event)) {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
activate();
|
|
88
|
+
}
|
|
89
|
+
}, onContextMenu: (event) => {
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
if (!current) {
|
|
92
|
+
onSelect(item);
|
|
93
|
+
}
|
|
94
|
+
onContextMenu(ref);
|
|
95
|
+
}, children: [_jsx(Table.Cell, { scope: "row", children: _jsxs(Box, { ref: ref, sx: { display: 'flex', alignItems: 'center', gap: 2, minWidth: 0 }, children: [isDirectory ? (_jsx(FileDirectoryFillIcon, {})) : icon ? (_jsx(icon.react, { tag: 'span' })) : (_jsx(FileIcon, {})), _jsx("span", { style: {
|
|
96
|
+
overflow: 'hidden',
|
|
97
|
+
textOverflow: 'ellipsis',
|
|
98
|
+
whiteSpace: 'nowrap',
|
|
99
|
+
}, children: item.name })] }) }), _jsx(Table.Cell, { children: item.last_modified ? (_jsx(RelativeTime, { date: new Date(item.last_modified) })) : null }), _jsx(Table.Cell, { align: "end", children: isDirectory ? '' : formatSize(item.size) })] }));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Table listing the content of one folder.
|
|
103
|
+
*
|
|
104
|
+
* Folder rows open the folder, the `..` row goes to the parent folder and
|
|
105
|
+
* the path bar jumps to any ancestor (or reloads the listed folder).
|
|
106
|
+
*/
|
|
107
|
+
export function ContentsTable(props) {
|
|
108
|
+
const { path, items, current, loading = false, onNavigate, onSelect, onContextMenu, } = props;
|
|
109
|
+
const segments = pathSegments(path);
|
|
110
|
+
const label = path ? `Contents of ${path}` : 'Contents of the root folder';
|
|
111
|
+
return (_jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsx(Box, { sx: {
|
|
112
|
+
display: 'flex',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
gap: 2,
|
|
115
|
+
minWidth: 0,
|
|
116
|
+
overflow: 'hidden',
|
|
117
|
+
}, children: _jsxs(Box, { role: "navigation", "aria-label": "Folder path", sx: {
|
|
118
|
+
display: 'flex',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
flexWrap: 'wrap',
|
|
121
|
+
gap: 1,
|
|
122
|
+
minWidth: 0,
|
|
123
|
+
fontSize: 1,
|
|
124
|
+
}, children: [_jsx(PathSegment, { name: "/", path: "", current: segments.length === 0, title: "Go to the root folder.", onNavigate: onNavigate }), segments.map((segment, index) => (_jsxs(Fragment, { children: [index > 0 && _jsx(Text, { sx: { color: 'fg.muted' }, children: "/" }), _jsx(PathSegment, { name: segment.name, path: segment.path, current: index === segments.length - 1, title: index === segments.length - 1
|
|
125
|
+
? `Reload ${segment.path}`
|
|
126
|
+
: `Go to ${segment.path}`, onNavigate: onNavigate })] }, segment.path)))] }) }), loading ? (_jsx(Box, { sx: {
|
|
127
|
+
display: 'flex',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
justifyContent: 'center',
|
|
130
|
+
minHeight: '40px',
|
|
131
|
+
padding: 3,
|
|
132
|
+
}, children: _jsx(Spinner, { "aria-label": "Loading folder\u2026" }) })) : (_jsx(Table.Container, { children: _jsxs(Table, { "aria-label": label, cellPadding: "condensed", gridTemplateColumns: "minmax(0, 1fr) max-content max-content", children: [_jsx(Table.Head, { children: _jsxs(Table.Row, { children: [_jsx(Table.Header, { children: "Name" }), _jsx(Table.Header, { children: "Last modified" }), _jsx(Table.Header, { align: "end", children: "Size" })] }) }), _jsxs(Table.Body, { children: [path && (_jsx(ParentRow, { path: PathExt.dirname(path), onNavigate: onNavigate })), items.map(item => (_jsx(ContentsRow, { item: item, current: item.path === current?.path, onNavigate: onNavigate, onSelect: onSelect, onContextMenu: onContextMenu }, item.path)))] })] }) }))] }));
|
|
133
|
+
}
|
|
134
|
+
export default ContentsTable;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The caller's Home Folders as a JupyterLab drive.
|
|
3
|
+
*
|
|
4
|
+
* One implementation of `Contents.IDrive`, so JupyterLab's file browser, the
|
|
5
|
+
* shared `ContentsBrowser` and VS Code's file system provider all read the
|
|
6
|
+
* same listing and write through the same transfer — `uploadHomeFolderFile`,
|
|
7
|
+
* verified, resumable — rather than each carrying an upload of its own.
|
|
8
|
+
*
|
|
9
|
+
* The tree is two levels of one address space: the root names the folders the
|
|
10
|
+
* caller reaches — their own, and one per organization and team — and
|
|
11
|
+
* everything below is a path inside one of them.
|
|
12
|
+
*
|
|
13
|
+
* @module components/storage/HomeFolderDrive
|
|
14
|
+
*/
|
|
15
|
+
import type { Contents, ServerConnection } from '@jupyterlab/services';
|
|
16
|
+
import { ISignal } from '@lumino/signaling';
|
|
17
|
+
export type HomeFolderDriveOptions = {
|
|
18
|
+
/** Where the Contents service is reached. */
|
|
19
|
+
contentsUrl: string;
|
|
20
|
+
/** The caller's token; the reachable folders are resolved from it. */
|
|
21
|
+
token: string;
|
|
22
|
+
/** The drive's name in JupyterLab, the prefix before `:` in a path. */
|
|
23
|
+
name?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The Home Folders, as one JupyterLab drive.
|
|
27
|
+
*
|
|
28
|
+
* Reads come from the shared filesystem — what a sandbox wrote as well as what
|
|
29
|
+
* was uploaded. Writes go through the transfer contract: a file the browser
|
|
30
|
+
* hands over in chunks is gathered and sent whole, created, its parts
|
|
31
|
+
* checksummed, then completed; an interrupted upload resumes from the parts
|
|
32
|
+
* the service verified. Checkpoints are the immutable versions the catalog
|
|
33
|
+
* keeps of every object, so there is nothing to create here.
|
|
34
|
+
*/
|
|
35
|
+
export declare class HomeFolderDrive implements Contents.IDrive {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly serverSettings: ServerConnection.ISettings;
|
|
38
|
+
private readonly _token;
|
|
39
|
+
private readonly _base;
|
|
40
|
+
private readonly _fileChanged;
|
|
41
|
+
private readonly _pending;
|
|
42
|
+
private _isDisposed;
|
|
43
|
+
constructor(options: HomeFolderDriveOptions);
|
|
44
|
+
get fileChanged(): ISignal<Contents.IDrive, Contents.IChangedArgs>;
|
|
45
|
+
get isDisposed(): boolean;
|
|
46
|
+
dispose(): void;
|
|
47
|
+
get(localPath: string, options?: Contents.IFetchOptions): Promise<Contents.IModel>;
|
|
48
|
+
getDownloadUrl(localPath: string): Promise<string>;
|
|
49
|
+
newUntitled(options?: Contents.ICreateOptions): Promise<Contents.IModel>;
|
|
50
|
+
delete(localPath: string): Promise<void>;
|
|
51
|
+
rename(oldLocalPath: string, newLocalPath: string): Promise<Contents.IModel>;
|
|
52
|
+
/**
|
|
53
|
+
* Upload, through the same transfer the CLI and the objects view use.
|
|
54
|
+
*
|
|
55
|
+
* A file is chunked by the browser — Jupyter's protocol numbers the chunks
|
|
56
|
+
* and marks the last one `-1` — and whole by the transfer contract, so the
|
|
57
|
+
* chunks are gathered and sent when the last one arrives. One idempotency
|
|
58
|
+
* key per file and size, so the retry of an interrupted upload resumes the
|
|
59
|
+
* transfer it started rather than opening a second.
|
|
60
|
+
*/
|
|
61
|
+
save(localPath: string, model?: Partial<Contents.IModel>): Promise<Contents.IModel>;
|
|
62
|
+
copy(localPath: string, toLocalDir: string): Promise<Contents.IModel>;
|
|
63
|
+
/** Every version the catalog keeps is a checkpoint already; nothing to create. */
|
|
64
|
+
createCheckpoint(localPath: string): Promise<Contents.ICheckpointModel>;
|
|
65
|
+
listCheckpoints(): Promise<Contents.ICheckpointModel[]>;
|
|
66
|
+
restoreCheckpoint(): Promise<void>;
|
|
67
|
+
deleteCheckpoint(): Promise<void>;
|
|
68
|
+
private _directory;
|
|
69
|
+
private _bytes;
|
|
70
|
+
}
|
|
71
|
+
export default HomeFolderDrive;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
import { Signal } from '@lumino/signaling';
|
|
6
|
+
import { deleteHomeFolderObject, listHomeFolderFiles, readHomeFolderFile, statHomeFolderObject, uploadHomeFolderFile, } from '../../api/contents/index.js';
|
|
7
|
+
import { API_BASE_PATHS } from '../../api/constants.js';
|
|
8
|
+
/**
|
|
9
|
+
* A folder that has never been written to has no timestamp: it is created the
|
|
10
|
+
* first time a sandbox mounts it. Jupyter's model wants a date, and an
|
|
11
|
+
* unparseable one throws where it is rendered.
|
|
12
|
+
*/
|
|
13
|
+
const EPOCH = new Date(0).toISOString();
|
|
14
|
+
const TEXT_EXTENSIONS = new Set([
|
|
15
|
+
'txt', 'md', 'py', 'js', 'ts', 'tsx', 'jsx', 'json', 'csv', 'tsv', 'yaml', 'yml',
|
|
16
|
+
'toml', 'html', 'css', 'xml', 'sh', 'sql', 'r', 'jl', 'rst', 'cfg', 'ini', 'log',
|
|
17
|
+
]);
|
|
18
|
+
const extension = (path) => (path.split('/').pop() ?? '').split('.').pop()?.toLowerCase() ?? '';
|
|
19
|
+
const basename = (path) => path.split('/').filter(Boolean).pop() ?? '';
|
|
20
|
+
const dirname = (path) => {
|
|
21
|
+
const parts = path.split('/').filter(Boolean);
|
|
22
|
+
parts.pop();
|
|
23
|
+
return parts.join('/');
|
|
24
|
+
};
|
|
25
|
+
const decodeBase64 = (value) => {
|
|
26
|
+
const binary = atob(value);
|
|
27
|
+
const bytes = new Uint8Array(binary.length);
|
|
28
|
+
for (let index = 0; index < binary.length; index += 1) {
|
|
29
|
+
bytes[index] = binary.charCodeAt(index);
|
|
30
|
+
}
|
|
31
|
+
return bytes;
|
|
32
|
+
};
|
|
33
|
+
const encodeBase64 = (bytes) => {
|
|
34
|
+
let binary = '';
|
|
35
|
+
for (let index = 0; index < bytes.byteLength; index += 1) {
|
|
36
|
+
binary += String.fromCharCode(bytes[index]);
|
|
37
|
+
}
|
|
38
|
+
return btoa(binary);
|
|
39
|
+
};
|
|
40
|
+
const joinChunks = (chunks) => {
|
|
41
|
+
const total = chunks.reduce((size, chunk) => size + chunk.byteLength, 0);
|
|
42
|
+
const joined = new Uint8Array(total);
|
|
43
|
+
let offset = 0;
|
|
44
|
+
for (const chunk of chunks) {
|
|
45
|
+
joined.set(chunk, offset);
|
|
46
|
+
offset += chunk.byteLength;
|
|
47
|
+
}
|
|
48
|
+
return joined;
|
|
49
|
+
};
|
|
50
|
+
const fileModel = (entry) => ({
|
|
51
|
+
name: entry.name,
|
|
52
|
+
path: entry.path,
|
|
53
|
+
type: entry.isDirectory ? 'directory' : extension(entry.path) === 'ipynb' ? 'notebook' : 'file',
|
|
54
|
+
writable: true,
|
|
55
|
+
created: entry.modifiedAt || EPOCH,
|
|
56
|
+
last_modified: entry.modifiedAt || EPOCH,
|
|
57
|
+
mimetype: '',
|
|
58
|
+
content: null,
|
|
59
|
+
format: null,
|
|
60
|
+
size: entry.size,
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* The Home Folders, as one JupyterLab drive.
|
|
64
|
+
*
|
|
65
|
+
* Reads come from the shared filesystem — what a sandbox wrote as well as what
|
|
66
|
+
* was uploaded. Writes go through the transfer contract: a file the browser
|
|
67
|
+
* hands over in chunks is gathered and sent whole, created, its parts
|
|
68
|
+
* checksummed, then completed; an interrupted upload resumes from the parts
|
|
69
|
+
* the service verified. Checkpoints are the immutable versions the catalog
|
|
70
|
+
* keeps of every object, so there is nothing to create here.
|
|
71
|
+
*/
|
|
72
|
+
export class HomeFolderDrive {
|
|
73
|
+
name;
|
|
74
|
+
serverSettings;
|
|
75
|
+
_token;
|
|
76
|
+
_base;
|
|
77
|
+
_fileChanged = new Signal(this);
|
|
78
|
+
_pending = new Map();
|
|
79
|
+
_isDisposed = false;
|
|
80
|
+
constructor(options) {
|
|
81
|
+
this.name = options.name ?? 'home-folder';
|
|
82
|
+
this._token = options.token;
|
|
83
|
+
this._base = String(options.contentsUrl).replace(/\/$/, '');
|
|
84
|
+
// The browser reads `appUrl` in one error message and nothing else; the
|
|
85
|
+
// requests themselves carry the token explicitly.
|
|
86
|
+
this.serverSettings = {
|
|
87
|
+
baseUrl: this._base,
|
|
88
|
+
appUrl: `${this._base}${API_BASE_PATHS.CONTENTS}/sources/home-folder/`,
|
|
89
|
+
wsUrl: '',
|
|
90
|
+
token: '',
|
|
91
|
+
appendToken: false,
|
|
92
|
+
init: {},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
get fileChanged() {
|
|
96
|
+
return this._fileChanged;
|
|
97
|
+
}
|
|
98
|
+
get isDisposed() {
|
|
99
|
+
return this._isDisposed;
|
|
100
|
+
}
|
|
101
|
+
dispose() {
|
|
102
|
+
if (this._isDisposed) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this._isDisposed = true;
|
|
106
|
+
Signal.clearData(this);
|
|
107
|
+
}
|
|
108
|
+
async get(localPath, options) {
|
|
109
|
+
const path = localPath.replace(/^\/+/, '');
|
|
110
|
+
if (path === '') {
|
|
111
|
+
return this._directory('');
|
|
112
|
+
}
|
|
113
|
+
// A folder answers the listing; a file does not, and is found in its parent.
|
|
114
|
+
try {
|
|
115
|
+
return await this._directory(path);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// Not a folder: fall through.
|
|
119
|
+
}
|
|
120
|
+
const parent = await listHomeFolderFiles(this._token, dirname(path), this._base);
|
|
121
|
+
const entry = parent.items.find(item => basename(item.path) === basename(path));
|
|
122
|
+
if (!entry || entry.isDirectory) {
|
|
123
|
+
throw new Error(`No file at ${path} in the Home Folder`);
|
|
124
|
+
}
|
|
125
|
+
const model = fileModel(entry);
|
|
126
|
+
if (options?.content === false) {
|
|
127
|
+
return model;
|
|
128
|
+
}
|
|
129
|
+
const { body } = await readHomeFolderFile(this._token, path, {}, this._base);
|
|
130
|
+
const bytes = new Uint8Array(body);
|
|
131
|
+
if (model.type === 'notebook') {
|
|
132
|
+
return { ...model, content: JSON.parse(new TextDecoder().decode(bytes)), format: 'json', mimetype: 'application/x-ipynb+json' };
|
|
133
|
+
}
|
|
134
|
+
if (options?.format === 'base64' || !TEXT_EXTENSIONS.has(extension(path))) {
|
|
135
|
+
return { ...model, content: encodeBase64(bytes), format: 'base64', mimetype: 'application/octet-stream' };
|
|
136
|
+
}
|
|
137
|
+
return { ...model, content: new TextDecoder().decode(bytes), format: 'text', mimetype: 'text/plain' };
|
|
138
|
+
}
|
|
139
|
+
getDownloadUrl(localPath) {
|
|
140
|
+
return Promise.resolve(`${this._base}${API_BASE_PATHS.CONTENTS}/sources/home-folder/files/content?path=${encodeURIComponent(localPath.replace(/^\/+/, ''))}`);
|
|
141
|
+
}
|
|
142
|
+
async newUntitled(options = {}) {
|
|
143
|
+
const type = options.type ?? 'file';
|
|
144
|
+
if (type === 'directory') {
|
|
145
|
+
throw new Error('A folder appears in the Home Folder when a file is saved into it.');
|
|
146
|
+
}
|
|
147
|
+
const parent = (options.path ?? '').replace(/^\/+|\/+$/g, '');
|
|
148
|
+
const name = type === 'notebook' ? 'Untitled.ipynb' : `untitled${options.ext ?? '.txt'}`;
|
|
149
|
+
const path = parent ? `${parent}/${name}` : name;
|
|
150
|
+
const content = type === 'notebook'
|
|
151
|
+
? JSON.stringify({ cells: [], metadata: {}, nbformat: 4, nbformat_minor: 5 })
|
|
152
|
+
: '';
|
|
153
|
+
return this.save(path, { type, format: 'text', content });
|
|
154
|
+
}
|
|
155
|
+
async delete(localPath) {
|
|
156
|
+
const path = localPath.replace(/^\/+/, '');
|
|
157
|
+
const object = await statHomeFolderObject(this._token, path, this._base);
|
|
158
|
+
await deleteHomeFolderObject(this._token, object.uid, this._base);
|
|
159
|
+
this._fileChanged.emit({ type: 'delete', oldValue: { path }, newValue: null });
|
|
160
|
+
}
|
|
161
|
+
async rename(oldLocalPath, newLocalPath) {
|
|
162
|
+
const current = await this.get(oldLocalPath, { content: true, format: 'base64' });
|
|
163
|
+
const moved = await this.save(newLocalPath, { type: current.type, format: current.format, content: current.content });
|
|
164
|
+
await this.delete(oldLocalPath);
|
|
165
|
+
this._fileChanged.emit({ type: 'rename', oldValue: current, newValue: moved });
|
|
166
|
+
return moved;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Upload, through the same transfer the CLI and the objects view use.
|
|
170
|
+
*
|
|
171
|
+
* A file is chunked by the browser — Jupyter's protocol numbers the chunks
|
|
172
|
+
* and marks the last one `-1` — and whole by the transfer contract, so the
|
|
173
|
+
* chunks are gathered and sent when the last one arrives. One idempotency
|
|
174
|
+
* key per file and size, so the retry of an interrupted upload resumes the
|
|
175
|
+
* transfer it started rather than opening a second.
|
|
176
|
+
*/
|
|
177
|
+
async save(localPath, model = {}) {
|
|
178
|
+
const path = localPath.replace(/^\/+/, '');
|
|
179
|
+
if (model.type === 'directory') {
|
|
180
|
+
throw new Error('A folder appears in the Home Folder when a file is saved into it.');
|
|
181
|
+
}
|
|
182
|
+
const bytes = this._bytes(model);
|
|
183
|
+
const chunk = model.chunk;
|
|
184
|
+
if (chunk !== undefined && chunk !== -1) {
|
|
185
|
+
this._pending.set(path, [...(this._pending.get(path) ?? []), bytes]);
|
|
186
|
+
return { ...fileModel({ name: basename(path), path, isDirectory: false, size: 0, modifiedAt: null }), chunk };
|
|
187
|
+
}
|
|
188
|
+
const content = joinChunks([...(this._pending.get(path) ?? []), bytes]);
|
|
189
|
+
this._pending.delete(path);
|
|
190
|
+
const transfer = await uploadHomeFolderFile(this._token, path, content, {
|
|
191
|
+
idempotencyKey: `home-folder-drive:${path}:${content.byteLength}`,
|
|
192
|
+
mediaType: model.mimetype || 'application/octet-stream',
|
|
193
|
+
overwrite: 'new-version',
|
|
194
|
+
}, this._base);
|
|
195
|
+
const saved = fileModel({
|
|
196
|
+
name: basename(path),
|
|
197
|
+
path,
|
|
198
|
+
isDirectory: false,
|
|
199
|
+
size: transfer.expectedSize ?? content.byteLength,
|
|
200
|
+
modifiedAt: transfer.completedAt ?? null,
|
|
201
|
+
});
|
|
202
|
+
this._fileChanged.emit({ type: 'save', oldValue: null, newValue: saved });
|
|
203
|
+
return saved;
|
|
204
|
+
}
|
|
205
|
+
async copy(localPath, toLocalDir) {
|
|
206
|
+
const current = await this.get(localPath, { content: true, format: 'base64' });
|
|
207
|
+
const target = `${toLocalDir.replace(/^\/+|\/+$/g, '')}/${basename(localPath)}`.replace(/^\//, '');
|
|
208
|
+
return this.save(target, { type: current.type, format: current.format, content: current.content });
|
|
209
|
+
}
|
|
210
|
+
/** Every version the catalog keeps is a checkpoint already; nothing to create. */
|
|
211
|
+
createCheckpoint(localPath) {
|
|
212
|
+
return Promise.resolve({ id: `latest:${localPath}`, last_modified: new Date().toISOString() });
|
|
213
|
+
}
|
|
214
|
+
listCheckpoints() {
|
|
215
|
+
return Promise.resolve([]);
|
|
216
|
+
}
|
|
217
|
+
restoreCheckpoint() {
|
|
218
|
+
return Promise.resolve();
|
|
219
|
+
}
|
|
220
|
+
deleteCheckpoint() {
|
|
221
|
+
return Promise.resolve();
|
|
222
|
+
}
|
|
223
|
+
async _directory(path) {
|
|
224
|
+
const listing = await listHomeFolderFiles(this._token, path, this._base);
|
|
225
|
+
return {
|
|
226
|
+
name: basename(path),
|
|
227
|
+
path,
|
|
228
|
+
type: 'directory',
|
|
229
|
+
writable: true,
|
|
230
|
+
created: EPOCH,
|
|
231
|
+
last_modified: EPOCH,
|
|
232
|
+
mimetype: '',
|
|
233
|
+
content: listing.items.map(fileModel),
|
|
234
|
+
format: 'json',
|
|
235
|
+
size: undefined,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
_bytes(model) {
|
|
239
|
+
if (model.content === null || model.content === undefined) {
|
|
240
|
+
return new Uint8Array(0);
|
|
241
|
+
}
|
|
242
|
+
if (typeof model.content !== 'string') {
|
|
243
|
+
return new TextEncoder().encode(JSON.stringify(model.content, null, 1));
|
|
244
|
+
}
|
|
245
|
+
return model.format === 'base64' ? decodeBase64(model.content) : new TextEncoder().encode(model.content);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
export default HomeFolderDrive;
|
|
@@ -29,5 +29,5 @@ type Props = {
|
|
|
29
29
|
student?: IStudent;
|
|
30
30
|
studentItem?: IStudentItemStatusData;
|
|
31
31
|
};
|
|
32
|
-
export declare const StudentItemStatus: (props: Props) => import("react
|
|
32
|
+
export declare const StudentItemStatus: (props: Props) => import("react").JSX.Element;
|
|
33
33
|
export default StudentItemStatus;
|
|
@@ -17,5 +17,5 @@ type Props = {
|
|
|
17
17
|
* the meaning of the green (success) / red (failure) / empty (no result yet)
|
|
18
18
|
* status is discoverable on hover and focus.
|
|
19
19
|
*/
|
|
20
|
-
export declare const StudentResultCircle: (props: Props) => import("react
|
|
20
|
+
export declare const StudentResultCircle: (props: Props) => import("react").JSX.Element;
|
|
21
21
|
export default StudentResultCircle;
|
|
@@ -9,7 +9,7 @@ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/compone
|
|
|
9
9
|
export declare const SubNavSubMenuVariants: readonly ["dropdown", "anchor"];
|
|
10
10
|
type SubMenuVariants = (typeof SubNavSubMenuVariants)[number];
|
|
11
11
|
type SubNavContextType = {
|
|
12
|
-
portalRef: RefObject<HTMLDivElement>;
|
|
12
|
+
portalRef: RefObject<HTMLDivElement | null>;
|
|
13
13
|
};
|
|
14
14
|
export declare const useSubNavContext: () => SubNavContextType;
|
|
15
15
|
export type SubNavProps = {
|
|
@@ -34,7 +34,7 @@ type SubNavLinkProps = {
|
|
|
34
34
|
type SubMenuProps = {
|
|
35
35
|
variant?: SubMenuVariants;
|
|
36
36
|
} & React.HTMLAttributes<HTMLUListElement> & BaseProps<HTMLUListElement>;
|
|
37
|
-
declare function SubMenu({ children, className, variant, ...props }: SubMenuProps):
|
|
37
|
+
declare function SubMenu({ children, className, variant, ...props }: SubMenuProps): React.JSX.Element;
|
|
38
38
|
type SubNavActionProps = {
|
|
39
39
|
/**
|
|
40
40
|
* Required path or location for the action button to link to.
|
|
@@ -49,7 +49,7 @@ type SubNavActionProps = {
|
|
|
49
49
|
*/
|
|
50
50
|
variant?: (typeof ButtonVariants)[number];
|
|
51
51
|
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>;
|
|
52
|
-
declare function _SubNavAction({ children, href, variant, size, ...rest }: SubNavActionProps):
|
|
52
|
+
declare function _SubNavAction({ children, href, variant, size, ...rest }: SubNavActionProps): React.JSX.Element;
|
|
53
53
|
/**
|
|
54
54
|
* Use SubNav to display a secondary navigation beneath a primary header.
|
|
55
55
|
* @see https://primer.style/brand/components/SubNav
|
|
@@ -65,9 +65,9 @@ export declare const SubNav: React.NamedExoticComponent<{
|
|
|
65
65
|
} & BaseProps<HTMLElement> & {
|
|
66
66
|
children?: ReactNode | undefined;
|
|
67
67
|
}> & {
|
|
68
|
-
readonly type: ({ id, children, className, "data-testid": testId, fullWidth, hasShadow, }: SubNavProps) =>
|
|
68
|
+
readonly type: ({ id, children, className, "data-testid": testId, fullWidth, hasShadow, }: SubNavProps) => React.JSX.Element;
|
|
69
69
|
} & {
|
|
70
|
-
Heading: ({ href, children, className, "data-testid": testID, ...props }: SubNavHeadingProps) =>
|
|
70
|
+
Heading: ({ href, children, className, "data-testid": testID, ...props }: SubNavHeadingProps) => React.JSX.Element;
|
|
71
71
|
Link: React.ForwardRefExoticComponent<Omit<SubNavLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement | HTMLDivElement>>;
|
|
72
72
|
Action: typeof _SubNavAction;
|
|
73
73
|
SubMenu: typeof SubMenu;
|
|
@@ -106,7 +106,8 @@ const _SubNavRoot = memo(({ id, children, className, 'data-testid': testId, full
|
|
|
106
106
|
useEffect(() => {
|
|
107
107
|
// check if there is an anchored nav in the SubNav.SubMenu child
|
|
108
108
|
const hasAnchorVariant = childrenArr.some(child => {
|
|
109
|
-
if (isValidElement(child) &&
|
|
109
|
+
if (isValidElement(child) &&
|
|
110
|
+
child.type === SubNavLink) {
|
|
110
111
|
const [, subMenu] = child.props.children;
|
|
111
112
|
if (subMenu?.props?.variant === 'anchor') {
|
|
112
113
|
return true;
|
|
@@ -144,12 +145,15 @@ const _SubNavRoot = memo(({ id, children, className, 'data-testid': testId, full
|
|
|
144
145
|
}
|
|
145
146
|
return acc;
|
|
146
147
|
}, { heading: undefined, links: [], action: undefined });
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
const activeLinkChildren = activeLink?.props.children;
|
|
149
|
+
const activeLinklabel = typeof activeLinkChildren === 'string'
|
|
150
|
+
? activeLinkChildren
|
|
151
|
+
: activeLinkChildren?.[0];
|
|
150
152
|
// needed to prevent rendering of anchor subnav inside the narrow <Button variant="invisible"> element
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
+
const activeLinkSubMenu = typeof activeLinkChildren === 'string'
|
|
154
|
+
? undefined
|
|
155
|
+
: activeLinkChildren?.[1];
|
|
156
|
+
const MaybeSubNav = activeLinkSubMenu?.props?.variant === 'anchor' && activeLinkSubMenu;
|
|
153
157
|
return (_jsx("div", { className: clsx(styles['SubNav__container'], hasAnchoredNav && styles['SubNav__container--with-anchor-nav']), children: _jsx(SubNavProvider, { children: _jsx("nav", { ref: navRef, id: id, className: clsx(styles.SubNav, isOpenAtNarrow && styles['SubNav--open'], hasShadow && styles['SubNav--has-shadow'], fullWidth && styles['SubNav--full-width'], className), "data-testid": testId || testIds.root, children: _jsxs("div", { ref: rootRef, className: styles['SubNav--header-container-outer'], children: [_jsxs("div", { className: styles['SubNav__header-container'], children: [HeadingChild && (_jsx("div", { className: styles['SubNav__heading-container'], children: HeadingChild })), !isLarge && (_jsxs("button", { className: clsx(styles['SubNav__overlay-toggle'], isOpenAtNarrow && styles['SubNav__overlay-toggle--open']), "data-testid": testIds.button, onClick: isOpenAtNarrow ? closeMenuCallback : handleMenuToggle, "aria-expanded": isOpenAtNarrow ? 'true' : 'false', "aria-controls": idForLinkContainer, children: [activeLinklabel && (_jsxs("span", { className: "visually-hidden", children: ["Navigation menu. Current page:", ' '] })), _jsxs("span", { className: clsx(styles['SubNav__overlay-toggle-content'], !activeLinklabel &&
|
|
154
158
|
styles['SubNav__overlay-toggle-content--end']), children: [activeLinklabel && (_jsx(Text, { as: "span", size: "200", children: activeLinklabel })), isOpenAtNarrow ? (_jsx(ChevronUpIcon, { className: styles['SubNav__overlay-toggle-icon'], size: 24 })) : (_jsx(ChevronDownIcon, { className: styles['SubNav__overlay-toggle-icon'], size: 24 }))] })] })), MaybeSubNav && MaybeSubNav] }), LinkChildren.length && (_jsxs("ul", { ref: overlayRef, id: idForLinkContainer, className: clsx(styles['SubNav__links-overlay'], isOpenAtNarrow && styles['SubNav__links-overlay--open']), "data-testid": testIds.overlay, children: [ActionChild ? (_jsx("li", { className: styles['SubNav__action-container'], children: ActionChild })) : (_jsx("li", { className: styles['SubNav__action-container'] })), LinkChildren, _jsx(ButtonGroup, { buttonSize: "small", children: _jsx(Button, { href: "#", onClick: e => {
|
|
155
159
|
window.location.assign('https://datalayer.ai');
|
|
@@ -251,9 +255,7 @@ function SubMenu({ children, className, variant = 'dropdown', ...props }) {
|
|
|
251
255
|
if (isValidElement(child)) {
|
|
252
256
|
return React.cloneElement(child, {
|
|
253
257
|
onClick: e => {
|
|
254
|
-
|
|
255
|
-
child.props.onClick(e);
|
|
256
|
-
}
|
|
258
|
+
child.props.onClick?.(e);
|
|
257
259
|
},
|
|
258
260
|
});
|
|
259
261
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type IDataTableProps = {
|
|
2
2
|
data: Array<any>;
|
|
3
3
|
};
|
|
4
|
-
export declare const DataTable: (props: IDataTableProps) => import("react
|
|
4
|
+
export declare const DataTable: (props: IDataTableProps) => import("react").JSX.Element;
|
|
5
5
|
export default DataTable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseProps } from '@datalayer/primer-addons';
|
|
3
3
|
export type TextRevealAnimationProps = BaseProps<HTMLSpanElement> & Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
4
|
-
children: React.
|
|
4
|
+
children: React.ReactElement | string | number;
|
|
5
5
|
};
|
|
6
|
-
export declare function TextRevealAnimation({ children, ...rest }: TextRevealAnimationProps):
|
|
6
|
+
export declare function TextRevealAnimation({ children, ...rest }: TextRevealAnimationProps): React.JSX.Element | null;
|