@rebasepro/studio 0.4.0 → 0.6.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.
Files changed (378) hide show
  1. package/README.md +73 -140
  2. package/dist/ApiExplorer-CdIwR9Ga.js +963 -0
  3. package/dist/ApiExplorer-CdIwR9Ga.js.map +1 -0
  4. package/dist/AuthSimulationSelector-iEZ-Or_1.js +56 -0
  5. package/dist/AuthSimulationSelector-iEZ-Or_1.js.map +1 -0
  6. package/dist/BranchesView-DncIRcZt.js +461 -0
  7. package/dist/BranchesView-DncIRcZt.js.map +1 -0
  8. package/dist/CronJobsView-4gdtJvoe.js +500 -0
  9. package/dist/CronJobsView-4gdtJvoe.js.map +1 -0
  10. package/dist/JSEditor-BhAbEjCP.js +1573 -0
  11. package/dist/JSEditor-BhAbEjCP.js.map +1 -0
  12. package/dist/LogsExplorer-CqtKILj8.js +240 -0
  13. package/dist/LogsExplorer-CqtKILj8.js.map +1 -0
  14. package/dist/MonacoEditor-COZqrIJ1.js +246 -0
  15. package/dist/MonacoEditor-COZqrIJ1.js.map +1 -0
  16. package/dist/RLSEditor-CTxYbBdW.js +1362 -0
  17. package/dist/RLSEditor-CTxYbBdW.js.map +1 -0
  18. package/dist/SQLEditor-BLuq_zDM.js +1964 -0
  19. package/dist/SQLEditor-BLuq_zDM.js.map +1 -0
  20. package/dist/SchemaVisualizer-BJK2u3C0.js +1068 -0
  21. package/dist/SchemaVisualizer-BJK2u3C0.js.map +1 -0
  22. package/dist/StorageView-nDaC2foF.js +1382 -0
  23. package/dist/StorageView-nDaC2foF.js.map +1 -0
  24. package/dist/{studio/src/components → components}/ApiExplorer/ApiExplorer.d.ts +2 -1
  25. package/dist/{studio/src/components → components}/ApiExplorer/EndpointDetail.d.ts +2 -1
  26. package/dist/{studio/src/components → components}/ApiExplorer/TryItPanel.d.ts +2 -1
  27. package/dist/{studio/src/components → components}/AuthSimulationSelector.d.ts +2 -1
  28. package/dist/components/Branches/BranchesView.d.ts +2 -0
  29. package/dist/components/CronJobs/CronJobsView.d.ts +2 -0
  30. package/dist/components/JSEditor/JSEditor.d.ts +2 -0
  31. package/dist/{studio/src/components → components}/JSEditor/JSEditorSidebar.d.ts +2 -1
  32. package/dist/{studio/src/components → components}/JSEditor/JSMonacoEditor.d.ts +2 -1
  33. package/dist/components/LogsExplorer/LogsExplorer.d.ts +2 -0
  34. package/dist/{studio/src/components → components}/RLSEditor/PolicyEditor.d.ts +2 -1
  35. package/dist/{studio/src/components → components}/RLSEditor/RLSEditor.d.ts +2 -7
  36. package/dist/{studio/src/components → components}/SQLEditor/MonacoEditor.d.ts +2 -1
  37. package/dist/{studio/src/components → components}/SQLEditor/SQLEditor.d.ts +2 -1
  38. package/dist/{studio/src/components → components}/SQLEditor/SQLEditorSidebar.d.ts +2 -1
  39. package/dist/{studio/src/components → components}/SQLEditor/SchemaBrowser.d.ts +2 -1
  40. package/dist/{studio/src/components → components}/SchemaVisualizer/RelationEdge.d.ts +1 -1
  41. package/dist/components/SchemaVisualizer/SchemaVisualizer.d.ts +3 -0
  42. package/dist/{studio/src/components → components}/SchemaVisualizer/TableNode.d.ts +1 -1
  43. package/dist/{studio/src/components → components}/SchemaVisualizer/schema-visualizer.utils.d.ts +0 -8
  44. package/dist/components/StorageView/StorageView.d.ts +2 -0
  45. package/dist/{studio/src/components → components}/StudioHomePage.d.ts +1 -1
  46. package/dist/index.es.js +688 -746
  47. package/dist/index.es.js.map +1 -1
  48. package/dist/index.umd.js +10303 -9572
  49. package/dist/index.umd.js.map +1 -1
  50. package/dist/{studio/src/utils → utils}/pgColumnToProperty.d.ts +1 -1
  51. package/package.json +22 -22
  52. package/src/components/ApiExplorer/TryItPanel.tsx +15 -18
  53. package/src/components/CronJobs/CronJobsView.tsx +1 -1
  54. package/src/components/JSEditor/JSEditor.tsx +10 -15
  55. package/src/components/LogsExplorer/LogsExplorer.tsx +6 -3
  56. package/src/components/RLSEditor/PolicyEditor.tsx +0 -1
  57. package/src/components/RLSEditor/RLSEditor.tsx +1 -1
  58. package/src/components/SQLEditor/SQLEditor.tsx +40 -30
  59. package/src/components/SchemaVisualizer/schema-visualizer.utils.ts +3 -3
  60. package/src/components/SchemaVisualizer/useSchemaGraph.ts +2 -2
  61. package/src/components/StorageView/StorageView.tsx +22 -11
  62. package/src/components/StudioHomePage.tsx +51 -15
  63. package/src/utils/parseSpec.test.ts +41 -20
  64. package/src/utils/pgColumnToProperty.ts +23 -20
  65. package/src/utils/sql_utils.ts +1 -1
  66. package/dist/ApiExplorer-CGHEF1uL.js +0 -1052
  67. package/dist/ApiExplorer-CGHEF1uL.js.map +0 -1
  68. package/dist/AuthSimulationSelector-DGoXkWSg.js +0 -105
  69. package/dist/AuthSimulationSelector-DGoXkWSg.js.map +0 -1
  70. package/dist/BranchesView-BiTEwIhd.js +0 -291
  71. package/dist/BranchesView-BiTEwIhd.js.map +0 -1
  72. package/dist/CronJobsView-3PM_qR8v.js +0 -472
  73. package/dist/CronJobsView-3PM_qR8v.js.map +0 -1
  74. package/dist/JSEditor-BCSoElPg.js +0 -1297
  75. package/dist/JSEditor-BCSoElPg.js.map +0 -1
  76. package/dist/LogsExplorer-_4sZadKn.js +0 -162
  77. package/dist/LogsExplorer-_4sZadKn.js.map +0 -1
  78. package/dist/MonacoEditor-CMYEjiRf.js +0 -161
  79. package/dist/MonacoEditor-CMYEjiRf.js.map +0 -1
  80. package/dist/RLSEditor-CHEExeSB.js +0 -1871
  81. package/dist/RLSEditor-CHEExeSB.js.map +0 -1
  82. package/dist/SQLEditor-BC0IOUQu.js +0 -1797
  83. package/dist/SQLEditor-BC0IOUQu.js.map +0 -1
  84. package/dist/SchemaVisualizer-BGpmzyXT.js +0 -1069
  85. package/dist/SchemaVisualizer-BGpmzyXT.js.map +0 -1
  86. package/dist/StorageView-B7AsN2qX.js +0 -869
  87. package/dist/StorageView-B7AsN2qX.js.map +0 -1
  88. package/dist/common/src/collections/CollectionRegistry.d.ts +0 -56
  89. package/dist/common/src/collections/default-collections.d.ts +0 -9
  90. package/dist/common/src/collections/index.d.ts +0 -2
  91. package/dist/common/src/data/buildRebaseData.d.ts +0 -14
  92. package/dist/common/src/data/query_builder.d.ts +0 -55
  93. package/dist/common/src/index.d.ts +0 -4
  94. package/dist/common/src/util/builders.d.ts +0 -57
  95. package/dist/common/src/util/callbacks.d.ts +0 -6
  96. package/dist/common/src/util/collections.d.ts +0 -11
  97. package/dist/common/src/util/common.d.ts +0 -2
  98. package/dist/common/src/util/conditions.d.ts +0 -26
  99. package/dist/common/src/util/entities.d.ts +0 -58
  100. package/dist/common/src/util/enums.d.ts +0 -3
  101. package/dist/common/src/util/index.d.ts +0 -16
  102. package/dist/common/src/util/navigation_from_path.d.ts +0 -34
  103. package/dist/common/src/util/navigation_utils.d.ts +0 -20
  104. package/dist/common/src/util/parent_references_from_path.d.ts +0 -6
  105. package/dist/common/src/util/paths.d.ts +0 -14
  106. package/dist/common/src/util/permissions.d.ts +0 -6
  107. package/dist/common/src/util/references.d.ts +0 -2
  108. package/dist/common/src/util/relations.d.ts +0 -22
  109. package/dist/common/src/util/resolutions.d.ts +0 -72
  110. package/dist/common/src/util/storage.d.ts +0 -24
  111. package/dist/core/src/components/AIIcon.d.ts +0 -16
  112. package/dist/core/src/components/BootstrapAdminBanner.d.ts +0 -4
  113. package/dist/core/src/components/ConfirmationDialog.d.ts +0 -9
  114. package/dist/core/src/components/Debug/UIReferenceView.d.ts +0 -1
  115. package/dist/core/src/components/Debug/UIStyleGuide.d.ts +0 -1
  116. package/dist/core/src/components/ErrorTooltip.d.ts +0 -2
  117. package/dist/core/src/components/ErrorView.d.ts +0 -21
  118. package/dist/core/src/components/LanguageToggle.d.ts +0 -1
  119. package/dist/core/src/components/LoginView/LoginView.d.ts +0 -109
  120. package/dist/core/src/components/LoginView/index.d.ts +0 -2
  121. package/dist/core/src/components/NotFoundPage.d.ts +0 -1
  122. package/dist/core/src/components/RebaseAuth.d.ts +0 -10
  123. package/dist/core/src/components/RebaseLogo.d.ts +0 -7
  124. package/dist/core/src/components/UnsavedChangesDialog.d.ts +0 -9
  125. package/dist/core/src/components/UserDisplay.d.ts +0 -7
  126. package/dist/core/src/components/UserSelectPopover.d.ts +0 -62
  127. package/dist/core/src/components/UserSettingsView.d.ts +0 -1
  128. package/dist/core/src/components/common/index.d.ts +0 -6
  129. package/dist/core/src/components/common/table_height.d.ts +0 -5
  130. package/dist/core/src/components/common/types.d.ts +0 -66
  131. package/dist/core/src/components/common/useColumnsIds.d.ts +0 -9
  132. package/dist/core/src/components/common/useDataTableController.d.ts +0 -45
  133. package/dist/core/src/components/common/useDebouncedData.d.ts +0 -9
  134. package/dist/core/src/components/common/useScrollRestoration.d.ts +0 -14
  135. package/dist/core/src/components/index.d.ts +0 -17
  136. package/dist/core/src/contexts/AdminModeController.d.ts +0 -4
  137. package/dist/core/src/contexts/AnalyticsContext.d.ts +0 -3
  138. package/dist/core/src/contexts/AuthControllerContext.d.ts +0 -3
  139. package/dist/core/src/contexts/CustomizationControllerContext.d.ts +0 -3
  140. package/dist/core/src/contexts/DataDriverContext.d.ts +0 -3
  141. package/dist/core/src/contexts/DatabaseAdminContext.d.ts +0 -3
  142. package/dist/core/src/contexts/DialogsProvider.d.ts +0 -4
  143. package/dist/core/src/contexts/EffectiveRoleController.d.ts +0 -4
  144. package/dist/core/src/contexts/InternalUserManagementContext.d.ts +0 -3
  145. package/dist/core/src/contexts/ModeController.d.ts +0 -4
  146. package/dist/core/src/contexts/RebaseClientInstanceContext.d.ts +0 -6
  147. package/dist/core/src/contexts/RebaseDataContext.d.ts +0 -3
  148. package/dist/core/src/contexts/SnackbarProvider.d.ts +0 -2
  149. package/dist/core/src/contexts/StorageSourceContext.d.ts +0 -3
  150. package/dist/core/src/contexts/UserConfigurationPersistenceContext.d.ts +0 -3
  151. package/dist/core/src/contexts/index.d.ts +0 -13
  152. package/dist/core/src/core/PluginLifecycleManager.d.ts +0 -17
  153. package/dist/core/src/core/PluginProviderStack.d.ts +0 -21
  154. package/dist/core/src/core/Rebase.d.ts +0 -14
  155. package/dist/core/src/core/RebaseProps.d.ts +0 -147
  156. package/dist/core/src/core/RebaseRouter.d.ts +0 -4
  157. package/dist/core/src/core/RebaseRoutes.d.ts +0 -17
  158. package/dist/core/src/core/index.d.ts +0 -4
  159. package/dist/core/src/hooks/ApiConfigContext.d.ts +0 -24
  160. package/dist/core/src/hooks/data/delete.d.ts +0 -31
  161. package/dist/core/src/hooks/data/save.d.ts +0 -34
  162. package/dist/core/src/hooks/data/useCollectionFetch.d.ts +0 -62
  163. package/dist/core/src/hooks/data/useData.d.ts +0 -13
  164. package/dist/core/src/hooks/data/useDataOrder.d.ts +0 -12
  165. package/dist/core/src/hooks/data/useEntityFetch.d.ts +0 -43
  166. package/dist/core/src/hooks/data/useRelationSelector.d.ts +0 -52
  167. package/dist/core/src/hooks/data/useUserSelector.d.ts +0 -31
  168. package/dist/core/src/hooks/index.d.ts +0 -37
  169. package/dist/core/src/hooks/useAdminModeController.d.ts +0 -19
  170. package/dist/core/src/hooks/useAnalyticsController.d.ts +0 -5
  171. package/dist/core/src/hooks/useAuthController.d.ts +0 -11
  172. package/dist/core/src/hooks/useAuthSubscription.d.ts +0 -2
  173. package/dist/core/src/hooks/useBackendStorageSource.d.ts +0 -30
  174. package/dist/core/src/hooks/useBridgeRegistration.d.ts +0 -18
  175. package/dist/core/src/hooks/useBrowserTitleAndIcon.d.ts +0 -6
  176. package/dist/core/src/hooks/useBuildAdminModeController.d.ts +0 -6
  177. package/dist/core/src/hooks/useBuildEffectiveRoleController.d.ts +0 -8
  178. package/dist/core/src/hooks/useBuildLocalConfigurationPersistence.d.ts +0 -2
  179. package/dist/core/src/hooks/useBuildModeController.d.ts +0 -6
  180. package/dist/core/src/hooks/useClipboard.d.ts +0 -57
  181. package/dist/core/src/hooks/useCollapsedGroups.d.ts +0 -27
  182. package/dist/core/src/hooks/useCustomizationController.d.ts +0 -11
  183. package/dist/core/src/hooks/useDialogsController.d.ts +0 -11
  184. package/dist/core/src/hooks/useEffectiveRoleController.d.ts +0 -7
  185. package/dist/core/src/hooks/useInternalUserManagementController.d.ts +0 -12
  186. package/dist/core/src/hooks/useLargeLayout.d.ts +0 -1
  187. package/dist/core/src/hooks/useModeController.d.ts +0 -19
  188. package/dist/core/src/hooks/usePermissions.d.ts +0 -12
  189. package/dist/core/src/hooks/useRebaseClient.d.ts +0 -5
  190. package/dist/core/src/hooks/useRebaseContext.d.ts +0 -11
  191. package/dist/core/src/hooks/useRebaseRegistry.d.ts +0 -34
  192. package/dist/core/src/hooks/useResolvedComponent.d.ts +0 -47
  193. package/dist/core/src/hooks/useSlot.d.ts +0 -18
  194. package/dist/core/src/hooks/useSnackbarController.d.ts +0 -20
  195. package/dist/core/src/hooks/useStorageSource.d.ts +0 -7
  196. package/dist/core/src/hooks/useStudioBridge.d.ts +0 -91
  197. package/dist/core/src/hooks/useTranslation.d.ts +0 -17
  198. package/dist/core/src/hooks/useUnsavedChangesDialog.d.ts +0 -12
  199. package/dist/core/src/hooks/useUserConfigurationPersistence.d.ts +0 -8
  200. package/dist/core/src/i18n/RebaseI18nProvider.d.ts +0 -33
  201. package/dist/core/src/index.d.ts +0 -15
  202. package/dist/core/src/internal/common.d.ts +0 -3
  203. package/dist/core/src/internal/useRestoreScroll.d.ts +0 -6
  204. package/dist/core/src/locales/de.d.ts +0 -2
  205. package/dist/core/src/locales/en.d.ts +0 -10
  206. package/dist/core/src/locales/es.d.ts +0 -10
  207. package/dist/core/src/locales/fr.d.ts +0 -2
  208. package/dist/core/src/locales/hi.d.ts +0 -2
  209. package/dist/core/src/locales/it.d.ts +0 -2
  210. package/dist/core/src/locales/pt.d.ts +0 -7
  211. package/dist/core/src/util/constants.d.ts +0 -1
  212. package/dist/core/src/util/createFormexStub.d.ts +0 -2
  213. package/dist/core/src/util/entity_cache.d.ts +0 -22
  214. package/dist/core/src/util/enums.d.ts +0 -5
  215. package/dist/core/src/util/icon_list.d.ts +0 -5
  216. package/dist/core/src/util/icons.d.ts +0 -20
  217. package/dist/core/src/util/index.d.ts +0 -8
  218. package/dist/core/src/util/previews.d.ts +0 -4
  219. package/dist/core/src/util/useStorageUploadController.d.ts +0 -38
  220. package/dist/formex/src/Field.d.ts +0 -52
  221. package/dist/formex/src/Formex.d.ts +0 -7
  222. package/dist/formex/src/index.d.ts +0 -5
  223. package/dist/formex/src/types.d.ts +0 -40
  224. package/dist/formex/src/useCreateFormex.d.ts +0 -14
  225. package/dist/formex/src/utils.d.ts +0 -16
  226. package/dist/studio/src/components/Branches/BranchesView.d.ts +0 -1
  227. package/dist/studio/src/components/CronJobs/CronJobsView.d.ts +0 -1
  228. package/dist/studio/src/components/JSEditor/JSEditor.d.ts +0 -1
  229. package/dist/studio/src/components/LogsExplorer/LogsExplorer.d.ts +0 -1
  230. package/dist/studio/src/components/SchemaVisualizer/SchemaVisualizer.d.ts +0 -2
  231. package/dist/studio/src/components/SchemaVisualizer/index.d.ts +0 -5
  232. package/dist/studio/src/components/StorageView/StorageView.d.ts +0 -1
  233. package/dist/studio/src/utils/entities.d.ts +0 -0
  234. package/dist/types/src/controllers/analytics_controller.d.ts +0 -7
  235. package/dist/types/src/controllers/auth.d.ts +0 -104
  236. package/dist/types/src/controllers/client.d.ts +0 -168
  237. package/dist/types/src/controllers/collection_registry.d.ts +0 -46
  238. package/dist/types/src/controllers/customization_controller.d.ts +0 -60
  239. package/dist/types/src/controllers/data.d.ts +0 -207
  240. package/dist/types/src/controllers/data_driver.d.ts +0 -218
  241. package/dist/types/src/controllers/database_admin.d.ts +0 -11
  242. package/dist/types/src/controllers/dialogs_controller.d.ts +0 -36
  243. package/dist/types/src/controllers/effective_role.d.ts +0 -4
  244. package/dist/types/src/controllers/email.d.ts +0 -36
  245. package/dist/types/src/controllers/index.d.ts +0 -18
  246. package/dist/types/src/controllers/local_config_persistence.d.ts +0 -20
  247. package/dist/types/src/controllers/navigation.d.ts +0 -225
  248. package/dist/types/src/controllers/registry.d.ts +0 -63
  249. package/dist/types/src/controllers/side_dialogs_controller.d.ts +0 -67
  250. package/dist/types/src/controllers/side_entity_controller.d.ts +0 -97
  251. package/dist/types/src/controllers/snackbar.d.ts +0 -24
  252. package/dist/types/src/controllers/storage.d.ts +0 -171
  253. package/dist/types/src/index.d.ts +0 -4
  254. package/dist/types/src/rebase_context.d.ts +0 -122
  255. package/dist/types/src/types/auth_adapter.d.ts +0 -301
  256. package/dist/types/src/types/backend.d.ts +0 -536
  257. package/dist/types/src/types/backend_hooks.d.ts +0 -172
  258. package/dist/types/src/types/builders.d.ts +0 -15
  259. package/dist/types/src/types/chips.d.ts +0 -5
  260. package/dist/types/src/types/collections.d.ts +0 -941
  261. package/dist/types/src/types/component_ref.d.ts +0 -47
  262. package/dist/types/src/types/cron.d.ts +0 -102
  263. package/dist/types/src/types/data_source.d.ts +0 -64
  264. package/dist/types/src/types/database_adapter.d.ts +0 -94
  265. package/dist/types/src/types/entities.d.ts +0 -145
  266. package/dist/types/src/types/entity_actions.d.ts +0 -104
  267. package/dist/types/src/types/entity_callbacks.d.ts +0 -173
  268. package/dist/types/src/types/entity_link_builder.d.ts +0 -7
  269. package/dist/types/src/types/entity_overrides.d.ts +0 -10
  270. package/dist/types/src/types/entity_views.d.ts +0 -87
  271. package/dist/types/src/types/export_import.d.ts +0 -21
  272. package/dist/types/src/types/formex.d.ts +0 -40
  273. package/dist/types/src/types/index.d.ts +0 -28
  274. package/dist/types/src/types/locales.d.ts +0 -4
  275. package/dist/types/src/types/modify_collections.d.ts +0 -5
  276. package/dist/types/src/types/plugins.d.ts +0 -282
  277. package/dist/types/src/types/properties.d.ts +0 -1181
  278. package/dist/types/src/types/property_config.d.ts +0 -74
  279. package/dist/types/src/types/relations.d.ts +0 -336
  280. package/dist/types/src/types/slots.d.ts +0 -262
  281. package/dist/types/src/types/translations.d.ts +0 -900
  282. package/dist/types/src/types/user_management_delegate.d.ts +0 -86
  283. package/dist/types/src/types/websockets.d.ts +0 -78
  284. package/dist/types/src/users/index.d.ts +0 -1
  285. package/dist/types/src/users/user.d.ts +0 -50
  286. package/dist/ui/src/components/Alert.d.ts +0 -12
  287. package/dist/ui/src/components/Autocomplete.d.ts +0 -21
  288. package/dist/ui/src/components/Avatar.d.ts +0 -11
  289. package/dist/ui/src/components/Badge.d.ts +0 -8
  290. package/dist/ui/src/components/BooleanSwitch.d.ts +0 -14
  291. package/dist/ui/src/components/BooleanSwitchWithLabel.d.ts +0 -17
  292. package/dist/ui/src/components/Button.d.ts +0 -14
  293. package/dist/ui/src/components/Card.d.ts +0 -8
  294. package/dist/ui/src/components/CenteredView.d.ts +0 -9
  295. package/dist/ui/src/components/Checkbox.d.ts +0 -13
  296. package/dist/ui/src/components/Chip.d.ts +0 -26
  297. package/dist/ui/src/components/CircularProgress.d.ts +0 -5
  298. package/dist/ui/src/components/CircularProgressCenter.d.ts +0 -11
  299. package/dist/ui/src/components/Collapse.d.ts +0 -9
  300. package/dist/ui/src/components/ColorPicker.d.ts +0 -30
  301. package/dist/ui/src/components/Container.d.ts +0 -8
  302. package/dist/ui/src/components/DateTimeField.d.ts +0 -24
  303. package/dist/ui/src/components/DebouncedTextField.d.ts +0 -2
  304. package/dist/ui/src/components/Dialog.d.ts +0 -39
  305. package/dist/ui/src/components/DialogActions.d.ts +0 -7
  306. package/dist/ui/src/components/DialogContent.d.ts +0 -7
  307. package/dist/ui/src/components/DialogTitle.d.ts +0 -10
  308. package/dist/ui/src/components/ErrorBoundary.d.ts +0 -33
  309. package/dist/ui/src/components/ExpandablePanel.d.ts +0 -12
  310. package/dist/ui/src/components/FileUpload.d.ts +0 -23
  311. package/dist/ui/src/components/FilterChip.d.ts +0 -34
  312. package/dist/ui/src/components/IconButton.d.ts +0 -12
  313. package/dist/ui/src/components/InfoLabel.d.ts +0 -5
  314. package/dist/ui/src/components/InputLabel.d.ts +0 -11
  315. package/dist/ui/src/components/Label.d.ts +0 -7
  316. package/dist/ui/src/components/LoadingButton.d.ts +0 -7
  317. package/dist/ui/src/components/Markdown.d.ts +0 -10
  318. package/dist/ui/src/components/Menu.d.ts +0 -23
  319. package/dist/ui/src/components/Menubar.d.ts +0 -80
  320. package/dist/ui/src/components/MultiSelect.d.ts +0 -48
  321. package/dist/ui/src/components/Paper.d.ts +0 -6
  322. package/dist/ui/src/components/Popover.d.ts +0 -24
  323. package/dist/ui/src/components/RadioGroup.d.ts +0 -28
  324. package/dist/ui/src/components/ResizablePanels.d.ts +0 -18
  325. package/dist/ui/src/components/SearchBar.d.ts +0 -26
  326. package/dist/ui/src/components/Select.d.ts +0 -43
  327. package/dist/ui/src/components/Separator.d.ts +0 -5
  328. package/dist/ui/src/components/Sheet.d.ts +0 -22
  329. package/dist/ui/src/components/Skeleton.d.ts +0 -6
  330. package/dist/ui/src/components/Slider.d.ts +0 -21
  331. package/dist/ui/src/components/Table.d.ts +0 -34
  332. package/dist/ui/src/components/Tabs.d.ts +0 -19
  333. package/dist/ui/src/components/TextField.d.ts +0 -58
  334. package/dist/ui/src/components/TextareaAutosize.d.ts +0 -43
  335. package/dist/ui/src/components/ToggleButtonGroup.d.ts +0 -30
  336. package/dist/ui/src/components/Tooltip.d.ts +0 -19
  337. package/dist/ui/src/components/Typography.d.ts +0 -36
  338. package/dist/ui/src/components/VirtualTable/VirtualTable.d.ts +0 -11
  339. package/dist/ui/src/components/VirtualTable/VirtualTableCell.d.ts +0 -21
  340. package/dist/ui/src/components/VirtualTable/VirtualTableHeader.d.ts +0 -29
  341. package/dist/ui/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +0 -2
  342. package/dist/ui/src/components/VirtualTable/VirtualTableProps.d.ts +0 -249
  343. package/dist/ui/src/components/VirtualTable/VirtualTableRow.d.ts +0 -3
  344. package/dist/ui/src/components/VirtualTable/index.d.ts +0 -3
  345. package/dist/ui/src/components/VirtualTable/types.d.ts +0 -38
  346. package/dist/ui/src/components/common/SelectInputLabel.d.ts +0 -5
  347. package/dist/ui/src/components/index.d.ts +0 -58
  348. package/dist/ui/src/hooks/PortalContainerContext.d.ts +0 -31
  349. package/dist/ui/src/hooks/index.d.ts +0 -6
  350. package/dist/ui/src/hooks/useDebounceCallback.d.ts +0 -1
  351. package/dist/ui/src/hooks/useDebounceValue.d.ts +0 -1
  352. package/dist/ui/src/hooks/useDebouncedCallback.d.ts +0 -1
  353. package/dist/ui/src/hooks/useInjectStyles.d.ts +0 -7
  354. package/dist/ui/src/hooks/useOutsideAlerter.d.ts +0 -5
  355. package/dist/ui/src/icons/GitHubIcon.d.ts +0 -2
  356. package/dist/ui/src/icons/HandleIcon.d.ts +0 -1
  357. package/dist/ui/src/icons/Icon.d.ts +0 -20
  358. package/dist/ui/src/icons/cool_icon_keys.d.ts +0 -1
  359. package/dist/ui/src/icons/icon_keys.d.ts +0 -1
  360. package/dist/ui/src/icons/index.d.ts +0 -8
  361. package/dist/ui/src/index.d.ts +0 -5
  362. package/dist/ui/src/styles.d.ts +0 -12
  363. package/dist/ui/src/util/chip_colors.d.ts +0 -4
  364. package/dist/ui/src/util/cls.d.ts +0 -2
  365. package/dist/ui/src/util/debounce.d.ts +0 -10
  366. package/dist/ui/src/util/hash.d.ts +0 -1
  367. package/dist/ui/src/util/index.d.ts +0 -4
  368. package/dist/ui/src/util/key_to_icon_component.d.ts +0 -1
  369. package/src/components/SchemaVisualizer/index.ts +0 -5
  370. package/src/utils/entities.ts +0 -2
  371. /package/dist/{studio/src/components → components}/ApiExplorer/parseSpec.d.ts +0 -0
  372. /package/dist/{studio/src/components → components}/ApiExplorer/types.d.ts +0 -0
  373. /package/dist/{studio/src/components → components}/RLSEditor/index.d.ts +0 -0
  374. /package/dist/{studio/src/components → components}/RebaseStudio.d.ts +0 -0
  375. /package/dist/{studio/src/components → components}/SQLEditor/ExplainVisualizer.d.ts +0 -0
  376. /package/dist/{studio/src/components → components}/SchemaVisualizer/useSchemaGraph.d.ts +0 -0
  377. /package/dist/{studio/src/index.d.ts → index.d.ts} +0 -0
  378. /package/dist/{studio/src/utils → utils}/sql_utils.d.ts +0 -0
