From 10df0443d71f8c027748ba87341d3851428cc96d Mon Sep 17 00:00:00 2001 From: awu0403 <76416779+awu0403@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:13:56 +0800 Subject: [PATCH 1/8] test git --- test.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.md diff --git a/test.md b/test.md new file mode 100644 index 0000000..e69de29 From 2350822b90efc3476c915142d9af91e5169d7a26 Mon Sep 17 00:00:00 2001 From: awu0403 <76416779+awu0403@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:22:05 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=B8=8D=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E6=88=96=E7=94=A8=E6=88=B7=E7=94=A8=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E7=9A=84API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user_account_operations.yaml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/api/user_account_operations.yaml b/api/user_account_operations.yaml index 58ad290..6f8c3eb 100644 --- a/api/user_account_operations.yaml +++ b/api/user_account_operations.yaml @@ -2456,34 +2456,6 @@ paths: '200': description: OK - /api2/repos/{repo_id}/download-info/: - get: - tags: - - Library Sync - summary: Fetch library Sync info - security: - - AccountTokenAuth: [] - parameters: - - $ref: '#/components/parameters/repo_id' - responses: - '200': - description: OK - - /api2/repos/{repo_id}/owa-file/: - get: - tags: - - Office Web APP Integration - summary: View File Through Office Web APP - security: - - AccountTokenAuth: [] - parameters: - - $ref: '#/components/parameters/repo_id' - # - $ref: '#/components/parameters/file_path' - # - $ref: '#/components/parameters/action' - responses: - '200': - description: OK - /api2/server-info/: get: tags: From 99326325246d8871294f1367073655e1cab1bb3f Mon Sep 17 00:00:00 2001 From: awu0403 <76416779+awu0403@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:24:21 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test.md diff --git a/test.md b/test.md deleted file mode 100644 index e69de29..0000000 From e246385be3ffd8e8b47d6b1ebd2a728bc22f0755 Mon Sep 17 00:00:00 2001 From: awu0403 <76416779+awu0403@users.noreply.github.com> Date: Mon, 4 Mar 2024 16:28:03 +0800 Subject: [PATCH 4/8] Get and Post File refine --- api/user_account_operations.yaml | 169 ++++++++++++++++++++++++------- 1 file changed, 134 insertions(+), 35 deletions(-) diff --git a/api/user_account_operations.yaml b/api/user_account_operations.yaml index 6f8c3eb..0438a63 100644 --- a/api/user_account_operations.yaml +++ b/api/user_account_operations.yaml @@ -167,6 +167,44 @@ components: type: string pattern: '^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$' + p: + name: p + in: path + description: 'The path to the file in the library' + required: true + schema: + type: string + + reuse: + name: reuse + in: query + description: Set reuse to 1 if you want the generated download link can be accessed more than once in one hour. + required: false + schema: + type: string + + repo_id_query: + name: repo_id + in: path + description: '' + required: true + schema: + type: string + path: + name: path + in: path + description: '' + required: true + schema: + type: string + is_dir: + name: is_dir + in: path + description: '' + required: true + schema: + type: string + comment_id: name: comment_id in: path @@ -327,6 +365,30 @@ components: newname: $ref: '#/components/schemas/newname' + file_operation: + title: 'operation' + type: string + example: "rename" + new_name: + title: 'newname' + type: string + example: 'test.md' + + dst_repo: + title: dst_repo + type: string + example: affc837f-7fdd-4e91-b88a-32caf99897f2 + + dst_dir: + title: dst_dir + type: string + example: /123 + + + + + + paths: # Account /api2/account/info/: @@ -1562,48 +1624,40 @@ paths: get: tags: - Files - summary: Download File + summary: Download file security: - AccountTokenAuth: [] parameters: - $ref: '#/components/parameters/repo_id' - # - $ref: '#/components/parameters/p' - # - $ref: '#/components/parameters/reuse' + - $ref: '#/components/parameters/p' + - $ref: '#/components/parameters/reuse' responses: '200': description: OK - + post: tags: - Files - summary: Rename/Move/Copy File + summary: Rename/Move/Copy file security: - AccountTokenAuth: [] parameters: - $ref: '#/components/parameters/repo_id' - # - $ref: '#/components/parameters/p' - # requestBody: - # content: - # application/json: - # schema: - # type: object - # properties: - # operation: - # $ref: '#/components/schemas/file_operation' - # newname: - # $ref: '#/components/schemas/new_name' - # requestBody: - # content: - # application/json: - # schema: - # type: object - # properties: - # operation: - # $ref: '#/components/schemas/file_operation' - # dst_repo: - # $ref: '#/components/schemas/dst_repo' - # dst_dir: - # $ref: '#/components/schemas/dst_dir' + - $ref: '#/components/parameters/p' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + newname: + $ref: '#/components/schemas/new_name' + operation: + $ref: '#/components/schemas/file_operation' + dst_repo: + $ref: '#/components/schemas/dst_repo' + dst_dir: + $ref: '#/components/schemas/dst_dir' responses: '200': description: OK @@ -1646,30 +1700,75 @@ paths: get: tags: - Files - summary: Get File Detail + summary: Get file detail security: - AccountTokenAuth: [] parameters: - $ref: '#/components/parameters/repo_id' - # - $ref: '#/components/parameters/p' + - $ref: '#/components/parameters/p' responses: '200': description: OK + content: + application/json: + schema: + type: object + properties: + type: + type: string + id: + type: string + name: + type: string + permission: + type: string + + example: + type: 'file' + id: '000000000000' + name: 'test.md' + permission: 'rw' + mtime: 1709530197 + last_modified: "2024-03-04T13:29:57+08:00" + last_modifier_email: "77a423e4804a4d7ca1ec78a150d71229@auth.local" + last_modifier_name: "xiaowu" + last_modifier_contact_email: "1942999482@qq.com" + size: 7839 + starred: false + comment_total: 0 + can_edit: true + /api/v2.1/smart-link/: get: tags: - Files - summary: Get Smart Link for a File + summary: Get smart link for a file security: - AccountTokenAuth: [] - # parameters: - # - $ref: '#/components/parameters/repo_id_query' - # - $ref: '#/components/parameters/path' - # - $ref: '#/components/parameters/is_dir' + parameters: + - $ref: '#/components/parameters/repo_id_query' + - $ref: '#/components/parameters/path' + - $ref: '#/components/parameters/is_dir' responses: '200': description: OK + content: + application/json: + schema: + type: object + properties: + smart_link: + type: string + smart_link_token: + type: string + name: + type: string + example: + smart_link: "https://cloud.seafile.com/smart-link/e5f748cf-be0b-4b9c-bcb5-63b6eccf791c/" + smart_link_token: "e5f748cf-be0b-4b9c-bcb5-63b6eccf791c" + name: "b" + /api/v2.1/repos/sync-batch-copy-item/: post: From 1f8251647b12d3e32a56fce49ed7865a5f31eeef Mon Sep 17 00:00:00 2001 From: awu0403 <76416779+awu0403@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:17:58 +0800 Subject: [PATCH 5/8] Put and Delete File refine --- api/user_account_operations.yaml | 56 ++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/api/user_account_operations.yaml b/api/user_account_operations.yaml index 0438a63..a381350 100644 --- a/api/user_account_operations.yaml +++ b/api/user_account_operations.yaml @@ -186,21 +186,21 @@ components: repo_id_query: name: repo_id in: path - description: '' + description: 'The unique identifier of a library' required: true schema: type: string path: name: path in: path - description: '' + description: 'path of file/folder.' required: true schema: type: string is_dir: name: is_dir in: path - description: '' + description: 'true or false' required: true schema: type: string @@ -368,7 +368,7 @@ components: file_operation: title: 'operation' type: string - example: "rename" + example: "lock" new_name: title: 'newname' type: string @@ -1665,37 +1665,57 @@ paths: put: tags: - Files - summary: Lock/Unlock File + summary: Lock/Unlock file security: - AccountTokenAuth: [] parameters: - $ref: '#/components/parameters/repo_id' - # - $ref: '#/components/parameters/p' - # requestBody: - # content: - # application/json: - # schema: - # type: object - # properties: - # operation: - # $ref: '#/components/schemas/file_operation' + - $ref: '#/components/parameters/p' + requestBody: + content: + application/json: + schema: + type: object + properties: + operation: + $ref: '#/components/schemas/file_operation' responses: '200': description: OK - + content: + application/json: + schema: + type: object + example: + type: "file" + repo_id: "eaa2b714-7993-4abc-93ce-56286d45d3de" + parent_dir: "/内层" + obj_name: "b" + obj_id: "0000000000000000000000000000000000000000" + size: 0 + mtime: "2024-03-04T15:44:56+08:00" + is_locked: true + can_preview: false + can_edit: false delete: tags: - Files - summary: Delete File + summary: Delete file security: - AccountTokenAuth: [] parameters: - $ref: '#/components/parameters/repo_id' - # - $ref: '#/components/parameters/p' + - $ref: '#/components/parameters/p' responses: '200': description: OK - + content: + application/json: + schema: + type: string + example: + success + /api2/repos/{repo_id}/file/detail/: get: tags: From 7f1e013aac2b7a25bf3c84f71b2eda695ecdfc69 Mon Sep 17 00:00:00 2001 From: awu0403 <76416779+awu0403@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:25:45 +0800 Subject: [PATCH 6/8] fix --- api/user_account_operations.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/user_account_operations.yaml b/api/user_account_operations.yaml index a381350..8063aa5 100644 --- a/api/user_account_operations.yaml +++ b/api/user_account_operations.yaml @@ -168,7 +168,7 @@ components: pattern: '^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$' p: - name: p + name: path in: path description: 'The path to the file in the library' required: true @@ -1620,7 +1620,7 @@ paths: '200': description: OK - /api2/repos/{repo_id}/file/: + /api2/repos/{repo_id}/file/?p={p}: get: tags: - Files From 624ab9afe1e57d95b5cb210b1b7da147dfee45e0 Mon Sep 17 00:00:00 2001 From: awu0403 <76416779+awu0403@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:28:20 +0800 Subject: [PATCH 7/8] Update user_account_operations.yaml --- api/user_account_operations.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/user_account_operations.yaml b/api/user_account_operations.yaml index 8063aa5..331da6d 100644 --- a/api/user_account_operations.yaml +++ b/api/user_account_operations.yaml @@ -168,7 +168,7 @@ components: pattern: '^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$' p: - name: path + name: p in: path description: 'The path to the file in the library' required: true From f9cf1ddda845c638be1443a514ddafe1836dc7c7 Mon Sep 17 00:00:00 2001 From: awu0403 <76416779+awu0403@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:30:36 +0800 Subject: [PATCH 8/8] Update user_account_operations.yaml --- api/user_account_operations.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/user_account_operations.yaml b/api/user_account_operations.yaml index 331da6d..fa4de8f 100644 --- a/api/user_account_operations.yaml +++ b/api/user_account_operations.yaml @@ -1716,7 +1716,7 @@ paths: example: success - /api2/repos/{repo_id}/file/detail/: + /api2/repos/{repo_id}/file/detail/?p={p}: get: tags: - Files