@orthacms/workspaces-admin 0.0.0-reserve.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/lib/api/useAddWorkspaceContent/index.d.ts +15 -0
- package/dist/lib/api/useAddWorkspaceContent/index.d.ts.map +1 -0
- package/dist/lib/api/useAddWorkspaceMember/index.d.ts +14 -0
- package/dist/lib/api/useAddWorkspaceMember/index.d.ts.map +1 -0
- package/dist/lib/api/useContentTypes/index.d.ts +10 -0
- package/dist/lib/api/useContentTypes/index.d.ts.map +1 -0
- package/dist/lib/api/useCreateWorkspace/index.d.ts +20 -0
- package/dist/lib/api/useCreateWorkspace/index.d.ts.map +1 -0
- package/dist/lib/api/useDeleteWorkspace/index.d.ts +13 -0
- package/dist/lib/api/useDeleteWorkspace/index.d.ts.map +1 -0
- package/dist/lib/api/useRemoveWorkspaceContent/index.d.ts +15 -0
- package/dist/lib/api/useRemoveWorkspaceContent/index.d.ts.map +1 -0
- package/dist/lib/api/useRemoveWorkspaceMember/index.d.ts +13 -0
- package/dist/lib/api/useRemoveWorkspaceMember/index.d.ts.map +1 -0
- package/dist/lib/api/useSetWorkspaceStatus/index.d.ts +14 -0
- package/dist/lib/api/useSetWorkspaceStatus/index.d.ts.map +1 -0
- package/dist/lib/api/useSlugAvailability/index.d.ts +10 -0
- package/dist/lib/api/useSlugAvailability/index.d.ts.map +1 -0
- package/dist/lib/api/useUpdateWorkspace/index.d.ts +23 -0
- package/dist/lib/api/useUpdateWorkspace/index.d.ts.map +1 -0
- package/dist/lib/api/useUsersSearch/index.d.ts +17 -0
- package/dist/lib/api/useUsersSearch/index.d.ts.map +1 -0
- package/dist/lib/api/useWorkspaceContentCount/index.d.ts +8 -0
- package/dist/lib/api/useWorkspaceContentCount/index.d.ts.map +1 -0
- package/dist/lib/api/useWorkspaceEntryCount/index.d.ts +8 -0
- package/dist/lib/api/useWorkspaceEntryCount/index.d.ts.map +1 -0
- package/dist/lib/api/useWorkspaces/index.d.ts +30 -0
- package/dist/lib/api/useWorkspaces/index.d.ts.map +1 -0
- package/dist/lib/application/useAddWorkspaceContent/index.d.ts +9 -0
- package/dist/lib/application/useAddWorkspaceContent/index.d.ts.map +1 -0
- package/dist/lib/application/useAddWorkspaceContent/index.js +15 -0
- package/dist/lib/application/useAddWorkspaceMember/index.d.ts +8 -0
- package/dist/lib/application/useAddWorkspaceMember/index.d.ts.map +1 -0
- package/dist/lib/application/useAddWorkspaceMember/index.js +14 -0
- package/dist/lib/application/useContentTypes/index.d.ts +9 -0
- package/dist/lib/application/useContentTypes/index.d.ts.map +1 -0
- package/dist/lib/application/useContentTypes/index.js +16 -0
- package/dist/lib/application/useCreateWorkspace/index.d.ts +20 -0
- package/dist/lib/application/useCreateWorkspace/index.d.ts.map +1 -0
- package/dist/lib/application/useCreateWorkspace/index.js +44 -0
- package/dist/lib/application/useCreateWorkspaceFlow/index.d.ts +23 -0
- package/dist/lib/application/useCreateWorkspaceFlow/index.d.ts.map +1 -0
- package/dist/lib/application/useCreateWorkspaceFlow/index.js +81 -0
- package/dist/lib/application/useDeleteWorkspace/index.d.ts +13 -0
- package/dist/lib/application/useDeleteWorkspace/index.d.ts.map +1 -0
- package/dist/lib/application/useDeleteWorkspace/index.js +23 -0
- package/dist/lib/application/useRemoveWorkspaceContent/index.d.ts +9 -0
- package/dist/lib/application/useRemoveWorkspaceContent/index.d.ts.map +1 -0
- package/dist/lib/application/useRemoveWorkspaceContent/index.js +15 -0
- package/dist/lib/application/useRemoveWorkspaceMember/index.d.ts +8 -0
- package/dist/lib/application/useRemoveWorkspaceMember/index.d.ts.map +1 -0
- package/dist/lib/application/useRemoveWorkspaceMember/index.js +14 -0
- package/dist/lib/application/useSetWorkspaceStatus/index.d.ts +9 -0
- package/dist/lib/application/useSetWorkspaceStatus/index.d.ts.map +1 -0
- package/dist/lib/application/useSetWorkspaceStatus/index.js +15 -0
- package/dist/lib/application/useSlugAvailability/index.d.ts +18 -0
- package/dist/lib/application/useSlugAvailability/index.d.ts.map +1 -0
- package/dist/lib/application/useSlugAvailability/index.js +39 -0
- package/dist/lib/application/useUpdateWorkspace/index.d.ts +9 -0
- package/dist/lib/application/useUpdateWorkspace/index.d.ts.map +1 -0
- package/dist/lib/application/useUpdateWorkspace/index.js +15 -0
- package/dist/lib/application/useUsersSearch/index.d.ts +18 -0
- package/dist/lib/application/useUsersSearch/index.d.ts.map +1 -0
- package/dist/lib/application/useUsersSearch/index.js +24 -0
- package/dist/lib/application/useWorkspaceContentCount/index.d.ts +8 -0
- package/dist/lib/application/useWorkspaceContentCount/index.d.ts.map +1 -0
- package/dist/lib/application/useWorkspaceContentCount/index.js +17 -0
- package/dist/lib/application/useWorkspaceEntryCount/index.d.ts +8 -0
- package/dist/lib/application/useWorkspaceEntryCount/index.d.ts.map +1 -0
- package/dist/lib/application/useWorkspaceEntryCount/index.js +17 -0
- package/dist/lib/application/useWorkspaces/index.d.ts +5 -0
- package/dist/lib/application/useWorkspaces/index.d.ts.map +1 -0
- package/dist/lib/application/useWorkspaces/index.js +11 -0
- package/dist/lib/components/BlockingConfirmDialog/index.d.ts +41 -0
- package/dist/lib/components/BlockingConfirmDialog/index.d.ts.map +1 -0
- package/dist/lib/components/ColorSwatchRow/index.d.ts +15 -0
- package/dist/lib/components/ColorSwatchRow/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/ColorSwatchRow/index.d.ts +15 -0
- package/dist/lib/components/CreateWorkspaceWizard/ColorSwatchRow/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts +11 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts +48 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/index.d.ts +23 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/IdentityFields/index.d.ts +17 -0
- package/dist/lib/components/CreateWorkspaceWizard/IdentityFields/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts +14 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts +15 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/index.d.ts +17 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/Monogram/index.d.ts +17 -0
- package/dist/lib/components/CreateWorkspaceWizard/Monogram/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/SlugField/index.d.ts +23 -0
- package/dist/lib/components/CreateWorkspaceWizard/SlugField/index.d.ts.map +1 -0
- package/dist/lib/components/StatusChip/index.d.ts +9 -0
- package/dist/lib/components/StatusChip/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceAvatar/index.d.ts +20 -0
- package/dist/lib/components/WorkspaceAvatar/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCard/MemberStack/MemberListPopover/index.d.ts +9 -0
- package/dist/lib/components/WorkspaceCard/MemberStack/MemberListPopover/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCard/MemberStack/index.d.ts +11 -0
- package/dist/lib/components/WorkspaceCard/MemberStack/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCard/StatusChip/index.d.ts +9 -0
- package/dist/lib/components/WorkspaceCard/StatusChip/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCard/index.d.ts +15 -0
- package/dist/lib/components/WorkspaceCard/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCommands/index.d.ts +8 -0
- package/dist/lib/components/WorkspaceCommands/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/AddContentDialog/index.d.ts +26 -0
- package/dist/lib/components/WorkspaceContentSettings/AddContentDialog/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts +21 -0
- package/dist/lib/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts +26 -0
- package/dist/lib/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts +25 -0
- package/dist/lib/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/index.d.ts +25 -0
- package/dist/lib/components/WorkspaceContentSettings/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts +22 -0
- package/dist/lib/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceDangerSettings/index.d.ts +18 -0
- package/dist/lib/components/WorkspaceDangerSettings/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceGeneralSettings/index.d.ts +18 -0
- package/dist/lib/components/WorkspaceGeneralSettings/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts +18 -0
- package/dist/lib/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceMembersSettings/MemberListRow/index.d.ts +17 -0
- package/dist/lib/components/WorkspaceMembersSettings/MemberListRow/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceMembersSettings/index.d.ts +16 -0
- package/dist/lib/components/WorkspaceMembersSettings/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceNav/WorkspaceNavButton/index.d.ts +14 -0
- package/dist/lib/components/WorkspaceNav/WorkspaceNavButton/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts +16 -0
- package/dist/lib/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceNav/index.d.ts +14 -0
- package/dist/lib/components/WorkspaceNav/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceSettingsRail/index.d.ts +14 -0
- package/dist/lib/components/WorkspaceSettingsRail/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceSettingsTabs/index.d.ts +14 -0
- package/dist/lib/components/WorkspaceSettingsTabs/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceSettingsTopBar/index.d.ts +8 -0
- package/dist/lib/components/WorkspaceSettingsTopBar/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/NewWorkspaceButton/index.d.ts +7 -0
- package/dist/lib/components/WorkspaceShell/NewWorkspaceButton/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/RailTooltip/index.d.ts +22 -0
- package/dist/lib/components/WorkspaceShell/RailTooltip/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceRail/index.d.ts +17 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceRail/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSidebarButton/index.d.ts +17 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSidebarButton/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/WorkspaceSwitcherPopover/index.d.ts +26 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/WorkspaceSwitcherPopover/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/index.d.ts +17 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/index.d.ts +16 -0
- package/dist/lib/components/WorkspaceShell/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceStats/index.d.ts +9 -0
- package/dist/lib/components/WorkspaceStats/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceToolbar/index.d.ts +22 -0
- package/dist/lib/components/WorkspaceToolbar/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesEmpty/index.d.ts +18 -0
- package/dist/lib/components/WorkspacesEmpty/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesHomePanel/index.d.ts +7 -0
- package/dist/lib/components/WorkspacesHomePanel/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesNavSection/index.d.ts +9 -0
- package/dist/lib/components/WorkspacesNavSection/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesSkeleton/index.d.ts +36 -0
- package/dist/lib/components/WorkspacesSkeleton/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesTable/index.d.ts +12 -0
- package/dist/lib/components/WorkspacesTable/index.d.ts.map +1 -0
- package/dist/lib/domain/isActiveWorkspace/index.d.ts +9 -0
- package/dist/lib/domain/isActiveWorkspace/index.d.ts.map +1 -0
- package/dist/lib/domain/isActiveWorkspace/index.js +9 -0
- package/dist/lib/domain/permissions/index.d.ts +7 -0
- package/dist/lib/domain/permissions/index.d.ts.map +1 -0
- package/dist/lib/domain/permissions/index.js +6 -0
- package/dist/lib/domain/resourceSelection/index.d.ts +18 -0
- package/dist/lib/domain/resourceSelection/index.d.ts.map +1 -0
- package/dist/lib/domain/resourceSelection/index.js +49 -0
- package/dist/lib/domain/slug/index.d.ts +25 -0
- package/dist/lib/domain/slug/index.d.ts.map +1 -0
- package/dist/lib/domain/slug/index.js +45 -0
- package/dist/lib/domain/types/wizard/index.d.ts +126 -0
- package/dist/lib/domain/types/wizard/index.d.ts.map +1 -0
- package/dist/lib/domain/types/wizard/index.js +21 -0
- package/dist/lib/domain/types/workspace/index.d.ts +42 -0
- package/dist/lib/domain/types/workspace/index.d.ts.map +1 -0
- package/dist/lib/domain/types/workspace/index.js +1 -0
- package/dist/lib/domain/workspaceLimits/index.d.ts +23 -0
- package/dist/lib/domain/workspaceLimits/index.d.ts.map +1 -0
- package/dist/lib/domain/workspaceLimits/index.js +22 -0
- package/dist/lib/hooks/useBasicsSchema/index.d.ts +14 -0
- package/dist/lib/hooks/useBasicsSchema/index.d.ts.map +1 -0
- package/dist/lib/hooks/useResourceSelection/index.d.ts +21 -0
- package/dist/lib/hooks/useResourceSelection/index.d.ts.map +1 -0
- package/dist/lib/hooks/useSlug/index.d.ts +28 -0
- package/dist/lib/hooks/useSlug/index.d.ts.map +1 -0
- package/dist/lib/hooks/useWizard/index.d.ts +57 -0
- package/dist/lib/hooks/useWizard/index.d.ts.map +1 -0
- package/dist/lib/hooks/useWorkspaceProfileSchema/index.d.ts +13 -0
- package/dist/lib/hooks/useWorkspaceProfileSchema/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/buildCreateWorkspaceBody/index.d.ts +12 -0
- package/dist/lib/infrastructure/buildCreateWorkspaceBody/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/buildCreateWorkspaceBody/index.js +27 -0
- package/dist/lib/infrastructure/httpWorkspaceGateway/index.d.ts +10 -0
- package/dist/lib/infrastructure/httpWorkspaceGateway/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/httpWorkspaceGateway/index.js +149 -0
- package/dist/lib/infrastructure/isConflict/index.d.ts +8 -0
- package/dist/lib/infrastructure/isConflict/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/isConflict/index.js +12 -0
- package/dist/lib/infrastructure/workspaceGateway/index.d.ts +90 -0
- package/dist/lib/infrastructure/workspaceGateway/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/workspaceGateway/index.js +1 -0
- package/dist/lib/infrastructure/workspaceMapper/index.d.ts +28 -0
- package/dist/lib/infrastructure/workspaceMapper/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/workspaceMapper/index.js +36 -0
- package/dist/lib/pages/CreateWorkspacePage/index.d.ts +7 -0
- package/dist/lib/pages/CreateWorkspacePage/index.d.ts.map +1 -0
- package/dist/lib/pages/WorkspaceSettingsPage/index.d.ts +12 -0
- package/dist/lib/pages/WorkspaceSettingsPage/index.d.ts.map +1 -0
- package/dist/lib/pages/WorkspacesPage/index.d.ts +7 -0
- package/dist/lib/pages/WorkspacesPage/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/BlockingConfirmDialog/index.d.ts +41 -0
- package/dist/lib/presentation/components/BlockingConfirmDialog/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/BlockingConfirmDialog/index.js +17 -0
- package/dist/lib/presentation/components/ColorSwatchRow/index.d.ts +22 -0
- package/dist/lib/presentation/components/ColorSwatchRow/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/ColorSwatchRow/index.js +70 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts +11 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.js +47 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts +48 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.js +32 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/index.d.ts +23 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/index.js +128 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/IdentityFields/index.d.ts +17 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/IdentityFields/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/IdentityFields/index.js +70 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts +14 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.js +25 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts +15 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.js +112 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/index.d.ts +17 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/index.js +35 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/Monogram/index.d.ts +17 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/Monogram/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/Monogram/index.js +11 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/SlugField/index.d.ts +23 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/SlugField/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/SlugField/index.js +68 -0
- package/dist/lib/presentation/components/StatusChip/index.d.ts +9 -0
- package/dist/lib/presentation/components/StatusChip/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/StatusChip/index.js +23 -0
- package/dist/lib/presentation/components/WorkspaceAvatar/index.d.ts +20 -0
- package/dist/lib/presentation/components/WorkspaceAvatar/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceAvatar/index.js +10 -0
- package/dist/lib/presentation/components/WorkspaceCommands/index.d.ts +8 -0
- package/dist/lib/presentation/components/WorkspaceCommands/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceCommands/index.js +34 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/AddContentDialog/index.d.ts +26 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/AddContentDialog/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/AddContentDialog/index.js +89 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts +21 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentGroup/index.js +11 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts +26 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentRow/index.js +31 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts +25 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/RemoveContentDialog/index.js +48 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/index.d.ts +25 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/index.js +173 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts +22 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.js +52 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/index.d.ts +18 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/index.js +150 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/WorkspaceIdField/index.d.ts +19 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/WorkspaceIdField/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/WorkspaceIdField/index.js +72 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/index.d.ts +18 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/index.js +131 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts +18 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberDirectorySearch/index.js +65 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.d.ts +17 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.js +22 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/index.d.ts +16 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/index.js +127 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.d.ts +14 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.js +30 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts +16 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.js +81 -0
- package/dist/lib/presentation/components/WorkspaceNav/index.d.ts +14 -0
- package/dist/lib/presentation/components/WorkspaceNav/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceNav/index.js +51 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTabs/index.d.ts +14 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTabs/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTabs/index.js +66 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTopBar/index.d.ts +8 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTopBar/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTopBar/index.js +57 -0
- package/dist/lib/presentation/components/WorkspaceShell/index.d.ts +16 -0
- package/dist/lib/presentation/components/WorkspaceShell/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceShell/index.js +100 -0
- package/dist/lib/presentation/components/WorkspaceStats/index.d.ts +9 -0
- package/dist/lib/presentation/components/WorkspaceStats/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceStats/index.js +48 -0
- package/dist/lib/presentation/components/WorkspaceToolbar/index.d.ts +22 -0
- package/dist/lib/presentation/components/WorkspaceToolbar/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceToolbar/index.js +73 -0
- package/dist/lib/presentation/components/WorkspacesEmpty/index.d.ts +18 -0
- package/dist/lib/presentation/components/WorkspacesEmpty/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesEmpty/index.js +42 -0
- package/dist/lib/presentation/components/WorkspacesHomePanel/index.d.ts +7 -0
- package/dist/lib/presentation/components/WorkspacesHomePanel/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesHomePanel/index.js +50 -0
- package/dist/lib/presentation/components/WorkspacesNavSection/index.d.ts +15 -0
- package/dist/lib/presentation/components/WorkspacesNavSection/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesNavSection/index.js +76 -0
- package/dist/lib/presentation/components/WorkspacesSkeleton/index.d.ts +49 -0
- package/dist/lib/presentation/components/WorkspacesSkeleton/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesSkeleton/index.js +94 -0
- package/dist/lib/presentation/components/WorkspacesTable/index.d.ts +12 -0
- package/dist/lib/presentation/components/WorkspacesTable/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesTable/index.js +58 -0
- package/dist/lib/presentation/currentWorkspace/index.d.ts +17 -0
- package/dist/lib/presentation/currentWorkspace/index.d.ts.map +1 -0
- package/dist/lib/presentation/currentWorkspace/index.js +44 -0
- package/dist/lib/presentation/hooks/useBasicsSchema/index.d.ts +17 -0
- package/dist/lib/presentation/hooks/useBasicsSchema/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useBasicsSchema/index.js +71 -0
- package/dist/lib/presentation/hooks/useComboboxList/index.d.ts +44 -0
- package/dist/lib/presentation/hooks/useComboboxList/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useComboboxList/index.js +62 -0
- package/dist/lib/presentation/hooks/useRedirectNotice/index.d.ts +24 -0
- package/dist/lib/presentation/hooks/useRedirectNotice/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useRedirectNotice/index.js +37 -0
- package/dist/lib/presentation/hooks/useResourceSelection/index.d.ts +21 -0
- package/dist/lib/presentation/hooks/useResourceSelection/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useResourceSelection/index.js +16 -0
- package/dist/lib/presentation/hooks/useSlug/index.d.ts +28 -0
- package/dist/lib/presentation/hooks/useSlug/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useSlug/index.js +18 -0
- package/dist/lib/presentation/hooks/useWizard/index.d.ts +60 -0
- package/dist/lib/presentation/hooks/useWizard/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useWizard/index.js +93 -0
- package/dist/lib/presentation/hooks/useWorkspaceProfileSchema/index.d.ts +16 -0
- package/dist/lib/presentation/hooks/useWorkspaceProfileSchema/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useWorkspaceProfileSchema/index.js +53 -0
- package/dist/lib/presentation/pages/CreateWorkspacePage/index.d.ts +7 -0
- package/dist/lib/presentation/pages/CreateWorkspacePage/index.d.ts.map +1 -0
- package/dist/lib/presentation/pages/CreateWorkspacePage/index.js +248 -0
- package/dist/lib/presentation/pages/WorkspaceSettingsPage/index.d.ts +12 -0
- package/dist/lib/presentation/pages/WorkspaceSettingsPage/index.d.ts.map +1 -0
- package/dist/lib/presentation/pages/WorkspaceSettingsPage/index.js +69 -0
- package/dist/lib/presentation/pages/WorkspacesPage/index.d.ts +7 -0
- package/dist/lib/presentation/pages/WorkspacesPage/index.d.ts.map +1 -0
- package/dist/lib/presentation/pages/WorkspacesPage/index.js +112 -0
- package/dist/lib/presentation/slots/workspaceSlots/index.d.ts +101 -0
- package/dist/lib/presentation/slots/workspaceSlots/index.d.ts.map +1 -0
- package/dist/lib/presentation/slots/workspaceSlots/index.js +25 -0
- package/dist/lib/presentation/workspacesPlugin/index.d.ts +31 -0
- package/dist/lib/presentation/workspacesPlugin/index.d.ts.map +1 -0
- package/dist/lib/presentation/workspacesPlugin/index.js +151 -0
- package/dist/lib/slots/workspaceSlots/index.d.ts +101 -0
- package/dist/lib/slots/workspaceSlots/index.d.ts.map +1 -0
- package/dist/lib/types/wizard/index.d.ts +119 -0
- package/dist/lib/types/wizard/index.d.ts.map +1 -0
- package/dist/lib/types/workspace/index.d.ts +42 -0
- package/dist/lib/types/workspace/index.d.ts.map +1 -0
- package/dist/lib/utils/buildCreateWorkspaceBody/index.d.ts +12 -0
- package/dist/lib/utils/buildCreateWorkspaceBody/index.d.ts.map +1 -0
- package/dist/lib/utils/currentWorkspace/index.d.ts +17 -0
- package/dist/lib/utils/currentWorkspace/index.d.ts.map +1 -0
- package/dist/lib/utils/isActiveWorkspace/index.d.ts +9 -0
- package/dist/lib/utils/isActiveWorkspace/index.d.ts.map +1 -0
- package/dist/lib/utils/isConflict/index.d.ts +8 -0
- package/dist/lib/utils/isConflict/index.d.ts.map +1 -0
- package/dist/lib/utils/permissions/index.d.ts +7 -0
- package/dist/lib/utils/permissions/index.d.ts.map +1 -0
- package/dist/lib/utils/radioGroupKeydown/index.d.ts +15 -0
- package/dist/lib/utils/radioGroupKeydown/index.d.ts.map +1 -0
- package/dist/lib/utils/resourceSelection/index.d.ts +18 -0
- package/dist/lib/utils/resourceSelection/index.d.ts.map +1 -0
- package/dist/lib/utils/workspacesPlugin/index.d.ts +31 -0
- package/dist/lib/utils/workspacesPlugin/index.d.ts.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/types/wizard/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,iDAAiD;AACjD,oBAAY,UAAU;IAClB,2BAA2B;IAC3B,KAAK,UAAU;IACf,yCAAyC;IACzC,OAAO,YAAY;IACnB,0DAA0D;IAC1D,QAAQ,aAAa;IACrB,mBAAmB;IACnB,SAAS,cAAc;IACvB,0CAA0C;IAC1C,KAAK,UAAU;IACf;;;;;OAKG;IACH,OAAO,YAAY;CACtB;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,aAAa,GAAG;IACxB,iBAAiB;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,KAAK,EAAE,MAA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,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,OAAO,CAAC;KACpB,EAAE,CAAC;IACJ,OAAO,EACD;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,GACf;QACI,IAAI,EAAE,UAAU,CAAC;QACjB,WAAW,EAAE,iBAAiB,CAAC;QAC/B,KAAK,EAAE,iBAAiB,CAAC;KAC5B,CAAC;CACX,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Live state of the slug availability check. */
|
|
2
|
+
export var SlugStatus;
|
|
3
|
+
(function (SlugStatus) {
|
|
4
|
+
/** No slug entered yet. */
|
|
5
|
+
SlugStatus["Empty"] = "empty";
|
|
6
|
+
/** Breaks the `^[a-z0-9-]+$` pattern. */
|
|
7
|
+
SlugStatus["Invalid"] = "invalid";
|
|
8
|
+
/** Debouncing or an availability request is in flight. */
|
|
9
|
+
SlugStatus["Checking"] = "checking";
|
|
10
|
+
/** Free to use. */
|
|
11
|
+
SlugStatus["Available"] = "available";
|
|
12
|
+
/** Already taken by another workspace. */
|
|
13
|
+
SlugStatus["Taken"] = "taken";
|
|
14
|
+
/**
|
|
15
|
+
* The availability request failed, so uniqueness is *unknown*. Treated as
|
|
16
|
+
* not-continuable: a failed pre-check must never read as the positive
|
|
17
|
+
* answer, matching the delete/revoke dialogs, which block when their
|
|
18
|
+
* entry-count pre-check fails rather than allowing the action.
|
|
19
|
+
*/
|
|
20
|
+
SlugStatus["Unknown"] = "unknown";
|
|
21
|
+
})(SlugStatus || (SlugStatus = {}));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AvatarColor } from '@orthacms/design-system';
|
|
2
|
+
/** Lifecycle status of a workspace. */
|
|
3
|
+
export type WorkspaceStatus = 'Active' | 'Archived';
|
|
4
|
+
/** A person who belongs to a workspace. */
|
|
5
|
+
export type WorkspaceMember = {
|
|
6
|
+
/** Stable member id. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Display name. */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Two-letter initials shown in the avatar. */
|
|
11
|
+
initials: string;
|
|
12
|
+
/** Contact email. */
|
|
13
|
+
email: string;
|
|
14
|
+
/** Accent color tinting the member's avatar. */
|
|
15
|
+
color: AvatarColor;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A workspace: a self-contained grouping of content, members, and plugins.
|
|
19
|
+
* The member count is never stored — read it from `members.length`.
|
|
20
|
+
*/
|
|
21
|
+
export type Workspace = {
|
|
22
|
+
/** Stable workspace id. */
|
|
23
|
+
id: string;
|
|
24
|
+
/** URL-safe identifier, unique across the system. */
|
|
25
|
+
slug: string;
|
|
26
|
+
/** Display name. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Short summary of what the workspace holds. */
|
|
29
|
+
description: string;
|
|
30
|
+
/** Accent color tinting the workspace avatar. */
|
|
31
|
+
color: AvatarColor;
|
|
32
|
+
/** Lifecycle status. */
|
|
33
|
+
status: WorkspaceStatus;
|
|
34
|
+
/** Everyone who belongs to the workspace. */
|
|
35
|
+
members: WorkspaceMember[];
|
|
36
|
+
/**
|
|
37
|
+
* Slugs of the content types granted to this workspace at creation. Feature
|
|
38
|
+
* plugins (e.g. the Content Library) scope what they show to these.
|
|
39
|
+
*/
|
|
40
|
+
content: string[];
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/types/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,uCAAuC;AACvC,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEpD,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GAAG;IAC1B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,KAAK,EAAE,WAAW,CAAC;IACnB,wBAAwB;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,6CAA6C;IAC7C,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B;;;OAGG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field length limits for a workspace's profile, mirroring the server DTOs —
|
|
3
|
+
* `CreateWorkspaceDto` / `UpdateWorkspaceDto` (`@MaxLength(120)` on `name`,
|
|
4
|
+
* `@MaxLength(2000)` on `description`).
|
|
5
|
+
*
|
|
6
|
+
* They live in `domain/` as one shared constant because they were previously
|
|
7
|
+
* duplicated across four sites (two Zod schema hooks and two components' local
|
|
8
|
+
* `NAME_MAX`/`DESCRIPTION_MAX`), all four of which had drifted to 100/500 while
|
|
9
|
+
* claiming in their docstrings to mirror the server. A client stricter than the
|
|
10
|
+
* server is not merely conservative here: a workspace whose name is 101–120
|
|
11
|
+
* characters — legal, and creatable through the public API, MCP, the copilot or
|
|
12
|
+
* a seed — made the settings form permanently invalid, disabling Save for the
|
|
13
|
+
* description and accent colour too, with `maxLength` preventing the user from
|
|
14
|
+
* even retyping the original value.
|
|
15
|
+
*
|
|
16
|
+
* Slug length is *not* here: it belongs to the {@link Slug} value object, which
|
|
17
|
+
* already mirrors the server's 120 correctly.
|
|
18
|
+
*/
|
|
19
|
+
/** Longest workspace name the server accepts. */
|
|
20
|
+
export declare const NAME_MAX = 120;
|
|
21
|
+
/** Longest workspace description the server accepts. */
|
|
22
|
+
export declare const DESCRIPTION_MAX = 2000;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/workspaceLimits/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iDAAiD;AACjD,eAAO,MAAM,QAAQ,MAAM,CAAC;AAE5B,wDAAwD;AACxD,eAAO,MAAM,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field length limits for a workspace's profile, mirroring the server DTOs —
|
|
3
|
+
* `CreateWorkspaceDto` / `UpdateWorkspaceDto` (`@MaxLength(120)` on `name`,
|
|
4
|
+
* `@MaxLength(2000)` on `description`).
|
|
5
|
+
*
|
|
6
|
+
* They live in `domain/` as one shared constant because they were previously
|
|
7
|
+
* duplicated across four sites (two Zod schema hooks and two components' local
|
|
8
|
+
* `NAME_MAX`/`DESCRIPTION_MAX`), all four of which had drifted to 100/500 while
|
|
9
|
+
* claiming in their docstrings to mirror the server. A client stricter than the
|
|
10
|
+
* server is not merely conservative here: a workspace whose name is 101–120
|
|
11
|
+
* characters — legal, and creatable through the public API, MCP, the copilot or
|
|
12
|
+
* a seed — made the settings form permanently invalid, disabling Save for the
|
|
13
|
+
* description and accent colour too, with `maxLength` preventing the user from
|
|
14
|
+
* even retyping the original value.
|
|
15
|
+
*
|
|
16
|
+
* Slug length is *not* here: it belongs to the {@link Slug} value object, which
|
|
17
|
+
* already mirrors the server's 120 correctly.
|
|
18
|
+
*/
|
|
19
|
+
/** Longest workspace name the server accepts. */
|
|
20
|
+
export const NAME_MAX = 120;
|
|
21
|
+
/** Longest workspace description the server accepts. */
|
|
22
|
+
export const DESCRIPTION_MAX = 2000;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the basics-step Zod schema with localized messages. Mirrors the
|
|
4
|
+
* server `CreateWorkspaceDto` (name required, ≤100; slug required, matching
|
|
5
|
+
* `^[a-z0-9-]+$`; description ≤500). Rebuilt when the locale changes so the
|
|
6
|
+
* copy stays in sync with the UI. Slug *availability* is checked separately by
|
|
7
|
+
* `useSlugAvailability` — this only validates shape.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useBasicsSchema(): z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
slug: z.ZodString;
|
|
12
|
+
description: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/useBasicsSchema/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB;;;;;;GAMG;AACH,wBAAgB,eAAe;;;;kBA0B9B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ResourceSelection } from '../../types/wizard';
|
|
2
|
+
/** Bound helpers returned by {@link useResourceSelection}. */
|
|
3
|
+
export type ResourceSelectionController = {
|
|
4
|
+
/** Whether `id` is selected in the current mode. */
|
|
5
|
+
isSelected: (id: string) => boolean;
|
|
6
|
+
/** Toggle one id (include list in `specific`, exclude list in `all`). */
|
|
7
|
+
toggle: (id: string) => void;
|
|
8
|
+
/** Switch the whole resource to "all" or back to an empty "specific" list. */
|
|
9
|
+
setAll: (all: boolean) => void;
|
|
10
|
+
/** Whether the resource is in "all" mode. */
|
|
11
|
+
isAll: boolean;
|
|
12
|
+
/** Count of selected items given the total available. */
|
|
13
|
+
count: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Controlled wrapper over the pure `resourceSelection` helpers. State lives in
|
|
17
|
+
* the caller (the wizard); this binds the selection + `onChange` into ready
|
|
18
|
+
* handlers for a selection panel, and derives the selected `count` from `total`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useResourceSelection(selection: ResourceSelection, onChange: (next: ResourceSelection) => void, total: number): ResourceSelectionController;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/useResourceSelection/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAQ5D,8DAA8D;AAC9D,MAAM,MAAM,2BAA2B,GAAG;IACtC,oDAAoD;IACpD,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACpC,yEAAyE;IACzE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,8EAA8E;IAC9E,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/B,6CAA6C;IAC7C,KAAK,EAAE,OAAO,CAAC;IACf,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAChC,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,EAC3C,KAAK,EAAE,MAAM,GACd,2BAA2B,CAW7B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SlugStatus, WizardData } from '../../types/wizard';
|
|
2
|
+
/** Arguments for {@link useSlug}. */
|
|
3
|
+
export type UseSlugArgs = {
|
|
4
|
+
/** Current basics data (reads `name`, `slug`, `slugEdited`). */
|
|
5
|
+
data: WizardData;
|
|
6
|
+
/** Merge a partial patch into the basics data. */
|
|
7
|
+
update: (patch: Partial<WizardData>) => void;
|
|
8
|
+
};
|
|
9
|
+
/** What {@link useSlug} returns. */
|
|
10
|
+
export type UseSlugResult = {
|
|
11
|
+
/** Live availability status of the current slug. */
|
|
12
|
+
status: SlugStatus;
|
|
13
|
+
/** Name change handler: also auto-fills the slug until it's been edited. */
|
|
14
|
+
onNameChange: (name: string) => void;
|
|
15
|
+
/** Direct slug edit — marks the slug as user-owned. */
|
|
16
|
+
onSlugChange: (slug: string) => void;
|
|
17
|
+
/** Re-derive the slug from the name and resume auto-fill. */
|
|
18
|
+
regenerate: () => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Wires the name → slug relationship for the basics step. The slug auto-fills
|
|
22
|
+
* from the name (via {@link slugify}) until the user edits it; from then on it
|
|
23
|
+
* is left alone and a regenerate action restores auto-fill. Availability is
|
|
24
|
+
* tracked by {@link useSlugAvailability}. State lives in the wizard — this only
|
|
25
|
+
* supplies handlers and the live status.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useSlug({ data, update }: UseSlugArgs): UseSlugResult;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/useSlug/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEjE,qCAAqC;AACrC,MAAM,MAAM,WAAW,GAAG;IACtB,gEAAgE;IAChE,IAAI,EAAE,UAAU,CAAC;IACjB,kDAAkD;IAClD,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG;IACxB,oDAAoD;IACpD,MAAM,EAAE,UAAU,CAAC;IACnB,4EAA4E;IAC5E,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,uDAAuD;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,6DAA6D;IAC7D,UAAU,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,GAAG,aAAa,CAWpE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Workspace } from '../../types/workspace';
|
|
2
|
+
import type { ContentMode, MemberDraft, ResourceSelection, WizardData, WizardSnapshot } from '../../types/wizard';
|
|
3
|
+
/** The full controller returned by {@link useWizard}. */
|
|
4
|
+
export type WizardController = {
|
|
5
|
+
/** Active step (1–3), mirrored to `?step=` and clamped. */
|
|
6
|
+
step: number;
|
|
7
|
+
/** Highest step the user has reached (gates rail navigation). */
|
|
8
|
+
maxReached: number;
|
|
9
|
+
/** Step 1 basics. */
|
|
10
|
+
data: WizardData;
|
|
11
|
+
/** Added members (excludes the implied owner). */
|
|
12
|
+
members: MemberDraft[];
|
|
13
|
+
/** Page-level content decision. */
|
|
14
|
+
contentMode: ContentMode;
|
|
15
|
+
/** Collection selection. */
|
|
16
|
+
collections: ResourceSelection;
|
|
17
|
+
/** Page selection. */
|
|
18
|
+
pages: ResourceSelection;
|
|
19
|
+
/** Whether the content-types list is still loading. */
|
|
20
|
+
ctLoading: boolean;
|
|
21
|
+
/** Whether the content-types list failed to load. */
|
|
22
|
+
ctError: boolean;
|
|
23
|
+
/** Navigate to a step (clamped); bumps {@link maxReached}. */
|
|
24
|
+
goStep: (next: number) => void;
|
|
25
|
+
/** Merge a partial patch into the basics data. */
|
|
26
|
+
update: (patch: Partial<WizardData>) => void;
|
|
27
|
+
/** Add a member if not already present. */
|
|
28
|
+
addMember: (member: MemberDraft) => void;
|
|
29
|
+
/** Remove a member by id. */
|
|
30
|
+
removeMember: (id: string) => void;
|
|
31
|
+
/** Set the page-level content mode. */
|
|
32
|
+
setContentMode: (mode: ContentMode) => void;
|
|
33
|
+
/** Replace the collection selection. */
|
|
34
|
+
setCollections: (selection: ResourceSelection) => void;
|
|
35
|
+
/** Replace the page selection. */
|
|
36
|
+
setPages: (selection: ResourceSelection) => void;
|
|
37
|
+
/** Whether the basics step passes shape validation (not availability). */
|
|
38
|
+
basicsValid: boolean;
|
|
39
|
+
/** Total members including the owner. */
|
|
40
|
+
memberCount: number;
|
|
41
|
+
/** Number of selected collections. */
|
|
42
|
+
collectionCount: number;
|
|
43
|
+
/** Number of selected pages. */
|
|
44
|
+
pageCount: number;
|
|
45
|
+
/** Submit the wizard. `override` replaces snapshot fields without mutating state. */
|
|
46
|
+
submit: (override?: Partial<WizardSnapshot>) => Promise<Workspace>;
|
|
47
|
+
/** Whether a submission is in flight. */
|
|
48
|
+
submitting: boolean;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Single source of truth for the create-workspace wizard: step (mirrored to the
|
|
52
|
+
* `?step=` query param and clamped), the per-step form state, derived validity
|
|
53
|
+
* and counts, and the submit action. Step bodies are presentational and read
|
|
54
|
+
* everything from here, so state survives navigating between steps.
|
|
55
|
+
*/
|
|
56
|
+
export declare function useWizard(): WizardController;
|
|
57
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/useWizard/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,S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AAM,CAAC;IACpB,sCAAsC;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACnE,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,gBAAgB,CA4G5C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the settings General-tab Zod schema with localized messages. Mirrors
|
|
4
|
+
* the server `UpdateWorkspaceDto` (name required, ≤100; description ≤500). The
|
|
5
|
+
* slug is intentionally absent — it's the workspace's immutable URL identifier
|
|
6
|
+
* and isn't editable from settings. Rebuilt when the locale changes so the copy
|
|
7
|
+
* stays in sync with the UI.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useWorkspaceProfileSchema(): z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/useWorkspaceProfileSchema/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB;;;;;;GAMG;AACH,wBAAgB,yBAAyB;;;kBAqBxC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CreateWorkspaceBody, WizardSnapshot } from '../../domain/types/wizard';
|
|
2
|
+
/**
|
|
3
|
+
* Maps a {@link WizardSnapshot} to the `/api/workspaces` request body. Content
|
|
4
|
+
* collapses to `{ mode: 'all' }` when the page-level decision is "All content";
|
|
5
|
+
* otherwise the two resource selections ride along under `mode: 'specific'`.
|
|
6
|
+
*
|
|
7
|
+
* The "Skip & create" path passes a snapshot with empty content rather than
|
|
8
|
+
* mutating wizard state, so a failed submit leaves the user's picks intact for
|
|
9
|
+
* retry.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildCreateWorkspaceBody(snapshot: WizardSnapshot): CreateWorkspaceBody;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/buildCreateWorkspaceBody/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,mBAAmB,EACnB,cAAc,EACjB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,cAAc,GACzB,mBAAmB,CAmBrB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a {@link WizardSnapshot} to the `/api/workspaces` request body. Content
|
|
3
|
+
* collapses to `{ mode: 'all' }` when the page-level decision is "All content";
|
|
4
|
+
* otherwise the two resource selections ride along under `mode: 'specific'`.
|
|
5
|
+
*
|
|
6
|
+
* The "Skip & create" path passes a snapshot with empty content rather than
|
|
7
|
+
* mutating wizard state, so a failed submit leaves the user's picks intact for
|
|
8
|
+
* retry.
|
|
9
|
+
*/
|
|
10
|
+
export function buildCreateWorkspaceBody(snapshot) {
|
|
11
|
+
const { data, members, contentMode, collections, pages } = snapshot;
|
|
12
|
+
return {
|
|
13
|
+
name: data.name.trim(),
|
|
14
|
+
slug: data.slug.trim(),
|
|
15
|
+
description: data.description.trim(),
|
|
16
|
+
color: data.color,
|
|
17
|
+
members: members.map((m) => ({
|
|
18
|
+
id: m.id,
|
|
19
|
+
name: m.name,
|
|
20
|
+
email: m.email,
|
|
21
|
+
invited: m.invited ?? false
|
|
22
|
+
})),
|
|
23
|
+
content: contentMode === 'all'
|
|
24
|
+
? { mode: 'all' }
|
|
25
|
+
: { mode: 'specific', collections, pages }
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkspaceGateway } from '../workspaceGateway';
|
|
2
|
+
/**
|
|
3
|
+
* HTTP implementation of {@link WorkspaceGateway} over the shared `apiClient`
|
|
4
|
+
* (axios, same-origin, cookie-authed; paths omit the `/api` dev-proxy prefix).
|
|
5
|
+
* Every workspace response is run through the `toWorkspace` anti-corruption
|
|
6
|
+
* mapper, and every failure is normalized with `toApiError`, so callers see the
|
|
7
|
+
* admin's models and `ApiError`, never axios internals.
|
|
8
|
+
*/
|
|
9
|
+
export declare const httpWorkspaceGateway: WorkspaceGateway;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/httpWorkspaceGateway/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAOR,gBAAgB,EACnB,MAAM,qBAAqB,CAAC;AA2B7B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,gBAqLlC,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { apiClient, toApiError } from '@orthacms/utils-admin';
|
|
2
|
+
import { toWorkspace } from '../workspaceMapper';
|
|
3
|
+
/** How many matches the typeahead asks for per query. */
|
|
4
|
+
const TYPEAHEAD_PAGE_SIZE = 10;
|
|
5
|
+
/**
|
|
6
|
+
* HTTP implementation of {@link WorkspaceGateway} over the shared `apiClient`
|
|
7
|
+
* (axios, same-origin, cookie-authed; paths omit the `/api` dev-proxy prefix).
|
|
8
|
+
* Every workspace response is run through the `toWorkspace` anti-corruption
|
|
9
|
+
* mapper, and every failure is normalized with `toApiError`, so callers see the
|
|
10
|
+
* admin's models and `ApiError`, never axios internals.
|
|
11
|
+
*/
|
|
12
|
+
export const httpWorkspaceGateway = {
|
|
13
|
+
async list() {
|
|
14
|
+
try {
|
|
15
|
+
const { data } = await apiClient.get('/workspaces');
|
|
16
|
+
return data.map(toWorkspace);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
throw toApiError(error);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
async create(body) {
|
|
23
|
+
try {
|
|
24
|
+
const { data } = await apiClient.post('/workspaces', body);
|
|
25
|
+
return toWorkspace(data);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
throw toApiError(error);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
async update({ id, ...patch }) {
|
|
32
|
+
try {
|
|
33
|
+
const { data } = await apiClient.patch(`/workspaces/${id}`, patch);
|
|
34
|
+
return toWorkspace(data);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw toApiError(error);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
async setStatus({ id, status }) {
|
|
41
|
+
const action = status === 'Archived' ? 'archive' : 'unarchive';
|
|
42
|
+
try {
|
|
43
|
+
const { data } = await apiClient.post(`/workspaces/${id}/${action}`);
|
|
44
|
+
return toWorkspace(data);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
throw toApiError(error);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
async remove(id) {
|
|
51
|
+
try {
|
|
52
|
+
await apiClient.delete(`/workspaces/${id}`);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
throw toApiError(error);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
async addMember({ workspaceId, userId }) {
|
|
59
|
+
try {
|
|
60
|
+
const { data } = await apiClient.post(`/workspaces/${workspaceId}/members`, { userId });
|
|
61
|
+
return toWorkspace(data);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
throw toApiError(error);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
async removeMember({ workspaceId, userId }) {
|
|
68
|
+
try {
|
|
69
|
+
await apiClient.delete(`/workspaces/${workspaceId}/members/${userId}`);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
throw toApiError(error);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
async addContent({ workspaceId, slug }) {
|
|
76
|
+
try {
|
|
77
|
+
const { data } = await apiClient.post(`/workspaces/${workspaceId}/content`, { slug });
|
|
78
|
+
return toWorkspace(data);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
throw toApiError(error);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
async removeContent({ workspaceId, slug }) {
|
|
85
|
+
try {
|
|
86
|
+
const { data } = await apiClient.delete(`/workspaces/${workspaceId}/content/${slug}`);
|
|
87
|
+
return toWorkspace(data);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
throw toApiError(error);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
async checkSlugAvailable(slug) {
|
|
94
|
+
try {
|
|
95
|
+
const { data } = await apiClient.get('/workspaces/slug-available', { params: { slug } });
|
|
96
|
+
return data.available;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
throw toApiError(error);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
async contentEntryCount(workspaceId, slug) {
|
|
103
|
+
try {
|
|
104
|
+
const { data } = await apiClient.get(`/workspaces/${workspaceId}/content/${slug}/entry-count`);
|
|
105
|
+
return data.count;
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
throw toApiError(error);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
async entryCount(workspaceId) {
|
|
112
|
+
try {
|
|
113
|
+
const { data } = await apiClient.get(`/workspaces/${workspaceId}/entry-count`);
|
|
114
|
+
return data.count;
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
throw toApiError(error);
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
async searchUsers(query) {
|
|
121
|
+
try {
|
|
122
|
+
const { data } = await apiClient.get('/users', {
|
|
123
|
+
params: {
|
|
124
|
+
search: query,
|
|
125
|
+
pageSize: TYPEAHEAD_PAGE_SIZE
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
return data.items
|
|
129
|
+
.filter((member) => member.status !== 'disabled')
|
|
130
|
+
.map((member) => ({
|
|
131
|
+
id: member.id,
|
|
132
|
+
name: member.name ?? member.email,
|
|
133
|
+
email: member.email
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
throw toApiError(error);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
async listContentTypes() {
|
|
141
|
+
try {
|
|
142
|
+
const { data } = await apiClient.get('/content-types');
|
|
143
|
+
return data;
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
throw toApiError(error);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether an error is the server's `409 Conflict` — the shared signal that a
|
|
3
|
+
* block-before-you-act guard (delete a non-empty workspace, revoke a non-empty
|
|
4
|
+
* content type) rejected the mutation. Centralized so the status literal and the
|
|
5
|
+
* `ApiError` narrowing live in one place across the settings dialogs.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isConflict(error: unknown): boolean;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/isConflict/index.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAElD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ApiError } from '@orthacms/utils-admin';
|
|
2
|
+
/** HTTP 409 — the server's "still has content / entries" conflict response. */
|
|
3
|
+
const CONFLICT = 409;
|
|
4
|
+
/**
|
|
5
|
+
* Whether an error is the server's `409 Conflict` — the shared signal that a
|
|
6
|
+
* block-before-you-act guard (delete a non-empty workspace, revoke a non-empty
|
|
7
|
+
* content type) rejected the mutation. Centralized so the status literal and the
|
|
8
|
+
* `ApiError` narrowing live in one place across the settings dialogs.
|
|
9
|
+
*/
|
|
10
|
+
export function isConflict(error) {
|
|
11
|
+
return error instanceof ApiError && error.status === CONFLICT;
|
|
12
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { AvatarColor } from '@orthacms/design-system';
|
|
2
|
+
import type { Workspace, WorkspaceStatus } from '../../domain/types/workspace';
|
|
3
|
+
import type { ContentType, CreateWorkspaceBody, DirectoryUser } from '../../domain/types/wizard';
|
|
4
|
+
/**
|
|
5
|
+
* A partial profile edit: the target workspace id plus any of the editable
|
|
6
|
+
* fields. Only the fields present are sent; the server writes just those.
|
|
7
|
+
*/
|
|
8
|
+
export type UpdateWorkspaceInput = {
|
|
9
|
+
/** The workspace to edit. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** New display name. */
|
|
12
|
+
name?: string;
|
|
13
|
+
/** New description (an empty string clears it). */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** New accent color. */
|
|
16
|
+
color?: AvatarColor;
|
|
17
|
+
};
|
|
18
|
+
/** The target lifecycle status for a workspace. */
|
|
19
|
+
export type SetWorkspaceStatusInput = {
|
|
20
|
+
/** The workspace to archive/unarchive. */
|
|
21
|
+
id: string;
|
|
22
|
+
/** The desired status. */
|
|
23
|
+
status: WorkspaceStatus;
|
|
24
|
+
};
|
|
25
|
+
/** Links an existing directory user to a workspace. */
|
|
26
|
+
export type AddWorkspaceMemberInput = {
|
|
27
|
+
/** The workspace to add the member to. */
|
|
28
|
+
workspaceId: string;
|
|
29
|
+
/** The directory user id to link. */
|
|
30
|
+
userId: string;
|
|
31
|
+
};
|
|
32
|
+
/** Removes a member's link to a workspace. */
|
|
33
|
+
export type RemoveWorkspaceMemberInput = {
|
|
34
|
+
/** The workspace to remove the member from. */
|
|
35
|
+
workspaceId: string;
|
|
36
|
+
/** The member's user id. */
|
|
37
|
+
userId: string;
|
|
38
|
+
};
|
|
39
|
+
/** Grants a workspace access to one content type. */
|
|
40
|
+
export type AddWorkspaceContentInput = {
|
|
41
|
+
/** The workspace to grant. */
|
|
42
|
+
workspaceId: string;
|
|
43
|
+
/** The content-type slug to grant. */
|
|
44
|
+
slug: string;
|
|
45
|
+
};
|
|
46
|
+
/** Revokes a workspace's access to one content type. */
|
|
47
|
+
export type RemoveWorkspaceContentInput = {
|
|
48
|
+
/** The workspace to revoke from. */
|
|
49
|
+
workspaceId: string;
|
|
50
|
+
/** The content-type slug to revoke. */
|
|
51
|
+
slug: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* The port over the remote workspaces API — the single seam the admin plugin
|
|
55
|
+
* talks to instead of `apiClient` directly. Every method returns the admin's
|
|
56
|
+
* mapped models (via the `workspaceMapper` anti-corruption layer), never the
|
|
57
|
+
* wire shape, so the application hooks and presentation stay off the transport.
|
|
58
|
+
* {@link httpWorkspaceGateway} is the HTTP implementation.
|
|
59
|
+
*/
|
|
60
|
+
export type WorkspaceGateway = {
|
|
61
|
+
/** Lists every workspace the signed-in user can see. */
|
|
62
|
+
list(): Promise<Workspace[]>;
|
|
63
|
+
/** Creates a workspace via `POST /api/workspaces`. */
|
|
64
|
+
create(body: CreateWorkspaceBody): Promise<Workspace>;
|
|
65
|
+
/** Edits a workspace's profile via `PATCH /api/workspaces/:id`. */
|
|
66
|
+
update(input: UpdateWorkspaceInput): Promise<Workspace>;
|
|
67
|
+
/** Archives or unarchives a workspace. */
|
|
68
|
+
setStatus(input: SetWorkspaceStatusInput): Promise<Workspace>;
|
|
69
|
+
/** Permanently deletes a workspace via `DELETE /api/workspaces/:id`. */
|
|
70
|
+
remove(id: string): Promise<void>;
|
|
71
|
+
/** Adds an existing user to a workspace. */
|
|
72
|
+
addMember(input: AddWorkspaceMemberInput): Promise<Workspace>;
|
|
73
|
+
/** Removes a member from a workspace. */
|
|
74
|
+
removeMember(input: RemoveWorkspaceMemberInput): Promise<void>;
|
|
75
|
+
/** Grants a workspace access to a content type. */
|
|
76
|
+
addContent(input: AddWorkspaceContentInput): Promise<Workspace>;
|
|
77
|
+
/** Revokes a workspace's access to a content type (`409` if non-empty). */
|
|
78
|
+
removeContent(input: RemoveWorkspaceContentInput): Promise<Workspace>;
|
|
79
|
+
/** Whether `slug` is free, via `GET /api/workspaces/slug-available`. */
|
|
80
|
+
checkSlugAvailable(slug: string): Promise<boolean>;
|
|
81
|
+
/** Entries of content type `slug` a workspace holds. */
|
|
82
|
+
contentEntryCount(workspaceId: string, slug: string): Promise<number>;
|
|
83
|
+
/** Total content entries a workspace holds across all its types. */
|
|
84
|
+
entryCount(workspaceId: string): Promise<number>;
|
|
85
|
+
/** Searches the user directory for the member typeahead. */
|
|
86
|
+
searchUsers(query: string): Promise<DirectoryUser[]>;
|
|
87
|
+
/** Loads the content-type catalogue. */
|
|
88
|
+
listContentTypes(): Promise<ContentType[]>;
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/workspaceGateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EACR,WAAW,EACX,mBAAmB,EACnB,aAAa,EAChB,MAAM,2BAA2B,CAAC;AAEnC;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM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