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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e7c47a22dce4e23deadb2344e7398865ff747c4
4
- data.tar.gz: 29cb9bbbece2ff2fa58fe029b380660e13e79023
3
+ metadata.gz: 780f513dd7b43f5cc1756a6b85273eff0aed6fa4
4
+ data.tar.gz: 785c3510ce4fe958bc2d37be4558d0f04d49a313
5
5
  SHA512:
6
- metadata.gz: 5f532b00a80f97e888b6b4913a0b57a25eb53b183a4a97a8e64255463924b57e79487b655784f7a332cad27bdb93694515f6166939929b197329eef3062b542c
7
- data.tar.gz: 96be7b099622bff41b42186885dd9f4e0f89437042331e9f1500bd0a7e49afa827f691612df0280ca11113e722743995c86cfea792869a7dd236c22237c36a92
6
+ metadata.gz: 4bda74f73cd828bb31b3af641bd015848bafda4d6af67345f992c1a341e4b3b344da028e688db77769b1718aa2bc055187f89c5f632eb27b77511e274e6f9f27
7
+ data.tar.gz: 055adc5d1f0fb2d5b7d0c5aa597a48a9fde4429d776fda6d23707216c858b22be50939c5be0885cddc2c74b654defaac08c2ca7611f006f550796d909b23579f
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- # - 1.8.7
4
- # - 1.9.3
3
+ - 1.9.3
5
4
  - 2.2.6
6
5
  - 2.3.3
7
- - 2.4.0
6
+ - 2.4.4
7
+ - 2.5.1
data/Gemfile CHANGED
@@ -2,6 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- # Documentation
6
- gem 'yard-rspec', :git => "https://github.com/Jesus/yard-spec-plugin.git"
7
- gem 'redcarpet'
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
@@ -1,7 +1,9 @@
1
1
  # Short term goals
2
2
 
3
3
  - Update faraday version.
4
- - Fix `@option` params in doc.
4
+ - Review coverage document.
5
+ - Pick some endpoints to cover.
6
+ - Release!
5
7
  - Complete full [API coverage](api_coverage.md).
6
8
 
7
9
  # Worth looking at
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
- ## Files namespace
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
- `/permanently_delete` | πŸŒ‘
34
- `/properties/add` | πŸŒ‘
35
- `/properties/overwrite` | πŸŒ‘
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
- ## Sharing namespace
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
- `/get_shared_links` | πŸŒ‘
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 namespace
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", "~> 1.1"
29
- spec.add_dependency "faraday", "~> 0.8", "~> 0.9"
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([:include_media_info, :include_deleted], 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
- body = JSON.dump(params)
11
- headers = {
10
+ request_headers = {
12
11
  'content-type' => 'application/json'
13
12
  }
14
13
 
15
- return body, headers
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
@@ -1,3 +1,3 @@
1
1
  module DropboxApi
2
- VERSION = '0.1.12'.freeze
2
+ VERSION = '0.1.13'.freeze
3
3
  end
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.12
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-14 00:00:00.000000000 Z
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: '0.9'
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: '0.9'
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