Skip to content

Commit 3998635

Browse files
authored
feat: add create snapshot api document (#89)
1 parent fd2e6c9 commit 3998635

5 files changed

Lines changed: 179 additions & 3 deletions

File tree

content/guides/pro/api.ja-JP.mdx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,50 @@ title: API
177177
}}
178178
/>
179179

180+
### スナップショットを生成する
181+
182+
<APITable
183+
request={{
184+
method: 'GET',
185+
url: '/universer-api/snapshot/{type}/unit/{unitID}/rev/0/ensure',
186+
parametersType: 'Query',
187+
parameters: [{
188+
name: 'type',
189+
type: 'enum(int)',
190+
required: true,
191+
description: '1(doc)、2(sheet)',
192+
}, {
193+
name: 'unitID',
194+
type: 'string',
195+
required: true,
196+
description: 'ドキュメント ID',
197+
}],
198+
example: `curl -X GET 'http://localhost:8000/universer-api/snapshot/2/unit/ETVf-B4lQqOSE_p09mcp9Q/rev/0/ensure'`,
199+
}}
200+
response={{
201+
type: 'application/json',
202+
parameters: [{
203+
name: 'error',
204+
type: 'object',
205+
properties: [{
206+
name: 'code',
207+
type: 'enum(int)',
208+
description: '1(成功)',
209+
}, {
210+
name: 'message',
211+
type: 'string',
212+
description: 'エラーメッセージ',
213+
}],
214+
}],
215+
example: JSON.stringify({
216+
error: {
217+
code: 1,
218+
message: '',
219+
},
220+
}, null, 2),
221+
}}
222+
/>
223+
180224
## ファイルとインポート/エクスポート
181225

182226
### ファイルアップロード

content/guides/pro/api.mdx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,50 @@ This page lists common Univer Server APIs. The default base URL is `http://local
177177
}}
178178
/>
179179

180+
### Create Snapshot
181+
182+
<APITable
183+
request={{
184+
method: 'GET',
185+
url: '/universer-api/snapshot/{type}/unit/{unitID}/rev/0/ensure',
186+
parametersType: 'Query',
187+
parameters: [{
188+
name: 'type',
189+
type: 'enum(int)',
190+
required: true,
191+
description: '1 (doc), 2 (sheet) for path',
192+
}, {
193+
name: 'unitID',
194+
type: 'string',
195+
required: true,
196+
description: 'Document id',
197+
}],
198+
example: `curl -X GET 'http://localhost:8000/universer-api/snapshot/2/unit/ETVf-B4lQqOSE_p09mcp9Q/rev/0/ensure'`,
199+
}}
200+
response={{
201+
type: 'application/json',
202+
parameters: [{
203+
name: 'error',
204+
type: 'object',
205+
properties: [{
206+
name: 'code',
207+
type: 'enum(int)',
208+
description: '1 (success)',
209+
}, {
210+
name: 'message',
211+
type: 'string',
212+
description: 'Error message',
213+
}],
214+
}],
215+
example: JSON.stringify({
216+
error: {
217+
code: 1,
218+
message: '',
219+
},
220+
}, null, 2),
221+
}}
222+
/>
223+
180224
## Files and Import/Export
181225

182226
### Upload File

content/guides/pro/api.zh-CN.mdx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,50 @@ title: API
177177
}}
178178
/>
179179

180+
### 生成快照
181+
182+
<APITable
183+
request={{
184+
method: 'GET',
185+
url: '/universer-api/snapshot/{type}/unit/{unitID}/rev/0/ensure',
186+
parametersType: 'Query',
187+
parameters: [{
188+
name: 'type',
189+
type: 'enum(int)',
190+
required: true,
191+
description: '1(doc),2(sheet)路径参数',
192+
}, {
193+
name: 'unitID',
194+
type: 'string',
195+
required: true,
196+
description: '文档 id',
197+
}],
198+
example: `curl -X GET 'http://localhost:8000/universer-api/snapshot/2/unit/ETVf-B4lQqOSE_p09mcp9Q/rev/0/ensure'`,
199+
}}
200+
response={{
201+
type: 'application/json',
202+
parameters: [{
203+
name: 'error',
204+
type: 'object',
205+
properties: [{
206+
name: 'code',
207+
type: 'enum(int)',
208+
description: '1(成功)',
209+
}, {
210+
name: 'message',
211+
type: 'string',
212+
description: '失败信息',
213+
}],
214+
}],
215+
example: JSON.stringify({
216+
error: {
217+
code: 1,
218+
message: '',
219+
},
220+
}, null, 2),
221+
}}
222+
/>
223+
180224
## 文件与导入导出
181225

182226
### 上传文件

content/guides/pro/api.zh-TW.mdx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,50 @@ title: API
177177
}}
178178
/>
179179

180+
### 生成快照
181+
182+
<APITable
183+
request={{
184+
method: 'GET',
185+
url: '/universer-api/snapshot/{type}/unit/{unitID}/rev/0/ensure',
186+
parametersType: 'Query',
187+
parameters: [{
188+
name: 'type',
189+
type: 'enum(int)',
190+
required: true,
191+
description: '1(doc),2(sheet)路徑參數',
192+
}, {
193+
name: 'unitID',
194+
type: 'string',
195+
required: true,
196+
description: '文檔 id',
197+
}],
198+
example: `curl -X GET 'http://localhost:8000/universer-api/snapshot/2/unit/ETVf-B4lQqOSE_p09mcp9Q/rev/0/ensure'`,
199+
}}
200+
response={{
201+
type: 'application/json',
202+
parameters: [{
203+
name: 'error',
204+
type: 'object',
205+
properties: [{
206+
name: 'code',
207+
type: 'enum(int)',
208+
description: '1(成功)',
209+
}, {
210+
name: 'message',
211+
type: 'string',
212+
description: '失敗信息',
213+
}],
214+
}],
215+
example: JSON.stringify({
216+
error: {
217+
code: 1,
218+
message: '',
219+
},
220+
}, null, 2),
221+
}}
222+
/>
223+
180224
## 檔案與匯入匯出
181225

182226
### 上傳檔案

examples/univer-vue2/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
## Project setup
44

5-
```
5+
```shell
66
pnpm install
77
```
88

99
### Compiles and hot-reloads for development
1010

11-
```
11+
```shell
1212
pnpm run serve
1313
```
1414

1515
### Compiles and minifies for production
1616

17-
```
17+
```shell
1818
pnpm run build
1919
```
2020

0 commit comments

Comments
 (0)