files.com 1.2.29 → 1.2.31
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/models/RemoteServer.md +22 -31
- package/docs/models/RemoteServerConfigurationFile.md +41 -21
- package/docs/models/Site.md +1 -0
- package/docs/models/User.md +4 -1
- package/lib/Files.js +1 -1
- package/lib/models/RemoteServer.js +20 -69
- package/lib/models/RemoteServerConfigurationFile.js +56 -26
- package/lib/models/User.js +8 -1
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/RemoteServer.js +4 -39
- package/src/models/RemoteServerConfigurationFile.js +44 -19
- package/src/models/User.js +8 -1
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.31
|
@@ -32,7 +32,7 @@
|
|
32
32
|
"rackspace_username": "rackspaceuser",
|
33
33
|
"rackspace_region": "dfw",
|
34
34
|
"rackspace_container": "my-container",
|
35
|
-
"auth_setup_link": "auth/:provider",
|
35
|
+
"auth_setup_link": "auth/:provider/redirect",
|
36
36
|
"auth_status": "in_setup",
|
37
37
|
"auth_account_name": "me@example.com",
|
38
38
|
"one_drive_account_type": "personal",
|
@@ -316,16 +316,9 @@ await RemoteServer.create({
|
|
316
316
|
const [remote_server] = await RemoteServer.list()
|
317
317
|
|
318
318
|
await remote_server.configuration_file({
|
319
|
-
'
|
320
|
-
'
|
321
|
-
'root': "example",
|
322
|
-
'hostname': "example",
|
323
|
-
'port': 1,
|
324
|
-
'status': "example",
|
325
|
-
'config_version': "example",
|
319
|
+
'permission_set': "example",
|
320
|
+
'root': "C:\\Users\\",
|
326
321
|
'private_key': "example",
|
327
|
-
'public_key': "example",
|
328
|
-
'server_host_key': "example",
|
329
322
|
'subdomain': "example",
|
330
323
|
})
|
331
324
|
```
|
@@ -333,34 +326,32 @@ await remote_server.configuration_file({
|
|
333
326
|
### Parameters
|
334
327
|
|
335
328
|
* `id` (int64): Required - Remote Server ID.
|
336
|
-
* `
|
337
|
-
* `
|
338
|
-
* `
|
339
|
-
* `
|
340
|
-
* `port` (int64): Incoming port for files agent connections
|
341
|
-
* `status` (string): either running or shutdown
|
342
|
-
* `config_version` (string): agent config version
|
343
|
-
* `private_key` (string): private key
|
344
|
-
* `public_key` (string): public key
|
345
|
-
* `server_host_key` (string):
|
346
|
-
* `subdomain` (string):
|
329
|
+
* `permission_set` (string): The permission set for the agent ['read_write', 'read_only', 'write_only']
|
330
|
+
* `root` (string): The root directory for the agent
|
331
|
+
* `private_key` (string): The private key for the agent
|
332
|
+
* `subdomain` (string): Files.com subdomain site name
|
347
333
|
|
348
334
|
### Example Response
|
349
335
|
|
350
336
|
```json
|
351
337
|
{
|
352
338
|
"id": 1,
|
353
|
-
"permission_set": "
|
339
|
+
"permission_set": "example",
|
354
340
|
"private_key": "example",
|
355
341
|
"subdomain": "example",
|
356
|
-
"root": "
|
357
|
-
"
|
358
|
-
"
|
359
|
-
"
|
360
|
-
"
|
361
|
-
"
|
362
|
-
"
|
363
|
-
"
|
342
|
+
"root": "C:\\Users\\",
|
343
|
+
"follow_links": true,
|
344
|
+
"prefer_protocol": "example",
|
345
|
+
"dns": "example",
|
346
|
+
"proxy_all_outbound": true,
|
347
|
+
"endpoint_override": "example",
|
348
|
+
"log_file": "example",
|
349
|
+
"log_level": "example",
|
350
|
+
"log_rotate_num": 1,
|
351
|
+
"log_rotate_size": 1,
|
352
|
+
"max_concurrent_jobs": 1,
|
353
|
+
"graceful_shutdown_timeout": 1,
|
354
|
+
"transfer_rate_limit": "example"
|
364
355
|
}
|
365
356
|
```
|
366
357
|
|
@@ -525,7 +516,7 @@ await remote_server.update({
|
|
525
516
|
"rackspace_username": "rackspaceuser",
|
526
517
|
"rackspace_region": "dfw",
|
527
518
|
"rackspace_container": "my-container",
|
528
|
-
"auth_setup_link": "auth/:provider",
|
519
|
+
"auth_setup_link": "auth/:provider/redirect",
|
529
520
|
"auth_status": "in_setup",
|
530
521
|
"auth_account_name": "me@example.com",
|
531
522
|
"one_drive_account_type": "personal",
|
@@ -5,29 +5,49 @@
|
|
5
5
|
```
|
6
6
|
{
|
7
7
|
"id": 1,
|
8
|
-
"permission_set": "
|
8
|
+
"permission_set": "example",
|
9
9
|
"private_key": "example",
|
10
10
|
"subdomain": "example",
|
11
|
-
"root": "
|
12
|
-
"
|
13
|
-
"
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
11
|
+
"root": "C:\\Users\\",
|
12
|
+
"follow_links": true,
|
13
|
+
"prefer_protocol": "example",
|
14
|
+
"dns": "example",
|
15
|
+
"proxy_all_outbound": true,
|
16
|
+
"endpoint_override": "example",
|
17
|
+
"log_file": "example",
|
18
|
+
"log_level": "example",
|
19
|
+
"log_rotate_num": 1,
|
20
|
+
"log_rotate_size": 1,
|
21
|
+
"max_concurrent_jobs": 1,
|
22
|
+
"graceful_shutdown_timeout": 1,
|
23
|
+
"transfer_rate_limit": "example"
|
19
24
|
}
|
20
25
|
```
|
21
26
|
|
22
|
-
* `id` (int64):
|
23
|
-
* `permission_set` (string):
|
24
|
-
* `private_key` (string): private key
|
25
|
-
* `subdomain` (string):
|
26
|
-
* `root` (string):
|
27
|
-
* `
|
28
|
-
* `
|
29
|
-
* `
|
30
|
-
* `
|
31
|
-
* `
|
32
|
-
* `
|
33
|
-
* `
|
27
|
+
* `id` (int64): The remote server ID of the agent
|
28
|
+
* `permission_set` (string): The permission set for the agent ['read_write', 'read_only', 'write_only']
|
29
|
+
* `private_key` (string): The private key for the agent
|
30
|
+
* `subdomain` (string): Files.com subdomain site name
|
31
|
+
* `root` (string): The root directory for the agent
|
32
|
+
* `follow_links` (boolean): Follow symlinks when traversing directories
|
33
|
+
* `prefer_protocol` (string): Preferred network protocol ['udp', 'tcp']
|
34
|
+
* `dns` (string): DNS lookup method ['auto','doh','system']
|
35
|
+
* `proxy_all_outbound` (boolean): Proxy all outbound traffic through files.com proxy server
|
36
|
+
* `endpoint_override` (string): Custom site endpoint URL
|
37
|
+
* `log_file` (string): Log file name and location
|
38
|
+
* `log_level` (string): Log level for the agent logs ['debug', 'info', 'warn', 'error', 'fatal']
|
39
|
+
* `log_rotate_num` (int64): Log route for agent logs. (default 5)
|
40
|
+
* `log_rotate_size` (int64): Log route size in MB for agent logs. (default 20MB)
|
41
|
+
* `max_concurrent_jobs` (int64): Maximum number of concurrent jobs (default CPU Count * 4)
|
42
|
+
* `graceful_shutdown_timeout` (int64): Graceful shutdown timeout in seconds
|
43
|
+
* `transfer_rate_limit` (string): File transfer (upload/download) rate limit
|
44
|
+
<limit>-<period>, with the given periods:
|
45
|
+
* 'S': second
|
46
|
+
* 'M': minute
|
47
|
+
* 'H': hour
|
48
|
+
* 'D': day
|
49
|
+
Examples:
|
50
|
+
* 5 requests/second: '5-S'
|
51
|
+
* 10 requests/minute: '10-M'
|
52
|
+
* 1000 requests/hour: '1000-H'
|
53
|
+
* 2000 requests/day: '2000-D'
|
package/docs/models/Site.md
CHANGED
@@ -248,6 +248,7 @@
|
|
248
248
|
"externally_managed": true,
|
249
249
|
"time_zone": "Pacific Time (US & Canada)",
|
250
250
|
"type_of_2fa": "yubi",
|
251
|
+
"type_of_2fa_for_display": "yubi",
|
251
252
|
"updated_at": "2000-01-01T01:00:00Z",
|
252
253
|
"user_root": "example",
|
253
254
|
"days_remaining_until_password_expire": 1,
|
package/docs/models/User.md
CHANGED
@@ -63,6 +63,7 @@
|
|
63
63
|
"externally_managed": true,
|
64
64
|
"time_zone": "Pacific Time (US & Canada)",
|
65
65
|
"type_of_2fa": "yubi",
|
66
|
+
"type_of_2fa_for_display": "yubi",
|
66
67
|
"user_root": "example",
|
67
68
|
"days_remaining_until_password_expire": 1,
|
68
69
|
"password_expire_at": "2000-01-01T01:00:00Z"
|
@@ -125,7 +126,8 @@
|
|
125
126
|
* `subscribe_to_newsletter` (boolean): Is the user subscribed to the newsletter?
|
126
127
|
* `externally_managed` (boolean): Is this user managed by a SsoStrategy?
|
127
128
|
* `time_zone` (string): User time zone
|
128
|
-
* `type_of_2fa` (string): Type(s) of 2FA methods in use. Will be either `sms`, `totp`, `u2f`, `yubi`, or multiple values sorted alphabetically and joined by an underscore.
|
129
|
+
* `type_of_2fa` (string): Type(s) of 2FA methods in use, for programmatic use. Will be either `sms`, `totp`, `u2f`, `yubi`, or multiple values sorted alphabetically and joined by an underscore. Does not specify whether user has more than one of a given method.
|
130
|
+
* `type_of_2fa_for_display` (string): Type(s) of 2FA methods in use, formatted for displaying in the UI. Unlike `type_of_2fa`, this value will make clear when a user has more than 1 of the same type of method.
|
129
131
|
* `user_root` (string): Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.) Note that this is not used for API, Desktop, or Web interface.
|
130
132
|
* `days_remaining_until_password_expire` (int64): Number of days remaining until password expires
|
131
133
|
* `password_expire_at` (date-time): Password expiration datetime
|
@@ -480,6 +482,7 @@ await user.update({
|
|
480
482
|
"externally_managed": true,
|
481
483
|
"time_zone": "Pacific Time (US & Canada)",
|
482
484
|
"type_of_2fa": "yubi",
|
485
|
+
"type_of_2fa_for_display": "yubi",
|
483
486
|
"user_root": "example",
|
484
487
|
"days_remaining_until_password_expire": 1,
|
485
488
|
"password_expire_at": "2000-01-01T01:00:00Z"
|
package/lib/Files.js
CHANGED
@@ -11,7 +11,7 @@ var endpointPrefix = '/api/rest/v1';
|
|
11
11
|
var apiKey;
|
12
12
|
var baseUrl = 'https://app.files.com';
|
13
13
|
var sessionId = null;
|
14
|
-
var version = '1.2.
|
14
|
+
var version = '1.2.31';
|
15
15
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
16
16
|
var logLevel = _Logger.LogLevel.INFO;
|
17
17
|
var debugRequest = false;
|
@@ -554,17 +554,10 @@ var RemoteServer = /*#__PURE__*/(0, _createClass2.default)(function RemoteServer
|
|
554
554
|
// Post local changes, check in, and download configuration file (used by some Remote Server integrations, such as the Files.com Agent)
|
555
555
|
//
|
556
556
|
// Parameters:
|
557
|
-
//
|
558
|
-
//
|
559
|
-
//
|
560
|
-
//
|
561
|
-
// port - int64 - Incoming port for files agent connections
|
562
|
-
// status - string - either running or shutdown
|
563
|
-
// config_version - string - agent config version
|
564
|
-
// private_key - string - private key
|
565
|
-
// public_key - string - public key
|
566
|
-
// server_host_key - string
|
567
|
-
// subdomain - string
|
557
|
+
// permission_set - string - The permission set for the agent ['read_write', 'read_only', 'write_only']
|
558
|
+
// root - string - The root directory for the agent
|
559
|
+
// private_key - string - The private key for the agent
|
560
|
+
// subdomain - string - Files.com subdomain site name
|
568
561
|
(0, _defineProperty2.default)(this, "configurationFile", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
569
562
|
var params,
|
570
563
|
response,
|
@@ -593,93 +586,51 @@ var RemoteServer = /*#__PURE__*/(0, _createClass2.default)(function RemoteServer
|
|
593
586
|
}
|
594
587
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
595
588
|
case 8:
|
596
|
-
if (!(params.api_token && !(0, _utils.isString)(params.api_token))) {
|
597
|
-
_context.next = 10;
|
598
|
-
break;
|
599
|
-
}
|
600
|
-
throw new errors.InvalidParameterError("Bad parameter: api_token must be of type String, received ".concat((0, _utils.getType)(params.api_token)));
|
601
|
-
case 10:
|
602
589
|
if (!(params.permission_set && !(0, _utils.isString)(params.permission_set))) {
|
603
|
-
_context.next =
|
590
|
+
_context.next = 10;
|
604
591
|
break;
|
605
592
|
}
|
606
593
|
throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params.permission_set)));
|
607
|
-
case
|
594
|
+
case 10:
|
608
595
|
if (!(params.root && !(0, _utils.isString)(params.root))) {
|
609
|
-
_context.next =
|
596
|
+
_context.next = 12;
|
610
597
|
break;
|
611
598
|
}
|
612
599
|
throw new errors.InvalidParameterError("Bad parameter: root must be of type String, received ".concat((0, _utils.getType)(params.root)));
|
613
|
-
case
|
614
|
-
if (!(params.hostname && !(0, _utils.isString)(params.hostname))) {
|
615
|
-
_context.next = 16;
|
616
|
-
break;
|
617
|
-
}
|
618
|
-
throw new errors.InvalidParameterError("Bad parameter: hostname must be of type String, received ".concat((0, _utils.getType)(params.hostname)));
|
619
|
-
case 16:
|
620
|
-
if (!(params.port && !(0, _utils.isInt)(params.port))) {
|
621
|
-
_context.next = 18;
|
622
|
-
break;
|
623
|
-
}
|
624
|
-
throw new errors.InvalidParameterError("Bad parameter: port must be of type Int, received ".concat((0, _utils.getType)(params.port)));
|
625
|
-
case 18:
|
626
|
-
if (!(params.status && !(0, _utils.isString)(params.status))) {
|
627
|
-
_context.next = 20;
|
628
|
-
break;
|
629
|
-
}
|
630
|
-
throw new errors.InvalidParameterError("Bad parameter: status must be of type String, received ".concat((0, _utils.getType)(params.status)));
|
631
|
-
case 20:
|
632
|
-
if (!(params.config_version && !(0, _utils.isString)(params.config_version))) {
|
633
|
-
_context.next = 22;
|
634
|
-
break;
|
635
|
-
}
|
636
|
-
throw new errors.InvalidParameterError("Bad parameter: config_version must be of type String, received ".concat((0, _utils.getType)(params.config_version)));
|
637
|
-
case 22:
|
600
|
+
case 12:
|
638
601
|
if (!(params.private_key && !(0, _utils.isString)(params.private_key))) {
|
639
|
-
_context.next =
|
602
|
+
_context.next = 14;
|
640
603
|
break;
|
641
604
|
}
|
642
605
|
throw new errors.InvalidParameterError("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(params.private_key)));
|
643
|
-
case
|
644
|
-
if (!(params.public_key && !(0, _utils.isString)(params.public_key))) {
|
645
|
-
_context.next = 26;
|
646
|
-
break;
|
647
|
-
}
|
648
|
-
throw new errors.InvalidParameterError("Bad parameter: public_key must be of type String, received ".concat((0, _utils.getType)(params.public_key)));
|
649
|
-
case 26:
|
650
|
-
if (!(params.server_host_key && !(0, _utils.isString)(params.server_host_key))) {
|
651
|
-
_context.next = 28;
|
652
|
-
break;
|
653
|
-
}
|
654
|
-
throw new errors.InvalidParameterError("Bad parameter: server_host_key must be of type String, received ".concat((0, _utils.getType)(params.server_host_key)));
|
655
|
-
case 28:
|
606
|
+
case 14:
|
656
607
|
if (!(params.subdomain && !(0, _utils.isString)(params.subdomain))) {
|
657
|
-
_context.next =
|
608
|
+
_context.next = 16;
|
658
609
|
break;
|
659
610
|
}
|
660
611
|
throw new errors.InvalidParameterError("Bad parameter: subdomain must be of type String, received ".concat((0, _utils.getType)(params.subdomain)));
|
661
|
-
case
|
612
|
+
case 16:
|
662
613
|
if (params.id) {
|
663
|
-
_context.next =
|
614
|
+
_context.next = 22;
|
664
615
|
break;
|
665
616
|
}
|
666
617
|
if (!_this.attributes.id) {
|
667
|
-
_context.next =
|
618
|
+
_context.next = 21;
|
668
619
|
break;
|
669
620
|
}
|
670
621
|
params.id = _this.id;
|
671
|
-
_context.next =
|
622
|
+
_context.next = 22;
|
672
623
|
break;
|
673
|
-
case
|
624
|
+
case 21:
|
674
625
|
throw new errors.MissingParameterError('Parameter missing: id');
|
675
|
-
case
|
676
|
-
_context.next =
|
626
|
+
case 22:
|
627
|
+
_context.next = 24;
|
677
628
|
return _Api.default.sendRequest("/remote_servers/".concat(encodeURIComponent(params.id), "/configuration_file"), 'POST', params, _this.options);
|
678
|
-
case
|
629
|
+
case 24:
|
679
630
|
response = _context.sent;
|
680
631
|
RemoteServerConfigurationFile = require('./RemoteServerConfigurationFile.js').default;
|
681
632
|
return _context.abrupt("return", new RemoteServerConfigurationFile(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
682
|
-
case
|
633
|
+
case 27:
|
683
634
|
case "end":
|
684
635
|
return _context.stop();
|
685
636
|
}
|
@@ -29,53 +29,83 @@ var RemoteServerConfigurationFile = /*#__PURE__*/(0, _createClass2.default)(func
|
|
29
29
|
(0, _defineProperty2.default)(this, "isLoaded", function () {
|
30
30
|
return !!_this.attributes.id;
|
31
31
|
});
|
32
|
-
// int64 #
|
32
|
+
// int64 # The remote server ID of the agent
|
33
33
|
(0, _defineProperty2.default)(this, "getId", function () {
|
34
34
|
return _this.attributes.id;
|
35
35
|
});
|
36
|
-
// string #
|
36
|
+
// string # The permission set for the agent ['read_write', 'read_only', 'write_only']
|
37
37
|
(0, _defineProperty2.default)(this, "getPermissionSet", function () {
|
38
38
|
return _this.attributes.permission_set;
|
39
39
|
});
|
40
|
-
// string # private key
|
40
|
+
// string # The private key for the agent
|
41
41
|
(0, _defineProperty2.default)(this, "getPrivateKey", function () {
|
42
42
|
return _this.attributes.private_key;
|
43
43
|
});
|
44
|
-
// string
|
44
|
+
// string # Files.com subdomain site name
|
45
45
|
(0, _defineProperty2.default)(this, "getSubdomain", function () {
|
46
46
|
return _this.attributes.subdomain;
|
47
47
|
});
|
48
|
-
// string #
|
48
|
+
// string # The root directory for the agent
|
49
49
|
(0, _defineProperty2.default)(this, "getRoot", function () {
|
50
50
|
return _this.attributes.root;
|
51
51
|
});
|
52
|
-
//
|
53
|
-
(0, _defineProperty2.default)(this, "
|
54
|
-
return _this.attributes.
|
52
|
+
// boolean # Follow symlinks when traversing directories
|
53
|
+
(0, _defineProperty2.default)(this, "getFollowLinks", function () {
|
54
|
+
return _this.attributes.follow_links;
|
55
55
|
});
|
56
|
-
//
|
57
|
-
(0, _defineProperty2.default)(this, "
|
58
|
-
return _this.attributes.
|
56
|
+
// string # Preferred network protocol ['udp', 'tcp']
|
57
|
+
(0, _defineProperty2.default)(this, "getPreferProtocol", function () {
|
58
|
+
return _this.attributes.prefer_protocol;
|
59
59
|
});
|
60
|
-
// string
|
61
|
-
(0, _defineProperty2.default)(this, "
|
62
|
-
return _this.attributes.
|
60
|
+
// string # DNS lookup method ['auto','doh','system']
|
61
|
+
(0, _defineProperty2.default)(this, "getDns", function () {
|
62
|
+
return _this.attributes.dns;
|
63
63
|
});
|
64
|
-
//
|
65
|
-
(0, _defineProperty2.default)(this, "
|
66
|
-
return _this.attributes.
|
64
|
+
// boolean # Proxy all outbound traffic through files.com proxy server
|
65
|
+
(0, _defineProperty2.default)(this, "getProxyAllOutbound", function () {
|
66
|
+
return _this.attributes.proxy_all_outbound;
|
67
67
|
});
|
68
|
-
// string #
|
69
|
-
(0, _defineProperty2.default)(this, "
|
70
|
-
return _this.attributes.
|
68
|
+
// string # Custom site endpoint URL
|
69
|
+
(0, _defineProperty2.default)(this, "getEndpointOverride", function () {
|
70
|
+
return _this.attributes.endpoint_override;
|
71
71
|
});
|
72
|
-
// string
|
73
|
-
(0, _defineProperty2.default)(this, "
|
74
|
-
return _this.attributes.
|
72
|
+
// string # Log file name and location
|
73
|
+
(0, _defineProperty2.default)(this, "getLogFile", function () {
|
74
|
+
return _this.attributes.log_file;
|
75
75
|
});
|
76
|
-
// string # agent
|
77
|
-
(0, _defineProperty2.default)(this, "
|
78
|
-
return _this.attributes.
|
76
|
+
// string # Log level for the agent logs ['debug', 'info', 'warn', 'error', 'fatal']
|
77
|
+
(0, _defineProperty2.default)(this, "getLogLevel", function () {
|
78
|
+
return _this.attributes.log_level;
|
79
|
+
});
|
80
|
+
// int64 # Log route for agent logs. (default 5)
|
81
|
+
(0, _defineProperty2.default)(this, "getLogRotateNum", function () {
|
82
|
+
return _this.attributes.log_rotate_num;
|
83
|
+
});
|
84
|
+
// int64 # Log route size in MB for agent logs. (default 20MB)
|
85
|
+
(0, _defineProperty2.default)(this, "getLogRotateSize", function () {
|
86
|
+
return _this.attributes.log_rotate_size;
|
87
|
+
});
|
88
|
+
// int64 # Maximum number of concurrent jobs (default CPU Count * 4)
|
89
|
+
(0, _defineProperty2.default)(this, "getMaxConcurrentJobs", function () {
|
90
|
+
return _this.attributes.max_concurrent_jobs;
|
91
|
+
});
|
92
|
+
// int64 # Graceful shutdown timeout in seconds
|
93
|
+
(0, _defineProperty2.default)(this, "getGracefulShutdownTimeout", function () {
|
94
|
+
return _this.attributes.graceful_shutdown_timeout;
|
95
|
+
});
|
96
|
+
// string # File transfer (upload/download) rate limit
|
97
|
+
// <limit>-<period>, with the given periods:
|
98
|
+
// * 'S': second
|
99
|
+
// * 'M': minute
|
100
|
+
// * 'H': hour
|
101
|
+
// * 'D': day
|
102
|
+
// Examples:
|
103
|
+
// * 5 requests/second: '5-S'
|
104
|
+
// * 10 requests/minute: '10-M'
|
105
|
+
// * 1000 requests/hour: '1000-H'
|
106
|
+
// * 2000 requests/day: '2000-D'
|
107
|
+
(0, _defineProperty2.default)(this, "getTransferRateLimit", function () {
|
108
|
+
return _this.attributes.transfer_rate_limit;
|
79
109
|
});
|
80
110
|
Object.entries(attributes).forEach(function (_ref) {
|
81
111
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
package/lib/models/User.js
CHANGED
@@ -422,13 +422,20 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
422
422
|
(0, _defineProperty2.default)(this, "setTimeZone", function (value) {
|
423
423
|
_this.attributes.time_zone = value;
|
424
424
|
});
|
425
|
-
// string # Type(s) of 2FA methods in use. Will be either `sms`, `totp`, `u2f`, `yubi`, or multiple values sorted alphabetically and joined by an underscore.
|
425
|
+
// string # Type(s) of 2FA methods in use, for programmatic use. Will be either `sms`, `totp`, `u2f`, `yubi`, or multiple values sorted alphabetically and joined by an underscore. Does not specify whether user has more than one of a given method.
|
426
426
|
(0, _defineProperty2.default)(this, "getTypeOf2fa", function () {
|
427
427
|
return _this.attributes.type_of_2fa;
|
428
428
|
});
|
429
429
|
(0, _defineProperty2.default)(this, "setTypeOf2fa", function (value) {
|
430
430
|
_this.attributes.type_of_2fa = value;
|
431
431
|
});
|
432
|
+
// string # Type(s) of 2FA methods in use, formatted for displaying in the UI. Unlike `type_of_2fa`, this value will make clear when a user has more than 1 of the same type of method.
|
433
|
+
(0, _defineProperty2.default)(this, "getTypeOf2faForDisplay", function () {
|
434
|
+
return _this.attributes.type_of_2fa_for_display;
|
435
|
+
});
|
436
|
+
(0, _defineProperty2.default)(this, "setTypeOf2faForDisplay", function (value) {
|
437
|
+
_this.attributes.type_of_2fa_for_display = value;
|
438
|
+
});
|
432
439
|
// string # Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.) Note that this is not used for API, Desktop, or Web interface.
|
433
440
|
(0, _defineProperty2.default)(this, "getUserRoot", function () {
|
434
441
|
return _this.attributes.user_root;
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
@@ -549,17 +549,10 @@ class RemoteServer {
|
|
549
549
|
// Post local changes, check in, and download configuration file (used by some Remote Server integrations, such as the Files.com Agent)
|
550
550
|
//
|
551
551
|
// Parameters:
|
552
|
-
//
|
553
|
-
//
|
554
|
-
//
|
555
|
-
//
|
556
|
-
// port - int64 - Incoming port for files agent connections
|
557
|
-
// status - string - either running or shutdown
|
558
|
-
// config_version - string - agent config version
|
559
|
-
// private_key - string - private key
|
560
|
-
// public_key - string - public key
|
561
|
-
// server_host_key - string
|
562
|
-
// subdomain - string
|
552
|
+
// permission_set - string - The permission set for the agent ['read_write', 'read_only', 'write_only']
|
553
|
+
// root - string - The root directory for the agent
|
554
|
+
// private_key - string - The private key for the agent
|
555
|
+
// subdomain - string - Files.com subdomain site name
|
563
556
|
configurationFile = async (params = {}) => {
|
564
557
|
if (!this.attributes.id) {
|
565
558
|
throw new errors.EmptyPropertyError('Current object has no id')
|
@@ -574,10 +567,6 @@ class RemoteServer {
|
|
574
567
|
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
|
575
568
|
}
|
576
569
|
|
577
|
-
if (params.api_token && !isString(params.api_token)) {
|
578
|
-
throw new errors.InvalidParameterError(`Bad parameter: api_token must be of type String, received ${getType(params.api_token)}`)
|
579
|
-
}
|
580
|
-
|
581
570
|
if (params.permission_set && !isString(params.permission_set)) {
|
582
571
|
throw new errors.InvalidParameterError(`Bad parameter: permission_set must be of type String, received ${getType(params.permission_set)}`)
|
583
572
|
}
|
@@ -586,34 +575,10 @@ class RemoteServer {
|
|
586
575
|
throw new errors.InvalidParameterError(`Bad parameter: root must be of type String, received ${getType(params.root)}`)
|
587
576
|
}
|
588
577
|
|
589
|
-
if (params.hostname && !isString(params.hostname)) {
|
590
|
-
throw new errors.InvalidParameterError(`Bad parameter: hostname must be of type String, received ${getType(params.hostname)}`)
|
591
|
-
}
|
592
|
-
|
593
|
-
if (params.port && !isInt(params.port)) {
|
594
|
-
throw new errors.InvalidParameterError(`Bad parameter: port must be of type Int, received ${getType(params.port)}`)
|
595
|
-
}
|
596
|
-
|
597
|
-
if (params.status && !isString(params.status)) {
|
598
|
-
throw new errors.InvalidParameterError(`Bad parameter: status must be of type String, received ${getType(params.status)}`)
|
599
|
-
}
|
600
|
-
|
601
|
-
if (params.config_version && !isString(params.config_version)) {
|
602
|
-
throw new errors.InvalidParameterError(`Bad parameter: config_version must be of type String, received ${getType(params.config_version)}`)
|
603
|
-
}
|
604
|
-
|
605
578
|
if (params.private_key && !isString(params.private_key)) {
|
606
579
|
throw new errors.InvalidParameterError(`Bad parameter: private_key must be of type String, received ${getType(params.private_key)}`)
|
607
580
|
}
|
608
581
|
|
609
|
-
if (params.public_key && !isString(params.public_key)) {
|
610
|
-
throw new errors.InvalidParameterError(`Bad parameter: public_key must be of type String, received ${getType(params.public_key)}`)
|
611
|
-
}
|
612
|
-
|
613
|
-
if (params.server_host_key && !isString(params.server_host_key)) {
|
614
|
-
throw new errors.InvalidParameterError(`Bad parameter: server_host_key must be of type String, received ${getType(params.server_host_key)}`)
|
615
|
-
}
|
616
|
-
|
617
582
|
if (params.subdomain && !isString(params.subdomain)) {
|
618
583
|
throw new errors.InvalidParameterError(`Bad parameter: subdomain must be of type String, received ${getType(params.subdomain)}`)
|
619
584
|
}
|
@@ -28,41 +28,66 @@ class RemoteServerConfigurationFile {
|
|
28
28
|
|
29
29
|
isLoaded = () => !!this.attributes.id
|
30
30
|
|
31
|
-
// int64 #
|
31
|
+
// int64 # The remote server ID of the agent
|
32
32
|
getId = () => this.attributes.id
|
33
33
|
|
34
|
-
// string #
|
34
|
+
// string # The permission set for the agent ['read_write', 'read_only', 'write_only']
|
35
35
|
getPermissionSet = () => this.attributes.permission_set
|
36
36
|
|
37
|
-
// string # private key
|
37
|
+
// string # The private key for the agent
|
38
38
|
getPrivateKey = () => this.attributes.private_key
|
39
39
|
|
40
|
-
// string
|
40
|
+
// string # Files.com subdomain site name
|
41
41
|
getSubdomain = () => this.attributes.subdomain
|
42
42
|
|
43
|
-
// string #
|
43
|
+
// string # The root directory for the agent
|
44
44
|
getRoot = () => this.attributes.root
|
45
45
|
|
46
|
-
//
|
47
|
-
|
46
|
+
// boolean # Follow symlinks when traversing directories
|
47
|
+
getFollowLinks = () => this.attributes.follow_links
|
48
48
|
|
49
|
-
//
|
50
|
-
|
49
|
+
// string # Preferred network protocol ['udp', 'tcp']
|
50
|
+
getPreferProtocol = () => this.attributes.prefer_protocol
|
51
51
|
|
52
|
-
// string
|
53
|
-
|
52
|
+
// string # DNS lookup method ['auto','doh','system']
|
53
|
+
getDns = () => this.attributes.dns
|
54
54
|
|
55
|
-
//
|
56
|
-
|
55
|
+
// boolean # Proxy all outbound traffic through files.com proxy server
|
56
|
+
getProxyAllOutbound = () => this.attributes.proxy_all_outbound
|
57
57
|
|
58
|
-
// string #
|
59
|
-
|
58
|
+
// string # Custom site endpoint URL
|
59
|
+
getEndpointOverride = () => this.attributes.endpoint_override
|
60
60
|
|
61
|
-
// string
|
62
|
-
|
61
|
+
// string # Log file name and location
|
62
|
+
getLogFile = () => this.attributes.log_file
|
63
63
|
|
64
|
-
// string # agent
|
65
|
-
|
64
|
+
// string # Log level for the agent logs ['debug', 'info', 'warn', 'error', 'fatal']
|
65
|
+
getLogLevel = () => this.attributes.log_level
|
66
|
+
|
67
|
+
// int64 # Log route for agent logs. (default 5)
|
68
|
+
getLogRotateNum = () => this.attributes.log_rotate_num
|
69
|
+
|
70
|
+
// int64 # Log route size in MB for agent logs. (default 20MB)
|
71
|
+
getLogRotateSize = () => this.attributes.log_rotate_size
|
72
|
+
|
73
|
+
// int64 # Maximum number of concurrent jobs (default CPU Count * 4)
|
74
|
+
getMaxConcurrentJobs = () => this.attributes.max_concurrent_jobs
|
75
|
+
|
76
|
+
// int64 # Graceful shutdown timeout in seconds
|
77
|
+
getGracefulShutdownTimeout = () => this.attributes.graceful_shutdown_timeout
|
78
|
+
|
79
|
+
// string # File transfer (upload/download) rate limit
|
80
|
+
// <limit>-<period>, with the given periods:
|
81
|
+
// * 'S': second
|
82
|
+
// * 'M': minute
|
83
|
+
// * 'H': hour
|
84
|
+
// * 'D': day
|
85
|
+
// Examples:
|
86
|
+
// * 5 requests/second: '5-S'
|
87
|
+
// * 10 requests/minute: '10-M'
|
88
|
+
// * 1000 requests/hour: '1000-H'
|
89
|
+
// * 2000 requests/day: '2000-D'
|
90
|
+
getTransferRateLimit = () => this.attributes.transfer_rate_limit
|
66
91
|
}
|
67
92
|
|
68
93
|
export default RemoteServerConfigurationFile
|
package/src/models/User.js
CHANGED
@@ -416,13 +416,20 @@ class User {
|
|
416
416
|
this.attributes.time_zone = value
|
417
417
|
}
|
418
418
|
|
419
|
-
// string # Type(s) of 2FA methods in use. Will be either `sms`, `totp`, `u2f`, `yubi`, or multiple values sorted alphabetically and joined by an underscore.
|
419
|
+
// string # Type(s) of 2FA methods in use, for programmatic use. Will be either `sms`, `totp`, `u2f`, `yubi`, or multiple values sorted alphabetically and joined by an underscore. Does not specify whether user has more than one of a given method.
|
420
420
|
getTypeOf2fa = () => this.attributes.type_of_2fa
|
421
421
|
|
422
422
|
setTypeOf2fa = value => {
|
423
423
|
this.attributes.type_of_2fa = value
|
424
424
|
}
|
425
425
|
|
426
|
+
// string # Type(s) of 2FA methods in use, formatted for displaying in the UI. Unlike `type_of_2fa`, this value will make clear when a user has more than 1 of the same type of method.
|
427
|
+
getTypeOf2faForDisplay = () => this.attributes.type_of_2fa_for_display
|
428
|
+
|
429
|
+
setTypeOf2faForDisplay = value => {
|
430
|
+
this.attributes.type_of_2fa_for_display = value
|
431
|
+
}
|
432
|
+
|
426
433
|
// string # Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.) Note that this is not used for API, Desktop, or Web interface.
|
427
434
|
getUserRoot = () => this.attributes.user_root
|
428
435
|
|