feat(workspace): überarbeite geteilte Notizen und ganze Ordner teilen
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m1s

This commit is contained in:
sandrodach committed 2026-10-26 08:26:24 +01:00
1 parent 3fcd164fd8
commit 35fd682fcd
6 files changed
+1213 -93

No files matched your search

+61
View File
@@ -12,6 +12,8 @@ import {
Organization,
PriorityLevel,
SharedList,
SharedFolder,
FolderShare,
Space,
SpaceMember,
SpaceShare,
@@ -432,6 +434,53 @@ export const api = {
);
},
// --- WORKSPACE SHARED FOLDERS ---
async getSharedFolders(): Promise<SharedFolder[]> {
const res = await request<SharedFolder[]>('/api/v1/workspace/folders/shared');
return ensureArray(res);
},
async createSharedFolder(payload: { name: string; mountPath?: string }): Promise<SharedFolder> {
return request<SharedFolder>('/api/v1/workspace/folders/shared', {
method: 'POST',
body: JSON.stringify(payload),
});
},
async getSharedFolder(id: string): Promise<SharedFolder> {
return request<SharedFolder>(`/api/v1/workspace/folders/shared/${id}`);
},
async deleteSharedFolder(id: string): Promise<void> {
await request(`/api/v1/workspace/folders/shared/${id}`, { method: 'DELETE' });
},
async updateFolderMount(id: string, mountPath: string): Promise<void> {
await request(`/api/v1/workspace/folders/shared/${id}/mount`, {
method: 'PUT',
body: JSON.stringify({ mountPath }),
});
},
async getFolderShares(folderId: string): Promise<FolderShare[]> {
const res = await request<FolderShare[]>(`/api/v1/workspace/folders/shared/${folderId}/shares`);
return ensureArray(res);
},
async createFolderShare(
folderId: string,
payload: { targetType?: 'team' | 'user'; targetId?: string; userId?: string; email?: string; teamId?: string; permission: 'read' | 'write' }
): Promise<FolderShare> {
return request<FolderShare>(`/api/v1/workspace/folders/shared/${folderId}/shares`, {
method: 'POST',
body: JSON.stringify(payload),
});
},
async deleteFolderShare(folderId: string, shareId: string): Promise<void> {
await request(`/api/v1/workspace/folders/shared/${folderId}/shares/${shareId}`, { method: 'DELETE' });
},
// --- WORKSPACE TAGS ---
async getWorkspaceTags(): Promise<TagSummary[]> {
const res = await request<TagSummary[]>('/api/v1/workspace/tags');
@@ -531,6 +580,18 @@ export const api = {
await request(`/api/v1/documents/${id}`, { method: 'DELETE' });
},
async moveDocument(id: string, folderPath: string): Promise<Document> {
const d = await request<Document>(`/api/v1/documents/${id}/move`, {
method: 'PUT',
body: JSON.stringify({ folderPath }),
});
return {
...d,
blocks: ensureArray(d.blocks),
tags: ensureArray(d.tags),
};
},
// --- DOCUMENT SHARING ---
async getDocShares(docId: string): Promise<DocShare[]> {
const res = await request<DocShare[]>(`/api/v1/documents/${docId}/shares`);
+30
View File
@@ -207,6 +207,36 @@ export interface Document {
isOwner?: boolean;
ownerName?: string;
sharedWith?: DocShare[];
sharedFolderId?: string;
subFolderPath?: string;
isSharedFolder?: boolean;
folderPermission?: string;
}
export interface SharedFolder {
id: string;
ownerId: string;
ownerName?: string;
name: string;
mountPath: string;
isOwner: boolean;
permission: 'owner' | 'write' | 'read';
shares?: FolderShare[];
createdAt: string;
updatedAt: string;
}
export interface FolderShare {
id: string;
folderId: string;
targetType: 'user' | 'team';
targetId: string;
targetName?: string;
email?: string;
avatarUrl?: string;
permission: 'read' | 'write';
createdBy: string;
createdAt: string;
}
export interface TagSummary {