nucleus-core-ts 0.8.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.
- package/LICENSE +48 -0
- package/README.md +177 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +1 -0
- package/dist/dist/index-0yyw12k6.d.ts +8 -0
- package/dist/dist/index-tv67j5qd.d.ts +488 -0
- package/dist/dist/index.d.ts +40 -0
- package/dist/fe/components/AbstractAnimatedBackground/index.d.ts +7 -0
- package/dist/fe/components/AuthorizationPage/components/AuthorizationPage.d.ts +3 -0
- package/dist/fe/components/AuthorizationPage/components/ClaimList.d.ts +3 -0
- package/dist/fe/components/AuthorizationPage/components/RoleClaimEditor.d.ts +3 -0
- package/dist/fe/components/AuthorizationPage/components/RoleList.d.ts +3 -0
- package/dist/fe/components/AuthorizationPage/index.d.ts +9 -0
- package/dist/fe/components/AuthorizationPage/store/index.d.ts +47 -0
- package/dist/fe/components/AuthorizationPage/theme/index.d.ts +82 -0
- package/dist/fe/components/AuthorizationPage/types/index.d.ts +64 -0
- package/dist/fe/components/Button/components/Button.d.ts +3 -0
- package/dist/fe/components/Button/components/ButtonSpinner.d.ts +3 -0
- package/dist/fe/components/Button/index.d.ts +6 -0
- package/dist/fe/components/Button/theme/index.d.ts +183 -0
- package/dist/fe/components/Button/types/index.d.ts +24 -0
- package/dist/fe/components/Button/utils/cn.d.ts +3 -0
- package/dist/fe/components/Captcha/components/Captcha.d.ts +4 -0
- package/dist/fe/components/Captcha/index.d.ts +4 -0
- package/dist/fe/components/Captcha/theme.d.ts +53 -0
- package/dist/fe/components/Captcha/types.d.ts +60 -0
- package/dist/fe/components/ChangePasswordPage/components/ChangePasswordForm.d.ts +4 -0
- package/dist/fe/components/ChangePasswordPage/components/ChangePasswordHeader.d.ts +4 -0
- package/dist/fe/components/ChangePasswordPage/components/ChangePasswordPage.d.ts +4 -0
- package/dist/fe/components/ChangePasswordPage/index.d.ts +7 -0
- package/dist/fe/components/ChangePasswordPage/store/index.d.ts +16 -0
- package/dist/fe/components/ChangePasswordPage/theme/index.d.ts +48 -0
- package/dist/fe/components/ChangePasswordPage/types/index.d.ts +56 -0
- package/dist/fe/components/Checkbox/components/Checkbox.d.ts +3 -0
- package/dist/fe/components/Checkbox/components/CheckboxIcon.d.ts +3 -0
- package/dist/fe/components/Checkbox/components/SwitchTrack.d.ts +3 -0
- package/dist/fe/components/Checkbox/index.d.ts +7 -0
- package/dist/fe/components/Checkbox/theme/index.d.ts +218 -0
- package/dist/fe/components/Checkbox/types/index.d.ts +39 -0
- package/dist/fe/components/Checkbox/utils/cn.d.ts +3 -0
- package/dist/fe/components/DataTable/DataTable.d.ts +3 -0
- package/dist/fe/components/DataTable/components/ActionCell.d.ts +10 -0
- package/dist/fe/components/DataTable/components/DataCell.d.ts +18 -0
- package/dist/fe/components/DataTable/components/EditableCell.d.ts +14 -0
- package/dist/fe/components/DataTable/components/EmptyState.d.ts +8 -0
- package/dist/fe/components/DataTable/components/HeaderCell.d.ts +16 -0
- package/dist/fe/components/DataTable/components/InfiniteScrollTrigger.d.ts +11 -0
- package/dist/fe/components/DataTable/components/LoadingSpinner.d.ts +7 -0
- package/dist/fe/components/DataTable/components/ResizeHandle.d.ts +9 -0
- package/dist/fe/components/DataTable/components/SelectionCell.d.ts +9 -0
- package/dist/fe/components/DataTable/components/SkeletonRow.d.ts +9 -0
- package/dist/fe/components/DataTable/components/SkeletonTable.d.ts +10 -0
- package/dist/fe/components/DataTable/components/SortIcon.d.ts +9 -0
- package/dist/fe/components/DataTable/components/TableHeader.d.ts +20 -0
- package/dist/fe/components/DataTable/components/TableRow.d.ts +20 -0
- package/dist/fe/components/DataTable/components/index.d.ts +15 -0
- package/dist/fe/components/DataTable/hooks/index.d.ts +3 -0
- package/dist/fe/components/DataTable/hooks/useAutoFitColumn.d.ts +8 -0
- package/dist/fe/components/DataTable/hooks/useResizeColumn.d.ts +12 -0
- package/dist/fe/components/DataTable/index.d.ts +6 -0
- package/dist/fe/components/DataTable/store/index.d.ts +52 -0
- package/dist/fe/components/DataTable/theme/index.d.ts +131 -0
- package/dist/fe/components/DataTable/types/index.d.ts +151 -0
- package/dist/fe/components/DataTable/utils/cn.d.ts +3 -0
- package/dist/fe/components/DatePicker/components/CalendarGrid.d.ts +3 -0
- package/dist/fe/components/DatePicker/components/CalendarHeader.d.ts +3 -0
- package/dist/fe/components/DatePicker/components/DatePicker.d.ts +3 -0
- package/dist/fe/components/DatePicker/components/MonthYearSelector.d.ts +10 -0
- package/dist/fe/components/DatePicker/index.d.ts +10 -0
- package/dist/fe/components/DatePicker/locales/index.d.ts +5 -0
- package/dist/fe/components/DatePicker/theme/index.d.ts +312 -0
- package/dist/fe/components/DatePicker/types/index.d.ts +88 -0
- package/dist/fe/components/DatePicker/utils/cn.d.ts +3 -0
- package/dist/fe/components/DatePicker/utils/date.d.ts +21 -0
- package/dist/fe/components/DevicesPage/components/DeviceCard.d.ts +4 -0
- package/dist/fe/components/DevicesPage/components/DevicesHeader.d.ts +4 -0
- package/dist/fe/components/DevicesPage/components/DevicesPage.d.ts +4 -0
- package/dist/fe/components/DevicesPage/index.d.ts +8 -0
- package/dist/fe/components/DevicesPage/store/index.d.ts +20 -0
- package/dist/fe/components/DevicesPage/theme/index.d.ts +92 -0
- package/dist/fe/components/DevicesPage/types/index.d.ts +147 -0
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordForm.d.ts +4 -0
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordHeader.d.ts +4 -0
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordPage.d.ts +4 -0
- package/dist/fe/components/ForgotPasswordPage/index.d.ts +7 -0
- package/dist/fe/components/ForgotPasswordPage/store/index.d.ts +14 -0
- package/dist/fe/components/ForgotPasswordPage/theme/index.d.ts +48 -0
- package/dist/fe/components/ForgotPasswordPage/types/index.d.ts +48 -0
- package/dist/fe/components/FormBuilder/components/FormBuilder.d.ts +3 -0
- package/dist/fe/components/FormBuilder/components/FormField.d.ts +3 -0
- package/dist/fe/components/FormBuilder/hooks/useFormBuilder.d.ts +3 -0
- package/dist/fe/components/FormBuilder/index.d.ts +6 -0
- package/dist/fe/components/FormBuilder/theme/index.d.ts +136 -0
- package/dist/fe/components/FormBuilder/types/index.d.ts +150 -0
- package/dist/fe/components/FormBuilder/utils/cn.d.ts +3 -0
- package/dist/fe/components/FormBuilder/utils/fieldMapping.d.ts +12 -0
- package/dist/fe/components/FormBuilder/utils/validation.d.ts +11 -0
- package/dist/fe/components/LoginPage/components/LoginForm.d.ts +4 -0
- package/dist/fe/components/LoginPage/components/LoginHeader.d.ts +4 -0
- package/dist/fe/components/LoginPage/components/LoginPage.d.ts +4 -0
- package/dist/fe/components/LoginPage/index.d.ts +8 -0
- package/dist/fe/components/LoginPage/store/index.d.ts +22 -0
- package/dist/fe/components/LoginPage/theme/index.d.ts +55 -0
- package/dist/fe/components/LoginPage/types/index.d.ts +129 -0
- package/dist/fe/components/MagicLinkVerifyPage/components/MagicLinkVerifyPage.d.ts +4 -0
- package/dist/fe/components/MagicLinkVerifyPage/index.d.ts +5 -0
- package/dist/fe/components/MagicLinkVerifyPage/store.d.ts +15 -0
- package/dist/fe/components/MagicLinkVerifyPage/theme.d.ts +37 -0
- package/dist/fe/components/MagicLinkVerifyPage/types.d.ts +35 -0
- package/dist/fe/components/NucleusEntityShowcase.d.ts +3 -0
- package/dist/fe/components/NucleusTextInput/components/FloatingLabel.d.ts +3 -0
- package/dist/fe/components/NucleusTextInput/components/InputIcons.d.ts +15 -0
- package/dist/fe/components/NucleusTextInput/components/NucleusTextInput.d.ts +3 -0
- package/dist/fe/components/NucleusTextInput/components/PasswordStrengthIndicator.d.ts +15 -0
- package/dist/fe/components/NucleusTextInput/components/TypewriterText.d.ts +3 -0
- package/dist/fe/components/NucleusTextInput/index.d.ts +11 -0
- package/dist/fe/components/NucleusTextInput/theme/index.d.ts +108 -0
- package/dist/fe/components/NucleusTextInput/types/index.d.ts +65 -0
- package/dist/fe/components/NucleusTextInput/utils/cn.d.ts +3 -0
- package/dist/fe/components/NucleusTextInput/utils/format.d.ts +8 -0
- package/dist/fe/components/NucleusTextInput/utils/validation.d.ts +23 -0
- package/dist/fe/components/ProfilePage/components/AddressCard.d.ts +4 -0
- package/dist/fe/components/ProfilePage/components/PhoneCard.d.ts +4 -0
- package/dist/fe/components/ProfilePage/components/ProfileHeader.d.ts +4 -0
- package/dist/fe/components/ProfilePage/components/ProfilePage.d.ts +4 -0
- package/dist/fe/components/ProfilePage/index.d.ts +10 -0
- package/dist/fe/components/ProfilePage/store/index.d.ts +37 -0
- package/dist/fe/components/ProfilePage/theme/index.d.ts +101 -0
- package/dist/fe/components/ProfilePage/types/index.d.ts +150 -0
- package/dist/fe/components/RangePicker/components/RangePicker.d.ts +3 -0
- package/dist/fe/components/RangePicker/components/RangeThumb.d.ts +3 -0
- package/dist/fe/components/RangePicker/components/RangeTooltip.d.ts +3 -0
- package/dist/fe/components/RangePicker/components/RangeTrack.d.ts +3 -0
- package/dist/fe/components/RangePicker/index.d.ts +8 -0
- package/dist/fe/components/RangePicker/theme/index.d.ts +90 -0
- package/dist/fe/components/RangePicker/types/index.d.ts +66 -0
- package/dist/fe/components/RangePicker/utils/cn.d.ts +3 -0
- package/dist/fe/components/RegisterPage/components/PasswordStrengthIndicator.d.ts +14 -0
- package/dist/fe/components/RegisterPage/components/RegisterForm.d.ts +4 -0
- package/dist/fe/components/RegisterPage/components/RegisterHeader.d.ts +4 -0
- package/dist/fe/components/RegisterPage/components/RegisterPage.d.ts +4 -0
- package/dist/fe/components/RegisterPage/index.d.ts +9 -0
- package/dist/fe/components/RegisterPage/store/index.d.ts +19 -0
- package/dist/fe/components/RegisterPage/theme/index.d.ts +81 -0
- package/dist/fe/components/RegisterPage/types/index.d.ts +141 -0
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordForm.d.ts +4 -0
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordHeader.d.ts +4 -0
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordPage.d.ts +4 -0
- package/dist/fe/components/ResetPasswordPage/index.d.ts +7 -0
- package/dist/fe/components/ResetPasswordPage/store/index.d.ts +15 -0
- package/dist/fe/components/ResetPasswordPage/theme/index.d.ts +56 -0
- package/dist/fe/components/ResetPasswordPage/types/index.d.ts +50 -0
- package/dist/fe/components/SearchBox/components/SearchBox.d.ts +3 -0
- package/dist/fe/components/SearchBox/components/SearchBoxDropdown.d.ts +3 -0
- package/dist/fe/components/SearchBox/index.d.ts +8 -0
- package/dist/fe/components/SearchBox/theme/index.d.ts +141 -0
- package/dist/fe/components/SearchBox/types/index.d.ts +47 -0
- package/dist/fe/components/SearchBox/utils/cn.d.ts +3 -0
- package/dist/fe/components/SearchBox/utils/debounce.d.ts +5 -0
- package/dist/fe/components/SearchBox/utils/sanitize.d.ts +9 -0
- package/dist/fe/components/SelectBox/components/SelectBox.d.ts +3 -0
- package/dist/fe/components/SelectBox/components/SelectDropdown.d.ts +6 -0
- package/dist/fe/components/SelectBox/components/SelectOptionItem.d.ts +3 -0
- package/dist/fe/components/SelectBox/components/SelectTrigger.d.ts +5 -0
- package/dist/fe/components/SelectBox/index.d.ts +8 -0
- package/dist/fe/components/SelectBox/theme/index.d.ts +100 -0
- package/dist/fe/components/SelectBox/types/index.d.ts +66 -0
- package/dist/fe/components/SelectBox/utils/cn.d.ts +3 -0
- package/dist/fe/components/SetPasswordPage/components/PasswordStrengthIndicator.d.ts +14 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordForm.d.ts +4 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordHeader.d.ts +4 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordPage.d.ts +4 -0
- package/dist/fe/components/SetPasswordPage/index.d.ts +9 -0
- package/dist/fe/components/SetPasswordPage/store/index.d.ts +16 -0
- package/dist/fe/components/SetPasswordPage/theme/index.d.ts +95 -0
- package/dist/fe/components/SetPasswordPage/types/index.d.ts +137 -0
- package/dist/fe/components/UsersPage/components/InviteUserModal.d.ts +10 -0
- package/dist/fe/components/UsersPage/components/Pagination.d.ts +13 -0
- package/dist/fe/components/UsersPage/components/RoleAssignmentModal.d.ts +12 -0
- package/dist/fe/components/UsersPage/components/StatsCards.d.ts +10 -0
- package/dist/fe/components/UsersPage/components/UserDetailDrawer.d.ts +24 -0
- package/dist/fe/components/UsersPage/components/UserFilters.d.ts +18 -0
- package/dist/fe/components/UsersPage/components/UserListItem.d.ts +11 -0
- package/dist/fe/components/UsersPage/components/UserListSkeleton.d.ts +7 -0
- package/dist/fe/components/UsersPage/components/UsersPage.d.ts +8 -0
- package/dist/fe/components/UsersPage/index.d.ts +13 -0
- package/dist/fe/components/UsersPage/store/index.d.ts +51 -0
- package/dist/fe/components/UsersPage/theme/index.d.ts +180 -0
- package/dist/fe/components/UsersPage/types/index.d.ts +73 -0
- package/dist/fe/components/VerifyEmailPage/components/VerifyEmailPage.d.ts +4 -0
- package/dist/fe/components/VerifyEmailPage/index.d.ts +5 -0
- package/dist/fe/components/VerifyEmailPage/store/index.d.ts +18 -0
- package/dist/fe/components/VerifyEmailPage/theme/index.d.ts +49 -0
- package/dist/fe/components/VerifyEmailPage/types/index.d.ts +84 -0
- package/dist/fe/hooks/useNucleusEntity.d.ts +3 -0
- package/dist/fe/index.d.ts +42 -0
- package/dist/fe/index.js +1 -0
- package/dist/fe/types/index.d.ts +233 -0
- package/dist/fe/utils/cn.d.ts +3 -0
- package/dist/fe/utils/columnUtils.d.ts +63 -0
- package/dist/fe/utils/endpointKeys.d.ts +9 -0
- package/dist/index-0yyw12k6.js +1 -0
- package/dist/index-tv67j5qd.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -0
- package/dist/nucleus.config.d.ts +95 -0
- package/dist/public/components/CTA.d.ts +2 -0
- package/dist/public/components/Capabilities.d.ts +9 -0
- package/dist/public/components/Features.d.ts +9 -0
- package/dist/public/components/Footer.d.ts +2 -0
- package/dist/public/components/Hero.d.ts +2 -0
- package/dist/public/components/Managers.d.ts +7 -0
- package/dist/public/components/Nav.d.ts +2 -0
- package/dist/public/components/Stack.d.ts +7 -0
- package/dist/public/components/docs/Docs.d.ts +2 -0
- package/dist/public/components/docs/DocsContent.d.ts +19 -0
- package/dist/public/components/docs/DocsRightSidebar.d.ts +9 -0
- package/dist/public/components/docs/DocsSidebar.d.ts +8 -0
- package/dist/public/components/docs/content/authentication.d.ts +3 -0
- package/dist/public/components/docs/content/gettingStarted.d.ts +3 -0
- package/dist/public/components/docs/docsData.d.ts +18 -0
- package/dist/public/components/docs/index.d.ts +7 -0
- package/dist/public/components/index.d.ts +10 -0
- package/dist/public/index.d.ts +3 -0
- package/dist/public/store.d.ts +20 -0
- package/dist/scripts/build.d.ts +7 -0
- package/dist/scripts/generate-schema.d.ts +3 -0
- package/dist/scripts/generate-system-tables-types.d.ts +2 -0
- package/dist/scripts/generate-types-schema.d.ts +7 -0
- package/dist/scripts/publish.d.ts +7 -0
- package/dist/scripts/version.d.ts +7 -0
- package/dist/src/Client/ApiCaller/client.d.ts +5 -0
- package/dist/src/Client/ApiCaller/examples/usage.example.d.ts +8 -0
- package/dist/src/Client/ApiCaller/generator.d.ts +10 -0
- package/dist/src/Client/ApiCaller/index.d.ts +7 -0
- package/dist/src/Client/ApiCaller/server.d.ts +4 -0
- package/dist/src/Client/ApiCaller/system-tables.d.ts +1215 -0
- package/dist/src/Client/ApiCaller/types.d.ts +907 -0
- package/dist/src/Client/Proxy/httpProxy.d.ts +5 -0
- package/dist/src/Client/Proxy/index.d.ts +6 -0
- package/dist/src/Client/Proxy/index.js +1 -0
- package/dist/src/Client/Proxy/server.d.ts +5 -0
- package/dist/src/Client/Proxy/types.d.ts +69 -0
- package/dist/src/Client/Proxy/utils.d.ts +12 -0
- package/dist/src/Client/Proxy/wsProxy.d.ts +20 -0
- package/dist/src/Client/ServerFetch/index.d.ts +19 -0
- package/dist/src/Client/ServerFetch/types.d.ts +34 -0
- package/dist/src/Client/index.d.ts +4 -0
- package/dist/src/ElysiaPlugin/index.d.ts +12 -0
- package/dist/src/ElysiaPlugin/publicRoutes.d.ts +9 -0
- package/dist/src/ElysiaPlugin/routes/auth/captcha/index.d.ts +46 -0
- package/dist/src/ElysiaPlugin/routes/auth/emailVerification/index.d.ts +38 -0
- package/dist/src/ElysiaPlugin/routes/auth/index.d.ts +68 -0
- package/dist/src/ElysiaPlugin/routes/auth/invite/index.d.ts +43 -0
- package/dist/src/ElysiaPlugin/routes/auth/login/index.d.ts +68 -0
- package/dist/src/ElysiaPlugin/routes/auth/login/types.d.ts +22 -0
- package/dist/src/ElysiaPlugin/routes/auth/login/utils.d.ts +19 -0
- package/dist/src/ElysiaPlugin/routes/auth/logout/index.d.ts +33 -0
- package/dist/src/ElysiaPlugin/routes/auth/logout/types.d.ts +6 -0
- package/dist/src/ElysiaPlugin/routes/auth/logout/utils.d.ts +2 -0
- package/dist/src/ElysiaPlugin/routes/auth/magicLink/index.d.ts +41 -0
- package/dist/src/ElysiaPlugin/routes/auth/magicLink/types.d.ts +23 -0
- package/dist/src/ElysiaPlugin/routes/auth/magicLink/utils.d.ts +4 -0
- package/dist/src/ElysiaPlugin/routes/auth/me/index.d.ts +40 -0
- package/dist/src/ElysiaPlugin/routes/auth/passwordChange/index.d.ts +33 -0
- package/dist/src/ElysiaPlugin/routes/auth/passwordChange/types.d.ts +12 -0
- package/dist/src/ElysiaPlugin/routes/auth/passwordChange/utils.d.ts +2 -0
- package/dist/src/ElysiaPlugin/routes/auth/passwordReset/index.d.ts +36 -0
- package/dist/src/ElysiaPlugin/routes/auth/passwordReset/types.d.ts +16 -0
- package/dist/src/ElysiaPlugin/routes/auth/passwordReset/utils.d.ts +3 -0
- package/dist/src/ElysiaPlugin/routes/auth/passwordSet/index.d.ts +33 -0
- package/dist/src/ElysiaPlugin/routes/auth/passwordSet/types.d.ts +9 -0
- package/dist/src/ElysiaPlugin/routes/auth/refresh/index.d.ts +39 -0
- package/dist/src/ElysiaPlugin/routes/auth/refresh/types.d.ts +9 -0
- package/dist/src/ElysiaPlugin/routes/auth/refresh/utils.d.ts +2 -0
- package/dist/src/ElysiaPlugin/routes/auth/register/index.d.ts +47 -0
- package/dist/src/ElysiaPlugin/routes/auth/register/types.d.ts +18 -0
- package/dist/src/ElysiaPlugin/routes/auth/register/utils.d.ts +8 -0
- package/dist/src/ElysiaPlugin/routes/auth/sessions/index.d.ts +33 -0
- package/dist/src/ElysiaPlugin/routes/auth/sessions/types.d.ts +67 -0
- package/dist/src/ElysiaPlugin/routes/auth/sessions/utils.d.ts +36 -0
- package/dist/src/ElysiaPlugin/routes/auth/types.d.ts +153 -0
- package/dist/src/ElysiaPlugin/routes/entity/index.d.ts +5 -0
- package/dist/src/ElysiaPlugin/routes/entity/types.d.ts +50 -0
- package/dist/src/ElysiaPlugin/routes/entity/utils.d.ts +11 -0
- package/dist/src/ElysiaPlugin/routes/index.d.ts +5 -0
- package/dist/src/ElysiaPlugin/routes/monitoring/index.d.ts +58 -0
- package/dist/src/ElysiaPlugin/routes/storage/cdn.d.ts +51 -0
- package/dist/src/ElysiaPlugin/routes/storage/helpers.d.ts +53 -0
- package/dist/src/ElysiaPlugin/routes/storage/index.d.ts +3 -0
- package/dist/src/ElysiaPlugin/routes/verification/index.d.ts +39 -0
- package/dist/src/ElysiaPlugin/swagger.d.ts +28 -0
- package/dist/src/ElysiaPlugin/utils.d.ts +70 -0
- package/dist/src/Managers/Dapr/clients/binding-client.d.ts +15 -0
- package/dist/src/Managers/Dapr/clients/config-client.d.ts +27 -0
- package/dist/src/Managers/Dapr/clients/crypto-client.d.ts +27 -0
- package/dist/src/Managers/Dapr/clients/invoke-client.d.ts +32 -0
- package/dist/src/Managers/Dapr/clients/lock-client.d.ts +23 -0
- package/dist/src/Managers/Dapr/clients/pubsub-client.d.ts +23 -0
- package/dist/src/Managers/Dapr/clients/secret-client.d.ts +19 -0
- package/dist/src/Managers/Dapr/clients/state-client.d.ts +55 -0
- package/dist/src/Managers/Dapr/clients/workflow-client.d.ts +39 -0
- package/dist/src/Managers/Dapr/connection-manager.d.ts +51 -0
- package/dist/src/Managers/Dapr/constants.d.ts +49 -0
- package/dist/src/Managers/Dapr/dapr-manager.d.ts +160 -0
- package/dist/src/Managers/Dapr/error-handling.d.ts +29 -0
- package/dist/src/Managers/Dapr/index.d.ts +102 -0
- package/dist/src/Managers/Dapr/types.d.ts +121 -0
- package/dist/src/Managers/Dapr/utils.d.ts +44 -0
- package/dist/src/Managers/File/atomic.d.ts +64 -0
- package/dist/src/Managers/File/core.d.ts +188 -0
- package/dist/src/Managers/File/index.d.ts +18 -0
- package/dist/src/Managers/File/permissions.d.ts +72 -0
- package/dist/src/Managers/File/streaming.d.ts +30 -0
- package/dist/src/Managers/File/types.d.ts +146 -0
- package/dist/src/Managers/File/utils.d.ts +112 -0
- package/dist/src/Managers/Postgre/index.d.ts +25 -0
- package/dist/src/Managers/Redis/index.d.ts +33 -0
- package/dist/src/Managers/index.d.ts +5 -0
- package/dist/src/Services/Auth/Fingerprint/Generate/index.d.ts +3 -0
- package/dist/src/Services/Auth/Fingerprint/Validate/index.d.ts +3 -0
- package/dist/src/Services/Auth/Fingerprint/index.d.ts +5 -0
- package/dist/src/Services/Auth/Fingerprint/types.d.ts +20 -0
- package/dist/src/Services/Auth/Fingerprint/utils.d.ts +3 -0
- package/dist/src/Services/Auth/JWT/Decode/index.d.ts +3 -0
- package/dist/src/Services/Auth/JWT/Sign/index.d.ts +3 -0
- package/dist/src/Services/Auth/JWT/Verify/index.d.ts +3 -0
- package/dist/src/Services/Auth/JWT/index.d.ts +5 -0
- package/dist/src/Services/Auth/JWT/types.d.ts +38 -0
- package/dist/src/Services/Auth/JWT/utils.d.ts +10 -0
- package/dist/src/Services/Auth/Password/Generate/index.d.ts +3 -0
- package/dist/src/Services/Auth/Password/Validate/index.d.ts +3 -0
- package/dist/src/Services/Auth/Password/index.d.ts +2 -0
- package/dist/src/Services/Auth/Password/types.d.ts +16 -0
- package/dist/src/Services/Auth/RefreshToken/Delete/index.d.ts +3 -0
- package/dist/src/Services/Auth/RefreshToken/Generate/index.d.ts +11 -0
- package/dist/src/Services/Auth/RefreshToken/Read/index.d.ts +11 -0
- package/dist/src/Services/Auth/RefreshToken/Validate/index.d.ts +11 -0
- package/dist/src/Services/Auth/RefreshToken/index.d.ts +5 -0
- package/dist/src/Services/Auth/RefreshToken/types.d.ts +27 -0
- package/dist/src/Services/Auth/RefreshToken/utils.d.ts +6 -0
- package/dist/src/Services/Auth/Session/Issue/index.d.ts +9 -0
- package/dist/src/Services/Auth/Session/index.d.ts +2 -0
- package/dist/src/Services/Auth/Session/types.d.ts +13 -0
- package/dist/src/Services/Auth/SessionStore/Delete/index.d.ts +3 -0
- package/dist/src/Services/Auth/SessionStore/Generate/index.d.ts +11 -0
- package/dist/src/Services/Auth/SessionStore/Read/index.d.ts +3 -0
- package/dist/src/Services/Auth/SessionStore/Update/index.d.ts +24 -0
- package/dist/src/Services/Auth/SessionStore/Validate/index.d.ts +3 -0
- package/dist/src/Services/Auth/SessionStore/index.d.ts +7 -0
- package/dist/src/Services/Auth/SessionStore/types.d.ts +59 -0
- package/dist/src/Services/Auth/SessionStore/utils.d.ts +6 -0
- package/dist/src/Services/Auth/index.d.ts +7 -0
- package/dist/src/Services/Authorization/ClaimSeeder/index.d.ts +6 -0
- package/dist/src/Services/Authorization/GodminSetup/index.d.ts +10 -0
- package/dist/src/Services/Authorization/Middleware/index.d.ts +21 -0
- package/dist/src/Services/Authorization/index.d.ts +5 -0
- package/dist/src/Services/Authorization/types.d.ts +68 -0
- package/dist/src/Services/Captcha/index.d.ts +15 -0
- package/dist/src/Services/Captcha/types.d.ts +69 -0
- package/dist/src/Services/Gmail/index.d.ts +62 -0
- package/dist/src/Services/Logger/Logger.d.ts +77 -0
- package/dist/src/Services/Logger/index.d.ts +5 -0
- package/dist/src/Services/Logger/transports.d.ts +54 -0
- package/dist/src/Services/Logger/types.d.ts +88 -0
- package/dist/src/Services/Logger/utils.d.ts +8 -0
- package/dist/src/Services/Monitoring/AlertService.d.ts +29 -0
- package/dist/src/Services/Monitoring/collectors/ApplicationCollector.d.ts +30 -0
- package/dist/src/Services/Monitoring/collectors/SystemCollector.d.ts +13 -0
- package/dist/src/Services/Monitoring/collectors/index.d.ts +3 -0
- package/dist/src/Services/Monitoring/index.d.ts +109 -0
- package/dist/src/Services/Monitoring/types.d.ts +163 -0
- package/dist/src/Services/Notification/index.d.ts +31 -0
- package/dist/src/Services/Notification/types.d.ts +59 -0
- package/dist/src/Services/RateLimiter/index.d.ts +99 -0
- package/dist/src/Services/Verification/index.d.ts +23 -0
- package/dist/src/Services/Verification/types.d.ts +135 -0
- package/dist/src/Services/index.d.ts +10 -0
- package/dist/src/types.d.ts +588 -0
- package/package.json +99 -0
- package/public/components/CTA.tsx +25 -0
- package/public/components/Capabilities.tsx +69 -0
- package/public/components/Features.tsx +107 -0
- package/public/components/Footer.tsx +60 -0
- package/public/components/Hero.tsx +53 -0
- package/public/components/Managers.tsx +60 -0
- package/public/components/Nav.tsx +107 -0
- package/public/components/Stack.tsx +36 -0
- package/public/components/docs/Docs.tsx +62 -0
- package/public/components/docs/DocsContent.tsx +203 -0
- package/public/components/docs/DocsRightSidebar.tsx +53 -0
- package/public/components/docs/DocsSidebar.tsx +62 -0
- package/public/components/docs/content/authentication.ts +1670 -0
- package/public/components/docs/content/gettingStarted.ts +627 -0
- package/public/components/docs/docsData.ts +36 -0
- package/public/components/docs/index.ts +6 -0
- package/public/components/index.ts +9 -0
- package/public/docs.css +633 -0
- package/public/index.html +81 -0
- package/public/index.tsx +52 -0
- package/public/store.ts +79 -0
- package/public/styles.css +877 -0
- package/schemas/bckp/config.nucleus.json +1488 -0
- package/schemas/bckp/nucleus.tables.schema.json +24 -0
- package/schemas/bckp/table.schema.json +472 -0
- package/schemas/config.nucleus.json +1010 -0
- package/schemas/nucleus.tables.schema.json +19 -0
- package/schemas/table.schema.json +498 -0
- package/scripts/build.ts +197 -0
- package/scripts/generate-schema.ts +556 -0
- package/scripts/generate-system-tables-types.ts +18 -0
- package/scripts/generate-types-schema.ts +962 -0
- package/scripts/publish.ts +210 -0
- package/scripts/version.ts +125 -0
- package/src/system.tables.json +1590 -0
|
@@ -0,0 +1,962 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* This script generates JSON Schema files from TypeScript types in src/types.ts
|
|
4
|
+
* Run: bun run scripts/generate-types-schema.ts
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as fs from "node:fs";
|
|
8
|
+
import * as path from "node:path";
|
|
9
|
+
|
|
10
|
+
const TYPES_FILE = path.resolve(import.meta.dir, "../src/types.ts");
|
|
11
|
+
const SCHEMAS_DIR = path.resolve(import.meta.dir, "../schemas");
|
|
12
|
+
|
|
13
|
+
interface SchemaProperty {
|
|
14
|
+
type?: string | string[];
|
|
15
|
+
description?: string;
|
|
16
|
+
enum?: string[];
|
|
17
|
+
items?: SchemaProperty;
|
|
18
|
+
properties?: Record<string, SchemaProperty>;
|
|
19
|
+
required?: string[];
|
|
20
|
+
default?: unknown;
|
|
21
|
+
$ref?: string;
|
|
22
|
+
additionalProperties?: boolean | SchemaProperty;
|
|
23
|
+
minLength?: number;
|
|
24
|
+
maxLength?: number;
|
|
25
|
+
minimum?: number;
|
|
26
|
+
maximum?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface JsonSchema {
|
|
30
|
+
$id?: string;
|
|
31
|
+
$schema?: string;
|
|
32
|
+
title?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
type?: string;
|
|
35
|
+
properties?: Record<string, SchemaProperty>;
|
|
36
|
+
required?: string[];
|
|
37
|
+
$defs?: Record<string, SchemaProperty>;
|
|
38
|
+
additionalProperties?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function parseTypesFile(): string {
|
|
42
|
+
return fs.readFileSync(TYPES_FILE, "utf-8");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function extractUnionType(content: string, typeName: string): string[] | null {
|
|
46
|
+
const regex = new RegExp(
|
|
47
|
+
`export type ${typeName}\\s*=([\\s\\S]*?)(?=export|$)`,
|
|
48
|
+
);
|
|
49
|
+
const match = content.match(regex);
|
|
50
|
+
if (!match || !match[1]) return null;
|
|
51
|
+
|
|
52
|
+
const body = match[1];
|
|
53
|
+
const values = body
|
|
54
|
+
.split("|")
|
|
55
|
+
.map((v) =>
|
|
56
|
+
v
|
|
57
|
+
.trim()
|
|
58
|
+
.replace(/^['"]|['"];?$/g, "")
|
|
59
|
+
.replace(/;$/, ""),
|
|
60
|
+
)
|
|
61
|
+
.filter(
|
|
62
|
+
(v) => v && !v.startsWith("//") && !v.includes("{") && v.length > 0,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
return values;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function extractInterface(
|
|
69
|
+
content: string,
|
|
70
|
+
interfaceName: string,
|
|
71
|
+
): { properties: Record<string, SchemaProperty>; required: string[] } | null {
|
|
72
|
+
const regex = new RegExp(
|
|
73
|
+
`export interface ${interfaceName}\\s*\\{([\\s\\S]*?)\\n\\}`,
|
|
74
|
+
"m",
|
|
75
|
+
);
|
|
76
|
+
const match = content.match(regex);
|
|
77
|
+
if (!match || !match[1]) return null;
|
|
78
|
+
|
|
79
|
+
const body = match[1];
|
|
80
|
+
const properties: Record<string, SchemaProperty> = {};
|
|
81
|
+
const required: string[] = [];
|
|
82
|
+
|
|
83
|
+
const lines = body.split("\n");
|
|
84
|
+
for (const line of lines) {
|
|
85
|
+
const propMatch = line.match(/^\s*(\w+)(\?)?:\s*(.+?);?\s*(?:\/\/.*)?$/);
|
|
86
|
+
if (!propMatch) continue;
|
|
87
|
+
|
|
88
|
+
const propName = propMatch[1];
|
|
89
|
+
const optional = propMatch[2];
|
|
90
|
+
const propType = propMatch[3];
|
|
91
|
+
if (!propName || !propType) continue;
|
|
92
|
+
|
|
93
|
+
const prop = parseTypeToSchema(propType.trim(), content);
|
|
94
|
+
properties[propName] = prop;
|
|
95
|
+
|
|
96
|
+
if (!optional) {
|
|
97
|
+
required.push(propName);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return { properties, required };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function parseTypeToSchema(typeStr: string, content: string): SchemaProperty {
|
|
105
|
+
typeStr = typeStr.replace(/;$/, "").trim();
|
|
106
|
+
|
|
107
|
+
if (typeStr === "string") return { type: "string" };
|
|
108
|
+
if (typeStr === "number") return { type: "number" };
|
|
109
|
+
if (typeStr === "boolean") return { type: "boolean" };
|
|
110
|
+
if (typeStr === "unknown" || typeStr === "any") return {};
|
|
111
|
+
if (typeStr === "string[]")
|
|
112
|
+
return { type: "array", items: { type: "string" } };
|
|
113
|
+
if (typeStr === "number[]")
|
|
114
|
+
return { type: "array", items: { type: "number" } };
|
|
115
|
+
|
|
116
|
+
if (typeStr.startsWith("'") || typeStr.startsWith('"')) {
|
|
117
|
+
const enumValue = typeStr.replace(/^['"]|['"]$/g, "");
|
|
118
|
+
return { type: "string", enum: [enumValue] };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const unionMatch = typeStr.match(
|
|
122
|
+
/^(['"][^'"]+['"](?:\s*\|\s*['"][^'"]+['"])+)$/,
|
|
123
|
+
);
|
|
124
|
+
if (unionMatch) {
|
|
125
|
+
const values = typeStr
|
|
126
|
+
.split("|")
|
|
127
|
+
.map((v) => v.trim().replace(/^['"]|['"]$/g, ""));
|
|
128
|
+
return { type: "string", enum: values };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const arrayMatch = typeStr.match(/^(.+)\[\]$/);
|
|
132
|
+
if (arrayMatch?.[1]) {
|
|
133
|
+
return { type: "array", items: parseTypeToSchema(arrayMatch[1], content) };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const recordMatch = typeStr.match(/^Record<string,\s*(.+)>$/);
|
|
137
|
+
if (recordMatch?.[1]) {
|
|
138
|
+
return {
|
|
139
|
+
type: "object",
|
|
140
|
+
additionalProperties: parseTypeToSchema(recordMatch[1], content),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const objectMatch = typeStr.match(/^\{([^}]+)\}$/);
|
|
145
|
+
if (objectMatch?.[1]) {
|
|
146
|
+
const props: Record<string, SchemaProperty> = {};
|
|
147
|
+
const innerProps = objectMatch[1].split(/[,;]/).filter((p) => p.trim());
|
|
148
|
+
for (const prop of innerProps) {
|
|
149
|
+
const m = prop.trim().match(/^(\w+)(\?)?:\s*(.+)$/);
|
|
150
|
+
if (m?.[1] && m[3]) {
|
|
151
|
+
props[m[1]] = parseTypeToSchema(m[3], content);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { type: "object", properties: props };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const knownUnion = extractUnionType(content, typeStr);
|
|
158
|
+
if (knownUnion) {
|
|
159
|
+
return { type: "string", enum: knownUnion };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const knownInterface = extractInterface(content, typeStr);
|
|
163
|
+
if (knownInterface) {
|
|
164
|
+
return {
|
|
165
|
+
type: "object",
|
|
166
|
+
properties: knownInterface.properties,
|
|
167
|
+
required:
|
|
168
|
+
knownInterface.required.length > 0
|
|
169
|
+
? knownInterface.required
|
|
170
|
+
: undefined,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return { type: "string" };
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function generateNucleusTableSchema(content: string): JsonSchema {
|
|
178
|
+
const columnTypes = extractUnionType(content, "NucleusColumnType") || [];
|
|
179
|
+
const fkActions = extractUnionType(content, "NucleusFKAction") || [];
|
|
180
|
+
const indexMethods = extractUnionType(content, "NucleusIndexMethod") || [];
|
|
181
|
+
const columnModes = extractUnionType(content, "NucleusColumnMode") || [];
|
|
182
|
+
const sanitizeOptions =
|
|
183
|
+
extractUnionType(content, "NucleusSanitizeOption") || [];
|
|
184
|
+
const methods = extractUnionType(content, "GenericNucleusMethods") || [];
|
|
185
|
+
const featureSets = extractUnionType(content, "SystemTableFeatureSets") || [];
|
|
186
|
+
const validationFormats = [
|
|
187
|
+
"email",
|
|
188
|
+
"url",
|
|
189
|
+
"uuid",
|
|
190
|
+
"date",
|
|
191
|
+
"datetime",
|
|
192
|
+
"time",
|
|
193
|
+
"uri",
|
|
194
|
+
"ipv4",
|
|
195
|
+
"ipv6",
|
|
196
|
+
];
|
|
197
|
+
|
|
198
|
+
const columnReference: SchemaProperty = {
|
|
199
|
+
type: "object",
|
|
200
|
+
properties: {
|
|
201
|
+
table: { type: "string", description: "Referenced table name" },
|
|
202
|
+
column: { type: "string", description: "Referenced column name" },
|
|
203
|
+
onDelete: {
|
|
204
|
+
type: "string",
|
|
205
|
+
enum: fkActions,
|
|
206
|
+
description: "ON DELETE action",
|
|
207
|
+
},
|
|
208
|
+
onUpdate: {
|
|
209
|
+
type: "string",
|
|
210
|
+
enum: fkActions,
|
|
211
|
+
description: "ON UPDATE action",
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
required: ["table"],
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
const columnEnum: SchemaProperty = {
|
|
218
|
+
type: "object",
|
|
219
|
+
properties: {
|
|
220
|
+
name: { type: "string", description: "Enum type name" },
|
|
221
|
+
values: {
|
|
222
|
+
type: "array",
|
|
223
|
+
items: { type: "string" },
|
|
224
|
+
description: "Enum values",
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
required: ["name", "values"],
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const columnValidation: SchemaProperty = {
|
|
231
|
+
type: "object",
|
|
232
|
+
properties: {
|
|
233
|
+
minLength: { type: "number" },
|
|
234
|
+
maxLength: { type: "number" },
|
|
235
|
+
min: { type: "number" },
|
|
236
|
+
max: { type: "number" },
|
|
237
|
+
pattern: { type: "string" },
|
|
238
|
+
format: { type: "string", enum: validationFormats },
|
|
239
|
+
customMessage: { type: "string" },
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
const column: SchemaProperty = {
|
|
244
|
+
type: "object",
|
|
245
|
+
properties: {
|
|
246
|
+
name: { type: "string", description: "Column name", minLength: 1 },
|
|
247
|
+
type: {
|
|
248
|
+
type: "string",
|
|
249
|
+
description: "Drizzle PostgreSQL column type",
|
|
250
|
+
enum: columnTypes,
|
|
251
|
+
},
|
|
252
|
+
length: {
|
|
253
|
+
type: "number",
|
|
254
|
+
description: "Column length (for varchar, char)",
|
|
255
|
+
},
|
|
256
|
+
precision: { type: "number", description: "Numeric precision" },
|
|
257
|
+
scale: { type: "number", description: "Numeric scale" },
|
|
258
|
+
dimensions: { type: "number", description: "Vector dimensions" },
|
|
259
|
+
mode: { type: "string", enum: columnModes, description: "Column mode" },
|
|
260
|
+
withTimezone: {
|
|
261
|
+
type: "boolean",
|
|
262
|
+
description: "Include timezone for timestamp types",
|
|
263
|
+
},
|
|
264
|
+
nullable: { type: "boolean", description: "Column is nullable" },
|
|
265
|
+
notNull: { type: "boolean", description: "Column is NOT NULL" },
|
|
266
|
+
unique: { type: "boolean", description: "Column has unique constraint" },
|
|
267
|
+
primaryKey: { type: "boolean", description: "Column is primary key" },
|
|
268
|
+
default: { description: "Default value" },
|
|
269
|
+
defaultRaw: { type: "string", description: "Raw SQL default expression" },
|
|
270
|
+
references: { $ref: "#/$defs/columnReference" },
|
|
271
|
+
array: { type: "boolean", description: "Column is array type" },
|
|
272
|
+
arrayDimensions: { type: "number", description: "Array dimensions" },
|
|
273
|
+
enumValues: {
|
|
274
|
+
type: "array",
|
|
275
|
+
items: { type: "string" },
|
|
276
|
+
description: "Enum values (shorthand)",
|
|
277
|
+
},
|
|
278
|
+
enum: { $ref: "#/$defs/columnEnum" },
|
|
279
|
+
generatedAlwaysAs: {
|
|
280
|
+
type: "string",
|
|
281
|
+
description: "Generated column expression",
|
|
282
|
+
},
|
|
283
|
+
generatedAlwaysAsIdentity: { type: "boolean" },
|
|
284
|
+
generatedByDefaultAsIdentity: { type: "boolean" },
|
|
285
|
+
check: { type: "string", description: "Check constraint expression" },
|
|
286
|
+
comment: { type: "string", description: "Column comment" },
|
|
287
|
+
validation: { $ref: "#/$defs/columnValidation" },
|
|
288
|
+
sanitize: {
|
|
289
|
+
type: "array",
|
|
290
|
+
items: { type: "string", enum: sanitizeOptions },
|
|
291
|
+
description: "Sanitize options",
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
required: ["name", "type"],
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
const index: SchemaProperty = {
|
|
298
|
+
type: "object",
|
|
299
|
+
properties: {
|
|
300
|
+
name: { type: "string", description: "Index name" },
|
|
301
|
+
columns: {
|
|
302
|
+
type: "array",
|
|
303
|
+
items: { type: "string" },
|
|
304
|
+
description: "Indexed columns",
|
|
305
|
+
},
|
|
306
|
+
unique: { type: "boolean", description: "Unique index" },
|
|
307
|
+
using: {
|
|
308
|
+
type: "string",
|
|
309
|
+
enum: indexMethods,
|
|
310
|
+
description: "Index method",
|
|
311
|
+
},
|
|
312
|
+
where: { type: "string", description: "Partial index WHERE clause" },
|
|
313
|
+
concurrently: {
|
|
314
|
+
type: "boolean",
|
|
315
|
+
description: "Create index concurrently",
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
required: ["columns"],
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
const uniqueConstraint: SchemaProperty = {
|
|
322
|
+
type: "object",
|
|
323
|
+
properties: {
|
|
324
|
+
name: { type: "string" },
|
|
325
|
+
columns: { type: "array", items: { type: "string" } },
|
|
326
|
+
},
|
|
327
|
+
required: ["columns"],
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
const checkConstraint: SchemaProperty = {
|
|
331
|
+
type: "object",
|
|
332
|
+
properties: {
|
|
333
|
+
name: { type: "string" },
|
|
334
|
+
expression: { type: "string" },
|
|
335
|
+
},
|
|
336
|
+
required: ["expression"],
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const constraints: SchemaProperty = {
|
|
340
|
+
type: "object",
|
|
341
|
+
properties: {
|
|
342
|
+
primaryKey: { type: "array", items: { type: "string" } },
|
|
343
|
+
unique: { type: "array", items: { $ref: "#/$defs/uniqueConstraint" } },
|
|
344
|
+
check: { type: "array", items: { $ref: "#/$defs/checkConstraint" } },
|
|
345
|
+
},
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
const isPublicProps: Record<string, SchemaProperty> = {};
|
|
349
|
+
for (const method of methods) {
|
|
350
|
+
isPublicProps[method] = { type: "boolean", default: false };
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const schema: JsonSchema = {
|
|
354
|
+
$id: "table.schema.json",
|
|
355
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
356
|
+
title: "Nucleus Table Definition",
|
|
357
|
+
description: "Generated from NucleusTable interface in types.ts",
|
|
358
|
+
type: "object",
|
|
359
|
+
properties: {
|
|
360
|
+
table_name: {
|
|
361
|
+
type: "string",
|
|
362
|
+
description: "Table name in database",
|
|
363
|
+
minLength: 1,
|
|
364
|
+
maxLength: 100,
|
|
365
|
+
},
|
|
366
|
+
feature_set: {
|
|
367
|
+
type: "array",
|
|
368
|
+
items: { type: "string", enum: featureSets },
|
|
369
|
+
description: "Feature set this table belongs to",
|
|
370
|
+
},
|
|
371
|
+
add_base_columns: {
|
|
372
|
+
type: "boolean",
|
|
373
|
+
description: "Add base columns (id, created_at, etc.)",
|
|
374
|
+
default: true,
|
|
375
|
+
},
|
|
376
|
+
is_form_data: {
|
|
377
|
+
type: "boolean",
|
|
378
|
+
description: "Entity needs multipart form data",
|
|
379
|
+
default: false,
|
|
380
|
+
},
|
|
381
|
+
available_app_ids: {
|
|
382
|
+
type: "array",
|
|
383
|
+
items: { type: "string" },
|
|
384
|
+
description: "Available app IDs",
|
|
385
|
+
default: ["*"],
|
|
386
|
+
},
|
|
387
|
+
available_schemas: {
|
|
388
|
+
type: "array",
|
|
389
|
+
items: { type: "string" },
|
|
390
|
+
description: "Available schemas",
|
|
391
|
+
default: ["*"],
|
|
392
|
+
},
|
|
393
|
+
excluded_schemas: {
|
|
394
|
+
type: "array",
|
|
395
|
+
items: { type: "string" },
|
|
396
|
+
description: "Excluded schemas",
|
|
397
|
+
},
|
|
398
|
+
excluded_methods: {
|
|
399
|
+
type: "array",
|
|
400
|
+
items: { type: "string", enum: methods },
|
|
401
|
+
description: "Excluded HTTP methods",
|
|
402
|
+
},
|
|
403
|
+
is_public: {
|
|
404
|
+
type: "object",
|
|
405
|
+
description: "Public access per method",
|
|
406
|
+
properties: isPublicProps,
|
|
407
|
+
},
|
|
408
|
+
columns: {
|
|
409
|
+
type: "array",
|
|
410
|
+
items: { $ref: "#/$defs/column" },
|
|
411
|
+
description: "Column definitions",
|
|
412
|
+
},
|
|
413
|
+
indexes: {
|
|
414
|
+
type: "array",
|
|
415
|
+
items: { $ref: "#/$defs/index" },
|
|
416
|
+
description: "Index definitions",
|
|
417
|
+
},
|
|
418
|
+
constraints: { $ref: "#/$defs/constraints" },
|
|
419
|
+
group_name: {
|
|
420
|
+
type: "string",
|
|
421
|
+
description: "Group name for organization",
|
|
422
|
+
minLength: 1,
|
|
423
|
+
},
|
|
424
|
+
bulk_endpoints_enabled: {
|
|
425
|
+
type: "boolean",
|
|
426
|
+
description: "Enable bulk endpoints",
|
|
427
|
+
default: false,
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
required: ["table_name"],
|
|
431
|
+
additionalProperties: false,
|
|
432
|
+
$defs: {
|
|
433
|
+
column,
|
|
434
|
+
index,
|
|
435
|
+
constraints,
|
|
436
|
+
uniqueConstraint,
|
|
437
|
+
checkConstraint,
|
|
438
|
+
columnReference,
|
|
439
|
+
columnEnum,
|
|
440
|
+
columnValidation,
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
return schema;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function generateNucleusConfigSchema(_content: string): JsonSchema {
|
|
448
|
+
// const methods = extractUnionType(content, "GenericNucleusMethods") || [];
|
|
449
|
+
|
|
450
|
+
const tokenConfig: SchemaProperty = {
|
|
451
|
+
type: "object",
|
|
452
|
+
properties: {
|
|
453
|
+
secret: {
|
|
454
|
+
type: "string",
|
|
455
|
+
description: "Environment variable name for JWT secret",
|
|
456
|
+
},
|
|
457
|
+
expiresIn: {
|
|
458
|
+
type: "string",
|
|
459
|
+
description: 'Token expiration (e.g., "15m", "7d")',
|
|
460
|
+
},
|
|
461
|
+
algorithm: {
|
|
462
|
+
type: "string",
|
|
463
|
+
enum: [
|
|
464
|
+
"HS256",
|
|
465
|
+
"HS384",
|
|
466
|
+
"HS512",
|
|
467
|
+
"RS256",
|
|
468
|
+
"RS384",
|
|
469
|
+
"RS512",
|
|
470
|
+
"ES256",
|
|
471
|
+
"ES384",
|
|
472
|
+
"ES512",
|
|
473
|
+
"PS256",
|
|
474
|
+
"PS384",
|
|
475
|
+
"PS512",
|
|
476
|
+
],
|
|
477
|
+
description: "JWT algorithm",
|
|
478
|
+
},
|
|
479
|
+
issuer: { type: "string", description: "Token issuer" },
|
|
480
|
+
audience: { type: "string", description: "Token audience" },
|
|
481
|
+
name: { type: "string", description: "Cookie name" },
|
|
482
|
+
setHeadersEnabled: {
|
|
483
|
+
type: "boolean",
|
|
484
|
+
description: "Set token in response headers",
|
|
485
|
+
},
|
|
486
|
+
returnJson: {
|
|
487
|
+
type: "boolean",
|
|
488
|
+
description: "Return token in JSON response",
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
const routeConfig: SchemaProperty = {
|
|
494
|
+
type: "object",
|
|
495
|
+
properties: {
|
|
496
|
+
route: { type: "string", description: "Custom route path" },
|
|
497
|
+
isPublic: {
|
|
498
|
+
type: "boolean",
|
|
499
|
+
description: "Route is public (no auth required)",
|
|
500
|
+
},
|
|
501
|
+
enabled: { type: "boolean", description: "Route is enabled" },
|
|
502
|
+
},
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
const rateLimitRoute: SchemaProperty = {
|
|
506
|
+
type: "object",
|
|
507
|
+
properties: {
|
|
508
|
+
window: { type: "string", description: 'Time window (e.g., "1m", "1h")' },
|
|
509
|
+
max: { type: "number", description: "Maximum requests in window" },
|
|
510
|
+
blockDuration: {
|
|
511
|
+
type: "string",
|
|
512
|
+
description: "Block duration after limit exceeded",
|
|
513
|
+
},
|
|
514
|
+
},
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
const schema: JsonSchema = {
|
|
518
|
+
$id: "config.nucleus.json",
|
|
519
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
520
|
+
title: "Nucleus Config",
|
|
521
|
+
description: "Generated from NucleusConfigOptions interface in types.ts",
|
|
522
|
+
type: "object",
|
|
523
|
+
properties: {
|
|
524
|
+
$schema: { type: "string", description: "JSON Schema reference" },
|
|
525
|
+
appId: { type: "string", description: "Application ID", minLength: 1 },
|
|
526
|
+
mode: {
|
|
527
|
+
type: "string",
|
|
528
|
+
enum: ["development", "production"],
|
|
529
|
+
default: "development",
|
|
530
|
+
},
|
|
531
|
+
database: {
|
|
532
|
+
type: "object",
|
|
533
|
+
properties: {
|
|
534
|
+
url: {
|
|
535
|
+
type: "string",
|
|
536
|
+
description: "Environment variable name for database URL",
|
|
537
|
+
},
|
|
538
|
+
type: { type: "string", enum: ["postgres"], default: "postgres" },
|
|
539
|
+
isMultiTenant: { type: "boolean", default: false },
|
|
540
|
+
schemas: {
|
|
541
|
+
type: "array",
|
|
542
|
+
items: { type: "string" },
|
|
543
|
+
default: ["main"],
|
|
544
|
+
},
|
|
545
|
+
allowDataLoss: { type: "boolean", default: false },
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
redis: {
|
|
549
|
+
type: "object",
|
|
550
|
+
properties: {
|
|
551
|
+
url: {
|
|
552
|
+
type: "string",
|
|
553
|
+
description: "Environment variable name for Redis URL",
|
|
554
|
+
},
|
|
555
|
+
host: { type: "string" },
|
|
556
|
+
port: { type: "number" },
|
|
557
|
+
withDapr: { type: "boolean" },
|
|
558
|
+
stateStoreName: { type: "string" },
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
authentication: {
|
|
562
|
+
type: "object",
|
|
563
|
+
properties: {
|
|
564
|
+
enabled: { type: "boolean", default: false },
|
|
565
|
+
accessToken: tokenConfig,
|
|
566
|
+
refreshToken: tokenConfig,
|
|
567
|
+
sessionToken: tokenConfig,
|
|
568
|
+
login: {
|
|
569
|
+
type: "object",
|
|
570
|
+
properties: {
|
|
571
|
+
route: { type: "string" },
|
|
572
|
+
rememberMe: { type: "boolean" },
|
|
573
|
+
isPublic: { type: "boolean" },
|
|
574
|
+
enabled: { type: "boolean" },
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
register: routeConfig,
|
|
578
|
+
logout: routeConfig,
|
|
579
|
+
refresh: routeConfig,
|
|
580
|
+
passwordReset: {
|
|
581
|
+
type: "object",
|
|
582
|
+
properties: {
|
|
583
|
+
route: { type: "string" },
|
|
584
|
+
isPublic: { type: "boolean" },
|
|
585
|
+
enabled: { type: "boolean" },
|
|
586
|
+
redirectUrl: { type: "string" },
|
|
587
|
+
},
|
|
588
|
+
},
|
|
589
|
+
passwordChange: routeConfig,
|
|
590
|
+
sessions: {
|
|
591
|
+
type: "object",
|
|
592
|
+
properties: {
|
|
593
|
+
route: { type: "string" },
|
|
594
|
+
isPublic: { type: "boolean" },
|
|
595
|
+
enabled: { type: "boolean" },
|
|
596
|
+
maxActiveSessions: { type: "number" },
|
|
597
|
+
inactivityTimeout: { type: "string" },
|
|
598
|
+
allowMultipleDevices: { type: "boolean" },
|
|
599
|
+
trustNewDevices: { type: "boolean" },
|
|
600
|
+
notifyOnNewDevice: { type: "boolean" },
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
magicLink: {
|
|
604
|
+
type: "object",
|
|
605
|
+
properties: {
|
|
606
|
+
route: { type: "string" },
|
|
607
|
+
verifyRoute: { type: "string" },
|
|
608
|
+
isPublic: { type: "boolean" },
|
|
609
|
+
enabled: { type: "boolean" },
|
|
610
|
+
expiresIn: { type: "string" },
|
|
611
|
+
redirectUrl: { type: "string" },
|
|
612
|
+
},
|
|
613
|
+
},
|
|
614
|
+
me: {
|
|
615
|
+
type: "object",
|
|
616
|
+
properties: {
|
|
617
|
+
route: { type: "string" },
|
|
618
|
+
isPublic: { type: "boolean" },
|
|
619
|
+
enabled: { type: "boolean" },
|
|
620
|
+
includeProfile: { type: "boolean" },
|
|
621
|
+
includeAddresses: { type: "boolean" },
|
|
622
|
+
includePhones: { type: "boolean" },
|
|
623
|
+
includeFiles: { type: "boolean" },
|
|
624
|
+
},
|
|
625
|
+
},
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
authorization: {
|
|
629
|
+
type: "object",
|
|
630
|
+
properties: {
|
|
631
|
+
enabled: { type: "boolean", default: false },
|
|
632
|
+
autoSeedClaims: { type: "boolean", default: true },
|
|
633
|
+
skipTables: { type: "array", items: { type: "string" } },
|
|
634
|
+
skipColumns: { type: "array", items: { type: "string" } },
|
|
635
|
+
excludedPaths: { type: "array", items: { type: "string" } },
|
|
636
|
+
publicPaths: { type: "array", items: { type: "string" } },
|
|
637
|
+
godminEmail: { type: "string" },
|
|
638
|
+
godminPassword: { type: "string" },
|
|
639
|
+
},
|
|
640
|
+
},
|
|
641
|
+
audit: {
|
|
642
|
+
type: "object",
|
|
643
|
+
properties: {
|
|
644
|
+
enabled: { type: "boolean", default: false },
|
|
645
|
+
actions: {
|
|
646
|
+
type: "object",
|
|
647
|
+
properties: {
|
|
648
|
+
GET: { type: "boolean" },
|
|
649
|
+
INSERT: { type: "boolean" },
|
|
650
|
+
UPDATE: { type: "boolean" },
|
|
651
|
+
DELETE: { type: "boolean" },
|
|
652
|
+
TOGGLE: { type: "boolean" },
|
|
653
|
+
VERIFICATION: { type: "boolean" },
|
|
654
|
+
},
|
|
655
|
+
},
|
|
656
|
+
},
|
|
657
|
+
},
|
|
658
|
+
verification: {
|
|
659
|
+
type: "object",
|
|
660
|
+
properties: {
|
|
661
|
+
enabled: { type: "boolean" },
|
|
662
|
+
autoResetOnRejection: { type: "boolean" },
|
|
663
|
+
requireSignatureByDefault: { type: "boolean" },
|
|
664
|
+
diffTrackingEnabled: { type: "boolean" },
|
|
665
|
+
endpoints: {
|
|
666
|
+
type: "object",
|
|
667
|
+
properties: {
|
|
668
|
+
enabled: { type: "boolean" },
|
|
669
|
+
basePath: { type: "string" },
|
|
670
|
+
},
|
|
671
|
+
},
|
|
672
|
+
},
|
|
673
|
+
},
|
|
674
|
+
notification: {
|
|
675
|
+
type: "object",
|
|
676
|
+
properties: {
|
|
677
|
+
enabled: { type: "boolean" },
|
|
678
|
+
portalEnabled: { type: "boolean" },
|
|
679
|
+
emailEnabled: { type: "boolean" },
|
|
680
|
+
defaultChannel: { type: "string", enum: ["portal", "email", "both"] },
|
|
681
|
+
templateVariables: {
|
|
682
|
+
type: "object",
|
|
683
|
+
additionalProperties: { type: "string" },
|
|
684
|
+
},
|
|
685
|
+
},
|
|
686
|
+
},
|
|
687
|
+
rateLimit: {
|
|
688
|
+
type: "object",
|
|
689
|
+
properties: {
|
|
690
|
+
enabled: { type: "boolean" },
|
|
691
|
+
strategy: {
|
|
692
|
+
type: "string",
|
|
693
|
+
enum: ["sliding-window", "fixed-window", "token-bucket"],
|
|
694
|
+
},
|
|
695
|
+
keyPrefix: { type: "string" },
|
|
696
|
+
authRoutes: {
|
|
697
|
+
type: "object",
|
|
698
|
+
properties: {
|
|
699
|
+
window: { type: "string" },
|
|
700
|
+
max: { type: "number" },
|
|
701
|
+
login: rateLimitRoute,
|
|
702
|
+
register: rateLimitRoute,
|
|
703
|
+
passwordReset: rateLimitRoute,
|
|
704
|
+
magicLink: rateLimitRoute,
|
|
705
|
+
},
|
|
706
|
+
},
|
|
707
|
+
publicRoutes: {
|
|
708
|
+
type: "object",
|
|
709
|
+
properties: { window: { type: "string" }, max: { type: "number" } },
|
|
710
|
+
},
|
|
711
|
+
privateRoutes: {
|
|
712
|
+
type: "object",
|
|
713
|
+
properties: { window: { type: "string" }, max: { type: "number" } },
|
|
714
|
+
},
|
|
715
|
+
byIp: { type: "boolean" },
|
|
716
|
+
byUserId: { type: "boolean" },
|
|
717
|
+
byEndpoint: { type: "boolean" },
|
|
718
|
+
skipSuccessfulRequests: { type: "boolean" },
|
|
719
|
+
headers: {
|
|
720
|
+
type: "object",
|
|
721
|
+
properties: {
|
|
722
|
+
remaining: { type: "string" },
|
|
723
|
+
reset: { type: "string" },
|
|
724
|
+
limit: { type: "string" },
|
|
725
|
+
},
|
|
726
|
+
},
|
|
727
|
+
whitelist: { type: "array", items: { type: "string" } },
|
|
728
|
+
blacklist: { type: "array", items: { type: "string" } },
|
|
729
|
+
},
|
|
730
|
+
},
|
|
731
|
+
monitoring: {
|
|
732
|
+
type: "object",
|
|
733
|
+
properties: {
|
|
734
|
+
enabled: { type: "boolean" },
|
|
735
|
+
system: {
|
|
736
|
+
type: "object",
|
|
737
|
+
properties: {
|
|
738
|
+
enabled: { type: "boolean" },
|
|
739
|
+
collectInterval: { type: "string" },
|
|
740
|
+
metrics: {
|
|
741
|
+
type: "object",
|
|
742
|
+
properties: {
|
|
743
|
+
cpu: { type: "boolean" },
|
|
744
|
+
memory: { type: "boolean" },
|
|
745
|
+
disk: { type: "boolean" },
|
|
746
|
+
network: { type: "boolean" },
|
|
747
|
+
process: { type: "boolean" },
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
},
|
|
752
|
+
application: {
|
|
753
|
+
type: "object",
|
|
754
|
+
properties: {
|
|
755
|
+
enabled: { type: "boolean" },
|
|
756
|
+
metrics: {
|
|
757
|
+
type: "object",
|
|
758
|
+
properties: {
|
|
759
|
+
requests: { type: "boolean" },
|
|
760
|
+
responseTime: { type: "boolean" },
|
|
761
|
+
errors: { type: "boolean" },
|
|
762
|
+
rateLimits: { type: "boolean" },
|
|
763
|
+
},
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
|
+
},
|
|
767
|
+
database: {
|
|
768
|
+
type: "object",
|
|
769
|
+
properties: {
|
|
770
|
+
enabled: { type: "boolean" },
|
|
771
|
+
metrics: {
|
|
772
|
+
type: "object",
|
|
773
|
+
properties: {
|
|
774
|
+
connections: { type: "boolean" },
|
|
775
|
+
queryTime: { type: "boolean" },
|
|
776
|
+
slowQueryThreshold: { type: "string" },
|
|
777
|
+
},
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
},
|
|
781
|
+
redis: {
|
|
782
|
+
type: "object",
|
|
783
|
+
properties: { enabled: { type: "boolean" } },
|
|
784
|
+
},
|
|
785
|
+
persistence: {
|
|
786
|
+
type: "object",
|
|
787
|
+
properties: {
|
|
788
|
+
enabled: { type: "boolean" },
|
|
789
|
+
flushInterval: { type: "string" },
|
|
790
|
+
retentionDays: { type: "number" },
|
|
791
|
+
},
|
|
792
|
+
},
|
|
793
|
+
alerts: {
|
|
794
|
+
type: "object",
|
|
795
|
+
properties: {
|
|
796
|
+
enabled: { type: "boolean" },
|
|
797
|
+
email: {
|
|
798
|
+
type: "object",
|
|
799
|
+
properties: {
|
|
800
|
+
enabled: { type: "boolean" },
|
|
801
|
+
recipients: { type: "array", items: { type: "string" } },
|
|
802
|
+
},
|
|
803
|
+
},
|
|
804
|
+
thresholds: {
|
|
805
|
+
type: "object",
|
|
806
|
+
properties: {
|
|
807
|
+
cpuPercent: { type: "number" },
|
|
808
|
+
memoryPercent: { type: "number" },
|
|
809
|
+
diskPercent: { type: "number" },
|
|
810
|
+
errorRatePercent: { type: "number" },
|
|
811
|
+
responseTimeMs: { type: "number" },
|
|
812
|
+
rateLimitBlocksPerMinute: { type: "number" },
|
|
813
|
+
},
|
|
814
|
+
},
|
|
815
|
+
cooldown: { type: "string" },
|
|
816
|
+
},
|
|
817
|
+
},
|
|
818
|
+
endpoints: {
|
|
819
|
+
type: "object",
|
|
820
|
+
properties: {
|
|
821
|
+
enabled: { type: "boolean" },
|
|
822
|
+
basePath: { type: "string" },
|
|
823
|
+
stream: {
|
|
824
|
+
type: "object",
|
|
825
|
+
properties: {
|
|
826
|
+
enabled: { type: "boolean" },
|
|
827
|
+
path: { type: "string" },
|
|
828
|
+
interval: { type: "string" },
|
|
829
|
+
},
|
|
830
|
+
},
|
|
831
|
+
snapshot: {
|
|
832
|
+
type: "object",
|
|
833
|
+
properties: {
|
|
834
|
+
enabled: { type: "boolean" },
|
|
835
|
+
path: { type: "string" },
|
|
836
|
+
},
|
|
837
|
+
},
|
|
838
|
+
history: {
|
|
839
|
+
type: "object",
|
|
840
|
+
properties: {
|
|
841
|
+
enabled: { type: "boolean" },
|
|
842
|
+
path: { type: "string" },
|
|
843
|
+
maxMinutes: { type: "number" },
|
|
844
|
+
},
|
|
845
|
+
},
|
|
846
|
+
alerts: {
|
|
847
|
+
type: "object",
|
|
848
|
+
properties: {
|
|
849
|
+
enabled: { type: "boolean" },
|
|
850
|
+
path: { type: "string" },
|
|
851
|
+
},
|
|
852
|
+
},
|
|
853
|
+
},
|
|
854
|
+
},
|
|
855
|
+
},
|
|
856
|
+
},
|
|
857
|
+
email: {
|
|
858
|
+
type: "object",
|
|
859
|
+
properties: {
|
|
860
|
+
gmail: {
|
|
861
|
+
type: "object",
|
|
862
|
+
properties: {
|
|
863
|
+
enabled: { type: "boolean" },
|
|
864
|
+
json_file_path: { type: "string" },
|
|
865
|
+
from_email: { type: "string" },
|
|
866
|
+
from_name: { type: "string" },
|
|
867
|
+
},
|
|
868
|
+
},
|
|
869
|
+
},
|
|
870
|
+
},
|
|
871
|
+
storage: {
|
|
872
|
+
type: "object",
|
|
873
|
+
properties: {
|
|
874
|
+
enabled: { type: "boolean" },
|
|
875
|
+
basePath: { type: "string" },
|
|
876
|
+
maxFileSizeBytes: { type: "number" },
|
|
877
|
+
allowedMimeTypes: { type: "array", items: { type: "string" } },
|
|
878
|
+
blockedMimeTypes: { type: "array", items: { type: "string" } },
|
|
879
|
+
cdn: {
|
|
880
|
+
type: "object",
|
|
881
|
+
properties: {
|
|
882
|
+
enabled: { type: "boolean" },
|
|
883
|
+
basePath: { type: "string" },
|
|
884
|
+
cacheMaxAge: { type: "number" },
|
|
885
|
+
enableRangeRequests: { type: "boolean" },
|
|
886
|
+
enableEtag: { type: "boolean" },
|
|
887
|
+
corsOrigins: { type: "array", items: { type: "string" } },
|
|
888
|
+
},
|
|
889
|
+
},
|
|
890
|
+
formData: {
|
|
891
|
+
type: "object",
|
|
892
|
+
properties: {
|
|
893
|
+
filesField: { type: "string" },
|
|
894
|
+
dataField: { type: "string" },
|
|
895
|
+
maxFiles: { type: "number" },
|
|
896
|
+
},
|
|
897
|
+
},
|
|
898
|
+
},
|
|
899
|
+
},
|
|
900
|
+
entities: {
|
|
901
|
+
type: "array",
|
|
902
|
+
description: "Entity/table definitions",
|
|
903
|
+
items: { $ref: "table.schema.json" },
|
|
904
|
+
},
|
|
905
|
+
},
|
|
906
|
+
required: ["appId", "entities"],
|
|
907
|
+
additionalProperties: false,
|
|
908
|
+
};
|
|
909
|
+
|
|
910
|
+
return schema;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
function generateTablesArraySchema(): JsonSchema {
|
|
914
|
+
return {
|
|
915
|
+
$id: "nucleus.tables.schema.json",
|
|
916
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
917
|
+
title: "Nucleus Tables Array",
|
|
918
|
+
description: "Array of Nucleus table definitions",
|
|
919
|
+
type: "object",
|
|
920
|
+
properties: {
|
|
921
|
+
$schema: { type: "string" },
|
|
922
|
+
tables: {
|
|
923
|
+
type: "array",
|
|
924
|
+
items: { $ref: "table.schema.json" },
|
|
925
|
+
},
|
|
926
|
+
},
|
|
927
|
+
required: ["tables"],
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
function main() {
|
|
932
|
+
console.log("🔄 Reading types.ts...");
|
|
933
|
+
const content = parseTypesFile();
|
|
934
|
+
|
|
935
|
+
console.log("📝 Generating table.schema.json...");
|
|
936
|
+
const tableSchema = generateNucleusTableSchema(content);
|
|
937
|
+
fs.writeFileSync(
|
|
938
|
+
path.join(SCHEMAS_DIR, "table.schema.json"),
|
|
939
|
+
JSON.stringify(tableSchema, null, 2),
|
|
940
|
+
);
|
|
941
|
+
|
|
942
|
+
console.log("📝 Generating config.nucleus.json...");
|
|
943
|
+
const configSchema = generateNucleusConfigSchema(content);
|
|
944
|
+
fs.writeFileSync(
|
|
945
|
+
path.join(SCHEMAS_DIR, "config.nucleus.json"),
|
|
946
|
+
JSON.stringify(configSchema, null, 2),
|
|
947
|
+
);
|
|
948
|
+
|
|
949
|
+
console.log("📝 Generating nucleus.tables.schema.json...");
|
|
950
|
+
const tablesSchema = generateTablesArraySchema();
|
|
951
|
+
fs.writeFileSync(
|
|
952
|
+
path.join(SCHEMAS_DIR, "nucleus.tables.schema.json"),
|
|
953
|
+
JSON.stringify(tablesSchema, null, 2),
|
|
954
|
+
);
|
|
955
|
+
|
|
956
|
+
console.log("✅ Schemas generated successfully!");
|
|
957
|
+
console.log(` - ${SCHEMAS_DIR}/table.schema.json`);
|
|
958
|
+
console.log(` - ${SCHEMAS_DIR}/config.nucleus.json`);
|
|
959
|
+
console.log(` - ${SCHEMAS_DIR}/nucleus.tables.schema.json`);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
main();
|