Skip to content

Commit dd2681e

Browse files
author
Karl Rieb
committed
Update public spec.
- Files - Add save_url endpoint for saving online content to your Dropbox. - Shared folders - Add viewer_no_comment to AccessLevel. - Add is_owner to GroupInfo. - Change return type of SharePathError.already_shared from Void to SharedFolderMetadata. - Add leave_a_copy parameter to relinquish_folder_membership endpoint. - Change relinquish_folder_membership to return async job ID when leaving a copy. - Add relinquish_folder_membership_error to JobError. - Business endpoints - Add membership_type to MemberProfile. - Add keep_account parameter to members/remove endpoint. - Add cannot_keep_account_and_transfer and cannot_keep_account_and_delete_data to MembersRemoveError.
1 parent 5fe253f commit dd2681e

8 files changed

+350
-29
lines changed

auth.stone

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ union AuthError
77
"The access token is invalid."
88
invalid_select_user
99
"The user specified in 'Dropbox-API-Select-User' is no longer on the team."
10+
invalid_select_admin
11+
"The user specified in 'Dropbox-API-Select-Admin' is not a Dropbox Business team admin."
1012
other*
1113
"An unspecified error."
1214

files.stone

+56-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
namespace files
22
"This namespace contains endpoints and data types for basic file operations."
33

4+
import async
45
import common
56
import users
67
import properties
78

89
alias Id = String(min_length=1)
9-
alias Path = String(pattern="/.*")
10-
alias PathOrId = String(pattern="(/|id:).*")
11-
alias PathR = String(pattern="(/.*)?") # A path that can be the root path ("").
10+
alias Path = String(pattern="/(.|[\\r\\n])*")
11+
alias PathOrId = String(pattern="/(.|[\\r\\n])*|id:.*")
12+
alias PathR = String(pattern="(/(.|[\\r\\n])*)?") # A path that can be the root path ("").
1213
alias Rev = String(min_length=9, pattern="[0-9a-f]+") # TODO: Change pattern to "rev:[0-9a-f]{9,}"
1314
alias ListFolderCursor = String(min_length=1)
14-
alias ReadPath = String(pattern="((/|id:).*)|(rev:[0-9a-f]{9,})")
15+
alias ReadPath = String(pattern="(/(.|[\\r\\n])*|id:.*)|(rev:[0-9a-f]{9,})")
1516

1617
#
1718
# Metadata definitions and route
@@ -282,7 +283,7 @@ struct ListFolderLongpollArg
282283
struct ListFolderLongpollResult
283284
changes Boolean
284285
"Indicates whether new changes are available. If true, call
285-
:route:`list_folder` to retrieve the changes."
286+
:route:`list_folder/continue` to retrieve the changes."
286287
backoff UInt64?
287288
"If present, backoff for at least this many seconds before calling
288289
:route:`list_folder/longpoll` again."
@@ -298,10 +299,11 @@ union ListFolderLongpollError
298299

299300
route list_folder/longpoll (ListFolderLongpollArg, ListFolderLongpollResult, ListFolderLongpollError)
300301
"A longpoll endpoint to wait for changes on an account. In conjunction with
301-
:route:`list_folder`, this call gives you a low-latency way to monitor an
302-
account for file changes. The connection will block until there are changes
303-
available or a timeout occurs. This endpoint is useful mostly for client-side
304-
apps. If you're looking for server-side notifications, check out our
302+
:route:`list_folder/continue`, this call gives you a low-latency way to
303+
monitor an account for file changes. The connection will block until there
304+
are changes available or a timeout occurs. This endpoint is useful mostly
305+
for client-side apps. If you're looking for server-side notifications,
306+
check out our
305307
:link:`webhooks documentation https://www.dropbox.com/developers/reference/webhooks`."
306308
attrs
307309
host="notify"
@@ -1025,7 +1027,6 @@ union RestoreError
10251027
route restore(RestoreArg, FileMetadata, RestoreError)
10261028
"Restore a file to a specific revision"
10271029

1028-
10291030
#
10301031
# Temporary link
10311032
#
@@ -1124,3 +1125,48 @@ union SaveCopyReferenceError
11241125

