dropbox_api 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/TODO.md +3 -6
- data/lib/dropbox_api.rb +3 -0
- data/lib/dropbox_api/endpoints/auth/token_revoke.rb +14 -0
- data/lib/dropbox_api/endpoints/files/delete.rb +13 -5
- data/lib/dropbox_api/endpoints/files/get_metadata.rb +6 -4
- data/lib/dropbox_api/endpoints/files/list_folder.rb +10 -7
- data/lib/dropbox_api/endpoints/files/list_folder_get_latest_cursor.rb +1 -1
- data/lib/dropbox_api/endpoints/files/list_revisions.rb +2 -2
- data/lib/dropbox_api/endpoints/files/permanently_delete.rb +28 -0
- data/lib/dropbox_api/endpoints/files/search.rb +7 -7
- data/lib/dropbox_api/endpoints/sharing/list_shared_links.rb +3 -3
- data/lib/dropbox_api/endpoints/sharing/share_folder.rb +12 -12
- data/lib/dropbox_api/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e7c47a22dce4e23deadb2344e7398865ff747c4
|
4
|
+
data.tar.gz: 29cb9bbbece2ff2fa58fe029b380660e13e79023
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f532b00a80f97e888b6b4913a0b57a25eb53b183a4a97a8e64255463924b57e79487b655784f7a332cad27bdb93694515f6166939929b197329eef3062b542c
|
7
|
+
data.tar.gz: 96be7b099622bff41b42186885dd9f4e0f89437042331e9f1500bd0a7e49afa827f691612df0280ca11113e722743995c86cfea792869a7dd236c22237c36a92
|
data/TODO.md
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
# Short term goals
|
2
2
|
|
3
|
-
-
|
3
|
+
- Update faraday version.
|
4
|
+
- Fix `@option` params in doc.
|
4
5
|
- Complete full [API coverage](api_coverage.md).
|
5
6
|
|
6
|
-
#
|
7
|
-
|
8
|
-
- Improve the API reference page, help here:
|
9
|
-
http://gnuu.org/2009/11/18/customizing-yard-templates/
|
10
|
-
- Supporting streams would be great.
|
7
|
+
# Worth looking at
|
11
8
|
- Add a layer to handle pagination, use `Enumerable`.
|
data/lib/dropbox_api.rb
CHANGED
@@ -134,6 +134,8 @@ require 'dropbox_api/endpoints/rpc_notify'
|
|
134
134
|
require 'dropbox_api/endpoints/content_download'
|
135
135
|
require 'dropbox_api/endpoints/content_upload'
|
136
136
|
|
137
|
+
require 'dropbox_api/endpoints/auth/token_revoke'
|
138
|
+
|
137
139
|
require 'dropbox_api/endpoints/files/copy'
|
138
140
|
require 'dropbox_api/endpoints/files/copy_reference_get'
|
139
141
|
require 'dropbox_api/endpoints/files/copy_reference_save'
|
@@ -151,6 +153,7 @@ require 'dropbox_api/endpoints/files/list_folder_longpoll'
|
|
151
153
|
require 'dropbox_api/endpoints/files/list_folder_get_latest_cursor'
|
152
154
|
require 'dropbox_api/endpoints/files/list_revisions'
|
153
155
|
require 'dropbox_api/endpoints/files/move'
|
156
|
+
require 'dropbox_api/endpoints/files/permanently_delete'
|
154
157
|
require 'dropbox_api/endpoints/files/restore'
|
155
158
|
require 'dropbox_api/endpoints/files/save_url'
|
156
159
|
require 'dropbox_api/endpoints/files/save_url_check_job_status'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module DropboxApi::Endpoints::Auth
|
2
|
+
class TokenRevoke < DropboxApi::Endpoints::Rpc
|
3
|
+
Method = :post
|
4
|
+
Path = "/2/auth/token/revoke".freeze
|
5
|
+
ResultType = DropboxApi::Results::VoidResult
|
6
|
+
ErrorType = nil
|
7
|
+
|
8
|
+
# Revoke the access token for the current account
|
9
|
+
#
|
10
|
+
add_endpoint :token_revoke do
|
11
|
+
perform_request(nil)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -5,18 +5,26 @@ module DropboxApi::Endpoints::Files
|
|
5
5
|
ResultType = DropboxApi::Metadata::Resource
|
6
6
|
ErrorType = DropboxApi::Errors::DeleteError
|
7
7
|
|
8
|
+
include DropboxApi::OptionsValidator
|
9
|
+
|
8
10
|
# Delete the file or folder at a given path.
|
9
11
|
#
|
10
12
|
# If the path is a folder, all its contents will be deleted too.
|
11
13
|
#
|
12
14
|
# A successful response indicates that the file or folder was deleted.
|
13
|
-
# The returned metadata will be the corresponding
|
14
|
-
#
|
15
|
-
#
|
15
|
+
# The returned metadata will be the corresponding
|
16
|
+
# {DropboxApi::Metadata::File} or {DropboxApi::Metadata::Folder} for the
|
17
|
+
# item at time of deletion, and not a {DropboxApi::Metadata::Deleted} object.
|
16
18
|
#
|
17
19
|
# @param path [String] Path in the user's Dropbox to delete.
|
18
|
-
|
19
|
-
|
20
|
+
# @option options parent_rev [String] Perform delete if given "rev"
|
21
|
+
# matches the existing file's latest "rev". This field does not support
|
22
|
+
# deleting a folder. If the given "rev" doesn't match, a
|
23
|
+
# {DropboxApi::Errors::FileConflictError} will be raised.
|
24
|
+
add_endpoint :delete do |path, options = {}|
|
25
|
+
validate_options([:parent_rev], options)
|
26
|
+
|
27
|
+
perform_request options.merge({
|
20
28
|
:path => path
|
21
29
|
})
|
22
30
|
end
|
@@ -15,11 +15,13 @@ module DropboxApi::Endpoints::Files
|
|
15
15
|
# `:pending` or `nil`.
|
16
16
|
#
|
17
17
|
# @param path [String] The path of a file or folder on Dropbox.
|
18
|
-
# @option include_media_info [Boolean] If `true`,
|
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 include_deleted [Boolean] If `true`,
|
21
|
-
#
|
22
|
-
#
|
20
|
+
# @option options include_deleted [Boolean] If `true`,
|
21
|
+
# {DropboxApi::Metadata::Deleted} will be
|
22
|
+
# returned for deleted file or folder, otherwise
|
23
|
+
# {DropboxApi::Errors::NotFoundError}
|
24
|
+
# will be raised. The default for this field is `false`.
|
23
25
|
add_endpoint :get_metadata do |path, options = {}|
|
24
26
|
validate_options([:include_media_info, :include_deleted], options)
|
25
27
|
|
@@ -10,14 +10,17 @@ module DropboxApi::Endpoints::Files
|
|
10
10
|
# Returns the contents of a folder.
|
11
11
|
#
|
12
12
|
# @param path [String] The path to the folder you want to read.
|
13
|
-
# @option recursive [Boolean] If `true`, the list folder operation
|
14
|
-
# applied recursively to all subfolders and the response will
|
15
|
-
# contents of all subfolders. The default for this field is
|
16
|
-
#
|
13
|
+
# @option options recursive [Boolean] If `true`, the list folder operation
|
14
|
+
# will be applied recursively to all subfolders and the response will
|
15
|
+
# contain contents of all subfolders. The default for this field is
|
16
|
+
# `false`.
|
17
|
+
# @option options include_media_info [Boolean] If `true`, media_info
|
17
18
|
# is set for photo and video. The default for this field is `false`.
|
18
|
-
# @option include_deleted [Boolean] If `true`,
|
19
|
-
#
|
20
|
-
#
|
19
|
+
# @option options include_deleted [Boolean] If `true`,
|
20
|
+
# {DropboxApi::Metadata::Deleted} will be
|
21
|
+
# returned for deleted file or folder, otherwise
|
22
|
+
# {DropboxApi::Errors::NotFoundError}
|
23
|
+
# will be raised. The default for this field is `false`.
|
21
24
|
add_endpoint :list_folder do |path, options = {}|
|
22
25
|
validate_options([
|
23
26
|
:recursive,
|
@@ -8,7 +8,7 @@ module DropboxApi::Endpoints::Files
|
|
8
8
|
include DropboxApi::OptionsValidator
|
9
9
|
|
10
10
|
# A way to quickly get a cursor for the folder's state. Unlike
|
11
|
-
# {DropboxApi::
|
11
|
+
# {DropboxApi::Client#list_folder}, this doesn't return any entries. This
|
12
12
|
# endpoint is for app which only needs to know about new files and
|
13
13
|
# modifications and doesn't need to know about files that already exist in
|
14
14
|
# Dropbox.
|
@@ -10,8 +10,8 @@ module DropboxApi::Endpoints::Files
|
|
10
10
|
# Return revisions of a file
|
11
11
|
#
|
12
12
|
# @param path [String] The path to file you want to see the revisions of.
|
13
|
-
# @option limit [Numeric] The maximum number of revision entries
|
14
|
-
# The default for this field is 10.
|
13
|
+
# @option options limit [Numeric] The maximum number of revision entries
|
14
|
+
# returned. The default for this field is 10.
|
15
15
|
add_endpoint :list_revisions do |path, options = {}|
|
16
16
|
validate_options([
|
17
17
|
:limit
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module DropboxApi::Endpoints::Files
|
2
|
+
class PermanentlyDelete < DropboxApi::Endpoints::Rpc
|
3
|
+
Method = :post
|
4
|
+
Path = "/2/files/permanently_delete".freeze
|
5
|
+
ResultType = DropboxApi::Results::VoidResult
|
6
|
+
ErrorType = DropboxApi::Errors::DeleteError
|
7
|
+
|
8
|
+
include DropboxApi::OptionsValidator
|
9
|
+
|
10
|
+
# Permanently delete the file or folder at a given path.
|
11
|
+
#
|
12
|
+
# See https://www.dropbox.com/en/help/40
|
13
|
+
#
|
14
|
+
# Note: This endpoint is only available for Dropbox Business apps.
|
15
|
+
#
|
16
|
+
# @param path [String] Path in the user's Dropbox to delete.
|
17
|
+
# @option options parent_rev [String] Perform delete if given "rev"
|
18
|
+
# matches the existing file's latest "rev". This field does not support
|
19
|
+
# deleting a folder.
|
20
|
+
add_endpoint :permanently_delete do |path, options = {}|
|
21
|
+
validate_options([:parent_rev], options)
|
22
|
+
|
23
|
+
perform_request options.merge({
|
24
|
+
:path => path
|
25
|
+
})
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -17,13 +17,13 @@ module DropboxApi::Endpoints::Files
|
|
17
17
|
# token is used for prefix matching (i.e. "bat c" matches "bat cave" but
|
18
18
|
# not "batman car").
|
19
19
|
# @param path [String] The path in the user's Dropbox to search.
|
20
|
-
# @option start [Numeric] The starting index within the search
|
21
|
-
# (used for paging). The default for this field is 0.
|
22
|
-
# @option max_results [Numeric] The maximum number of search
|
23
|
-
# return. The default for this field is 100.
|
24
|
-
# @option mode [:filename, :filename_and_content, :deleted_filename]
|
25
|
-
# search mode. Note that searching file content is only
|
26
|
-
# Dropbox Business accounts. The default is filename.
|
20
|
+
# @option options start [Numeric] The starting index within the search
|
21
|
+
# results (used for paging). The default for this field is 0.
|
22
|
+
# @option options max_results [Numeric] The maximum number of search
|
23
|
+
# results to return. The default for this field is 100.
|
24
|
+
# @option options mode [:filename, :filename_and_content, :deleted_filename]
|
25
|
+
# The search mode. Note that searching file content is only
|
26
|
+
# available for Dropbox Business accounts. The default is filename.
|
27
27
|
add_endpoint :search do |query, path = "", options = {}|
|
28
28
|
validate_options([
|
29
29
|
:start,
|
@@ -17,9 +17,9 @@ module DropboxApi::Endpoints::Sharing
|
|
17
17
|
# links to parent folders of the given path. Links to parent folders can
|
18
18
|
# be suppressed by setting direct_only to true.
|
19
19
|
#
|
20
|
-
# @option path [String]
|
21
|
-
# @option cursor [String] The cursor returned by your last call.
|
22
|
-
# @option direct_only [Boolean]
|
20
|
+
# @option options path [String]
|
21
|
+
# @option options cursor [String] The cursor returned by your last call.
|
22
|
+
# @option options direct_only [Boolean]
|
23
23
|
# @return [ListSharedLinksResult]
|
24
24
|
add_endpoint :list_shared_links do |options = {}|
|
25
25
|
validate_options([:path, :cursor, :direct_only], options)
|
@@ -11,7 +11,7 @@ module DropboxApi::Endpoints::Sharing
|
|
11
11
|
#
|
12
12
|
# Most sharing will be completed synchronously. Large folders will be
|
13
13
|
# completed asynchronously. To make testing the async case repeatable, set
|
14
|
-
# `
|
14
|
+
# `force_async`.
|
15
15
|
#
|
16
16
|
# If a ShareFolderLaunch.async_job_id is returned, you'll need to call
|
17
17
|
# check_share_job_status until the action completes to get the metadata
|
@@ -21,18 +21,18 @@ module DropboxApi::Endpoints::Sharing
|
|
21
21
|
#
|
22
22
|
# @param path [String] The path to the folder to share. If it does not
|
23
23
|
# exist, then a new one is created.
|
24
|
-
# @option member_policy [:anyone, :team] Who can be a member of
|
25
|
-
# folder. Only applicable if the current user is on a team.
|
26
|
-
# is `:anyone`.
|
27
|
-
# @option acl_update_policy [:owner, :editors] Who can add and
|
28
|
-
# members of this shared folder. The default is `:owner`.
|
29
|
-
# @option shared_link_policy [:anyone, :members] The policy to
|
30
|
-
# shared links created for content inside this shared folder.
|
31
|
-
# current user must be on a team to set this policy to `:members`.
|
24
|
+
# @option options member_policy [:anyone, :team] Who can be a member of
|
25
|
+
# this shared folder. Only applicable if the current user is on a team.
|
26
|
+
# The default is `:anyone`.
|
27
|
+
# @option options acl_update_policy [:owner, :editors] Who can add and
|
28
|
+
# remove members of this shared folder. The default is `:owner`.
|
29
|
+
# @option options shared_link_policy [:anyone, :members] The policy to
|
30
|
+
# apply to shared links created for content inside this shared folder.
|
31
|
+
# The current user must be on a team to set this policy to `:members`.
|
32
32
|
# The default is `anyone`.
|
33
|
-
# @option force_async [Boolean] Whether to force the share to
|
34
|
-
# asynchronously. The default for this field is `false`.
|
35
|
-
# @return [ShareFolderLaunch] Shared folder metadata.
|
33
|
+
# @option options force_async [Boolean] Whether to force the share to
|
34
|
+
# happen asynchronously. The default for this field is `false`.
|
35
|
+
# @return [DropboxApi::Results::ShareFolderLaunch] Shared folder metadata.
|
36
36
|
add_endpoint :share_folder do |path, options = {}|
|
37
37
|
validate_options([
|
38
38
|
:member_policy,
|
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.12
|
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-
|
11
|
+
date: 2018-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- lib/dropbox_api/chunked_uploader.rb
|
142
142
|
- lib/dropbox_api/client.rb
|
143
143
|
- lib/dropbox_api/connection_builder.rb
|
144
|
+
- lib/dropbox_api/endpoints/auth/token_revoke.rb
|
144
145
|
- lib/dropbox_api/endpoints/base.rb
|
145
146
|
- lib/dropbox_api/endpoints/content_download.rb
|
146
147
|
- lib/dropbox_api/endpoints/content_upload.rb
|
@@ -162,6 +163,7 @@ files:
|
|
162
163
|
- lib/dropbox_api/endpoints/files/list_folder_longpoll.rb
|
163
164
|
- lib/dropbox_api/endpoints/files/list_revisions.rb
|
164
165
|
- lib/dropbox_api/endpoints/files/move.rb
|
166
|
+
- lib/dropbox_api/endpoints/files/permanently_delete.rb
|
165
167
|
- lib/dropbox_api/endpoints/files/restore.rb
|
166
168
|
- lib/dropbox_api/endpoints/files/save_url.rb
|
167
169
|
- lib/dropbox_api/endpoints/files/save_url_check_job_status.rb
|