files.com 1.2.131 → 1.2.133
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.
- package/_VERSION +1 -1
- package/docs/models/Automation.md +4 -1
- package/docs/models/Site.md +2 -0
- package/docs/models/User.md +10 -3
- package/lib/Files.js +1 -1
- package/lib/models/Automation.js +8 -1
- package/lib/models/User.js +39 -18
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/Automation.js +8 -1
- package/src/models/User.js +20 -3
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.133
|
@@ -15,6 +15,7 @@
|
|
15
15
|
"destination"
|
16
16
|
],
|
17
17
|
"disabled": true,
|
18
|
+
"exclude_pattern": "example",
|
18
19
|
"flatten_destination_structure": true,
|
19
20
|
"group_ids": [
|
20
21
|
1,
|
@@ -71,6 +72,7 @@
|
|
71
72
|
* `destination_replace_to` (string): If set, this string will replace the value `destination_replace_from` in the destination filename. You can use special patterns here.
|
72
73
|
* `destinations` (array(string)): Destination Paths
|
73
74
|
* `disabled` (boolean): If true, this automation will not run.
|
75
|
+
* `exclude_pattern` (string): If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
|
74
76
|
* `flatten_destination_structure` (boolean): Normally copy and move automations that use globs will implicitly preserve the source folder structure in the destination. If this flag is `true`, the source folder structure will be flattened in the destination. This is useful for copying or moving files from multiple folders into a single destination folder.
|
75
77
|
* `group_ids` (array(int64)): IDs of Groups for the Automation (i.e. who to Request File from)
|
76
78
|
* `ignore_locked_folders` (boolean): If true, the Lock Folders behavior will be disregarded for automated actions.
|
@@ -87,7 +89,7 @@
|
|
87
89
|
* `schedule_days_of_week` (array(int64)): If trigger is `custom_schedule`, Custom schedule description for when the automation should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
|
88
90
|
* `schedule_times_of_day` (array(string)): If trigger is `custom_schedule`, Custom schedule description for when the automation should be run. Times of day in HH:MM format.
|
89
91
|
* `schedule_time_zone` (string): If trigger is `custom_schedule`, Custom schedule Time Zone for when the automation should be run.
|
90
|
-
* `source` (string): Source
|
92
|
+
* `source` (string): Source path. Supports globs, except on remote mounts.
|
91
93
|
* `sync_ids` (array(int64)): IDs of remote sync folder behaviors to run by this Automation
|
92
94
|
* `trigger_actions` (array(string)): If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
93
95
|
* `trigger` (string): How this automation is triggered to run.
|
@@ -294,6 +296,7 @@ await automation.update({
|
|
294
296
|
"destination"
|
295
297
|
],
|
296
298
|
"disabled": true,
|
299
|
+
"exclude_pattern": "example",
|
297
300
|
"flatten_destination_structure": true,
|
298
301
|
"group_ids": [
|
299
302
|
1,
|
package/docs/models/Site.md
CHANGED
@@ -157,6 +157,7 @@
|
|
157
157
|
"multiple_regions": true,
|
158
158
|
"read_only": true,
|
159
159
|
"root_path": "example",
|
160
|
+
"home_path": "example",
|
160
161
|
"sftp_insecure_ciphers": false,
|
161
162
|
"site_id": 1,
|
162
163
|
"ssl_required": true,
|
@@ -262,6 +263,7 @@
|
|
262
263
|
"type_of_2fa_for_display": "yubi",
|
263
264
|
"updated_at": "2000-01-01T01:00:00Z",
|
264
265
|
"user_root": "example",
|
266
|
+
"user_home": "example",
|
265
267
|
"days_remaining_until_password_expire": 1,
|
266
268
|
"password_expire_at": "2000-01-01T01:00:00Z"
|
267
269
|
},
|
package/docs/models/User.md
CHANGED
@@ -67,6 +67,7 @@
|
|
67
67
|
"type_of_2fa": "yubi",
|
68
68
|
"type_of_2fa_for_display": "yubi",
|
69
69
|
"user_root": "example",
|
70
|
+
"user_home": "example",
|
70
71
|
"days_remaining_until_password_expire": 1,
|
71
72
|
"password_expire_at": "2000-01-01T01:00:00Z"
|
72
73
|
}
|
@@ -132,7 +133,8 @@
|
|
132
133
|
* `time_zone` (string): User time zone
|
133
134
|
* `type_of_2fa` (string): Type(s) of 2FA methods in use, for programmatic use. Will be either `sms`, `totp`, `webauthn`, `yubi`, `email`, or multiple values sorted alphabetically and joined by an underscore. Does not specify whether user has more than one of a given method.
|
134
135
|
* `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.
|
135
|
-
* `user_root` (string): Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.
|
136
|
+
* `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.
|
137
|
+
* `user_home` (string): Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
136
138
|
* `days_remaining_until_password_expire` (int64): Number of days remaining until password expires
|
137
139
|
* `password_expire_at` (date-time): Password expiration datetime
|
138
140
|
* `avatar_file` (file): An image file for your user avatar.
|
@@ -226,6 +228,7 @@ await User.create({
|
|
226
228
|
'require_2fa': "always_require",
|
227
229
|
'time_zone': "Pacific Time (US & Canada)",
|
228
230
|
'user_root': "example",
|
231
|
+
'user_home': "example",
|
229
232
|
'username': "user",
|
230
233
|
})
|
231
234
|
```
|
@@ -277,7 +280,8 @@ await User.create({
|
|
277
280
|
* `subscribe_to_newsletter` (boolean): Is the user subscribed to the newsletter?
|
278
281
|
* `require_2fa` (string): 2FA required setting
|
279
282
|
* `time_zone` (string): User time zone
|
280
|
-
* `user_root` (string): Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.
|
283
|
+
* `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.
|
284
|
+
* `user_home` (string): Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
281
285
|
* `username` (string): Required - User's username
|
282
286
|
|
283
287
|
---
|
@@ -371,6 +375,7 @@ await user.update({
|
|
371
375
|
'require_2fa': "always_require",
|
372
376
|
'time_zone': "Pacific Time (US & Canada)",
|
373
377
|
'user_root': "example",
|
378
|
+
'user_home': "example",
|
374
379
|
'username': "user",
|
375
380
|
})
|
376
381
|
```
|
@@ -422,7 +427,8 @@ await user.update({
|
|
422
427
|
* `subscribe_to_newsletter` (boolean): Is the user subscribed to the newsletter?
|
423
428
|
* `require_2fa` (string): 2FA required setting
|
424
429
|
* `time_zone` (string): User time zone
|
425
|
-
* `user_root` (string): Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.
|
430
|
+
* `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.
|
431
|
+
* `user_home` (string): Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
426
432
|
* `username` (string): User's username
|
427
433
|
|
428
434
|
### Example Response
|
@@ -492,6 +498,7 @@ await user.update({
|
|
492
498
|
"type_of_2fa": "yubi",
|
493
499
|
"type_of_2fa_for_display": "yubi",
|
494
500
|
"user_root": "example",
|
501
|
+
"user_home": "example",
|
495
502
|
"days_remaining_until_password_expire": 1,
|
496
503
|
"password_expire_at": "2000-01-01T01:00:00Z"
|
497
504
|
}
|
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.133';
|
15
15
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
16
16
|
var logLevel = _Logger.LogLevel.INFO;
|
17
17
|
var debugRequest = false;
|
package/lib/models/Automation.js
CHANGED
@@ -96,6 +96,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
96
96
|
(0, _defineProperty2.default)(this, "setDisabled", function (value) {
|
97
97
|
_this.attributes.disabled = value;
|
98
98
|
});
|
99
|
+
// string # If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
|
100
|
+
(0, _defineProperty2.default)(this, "getExcludePattern", function () {
|
101
|
+
return _this.attributes.exclude_pattern;
|
102
|
+
});
|
103
|
+
(0, _defineProperty2.default)(this, "setExcludePattern", function (value) {
|
104
|
+
_this.attributes.exclude_pattern = value;
|
105
|
+
});
|
99
106
|
// boolean # Normally copy and move automations that use globs will implicitly preserve the source folder structure in the destination. If this flag is `true`, the source folder structure will be flattened in the destination. This is useful for copying or moving files from multiple folders into a single destination folder.
|
100
107
|
(0, _defineProperty2.default)(this, "getFlattenDestinationStructure", function () {
|
101
108
|
return _this.attributes.flatten_destination_structure;
|
@@ -208,7 +215,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
208
215
|
(0, _defineProperty2.default)(this, "setScheduleTimeZone", function (value) {
|
209
216
|
_this.attributes.schedule_time_zone = value;
|
210
217
|
});
|
211
|
-
// string # Source
|
218
|
+
// string # Source path. Supports globs, except on remote mounts.
|
212
219
|
(0, _defineProperty2.default)(this, "getSource", function () {
|
213
220
|
return _this.attributes.source;
|
214
221
|
});
|
package/lib/models/User.js
CHANGED
@@ -450,13 +450,20 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
450
450
|
(0, _defineProperty2.default)(this, "setTypeOf2faForDisplay", function (value) {
|
451
451
|
_this.attributes.type_of_2fa_for_display = value;
|
452
452
|
});
|
453
|
-
// string # Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.
|
453
|
+
// 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.
|
454
454
|
(0, _defineProperty2.default)(this, "getUserRoot", function () {
|
455
455
|
return _this.attributes.user_root;
|
456
456
|
});
|
457
457
|
(0, _defineProperty2.default)(this, "setUserRoot", function (value) {
|
458
458
|
_this.attributes.user_root = value;
|
459
459
|
});
|
460
|
+
// string # Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
461
|
+
(0, _defineProperty2.default)(this, "getUserHome", function () {
|
462
|
+
return _this.attributes.user_home;
|
463
|
+
});
|
464
|
+
(0, _defineProperty2.default)(this, "setUserHome", function (value) {
|
465
|
+
_this.attributes.user_home = value;
|
466
|
+
});
|
460
467
|
// int64 # Number of days remaining until password expires
|
461
468
|
(0, _defineProperty2.default)(this, "getDaysRemainingUntilPasswordExpire", function () {
|
462
469
|
return _this.attributes.days_remaining_until_password_expire;
|
@@ -733,7 +740,8 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
733
740
|
// subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
|
734
741
|
// require_2fa - string - 2FA required setting
|
735
742
|
// time_zone - string - User time zone
|
736
|
-
// user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.
|
743
|
+
// 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.
|
744
|
+
// user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
737
745
|
// username - string - User's username
|
738
746
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
739
747
|
var params,
|
@@ -912,32 +920,38 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
912
920
|
}
|
913
921
|
throw new errors.InvalidParameterError("Bad parameter: user_root must be of type String, received ".concat((0, _utils.getType)(params.user_root)));
|
914
922
|
case 58:
|
915
|
-
if (!(params.
|
923
|
+
if (!(params.user_home && !(0, _utils.isString)(params.user_home))) {
|
916
924
|
_context4.next = 60;
|
917
925
|
break;
|
918
926
|
}
|
919
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
927
|
+
throw new errors.InvalidParameterError("Bad parameter: user_home must be of type String, received ".concat((0, _utils.getType)(params.user_home)));
|
920
928
|
case 60:
|
929
|
+
if (!(params.username && !(0, _utils.isString)(params.username))) {
|
930
|
+
_context4.next = 62;
|
931
|
+
break;
|
932
|
+
}
|
933
|
+
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
|
934
|
+
case 62:
|
921
935
|
if (params.id) {
|
922
|
-
_context4.next =
|
936
|
+
_context4.next = 68;
|
923
937
|
break;
|
924
938
|
}
|
925
939
|
if (!_this.attributes.id) {
|
926
|
-
_context4.next =
|
940
|
+
_context4.next = 67;
|
927
941
|
break;
|
928
942
|
}
|
929
943
|
params.id = _this.id;
|
930
|
-
_context4.next =
|
944
|
+
_context4.next = 68;
|
931
945
|
break;
|
932
|
-
case
|
946
|
+
case 67:
|
933
947
|
throw new errors.MissingParameterError('Parameter missing: id');
|
934
|
-
case 66:
|
935
|
-
_context4.next = 68;
|
936
|
-
return _Api.default.sendRequest("/users/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
937
948
|
case 68:
|
949
|
+
_context4.next = 70;
|
950
|
+
return _Api.default.sendRequest("/users/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
951
|
+
case 70:
|
938
952
|
response = _context4.sent;
|
939
953
|
return _context4.abrupt("return", new User(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
940
|
-
case
|
954
|
+
case 72:
|
941
955
|
case "end":
|
942
956
|
return _context4.stop();
|
943
957
|
}
|
@@ -1199,7 +1213,8 @@ _User = User;
|
|
1199
1213
|
// subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
|
1200
1214
|
// require_2fa - string - 2FA required setting
|
1201
1215
|
// time_zone - string - User time zone
|
1202
|
-
// user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.
|
1216
|
+
// 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.
|
1217
|
+
// user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
1203
1218
|
// username (required) - string - User's username
|
1204
1219
|
(0, _defineProperty2.default)(User, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
1205
1220
|
var params,
|
@@ -1367,18 +1382,24 @@ _User = User;
|
|
1367
1382
|
}
|
1368
1383
|
throw new errors.InvalidParameterError("Bad parameter: user_root must be of type String, received ".concat((0, _utils.getType)(params.user_root)));
|
1369
1384
|
case 54:
|
1370
|
-
if (!(params.
|
1385
|
+
if (!(params.user_home && !(0, _utils.isString)(params.user_home))) {
|
1371
1386
|
_context9.next = 56;
|
1372
1387
|
break;
|
1373
1388
|
}
|
1374
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1389
|
+
throw new errors.InvalidParameterError("Bad parameter: user_home must be of type String, received ".concat((0, _utils.getType)(params.user_home)));
|
1375
1390
|
case 56:
|
1376
|
-
|
1377
|
-
|
1391
|
+
if (!(params.username && !(0, _utils.isString)(params.username))) {
|
1392
|
+
_context9.next = 58;
|
1393
|
+
break;
|
1394
|
+
}
|
1395
|
+
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
|
1378
1396
|
case 58:
|
1397
|
+
_context9.next = 60;
|
1398
|
+
return _Api.default.sendRequest('/users', 'POST', params, options);
|
1399
|
+
case 60:
|
1379
1400
|
response = _context9.sent;
|
1380
1401
|
return _context9.abrupt("return", new _User(response === null || response === void 0 ? void 0 : response.data, options));
|
1381
|
-
case
|
1402
|
+
case 62:
|
1382
1403
|
case "end":
|
1383
1404
|
return _context9.stop();
|
1384
1405
|
}
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
package/src/models/Automation.js
CHANGED
@@ -91,6 +91,13 @@ class Automation {
|
|
91
91
|
this.attributes.disabled = value
|
92
92
|
}
|
93
93
|
|
94
|
+
// string # If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.
|
95
|
+
getExcludePattern = () => this.attributes.exclude_pattern
|
96
|
+
|
97
|
+
setExcludePattern = value => {
|
98
|
+
this.attributes.exclude_pattern = value
|
99
|
+
}
|
100
|
+
|
94
101
|
// boolean # Normally copy and move automations that use globs will implicitly preserve the source folder structure in the destination. If this flag is `true`, the source folder structure will be flattened in the destination. This is useful for copying or moving files from multiple folders into a single destination folder.
|
95
102
|
getFlattenDestinationStructure = () => this.attributes.flatten_destination_structure
|
96
103
|
|
@@ -203,7 +210,7 @@ class Automation {
|
|
203
210
|
this.attributes.schedule_time_zone = value
|
204
211
|
}
|
205
212
|
|
206
|
-
// string # Source
|
213
|
+
// string # Source path. Supports globs, except on remote mounts.
|
207
214
|
getSource = () => this.attributes.source
|
208
215
|
|
209
216
|
setSource = value => {
|
package/src/models/User.js
CHANGED
@@ -444,13 +444,20 @@ class User {
|
|
444
444
|
this.attributes.type_of_2fa_for_display = value
|
445
445
|
}
|
446
446
|
|
447
|
-
// string # Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.
|
447
|
+
// 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.
|
448
448
|
getUserRoot = () => this.attributes.user_root
|
449
449
|
|
450
450
|
setUserRoot = value => {
|
451
451
|
this.attributes.user_root = value
|
452
452
|
}
|
453
453
|
|
454
|
+
// string # Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
455
|
+
getUserHome = () => this.attributes.user_home
|
456
|
+
|
457
|
+
setUserHome = value => {
|
458
|
+
this.attributes.user_home = value
|
459
|
+
}
|
460
|
+
|
454
461
|
// int64 # Number of days remaining until password expires
|
455
462
|
getDaysRemainingUntilPasswordExpire = () => this.attributes.days_remaining_until_password_expire
|
456
463
|
|
@@ -658,7 +665,8 @@ class User {
|
|
658
665
|
// subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
|
659
666
|
// require_2fa - string - 2FA required setting
|
660
667
|
// time_zone - string - User time zone
|
661
|
-
// user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.
|
668
|
+
// 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.
|
669
|
+
// user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
662
670
|
// username - string - User's username
|
663
671
|
update = async (params = {}) => {
|
664
672
|
if (!this.attributes.id) {
|
@@ -774,6 +782,10 @@ class User {
|
|
774
782
|
throw new errors.InvalidParameterError(`Bad parameter: user_root must be of type String, received ${getType(params.user_root)}`)
|
775
783
|
}
|
776
784
|
|
785
|
+
if (params.user_home && !isString(params.user_home)) {
|
786
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_home must be of type String, received ${getType(params.user_home)}`)
|
787
|
+
}
|
788
|
+
|
777
789
|
if (params.username && !isString(params.username)) {
|
778
790
|
throw new errors.InvalidParameterError(`Bad parameter: username must be of type String, received ${getType(params.username)}`)
|
779
791
|
}
|
@@ -938,7 +950,8 @@ class User {
|
|
938
950
|
// subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
|
939
951
|
// require_2fa - string - 2FA required setting
|
940
952
|
// time_zone - string - User time zone
|
941
|
-
// user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.
|
953
|
+
// 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.
|
954
|
+
// user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
942
955
|
// username (required) - string - User's username
|
943
956
|
static create = async (params = {}, options = {}) => {
|
944
957
|
if (!params.username) {
|
@@ -1045,6 +1058,10 @@ class User {
|
|
1045
1058
|
throw new errors.InvalidParameterError(`Bad parameter: user_root must be of type String, received ${getType(params.user_root)}`)
|
1046
1059
|
}
|
1047
1060
|
|
1061
|
+
if (params.user_home && !isString(params.user_home)) {
|
1062
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_home must be of type String, received ${getType(params.user_home)}`)
|
1063
|
+
}
|
1064
|
+
|
1048
1065
|
if (params.username && !isString(params.username)) {
|
1049
1066
|
throw new errors.InvalidParameterError(`Bad parameter: username must be of type String, received ${getType(params.username)}`)
|
1050
1067
|
}
|