@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,390 @@
|
|
|
1
|
+
|
|
2
|
+
import React, { useRef, useEffect } from "react";
|
|
3
|
+
import Editor, { Monaco, OnMount } from "@monaco-editor/react";
|
|
4
|
+
import type { editor } from "monaco-editor";
|
|
5
|
+
import { cls, defaultBorderMixin } from "@rebasepro/ui";
|
|
6
|
+
import { FileIcon } from "lucide-react";
|
|
7
|
+
import { useModeController } from "@rebasepro/core";
|
|
8
|
+
|
|
9
|
+
/** Ambient type definitions for the Rebase client SDK injected into Monaco. */
|
|
10
|
+
const REBASE_CLIENT_TYPES = `
|
|
11
|
+
// ─── Rebase Client SDK Type Definitions ─────────────────────────────
|
|
12
|
+
|
|
13
|
+
interface Entity<M extends Record<string, any> = any> {
|
|
14
|
+
id: string | number;
|
|
15
|
+
path: string;
|
|
16
|
+
values: M;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface FindParams {
|
|
20
|
+
limit?: number;
|
|
21
|
+
offset?: number;
|
|
22
|
+
page?: number;
|
|
23
|
+
where?: Record<string, string>;
|
|
24
|
+
orderBy?: string;
|
|
25
|
+
include?: string[];
|
|
26
|
+
searchString?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface FindResponse<M extends Record<string, any> = any> {
|
|
30
|
+
data: Entity<M>[];
|
|
31
|
+
meta: {
|
|
32
|
+
total: number;
|
|
33
|
+
limit: number;
|
|
34
|
+
offset: number;
|
|
35
|
+
hasMore: boolean;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type FilterOperator = "=" | "!=" | ">" | ">=" | "<" | "<=" | "in" | "not-in" | "array-contains" | "array-contains-any" | "is" | "is_not" | "like" | "ilike";
|
|
40
|
+
|
|
41
|
+
interface QueryBuilder<M extends Record<string, any> = any> {
|
|
42
|
+
where(column: keyof M & string, operator: FilterOperator, value: any): QueryBuilder<M>;
|
|
43
|
+
orderBy(column: keyof M & string, direction?: "asc" | "desc"): QueryBuilder<M>;
|
|
44
|
+
limit(count: number): QueryBuilder<M>;
|
|
45
|
+
offset(count: number): QueryBuilder<M>;
|
|
46
|
+
search(searchString: string): QueryBuilder<M>;
|
|
47
|
+
find(): Promise<FindResponse<M>>;
|
|
48
|
+
findOne(): Promise<Entity<M> | undefined>;
|
|
49
|
+
count(): Promise<number>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface CollectionClient<M extends Record<string, any> = any> {
|
|
53
|
+
find(params?: FindParams): Promise<FindResponse<M>>;
|
|
54
|
+
findById(id: string | number): Promise<Entity<M> | undefined>;
|
|
55
|
+
create(data: Partial<M>, id?: string | number): Promise<Entity<M>>;
|
|
56
|
+
update(id: string | number, data: Partial<M>): Promise<Entity<M>>;
|
|
57
|
+
delete(id: string | number): Promise<void>;
|
|
58
|
+
where(column: keyof M & string, operator: FilterOperator, value: any): QueryBuilder<M>;
|
|
59
|
+
orderBy(column: keyof M & string, direction?: "asc" | "desc"): QueryBuilder<M>;
|
|
60
|
+
limit(count: number): QueryBuilder<M>;
|
|
61
|
+
offset(count: number): QueryBuilder<M>;
|
|
62
|
+
search(searchString: string): QueryBuilder<M>;
|
|
63
|
+
listen?(params: FindParams | undefined, onUpdate: (response: FindResponse<M>) => void, onError?: (error: Error) => void): () => void;
|
|
64
|
+
listenById?(id: string | number, onUpdate: (entity: Entity<M> | undefined) => void, onError?: (error: Error) => void): () => void;
|
|
65
|
+
count?(params?: FindParams): Promise<number>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface RebaseUser {
|
|
69
|
+
uid: string;
|
|
70
|
+
email: string | null;
|
|
71
|
+
displayName: string | null;
|
|
72
|
+
photoURL: string | null;
|
|
73
|
+
emailVerified?: boolean;
|
|
74
|
+
roles?: string[];
|
|
75
|
+
providerId: string;
|
|
76
|
+
isAnonymous: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface RebaseSession {
|
|
80
|
+
accessToken: string;
|
|
81
|
+
refreshToken: string;
|
|
82
|
+
expiresAt: number;
|
|
83
|
+
user: RebaseUser;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
type AuthChangeEvent = 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | 'USER_UPDATED';
|
|
87
|
+
|
|
88
|
+
interface RebaseAuth {
|
|
89
|
+
signInWithEmail(email: string, password: string): Promise<{ user: RebaseUser; accessToken: string; refreshToken: string }>;
|
|
90
|
+
signUp(email: string, password: string, displayName?: string): Promise<{ user: RebaseUser; accessToken: string; refreshToken: string }>;
|
|
91
|
+
signInWithGoogle(idToken: string): Promise<{ user: RebaseUser; accessToken: string; refreshToken: string }>;
|
|
92
|
+
signOut(): Promise<void>;
|
|
93
|
+
refreshSession(): Promise<RebaseSession>;
|
|
94
|
+
getUser(): Promise<RebaseUser>;
|
|
95
|
+
updateUser(updates: { displayName?: string; photoURL?: string }): Promise<RebaseUser>;
|
|
96
|
+
resetPasswordForEmail(email: string): Promise<{ success: boolean; message: string }>;
|
|
97
|
+
resetPassword(token: string, password: string): Promise<{ success: boolean; message: string }>;
|
|
98
|
+
changePassword(oldPassword: string, newPassword: string): Promise<{ success: boolean; message: string }>;
|
|
99
|
+
sendVerificationEmail(): Promise<{ success: boolean; message: string }>;
|
|
100
|
+
verifyEmail(token: string): Promise<{ success: boolean; message: string }>;
|
|
101
|
+
getSessions(): Promise<any[]>;
|
|
102
|
+
revokeSession(sessionId: string): Promise<{ success: boolean }>;
|
|
103
|
+
revokeAllSessions(): Promise<{ success: boolean }>;
|
|
104
|
+
getSession(): RebaseSession | null;
|
|
105
|
+
onAuthStateChange(callback: (event: AuthChangeEvent, session: RebaseSession | null) => void): () => void;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface AdminUser {
|
|
109
|
+
uid: string;
|
|
110
|
+
email: string;
|
|
111
|
+
displayName: string | null;
|
|
112
|
+
photoURL: string | null;
|
|
113
|
+
provider: string;
|
|
114
|
+
roles: string[];
|
|
115
|
+
createdAt: string;
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface RebaseRole {
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
isAdmin: boolean;
|
|
123
|
+
defaultPermissions: Record<string, any> | null;
|
|
124
|
+
config: Record<string, any> | null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface RebaseAdmin {
|
|
128
|
+
listUsers(): Promise<{ users: AdminUser[] }>;
|
|
129
|
+
getUser(userId: string): Promise<{ user: AdminUser }>;
|
|
130
|
+
createUser(data: { email: string; displayName?: string; password?: string; roles?: string[] }): Promise<{ user: AdminUser }>;
|
|
131
|
+
updateUser(userId: string, data: { email?: string; displayName?: string; password?: string; roles?: string[] }): Promise<{ user: AdminUser }>;
|
|
132
|
+
deleteUser(userId: string): Promise<{ success: boolean }>;
|
|
133
|
+
listRoles(): Promise<{ roles: RebaseRole[] }>;
|
|
134
|
+
getRole(roleId: string): Promise<{ role: RebaseRole }>;
|
|
135
|
+
createRole(data: { id: string; name: string; isAdmin?: boolean; defaultPermissions?: any; config?: any }): Promise<{ role: RebaseRole }>;
|
|
136
|
+
updateRole(roleId: string, data: { name?: string; isAdmin?: boolean; defaultPermissions?: any; config?: any }): Promise<{ role: RebaseRole }>;
|
|
137
|
+
deleteRole(roleId: string): Promise<{ success: boolean }>;
|
|
138
|
+
bootstrap(): Promise<{ success: boolean; message: string; user: { uid: string; roles: string[] } }>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
interface UploadFileProps {
|
|
142
|
+
file: FileIcon;
|
|
143
|
+
fileName?: string;
|
|
144
|
+
path?: string;
|
|
145
|
+
metadata?: Record<string, any>;
|
|
146
|
+
bucket?: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
interface UploadFileResult {
|
|
150
|
+
path: string;
|
|
151
|
+
bucket?: string;
|
|
152
|
+
downloadUrl?: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface DownloadConfig {
|
|
156
|
+
url: string | null;
|
|
157
|
+
fileNotFound?: boolean;
|
|
158
|
+
metadata?: any;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
interface StorageSource {
|
|
162
|
+
putObject(props: UploadFileProps): Promise<UploadFileResult>;
|
|
163
|
+
getSignedUrl(pathOrUrl: string, bucket?: string): Promise<DownloadConfig>;
|
|
164
|
+
getObject(path: string, bucket?: string): Promise<FileIcon | null>;
|
|
165
|
+
deleteObject(path: string, bucket?: string): Promise<void>;
|
|
166
|
+
listObjects(path: string, options?: { bucket?: string; maxResults?: number; pageToken?: string }): Promise<any>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
type RebaseData = {
|
|
170
|
+
/** Look up a collection by slug. */
|
|
171
|
+
collection(slug: string): CollectionClient;
|
|
172
|
+
} & {
|
|
173
|
+
/** Dynamic collection access — e.g. client.data.authors */
|
|
174
|
+
[collectionSlug: string]: CollectionClient;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The Rebase client instance. Use \`client.data\`, \`client.auth\`, \`client.admin\`,
|
|
179
|
+
* \`client.storage\`, and \`client.call()\` to interact with your Rebase backend.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* // Query a collection
|
|
183
|
+
* const result = await client.data.products.find({ limit: 10 });
|
|
184
|
+
*
|
|
185
|
+
* // Create a record
|
|
186
|
+
* await client.data.products.create({ name: "Camera", price: 299 });
|
|
187
|
+
*
|
|
188
|
+
* // Fluent query
|
|
189
|
+
* const expensive = await client.data.products.where("price", ">", 100).orderBy("price", "desc").limit(5).find();
|
|
190
|
+
*
|
|
191
|
+
* // Auth
|
|
192
|
+
* const session = client.auth.getSession();
|
|
193
|
+
*
|
|
194
|
+
* // Admin
|
|
195
|
+
* const { users } = await client.admin.listUsers();
|
|
196
|
+
*
|
|
197
|
+
* // Custom endpoint
|
|
198
|
+
* const result = await client.call("/my-endpoint", { myData: 123 });
|
|
199
|
+
*/
|
|
200
|
+
interface RebaseClient {
|
|
201
|
+
/** Data access — dynamic collection accessors */
|
|
202
|
+
data: RebaseData;
|
|
203
|
+
/** Authentication methods */
|
|
204
|
+
auth: RebaseAuth;
|
|
205
|
+
/** User/role admin methods */
|
|
206
|
+
admin: RebaseAdmin;
|
|
207
|
+
/** Storage operations */
|
|
208
|
+
storage?: StorageSource;
|
|
209
|
+
/** Call a custom server-side endpoint */
|
|
210
|
+
call<T = any>(endpoint: string, payload?: any): Promise<T>;
|
|
211
|
+
/** Direct collection access (shorthand) */
|
|
212
|
+
[collectionSlug: string]: any;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** The pre-configured client instance. Already authenticated with the current user session. */
|
|
216
|
+
declare const client: RebaseClient;
|
|
217
|
+
|
|
218
|
+
/** Execution context with user and collection information. */
|
|
219
|
+
interface JSEditorContext {
|
|
220
|
+
/** The user the script is running as. */
|
|
221
|
+
user: {
|
|
222
|
+
uid: string;
|
|
223
|
+
displayName: string | null;
|
|
224
|
+
email: string | null;
|
|
225
|
+
roles?: string[];
|
|
226
|
+
} | null;
|
|
227
|
+
/** Registered collections with their property names. */
|
|
228
|
+
collections: Array<{
|
|
229
|
+
slug: string;
|
|
230
|
+
name: string;
|
|
231
|
+
properties: string[];
|
|
232
|
+
}>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** Execution context — contains info about the selected user and registered collections. */
|
|
236
|
+
declare const context: JSEditorContext;
|
|
237
|
+
`;
|
|
238
|
+
|
|
239
|
+
export type CollectionInfo = {
|
|
240
|
+
slug: string;
|
|
241
|
+
name: string;
|
|
242
|
+
properties: string[];
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export type JSMonacoEditorProps = {
|
|
246
|
+
value: string;
|
|
247
|
+
onChange: (value: string | undefined) => void;
|
|
248
|
+
onRun?: (selectedText?: string) => void;
|
|
249
|
+
className?: string;
|
|
250
|
+
readOnly?: boolean;
|
|
251
|
+
autoFocus?: boolean;
|
|
252
|
+
/** Collection slugs for basic autocomplete */
|
|
253
|
+
collectionSlugs?: string[];
|
|
254
|
+
/** Full collection info with property names for richer type generation */
|
|
255
|
+
collections?: CollectionInfo[];
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export const JSMonacoEditor = ({
|
|
259
|
+
value,
|
|
260
|
+
onChange,
|
|
261
|
+
onRun,
|
|
262
|
+
className,
|
|
263
|
+
readOnly = false,
|
|
264
|
+
autoFocus = true,
|
|
265
|
+
collectionSlugs = [],
|
|
266
|
+
collections = []
|
|
267
|
+
}: JSMonacoEditorProps) => {
|
|
268
|
+
const { mode } = useModeController();
|
|
269
|
+
const editorRef = useRef<editor.IStandaloneCodeEditor | null>(null);
|
|
270
|
+
const monacoRef = useRef<Monaco | null>(null);
|
|
271
|
+
const onRunRef = useRef(onRun);
|
|
272
|
+
onRunRef.current = onRun;
|
|
273
|
+
const typesRegisteredRef = useRef(false);
|
|
274
|
+
|
|
275
|
+
const handleEditorOnMount: OnMount = (editorInstance, monaco) => {
|
|
276
|
+
editorRef.current = editorInstance;
|
|
277
|
+
monacoRef.current = monaco;
|
|
278
|
+
|
|
279
|
+
// Register Cmd/Ctrl+Enter to run
|
|
280
|
+
editorInstance.addAction({
|
|
281
|
+
id: "run-script",
|
|
282
|
+
label: "Run Script",
|
|
283
|
+
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter],
|
|
284
|
+
contextMenuGroupId: "operation",
|
|
285
|
+
contextMenuOrder: 0,
|
|
286
|
+
run: () => {
|
|
287
|
+
if (onRunRef.current) {
|
|
288
|
+
const selection = editorInstance.getSelection();
|
|
289
|
+
let selectedText: string | undefined;
|
|
290
|
+
if (selection && !selection.isEmpty()) {
|
|
291
|
+
selectedText = editorInstance.getModel()?.getValueInRange(selection)?.trim();
|
|
292
|
+
}
|
|
293
|
+
onRunRef.current(selectedText || undefined);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// Configure TypeScript/JavaScript defaults for richer completion
|
|
299
|
+
if (!typesRegisteredRef.current) {
|
|
300
|
+
typesRegisteredRef.current = true;
|
|
301
|
+
|
|
302
|
+
// Configure TS compiler for modern JS with top-level await
|
|
303
|
+
// Note: cast through `any` because the bundled type stubs mark
|
|
304
|
+
// `monaco.languages.typescript` as deprecated while the runtime
|
|
305
|
+
// API is fully functional.
|
|
306
|
+
const ts = (monaco.languages as any).typescript;
|
|
307
|
+
ts.typescriptDefaults.setCompilerOptions({
|
|
308
|
+
target: ts.ScriptTarget.ESNext,
|
|
309
|
+
module: ts.ModuleKind.ESNext,
|
|
310
|
+
allowJs: true,
|
|
311
|
+
checkJs: false,
|
|
312
|
+
strict: false,
|
|
313
|
+
noEmit: true,
|
|
314
|
+
allowNonTsExtensions: true
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// Suppress diagnostics that don't apply to our script context.
|
|
318
|
+
// Scripts are executed inside `new AsyncFunction(...)` at runtime,
|
|
319
|
+
// so top-level `await` (1375) and `return` (1108) are valid.
|
|
320
|
+
ts.typescriptDefaults.setDiagnosticsOptions({
|
|
321
|
+
diagnosticCodesToIgnore: [1375, 1108]
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
// Inject the Rebase Client SDK type definitions
|
|
325
|
+
ts.typescriptDefaults.addExtraLib(
|
|
326
|
+
REBASE_CLIENT_TYPES,
|
|
327
|
+
"ts:rebase-client.d.ts"
|
|
328
|
+
);
|
|
329
|
+
|
|
330
|
+
// Generate collection-specific types from registered collections
|
|
331
|
+
if (collections.length > 0) {
|
|
332
|
+
const lines: string[] = [];
|
|
333
|
+
for (const col of collections) {
|
|
334
|
+
// Generate a typed interface for each collection
|
|
335
|
+
const ifaceName = col.slug.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
336
|
+
const propsType = col.properties.length > 0
|
|
337
|
+
? `{ ${col.properties.map(p => `${p}: any`).join("; ")} }`
|
|
338
|
+
: "Record<string, any>";
|
|
339
|
+
lines.push(`/** Collection: ${col.name} (${col.slug}) */`);
|
|
340
|
+
lines.push(`interface ${ifaceName}_Row ${propsType}`);
|
|
341
|
+
lines.push(`declare namespace client.data { const ${col.slug}: CollectionClient<${ifaceName}_Row>; }`);
|
|
342
|
+
}
|
|
343
|
+
ts.typescriptDefaults.addExtraLib(
|
|
344
|
+
lines.join("\n"),
|
|
345
|
+
"ts:rebase-collections.d.ts"
|
|
346
|
+
);
|
|
347
|
+
} else if (collectionSlugs.length > 0) {
|
|
348
|
+
// Fallback: just slug names without property info
|
|
349
|
+
const collectionHints = collectionSlugs.map(slug =>
|
|
350
|
+
`/** Collection: ${slug} */\ndeclare namespace client.data { const ${slug}: CollectionClient; }`
|
|
351
|
+
).join("\n");
|
|
352
|
+
ts.typescriptDefaults.addExtraLib(
|
|
353
|
+
collectionHints,
|
|
354
|
+
"ts:rebase-collections.d.ts"
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (autoFocus) {
|
|
360
|
+
editorInstance.focus();
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
return (
|
|
365
|
+
<div className={cls("relative w-full h-full overflow-hidden", className)}>
|
|
366
|
+
<Editor
|
|
367
|
+
height="100%"
|
|
368
|
+
defaultLanguage="typescript"
|
|
369
|
+
path="rebase-script.ts"
|
|
370
|
+
value={value}
|
|
371
|
+
onChange={onChange}
|
|
372
|
+
onMount={handleEditorOnMount}
|
|
373
|
+
theme={mode === "dark" ? "vs-dark" : "vs"}
|
|
374
|
+
options={{
|
|
375
|
+
minimap: { enabled: false },
|
|
376
|
+
fontSize: 14,
|
|
377
|
+
lineNumbers: "on",
|
|
378
|
+
scrollBeyondLastLine: false,
|
|
379
|
+
automaticLayout: true,
|
|
380
|
+
readOnly,
|
|
381
|
+
tabSize: 2,
|
|
382
|
+
wordWrap: "on",
|
|
383
|
+
suggestOnTriggerCharacters: true,
|
|
384
|
+
quickSuggestions: true,
|
|
385
|
+
parameterHints: { enabled: true }
|
|
386
|
+
}}
|
|
387
|
+
/>
|
|
388
|
+
</div>
|
|
389
|
+
);
|
|
390
|
+
};
|