@studiocubics/cms 0.0.2 → 0.0.4
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/dist/client/clerk/rbacConfig.js +2 -0
- package/dist/client/clerk/rbacConfig.js.map +1 -0
- package/dist/client/constants/defaults.d.ts +3 -0
- package/dist/client/constants/defaults.js +2 -0
- package/dist/client/constants/defaults.js.map +1 -0
- package/dist/client/constants/pageLimits.js +2 -0
- package/dist/client/constants/pageLimits.js.map +1 -0
- package/dist/{index.d.ts → client/index.d.ts} +1 -2
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/providers/CMSRootProviders.js +2 -0
- package/dist/client/providers/CMSRootProviders.js.map +1 -0
- package/dist/client/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js +2 -0
- package/dist/client/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js.map +1 -0
- package/dist/client/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js +2 -0
- package/dist/{ui → client/ui}/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js.map +1 -1
- package/dist/client/ui/Layout/CMSSecurityLayout.js +2 -0
- package/dist/client/ui/Layout/CMSSecurityLayout.js.map +1 -0
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebar.js +2 -0
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebar.js.map +1 -0
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebarBody.js +2 -0
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebarBody.js.map +1 -0
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js +2 -0
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js.map +1 -0
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js +2 -0
- package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js.map +1 -1
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js +2 -0
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js.map +1 -0
- package/dist/client/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js +2 -0
- package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js.map +1 -1
- package/dist/client/ui/System/Auth/SignIn/SignIn.js +2 -0
- package/dist/client/ui/System/Auth/SignIn/SignIn.js.map +1 -0
- package/dist/client/ui/System/Auth/SignIn/SignIn.module.css.js +2 -0
- package/dist/{ui → client/ui}/System/Auth/SignIn/SignIn.module.css.js.map +1 -1
- package/dist/client/ui/System/Auth/SignIn/useSignInForm.js +2 -0
- package/dist/client/ui/System/Auth/SignIn/useSignInForm.js.map +1 -0
- package/dist/client/ui/System/Auth/SignUp/SignUp.js +2 -0
- package/dist/client/ui/System/Auth/SignUp/SignUp.js.map +1 -0
- package/dist/client/ui/System/Auth/SignUp/SignUp.module.css.js +2 -0
- package/dist/{ui → client/ui}/System/Auth/SignUp/SignUp.module.css.js.map +1 -1
- package/dist/client/ui/System/Auth/SignUp/useSignUpForm.js +2 -0
- package/dist/client/ui/System/Auth/SignUp/useSignUpForm.js.map +1 -0
- package/dist/client/ui/System/Invitations/InvitationList.js +2 -0
- package/dist/client/ui/System/Invitations/InvitationList.js.map +1 -0
- package/dist/client/ui/System/Invitations/InvitationListActions.js +2 -0
- package/dist/client/ui/System/Invitations/InvitationListActions.js.map +1 -0
- package/dist/client/ui/System/Invitations/InvitationListCard.js +2 -0
- package/dist/client/ui/System/Invitations/InvitationListCard.js.map +1 -0
- package/dist/client/ui/System/Invitations/InvitationListPage.js +2 -0
- package/dist/client/ui/System/Invitations/InvitationListPage.js.map +1 -0
- package/dist/client/ui/System/Invitations/InvitationListPagination.js +2 -0
- package/dist/client/ui/System/Invitations/InvitationListPagination.js.map +1 -0
- package/dist/client/ui/System/Permissions/RoleListCard.js +2 -0
- package/dist/client/ui/System/Permissions/RoleListCard.js.map +1 -0
- package/dist/client/ui/System/Permissions/RolePermissionsPage.js +2 -0
- package/dist/client/ui/System/Permissions/RolePermissionsPage.js.map +1 -0
- package/dist/client/ui/System/Permissions/RolePermissionsTable.js +2 -0
- package/dist/client/ui/System/Permissions/RolePermissionsTable.js.map +1 -0
- package/dist/client/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js +2 -0
- package/dist/client/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js.map +1 -0
- package/dist/client/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js +2 -0
- package/dist/{ui → client/ui}/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js.map +1 -1
- package/dist/client/ui/System/SystemUser/CurrentSystemUserPage.js +2 -0
- package/dist/client/ui/System/SystemUser/CurrentSystemUserPage.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserActions.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserActions.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js +2 -0
- package/dist/{ui → client/ui}/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js.map +1 -1
- package/dist/client/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js +2 -0
- package/dist/{ui → client/ui}/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js.map +1 -1
- package/dist/client/ui/System/SystemUser/SystemUserList.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserList.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserListActions.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserListActions.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserListCard.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserListCard.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserListPage.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserListPage.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserListPagination.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserListPagination.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserPage.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserPage.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserPageContent.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserPageContent.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserRole/SystemUserRole.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserRole/SystemUserRole.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js +2 -0
- package/dist/{ui → client/ui}/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js.map +1 -1
- package/dist/client/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js.map +1 -0
- package/dist/client/ui/System/SystemUser/SystemUserTimestamps.js +2 -0
- package/dist/client/ui/System/SystemUser/SystemUserTimestamps.js.map +1 -0
- package/dist/client/ui/System/WelcomePage/WelcomePage.js +2 -0
- package/dist/client/ui/System/WelcomePage/WelcomePage.js.map +1 -0
- package/dist/client/ui/System/WelcomePage/WelcomePage.module.css.js +2 -0
- package/dist/{ui → client/ui}/System/WelcomePage/WelcomePage.module.css.js.map +1 -1
- package/dist/{ui → client/ui}/System/types.d.ts +1 -1
- package/dist/index.css +1 -215
- package/dist/{clerk → server/clerk}/_index.d.ts +1 -1
- package/dist/{clerk → server/clerk}/actions/invitations.d.ts +1 -1
- package/dist/server/clerk/actions/invitations.js +2 -0
- package/dist/server/clerk/actions/invitations.js.map +1 -0
- package/dist/{clerk → server/clerk}/actions/systemUsers.d.ts +2 -2
- package/dist/server/clerk/actions/systemUsers.js +2 -0
- package/dist/server/clerk/actions/systemUsers.js.map +1 -0
- package/dist/{clerk → server/clerk}/auth.d.ts +1 -1
- package/dist/server/clerk/auth.js +2 -0
- package/dist/server/clerk/auth.js.map +1 -0
- package/dist/{clerk → server/clerk}/hasPermission.d.ts +1 -1
- package/dist/server/clerk/hasPermission.js +2 -0
- package/dist/server/clerk/hasPermission.js.map +1 -0
- package/dist/server/clerk/schemas/invitation.js +2 -0
- package/dist/server/clerk/schemas/invitation.js.map +1 -0
- package/dist/server/clerk/toClientSafeUser.js +2 -0
- package/dist/server/clerk/toClientSafeUser.js.map +1 -0
- package/dist/server/index.d.ts +5 -0
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -0
- package/package.json +14 -10
- package/dist/clerk/actions/invitations.js +0 -59
- package/dist/clerk/actions/invitations.js.map +0 -1
- package/dist/clerk/actions/systemUsers.js +0 -64
- package/dist/clerk/actions/systemUsers.js.map +0 -1
- package/dist/clerk/auth.js +0 -21
- package/dist/clerk/auth.js.map +0 -1
- package/dist/clerk/hasPermission.js +0 -78
- package/dist/clerk/hasPermission.js.map +0 -1
- package/dist/clerk/rbacConfig.js +0 -48
- package/dist/clerk/rbacConfig.js.map +0 -1
- package/dist/clerk/schemas/invitation.js +0 -20
- package/dist/clerk/schemas/invitation.js.map +0 -1
- package/dist/clerk/toClientSafeUser.js +0 -46
- package/dist/clerk/toClientSafeUser.js.map +0 -1
- package/dist/constants/defaults.d.ts +0 -6
- package/dist/constants/defaults.js +0 -56
- package/dist/constants/defaults.js.map +0 -1
- package/dist/constants/pageLimits.js +0 -5
- package/dist/constants/pageLimits.js.map +0 -1
- package/dist/index.js +0 -45
- package/dist/index.js.map +0 -1
- package/dist/providers/CMSRootProviders.js +0 -11
- package/dist/providers/CMSRootProviders.js.map +0 -1
- package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js +0 -13
- package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js.map +0 -1
- package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js +0 -4
- package/dist/ui/Layout/CMSSecurityLayout.js +0 -18
- package/dist/ui/Layout/CMSSecurityLayout.js.map +0 -1
- package/dist/ui/Layout/CMSSidebar/CMSSidebar.js +0 -15
- package/dist/ui/Layout/CMSSidebar/CMSSidebar.js.map +0 -1
- package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.js +0 -18
- package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.js.map +0 -1
- package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js +0 -39
- package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js.map +0 -1
- package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js +0 -4
- package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js +0 -16
- package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js.map +0 -1
- package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js +0 -4
- package/dist/ui/System/Auth/SignIn/SignIn.js +0 -28
- package/dist/ui/System/Auth/SignIn/SignIn.js.map +0 -1
- package/dist/ui/System/Auth/SignIn/SignIn.module.css.js +0 -4
- package/dist/ui/System/Auth/SignIn/useSignInForm.js +0 -46
- package/dist/ui/System/Auth/SignIn/useSignInForm.js.map +0 -1
- package/dist/ui/System/Auth/SignUp/SignUp.js +0 -36
- package/dist/ui/System/Auth/SignUp/SignUp.js.map +0 -1
- package/dist/ui/System/Auth/SignUp/SignUp.module.css.js +0 -4
- package/dist/ui/System/Auth/SignUp/useSignUpForm.js +0 -58
- package/dist/ui/System/Auth/SignUp/useSignUpForm.js.map +0 -1
- package/dist/ui/System/Invitations/InvitationList.js +0 -11
- package/dist/ui/System/Invitations/InvitationList.js.map +0 -1
- package/dist/ui/System/Invitations/InvitationListActions.js +0 -39
- package/dist/ui/System/Invitations/InvitationListActions.js.map +0 -1
- package/dist/ui/System/Invitations/InvitationListCard.js +0 -16
- package/dist/ui/System/Invitations/InvitationListCard.js.map +0 -1
- package/dist/ui/System/Invitations/InvitationListPage.js +0 -22
- package/dist/ui/System/Invitations/InvitationListPage.js.map +0 -1
- package/dist/ui/System/Invitations/InvitationListPagination.js +0 -11
- package/dist/ui/System/Invitations/InvitationListPagination.js.map +0 -1
- package/dist/ui/System/Permissions/RoleListCard.js +0 -11
- package/dist/ui/System/Permissions/RoleListCard.js.map +0 -1
- package/dist/ui/System/Permissions/RolePermissionsPage.js +0 -14
- package/dist/ui/System/Permissions/RolePermissionsPage.js.map +0 -1
- package/dist/ui/System/Permissions/RolePermissionsTable.js +0 -28
- package/dist/ui/System/Permissions/RolePermissionsTable.js.map +0 -1
- package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js +0 -31
- package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js.map +0 -1
- package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js +0 -4
- package/dist/ui/System/SystemUser/CurrentSystemUserPage.js +0 -17
- package/dist/ui/System/SystemUser/CurrentSystemUserPage.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserActions.js +0 -14
- package/dist/ui/System/SystemUser/SystemUserActions.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js +0 -16
- package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js +0 -4
- package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js +0 -26
- package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js +0 -4
- package/dist/ui/System/SystemUser/SystemUserList.js +0 -11
- package/dist/ui/System/SystemUser/SystemUserList.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserListActions.js +0 -11
- package/dist/ui/System/SystemUser/SystemUserListActions.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserListCard.js +0 -34
- package/dist/ui/System/SystemUser/SystemUserListCard.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserListPage.js +0 -24
- package/dist/ui/System/SystemUser/SystemUserListPage.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserListPagination.js +0 -11
- package/dist/ui/System/SystemUser/SystemUserListPagination.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserPage.js +0 -17
- package/dist/ui/System/SystemUser/SystemUserPage.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserPageContent.js +0 -13
- package/dist/ui/System/SystemUser/SystemUserPageContent.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.js +0 -21
- package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js +0 -4
- package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js +0 -19
- package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js.map +0 -1
- package/dist/ui/System/SystemUser/SystemUserTimestamps.js +0 -27
- package/dist/ui/System/SystemUser/SystemUserTimestamps.js.map +0 -1
- package/dist/ui/System/WelcomePage/WelcomePage.js +0 -16
- package/dist/ui/System/WelcomePage/WelcomePage.js.map +0 -1
- package/dist/ui/System/WelcomePage/WelcomePage.module.css.js +0 -4
- package/dist/utils/_index.d.ts +0 -1
- package/dist/utils/proxyFunctions.d.ts +0 -4
- package/dist/utils/proxyFunctions.js +0 -34
- package/dist/utils/proxyFunctions.js.map +0 -1
- package/rollup.config.js +0 -48
- /package/dist/{clerk → client/clerk}/rbacConfig.d.ts +0 -0
- /package/dist/{constants → client/constants}/_index.d.ts +0 -0
- /package/dist/{constants → client/constants}/pageLimits.d.ts +0 -0
- /package/dist/{providers → client/providers}/CMSRootProviders.d.ts +0 -0
- /package/dist/{providers → client/providers}/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.d.ts +0 -0
- /package/dist/{ui → client/ui}/Inputs/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/Layout/CMSSecurityLayout.d.ts +0 -0
- /package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebar.d.ts +0 -0
- /package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarBody.d.ts +0 -0
- /package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.d.ts +0 -0
- /package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.d.ts +0 -0
- /package/dist/{ui → client/ui}/Layout/CMSSidebar/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/Layout/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Auth/SignIn/SignIn.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Auth/SignIn/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Auth/SignIn/useSignInForm.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Auth/SignUp/SignUp.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Auth/SignUp/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Auth/SignUp/useSignUpForm.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Auth/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Invitations/InvitationList.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Invitations/InvitationListActions.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Invitations/InvitationListCard.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Invitations/InvitationListPage.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Invitations/InvitationListPagination.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Invitations/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Permissions/RoleListCard.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Permissions/RolePermissionsPage.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Permissions/RolePermissionsTable.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/Permissions/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/CurrentSystemUserPage.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserActions.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserDetails/SystemUserDetails.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserList.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserListActions.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserListCard.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserListPage.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserListPagination.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserPage.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserPageContent.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserRole/SystemUserRole.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/SystemUserTimestamps.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/SystemUser/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/WelcomePage/WelcomePage.d.ts +0 -0
- /package/dist/{ui → client/ui}/System/_index.d.ts +0 -0
- /package/dist/{ui → client/ui}/_index.d.ts +0 -0
- /package/dist/{clerk → server/clerk}/actions/_index.d.ts +0 -0
- /package/dist/{clerk → server/clerk}/schemas/_index.d.ts +0 -0
- /package/dist/{clerk → server/clerk}/schemas/invitation.d.ts +0 -0
- /package/dist/{clerk → server/clerk}/schemas/systemUser.d.ts +0 -0
- /package/dist/{clerk → server/clerk}/toClientSafeUser.d.ts +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as i,Fragment as r,jsx as t}from"react/jsx-runtime";import{Button as o}from"@studiocubics/components";import{Search as e,ChartNoAxesGantt as n}from"lucide-react";import{InvitationCreateDialog as s}from"../Invitations/InvitationListActions.js";function m(){return i(r,{children:[t(s,{}),t(o,{size:"sm",square:!0,children:t(e,{})}),t(o,{size:"sm",square:!0,children:t(n,{})})]})}export{m as SystemUserListActions};
|
|
2
|
+
//# sourceMappingURL=SystemUserListActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemUserListActions.js","sources":["../../../../../src/client/ui/System/SystemUser/SystemUserListActions.tsx"],"sourcesContent":["import { Button } from \"@studiocubics/components\";\nimport { Search, ChartNoAxesGantt } from \"lucide-react\";\nimport { InvitationCreateDialog } from \"../Invitations/InvitationListActions\";\n\nexport function SystemUserListActions() {\n return (\n <>\n <InvitationCreateDialog />\n <Button size=\"sm\" square>\n <Search />\n </Button>\n <Button size=\"sm\" square>\n <ChartNoAxesGantt />\n </Button>\n </>\n );\n}\n"],"names":["SystemUserListActions","_jsxs","_Fragment","children","_jsx","InvitationCreateDialog","Button","size","square","Search","ChartNoAxesGantt"],"mappings":"wQAIgBA,IACd,OACEC,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,MACDD,EAACE,EAAM,CAACC,KAAK,KAAKC,mBAChBJ,EAACK,EAAM,CAAA,KAETL,EAACE,EAAM,CAACC,KAAK,KAAKC,QAAM,EAAAL,SACtBC,EAACM,EAAgB,CAAA,OAIzB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as i,Fragment as s}from"react/jsx-runtime";import{List as r,ListItem as t,CollectionItemCard as o,CollectionItemCardActions as n}from"@studiocubics/components";import{toCapitalised as c}from"@studiocubics/utils";import{BrickWallShield as a,OctagonX as l,EllipsisVertical as m,History as u}from"lucide-react";import d from"next/link";import{SystemUserDeleteListItem as p}from"./SystemUserActions.js";function f(f){const{id:h,fullName:y,imageUrl:b,emailAddress:g,role:N,lastSignInAt:U}=f,v=[{actionType:"link",icon:e(a,{}),label:"View Sessions",href:`/dashboard/security/systemUsers/${h}/sessions`,prefetch:!0,as:d},{actionType:"popover",icon:e(m,{}),popoverChildren:i(r,{className:"surfaceContainer",children:[e(p,{uid:h,fullName:y}),e(t,{startIcon:e(l,{}),children:"Ban User",color:"error"})]})}];return e(o,{as:d,href:`/dashboard/security/systemUsers/${h}`,title:y??"Name is missing",thumbnail:e("img",{src:b,alt:y??""}),subtitle:g,chip:c(N),description:U?i(s,{children:[e(u,{size:16})," Last Active ",e("strong",{children:new Date(U).toDateString()})]}):"No activity found!",footer:e(n,{actions:v})})}export{f as SystemUserListCard};
|
|
2
|
+
//# sourceMappingURL=SystemUserListCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemUserListCard.js","sources":["../../../../../src/client/ui/System/SystemUser/SystemUserListCard.tsx"],"sourcesContent":["\"use client\";\n\nimport type { User } from \"@clerk/nextjs/server\";\nimport {\n CollectionItemCard,\n CollectionItemCardActions,\n type DocumentAction,\n List,\n ListItem,\n} from \"@studiocubics/components\";\nimport { toCapitalised } from \"@studiocubics/utils\";\nimport {\n BrickWallShield,\n EllipsisVertical,\n History,\n OctagonX,\n} from \"lucide-react\";\nimport Link from \"next/link\";\nimport { SystemUserDeleteListItem } from \"./SystemUserActions\";\nimport type { Route } from \"next\";\nimport type { Role } from \"../../../clerk/rbacConfig\";\n\nexport interface SystemUserListCardProps {\n id: User[\"id\"];\n fullName: User[\"fullName\"];\n imageUrl: User[\"imageUrl\"];\n emailAddress?: NonNullable<User[\"primaryEmailAddress\"]>[\"emailAddress\"];\n role?: Role;\n lastSignInAt?: User[\"lastActiveAt\"];\n}\n\nexport function SystemUserListCard(props: SystemUserListCardProps) {\n const { id, fullName, imageUrl, emailAddress, role, lastSignInAt } = props;\n const actions: DocumentAction[] = [\n {\n actionType: \"link\",\n icon: <BrickWallShield />,\n label: \"View Sessions\",\n href: `/dashboard/security/systemUsers/${id}/sessions`,\n prefetch: true,\n // @ts-expect-error\n // This is dumb polymorphism garbage!\n as: Link,\n },\n {\n actionType: \"popover\",\n icon: <EllipsisVertical />,\n popoverChildren: (\n <List className=\"surfaceContainer\">\n <SystemUserDeleteListItem uid={id} fullName={fullName} />\n <ListItem\n {...{\n startIcon: <OctagonX />,\n children: \"Ban User\",\n color: \"error\",\n }}\n />\n </List>\n ),\n },\n ];\n\n return (\n <CollectionItemCard\n as={Link}\n href={`/dashboard/security/systemUsers/${id}` as Route}\n title={fullName ?? \"Name is missing\"}\n thumbnail={<img src={imageUrl} alt={fullName ?? \"\"} />}\n subtitle={emailAddress}\n chip={toCapitalised(role)}\n description={\n lastSignInAt ? (\n <>\n <History size={16} />\n  Last Active \n <strong>{new Date(lastSignInAt).toDateString()}</strong>\n </>\n ) : (\n \"No activity found!\"\n )\n }\n footer={<CollectionItemCardActions actions={actions} />}\n />\n );\n}\n"],"names":["SystemUserListCard","props","id","fullName","imageUrl","emailAddress","role","lastSignInAt","actions","actionType","icon","_jsx","BrickWallShield","label","href","prefetch","as","Link","EllipsisVertical","popoverChildren","_jsxs","List","className","children","SystemUserDeleteListItem","uid","ListItem","startIcon","OctagonX","color","CollectionItemCard","title","thumbnail","src","alt","subtitle","chip","toCapitalised","description","_Fragment","History","size","Date","toDateString","footer","CollectionItemCardActions"],"mappings":"ibA+BM,SAAUA,EAAmBC,GACjC,MAAMC,GAAEA,EAAEC,SAAEA,EAAQC,SAAEA,EAAQC,aAAEA,EAAYC,KAAEA,EAAIC,aAAEA,GAAiBN,EAC/DO,EAA4B,CAChC,CACEC,WAAY,OACZC,KAAMC,EAACC,EAAe,IACtBC,MAAO,gBACPC,KAAM,mCAAmCZ,aACzCa,UAAU,EAGVC,GAAIC,GAEN,CACER,WAAY,UACZC,KAAMC,EAACO,EAAgB,IACvBC,gBACEC,EAACC,EAAI,CAACC,UAAU,mBAAkBC,SAAA,CAChCZ,EAACa,EAAwB,CAACC,IAAKvB,EAAIC,SAAUA,IAC7CQ,EAACe,EAAQ,CAELC,UAAWhB,EAACiB,EAAQ,IACpBL,SAAU,WACVM,MAAO,eAQnB,OACElB,EAACmB,GACCd,GAAIC,EACJH,KAAM,mCAAmCZ,IACzC6B,MAAO5B,GAAY,kBACnB6B,UAAWrB,EAAA,MAAA,CAAKsB,IAAK7B,EAAU8B,IAAK/B,GAAY,KAChDgC,SAAU9B,EACV+B,KAAMC,EAAc/B,GACpBgC,YACE/B,EACEa,EAAAmB,EAAA,CAAAhB,SAAA,CACEZ,EAAC6B,EAAO,CAACC,KAAM,qBAEf9B,EAAA,SAAA,CAAAY,SAAS,IAAImB,KAAKnC,GAAcoC,oBAC/B,qBAKPC,OAAQjC,EAACkC,GAA0BrC,QAASA,KAGlD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{SYSTEM_USERS_PAGE_LIMIT as r}from"../../../constants/pageLimits.js";import{PageLayoutPagination as i}from"@studiocubics/components";import{SystemUserListActions as s}from"./SystemUserListActions.js";import{SystemUserList as e}from"./SystemUserList.js";import{SystemUserListPagination as o}from"./SystemUserListPagination.js";async function m({searchParams:m,securityLinks:n}){const a=await m,c=Number(a.page??1),p=String(a.orderBy??"created_at"),f=String(a.query??""),u={limit:r,offset:(c-1)*r,orderBy:p,query:f};return t(i,{actions:t(s,{}),size:"sm",title:n[2]?.children,paginationComponent:t(o,{page:c,...u}),children:t(e,{...u})})}export{m as SystemUserListPage};
|
|
2
|
+
//# sourceMappingURL=SystemUserListPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemUserListPage.js","sources":["../../../../../src/client/ui/System/SystemUser/SystemUserListPage.tsx"],"sourcesContent":["import { SYSTEM_USERS_PAGE_LIMIT as limit } from \"../../../constants/pageLimits\";\nimport type { SecurityPageProps } from \"../types\";\nimport { PageLayoutPagination } from \"@studiocubics/components\";\nimport { SystemUserListActions } from \"./SystemUserListActions\";\nimport { SystemUserList } from \"./SystemUserList\";\nimport { SystemUserListPagination } from \"./SystemUserListPagination\";\n\nexport async function SystemUserListPage({\n searchParams,\n securityLinks,\n}: SecurityPageProps) {\n const sp = await searchParams;\n const page = Number(sp.page ?? 1);\n const orderBy = String(sp.orderBy ?? \"created_at\");\n const query = String(sp.query ?? \"\");\n const offset = (page - 1) * limit;\n const params = {\n limit,\n offset,\n orderBy,\n query,\n };\n return (\n <PageLayoutPagination\n actions={<SystemUserListActions />}\n size=\"sm\"\n title={securityLinks[2]?.children}\n paginationComponent={<SystemUserListPagination page={page} {...params} />}\n >\n <SystemUserList {...params} />\n </PageLayoutPagination>\n );\n}\n"],"names":["async","SystemUserListPage","searchParams","securityLinks","sp","page","Number","orderBy","String","query","params","limit","offset","_jsx","PageLayoutPagination","actions","SystemUserListActions","size","title","children","paginationComponent","SystemUserListPagination","SystemUserList"],"mappings":"oXAOOA,eAAeC,GAAmBC,aACvCA,EAAYC,cACZA,IAEA,MAAMC,QAAWF,EACXG,EAAOC,OAAOF,EAAGC,MAAQ,GACzBE,EAAUC,OAAOJ,EAAGG,SAAW,cAC/BE,EAAQD,OAAOJ,EAAGK,OAAS,IAE3BC,EAAS,OACbC,EACAC,QAHcP,EAAO,GAAKM,EAI1BJ,UACAE,SAEF,OACEI,EAACC,GACCC,QAASF,EAACG,EAAqB,CAAA,GAC/BC,KAAK,KACLC,MAAOf,EAAc,IAAIgB,SACzBC,oBAAqBP,EAACQ,EAAwB,CAAChB,KAAMA,KAAUK,IAAUS,SAEzEN,EAACS,EAAc,IAAKZ,KAG1B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{NextSSRPagination as r}from"@studiocubics/next";import{systemUserListReadAction as o}from"../../../../server/clerk/actions/systemUsers.js";async function i({page:i,...e}){const s=await o(e);return t(r,{page:i,limit:e.limit,total:s.totalCount})}export{i as SystemUserListPagination};
|
|
2
|
+
//# sourceMappingURL=SystemUserListPagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemUserListPagination.js","sources":["../../../../../src/client/ui/System/SystemUser/SystemUserListPagination.tsx"],"sourcesContent":["import { NextSSRPagination } from \"@studiocubics/next\";\nimport { systemUserListReadAction } from \"../../../../server/clerk/actions/systemUsers\";\n\nexport async function SystemUserListPagination({\n page,\n ...params\n}: {\n page: number;\n limit: number;\n} & ClerkUserListParams) {\n const systemUsersList = await systemUserListReadAction(params);\n return (\n <NextSSRPagination\n page={page}\n limit={params.limit}\n total={systemUsersList.totalCount}\n />\n );\n}\n"],"names":["async","SystemUserListPagination","page","params","systemUsersList","systemUserListReadAction","_jsx","NextSSRPagination","limit","total","totalCount"],"mappings":"0LAGOA,eAAeC,GAAyBC,KAC7CA,KACGC,IAKH,MAAMC,QAAwBC,EAAyBF,GACvD,OACEG,EAACC,EAAiB,CAChBL,KAAMA,EACNM,MAAOL,EAAOK,MACdC,MAAOL,EAAgBM,YAG7B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as r,Fragment as e,jsx as s}from"react/jsx-runtime";import{PageTitle as t,Breadcrumbs as i}from"@studiocubics/components";import{SystemUserPageContent as o}from"./SystemUserPageContent.js";import m from"next/link";import{auth as a}from"../../../../server/clerk/auth.js";import{systemUserReadAction as n}from"../../../../server/clerk/actions/systemUsers.js";async function c({params:c}){const l=(await c).userId,d=await a(),u=await d.hasPermission("systemUsers","update"),h=await n(l);return r(e,{children:[s(t,{size:"sm",title:r(i,{defaultActive:1,children:[s("h4",{children:s(m,{href:"/dashboard/security/systemUsers",children:"System Users"})}),r("h4",{children:[h.fullName,"'s Account"]})]}),noBorders:!0}),s(o,{user:h,allowEdit:u})]})}export{c as SystemUserPage};
|
|
2
|
+
//# sourceMappingURL=SystemUserPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemUserPage.js","sources":["../../../../../src/client/ui/System/SystemUser/SystemUserPage.tsx"],"sourcesContent":["import { Breadcrumbs, PageTitle } from \"@studiocubics/components\";\nimport { SystemUserPageContent } from \"./SystemUserPageContent\";\nimport Link from \"next/link\";\nimport { auth } from \"../../../../server/clerk/auth\";\nimport { systemUserReadAction } from \"../../../../server/clerk/actions/systemUsers\";\nexport async function SystemUserPage({\n params,\n}: PageProps<\"/dashboard/security/systemUsers/[userId]\">) {\n const userId = (await params).userId;\n const session = await auth();\n const allowEdit = await session.hasPermission(\"systemUsers\", \"update\");\n const user = await systemUserReadAction(userId);\n return (\n <>\n <PageTitle\n size=\"sm\"\n title={\n <Breadcrumbs defaultActive={1}>\n <h4>\n <Link href={\"/dashboard/security/systemUsers\"}>System Users</Link>\n </h4>\n <h4>{user.fullName}'s Account</h4>\n </Breadcrumbs>\n }\n noBorders\n />\n <SystemUserPageContent user={user} allowEdit={allowEdit} />\n </>\n );\n}\n"],"names":["async","SystemUserPage","params","userId","session","auth","allowEdit","hasPermission","user","systemUserReadAction","_jsxs","_jsx","PageTitle","size","title","Breadcrumbs","defaultActive","children","Link","href","fullName","noBorders","SystemUserPageContent"],"mappings":"iXAKOA,eAAeC,GAAeC,OACnCA,IAEA,MAAMC,SAAgBD,GAAQC,OACxBC,QAAgBC,IAChBC,QAAkBF,EAAQG,cAAc,cAAe,UACvDC,QAAaC,EAAqBN,GACxC,OACEO,eACEC,EAACC,GACCC,KAAK,KACLC,MACEJ,EAACK,EAAW,CAACC,cAAe,EAACC,SAAA,CAC3BN,iBACEA,EAACO,EAAI,CAACC,KAAM,8DAEdT,EAAA,KAAA,CAAAO,SAAA,CAAKT,EAAKY,4BAGdC,WAAS,IAEXV,EAACW,EAAqB,CAACd,KAAMA,EAAMF,UAAWA,MAGpD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as s}from"react/jsx-runtime";import{SectionWrapper as i}from"@studiocubics/components";import{SystemUserDetails as r}from"./SystemUserDetails/SystemUserDetails.js";import{SystemUserRole as l}from"./SystemUserRole/SystemUserRole.js";import{SystemUserTimestamps as m}from"./SystemUserTimestamps.js";import a from"next/link";function o({allowEdit:o,user:d}){return e(t,{children:[s(i,{title:"Account Details",noBorders:!0,children:s(r,{editable:o,id:d.id,fullName:d.fullName,firstName:d.firstName,lastName:d.lastName,imageUrl:d.imageUrl,emailAddress:d.primaryEmailAddress?.emailAddress})}),s(i,{title:"Account Timestamps",children:s(m,{createdAt:d.createdAt,updatedAt:d.updatedAt,lastSignInAt:d.lastSignInAt})}),s(i,{title:"Assigned Role",children:s(l,{role:d.publicMetadata.role,editable:o})}),s(i,{title:"Active Sessions",subtitle:s("p",{style:{fontSize:"var(--fs-body2)"},children:s(a,{href:`/dashboard/security/systemUsers/${d.id}/sessions`,children:"View All Sessions"})})})]})}export{o as SystemUserPageContent};
|
|
2
|
+
//# sourceMappingURL=SystemUserPageContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemUserPageContent.js","sources":["../../../../../src/client/ui/System/SystemUser/SystemUserPageContent.tsx"],"sourcesContent":["import { SectionWrapper } from \"@studiocubics/components\";\nimport { SystemUserDetails } from \"./SystemUserDetails/SystemUserDetails\";\nimport { SystemUserRole } from \"./SystemUserRole/SystemUserRole\";\nimport { SystemUserTimestamps } from \"./SystemUserTimestamps\";\nimport Link from \"next/link\";\nimport type { User } from \"@clerk/nextjs/server\";\nimport type { Role } from \"../../../clerk/rbacConfig\";\n\nexport function SystemUserPageContent({\n allowEdit,\n user,\n}: {\n allowEdit: boolean;\n user: User;\n}) {\n return (\n <>\n <SectionWrapper title={\"Account Details\"} noBorders>\n <SystemUserDetails\n editable={allowEdit}\n id={user.id}\n fullName={user.fullName}\n firstName={user.firstName}\n lastName={user.lastName}\n imageUrl={user.imageUrl}\n emailAddress={user.primaryEmailAddress?.emailAddress}\n />\n </SectionWrapper>\n <SectionWrapper title={\"Account Timestamps\"}>\n <SystemUserTimestamps\n createdAt={user.createdAt}\n updatedAt={user.updatedAt}\n lastSignInAt={user.lastSignInAt}\n />\n </SectionWrapper>\n <SectionWrapper title={\"Assigned Role\"}>\n <SystemUserRole\n role={user.publicMetadata.role as Role}\n editable={allowEdit}\n />\n </SectionWrapper>\n <SectionWrapper\n title={\"Active Sessions\"}\n subtitle={\n <p style={{ fontSize: \"var(--fs-body2)\" }}>\n <Link href={`/dashboard/security/systemUsers/${user.id}/sessions`}>\n View All Sessions\n </Link>\n </p>\n }\n ></SectionWrapper>\n </>\n );\n}\n"],"names":["SystemUserPageContent","allowEdit","user","_jsxs","_Fragment","children","_jsx","SectionWrapper","title","noBorders","SystemUserDetails","editable","id","fullName","firstName","lastName","imageUrl","emailAddress","primaryEmailAddress","SystemUserTimestamps","createdAt","updatedAt","lastSignInAt","SystemUserRole","role","publicMetadata","subtitle","style","fontSize","Link","href"],"mappings":"8WAQgBA,GAAsBC,UACpCA,EAASC,KACTA,IAKA,OACEC,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,GAAeC,MAAO,kBAAmBC,WAAS,EAAAJ,SACjDC,EAACI,GACCC,SAAUV,EACVW,GAAIV,EAAKU,GACTC,SAAUX,EAAKW,SACfC,UAAWZ,EAAKY,UAChBC,SAAUb,EAAKa,SACfC,SAAUd,EAAKc,SACfC,aAAcf,EAAKgB,qBAAqBD,iBAG5CX,EAACC,EAAc,CAACC,MAAO,8BACrBF,EAACa,EAAoB,CACnBC,UAAWlB,EAAKkB,UAChBC,UAAWnB,EAAKmB,UAChBC,aAAcpB,EAAKoB,iBAGvBhB,EAACC,EAAc,CAACC,MAAO,gBAAeH,SACpCC,EAACiB,EAAc,CACbC,KAAMtB,EAAKuB,eAAeD,KAC1Bb,SAAUV,MAGdK,EAACC,EAAc,CACbC,MAAO,kBACPkB,SACEpB,EAAA,IAAA,CAAGqB,MAAO,CAAEC,SAAU,mBAAmBvB,SACvCC,EAACuB,EAAI,CAACC,KAAM,mCAAmC5B,EAAKU,cAAaP,SAAA,4BAQ7E"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsxs as r,Fragment as o,jsx as i}from"react/jsx-runtime";import{toCapitalised as e}from"@studiocubics/utils";import{User as n,Edit as s}from"lucide-react";import{TransitionAnimation as t,Tooltip as m,Button as c}from"@studiocubics/components";import l from"next/link";import{useDisclosure as d}from"@studiocubics/hooks";import a from"./SystemUserRole.module.css.js";import{RBAC_CONFIG as u}from"../../../../clerk/rbacConfig.js";import{SystemUserRoleForm as p}from"../SystemUserRoleForm/SystemUserRoleForm.js";function h({role:h,editable:f}){const y=u[h],{open:O,handleOpen:b,handleClose:x}=d();return y?r(o,{children:[i(t,{in:!O,transformOrigin:"top",mountOnly:!0,unmountOnExit:!0,children:r("div",{className:a.root,children:[r("div",{className:a.main,children:[i(m,{renderArrow:!0,title:"View resource permissions",children:i(c,{as:l,variant:"contained",color:"primary",startIcon:i(n,{size:16}),size:"sm",href:`/dashboard/security/permissions/${h}`,children:e(h)})}),i("p",{children:y.desc})]}),f&&i(c,{size:"sm",startIcon:i(s,{}),onClick:b,children:"Edit Role"})]})}),i(t,{in:O,transformOrigin:"top right",mountOnly:!0,unmountOnExit:!0,children:i(p,{role:h,onClose:x})})]}):null}export{h as SystemUserRole};
|
|
2
|
+
//# sourceMappingURL=SystemUserRole.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemUserRole.js","sources":["../../../../../../src/client/ui/System/SystemUser/SystemUserRole/SystemUserRole.tsx"],"sourcesContent":["\"use client\";\n\nimport { toCapitalised } from \"@studiocubics/utils\";\nimport { Edit, User } from \"lucide-react\";\nimport { Button, Tooltip, TransitionAnimation } from \"@studiocubics/components\";\nimport Link from \"next/link\";\nimport { useDisclosure } from \"@studiocubics/hooks\";\nimport styles from \"./SystemUserRole.module.css\";\nimport { RBAC_CONFIG, type Role } from \"../../../../clerk/rbacConfig\";\nimport type { Route } from \"next\";\nimport { SystemUserRoleForm } from \"../SystemUserRoleForm/SystemUserRoleForm\";\n\nexport interface SystemUserRoleProps {\n role: Role;\n editable?: boolean;\n}\n\nexport function SystemUserRole({ role, editable }: SystemUserRoleProps) {\n const roleDetails = RBAC_CONFIG[role];\n const { open, handleOpen, handleClose } = useDisclosure();\n if (!roleDetails) return null;\n\n return (\n <>\n <TransitionAnimation\n in={!open}\n transformOrigin={\"top\"}\n mountOnly\n unmountOnExit\n >\n <div className={styles.root}>\n <div className={styles.main}>\n <Tooltip renderArrow title={\"View resource permissions\"}>\n <Button\n as={Link}\n variant=\"contained\"\n color=\"primary\"\n startIcon={<User size={16} />}\n size=\"sm\"\n href={`/dashboard/security/permissions/${role}` as Route}\n >\n {toCapitalised(role)}\n </Button>\n </Tooltip>\n <p>{roleDetails.desc}</p>\n </div>\n {editable && (\n <Button size=\"sm\" startIcon={<Edit />} onClick={handleOpen}>\n Edit Role\n </Button>\n )}\n </div>\n </TransitionAnimation>\n <TransitionAnimation\n in={open}\n transformOrigin={\"top right\"}\n mountOnly\n unmountOnExit\n >\n <SystemUserRoleForm role={role} onClose={handleClose} />\n </TransitionAnimation>\n </>\n );\n}\n"],"names":["SystemUserRole","role","editable","roleDetails","RBAC_CONFIG","open","handleOpen","handleClose","useDisclosure","_jsxs","_Fragment","children","_jsx","TransitionAnimation","in","transformOrigin","mountOnly","unmountOnExit","className","styles","root","main","Tooltip","renderArrow","title","Button","as","Link","variant","color","startIcon","User","size","href","toCapitalised","desc","Edit","onClick","SystemUserRoleForm","onClose"],"mappings":"0hBAiBgBA,GAAeC,KAAEA,EAAIC,SAAEA,IACrC,MAAMC,EAAcC,EAAYH,IAC1BI,KAAEA,EAAIC,WAAEA,EAAUC,YAAEA,GAAgBC,IAC1C,OAAKL,EAGHM,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,GACCC,IAAKT,EACLU,gBAAiB,MACjBC,WAAS,EACTC,eAAa,EAAAN,SAEbF,EAAA,MAAA,CAAKS,UAAWC,EAAOC,KAAIT,SAAA,CACzBF,EAAA,MAAA,CAAKS,UAAWC,EAAOE,eACrBT,EAACU,EAAO,CAACC,aAAW,EAACC,MAAO,qCAC1BZ,EAACa,EAAM,CACLC,GAAIC,EACJC,QAAQ,YACRC,MAAM,UACNC,UAAWlB,EAACmB,EAAI,CAACC,KAAM,KACvBA,KAAK,KACLC,KAAM,mCAAmChC,IAAeU,SAEvDuB,EAAcjC,OAGnBW,EAAA,IAAA,CAAAD,SAAIR,EAAYgC,UAEjBjC,GACCU,EAACa,GAAOO,KAAK,KAAKF,UAAWlB,EAACwB,EAAI,CAAA,GAAKC,QAAS/B,EAAUK,SAAA,mBAMhEC,EAACC,EAAmB,CAClBC,GAAIT,EACJU,gBAAiB,YACjBC,WAAS,EACTC,eAAa,EAAAN,SAEbC,EAAC0B,EAAkB,CAACrC,KAAMA,EAAMsC,QAAShC,SAvCtB,IA2C3B"}
|
package/dist/{ui → client/ui}/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js.map
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemUserRole.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SystemUserRole.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import{Card as e,ConfirmationForm as o,Select as i}from"@studiocubics/components";import{initialiseForm as t,toCapitalised as l}from"@studiocubics/utils";import{roles as n}from"../../../../clerk/rbacConfig.js";import{useActionState as s}from"react";import"../../../../../server/clerk/actions/invitations.js";import{systemUserRoleUpdateAction as c}from"../../../../../server/clerk/actions/systemUsers.js";import"@clerk/nextjs/server";import"../../../../../server/clerk/schemas/invitation.js";const m=t("role");function a({role:t,onClose:a,...u}){const[d,f,p]=s(c.bind(null,"hello"),m);return r(e,{...u,fullWidth:!0,children:r(o,{variant:"danger",confirmText:"Change Role",action:f,formTitle:"Edit Role",onCancel:a,children:r(i,{label:"Current role",error:d.fieldErrors?.role,defaultValue:t,disabled:p,children:n.map(e=>r("option",{value:e,children:l(e)},e))})})})}export{a as SystemUserRoleForm};
|
|
2
|
+
//# sourceMappingURL=SystemUserRoleForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemUserRoleForm.js","sources":["../../../../../../src/client/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type CardProps,\n Card,\n ConfirmationForm,\n Select,\n} from \"@studiocubics/components\";\nimport { initialiseForm, toCapitalised } from \"@studiocubics/utils\";\nimport { type Role, roles } from \"../../../../clerk/rbacConfig\";\nimport { useActionState } from \"react\";\nimport { systemUserRoleUpdateAction } from \"../../../../../server/clerk/_index\";\n\nconst initialSystemUserRoleUpdateState = initialiseForm(\"role\");\n\nexport type SystemUserRoleUpdateState = typeof initialSystemUserRoleUpdateState;\n\nexport function SystemUserRoleForm({\n role,\n onClose,\n ...rest\n}: { role: Role; onClose(): void } & CardProps) {\n const [state, action, pending] = useActionState(\n systemUserRoleUpdateAction.bind(null, \"hello\"),\n initialSystemUserRoleUpdateState,\n );\n return (\n <Card {...rest} fullWidth>\n <ConfirmationForm\n variant=\"danger\"\n confirmText=\"Change Role\"\n action={action}\n formTitle=\"Edit Role\"\n onCancel={onClose}\n >\n <Select\n label=\"Current role\"\n error={state.fieldErrors?.role}\n defaultValue={role}\n disabled={pending}\n >\n {roles.map((r) => (\n <option key={r} value={r}>\n {toCapitalised(r)}\n </option>\n ))}\n </Select>\n </ConfirmationForm>\n </Card>\n );\n}\n"],"names":["initialSystemUserRoleUpdateState","initialiseForm","SystemUserRoleForm","role","onClose","rest","state","action","pending","useActionState","systemUserRoleUpdateAction","bind","_jsx","Card","fullWidth","children","ConfirmationForm","variant","confirmText","formTitle","onCancel","Select","label","error","fieldErrors","defaultValue","disabled","roles","map","r","value","toCapitalised"],"mappings":"giBAaA,MAAMA,EAAmCC,EAAe,QAIlD,SAAUC,GAAmBC,KACjCA,EAAIC,QACJA,KACGC,IAEH,MAAOC,EAAOC,EAAQC,GAAWC,EAC/BC,EAA2BC,KAAK,KAAM,SACtCX,GAEF,OACEY,EAACC,EAAI,IAAKR,EAAMS,WAAS,EAAAC,SACvBH,EAACI,GACCC,QAAQ,SACRC,YAAY,cACZX,OAAQA,EACRY,UAAU,YACVC,SAAUhB,EAAOW,SAEjBH,EAACS,EAAM,CACLC,MAAM,eACNC,MAAOjB,EAAMkB,aAAarB,KAC1BsB,aAActB,EACduB,SAAUlB,WAETmB,EAAMC,IAAKC,GACVjB,YAAgBkB,MAAOD,EAACd,SACrBgB,EAAcF,IADJA,SAQzB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{useUser as e}from"@clerk/nextjs";import{LabeledValue as i,Skeleton as a}from"@studiocubics/components";function n(){const{user:i,isLoaded:a}=e();return t(r,{isLoaded:a,createdAt:i?.createdAt,updatedAt:i?.updatedAt,lastSignInAt:i?.lastSignInAt})}function r(e){const{createdAt:n,updatedAt:r,lastSignInAt:m,isLoaded:d=!0}=e;return[{stamp:"Created at",time:n},{stamp:"Updated",time:r},{stamp:"Last Sign in",time:m}].map(e=>{let n=e.time&&"number"==typeof e.time?new Date(e.time):e.time;return t(i,{label:e.stamp,children:d?e.time?n?.toLocaleString():"-":t(a,{width:150,height:24})},e.stamp)})}export{n as CurrentSystemUserTimestamps,r as SystemUserTimestamps};
|
|
2
|
+
//# sourceMappingURL=SystemUserTimestamps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemUserTimestamps.js","sources":["../../../../../src/client/ui/System/SystemUser/SystemUserTimestamps.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@clerk/nextjs\";\nimport type { User } from \"@clerk/nextjs/server\";\nimport { LabeledValue, Skeleton } from \"@studiocubics/components\";\n\nexport function CurrentSystemUserTimestamps() {\n const { user, isLoaded } = useUser();\n // if (!user) return null;\n return (\n <SystemUserTimestamps\n isLoaded={isLoaded}\n createdAt={user?.createdAt}\n updatedAt={user?.updatedAt}\n lastSignInAt={user?.lastSignInAt}\n />\n );\n}\nexport interface SystemUserTimestampsProps {\n createdAt?: User[\"createdAt\"] | NonNullable<ClerkClientUser>[\"createdAt\"];\n updatedAt?: User[\"updatedAt\"] | NonNullable<ClerkClientUser>[\"updatedAt\"];\n lastSignInAt?:\n | User[\"lastSignInAt\"]\n | NonNullable<ClerkClientUser>[\"lastSignInAt\"];\n isLoaded?: boolean;\n}\n\nexport function SystemUserTimestamps(props: SystemUserTimestampsProps) {\n const { createdAt, updatedAt, lastSignInAt, isLoaded = true } = props;\n const timestamps = [\n { stamp: \"Created at\", time: createdAt },\n { stamp: \"Updated\", time: updatedAt },\n { stamp: \"Last Sign in\", time: lastSignInAt },\n ];\n\n return timestamps.map((timestamp) => {\n let timestampTime =\n timestamp.time && typeof timestamp.time == \"number\"\n ? new Date(timestamp.time)\n : timestamp.time;\n\n return (\n <LabeledValue key={timestamp.stamp} label={timestamp.stamp}>\n {isLoaded ? (\n !timestamp.time ? (\n \"-\"\n ) : (\n timestampTime?.toLocaleString()\n )\n ) : (\n <Skeleton width={150} height={24} />\n )}\n </LabeledValue>\n );\n });\n}\n"],"names":["CurrentSystemUserTimestamps","user","isLoaded","useUser","_jsx","SystemUserTimestamps","createdAt","updatedAt","lastSignInAt","props","stamp","time","map","timestamp","timestampTime","Date","LabeledValue","label","children","toLocaleString","Skeleton","width","height"],"mappings":"4KAMgBA,IACd,MAAMC,KAAEA,EAAIC,SAAEA,GAAaC,IAE3B,OACEC,EAACC,EAAoB,CACnBH,SAAUA,EACVI,UAAWL,GAAMK,UACjBC,UAAWN,GAAMM,UACjBC,aAAcP,GAAMO,cAG1B,CAUM,SAAUH,EAAqBI,GACnC,MAAMH,UAAEA,EAASC,UAAEA,EAASC,aAAEA,EAAYN,SAAEA,GAAW,GAASO,EAOhE,MANmB,CACjB,CAAEC,MAAO,aAAcC,KAAML,GAC7B,CAAEI,MAAO,UAAWC,KAAMJ,GAC1B,CAAEG,MAAO,eAAgBC,KAAMH,IAGfI,IAAKC,IACrB,IAAIC,EACFD,EAAUF,MAAiC,iBAAlBE,EAAUF,KAC/B,IAAII,KAAKF,EAAUF,MACnBE,EAAUF,KAEhB,OACEP,EAACY,EAAY,CAAuBC,MAAOJ,EAAUH,MAAKQ,SACvDhB,EACEW,EAAUF,KAGTG,GAAeK,iBAHF,IAMff,EAACgB,EAAQ,CAACC,MAAO,IAAKC,OAAQ,MARfT,EAAUH,QAanC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Button as r,CubicsUILogo as t,PoweredByBanner as n}from"@studiocubics/components";import a from"./WelcomePage.module.css.js";import c from"next/link";import{LogIn as i,LayoutDashboardIcon as l}from"lucide-react";import{auth as d}from"../../../../server/clerk/auth.js";async function s(){const{userId:s}=await d(),m=e(c,{href:"/auth/signIn/",children:e(r,{variant:"contained",endIcon:e(i,{}),children:"Get Started"})}),h=e(c,{href:"/dashboard",children:e(r,{variant:"contained",endIcon:e(l,{}),children:"Go to dashboard"})});return o("div",{className:a.root,children:[e(t,{width:"10rem",height:"auto",onlyFavicon:!0}),e(n,{size:"md"}),e("h2",{children:"Welcome to Cubics CMS!"}),e("p",{className:a.desc,children:"A powerful and intuitive platform to manage your content effortlessly. Streamline updates, enhance collaboration, and take full control of your digital presence."}),s?h:m,!s&&o("p",{className:a.catcall,children:["Dont have an account? ",e(c,{href:"/auth/requestAccount",children:"Request from an admin"})]})]})}export{s as WelcomePage};
|
|
2
|
+
//# sourceMappingURL=WelcomePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomePage.js","sources":["../../../../../src/client/ui/System/WelcomePage/WelcomePage.tsx"],"sourcesContent":["import { Button, CubicsUILogo, PoweredByBanner } from \"@studiocubics/components\";\nimport styles from \"./WelcomePage.module.css\";\nimport Link from \"next/link\";\nimport { LayoutDashboardIcon, LogIn } from \"lucide-react\";\nimport { auth } from \"../../../../server/clerk/auth\";\nexport async function WelcomePage() {\n const { userId } = await auth();\n const loggedOutUser = (\n <Link href={\"/auth/signIn/\"}>\n <Button variant=\"contained\" endIcon={<LogIn />}>\n Get Started\n </Button>\n </Link>\n );\n const loggedInUser = (\n <Link href={\"/dashboard\"}>\n <Button variant=\"contained\" endIcon={<LayoutDashboardIcon />}>\n Go to dashboard\n </Button>\n </Link>\n );\n return (\n <div className={styles.root}>\n <CubicsUILogo width={\"10rem\"} height={\"auto\"} onlyFavicon />\n <PoweredByBanner size={\"md\"} />\n <h2>Welcome to Cubics CMS!</h2>\n <p className={styles.desc}>\n A powerful and intuitive platform to manage your content effortlessly.\n Streamline updates, enhance collaboration, and take full control of your\n digital presence.\n </p>\n {userId ? loggedInUser : loggedOutUser}\n {!userId && (\n <p className={styles.catcall}>\n Dont have an account? \n {/* TODO add request account from admin flow.\n //@ts-ignore */}\n <Link href=\"/auth/requestAccount\">Request from an admin</Link>\n </p>\n )}\n </div>\n );\n}\n"],"names":["async","WelcomePage","userId","auth","loggedOutUser","_jsx","Link","href","children","Button","variant","endIcon","LogIn","loggedInUser","LayoutDashboardIcon","_jsxs","className","styles","root","CubicsUILogo","width","height","onlyFavicon","PoweredByBanner","size","desc","catcall"],"mappings":"qUAKOA,eAAeC,IACpB,MAAMC,OAAEA,SAAiBC,IACnBC,EACJC,EAACC,GAAKC,KAAM,gBAAeC,SACzBH,EAACI,GAAOC,QAAQ,YAAYC,QAASN,EAACO,EAAK,CAAA,GAAGJ,SAAA,kBAK5CK,EACJR,EAACC,GAAKC,KAAM,aAAYC,SACtBH,EAACI,GAAOC,QAAQ,YAAYC,QAASN,EAACS,EAAmB,CAAA,GAAGN,SAAA,sBAKhE,OACEO,EAAA,MAAA,CAAKC,UAAWC,EAAOC,KAAIV,SAAA,CACzBH,EAACc,EAAY,CAACC,MAAO,QAASC,OAAQ,OAAQC,aAAW,IACzDjB,EAACkB,EAAe,CAACC,KAAM,OACvBnB,EAAA,KAAA,CAAAG,SAAA,2BACAH,EAAA,IAAA,CAAGW,UAAWC,EAAOQ,KAAIjB,SAAA,sKAKxBN,EAASW,EAAeT,GACvBF,GACAa,EAAA,IAAA,CAAGC,UAAWC,EAAOS,QAAOlB,SAAA,CAAA,yBAI1BH,EAACC,EAAI,CAACC,KAAK,uBAAsBC,SAAA,+BAK3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WelcomePage.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WelcomePage.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TabProps } from "@studiocubics/components";
|
|
2
|
-
import type { AppRoutes } from "
|
|
2
|
+
import type { AppRoutes } from "../../../routes";
|
|
3
3
|
export type SecurityPageProps<T extends AppRoutes = "/dashboard/security"> = PageProps<T> & {
|
|
4
4
|
securityLinks: TabProps[];
|
|
5
5
|
};
|
package/dist/index.css
CHANGED
|
@@ -1,215 +1 @@
|
|
|
1
|
-
.ThemedMonacoEditor-
|
|
2
|
-
border-radius: var(--shape-br-sm);
|
|
3
|
-
overflow: hidden;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.CMSSidebarHeader-module_root__7p0w6 {
|
|
7
|
-
flex: 1;
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: row;
|
|
10
|
-
align-items: center;
|
|
11
|
-
padding-inline: 8.33%;
|
|
12
|
-
gap: var(--spacing-gap);
|
|
13
|
-
|
|
14
|
-
padding-top: var(--spacing-gap-3);
|
|
15
|
-
padding-bottom: var(--spacing-gap-2);
|
|
16
|
-
transition: padding var(--transition-time) var(--transition-tf);
|
|
17
|
-
}
|
|
18
|
-
.CMSSidebarHeader-module_logoContainer__KTkmc {
|
|
19
|
-
flex: 1;
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: flex-start;
|
|
22
|
-
align-items: center;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.CMSSidebarHeader-module_logo__YED-6 {
|
|
26
|
-
max-width: 6rem;
|
|
27
|
-
height: auto;
|
|
28
|
-
width: 40%;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@media (min-width: 600px) {
|
|
32
|
-
.CMSSidebarHeader-module_root__7p0w6 {
|
|
33
|
-
flex: 0 1 0%;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
align-items: center;
|
|
36
|
-
padding-inline: 0;
|
|
37
|
-
}
|
|
38
|
-
.CMSSidebarHeader-module_root__7p0w6[data-open="true"] {
|
|
39
|
-
flex-direction: row;
|
|
40
|
-
justify-content: space-between;
|
|
41
|
-
padding-top: var(--spacing-gap-2);
|
|
42
|
-
& .CMSSidebarHeader-module_logo__YED-6 {
|
|
43
|
-
width: 100%;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
.CMSSidebarHeader-module_logoContainer__KTkmc {
|
|
47
|
-
justify-content: center;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.CMSSidebarFooter-module_root__155tB {
|
|
52
|
-
display: flex;
|
|
53
|
-
flex-direction: column;
|
|
54
|
-
justify-content: flex-end;
|
|
55
|
-
height: 100%;
|
|
56
|
-
gap: var(--spacing-gap-2);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.CurrentSystemUserButton-module_title__uZG7O {
|
|
60
|
-
display: flex;
|
|
61
|
-
align-items: center;
|
|
62
|
-
gap: var(--spacing-gap);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/* Yes this is seperate its meant to be separate dont make the SignUp and SignIn styles into one eventhough they are the exact same. Just dont do it ples! */
|
|
66
|
-
.SignIn-module_root__a85lb,
|
|
67
|
-
.SignIn-module_body__Sg2nG,
|
|
68
|
-
.SignIn-module_header__eyTQi,
|
|
69
|
-
.SignIn-module_form__myu4V,
|
|
70
|
-
.SignIn-module_footer__u-JMS {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
}
|
|
74
|
-
.SignIn-module_root__a85lb {
|
|
75
|
-
width: clamp(350px, 50vw, 550px);
|
|
76
|
-
align-items: center;
|
|
77
|
-
gap: var(--spacing-gap-7);
|
|
78
|
-
& p {
|
|
79
|
-
font-size: var(--fs-body2);
|
|
80
|
-
text-align: center;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
.SignIn-module_body__Sg2nG {
|
|
84
|
-
width: 100%;
|
|
85
|
-
align-items: center;
|
|
86
|
-
gap: var(--spacing-gap-3);
|
|
87
|
-
}
|
|
88
|
-
.SignIn-module_header__eyTQi {
|
|
89
|
-
align-items: center;
|
|
90
|
-
text-align: center;
|
|
91
|
-
gap: var(--spacing-gap);
|
|
92
|
-
& > h1 {
|
|
93
|
-
font-size: var(--fs-h3);
|
|
94
|
-
}
|
|
95
|
-
& > p {
|
|
96
|
-
font-size: var(--fs-body2);
|
|
97
|
-
color: var(--color-on-background-faint);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
.SignIn-module_form__myu4V {
|
|
101
|
-
width: 100%;
|
|
102
|
-
gap: var(--spacing-gap-2);
|
|
103
|
-
}
|
|
104
|
-
.SignIn-module_footer__u-JMS {
|
|
105
|
-
width: 100%;
|
|
106
|
-
padding: var(--spacing-gap-3);
|
|
107
|
-
align-items: center;
|
|
108
|
-
border-top: 1px solid var(--color-outline);
|
|
109
|
-
}
|
|
110
|
-
.SignIn-module_error__zk6qv {
|
|
111
|
-
font-size: 2rem;
|
|
112
|
-
color: var(--color-error);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
.SignUp-module_root__N7dct,
|
|
117
|
-
.SignUp-module_body__K80Nw,
|
|
118
|
-
.SignUp-module_header__2s9kc,
|
|
119
|
-
.SignUp-module_form__BDitR,
|
|
120
|
-
.SignUp-module_footer__YFJst {
|
|
121
|
-
display: flex;
|
|
122
|
-
flex-direction: column;
|
|
123
|
-
}
|
|
124
|
-
.SignUp-module_root__N7dct {
|
|
125
|
-
width: clamp(350px, 50vw, 550px);
|
|
126
|
-
align-items: center;
|
|
127
|
-
gap: var(--spacing-gap-7);
|
|
128
|
-
& p {
|
|
129
|
-
font-size: var(--fs-body2);
|
|
130
|
-
text-align: center;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
.SignUp-module_body__K80Nw {
|
|
134
|
-
width: 100%;
|
|
135
|
-
align-items: center;
|
|
136
|
-
gap: var(--spacing-gap-3);
|
|
137
|
-
}
|
|
138
|
-
.SignUp-module_header__2s9kc {
|
|
139
|
-
align-items: center;
|
|
140
|
-
text-align: center;
|
|
141
|
-
gap: var(--spacing-gap);
|
|
142
|
-
& > h1 {
|
|
143
|
-
font-size: var(--fs-h3);
|
|
144
|
-
}
|
|
145
|
-
& > p {
|
|
146
|
-
font-size: var(--fs-body2);
|
|
147
|
-
color: var(--color-on-background-faint);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
.SignUp-module_form__BDitR {
|
|
151
|
-
width: 100%;
|
|
152
|
-
gap: var(--spacing-gap-2);
|
|
153
|
-
}
|
|
154
|
-
.SignUp-module_footer__YFJst {
|
|
155
|
-
width: 100%;
|
|
156
|
-
padding: var(--spacing-gap-3);
|
|
157
|
-
align-items: center;
|
|
158
|
-
border-top: 1px solid var(--color-outline);
|
|
159
|
-
}
|
|
160
|
-
.SignUp-module_error__1HM-5 {
|
|
161
|
-
font-size: 2rem;
|
|
162
|
-
color: var(--color-error);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.SystemUserDetails-module_root__7fbdi {
|
|
166
|
-
display: flex;
|
|
167
|
-
justify-content: space-between;
|
|
168
|
-
align-items: flex-start;
|
|
169
|
-
width: 100%;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.SystemUserDetailsForm-module_form__JwtS6 {
|
|
173
|
-
flex: 1;
|
|
174
|
-
}
|
|
175
|
-
.SystemUserDetailsForm-module_formRow__wF0Cw {
|
|
176
|
-
display: flex;
|
|
177
|
-
gap: var(--spacing-gap);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.SystemUserRole-module_root__HlOLA {
|
|
181
|
-
display: flex;
|
|
182
|
-
justify-content: space-between;
|
|
183
|
-
align-items: flex-start;
|
|
184
|
-
width: 100%;
|
|
185
|
-
}
|
|
186
|
-
.SystemUserRole-module_main__X9g43 {
|
|
187
|
-
display: flex;
|
|
188
|
-
flex: 1;
|
|
189
|
-
flex-direction: column;
|
|
190
|
-
gap: var(--spacing-gap-2);
|
|
191
|
-
align-items: flex-start;
|
|
192
|
-
p {
|
|
193
|
-
font-size: var(--fs-body2);
|
|
194
|
-
color: var(--color-on-background-faint);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.WelcomePage-module_root__NQgmW {
|
|
199
|
-
display: flex;
|
|
200
|
-
flex-direction: column;
|
|
201
|
-
justify-content: center;
|
|
202
|
-
align-items: center;
|
|
203
|
-
gap: var(--spacing-gap-4);
|
|
204
|
-
width: 100dvw;
|
|
205
|
-
height: 100dvh;
|
|
206
|
-
}
|
|
207
|
-
.WelcomePage-module_desc__D429m {
|
|
208
|
-
max-width: 65ch;
|
|
209
|
-
text-align: center;
|
|
210
|
-
font-size: var(--fs-body);
|
|
211
|
-
color: var(--color-on-background-faint);
|
|
212
|
-
}
|
|
213
|
-
.WelcomePage-module_catcall__ZfRP8 {
|
|
214
|
-
font-size: var(--fs-body2);
|
|
215
|
-
}
|
|
1
|
+
.ThemedMonacoEditor-module_root__9pWgK{border-radius:var(--shape-br-sm);overflow:hidden}.CMSSidebarHeader-module_root__QUbml{align-items:center;display:flex;flex:1;flex-direction:row;gap:var(--spacing-gap);padding-inline:8.33%;padding-bottom:var(--spacing-gap-2);padding-top:var(--spacing-gap-3);transition:padding var(--transition-time) var(--transition-tf)}.CMSSidebarHeader-module_logoContainer__1tdc3{align-items:center;display:flex;flex:1;justify-content:flex-start}.CMSSidebarHeader-module_logo__qCMLH{height:auto;max-width:6rem;width:40%}@media (min-width:600px){.CMSSidebarHeader-module_root__QUbml{align-items:center;flex:0 1 0%;flex-direction:column;padding-inline:0}.CMSSidebarHeader-module_root__QUbml[data-open=true]{flex-direction:row;justify-content:space-between;padding-top:var(--spacing-gap-2);& .CMSSidebarHeader-module_logo__qCMLH{width:100%}}.CMSSidebarHeader-module_logoContainer__1tdc3{justify-content:center}}.CMSSidebarFooter-module_root__ZMRx2{display:flex;flex-direction:column;gap:var(--spacing-gap-2);height:100%;justify-content:flex-end}.CurrentSystemUserButton-module_title__RFrLD{align-items:center;display:flex;gap:var(--spacing-gap)}.SignIn-module_body__2yvpI,.SignIn-module_footer__KKVs7,.SignIn-module_form__IjD6r,.SignIn-module_header__XEjx6,.SignIn-module_root__QZuyy{display:flex;flex-direction:column}.SignIn-module_root__QZuyy{align-items:center;gap:var(--spacing-gap-7);width:clamp(350px,50vw,550px);& p{font-size:var(--fs-body2);text-align:center}}.SignIn-module_body__2yvpI{align-items:center;gap:var(--spacing-gap-3);width:100%}.SignIn-module_header__XEjx6{align-items:center;gap:var(--spacing-gap);text-align:center;&>h1{font-size:var(--fs-h3)}&>p{color:var(--color-on-background-faint);font-size:var(--fs-body2)}}.SignIn-module_form__IjD6r{gap:var(--spacing-gap-2);width:100%}.SignIn-module_footer__KKVs7{align-items:center;border-top:1px solid var(--color-outline);padding:var(--spacing-gap-3);width:100%}.SignIn-module_error__q4xLf{color:var(--color-error);font-size:2rem}.SignUp-module_body__TciO0,.SignUp-module_footer__NhgL2,.SignUp-module_form__8wMar,.SignUp-module_header__ol6o4,.SignUp-module_root__gyyhf{display:flex;flex-direction:column}.SignUp-module_root__gyyhf{align-items:center;gap:var(--spacing-gap-7);width:clamp(350px,50vw,550px);& p{font-size:var(--fs-body2);text-align:center}}.SignUp-module_body__TciO0{align-items:center;gap:var(--spacing-gap-3);width:100%}.SignUp-module_header__ol6o4{align-items:center;gap:var(--spacing-gap);text-align:center;&>h1{font-size:var(--fs-h3)}&>p{color:var(--color-on-background-faint);font-size:var(--fs-body2)}}.SignUp-module_form__8wMar{gap:var(--spacing-gap-2);width:100%}.SignUp-module_footer__NhgL2{align-items:center;border-top:1px solid var(--color-outline);padding:var(--spacing-gap-3);width:100%}.SignUp-module_error__VRpFj{color:var(--color-error);font-size:2rem}.SystemUserDetails-module_root__KsYgB{align-items:flex-start;display:flex;justify-content:space-between;width:100%}.SystemUserDetailsForm-module_form__P1Xz3{flex:1}.SystemUserDetailsForm-module_formRow__YpJTg{display:flex;gap:var(--spacing-gap)}.SystemUserRole-module_root__1wcEv{align-items:flex-start;display:flex;justify-content:space-between;width:100%}.SystemUserRole-module_main__xN-Z1{align-items:flex-start;display:flex;flex:1;flex-direction:column;gap:var(--spacing-gap-2);p{color:var(--color-on-background-faint);font-size:var(--fs-body2)}}.WelcomePage-module_root__hO-sl{align-items:center;display:flex;flex-direction:column;gap:var(--spacing-gap-4);height:100dvh;justify-content:center;width:100dvw}.WelcomePage-module_desc__czLaI{color:var(--color-on-background-faint);font-size:var(--fs-body);max-width:65ch;text-align:center}.WelcomePage-module_catcall__xsT00{font-size:var(--fs-body2)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Invitation } from "@clerk/nextjs/server";
|
|
2
|
-
import type { InvitationCreateState } from "
|
|
2
|
+
import type { InvitationCreateState } from "../../../client/ui/System/Invitations/InvitationListActions";
|
|
3
3
|
import type { PaginatedResponse } from "../clerk";
|
|
4
4
|
export declare const invitationListReadAction: (params: ClerkInvitationListParams) => Promise<PaginatedResponse<Invitation[]>>;
|
|
5
5
|
export declare const invitationDeleteAction: (id: string) => Promise<import("@studiocubics/utils").ActionResponse<string, string[]>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use server";import{clerkClient as t}from"@clerk/nextjs/server";import{auth as i}from"../auth.js";import{revalidatePath as r}from"next/cache";import{headers as a}from"next/headers";import{getInvitationPublicMetadata as o}from"../../../client/clerk/rbacConfig.js";import{createInvitationSchema as n}from"../schemas/invitation.js";import s from"zod";import{apiRes as e}from"@studiocubics/utils";import{cache as c}from"react";const f=c(async r=>{if(!(await i()).hasPermission("invitations","read"))throw new Error(e.forbidden);const a=await t();return await a.invitations.getInvitationList(r)}),m=async a=>{if(!(await i()).hasPermission("invitations","delete"))return e.actionFail(e.forbidden);if(!a||"string"!=typeof a)return e.actionFail(e.wrongType("id","string"));const o=await t();return await o.invitations.revokeInvitation(a),r("/dashboard/security/invitations"),e.actionSuccess()};async function d(c,f){if(!(await i()).hasPermission("invitations","create"))return e.actionFail(e.forbidden);const m=(await a()).get("host"),d=m?.startsWith("localhost")?"http":"https",u=Object.fromEntries(f.entries()),{success:h,data:l,error:p}=n.safeParse(u);if(!h){const t=s.flattenError(p);return e.actionFail(t.formErrors.join("\n"),t.fieldErrors)}const v=o(l.role),w=await t();return await w.invitations.createInvitation({...l,redirectUrl:`${d}://${m}/auth/signUp`,publicMetadata:v}),r("/dashboard/security/invitations"),e.actionSuccess()}export{d as invitationCreateAction,m as invitationDeleteAction,f as invitationListReadAction};
|
|
2
|
+
//# sourceMappingURL=invitations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitations.js","sources":["../../../../src/server/clerk/actions/invitations.ts"],"sourcesContent":["\"use server\";\n\nimport { clerkClient, type Invitation } from \"@clerk/nextjs/server\";\nimport { auth } from \"../auth\";\nimport { revalidatePath } from \"next/cache\";\nimport { headers } from \"next/headers\";\nimport { getInvitationPublicMetadata } from \"../../../client/clerk/rbacConfig\";\nimport { createInvitationSchema } from \"../schemas/invitation\";\nimport z from \"zod\";\nimport type { InvitationCreateState } from \"../../../client/ui/System/Invitations/InvitationListActions\";\nimport { apiRes } from \"@studiocubics/utils\";\nimport type { PaginatedResponse } from \"../clerk\";\nimport { cache } from \"react\";\n\nexport const invitationListReadAction = cache(\n async (\n params: ClerkInvitationListParams,\n ): Promise<PaginatedResponse<Invitation[]>> => {\n const session = await auth();\n if (!session.hasPermission(\"invitations\", \"read\")) {\n throw new Error(apiRes.forbidden);\n }\n const client = await clerkClient();\n const invitationsList = await client.invitations.getInvitationList(params);\n return invitationsList;\n },\n);\nexport const invitationDeleteAction = async (id: string) => {\n const session = await auth();\n if (!session.hasPermission(\"invitations\", \"delete\")) {\n return apiRes.actionFail(apiRes.forbidden);\n }\n\n if (!id || typeof id !== \"string\")\n return apiRes.actionFail(apiRes.wrongType(\"id\", \"string\"));\n\n const client = await clerkClient();\n await client.invitations.revokeInvitation(id);\n\n revalidatePath(\"/dashboard/security/invitations\");\n return apiRes.actionSuccess();\n};\n\nexport async function invitationCreateAction(\n _: InvitationCreateState,\n formData: FormData,\n): Promise<InvitationCreateState> {\n const session = await auth();\n if (!session.hasPermission(\"invitations\", \"create\")) {\n return apiRes.actionFail(apiRes.forbidden);\n }\n\n const headersList = await headers();\n const host = headersList.get(\"host\");\n const protocol = host?.startsWith(\"localhost\") ? \"http\" : \"https\";\n\n const formDataObj = Object.fromEntries(formData.entries());\n const { success, data, error } =\n createInvitationSchema.safeParse(formDataObj);\n if (!success) {\n const flattenedError = z.flattenError(error);\n return apiRes.actionFail(\n flattenedError.formErrors.join(\"\\n\"),\n flattenedError.fieldErrors,\n );\n }\n\n const publicMetadata = getInvitationPublicMetadata(data.role);\n const client = await clerkClient();\n await client.invitations.createInvitation({\n ...data,\n redirectUrl: `${protocol}://${host}/auth/signUp`,\n publicMetadata,\n });\n\n revalidatePath(\"/dashboard/security/invitations\");\n return apiRes.actionSuccess();\n}\n"],"names":["invitationListReadAction","cache","async","params","auth","hasPermission","Error","apiRes","forbidden","client","clerkClient","invitations","getInvitationList","invitationDeleteAction","id","actionFail","wrongType","revokeInvitation","revalidatePath","actionSuccess","invitationCreateAction","_","formData","host","headers","get","protocol","startsWith","formDataObj","Object","fromEntries","entries","success","data","error","createInvitationSchema","safeParse","flattenedError","z","flattenError","formErrors","join","fieldErrors","publicMetadata","getInvitationPublicMetadata","role","createInvitation","redirectUrl"],"mappings":"uaAcO,MAAMA,EAA2BC,EACtCC,MACEC,IAGA,WADsBC,KACTC,cAAc,cAAe,QACxC,MAAM,IAAIC,MAAMC,EAAOC,WAEzB,MAAMC,QAAeC,IAErB,aAD8BD,EAAOE,YAAYC,kBAAkBT,KAI1DU,EAAyBX,MAAOY,IAE3C,WADsBV,KACTC,cAAc,cAAe,UACxC,OAAOE,EAAOQ,WAAWR,EAAOC,WAGlC,IAAKM,GAAoB,iBAAPA,EAChB,OAAOP,EAAOQ,WAAWR,EAAOS,UAAU,KAAM,WAElD,MAAMP,QAAeC,IAIrB,aAHMD,EAAOE,YAAYM,iBAAiBH,GAE1CI,EAAe,mCACRX,EAAOY,iBAGTjB,eAAekB,EACpBC,EACAC,GAGA,WADsBlB,KACTC,cAAc,cAAe,UACxC,OAAOE,EAAOQ,WAAWR,EAAOC,WAGlC,MACMe,SADoBC,KACDC,IAAI,QACvBC,EAAWH,GAAMI,WAAW,aAAe,OAAS,QAEpDC,EAAcC,OAAOC,YAAYR,EAASS,YAC1CC,QAAEA,EAAOC,KAAEA,EAAIC,MAAEA,GACrBC,EAAuBC,UAAUR,GACnC,IAAKI,EAAS,CACZ,MAAMK,EAAiBC,EAAEC,aAAaL,GACtC,OAAO3B,EAAOQ,WACZsB,EAAeG,WAAWC,KAAK,MAC/BJ,EAAeK,YAEnB,CAEA,MAAMC,EAAiBC,EAA4BX,EAAKY,MAClDpC,QAAeC,IAQrB,aAPMD,EAAOE,YAAYmC,iBAAiB,IACrCb,EACHc,YAAa,GAAGrB,OAAcH,gBAC9BoB,mBAGFzB,EAAe,mCACRX,EAAOY,eAChB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type User } from "@clerk/nextjs/server";
|
|
2
2
|
import type { PaginatedResponse } from "../clerk";
|
|
3
|
-
import type { SystemUserRoleUpdateState } from "
|
|
4
|
-
import type { SystemUserDetailsUpdateState } from "
|
|
3
|
+
import type { SystemUserRoleUpdateState } from "../../../client/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm";
|
|
4
|
+
import type { SystemUserDetailsUpdateState } from "../../../client/ui/_index";
|
|
5
5
|
export declare const systemUserListReadAction: (params: ClerkUserListParams, removeCurrent?: boolean) => Promise<PaginatedResponse<User[]>>;
|
|
6
6
|
export declare const systemUserReadAction: (id: string) => Promise<User>;
|
|
7
7
|
export declare function systemUserRoleUpdateAction(userId: string, _: SystemUserRoleUpdateState, formData: FormData): Promise<SystemUserRoleUpdateState>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use server";import{clerkClient as e}from"@clerk/nextjs/server";import{auth as r}from"../auth.js";import{apiRes as s}from"@studiocubics/utils";import{cache as o}from"react";const t=o(async(o,t=!1)=>{const i=await r();if(!i.hasPermission("systemUsers","read"))throw new Error(s.forbidden);const a=await e(),n=await a.users.getUserList(o);return t&&(n.data=n.data.filter(e=>e.id!==i.userId),n.totalCount--),n}),i=o(async o=>{if(!(await r()).hasPermission("systemUsers","read"))throw new Error(s.forbidden);const t=await e(),i=await t.users.getUser(o);if(!i)throw new Error(s.notFound(`System User: ${o}`));return i});async function a(e,o,t){if(!(await r()).hasPermission("systemUsers","update"))throw new Error(s.forbidden);const i=t.get("role");return console.log("userId",e),console.log("role",i),s.actionSuccess()}async function n(e,o,t){if(!(await r()).hasPermission("systemUsers","update"))throw new Error(s.forbidden);return console.log("firstName",t.get("firstName")),console.log("lastName",t.get("firstName")),console.log("imageFile",t.get("imageFile")),console.log("userId",e),s.actionSuccess()}export{n as systemUserDetailsUpdateAction,t as systemUserListReadAction,i as systemUserReadAction,a as systemUserRoleUpdateAction};
|
|
2
|
+
//# sourceMappingURL=systemUsers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemUsers.js","sources":["../../../../src/server/clerk/actions/systemUsers.ts"],"sourcesContent":["\"use server\";\n\nimport { clerkClient, type User } from \"@clerk/nextjs/server\";\nimport { auth } from \"../auth\";\nimport { apiRes } from \"@studiocubics/utils\";\nimport type { PaginatedResponse } from \"../clerk\";\nimport type { SystemUserRoleUpdateState } from \"../../../client/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm\";\nimport { cache } from \"react\";\nimport type { SystemUserDetailsUpdateState } from \"../../../client/ui/_index\";\n\nexport const systemUserListReadAction = cache(\n async (\n params: ClerkUserListParams,\n removeCurrent: boolean = false,\n ): Promise<PaginatedResponse<User[]>> => {\n const session = await auth();\n\n if (!session.hasPermission(\"systemUsers\", \"read\")) {\n throw new Error(apiRes.forbidden);\n }\n\n const client = await clerkClient();\n const systemUserList = await client.users.getUserList(params);\n\n if (removeCurrent) {\n systemUserList.data = systemUserList.data.filter(\n (su) => su.id !== session.userId,\n );\n systemUserList.totalCount--;\n }\n\n return systemUserList;\n },\n);\n\nexport const systemUserReadAction = cache(async (id: string) => {\n const session = await auth();\n\n if (!session.hasPermission(\"systemUsers\", \"read\")) {\n throw new Error(apiRes.forbidden);\n }\n\n const client = await clerkClient();\n const systemUser = await client.users.getUser(id);\n\n if (!systemUser) {\n throw new Error(apiRes.notFound(`System User: ${id}`));\n }\n\n return systemUser;\n});\n\nexport async function systemUserRoleUpdateAction(\n userId: string,\n _: SystemUserRoleUpdateState,\n formData: FormData,\n): Promise<SystemUserRoleUpdateState> {\n const session = await auth();\n\n if (!session.hasPermission(\"systemUsers\", \"update\")) {\n throw new Error(apiRes.forbidden);\n }\n const role = formData.get(\"role\");\n console.log(\"userId\", userId);\n console.log(\"role\", role);\n return apiRes.actionSuccess();\n\n // const client = await clerkClient();\n // const { publicMetadata } = await client.users.getUser(userId);\n // const patchedUser = await client.users.updateUserMetadata(userId, {\n // publicMetadata: {\n // ...publicMetadata,\n // role,\n // },\n // });\n // return apiRes.actionSuccess(patchedUser);\n}\n\nexport async function systemUserDetailsUpdateAction(\n userId: string,\n _: SystemUserDetailsUpdateState,\n formData: FormData,\n): Promise<SystemUserDetailsUpdateState> {\n const session = await auth();\n\n if (!session.hasPermission(\"systemUsers\", \"update\")) {\n throw new Error(apiRes.forbidden);\n }\n console.log(\"firstName\", formData.get(\"firstName\"));\n console.log(\"lastName\", formData.get(\"firstName\"));\n console.log(\"imageFile\", formData.get(\"imageFile\"));\n\n console.log(\"userId\", userId);\n return apiRes.actionSuccess();\n}\n"],"names":["systemUserListReadAction","cache","async","params","removeCurrent","session","auth","hasPermission","Error","apiRes","forbidden","client","clerkClient","systemUserList","users","getUserList","data","filter","su","id","userId","totalCount","systemUserReadAction","systemUser","getUser","notFound","systemUserRoleUpdateAction","_","formData","role","get","console","log","actionSuccess","systemUserDetailsUpdateAction"],"mappings":"6KAUO,MAAMA,EAA2BC,EACtCC,MACEC,EACAC,GAAyB,KAEzB,MAAMC,QAAgBC,IAEtB,IAAKD,EAAQE,cAAc,cAAe,QACxC,MAAM,IAAIC,MAAMC,EAAOC,WAGzB,MAAMC,QAAeC,IACfC,QAAuBF,EAAOG,MAAMC,YAAYZ,GAStD,OAPIC,IACFS,EAAeG,KAAOH,EAAeG,KAAKC,OACvCC,GAAOA,EAAGC,KAAOd,EAAQe,QAE5BP,EAAeQ,cAGVR,IAIES,EAAuBrB,EAAMC,MAAOiB,IAG/C,WAFsBb,KAETC,cAAc,cAAe,QACxC,MAAM,IAAIC,MAAMC,EAAOC,WAGzB,MAAMC,QAAeC,IACfW,QAAmBZ,EAAOG,MAAMU,QAAQL,GAE9C,IAAKI,EACH,MAAM,IAAIf,MAAMC,EAAOgB,SAAS,gBAAgBN,MAGlD,OAAOI,IAGFrB,eAAewB,EACpBN,EACAO,EACAC,GAIA,WAFsBtB,KAETC,cAAc,cAAe,UACxC,MAAM,IAAIC,MAAMC,EAAOC,WAEzB,MAAMmB,EAAOD,EAASE,IAAI,QAG1B,OAFAC,QAAQC,IAAI,SAAUZ,GACtBW,QAAQC,IAAI,OAAQH,GACbpB,EAAOwB,eAWhB,CAEO/B,eAAegC,EACpBd,EACAO,EACAC,GAIA,WAFsBtB,KAETC,cAAc,cAAe,UACxC,MAAM,IAAIC,MAAMC,EAAOC,WAOzB,OALAqB,QAAQC,IAAI,YAAaJ,EAASE,IAAI,cACtCC,QAAQC,IAAI,WAAYJ,EAASE,IAAI,cACrCC,QAAQC,IAAI,YAAaJ,EAASE,IAAI,cAEtCC,QAAQC,IAAI,SAAUZ,GACfX,EAAOwB,eAChB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { auth as clerkAuth } from "@clerk/nextjs/server";
|
|
2
|
-
import type { Resource, RoleActions } from "
|
|
2
|
+
import type { Resource, RoleActions } from "../../client/clerk/rbacConfig";
|
|
3
3
|
type ClerkAuthResult = Awaited<ReturnType<typeof clerkAuth>>;
|
|
4
4
|
export type AuthWithPermissions = ClerkAuthResult & {
|
|
5
5
|
hasPermission: (resource: Resource, action: RoleActions, record?: Record<string, any>) => Promise<boolean>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use server";import{auth as s}from"@clerk/nextjs/server";import{hasPermissionForClaims as r}from"./hasPermission.js";async function e(e){const o=await s(e);return{...o,hasPermission:async(s,e,i)=>r({claims:o.sessionClaims,resource:s,action:e,record:i})}}export{e as auth};
|
|
2
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sources":["../../../src/server/clerk/auth.ts"],"sourcesContent":["\"use server\";\n\nimport { auth as clerkAuth } from \"@clerk/nextjs/server\";\nimport { hasPermissionForClaims } from \"./hasPermission\";\nimport type { Resource, RoleActions } from \"../../client/clerk/rbacConfig\";\ntype ClerkAuthResult = Awaited<ReturnType<typeof clerkAuth>>;\n\nexport type AuthWithPermissions = ClerkAuthResult & {\n hasPermission: (\n resource: Resource,\n action: RoleActions,\n record?: Record<string, any>,\n ) => Promise<boolean>;\n};\nexport async function auth(\n options?: Parameters<typeof clerkAuth>[0],\n): Promise<AuthWithPermissions> {\n const clerkAuthResult = await clerkAuth(options);\n\n return {\n ...clerkAuthResult,\n hasPermission: async (\n resource: Resource,\n action: RoleActions,\n record?: Record<string, any>,\n ) => {\n return hasPermissionForClaims({\n claims: clerkAuthResult.sessionClaims,\n resource,\n action,\n record,\n });\n },\n };\n}\n"],"names":["async","auth","options","clerkAuthResult","clerkAuth","hasPermission","resource","action","record","hasPermissionForClaims","claims","sessionClaims"],"mappings":"qHAcOA,eAAeC,EACpBC,GAEA,MAAMC,QAAwBC,EAAUF,GAExC,MAAO,IACFC,EACHE,cAAeL,MACbM,EACAC,EACAC,IAEOC,EAAuB,CAC5BC,OAAQP,EAAgBQ,cACxBL,WACAC,SACAC,WAIR"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use server";import{auth as r}from"@clerk/nextjs/server";import{RBAC_CONFIG as e}from"../../client/clerk/rbacConfig.js";async function n(r){if(!("metadata"in r.claims))return!1;const e=r.claims?.metadata.role;return!!e&&i({role:e,...r})}async function o(e){let n;n=(await r()).sessionClaims;const o=n?.metadata.role;return!!o&&i({role:o,claims:n,...e})}function i(r){const n=e[r.role];if(!n)return!1;if(n.isSystem)return!0;for(const e of n.permissions)if(e.resource===r.resource&&e.actions?.[r.action]){if(e.conditions?.ownerField&&r.record){const n=e.conditions.ownerField;if(r.record[n]!==r.claims.id)continue}return!0}return!1}export{o as hasPermission,n as hasPermissionForClaims};
|
|
2
|
+
//# sourceMappingURL=hasPermission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasPermission.js","sources":["../../../src/server/clerk/hasPermission.ts"],"sourcesContent":["\"use server\";\n\nimport { auth } from \"@clerk/nextjs/server\";\nimport {\n type Resource,\n type RoleActions,\n type Role,\n RBAC_CONFIG,\n} from \"../../client/clerk/rbacConfig\";\n\n/**\n * Evaluates RBAC permissions using explicitly provided session claims.\n *\n * @returns `true` if the role defined in `sessionClaims.metadata.role`\n * is allowed to perform `action` on `resource` under RBAC rules.\n */\nexport async function hasPermissionForClaims(args: {\n claims: ClerkSessionClaims;\n resource: Resource;\n action: RoleActions;\n record?: Record<string, any>;\n}): Promise<boolean> {\n if (!(\"metadata\" in args.claims)) return false;\n const role = args.claims?.metadata.role;\n if (!role) return false;\n return checkPermissions({ role, ...args });\n}\n\n/**\n * Evaluates RBAC permissions for the currently authenticated user.\n *\n * Use this when you do NOT already have session claims.\n *\n * @returns `true` if the current user's role is allowed\n * to perform `action` on `resource` under RBAC rules.\n */\nexport async function hasPermission(args: {\n resource: Resource;\n action: RoleActions;\n record?: Record<string, any>;\n}): Promise<boolean> {\n let claims;\n\n const a = await auth();\n claims = a.sessionClaims;\n\n const role = claims?.metadata.role;\n if (!role) return false;\n return checkPermissions({\n role,\n claims,\n ...args,\n });\n}\nexport type PermissionCheckInput = {\n role: Role;\n claims: ClerkSessionClaims;\n resource: Resource;\n action: RoleActions;\n record?: Record<string, any>;\n};\n\n/**\n * Core RBAC policy evaluator.\n *\n * This is the authorization engine shared by all permission checks.\n * It does NOT perform authentication or session resolution.\n *\n * Rules:\n * - `isSystem` roles bypass all checks\n * - permissions are matched by `{ resource, action }`\n * - optional ownership constraints are enforced via `ownerField`\n * @param {PermissionCheckInput} args\n * @returns `true` if at least one permission grants access\n */\nfunction checkPermissions(args: PermissionCheckInput) {\n const def = RBAC_CONFIG[args.role];\n if (!def) return false;\n\n // Allow system\n if (def.isSystem) return true;\n\n // Iterate over all permissions\n for (const p of def.permissions) {\n if (p.resource !== args.resource) continue;\n if (!p.actions?.[args.action]) continue;\n\n // Ownership conditions\n if (p.conditions?.ownerField && args.record) {\n const ownerField = p.conditions.ownerField;\n if (args.record[ownerField] !== args.claims.id) continue;\n }\n\n return true;\n }\n return false;\n}\n"],"names":["async","hasPermissionForClaims","args","claims","role","metadata","checkPermissions","hasPermission","auth","sessionClaims","def","RBAC_CONFIG","isSystem","p","permissions","resource","actions","action","conditions","ownerField","record","id"],"mappings":"wHAgBOA,eAAeC,EAAuBC,GAM3C,KAAM,aAAcA,EAAKC,QAAS,OAAO,EACzC,MAAMC,EAAOF,EAAKC,QAAQE,SAASD,KACnC,QAAKA,GACEE,EAAiB,CAAEF,UAASF,GACrC,CAUOF,eAAeO,EAAcL,GAKlC,IAAIC,EAGJA,SADgBK,KACLC,cAEX,MAAML,EAAOD,GAAQE,SAASD,KAC9B,QAAKA,GACEE,EAAiB,CACtBF,OACAD,YACGD,GAEP,CAsBA,SAASI,EAAiBJ,GACxB,MAAMQ,EAAMC,EAAYT,EAAKE,MAC7B,IAAKM,EAAK,OAAO,EAGjB,GAAIA,EAAIE,SAAU,OAAO,EAGzB,IAAK,MAAMC,KAAKH,EAAII,YAClB,GAAID,EAAEE,WAAab,EAAKa,UACnBF,EAAEG,UAAUd,EAAKe,QAAtB,CAGA,GAAIJ,EAAEK,YAAYC,YAAcjB,EAAKkB,OAAQ,CAC3C,MAAMD,EAAaN,EAAEK,WAAWC,WAChC,GAAIjB,EAAKkB,OAAOD,KAAgBjB,EAAKC,OAAOkB,GAAI,QAClD,CAEA,OAAO,CARwB,CAUjC,OAAO,CACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import o from"zod";import{roles as e}from"../../../client/clerk/rbacConfig.js";const r=o.object({emailAddress:o.string(),expiresInDays:o.preprocess(o=>"string"==typeof o?Number.parseInt(o):o,o.number()).optional(),ignoreExisting:o.boolean().default(!1).optional(),notify:o.boolean().default(!0).optional(),role:o.enum(e)});export{r as createInvitationSchema};
|
|
2
|
+
//# sourceMappingURL=invitation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation.js","sources":["../../../../src/server/clerk/schemas/invitation.ts"],"sourcesContent":["import z from \"zod\";\nimport { roles } from \"../../../client/clerk/rbacConfig\";\n\nexport const createInvitationSchema = z.object({\n emailAddress: z.string(),\n expiresInDays: z\n .preprocess((val) => {\n if (typeof val === \"string\") {\n return Number.parseInt(val);\n }\n return val;\n }, z.number())\n .optional(),\n ignoreExisting: z.boolean().default(false).optional(),\n notify: z.boolean().default(true).optional(),\n role: z.enum(roles),\n});\n"],"names":["createInvitationSchema","z","object","emailAddress","string","expiresInDays","preprocess","val","Number","parseInt","number","optional","ignoreExisting","boolean","default","notify","role","enum","roles"],"mappings":"+EAGO,MAAMA,EAAyBC,EAAEC,OAAO,CAC7CC,aAAcF,EAAEG,SAChBC,cAAeJ,EACZK,WAAYC,GACQ,iBAARA,EACFC,OAAOC,SAASF,GAElBA,EACNN,EAAES,UACJC,WACHC,eAAgBX,EAAEY,UAAUC,SAAQ,GAAOH,WAC3CI,OAAQd,EAAEY,UAAUC,SAAQ,GAAMH,WAClCK,KAAMf,EAAEgB,KAAKC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use server";function e(e){const i=e.emailAddresses.find(i=>i.id==e.primaryEmailAddressId);if(!i)throw new Error("Missing primaryEmailAddress");return{id:e.id,username:e.username,firstName:e.firstName,lastName:e.lastName,fullName:e.fullName,imageUrl:e.imageUrl,primaryEmailAddress:{id:i.id,emailAddress:i.emailAddress,verified:"verified"===i.verification?.status},emailAddresses:e.emailAddresses.map(e=>({id:e.id,emailAddress:e.emailAddress,verified:"verified"===e.verification?.status})),publicMetadata:e.publicMetadata??{},createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),lastSignInAt:e.lastSignInAt?new Date(e.lastSignInAt):null}}export{e as toClientSafeUser};
|
|
2
|
+
//# sourceMappingURL=toClientSafeUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toClientSafeUser.js","sources":["../../../src/server/clerk/toClientSafeUser.ts"],"sourcesContent":["\"use server\";\n\nimport type { User } from \"@clerk/nextjs/server\";\n\n/**\n * Client-safe representation of a Clerk User.\n *\n * This intentionally excludes any sensitive or server-only fields\n * (e.g. privateMetadata, externalAccounts with tokens, etc.)\n * and contains only JSON-serializable data that is safe to pass\n * from Server Components to Client Components.\n */\nexport type ClientSafeUser = {\n id: string;\n username: string | null;\n firstName: string | null;\n lastName: string | null;\n fullName: string | null;\n imageUrl: string;\n primaryEmailAddress: {\n id: string;\n emailAddress: string;\n verified: boolean;\n };\n emailAddresses: Array<{\n id: string;\n emailAddress: string;\n verified: boolean;\n }>;\n publicMetadata: CustomJwtSessionClaims[\"metadata\"];\n createdAt: Date | null;\n updatedAt: Date | null;\n lastSignInAt: Date | null;\n};\n\n/**\n * Converts a Clerk `User` (server-side) into a client-safe, serializable object.\n *\n * Why this exists:\n * - The Clerk `User` class contains methods and non-serializable fields.\n * - Passing it directly to a Client Component will break React Server Components.\n * - This function strips the object down to stable, safe primitives only.\n *\n * Rules enforced here:\n * - No functions\n * - No circular references\n * - No private or sensitive data\n *\n * @param user Clerk User instance from `@clerk/nextjs/server`\n * @returns ClientSafeUser plain object\n */\nexport function toClientSafeUser(user: User): ClientSafeUser {\n const pea = user.emailAddresses.find(\n (ea) => ea.id == user.primaryEmailAddressId,\n );\n if (!pea) throw new Error(\"Missing primaryEmailAddress\");\n return {\n id: user.id,\n username: user.username,\n firstName: user.firstName,\n lastName: user.lastName,\n fullName: user.fullName,\n imageUrl: user.imageUrl,\n primaryEmailAddress: {\n id: pea.id,\n emailAddress: pea.emailAddress,\n verified: pea.verification?.status === \"verified\",\n },\n emailAddresses: user.emailAddresses.map((email) => ({\n id: email.id,\n emailAddress: email.emailAddress,\n verified: email.verification?.status === \"verified\",\n })),\n publicMetadata: user.publicMetadata ?? {},\n createdAt: new Date(user.createdAt),\n updatedAt: new Date(user.updatedAt),\n lastSignInAt: user.lastSignInAt ? new Date(user.lastSignInAt) : null,\n };\n}\n"],"names":["toClientSafeUser","user","pea","emailAddresses","find","ea","id","primaryEmailAddressId","Error","username","firstName","lastName","fullName","imageUrl","primaryEmailAddress","emailAddress","verified","verification","status","map","email","publicMetadata","createdAt","Date","updatedAt","lastSignInAt"],"mappings":"aAmDM,SAAUA,EAAiBC,GAC/B,MAAMC,EAAMD,EAAKE,eAAeC,KAC7BC,GAAOA,EAAGC,IAAML,EAAKM,uBAExB,IAAKL,EAAK,MAAM,IAAIM,MAAM,+BAC1B,MAAO,CACLF,GAAIL,EAAKK,GACTG,SAAUR,EAAKQ,SACfC,UAAWT,EAAKS,UAChBC,SAAUV,EAAKU,SACfC,SAAUX,EAAKW,SACfC,SAAUZ,EAAKY,SACfC,oBAAqB,CACnBR,GAAIJ,EAAII,GACRS,aAAcb,EAAIa,aAClBC,SAAuC,aAA7Bd,EAAIe,cAAcC,QAE9Bf,eAAgBF,EAAKE,eAAegB,IAAKC,IAAK,CAC5Cd,GAAIc,EAAMd,GACVS,aAAcK,EAAML,aACpBC,SAAyC,aAA/BI,EAAMH,cAAcC,UAEhCG,eAAgBpB,EAAKoB,gBAAkB,CAAA,EACvCC,UAAW,IAAIC,KAAKtB,EAAKqB,WACzBE,UAAW,IAAID,KAAKtB,EAAKuB,WACzBC,aAAcxB,EAAKwB,aAAe,IAAIF,KAAKtB,EAAKwB,cAAgB,KAEpE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{invitationCreateAction,invitationDeleteAction,invitationListReadAction}from"./clerk/actions/invitations.js";export{systemUserDetailsUpdateAction,systemUserListReadAction,systemUserReadAction,systemUserRoleUpdateAction}from"./clerk/actions/systemUsers.js";export{createInvitationSchema}from"./clerk/schemas/invitation.js";export{auth}from"./clerk/auth.js";export{hasPermission,hasPermissionForClaims}from"./clerk/hasPermission.js";export{toClientSafeUser}from"./clerk/toClientSafeUser.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|