@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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every MCP view is given by the application that draws it.
|
|
3
|
+
*
|
|
4
|
+
* Two things a Core view does not decide for itself: the words for a
|
|
5
|
+
* failure, and the addresses to link to. Both belong to the application —
|
|
6
|
+
* the web application says "Sign in to see your agents" and routes at
|
|
7
|
+
* `/audit`, JupyterLab says something else and routes somewhere else — so
|
|
8
|
+
* they arrive as props rather than as a second copy of the same catalog
|
|
9
|
+
* inside Core.
|
|
10
|
+
*
|
|
11
|
+
* The classification itself lives once, in the application, beside its
|
|
12
|
+
* specification: `ui/src/views/mcp/mcpErrorState.ts` and its spec.
|
|
13
|
+
*
|
|
14
|
+
* @module views/mcp/types
|
|
15
|
+
*/
|
|
16
|
+
/** What a failed request actually was, in the reader's terms. */
|
|
17
|
+
export type McpErrorReason = 'unauthenticated' | 'forbidden' | 'not-found' | 'unavailable' | 'unknown';
|
|
18
|
+
export interface McpErrorState {
|
|
19
|
+
reason: McpErrorReason;
|
|
20
|
+
heading: string;
|
|
21
|
+
description: string;
|
|
22
|
+
/** Whether retrying in place could plausibly succeed. */
|
|
23
|
+
retryable: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Describe a failure in terms of what the reader was looking at; `subject`
|
|
27
|
+
* names it as it appears on screen ("Connected agents", "Audit").
|
|
28
|
+
*/
|
|
29
|
+
export type McpErrorStateFn = (error: unknown, subject: string) => McpErrorState;
|
|
30
|
+
/**
|
|
31
|
+
* Where the MCP surfaces live in the application drawing them.
|
|
32
|
+
*
|
|
33
|
+
* A view links onward — a call to its audit row, an agent to its runs — and
|
|
34
|
+
* must not invent the addresses; the application owns its routing.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Where an application puts the surfaces these views link to.
|
|
38
|
+
*
|
|
39
|
+
* Required at every mount, with no defaults. There were defaults, naming the
|
|
40
|
+
* layout the web application had when these views were written — the audit at
|
|
41
|
+
* `/audit`, the runs at `/runs`. The application moved them under `/mcp`, and
|
|
42
|
+
* every view mounted without `routes` went on linking to the old addresses:
|
|
43
|
+
* the page rendered, the links looked right, and clicking one left the tabs
|
|
44
|
+
* or landed on a route that had stopped existing.
|
|
45
|
+
*
|
|
46
|
+
* That was found four separate times by clicking, and fixed four times by
|
|
47
|
+
* eye. A default here is a wrong answer that looks like a right one, so
|
|
48
|
+
* there is none: an application that mounts these says where its own pages
|
|
49
|
+
* are, or it does not compile.
|
|
50
|
+
*/
|
|
51
|
+
export interface McpRoutes {
|
|
52
|
+
/** The dashboard: what the connected clients are doing right now. */
|
|
53
|
+
dashboard: string;
|
|
54
|
+
/** Setup and access: the endpoint and the per-client cards. */
|
|
55
|
+
access: string;
|
|
56
|
+
/** The audit log. */
|
|
57
|
+
audit: string;
|
|
58
|
+
/** The runs list; a task appends `/{uid}`. */
|
|
59
|
+
runs: string;
|
|
60
|
+
/** The observability panes. */
|
|
61
|
+
observability: string;
|
|
62
|
+
/** The connected agents. */
|
|
63
|
+
agents: string;
|
|
64
|
+
/** The effective policy. */
|
|
65
|
+
policies: string;
|
|
66
|
+
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type SecretEditProps = {
|
|
2
|
+
/** The list to return to once the secret is deleted. */
|
|
3
|
+
secretsListRoute?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const SecretEdit: ({ secretsListRoute, }?: SecretEditProps) => import("react").JSX.Element;
|
|
2
6
|
export default SecretEdit;
|
|
@@ -11,7 +11,7 @@ import { EyeIcon, EyeClosedIcon } from '@primer/octicons-react';
|
|
|
11
11
|
import { BoringAvatar } from '../../components/avatars/index.js';
|
|
12
12
|
import { useCache, useNavigate, useToast } from '../../hooks/index.js';
|
|
13
13
|
import { useRunStore } from '../../state/index.js';
|
|
14
|
-
export const SecretEdit = () => {
|
|
14
|
+
export const SecretEdit = ({ secretsListRoute = '/settings/secrets', } = {}) => {
|
|
15
15
|
const { secretId } = useParams();
|
|
16
16
|
const runStore = useRunStore();
|
|
17
17
|
const navigate = useNavigate();
|
|
@@ -120,7 +120,7 @@ export const SecretEdit = () => {
|
|
|
120
120
|
enqueueToast('The secret is successfully deleted.', {
|
|
121
121
|
variant: 'success',
|
|
122
122
|
});
|
|
123
|
-
navigate(
|
|
123
|
+
navigate(secretsListRoute);
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
onSettled: () => {
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type SecretNewProps = {
|
|
2
|
+
/**
|
|
3
|
+
* The list to return to once the secret is created.
|
|
4
|
+
*
|
|
5
|
+
* It was hardcoded to a settings address this view no longer lives at, so a
|
|
6
|
+
* caller that mounted it elsewhere — and passed this prop, which did not
|
|
7
|
+
* exist — landed on a dead URL after every successful save.
|
|
8
|
+
*/
|
|
9
|
+
secretsListRoute?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const SecretNew: ({ secretsListRoute, }?: SecretNewProps) => import("react").JSX.Element;
|
|
2
12
|
export default SecretNew;
|
|
@@ -8,7 +8,7 @@ import { PageHeader, FormControl, Button, TextInput, Textarea, Select, } from '@
|
|
|
8
8
|
import { Box } from '@datalayer/primer-addons';
|
|
9
9
|
import { useCache, useNavigate, useToast } from '../../hooks/index.js';
|
|
10
10
|
import { useRunStore } from '../../state/index.js';
|
|
11
|
-
export const SecretNew = () => {
|
|
11
|
+
export const SecretNew = ({ secretsListRoute = '/settings/secrets', } = {}) => {
|
|
12
12
|
const runStore = useRunStore();
|
|
13
13
|
const navigate = useNavigate();
|
|
14
14
|
const { useCreateSecret } = useCache();
|
|
@@ -81,7 +81,7 @@ export const SecretNew = () => {
|
|
|
81
81
|
onSuccess: (resp) => {
|
|
82
82
|
if (resp.success) {
|
|
83
83
|
enqueueToast(resp.message, { variant: 'success' });
|
|
84
|
-
navigate(
|
|
84
|
+
navigate(secretsListRoute);
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
onSettled: () => {
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type SecretsProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Where the "New Secret" button goes.
|
|
4
|
+
*
|
|
5
|
+
* A prop because the same list is mounted at more than one base: the web
|
|
6
|
+
* application serves it under the settings, a JupyterLab extension under its
|
|
7
|
+
* own route. Hardcoding one of those sent the other somewhere that does not
|
|
8
|
+
* exist.
|
|
9
|
+
*/
|
|
10
|
+
newSecretRoute?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const Secrets: ({ newSecretRoute, }?: SecretsProps) => import("react").JSX.Element;
|
|
2
13
|
export default Secrets;
|
|
@@ -41,8 +41,8 @@ const SecretsTable = () => {
|
|
|
41
41
|
},
|
|
42
42
|
] }) }));
|
|
43
43
|
};
|
|
44
|
-
export const Secrets = () => {
|
|
44
|
+
export const Secrets = ({ newSecretRoute = '/settings/secrets/new', } = {}) => {
|
|
45
45
|
const navigate = useNavigate();
|
|
46
|
-
return (_jsxs(PageLayout, { containerWidth: "full", padding: "normal", style: { overflow: 'visible', minHeight: 'calc(100vh - 45px)' }, children: [_jsx(PageLayout.Header, { children: _jsxs(PageHeader, { children: [_jsx(PageHeader.TitleArea, { variant: "large", children: _jsx(PageHeader.Title, { children: "Secrets" }) }), _jsx(PageHeader.Actions, { children: _jsx(Button, { size: "small", variant: "primary", onClick: e => navigate(
|
|
46
|
+
return (_jsxs(PageLayout, { containerWidth: "full", padding: "normal", style: { overflow: 'visible', minHeight: 'calc(100vh - 45px)' }, children: [_jsx(PageLayout.Header, { children: _jsxs(PageHeader, { children: [_jsx(PageHeader.TitleArea, { variant: "large", children: _jsx(PageHeader.Title, { children: "Secrets" }) }), _jsx(PageHeader.Actions, { children: _jsx(Button, { size: "small", variant: "primary", onClick: e => navigate(newSecretRoute, e), children: "New secret" }) })] }) }), _jsx(PageLayout.Content, { children: _jsx(Box, { children: _jsx(SecretsTable, {}) }) })] }));
|
|
47
47
|
};
|
|
48
48
|
export default Secrets;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalayer/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.66",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
".",
|
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
"build:lib": "npm run clean:lib && gulp resources-to-lib && tsc -b && node scripts/fix-esm-imports.cjs",
|
|
56
56
|
"build:cli-login": "vite build --config vite.cli-login.config.ts",
|
|
57
57
|
"build:types": "npm run clean:lib && tsc -b",
|
|
58
|
+
"generate:contents": "python scripts/generate-contents-types.py",
|
|
59
|
+
"check:contents-generated": "python scripts/generate-contents-types.py --check",
|
|
60
|
+
"generate:mcp": "python scripts/generate-mcp-types.py",
|
|
61
|
+
"check:mcp-generated": "python scripts/generate-mcp-types.py --check",
|
|
58
62
|
"build:nextjs": "npm run build --workspace=nextjj-example",
|
|
59
63
|
"build:examples": "npm run build:nextjs",
|
|
60
64
|
"build:all": "npm run build && npm run build:examples",
|
|
@@ -135,8 +139,8 @@
|
|
|
135
139
|
"@primer/primitives": "^10.7.0",
|
|
136
140
|
"@primer/react": "^37.31.0",
|
|
137
141
|
"@primer/react-brand": "^0.58.0",
|
|
138
|
-
"@stripe/react-stripe-js": "
|
|
139
|
-
"@stripe/stripe-js": "
|
|
142
|
+
"@stripe/react-stripe-js": "6.8.2",
|
|
143
|
+
"@stripe/stripe-js": "9.15.0",
|
|
140
144
|
"@styled-system/css": "^5.1.5",
|
|
141
145
|
"@tailwindcss/vite": "^4.1.13",
|
|
142
146
|
"@tanstack/react-query": "^5.90.6",
|
|
@@ -155,10 +159,10 @@
|
|
|
155
159
|
"lucide-react": "^0.542.0",
|
|
156
160
|
"marked": "^4.0.10",
|
|
157
161
|
"mock-socket": "^9.3.1",
|
|
158
|
-
"react": "
|
|
162
|
+
"react": "19.2.8",
|
|
159
163
|
"react-confetti": "^6.4.0",
|
|
160
|
-
"react-dom": "
|
|
161
|
-
"react-is": "
|
|
164
|
+
"react-dom": "19.2.8",
|
|
165
|
+
"react-is": "19.2.8",
|
|
162
166
|
"react-toastify": "^11.0.5",
|
|
163
167
|
"streamdown": "^1.6.6",
|
|
164
168
|
"styled-system": "^5.1.5",
|
|
@@ -169,7 +173,7 @@
|
|
|
169
173
|
"tw-animate-css": "^1.4.0",
|
|
170
174
|
"ulid": "^2.3.0",
|
|
171
175
|
"unique-names-generator": "^4.7.1",
|
|
172
|
-
"usehooks-ts": "
|
|
176
|
+
"usehooks-ts": "3.1.1",
|
|
173
177
|
"uuid": "^13.0.0",
|
|
174
178
|
"validator": "^13.7.0",
|
|
175
179
|
"zod": "^4.1.13",
|
|
@@ -186,7 +190,7 @@
|
|
|
186
190
|
},
|
|
187
191
|
"devDependencies": {
|
|
188
192
|
"@chromatic-com/storybook": "^4.1.0",
|
|
189
|
-
"@eslint/js": "^
|
|
193
|
+
"@eslint/js": "^10.0.1",
|
|
190
194
|
"@storybook/addon-a11y": "^9.1.1",
|
|
191
195
|
"@storybook/addon-docs": "^9.1.1",
|
|
192
196
|
"@storybook/addon-onboarding": "^9.1.1",
|
|
@@ -195,8 +199,8 @@
|
|
|
195
199
|
"@storybook/react-vite": "^9.1.1",
|
|
196
200
|
"@tailwindcss/postcss": "^4.1.16",
|
|
197
201
|
"@types/node": "^20.11.0",
|
|
198
|
-
"@types/react": "
|
|
199
|
-
"@types/react-dom": "
|
|
202
|
+
"@types/react": "19.2.18",
|
|
203
|
+
"@types/react-dom": "19.2.5",
|
|
200
204
|
"@vitejs/plugin-react": "^4.5.2",
|
|
201
205
|
"@vitest/browser": "^3.2.4",
|
|
202
206
|
"@vitest/coverage-v8": "^3.2.4",
|
|
@@ -204,13 +208,13 @@
|
|
|
204
208
|
"autoprefixer": "^10.4.21",
|
|
205
209
|
"crypto-browserify": "^3.12.1",
|
|
206
210
|
"dotenv": "^17.2.2",
|
|
207
|
-
"eslint": "^9.
|
|
211
|
+
"eslint": "^10.9.1",
|
|
208
212
|
"eslint-config-prettier": "^10.1.8",
|
|
209
|
-
"eslint-plugin-prettier": "^5.5.
|
|
213
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
210
214
|
"eslint-plugin-react": "^7.37.5",
|
|
211
|
-
"eslint-plugin-react-hooks": "^
|
|
212
|
-
"eslint-plugin-react-refresh": "^0.
|
|
213
|
-
"eslint-plugin-storybook": "^
|
|
215
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
216
|
+
"eslint-plugin-react-refresh": "^0.5.5",
|
|
217
|
+
"eslint-plugin-storybook": "^10.5.10",
|
|
214
218
|
"globals": "^16.2.0",
|
|
215
219
|
"gulp": "^4.0.2",
|
|
216
220
|
"gulp-append-prepend": "^1.0.8",
|
|
@@ -223,13 +227,13 @@
|
|
|
223
227
|
"patch-package": "^8.0.0",
|
|
224
228
|
"playwright": "^1.53.2",
|
|
225
229
|
"prettier": "^3.6.2",
|
|
226
|
-
"react-router-dom": "
|
|
230
|
+
"react-router-dom": "7.18.3",
|
|
227
231
|
"rimraf": "^6.1.3",
|
|
228
232
|
"storybook": "^9.1.1",
|
|
229
233
|
"typedoc-plugin-markdown": "^4.0.0",
|
|
230
|
-
"typescript": "
|
|
234
|
+
"typescript": "5.9.3",
|
|
231
235
|
"typescript-eslint": "^8.34.1",
|
|
232
|
-
"vite": "
|
|
236
|
+
"vite": "7.3.6",
|
|
233
237
|
"vite-plugin-treat-umd-as-commonjs": "^0.1.4",
|
|
234
238
|
"vitest": "^3.2.4"
|
|
235
239
|
},
|
|
@@ -241,12 +245,12 @@
|
|
|
241
245
|
"@microsoft/fast-react-wrapper": "0.3.24",
|
|
242
246
|
"@microsoft/fast-web-utilities": "5.4.1",
|
|
243
247
|
"@microsoft/load-themed-styles": "1.10.295",
|
|
244
|
-
"@types/react": "
|
|
245
|
-
"@types/react-dom": "
|
|
246
|
-
"pyodide": "0.
|
|
247
|
-
"react": "
|
|
248
|
-
"react-dom": "
|
|
249
|
-
"typescript": "
|
|
248
|
+
"@types/react": "19.2.18",
|
|
249
|
+
"@types/react-dom": "19.2.5",
|
|
250
|
+
"pyodide": "0.29.4",
|
|
251
|
+
"react": "19.2.8",
|
|
252
|
+
"react-dom": "19.2.8",
|
|
253
|
+
"typescript": "5.9.3"
|
|
250
254
|
},
|
|
251
255
|
"lint-staged": {
|
|
252
256
|
"src/**/*.{js,jsx,ts,tsx}": [
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
# Distributed under the terms of the Modified BSD License.
|
|
4
|
+
|
|
5
|
+
"""Generate deterministic TypeScript wire types from Contents OpenAPI."""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import json
|
|
10
|
+
import os
|
|
11
|
+
import subprocess
|
|
12
|
+
import sys
|
|
13
|
+
import tempfile
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
ROOT = Path(__file__).parents[1]
|
|
18
|
+
DEFAULT_OPENAPI = (
|
|
19
|
+
ROOT.parents[2]
|
|
20
|
+
/ "k8s/services/contents/datalayer_contents/contracts/v1/openapi.json"
|
|
21
|
+
)
|
|
22
|
+
OPENAPI = Path(os.environ.get("DATALAYER_CONTENTS_OPENAPI", DEFAULT_OPENAPI))
|
|
23
|
+
DEFAULT_CONTRACT_FIXTURES = (
|
|
24
|
+
ROOT.parents[2] / "k8s/services/contents/tests/fixtures/v1-contracts.json"
|
|
25
|
+
)
|
|
26
|
+
DEFAULT_SOLR_CODEC_FIXTURE = (
|
|
27
|
+
ROOT.parents[2]
|
|
28
|
+
/ "k8s/services/common/datalayer_common/tests/fixtures/solr_codec.json"
|
|
29
|
+
)
|
|
30
|
+
CONTRACT_FIXTURES = Path(
|
|
31
|
+
os.environ.get("DATALAYER_CONTENTS_CONTRACT_FIXTURES", DEFAULT_CONTRACT_FIXTURES)
|
|
32
|
+
)
|
|
33
|
+
SOLR_CODEC_FIXTURE = Path(
|
|
34
|
+
os.environ.get("DATALAYER_SOLR_CODEC_FIXTURE", DEFAULT_SOLR_CODEC_FIXTURE)
|
|
35
|
+
)
|
|
36
|
+
OUTPUT = ROOT / "src/api/contents/generated.ts"
|
|
37
|
+
PYTHON_OUTPUT = ROOT / "datalayer_core/models/contents/generated.py"
|
|
38
|
+
CLIENT_CONTRACT_FIXTURES = ROOT / "src/models/contents/__fixtures__/v1-contracts.json"
|
|
39
|
+
CLIENT_SOLR_CODEC_FIXTURE = ROOT / "src/models/contents/__fixtures__/solr-codec.json"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def type_name(reference: str) -> str:
|
|
43
|
+
return reference.rsplit("/", 1)[-1]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def ts_type(schema: dict[str, Any]) -> str:
|
|
47
|
+
if "$ref" in schema:
|
|
48
|
+
return type_name(schema["$ref"])
|
|
49
|
+
if "const" in schema:
|
|
50
|
+
return json.dumps(schema["const"])
|
|
51
|
+
if "enum" in schema:
|
|
52
|
+
return " | ".join(json.dumps(value) for value in schema["enum"])
|
|
53
|
+
if "oneOf" in schema:
|
|
54
|
+
return " | ".join(ts_type(item) for item in schema["oneOf"])
|
|
55
|
+
if "anyOf" in schema:
|
|
56
|
+
return " | ".join(ts_type(item) for item in schema["anyOf"])
|
|
57
|
+
kind = schema.get("type")
|
|
58
|
+
if isinstance(kind, list):
|
|
59
|
+
return " | ".join(
|
|
60
|
+
"null" if item == "null" else ts_type({"type": item}) for item in kind
|
|
61
|
+
)
|
|
62
|
+
if kind == "array":
|
|
63
|
+
return f"Array<{ts_type(schema.get('items', {}))}>"
|
|
64
|
+
if kind == "object":
|
|
65
|
+
additional = schema.get("additionalProperties")
|
|
66
|
+
return (
|
|
67
|
+
f"Record<string, {ts_type(additional)}>"
|
|
68
|
+
if isinstance(additional, dict)
|
|
69
|
+
else "Record<string, unknown>"
|
|
70
|
+
)
|
|
71
|
+
if kind in {"integer", "number"}:
|
|
72
|
+
return "number"
|
|
73
|
+
if kind == "boolean":
|
|
74
|
+
return "boolean"
|
|
75
|
+
if kind == "null":
|
|
76
|
+
return "null"
|
|
77
|
+
if kind == "string":
|
|
78
|
+
return "string"
|
|
79
|
+
return "unknown"
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def camel(name: str) -> str:
|
|
83
|
+
parts = name.split("_")
|
|
84
|
+
return parts[0] + "".join(part[:1].upper() + part[1:] for part in parts[1:])
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def generate() -> str:
|
|
88
|
+
document = json.loads(OPENAPI.read_text())
|
|
89
|
+
schemas = document["components"]["schemas"]
|
|
90
|
+
lines = [
|
|
91
|
+
"/* This file is generated from Datalayer Contents OpenAPI. Do not edit. */",
|
|
92
|
+
"",
|
|
93
|
+
]
|
|
94
|
+
for name, schema in schemas.items():
|
|
95
|
+
if schema.get("type") == "object" and "properties" in schema:
|
|
96
|
+
lines.append(f"export interface {name} {{")
|
|
97
|
+
required = set(schema.get("required", []))
|
|
98
|
+
for property_name, property_schema in schema["properties"].items():
|
|
99
|
+
optional = "" if property_name in required else "?"
|
|
100
|
+
lines.append(
|
|
101
|
+
f" {camel(property_name)}{optional}: {ts_type(property_schema)};"
|
|
102
|
+
)
|
|
103
|
+
lines.extend(["}", ""])
|
|
104
|
+
else:
|
|
105
|
+
lines.extend([f"export type {name} = {ts_type(schema)};", ""])
|
|
106
|
+
return "\n".join(lines)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def main() -> None:
|
|
110
|
+
expected = generate()
|
|
111
|
+
expected_fixtures = CONTRACT_FIXTURES.read_text()
|
|
112
|
+
expected_solr_fixture = SOLR_CODEC_FIXTURE.read_text()
|
|
113
|
+
check = "--check" in sys.argv[1:]
|
|
114
|
+
if check:
|
|
115
|
+
if not OUTPUT.exists() or OUTPUT.read_text() != expected:
|
|
116
|
+
raise SystemExit("Stale generated Contents TypeScript types")
|
|
117
|
+
if (
|
|
118
|
+
not CLIENT_CONTRACT_FIXTURES.exists()
|
|
119
|
+
or CLIENT_CONTRACT_FIXTURES.read_text() != expected_fixtures
|
|
120
|
+
):
|
|
121
|
+
raise SystemExit("Stale generated Contents contract fixtures")
|
|
122
|
+
if (
|
|
123
|
+
not CLIENT_SOLR_CODEC_FIXTURE.exists()
|
|
124
|
+
or CLIENT_SOLR_CODEC_FIXTURE.read_text() != expected_solr_fixture
|
|
125
|
+
):
|
|
126
|
+
raise SystemExit("Stale generated Solr codec fixture")
|
|
127
|
+
else:
|
|
128
|
+
OUTPUT.parent.mkdir(parents=True, exist_ok=True)
|
|
129
|
+
OUTPUT.write_text(expected)
|
|
130
|
+
CLIENT_CONTRACT_FIXTURES.parent.mkdir(parents=True, exist_ok=True)
|
|
131
|
+
CLIENT_CONTRACT_FIXTURES.write_text(expected_fixtures)
|
|
132
|
+
CLIENT_SOLR_CODEC_FIXTURE.write_text(expected_solr_fixture)
|
|
133
|
+
|
|
134
|
+
with tempfile.TemporaryDirectory() as temporary_directory:
|
|
135
|
+
generated_python = (
|
|
136
|
+
Path(temporary_directory) / "generated.py" if check else PYTHON_OUTPUT
|
|
137
|
+
)
|
|
138
|
+
generated_python.parent.mkdir(parents=True, exist_ok=True)
|
|
139
|
+
subprocess.run(
|
|
140
|
+
[
|
|
141
|
+
"datamodel-codegen",
|
|
142
|
+
"--input",
|
|
143
|
+
str(OPENAPI),
|
|
144
|
+
"--input-file-type",
|
|
145
|
+
"openapi",
|
|
146
|
+
"--output",
|
|
147
|
+
str(generated_python),
|
|
148
|
+
"--output-model-type",
|
|
149
|
+
"pydantic_v2.BaseModel",
|
|
150
|
+
"--target-python-version",
|
|
151
|
+
"3.10",
|
|
152
|
+
"--use-standard-collections",
|
|
153
|
+
"--use-union-operator",
|
|
154
|
+
"--disable-timestamp",
|
|
155
|
+
"--enum-field-as-literal",
|
|
156
|
+
"all",
|
|
157
|
+
"--collapse-root-models",
|
|
158
|
+
],
|
|
159
|
+
check=True,
|
|
160
|
+
)
|
|
161
|
+
if check and (
|
|
162
|
+
not PYTHON_OUTPUT.exists()
|
|
163
|
+
or PYTHON_OUTPUT.read_text() != generated_python.read_text()
|
|
164
|
+
):
|
|
165
|
+
raise SystemExit("Stale generated Contents Python types")
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
if __name__ == "__main__":
|
|
169
|
+
main()
|