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,907 @@
|
|
|
1
|
+
import type { NucleusConfigOptions, NucleusTable, PaginationMeta, StandardQueryParams, StandardReturn } from "../../types";
|
|
2
|
+
import type { HttpMethod } from "../ServerFetch/types";
|
|
3
|
+
import type { SystemTables } from "./system-tables";
|
|
4
|
+
export type { HttpMethod };
|
|
5
|
+
export interface ApiResponse<TSuccess, TError> {
|
|
6
|
+
isSuccess: boolean;
|
|
7
|
+
data?: TSuccess;
|
|
8
|
+
errors?: TError;
|
|
9
|
+
code?: number | null;
|
|
10
|
+
message?: string;
|
|
11
|
+
}
|
|
12
|
+
export type EndpointMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
13
|
+
export interface EndpointDefinition<TPayload = unknown, TSuccess = unknown, TError = unknown> {
|
|
14
|
+
method: EndpointMethod;
|
|
15
|
+
path: string;
|
|
16
|
+
isPublic?: boolean;
|
|
17
|
+
isFormData?: boolean;
|
|
18
|
+
_payload: TPayload;
|
|
19
|
+
_success: TSuccess;
|
|
20
|
+
_error: TError;
|
|
21
|
+
}
|
|
22
|
+
export type BaseErrorResponse = {
|
|
23
|
+
message: string;
|
|
24
|
+
code?: string;
|
|
25
|
+
details?: unknown;
|
|
26
|
+
};
|
|
27
|
+
export type ListResponse<T> = StandardReturn<{
|
|
28
|
+
items: T[];
|
|
29
|
+
meta: PaginationMeta;
|
|
30
|
+
}>;
|
|
31
|
+
export type SingleResponse<T> = StandardReturn<T | null>;
|
|
32
|
+
export type MutationResponse<T> = StandardReturn<T>;
|
|
33
|
+
export type DeleteResponse = StandardReturn<null>;
|
|
34
|
+
type EntityMethodMap = {
|
|
35
|
+
GET: "GET";
|
|
36
|
+
POST: "ADD";
|
|
37
|
+
PUT: "UPDATE";
|
|
38
|
+
PATCH: "PATCH";
|
|
39
|
+
DELETE: "DELETE";
|
|
40
|
+
};
|
|
41
|
+
type Singularize<S extends string> = S extends `${infer Base}ies` ? `${Base}y` : S extends `${infer Base}ses` ? `${Base}s` : S extends `${infer Base}s` ? Base : S;
|
|
42
|
+
export type EntityEndpointKey<TTableName extends string, TMethod extends keyof EntityMethodMap> = TMethod extends "GET" ? `GET_${Uppercase<TTableName>}` : `${EntityMethodMap[TMethod]}_${Uppercase<Singularize<TTableName>>}`;
|
|
43
|
+
export type BulkEndpointKey<TTableName extends string, TMethod extends "POST" | "PUT" | "DELETE"> = `BULK_${EntityMethodMap[TMethod]}_${Uppercase<TTableName>}`;
|
|
44
|
+
export interface LoginPayload {
|
|
45
|
+
email: string;
|
|
46
|
+
password: string;
|
|
47
|
+
rememberMe?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface UserData {
|
|
50
|
+
id: string;
|
|
51
|
+
email: string;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
updatedAt: string;
|
|
54
|
+
isActive: boolean;
|
|
55
|
+
createdBy: string | null;
|
|
56
|
+
updatedBy: string | null;
|
|
57
|
+
verifiedAt: string | null;
|
|
58
|
+
lastLoginAt: string | null;
|
|
59
|
+
loginCount: number;
|
|
60
|
+
isLocked: boolean;
|
|
61
|
+
lockedUntil: string | null;
|
|
62
|
+
failedLoginAttempts: number;
|
|
63
|
+
isGod: boolean;
|
|
64
|
+
profile: Record<string, unknown>;
|
|
65
|
+
[key: string]: unknown;
|
|
66
|
+
}
|
|
67
|
+
export type LoginSuccessData = {
|
|
68
|
+
user: UserData;
|
|
69
|
+
accessToken?: string;
|
|
70
|
+
sessionId?: string;
|
|
71
|
+
};
|
|
72
|
+
export type LoginSuccess = StandardReturn<LoginSuccessData>;
|
|
73
|
+
export interface RegisterPayload {
|
|
74
|
+
email: string;
|
|
75
|
+
password: string;
|
|
76
|
+
}
|
|
77
|
+
export type RegisterSuccessData = {
|
|
78
|
+
user: UserData;
|
|
79
|
+
accessToken?: string;
|
|
80
|
+
sessionId?: string;
|
|
81
|
+
};
|
|
82
|
+
export type RegisterSuccess = StandardReturn<RegisterSuccessData>;
|
|
83
|
+
export type RefreshSuccessData = {
|
|
84
|
+
accessToken: string;
|
|
85
|
+
sessionId?: string;
|
|
86
|
+
};
|
|
87
|
+
export type RefreshSuccess = StandardReturn<RefreshSuccessData>;
|
|
88
|
+
export type MeResponse = StandardReturn<UserData>;
|
|
89
|
+
export interface PasswordChangePayload {
|
|
90
|
+
currentPassword: string;
|
|
91
|
+
newPassword: string;
|
|
92
|
+
}
|
|
93
|
+
export interface PasswordSetPayload {
|
|
94
|
+
newPassword: string;
|
|
95
|
+
userId: string;
|
|
96
|
+
}
|
|
97
|
+
export interface PasswordResetRequestPayload {
|
|
98
|
+
email: string;
|
|
99
|
+
}
|
|
100
|
+
export interface PasswordResetConfirmPayload {
|
|
101
|
+
token: string;
|
|
102
|
+
newPassword: string;
|
|
103
|
+
confirmPassword: string;
|
|
104
|
+
}
|
|
105
|
+
export type PasswordResetResponse = StandardReturn<{
|
|
106
|
+
message: string;
|
|
107
|
+
}>;
|
|
108
|
+
export interface MagicLinkPayload {
|
|
109
|
+
email: string;
|
|
110
|
+
}
|
|
111
|
+
export interface InvitePayload {
|
|
112
|
+
email: string;
|
|
113
|
+
}
|
|
114
|
+
export type InviteResponse = StandardReturn<UserData>;
|
|
115
|
+
export interface EmailVerificationPayload {
|
|
116
|
+
token: string;
|
|
117
|
+
}
|
|
118
|
+
export interface EmailVerificationResponse {
|
|
119
|
+
success: boolean;
|
|
120
|
+
message: string;
|
|
121
|
+
data?: {
|
|
122
|
+
redirectUrl: string;
|
|
123
|
+
verified: boolean;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export interface ResendVerificationPayload {
|
|
127
|
+
email: string;
|
|
128
|
+
}
|
|
129
|
+
export interface ResendVerificationResponse {
|
|
130
|
+
success: boolean;
|
|
131
|
+
message: string;
|
|
132
|
+
data?: {
|
|
133
|
+
cooldownSeconds?: number;
|
|
134
|
+
cooldownRemaining?: number;
|
|
135
|
+
canResendAt?: string;
|
|
136
|
+
attemptsRemaining?: number;
|
|
137
|
+
maxAttemptsReached?: boolean;
|
|
138
|
+
attemptsUsed?: number;
|
|
139
|
+
maxAttempts?: number;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
export interface SessionInfo {
|
|
143
|
+
id: string;
|
|
144
|
+
userId: string;
|
|
145
|
+
deviceFingerprint?: string;
|
|
146
|
+
deviceName?: string;
|
|
147
|
+
deviceType?: string;
|
|
148
|
+
browserName?: string;
|
|
149
|
+
browserVersion?: string;
|
|
150
|
+
osName?: string;
|
|
151
|
+
osVersion?: string;
|
|
152
|
+
ipAddress?: string;
|
|
153
|
+
locationCountry?: string;
|
|
154
|
+
locationCity?: string;
|
|
155
|
+
locationCoordinates?: string;
|
|
156
|
+
lastActivityAt?: string;
|
|
157
|
+
createdAt?: string;
|
|
158
|
+
expiresAt?: string;
|
|
159
|
+
revokedAt?: string;
|
|
160
|
+
revokedReason?: string;
|
|
161
|
+
isCurrent?: boolean;
|
|
162
|
+
loginMethod?: string;
|
|
163
|
+
trustScore?: number;
|
|
164
|
+
approvalStatus?: "approved" | "pending" | "rejected";
|
|
165
|
+
approvalToken?: string;
|
|
166
|
+
approvalRequestedAt?: string;
|
|
167
|
+
approvalRespondedAt?: string;
|
|
168
|
+
}
|
|
169
|
+
export type SessionsListResponse = StandardReturn<{
|
|
170
|
+
sessions: SessionInfo[];
|
|
171
|
+
currentSessionId?: string;
|
|
172
|
+
totalCount: number;
|
|
173
|
+
}>;
|
|
174
|
+
export type SessionCurrentResponse = StandardReturn<SessionInfo>;
|
|
175
|
+
export type SessionRevokePayload = {
|
|
176
|
+
_sessionId: string;
|
|
177
|
+
reason?: string;
|
|
178
|
+
};
|
|
179
|
+
export type SessionRevokeResponse = StandardReturn<{
|
|
180
|
+
message: string;
|
|
181
|
+
}>;
|
|
182
|
+
export type SessionRevokeAllPayload = {
|
|
183
|
+
excludeCurrent?: boolean;
|
|
184
|
+
reason?: string;
|
|
185
|
+
};
|
|
186
|
+
export type SessionRevokeAllResponse = StandardReturn<{
|
|
187
|
+
message: string;
|
|
188
|
+
}>;
|
|
189
|
+
export type SessionStatsResponse = StandardReturn<{
|
|
190
|
+
activeSessions: number;
|
|
191
|
+
uniqueDevices: number;
|
|
192
|
+
uniqueIpAddresses: number;
|
|
193
|
+
}>;
|
|
194
|
+
export type SessionsPendingResponse = StandardReturn<{
|
|
195
|
+
sessions: (SessionInfo & {
|
|
196
|
+
approvalStatus?: string;
|
|
197
|
+
approvalRequestedAt?: string;
|
|
198
|
+
})[];
|
|
199
|
+
totalCount: number;
|
|
200
|
+
}>;
|
|
201
|
+
export type SessionApprovePayload = {
|
|
202
|
+
token: string;
|
|
203
|
+
};
|
|
204
|
+
export type SessionApproveResponse = StandardReturn<{
|
|
205
|
+
message: string;
|
|
206
|
+
}>;
|
|
207
|
+
export type SessionRejectPayload = {
|
|
208
|
+
token: string;
|
|
209
|
+
};
|
|
210
|
+
export type SessionRejectResponse = StandardReturn<{
|
|
211
|
+
message: string;
|
|
212
|
+
}>;
|
|
213
|
+
export type CaptchaGeneratePayload = {
|
|
214
|
+
type?: "math" | "image" | "puzzle" | "text";
|
|
215
|
+
difficulty?: "easy" | "medium" | "hard";
|
|
216
|
+
};
|
|
217
|
+
export type CaptchaGenerateResponse = StandardReturn<{
|
|
218
|
+
challengeId: string;
|
|
219
|
+
type: "math" | "image" | "puzzle" | "text";
|
|
220
|
+
question: string;
|
|
221
|
+
imageData?: string;
|
|
222
|
+
puzzleData?: {
|
|
223
|
+
pieces: Array<{
|
|
224
|
+
id: number;
|
|
225
|
+
x: number;
|
|
226
|
+
y: number;
|
|
227
|
+
}>;
|
|
228
|
+
};
|
|
229
|
+
expiresAt: number;
|
|
230
|
+
}>;
|
|
231
|
+
export type CaptchaValidatePayload = {
|
|
232
|
+
challengeId: string;
|
|
233
|
+
answer: string;
|
|
234
|
+
};
|
|
235
|
+
export type CaptchaValidateResponse = StandardReturn<{
|
|
236
|
+
valid: boolean;
|
|
237
|
+
message?: string;
|
|
238
|
+
attemptsRemaining?: number;
|
|
239
|
+
}>;
|
|
240
|
+
export type AuthFeatureConfig = {
|
|
241
|
+
route?: string;
|
|
242
|
+
isPublic?: boolean;
|
|
243
|
+
enabled?: boolean;
|
|
244
|
+
};
|
|
245
|
+
export type AuthenticationConfig = {
|
|
246
|
+
enabled?: boolean;
|
|
247
|
+
login?: AuthFeatureConfig & {
|
|
248
|
+
rememberMe?: boolean;
|
|
249
|
+
};
|
|
250
|
+
register?: AuthFeatureConfig;
|
|
251
|
+
logout?: AuthFeatureConfig;
|
|
252
|
+
refresh?: AuthFeatureConfig;
|
|
253
|
+
me?: AuthFeatureConfig & {
|
|
254
|
+
includeProfile?: boolean;
|
|
255
|
+
includeAddresses?: boolean;
|
|
256
|
+
includePhones?: boolean;
|
|
257
|
+
includeFiles?: boolean;
|
|
258
|
+
};
|
|
259
|
+
passwordChange?: AuthFeatureConfig;
|
|
260
|
+
passwordSet?: AuthFeatureConfig;
|
|
261
|
+
passwordReset?: AuthFeatureConfig & {
|
|
262
|
+
redirectUrl?: string;
|
|
263
|
+
};
|
|
264
|
+
sessions?: AuthFeatureConfig & {
|
|
265
|
+
maxActiveSessions?: number;
|
|
266
|
+
inactivityTimeout?: string;
|
|
267
|
+
allowMultipleDevices?: boolean;
|
|
268
|
+
trustNewDevices?: boolean;
|
|
269
|
+
notifyOnNewDevice?: boolean;
|
|
270
|
+
};
|
|
271
|
+
magicLink?: AuthFeatureConfig & {
|
|
272
|
+
verifyRoute?: string;
|
|
273
|
+
expiresIn?: string;
|
|
274
|
+
redirectUrl?: string;
|
|
275
|
+
};
|
|
276
|
+
invite?: AuthFeatureConfig & {
|
|
277
|
+
tokenExpiresIn?: string;
|
|
278
|
+
redirectUrl?: string;
|
|
279
|
+
};
|
|
280
|
+
emailVerification?: AuthFeatureConfig & {
|
|
281
|
+
resendRoute?: string;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
export declare const AUTH_ENDPOINT_CONFIGS: {
|
|
285
|
+
login: {
|
|
286
|
+
key: "LOGIN";
|
|
287
|
+
method: "POST";
|
|
288
|
+
defaultRoute: string;
|
|
289
|
+
defaultIsPublic: boolean;
|
|
290
|
+
_payload: LoginPayload;
|
|
291
|
+
_success: LoginSuccess;
|
|
292
|
+
_error: BaseErrorResponse;
|
|
293
|
+
};
|
|
294
|
+
register: {
|
|
295
|
+
key: "REGISTER";
|
|
296
|
+
method: "POST";
|
|
297
|
+
defaultRoute: string;
|
|
298
|
+
defaultIsPublic: boolean;
|
|
299
|
+
_payload: RegisterPayload;
|
|
300
|
+
_success: RegisterSuccess;
|
|
301
|
+
_error: BaseErrorResponse;
|
|
302
|
+
};
|
|
303
|
+
logout: {
|
|
304
|
+
key: "LOGOUT";
|
|
305
|
+
method: "POST";
|
|
306
|
+
defaultRoute: string;
|
|
307
|
+
defaultIsPublic: boolean;
|
|
308
|
+
_payload: undefined;
|
|
309
|
+
_success: {
|
|
310
|
+
message: string;
|
|
311
|
+
};
|
|
312
|
+
_error: BaseErrorResponse;
|
|
313
|
+
};
|
|
314
|
+
refresh: {
|
|
315
|
+
key: "REFRESH";
|
|
316
|
+
method: "POST";
|
|
317
|
+
defaultRoute: string;
|
|
318
|
+
defaultIsPublic: boolean;
|
|
319
|
+
_payload: undefined;
|
|
320
|
+
_success: RefreshSuccess;
|
|
321
|
+
_error: BaseErrorResponse;
|
|
322
|
+
};
|
|
323
|
+
me: {
|
|
324
|
+
key: "ME";
|
|
325
|
+
method: "GET";
|
|
326
|
+
defaultRoute: string;
|
|
327
|
+
defaultIsPublic: boolean;
|
|
328
|
+
_payload: undefined;
|
|
329
|
+
_success: MeSuccessResponse;
|
|
330
|
+
_error: BaseErrorResponse;
|
|
331
|
+
};
|
|
332
|
+
passwordChange: {
|
|
333
|
+
key: "PASSWORD_CHANGE";
|
|
334
|
+
method: "POST";
|
|
335
|
+
defaultRoute: string;
|
|
336
|
+
defaultIsPublic: boolean;
|
|
337
|
+
_payload: PasswordChangePayload;
|
|
338
|
+
_success: {
|
|
339
|
+
message: string;
|
|
340
|
+
};
|
|
341
|
+
_error: BaseErrorResponse;
|
|
342
|
+
};
|
|
343
|
+
passwordSet: {
|
|
344
|
+
key: "PASSWORD_SET";
|
|
345
|
+
method: "POST";
|
|
346
|
+
defaultRoute: string;
|
|
347
|
+
defaultIsPublic: boolean;
|
|
348
|
+
_payload: PasswordSetPayload;
|
|
349
|
+
_success: {
|
|
350
|
+
message: string;
|
|
351
|
+
};
|
|
352
|
+
_error: BaseErrorResponse;
|
|
353
|
+
};
|
|
354
|
+
passwordReset: {
|
|
355
|
+
key: "PASSWORD_RESET_REQUEST";
|
|
356
|
+
method: "POST";
|
|
357
|
+
defaultRoute: string;
|
|
358
|
+
defaultIsPublic: boolean;
|
|
359
|
+
subEndpoints: ({
|
|
360
|
+
key: "PASSWORD_RESET_REQUEST";
|
|
361
|
+
method: "POST";
|
|
362
|
+
suffix: string;
|
|
363
|
+
_payload: PasswordResetRequestPayload;
|
|
364
|
+
_success: PasswordResetResponse;
|
|
365
|
+
_error: BaseErrorResponse;
|
|
366
|
+
} | {
|
|
367
|
+
key: "PASSWORD_RESET_CONFIRM";
|
|
368
|
+
method: "POST";
|
|
369
|
+
suffix: string;
|
|
370
|
+
_payload: PasswordResetConfirmPayload;
|
|
371
|
+
_success: PasswordResetResponse;
|
|
372
|
+
_error: BaseErrorResponse;
|
|
373
|
+
})[];
|
|
374
|
+
};
|
|
375
|
+
sessions: {
|
|
376
|
+
key: "SESSIONS";
|
|
377
|
+
method: "GET";
|
|
378
|
+
defaultRoute: string;
|
|
379
|
+
defaultIsPublic: boolean;
|
|
380
|
+
subEndpoints: ({
|
|
381
|
+
key: "SESSIONS";
|
|
382
|
+
method: "GET";
|
|
383
|
+
suffix: string;
|
|
384
|
+
_payload: undefined;
|
|
385
|
+
_success: SessionsListResponse;
|
|
386
|
+
_error: BaseErrorResponse;
|
|
387
|
+
} | {
|
|
388
|
+
key: "SESSIONS_CURRENT";
|
|
389
|
+
method: "GET";
|
|
390
|
+
suffix: string;
|
|
391
|
+
_payload: undefined;
|
|
392
|
+
_success: SessionCurrentResponse;
|
|
393
|
+
_error: BaseErrorResponse;
|
|
394
|
+
} | {
|
|
395
|
+
key: "SESSIONS_STATS";
|
|
396
|
+
method: "GET";
|
|
397
|
+
suffix: string;
|
|
398
|
+
_payload: undefined;
|
|
399
|
+
_success: SessionStatsResponse;
|
|
400
|
+
_error: BaseErrorResponse;
|
|
401
|
+
} | {
|
|
402
|
+
key: "SESSIONS_PENDING";
|
|
403
|
+
method: "GET";
|
|
404
|
+
suffix: string;
|
|
405
|
+
_payload: undefined;
|
|
406
|
+
_success: SessionsPendingResponse;
|
|
407
|
+
_error: BaseErrorResponse;
|
|
408
|
+
} | {
|
|
409
|
+
key: "SESSIONS_REVOKE";
|
|
410
|
+
method: "DELETE";
|
|
411
|
+
suffix: string;
|
|
412
|
+
_payload: SessionRevokePayload;
|
|
413
|
+
_success: SessionRevokeResponse;
|
|
414
|
+
_error: BaseErrorResponse;
|
|
415
|
+
} | {
|
|
416
|
+
key: "SESSIONS_REVOKE_ALL";
|
|
417
|
+
method: "DELETE";
|
|
418
|
+
suffix: string;
|
|
419
|
+
_payload: SessionRevokeAllPayload;
|
|
420
|
+
_success: SessionRevokeAllResponse;
|
|
421
|
+
_error: BaseErrorResponse;
|
|
422
|
+
} | {
|
|
423
|
+
key: "SESSIONS_APPROVE";
|
|
424
|
+
method: "POST";
|
|
425
|
+
suffix: string;
|
|
426
|
+
_payload: SessionApprovePayload;
|
|
427
|
+
_success: SessionApproveResponse;
|
|
428
|
+
_error: BaseErrorResponse;
|
|
429
|
+
} | {
|
|
430
|
+
key: "SESSIONS_REJECT";
|
|
431
|
+
method: "POST";
|
|
432
|
+
suffix: string;
|
|
433
|
+
_payload: SessionRejectPayload;
|
|
434
|
+
_success: SessionRejectResponse;
|
|
435
|
+
_error: BaseErrorResponse;
|
|
436
|
+
})[];
|
|
437
|
+
};
|
|
438
|
+
magicLink: {
|
|
439
|
+
key: "MAGIC_LINK";
|
|
440
|
+
method: "POST";
|
|
441
|
+
defaultRoute: string;
|
|
442
|
+
defaultIsPublic: boolean;
|
|
443
|
+
subEndpoints: ({
|
|
444
|
+
key: "MAGIC_LINK";
|
|
445
|
+
method: "POST";
|
|
446
|
+
suffix: string;
|
|
447
|
+
_payload: MagicLinkPayload;
|
|
448
|
+
_success: StandardReturn<{
|
|
449
|
+
message: string;
|
|
450
|
+
}>;
|
|
451
|
+
_error: BaseErrorResponse;
|
|
452
|
+
routeKey?: undefined;
|
|
453
|
+
} | {
|
|
454
|
+
key: "MAGIC_LINK_VERIFY";
|
|
455
|
+
method: "GET";
|
|
456
|
+
suffix: string;
|
|
457
|
+
routeKey: "verifyRoute";
|
|
458
|
+
_payload: {
|
|
459
|
+
token: string;
|
|
460
|
+
};
|
|
461
|
+
_success: LoginSuccess;
|
|
462
|
+
_error: BaseErrorResponse;
|
|
463
|
+
})[];
|
|
464
|
+
};
|
|
465
|
+
invite: {
|
|
466
|
+
key: "INVITE";
|
|
467
|
+
method: "POST";
|
|
468
|
+
defaultRoute: string;
|
|
469
|
+
defaultIsPublic: boolean;
|
|
470
|
+
_payload: InvitePayload;
|
|
471
|
+
_success: InviteResponse;
|
|
472
|
+
_error: BaseErrorResponse;
|
|
473
|
+
};
|
|
474
|
+
emailVerification: {
|
|
475
|
+
key: "VERIFY_EMAIL";
|
|
476
|
+
method: "GET";
|
|
477
|
+
defaultRoute: string;
|
|
478
|
+
defaultIsPublic: boolean;
|
|
479
|
+
subEndpoints: ({
|
|
480
|
+
key: "VERIFY_EMAIL";
|
|
481
|
+
method: "GET";
|
|
482
|
+
suffix: string;
|
|
483
|
+
_payload: EmailVerificationPayload;
|
|
484
|
+
_success: EmailVerificationResponse;
|
|
485
|
+
_error: BaseErrorResponse;
|
|
486
|
+
routeKey?: undefined;
|
|
487
|
+
defaultRoute?: undefined;
|
|
488
|
+
} | {
|
|
489
|
+
key: "RESEND_VERIFICATION";
|
|
490
|
+
method: "POST";
|
|
491
|
+
suffix: string;
|
|
492
|
+
routeKey: "resendRoute";
|
|
493
|
+
defaultRoute: "/resend-verification";
|
|
494
|
+
_payload: ResendVerificationPayload;
|
|
495
|
+
_success: ResendVerificationResponse;
|
|
496
|
+
_error: BaseErrorResponse;
|
|
497
|
+
})[];
|
|
498
|
+
};
|
|
499
|
+
captcha: {
|
|
500
|
+
key: "CAPTCHA";
|
|
501
|
+
method: "GET";
|
|
502
|
+
defaultRoute: string;
|
|
503
|
+
defaultIsPublic: boolean;
|
|
504
|
+
subEndpoints: ({
|
|
505
|
+
key: "CAPTCHA_GENERATE";
|
|
506
|
+
method: "GET";
|
|
507
|
+
suffix: string;
|
|
508
|
+
_payload: CaptchaGeneratePayload;
|
|
509
|
+
_success: CaptchaGenerateResponse;
|
|
510
|
+
_error: BaseErrorResponse;
|
|
511
|
+
} | {
|
|
512
|
+
key: "CAPTCHA_VALIDATE";
|
|
513
|
+
method: "POST";
|
|
514
|
+
suffix: string;
|
|
515
|
+
_payload: CaptchaValidatePayload;
|
|
516
|
+
_success: CaptchaValidateResponse;
|
|
517
|
+
_error: BaseErrorResponse;
|
|
518
|
+
})[];
|
|
519
|
+
};
|
|
520
|
+
};
|
|
521
|
+
export type AuthFeatureKey = keyof typeof AUTH_ENDPOINT_CONFIGS;
|
|
522
|
+
type AuthEndpointMap = {
|
|
523
|
+
login: {
|
|
524
|
+
key: "LOGIN";
|
|
525
|
+
definition: EndpointDefinition<LoginPayload, LoginSuccess, BaseErrorResponse>;
|
|
526
|
+
};
|
|
527
|
+
register: {
|
|
528
|
+
key: "REGISTER";
|
|
529
|
+
definition: EndpointDefinition<RegisterPayload, RegisterSuccess, BaseErrorResponse>;
|
|
530
|
+
};
|
|
531
|
+
logout: {
|
|
532
|
+
key: "LOGOUT";
|
|
533
|
+
definition: EndpointDefinition<undefined, {
|
|
534
|
+
message: string;
|
|
535
|
+
}, BaseErrorResponse>;
|
|
536
|
+
};
|
|
537
|
+
refresh: {
|
|
538
|
+
key: "REFRESH";
|
|
539
|
+
definition: EndpointDefinition<undefined, RefreshSuccess, BaseErrorResponse>;
|
|
540
|
+
};
|
|
541
|
+
me: {
|
|
542
|
+
key: "ME";
|
|
543
|
+
definition: EndpointDefinition<undefined, Record<string, unknown>, BaseErrorResponse>;
|
|
544
|
+
};
|
|
545
|
+
passwordChange: {
|
|
546
|
+
key: "PASSWORD_CHANGE";
|
|
547
|
+
definition: EndpointDefinition<PasswordChangePayload, {
|
|
548
|
+
message: string;
|
|
549
|
+
}, BaseErrorResponse>;
|
|
550
|
+
};
|
|
551
|
+
passwordSet: {
|
|
552
|
+
key: "PASSWORD_SET";
|
|
553
|
+
definition: EndpointDefinition<PasswordSetPayload, {
|
|
554
|
+
message: string;
|
|
555
|
+
}, BaseErrorResponse>;
|
|
556
|
+
};
|
|
557
|
+
passwordReset: {
|
|
558
|
+
keys: ["PASSWORD_RESET_REQUEST", "PASSWORD_RESET_CONFIRM"];
|
|
559
|
+
definitions: {
|
|
560
|
+
PASSWORD_RESET_REQUEST: EndpointDefinition<PasswordResetRequestPayload, PasswordResetResponse, BaseErrorResponse>;
|
|
561
|
+
PASSWORD_RESET_CONFIRM: EndpointDefinition<PasswordResetConfirmPayload, PasswordResetResponse, BaseErrorResponse>;
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
sessions: {
|
|
565
|
+
keys: [
|
|
566
|
+
"SESSIONS",
|
|
567
|
+
"SESSIONS_CURRENT",
|
|
568
|
+
"SESSIONS_STATS",
|
|
569
|
+
"SESSIONS_PENDING",
|
|
570
|
+
"SESSIONS_REVOKE",
|
|
571
|
+
"SESSIONS_REVOKE_ALL",
|
|
572
|
+
"SESSIONS_APPROVE",
|
|
573
|
+
"SESSIONS_REJECT"
|
|
574
|
+
];
|
|
575
|
+
definitions: {
|
|
576
|
+
SESSIONS: EndpointDefinition<undefined, SessionsListResponse, BaseErrorResponse>;
|
|
577
|
+
SESSIONS_CURRENT: EndpointDefinition<undefined, SessionCurrentResponse, BaseErrorResponse>;
|
|
578
|
+
SESSIONS_STATS: EndpointDefinition<undefined, SessionStatsResponse, BaseErrorResponse>;
|
|
579
|
+
SESSIONS_PENDING: EndpointDefinition<undefined, SessionsPendingResponse, BaseErrorResponse>;
|
|
580
|
+
SESSIONS_REVOKE: EndpointDefinition<SessionRevokePayload, SessionRevokeResponse, BaseErrorResponse>;
|
|
581
|
+
SESSIONS_REVOKE_ALL: EndpointDefinition<SessionRevokeAllPayload, SessionRevokeAllResponse, BaseErrorResponse>;
|
|
582
|
+
SESSIONS_APPROVE: EndpointDefinition<SessionApprovePayload, SessionApproveResponse, BaseErrorResponse>;
|
|
583
|
+
SESSIONS_REJECT: EndpointDefinition<SessionRejectPayload, SessionRejectResponse, BaseErrorResponse>;
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
magicLink: {
|
|
587
|
+
keys: ["MAGIC_LINK", "MAGIC_LINK_VERIFY"];
|
|
588
|
+
definitions: {
|
|
589
|
+
MAGIC_LINK: EndpointDefinition<MagicLinkPayload, StandardReturn<{
|
|
590
|
+
message: string;
|
|
591
|
+
}>, BaseErrorResponse>;
|
|
592
|
+
MAGIC_LINK_VERIFY: EndpointDefinition<{
|
|
593
|
+
token: string;
|
|
594
|
+
}, LoginSuccess, BaseErrorResponse>;
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
invite: {
|
|
598
|
+
key: "INVITE";
|
|
599
|
+
definition: EndpointDefinition<InvitePayload, InviteResponse, BaseErrorResponse>;
|
|
600
|
+
};
|
|
601
|
+
emailVerification: {
|
|
602
|
+
keys: ["VERIFY_EMAIL", "RESEND_VERIFICATION"];
|
|
603
|
+
definitions: {
|
|
604
|
+
VERIFY_EMAIL: EndpointDefinition<EmailVerificationPayload, EmailVerificationResponse, BaseErrorResponse>;
|
|
605
|
+
RESEND_VERIFICATION: EndpointDefinition<ResendVerificationPayload, ResendVerificationResponse, BaseErrorResponse>;
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
captcha: {
|
|
609
|
+
keys: ["CAPTCHA_GENERATE", "CAPTCHA_VALIDATE"];
|
|
610
|
+
definitions: {
|
|
611
|
+
CAPTCHA_GENERATE: EndpointDefinition<CaptchaGeneratePayload, CaptchaGenerateResponse, BaseErrorResponse>;
|
|
612
|
+
CAPTCHA_VALIDATE: EndpointDefinition<CaptchaValidatePayload, CaptchaValidateResponse, BaseErrorResponse>;
|
|
613
|
+
};
|
|
614
|
+
};
|
|
615
|
+
};
|
|
616
|
+
type ExtractSingleAuthEndpoint<TAuth extends AuthenticationConfig, TFeature extends keyof AuthEndpointMap> = TFeature extends keyof TAuth ? TAuth[TFeature] extends {
|
|
617
|
+
enabled: true;
|
|
618
|
+
} | {
|
|
619
|
+
enabled?: true;
|
|
620
|
+
} ? TFeature extends "passwordReset" | "magicLink" | "sessions" | "emailVerification" | "captcha" ? AuthEndpointMap[TFeature] extends {
|
|
621
|
+
definitions: infer D;
|
|
622
|
+
} ? D : never : AuthEndpointMap[TFeature] extends {
|
|
623
|
+
key: infer K;
|
|
624
|
+
definition: infer D;
|
|
625
|
+
} ? K extends string ? {
|
|
626
|
+
[P in K]: D;
|
|
627
|
+
} : never : never : Record<string, never> : Record<string, never>;
|
|
628
|
+
export type GeneratedAuthEndpoints<TAuth extends AuthenticationConfig> = TAuth["enabled"] extends false ? Record<string, never> : ExtractSingleAuthEndpoint<TAuth, "login"> & ExtractSingleAuthEndpoint<TAuth, "register"> & ExtractSingleAuthEndpoint<TAuth, "logout"> & ExtractSingleAuthEndpoint<TAuth, "refresh"> & ExtractSingleAuthEndpoint<TAuth, "me"> & ExtractSingleAuthEndpoint<TAuth, "passwordChange"> & ExtractSingleAuthEndpoint<TAuth, "passwordSet"> & ExtractSingleAuthEndpoint<TAuth, "passwordReset"> & ExtractSingleAuthEndpoint<TAuth, "sessions"> & ExtractSingleAuthEndpoint<TAuth, "magicLink"> & ExtractSingleAuthEndpoint<TAuth, "invite"> & ExtractSingleAuthEndpoint<TAuth, "emailVerification"> & ExtractSingleAuthEndpoint<TAuth, "captcha">;
|
|
629
|
+
export type AuthEndpointDefinitions = {
|
|
630
|
+
LOGIN: EndpointDefinition<LoginPayload, LoginSuccess, BaseErrorResponse>;
|
|
631
|
+
REGISTER: EndpointDefinition<RegisterPayload, RegisterSuccess, BaseErrorResponse>;
|
|
632
|
+
LOGOUT: EndpointDefinition<undefined, {
|
|
633
|
+
message: string;
|
|
634
|
+
}, BaseErrorResponse>;
|
|
635
|
+
REFRESH: EndpointDefinition<undefined, RefreshSuccess, BaseErrorResponse>;
|
|
636
|
+
ME: EndpointDefinition<undefined, MeSuccessResponse, BaseErrorResponse>;
|
|
637
|
+
PASSWORD_CHANGE: EndpointDefinition<PasswordChangePayload, {
|
|
638
|
+
message: string;
|
|
639
|
+
}, BaseErrorResponse>;
|
|
640
|
+
PASSWORD_SET: EndpointDefinition<PasswordSetPayload, {
|
|
641
|
+
message: string;
|
|
642
|
+
}, BaseErrorResponse>;
|
|
643
|
+
PASSWORD_RESET_REQUEST: EndpointDefinition<PasswordResetRequestPayload, PasswordResetResponse, BaseErrorResponse>;
|
|
644
|
+
PASSWORD_RESET_CONFIRM: EndpointDefinition<PasswordResetConfirmPayload, PasswordResetResponse, BaseErrorResponse>;
|
|
645
|
+
SESSIONS: EndpointDefinition<undefined, SessionsListResponse, BaseErrorResponse>;
|
|
646
|
+
SESSIONS_CURRENT: EndpointDefinition<undefined, SessionCurrentResponse, BaseErrorResponse>;
|
|
647
|
+
SESSIONS_STATS: EndpointDefinition<undefined, SessionStatsResponse, BaseErrorResponse>;
|
|
648
|
+
SESSIONS_PENDING: EndpointDefinition<undefined, SessionsPendingResponse, BaseErrorResponse>;
|
|
649
|
+
SESSIONS_REVOKE: EndpointDefinition<SessionRevokePayload, SessionRevokeResponse, BaseErrorResponse>;
|
|
650
|
+
SESSIONS_REVOKE_ALL: EndpointDefinition<SessionRevokeAllPayload, SessionRevokeAllResponse, BaseErrorResponse>;
|
|
651
|
+
SESSIONS_APPROVE: EndpointDefinition<SessionApprovePayload, SessionApproveResponse, BaseErrorResponse>;
|
|
652
|
+
SESSIONS_REJECT: EndpointDefinition<SessionRejectPayload, SessionRejectResponse, BaseErrorResponse>;
|
|
653
|
+
MAGIC_LINK: EndpointDefinition<MagicLinkPayload, StandardReturn<{
|
|
654
|
+
message: string;
|
|
655
|
+
}>, BaseErrorResponse>;
|
|
656
|
+
MAGIC_LINK_VERIFY: EndpointDefinition<{
|
|
657
|
+
token: string;
|
|
658
|
+
}, LoginSuccess, BaseErrorResponse>;
|
|
659
|
+
INVITE: EndpointDefinition<InvitePayload, InviteResponse, BaseErrorResponse>;
|
|
660
|
+
VERIFY_EMAIL: EndpointDefinition<EmailVerificationPayload, EmailVerificationResponse, BaseErrorResponse>;
|
|
661
|
+
RESEND_VERIFICATION: EndpointDefinition<ResendVerificationPayload, ResendVerificationResponse, BaseErrorResponse>;
|
|
662
|
+
CAPTCHA_GENERATE: EndpointDefinition<CaptchaGeneratePayload, CaptchaGenerateResponse, BaseErrorResponse>;
|
|
663
|
+
CAPTCHA_VALIDATE: EndpointDefinition<CaptchaValidatePayload, CaptchaValidateResponse, BaseErrorResponse>;
|
|
664
|
+
};
|
|
665
|
+
export type EntityRecord = Record<string, unknown>;
|
|
666
|
+
export type GenerateEntityEndpoints<TTable extends NucleusTable> = {
|
|
667
|
+
[K in EntityEndpointKey<TTable["table_name"], "GET">]: EndpointDefinition<StandardQueryParams, ListResponse<EntityRecord>, BaseErrorResponse>;
|
|
668
|
+
} & {
|
|
669
|
+
[K in `GET_${Uppercase<Singularize<TTable["table_name"]>>}_BY_ID`]: EndpointDefinition<{
|
|
670
|
+
id: string;
|
|
671
|
+
}, SingleResponse<EntityRecord>, BaseErrorResponse>;
|
|
672
|
+
} & {
|
|
673
|
+
[K in EntityEndpointKey<TTable["table_name"], "POST">]: EndpointDefinition<EntityRecord, MutationResponse<EntityRecord>, BaseErrorResponse>;
|
|
674
|
+
} & {
|
|
675
|
+
[K in EntityEndpointKey<TTable["table_name"], "PUT">]: EndpointDefinition<EntityRecord & {
|
|
676
|
+
id: string;
|
|
677
|
+
}, MutationResponse<EntityRecord>, BaseErrorResponse>;
|
|
678
|
+
} & {
|
|
679
|
+
[K in EntityEndpointKey<TTable["table_name"], "PATCH">]: EndpointDefinition<Partial<EntityRecord> & {
|
|
680
|
+
id: string;
|
|
681
|
+
}, MutationResponse<EntityRecord>, BaseErrorResponse>;
|
|
682
|
+
} & {
|
|
683
|
+
[K in EntityEndpointKey<TTable["table_name"], "DELETE">]: EndpointDefinition<{
|
|
684
|
+
id: string;
|
|
685
|
+
}, DeleteResponse, BaseErrorResponse>;
|
|
686
|
+
};
|
|
687
|
+
export interface EndpointState<TSuccess, TError> {
|
|
688
|
+
isPending: boolean;
|
|
689
|
+
data: TSuccess | null;
|
|
690
|
+
error: TError | null;
|
|
691
|
+
code: number | null;
|
|
692
|
+
}
|
|
693
|
+
export interface StartOptions<TPayload, TSuccess, TError> {
|
|
694
|
+
payload: TPayload;
|
|
695
|
+
onAfterHandle?: (data: TSuccess) => void;
|
|
696
|
+
onErrorHandle?: (error: TError, code?: number | null) => void;
|
|
697
|
+
}
|
|
698
|
+
export interface EndpointAction<TPayload, TSuccess, TError> {
|
|
699
|
+
state: EndpointState<TSuccess, TError>;
|
|
700
|
+
start: (options: StartOptions<TPayload, TSuccess, TError>) => void;
|
|
701
|
+
}
|
|
702
|
+
export type EndpointActions<TEndpoints extends Record<string, EndpointDefinition>> = {
|
|
703
|
+
[K in keyof TEndpoints]: EndpointAction<TEndpoints[K]["_payload"], TEndpoints[K]["_success"], TEndpoints[K]["_error"]>;
|
|
704
|
+
};
|
|
705
|
+
export interface CookieStore {
|
|
706
|
+
get: (name: string) => {
|
|
707
|
+
value: string;
|
|
708
|
+
} | undefined;
|
|
709
|
+
set: (name: string, value: string, options?: Record<string, unknown>) => void;
|
|
710
|
+
delete: (name: string) => void;
|
|
711
|
+
}
|
|
712
|
+
export interface HeadersStore {
|
|
713
|
+
get: (name: string) => string | null;
|
|
714
|
+
forEach: (callback: (value: string, key: string) => void) => void;
|
|
715
|
+
}
|
|
716
|
+
export interface ServerFactoryConfig {
|
|
717
|
+
baseUrl: string;
|
|
718
|
+
tokenNames?: {
|
|
719
|
+
accessToken?: string;
|
|
720
|
+
refreshToken?: string;
|
|
721
|
+
sessionToken?: string;
|
|
722
|
+
};
|
|
723
|
+
debug?: boolean;
|
|
724
|
+
}
|
|
725
|
+
export interface ClientHookConfig<TEndpoints extends Record<string, EndpointDefinition>> {
|
|
726
|
+
endpoints: TEndpoints;
|
|
727
|
+
factory: <K extends keyof TEndpoints>(endpoint: K, payload: TEndpoints[K]["_payload"]) => Promise<ApiResponse<TEndpoints[K]["_success"], TEndpoints[K]["_error"]>>;
|
|
728
|
+
}
|
|
729
|
+
export type ExtraEndpoints = Record<string, EndpointDefinition>;
|
|
730
|
+
export interface ApiCallerConfig<TConfig extends NucleusConfigOptions, TExtra extends ExtraEndpoints = Record<string, never>> {
|
|
731
|
+
config: TConfig;
|
|
732
|
+
extraEndpoints?: TExtra;
|
|
733
|
+
serverConfig: ServerFactoryConfig;
|
|
734
|
+
getCookies: () => Promise<CookieStore>;
|
|
735
|
+
getHeaders: () => Promise<HeadersStore>;
|
|
736
|
+
}
|
|
737
|
+
type ExtractTableNames<T extends readonly {
|
|
738
|
+
table_name: string;
|
|
739
|
+
}[]> = T[number]["table_name"];
|
|
740
|
+
type GenerateEntityEndpointKeys<TTableName extends string> = `GET_${Uppercase<TTableName>}` | `GET_${Uppercase<Singularize<TTableName>>}_BY_ID` | `GET_${Uppercase<TTableName>}_DISTINCT` | `ADD_${Uppercase<Singularize<TTableName>>}` | `UPDATE_${Uppercase<Singularize<TTableName>>}` | `PATCH_${Uppercase<Singularize<TTableName>>}` | `DELETE_${Uppercase<Singularize<TTableName>>}`;
|
|
741
|
+
type GenerateBulkEndpointKeys<TTableName extends string> = `BULK_ADD_${Uppercase<TTableName>}` | `BULK_UPDATE_${Uppercase<TTableName>}` | `BULK_DELETE_${Uppercase<TTableName>}`;
|
|
742
|
+
type EntityEndpointDefinitionFor<TKey extends string> = TKey extends `GET_${string}_BY_ID` ? EndpointDefinition<{
|
|
743
|
+
id: string;
|
|
744
|
+
}, SingleResponse<EntityRecord>, BaseErrorResponse> : TKey extends `GET_${string}_DISTINCT` ? EndpointDefinition<{
|
|
745
|
+
field: string;
|
|
746
|
+
}, StandardReturn<{
|
|
747
|
+
value: unknown;
|
|
748
|
+
}[]>, BaseErrorResponse> : TKey extends `GET_${string}` ? EndpointDefinition<StandardQueryParams | undefined, ListResponse<EntityRecord>, BaseErrorResponse> : TKey extends `ADD_${string}` ? EndpointDefinition<EntityRecord, MutationResponse<EntityRecord>, BaseErrorResponse> : TKey extends `UPDATE_${string}` ? EndpointDefinition<EntityRecord & {
|
|
749
|
+
id: string;
|
|
750
|
+
}, MutationResponse<EntityRecord>, BaseErrorResponse> : TKey extends `PATCH_${string}` ? EndpointDefinition<Partial<EntityRecord> & {
|
|
751
|
+
id: string;
|
|
752
|
+
}, MutationResponse<EntityRecord>, BaseErrorResponse> : TKey extends `DELETE_${string}` ? EndpointDefinition<{
|
|
753
|
+
id: string;
|
|
754
|
+
}, DeleteResponse, BaseErrorResponse> : TKey extends `BULK_ADD_${string}` ? EndpointDefinition<EntityRecord[], MutationResponse<EntityRecord[]>, BaseErrorResponse> : TKey extends `BULK_UPDATE_${string}` ? EndpointDefinition<{
|
|
755
|
+
id: string;
|
|
756
|
+
data: EntityRecord;
|
|
757
|
+
}[], MutationResponse<EntityRecord[]>, BaseErrorResponse> : TKey extends `BULK_DELETE_${string}` ? EndpointDefinition<string[], StandardReturn<{
|
|
758
|
+
deleted: number;
|
|
759
|
+
}>, BaseErrorResponse> : EndpointDefinition;
|
|
760
|
+
export type GeneratedEndpointsFromConfig<TEntities extends readonly {
|
|
761
|
+
table_name: string;
|
|
762
|
+
bulk_endpoints_enabled?: boolean;
|
|
763
|
+
}[]> = {
|
|
764
|
+
[K in GenerateEntityEndpointKeys<ExtractTableNames<TEntities>>]: EntityEndpointDefinitionFor<K>;
|
|
765
|
+
} & {
|
|
766
|
+
[K in GenerateBulkEndpointKeys<ExtractTableNames<TEntities>>]: EntityEndpointDefinitionFor<K>;
|
|
767
|
+
};
|
|
768
|
+
export type AllGeneratedEndpoints<TEntities extends readonly {
|
|
769
|
+
table_name: string;
|
|
770
|
+
bulk_endpoints_enabled?: boolean;
|
|
771
|
+
}[], TExtra extends Record<string, EndpointDefinition> = Record<string, never>> = GeneratedEndpointsFromConfig<TEntities> & AuthEndpointDefinitions & TExtra;
|
|
772
|
+
type NucleusColumnTypeToTS<T extends string> = T extends "integer" | "smallint" | "bigint" | "serial" | "smallserial" | "bigserial" | "real" | "doublePrecision" | "numeric" | "decimal" ? number : T extends "text" | "varchar" | "char" | "uuid" ? string : T extends "boolean" ? boolean : T extends "date" | "time" | "timestamp" | "timestamptz" ? Date | string : T extends "json" | "jsonb" ? unknown : unknown;
|
|
773
|
+
type SnakeToCamelCase<S extends string> = S extends `${infer T}_${infer U}` ? `${T}${Capitalize<SnakeToCamelCase<U>>}` : S;
|
|
774
|
+
type ColumnsToEntity<TColumns extends readonly {
|
|
775
|
+
name: string;
|
|
776
|
+
type: string;
|
|
777
|
+
}[]> = {
|
|
778
|
+
[C in TColumns[number] as SnakeToCamelCase<C["name"]>]: NucleusColumnTypeToTS<C["type"]>;
|
|
779
|
+
};
|
|
780
|
+
type BaseEntityFields = {
|
|
781
|
+
id: string;
|
|
782
|
+
createdAt: Date | string;
|
|
783
|
+
updatedAt: Date | string;
|
|
784
|
+
};
|
|
785
|
+
type EntityFromConfig<TEntity extends {
|
|
786
|
+
table_name: string;
|
|
787
|
+
columns?: readonly {
|
|
788
|
+
name: string;
|
|
789
|
+
type: string;
|
|
790
|
+
}[];
|
|
791
|
+
add_base_columns?: boolean;
|
|
792
|
+
}> = TEntity["columns"] extends readonly {
|
|
793
|
+
name: string;
|
|
794
|
+
type: string;
|
|
795
|
+
}[] ? TEntity["add_base_columns"] extends true ? BaseEntityFields & ColumnsToEntity<TEntity["columns"]> : ColumnsToEntity<TEntity["columns"]> : BaseEntityFields;
|
|
796
|
+
type FindEntityByName<TEntities extends readonly {
|
|
797
|
+
table_name: string;
|
|
798
|
+
columns?: readonly {
|
|
799
|
+
name: string;
|
|
800
|
+
type: string;
|
|
801
|
+
}[];
|
|
802
|
+
}[], TName extends string> = TEntities extends readonly [infer First, ...infer Rest] ? First extends {
|
|
803
|
+
table_name: TName;
|
|
804
|
+
} ? First : Rest extends readonly {
|
|
805
|
+
table_name: string;
|
|
806
|
+
columns?: readonly {
|
|
807
|
+
name: string;
|
|
808
|
+
type: string;
|
|
809
|
+
}[];
|
|
810
|
+
}[] ? FindEntityByName<Rest, TName> : never : never;
|
|
811
|
+
type SingularToPlural<T extends string> = T extends `${infer Base}ss` ? `${Base}sses` : T extends `${infer Base}s` ? `${Base}ses` : T extends `${infer Base}x` ? `${Base}xes` : T extends `${infer Base}z` ? `${Base}zes` : T extends `${infer Base}ch` ? `${Base}ches` : T extends `${infer Base}sh` ? `${Base}shes` : T extends `${infer Base}y` ? `${Base}ies` : `${T}s`;
|
|
812
|
+
type FindEntityByNameOrSingular<TEntities extends readonly {
|
|
813
|
+
table_name: string;
|
|
814
|
+
columns?: readonly {
|
|
815
|
+
name: string;
|
|
816
|
+
type: string;
|
|
817
|
+
}[];
|
|
818
|
+
}[], TName extends string> = FindEntityByName<TEntities, TName> extends never ? FindEntityByName<TEntities, SingularToPlural<TName>> : FindEntityByName<TEntities, TName>;
|
|
819
|
+
type EntityEndpointDefinitionWithTypes<TKey extends string, TEntities extends readonly {
|
|
820
|
+
table_name: string;
|
|
821
|
+
columns?: readonly {
|
|
822
|
+
name: string;
|
|
823
|
+
type: string;
|
|
824
|
+
}[];
|
|
825
|
+
add_base_columns?: boolean;
|
|
826
|
+
}[]> = TKey extends `GET_${infer TableName}_BY_ID` ? EndpointDefinition<{
|
|
827
|
+
id: string;
|
|
828
|
+
}, SingleResponse<EntityFromConfig<FindEntityByName<TEntities, Lowercase<TableName>>>>, BaseErrorResponse> : TKey extends `GET_${infer _TableName}_DISTINCT` ? EndpointDefinition<{
|
|
829
|
+
field: string;
|
|
830
|
+
}, StandardReturn<{
|
|
831
|
+
value: unknown;
|
|
832
|
+
}[]>, BaseErrorResponse> : TKey extends `GET_${infer TableName}` ? EndpointDefinition<StandardQueryParams | undefined, ListResponse<EntityFromConfig<FindEntityByName<TEntities, Lowercase<TableName>>>>, BaseErrorResponse> : TKey extends `ADD_${infer SingularName}` ? EndpointDefinition<Partial<EntityFromConfig<FindEntityByNameOrSingular<TEntities, Lowercase<SingularName>>>>, MutationResponse<EntityFromConfig<FindEntityByNameOrSingular<TEntities, Lowercase<SingularName>>>>, BaseErrorResponse> : TKey extends `UPDATE_${infer SingularName}` ? EndpointDefinition<Partial<EntityFromConfig<FindEntityByNameOrSingular<TEntities, Lowercase<SingularName>>>> & {
|
|
833
|
+
id: string;
|
|
834
|
+
}, MutationResponse<EntityFromConfig<FindEntityByNameOrSingular<TEntities, Lowercase<SingularName>>>>, BaseErrorResponse> : TKey extends `PATCH_${infer SingularName}` ? EndpointDefinition<Partial<EntityFromConfig<FindEntityByNameOrSingular<TEntities, Lowercase<SingularName>>>> & {
|
|
835
|
+
id: string;
|
|
836
|
+
}, MutationResponse<EntityFromConfig<FindEntityByNameOrSingular<TEntities, Lowercase<SingularName>>>>, BaseErrorResponse> : TKey extends `DELETE_${infer _SingularName}` ? EndpointDefinition<{
|
|
837
|
+
id: string;
|
|
838
|
+
}, DeleteResponse, BaseErrorResponse> : EndpointDefinition;
|
|
839
|
+
export type GeneratedEndpointsWithEntityTypes<TEntities extends readonly {
|
|
840
|
+
table_name: string;
|
|
841
|
+
columns?: readonly {
|
|
842
|
+
name: string;
|
|
843
|
+
type: string;
|
|
844
|
+
}[];
|
|
845
|
+
add_base_columns?: boolean;
|
|
846
|
+
bulk_endpoints_enabled?: boolean;
|
|
847
|
+
}[]> = {
|
|
848
|
+
[K in GenerateEntityEndpointKeys<ExtractTableNames<TEntities>>]: EntityEndpointDefinitionWithTypes<K, TEntities>;
|
|
849
|
+
} & {
|
|
850
|
+
[K in GenerateBulkEndpointKeys<ExtractTableNames<TEntities>>]: EntityEndpointDefinitionFor<K>;
|
|
851
|
+
};
|
|
852
|
+
type SystemTableEndpoints = GeneratedEndpointsWithEntityTypes<SystemTables>;
|
|
853
|
+
export type AllGeneratedEndpointsWithEntityTypes<TEntities extends readonly {
|
|
854
|
+
table_name: string;
|
|
855
|
+
columns?: readonly {
|
|
856
|
+
name: string;
|
|
857
|
+
type: string;
|
|
858
|
+
}[];
|
|
859
|
+
add_base_columns?: boolean;
|
|
860
|
+
bulk_endpoints_enabled?: boolean;
|
|
861
|
+
}[], TExtra extends Record<string, EndpointDefinition> = Record<string, never>> = GeneratedEndpointsWithEntityTypes<TEntities> & AuthEndpointDefinitions & SystemTableEndpoints & TExtra;
|
|
862
|
+
export type AllGeneratedEndpointsWithConfig<TConfig extends {
|
|
863
|
+
entities: readonly {
|
|
864
|
+
table_name: string;
|
|
865
|
+
columns?: readonly {
|
|
866
|
+
name: string;
|
|
867
|
+
type: string;
|
|
868
|
+
}[];
|
|
869
|
+
add_base_columns?: boolean;
|
|
870
|
+
bulk_endpoints_enabled?: boolean;
|
|
871
|
+
}[];
|
|
872
|
+
authentication?: AuthenticationConfig;
|
|
873
|
+
}, TExtra extends Record<string, EndpointDefinition> = Record<string, never>> = GeneratedEndpointsWithEntityTypes<TConfig["entities"]> & (TConfig["authentication"] extends AuthenticationConfig ? GeneratedAuthEndpoints<TConfig["authentication"]> : AuthEndpointDefinitions) & TExtra;
|
|
874
|
+
export type InferEntity<TEntities extends readonly {
|
|
875
|
+
table_name: string;
|
|
876
|
+
columns?: readonly {
|
|
877
|
+
name: string;
|
|
878
|
+
type: string;
|
|
879
|
+
}[];
|
|
880
|
+
add_base_columns?: boolean;
|
|
881
|
+
}[], TName extends string> = FindEntityByNameOrSingular<TEntities, TName> extends infer TEntity ? TEntity extends {
|
|
882
|
+
table_name: string;
|
|
883
|
+
columns?: readonly {
|
|
884
|
+
name: string;
|
|
885
|
+
type: string;
|
|
886
|
+
}[];
|
|
887
|
+
add_base_columns?: boolean;
|
|
888
|
+
} ? EntityFromConfig<TEntity> : never : never;
|
|
889
|
+
export type SystemUserEntity = InferEntity<SystemTables, "users">;
|
|
890
|
+
export type SystemProfileEntity = InferEntity<SystemTables, "profiles">;
|
|
891
|
+
export type SystemAddressEntity = InferEntity<SystemTables, "addresses">;
|
|
892
|
+
export type SystemPhoneEntity = InferEntity<SystemTables, "phones">;
|
|
893
|
+
export type SystemFileEntity = InferEntity<SystemTables, "files">;
|
|
894
|
+
export type SystemRoleEntity = InferEntity<SystemTables, "roles">;
|
|
895
|
+
export type SystemClaimEntity = InferEntity<SystemTables, "claims">;
|
|
896
|
+
export type SystemRoleClaimEntity = InferEntity<SystemTables, "role_claims">;
|
|
897
|
+
export type SystemUserRoleEntity = InferEntity<SystemTables, "user_roles">;
|
|
898
|
+
export type MeResponseData = {
|
|
899
|
+
user: SystemUserEntity;
|
|
900
|
+
profile: SystemProfileEntity | null;
|
|
901
|
+
addresses: SystemAddressEntity[];
|
|
902
|
+
phones: SystemPhoneEntity[];
|
|
903
|
+
files: SystemFileEntity[];
|
|
904
|
+
roles: SystemRoleEntity[];
|
|
905
|
+
};
|
|
906
|
+
export type MeSuccessResponse = StandardReturn<MeResponseData>;
|
|
907
|
+
//# sourceMappingURL=types.d.ts.map
|