@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,168 +0,0 @@
1
- import type { User } from "../users";
2
- import type { RebaseData } from "./data";
3
- import type { EmailService } from "./email";
4
- /**
5
- * Event type for authentication state changes
6
- */
7
- export type AuthChangeEvent = "SIGNED_IN" | "SIGNED_OUT" | "TOKEN_REFRESHED" | "USER_UPDATED";
8
- /**
9
- * Standard session interface representing an authenticated state
10
- */
11
- export interface RebaseSession {
12
- accessToken: string;
13
- refreshToken: string;
14
- expiresAt: number;
15
- user: User;
16
- }
17
- import type { StorageSource } from "./storage";
18
- /**
19
- * Unified Authentication Client Interface
20
- * Pure functional SDK interface, decoupled from UI and React hooks
21
- */
22
- export interface AuthClient {
23
- /**
24
- * Get the current user from the server or cache
25
- */
26
- getUser(): Promise<User | null>;
27
- /**
28
- * Get the currently active session
29
- */
30
- getSession(): RebaseSession | null;
31
- /**
32
- * Sign out the current user and clear local session
33
- */
34
- signOut(): Promise<void>;
35
- /**
36
- * Subscribe to authentication state changes
37
- */
38
- onAuthStateChange(callback: (event: AuthChangeEvent, session: RebaseSession | null) => void): () => void;
39
- /**
40
- * Manually refresh the session token
41
- */
42
- refreshSession(): Promise<RebaseSession>;
43
- }
44
- /**
45
- * User record as returned by the Admin API.
46
- * @group Admin
47
- */
48
- export interface AdminUser {
49
- uid: string;
50
- email: string;
51
- displayName: string | null;
52
- photoURL: string | null;
53
- provider: string;
54
- roles: string[];
55
- metadata?: Record<string, any>;
56
- createdAt: string;
57
- updatedAt: string;
58
- }
59
- /**
60
- * Client-side Admin API interface.
61
- * Provides user management operations.
62
- * @group Admin
63
- */
64
- export interface AdminAPI {
65
- listUsers(): Promise<{
66
- users: AdminUser[];
67
- }>;
68
- listUsersPaginated(options?: {
69
- search?: string;
70
- limit?: number;
71
- offset?: number;
72
- orderBy?: string;
73
- orderDir?: "asc" | "desc";
74
- }): Promise<{
75
- users: AdminUser[];
76
- total: number;
77
- limit: number;
78
- offset: number;
79
- }>;
80
- getUser(userId: string): Promise<{
81
- user: AdminUser;
82
- }>;
83
- createUser(data: {
84
- email: string;
85
- displayName?: string;
86
- password?: string;
87
- roles?: string[];
88
- metadata?: Record<string, any>;
89
- }): Promise<{
90
- user: AdminUser;
91
- }>;
92
- updateUser(userId: string, data: {
93
- email?: string;
94
- displayName?: string;
95
- password?: string;
96
- roles?: string[];
97
- metadata?: Record<string, any>;
98
- }): Promise<{
99
- user: AdminUser;
100
- }>;
101
- deleteUser(userId: string): Promise<{
102
- success: boolean;
103
- }>;
104
- bootstrap(): Promise<{
105
- success: boolean;
106
- message: string;
107
- user: {
108
- uid: string;
109
- roles: string[];
110
- };
111
- }>;
112
- }
113
- /**
114
- * Overarching abstraction that unites Data, Auth, Storage, and Email.
115
- * Adapters for Supabase or Firebase simply need to implement this interface.
116
- */
117
- export interface RebaseClient<DB = unknown> {
118
- /** Unified Data access layer */
119
- data: RebaseData;
120
- /** Unified Authentication layer */
121
- auth: AuthClient;
122
- /** Unified Storage layer */
123
- storage?: StorageSource;
124
- /**
125
- * Server-side email service.
126
- *
127
- * Available when SMTP (or a custom `sendEmail` function) is configured
128
- * in the backend auth config. `undefined` when email is not configured.
129
- *
130
- * > **Note:** This is only available on the server-side `rebase` singleton.
131
- * > The client-side SDK does not include an email service.
132
- */
133
- email?: EmailService;
134
- /** Admin API for user management */
135
- admin?: AdminAPI;
136
- /**
137
- * The base HTTP URL of the backend server.
138
- * Exposed by the SDK client (`@rebasepro/client`) and used to auto-derive
139
- * the `ApiConfigProvider` URL.
140
- */
141
- baseUrl?: string;
142
- /**
143
- * WebSocket client for realtime subscriptions and admin capabilities.
144
- * Exposed by the SDK client (`@rebasepro/client`). The shape is intentionally
145
- * left as `unknown` in the base interface — callers should narrow via feature
146
- * detection (e.g. `typeof ws.executeSql === "function"`).
147
- */
148
- ws?: unknown;
149
- /**
150
- * Execute raw SQL against the database.
151
- *
152
- * Only available server-side when the backend uses a SQL database
153
- * (PostgreSQL, MySQL, etc.). `undefined` for document databases
154
- * (MongoDB, Firestore) and on the client-side SDK.
155
- *
156
- * @example
157
- * ```typescript
158
- * // In a cron job or custom function:
159
- * if (ctx.client.sql) {
160
- * const rows = await ctx.client.sql("SELECT count(*) FROM orders");
161
- * }
162
- * ```
163
- */
164
- sql?(query: string, options?: {
165
- database?: string;
166
- role?: string;
167
- }): Promise<Record<string, unknown>[]>;
168
- }
@@ -1,46 +0,0 @@
1
- import type { EntityCollection } from "../types/collections";
2
- import type { EntityReference } from "../types/entities";
3
- /**
4
- * Controller that provides access to the registered entity collections.
5
- * @group Models
6
- */
7
- export type CollectionRegistryController<DB = Record<string, unknown>, EC extends EntityCollection = EntityCollection> = {
8
- /**
9
- * List of the mapped collections in the CMS.
10
- * Each entry relates to a collection in the root database.
11
- * Each of the navigation entries in this field
12
- * generates an entry in the main menu.
13
- */
14
- collections?: EntityCollection[];
15
- /**
16
- * Is the registry ready to be used
17
- */
18
- initialised: boolean;
19
- /**
20
- * Get the collection configuration for a given path.
21
- * The collection is resolved from the given path or alias.
22
- */
23
- getCollection: <K extends keyof DB>(slugOrPath: Extract<K, string>, includeUserOverride?: boolean) => EC | undefined;
24
- /**
25
- * Get the raw, un-normalized collection configuration.
26
- * This bypasses the `CollectionRegistry` normalization (such as injecting `relation` instances).
27
- * This is strictly for the Visual Editor to manipulate AST code without persisting runtime state.
28
- */
29
- getRawCollection: (slugOrPath: string) => EC | undefined;
30
- /**
31
- * Retrieve all the related parent references for a given path
32
- * @param path
33
- */
34
- getParentReferencesFromPath: (path: string) => EntityReference[];
35
- /**
36
- * Retrieve all the related parent collection ids for a given path
37
- * @param path
38
- */
39
- getParentCollectionSlugs: (path: string) => string[];
40
- getParentEntityIds: (path: string) => string[];
41
- /**
42
- * Resolve paths from a list of ids
43
- * @param ids
44
- */
45
- convertIdsToPaths: (ids: string[]) => string[];
46
- };
@@ -1,60 +0,0 @@
1
- import React from "react";
2
- import type { EntityLinkBuilder } from "../types/entity_link_builder";
3
- import type { Locale } from "../types/locales";
4
- import type { EntityAction } from "../types/entity_actions";
5
- import type { EntityCustomView } from "../types/entity_views";
6
- import type { RebasePlugin } from "../types/plugins";
7
- import type { PropertyConfig } from "../types/property_config";
8
- import type { SlotContribution } from "../types/slots";
9
- export type CustomizationController = {
10
- /**
11
- * Builder for generating utility links for entities
12
- */
13
- entityLinkBuilder?: EntityLinkBuilder;
14
- /**
15
- * Use plugins to modify the behaviour of the CMS.
16
- */
17
- plugins?: RebasePlugin[];
18
- /**
19
- * Pre-merged slots from plugins + direct slot contributions.
20
- */
21
- resolvedSlots: SlotContribution[];
22
- /**
23
- * List of additional custom views for entities.
24
- * You can use the key to reference the custom view in
25
- * the `entityViews` prop of a collection.
26
- *
27
- * You can also define an entity view from the UI.
28
- */
29
- entityViews?: EntityCustomView[];
30
- /**
31
- * List of actions that can be performed on entities.
32
- * These actions are displayed in the entity view and in the collection view.
33
- * You can later reuse these actions in the `entityActions` prop of a collection,
34
- * by specifying the `key` of the action.
35
- */
36
- entityActions?: EntityAction[];
37
- /**
38
- * Format of the dates in the CMS.
39
- * Defaults to 'MMMM dd, yyyy, HH:mm:ss'
40
- */
41
- dateTimeFormat?: string;
42
- /**
43
- * Locale of the CMS, currently only affecting dates
44
- */
45
- locale?: Locale;
46
- /**
47
- * Record of custom form fields to be used in the CMS.
48
- * You can use the key to reference the custom field in
49
- * the `propertyConfig` prop of a property in a collection.
50
- */
51
- propertyConfigs: Record<string, PropertyConfig>;
52
- components?: {
53
- /**
54
- * Component to render when a reference is missing
55
- */
56
- missingReference?: React.ComponentType<{
57
- path: string;
58
- }>;
59
- };
60
- };
@@ -1,207 +0,0 @@
1
- import { Entity, EntityValues } from "../types/entities";
2
- /**
3
- * Parameters for querying a collection.
4
- * Uses PostgREST-style filter syntax for consistency between
5
- * the SDK (HTTP) and framework (in-process) contexts.
6
- *
7
- * @group Data
8
- */
9
- /**
10
- * A where-clause value for a single field.
11
- *
12
- * Supports three syntaxes:
13
- * 1. **Equality shorthand**: raw JS values — `null`, `"active"`, `42`, `true`
14
- * 2. **Tuple syntax**: `[operator, value]` — `[">", 18]`, `["in", ["a","b"]]`
15
- * 3. **PostgREST string**: `"eq.published"`, `"gte.18"`, `"in.(a,b)"`
16
- *
17
- * @group Data
18
- */
19
- export type WhereFieldValue = string | number | boolean | null | [WhereFilterOpShort, any] | [WhereFilterOpShort, any][];
20
- export type WhereValue<T> = T | T[] | null;
21
- export interface LogicalCondition {
22
- type: "and" | "or";
23
- conditions: (FilterCondition | LogicalCondition)[];
24
- }
25
- export interface FilterCondition {
26
- column: string;
27
- operator: FilterOperator;
28
- value: unknown;
29
- }
30
- /** Short operator strings accepted in the tuple syntax. */
31
- export type WhereFilterOpShort = "==" | "!=" | ">" | ">=" | "<" | "<=" | "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "nin" | "not-in" | "array-contains" | "array-contains-any" | "cs" | "csa";
32
- export interface FindParams {
33
- /** Maximum number of items to return (default: 20) */
34
- limit?: number;
35
- /** Number of items to skip */
36
- offset?: number;
37
- /** Page number (1-indexed), alternative to offset */
38
- page?: number;
39
- /**
40
- * Filter object. Supports multiple syntaxes per field:
41
- *
42
- * **Equality shorthand** — raw JS values (null, string, number, boolean):
43
- * ```ts
44
- * { company_profile_id: null }
45
- * { status: "active" }
46
- * { age: 18 }
47
- * ```
48
- *
49
- * **Tuple syntax** — `[operator, value]`:
50
- * ```ts
51
- * { age: [">=", 18] }
52
- * { role: ["in", ["admin", "editor"]] }
53
- * { deleted_at: ["!=", null] }
54
- * ```
55
- *
56
- * **PostgREST string syntax** (original format):
57
- * ```ts
58
- * { status: "eq.published" }
59
- * { age: "gte.18" }
60
- * { role: "in.(admin,editor)" }
61
- * ```
62
- */
63
- where?: Record<string, WhereFieldValue>;
64
- /** Logical grouping conditions (AND/OR) */
65
- logical?: LogicalCondition;
66
- /**
67
- * Sort order. Format: "field:direction".
68
- * @example "created_at:desc", "name:asc"
69
- */
70
- orderBy?: string;
71
- /** Relations to include in the response */
72
- include?: string[];
73
- /** Full-text search string */
74
- searchString?: string;
75
- }
76
- /**
77
- * Paginated response from a collection query.
78
- * @group Data
79
- */
80
- export interface FindResponse<M extends Record<string, unknown> = Record<string, unknown>> {
81
- /** Array of entities matching the query */
82
- data: Entity<M>[];
83
- /** Pagination metadata */
84
- meta: {
85
- total: number;
86
- limit: number;
87
- offset: number;
88
- hasMore: boolean;
89
- };
90
- }
91
- export type FilterOperator = WhereFilterOpShort;
92
- /**
93
- * Fluent Query Builder Interface supported on both client and server accessors.
94
- * @group Data
95
- */
96
- export interface QueryBuilderInterface<M extends Record<string, unknown> = Record<string, unknown>> {
97
- where<K extends keyof M & string>(column: K, operator: FilterOperator, value: WhereValue<M[K]>): this;
98
- where(logicalCondition: LogicalCondition): this;
99
- orderBy(column: keyof M & string, ascending?: "asc" | "desc"): this;
100
- limit(count: number): this;
101
- offset(count: number): this;
102
- search(searchString: string): this;
103
- include(...relations: string[]): this;
104
- find(): Promise<FindResponse<M>>;
105
- listen(onUpdate: (data: FindResponse<M>) => void, onError?: (error: Error) => void): () => void;
106
- }
107
- /**
108
- * A single collection's CRUD accessor.
109
- *
110
- * This is the unified API surface used in both:
111
- * - The generated SDK (`client.data.products.create(...)`)
112
- * - Framework callbacks (`context.data.products.create(...)`)
113
- *
114
- * @group Data
115
- */
116
- export interface CollectionAccessor<M extends Record<string, unknown> = Record<string, unknown>> {
117
- /**
118
- * Find multiple records with optional filtering, pagination, and sorting.
119
- */
120
- find(params?: FindParams): Promise<FindResponse<M>>;
121
- /**
122
- * Find a single record by its ID.
123
- */
124
- findById(id: string | number): Promise<Entity<M> | undefined>;
125
- /**
126
- * Create a new record.
127
- * @param data The entity data to create.
128
- * @param id Optional specific ID to use for the new record.
129
- * @returns The created entity
130
- */
131
- create(data: Partial<EntityValues<M>>, id?: string | number): Promise<Entity<M>>;
132
- /**
133
- * Update an existing record by ID.
134
- * @returns The updated entity
135
- */
136
- update(id: string | number, data: Partial<EntityValues<M>>): Promise<Entity<M>>;
137
- /**
138
- * Delete a record by ID.
139
- */
140
- delete(id: string | number): Promise<void>;
141
- /**
142
- * Delete all records in this collection.
143
- */
144
- deleteAll?(): Promise<void>;
145
- /**
146
- * Subscribe to a collection for real-time updates.
147
- * Optional method, may not be supported by all implementations (like stateless HTTP clients).
148
- */
149
- listen?(params: FindParams | undefined, onUpdate: (response: FindResponse<M>) => void, onError?: (error: Error) => void): () => void;
150
- /**
151
- * Subscribe to a single record for real-time updates.
152
- * Optional method.
153
- */
154
- listenById?(id: string | number, onUpdate: (entity: Entity<M> | undefined) => void, onError?: (error: Error) => void): () => void;
155
- /**
156
- * Count the number of records matching the given filter.
157
- */
158
- count?(params?: FindParams): Promise<number>;
159
- where<K extends keyof M & string>(column: K, operator: FilterOperator, value: WhereValue<M[K]>): QueryBuilderInterface<M>;
160
- where(logicalCondition: LogicalCondition): QueryBuilderInterface<M>;
161
- orderBy(column: keyof M & string, ascending?: "asc" | "desc"): QueryBuilderInterface<M>;
162
- limit(count: number): QueryBuilderInterface<M>;
163
- offset(count: number): QueryBuilderInterface<M>;
164
- search(searchString: string): QueryBuilderInterface<M>;
165
- include(...relations: string[]): QueryBuilderInterface<M>;
166
- }
167
- /**
168
- * The unified data access object.
169
- *
170
- * Access collections as dynamic properties: `data.products.find(...)`.
171
- * In the SDK this is backed by HTTP transport (typed, generated per-project).
172
- * In the framework this is backed by a Proxy + in-process database driver (dynamic).
173
- *
174
- * @example
175
- * // SDK
176
- * const client = createRebaseClient({ baseUrl: "..." });
177
- * await client.data.products.create({ name: "Camera", price: 299 });
178
- *
179
- * // Framework callback
180
- * callbacks: {
181
- * afterSave({ context }) {
182
- * await context.data.logs.create({ action: "saved", timestamp: new Date() });
183
- * }
184
- * }
185
- *
186
- * @group Data
187
- */
188
- export interface RebaseData {
189
- /**
190
- * Get a collection accessor by slug.
191
- * Alternative to dynamic property access for cases where
192
- * the collection name is a variable.
193
- *
194
- * @example
195
- * const accessor = data.collection("products");
196
- * await accessor.find({ limit: 10 });
197
- */
198
- collection(slug: string): CollectionAccessor;
199
- /**
200
- * Dynamic collection accessor.
201
- * Access any collection by its slug as a property.
202
- *
203
- * @example
204
- * data.products.find({ where: { status: "eq.published" } })
205
- */
206
- [collectionSlug: string]: CollectionAccessor | ((slug: string) => CollectionAccessor);
207
- }
@@ -1,218 +0,0 @@
1
- import type { Entity, EntityStatus, EntityValues } from "../types/entities";
2
- import type { EntityCollection, FilterValues } from "../types/collections";
3
- import type { RebaseContext } from "../rebase_context";
4
- /**
5
- * @internal
6
- */
7
- export interface FetchEntityProps<M extends Record<string, unknown> = Record<string, unknown>> {
8
- path: string;
9
- entityId: string | number;
10
- databaseId?: string;
11
- collection?: EntityCollection<M>;
12
- }
13
- /**
14
- * @internal
15
- */
16
- export type ListenEntityProps<M extends Record<string, unknown> = Record<string, unknown>> = FetchEntityProps<M> & {
17
- onUpdate: (entity: Entity<M> | null) => void;
18
- onError?: (error: Error) => void;
19
- };
20
- /**
21
- * Configuration for vector similarity search queries.
22
- * Vector search applies an ORDER BY distance expression and optionally
23
- * filters results by a distance threshold.
24
- */
25
- export interface VectorSearchParams {
26
- /** Property name containing the vector column */
27
- property: string;
28
- /** Query vector to compare against */
29
- vector: number[];
30
- /** Distance function (default: "cosine") */
31
- distance?: "cosine" | "l2" | "inner_product";
32
- /** Only return results within this distance threshold */
33
- threshold?: number;
34
- }
35
- /**
36
- * @internal
37
- */
38
- export interface FetchCollectionProps<M extends Record<string, unknown> = Record<string, unknown>> {
39
- path: string;
40
- collection?: EntityCollection<M>;
41
- filter?: FilterValues<Extract<keyof M, string>>;
42
- limit?: number;
43
- offset?: number;
44
- startAfter?: unknown;
45
- orderBy?: string;
46
- searchString?: string;
47
- order?: "desc" | "asc";
48
- /** Vector similarity search configuration */
49
- vectorSearch?: VectorSearchParams;
50
- }
51
- /**
52
- * @internal
53
- */
54
- export type ListenCollectionProps<M extends Record<string, unknown> = Record<string, unknown>> = FetchCollectionProps<M> & {
55
- onUpdate: (entities: Entity<M>[]) => void;
56
- onError?: (error: Error) => void;
57
- };
58
- /**
59
- * @internal
60
- */
61
- export interface SaveEntityProps<M extends Record<string, unknown> = Record<string, unknown>> {
62
- path: string;
63
- values: Partial<EntityValues<M>>;
64
- entityId?: string | number;
65
- previousValues?: Partial<EntityValues<M>>;
66
- collection?: EntityCollection<M>;
67
- status: EntityStatus;
68
- }
69
- /**
70
- * @internal
71
- */
72
- export interface DeleteEntityProps<M extends Record<string, unknown> = Record<string, unknown>> {
73
- entity: Entity<M>;
74
- collection?: EntityCollection<M>;
75
- }
76
- export type FilterCombinationValidProps = {
77
- path: string;
78
- databaseId?: string;
79
- collection: EntityCollection;
80
- filterValues: FilterValues<string>;
81
- sortBy?: [string, "asc" | "desc"];
82
- };
83
- /**
84
- * Internal driver interface for communicating with the data layer.
85
- * This is NOT the public API — use `RebaseData` / `context.data` instead.
86
- * @internal
87
- */
88
- export interface DataDriver {
89
- /**
90
- * Key that identifies this driver
91
- */
92
- key?: string;
93
- /**
94
- * If the driver has been initialised
95
- */
96
- initialised?: boolean;
97
- /**
98
- * Fetch data from a collection
99
- * @param props
100
- * @return Promise of entities
101
- */
102
- fetchCollection<M extends Record<string, unknown> = Record<string, unknown>>(props: FetchCollectionProps<M>): Promise<Entity<M>[]>;
103
- /**
104
- * Listen to a collection in a given path. If you don't implement this method
105
- * `fetchCollection` will be used instead, with no real time updates.
106
- * @param props
107
- * @return Function to cancel subscription
108
- */
109
- listenCollection?<M extends Record<string, unknown> = Record<string, unknown>>(props: ListenCollectionProps<M>): () => void;
110
- /**
111
- * Retrieve an entity given a path and a collection
112
- * @param props
113
- */
114
- fetchEntity<M extends Record<string, unknown> = Record<string, unknown>>(props: FetchEntityProps<M>): Promise<Entity<M> | undefined>;
115
- /**
116
- * Get realtime updates on one entity.
117
- * @param props
118
- * @return Function to cancel subscription
119
- */
120
- listenEntity?<M extends Record<string, unknown> = Record<string, unknown>>(props: ListenEntityProps<M>): () => void;
121
- /**
122
- * Save entity to the specified path
123
- * @param props
124
- */
125
- saveEntity<M extends Record<string, unknown> = Record<string, unknown>>(props: SaveEntityProps<M>): Promise<Entity<M>>;
126
- /**
127
- * Delete an entity
128
- * @param props
129
- * @return was the whole deletion flow successful
130
- */
131
- deleteEntity<M extends Record<string, unknown> = Record<string, unknown>>(props: DeleteEntityProps<M>): Promise<void>;
132
- /**
133
- * Delete all entities from a collection.
134
- * @param path Collection path
135
- */
136
- deleteAll?(path: string): Promise<void>;
137
- /**
138
- * Check if the given property is unique in the given collection
139
- * @param path Collection path
140
- * @param name of the property
141
- * @param value
142
- * @param entityId
143
- * @param collection
144
- * @return `true` if there are no other fields besides the given entity
145
- */
146
- checkUniqueField(path: string, name: string, value: unknown, entityId?: string | number, collection?: EntityCollection): Promise<boolean>;
147
- /**
148
- * Count the number of entities in a collection
149
- */
150
- countEntities?<M extends Record<string, unknown> = Record<string, unknown>>(props: FetchCollectionProps<M>): Promise<number>;
151
- /**
152
- * Check if the given filter combination is valid
153
- * @param props
154
- */
155
- isFilterCombinationValid?(props: Omit<FilterCombinationValidProps, "collection"> & {
156
- databaseId?: string;
157
- }): boolean;
158
- /**
159
- * Get the object to generate the current time in the driver
160
- */
161
- currentTime?: () => unknown;
162
- delegateToCMSModel?: (data: unknown) => unknown;
163
- cmsToDelegateModel?: (data: unknown) => unknown;
164
- initTextSearch?: (props: {
165
- context: RebaseContext;
166
- path: string;
167
- databaseId?: string;
168
- collection: EntityCollection;
169
- parentCollectionSlugs?: string[];
170
- parentEntityIds?: string[];
171
- }) => Promise<boolean>;
172
- /**
173
- * Flag to indicate if the driver has requested the initialization of the text search index
174
- */
175
- needsInitTextSearch?: boolean;
176
- /**
177
- * Optional REST-optimised fetch service. When present, the REST API
178
- * generator uses these methods instead of the generic `fetchEntity` /
179
- * `fetchCollection` pipeline, enabling include-aware eager-loading.
180
- */
181
- restFetchService?: RestFetchService;
182
- /**
183
- * Return the admin capabilities of this driver.
184
- * @see SQLAdmin
185
- * @see DocumentAdmin
186
- * @see SchemaAdmin
187
- */
188
- admin?: import("../types/backend").DatabaseAdmin;
189
- }
190
- /**
191
- * REST-optimised fetch service exposed by drivers that support
192
- * eager-loading of relations via `include`.
193
- *
194
- * The methods return flattened rows (`{ id, ...columns }`) rather
195
- * than the `Entity<M>` wrapper used by the generic DataDriver API.
196
- *
197
- * @group DataDriver
198
- */
199
- export interface RestFetchService {
200
- /**
201
- * Fetch a collection of flattened entities with optional relation includes.
202
- */
203
- fetchCollectionForRest(collectionPath: string, options?: {
204
- filter?: FilterValues<string>;
205
- orderBy?: string;
206
- order?: "desc" | "asc";
207
- limit?: number;
208
- offset?: number;
209
- startAfter?: Record<string, unknown>;
210
- searchString?: string;
211
- databaseId?: string;
212
- vectorSearch?: VectorSearchParams;
213
- }, include?: string[]): Promise<Record<string, unknown>[]>;
214
- /**
215
- * Fetch a single flattened entity with optional relation includes.
216
- */
217
- fetchEntityForRest(collectionPath: string, entityId: string | number, include?: string[], databaseId?: string): Promise<Record<string, unknown> | null>;
218
- }