@rebasepro/studio 0.0.1-canary.09e5ec5
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/LICENSE +114 -0
- package/README.md +159 -0
- package/dist/ApiExplorer-gMJt5JrS.js +1053 -0
- package/dist/ApiExplorer-gMJt5JrS.js.map +1 -0
- package/dist/AuthSimulationSelector-BF4rkRGp.js +118 -0
- package/dist/AuthSimulationSelector-BF4rkRGp.js.map +1 -0
- package/dist/BranchesView-DcHZtvXo.js +292 -0
- package/dist/BranchesView-DcHZtvXo.js.map +1 -0
- package/dist/CronJobsView-CijCToeK.js +456 -0
- package/dist/CronJobsView-CijCToeK.js.map +1 -0
- package/dist/JSEditor-D8nVp3Lp.js +1308 -0
- package/dist/JSEditor-D8nVp3Lp.js.map +1 -0
- package/dist/MonacoEditor-CMYEjiRf.js +161 -0
- package/dist/MonacoEditor-CMYEjiRf.js.map +1 -0
- package/dist/RLSEditor-DBH09u9v.js +1831 -0
- package/dist/RLSEditor-DBH09u9v.js.map +1 -0
- package/dist/SQLEditor-CkVx9vgr.js +1792 -0
- package/dist/SQLEditor-CkVx9vgr.js.map +1 -0
- package/dist/SchemaVisualizer-BgD5Zb77.js +1069 -0
- package/dist/SchemaVisualizer-BgD5Zb77.js.map +1 -0
- package/dist/StorageView-CTqGFhY9.js +907 -0
- package/dist/StorageView-CTqGFhY9.js.map +1 -0
- package/dist/common/src/collections/CollectionRegistry.d.ts +56 -0
- package/dist/common/src/collections/index.d.ts +1 -0
- package/dist/common/src/data/buildRebaseData.d.ts +14 -0
- package/dist/common/src/index.d.ts +3 -0
- package/dist/common/src/util/builders.d.ts +57 -0
- package/dist/common/src/util/callbacks.d.ts +6 -0
- package/dist/common/src/util/collections.d.ts +11 -0
- package/dist/common/src/util/common.d.ts +2 -0
- package/dist/common/src/util/conditions.d.ts +26 -0
- package/dist/common/src/util/entities.d.ts +58 -0
- package/dist/common/src/util/enums.d.ts +3 -0
- package/dist/common/src/util/index.d.ts +16 -0
- package/dist/common/src/util/navigation_from_path.d.ts +34 -0
- package/dist/common/src/util/navigation_utils.d.ts +20 -0
- package/dist/common/src/util/parent_references_from_path.d.ts +6 -0
- package/dist/common/src/util/paths.d.ts +14 -0
- package/dist/common/src/util/permissions.d.ts +5 -0
- package/dist/common/src/util/references.d.ts +2 -0
- package/dist/common/src/util/relations.d.ts +22 -0
- package/dist/common/src/util/resolutions.d.ts +72 -0
- package/dist/common/src/util/storage.d.ts +24 -0
- package/dist/core/src/components/AIIcon.d.ts +16 -0
- package/dist/core/src/components/ConfirmationDialog.d.ts +9 -0
- package/dist/core/src/components/Debug/UIReferenceView.d.ts +1 -0
- package/dist/core/src/components/Debug/UIStyleGuide.d.ts +1 -0
- package/dist/core/src/components/ErrorTooltip.d.ts +2 -0
- package/dist/core/src/components/ErrorView.d.ts +21 -0
- package/dist/core/src/components/LanguageToggle.d.ts +1 -0
- package/dist/core/src/components/LoginView/LoginView.d.ts +68 -0
- package/dist/core/src/components/LoginView/index.d.ts +2 -0
- package/dist/core/src/components/NotFoundPage.d.ts +1 -0
- package/dist/core/src/components/RebaseAuth.d.ts +10 -0
- package/dist/core/src/components/RebaseLogo.d.ts +7 -0
- package/dist/core/src/components/UnsavedChangesDialog.d.ts +9 -0
- package/dist/core/src/components/UserDisplay.d.ts +7 -0
- package/dist/core/src/components/UserSelectPopover.d.ts +62 -0
- package/dist/core/src/components/UserSettingsView.d.ts +1 -0
- package/dist/core/src/components/common/index.d.ts +6 -0
- package/dist/core/src/components/common/table_height.d.ts +5 -0
- package/dist/core/src/components/common/types.d.ts +63 -0
- package/dist/core/src/components/common/useColumnsIds.d.ts +9 -0
- package/dist/core/src/components/common/useDataTableController.d.ts +45 -0
- package/dist/core/src/components/common/useDebouncedData.d.ts +9 -0
- package/dist/core/src/components/common/useScrollRestoration.d.ts +14 -0
- package/dist/core/src/components/index.d.ts +16 -0
- package/dist/core/src/contexts/AdminModeController.d.ts +4 -0
- package/dist/core/src/contexts/AnalyticsContext.d.ts +3 -0
- package/dist/core/src/contexts/AuthControllerContext.d.ts +3 -0
- package/dist/core/src/contexts/CustomizationControllerContext.d.ts +3 -0
- package/dist/core/src/contexts/DataDriverContext.d.ts +3 -0
- package/dist/core/src/contexts/DatabaseAdminContext.d.ts +3 -0
- package/dist/core/src/contexts/DialogsProvider.d.ts +4 -0
- package/dist/core/src/contexts/EffectiveRoleController.d.ts +4 -0
- package/dist/core/src/contexts/InternalUserManagementContext.d.ts +3 -0
- package/dist/core/src/contexts/ModeController.d.ts +4 -0
- package/dist/core/src/contexts/RebaseClientInstanceContext.d.ts +6 -0
- package/dist/core/src/contexts/RebaseDataContext.d.ts +3 -0
- package/dist/core/src/contexts/SnackbarProvider.d.ts +2 -0
- package/dist/core/src/contexts/StorageSourceContext.d.ts +3 -0
- package/dist/core/src/contexts/UserConfigurationPersistenceContext.d.ts +3 -0
- package/dist/core/src/contexts/index.d.ts +13 -0
- package/dist/core/src/core/PluginLifecycleManager.d.ts +17 -0
- package/dist/core/src/core/PluginProviderStack.d.ts +21 -0
- package/dist/core/src/core/Rebase.d.ts +14 -0
- package/dist/core/src/core/RebaseProps.d.ts +136 -0
- package/dist/core/src/core/RebaseRouter.d.ts +4 -0
- package/dist/core/src/core/RebaseRoutes.d.ts +17 -0
- package/dist/core/src/core/index.d.ts +4 -0
- package/dist/core/src/hooks/ApiConfigContext.d.ts +24 -0
- package/dist/core/src/hooks/data/delete.d.ts +31 -0
- package/dist/core/src/hooks/data/save.d.ts +34 -0
- package/dist/core/src/hooks/data/useCollectionFetch.d.ts +51 -0
- package/dist/core/src/hooks/data/useData.d.ts +13 -0
- package/dist/core/src/hooks/data/useDataOrder.d.ts +12 -0
- package/dist/core/src/hooks/data/useEntityFetch.d.ts +38 -0
- package/dist/core/src/hooks/data/useRelationSelector.d.ts +52 -0
- package/dist/core/src/hooks/data/useUserSelector.d.ts +31 -0
- package/dist/core/src/hooks/index.d.ts +37 -0
- package/dist/core/src/hooks/useAdminModeController.d.ts +19 -0
- package/dist/core/src/hooks/useAnalyticsController.d.ts +5 -0
- package/dist/core/src/hooks/useAuthController.d.ts +11 -0
- package/dist/core/src/hooks/useAuthSubscription.d.ts +2 -0
- package/dist/core/src/hooks/useBackendStorageSource.d.ts +30 -0
- package/dist/core/src/hooks/useBridgeRegistration.d.ts +18 -0
- package/dist/core/src/hooks/useBrowserTitleAndIcon.d.ts +6 -0
- package/dist/core/src/hooks/useBuildAdminModeController.d.ts +6 -0
- package/dist/core/src/hooks/useBuildEffectiveRoleController.d.ts +8 -0
- package/dist/core/src/hooks/useBuildLocalConfigurationPersistence.d.ts +2 -0
- package/dist/core/src/hooks/useBuildModeController.d.ts +6 -0
- package/dist/core/src/hooks/useClipboard.d.ts +57 -0
- package/dist/core/src/hooks/useCollapsedGroups.d.ts +12 -0
- package/dist/core/src/hooks/useCustomizationController.d.ts +11 -0
- package/dist/core/src/hooks/useDialogsController.d.ts +11 -0
- package/dist/core/src/hooks/useEffectiveRoleController.d.ts +7 -0
- package/dist/core/src/hooks/useInternalUserManagementController.d.ts +12 -0
- package/dist/core/src/hooks/useLargeLayout.d.ts +1 -0
- package/dist/core/src/hooks/useModeController.d.ts +19 -0
- package/dist/core/src/hooks/usePermissions.d.ts +12 -0
- package/dist/core/src/hooks/useRebaseClient.d.ts +5 -0
- package/dist/core/src/hooks/useRebaseContext.d.ts +11 -0
- package/dist/core/src/hooks/useRebaseRegistry.d.ts +34 -0
- package/dist/core/src/hooks/useSlot.d.ts +18 -0
- package/dist/core/src/hooks/useSnackbarController.d.ts +20 -0
- package/dist/core/src/hooks/useStorageSource.d.ts +7 -0
- package/dist/core/src/hooks/useStudioBridge.d.ts +91 -0
- package/dist/core/src/hooks/useTranslation.d.ts +17 -0
- package/dist/core/src/hooks/useUnsavedChangesDialog.d.ts +12 -0
- package/dist/core/src/hooks/useUserConfigurationPersistence.d.ts +8 -0
- package/dist/core/src/hooks/useValidateAuthenticator.d.ts +21 -0
- package/dist/core/src/i18n/RebaseI18nProvider.d.ts +33 -0
- package/dist/core/src/index.d.ts +15 -0
- package/dist/core/src/internal/common.d.ts +3 -0
- package/dist/core/src/internal/useRestoreScroll.d.ts +6 -0
- package/dist/core/src/locales/de.d.ts +2 -0
- package/dist/core/src/locales/en.d.ts +10 -0
- package/dist/core/src/locales/es.d.ts +10 -0
- package/dist/core/src/locales/fr.d.ts +2 -0
- package/dist/core/src/locales/hi.d.ts +2 -0
- package/dist/core/src/locales/it.d.ts +2 -0
- package/dist/core/src/locales/pt.d.ts +7 -0
- package/dist/core/src/util/constants.d.ts +1 -0
- package/dist/core/src/util/createFormexStub.d.ts +2 -0
- package/dist/core/src/util/entity_cache.d.ts +27 -0
- package/dist/core/src/util/enums.d.ts +5 -0
- package/dist/core/src/util/icon_list.d.ts +5 -0
- package/dist/core/src/util/icon_synonyms.d.ts +1 -0
- package/dist/core/src/util/icons.d.ts +20 -0
- package/dist/core/src/util/index.d.ts +10 -0
- package/dist/core/src/util/previews.d.ts +4 -0
- package/dist/core/src/util/useStorageUploadController.d.ts +38 -0
- package/dist/core/src/util/useTraceUpdate.d.ts +2 -0
- package/dist/formex/src/Field.d.ts +52 -0
- package/dist/formex/src/Formex.d.ts +7 -0
- package/dist/formex/src/index.d.ts +5 -0
- package/dist/formex/src/types.d.ts +40 -0
- package/dist/formex/src/useCreateFormex.d.ts +14 -0
- package/dist/formex/src/utils.d.ts +16 -0
- package/dist/index.es.js +726 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +9647 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/studio/src/components/ApiExplorer/ApiExplorer.d.ts +9 -0
- package/dist/studio/src/components/ApiExplorer/EndpointDetail.d.ts +9 -0
- package/dist/studio/src/components/ApiExplorer/TryItPanel.d.ts +15 -0
- package/dist/studio/src/components/ApiExplorer/parseSpec.d.ts +16 -0
- package/dist/studio/src/components/ApiExplorer/types.d.ts +90 -0
- package/dist/studio/src/components/AuthSimulationSelector.d.ts +11 -0
- package/dist/studio/src/components/Branches/BranchesView.d.ts +1 -0
- package/dist/studio/src/components/CronJobs/CronJobsView.d.ts +1 -0
- package/dist/studio/src/components/JSEditor/JSEditor.d.ts +1 -0
- package/dist/studio/src/components/JSEditor/JSEditorSidebar.d.ts +21 -0
- package/dist/studio/src/components/JSEditor/JSMonacoEditor.d.ts +18 -0
- package/dist/studio/src/components/RLSEditor/PolicyEditor.d.ts +9 -0
- package/dist/studio/src/components/RLSEditor/RLSEditor.d.ts +19 -0
- package/dist/studio/src/components/RLSEditor/index.d.ts +1 -0
- package/dist/studio/src/components/RebaseStudio.d.ts +2 -0
- package/dist/studio/src/components/SQLEditor/ExplainVisualizer.d.ts +24 -0
- package/dist/studio/src/components/SQLEditor/MonacoEditor.d.ts +17 -0
- package/dist/studio/src/components/SQLEditor/SQLEditor.d.ts +11 -0
- package/dist/studio/src/components/SQLEditor/SQLEditorSidebar.d.ts +21 -0
- package/dist/studio/src/components/SQLEditor/SchemaBrowser.d.ts +8 -0
- package/dist/studio/src/components/SchemaVisualizer/RelationEdge.d.ts +3 -0
- package/dist/studio/src/components/SchemaVisualizer/SchemaVisualizer.d.ts +2 -0
- package/dist/studio/src/components/SchemaVisualizer/TableNode.d.ts +3 -0
- package/dist/studio/src/components/SchemaVisualizer/index.d.ts +5 -0
- package/dist/studio/src/components/SchemaVisualizer/schema-visualizer.utils.d.ts +42 -0
- package/dist/studio/src/components/SchemaVisualizer/useSchemaGraph.d.ts +37 -0
- package/dist/studio/src/components/StorageView/StorageView.d.ts +1 -0
- package/dist/studio/src/components/StudioHomePage.d.ts +9 -0
- package/dist/studio/src/index.d.ts +4 -0
- package/dist/studio/src/utils/entities.d.ts +0 -0
- package/dist/studio/src/utils/pgColumnToProperty.d.ts +6 -0
- package/dist/studio/src/utils/sql_utils.d.ts +52 -0
- package/dist/types/src/controllers/analytics_controller.d.ts +7 -0
- package/dist/types/src/controllers/auth.d.ts +119 -0
- package/dist/types/src/controllers/client.d.ts +170 -0
- package/dist/types/src/controllers/collection_registry.d.ts +45 -0
- package/dist/types/src/controllers/customization_controller.d.ts +60 -0
- package/dist/types/src/controllers/data.d.ts +168 -0
- package/dist/types/src/controllers/data_driver.d.ts +160 -0
- package/dist/types/src/controllers/database_admin.d.ts +11 -0
- package/dist/types/src/controllers/dialogs_controller.d.ts +36 -0
- package/dist/types/src/controllers/effective_role.d.ts +4 -0
- package/dist/types/src/controllers/email.d.ts +34 -0
- package/dist/types/src/controllers/index.d.ts +18 -0
- package/dist/types/src/controllers/local_config_persistence.d.ts +20 -0
- package/dist/types/src/controllers/navigation.d.ts +213 -0
- package/dist/types/src/controllers/registry.d.ts +54 -0
- package/dist/types/src/controllers/side_dialogs_controller.d.ts +67 -0
- package/dist/types/src/controllers/side_entity_controller.d.ts +90 -0
- package/dist/types/src/controllers/snackbar.d.ts +24 -0
- package/dist/types/src/controllers/storage.d.ts +171 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/rebase_context.d.ts +105 -0
- package/dist/types/src/types/backend.d.ts +536 -0
- package/dist/types/src/types/builders.d.ts +15 -0
- package/dist/types/src/types/chips.d.ts +5 -0
- package/dist/types/src/types/collections.d.ts +856 -0
- package/dist/types/src/types/cron.d.ts +102 -0
- package/dist/types/src/types/data_source.d.ts +64 -0
- package/dist/types/src/types/entities.d.ts +145 -0
- package/dist/types/src/types/entity_actions.d.ts +98 -0
- package/dist/types/src/types/entity_callbacks.d.ts +173 -0
- package/dist/types/src/types/entity_link_builder.d.ts +7 -0
- package/dist/types/src/types/entity_overrides.d.ts +10 -0
- package/dist/types/src/types/entity_views.d.ts +61 -0
- package/dist/types/src/types/export_import.d.ts +21 -0
- package/dist/types/src/types/index.d.ts +23 -0
- package/dist/types/src/types/locales.d.ts +4 -0
- package/dist/types/src/types/modify_collections.d.ts +5 -0
- package/dist/types/src/types/plugins.d.ts +279 -0
- package/dist/types/src/types/properties.d.ts +1176 -0
- package/dist/types/src/types/property_config.d.ts +70 -0
- package/dist/types/src/types/relations.d.ts +336 -0
- package/dist/types/src/types/slots.d.ts +252 -0
- package/dist/types/src/types/translations.d.ts +870 -0
- package/dist/types/src/types/user_management_delegate.d.ts +121 -0
- package/dist/types/src/types/websockets.d.ts +78 -0
- package/dist/types/src/users/index.d.ts +2 -0
- package/dist/types/src/users/roles.d.ts +22 -0
- package/dist/types/src/users/user.d.ts +46 -0
- package/dist/ui/src/components/Alert.d.ts +12 -0
- package/dist/ui/src/components/Autocomplete.d.ts +21 -0
- package/dist/ui/src/components/Avatar.d.ts +11 -0
- package/dist/ui/src/components/Badge.d.ts +8 -0
- package/dist/ui/src/components/BooleanSwitch.d.ts +14 -0
- package/dist/ui/src/components/BooleanSwitchWithLabel.d.ts +17 -0
- package/dist/ui/src/components/Button.d.ts +14 -0
- package/dist/ui/src/components/Card.d.ts +9 -0
- package/dist/ui/src/components/CenteredView.d.ts +9 -0
- package/dist/ui/src/components/Checkbox.d.ts +13 -0
- package/dist/ui/src/components/Chip.d.ts +26 -0
- package/dist/ui/src/components/CircularProgress.d.ts +5 -0
- package/dist/ui/src/components/CircularProgressCenter.d.ts +11 -0
- package/dist/ui/src/components/Collapse.d.ts +9 -0
- package/dist/ui/src/components/ColorPicker.d.ts +30 -0
- package/dist/ui/src/components/Container.d.ts +8 -0
- package/dist/ui/src/components/DateTimeField.d.ts +24 -0
- package/dist/ui/src/components/DebouncedTextField.d.ts +2 -0
- package/dist/ui/src/components/Dialog.d.ts +39 -0
- package/dist/ui/src/components/DialogActions.d.ts +7 -0
- package/dist/ui/src/components/DialogContent.d.ts +7 -0
- package/dist/ui/src/components/DialogTitle.d.ts +10 -0
- package/dist/ui/src/components/ErrorBoundary.d.ts +11 -0
- package/dist/ui/src/components/ExpandablePanel.d.ts +12 -0
- package/dist/ui/src/components/FileUpload.d.ts +23 -0
- package/dist/ui/src/components/IconButton.d.ts +12 -0
- package/dist/ui/src/components/InfoLabel.d.ts +5 -0
- package/dist/ui/src/components/InputLabel.d.ts +11 -0
- package/dist/ui/src/components/Label.d.ts +7 -0
- package/dist/ui/src/components/LoadingButton.d.ts +7 -0
- package/dist/ui/src/components/Markdown.d.ts +10 -0
- package/dist/ui/src/components/Menu.d.ts +23 -0
- package/dist/ui/src/components/Menubar.d.ts +80 -0
- package/dist/ui/src/components/MultiSelect.d.ts +48 -0
- package/dist/ui/src/components/Paper.d.ts +6 -0
- package/dist/ui/src/components/Popover.d.ts +24 -0
- package/dist/ui/src/components/RadioGroup.d.ts +28 -0
- package/dist/ui/src/components/ResizablePanels.d.ts +18 -0
- package/dist/ui/src/components/SearchBar.d.ts +22 -0
- package/dist/ui/src/components/Select.d.ts +43 -0
- package/dist/ui/src/components/Separator.d.ts +5 -0
- package/dist/ui/src/components/Sheet.d.ts +22 -0
- package/dist/ui/src/components/Skeleton.d.ts +6 -0
- package/dist/ui/src/components/Slider.d.ts +21 -0
- package/dist/ui/src/components/Table.d.ts +34 -0
- package/dist/ui/src/components/Tabs.d.ts +19 -0
- package/dist/ui/src/components/TextField.d.ts +58 -0
- package/dist/ui/src/components/TextareaAutosize.d.ts +43 -0
- package/dist/ui/src/components/ToggleButtonGroup.d.ts +30 -0
- package/dist/ui/src/components/Tooltip.d.ts +19 -0
- package/dist/ui/src/components/Typography.d.ts +36 -0
- package/dist/ui/src/components/VirtualTable/VirtualTable.d.ts +11 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableCell.d.ts +21 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableHeader.d.ts +29 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +2 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableProps.d.ts +243 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableRow.d.ts +3 -0
- package/dist/ui/src/components/VirtualTable/index.d.ts +3 -0
- package/dist/ui/src/components/VirtualTable/types.d.ts +38 -0
- package/dist/ui/src/components/common/SelectInputLabel.d.ts +5 -0
- package/dist/ui/src/components/index.d.ts +53 -0
- package/dist/ui/src/hooks/PortalContainerContext.d.ts +31 -0
- package/dist/ui/src/hooks/index.d.ts +6 -0
- package/dist/ui/src/hooks/useDebounceCallback.d.ts +1 -0
- package/dist/ui/src/hooks/useDebounceValue.d.ts +1 -0
- package/dist/ui/src/hooks/useDebouncedCallback.d.ts +1 -0
- package/dist/ui/src/hooks/useInjectStyles.d.ts +7 -0
- package/dist/ui/src/hooks/useOutsideAlerter.d.ts +5 -0
- package/dist/ui/src/icons/GitHubIcon.d.ts +2 -0
- package/dist/ui/src/icons/HandleIcon.d.ts +1 -0
- package/dist/ui/src/icons/Icon.d.ts +20 -0
- package/dist/ui/src/icons/cool_icon_keys.d.ts +1 -0
- package/dist/ui/src/icons/icon_keys.d.ts +1 -0
- package/dist/ui/src/icons/index.d.ts +6 -0
- package/dist/ui/src/index.d.ts +5 -0
- package/dist/ui/src/styles.d.ts +12 -0
- package/dist/ui/src/util/chip_colors.d.ts +4 -0
- package/dist/ui/src/util/cls.d.ts +2 -0
- package/dist/ui/src/util/debounce.d.ts +10 -0
- package/dist/ui/src/util/hash.d.ts +1 -0
- package/dist/ui/src/util/index.d.ts +4 -0
- package/dist/ui/src/util/key_to_icon_component.d.ts +1 -0
- package/package.json +84 -0
- package/src/components/ApiExplorer/ApiExplorer.tsx +290 -0
- package/src/components/ApiExplorer/EndpointDetail.tsx +271 -0
- package/src/components/ApiExplorer/TryItPanel.tsx +510 -0
- package/src/components/ApiExplorer/parseSpec.ts +104 -0
- package/src/components/ApiExplorer/types.ts +84 -0
- package/src/components/AuthSimulationSelector.tsx +77 -0
- package/src/components/Branches/BranchesView.tsx +370 -0
- package/src/components/CronJobs/CronJobsView.tsx +346 -0
- package/src/components/JSEditor/JSEditor.tsx +1033 -0
- package/src/components/JSEditor/JSEditorSidebar.tsx +340 -0
- package/src/components/JSEditor/JSMonacoEditor.tsx +390 -0
- package/src/components/RLSEditor/PolicyEditor.tsx +444 -0
- package/src/components/RLSEditor/RLSEditor.tsx +692 -0
- package/src/components/RLSEditor/index.ts +1 -0
- package/src/components/RebaseStudio.tsx +121 -0
- package/src/components/SQLEditor/ExplainVisualizer.tsx +128 -0
- package/src/components/SQLEditor/MonacoEditor.tsx +203 -0
- package/src/components/SQLEditor/SQLEditor.tsx +1419 -0
- package/src/components/SQLEditor/SQLEditorSidebar.tsx +174 -0
- package/src/components/SQLEditor/SchemaBrowser.tsx +158 -0
- package/src/components/SchemaVisualizer/RelationEdge.tsx +102 -0
- package/src/components/SchemaVisualizer/SchemaVisualizer.tsx +665 -0
- package/src/components/SchemaVisualizer/TableNode.tsx +257 -0
- package/src/components/SchemaVisualizer/index.ts +5 -0
- package/src/components/SchemaVisualizer/schema-visualizer.utils.ts +140 -0
- package/src/components/SchemaVisualizer/useSchemaGraph.ts +397 -0
- package/src/components/StorageView/StorageView.tsx +1035 -0
- package/src/components/StudioHomePage.tsx +357 -0
- package/src/index.ts +31 -0
- package/src/utils/entities.ts +2 -0
- package/src/utils/pgColumnToProperty.test.ts +401 -0
- package/src/utils/pgColumnToProperty.ts +275 -0
- package/src/utils/sql_utils.test.ts +265 -0
- package/src/utils/sql_utils.ts +291 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom-built API Explorer for Rebase Studio.
|
|
3
|
+
* No external dependencies — renders the OpenAPI spec natively
|
|
4
|
+
* with deep integration into the Rebase auth system.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ApiExplorer(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace ApiExplorer {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ParsedEndpoint, OpenApiSpec } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Renders the documentation view for a single API endpoint:
|
|
4
|
+
* parameters, request body schema, response schemas.
|
|
5
|
+
*/
|
|
6
|
+
export declare function EndpointDetail({ endpoint, spec }: {
|
|
7
|
+
endpoint: ParsedEndpoint;
|
|
8
|
+
spec: OpenApiSpec;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ParsedEndpoint } from "./types";
|
|
2
|
+
import type { User } from "@rebasepro/types";
|
|
3
|
+
interface TryItPanelProps {
|
|
4
|
+
endpoint: ParsedEndpoint;
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
getAuthToken: () => Promise<string | null | undefined>;
|
|
7
|
+
user: User | null;
|
|
8
|
+
basePath?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Interactive "Try It" panel that lets the user execute API requests
|
|
12
|
+
* using their current JWT token directly from the Studio.
|
|
13
|
+
*/
|
|
14
|
+
export declare function TryItPanel({ endpoint, apiUrl, getAuthToken, user, basePath }: TryItPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OpenApiSpec, ParsedEndpoint, EndpointGroup } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Parse an OpenAPI 3.x spec into grouped, sorted endpoints for the sidebar.
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseOpenApiSpec(spec: OpenApiSpec): {
|
|
6
|
+
groups: EndpointGroup[];
|
|
7
|
+
allEndpoints: ParsedEndpoint[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a $ref string (e.g. "#/components/schemas/Author") to a schema name.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveRefName(ref: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve a $ref to its actual schema from the spec.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveRef(spec: OpenApiSpec, ref: string): any;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** Minimal OpenAPI 3.x types we care about */
|
|
2
|
+
export interface OpenApiSpec {
|
|
3
|
+
openapi: string;
|
|
4
|
+
info: {
|
|
5
|
+
title: string;
|
|
6
|
+
version: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
};
|
|
9
|
+
servers?: {
|
|
10
|
+
url: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}[];
|
|
13
|
+
paths: Record<string, Record<string, OpenApiOperation>>;
|
|
14
|
+
components?: {
|
|
15
|
+
schemas?: Record<string, OpenApiSchema>;
|
|
16
|
+
securitySchemes?: Record<string, any>;
|
|
17
|
+
};
|
|
18
|
+
tags?: {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
}[];
|
|
22
|
+
security?: Record<string, string[]>[];
|
|
23
|
+
}
|
|
24
|
+
export interface OpenApiOperation {
|
|
25
|
+
operationId?: string;
|
|
26
|
+
summary?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
tags?: string[];
|
|
29
|
+
parameters?: OpenApiParameter[];
|
|
30
|
+
requestBody?: {
|
|
31
|
+
required?: boolean;
|
|
32
|
+
content?: Record<string, {
|
|
33
|
+
schema?: OpenApiSchema;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
responses?: Record<string, {
|
|
37
|
+
description?: string;
|
|
38
|
+
content?: Record<string, {
|
|
39
|
+
schema?: OpenApiSchema;
|
|
40
|
+
}>;
|
|
41
|
+
}>;
|
|
42
|
+
security?: Record<string, string[]>[];
|
|
43
|
+
}
|
|
44
|
+
export interface OpenApiParameter {
|
|
45
|
+
name: string;
|
|
46
|
+
in: "query" | "path" | "header" | "cookie";
|
|
47
|
+
description?: string;
|
|
48
|
+
required?: boolean;
|
|
49
|
+
schema?: OpenApiSchema;
|
|
50
|
+
}
|
|
51
|
+
export interface OpenApiSchema {
|
|
52
|
+
type?: string;
|
|
53
|
+
format?: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
properties?: Record<string, OpenApiSchema>;
|
|
56
|
+
required?: string[];
|
|
57
|
+
items?: OpenApiSchema;
|
|
58
|
+
enum?: (string | number)[];
|
|
59
|
+
oneOf?: OpenApiSchema[];
|
|
60
|
+
anyOf?: OpenApiSchema[];
|
|
61
|
+
allOf?: OpenApiSchema[];
|
|
62
|
+
$ref?: string;
|
|
63
|
+
readOnly?: boolean;
|
|
64
|
+
minimum?: number;
|
|
65
|
+
maximum?: number;
|
|
66
|
+
maxLength?: number;
|
|
67
|
+
minLength?: number;
|
|
68
|
+
default?: any;
|
|
69
|
+
example?: any;
|
|
70
|
+
additionalProperties?: boolean | OpenApiSchema;
|
|
71
|
+
}
|
|
72
|
+
export interface ParsedEndpoint {
|
|
73
|
+
id: string;
|
|
74
|
+
method: string;
|
|
75
|
+
path: string;
|
|
76
|
+
shortPath: string;
|
|
77
|
+
summary: string;
|
|
78
|
+
description: string;
|
|
79
|
+
tags: string[];
|
|
80
|
+
parameters: OpenApiParameter[];
|
|
81
|
+
requestBody?: OpenApiOperation["requestBody"];
|
|
82
|
+
responses: NonNullable<OpenApiOperation["responses"]>;
|
|
83
|
+
security?: OpenApiOperation["security"];
|
|
84
|
+
operationId?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface EndpointGroup {
|
|
87
|
+
tag: string;
|
|
88
|
+
description?: string;
|
|
89
|
+
endpoints: ParsedEndpoint[];
|
|
90
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SelectableUser } from "@rebasepro/core";
|
|
2
|
+
export interface AuthSimulationSelectorProps {
|
|
3
|
+
authMode: "jwt" | "none";
|
|
4
|
+
setAuthMode: (mode: "jwt" | "none") => void;
|
|
5
|
+
selectedUser: SelectableUser | null;
|
|
6
|
+
setSelectedUser: (user: SelectableUser | null) => void;
|
|
7
|
+
users: SelectableUser[];
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
currentUser: SelectableUser | null;
|
|
10
|
+
}
|
|
11
|
+
export declare function AuthSimulationSelector({ authMode, setAuthMode, selectedUser, setSelectedUser, users, loading, currentUser }: AuthSimulationSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function BranchesView(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CronJobsView(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function JSEditor(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface JSSnippet {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
code: string;
|
|
5
|
+
createdAt: number;
|
|
6
|
+
isFavorite?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface CollectionInfo {
|
|
9
|
+
slug: string;
|
|
10
|
+
properties: string[];
|
|
11
|
+
}
|
|
12
|
+
interface JSEditorSidebarProps {
|
|
13
|
+
collections: CollectionInfo[];
|
|
14
|
+
snippets: JSSnippet[];
|
|
15
|
+
history: string[];
|
|
16
|
+
onSelectSnippet: (code: string) => void;
|
|
17
|
+
onDeleteSnippet: (id: string) => void;
|
|
18
|
+
onInsertCode: (code: string) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const JSEditorSidebar: ({ collections, snippets, history, onSelectSnippet, onDeleteSnippet, onInsertCode }: JSEditorSidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type CollectionInfo = {
|
|
2
|
+
slug: string;
|
|
3
|
+
name: string;
|
|
4
|
+
properties: string[];
|
|
5
|
+
};
|
|
6
|
+
export type JSMonacoEditorProps = {
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (value: string | undefined) => void;
|
|
9
|
+
onRun?: (selectedText?: string) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
readOnly?: boolean;
|
|
12
|
+
autoFocus?: boolean;
|
|
13
|
+
/** Collection slugs for basic autocomplete */
|
|
14
|
+
collectionSlugs?: string[];
|
|
15
|
+
/** Full collection info with property names for richer type generation */
|
|
16
|
+
collections?: CollectionInfo[];
|
|
17
|
+
};
|
|
18
|
+
export declare const JSMonacoEditor: ({ value, onChange, onRun, className, readOnly, autoFocus, collectionSlugs, collections }: JSMonacoEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PostgresPolicy } from "./RLSEditor";
|
|
2
|
+
export interface PolicyEditorProps {
|
|
3
|
+
policy?: PostgresPolicy;
|
|
4
|
+
schema: string;
|
|
5
|
+
table: string;
|
|
6
|
+
onSave: (policyData: Partial<PostgresPolicy>) => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const PolicyEditor: ({ policy, schema, table, onSave, onCancel }: PolicyEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface PostgresPolicy {
|
|
2
|
+
policyname: string;
|
|
3
|
+
tablename: string;
|
|
4
|
+
permissive: "PERMISSIVE" | "RESTRICTIVE";
|
|
5
|
+
roles: string[];
|
|
6
|
+
cmd: "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "ALL";
|
|
7
|
+
qual: string | null;
|
|
8
|
+
with_check: string | null;
|
|
9
|
+
status?: "live" | "code_only" | "both";
|
|
10
|
+
}
|
|
11
|
+
export interface TableRLSStatus {
|
|
12
|
+
schemaName: string;
|
|
13
|
+
tableName: string;
|
|
14
|
+
rlsEnabled: boolean;
|
|
15
|
+
policies: PostgresPolicy[];
|
|
16
|
+
}
|
|
17
|
+
export declare const RLSEditor: ({ apiUrl }: {
|
|
18
|
+
apiUrl?: string;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RLSEditor";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ExplainPlanNode {
|
|
3
|
+
"Node Type": string;
|
|
4
|
+
"Relation Name"?: string;
|
|
5
|
+
"Alias"?: string;
|
|
6
|
+
"Startup Cost": number;
|
|
7
|
+
"Total Cost": number;
|
|
8
|
+
"Plan Rows": number;
|
|
9
|
+
"Plan Width": number;
|
|
10
|
+
"Actual Startup Time"?: number;
|
|
11
|
+
"Actual Total Time"?: number;
|
|
12
|
+
"Actual Rows"?: number;
|
|
13
|
+
"Actual Loops"?: number;
|
|
14
|
+
"Filter"?: string;
|
|
15
|
+
"Index Cond"?: string;
|
|
16
|
+
"Hash Cond"?: string;
|
|
17
|
+
"Plans"?: ExplainPlanNode[];
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
export interface ExplainVisualizerProps {
|
|
21
|
+
plan: ExplainPlanNode;
|
|
22
|
+
isRoot?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const ExplainVisualizer: React.FC<ExplainVisualizerProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type MonacoEditorProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string | undefined) => void;
|
|
4
|
+
onRun?: (selectedText?: string) => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
readOnly?: boolean;
|
|
7
|
+
autoFocus?: boolean;
|
|
8
|
+
schemas?: Record<string, {
|
|
9
|
+
schemaName: string;
|
|
10
|
+
tableName: string;
|
|
11
|
+
columns: {
|
|
12
|
+
name: string;
|
|
13
|
+
dataType: string;
|
|
14
|
+
}[];
|
|
15
|
+
}[]>;
|
|
16
|
+
};
|
|
17
|
+
export declare const MonacoEditor: ({ value, onChange, onRun, className, readOnly, autoFocus, schemas }: MonacoEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SQLEditorColumnInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
dataType: string;
|
|
4
|
+
isPrimaryKey: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface TableInfo {
|
|
7
|
+
schemaName: string;
|
|
8
|
+
tableName: string;
|
|
9
|
+
columns: SQLEditorColumnInfo[];
|
|
10
|
+
}
|
|
11
|
+
export declare const SQLEditor: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TableInfo } from "./SQLEditor";
|
|
2
|
+
export interface Snippet {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
sql: string;
|
|
6
|
+
createdAt: number;
|
|
7
|
+
isFavorite?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface SQLEditorSidebarProps {
|
|
10
|
+
onSelectSnippet: (sql: string) => void;
|
|
11
|
+
onTableClick: (tableName: string) => void;
|
|
12
|
+
snippets: Snippet[];
|
|
13
|
+
history: string[];
|
|
14
|
+
onDeleteSnippet: (id: string) => void;
|
|
15
|
+
schemas: Record<string, TableInfo[]>;
|
|
16
|
+
isSchemaLoading: boolean;
|
|
17
|
+
schemaError: string | null;
|
|
18
|
+
onRetrySchema: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const SQLEditorSidebar: ({ onSelectSnippet, onTableClick, snippets, history, onDeleteSnippet, schemas, isSchemaLoading, schemaError, onRetrySchema }: SQLEditorSidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableInfo } from "./SQLEditor";
|
|
2
|
+
export declare const SchemaBrowser: ({ onTableClick, schemas, isSchemaLoading, schemaError, onRetrySchema }: {
|
|
3
|
+
onTableClick?: (tableName: string) => void;
|
|
4
|
+
schemas: Record<string, TableInfo[]>;
|
|
5
|
+
isSchemaLoading: boolean;
|
|
6
|
+
schemaError: string | null;
|
|
7
|
+
onRetrySchema: () => void;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { EdgeProps } from "@xyflow/react";
|
|
3
|
+
export declare const RelationEdge: React.MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, selected }: EdgeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Node, Edge } from "@xyflow/react";
|
|
2
|
+
export declare const NODE_WIDTH = 280;
|
|
3
|
+
/** Header with a single line of text (junction tables or tableName === collectionName). */
|
|
4
|
+
export declare const HEADER_HEIGHT_SINGLE = 33;
|
|
5
|
+
/** Header with two lines (name + subtitle when collectionName !== tableName). */
|
|
6
|
+
export declare const HEADER_HEIGHT_DOUBLE = 47;
|
|
7
|
+
/**
|
|
8
|
+
* Compute the correct header height for a table node.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getHeaderHeight: (opts: {
|
|
11
|
+
isJunction: boolean;
|
|
12
|
+
collectionName: string;
|
|
13
|
+
tableName: string;
|
|
14
|
+
}) => number;
|
|
15
|
+
/**
|
|
16
|
+
* Estimate the pixel height of a table node based on column count.
|
|
17
|
+
*/
|
|
18
|
+
export declare const estimateNodeHeight: (columnCount: number, headerHeight?: number) => number;
|
|
19
|
+
/**
|
|
20
|
+
* Get the vertical center Y of a specific column row (0-indexed)
|
|
21
|
+
* relative to the top of the node.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getColumnRowY: (rowIndex: number, headerHeight?: number) => number;
|
|
24
|
+
export type LayoutDirection = "TB" | "LR";
|
|
25
|
+
/**
|
|
26
|
+
* Compute node positions using the dagre graph layout engine.
|
|
27
|
+
* Returns a new array of nodes with updated `position`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const getLayoutedElements: (nodes: Node[], edges: Edge[], direction?: LayoutDirection) => {
|
|
30
|
+
nodes: Node[];
|
|
31
|
+
edges: Edge[];
|
|
32
|
+
};
|
|
33
|
+
export declare const getTypeLabel: (type: string) => string;
|
|
34
|
+
export interface RelationEdgeData {
|
|
35
|
+
cardinality: "one" | "many";
|
|
36
|
+
direction: "owning" | "inverse";
|
|
37
|
+
relationName: string;
|
|
38
|
+
hasJunction: boolean;
|
|
39
|
+
hasJoinPath: boolean;
|
|
40
|
+
label: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const getCardinalityLabel: (cardinality: "one" | "many", direction: "owning" | "inverse") => string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Node, Edge } from "@xyflow/react";
|
|
2
|
+
import type { EntityCollection } from "@rebasepro/types";
|
|
3
|
+
import type { LayoutDirection } from "./schema-visualizer.utils";
|
|
4
|
+
export interface ColumnInfo {
|
|
5
|
+
name: string;
|
|
6
|
+
type: string;
|
|
7
|
+
typeLabel: string;
|
|
8
|
+
isPrimaryKey: boolean;
|
|
9
|
+
isForeignKey: boolean;
|
|
10
|
+
isRequired: boolean;
|
|
11
|
+
isEnum: boolean;
|
|
12
|
+
enumValues?: string[];
|
|
13
|
+
relationName?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TableNodeData {
|
|
16
|
+
tableName: string;
|
|
17
|
+
collectionName: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
columns: ColumnInfo[];
|
|
20
|
+
isJunction: boolean;
|
|
21
|
+
isUnmanaged: boolean;
|
|
22
|
+
rlsEnabled: boolean;
|
|
23
|
+
historyEnabled: boolean;
|
|
24
|
+
icon?: string;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
export interface UseSchemaGraphResult {
|
|
28
|
+
nodes: Node[];
|
|
29
|
+
edges: Edge[];
|
|
30
|
+
direction: LayoutDirection;
|
|
31
|
+
setDirection: (dir: LayoutDirection) => void;
|
|
32
|
+
relayout: () => void;
|
|
33
|
+
isLoading: boolean;
|
|
34
|
+
tableCount: number;
|
|
35
|
+
relationCount: number;
|
|
36
|
+
}
|
|
37
|
+
export declare const useSchemaGraph: (collections: EntityCollection[] | undefined) => UseSchemaGraphResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StorageView: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HomePageSection } from "@rebasepro/types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export declare function StudioHomePage({ additionalActions, additionalChildrenStart, additionalChildrenEnd, sections, hiddenGroups }: {
|
|
4
|
+
additionalActions?: React.ReactNode;
|
|
5
|
+
additionalChildrenStart?: React.ReactNode;
|
|
6
|
+
additionalChildrenEnd?: React.ReactNode;
|
|
7
|
+
sections?: HomePageSection[];
|
|
8
|
+
hiddenGroups?: string[];
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { StudioBridgeProvider, StudioBridgeContext, useStudioCollectionRegistry, useStudioSideEntityController, useStudioUrlController, useStudioNavigationState, useStudioBreadcrumbs } from "@rebasepro/core";
|
|
2
|
+
export type { StudioBridge, BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/core";
|
|
3
|
+
export * from "./components/RebaseStudio";
|
|
4
|
+
export * from "./components/StudioHomePage";
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EntityCollection, TableMetadata } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* Builds a partial EntityCollection from PostgreSQL table metadata.
|
|
4
|
+
* This is used when creating a new collection from an existing database table.
|
|
5
|
+
*/
|
|
6
|
+
export declare function buildCollectionFromTableMetadata(tableName: string, metadata: TableMetadata): Partial<EntityCollection>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { TableInfo } from "../components/SQLEditor/SQLEditor";
|
|
2
|
+
import { EntityCollection } from "@rebasepro/types";
|
|
3
|
+
/**
|
|
4
|
+
* A table extracted from a SQL query's FROM/JOIN clauses.
|
|
5
|
+
*/
|
|
6
|
+
export interface ExtractedTable {
|
|
7
|
+
name: string;
|
|
8
|
+
alias?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A collection matched to a table in a SQL query.
|
|
12
|
+
*/
|
|
13
|
+
export interface ResolvedQueryCollection {
|
|
14
|
+
/** DB table name from the SQL AST (e.g. "blog_posts") */
|
|
15
|
+
tableName: string;
|
|
16
|
+
/** SQL alias if present (e.g. "bp") */
|
|
17
|
+
tableAlias?: string;
|
|
18
|
+
/** The matched collection */
|
|
19
|
+
collection: EntityCollection;
|
|
20
|
+
/** Columns from this table that are present in the result set */
|
|
21
|
+
columns: string[];
|
|
22
|
+
/** The result column name that holds the primary key for this table (e.g. "id", "author_id") */
|
|
23
|
+
pkColumn?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Extract all tables referenced in a SQL query's FROM and JOIN clauses.
|
|
27
|
+
* Returns an empty array for non-SELECT queries or parse failures.
|
|
28
|
+
*/
|
|
29
|
+
export declare function extractTablesFromQuery(sqlString: string): ExtractedTable[];
|
|
30
|
+
/**
|
|
31
|
+
* Resolve which collections are referenced by a SQL query.
|
|
32
|
+
*
|
|
33
|
+
* Parses the SQL, extracts table names, and matches each against
|
|
34
|
+
* registered collections via `collection.table` (falling back to
|
|
35
|
+
* snake_case of `collection.slug`).
|
|
36
|
+
*
|
|
37
|
+
* For each matched collection, determines which result columns
|
|
38
|
+
* belong to that table using the database schema information.
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveQueryCollections(sqlString: string, schemas: Record<string, TableInfo[]>, collections: EntityCollection[], resultColumns?: string[]): ResolvedQueryCollection[];
|
|
41
|
+
export interface PKMapping {
|
|
42
|
+
/** The actual column name in the database table */
|
|
43
|
+
dbColumn: string;
|
|
44
|
+
/** The column name as it appears in the query result set (may be aliased) */
|
|
45
|
+
resultColumn: string;
|
|
46
|
+
}
|
|
47
|
+
export interface TableAndPKResult {
|
|
48
|
+
tableName?: string;
|
|
49
|
+
primaryKeys?: PKMapping[];
|
|
50
|
+
error?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function determineTableAndPK(sqlString: string, columnKey: string, schemas: Record<string, TableInfo[]>): TableAndPKResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type AnalyticsController = {
|
|
2
|
+
/**
|
|
3
|
+
* Callback used to get analytics events from the CMS
|
|
4
|
+
*/
|
|
5
|
+
onAnalyticsEvent?: (event: AnalyticsEvent, data?: object) => void;
|
|
6
|
+
};
|
|
7
|
+
export type AnalyticsEvent = "entity_click" | "entity_click_from_reference" | "reference_selection_clear" | "reference_selection_toggle" | "reference_selected_single" | "reference_selection_new_entity" | "edit_entity_clicked" | "entity_edited" | "new_entity_click" | "new_entity_saved" | "copy_entity_click" | "entity_copied" | "single_delete_dialog_open" | "multiple_delete_dialog_open" | "single_entity_deleted" | "multiple_entities_deleted" | "drawer_navigate_to_home" | "drawer_navigate_to_collection" | "drawer_navigate_to_view" | "home_navigate_to_collection" | "home_favorite_navigate_to_collection" | "home_navigate_to_view" | "home_navigate_to_admin_view" | "home_favorite_navigate_to_view" | "home_move_card" | "home_move_group" | "home_drop_new_group" | "collection_inline_editing" | "view_mode_changed" | "kanban_card_moved" | "kanban_column_reorder" | "kanban_property_changed" | "kanban_new_entity_in_column" | "kanban_backfill_order" | "card_view_entity_click" | "unmapped_event";
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { StorageSource } from "./storage";
|
|
2
|
+
import { Role, User } from "../users";
|
|
3
|
+
import { RebaseData } from "./data";
|
|
4
|
+
/**
|
|
5
|
+
* Capabilities advertised by an auth provider.
|
|
6
|
+
* UI components use this to show/hide features dynamically
|
|
7
|
+
* (e.g. password reset, registration, session management).
|
|
8
|
+
* @group Hooks and utilities
|
|
9
|
+
*/
|
|
10
|
+
export interface AuthCapabilities {
|
|
11
|
+
emailPasswordLogin?: boolean;
|
|
12
|
+
googleLogin?: boolean;
|
|
13
|
+
registration?: boolean;
|
|
14
|
+
passwordReset?: boolean;
|
|
15
|
+
sessionManagement?: boolean;
|
|
16
|
+
profileUpdate?: boolean;
|
|
17
|
+
emailVerification?: boolean;
|
|
18
|
+
/** List of enabled OAuth provider IDs (e.g. ["google", "github", "discord"]) */
|
|
19
|
+
enabledProviders?: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Controller for retrieving the logged user or performing auth related operations.
|
|
23
|
+
* Note that if you are implementing your AuthController, you probably will want
|
|
24
|
+
* to do it as the result of a hook.
|
|
25
|
+
* @group Hooks and utilities
|
|
26
|
+
*/
|
|
27
|
+
export type AuthController<USER extends User = User, ExtraData = unknown> = {
|
|
28
|
+
/**
|
|
29
|
+
* The user currently logged in
|
|
30
|
+
* The values can be: the user object, null if they skipped login
|
|
31
|
+
*/
|
|
32
|
+
user: USER | null;
|
|
33
|
+
/**
|
|
34
|
+
* Initial loading flag. It is used not to display the login screen
|
|
35
|
+
* when the app first loads, and it has not been checked whether the user
|
|
36
|
+
* is logged in or not.
|
|
37
|
+
*/
|
|
38
|
+
initialLoading?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Loading flag. It is used to display a loading screen when the user is
|
|
41
|
+
* logging in or out.
|
|
42
|
+
*/
|
|
43
|
+
authLoading: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Sign out
|
|
46
|
+
*/
|
|
47
|
+
signOut: () => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Error initializing the authentication
|
|
50
|
+
*/
|
|
51
|
+
authError?: unknown;
|
|
52
|
+
/**
|
|
53
|
+
* Error dispatched by the auth provider
|
|
54
|
+
*/
|
|
55
|
+
authProviderError?: unknown;
|
|
56
|
+
/**
|
|
57
|
+
* You can use this method to retrieve the auth token for the current user.
|
|
58
|
+
*/
|
|
59
|
+
getAuthToken: () => Promise<string>;
|
|
60
|
+
/**
|
|
61
|
+
* Has the user skipped the login process
|
|
62
|
+
*/
|
|
63
|
+
loginSkipped: boolean;
|
|
64
|
+
extra: ExtraData;
|
|
65
|
+
setExtra: (extra: ExtraData) => void;
|
|
66
|
+
setUser?(user: USER | null): void;
|
|
67
|
+
setUserRoles?(roles: Role[]): void;
|
|
68
|
+
/**
|
|
69
|
+
* Capabilities advertised by the auth provider.
|
|
70
|
+
* UI components use this to feature-detect what the backend supports.
|
|
71
|
+
*/
|
|
72
|
+
capabilities?: AuthCapabilities;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Extended auth controller with common optional auth methods.
|
|
76
|
+
* Backend implementations (Rebase backend, Firebase, Supabase, etc.)
|
|
77
|
+
* extend this with their own backend-specific extras.
|
|
78
|
+
* @group Hooks and utilities
|
|
79
|
+
*/
|
|
80
|
+
export interface AuthControllerExtended<USER extends User = User, ExtraData = unknown> extends AuthController<USER, ExtraData> {
|
|
81
|
+
/** Login with email and password */
|
|
82
|
+
emailPasswordLogin?(email: string, password: string): Promise<void>;
|
|
83
|
+
/** Login with a Google ID token or trigger Google popup */
|
|
84
|
+
googleLogin?(idToken: string): Promise<void>;
|
|
85
|
+
/** Register a new user */
|
|
86
|
+
register?(email: string, password: string, displayName?: string): Promise<void>;
|
|
87
|
+
/** Skip login (for anonymous access if enabled) */
|
|
88
|
+
skipLogin?(): void;
|
|
89
|
+
/** Request password reset email */
|
|
90
|
+
forgotPassword?(email: string): Promise<void>;
|
|
91
|
+
/** Reset password using a token */
|
|
92
|
+
resetPassword?(token: string, password: string): Promise<void>;
|
|
93
|
+
/** Change password for the authenticated user */
|
|
94
|
+
changePassword?(oldPassword: string, newPassword: string): Promise<void>;
|
|
95
|
+
/** Update user profile */
|
|
96
|
+
updateProfile?(displayName?: string, photoURL?: string): Promise<USER>;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Implement this function to allow access to specific users.
|
|
100
|
+
* @group Hooks and utilities
|
|
101
|
+
*/
|
|
102
|
+
export type Authenticator<USER extends User = User> = (props: {
|
|
103
|
+
/**
|
|
104
|
+
* Logged-in user or null
|
|
105
|
+
*/
|
|
106
|
+
user: USER | null;
|
|
107
|
+
/**
|
|
108
|
+
* AuthController
|
|
109
|
+
*/
|
|
110
|
+
authController: AuthController<USER>;
|
|
111
|
+
/**
|
|
112
|
+
* Unified data access API
|
|
113
|
+
*/
|
|
114
|
+
data: RebaseData;
|
|
115
|
+
/**
|
|
116
|
+
* Used storage implementation
|
|
117
|
+
*/
|
|
118
|
+
storageSource: StorageSource;
|
|
119
|
+
}) => boolean | Promise<boolean>;
|