feat(web): add account workspaces and signed content flows

This commit is contained in:
justme committed 2026-10-14 04:06:03 +08:00
1 parent 7b8d61d1ba
commit b5cf3d5958
117 files changed
+2789 -1674

No files matched your search

+3 -6
View File
@@ -1,9 +1,9 @@
import type { ParsedChannelLink } from '@/lib/channelLink';
import type { AccountInvitation } from './account';
import type { ArchiveEntry, ChannelInfo, ChannelSettingsPatch, ConnectionState, CreateOptions, FileUploadOptions, WorkspaceEvent } from './types';
import type { ArchiveEntry, ChannelInfo, ChannelSettingsPatch, CreateOptions, FileUploadOptions, WorkspaceEvent } from './types';
/**
* 常驻空间的后端边界。真实实现接 @webdrop/core 与 api.md,现在由 mock.ts 提供假实现。
* 常驻空间的 Worker 边界;业务结构来自后端,资源加解密由 @webdrop/core 处理。
* 便捷分享有自己的边界,见 shareApi.ts。
*/
export interface WorkspaceApi {
@@ -21,8 +21,6 @@ export interface WorkspaceApi {
listSaved(): Promise<ChannelInfo[]>;
/** 仅从本机删除保存的链接和终端密钥,不会删服务端空间 */
forget(id: string): Promise<void>;
/** 仅假实现提供:载入演示用的空间 */
loadDemo?(): ChannelInfo[];
/** 订阅某个空间的事件流(对应追加日志的推送),返回取消订阅函数 */
connect(channelId: string, onEvent: (e: WorkspaceEvent) => void): () => void;
@@ -33,6 +31,7 @@ export interface WorkspaceApi {
renameGroup(id: string, name: string): Promise<void>;
groupThread(id: string, groupId?: string): Promise<void>;
renameThread(threadId: string, name: string): Promise<void>;
setChannelHistory(threadId: string, chatHistory: boolean, filesHistory: boolean): Promise<void>;
createFolder(threadId: string, name: string, parentId?: string): Promise<void>;
renameFolder(folderId: string, threadId: string, name: string): Promise<void>;
moveItems(itemIds: string[], threadId: string, folderId?: string): Promise<void>;
@@ -46,6 +45,4 @@ export interface WorkspaceApi {
listArchive(id: string): Promise<ArchiveEntry[]>;
/** 标记「别的设备的修改」已看过(本地状态) */
markSeen(id: string): Promise<void>;
/** 仅假实现提供,用于演示连接状态 */
simulateConnection?(state: ConnectionState): void;
}