Skip to content

Commit 65ae458

Browse files
committed
perf(api): 调整 API /api/snippet/getSnippet | Adjust API /api/snippet/getSnippet
1 parent 3c664b2 commit 65ae458

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- 添加 API `/api/storage/setLocalStorageVal` | Add API `/api/storage/setLocalStorageVal`
44
- 为 API `/api/file/getFile``blob` 响应结果添加 `content-type` | Add `content-type` to the `blob` response result of API `/api/file/getFile`
55
- [#1](https://github.com/siyuan-community/siyuan-sdk/issues/1) 添加 API `/api/filetree/getIDsByHPath` | Add API `/api/filetree/getIDsByHPath`
6+
- 调整 API `/api/snippet/getSnippet` | Adjust API `/api/snippet/getSnippet`
67

78
## v0.3.3 / 2023-10-24
89

node/tests/api/snippet/getSnippet.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ describe.concurrent(pathname, async () => {
8181
expect(s).not.toBeUndefined();
8282
if (s) {
8383
if (s.id !== "") {
84-
expect.soft(s.id).toEqual(snippet.id);
84+
expect.soft(s.id, "snippet.id").toEqual(snippet.id);
8585
}
86-
expect.soft(s.name).toEqual(snippet.name);
87-
expect.soft(s.type).toEqual(snippet.type);
88-
expect.soft(s.enabled).toEqual(snippet.enabled);
89-
expect.soft(s.content).toEqual(snippet.content);
86+
expect.soft(s.name, "snippet.name").toEqual(snippet.name);
87+
expect.soft(s.type, "snippet.type").toEqual(snippet.type);
88+
expect.soft(s.enabled, "snippet.enabled").toEqual(snippet.enabled);
89+
expect.soft(s.content, "snippet.content").toEqual(snippet.content);
9090
}
9191
}
9292
});

schemas/kernel/api/snippet/getSnippet/response.schema.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/snippet/getSnippet/response.schema.json",
4-
"$comment": "v2.9.7",
4+
"$comment": "v2.10.15",
55
"$ref": "#/$defs/root",
66
"$defs": {
77
"root": {
@@ -53,7 +53,6 @@
5353
"required": [
5454
"id",
5555
"name",
56-
"memo",
5756
"type",
5857
"enabled",
5958
"content"

schemas/kernel/api/snippet/getSnippet/response.schema.json5

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* schemas/kernel/api/snippet/getSnippet/response.schema.json5
33
* 获取代码片段列表
4-
* REF: https://github.com/siyuan-note/siyuan/blob/v2.9.7/kernel/api/snippet.go#L58-L94
4+
* REF: https://github.com/siyuan-note/siyuan/blob/v2.10.15/kernel/api/snippet.go#L58-L94
55
* @pathname: /api/snippet/getSnippet
6-
* @version: 2.9.7
6+
* @version: 2.10.15
77
*/
88
{
99
$schema: 'https://json-schema.org/draft/2020-12/schema',
1010
$id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/snippet/getSnippet/response.schema.json5',
11-
$comment: 'v2.9.7',
11+
$comment: 'v2.10.15',
1212
$ref: '#/$defs/root',
1313
$defs: {
1414
root: {
@@ -55,7 +55,7 @@
5555

5656
type: 'object',
5757
additionalProperties: false,
58-
required: ['id', 'name', 'memo', 'type', 'enabled', 'content'],
58+
required: ['id', 'name', 'type', 'enabled', 'content'],
5959
properties: {
6060
id: {
6161
// 代码片段 ID

0 commit comments

Comments
 (0)