Skip to content

Commit 1eaa36f

Browse files
committed
feat: create public share link
Signed-off-by: Jana Peper <[email protected]>
1 parent 58cb7c3 commit 1eaa36f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

ex_app/lib/all_tools/files.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ def get_file_content(file_path: str):
2525

2626
return response.text
2727

28+
29+
@tool
30+
@dangerous_tool
31+
def create_public_sharing_link(path: str):
32+
"""
33+
Creates a public sharing link for a file or folder
34+
:param path: the path of the file or folder
35+
:return:
36+
"""
37+
38+
response = nc.ocs('POST', '/ocs/v2.php/apps/files_sharing/api/v1/shares', json={
39+
'path': path,
40+
'shareType': 3,
41+
})
42+
43+
return response
44+
2845
return [
29-
get_file_content
46+
get_file_content,
47+
create_public_sharing_link,
3048
]

0 commit comments

Comments
 (0)