From ea4cfc869f615bc658f2f5fa41a80a045cdb0f23 Mon Sep 17 00:00:00 2001 From: zsq1234 <2387311298@qq.com> Date: Fri, 12 Jun 2026 17:18:10 +0800 Subject: [PATCH] feat: update delete unit api and add fork unit api document --- content/guides/pro/api.ja-JP.mdx | 59 +++++++++++++++++++++++++++++++- content/guides/pro/api.mdx | 59 +++++++++++++++++++++++++++++++- content/guides/pro/api.zh-CN.mdx | 59 +++++++++++++++++++++++++++++++- content/guides/pro/api.zh-TW.mdx | 59 +++++++++++++++++++++++++++++++- 4 files changed, 232 insertions(+), 4 deletions(-) diff --git a/content/guides/pro/api.ja-JP.mdx b/content/guides/pro/api.ja-JP.mdx index b1d115c..c7e9dcd 100644 --- a/content/guides/pro/api.ja-JP.mdx +++ b/content/guides/pro/api.ja-JP.mdx @@ -160,8 +160,13 @@ title: API type: 'array[string]', required: true, description: 'ドキュメント ID 配列', + }, { + name: 'hardDelete', + type: 'boolean', + required: false, + description: '`true` の場合は完全に削除し、`false` または省略時は削除済みとしてマークします', }], - example: `curl -X DELETE 'http://localhost:8000/universer-api/snapshot/-/units?unitIds=1&unitIds=2'`, + example: `curl -X DELETE 'http://localhost:8000/universer-api/snapshot/-/units?unitIds=1&unitIds=2&hardDelete=true'`, }} response={{ type: 'application/json', @@ -187,6 +192,58 @@ title: API }} /> +### ドキュメント複製(実験的 API) + +> 注:これは実験的な API であり、今後互換性のない変更が入る可能性があります。 + +content-type: application/json, + parametersType: 'Path', + parameters: [{ + name: 'type', + type: 'enum(int)', + required: true, + description: '1(docs)、2(sheets)のパスパラメータ', + }, { + name: 'unitId', + type: 'string', + required: true, + description: '複製元のドキュメント ID', + }], + example: `curl -X POST 'http://localhost:8000/universer-api/snapshot/2/unit/ETVf-B4lQqOSE_p09mcp9Q/fork'`, + }} + response={{ + type: 'application/json', + parameters: [{ + name: 'error', + type: 'object', + properties: [{ + name: 'code', + type: 'enum(int)', + description: '1(成功)', + }, { + name: 'message', + type: 'string', + description: 'エラーメッセージ', + }], + }, { + name: 'unitId', + type: 'string', + description: '複製後に生成される新しいドキュメント ID', + }], + example: JSON.stringify({ + error: { + code: 1, + message: '', + }, + unitId: 'FORKED_ETVf-B4lQqOSE_p09mcp9Q', + }, null, 2), + }} +/> + ### スナップショットを生成する +### Fork Document (Experimental API) + +> Note: This is an experimental API and may change incompatibly in future releases. + +content-type: application/json, + parametersType: 'Path', + parameters: [{ + name: 'type', + type: 'enum(int)', + required: true, + description: '1 (docs), 2 (sheets) for path', + }, { + name: 'unitId', + type: 'string', + required: true, + description: 'Document id to fork', + }], + example: `curl -X POST 'http://localhost:8000/universer-api/snapshot/2/unit/ETVf-B4lQqOSE_p09mcp9Q/fork'`, + }} + response={{ + type: 'application/json', + parameters: [{ + name: 'error', + type: 'object', + properties: [{ + name: 'code', + type: 'enum(int)', + description: '1 (success)', + }, { + name: 'message', + type: 'string', + description: 'Error message', + }], + }, { + name: 'unitId', + type: 'string', + description: 'New document id generated by the fork', + }], + example: JSON.stringify({ + error: { + code: 1, + message: '', + }, + unitId: 'FORKED_ETVf-B4lQqOSE_p09mcp9Q', + }, null, 2), + }} +/> + ### Create Snapshot +### 复制文档(实验性 API) + +> 说明:这是实验性 API,后续可能发生兼容性变更。 + +content-type: application/json, + parametersType: 'Path', + parameters: [{ + name: 'type', + type: 'enum(int)', + required: true, + description: '1(docs),2(sheets)路径参数', + }, { + name: 'unitId', + type: 'string', + required: true, + description: '待复制的文档 id', + }], + example: `curl -X POST 'http://localhost:8000/universer-api/snapshot/2/unit/ETVf-B4lQqOSE_p09mcp9Q/fork'`, + }} + response={{ + type: 'application/json', + parameters: [{ + name: 'error', + type: 'object', + properties: [{ + name: 'code', + type: 'enum(int)', + description: '1(成功)', + }, { + name: 'message', + type: 'string', + description: '失败信息', + }], + }, { + name: 'unitId', + type: 'string', + description: '复制后生成的新文档 id', + }], + example: JSON.stringify({ + error: { + code: 1, + message: '', + }, + unitId: 'FORKED_ETVf-B4lQqOSE_p09mcp9Q', + }, null, 2), + }} +/> + ### 生成快照 +### 複製文件(實驗性 API) + +> 說明:這是實驗性 API,後續可能發生不相容變更。 + +content-type: application/json, + parametersType: 'Path', + parameters: [{ + name: 'type', + type: 'enum(int)', + required: true, + description: '1(docs),2(sheets)路徑參數', + }, { + name: 'unitId', + type: 'string', + required: true, + description: '待複製的文件 id', + }], + example: `curl -X POST 'http://localhost:8000/universer-api/snapshot/2/unit/ETVf-B4lQqOSE_p09mcp9Q/fork'`, + }} + response={{ + type: 'application/json', + parameters: [{ + name: 'error', + type: 'object', + properties: [{ + name: 'code', + type: 'enum(int)', + description: '1(成功)', + }, { + name: 'message', + type: 'string', + description: '錯誤訊息', + }], + }, { + name: 'unitId', + type: 'string', + description: '複製後產生的新文件 id', + }], + example: JSON.stringify({ + error: { + code: 1, + message: '', + }, + unitId: 'FORKED_ETVf-B4lQqOSE_p09mcp9Q', + }, null, 2), + }} +/> + ### 生成快照