@rebasepro/plugin-data-enhancement 0.0.1-canary.000dc36

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 (318) hide show
  1. package/LICENSE +114 -0
  2. package/README.md +89 -0
  3. package/dist/common/src/collections/CollectionRegistry.d.ts +56 -0
  4. package/dist/common/src/collections/index.d.ts +1 -0
  5. package/dist/common/src/data/buildRebaseData.d.ts +14 -0
  6. package/dist/common/src/index.d.ts +3 -0
  7. package/dist/common/src/util/builders.d.ts +57 -0
  8. package/dist/common/src/util/callbacks.d.ts +6 -0
  9. package/dist/common/src/util/collections.d.ts +11 -0
  10. package/dist/common/src/util/common.d.ts +2 -0
  11. package/dist/common/src/util/conditions.d.ts +26 -0
  12. package/dist/common/src/util/entities.d.ts +58 -0
  13. package/dist/common/src/util/enums.d.ts +3 -0
  14. package/dist/common/src/util/index.d.ts +16 -0
  15. package/dist/common/src/util/navigation_from_path.d.ts +34 -0
  16. package/dist/common/src/util/navigation_utils.d.ts +20 -0
  17. package/dist/common/src/util/parent_references_from_path.d.ts +6 -0
  18. package/dist/common/src/util/paths.d.ts +14 -0
  19. package/dist/common/src/util/permissions.d.ts +5 -0
  20. package/dist/common/src/util/references.d.ts +2 -0
  21. package/dist/common/src/util/relations.d.ts +22 -0
  22. package/dist/common/src/util/resolutions.d.ts +72 -0
  23. package/dist/common/src/util/storage.d.ts +24 -0
  24. package/dist/core/src/components/AIIcon.d.ts +16 -0
  25. package/dist/core/src/components/ConfirmationDialog.d.ts +9 -0
  26. package/dist/core/src/components/Debug/UIReferenceView.d.ts +1 -0
  27. package/dist/core/src/components/Debug/UIStyleGuide.d.ts +1 -0
  28. package/dist/core/src/components/ErrorTooltip.d.ts +2 -0
  29. package/dist/core/src/components/ErrorView.d.ts +21 -0
  30. package/dist/core/src/components/LanguageToggle.d.ts +1 -0
  31. package/dist/core/src/components/LoginView/LoginView.d.ts +68 -0
  32. package/dist/core/src/components/LoginView/index.d.ts +2 -0
  33. package/dist/core/src/components/NotFoundPage.d.ts +1 -0
  34. package/dist/core/src/components/RebaseAuth.d.ts +10 -0
  35. package/dist/core/src/components/RebaseLogo.d.ts +7 -0
  36. package/dist/core/src/components/UnsavedChangesDialog.d.ts +9 -0
  37. package/dist/core/src/components/UserDisplay.d.ts +7 -0
  38. package/dist/core/src/components/UserSelectPopover.d.ts +62 -0
  39. package/dist/core/src/components/UserSettingsView.d.ts +1 -0
  40. package/dist/core/src/components/common/index.d.ts +6 -0
  41. package/dist/core/src/components/common/table_height.d.ts +5 -0
  42. package/dist/core/src/components/common/types.d.ts +63 -0
  43. package/dist/core/src/components/common/useColumnsIds.d.ts +9 -0
  44. package/dist/core/src/components/common/useDataTableController.d.ts +45 -0
  45. package/dist/core/src/components/common/useDebouncedData.d.ts +9 -0
  46. package/dist/core/src/components/common/useScrollRestoration.d.ts +14 -0
  47. package/dist/core/src/components/index.d.ts +16 -0
  48. package/dist/core/src/contexts/AdminModeController.d.ts +4 -0
  49. package/dist/core/src/contexts/AnalyticsContext.d.ts +3 -0
  50. package/dist/core/src/contexts/AuthControllerContext.d.ts +3 -0
  51. package/dist/core/src/contexts/CustomizationControllerContext.d.ts +3 -0
  52. package/dist/core/src/contexts/DataDriverContext.d.ts +3 -0
  53. package/dist/core/src/contexts/DatabaseAdminContext.d.ts +3 -0
  54. package/dist/core/src/contexts/DialogsProvider.d.ts +4 -0
  55. package/dist/core/src/contexts/EffectiveRoleController.d.ts +4 -0
  56. package/dist/core/src/contexts/InternalUserManagementContext.d.ts +3 -0
  57. package/dist/core/src/contexts/ModeController.d.ts +4 -0
  58. package/dist/core/src/contexts/RebaseClientInstanceContext.d.ts +6 -0
  59. package/dist/core/src/contexts/RebaseDataContext.d.ts +3 -0
  60. package/dist/core/src/contexts/SnackbarProvider.d.ts +2 -0
  61. package/dist/core/src/contexts/StorageSourceContext.d.ts +3 -0
  62. package/dist/core/src/contexts/UserConfigurationPersistenceContext.d.ts +3 -0
  63. package/dist/core/src/contexts/index.d.ts +13 -0
  64. package/dist/core/src/core/PluginLifecycleManager.d.ts +17 -0
  65. package/dist/core/src/core/PluginProviderStack.d.ts +21 -0
  66. package/dist/core/src/core/Rebase.d.ts +14 -0
  67. package/dist/core/src/core/RebaseProps.d.ts +136 -0
  68. package/dist/core/src/core/RebaseRouter.d.ts +4 -0
  69. package/dist/core/src/core/RebaseRoutes.d.ts +17 -0
  70. package/dist/core/src/core/index.d.ts +4 -0
  71. package/dist/core/src/hooks/ApiConfigContext.d.ts +24 -0
  72. package/dist/core/src/hooks/data/delete.d.ts +31 -0
  73. package/dist/core/src/hooks/data/save.d.ts +34 -0
  74. package/dist/core/src/hooks/data/useCollectionFetch.d.ts +51 -0
  75. package/dist/core/src/hooks/data/useData.d.ts +13 -0
  76. package/dist/core/src/hooks/data/useDataOrder.d.ts +12 -0
  77. package/dist/core/src/hooks/data/useEntityFetch.d.ts +38 -0
  78. package/dist/core/src/hooks/data/useRelationSelector.d.ts +52 -0
  79. package/dist/core/src/hooks/data/useUserSelector.d.ts +31 -0
  80. package/dist/core/src/hooks/index.d.ts +37 -0
  81. package/dist/core/src/hooks/useAdminModeController.d.ts +19 -0
  82. package/dist/core/src/hooks/useAnalyticsController.d.ts +5 -0
  83. package/dist/core/src/hooks/useAuthController.d.ts +11 -0
  84. package/dist/core/src/hooks/useAuthSubscription.d.ts +2 -0
  85. package/dist/core/src/hooks/useBackendStorageSource.d.ts +30 -0
  86. package/dist/core/src/hooks/useBridgeRegistration.d.ts +18 -0
  87. package/dist/core/src/hooks/useBrowserTitleAndIcon.d.ts +6 -0
  88. package/dist/core/src/hooks/useBuildAdminModeController.d.ts +6 -0
  89. package/dist/core/src/hooks/useBuildEffectiveRoleController.d.ts +8 -0
  90. package/dist/core/src/hooks/useBuildLocalConfigurationPersistence.d.ts +2 -0
  91. package/dist/core/src/hooks/useBuildModeController.d.ts +6 -0
  92. package/dist/core/src/hooks/useClipboard.d.ts +57 -0
  93. package/dist/core/src/hooks/useCollapsedGroups.d.ts +12 -0
  94. package/dist/core/src/hooks/useCustomizationController.d.ts +11 -0
  95. package/dist/core/src/hooks/useDialogsController.d.ts +11 -0
  96. package/dist/core/src/hooks/useEffectiveRoleController.d.ts +7 -0
  97. package/dist/core/src/hooks/useInternalUserManagementController.d.ts +12 -0
  98. package/dist/core/src/hooks/useLargeLayout.d.ts +1 -0
  99. package/dist/core/src/hooks/useModeController.d.ts +19 -0
  100. package/dist/core/src/hooks/usePermissions.d.ts +12 -0
  101. package/dist/core/src/hooks/useRebaseClient.d.ts +5 -0
  102. package/dist/core/src/hooks/useRebaseContext.d.ts +11 -0
  103. package/dist/core/src/hooks/useRebaseRegistry.d.ts +34 -0
  104. package/dist/core/src/hooks/useSlot.d.ts +18 -0
  105. package/dist/core/src/hooks/useSnackbarController.d.ts +20 -0
  106. package/dist/core/src/hooks/useStorageSource.d.ts +7 -0
  107. package/dist/core/src/hooks/useStudioBridge.d.ts +91 -0
  108. package/dist/core/src/hooks/useTranslation.d.ts +17 -0
  109. package/dist/core/src/hooks/useUnsavedChangesDialog.d.ts +12 -0
  110. package/dist/core/src/hooks/useUserConfigurationPersistence.d.ts +8 -0
  111. package/dist/core/src/hooks/useValidateAuthenticator.d.ts +21 -0
  112. package/dist/core/src/i18n/RebaseI18nProvider.d.ts +33 -0
  113. package/dist/core/src/index.d.ts +15 -0
  114. package/dist/core/src/internal/common.d.ts +3 -0
  115. package/dist/core/src/internal/useRestoreScroll.d.ts +6 -0
  116. package/dist/core/src/locales/de.d.ts +2 -0
  117. package/dist/core/src/locales/en.d.ts +10 -0
  118. package/dist/core/src/locales/es.d.ts +10 -0
  119. package/dist/core/src/locales/fr.d.ts +2 -0
  120. package/dist/core/src/locales/hi.d.ts +2 -0
  121. package/dist/core/src/locales/it.d.ts +2 -0
  122. package/dist/core/src/locales/pt.d.ts +7 -0
  123. package/dist/core/src/util/constants.d.ts +1 -0
  124. package/dist/core/src/util/createFormexStub.d.ts +2 -0
  125. package/dist/core/src/util/entity_cache.d.ts +27 -0
  126. package/dist/core/src/util/enums.d.ts +5 -0
  127. package/dist/core/src/util/icon_list.d.ts +5 -0
  128. package/dist/core/src/util/icon_synonyms.d.ts +1 -0
  129. package/dist/core/src/util/icons.d.ts +20 -0
  130. package/dist/core/src/util/index.d.ts +10 -0
  131. package/dist/core/src/util/previews.d.ts +4 -0
  132. package/dist/core/src/util/useStorageUploadController.d.ts +38 -0
  133. package/dist/core/src/util/useTraceUpdate.d.ts +2 -0
  134. package/dist/formex/src/Field.d.ts +52 -0
  135. package/dist/formex/src/Formex.d.ts +7 -0
  136. package/dist/formex/src/index.d.ts +5 -0
  137. package/dist/formex/src/types.d.ts +40 -0
  138. package/dist/formex/src/useCreateFormex.d.ts +14 -0
  139. package/dist/formex/src/utils.d.ts +16 -0
  140. package/dist/index.es.js +751 -0
  141. package/dist/index.es.js.map +1 -0
  142. package/dist/index.umd.js +746 -0
  143. package/dist/index.umd.js.map +1 -0
  144. package/dist/plugin-data-enhancement/src/api.d.ts +34 -0
  145. package/dist/plugin-data-enhancement/src/components/DataEnhancementControllerProvider.d.ts +14 -0
  146. package/dist/plugin-data-enhancement/src/components/FormEnhanceAction.d.ts +10 -0
  147. package/dist/plugin-data-enhancement/src/editor/useEditorAIController.d.ts +4 -0
  148. package/dist/plugin-data-enhancement/src/index.d.ts +4 -0
  149. package/dist/plugin-data-enhancement/src/locales/de.d.ts +21 -0
  150. package/dist/plugin-data-enhancement/src/locales/en.d.ts +21 -0
  151. package/dist/plugin-data-enhancement/src/locales/es.d.ts +21 -0
  152. package/dist/plugin-data-enhancement/src/locales/fr.d.ts +21 -0
  153. package/dist/plugin-data-enhancement/src/locales/hi.d.ts +21 -0
  154. package/dist/plugin-data-enhancement/src/locales/it.d.ts +21 -0
  155. package/dist/plugin-data-enhancement/src/locales/pt.d.ts +21 -0
  156. package/dist/plugin-data-enhancement/src/types/data_enhancement_controller.d.ts +71 -0
  157. package/dist/plugin-data-enhancement/src/types/subscriptions_message_props.d.ts +3 -0
  158. package/dist/plugin-data-enhancement/src/useDataEnhancementPlugin.d.ts +29 -0
  159. package/dist/plugin-data-enhancement/src/utils/diffStrings.d.ts +7 -0
  160. package/dist/plugin-data-enhancement/src/utils/properties.d.ts +3 -0
  161. package/dist/plugin-data-enhancement/src/utils/strings_counter.d.ts +2 -0
  162. package/dist/plugin-data-enhancement/src/utils/suggestions.d.ts +1 -0
  163. package/dist/plugin-data-enhancement/src/utils/values.d.ts +1 -0
  164. package/dist/types/src/controllers/analytics_controller.d.ts +7 -0
  165. package/dist/types/src/controllers/auth.d.ts +119 -0
  166. package/dist/types/src/controllers/client.d.ts +170 -0
  167. package/dist/types/src/controllers/collection_registry.d.ts +46 -0
  168. package/dist/types/src/controllers/customization_controller.d.ts +60 -0
  169. package/dist/types/src/controllers/data.d.ts +168 -0
  170. package/dist/types/src/controllers/data_driver.d.ts +195 -0
  171. package/dist/types/src/controllers/database_admin.d.ts +11 -0
  172. package/dist/types/src/controllers/dialogs_controller.d.ts +36 -0
  173. package/dist/types/src/controllers/effective_role.d.ts +4 -0
  174. package/dist/types/src/controllers/email.d.ts +34 -0
  175. package/dist/types/src/controllers/index.d.ts +18 -0
  176. package/dist/types/src/controllers/local_config_persistence.d.ts +20 -0
  177. package/dist/types/src/controllers/navigation.d.ts +213 -0
  178. package/dist/types/src/controllers/registry.d.ts +54 -0
  179. package/dist/types/src/controllers/side_dialogs_controller.d.ts +67 -0
  180. package/dist/types/src/controllers/side_entity_controller.d.ts +90 -0
  181. package/dist/types/src/controllers/snackbar.d.ts +24 -0
  182. package/dist/types/src/controllers/storage.d.ts +171 -0
  183. package/dist/types/src/index.d.ts +4 -0
  184. package/dist/types/src/rebase_context.d.ts +105 -0
  185. package/dist/types/src/types/backend.d.ts +536 -0
  186. package/dist/types/src/types/backend_hooks.d.ts +187 -0
  187. package/dist/types/src/types/builders.d.ts +15 -0
  188. package/dist/types/src/types/chips.d.ts +5 -0
  189. package/dist/types/src/types/collections.d.ts +857 -0
  190. package/dist/types/src/types/cron.d.ts +102 -0
  191. package/dist/types/src/types/data_source.d.ts +64 -0
  192. package/dist/types/src/types/entities.d.ts +145 -0
  193. package/dist/types/src/types/entity_actions.d.ts +98 -0
  194. package/dist/types/src/types/entity_callbacks.d.ts +173 -0
  195. package/dist/types/src/types/entity_link_builder.d.ts +7 -0
  196. package/dist/types/src/types/entity_overrides.d.ts +10 -0
  197. package/dist/types/src/types/entity_views.d.ts +59 -0
  198. package/dist/types/src/types/export_import.d.ts +21 -0
  199. package/dist/types/src/types/formex.d.ts +40 -0
  200. package/dist/types/src/types/index.d.ts +25 -0
  201. package/dist/types/src/types/locales.d.ts +4 -0
  202. package/dist/types/src/types/modify_collections.d.ts +5 -0
  203. package/dist/types/src/types/plugins.d.ts +282 -0
  204. package/dist/types/src/types/properties.d.ts +1148 -0
  205. package/dist/types/src/types/property_config.d.ts +70 -0
  206. package/dist/types/src/types/relations.d.ts +336 -0
  207. package/dist/types/src/types/slots.d.ts +262 -0
  208. package/dist/types/src/types/translations.d.ts +874 -0
  209. package/dist/types/src/types/user_management_delegate.d.ts +121 -0
  210. package/dist/types/src/types/websockets.d.ts +78 -0
  211. package/dist/types/src/users/index.d.ts +2 -0
  212. package/dist/types/src/users/roles.d.ts +22 -0
  213. package/dist/types/src/users/user.d.ts +46 -0
  214. package/dist/ui/src/components/Alert.d.ts +12 -0
  215. package/dist/ui/src/components/Autocomplete.d.ts +21 -0
  216. package/dist/ui/src/components/Avatar.d.ts +11 -0
  217. package/dist/ui/src/components/Badge.d.ts +8 -0
  218. package/dist/ui/src/components/BooleanSwitch.d.ts +14 -0
  219. package/dist/ui/src/components/BooleanSwitchWithLabel.d.ts +17 -0
  220. package/dist/ui/src/components/Button.d.ts +14 -0
  221. package/dist/ui/src/components/Card.d.ts +9 -0
  222. package/dist/ui/src/components/CenteredView.d.ts +9 -0
  223. package/dist/ui/src/components/Checkbox.d.ts +13 -0
  224. package/dist/ui/src/components/Chip.d.ts +26 -0
  225. package/dist/ui/src/components/CircularProgress.d.ts +5 -0
  226. package/dist/ui/src/components/CircularProgressCenter.d.ts +11 -0
  227. package/dist/ui/src/components/Collapse.d.ts +9 -0
  228. package/dist/ui/src/components/ColorPicker.d.ts +30 -0
  229. package/dist/ui/src/components/Container.d.ts +8 -0
  230. package/dist/ui/src/components/DateTimeField.d.ts +24 -0
  231. package/dist/ui/src/components/DebouncedTextField.d.ts +2 -0
  232. package/dist/ui/src/components/Dialog.d.ts +39 -0
  233. package/dist/ui/src/components/DialogActions.d.ts +7 -0
  234. package/dist/ui/src/components/DialogContent.d.ts +7 -0
  235. package/dist/ui/src/components/DialogTitle.d.ts +10 -0
  236. package/dist/ui/src/components/ErrorBoundary.d.ts +11 -0
  237. package/dist/ui/src/components/ExpandablePanel.d.ts +12 -0
  238. package/dist/ui/src/components/FileUpload.d.ts +23 -0
  239. package/dist/ui/src/components/IconButton.d.ts +12 -0
  240. package/dist/ui/src/components/InfoLabel.d.ts +5 -0
  241. package/dist/ui/src/components/InputLabel.d.ts +11 -0
  242. package/dist/ui/src/components/Label.d.ts +7 -0
  243. package/dist/ui/src/components/LoadingButton.d.ts +7 -0
  244. package/dist/ui/src/components/Markdown.d.ts +10 -0
  245. package/dist/ui/src/components/Menu.d.ts +23 -0
  246. package/dist/ui/src/components/Menubar.d.ts +80 -0
  247. package/dist/ui/src/components/MultiSelect.d.ts +48 -0
  248. package/dist/ui/src/components/Paper.d.ts +6 -0
  249. package/dist/ui/src/components/Popover.d.ts +24 -0
  250. package/dist/ui/src/components/RadioGroup.d.ts +28 -0
  251. package/dist/ui/src/components/ResizablePanels.d.ts +18 -0
  252. package/dist/ui/src/components/SearchBar.d.ts +22 -0
  253. package/dist/ui/src/components/Select.d.ts +43 -0
  254. package/dist/ui/src/components/Separator.d.ts +5 -0
  255. package/dist/ui/src/components/Sheet.d.ts +22 -0
  256. package/dist/ui/src/components/Skeleton.d.ts +6 -0
  257. package/dist/ui/src/components/Slider.d.ts +21 -0
  258. package/dist/ui/src/components/Table.d.ts +34 -0
  259. package/dist/ui/src/components/Tabs.d.ts +19 -0
  260. package/dist/ui/src/components/TextField.d.ts +58 -0
  261. package/dist/ui/src/components/TextareaAutosize.d.ts +43 -0
  262. package/dist/ui/src/components/ToggleButtonGroup.d.ts +30 -0
  263. package/dist/ui/src/components/Tooltip.d.ts +19 -0
  264. package/dist/ui/src/components/Typography.d.ts +36 -0
  265. package/dist/ui/src/components/VirtualTable/VirtualTable.d.ts +11 -0
  266. package/dist/ui/src/components/VirtualTable/VirtualTableCell.d.ts +21 -0
  267. package/dist/ui/src/components/VirtualTable/VirtualTableHeader.d.ts +29 -0
  268. package/dist/ui/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +2 -0
  269. package/dist/ui/src/components/VirtualTable/VirtualTableProps.d.ts +243 -0
  270. package/dist/ui/src/components/VirtualTable/VirtualTableRow.d.ts +3 -0
  271. package/dist/ui/src/components/VirtualTable/index.d.ts +3 -0
  272. package/dist/ui/src/components/VirtualTable/types.d.ts +38 -0
  273. package/dist/ui/src/components/common/SelectInputLabel.d.ts +5 -0
  274. package/dist/ui/src/components/index.d.ts +53 -0
  275. package/dist/ui/src/hooks/PortalContainerContext.d.ts +31 -0
  276. package/dist/ui/src/hooks/index.d.ts +6 -0
  277. package/dist/ui/src/hooks/useDebounceCallback.d.ts +1 -0
  278. package/dist/ui/src/hooks/useDebounceValue.d.ts +1 -0
  279. package/dist/ui/src/hooks/useDebouncedCallback.d.ts +1 -0
  280. package/dist/ui/src/hooks/useInjectStyles.d.ts +7 -0
  281. package/dist/ui/src/hooks/useOutsideAlerter.d.ts +5 -0
  282. package/dist/ui/src/icons/GitHubIcon.d.ts +2 -0
  283. package/dist/ui/src/icons/HandleIcon.d.ts +1 -0
  284. package/dist/ui/src/icons/Icon.d.ts +20 -0
  285. package/dist/ui/src/icons/cool_icon_keys.d.ts +1 -0
  286. package/dist/ui/src/icons/icon_keys.d.ts +1 -0
  287. package/dist/ui/src/icons/index.d.ts +6 -0
  288. package/dist/ui/src/index.d.ts +5 -0
  289. package/dist/ui/src/styles.d.ts +12 -0
  290. package/dist/ui/src/util/chip_colors.d.ts +4 -0
  291. package/dist/ui/src/util/cls.d.ts +2 -0
  292. package/dist/ui/src/util/debounce.d.ts +10 -0
  293. package/dist/ui/src/util/hash.d.ts +1 -0
  294. package/dist/ui/src/util/index.d.ts +4 -0
  295. package/dist/ui/src/util/key_to_icon_component.d.ts +1 -0
  296. package/package.json +86 -0
  297. package/src/api.ts +198 -0
  298. package/src/components/DataEnhancementControllerProvider.tsx +339 -0
  299. package/src/components/FormEnhanceAction.tsx +273 -0
  300. package/src/editor/useEditorAIController.tsx +37 -0
  301. package/src/index.ts +10 -0
  302. package/src/locales/de.ts +21 -0
  303. package/src/locales/en.ts +21 -0
  304. package/src/locales/es.ts +21 -0
  305. package/src/locales/fr.ts +21 -0
  306. package/src/locales/hi.ts +21 -0
  307. package/src/locales/it.ts +21 -0
  308. package/src/locales/pt.ts +21 -0
  309. package/src/tests/diffStrings.test.ts +128 -0
  310. package/src/types/data_enhancement_controller.tsx +75 -0
  311. package/src/types/subscriptions_message_props.tsx +1 -0
  312. package/src/useDataEnhancementPlugin.tsx +66 -0
  313. package/src/utils/diffStrings.ts +70 -0
  314. package/src/utils/properties.ts +168 -0
  315. package/src/utils/strings_counter.ts +22 -0
  316. package/src/utils/suggestions.ts +6 -0
  317. package/src/utils/values.ts +12 -0
  318. package/src/vite-env.d.ts +1 -0
