@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
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"private": false,
|
|
8
|
-
"version": "0.0.
|
|
8
|
+
"version": "0.0.4",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"@studiocubics",
|
|
11
11
|
"cubics",
|
|
@@ -22,22 +22,25 @@
|
|
|
22
22
|
"type": "module",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
|
-
"types": "./dist/index.d.ts",
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
"types": "./dist/client/index.d.ts",
|
|
26
|
+
"default": "./dist/client/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./server": {
|
|
29
|
+
"types": "./dist/server/index.d.ts",
|
|
30
|
+
"default": "./dist/server/index.js"
|
|
29
31
|
},
|
|
30
32
|
"./styles.css": "./dist/index.css"
|
|
31
33
|
},
|
|
34
|
+
"sideEffects": true,
|
|
32
35
|
"dependencies": {
|
|
33
36
|
"@monaco-editor/react": "4.8.0-rc.3",
|
|
34
37
|
"lucide-react": "^0.554.0",
|
|
35
38
|
"next-themes": "^0.4.6",
|
|
36
39
|
"zod": "^4.3.6",
|
|
37
|
-
"@studiocubics/components": "^0.0.
|
|
38
|
-
"@studiocubics/hooks": "^0.0.
|
|
39
|
-
"@studiocubics/next": "^0.0.
|
|
40
|
-
"@studiocubics/utils": "^0.0.
|
|
40
|
+
"@studiocubics/components": "^0.0.4",
|
|
41
|
+
"@studiocubics/hooks": "^0.0.4",
|
|
42
|
+
"@studiocubics/next": "^0.0.4",
|
|
43
|
+
"@studiocubics/utils": "^0.0.4"
|
|
41
44
|
},
|
|
42
45
|
"devDependencies": {
|
|
43
46
|
"@eslint/js": "^9.39.1",
|
|
@@ -58,9 +61,10 @@
|
|
|
58
61
|
"rollup": "^4.53.3",
|
|
59
62
|
"rollup-plugin-postcss": "^4.0.2",
|
|
60
63
|
"rollup-preserve-directives": "^1.1.3",
|
|
64
|
+
"rollup-plugin-bundle-stats": "^4.21.9",
|
|
61
65
|
"typescript": "^5.9.3",
|
|
62
66
|
"typescript-eslint": "^8.46.4",
|
|
63
|
-
"@studiocubics/types": "^0.0.
|
|
67
|
+
"@studiocubics/types": "^0.0.4"
|
|
64
68
|
},
|
|
65
69
|
"peerDependencies": {
|
|
66
70
|
"@clerk/nextjs": ">= 6",
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
import { clerkClient } from '@clerk/nextjs/server';
|
|
3
|
-
import { auth } from '../auth.js';
|
|
4
|
-
import { revalidatePath } from 'next/cache';
|
|
5
|
-
import { headers } from 'next/headers';
|
|
6
|
-
import { getInvitationPublicMetadata } from '../rbacConfig.js';
|
|
7
|
-
import { createInvitationSchema } from '../schemas/invitation.js';
|
|
8
|
-
import z from 'zod';
|
|
9
|
-
import { apiRes } from '@studiocubics/utils';
|
|
10
|
-
import { cache } from 'react';
|
|
11
|
-
|
|
12
|
-
const invitationListReadAction = cache(async (params) => {
|
|
13
|
-
const session = await auth();
|
|
14
|
-
if (!session.hasPermission("invitations", "read")) {
|
|
15
|
-
throw new Error(apiRes.forbidden);
|
|
16
|
-
}
|
|
17
|
-
const client = await clerkClient();
|
|
18
|
-
const invitationsList = await client.invitations.getInvitationList(params);
|
|
19
|
-
return invitationsList;
|
|
20
|
-
});
|
|
21
|
-
const invitationDeleteAction = async (id) => {
|
|
22
|
-
const session = await auth();
|
|
23
|
-
if (!session.hasPermission("invitations", "delete")) {
|
|
24
|
-
return apiRes.actionFail(apiRes.forbidden);
|
|
25
|
-
}
|
|
26
|
-
if (!id || typeof id !== "string")
|
|
27
|
-
return apiRes.actionFail(apiRes.wrongType("id", "string"));
|
|
28
|
-
const client = await clerkClient();
|
|
29
|
-
await client.invitations.revokeInvitation(id);
|
|
30
|
-
revalidatePath("/dashboard/security/invitations");
|
|
31
|
-
return apiRes.actionSuccess();
|
|
32
|
-
};
|
|
33
|
-
async function invitationCreateAction(_, formData) {
|
|
34
|
-
const session = await auth();
|
|
35
|
-
if (!session.hasPermission("invitations", "create")) {
|
|
36
|
-
return apiRes.actionFail(apiRes.forbidden);
|
|
37
|
-
}
|
|
38
|
-
const headersList = await headers();
|
|
39
|
-
const host = headersList.get("host");
|
|
40
|
-
const protocol = host?.startsWith("localhost") ? "http" : "https";
|
|
41
|
-
const formDataObj = Object.fromEntries(formData.entries());
|
|
42
|
-
const { success, data, error } = createInvitationSchema.safeParse(formDataObj);
|
|
43
|
-
if (!success) {
|
|
44
|
-
const flattenedError = z.flattenError(error);
|
|
45
|
-
return apiRes.actionFail(flattenedError.formErrors.join("\n"), flattenedError.fieldErrors);
|
|
46
|
-
}
|
|
47
|
-
const publicMetadata = getInvitationPublicMetadata(data.role);
|
|
48
|
-
const client = await clerkClient();
|
|
49
|
-
await client.invitations.createInvitation({
|
|
50
|
-
...data,
|
|
51
|
-
redirectUrl: `${protocol}://${host}/auth/signUp`,
|
|
52
|
-
publicMetadata,
|
|
53
|
-
});
|
|
54
|
-
revalidatePath("/dashboard/security/invitations");
|
|
55
|
-
return apiRes.actionSuccess();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { invitationCreateAction, invitationDeleteAction, invitationListReadAction };
|
|
59
|
-
//# sourceMappingURL=invitations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invitations.js","sources":["../../../src/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 \"../rbacConfig\";\nimport { createInvitationSchema } from \"../schemas/invitation\";\nimport z from \"zod\";\nimport type { InvitationCreateState } from \"../../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":[],"mappings":";;;;;;;;;;;AAcO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,wBAAwB,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAK,CAC3C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACE,MAAiC,CAAA,CAAA,CAAA,CAAA,CACW;AAC5C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,IAAI,CAAA,CAAE;IAC5B,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAE;AACjD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAM,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,SAAS,CAAC;IACnC;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc;QAChD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc;AACf,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC;IAEF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiC,CAAC;AACjD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAE;AAC/B;;"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
import { clerkClient } from '@clerk/nextjs/server';
|
|
3
|
-
import { auth } from '../auth.js';
|
|
4
|
-
import { apiRes } from '@studiocubics/utils';
|
|
5
|
-
import { cache } from 'react';
|
|
6
|
-
|
|
7
|
-
const systemUserListReadAction = cache(async (params, removeCurrent = false) => {
|
|
8
|
-
const session = await auth();
|
|
9
|
-
if (!session.hasPermission("systemUsers", "read")) {
|
|
10
|
-
throw new Error(apiRes.forbidden);
|
|
11
|
-
}
|
|
12
|
-
const client = await clerkClient();
|
|
13
|
-
const systemUserList = await client.users.getUserList(params);
|
|
14
|
-
if (removeCurrent) {
|
|
15
|
-
systemUserList.data = systemUserList.data.filter((su) => su.id !== session.userId);
|
|
16
|
-
systemUserList.totalCount--;
|
|
17
|
-
}
|
|
18
|
-
return systemUserList;
|
|
19
|
-
});
|
|
20
|
-
const systemUserReadAction = cache(async (id) => {
|
|
21
|
-
const session = await auth();
|
|
22
|
-
if (!session.hasPermission("systemUsers", "read")) {
|
|
23
|
-
throw new Error(apiRes.forbidden);
|
|
24
|
-
}
|
|
25
|
-
const client = await clerkClient();
|
|
26
|
-
const systemUser = await client.users.getUser(id);
|
|
27
|
-
if (!systemUser) {
|
|
28
|
-
throw new Error(apiRes.notFound(`System User: ${id}`));
|
|
29
|
-
}
|
|
30
|
-
return systemUser;
|
|
31
|
-
});
|
|
32
|
-
async function systemUserRoleUpdateAction(userId, _, formData) {
|
|
33
|
-
const session = await auth();
|
|
34
|
-
if (!session.hasPermission("systemUsers", "update")) {
|
|
35
|
-
throw new Error(apiRes.forbidden);
|
|
36
|
-
}
|
|
37
|
-
const role = formData.get("role");
|
|
38
|
-
console.log("userId", userId);
|
|
39
|
-
console.log("role", role);
|
|
40
|
-
return apiRes.actionSuccess();
|
|
41
|
-
// const client = await clerkClient();
|
|
42
|
-
// const { publicMetadata } = await client.users.getUser(userId);
|
|
43
|
-
// const patchedUser = await client.users.updateUserMetadata(userId, {
|
|
44
|
-
// publicMetadata: {
|
|
45
|
-
// ...publicMetadata,
|
|
46
|
-
// role,
|
|
47
|
-
// },
|
|
48
|
-
// });
|
|
49
|
-
// return apiRes.actionSuccess(patchedUser);
|
|
50
|
-
}
|
|
51
|
-
async function systemUserDetailsUpdateAction(userId, _, formData) {
|
|
52
|
-
const session = await auth();
|
|
53
|
-
if (!session.hasPermission("systemUsers", "update")) {
|
|
54
|
-
throw new Error(apiRes.forbidden);
|
|
55
|
-
}
|
|
56
|
-
console.log("firstName", formData.get("firstName"));
|
|
57
|
-
console.log("lastName", formData.get("firstName"));
|
|
58
|
-
console.log("imageFile", formData.get("imageFile"));
|
|
59
|
-
console.log("userId", userId);
|
|
60
|
-
return apiRes.actionSuccess();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { systemUserDetailsUpdateAction, systemUserListReadAction, systemUserReadAction, systemUserRoleUpdateAction };
|
|
64
|
-
//# sourceMappingURL=systemUsers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"systemUsers.js","sources":["../../../src/clerk/actions/systemUsers.ts"],"sourcesContent":["\"use server\";\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 \"../../ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm\";\nimport { cache } from \"react\";\nimport type { SystemUserDetailsUpdateState } from \"../../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":[],"mappings":";;;;;;AASO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAK,CAC3C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACE,MAA2B,CAAA,CAC3B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyB,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CACQ;AACtC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,IAAI,CAAA,CAAE;IAE5B,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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';
|
|
4
|
-
|
|
5
|
-
async function auth(options) {
|
|
6
|
-
const clerkAuthResult = await auth$1(options);
|
|
7
|
-
return {
|
|
8
|
-
...clerkAuthResult,
|
|
9
|
-
hasPermission: async (resource, action, record) => {
|
|
10
|
-
return hasPermissionForClaims({
|
|
11
|
-
claims: clerkAuthResult.sessionClaims,
|
|
12
|
-
resource,
|
|
13
|
-
action,
|
|
14
|
-
record,
|
|
15
|
-
});
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { auth };
|
|
21
|
-
//# sourceMappingURL=auth.js.map
|
package/dist/clerk/auth.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sources":["../../src/clerk/auth.ts"],"sourcesContent":["\"use server\";\nimport { auth as clerkAuth } from \"@clerk/nextjs/server\";\nimport { hasPermissionForClaims } from \"./hasPermission\";\nimport type { Resource, RoleActions } from \"./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":["clerkAuth"],"mappings":";;;;AAaO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAA,CAAA,CAAI,CACxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyC,CAAA,CAAA;AAEzC,CAAA,CAAA,CAAA,CA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A,CAAA,CAAA,CAAC;QACJ,CAAC;KACF;AACH;;"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
import { auth } from '@clerk/nextjs/server';
|
|
3
|
-
import { RBAC_CONFIG } from './rbacConfig.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Evaluates RBAC permissions using explicitly provided session claims.
|
|
7
|
-
*
|
|
8
|
-
* @returns `true` if the role defined in `sessionClaims.metadata.role`
|
|
9
|
-
* is allowed to perform `action` on `resource` under RBAC rules.
|
|
10
|
-
*/
|
|
11
|
-
async function hasPermissionForClaims(args) {
|
|
12
|
-
if (!("metadata" in args.claims))
|
|
13
|
-
return false;
|
|
14
|
-
const role = args.claims?.metadata.role;
|
|
15
|
-
if (!role)
|
|
16
|
-
return false;
|
|
17
|
-
return checkPermissions({ role, ...args });
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Evaluates RBAC permissions for the currently authenticated user.
|
|
21
|
-
*
|
|
22
|
-
* Use this when you do NOT already have session claims.
|
|
23
|
-
*
|
|
24
|
-
* @returns `true` if the current user's role is allowed
|
|
25
|
-
* to perform `action` on `resource` under RBAC rules.
|
|
26
|
-
*/
|
|
27
|
-
async function hasPermission(args) {
|
|
28
|
-
let claims;
|
|
29
|
-
const a = await auth();
|
|
30
|
-
claims = a.sessionClaims;
|
|
31
|
-
const role = claims?.metadata.role;
|
|
32
|
-
if (!role)
|
|
33
|
-
return false;
|
|
34
|
-
return checkPermissions({
|
|
35
|
-
role,
|
|
36
|
-
claims,
|
|
37
|
-
...args,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Core RBAC policy evaluator.
|
|
42
|
-
*
|
|
43
|
-
* This is the authorization engine shared by all permission checks.
|
|
44
|
-
* It does NOT perform authentication or session resolution.
|
|
45
|
-
*
|
|
46
|
-
* Rules:
|
|
47
|
-
* - `isSystem` roles bypass all checks
|
|
48
|
-
* - permissions are matched by `{ resource, action }`
|
|
49
|
-
* - optional ownership constraints are enforced via `ownerField`
|
|
50
|
-
* @param {PermissionCheckInput} args
|
|
51
|
-
* @returns `true` if at least one permission grants access
|
|
52
|
-
*/
|
|
53
|
-
function checkPermissions(args) {
|
|
54
|
-
const def = RBAC_CONFIG[args.role];
|
|
55
|
-
if (!def)
|
|
56
|
-
return false;
|
|
57
|
-
// Allow system
|
|
58
|
-
if (def.isSystem)
|
|
59
|
-
return true;
|
|
60
|
-
// Iterate over all permissions
|
|
61
|
-
for (const p of def.permissions) {
|
|
62
|
-
if (p.resource !== args.resource)
|
|
63
|
-
continue;
|
|
64
|
-
if (!p.actions?.[args.action])
|
|
65
|
-
continue;
|
|
66
|
-
// Ownership conditions
|
|
67
|
-
if (p.conditions?.ownerField && args.record) {
|
|
68
|
-
const ownerField = p.conditions.ownerField;
|
|
69
|
-
if (args.record[ownerField] !== args.claims.id)
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export { hasPermission, hasPermissionForClaims };
|
|
78
|
-
//# sourceMappingURL=hasPermission.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasPermission.js","sources":["../../src/clerk/hasPermission.ts"],"sourcesContent":["\"use server\";\nimport { auth } from \"@clerk/nextjs/server\";\nimport {\n type Resource,\n type RoleActions,\n type Role,\n RBAC_CONFIG,\n} from \"./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":[],"mappings":";;;;AASA,CAAA,CAAA;;;;;AAKG,CAAA,CAAA;AACI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,CAAC,CAAA,CAAA,CAAA,CAK5C,CAAA,CAAA;AACC,CAAA,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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAA,CAAG,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU;YAC1C,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAA,CAAE;gBAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;QAClD;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAI;IACb;AACA,CAAA,CAAA,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAA,CAAK;AACd;;"}
|
package/dist/clerk/rbacConfig.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const roles = ["admin", "manager", "member"];
|
|
2
|
-
const resources = ["systemUsers", "projects", "invitations"];
|
|
3
|
-
const RBAC_CONFIG = {
|
|
4
|
-
admin: {
|
|
5
|
-
desc: "Full system authority with unrestricted access and management capabilities.",
|
|
6
|
-
isSystem: true,
|
|
7
|
-
permissions: [], // system role bypasses all checks
|
|
8
|
-
},
|
|
9
|
-
manager: {
|
|
10
|
-
desc: "Responsible for overseeing teams and resources; can manage existing items and invite users.",
|
|
11
|
-
inherits: ["member"],
|
|
12
|
-
permissions: [
|
|
13
|
-
{
|
|
14
|
-
resource: "systemUsers",
|
|
15
|
-
actions: { create: true, read: true, update: true },
|
|
16
|
-
conditions: { ownerField: "id" },
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
resource: "projects",
|
|
20
|
-
actions: { create: true, read: true, update: true, delete: true },
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
resource: "invitations",
|
|
24
|
-
actions: { create: true, read: true, update: true, delete: true },
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
member: {
|
|
29
|
-
desc: "Standard user with read-level access to assigned resources; limited modification rights.",
|
|
30
|
-
permissions: [
|
|
31
|
-
{ resource: "systemUsers", actions: { read: true } },
|
|
32
|
-
{ resource: "projects", actions: { read: true } },
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
const getInvitationPublicMetadata = (role) => {
|
|
37
|
-
switch (role) {
|
|
38
|
-
case "admin":
|
|
39
|
-
return { role, onboardingComplete: true };
|
|
40
|
-
case "manager":
|
|
41
|
-
return { role, onboardingComplete: true };
|
|
42
|
-
default:
|
|
43
|
-
return { role, onboardingComplete: false };
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export { RBAC_CONFIG, getInvitationPublicMetadata, resources, roles };
|
|
48
|
-
//# sourceMappingURL=rbacConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rbacConfig.js","sources":["../../src/clerk/rbacConfig.ts"],"sourcesContent":["export const roles = [\"admin\", \"manager\", \"member\"] as const;\nexport const resources = [\"systemUsers\", \"projects\", \"invitations\"] as const;\n\nexport const RBAC_CONFIG: {\n [K in Role]: RoleDoc;\n} = {\n admin: {\n desc: \"Full system authority with unrestricted access and management capabilities.\",\n isSystem: true,\n permissions: [], // system role bypasses all checks\n },\n manager: {\n desc: \"Responsible for overseeing teams and resources; can manage existing items and invite users.\",\n inherits: [\"member\"],\n permissions: [\n {\n resource: \"systemUsers\",\n actions: { create: true, read: true, update: true },\n conditions: { ownerField: \"id\" },\n },\n {\n resource: \"projects\",\n actions: { create: true, read: true, update: true, delete: true },\n },\n {\n resource: \"invitations\",\n actions: { create: true, read: true, update: true, delete: true },\n },\n ],\n },\n member: {\n desc: \"Standard user with read-level access to assigned resources; limited modification rights.\",\n permissions: [\n { resource: \"systemUsers\", actions: { read: true } },\n { resource: \"projects\", actions: { read: true } },\n ],\n },\n} as const;\n\nexport type Role = (typeof roles)[number];\nexport type Resource = (typeof resources)[number];\n\nexport type RoleActions = \"create\" | \"read\" | \"update\" | \"delete\";\n\nexport type ResourcePermission = {\n resource: Resource;\n actions: Partial<Record<RoleActions, boolean>>;\n conditions?: {\n ownerField?: string; // e.g. “creatorId”\n };\n};\nexport type RoleDoc = {\n desc?: string;\n inherits?: string[];\n isSystem?: boolean;\n permissions: ResourcePermission[];\n};\n\nexport const getInvitationPublicMetadata = (role: Role) => {\n switch (role) {\n case \"admin\":\n return { role, onboardingComplete: true };\n case \"manager\":\n return { role, onboardingComplete: true };\n default:\n return { role, onboardingComplete: false };\n }\n};\n"],"names":[],"mappings":"AAAO,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ;AAC3C,MAAM,SAAS,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,aAAa;AAE3D,MAAM,WAAW,GAEpB;AACF,IAAA,KAAK,EAAE;AACL,QAAA,IAAI,EAAE,6EAA6E;AACnF,QAAA,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,EAAE;AAChB,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,6FAA6F;QACnG,QAAQ,EAAE,CAAC,QAAQ,CAAC;AACpB,QAAA,WAAW,EAAE;AACX,YAAA;AACE,gBAAA,QAAQ,EAAE,aAAa;AACvB,gBAAA,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;AACnD,gBAAA,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;AACjC,aAAA;AACD,YAAA;AACE,gBAAA,QAAQ,EAAE,UAAU;AACpB,gBAAA,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;AAClE,aAAA;AACD,YAAA;AACE,gBAAA,QAAQ,EAAE,aAAa;AACvB,gBAAA,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;AAClE,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,0FAA0F;AAChG,QAAA,WAAW,EAAE;YACX,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;YACpD,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;AAClD,SAAA;AACF,KAAA;;AAsBI,MAAM,2BAA2B,GAAG,CAAC,IAAU,KAAI;IACxD,QAAQ,IAAI;AACV,QAAA,KAAK,OAAO;AACV,YAAA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE;AAC3C,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE;AAC3C,QAAA;AACE,YAAA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE;;AAEhD;;;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
import { roles } from '../rbacConfig.js';
|
|
3
|
-
|
|
4
|
-
const createInvitationSchema = z.object({
|
|
5
|
-
emailAddress: z.string(),
|
|
6
|
-
expiresInDays: z
|
|
7
|
-
.preprocess((val) => {
|
|
8
|
-
if (typeof val === "string") {
|
|
9
|
-
return Number.parseInt(val);
|
|
10
|
-
}
|
|
11
|
-
return val;
|
|
12
|
-
}, z.number())
|
|
13
|
-
.optional(),
|
|
14
|
-
ignoreExisting: z.boolean().default(false).optional(),
|
|
15
|
-
notify: z.boolean().default(true).optional(),
|
|
16
|
-
role: z.enum(roles),
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export { createInvitationSchema };
|
|
20
|
-
//# sourceMappingURL=invitation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.js","sources":["../../../src/clerk/schemas/invitation.ts"],"sourcesContent":["import z from \"zod\";\nimport { roles } from \"../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":[],"mappings":";;;AAGO,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;AAC7C,IAAA,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;AACxB,IAAA,aAAa,EAAE;AACZ,SAAA,UAAU,CAAC,CAAC,GAAG,KAAI;AAClB,QAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC3B,YAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC7B;AACA,QAAA,OAAO,GAAG;AACZ,IAAA,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;AACZ,SAAA,QAAQ,EAAE;AACb,IAAA,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;AACrD,IAAA,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;AAC5C,IAAA,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACpB,CAAA;;;;"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a Clerk `User` (server-side) into a client-safe, serializable object.
|
|
3
|
-
*
|
|
4
|
-
* Why this exists:
|
|
5
|
-
* - The Clerk `User` class contains methods and non-serializable fields.
|
|
6
|
-
* - Passing it directly to a Client Component will break React Server Components.
|
|
7
|
-
* - This function strips the object down to stable, safe primitives only.
|
|
8
|
-
*
|
|
9
|
-
* Rules enforced here:
|
|
10
|
-
* - No functions
|
|
11
|
-
* - No circular references
|
|
12
|
-
* - No private or sensitive data
|
|
13
|
-
*
|
|
14
|
-
* @param user Clerk User instance from `@clerk/nextjs/server`
|
|
15
|
-
* @returns ClientSafeUser plain object
|
|
16
|
-
*/
|
|
17
|
-
function toClientSafeUser(user) {
|
|
18
|
-
const pea = user.emailAddresses.find((ea) => ea.id == user.primaryEmailAddressId);
|
|
19
|
-
if (!pea)
|
|
20
|
-
throw new Error("Missing primaryEmailAddress");
|
|
21
|
-
return {
|
|
22
|
-
id: user.id,
|
|
23
|
-
username: user.username,
|
|
24
|
-
firstName: user.firstName,
|
|
25
|
-
lastName: user.lastName,
|
|
26
|
-
fullName: user.fullName,
|
|
27
|
-
imageUrl: user.imageUrl,
|
|
28
|
-
primaryEmailAddress: {
|
|
29
|
-
id: pea.id,
|
|
30
|
-
emailAddress: pea.emailAddress,
|
|
31
|
-
verified: pea.verification?.status === "verified",
|
|
32
|
-
},
|
|
33
|
-
emailAddresses: user.emailAddresses.map((email) => ({
|
|
34
|
-
id: email.id,
|
|
35
|
-
emailAddress: email.emailAddress,
|
|
36
|
-
verified: email.verification?.status === "verified",
|
|
37
|
-
})),
|
|
38
|
-
publicMetadata: user.publicMetadata ?? {},
|
|
39
|
-
createdAt: new Date(user.createdAt),
|
|
40
|
-
updatedAt: new Date(user.updatedAt),
|
|
41
|
-
lastSignInAt: user.lastSignInAt ? new Date(user.lastSignInAt) : null,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export { toClientSafeUser };
|
|
46
|
-
//# sourceMappingURL=toClientSafeUser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toClientSafeUser.js","sources":["../../src/clerk/toClientSafeUser.ts"],"sourcesContent":["import 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":[],"mappings":"AAiCA;;;;;;;;;;;;;;;AAeG;AACG,SAAU,gBAAgB,CAAC,IAAU,EAAA;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAClC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,qBAAqB,CAC5C;AACD,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC;IACxD,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;AACvB,QAAA,mBAAmB,EAAE;YACnB,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,YAAY,EAAE,GAAG,CAAC,YAAY;AAC9B,YAAA,QAAQ,EAAE,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,UAAU;AAClD,SAAA;AACD,QAAA,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,MAAM;YAClD,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,YAAY,EAAE,KAAK,CAAC,YAAY;AAChC,YAAA,QAAQ,EAAE,KAAK,CAAC,YAAY,EAAE,MAAM,KAAK,UAAU;AACpD,SAAA,CAAC,CAAC;AACH,QAAA,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,EAAE;AACzC,QAAA,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;AACnC,QAAA,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;AACnC,QAAA,YAAY,EAAE,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI;KACrE;AACH;;;;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ListItemProps, TabProps } from "@studiocubics/components";
|
|
2
|
-
export declare const defaultNavLinks: ListItemProps[];
|
|
3
|
-
export declare const defaultSecurityLinks: TabProps[];
|
|
4
|
-
export declare const fontH: import("next/dist/compiled/@next/font").NextFontWithVariable;
|
|
5
|
-
export declare const fontP: import("next/dist/compiled/@next/font").NextFontWithVariable;
|
|
6
|
-
export declare const defaultBodyClassName: string;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Outfit, Titillium_Web } from 'next/font/google';
|
|
3
|
-
import { Newspaper, ShieldUser, Settings, SquareUser, DoorClosedLocked, Users, Send } from 'lucide-react';
|
|
4
|
-
|
|
5
|
-
const defaultNavLinks = [
|
|
6
|
-
{
|
|
7
|
-
startIcon: jsx(Newspaper, {}),
|
|
8
|
-
children: "Content",
|
|
9
|
-
href: "/dashboard/content",
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
startIcon: jsx(ShieldUser, {}),
|
|
13
|
-
href: "/dashboard/security",
|
|
14
|
-
children: "Security",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
startIcon: jsx(Settings, {}),
|
|
18
|
-
href: "/dashboard/settings",
|
|
19
|
-
children: "Settings",
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
const defaultSecurityLinks = [
|
|
23
|
-
{
|
|
24
|
-
children: "Your Account",
|
|
25
|
-
startIcon: jsx(SquareUser, {}),
|
|
26
|
-
href: "/dashboard/security/account",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
children: "Roles & Permissions",
|
|
30
|
-
startIcon: jsx(DoorClosedLocked, {}),
|
|
31
|
-
href: "/dashboard/security/permissions",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
children: "System Users",
|
|
35
|
-
startIcon: jsx(Users, {}),
|
|
36
|
-
href: "/dashboard/security/systemUsers",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
children: "Invitations",
|
|
40
|
-
startIcon: jsx(Send, {}),
|
|
41
|
-
href: "/dashboard/security/invitations",
|
|
42
|
-
},
|
|
43
|
-
];
|
|
44
|
-
const fontH = Outfit({
|
|
45
|
-
variable: "--font-h",
|
|
46
|
-
subsets: ["latin"],
|
|
47
|
-
});
|
|
48
|
-
const fontP = Titillium_Web({
|
|
49
|
-
variable: "--font-p",
|
|
50
|
-
weight: ["200", "400", "600", "700", "900"],
|
|
51
|
-
subsets: ["latin"],
|
|
52
|
-
});
|
|
53
|
-
const defaultBodyClassName = `${fontH.variable} ${fontP.variable}`;
|
|
54
|
-
|
|
55
|
-
export { defaultBodyClassName, defaultNavLinks, defaultSecurityLinks, fontH, fontP };
|
|
56
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sources":["../../src/constants/defaults.tsx"],"sourcesContent":["import type { ListItemProps, TabProps } from \"@studiocubics/components\";\nimport { Titillium_Web, Outfit } from \"next/font/google\";\nimport {\n Newspaper,\n Settings,\n ShieldUser,\n SquareUser,\n DoorClosedLocked,\n Users,\n Send,\n} from \"lucide-react\";\n\nexport const defaultNavLinks: ListItemProps[] = [\n {\n startIcon: <Newspaper />,\n children: \"Content\",\n href: \"/dashboard/content\",\n },\n {\n startIcon: <ShieldUser />,\n href: \"/dashboard/security\",\n children: \"Security\",\n },\n {\n startIcon: <Settings />,\n href: \"/dashboard/settings\",\n children: \"Settings\",\n },\n];\nexport const defaultSecurityLinks: TabProps[] = [\n {\n children: \"Your Account\",\n startIcon: <SquareUser />,\n href: \"/dashboard/security/account\",\n },\n {\n children: \"Roles & Permissions\",\n startIcon: <DoorClosedLocked />,\n href: \"/dashboard/security/permissions\",\n },\n {\n children: \"System Users\",\n startIcon: <Users />,\n href: \"/dashboard/security/systemUsers\",\n },\n {\n children: \"Invitations\",\n startIcon: <Send />,\n href: \"/dashboard/security/invitations\",\n },\n];\nexport const fontH = Outfit({\n variable: \"--font-h\",\n subsets: [\"latin\"],\n});\n\nexport const fontP = Titillium_Web({\n variable: \"--font-p\",\n weight: [\"200\", \"400\", \"600\", \"700\", \"900\"],\n subsets: [\"latin\"],\n});\nexport const defaultBodyClassName = `${fontH.variable} ${fontP.variable}`;\n"],"names":["_jsx"],"mappings":";;;;AAYO,MAAM,eAAe,GAAoB;AAC9C,IAAA;QACE,SAAS,EAAEA,GAAA,CAAC,SAAS,EAAA,EAAA,CAAG;AACxB,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,IAAI,EAAE,oBAAoB;AAC3B,KAAA;AACD,IAAA;QACE,SAAS,EAAEA,GAAA,CAAC,UAAU,EAAA,EAAA,CAAG;AACzB,QAAA,IAAI,EAAE,qBAAqB;AAC3B,QAAA,QAAQ,EAAE,UAAU;AACrB,KAAA;AACD,IAAA;QACE,SAAS,EAAEA,GAAA,CAAC,QAAQ,EAAA,EAAA,CAAG;AACvB,QAAA,IAAI,EAAE,qBAAqB;AAC3B,QAAA,QAAQ,EAAE,UAAU;AACrB,KAAA;;AAEI,MAAM,oBAAoB,GAAe;AAC9C,IAAA;AACE,QAAA,QAAQ,EAAE,cAAc;QACxB,SAAS,EAAEA,GAAA,CAAC,UAAU,EAAA,EAAA,CAAG;AACzB,QAAA,IAAI,EAAE,6BAA6B;AACpC,KAAA;AACD,IAAA;AACE,QAAA,QAAQ,EAAE,qBAAqB;QAC/B,SAAS,EAAEA,GAAA,CAAC,gBAAgB,EAAA,EAAA,CAAG;AAC/B,QAAA,IAAI,EAAE,iCAAiC;AACxC,KAAA;AACD,IAAA;AACE,QAAA,QAAQ,EAAE,cAAc;QACxB,SAAS,EAAEA,GAAA,CAAC,KAAK,EAAA,EAAA,CAAG;AACpB,QAAA,IAAI,EAAE,iCAAiC;AACxC,KAAA;AACD,IAAA;AACE,QAAA,QAAQ,EAAE,aAAa;QACvB,SAAS,EAAEA,GAAA,CAAC,IAAI,EAAA,EAAA,CAAG;AACnB,QAAA,IAAI,EAAE,iCAAiC;AACxC,KAAA;;AAEI,MAAM,KAAK,GAAG,MAAM,CAAC;AAC1B,IAAA,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,CAAC,OAAO,CAAC;AACnB,CAAA;AAEM,MAAM,KAAK,GAAG,aAAa,CAAC;AACjC,IAAA,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IAC3C,OAAO,EAAE,CAAC,OAAO,CAAC;AACnB,CAAA;AACM,MAAM,oBAAoB,GAAG,CAAA,EAAG,KAAK,CAAC,QAAQ,CAAA,CAAA,EAAI,KAAK,CAAC,QAAQ;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pageLimits.js","sources":["../../src/constants/pageLimits.ts"],"sourcesContent":["export const SYSTEM_USERS_PAGE_LIMIT = 10;\nexport const INVITATIONS_PAGE_LIMIT = 10;\n"],"names":[],"mappings":"AAAO,MAAM,uBAAuB,GAAG;AAChC,MAAM,sBAAsB,GAAG;;;;"}
|
package/dist/index.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export { invitationCreateAction, invitationDeleteAction, invitationListReadAction } from './clerk/actions/invitations.js';
|
|
2
|
-
export { systemUserDetailsUpdateAction, systemUserListReadAction, systemUserReadAction, systemUserRoleUpdateAction } from './clerk/actions/systemUsers.js';
|
|
3
|
-
export { auth } from './clerk/auth.js';
|
|
4
|
-
export { hasPermission, hasPermissionForClaims } from './clerk/hasPermission.js';
|
|
5
|
-
export { RBAC_CONFIG, getInvitationPublicMetadata, resources, roles } from './clerk/rbacConfig.js';
|
|
6
|
-
export { createInvitationSchema } from './clerk/schemas/invitation.js';
|
|
7
|
-
export { toClientSafeUser } from './clerk/toClientSafeUser.js';
|
|
8
|
-
export { INVITATIONS_PAGE_LIMIT, SYSTEM_USERS_PAGE_LIMIT } from './constants/pageLimits.js';
|
|
9
|
-
export { defaultBodyClassName, defaultNavLinks, defaultSecurityLinks, fontH, fontP } from './constants/defaults.js';
|
|
10
|
-
export { CMSRootProviders } from './providers/CMSRootProviders.js';
|
|
11
|
-
export { ThemedMonacoEditor } from './ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js';
|
|
12
|
-
export { CMSSecurityLayout } from './ui/Layout/CMSSecurityLayout.js';
|
|
13
|
-
export { CMSSidebar } from './ui/Layout/CMSSidebar/CMSSidebar.js';
|
|
14
|
-
export { CMSSidebarBody } from './ui/Layout/CMSSidebar/CMSSidebarBody.js';
|
|
15
|
-
export { CMSSidebarFooter } from './ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js';
|
|
16
|
-
export { CMSSidebarHeader } from './ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js';
|
|
17
|
-
export { SignIn } from './ui/System/Auth/SignIn/SignIn.js';
|
|
18
|
-
export { useSignInForm } from './ui/System/Auth/SignIn/useSignInForm.js';
|
|
19
|
-
export { SignUp } from './ui/System/Auth/SignUp/SignUp.js';
|
|
20
|
-
export { useSignUpForm } from './ui/System/Auth/SignUp/useSignUpForm.js';
|
|
21
|
-
export { InvitationList } from './ui/System/Invitations/InvitationList.js';
|
|
22
|
-
export { InvitationCreateDialog, InvitationListActions, InvitationRevokeDialog } from './ui/System/Invitations/InvitationListActions.js';
|
|
23
|
-
export { InvitationListCard } from './ui/System/Invitations/InvitationListCard.js';
|
|
24
|
-
export { InvitationListPage } from './ui/System/Invitations/InvitationListPage.js';
|
|
25
|
-
export { InvitationListPagination } from './ui/System/Invitations/InvitationListPagination.js';
|
|
26
|
-
export { RoleListCard } from './ui/System/Permissions/RoleListCard.js';
|
|
27
|
-
export { RolePermissionsPage } from './ui/System/Permissions/RolePermissionsPage.js';
|
|
28
|
-
export { RolePermissionsTable } from './ui/System/Permissions/RolePermissionsTable.js';
|
|
29
|
-
export { CurrentSystemUserButton, Logout } from './ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js';
|
|
30
|
-
export { CurrentSystemUserPage } from './ui/System/SystemUser/CurrentSystemUserPage.js';
|
|
31
|
-
export { SystemUserDeleteListItem } from './ui/System/SystemUser/SystemUserActions.js';
|
|
32
|
-
export { SystemUserDetails } from './ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js';
|
|
33
|
-
export { SystemUserDetailsForm } from './ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js';
|
|
34
|
-
export { SystemUserList } from './ui/System/SystemUser/SystemUserList.js';
|
|
35
|
-
export { SystemUserListActions } from './ui/System/SystemUser/SystemUserListActions.js';
|
|
36
|
-
export { SystemUserListCard } from './ui/System/SystemUser/SystemUserListCard.js';
|
|
37
|
-
export { SystemUserListPage } from './ui/System/SystemUser/SystemUserListPage.js';
|
|
38
|
-
export { SystemUserListPagination } from './ui/System/SystemUser/SystemUserListPagination.js';
|
|
39
|
-
export { SystemUserPage } from './ui/System/SystemUser/SystemUserPage.js';
|
|
40
|
-
export { SystemUserPageContent } from './ui/System/SystemUser/SystemUserPageContent.js';
|
|
41
|
-
export { SystemUserRole } from './ui/System/SystemUser/SystemUserRole/SystemUserRole.js';
|
|
42
|
-
export { CurrentSystemUserTimestamps, SystemUserTimestamps } from './ui/System/SystemUser/SystemUserTimestamps.js';
|
|
43
|
-
export { WelcomePage } from './ui/System/WelcomePage/WelcomePage.js';
|
|
44
|
-
export { cmsConfig, cmsMiddleware } from './utils/proxyFunctions.js';
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|