@object-ui/app-shell 6.2.3 → 7.0.0
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/CHANGELOG.md +948 -0
- package/README.md +292 -0
- package/dist/assistant/assistantBus.d.ts +72 -0
- package/dist/assistant/assistantBus.js +133 -0
- package/dist/chrome/CommandPalette.d.ts +1 -1
- package/dist/chrome/CommandPalette.js +26 -22
- package/dist/chrome/ConditionalAuthWrapper.d.ts +1 -1
- package/dist/chrome/ConsoleToaster.d.ts +1 -1
- package/dist/chrome/ConsoleToaster.js +3 -1
- package/dist/chrome/ErrorBoundary.d.ts +1 -1
- package/dist/chrome/KeyboardShortcutsDialog.d.ts +1 -1
- package/dist/chrome/KeyboardShortcutsDialog.js +16 -5
- package/dist/chrome/LoadingScreen.d.ts +1 -1
- package/dist/chrome/LoadingScreen.js +22 -26
- package/dist/chrome/RouteFader.d.ts +1 -1
- package/dist/chrome/ThemeProvider.d.ts +1 -1
- package/dist/components/ManagedByBadge.d.ts +1 -1
- package/dist/console/AppContent.d.ts +1 -1
- package/dist/console/AppContent.js +170 -37
- package/dist/console/ConsoleShell.d.ts +7 -7
- package/dist/console/ConsoleShell.js +32 -3
- package/dist/console/ai/AiChatPage.d.ts +88 -1
- package/dist/console/ai/AiChatPage.js +743 -66
- package/dist/console/ai/ConversationsSidebar.d.ts +26 -1
- package/dist/console/ai/ConversationsSidebar.js +149 -34
- package/dist/console/ai/LiveCanvas.d.ts +22 -0
- package/dist/console/ai/LiveCanvas.js +78 -0
- package/dist/console/ai/reconcileTurn.d.ts +8 -0
- package/dist/console/ai/reconcileTurn.js +20 -0
- package/dist/console/auth/AuthPageLayout.d.ts +1 -1
- package/dist/console/auth/ForgotPasswordPage.d.ts +1 -1
- package/dist/console/auth/LoginPage.d.ts +1 -1
- package/dist/console/auth/RegisterPage.d.ts +1 -1
- package/dist/console/auth/RegisterPage.js +23 -3
- package/dist/console/cloud-connection/CloudConnectionPanel.d.ts +1 -0
- package/dist/console/cloud-connection/CloudConnectionPanel.js +169 -0
- package/dist/console/home/AppCard.d.ts +1 -1
- package/dist/console/home/AppCard.js +6 -12
- package/dist/console/home/HomeAppsStrip.d.ts +8 -0
- package/dist/console/home/HomeAppsStrip.js +61 -0
- package/dist/console/home/HomeLayout.d.ts +1 -1
- package/dist/console/home/HomeLayout.js +3 -1
- package/dist/console/home/HomePage.d.ts +1 -2
- package/dist/console/home/HomePage.js +149 -21
- package/dist/console/home/HomeRail.d.ts +22 -0
- package/dist/console/home/HomeRail.js +62 -0
- package/dist/console/home/QuickActions.d.ts +1 -1
- package/dist/console/home/QuickActions.js +3 -11
- package/dist/console/home/RecentApps.d.ts +1 -1
- package/dist/console/home/RecentApps.js +2 -2
- package/dist/console/home/StarredApps.d.ts +1 -1
- package/dist/console/home/StarredApps.js +2 -2
- package/dist/console/marketplace/InstalledListWidget.d.ts +1 -0
- package/dist/console/marketplace/InstalledListWidget.js +93 -0
- package/dist/console/marketplace/MarkdownText.d.ts +1 -1
- package/dist/console/marketplace/MarketplaceAccessDenied.d.ts +1 -1
- package/dist/console/marketplace/MarketplaceInstalledPage.d.ts +8 -14
- package/dist/console/marketplace/MarketplaceInstalledPage.js +14 -66
- package/dist/console/marketplace/MarketplacePackagePage.d.ts +1 -1
- package/dist/console/marketplace/MarketplacePackagePage.js +249 -8
- package/dist/console/marketplace/MarketplacePage.d.ts +1 -1
- package/dist/console/marketplace/MarketplacePage.js +60 -3
- package/dist/console/marketplace/PackageIcon.d.ts +1 -1
- package/dist/console/marketplace/PluginDisclosure.d.ts +14 -0
- package/dist/console/marketplace/PluginDisclosure.js +38 -0
- package/dist/console/marketplace/marketplaceApi.d.ts +123 -0
- package/dist/console/marketplace/marketplaceApi.js +254 -1
- package/dist/console/organizations/CreateWorkspaceDialog.d.ts +1 -1
- package/dist/console/organizations/OrganizationsLayout.d.ts +1 -1
- package/dist/console/organizations/OrganizationsPage.d.ts +1 -1
- package/dist/console/organizations/manage/AcceptInvitationPage.d.ts +1 -1
- package/dist/console/organizations/manage/InvitationsPage.d.ts +1 -1
- package/dist/console/organizations/manage/InviteMemberDialog.d.ts +1 -1
- package/dist/console/organizations/manage/MembersPage.d.ts +1 -1
- package/dist/console/organizations/manage/OrganizationLayout.d.ts +1 -1
- package/dist/console/organizations/manage/SettingsPage.d.ts +1 -1
- package/dist/context/CommandPaletteProvider.d.ts +44 -0
- package/dist/context/CommandPaletteProvider.js +71 -0
- package/dist/context/FavoritesProvider.d.ts +1 -1
- package/dist/context/NavigationContext.d.ts +1 -1
- package/dist/context/RecentItemsProvider.d.ts +2 -2
- package/dist/context/UserStateAdapters.d.ts +1 -1
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +1 -0
- package/dist/hooks/index.d.ts +5 -2
- package/dist/hooks/index.js +4 -1
- package/dist/hooks/useActionModal.d.ts +53 -0
- package/dist/hooks/useActionModal.js +111 -0
- package/dist/hooks/useChatConversation.d.ts +107 -4
- package/dist/hooks/useChatConversation.js +253 -25
- package/dist/hooks/useConsoleActionRuntime.d.ts +70 -0
- package/dist/hooks/useConsoleActionRuntime.js +560 -0
- package/dist/hooks/useConversationList.js +61 -3
- package/dist/hooks/useHomeInbox.d.ts +13 -0
- package/dist/hooks/useHomeInbox.js +142 -0
- package/dist/hooks/useNavPins.js +17 -23
- package/dist/hooks/useNavigationSync.d.ts +33 -0
- package/dist/hooks/useNavigationSync.js +98 -12
- package/dist/hooks/useReconcileOnError.d.ts +40 -0
- package/dist/hooks/useReconcileOnError.js +37 -0
- package/dist/hooks/useRecordApprovals.d.ts +18 -19
- package/dist/hooks/useRecordApprovals.js +24 -40
- package/dist/hooks/useResponsiveSidebar.js +14 -5
- package/dist/hooks/useSettleSignal.d.ts +19 -0
- package/dist/hooks/useSettleSignal.js +20 -0
- package/dist/hooks/useTrackRouteAsRecent.js +35 -0
- package/dist/hooks/useUrlOverlay.d.ts +62 -0
- package/dist/hooks/useUrlOverlay.js +88 -0
- package/dist/index.d.ts +16 -7
- package/dist/index.js +12 -4
- package/dist/layout/ActivityFeed.d.ts +1 -1
- package/dist/layout/AppHeader.d.ts +3 -2
- package/dist/layout/AppHeader.js +237 -72
- package/dist/layout/AppSidebar.d.ts +2 -1
- package/dist/layout/AppSidebar.js +26 -46
- package/dist/layout/AppSwitcher.d.ts +2 -1
- package/dist/layout/AppSwitcher.js +9 -5
- package/dist/layout/AuthPageLayout.d.ts +1 -1
- package/dist/layout/ConnectionStatus.d.ts +1 -1
- package/dist/layout/ConnectionStatus.js +9 -6
- package/dist/layout/ConsoleChatbotFab.d.ts +19 -1
- package/dist/layout/ConsoleChatbotFab.js +16 -2
- package/dist/layout/ConsoleFloatingChatbot.d.ts +32 -2
- package/dist/layout/ConsoleFloatingChatbot.js +374 -41
- package/dist/layout/ConsoleLayout.d.ts +1 -1
- package/dist/layout/ConsoleLayout.js +27 -11
- package/dist/layout/ContextSelectors.d.ts +44 -0
- package/dist/layout/ContextSelectors.js +218 -0
- package/dist/layout/InboxPopover.d.ts +6 -1
- package/dist/layout/InboxPopover.js +25 -6
- package/dist/layout/LocaleSwitcher.d.ts +1 -1
- package/dist/layout/LocalizedSidebarTrigger.d.ts +2 -0
- package/dist/layout/LocalizedSidebarTrigger.js +15 -0
- package/dist/layout/MobileViewSwitcherContext.d.ts +1 -1
- package/dist/layout/ModeToggle.d.ts +1 -1
- package/dist/layout/PageHeader.d.ts +1 -1
- package/dist/layout/UnifiedSidebar.d.ts +2 -1
- package/dist/layout/UnifiedSidebar.js +116 -15
- package/dist/observability/index.d.ts +1 -0
- package/dist/observability/index.js +1 -0
- package/dist/observability/settleSignal.d.ts +64 -0
- package/dist/observability/settleSignal.js +131 -0
- package/dist/preview/DraftChangesPanel.d.ts +19 -0
- package/dist/preview/DraftChangesPanel.js +114 -0
- package/dist/preview/DraftPreviewBar.d.ts +8 -0
- package/dist/preview/DraftPreviewBar.js +86 -0
- package/dist/preview/PreviewDraftEmptyState.d.ts +16 -0
- package/dist/preview/PreviewDraftEmptyState.js +47 -0
- package/dist/preview/PreviewModeContext.d.ts +57 -0
- package/dist/preview/PreviewModeContext.js +99 -0
- package/dist/preview/UnpublishedAppBar.d.ts +8 -0
- package/dist/preview/UnpublishedAppBar.js +79 -0
- package/dist/preview/draftStatus.d.ts +20 -0
- package/dist/preview/draftStatus.js +27 -0
- package/dist/preview/usePublishAllDrafts.d.ts +18 -0
- package/dist/preview/usePublishAllDrafts.js +106 -0
- package/dist/providers/AdapterProvider.d.ts +1 -1
- package/dist/providers/AdapterProvider.js +6 -1
- package/dist/providers/ExpressionProvider.d.ts +1 -1
- package/dist/providers/MetadataProvider.d.ts +17 -2
- package/dist/providers/MetadataProvider.js +183 -12
- package/dist/runtime-config.d.ts +46 -2
- package/dist/runtime-config.js +39 -2
- package/dist/services/builtinComponents.js +68 -59
- package/dist/skeletons/SkeletonDashboard.d.ts +1 -1
- package/dist/skeletons/SkeletonDetail.d.ts +1 -1
- package/dist/skeletons/SkeletonGrid.d.ts +1 -1
- package/dist/utils/appRoute.d.ts +21 -0
- package/dist/utils/appRoute.js +25 -0
- package/dist/utils/deriveRelatedLists.d.ts +54 -0
- package/dist/utils/deriveRelatedLists.js +91 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/managedByEmptyState.d.ts +8 -1
- package/dist/utils/managedByEmptyState.js +13 -7
- package/dist/utils/preferLocal.d.ts +18 -0
- package/dist/utils/preferLocal.js +24 -0
- package/dist/views/ActionConfirmDialog.d.ts +1 -1
- package/dist/views/ActionConfirmDialog.js +3 -1
- package/dist/views/ActionParamDialog.d.ts +6 -1
- package/dist/views/ActionParamDialog.js +9 -3
- package/dist/views/ActionResultDialog.d.ts +13 -0
- package/dist/views/ActionResultDialog.js +134 -0
- package/dist/views/ComponentNavView.d.ts +14 -1
- package/dist/views/CreateViewDialog.d.ts +1 -1
- package/dist/views/DashboardConfigPanel.d.ts +28 -0
- package/dist/views/DashboardConfigPanel.js +81 -0
- package/dist/views/DashboardView.d.ts +4 -3
- package/dist/views/DashboardView.js +38 -239
- package/dist/views/FlowRunner.d.ts +59 -0
- package/dist/views/FlowRunner.js +153 -0
- package/dist/views/InterfaceListPage.d.ts +49 -0
- package/dist/views/InterfaceListPage.js +347 -0
- package/dist/views/MetadataInspector.d.ts +2 -2
- package/dist/views/ObjectView.d.ts +1 -1
- package/dist/views/ObjectView.js +209 -532
- package/dist/views/PageView.d.ts +8 -3
- package/dist/views/PageView.js +45 -32
- package/dist/views/RecordDetailView.d.ts +1 -1
- package/dist/views/RecordDetailView.js +363 -148
- package/dist/views/RecordFormPage.d.ts +1 -1
- package/dist/views/RecordFormPage.js +26 -1
- package/dist/views/ReportConfigPanel.d.ts +37 -0
- package/dist/views/ReportConfigPanel.js +85 -0
- package/dist/views/ReportView.d.ts +1 -1
- package/dist/views/ReportView.js +116 -7
- package/dist/views/RuntimeDraftBar.d.ts +30 -0
- package/dist/views/RuntimeDraftBar.js +112 -0
- package/dist/views/SearchResultsPage.d.ts +1 -1
- package/dist/views/SearchResultsPage.js +8 -18
- package/dist/views/ViewConfigPanel.d.ts +24 -17
- package/dist/views/ViewConfigPanel.js +121 -77
- package/dist/views/index.d.ts +1 -1
- package/dist/views/index.js +1 -1
- package/dist/views/metadata-admin/AuditPanel.d.ts +28 -0
- package/dist/views/metadata-admin/AuditPanel.js +79 -0
- package/dist/views/metadata-admin/DiagnosticsPage.d.ts +20 -0
- package/dist/views/metadata-admin/DiagnosticsPage.js +69 -0
- package/dist/views/metadata-admin/DirectoryPage.d.ts +16 -1
- package/dist/views/metadata-admin/DirectoryPage.js +113 -24
- package/dist/views/metadata-admin/DraftReviewPanel.d.ts +33 -0
- package/dist/views/metadata-admin/DraftReviewPanel.js +77 -0
- package/dist/views/metadata-admin/EmbeddedItemEditor.d.ts +17 -1
- package/dist/views/metadata-admin/EmbeddedItemEditor.js +15 -8
- package/dist/views/metadata-admin/JsonSourceEditor.d.ts +37 -0
- package/dist/views/metadata-admin/JsonSourceEditor.js +178 -0
- package/dist/views/metadata-admin/LayeredDiff.d.ts +39 -1
- package/dist/views/metadata-admin/LayeredDiff.js +171 -5
- package/dist/views/metadata-admin/MetadataDetailDrawer.d.ts +15 -1
- package/dist/views/metadata-admin/MetadataTypeActions.d.ts +48 -0
- package/dist/views/metadata-admin/MetadataTypeActions.js +165 -0
- package/dist/views/metadata-admin/PackagesPage.d.ts +18 -0
- package/dist/views/metadata-admin/PackagesPage.js +395 -0
- package/dist/views/metadata-admin/PageShell.d.ts +1 -1
- package/dist/views/metadata-admin/PageShell.js +9 -4
- package/dist/views/metadata-admin/PermissionMatrixEditor.d.ts +35 -1
- package/dist/views/metadata-admin/QuickFind.d.ts +21 -1
- package/dist/views/metadata-admin/QuickFind.js +6 -3
- package/dist/views/metadata-admin/RelatedPanel.d.ts +24 -1
- package/dist/views/metadata-admin/RelatedPanel.js +20 -18
- package/dist/views/metadata-admin/ResourceEditPage.d.ts +40 -1
- package/dist/views/metadata-admin/ResourceEditPage.js +1223 -60
- package/dist/views/metadata-admin/ResourceHistoryPage.d.ts +39 -1
- package/dist/views/metadata-admin/ResourceHistoryPage.js +66 -16
- package/dist/views/metadata-admin/ResourceListPage.d.ts +13 -1
- package/dist/views/metadata-admin/ResourceListPage.js +266 -30
- package/dist/views/metadata-admin/ResourceRouter.d.ts +23 -1
- package/dist/views/metadata-admin/SchemaForm.d.ts +34 -1
- package/dist/views/metadata-admin/SchemaForm.js +559 -49
- package/dist/views/metadata-admin/StudioHomePage.d.ts +22 -0
- package/dist/views/metadata-admin/StudioHomePage.js +213 -0
- package/dist/views/metadata-admin/anchors.js +237 -24
- package/dist/views/metadata-admin/clientValidation.d.ts +50 -0
- package/dist/views/metadata-admin/clientValidation.js +169 -0
- package/dist/views/metadata-admin/color-variant-field.d.ts +30 -0
- package/dist/views/metadata-admin/color-variant-field.js +38 -0
- package/dist/views/metadata-admin/createDerive.d.ts +75 -0
- package/dist/views/metadata-admin/createDerive.js +179 -0
- package/dist/views/metadata-admin/dashboard-schema.d.ts +12 -0
- package/dist/views/metadata-admin/dashboard-schema.js +80 -0
- package/dist/views/metadata-admin/datasource/DatasourceResourcePage.d.ts +35 -0
- package/dist/views/metadata-admin/datasource/DatasourceResourcePage.js +327 -0
- package/dist/views/metadata-admin/datasource/register.d.ts +1 -0
- package/dist/views/metadata-admin/datasource/register.js +24 -0
- package/dist/views/metadata-admin/default-inspector-registry.d.ts +49 -0
- package/dist/views/metadata-admin/default-inspector-registry.js +8 -0
- package/dist/views/metadata-admin/default-schemas.js +115 -10
- package/dist/views/metadata-admin/external/ExternalDatasourcePanel.d.ts +27 -0
- package/dist/views/metadata-admin/external/ExternalDatasourcePanel.js +69 -0
- package/dist/views/metadata-admin/external/ImportObjectDialog.d.ts +27 -0
- package/dist/views/metadata-admin/external/ImportObjectDialog.js +77 -0
- package/dist/views/metadata-admin/external/SchemaBrowser.d.ts +16 -0
- package/dist/views/metadata-admin/external/SchemaBrowser.js +74 -0
- package/dist/views/metadata-admin/external/ValidationPanel.d.ts +16 -0
- package/dist/views/metadata-admin/external/ValidationPanel.js +68 -0
- package/dist/views/metadata-admin/external/api.d.ts +100 -0
- package/dist/views/metadata-admin/external/api.js +124 -0
- package/dist/views/metadata-admin/i18n.d.ts +1 -0
- package/dist/views/metadata-admin/i18n.js +1166 -2
- package/dist/views/metadata-admin/index.d.ts +8 -5
- package/dist/views/metadata-admin/index.js +12 -2
- package/dist/views/metadata-admin/inspector-registry.d.ts +51 -0
- package/dist/views/metadata-admin/inspector-registry.js +11 -0
- package/dist/views/metadata-admin/inspectors/ActionDefaultInspector.d.ts +30 -0
- package/dist/views/metadata-admin/inspectors/ActionDefaultInspector.js +180 -0
- package/dist/views/metadata-admin/inspectors/AppNavInspector.d.ts +16 -0
- package/dist/views/metadata-admin/inspectors/AppNavInspector.js +110 -0
- package/dist/views/metadata-admin/inspectors/ConditionBuilder.d.ts +29 -0
- package/dist/views/metadata-admin/inspectors/ConditionBuilder.js +154 -0
- package/dist/views/metadata-admin/inspectors/DashboardDefaultInspector.d.ts +28 -0
- package/dist/views/metadata-admin/inspectors/DashboardDefaultInspector.js +110 -0
- package/dist/views/metadata-admin/inspectors/DashboardWidgetInspector.d.ts +18 -0
- package/dist/views/metadata-admin/inspectors/DashboardWidgetInspector.js +139 -0
- package/dist/views/metadata-admin/inspectors/DatasetDefaultInspector.d.ts +21 -0
- package/dist/views/metadata-admin/inspectors/DatasetDefaultInspector.js +107 -0
- package/dist/views/metadata-admin/inspectors/FlowEdgeInspector.d.ts +16 -0
- package/dist/views/metadata-admin/inspectors/FlowEdgeInspector.js +45 -0
- package/dist/views/metadata-admin/inspectors/FlowInspector.d.ts +12 -0
- package/dist/views/metadata-admin/inspectors/FlowInspector.js +9 -0
- package/dist/views/metadata-admin/inspectors/FlowKeyValueField.d.ts +30 -0
- package/dist/views/metadata-admin/inspectors/FlowKeyValueField.js +125 -0
- package/dist/views/metadata-admin/inspectors/FlowNodeConfigField.d.ts +18 -0
- package/dist/views/metadata-admin/inspectors/FlowNodeConfigField.js +40 -0
- package/dist/views/metadata-admin/inspectors/FlowNodeInspector.d.ts +14 -0
- package/dist/views/metadata-admin/inspectors/FlowNodeInspector.js +140 -0
- package/dist/views/metadata-admin/inspectors/FlowObjectListField.d.ts +26 -0
- package/dist/views/metadata-admin/inspectors/FlowObjectListField.js +105 -0
- package/dist/views/metadata-admin/inspectors/FlowReferenceField.d.ts +83 -0
- package/dist/views/metadata-admin/inspectors/FlowReferenceField.js +181 -0
- package/dist/views/metadata-admin/inspectors/FlowStringListField.d.ts +21 -0
- package/dist/views/metadata-admin/inspectors/FlowStringListField.js +60 -0
- package/dist/views/metadata-admin/inspectors/InspectorComboField.d.ts +40 -0
- package/dist/views/metadata-admin/inspectors/InspectorComboField.js +61 -0
- package/dist/views/metadata-admin/inspectors/ObjectDefaultInspector.d.ts +21 -0
- package/dist/views/metadata-admin/inspectors/ObjectDefaultInspector.js +54 -0
- package/dist/views/metadata-admin/inspectors/ObjectFieldInspector.d.ts +23 -0
- package/dist/views/metadata-admin/inspectors/ObjectFieldInspector.js +330 -0
- package/dist/views/metadata-admin/inspectors/PageBlockInspector.d.ts +48 -0
- package/dist/views/metadata-admin/inspectors/PageBlockInspector.js +332 -0
- package/dist/views/metadata-admin/inspectors/ReportDefaultInspector.d.ts +58 -0
- package/dist/views/metadata-admin/inspectors/ReportDefaultInspector.js +160 -0
- package/dist/views/metadata-admin/inspectors/ViewColumnInspector.d.ts +19 -0
- package/dist/views/metadata-admin/inspectors/ViewColumnInspector.js +144 -0
- package/dist/views/metadata-admin/inspectors/ViewInspector.d.ts +19 -0
- package/dist/views/metadata-admin/inspectors/ViewInspector.js +21 -0
- package/dist/views/metadata-admin/inspectors/ViewVariantInspector.d.ts +54 -0
- package/dist/views/metadata-admin/inspectors/ViewVariantInspector.js +191 -0
- package/dist/views/metadata-admin/inspectors/_shared.d.ts +124 -0
- package/dist/views/metadata-admin/inspectors/_shared.js +113 -0
- package/dist/views/metadata-admin/inspectors/expression-validate.d.ts +26 -0
- package/dist/views/metadata-admin/inspectors/expression-validate.js +66 -0
- package/dist/views/metadata-admin/inspectors/flow-node-config.d.ts +143 -0
- package/dist/views/metadata-admin/inspectors/flow-node-config.js +461 -0
- package/dist/views/metadata-admin/inspectors/index.d.ts +1 -0
- package/dist/views/metadata-admin/inspectors/index.js +45 -0
- package/dist/views/metadata-admin/inspectors/json-schema-to-fields.d.ts +40 -0
- package/dist/views/metadata-admin/inspectors/json-schema-to-fields.js +227 -0
- package/dist/views/metadata-admin/inspectors/useDatasetFields.d.ts +72 -0
- package/dist/views/metadata-admin/inspectors/useDatasetFields.js +0 -0
- package/dist/views/metadata-admin/mergeServerFields.d.ts +65 -0
- package/dist/views/metadata-admin/mergeServerFields.js +56 -0
- package/dist/views/metadata-admin/preview-registry.d.ts +55 -0
- package/dist/views/metadata-admin/previews/ActionPreview.d.ts +25 -0
- package/dist/views/metadata-admin/previews/ActionPreview.js +238 -0
- package/dist/views/metadata-admin/previews/AddWidgetPicker.d.ts +12 -0
- package/dist/views/metadata-admin/previews/AddWidgetPicker.js +56 -0
- package/dist/views/metadata-admin/previews/AgentPreview.d.ts +24 -0
- package/dist/views/metadata-admin/previews/AgentPreview.js +100 -0
- package/dist/views/metadata-admin/previews/AppNavCanvas.d.ts +31 -0
- package/dist/views/metadata-admin/previews/AppNavCanvas.js +260 -0
- package/dist/views/metadata-admin/previews/AppPreview.d.ts +16 -1
- package/dist/views/metadata-admin/previews/AppPreview.js +23 -14
- package/dist/views/metadata-admin/previews/BookPreview.d.ts +20 -0
- package/dist/views/metadata-admin/previews/BookPreview.js +132 -0
- package/dist/views/metadata-admin/previews/DashboardPreview.d.ts +16 -1
- package/dist/views/metadata-admin/previews/DashboardPreview.js +110 -8
- package/dist/views/metadata-admin/previews/DatasetPreview.d.ts +18 -0
- package/dist/views/metadata-admin/previews/DatasetPreview.js +89 -0
- package/dist/views/metadata-admin/previews/DatasourcePreview.d.ts +23 -0
- package/dist/views/metadata-admin/previews/DatasourcePreview.js +68 -0
- package/dist/views/metadata-admin/previews/EmailTemplatePreview.d.ts +14 -1
- package/dist/views/metadata-admin/previews/FieldStub.d.ts +30 -0
- package/dist/views/metadata-admin/previews/FieldStub.js +104 -0
- package/dist/views/metadata-admin/previews/FieldsListEditor.d.ts +50 -0
- package/dist/views/metadata-admin/previews/FieldsListEditor.js +97 -0
- package/dist/views/metadata-admin/previews/FlowCanvas.d.ts +43 -0
- package/dist/views/metadata-admin/previews/FlowCanvas.js +328 -0
- package/dist/views/metadata-admin/previews/FlowPreview.d.ts +20 -0
- package/dist/views/metadata-admin/previews/FlowPreview.js +92 -0
- package/dist/views/metadata-admin/previews/FlowRunsPanel.d.ts +46 -0
- package/dist/views/metadata-admin/previews/FlowRunsPanel.js +97 -0
- package/dist/views/metadata-admin/previews/FlowSimulatorPanel.d.ts +25 -0
- package/dist/views/metadata-admin/previews/FlowSimulatorPanel.js +170 -0
- package/dist/views/metadata-admin/previews/JobPreview.d.ts +28 -0
- package/dist/views/metadata-admin/previews/JobPreview.js +290 -0
- package/dist/views/metadata-admin/previews/ObjectFormCanvas.d.ts +30 -0
- package/dist/views/metadata-admin/previews/ObjectFormCanvas.js +547 -0
- package/dist/views/metadata-admin/previews/ObjectPreview.d.ts +14 -1
- package/dist/views/metadata-admin/previews/ObjectPreview.js +5 -30
- package/dist/views/metadata-admin/previews/OutlineStrip.d.ts +32 -0
- package/dist/views/metadata-admin/previews/OutlineStrip.js +8 -0
- package/dist/views/metadata-admin/previews/PageBlockCanvas.d.ts +49 -0
- package/dist/views/metadata-admin/previews/PageBlockCanvas.js +510 -0
- package/dist/views/metadata-admin/previews/PagePreview.d.ts +10 -1
- package/dist/views/metadata-admin/previews/PagePreview.js +90 -4
- package/dist/views/metadata-admin/previews/PermissionPreview.d.ts +27 -0
- package/dist/views/metadata-admin/previews/PermissionPreview.js +115 -0
- package/dist/views/metadata-admin/previews/PreviewShell.d.ts +29 -6
- package/dist/views/metadata-admin/previews/PreviewShell.js +16 -3
- package/dist/views/metadata-admin/previews/ReportPreview.d.ts +18 -1
- package/dist/views/metadata-admin/previews/ReportPreview.js +23 -15
- package/dist/views/metadata-admin/previews/RolePreview.d.ts +19 -0
- package/dist/views/metadata-admin/previews/RolePreview.js +14 -0
- package/dist/views/metadata-admin/previews/SkillPreview.d.ts +22 -0
- package/dist/views/metadata-admin/previews/SkillPreview.js +34 -0
- package/dist/views/metadata-admin/previews/ToolPreview.d.ts +25 -0
- package/dist/views/metadata-admin/previews/ToolPreview.js +122 -0
- package/dist/views/metadata-admin/previews/TranslationPreview.d.ts +25 -0
- package/dist/views/metadata-admin/previews/TranslationPreview.js +52 -0
- package/dist/views/metadata-admin/previews/ValidationPreview.d.ts +27 -0
- package/dist/views/metadata-admin/previews/ValidationPreview.js +110 -0
- package/dist/views/metadata-admin/previews/ViewColumnPanes.d.ts +62 -0
- package/dist/views/metadata-admin/previews/ViewColumnPanes.js +140 -0
- package/dist/views/metadata-admin/previews/ViewPreview.d.ts +23 -1
- package/dist/views/metadata-admin/previews/ViewPreview.js +101 -73
- package/dist/views/metadata-admin/previews/block-config.d.ts +82 -0
- package/dist/views/metadata-admin/previews/block-config.js +324 -0
- package/dist/views/metadata-admin/previews/block-types.d.ts +40 -0
- package/dist/views/metadata-admin/previews/block-types.js +110 -0
- package/dist/views/metadata-admin/previews/field-types.d.ts +53 -0
- package/dist/views/metadata-admin/previews/field-types.js +97 -0
- package/dist/views/metadata-admin/previews/flow-canvas-layout.d.ts +88 -0
- package/dist/views/metadata-admin/previews/flow-canvas-layout.js +190 -0
- package/dist/views/metadata-admin/previews/flow-canvas-parts.d.ts +88 -0
- package/dist/views/metadata-admin/previews/flow-canvas-parts.js +358 -0
- package/dist/views/metadata-admin/previews/form-preview.d.ts +24 -0
- package/dist/views/metadata-admin/previews/form-preview.js +29 -0
- package/dist/views/metadata-admin/previews/index.js +43 -0
- package/dist/views/metadata-admin/previews/object-fields-bridge.d.ts +66 -0
- package/dist/views/metadata-admin/previews/object-fields-bridge.js +171 -0
- package/dist/views/metadata-admin/previews/object-fields-io.d.ts +109 -0
- package/dist/views/metadata-admin/previews/object-fields-io.js +208 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-types.d.ts +91 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-types.js +2 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-validate.d.ts +8 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-validate.js +113 -0
- package/dist/views/metadata-admin/previews/simulator/flow-simulator.d.ts +44 -0
- package/dist/views/metadata-admin/previews/simulator/flow-simulator.js +316 -0
- package/dist/views/metadata-admin/previews/useDatasetCatalog.d.ts +47 -0
- package/dist/views/metadata-admin/previews/useDatasetCatalog.js +133 -0
- package/dist/views/metadata-admin/previews/useFlowNodePalette.d.ts +44 -0
- package/dist/views/metadata-admin/previews/useFlowNodePalette.js +124 -0
- package/dist/views/metadata-admin/previews/useMetaOptions.d.ts +8 -0
- package/dist/views/metadata-admin/previews/useMetaOptions.js +50 -0
- package/dist/views/metadata-admin/previews/useObjectFields.d.ts +23 -0
- package/dist/views/metadata-admin/previews/useObjectFields.js +79 -0
- package/dist/views/metadata-admin/previews/useObjectOptions.d.ts +8 -0
- package/dist/views/metadata-admin/previews/useObjectOptions.js +43 -0
- package/dist/views/metadata-admin/previews/view-column-io.d.ts +42 -0
- package/dist/views/metadata-admin/previews/view-column-io.js +73 -0
- package/dist/views/metadata-admin/previews/widget-types.d.ts +24 -0
- package/dist/views/metadata-admin/previews/widget-types.js +40 -0
- package/dist/views/metadata-admin/registry.d.ts +140 -19
- package/dist/views/metadata-admin/report-schema.d.ts +26 -0
- package/dist/views/metadata-admin/report-schema.js +121 -0
- package/dist/views/metadata-admin/useMetadata.d.ts +100 -2
- package/dist/views/metadata-admin/useMetadata.js +155 -4
- package/dist/views/metadata-admin/view-item-normalize.d.ts +20 -0
- package/dist/views/metadata-admin/view-item-normalize.js +68 -0
- package/dist/views/metadata-admin/view-schema.d.ts +16 -0
- package/dist/views/metadata-admin/view-schema.js +107 -0
- package/dist/views/metadata-admin/view-variant-model.d.ts +23 -0
- package/dist/views/metadata-admin/view-variant-model.js +64 -0
- package/dist/views/metadata-admin/widgets.d.ts +89 -1
- package/dist/views/metadata-admin/widgets.js +491 -17
- package/dist/views/runtime-metadata-persistence.d.ts +78 -0
- package/dist/views/runtime-metadata-persistence.js +89 -0
- package/dist/views/useOpenRecordList.d.ts +18 -0
- package/dist/views/useOpenRecordList.js +36 -0
- package/dist/views/userFilterUrlState.d.ts +15 -0
- package/dist/views/userFilterUrlState.js +53 -0
- package/dist/views/view-config-adapter.d.ts +38 -0
- package/dist/views/view-config-adapter.js +80 -0
- package/package.json +52 -34
- package/dist/views/DesignDrawer.d.ts +0 -28
- package/dist/views/DesignDrawer.js +0 -51
- package/dist/views/metadata-admin/DesignerEditorWrapper.d.ts +0 -68
- package/dist/views/metadata-admin/DesignerEditorWrapper.js +0 -158
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
// Map metadata-type name → loader for that type's root Zod schema.
|
|
3
|
+
// Each loader pulls only one spec subpath so we don't drag the whole
|
|
4
|
+
// 2MB schema bundle into the studio bundle.
|
|
5
|
+
//
|
|
6
|
+
// Types still falling through to server-only validation:
|
|
7
|
+
// - `validation`: not a top-level metadata file; lives inside object. (DataValidationRuleSchema
|
|
8
|
+
// exists but has empty shape, so it's not useful for client validation.)
|
|
9
|
+
// - `profile`: spec ships no top-level ProfileSchema (7.1 confirmed).
|
|
10
|
+
// - `trigger`: no standalone TriggerSchema export at runtime (only
|
|
11
|
+
// ConnectorTriggerSchema / WebhookEventSchema variants).
|
|
12
|
+
// - `sharing_rule`: SharingRuleSchema is declared but has empty shape — server-only.
|
|
13
|
+
// - `translation`: TranslationBundleSchema is z.object({}) — accepts anything; server-only.
|
|
14
|
+
// - `connector`: ConnectorSchema requires an `id` field that's not in the on-disk
|
|
15
|
+
// metadata shape — the spec models the runtime connector instance, not the file.
|
|
16
|
+
// Wiring it would flag every valid connector definition.
|
|
17
|
+
const LOADERS = {
|
|
18
|
+
// data
|
|
19
|
+
object: async () => (await import('@objectstack/spec/data')).ObjectSchema,
|
|
20
|
+
hook: async () => (await import('@objectstack/spec/data')).HookSchema,
|
|
21
|
+
mapping: async () => (await import('@objectstack/spec/data')).MappingSchema,
|
|
22
|
+
analytics_cube: async () => (await import('@objectstack/spec/data')).CubeSchema,
|
|
23
|
+
// ui
|
|
24
|
+
view: async () => (await import('@objectstack/spec/ui')).ViewSchema,
|
|
25
|
+
page: async () => (await import('@objectstack/spec/ui')).PageSchema,
|
|
26
|
+
app: async () => (await import('@objectstack/spec/ui')).AppSchema,
|
|
27
|
+
dashboard: async () => (await import('@objectstack/spec/ui')).DashboardSchema,
|
|
28
|
+
report: async () => (await import('@objectstack/spec/ui')).ReportSchema,
|
|
29
|
+
action: async () => (await import('@objectstack/spec/ui')).ActionSchema,
|
|
30
|
+
theme: async () => (await import('@objectstack/spec/ui')).ThemeSchema,
|
|
31
|
+
// automation
|
|
32
|
+
flow: async () => (await import('@objectstack/spec/automation')).FlowSchema,
|
|
33
|
+
// `workflow` is no longer a standalone metadata type (ADR-0020) — record
|
|
34
|
+
// state machines are a `state_machine` validation rule on the object,
|
|
35
|
+
// validated as part of ObjectSchema; there is no top-level workflow schema.
|
|
36
|
+
// `approval` is no longer a standalone metadata type — it's a flow node
|
|
37
|
+
// (`type: 'approval'`, ADR-0019). Its config (ApprovalNodeConfigSchema) is
|
|
38
|
+
// validated as part of the enclosing flow; there is no top-level schema, so
|
|
39
|
+
// it falls through to server-side validation.
|
|
40
|
+
webhook: async () => (await import('@objectstack/spec/automation')).WebhookSchema,
|
|
41
|
+
// ai
|
|
42
|
+
agent: async () => (await import('@objectstack/spec/ai')).AgentSchema,
|
|
43
|
+
tool: async () => (await import('@objectstack/spec/ai')).ToolSchema,
|
|
44
|
+
skill: async () => (await import('@objectstack/spec/ai')).SkillSchema,
|
|
45
|
+
// system
|
|
46
|
+
email_template: async () => (await import('@objectstack/spec/system')).EmailTemplateSchema,
|
|
47
|
+
job: async () => (await import('@objectstack/spec/system')).JobSchema,
|
|
48
|
+
// security
|
|
49
|
+
// NOTE: use PermissionSetSchema from /security, NOT PluginPermissionSchema from /kernel —
|
|
50
|
+
// the kernel one is the plugin-sandbox permission ({id,resource,actions}), not the
|
|
51
|
+
// metadata permission set ({name,isProfile,objects,fields}). See
|
|
52
|
+
// packages/spec/src/kernel/metadata-type-schemas.ts for the canonical mapping.
|
|
53
|
+
permission: async () => (await import('@objectstack/spec/security')).PermissionSetSchema,
|
|
54
|
+
profile: async () => (await import('@objectstack/spec/security')).PermissionSetSchema,
|
|
55
|
+
policy: async () => (await import('@objectstack/spec/security')).PolicySchema,
|
|
56
|
+
// identity
|
|
57
|
+
role: async () => (await import('@objectstack/spec/identity')).RoleSchema,
|
|
58
|
+
// api
|
|
59
|
+
api: async () => (await import('@objectstack/spec/api')).ApiEndpointSchema,
|
|
60
|
+
};
|
|
61
|
+
// Flow node `type` values the running server accepts but the published
|
|
62
|
+
// `@objectstack/spec` FlowNodeSchema enum predates. The framework HEAD opened
|
|
63
|
+
// FlowNodeSchema.type to a validated string (ADR-0019 P2) and registers these
|
|
64
|
+
// as built-in node descriptors, but that spec change is not yet on npm — so the
|
|
65
|
+
// published closed enum spuriously flags them. We suppress only the enum
|
|
66
|
+
// mismatch on the node's `.type`; every other field is still validated.
|
|
67
|
+
// - `approval`: durable-pause approval node (ADR-0019).
|
|
68
|
+
// - `connector_action`: deliberate open extension point for connector-provided
|
|
69
|
+
// node types — must never be flagged as invalid.
|
|
70
|
+
const FORWARD_COMPAT_FLOW_NODE_TYPES = new Set(['approval', 'connector_action']);
|
|
71
|
+
const FLOW_NODE_TYPE_ISSUE = /^nodes\.(\d+)\.type$/;
|
|
72
|
+
function nodeTypeAt(draft, index) {
|
|
73
|
+
const nodes = draft?.nodes;
|
|
74
|
+
if (!Array.isArray(nodes))
|
|
75
|
+
return undefined;
|
|
76
|
+
const node = nodes[index];
|
|
77
|
+
return typeof node?.type === 'string' ? node.type : undefined;
|
|
78
|
+
}
|
|
79
|
+
const SCHEMA_CACHE = new Map();
|
|
80
|
+
async function getSchemaForType(type) {
|
|
81
|
+
if (SCHEMA_CACHE.has(type))
|
|
82
|
+
return SCHEMA_CACHE.get(type) ?? null;
|
|
83
|
+
const loader = LOADERS[type];
|
|
84
|
+
if (!loader) {
|
|
85
|
+
SCHEMA_CACHE.set(type, null);
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const schema = await loader();
|
|
90
|
+
const value = (schema && typeof schema.safeParse === 'function') ? schema : null;
|
|
91
|
+
SCHEMA_CACHE.set(type, value);
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
SCHEMA_CACHE.set(type, null);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Returns true if a client-side schema exists for the given metadata
|
|
101
|
+
* type. Useful for deciding whether to skip the debounce in caller.
|
|
102
|
+
*/
|
|
103
|
+
export function hasClientValidator(type) {
|
|
104
|
+
return type in LOADERS;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Run Zod validation for the given metadata draft. Returns `{ok: true,
|
|
108
|
+
* issues: []}` for types without a registered schema so callers can
|
|
109
|
+
* fall back to server-side diagnostics without special-casing.
|
|
110
|
+
*/
|
|
111
|
+
export async function validateMetadataDraft(type, draft,
|
|
112
|
+
/**
|
|
113
|
+
* The live server JSON schema for this type (from `/meta/types`, i.e.
|
|
114
|
+
* `RichMetadataTypeEntry.schema`). When provided it ROOT-CURES cross-repo
|
|
115
|
+
* spec skew: the bundled `@objectstack/spec` may lag the running server, so
|
|
116
|
+
* we never let the client be STRICTER than the server — a "missing required
|
|
117
|
+
* field" flagged by the (possibly stale) bundled Zod is suppressed when the
|
|
118
|
+
* server marks that field optional. The server's own validation on save
|
|
119
|
+
* stays authoritative. This makes the editor track the live schema without a
|
|
120
|
+
* per-change shim (cf. `FORWARD_COMPAT_FLOW_NODE_TYPES`).
|
|
121
|
+
*/
|
|
122
|
+
serverSchema) {
|
|
123
|
+
const schema = await getSchemaForType(type);
|
|
124
|
+
if (!schema)
|
|
125
|
+
return { ok: true, issues: [] };
|
|
126
|
+
const result = schema.safeParse(draft);
|
|
127
|
+
if (result.success)
|
|
128
|
+
return { ok: true, issues: [] };
|
|
129
|
+
let rawIssues = result.error?.issues ?? [];
|
|
130
|
+
// Cross-repo skew root-cure — drop "missing required field" false positives
|
|
131
|
+
// for top-level fields the SERVER schema marks optional. Only suppresses when
|
|
132
|
+
// the field is actually absent in the draft (a present-but-invalid field
|
|
133
|
+
// still surfaces), so the client can never be stricter than the live server.
|
|
134
|
+
const serverRequired = Array.isArray(serverSchema?.required)
|
|
135
|
+
? new Set(serverSchema.required.map((x) => String(x)))
|
|
136
|
+
: undefined;
|
|
137
|
+
if (serverRequired && draft && typeof draft === 'object' && !Array.isArray(draft)) {
|
|
138
|
+
const d = draft;
|
|
139
|
+
rawIssues = rawIssues.filter((i) => {
|
|
140
|
+
const path = i.path ?? [];
|
|
141
|
+
if (path.length !== 1)
|
|
142
|
+
return true; // only top-level field issues
|
|
143
|
+
const field = String(path[0]);
|
|
144
|
+
const absent = d[field] === undefined || d[field] === null;
|
|
145
|
+
return !(absent && !serverRequired.has(field));
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Forward-compat: don't let the published flow schema's closed node-type
|
|
149
|
+
// enum reject node types the running server supports (see
|
|
150
|
+
// FORWARD_COMPAT_FLOW_NODE_TYPES). Suppress only the `.type` enum mismatch
|
|
151
|
+
// for those nodes; all other issues still surface.
|
|
152
|
+
if (type === 'flow') {
|
|
153
|
+
rawIssues = rawIssues.filter((i) => {
|
|
154
|
+
const path = (i.path ?? []).map((seg) => String(seg)).join('.');
|
|
155
|
+
const match = FLOW_NODE_TYPE_ISSUE.exec(path);
|
|
156
|
+
if (!match)
|
|
157
|
+
return true;
|
|
158
|
+
const nodeType = nodeTypeAt(draft, Number(match[1]));
|
|
159
|
+
return !(nodeType && FORWARD_COMPAT_FLOW_NODE_TYPES.has(nodeType));
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
if (rawIssues.length === 0)
|
|
163
|
+
return { ok: true, issues: [] };
|
|
164
|
+
const issues = rawIssues.map((i) => ({
|
|
165
|
+
path: (i.path ?? []).map((seg) => String(seg)).join('.'),
|
|
166
|
+
message: i.message,
|
|
167
|
+
}));
|
|
168
|
+
return { ok: false, issues };
|
|
169
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared color-variant swatch picker.
|
|
3
|
+
*
|
|
4
|
+
* Metadata color fields (`colorVariant` on metrics / dashboard widgets, badge
|
|
5
|
+
* tones, …) are a fixed SEMANTIC palette, not arbitrary hex. A row of colored
|
|
6
|
+
* swatches is far more scannable than a text dropdown — the admin sees the
|
|
7
|
+
* actual color, like Linear/Notion label pickers. Reused by the generic
|
|
8
|
+
* SchemaForm `color-picker` widget and the curated inspectors so every color
|
|
9
|
+
* field looks and behaves the same.
|
|
10
|
+
*/
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
export interface ColorVariant {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
css: string;
|
|
16
|
+
}
|
|
17
|
+
/** Canonical semantic palette (mirrors the renderer's colorVariant tokens). */
|
|
18
|
+
export declare const COLOR_VARIANTS: ColorVariant[];
|
|
19
|
+
/** Resolve a token (or hex) to a CSS color; unknown tokens fall back to neutral. */
|
|
20
|
+
export declare function colorVariantCss(value: string | undefined): string;
|
|
21
|
+
export declare function ColorVariantPicker({ value, onChange, disabled, options }: {
|
|
22
|
+
value: string | undefined;
|
|
23
|
+
onChange: (v: string) => void;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Restrict/relabel the choices; defaults to the full canonical palette. */
|
|
26
|
+
options?: Array<{
|
|
27
|
+
value: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
}>;
|
|
30
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '@object-ui/components';
|
|
3
|
+
/** Canonical semantic palette (mirrors the renderer's colorVariant tokens). */
|
|
4
|
+
export const COLOR_VARIANTS = [
|
|
5
|
+
{ value: 'default', label: 'Default', css: '#9ca3af' },
|
|
6
|
+
{ value: 'blue', label: 'Blue', css: '#3b82f6' },
|
|
7
|
+
{ value: 'teal', label: 'Teal', css: '#14b8a6' },
|
|
8
|
+
{ value: 'orange', label: 'Orange', css: '#f97316' },
|
|
9
|
+
{ value: 'purple', label: 'Purple', css: '#a855f7' },
|
|
10
|
+
{ value: 'success', label: 'Success', css: '#22c55e' },
|
|
11
|
+
{ value: 'warning', label: 'Warning', css: '#f59e0b' },
|
|
12
|
+
{ value: 'danger', label: 'Danger', css: '#ef4444' },
|
|
13
|
+
// common aliases so non-canonical tokens still get a sensible swatch
|
|
14
|
+
{ value: 'green', label: 'Green', css: '#22c55e' },
|
|
15
|
+
{ value: 'red', label: 'Red', css: '#ef4444' },
|
|
16
|
+
{ value: 'amber', label: 'Amber', css: '#f59e0b' },
|
|
17
|
+
];
|
|
18
|
+
const CSS_BY_VALUE = Object.fromEntries(COLOR_VARIANTS.map((c) => [c.value, c.css]));
|
|
19
|
+
/** Resolve a token (or hex) to a CSS color; unknown tokens fall back to neutral. */
|
|
20
|
+
export function colorVariantCss(value) {
|
|
21
|
+
if (!value)
|
|
22
|
+
return '#9ca3af';
|
|
23
|
+
if (/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(value))
|
|
24
|
+
return value;
|
|
25
|
+
return CSS_BY_VALUE[value] ?? '#9ca3af';
|
|
26
|
+
}
|
|
27
|
+
export function ColorVariantPicker({ value, onChange, disabled, options }) {
|
|
28
|
+
const opts = options
|
|
29
|
+
? options.map((o) => ({ value: o.value, label: o.label ?? o.value, css: colorVariantCss(o.value) }))
|
|
30
|
+
: COLOR_VARIANTS.slice(0, 8); // canonical 8 (skip aliases in the default row)
|
|
31
|
+
const current = value ?? 'default';
|
|
32
|
+
return (_jsx("div", { className: "flex flex-wrap gap-1.5", role: "radiogroup", children: opts.map((o) => {
|
|
33
|
+
const on = current === o.value;
|
|
34
|
+
return (_jsx("button", { type: "button", role: "radio", "aria-checked": on, "aria-label": o.label, title: o.label, disabled: disabled, onClick: () => onChange(o.value), className: cn('flex h-7 w-7 items-center justify-center rounded-full border transition-all', on
|
|
35
|
+
? 'border-transparent ring-2 ring-foreground/60 ring-offset-1 ring-offset-background'
|
|
36
|
+
: 'border-border hover:scale-110', disabled && 'cursor-not-allowed opacity-50'), children: _jsx("span", { className: "h-4 w-4 rounded-full", style: { backgroundColor: o.css } }) }, o.value));
|
|
37
|
+
}) }));
|
|
38
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createDerive — declarative live-derivation helpers for the generic
|
|
3
|
+
* metadata create form.
|
|
4
|
+
*
|
|
5
|
+
* The goal is to keep "smart" UX behaviors (auto slug, plural label)
|
|
6
|
+
* out of bespoke per-type pages. Instead, a small closed set of named
|
|
7
|
+
* transforms is exposed; types pick which ones they want via the
|
|
8
|
+
* registry's `createDerive` config.
|
|
9
|
+
*/
|
|
10
|
+
import type { CreateDeriveRule } from './registry';
|
|
11
|
+
/**
|
|
12
|
+
* Convert a human label into a snake_case identifier.
|
|
13
|
+
*
|
|
14
|
+
* Strategy: NFKD-normalise, lowercase, replace runs of non-alphanum
|
|
15
|
+
* with `_`, trim, strip leading digit, clamp to 64 chars.
|
|
16
|
+
*
|
|
17
|
+
* Non-Latin scripts (CJK, Arabic, …) leave the result empty — the
|
|
18
|
+
* caller surface is expected to detect that and prompt the user to
|
|
19
|
+
* enter `name` manually rather than silently writing garbage.
|
|
20
|
+
*/
|
|
21
|
+
export declare function slugify(input: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Naive English pluraliser. Handles -y → -ies, sibilants → -es, else
|
|
24
|
+
* appends -s. Returns input unchanged when it contains no ASCII
|
|
25
|
+
* letters (CJK passes through).
|
|
26
|
+
*/
|
|
27
|
+
export declare function naivePlural(input: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* snake_case / kebab-case → "Title Case".
|
|
30
|
+
*/
|
|
31
|
+
export declare function titlecase(input: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Take everything up to the first space / underscore / dash.
|
|
34
|
+
*/
|
|
35
|
+
export declare function firstToken(input: string): string;
|
|
36
|
+
export declare function applyTransform(transform: CreateDeriveRule['transform'], value: unknown): string;
|
|
37
|
+
export interface UseCreateDeriveArgs<T extends Record<string, unknown>> {
|
|
38
|
+
/** Rules from `MetadataResourceConfig.createDerive` (may be undefined). */
|
|
39
|
+
rules: readonly CreateDeriveRule[] | undefined;
|
|
40
|
+
/** Current draft object. */
|
|
41
|
+
draft: T;
|
|
42
|
+
/** Setter — receives a partial patch to merge. */
|
|
43
|
+
onPatch: (patch: Partial<T>) => void;
|
|
44
|
+
/** When true, suspend derivation entirely (e.g. not in create mode). */
|
|
45
|
+
enabled?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface UseCreateDeriveResult {
|
|
48
|
+
/**
|
|
49
|
+
* Mark a target field as user-touched so future derivations leave it
|
|
50
|
+
* alone. Call from input `onChange` handlers in the create form.
|
|
51
|
+
*/
|
|
52
|
+
markTouched: (path: string) => void;
|
|
53
|
+
/** Read-only set of currently touched target paths. */
|
|
54
|
+
touched: ReadonlySet<string>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Watches `draft[from]` and writes derived values into `draft[to]`.
|
|
58
|
+
*
|
|
59
|
+
* Why a hook (not inline state machine in ResourceEditPage):
|
|
60
|
+
* - The "stop when user edits target" behavior needs persistent
|
|
61
|
+
* touched-set state across renders.
|
|
62
|
+
* - Multiple rules may target the same field; the hook resolves them
|
|
63
|
+
* deterministically in registry order.
|
|
64
|
+
* - Keeping the logic here lets us unit-test the derivation without
|
|
65
|
+
* spinning up the whole edit page.
|
|
66
|
+
*/
|
|
67
|
+
export declare function useCreateDerive<T extends Record<string, unknown>>(args: UseCreateDeriveArgs<T>): UseCreateDeriveResult;
|
|
68
|
+
/**
|
|
69
|
+
* When a type doesn't declare `createFields`, fall back to a sensible
|
|
70
|
+
* default: every required field, plus `name` and `label` if present.
|
|
71
|
+
*
|
|
72
|
+
* Returns a stable, order-preserving array (required first in their
|
|
73
|
+
* schema order, then `name`/`label` if not already included).
|
|
74
|
+
*/
|
|
75
|
+
export declare function deriveDefaultCreateFields(schemaProperties: Record<string, unknown> | undefined, required: readonly string[] | undefined): string[];
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createDerive — declarative live-derivation helpers for the generic
|
|
3
|
+
* metadata create form.
|
|
4
|
+
*
|
|
5
|
+
* The goal is to keep "smart" UX behaviors (auto slug, plural label)
|
|
6
|
+
* out of bespoke per-type pages. Instead, a small closed set of named
|
|
7
|
+
* transforms is exposed; types pick which ones they want via the
|
|
8
|
+
* registry's `createDerive` config.
|
|
9
|
+
*/
|
|
10
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
11
|
+
// ── Pure transforms ───────────────────────────────────────────────────
|
|
12
|
+
/**
|
|
13
|
+
* Convert a human label into a snake_case identifier.
|
|
14
|
+
*
|
|
15
|
+
* Strategy: NFKD-normalise, lowercase, replace runs of non-alphanum
|
|
16
|
+
* with `_`, trim, strip leading digit, clamp to 64 chars.
|
|
17
|
+
*
|
|
18
|
+
* Non-Latin scripts (CJK, Arabic, …) leave the result empty — the
|
|
19
|
+
* caller surface is expected to detect that and prompt the user to
|
|
20
|
+
* enter `name` manually rather than silently writing garbage.
|
|
21
|
+
*/
|
|
22
|
+
export function slugify(input) {
|
|
23
|
+
if (typeof input !== 'string')
|
|
24
|
+
return '';
|
|
25
|
+
const normalised = input.normalize('NFKD').replace(/[\u0300-\u036f]/g, '');
|
|
26
|
+
let out = normalised
|
|
27
|
+
.toLowerCase()
|
|
28
|
+
.replace(/[^a-z0-9]+/g, '_')
|
|
29
|
+
.replace(/^_+|_+$/g, '');
|
|
30
|
+
if (/^\d/.test(out))
|
|
31
|
+
out = `n_${out}`;
|
|
32
|
+
if (out.length > 64)
|
|
33
|
+
out = out.slice(0, 64).replace(/_+$/g, '');
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Naive English pluraliser. Handles -y → -ies, sibilants → -es, else
|
|
38
|
+
* appends -s. Returns input unchanged when it contains no ASCII
|
|
39
|
+
* letters (CJK passes through).
|
|
40
|
+
*/
|
|
41
|
+
export function naivePlural(input) {
|
|
42
|
+
if (typeof input !== 'string')
|
|
43
|
+
return '';
|
|
44
|
+
const trimmed = input.trim();
|
|
45
|
+
if (!trimmed)
|
|
46
|
+
return '';
|
|
47
|
+
if (!/[A-Za-z]/.test(trimmed))
|
|
48
|
+
return trimmed;
|
|
49
|
+
// Already plural? Cheap heuristic — avoid double-pluralising.
|
|
50
|
+
if (/(s|ses|xes|zes|ches|shes|ies)$/i.test(trimmed))
|
|
51
|
+
return trimmed;
|
|
52
|
+
if (/[^aeiou]y$/i.test(trimmed))
|
|
53
|
+
return trimmed.replace(/y$/i, 'ies');
|
|
54
|
+
if (/(s|x|z|ch|sh)$/i.test(trimmed))
|
|
55
|
+
return `${trimmed}es`;
|
|
56
|
+
return `${trimmed}s`;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* snake_case / kebab-case → "Title Case".
|
|
60
|
+
*/
|
|
61
|
+
export function titlecase(input) {
|
|
62
|
+
if (typeof input !== 'string')
|
|
63
|
+
return '';
|
|
64
|
+
return input
|
|
65
|
+
.replace(/[_-]+/g, ' ')
|
|
66
|
+
.split(/\s+/)
|
|
67
|
+
.filter(Boolean)
|
|
68
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
|
69
|
+
.join(' ');
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Take everything up to the first space / underscore / dash.
|
|
73
|
+
*/
|
|
74
|
+
export function firstToken(input) {
|
|
75
|
+
if (typeof input !== 'string')
|
|
76
|
+
return '';
|
|
77
|
+
const m = input.trim().match(/^[^\s_-]+/);
|
|
78
|
+
return m ? m[0] : '';
|
|
79
|
+
}
|
|
80
|
+
export function applyTransform(transform, value) {
|
|
81
|
+
const str = typeof value === 'string' ? value : value == null ? '' : String(value);
|
|
82
|
+
switch (transform) {
|
|
83
|
+
case 'slugify':
|
|
84
|
+
return slugify(str);
|
|
85
|
+
case 'plural-en':
|
|
86
|
+
return naivePlural(str);
|
|
87
|
+
case 'titlecase':
|
|
88
|
+
return titlecase(str);
|
|
89
|
+
case 'first-token':
|
|
90
|
+
return firstToken(str);
|
|
91
|
+
default:
|
|
92
|
+
return str;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Watches `draft[from]` and writes derived values into `draft[to]`.
|
|
97
|
+
*
|
|
98
|
+
* Why a hook (not inline state machine in ResourceEditPage):
|
|
99
|
+
* - The "stop when user edits target" behavior needs persistent
|
|
100
|
+
* touched-set state across renders.
|
|
101
|
+
* - Multiple rules may target the same field; the hook resolves them
|
|
102
|
+
* deterministically in registry order.
|
|
103
|
+
* - Keeping the logic here lets us unit-test the derivation without
|
|
104
|
+
* spinning up the whole edit page.
|
|
105
|
+
*/
|
|
106
|
+
export function useCreateDerive(args) {
|
|
107
|
+
const { rules, draft, onPatch, enabled = true } = args;
|
|
108
|
+
// Targets the user has typed into directly. Once a target appears
|
|
109
|
+
// here, no rule will overwrite it again for the lifetime of the
|
|
110
|
+
// create form (the form unmounts on submit, so this naturally resets).
|
|
111
|
+
const touchedRef = useRef(new Set());
|
|
112
|
+
// Snapshot of `from` values from the prior render — lets us detect
|
|
113
|
+
// *changes* and avoid re-firing on every keystroke unrelated to a
|
|
114
|
+
// given source field.
|
|
115
|
+
const prevFromRef = useRef({});
|
|
116
|
+
const markTouched = useCallback((path) => {
|
|
117
|
+
touchedRef.current.add(path);
|
|
118
|
+
}, []);
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (!enabled || !rules || rules.length === 0)
|
|
121
|
+
return;
|
|
122
|
+
const patch = {};
|
|
123
|
+
const prev = prevFromRef.current;
|
|
124
|
+
const nextSnapshot = {};
|
|
125
|
+
for (const rule of rules) {
|
|
126
|
+
const fromVal = draft[rule.from];
|
|
127
|
+
nextSnapshot[rule.from] = fromVal;
|
|
128
|
+
const fromChanged = !Object.is(prev[rule.from], fromVal);
|
|
129
|
+
if (!fromChanged)
|
|
130
|
+
continue;
|
|
131
|
+
const respectTouched = rule.untilUserEdits !== false;
|
|
132
|
+
if (respectTouched && touchedRef.current.has(rule.to))
|
|
133
|
+
continue;
|
|
134
|
+
// Don't fight other rules in the same batch.
|
|
135
|
+
if (rule.to in patch)
|
|
136
|
+
continue;
|
|
137
|
+
const derived = applyTransform(rule.transform, fromVal);
|
|
138
|
+
// Empty derivations (e.g. CJK → slugify) just clear the target;
|
|
139
|
+
// that's intentional — the UI then knows to prompt for manual entry.
|
|
140
|
+
if (draft[rule.to] !== derived) {
|
|
141
|
+
patch[rule.to] = derived;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
prevFromRef.current = { ...prev, ...nextSnapshot };
|
|
145
|
+
if (Object.keys(patch).length > 0) {
|
|
146
|
+
onPatch(patch);
|
|
147
|
+
}
|
|
148
|
+
// We deliberately depend on `draft` (referential) rather than every
|
|
149
|
+
// rule.from — the rules array is treated as stable across the
|
|
150
|
+
// lifetime of the form.
|
|
151
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
152
|
+
}, [draft, enabled]);
|
|
153
|
+
return { markTouched, touched: touchedRef.current };
|
|
154
|
+
}
|
|
155
|
+
// ── Default field selection ───────────────────────────────────────────
|
|
156
|
+
/**
|
|
157
|
+
* When a type doesn't declare `createFields`, fall back to a sensible
|
|
158
|
+
* default: every required field, plus `name` and `label` if present.
|
|
159
|
+
*
|
|
160
|
+
* Returns a stable, order-preserving array (required first in their
|
|
161
|
+
* schema order, then `name`/`label` if not already included).
|
|
162
|
+
*/
|
|
163
|
+
export function deriveDefaultCreateFields(schemaProperties, required) {
|
|
164
|
+
const propKeys = schemaProperties ? Object.keys(schemaProperties) : [];
|
|
165
|
+
const result = [];
|
|
166
|
+
const push = (k) => {
|
|
167
|
+
if (!result.includes(k) && propKeys.includes(k))
|
|
168
|
+
result.push(k);
|
|
169
|
+
};
|
|
170
|
+
// 1. Required fields, in JSONSchema order.
|
|
171
|
+
for (const k of propKeys) {
|
|
172
|
+
if (required?.includes(k))
|
|
173
|
+
push(k);
|
|
174
|
+
}
|
|
175
|
+
// 2. Then label/pluralLabel/name if not already in.
|
|
176
|
+
for (const k of ['label', 'pluralLabel', 'name', 'description'])
|
|
177
|
+
push(k);
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FormViewSpec } from './SchemaForm';
|
|
2
|
+
type JsonSchema = Record<string, any>;
|
|
3
|
+
/** JSONSchema for the whole (flat) Dashboard document. */
|
|
4
|
+
export declare function getDashboardSchema(): JsonSchema | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* The canonical authoring FormView, with the fields the curated inspector
|
|
7
|
+
* owns directly (widgets / label / description / name) pruned from every
|
|
8
|
+
* section so they are not double-rendered. Everything else — layout,
|
|
9
|
+
* filters, performance — flows through verbatim from the spec.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getDashboardForm(): FormViewSpec | undefined;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
/**
|
|
3
|
+
* dashboard-schema.ts — the SINGLE source of truth for Dashboard authoring
|
|
4
|
+
* metadata, sourced directly from `@objectstack/spec` (the protocol) rather
|
|
5
|
+
* than hand-written field lists. Mirrors {@link ./report-schema.ts}.
|
|
6
|
+
*
|
|
7
|
+
* Why: the Dashboard inspector must render the CORRECT config fields
|
|
8
|
+
* (layout / filters / performance / …) without hardcoding them. The spec
|
|
9
|
+
* already describes this:
|
|
10
|
+
*
|
|
11
|
+
* • `dashboardForm` — the canonical authoring FormView: sections for
|
|
12
|
+
* basics, layout, widgets, filters and advanced.
|
|
13
|
+
* • `DashboardSchema` — the zod schema for the whole (flat) Dashboard
|
|
14
|
+
* document (name / label / widgets[] / columns /
|
|
15
|
+
* gap / dateRange / globalFilters / performance / …).
|
|
16
|
+
*
|
|
17
|
+
* We convert the zod schema to JSONSchema once (memoised) via zod 4's native
|
|
18
|
+
* `z.toJSONSchema`, and feed `{ form, schema }` straight into the existing
|
|
19
|
+
* {@link SchemaForm}. Adding a new dashboard config prop to the spec therefore
|
|
20
|
+
* flows through automatically — zero code changes here.
|
|
21
|
+
*/
|
|
22
|
+
import { z } from 'zod';
|
|
23
|
+
import { DashboardSchema, dashboardForm as specDashboardForm } from '@objectstack/spec/ui';
|
|
24
|
+
const TO_JSON_OPTS = { io: 'input', unrepresentable: 'any' };
|
|
25
|
+
/** Fields the curated inspector owns directly, pruned from the spec form. */
|
|
26
|
+
const FORM_FIELDS_OWNED_ELSEWHERE = new Set([
|
|
27
|
+
'widgets', // managed by the dedicated widgets list + per-widget inspector
|
|
28
|
+
'label', // dashboard display name rendered as a dedicated control
|
|
29
|
+
'description', // rendered as a dedicated control
|
|
30
|
+
'name', // record identity — not user-editable here
|
|
31
|
+
]);
|
|
32
|
+
let _dashboardDocSchema;
|
|
33
|
+
let _dashboardDocFailed = false;
|
|
34
|
+
/** JSONSchema for the whole (flat) Dashboard document. */
|
|
35
|
+
export function getDashboardSchema() {
|
|
36
|
+
if (_dashboardDocSchema || _dashboardDocFailed)
|
|
37
|
+
return _dashboardDocSchema;
|
|
38
|
+
try {
|
|
39
|
+
_dashboardDocSchema = z.toJSONSchema(DashboardSchema, TO_JSON_OPTS);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
_dashboardDocFailed = true;
|
|
43
|
+
if (typeof console !== 'undefined') {
|
|
44
|
+
console.warn('[dashboard-schema] failed to derive Dashboard JSONSchema from spec', err);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return _dashboardDocSchema;
|
|
48
|
+
}
|
|
49
|
+
let _dashboardForm;
|
|
50
|
+
/**
|
|
51
|
+
* The canonical authoring FormView, with the fields the curated inspector
|
|
52
|
+
* owns directly (widgets / label / description / name) pruned from every
|
|
53
|
+
* section so they are not double-rendered. Everything else — layout,
|
|
54
|
+
* filters, performance — flows through verbatim from the spec.
|
|
55
|
+
*/
|
|
56
|
+
export function getDashboardForm() {
|
|
57
|
+
if (_dashboardForm)
|
|
58
|
+
return _dashboardForm;
|
|
59
|
+
if (!specDashboardForm || typeof specDashboardForm !== 'object')
|
|
60
|
+
return undefined;
|
|
61
|
+
try {
|
|
62
|
+
const clone = JSON.parse(JSON.stringify(specDashboardForm));
|
|
63
|
+
for (const section of clone.sections ?? []) {
|
|
64
|
+
section.fields = (section.fields ?? []).filter((f) => {
|
|
65
|
+
const name = typeof f === 'string' ? f : f?.field;
|
|
66
|
+
return !FORM_FIELDS_OWNED_ELSEWHERE.has(name);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
// Drop now-empty sections so we don't render bare headers.
|
|
70
|
+
clone.sections = (clone.sections ?? []).filter((s) => (s.fields ?? []).length > 0);
|
|
71
|
+
_dashboardForm = clone;
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
if (typeof console !== 'undefined') {
|
|
75
|
+
console.warn('[dashboard-schema] failed to prepare dashboardForm from spec', err);
|
|
76
|
+
}
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
return _dashboardForm;
|
|
80
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DatasourceResourcePage — the `datasource` metadata type's custom ListPage,
|
|
3
|
+
* registered into the metadata-admin engine (`registerMetadataResource`) and
|
|
4
|
+
* reached via the engine route `…/component/metadata/resource?type=datasource`
|
|
5
|
+
* (and the setup left-nav "Datasources" item → `system/metadata/datasource`).
|
|
6
|
+
*
|
|
7
|
+
* datasource is a *side-effectful* metadata type: its records are managed by
|
|
8
|
+
* the framework `datasource-admin` service (secret encryption + connection-pool
|
|
9
|
+
* registration + origin gating), so create/edit/delete + test go through that
|
|
10
|
+
* service's REST (`/api/v1/datasources/*`) rather than the generic sys_metadata
|
|
11
|
+
* write path. The engine still owns the route, shell, and registry slot.
|
|
12
|
+
*
|
|
13
|
+
* Capabilities:
|
|
14
|
+
* - **List** datasources (driver/status/origin).
|
|
15
|
+
* - **Create / edit** a connection with a typed form generated from the
|
|
16
|
+
* selected driver's JSON-Schema `configSchema` (`GET /datasources/drivers`).
|
|
17
|
+
* Credential fields (`format: 'password'`) are routed to the top-level
|
|
18
|
+
* `secret` so they are encrypted into `sys_secret` and never persisted in
|
|
19
|
+
* `config` metadata. Edit prefills from `GET /datasources/:name` (which
|
|
20
|
+
* returns `config` + a `hasSecret` flag, never the credential itself).
|
|
21
|
+
* - **Test** a connection (saved → `POST …/:name/test`; draft in the editor →
|
|
22
|
+
* `POST …/test`).
|
|
23
|
+
* - **Sync objects**: introspect remote tables (`GET …/remote-tables`), pick
|
|
24
|
+
* which to import, generate an object definition for each (`POST …/object-draft`),
|
|
25
|
+
* and create it through the normal metadata channel (`MetadataClient.save('object', …)`).
|
|
26
|
+
* - **Delete** a runtime datasource (`DELETE …/:name`; blocked by the backend
|
|
27
|
+
* while objects are still bound).
|
|
28
|
+
*
|
|
29
|
+
* Code-defined (`origin: 'code'`) datasources are read-only: edit/delete are
|
|
30
|
+
* hidden for them.
|
|
31
|
+
*/
|
|
32
|
+
import * as React from 'react';
|
|
33
|
+
export declare function DatasourceResourcePage(_props: {
|
|
34
|
+
type?: string;
|
|
35
|
+
}): React.ReactElement;
|