Skip to content
Open
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
59 changes: 58 additions & 1 deletion content/guides/pro/api.ja-JP.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -187,6 +192,58 @@ title: API
}}
/>

### ドキュメント複製(実験的 API)

> 注:これは実験的な API であり、今後互換性のない変更が入る可能性があります。

<APITable
request={{
method: 'POST',
url: '/universer-api/snapshot/{type}/unit/{unitId}/fork',
headers: <code>content-type: application/json</code>,
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),
}}
/>

### スナップショットを生成する

<APITable
Expand Down
59 changes: 58 additions & 1 deletion content/guides/pro/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,13 @@ This page lists common Univer Server APIs. The default base URL is `http://local
type: 'array[string]',
required: true,
description: 'Document id list',
}, {
name: 'hardDelete',
type: 'boolean',
required: false,
description: 'Whether to permanently delete the documents. `true` permanently deletes them; `false` or omitted only marks them as deleted.',
}],
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',
Expand All @@ -187,6 +192,58 @@ This page lists common Univer Server APIs. The default base URL is `http://local
}}
/>

### Fork Document (Experimental API)

> Note: This is an experimental API and may change incompatibly in future releases.

<APITable
request={{
method: 'POST',
url: '/universer-api/snapshot/{type}/unit/{unitId}/fork',
headers: <code>content-type: application/json</code>,
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

<APITable
Expand Down
59 changes: 58 additions & 1 deletion content/guides/pro/api.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -187,6 +192,58 @@ title: API
}}
/>

### 复制文档(实验性 API)

> 说明:这是实验性 API,后续可能发生兼容性变更。

<APITable
request={{
method: 'POST',
url: '/universer-api/snapshot/{type}/unit/{unitId}/fork',
headers: <code>content-type: application/json</code>,
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),
}}
/>

### 生成快照

<APITable
Expand Down
59 changes: 58 additions & 1 deletion content/guides/pro/api.zh-TW.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -187,6 +192,58 @@ title: API
}}
/>

### 複製文件(實驗性 API)

> 說明:這是實驗性 API,後續可能發生不相容變更。

<APITable
request={{
method: 'POST',
url: '/universer-api/snapshot/{type}/unit/{unitId}/fork',
headers: <code>content-type: application/json</code>,
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),
}}
/>

### 生成快照

<APITable
Expand Down
Loading