dropbox_api 0.1.12 β 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/Gemfile +5 -3
- data/README.md +7 -0
- data/TODO.md +3 -1
- data/api_coverage.md +67 -28
- data/dropbox_api.gemspec +2 -2
- data/lib/dropbox_api.rb +2 -0
- data/lib/dropbox_api/endpoints/files/get_metadata.rb +9 -1
- data/lib/dropbox_api/endpoints/rpc.rb +11 -3
- data/lib/dropbox_api/endpoints/sharing/list_file_members.rb +46 -0
- data/lib/dropbox_api/metadata/file.rb +1 -0
- data/lib/dropbox_api/results/shared_file_members.rb +19 -0
- data/lib/dropbox_api/version.rb +1 -1
- metadata +18 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 780f513dd7b43f5cc1756a6b85273eff0aed6fa4
|
4
|
+
data.tar.gz: 785c3510ce4fe958bc2d37be4558d0f04d49a313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bda74f73cd828bb31b3af641bd015848bafda4d6af67345f992c1a341e4b3b344da028e688db77769b1718aa2bc055187f89c5f632eb27b77511e274e6f9f27
|
7
|
+
data.tar.gz: 055adc5d1f0fb2d5b7d0c5aa597a48a9fde4429d776fda6d23707216c858b22be50939c5be0885cddc2c74b654defaac08c2ca7611f006f550796d909b23579f
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,6 +2,8 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
gem '
|
5
|
+
group :development do
|
6
|
+
# Documentation
|
7
|
+
gem 'yard-rspec', :git => "https://github.com/Jesus/yard-spec-plugin.git"
|
8
|
+
gem 'redcarpet'
|
9
|
+
end
|
data/README.md
CHANGED
@@ -139,7 +139,14 @@ Check out the
|
|
139
139
|
[method documentation](http://www.xuuso.com/dropbox_api/DropboxApi/Client.html#upload_by_chunks-instance_method)
|
140
140
|
to find out all available options.
|
141
141
|
|
142
|
+
## Dependencies
|
142
143
|
|
144
|
+
This gem depends on
|
145
|
+
[oauth2](https://github.com/oauth-xx/oauth2)
|
146
|
+
and
|
147
|
+
[faraday](https://github.com/lostisland/faraday).
|
148
|
+
|
149
|
+
It has official support for Ruby versions `1.9.x` and `2.x`.
|
143
150
|
|
144
151
|
## Development
|
145
152
|
|
data/TODO.md
CHANGED
data/api_coverage.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# @title API Implementation Coverage
|
2
2
|
|
3
|
-
**IMPORTANT: This document is work in progress. Information isn't accurate.**
|
4
|
-
|
5
3
|
The Dropbox API changes frequently, so you may find out that the feature that
|
6
4
|
you need is missing. This document indicates what endpoints have been
|
7
5
|
implemented.
|
@@ -10,63 +8,112 @@ Full moon means fully implemented. Half moon means that the basic functionality
|
|
10
8
|
of the endpoint has been implemented but some options may be missing. Guess
|
11
9
|
what new moon means.
|
12
10
|
|
13
|
-
##
|
11
|
+
## File properties
|
12
|
+
|
13
|
+
API call | Status
|
14
|
+
--- | :---:
|
15
|
+
`/properties/add` | π
|
16
|
+
`/properties/overwrite` | π
|
17
|
+
`/properties/remove` | π
|
18
|
+
`/properties/search` | π
|
19
|
+
`/properties/search/continue` | π
|
20
|
+
`/properties/update` | π
|
21
|
+
`/templates/add_for_user` | π
|
22
|
+
`/templates/get_for_user` | π
|
23
|
+
`/templates/list_for_user` | π
|
24
|
+
`/templates/remove_for_user` | π
|
25
|
+
`/templates/update_for_user` | π
|
26
|
+
|
27
|
+
## File requests
|
28
|
+
|
29
|
+
API call | Status
|
30
|
+
--- | :---:
|
31
|
+
`/create` | π
|
32
|
+
`/get` | π
|
33
|
+
`/list` | π
|
34
|
+
`/update` | π
|
35
|
+
|
36
|
+
## Files
|
14
37
|
|
15
38
|
API call | Status
|
16
39
|
--- | :---:
|
17
40
|
`/copy` | π
|
41
|
+
`/copy_batch` | π
|
42
|
+
`/copy_batch/check` | π
|
18
43
|
`/copy_reference/get` | π
|
19
44
|
`/copy_reference/save` | π
|
20
45
|
`/create_folder` | π
|
46
|
+
`/create_folder_batch` | π
|
47
|
+
`/create_folder_batch/check` | π
|
21
48
|
`/delete` | π
|
49
|
+
`/delete_batch` | π
|
50
|
+
`/delete_batch/check` | π
|
22
51
|
`/download` | π
|
52
|
+
`/download_zip` | π
|
23
53
|
`/get_metadata` | π
|
24
54
|
`/get_preview` | π
|
25
55
|
`/get_temporary_link` | π
|
56
|
+
`/get_temporary_upload_link` | π
|
26
57
|
`/get_thumbnail` | π
|
58
|
+
`/get_thumbnail_batch` | π
|
27
59
|
`/list_folder` | π
|
28
60
|
`/list_folder/continue` | π
|
29
61
|
`/list_folder/get_latest_cursor` | π
|
30
62
|
`/list_folder/longpoll` | π
|
31
63
|
`/list_revisions` | π
|
32
64
|
`/move` | π
|
33
|
-
`/
|
34
|
-
`/
|
35
|
-
`/
|
36
|
-
`/properties/remove` | π
|
37
|
-
`/properties/template/get` | π
|
38
|
-
`/properties/template/list` | π
|
39
|
-
`/properties/update` | π
|
65
|
+
`/move_batch` | π
|
66
|
+
`/move_batch/check` | π
|
67
|
+
`/permanently_delete` | π
|
40
68
|
`/restore` | π
|
41
69
|
`/save_url` | π
|
42
70
|
`/save_url/check_job_status` | π
|
43
71
|
`/search` | π
|
44
72
|
`/upload` | π
|
45
|
-
`/upload_session/append` |
|
73
|
+
`/upload_session/append` | alias?
|
46
74
|
`/upload_session/append_v2` | π
|
47
75
|
`/upload_session/finish` | π
|
48
76
|
`/upload_session/finish_batch` | π
|
49
77
|
`/upload_session/finish_batch/check` | π
|
50
78
|
`/upload_session/start` | π
|
51
79
|
|
52
|
-
##
|
80
|
+
## Paper
|
81
|
+
|
82
|
+
API call | Status
|
83
|
+
--- | :---:
|
84
|
+
`/docs/archive` | π
|
85
|
+
`/docs/create` | π
|
86
|
+
`/docs/download` | π
|
87
|
+
`/docs/folder_users/list` | π
|
88
|
+
`/docs/folder_users/list/continue` | π
|
89
|
+
`/docs/get_folder_info` | π
|
90
|
+
`/docs/list` | π
|
91
|
+
`/docs/list/continue` | π
|
92
|
+
`/docs/permanently_delete` | π
|
93
|
+
`/docs/sharing_policy/get` | π
|
94
|
+
`/docs/sharing_policy/set` | π
|
95
|
+
`/docs/update` | π
|
96
|
+
`/docs/users/add` | π
|
97
|
+
`/docs/users/list` | π
|
98
|
+
`/docs/users/list/continue` | π
|
99
|
+
`/docs/users/remove` | π
|
100
|
+
|
101
|
+
## Sharing
|
102
|
+
|
53
103
|
API call | Status
|
54
104
|
--- | :---:
|
55
105
|
`/add_file_member` | π
|
56
106
|
`/add_folder_member` | π
|
57
|
-
`/change_file_member_access` | π
|
58
107
|
`/check_job_status` | π
|
59
108
|
`/check_remove_member_job_status` | π
|
60
109
|
`/check_share_job_status` | π
|
61
|
-
`/create_shared_link` | π
|
62
110
|
`/create_shared_link_with_settings` | π
|
63
111
|
`/get_file_metadata` | π
|
64
112
|
`/get_file_metadata/batch` | π
|
65
113
|
`/get_folder_metadata` | π
|
66
114
|
`/get_shared_link_file` | π
|
67
115
|
`/get_shared_link_metadata` | π
|
68
|
-
`/
|
69
|
-
`/list_file_members` | π
|
116
|
+
`/list_file_members` | π
|
70
117
|
`/list_file_members/batch` | π
|
71
118
|
`/list_file_members/continue` | π
|
72
119
|
`/list_folder_members` | π
|
@@ -82,19 +129,20 @@ API call | Status
|
|
82
129
|
`/mount_folder` | π
|
83
130
|
`/relinquish_file_membership` | π
|
84
131
|
`/relinquish_folder_membership` | π
|
85
|
-
`/remove_file_member` | π
|
86
132
|
`/remove_file_member_2` | π
|
87
133
|
`/remove_folder_member` | π
|
88
134
|
`/revoke_shared_link` | π
|
135
|
+
`/set_access_inheritance` | π
|
89
136
|
`/share_folder` | π
|
90
137
|
`/transfer_folder` | π
|
91
138
|
`/unmount_folder` | π
|
92
139
|
`/unshare_file` | π
|
93
140
|
`/unshare_folder` | π
|
141
|
+
`/update_file_member` | π
|
94
142
|
`/update_folder_member` | π
|
95
143
|
`/update_folder_policy` | π
|
96
144
|
|
97
|
-
## Users
|
145
|
+
## Users
|
98
146
|
|
99
147
|
API call | Status
|
100
148
|
--- | :---:
|
@@ -103,17 +151,8 @@ API call | Status
|
|
103
151
|
`/get_current_account` | π
|
104
152
|
`/get_space_usage` | π
|
105
153
|
|
106
|
-
## File Requests namespace
|
107
|
-
|
108
|
-
API call | Status
|
109
|
-
--- | :---:
|
110
|
-
`/create` | π
|
111
|
-
`/get` | π
|
112
|
-
`/list` | π
|
113
|
-
`/update` | π
|
114
|
-
|
115
|
-
|
116
154
|
## Dropbox Business API
|
155
|
+
|
117
156
|
Unfortunately, none of the Dropbox Business endpoints have been implemented.
|
118
157
|
If this is a problem for you, please [open an
|
119
158
|
issue](https://github.com/Jesus/dropbox_api/issues/new).
|
data/dropbox_api.gemspec
CHANGED
@@ -25,6 +25,6 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency "vcr"
|
26
26
|
spec.add_development_dependency "webmock"
|
27
27
|
|
28
|
-
spec.add_dependency "oauth2", "
|
29
|
-
spec.add_dependency "faraday", "
|
28
|
+
spec.add_dependency "oauth2", ">= 1.1", "<= 1.4"
|
29
|
+
spec.add_dependency "faraday", ">= 0.8", "<= 0.15.2"
|
30
30
|
end
|
data/lib/dropbox_api.rb
CHANGED
@@ -119,6 +119,7 @@ require 'dropbox_api/results/save_url_job_status'
|
|
119
119
|
require 'dropbox_api/results/search/match'
|
120
120
|
require 'dropbox_api/results/search_result'
|
121
121
|
require 'dropbox_api/results/share_folder_launch'
|
122
|
+
require 'dropbox_api/results/shared_file_members'
|
122
123
|
require 'dropbox_api/results/shared_folder_members'
|
123
124
|
require 'dropbox_api/results/void_result'
|
124
125
|
require 'dropbox_api/results/upload_session_start'
|
@@ -164,6 +165,7 @@ require 'dropbox_api/endpoints/files/upload_session_append_v2'
|
|
164
165
|
require 'dropbox_api/endpoints/files/upload_session_finish'
|
165
166
|
|
166
167
|
require 'dropbox_api/endpoints/sharing/add_file_member'
|
168
|
+
require 'dropbox_api/endpoints/sharing/list_file_members'
|
167
169
|
require 'dropbox_api/endpoints/sharing/add_folder_member'
|
168
170
|
require 'dropbox_api/endpoints/sharing/list_folder_members'
|
169
171
|
require 'dropbox_api/endpoints/sharing/share_folder'
|
@@ -17,13 +17,21 @@ module DropboxApi::Endpoints::Files
|
|
17
17
|
# @param path [String] The path of a file or folder on Dropbox.
|
18
18
|
# @option options include_media_info [Boolean] If `true`, `media_info`
|
19
19
|
# is set for photo and video. The default for this field is `false`.
|
20
|
+
# @option options include_has_explicit_shared_members [Boolean] If `true`,
|
21
|
+
# the results will include a flag for each file indicating whether or
|
22
|
+
# not that file has any explicit members. The default for this field
|
23
|
+
# is `false`.
|
20
24
|
# @option options include_deleted [Boolean] If `true`,
|
21
25
|
# {DropboxApi::Metadata::Deleted} will be
|
22
26
|
# returned for deleted file or folder, otherwise
|
23
27
|
# {DropboxApi::Errors::NotFoundError}
|
24
28
|
# will be raised. The default for this field is `false`.
|
25
29
|
add_endpoint :get_metadata do |path, options = {}|
|
26
|
-
validate_options([
|
30
|
+
validate_options([
|
31
|
+
:include_media_info,
|
32
|
+
:include_deleted,
|
33
|
+
:include_has_explicit_shared_members
|
34
|
+
], options)
|
27
35
|
|
28
36
|
perform_request(options.merge({
|
29
37
|
:path => path
|
@@ -7,12 +7,20 @@ module DropboxApi::Endpoints
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def build_request(params)
|
10
|
-
|
11
|
-
headers = {
|
10
|
+
request_headers = {
|
12
11
|
'content-type' => 'application/json'
|
13
12
|
}
|
14
13
|
|
15
|
-
return
|
14
|
+
return request_body(params), request_headers
|
15
|
+
end
|
16
|
+
|
17
|
+
def request_body(params)
|
18
|
+
# This check is only required for compatibility with old JSON serializers
|
19
|
+
if params.nil?
|
20
|
+
'null'
|
21
|
+
else
|
22
|
+
JSON.dump(params)
|
23
|
+
end
|
16
24
|
end
|
17
25
|
end
|
18
26
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module DropboxApi::Endpoints::Sharing
|
2
|
+
class ListFileMembers < DropboxApi::Endpoints::Rpc
|
3
|
+
Method = :post
|
4
|
+
Path = "/2/sharing/list_file_members".freeze
|
5
|
+
ResultType = DropboxApi::Results::SharedFileMembers
|
6
|
+
ErrorType = DropboxApi::Errors::SharingFileAccessError
|
7
|
+
|
8
|
+
include DropboxApi::OptionsValidator
|
9
|
+
|
10
|
+
# Use to obtain the members who have been invited to a file, both
|
11
|
+
# inherited and uninherited members.
|
12
|
+
#
|
13
|
+
# Apps must have full Dropbox access to use this endpoint.
|
14
|
+
#
|
15
|
+
# @example List file members.
|
16
|
+
# client.list_file_members "1231273663"
|
17
|
+
#
|
18
|
+
# @example List file members, with detail of permission to make owner.
|
19
|
+
# client.list_file_members "1231273663", [:make_owner]
|
20
|
+
#
|
21
|
+
# @example List file members, using the path instead of file ID.
|
22
|
+
# client.list_file_members "/my/file.pdf"
|
23
|
+
#
|
24
|
+
# @param file_id [String] The ID for the shared file.
|
25
|
+
# @param actions [Array]
|
26
|
+
# This is an optional list of actions. The permissions for the actions
|
27
|
+
# requested will be included in the result.
|
28
|
+
# @option options include_inherited [Boolean] Whether to include members
|
29
|
+
# who only have access from a parent shared folder. The default for this
|
30
|
+
# field is `true`.
|
31
|
+
# @option options limit [Numeric] The maximum number of results that
|
32
|
+
# include members, groups and invitees to return per request. The default
|
33
|
+
# for this field is 100.
|
34
|
+
# @return [SharedFileMembers] Shared file user and group membership.
|
35
|
+
# @see Metadata::MemberActionList
|
36
|
+
add_endpoint :list_file_members do |file_id, actions = [], options = {}|
|
37
|
+
validate_options([:limit, :include_inherited], options)
|
38
|
+
options[:limit] ||= 100
|
39
|
+
|
40
|
+
perform_request options.merge({
|
41
|
+
:file => file_id,
|
42
|
+
:actions => DropboxApi::Metadata::MemberActionList.new(actions)
|
43
|
+
})
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -30,6 +30,7 @@ module DropboxApi::Metadata
|
|
30
30
|
field :size, Integer
|
31
31
|
field :content_hash, String, :optional
|
32
32
|
field :media_info, DropboxApi::Metadata::MediaInfo, :optional
|
33
|
+
field :has_explicit_shared_members, :boolean, :optional
|
33
34
|
|
34
35
|
def to_hash
|
35
36
|
super.merge(".tag" => "file")
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module DropboxApi::Results
|
2
|
+
class SharedFileMembers < DropboxApi::Results::Base
|
3
|
+
def users
|
4
|
+
@data["users"]
|
5
|
+
end
|
6
|
+
|
7
|
+
def groups
|
8
|
+
@data["groups"]
|
9
|
+
end
|
10
|
+
|
11
|
+
def invitees
|
12
|
+
@data["invitees"]
|
13
|
+
end
|
14
|
+
|
15
|
+
def cursor
|
16
|
+
@data["cursor"]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/dropbox_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dropbox_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JesΓΊs Burgos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07
|
11
|
+
date: 2018-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,36 +84,42 @@ dependencies:
|
|
84
84
|
name: oauth2
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.1'
|
90
|
+
- - "<="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '1.4'
|
90
93
|
type: :runtime
|
91
94
|
prerelease: false
|
92
95
|
version_requirements: !ruby/object:Gem::Requirement
|
93
96
|
requirements:
|
94
|
-
- - "
|
97
|
+
- - ">="
|
95
98
|
- !ruby/object:Gem::Version
|
96
99
|
version: '1.1'
|
100
|
+
- - "<="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '1.4'
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
104
|
name: faraday
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
100
106
|
requirements:
|
101
|
-
- - "
|
107
|
+
- - ">="
|
102
108
|
- !ruby/object:Gem::Version
|
103
109
|
version: '0.8'
|
104
|
-
- - "
|
110
|
+
- - "<="
|
105
111
|
- !ruby/object:Gem::Version
|
106
|
-
version:
|
112
|
+
version: 0.15.2
|
107
113
|
type: :runtime
|
108
114
|
prerelease: false
|
109
115
|
version_requirements: !ruby/object:Gem::Requirement
|
110
116
|
requirements:
|
111
|
-
- - "
|
117
|
+
- - ">="
|
112
118
|
- !ruby/object:Gem::Version
|
113
119
|
version: '0.8'
|
114
|
-
- - "
|
120
|
+
- - "<="
|
115
121
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
122
|
+
version: 0.15.2
|
117
123
|
description:
|
118
124
|
email:
|
119
125
|
- jburmac@gmail.com
|
@@ -178,6 +184,7 @@ files:
|
|
178
184
|
- lib/dropbox_api/endpoints/sharing/add_file_member.rb
|
179
185
|
- lib/dropbox_api/endpoints/sharing/add_folder_member.rb
|
180
186
|
- lib/dropbox_api/endpoints/sharing/create_shared_link_with_settings.rb
|
187
|
+
- lib/dropbox_api/endpoints/sharing/list_file_members.rb
|
181
188
|
- lib/dropbox_api/endpoints/sharing/list_folder_members.rb
|
182
189
|
- lib/dropbox_api/endpoints/sharing/list_shared_links.rb
|
183
190
|
- lib/dropbox_api/endpoints/sharing/share_folder.rb
|
@@ -296,6 +303,7 @@ files:
|
|
296
303
|
- lib/dropbox_api/results/search/match.rb
|
297
304
|
- lib/dropbox_api/results/search_result.rb
|
298
305
|
- lib/dropbox_api/results/share_folder_launch.rb
|
306
|
+
- lib/dropbox_api/results/shared_file_members.rb
|
299
307
|
- lib/dropbox_api/results/shared_folder_members.rb
|
300
308
|
- lib/dropbox_api/results/upload_session_start.rb
|
301
309
|
- lib/dropbox_api/results/void_result.rb
|