files.com 1.0.32 → 1.0.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/files.com.gemspec +1 -0
- data/lib/files.com.rb +1 -0
- data/lib/files.com/models/behavior.rb +1 -1
- data/lib/files.com/models/file.rb +8 -8
- data/lib/files.com/models/file_action.rb +6 -6
- data/lib/files.com/models/file_comment.rb +1 -1
- data/lib/files.com/models/folder.rb +3 -3
- data/lib/files.com/models/lock.rb +5 -5
- data/lib/files.com/models/request.rb +1 -1
- data/lib/files.com/models/style.rb +5 -5
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 826a7f03949844aebecf585f0a51b79d77faaddeb353ce8f993f8d45e3d202b3
|
4
|
+
data.tar.gz: 9c4b4f2ecee43ec3e0606fbd80cb708918c8d0f6a4a3f8bdb096ee33098540ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5c94fcd236187d9ad215a2157b7cf2db9a57860ba77ea4c49e8b6abe1abda29e22d163f9aa4a599aa1257d3e0220bd495d24658950e364fceb76e1810d9e854
|
7
|
+
data.tar.gz: 24c4306f9ad6ad772da4355eba69e66d64da3054c83748a58ce46b5cf723d81fa6a4423129e9a8a47cbc7a2812ac50548bb9e8625af098818ff73c8160e5dfad
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.33
|
data/files.com.gemspec
CHANGED
@@ -13,6 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.required_ruby_version = ">= 2.3"
|
14
14
|
s.add_dependency 'faraday', '>= 0.12.0'
|
15
15
|
s.add_dependency 'net-http-persistent'
|
16
|
+
s.add_dependency 'addressable', "~> 2.7.0"
|
16
17
|
|
17
18
|
s.files = `find *`.split("\n").uniq.sort.reject(&:empty?)
|
18
19
|
s.executables = [ "files", "files-console" ]
|
data/lib/files.com.rb
CHANGED
@@ -137,7 +137,7 @@ module Files
|
|
137
137
|
raise InvalidParameterError.new("Bad parameter: behavior must be an String") if params.dig(:behavior) and !params.dig(:behavior).is_a?(String)
|
138
138
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
139
139
|
|
140
|
-
response, options = Api.send_request("/behaviors/folders/#{URI.
|
140
|
+
response, options = Api.send_request("/behaviors/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
|
141
141
|
response.data.map { |object| Behavior.new(object, options) }
|
142
142
|
end
|
143
143
|
|
@@ -832,7 +832,7 @@ module Files
|
|
832
832
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
833
833
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
834
834
|
|
835
|
-
Api.send_request("/files/#{URI.
|
835
|
+
Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :get, params, @options)
|
836
836
|
end
|
837
837
|
|
838
838
|
# Upload file
|
@@ -867,7 +867,7 @@ module Files
|
|
867
867
|
raise InvalidParameterError.new("Bad parameter: structure must be an String") if params.dig(:structure) and !params.dig(:structure).is_a?(String)
|
868
868
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
869
869
|
|
870
|
-
Api.send_request("/files/#{URI.
|
870
|
+
Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :post, params, @options)
|
871
871
|
end
|
872
872
|
|
873
873
|
# Parameters:
|
@@ -882,7 +882,7 @@ module Files
|
|
882
882
|
raise InvalidParameterError.new("Bad parameter: priority_color must be an String") if params.dig(:priority_color) and !params.dig(:priority_color).is_a?(String)
|
883
883
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
884
884
|
|
885
|
-
Api.send_request("/files/#{URI.
|
885
|
+
Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :patch, params, @options)
|
886
886
|
end
|
887
887
|
|
888
888
|
# Parameters:
|
@@ -894,7 +894,7 @@ module Files
|
|
894
894
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
895
895
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
896
896
|
|
897
|
-
Api.send_request("/files/#{URI.
|
897
|
+
Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :delete, params, @options)
|
898
898
|
end
|
899
899
|
|
900
900
|
def destroy(params = {})
|
@@ -925,7 +925,7 @@ module Files
|
|
925
925
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
926
926
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
927
927
|
|
928
|
-
response, options = Api.send_request("/files/#{URI.
|
928
|
+
response, options = Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
|
929
929
|
File.new(response.data, options)
|
930
930
|
end
|
931
931
|
|
@@ -960,7 +960,7 @@ module Files
|
|
960
960
|
raise InvalidParameterError.new("Bad parameter: structure must be an String") if params.dig(:structure) and !params.dig(:structure).is_a?(String)
|
961
961
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
962
962
|
|
963
|
-
response, options = Api.send_request("/files/#{URI.
|
963
|
+
response, options = Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
|
964
964
|
File.new(response.data, options)
|
965
965
|
end
|
966
966
|
|
@@ -975,7 +975,7 @@ module Files
|
|
975
975
|
raise InvalidParameterError.new("Bad parameter: priority_color must be an String") if params.dig(:priority_color) and !params.dig(:priority_color).is_a?(String)
|
976
976
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
977
977
|
|
978
|
-
response, options = Api.send_request("/files/#{URI.
|
978
|
+
response, options = Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :patch, params, options)
|
979
979
|
File.new(response.data, options)
|
980
980
|
end
|
981
981
|
|
@@ -987,7 +987,7 @@ module Files
|
|
987
987
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
988
988
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
989
989
|
|
990
|
-
response, _options = Api.send_request("/files/#{URI.
|
990
|
+
response, _options = Api.send_request("/files/#{Addressable::URI.encode_component(params[:path])}", :delete, params, options)
|
991
991
|
response.data
|
992
992
|
end
|
993
993
|
|
@@ -22,7 +22,7 @@ module Files
|
|
22
22
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
23
23
|
raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
|
24
24
|
|
25
|
-
Api.send_request("/file_actions/copy/#{URI.
|
25
|
+
Api.send_request("/file_actions/copy/#{Addressable::URI.encode_component(params[:path])}", :post, params, @options)
|
26
26
|
end
|
27
27
|
|
28
28
|
# Move file/folder
|
@@ -38,7 +38,7 @@ module Files
|
|
38
38
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
39
39
|
raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
|
40
40
|
|
41
|
-
Api.send_request("/file_actions/move/#{URI.
|
41
|
+
Api.send_request("/file_actions/move/#{Addressable::URI.encode_component(params[:path])}", :post, params, @options)
|
42
42
|
end
|
43
43
|
|
44
44
|
# Begin file upload
|
@@ -61,7 +61,7 @@ module Files
|
|
61
61
|
raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if params.dig(:restart) and !params.dig(:restart).is_a?(Integer)
|
62
62
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
63
63
|
|
64
|
-
Api.send_request("/file_actions/begin_upload/#{URI.
|
64
|
+
Api.send_request("/file_actions/begin_upload/#{Addressable::URI.encode_component(params[:path])}", :post, params, @options)
|
65
65
|
end
|
66
66
|
|
67
67
|
# Copy file/folder
|
@@ -76,7 +76,7 @@ module Files
|
|
76
76
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
77
77
|
raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
|
78
78
|
|
79
|
-
response, _options = Api.send_request("/file_actions/copy/#{URI.
|
79
|
+
response, _options = Api.send_request("/file_actions/copy/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
|
80
80
|
response.data
|
81
81
|
end
|
82
82
|
|
@@ -92,7 +92,7 @@ module Files
|
|
92
92
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
93
93
|
raise MissingParameterError.new("Parameter missing: destination") unless params.dig(:destination)
|
94
94
|
|
95
|
-
response, _options = Api.send_request("/file_actions/move/#{URI.
|
95
|
+
response, _options = Api.send_request("/file_actions/move/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
|
96
96
|
response.data
|
97
97
|
end
|
98
98
|
|
@@ -115,7 +115,7 @@ module Files
|
|
115
115
|
raise InvalidParameterError.new("Bad parameter: restart must be an Integer") if params.dig(:restart) and !params.dig(:restart).is_a?(Integer)
|
116
116
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
117
117
|
|
118
|
-
response, options = Api.send_request("/file_actions/begin_upload/#{URI.
|
118
|
+
response, options = Api.send_request("/file_actions/begin_upload/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
|
119
119
|
FilePartUpload.new(response.data, options)
|
120
120
|
end
|
121
121
|
end
|
@@ -96,7 +96,7 @@ module Files
|
|
96
96
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
97
97
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
98
98
|
|
99
|
-
response, options = Api.send_request("/file_comments/files/#{URI.
|
99
|
+
response, options = Api.send_request("/file_comments/files/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
|
100
100
|
response.data.map { |object| FileComment.new(object, options) }
|
101
101
|
end
|
102
102
|
|
@@ -317,7 +317,7 @@ module Files
|
|
317
317
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
318
318
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
319
319
|
|
320
|
-
Api.send_request("/folders/#{URI.
|
320
|
+
Api.send_request("/folders/#{Addressable::URI.encode_component(params[:path])}", :post, params, @options)
|
321
321
|
end
|
322
322
|
|
323
323
|
def save
|
@@ -353,7 +353,7 @@ module Files
|
|
353
353
|
raise InvalidParameterError.new("Bad parameter: search must be an String") if params.dig(:search) and !params.dig(:search).is_a?(String)
|
354
354
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
355
355
|
|
356
|
-
response, options = Api.send_request("/folders/#{URI.
|
356
|
+
response, options = Api.send_request("/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
|
357
357
|
response.data.map { |object| File.new(object, options) }
|
358
358
|
end
|
359
359
|
|
@@ -364,7 +364,7 @@ module Files
|
|
364
364
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
365
365
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
366
366
|
|
367
|
-
response, options = Api.send_request("/folders/#{URI.
|
367
|
+
response, options = Api.send_request("/folders/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
|
368
368
|
File.new(response.data, options)
|
369
369
|
end
|
370
370
|
end
|
@@ -102,7 +102,7 @@ module Files
|
|
102
102
|
raise InvalidParameterError.new("Bad parameter: timeout must be an Integer") if params.dig(:timeout) and !params.dig(:timeout).is_a?(Integer)
|
103
103
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
104
104
|
|
105
|
-
Api.send_request("/locks/#{URI.
|
105
|
+
Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :post, params, @options)
|
106
106
|
end
|
107
107
|
|
108
108
|
# Parameters:
|
@@ -116,7 +116,7 @@ module Files
|
|
116
116
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
117
117
|
raise MissingParameterError.new("Parameter missing: token") unless params.dig(:token)
|
118
118
|
|
119
|
-
Api.send_request("/locks/#{URI.
|
119
|
+
Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :delete, params, @options)
|
120
120
|
end
|
121
121
|
|
122
122
|
def destroy(params = {})
|
@@ -147,7 +147,7 @@ module Files
|
|
147
147
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
148
148
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
149
149
|
|
150
|
-
response, options = Api.send_request("/locks/#{URI.
|
150
|
+
response, options = Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
|
151
151
|
response.data.map { |object| Lock.new(object, options) }
|
152
152
|
end
|
153
153
|
|
@@ -162,7 +162,7 @@ module Files
|
|
162
162
|
raise InvalidParameterError.new("Bad parameter: timeout must be an Integer") if params.dig(:timeout) and !params.dig(:timeout).is_a?(Integer)
|
163
163
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
164
164
|
|
165
|
-
response, options = Api.send_request("/locks/#{URI.
|
165
|
+
response, options = Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
|
166
166
|
Lock.new(response.data, options)
|
167
167
|
end
|
168
168
|
|
@@ -176,7 +176,7 @@ module Files
|
|
176
176
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
177
177
|
raise MissingParameterError.new("Parameter missing: token") unless params.dig(:token)
|
178
178
|
|
179
|
-
response, _options = Api.send_request("/locks/#{URI.
|
179
|
+
response, _options = Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :delete, params, options)
|
180
180
|
response.data
|
181
181
|
end
|
182
182
|
|
@@ -143,7 +143,7 @@ module Files
|
|
143
143
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
144
144
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
145
145
|
|
146
|
-
response, options = Api.send_request("/requests/folders/#{URI.
|
146
|
+
response, options = Api.send_request("/requests/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
|
147
147
|
response.data.map { |object| Request.new(object, options) }
|
148
148
|
end
|
149
149
|
|
@@ -64,7 +64,7 @@ module Files
|
|
64
64
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
65
65
|
raise MissingParameterError.new("Parameter missing: file") unless params.dig(:file)
|
66
66
|
|
67
|
-
Api.send_request("/styles/#{URI.
|
67
|
+
Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :patch, params, @options)
|
68
68
|
end
|
69
69
|
|
70
70
|
def delete(params = {})
|
@@ -74,7 +74,7 @@ module Files
|
|
74
74
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
75
75
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
76
76
|
|
77
|
-
Api.send_request("/styles/#{URI.
|
77
|
+
Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :delete, params, @options)
|
78
78
|
end
|
79
79
|
|
80
80
|
def destroy(params = {})
|
@@ -93,7 +93,7 @@ module Files
|
|
93
93
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
94
94
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
95
95
|
|
96
|
-
response, options = Api.send_request("/styles/#{URI.
|
96
|
+
response, options = Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
|
97
97
|
Style.new(response.data, options)
|
98
98
|
end
|
99
99
|
|
@@ -110,7 +110,7 @@ module Files
|
|
110
110
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
111
111
|
raise MissingParameterError.new("Parameter missing: file") unless params.dig(:file)
|
112
112
|
|
113
|
-
response, options = Api.send_request("/styles/#{URI.
|
113
|
+
response, options = Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :patch, params, options)
|
114
114
|
Style.new(response.data, options)
|
115
115
|
end
|
116
116
|
|
@@ -120,7 +120,7 @@ module Files
|
|
120
120
|
raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
|
121
121
|
raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
|
122
122
|
|
123
|
-
response, _options = Api.send_request("/styles/#{URI.
|
123
|
+
response, _options = Api.send_request("/styles/#{Addressable::URI.encode_component(params[:path])}", :delete, params, options)
|
124
124
|
response.data
|
125
125
|
end
|
126
126
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: files.com
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: addressable
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.7.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.7.0
|
41
55
|
description: The Files.com Ruby client.
|
42
56
|
email:
|
43
57
|
- support@files.com
|