Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ npm run test:browser

## License
MIT

账号默认私有、明确授权共享、退出登录及项目/编排回收站的权限、接口和迁移说明见 [用户与回收站](docs/accounts-and-trash.md)。
21 changes: 21 additions & 0 deletions apps/api/migrations/0004_ownership_recycle_bin.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- Ownership is server-derived. Legacy agent-created projects migrate only when
-- there is exactly one human writer; ambiguous projects remain quarantined.
ALTER TABLE projects ADD COLUMN owner_user_id TEXT;
UPDATE projects SET owner_user_id = CASE
WHEN instr(created_by, '@') > 0 THEN lower(trim(created_by))
ELSE (SELECT CASE WHEN count(DISTINCT lower(trim(actor_id))) = 1 THEN min(lower(trim(actor_id))) ELSE NULL END
FROM project_members WHERE project_id = projects.id AND role = 'writer' AND instr(actor_id, '@') > 0)
END;
ALTER TABLE projects ADD COLUMN sharing_mode TEXT NOT NULL DEFAULT 'private' CHECK(sharing_mode IN ('private','members'));
UPDATE projects SET sharing_mode = 'members' WHERE EXISTS (
SELECT 1 FROM project_members WHERE project_id = projects.id AND instr(actor_id,'@') > 0 AND lower(trim(actor_id)) <> owner_user_id
);
ALTER TABLE projects ADD COLUMN membership_revision INTEGER NOT NULL DEFAULT 0;
CREATE INDEX projects_owner_idx ON projects(owner_user_id);
CREATE TABLE resource_lifecycle (
project_id TEXT NOT NULL,
kind TEXT NOT NULL CHECK(kind IN ('project','composition')),
id TEXT NOT NULL,
record_json TEXT NOT NULL,
PRIMARY KEY(project_id,kind,id)
);
5 changes: 3 additions & 2 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"build": "tsc --noEmit"
},
"dependencies": {
"@video-compose/protocol": "*",
"@video-compose/domain": "*",
"hono": "^4.7.4"
"@video-compose/protocol": "*",
"hono": "^4.7.4",
"jose": "^6.2.13"
}
}
Loading
Loading