package/LICENSE ADDED
@@ -0,0 +1,114 @@
1
+ Business Source License 1.1
2
+
3
+ Parameters
4
+
5
+ Licensor: Rebase S.L.
6
+ Licensed Work: Rebase CMS packages:
7
+ cli
8
+ collection_editor
9
+ collection_editor_firebase
10
+ data_enhancement
11
+ data_export
12
+ data_export
13
+ editor
14
+ rebase_cloud
15
+ schema_inference
16
+ user_management
17
+
18
+ The Licensed Work is (c) 2024 Rebase S.L
19
+ Additional Use Grant: You may make use of the Licensed Work, provided that
20
+ you may not use the Licensed Work for a CMS Data Enhancement
21
+ Service.
22
+
23
+ A “CMS package” is a commercial offering that
24
+ allows third parties (other than your employees and
25
+ contractors) to access the functionality of the
26
+ Licensed Work by using software to extend the base features of
27
+ content management system controlled by such third parties.
28
+
29
+ Change Date: Four years from the date the Licensed Work is published.
30
+
31
+ Change License: MIT
32
+
33
+ For information about alternative licensing arrangements for the Software,
34
+ please visit: https://rebase.pro
35
+
36
+ Notice
37
+
38
+ The Business Source License (this document, or the “License”) is not an Open
39
+ Source license. However, the Licensed Work will eventually be made available
40
+ under an Open Source License, as stated in this License.
41
+
42
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
43
+ “Business Source License” is a trademark of MariaDB Corporation Ab.
44
+
45
+ -----------------------------------------------------------------------------
46
+
47
+ Business Source License 1.1
48
+
49
+ Terms
50
+
51
+ The Licensor hereby grants you the right to copy, modify, create derivative
52
+ works, redistribute, and make non-production use of the Licensed Work. The
53
+ Licensor may make an Additional Use Grant, above, permitting limited
54
+ production use.
55
+
56
+ Effective on the Change Date, or the fourth anniversary of the first publicly
57
+ available distribution of a specific version of the Licensed Work under this
58
+ License, whichever comes first, the Licensor hereby grants you rights under
59
+ the terms of the Change License, and the rights granted in the paragraph
60
+ above terminate.
61
+
62
+ If your use of the Licensed Work does not comply with the requirements
63
+ currently in effect as described in this License, you must purchase a
64
+ commercial license from the Licensor, its affiliated entities, or authorized
65
+ resellers, or you must refrain from using the Licensed Work.
66
+
67
+ All copies of the original and modified Licensed Work, and derivative works
68
+ of the Licensed Work, are subject to this License. This License applies
69
+ separately for each version of the Licensed Work and the Change Date may vary
70
+ for each version of the Licensed Work released by Licensor.
71
+
72
+ You must conspicuously display this License on each original or modified copy
73
+ of the Licensed Work. If you receive the Licensed Work in original or
74
+ modified form from a third party, the terms and conditions set forth in this
75
+ License apply to your use of that work.
76
+
77
+ Any use of the Licensed Work in violation of this License will automatically
78
+ terminate your rights under this License for the current and all other
79
+ versions of the Licensed Work.
80
+
81
+ This License does not grant you any right in any trademark or logo of
82
+ Licensor or its affiliates (provided that you may use a trademark or logo of
83
+ Licensor as expressly required by this License).
84
+
85
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
86
+ AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
87
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
88
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
89
+ TITLE.
90
+
91
+ MariaDB hereby grants you permission to use this License’s text to license
92
+ your works, and to refer to it using the trademark “Business Source License”,
93
+ as long as you comply with the Covenants of Licensor below.
94
+
95
+ Covenants of Licensor
96
+
97
+ In consideration of the right to use this License’s text and the “Business
98
+ Source License” name and trademark, Licensor covenants to MariaDB, and to all
99
+ other recipients of the licensed work to be provided by Licensor:
100
+
101
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
102
+ or a license that is compatible with GPL Version 2.0 or a later version,
103
+ where “compatible” means that software provided under the Change License can
104
+ be included in a program with software provided under GPL Version 2.0 or a
105
+ later version. Licensor may specify additional Change Licenses without
106
+ limitation.
107
+
108
+ 2. To either: (a) specify an additional grant of rights to use that does not
109
+ impose any additional restriction on the right granted in this License, as
110
+ the Additional Use Grant; or (b) insert the text “None”.
111
+
112
+ 3. To specify a Change Date.
113
+
114
+ 4. Not to modify this License in any other way.
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ ## Rebase Data enhancement plugin
2
+
3
+ This plugin allows you to enhance data in your [Rebase](https://rebase.pro)
4
+ project, using ChatGPT.
5
+
6
+ The ChatGPT plugin allows you to use the OpenAI API to generate content using
7
+ the latest GPT models. This plugin is able to understand the structure of your
8
+ data and generate content that fits your schema.
9
+
10
+ <p align="center">
11
+ <img src="https://rebase.pro/img/data_enhancement.png" width="800px" alt="Data enhancement UI" />
12
+ </p>
13
+
14
+ In order to be able to use this plugin you need to have a valid subscription.
15
+
16
+ You can get a subscription in
17
+ the [Rebase dashboard](https://app.rebase.pro/subscriptions).
18
+
19
+ You need to specify the Firebase project id you would like to use the plugin
20
+ with,
21
+ in the website. And that's it!
22
+
23
+ No need to add any subscription key or anything like that.
24
+
25
+ ```tsx
26
+ import React from "react";
27
+ import { Rebase } from "@rebasepro/core";
28
+ import "typeface-rubik";
29
+ import "@fontsource/jetbrains-mono";
30
+
31
+ import { useDataEnhancementPlugin } from "@rebasepro/data_enhancement";
32
+
33
+ // TODO: Replace with your Firebase config
34
+ const firebaseConfig = {
35
+ apiKey: "",
36
+ authDomain: "",
37
+ projectId: "",
38
+ storageBucket: "",
39
+ messagingSenderId: "",
40
+ appId: ""
41
+ };
42
+
43
+ export default function App() {
44
+
45
+ const dataEnhancementPlugin = useDataEnhancementPlugin({
46
+ // Optional callback for defining which collections should be enhanced
47
+ getConfigForPath: ({ path }) => {
48
+ if (path === "books")
49
+ return true;
50
+ return false;
51
+ }
52
+ });
53
+
54
+ const plugins = [dataEnhancementPlugin];
55
+
56
+ const navigationController = useBuildNavigationStateController({
57
+ // ... rest of your config
58
+ plugins
59
+ });
60
+
61
+ return <Rebase
62
+ name={"My Online Shop"}
63
+ plugins={[dataEnhancementPlugin]}
64
+ authentication={myAuthenticator}
65
+ navigationController={navigationController}
66
+ firebaseConfig={firebaseConfig}
67
+ />;
68
+ }
69
+ ```
70
+
71
+ ## How does it work?
72
+
73
+ This plugin uses the OpenAI API to generate content using the latest GPT models.
74
+ This plugin is able to understand the structure of your data and generate
75
+ content that fits your schema.
76
+
77
+ Some tips in order to get the best results:
78
+
79
+ - Make sure you select the **right data** type for your fields.
80
+ - The **field names** are used to generate the content and are usually enough to
81
+ generate good results. If you want to get even better results, you can
82
+ **add a description** to your fields. This will help the plugin understand the
83
+ context of your data and generate better results.
84
+ - The **collection name** is important as well.
85
+ - You can establish **relations between fields** and the plugin will pick it up.
86
+ e.g. if you have a field called `author` and another field called `book`, the
87
+ plugin will understand that the author is related to the book and will
88
+ generate content accordingly. You can use this for making **summaries, reviews,
89
+ translations, SEO content**, etc.
@@ -0,0 +1,56 @@
1
+ import { EntityCollection } from "@rebasepro/types";
2
+ export declare class CollectionRegistry {
3
+ private collectionsByTableName;
4
+ private collectionsBySlug;
5
+ private rootCollections;
6
+ private cachedCollectionsList;
7
+ private rawCollectionsByTableName;
8
+ private rawCollectionsBySlug;
9
+ private rawRootCollections;
10
+ private cachedRawCollectionsList;
11
+ private lastRawInputSnapshot;
12
+ constructor(collections?: EntityCollection[]);
13
+ reset(): void;
14
+ /**
15
+ * Registers a collection and its subcollections recursively.
16
+ * Returns true if the collections have changed, false otherwise.
17
+ *
18
+ * Idempotent: compares the raw input (before normalization) against a stored
19
+ * snapshot. Only re-normalizes and re-registers when the raw input actually changed.
20
+ * @param collections
21
+ */
22
+ registerMultiple(collections: EntityCollection[]): boolean;
23
+ register(collection: EntityCollection, rawCollection?: EntityCollection): void;
24
+ private _registerRecursively;
25
+ normalizeCollection(collection: EntityCollection): EntityCollection;
26
+ /**
27
+ * Extract Relation[] from properties that have inline relation config (i.e. `target` is set).
28
+ * This allows developers to define relations directly on properties without a separate
29
+ * `relations[]` entry on the collection.
30
+ */
31
+ private extractRelationsFromProperties;
32
+ private normalizeProperties;
33
+ private normalizeProperty;
34
+ get(path: string): EntityCollection | undefined;
35
+ /**
36
+ * Gets the pristine, un-normalized collection exactly as it was provided.
37
+ * Useful for the AST editor so it doesn't accidentally serialize injected metadata back to disk.
38
+ */
39
+ getRaw(path: string): EntityCollection | undefined;
40
+ /**
41
+ * Get collection by resolving multi-segment paths through relations
42
+ * e.g., "authors/70/posts" resolves to the posts collection
43
+ */
44
+ getCollectionByPath(collectionPath: string): EntityCollection | undefined;
45
+ getCollections(): EntityCollection[];
46
+ getRawCollections(): EntityCollection[];
47
+ /**
48
+ * Resolves a multi-segment path like "products/123/locales" and returns
49
+ * information about the collections and entity IDs along the path
50
+ */
51
+ resolvePathToCollections(path: string): {
52
+ collections: EntityCollection[];
53
+ entityIds: (string | number)[];
54
+ finalCollection: EntityCollection;
55
+ };
56
+ }
@@ -0,0 +1 @@
1
+ export * from "./CollectionRegistry";
@@ -0,0 +1,14 @@
1
+ import { DataDriver, RebaseData } from "@rebasepro/types";
2
+ /**
3
+ * Build a `RebaseData` object from a `DataDriver` using JavaScript Proxy.
4
+ *
5
+ * This is the key bridge: any property access like `data.products` returns
6
+ * a `CollectionAccessor` backed by the underlying DataDriver, without
7
+ * needing per-collection code generation.
8
+ *
9
+ * @example
10
+ * const data = buildRebaseData(driver);
11
+ * await data.products.create({ name: "Camera", price: 299 });
12
+ * const { data: items } = await data.products.find({ where: { status: "eq.published" } });
13
+ */
14
+ export declare function buildRebaseData(driver: DataDriver): RebaseData;
@@ -0,0 +1,3 @@
1
+ export * from "./util";
2
+ export * from "./collections";
3
+ export * from "./data/buildRebaseData";
@@ -0,0 +1,57 @@
1
+ import { AdditionalFieldDelegate, ArrayProperty, BooleanProperty, DateProperty, EntityCallbacks, EntityCollection, EnumValueConfig, EnumValues, GeopointProperty, MapProperty, NumberProperty, Properties, Property, ReferenceProperty, StringProperty, User } from "@rebasepro/types";
2
+ /**
3
+ * Identity function we use to defeat the type system of Typescript and build
4
+ * collection views with all its properties
5
+ * @param collection
6
+ * @group Builder
7
+ */
8
+ export declare function buildCollection<M extends Record<string, unknown> = Record<string, unknown>, USER extends User = User>(collection: EntityCollection<M, USER>): EntityCollection<M, USER>;
9
+ /**
10
+ * Identity function we use to defeat the type system of Typescript and preserve
11
+ * the property keys.
12
+ * @param property
13
+ * @group Builder
14
+ */
15
+ export declare function buildProperty<T, P extends Property = Property>(property: P): P extends StringProperty ? StringProperty : P extends NumberProperty ? NumberProperty : P extends BooleanProperty ? BooleanProperty : P extends DateProperty ? DateProperty : P extends GeopointProperty ? GeopointProperty : P extends ReferenceProperty ? ReferenceProperty : P extends ArrayProperty ? ArrayProperty : P extends MapProperty ? MapProperty : never;
16
+ /**
17
+ * Identity function we use to defeat the type system of Typescript and preserve
18
+ * the properties keys.
19
+ * @param properties
20
+ * @group Builder
21
+ */
22
+ export declare function buildProperties<M extends Record<string, unknown>>(properties: Properties): Properties;
23
+ /**
24
+ * Identity function we use to defeat the type system of Typescript and preserve
25
+ * the properties keys.
26
+ * @param propertiesOrBuilder
27
+ * @group Builder
28
+ */
29
+ export declare function buildPropertiesOrBuilder<M extends Record<string, unknown>>(propertiesOrBuilder: Properties): Properties;
30
+ /**
31
+ * Identity function we use to defeat the type system of Typescript and preserve
32
+ * the properties keys.
33
+ * @param enumValues
34
+ * @group Builder
35
+ */
36
+ export declare function buildEnum(enumValues: EnumValues): EnumValues;
37
+ /**
38
+ * Identity function we use to defeat the type system of Typescript and preserve
39
+ * the properties keys.
40
+ * @param enumValueConfig
41
+ * @group Builder
42
+ */
43
+ export declare function buildEnumValueConfig(enumValueConfig: EnumValueConfig): EnumValueConfig;
44
+ /**
45
+ * Identity function we use to defeat the type system of Typescript and preserve
46
+ * the properties keys.
47
+ * @param callbacks
48
+ * @group Builder
49
+ */
50
+ export declare function buildEntityCallbacks<M extends Record<string, unknown> = Record<string, unknown>>(callbacks: EntityCallbacks<M>): EntityCallbacks<M>;
51
+ /**
52
+ * Identity function we use to defeat the type system of Typescript and build
53
+ * additional field delegates views with all its properties
54
+ * @param additionalFieldDelegate
55
+ * @group Builder
56
+ */
57
+ export declare function buildAdditionalFieldDelegate<M extends Record<string, unknown>, USER extends User = User>(additionalFieldDelegate: AdditionalFieldDelegate<M, USER>): AdditionalFieldDelegate<M, USER>;
@@ -0,0 +1,6 @@
1
+ import { EntityCallbacks, Properties } from "@rebasepro/types";
2
+ /**
3
+ * Helper function to extract field-level PropertyCallbacks from a properties schema
4
+ * and wrap them into an EntityCallbacks object recursively.
5
+ */
6
+ export declare const buildPropertyCallbacks: (properties: Properties) => EntityCallbacks | undefined;
@@ -0,0 +1,11 @@
1
+ import { DefaultSelectedViewBuilder, DefaultSelectedViewParams, EntityCollection, Properties } from "@rebasepro/types";
2
+ export declare function sortProperties<M extends Record<string, unknown>>(properties: Properties, propertiesOrder?: string[]): Properties;
3
+ export declare function resolveDefaultSelectedView(defaultSelectedView: string | DefaultSelectedViewBuilder | undefined, params: DefaultSelectedViewParams): string | undefined;
4
+ export declare function getLocalChangesBackup(collection: EntityCollection): "manual_apply" | "auto_apply";
5
+ /**
6
+ * Returns the primary keys for an entity collection by inspecting the properties
7
+ * and finding any properties with `isId`.
8
+ * Fallbacks to `["id"]` if no properties are marked as `isId: true`.
9
+ * @param collection
10
+ */
11
+ export declare function getPrimaryKeys<M extends Record<string, unknown>>(collection: EntityCollection<M>): Extract<keyof M, string>[];
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_ONE_OF_TYPE = "type";
2
+ export declare const DEFAULT_ONE_OF_VALUE = "value";
@@ -0,0 +1,26 @@
1
+ import { AuthController, ConditionContext, JsonLogicRule, Property } from "@rebasepro/types";
2
+ /**
3
+ * Register custom JSON Logic operations for Rebase.
4
+ * Call this once at app initialization.
5
+ */
6
+ export declare function registerConditionOperations(): void;
7
+ /**
8
+ * Evaluate a JSON Logic rule against the given context.
9
+ */
10
+ export declare function evaluateCondition(rule: JsonLogicRule, context: ConditionContext): unknown;
11
+ /**
12
+ * Build a ConditionContext from the current property resolution context.
13
+ */
14
+ export declare function buildConditionContext(params: {
15
+ propertyKey?: string;
16
+ values?: Record<string, unknown>;
17
+ previousValues?: Record<string, unknown>;
18
+ path: string;
19
+ entityId?: string;
20
+ index?: number;
21
+ authController: AuthController;
22
+ }): ConditionContext;
23
+ /**
24
+ * Apply PropertyConditions to a resolved property, evaluating all JSON Logic rules.
25
+ */
26
+ export declare function applyPropertyConditions(property: Property, context: ConditionContext): Property;
@@ -0,0 +1,58 @@
1
+ import { DataType, Entity, EntityReference, EntityRelation, EntityStatus, EntityValues, Properties, Property } from "@rebasepro/types";
2
+ export declare function isReadOnly(property: Property): boolean;
3
+ export declare function isHidden(property: Property): boolean;
4
+ export declare function isPropertyBuilder(property?: Property): boolean;
5
+ export declare function getDefaultValuesFor<M extends Record<string, unknown>>(properties: Properties): Partial<EntityValues<M>>;
6
+ export declare function getDefaultValueFor(property?: Property): {} | null | undefined;
7
+ export declare function getDefaultValueFortype(type: DataType): {} | null;
8
+ /**
9
+ * Update the automatic values in an entity before save
10
+ * @group Driver
11
+ */
12
+ export declare function updateDateAutoValues<M extends Record<string, unknown>>({ inputValues, properties, status, timestampNowValue }: {
13
+ inputValues: Partial<EntityValues<M>>;
14
+ properties: Properties;
15
+ status: EntityStatus;
16
+ timestampNowValue: unknown;
17
+ }): EntityValues<M>;
18
+ /**
19
+ * Add missing required fields, expected in the collection, to the values of an entity
20
+ * @param values
21
+ * @param properties
22
+ * @group Driver
23
+ */
24
+ export declare function sanitizeData<M extends Record<string, unknown>>(values: EntityValues<M>, properties: Properties): Record<string, unknown>;
25
+ export declare function getReferenceFrom<M extends Record<string, unknown>>(entity: Entity<M>): EntityReference;
26
+ export declare function getRelationFrom<M extends Record<string, unknown>>(entity: Entity<M>): EntityRelation;
27
+ /**
28
+ * Normalize a value into a proper EntityRelation instance.
29
+ * Handles EntityRelation class instances, and plain objects
30
+ * with `__type === "relation"` or an `isEntityRelation()` method.
31
+ *
32
+ * Returns null if the value cannot be coerced.
33
+ */
34
+ export declare function normalizeToEntityRelation(value: unknown): EntityRelation | null;
35
+ export declare function traverseValuesProperties<M extends Record<string, unknown>>(inputValues: Partial<EntityValues<M>>, properties: Properties, operation: (value: unknown, property: Property) => unknown): EntityValues<M> | undefined;
36
+ export declare function traverseValueProperty(inputValue: unknown, property: Property, operation: (value: unknown, property: Property) => unknown): unknown;
37
+ /**
38
+ * Relation reference types used throughout the server layer.
39
+ * These replace the 50+ manual `{ id, path, __type: "relation" }` constructions.
40
+ */
41
+ export interface RelationRef {
42
+ readonly id: string | number;
43
+ readonly path: string;
44
+ readonly __type: "relation";
45
+ }
46
+ export interface RelationRefWithData extends RelationRef {
47
+ readonly data: Entity;
48
+ }
49
+ /**
50
+ * Create a lightweight relation stub for CMS views.
51
+ * Replaces inline `{ id, path, __type: "relation" }` object literals.
52
+ */
53
+ export declare function createRelationRef(id: string | number, path: string): RelationRef;
54
+ /**
55
+ * Create a hydrated relation reference that includes the full entity data.
56
+ * Used when entity data has been pre-fetched (e.g., via batch loading or JOINs).
57
+ */
58
+ export declare function createRelationRefWithData(id: string | number, path: string, data: Entity): RelationRefWithData;
@@ -0,0 +1,3 @@
1
+ import { EnumValueConfig, EnumValues } from "@rebasepro/types";
2
+ export declare function enumToObjectEntries(enumValues: EnumValues): EnumValueConfig[];
3
+ export declare function getLabelOrConfigFrom(enumValues: EnumValueConfig[], key?: string | number): EnumValueConfig | undefined;
@@ -0,0 +1,16 @@
1
+ export * from "./collections";
2
+ export * from "./common";
3
+ export * from "./entities";
4
+ export * from "./enums";
5
+ export * from "./paths";
6
+ export * from "./resolutions";
7
+ export * from "./permissions";
8
+ export * from "./references";
9
+ export * from "./navigation_from_path";
10
+ export * from "./parent_references_from_path";
11
+ export * from "./builders";
12
+ export * from "./storage";
13
+ export * from "./callbacks";
14
+ export * from "./relations";
15
+ export * from "./conditions";
16
+ export * from "./navigation_utils";
@@ -0,0 +1,34 @@
1
+ import { EntityCollection } from "@rebasepro/types";
2
+ type EntityCustomView<M extends Record<string, unknown> = Record<string, unknown>> = {
3
+ key: string;
4
+ [key: string]: unknown;
5
+ };
6
+ export type NavigationViewInternal<M extends Record<string, unknown> = Record<string, unknown>> = NavigationViewEntityInternal<M> | NavigationViewCollectionInternal<M> | NavigationViewEntityCustomInternal<M>;
7
+ export interface NavigationViewEntityInternal<M extends Record<string, unknown>> {
8
+ type: "entity";
9
+ entityId: string | number;
10
+ slug: string;
11
+ path: string;
12
+ parentCollection: EntityCollection<M>;
13
+ }
14
+ export interface NavigationViewCollectionInternal<M extends Record<string, unknown>> {
15
+ type: "collection";
16
+ id: string;
17
+ slug: string;
18
+ path: string;
19
+ collection: EntityCollection<M>;
20
+ }
21
+ export interface NavigationViewEntityCustomInternal<M extends Record<string, unknown>> {
22
+ type: "custom_view";
23
+ slug: string;
24
+ path: string;
25
+ entityId: string | number;
26
+ view: EntityCustomView<M>;
27
+ }
28
+ export declare function getNavigationEntriesFromPath(props: {
29
+ path: string;
30
+ collections: EntityCollection[] | undefined;
31
+ currentFullPath?: string;
32
+ contextEntityViews?: EntityCustomView[];
33
+ }): NavigationViewInternal[];
34
+ export {};
@@ -0,0 +1,20 @@
1
+ import { EntityCollection } from "@rebasepro/types";
2
+ export declare function removeInitialAndTrailingSlashes(s: string): string;
3
+ export declare function removeInitialSlash(s: string): string;
4
+ export declare function removeTrailingSlash(s: string): string;
5
+ export declare function addInitialSlash(s: string): string;
6
+ export declare function getLastSegment(path: string): string;
7
+ export declare function resolveCollectionPathIds(path: string, allCollections: EntityCollection[]): string;
8
+ /**
9
+ * Find the corresponding view at any depth for a given path.
10
+ * Note that path or segments of the paths can be collection aliases.
11
+ * @param slugOrPath
12
+ * @param collections
13
+ */
14
+ export declare function getCollectionBySlugWithin(slugOrPath: string, collections: EntityCollection[]): EntityCollection | undefined;
15
+ /**
16
+ * Get the subcollection combinations from a path:
17
+ * "sites/es/locales" => ["sites/es/locales", "sites"]
18
+ * @param subpaths
19
+ */
20
+ export declare function getCollectionPathsCombinations(subpaths: string[]): string[];
@@ -0,0 +1,6 @@
1
+ import { EntityCollection, EntityReference } from "@rebasepro/types";
2
+ export declare function getParentReferencesFromPath(props: {
3
+ path: string;
4
+ collections: EntityCollection[] | undefined;
5
+ currentFullPath?: string;
6
+ }): EntityReference[];
@@ -0,0 +1,14 @@
1
+ export declare const COLLECTION_PATH_SEPARATOR = "::";
2
+ /**
3
+ * Remove the entity ids from a given path
4
+ * `products/B44RG6APH/locales` => `products::locales`
5
+ * @param path
6
+ */
7
+ export declare function stripCollectionPath(path: string): string;
8
+ export declare function segmentsToStrippedPath(paths: string[]): string;
9
+ /**
10
+ * Extract the collection path routes
11
+ * `products/B44RG6APH/locales` => [`products`, `locales`]
12
+ * @param path
13
+ */
14
+ export declare function fullPathToCollectionSegments(path: string): string[];
@@ -0,0 +1,5 @@
1
+ import { AuthController, Entity, EntityCollection, User } from "@rebasepro/types";
2
+ export declare function canReadCollection<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authController: AuthController<USER>): boolean;
3
+ export declare function canEditEntity<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authController: AuthController<USER>, path: string, entity: Entity<M> | null): boolean;
4
+ export declare function canCreateEntity<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authController: AuthController<USER>, path: string, entity: Entity<M> | null): boolean;
5
+ export declare function canDeleteEntity<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authController: AuthController<USER>, path: string, entity: Entity<M> | null): boolean;
@@ -0,0 +1,2 @@
1
+ import { EntityCollection } from "@rebasepro/types";
2
+ export declare function getEntityImagePreviewPropertyKey<M extends Record<string, unknown>>(collection: EntityCollection<M>): string | undefined;
@@ -0,0 +1,22 @@
1
+ import { EntityCollection, Property, Relation } from "@rebasepro/types";
2
+ export declare function sanitizeRelation(relation: Partial<Relation>, sourceCollection: EntityCollection): Relation;
3
+ export declare function resolveCollectionRelations(collection: EntityCollection): Record<string, Relation>;
4
+ export declare function resolvePropertyRelation({ propertyKey, property, sourceCollection }: {
5
+ propertyKey: string;
6
+ property: Property;
7
+ sourceCollection: EntityCollection;
8
+ }): Relation | undefined;
9
+ export declare function getTableName(collection: EntityCollection): string;
10
+ export declare function getTableVarName(tableName: string): string;
11
+ export declare function getEnumVarName(tableName: string, propName: string): string;
12
+ export declare function getColumnName(fullColumn: string): string;
13
+ /**
14
+ * Look up a relation by key with forgiving normalization.
15
+ *
16
+ * `resolveCollectionRelations` stores each relation under a single canonical
17
+ * key (no aliases). This helper tries the given key as-is, then falls back to
18
+ * slug form (underscores → hyphens) and snake_case form (hyphens → underscores)
19
+ * so that callers that receive a key from external input (URL path segments,
20
+ * user-provided config, etc.) can still find the right entry.
21
+ */
22
+ export declare function findRelation(resolvedRelations: Record<string, Relation>, key: string): Relation | undefined;