11251126
route copy_reference/save(SaveCopyReferenceArg, SaveCopyReferenceResult, SaveCopyReferenceError)
11261127
"Save a copy reference returned by :route:`copy_reference/get` to the user's Dropbox."
1128+
1129+
#
1130+
# Save URL
1131+
#
1132+
1133+
struct SaveUrlArg
1134+
path Path
1135+
"The path in Dropbox where the URL will be saved to."
1136+
url String
1137+
"The URL to be saved."
1138+
1139+
example default
1140+
path = "/a.txt"
1141+
url = "http://example.com/a.txt"
1142+
1143+
union SaveUrlResult extends async.LaunchResultBase
1144+
complete FileMetadata
1145+
"Metadata of the file where the URL is saved to."
1146+
1147+
union SaveUrlError
1148+
path WriteError
1149+
download_failed
1150+
"Failed downloading the given URL."
1151+
invalid_url
1152+
"The given URL is invalid."
1153+
not_found
1154+
"The file where the URL is saved to no longer exists."
1155+
other*
1156+
1157+
route save_url(SaveUrlArg, SaveUrlResult, SaveUrlError)
1158+
"Save a specified URL into a file in user's Dropbox. If the given path already
1159+
exists, the file will be renamed to avoid the conflict (e.g. myfile (1).txt)."
1160+
1161+
#
1162+
# Save URL Job
1163+
#
1164+
1165+
union SaveUrlJobStatus extends async.PollResultBase
1166+
complete FileMetadata
1167+
"Metadata of the file where the URL is saved to."
1168+
failed SaveUrlError
1169+
1170+
route save_url/check_job_status(async.PollArg, SaveUrlJobStatus, async.PollError)
1171+
"Check the status of a :route:`save_url` job."
1172+

sharing_folders.stone

+22-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace sharing
55
import async
66
import common
77
import files
8-
import team
8+
import team_common
99
import users
1010

1111
alias DropboxId = String(min_length=1)
@@ -21,6 +21,9 @@ union AccessLevel
2121
"The collaborator can both view and edit the shared folder."
2222
viewer
2323
"The collaborator can only view the shared folder."
24+
viewer_no_comment
25+
"The collaborator can only view the shared folder and does
26+
not have any access to comments."
2427
other*
2528

2629
struct FolderPolicy
@@ -232,12 +235,14 @@ struct InviteeMembershipInfo extends MembershipInfo
232235
access_type = viewer
233236
permissions = []
234237

235-
struct GroupInfo extends team.GroupSummary
238+
struct GroupInfo extends team_common.GroupSummary
236239
"The information about a group. Groups is a way to manage a list of users
237240
who need same access permission to the shared folder."
238241

239-
group_type team.GroupType
242+
group_type team_common.GroupType
240243
"The type of group."
244+
is_owner Boolean
245+
"If the current user is an owner of the group."
241246
same_team Boolean
242247
"If the group is owned by the current user's team."
243248

@@ -246,6 +251,7 @@ struct GroupInfo extends team.GroupSummary
246251
group_id = "g:e2db7665347abcd600000000001a2b3c"
247252
member_count = 10
248253
group_type = user_managed
254+
is_owner = false
249255
same_team = true
250256

