files.com 1.1.207 → 1.1.209
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +87 -34
- data/_VERSION +1 -1
- data/docs/folder.md +1 -1
- data/lib/files.com/models/folder.rb +1 -1
- data/lib/files.com/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68178822d907592200032431d45cb642e14fb43c69a90581dd5ba57f736a98ee
|
4
|
+
data.tar.gz: 4ef6c6c634a31505d20134df1cd55663efd6e205834686dbced284d5d1933468
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7b1227eaf4f216a59850eac06d26f94e0b22d57bd006e37a8523b74633abf9b9375044a7de2bceef5f7d6a6a70b31051c36074488631c0b8af06659fa6ec008
|
7
|
+
data.tar.gz: 789287b933acc3a43c4390fd47dc1e915d37f055fcdd8fcea2cec05d6f89db412247f7fe7d03b32ca80ece12840835c478b7804cb76679007a0304acd511167c
|
data/README.md
CHANGED
@@ -69,8 +69,14 @@ that user can access, and no access will be granted to site administration funct
|
|
69
69
|
```ruby title="Example Request"
|
70
70
|
Files.api_key = 'YOUR_API_KEY'
|
71
71
|
|
72
|
-
|
73
|
-
|
72
|
+
begin
|
73
|
+
# Alternatively, you can specify the API key on a per-request basis in the final parameter to any method or initializer.
|
74
|
+
Files::User.new(params, api_key: 'YOUR_API_KEY')
|
75
|
+
rescue Files::NotAuthenticatedError => e
|
76
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
77
|
+
rescue Files::Error => e
|
78
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
79
|
+
end
|
74
80
|
```
|
75
81
|
|
76
82
|
Don't forget to replace the placeholder, `YOUR_API_KEY`, with your actual API key.
|
@@ -95,7 +101,13 @@ password.
|
|
95
101
|
This returns a session object that can be used to authenticate SDK method calls.
|
96
102
|
|
97
103
|
```ruby title="Example Request"
|
98
|
-
|
104
|
+
begin
|
105
|
+
session = Files::Session.create(username: "username", password: "password")
|
106
|
+
rescue Files::NotAuthenticatedError => e
|
107
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
108
|
+
rescue Files::Error => e
|
109
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
110
|
+
end
|
99
111
|
```
|
100
112
|
|
101
113
|
#### Using a Session
|
@@ -104,14 +116,19 @@ Once a session has been created, you can store the session globally, use the ses
|
|
104
116
|
|
105
117
|
```ruby title="Example Requests"
|
106
118
|
## You may set the returned session to be used by default for subsequent requests.
|
107
|
-
Files.session =
|
119
|
+
Files.session = session
|
108
120
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
## You may also specify the session ID on a per-request basis in the final parameter to static methods.
|
113
|
-
Files::Group.list({}, session_id: session.id)
|
121
|
+
begin
|
122
|
+
# Alternatively, you can specify the session ID on a per-object basis in the second parameter to a model constructor.
|
123
|
+
user = Files::User.new(params, session_id: session.id)
|
114
124
|
|
125
|
+
# You may also specify the session ID on a per-request basis in the final parameter to static methods.
|
126
|
+
Files::Group.list({}, session_id: session.id)
|
127
|
+
rescue Files::NotAuthenticatedError => e
|
128
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
129
|
+
rescue Files::Error => e
|
130
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
131
|
+
end
|
115
132
|
```
|
116
133
|
|
117
134
|
#### Logging Out
|
@@ -119,7 +136,13 @@ Files::Group.list({}, session_id: session.id)
|
|
119
136
|
User sessions can be ended calling the `destroy` method on the `session` object.
|
120
137
|
|
121
138
|
```ruby title="Example Request"
|
122
|
-
|
139
|
+
begin
|
140
|
+
session.destroy()
|
141
|
+
rescue Files::NotAuthenticatedError => e
|
142
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
143
|
+
rescue Files::Error => e
|
144
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
145
|
+
end
|
123
146
|
```
|
124
147
|
|
125
148
|
## Configuration
|
@@ -216,10 +239,16 @@ The argument value is a Ruby hash that has a key of the resource field name to s
|
|
216
239
|
of either ```"asc"``` or ```"desc"``` to specify the sort order.
|
217
240
|
|
218
241
|
```ruby title="Sort Example"
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
242
|
+
begin
|
243
|
+
# users sorted by username
|
244
|
+
Files::User.list(
|
245
|
+
sort_by: { "username": "asc" }
|
246
|
+
)
|
247
|
+
rescue Files::NotAuthenticatedError => e
|
248
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
249
|
+
rescue Files::Error => e
|
250
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
251
|
+
end
|
223
252
|
```
|
224
253
|
|
225
254
|
### Filtering
|
@@ -246,33 +275,57 @@ and a passed in value to use in the filter comparison.
|
|
246
275
|
| `filter_lteq` | Range | Find resources that have a field value that is less than or equal to the passed in value. (i.e., FIELD_VALUE \<= PASS_IN_VALUE). |
|
247
276
|
|
248
277
|
```ruby title="Exact Filter Example"
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
278
|
+
begin
|
279
|
+
# non admin users
|
280
|
+
Files::User.list(
|
281
|
+
filter: { not_site_admin: true }
|
282
|
+
)
|
283
|
+
rescue Files::NotAuthenticatedError => e
|
284
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
285
|
+
rescue Files::Error => e
|
286
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
287
|
+
end
|
253
288
|
```
|
254
289
|
|
255
290
|
```ruby title="Range Filter Example"
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
291
|
+
begin
|
292
|
+
# users who haven't logged in since 2024-01-01
|
293
|
+
Files::User.list(
|
294
|
+
filter_gteq: { "last_login_at": "2024-01-01" }
|
295
|
+
)
|
296
|
+
rescue Files::NotAuthenticatedError => e
|
297
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
298
|
+
rescue Files::Error => e
|
299
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
300
|
+
end
|
260
301
|
```
|
261
302
|
|
262
303
|
```ruby title="Pattern Filter Example"
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
304
|
+
begin
|
305
|
+
# users whose usernames start with 'test'
|
306
|
+
Files::User.list(
|
307
|
+
filter_pre: { username: "test" }
|
308
|
+
)
|
309
|
+
rescue Files::NotAuthenticatedError => e
|
310
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
311
|
+
rescue Files::Error => e
|
312
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
313
|
+
end
|
267
314
|
```
|
268
315
|
|
269
316
|
```ruby title="Combination Filter with Sort Example"
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
317
|
+
begin
|
318
|
+
# users whose usernames start with 'test' and are not admins
|
319
|
+
Files::User.list(
|
320
|
+
filter_prefix: { username: "test" },
|
321
|
+
filter: { not_site_admin: true },
|
322
|
+
sort_by: { "username": "asc" }
|
323
|
+
)
|
324
|
+
rescue Files::NotAuthenticatedError => e
|
325
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
326
|
+
rescue Files::Error => e
|
327
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
328
|
+
end
|
276
329
|
```
|
277
330
|
|
278
331
|
## Errors
|
@@ -296,9 +349,9 @@ rescue for general `Files::Error` as a catch-all.
|
|
296
349
|
begin
|
297
350
|
session = Files::Session.create(username: "USERNAME", password: "BADPASSWORD")
|
298
351
|
rescue Files::NotAuthenticatedError => e
|
299
|
-
puts "
|
352
|
+
puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
|
300
353
|
rescue Files::Error => e
|
301
|
-
puts "
|
354
|
+
puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
|
302
355
|
end
|
303
356
|
```
|
304
357
|
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.209
|
data/docs/folder.md
CHANGED
@@ -113,7 +113,7 @@ Files::Folder.list_for(path,
|
|
113
113
|
* `path` (string): Required - Path to operate on.
|
114
114
|
* `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
|
115
115
|
* `sort_by` (object): Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
|
116
|
-
* `search` (string): If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be
|
116
|
+
* `search` (string): If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
|
117
117
|
* `search_all` (boolean): Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the web UI when running 'Search All Files'. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
|
118
118
|
* `with_previews` (boolean): Include file previews?
|
119
119
|
* `with_priority_color` (boolean): Include file priority color information?
|
@@ -482,7 +482,7 @@ module Files
|
|
482
482
|
# path (required) - string - Path to operate on.
|
483
483
|
# preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
|
484
484
|
# sort_by - object - Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
|
485
|
-
# search - string - If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be
|
485
|
+
# search - string - If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
|
486
486
|
# search_all - boolean - Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the web UI when running 'Search All Files'. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
|
487
487
|
# with_previews - boolean - Include file previews?
|
488
488
|
# with_priority_color - boolean - Include file priority color information?
|
data/lib/files.com/version.rb
CHANGED
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.1.
|
4
|
+
version: 1.1.209
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|