feat: 规范化PocketBase数据库文档与原生API访问

- 将数据库文档拆分为按collection命名的标准文件,统一格式
- 补充tbl_company、tbl_system_dict等表的原生访问规则
- 新增users_tag、document_create等字段
- 优化用户资料更新接口,支持非必填字段
- 添加公司原生API测试脚本
- 归档本次变更至OpenSpec
This commit is contained in:
2026-03-29 16:21:34 +08:00
parent 51a90260e4
commit e9fe1165e3
46 changed files with 3790 additions and 1108 deletions

View File

@@ -23,6 +23,11 @@ const pb = new PocketBase(PB_URL);
const collectionData = {
name: 'tbl_system_dict',
type: 'base',
listRule: '',
viewRule: '',
createRule: '(@request.auth.users_idtype = "ManagePlatform" || @request.auth.usergroups_id = "ROLE-1774666070666-9dDrTB")',
updateRule: '(@request.auth.users_idtype = "ManagePlatform" || @request.auth.usergroups_id = "ROLE-1774666070666-9dDrTB")',
deleteRule: '(@request.auth.users_idtype = "ManagePlatform" || @request.auth.usergroups_id = "ROLE-1774666070666-9dDrTB")',
fields: [
{ name: 'system_dict_id', type: 'text', required: true },
{ name: 'dict_name', type: 'text', required: true },
@@ -68,6 +73,11 @@ function buildCollectionPayload(target, existingCollection) {
return {
name: target.name,
type: target.type,
listRule: target.listRule,
viewRule: target.viewRule,
createRule: target.createRule,
updateRule: target.updateRule,
deleteRule: target.deleteRule,
fields: target.fields.map((field) => normalizeFieldPayload(field, null)),
indexes: target.indexes,
};
@@ -91,6 +101,11 @@ function buildCollectionPayload(target, existingCollection) {
return {
name: target.name,
type: target.type,
listRule: target.listRule,
viewRule: target.viewRule,
createRule: target.createRule,
updateRule: target.updateRule,
deleteRule: target.deleteRule,
fields: fields,
indexes: target.indexes,
};