Skip to content

Commit 6e0a08f

Browse files
authored
Spec Update 11/03/2021 (dropbox#60)
Change Notes: files Namespace - Update list_folder route to include app auth - Update list_folder/continue route to include app auth - Update Examples Add file_tagging Namespace
1 parent 72d0718 commit 6e0a08f

File tree

2 files changed

+133
-1
lines changed

2 files changed

+133
-1
lines changed

file_tagging.stone

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
namespace files
2+
3+
import common
4+
import async
5+
6+
alias TagText = String(min_length=1, max_length=32, pattern="[A-Za-z0-9\_]+")
7+
8+
union Tag
9+
"Tag that can be added in multiple ways."
10+
11+
user_generated_tag UserGeneratedTag
12+
"Tag generated by the user."
13+
14+
example default
15+
user_generated_tag = default
16+
17+
18+
union BaseError
19+
unknown
20+
"Action failed."
21+
transient
22+
"Action failed. Try again."
23+
input_validation
24+
"Action failed due to wrong params."
25+
cancelled
26+
"Action cancelled."
27+
28+
struct UserGeneratedTag
29+
tag_text TagText
30+
31+
example default
32+
tag_text = "my_tag"
33+
34+
35+
36+
union BaseTagError extends BaseError
37+
feature_not_supported
38+
"Tags are not turned on for your team. Please turn on the feature."
39+
40+
path_not_found
41+
"Path not found."
42+
43+
44+
#####################################
45+
# Add Tag to an item
46+
#####################################
47+
struct AddTagArg
48+
path Path
49+
"Path to the item to be tagged."
50+
51+
tag_text TagText
52+
"The value of the tag to add."
53+
54+
example default
55+
path = "/Prime_Numbers.txt"
56+
tag_text = "MyTag"
57+
58+
union AddTagError extends BaseTagError
59+
too_many_tags
60+
"Item already has max supported tags."
61+
62+
route tags/add(AddTagArg, Void, AddTagError)
63+
"Add a tag to an item. A tag is a string. No more than 20 tags can be added to a given item."
64+
65+
attrs
66+
auth = "user"
67+
is_preview = true
68+
scope = "files.metadata.write"
69+
70+
71+
#####################################
72+
# Remove Tag from a item
73+
#####################################
74+
75+
struct RemoveTagArg
76+
path Path
77+
"Path to the item to tag."
78+
79+
tag_text TagText
80+
"The tag to remove."
81+
82+
example default
83+
path = "/Prime_Numbers.txt"
84+
tag_text = "MyTag"
85+
86+
union RemoveTagError extends BaseTagError
87+
tag_not_exists_for_this_path
88+
"That tag doesn't exist at this path."
89+
90+
route tags/remove(RemoveTagArg, Void, RemoveTagError)
91+
"Remove a tag from an item."
92+
93+
attrs
94+
auth = "user"
95+
is_preview = true
96+
scope = "files.metadata.write"
97+
98+
###############################################
99+
# Get tags by item
100+
###############################################
101+
struct GetTagsArg
102+
paths List(Path)
103+
"Path to the items."
104+
105+
example default
106+
paths = ["/Prime_Numbers.txt"]
107+
108+
struct PathToTags
109+
path Path
110+
"Path of the item."
111+
tags List(Tag)
112+
"Tags assigned to this item."
113+
example default
114+
path = "/Prime_Numbers.txt"
115+
tags = [default]
116+
117+
struct GetTagsResult
118+
paths_to_tags List(PathToTags)
119+
"List of paths and their corresponding tags."
120+
121+
example default
122+
paths_to_tags = [default]
123+
124+
route tags/get(GetTagsArg, GetTagsResult, BaseTagError)
125+
"Get list of tags assigned to items."
126+
127+
attrs
128+
auth = "user"
129+
is_preview = true
130+
scope = "files.metadata.read"

files.stone

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ route list_folder (ListFolderArg, ListFolderResult, ListFolderError)
555555

556556
attrs
557557
allow_app_folder_app = true
558+
auth = "app, user"
558559
select_admin_mode = "whole_team"
559560
scope = "files.metadata.read"
560561

@@ -580,6 +581,7 @@ route list_folder/continue (ListFolderContinueArg, ListFolderResult, ListFolderC
580581

581582
attrs
582583
allow_app_folder_app = true
584+
auth = "app, user"
583585
select_admin_mode = "whole_team"
584586
scope = "files.metadata.read"
585587

@@ -2553,7 +2555,7 @@ struct GetTemporaryLinkResult
25532555

25542556
example default
25552557
metadata = default
2556-
link = "https://content.dropboxapi.com/apitl/1/YXNkZmFzZGcyMzQyMzI0NjU2NDU2NDU2"
2558+
link = "https://ucabc123456.dl.dropboxusercontent.com/cd/0/get/abcdefghijklmonpqrstuvwxyz1234567890/file"
25572559

25582560
union GetTemporaryLinkError
25592561
path LookupError

0 commit comments

Comments
 (0)