@@ -1,33 +0,0 @@
1
- import { PropsWithChildren } from "react";
2
- import { RebaseTranslations } from "@rebasepro/types";
3
- export declare const REBASE_LOCALE_STORAGE_KEY = "rebase_locale";
4
- /** DeepPartial helper — allows partial overrides at any nesting level */
5
- type DeepPartial<T> = T extends object ? {
6
- [K in keyof T]?: DeepPartial<T[K]>;
7
- } : T;
8
- export interface RebaseI18nProviderProps {
9
- /** BCP-47 locale tag, e.g. "en", "es", "fr". Defaults to "en". */
10
- locale?: string;
11
- /**
12
- * Override or extend any Rebase UI string, keyed by locale.
13
- *
14
- * @example
15
- * translations={{
16
- * en: { save: "Publish" },
17
- * es: { save: "Publicar", discard: "Descartar" }
18
- * }}
19
- */
20
- translations?: {
21
- [locale: string]: DeepPartial<RebaseTranslations>;
22
- };
23
- }
24
- /**
25
- * Initialises a dedicated i18next instance for Rebase's internal UI strings.
26
- *
27
- * This instance is isolated from any app-level i18next configuration the
28
- * consumer may have. Mount this at the top of the Rebase component tree.
29
- *
30
- * @internal
31
- */
32
- export declare function RebaseI18nProvider({ locale, translations, children }: PropsWithChildren<RebaseI18nProviderProps>): import("react/jsx-runtime").JSX.Element | null;
33
- export {};
@@ -1,15 +0,0 @@
1
- export * from "./core";
2
- export * from "./hooks";
3
- export * from "./components";
4
- export * from "./util";
5
- export * from "./contexts";
6
- export * from "./internal/common";
7
- export * from "./internal/useRestoreScroll";
8
- export { useUnsavedChangesDialog } from "./hooks/useUnsavedChangesDialog";
9
- export type { UnsavedChangesDialogProps } from "./components/UnsavedChangesDialog";
10
- export { UnsavedChangesDialog } from "./components/UnsavedChangesDialog";
11
- export * from "./i18n/RebaseI18nProvider";
12
- export * from "./locales/en";
13
- export * from "./locales/es";
14
- export * from "./hooks/useStudioBridge";
15
- export { useBridgeRegistration } from "./hooks/useBridgeRegistration";
@@ -1,3 +0,0 @@
1
- export declare const CONTAINER_FULL_WIDTH = "100vw";
2
- export declare const ADDITIONAL_TAB_WIDTH = "55vw";
3
- export declare const FORM_CONTAINER_WIDTH = "768px";
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- export declare function useRestoreScroll(): {
3
- containerRef: React.RefObject<HTMLDivElement | null>;
4
- scroll: number;
5
- direction: "up" | "down";
6
- };
@@ -1,2 +0,0 @@
1
- import { RebaseTranslations } from "@rebasepro/types";
2
- export declare const de: RebaseTranslations;
@@ -1,10 +0,0 @@
1
- import { RebaseTranslations } from "@rebasepro/types";
2
- /**
3
- * English baseline translations for @rebasepro/core.
4
- *
5
- * This is the single source of truth for all default UI strings.
6
- * Override any key via the `translations` prop on Rebase entry-point components.
7
- *
8
- * @group Core
9
- */
10
- export declare const en: RebaseTranslations;
@@ -1,10 +0,0 @@
1
- import { RebaseTranslations } from "@rebasepro/types";
2
- /**
3
- * Spanish baseline translations for @rebasepro/core.
4
- *
5
- * This is the single source of truth for all default UI strings in Spanish.
6
- * Override any key via the `translations` prop on Rebase entry-point components.
7
- *
8
- * @group Core
9
- */
10
- export declare const es: RebaseTranslations;
@@ -1,2 +0,0 @@
1
- import { RebaseTranslations } from "@rebasepro/types";
2
- export declare const fr: RebaseTranslations;
@@ -1,2 +0,0 @@
1
- import { RebaseTranslations } from "@rebasepro/types";
2
- export declare const hi: RebaseTranslations;
@@ -1,2 +0,0 @@
1
- import { RebaseTranslations } from "@rebasepro/types";
2
- export declare const it: RebaseTranslations;
@@ -1,7 +0,0 @@
1
- import { RebaseTranslations } from "@rebasepro/types";
2
- /**
3
- * Portuguese (pt) translations for @rebasepro/core.
4
- *
5
- * @group Core
6
- */
7
- export declare const pt: RebaseTranslations;
@@ -1 +0,0 @@
1
- export declare const STUDIO_NAVIGATION_GROUPS: string[];
@@ -1,2 +0,0 @@
1
- import { FormexController } from "@rebasepro/formex";
2
- export declare function createFormexStub<T extends object>(values: T): FormexController<T>;
@@ -1,22 +0,0 @@
1
- /**
2
- * Saves data to the in-memory cache and persists it individually in `sessionStorage`.
3
- * @param path - The unique path/key for the data.
4
- * @param data - The data to cache and persist.
5
- */
6
- export declare function saveEntityToCache(path: string, data: object): void;
7
- export declare function removeEntityFromMemoryCache(path: string): void;
8
- export declare function saveEntityToMemoryCache(path: string, data: object): void;
9
- export declare function getEntityFromMemoryCache(path: string): object | undefined;
10
- /**
11
- * Retrieves an entity from the in-memory cache or `sessionStorage`.
12
- * If the entity is not in the cache but exists in `sessionStorage`, it loads it into the cache.
13
- * @param path - The unique path/key for the entity.
14
- * @returns The cached entity or `undefined` if not found.
15
- */
16
- export declare function getEntityFromCache(path: string): object | undefined;
17
- /**
18
- * Removes an entity from both the in-memory cache and `sessionStorage`.
19
- * @param path - The unique path/key for the entity to remove.
20
- */
21
- export declare function removeEntityFromCache(path: string): void;
22
- export declare function flattenKeys(obj: Record<string, unknown> | unknown[], prefix?: string, result?: string[]): string[];
@@ -1,5 +0,0 @@
1
- import { EnumValueConfig } from "@rebasepro/types";
2
- import { ChipColorScheme } from "@rebasepro/ui";
3
- export declare function getColorScheme(enumValues: EnumValueConfig[], key: string | number): ChipColorScheme | undefined;
4
- export declare function isEnumValueDisabled(labelOrConfig?: string | EnumValueConfig): boolean | undefined;
5
- export declare function buildEnumLabel(labelOrConfig?: string | EnumValueConfig): string | undefined;
@@ -1,5 +0,0 @@
1
- import Fuse from "fuse.js";
2
- export declare const iconsSearch: Fuse<{
3
- key: string;
4
- synonyms: string;
5
- }>;
@@ -1,20 +0,0 @@
1
- import React from "react";
2
- import { IconColor } from "@rebasepro/ui";
3
- /**
4
- * Render an icon element from a string key or existing React element.
5
- * This resolves the icon from the lucide-react icons map directly.
6
- */
7
- export declare function getIcon(iconKey?: string | React.ReactNode, className?: string, color?: IconColor, size?: "smallest" | "small" | "medium" | "large" | number): React.ReactElement | undefined;
8
- export type IconViewProps = {
9
- slug: string;
10
- name: string;
11
- singularName?: string;
12
- group?: string;
13
- icon?: string | React.ReactNode;
14
- };
15
- export declare const IconForView: React.NamedExoticComponent<{
16
- collectionOrView?: IconViewProps;
17
- color?: IconColor;
18
- className?: string;
19
- size?: "smallest" | "small" | "medium" | "large" | number;
20
- }>;
@@ -1,8 +0,0 @@
1
- export * from "./icon_list";
2
- export * from "./icons";
3
- export * from "./createFormexStub";
4
- export * from "./entity_cache";
5
- export * from "./useStorageUploadController";
6
- export * from "./previews";
7
- export * from "./enums";
8
- export * from "./constants";
@@ -1,4 +0,0 @@
1
- import type { EntityCollection, PropertyConfig } from "@rebasepro/types";
2
- import { AuthController } from "@rebasepro/types";
3
- export declare function getEntityPreviewKeys(authController: AuthController, targetCollection: EntityCollection<any>, fields: Record<string, PropertyConfig>, previewProperties?: string[], limit?: number): string[];
4
- export declare function getEntityTitlePropertyKey<M extends Record<string, any>>(collection: EntityCollection<M>, propertyConfigs: Record<string, PropertyConfig>): string | undefined;
@@ -1,38 +0,0 @@
1
- import type { ArrayProperty, StringProperty } from "@rebasepro/types";
2
- import { EntityValues, StorageConfig, StorageSource } from "@rebasepro/types";
3
- export type StorageFieldSize = "smallest" | "small" | "medium" | "large" | number;
4
- /**
5
- * Internal representation of an item in the storage
6
- * It can have two states, having a storagePathOrDownloadUrl set,
7
- * which means the file has been uploaded, and it is rendered as a preview
8
- * Or have a pending file being uploaded.
9
- */
10
- export interface StorageFieldItem {
11
- id: number;
12
- storagePathOrDownloadUrl?: string;
13
- file?: File;
14
- fileName?: string;
15
- metadata?: Record<string, unknown>;
16
- size: StorageFieldSize;
17
- }
18
- export declare function useStorageUploadController<M extends Record<string, unknown>>({ entityId, entityValues, path, value, property, propertyKey, storageSource, disabled, onChange }: {
19
- entityId?: string | number;
20
- entityValues: EntityValues<M>;
21
- value: string | string[] | null;
22
- path?: string;
23
- propertyKey: string;
24
- property: StringProperty | ArrayProperty | StringProperty | ArrayProperty;
25
- storageSource: StorageSource;
26
- disabled: boolean;
27
- onChange: (value: string | string[] | null) => void;
28
- }): {
29
- internalValue: StorageFieldItem[];
30
- setInternalValue: import("react").Dispatch<import("react").SetStateAction<StorageFieldItem[]>>;
31
- storage: StorageConfig;
32
- fileNameBuilder: (file: File) => Promise<string>;
33
- storagePathBuilder: (file: File) => string;
34
- onFileUploadComplete: (uploadedPath: string, entry: StorageFieldItem, metadata?: Record<string, unknown>, uploadedUrl?: string) => Promise<void>;
35
- onFileUploadError: (entry: StorageFieldItem) => void;
36
- onFilesAdded: (acceptedFiles: File[]) => Promise<void>;
37
- multipleFilesSupported: boolean;
38
- };
@@ -1,52 +0,0 @@
1
- import * as React from "react";
2
- import { FormexController } from "./types";
3
- export interface FieldInputProps<Value> {
4
- /** Value of the field */
5
- value: Value;
6
- /** Name of the field */
7
- name: string;
8
- /** Multiple select? */
9
- multiple?: boolean;
10
- /** Is the field checked? */
11
- checked?: boolean;
12
- /** Change event handler */
13
- onChange: (event: React.SyntheticEvent) => void;
14
- /** Blur event handler */
15
- onBlur: (event: React.FocusEvent) => void;
16
- }
17
- export interface FormexFieldProps<Value = any, FormValues extends object = object> {
18
- field: FieldInputProps<Value>;
19
- form: FormexController<FormValues>;
20
- }
21
- export interface FieldConfig<Value, C extends React.ElementType | undefined = undefined> {
22
- /**
23
- * Component to render. Can either be a string e.g. 'select', 'input', or 'textarea', or a component.
24
- */
25
- as?: C | string | React.ForwardRefExoticComponent<Record<string, unknown>>;
26
- /**
27
- * Children render function <Field name>{props => ...}</Field>)
28
- */
29
- children?: ((props: FormexFieldProps<Value>) => React.ReactNode) | React.ReactNode;
30
- /**
31
- * Validate a single field value independently
32
- */
33
- /**
34
- * Used for 'select' and related input types.
35
- */
36
- multiple?: boolean;
37
- /**
38
- * Field name
39
- */
40
- name: string;
41
- /** HTML input type */
42
- type?: string;
43
- /** Field value */
44
- value?: unknown;
45
- /** Inner ref */
46
- innerRef?: (instance: unknown) => void;
47
- }
48
- export type FieldProps<T, C extends React.ElementType | undefined> = {
49
- as?: C;
50
- } & (C extends React.ElementType ? (React.ComponentProps<C> & FieldConfig<T, C>) : FieldConfig<T, C>);
51
- export declare function Field<T, C extends React.ElementType | undefined = undefined>({ validate, name, children, as: is, // `as` is reserved in typescript lol
52
- className, ...props }: FieldProps<T, C>): any;
@@ -1,7 +0,0 @@
1
- import React from "react";
2
- import { FormexController } from "./types";
3
- export declare const useFormex: <T = any>() => FormexController<T>;
4
- export declare const Formex: <T = any>({ value, children }: {
5
- value: FormexController<T>;
6
- children: React.ReactNode;
7
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- export * from "./Field";
2
- export * from "./Formex";
3
- export * from "./types";
4
- export * from "./utils";
5
- export * from "./useCreateFormex";
@@ -1,40 +0,0 @@
1
- import React, { FormEvent } from "react";
2
- export type FormexController<T = any> = {
3
- values: T;
4
- initialValues: T;
5
- setValues: (values: T) => void;
6
- setFieldValue: (key: string, value: unknown, shouldValidate?: boolean) => void;
7
- touched: Record<string, boolean>;
8
- setFieldTouched: (key: string, touched: boolean, shouldValidate?: boolean) => void;
9
- setTouched: (touched: Record<string, boolean>) => void;
10
- dirty: boolean;
11
- setDirty: (dirty: boolean) => void;
12
- setSubmitCount: (submitCount: number) => void;
13
- errors: Record<string, string>;
14
- setFieldError: (key: string, error?: string) => void;
15
- handleChange: (event: React.SyntheticEvent) => void;
16
- handleBlur: (event: React.FocusEvent) => void;
17
- handleSubmit: (event?: FormEvent<HTMLFormElement>) => void;
18
- validate: () => void;
19
- resetForm: (props?: FormexResetProps<T>) => void;
20
- submitCount: number;
21
- isSubmitting: boolean;
22
- setSubmitting: (isSubmitting: boolean) => void;
23
- isValidating: boolean;
24
- /**
25
- * The version of the form. This is incremented every time the form is reset
26
- * or the form is submitted.
27
- */
28
- version: number;
29
- debugId?: string;
30
- undo: () => void;
31
- redo: () => void;
32
- canUndo: boolean;
33
- canRedo: boolean;
34
- };
35
- export type FormexResetProps<T = any> = {
36
- values?: T;
37
- submitCount?: number;
38
- errors?: Record<string, string>;
39
- touched?: Record<string, boolean>;
40
- };
@@ -1,14 +0,0 @@
1
- import { FormexController } from "./types";
2
- export declare function useCreateFormex<T = any>({ initialValues, initialErrors, initialDirty, initialTouched, validation, validateOnChange, validateOnInitialRender, onSubmit, onReset, onValuesChangeDeferred, debugId }: {
3
- initialValues: T;
4
- initialErrors?: Record<string, string>;
5
- initialDirty?: boolean;
6
- initialTouched?: Record<string, boolean>;
7
- validateOnChange?: boolean;
8
- validateOnInitialRender?: boolean;
9
- validation?: (values: T) => Record<string, string> | Promise<Record<string, string>> | undefined | void;
10
- onValuesChangeDeferred?: (values: T, controller: FormexController<T>) => void;
11
- onSubmit?: (values: T, controller: FormexController<T>) => void | Promise<void>;
12
- onReset?: (controller: FormexController<T>) => void | Promise<void>;
13
- debugId?: string;
14
- }): FormexController<T>;
@@ -1,16 +0,0 @@
1
- /** @private is the value an empty array? */
2
- export declare const isEmptyArray: (value?: unknown) => boolean;
3
- /** @private is the given object a Function? */
4
- export declare const isFunction: (obj: unknown) => obj is Function;
5
- /** @private is the given object an Object? */
6
- export declare const isObject: (obj: unknown) => obj is Record<string, unknown>;
7
- /** @private is the given object an integer? */
8
- export declare const isInteger: (obj: unknown) => boolean;
9
- /** @private is the given object a NaN? */
10
- export declare const isNaN: (obj: unknown) => boolean;
11
- /**
12
- * Deeply get a value from an object via its path.
13
- */
14
- export declare function getIn(obj: unknown, key: string | string[], def?: unknown, p?: number): unknown;
15
- export declare function setIn(obj: unknown, path: string, value: unknown): unknown;
16
- export declare function clone(value: unknown): unknown;
@@ -1 +0,0 @@
1
- export declare function BranchesView(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function CronJobsView(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function JSEditor(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function LogsExplorer(): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import "@xyflow/react/dist/style.css";
2
- export declare const SchemaVisualizer: () => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- export { SchemaVisualizer } from "./SchemaVisualizer";
2
- export { TableNode } from "./TableNode";
3
- export { RelationEdge } from "./RelationEdge";
4
- export { useSchemaGraph } from "./useSchemaGraph";
5
- export type { TableNodeData, ColumnInfo } from "./useSchemaGraph";
@@ -1 +0,0 @@
1
- export declare const StorageView: () => import("react/jsx-runtime").JSX.Element;
File without changes
@@ -1,7 +0,0 @@
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";
@@ -1,104 +0,0 @@
1
- import type { User } from "../users";
2
- /**
3
- * Capabilities advertised by an auth provider.
4
- * UI components use this to show/hide features dynamically
5
- * (e.g. password reset, registration, session management).
6
- * @group Hooks and utilities
7
- */
8
- export interface AuthCapabilities {
9
- emailPasswordLogin?: boolean;
10
- googleLogin?: boolean;
11
- registration?: boolean;
12
- passwordReset?: boolean;
13
- sessionManagement?: boolean;
14
- profileUpdate?: boolean;
15
- emailVerification?: boolean;
16
- /** List of enabled OAuth provider IDs (e.g. ["google", "github", "discord"]) */
17
- enabledProviders?: string[];
18
- }
19
- /**
20
- * Controller for retrieving the logged user or performing auth related operations.
21
- * Note that if you are implementing your AuthController, you probably will want
22
- * to do it as the result of a hook.
23
- * @group Hooks and utilities
24
- */
25
- export type AuthController<USER extends User = User, ExtraData = unknown> = {
26
- /**
27
- * The user currently logged in
28
- * The values can be: the user object, null if they skipped login
29
- */
30
- user: USER | null;
31
- /**
32
- * Initial loading flag. It is used not to display the login screen
33
- * when the app first loads, and it has not been checked whether the user
34
- * is logged in or not.
35
- */
36
- initialLoading?: boolean;
37
- /**
38
- * Loading flag. It is used to display a loading screen when the user is
39
- * logging in or out.
40
- */
41
- authLoading: boolean;
42
- /**
43
- * Sign out
44
- */
45
- signOut: () => Promise<void>;
46
- /**
47
- * Error initializing the authentication
48
- */
49
- authError?: unknown;
50
- /**
51
- * Error dispatched by the auth provider
52
- */
53
- authProviderError?: unknown;
54
- /**
55
- * You can use this method to retrieve the auth token for the current user.
56
- */
57
- getAuthToken: () => Promise<string>;
58
- /**
59
- * Has the user skipped the login process
60
- */
61
- loginSkipped: boolean;
62
- extra: ExtraData;
63
- setExtra: (extra: ExtraData) => void;
64
- setUser?(user: USER | null): void;
65
- setUserRoles?(roles: string[]): void;
66
- /**
67
- * Capabilities advertised by the auth provider.
68
- * UI components use this to feature-detect what the backend supports.
69
- */
70
- capabilities?: AuthCapabilities;
71
- };
72
- /**
73
- * Extended auth controller with common optional auth methods.
74
- * Backend implementations (Rebase backend, Firebase, Supabase, etc.)
75
- * extend this with their own backend-specific extras.
76
- * @group Hooks and utilities
77
- */
78
- export interface AuthControllerExtended<USER extends User = User, ExtraData = unknown> extends AuthController<USER, ExtraData> {
79
- /** Login with email and password */
80
- emailPasswordLogin?(email: string, password: string): Promise<void>;
81
- /** Login with Google — accepts an ID token, access token, or authorization code payload */
82
- googleLogin?: (payload: {
83
- idToken: string;
84
- } | {
85
- accessToken: string;
86
- } | {
87
- code: string;
88
- redirectUri: string;
89
- }) => Promise<void>;
90
- /** Generic OAuth login — works with any provider. Posts payload to /auth/{providerId}. */
91
- oauthLogin?: (providerId: string, payload: Record<string, unknown>) => Promise<void>;
92
- /** Register a new user */
93
- register?(email: string, password: string, displayName?: string): Promise<void>;
94
- /** Skip login (for anonymous access if enabled) */
95
- skipLogin?(): void;
96
- /** Request password reset email */
97
- forgotPassword?(email: string): Promise<void>;
98
- /** Reset password using a token */
99
- resetPassword?(token: string, password: string): Promise<void>;
100
- /** Change password for the authenticated user */
101
- changePassword?(oldPassword: string, newPassword: string): Promise<void>;
102
- /** Update user profile */
103
- updateProfile?(displayName?: string, photoURL?: string): Promise<USER>;
104
- }