251257
struct GroupMembershipInfo extends MembershipInfo
@@ -544,8 +550,8 @@ union SharePathError
544550
inside_public_folder
545551
"A folder inside a public folder can't be shared this way. Use a public
546552
link instead."
547-
already_shared
548-
"Folder is already shared."
553+
already_shared SharedFolderMetadata
554+
"Folder is already shared. Contains metadata about the existing shared folder."
549555
invalid_path
550556
"Path is not valid."
551557
is_osx_package
@@ -575,14 +581,14 @@ route check_share_job_status(async.PollArg, ShareFolderJobStatus, async.PollErro
575581

576582
Apps must have full Dropbox access to use this endpoint."
577583

578-
# --
579-
580584
union JobStatus extends async.PollResultBase
581585
complete
582586
"The asynchronous job has finished."
583587
failed JobError
584588
"The asynchronous job returned an error."
585589

590+
# --
591+
586592
union SharedFolderMemberError
587593
invalid_dropbox_id
588594
"The target dropbox_id is invalid."
@@ -598,6 +604,8 @@ union JobError
598604
"Error occurred while performing :route:`unshare_folder` action."
599605
remove_folder_member_error RemoveFolderMemberError
600606
"Error occurred while performing :route:`remove_folder_member` action."
607+
relinquish_folder_membership_error RelinquishFolderMembershipError
608+
"Error occurred while performing :route:`relinquish_folder_membership` action."
601609
other*
602610

603611
route check_job_status(async.PollArg, JobStatus, async.PollError)
@@ -661,7 +669,7 @@ union TransferFolderError
661669
new_owner_not_a_member
662670
"The new designated owner is not currently a member of the shared folder."
663671
new_owner_unmounted
664-
"The new designated owner does not have the shared folder mounted."
672+
"The new designated owner has not added the folder to their Dropbox."
665673
new_owner_email_unverified
666674
"The new designated owner's e-mail address is unverified."
667675
team_folder
@@ -962,19 +970,24 @@ union UnmountFolderError
962970

963971
# --
964972

965-
route relinquish_folder_membership(RelinquishFolderMembershipArg, Void, RelinquishFolderMembershipError)
973+
route relinquish_folder_membership(RelinquishFolderMembershipArg, async.LaunchEmptyResult, RelinquishFolderMembershipError)
966974
"The current user relinquishes their membership in the designated shared
967975
folder and will no longer have access to the folder. A folder owner cannot
968976
relinquish membership in their own folder.
969977

978+
This will run synchronously if leave_a_copy is false, and asynchronously
979+
if leave_a_copy is true.
970980
Apps must have full Dropbox access to use this endpoint."
971981

972982
struct RelinquishFolderMembershipArg
973983
shared_folder_id common.SharedFolderId
974984
"The ID for the shared folder."
985+
leave_a_copy Boolean = false
986+
"Keep a copy of the folder's contents upon relinquishing membership."
975987

976988
example default
977989
shared_folder_id = "84528192421"
990+
leave_a_copy = false
978991

979992
union RelinquishFolderMembershipError
980993
access_error SharedFolderAccessError

stone_cfg.stone

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace stone_cfg
2+
3+
struct Route
4+
5+
auth String = "user"
6+
"The auth type for the route. Valid values: user, team, app, noauth."
7+
host String = "meta"
8+
"The server to make the request to. Valid values: meta, content,
9+
and notify."
10+
style String = "rpc"
11+
"The RPC format to use for the request. Valid values: rpc, download,
12+
and upload."
13+
alpha_group String?
14+
"Set if the route is part of an alpha release to the name of the
15+
feature."

team.stone

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ union TeamMemberStatus
2727
"User is no longer a member of the team, but the account can be un-suspended,
2828
re-establishing the user as a team member."
2929

30+
union TeamMembershipType
31+
full
32+
"User uses a license and has full access to team resources like the shared quota."
33+
limited
34+
"User does not have access to the shared quota and team admins have restricted administrative control."
3035

3136
struct MemberProfile
3237
"Basic member profile."
@@ -45,13 +50,16 @@ struct MemberProfile
4550
"The user's status as a member of a specific team."
4651
name users.Name
4752
"Representations for a person's name."
53+
membership_type TeamMembershipType
54+
"The user's membership type: full (normal team member) vs limited (does not use a license; no access to the team's shared quota)."
4855

4956
example default
5057
team_member_id = "dbmid:1234567"
5158
5259
email_verified = true
5360
status = active
5461
name = default
62+
membership_type = full
5563

5664
union UserSelectorArg
5765
"Argument for selecting a single user, either by team_member_id, external_id or email."

team_common.stone

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace team
1+
namespace team_common
22

33
alias GroupId = String
44

@@ -17,6 +17,29 @@ struct GroupSummary
1717
group_id = "g:e2db7665347abcd600000000001a2b3c"
1818
member_count = 10
1919

20+
21+
struct AlphaGroupSummary extends GroupSummary
22+
"Information about a group."
23+
24+
group_management_type GroupManagementType
25+
"Who is allowed to manage the group."
26+
27+
example default
28+
group_name = "Test group"
29+
group_id = "g:e2db7665347abcd600000000001a2b3c"
30+
member_count = 10
31+
group_management_type = user_managed
32+
33+
union GroupManagementType
34+
"The group type determines how a group is managed."
35+
36+
company_managed
37+
"A group which is managed by team admins only."
38+
user_managed
39+
"A group which is managed by selected users."
40+
other*
41+
42+
2043
union GroupType
2144
"The group type determines how a group is created and managed."
2245

0 commit comments

Comments
 (0)