files.com 1.2.44 → 1.2.45
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 +7 -0
- package/lib/Files.js +1 -1
- package/lib/models/Automation.js +48 -27
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/Automation.js +17 -0
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.45
|
@@ -25,6 +25,7 @@
|
|
25
25
|
"name": "example",
|
26
26
|
"overwrite_files": true,
|
27
27
|
"path": "example",
|
28
|
+
"path_time_zone": "Eastern Time (US & Canada)",
|
28
29
|
"recurring_day": 25,
|
29
30
|
"schedule": "example",
|
30
31
|
"human_readable_schedule": "Triggered every Monday, Wednesday at 6:30 AM,\n 2:30 PM Eastern Time (US & Canada) TZ",
|
@@ -75,6 +76,7 @@
|
|
75
76
|
* `name` (string): Name for this automation.
|
76
77
|
* `overwrite_files` (boolean): If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten if they appear to be the same file size as the newly incoming file. Use the `:always_overwrite_size_matching_files` option to override this.
|
77
78
|
* `path` (string): Path on which this Automation runs. Supports globs, except on remote mounts. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
79
|
+
* `path_time_zone` (string): Timezone to use when rendering timestamps in paths.
|
78
80
|
* `recurring_day` (int64): If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
|
79
81
|
* `schedule` (object): If trigger is `custom_schedule`, Custom schedule description for when the automation should be run in json format.
|
80
82
|
* `human_readable_schedule` (string): If trigger is `custom_schedule`, Human readable Custom schedule description for when the automation should be run.
|
@@ -152,6 +154,7 @@ await Automation.create({
|
|
152
154
|
'ignore_locked_folders': true,
|
153
155
|
'name': "example",
|
154
156
|
'overwrite_files': true,
|
157
|
+
'path_time_zone': "Eastern Time (US & Canada)",
|
155
158
|
'trigger': "daily",
|
156
159
|
'trigger_actions': ["create"],
|
157
160
|
'value': {"limit":"1"},
|
@@ -182,6 +185,7 @@ await Automation.create({
|
|
182
185
|
* `ignore_locked_folders` (boolean): If true, the Lock Folders behavior will be disregarded for automated actions.
|
183
186
|
* `name` (string): Name for this automation.
|
184
187
|
* `overwrite_files` (boolean): If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten if they appear to be the same file size as the newly incoming file. Use the `:always_overwrite_size_matching_files` option to override this.
|
188
|
+
* `path_time_zone` (string): Timezone to use when rendering timestamps in paths.
|
185
189
|
* `trigger` (string): How this automation is triggered to run.
|
186
190
|
* `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
|
187
191
|
* `value` (object): A Hash of attributes specific to the automation type.
|
@@ -229,6 +233,7 @@ await automation.update({
|
|
229
233
|
'ignore_locked_folders': true,
|
230
234
|
'name': "example",
|
231
235
|
'overwrite_files': true,
|
236
|
+
'path_time_zone': "Eastern Time (US & Canada)",
|
232
237
|
'trigger': "daily",
|
233
238
|
'trigger_actions': ["create"],
|
234
239
|
'value': {"limit":"1"},
|
@@ -259,6 +264,7 @@ await automation.update({
|
|
259
264
|
* `ignore_locked_folders` (boolean): If true, the Lock Folders behavior will be disregarded for automated actions.
|
260
265
|
* `name` (string): Name for this automation.
|
261
266
|
* `overwrite_files` (boolean): If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten if they appear to be the same file size as the newly incoming file. Use the `:always_overwrite_size_matching_files` option to override this.
|
267
|
+
* `path_time_zone` (string): Timezone to use when rendering timestamps in paths.
|
262
268
|
* `trigger` (string): How this automation is triggered to run.
|
263
269
|
* `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
|
264
270
|
* `value` (object): A Hash of attributes specific to the automation type.
|
@@ -290,6 +296,7 @@ await automation.update({
|
|
290
296
|
"name": "example",
|
291
297
|
"overwrite_files": true,
|
292
298
|
"path": "example",
|
299
|
+
"path_time_zone": "Eastern Time (US & Canada)",
|
293
300
|
"recurring_day": 25,
|
294
301
|
"schedule": "example",
|
295
302
|
"human_readable_schedule": "Triggered every Monday, Wednesday at 6:30 AM,\n 2:30 PM Eastern Time (US & Canada) TZ",
|
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.45';
|
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
@@ -145,6 +145,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
145
145
|
(0, _defineProperty2.default)(this, "setPath", function (value) {
|
146
146
|
_this.attributes.path = value;
|
147
147
|
});
|
148
|
+
// string # Timezone to use when rendering timestamps in paths.
|
149
|
+
(0, _defineProperty2.default)(this, "getPathTimeZone", function () {
|
150
|
+
return _this.attributes.path_time_zone;
|
151
|
+
});
|
152
|
+
(0, _defineProperty2.default)(this, "setPathTimeZone", function (value) {
|
153
|
+
_this.attributes.path_time_zone = value;
|
154
|
+
});
|
148
155
|
// int64 # If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
|
149
156
|
(0, _defineProperty2.default)(this, "getRecurringDay", function () {
|
150
157
|
return _this.attributes.recurring_day;
|
@@ -319,6 +326,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
319
326
|
// ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
|
320
327
|
// name - string - Name for this automation.
|
321
328
|
// overwrite_files - boolean - If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten if they appear to be the same file size as the newly incoming file. Use the `:always_overwrite_size_matching_files` option to override this.
|
329
|
+
// path_time_zone - string - Timezone to use when rendering timestamps in paths.
|
322
330
|
// trigger - string - How this automation is triggered to run.
|
323
331
|
// 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
|
324
332
|
// value - object - A Hash of attributes specific to the automation type.
|
@@ -441,50 +449,56 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
441
449
|
}
|
442
450
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
443
451
|
case 38:
|
444
|
-
if (!(params.
|
452
|
+
if (!(params.path_time_zone && !(0, _utils.isString)(params.path_time_zone))) {
|
445
453
|
_context2.next = 40;
|
446
454
|
break;
|
447
455
|
}
|
448
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
456
|
+
throw new errors.InvalidParameterError("Bad parameter: path_time_zone must be of type String, received ".concat((0, _utils.getType)(params.path_time_zone)));
|
449
457
|
case 40:
|
450
|
-
if (!(params.
|
458
|
+
if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
|
451
459
|
_context2.next = 42;
|
452
460
|
break;
|
453
461
|
}
|
454
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
462
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
|
455
463
|
case 42:
|
456
|
-
if (!(params.
|
464
|
+
if (!(params.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
|
457
465
|
_context2.next = 44;
|
458
466
|
break;
|
459
467
|
}
|
460
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
468
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
|
461
469
|
case 44:
|
462
|
-
if (!(params.
|
470
|
+
if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
|
463
471
|
_context2.next = 46;
|
464
472
|
break;
|
465
473
|
}
|
466
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
474
|
+
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
|
467
475
|
case 46:
|
476
|
+
if (!(params.automation && !(0, _utils.isString)(params.automation))) {
|
477
|
+
_context2.next = 48;
|
478
|
+
break;
|
479
|
+
}
|
480
|
+
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
|
481
|
+
case 48:
|
468
482
|
if (params.id) {
|
469
|
-
_context2.next =
|
483
|
+
_context2.next = 54;
|
470
484
|
break;
|
471
485
|
}
|
472
486
|
if (!_this.attributes.id) {
|
473
|
-
_context2.next =
|
487
|
+
_context2.next = 53;
|
474
488
|
break;
|
475
489
|
}
|
476
490
|
params.id = _this.id;
|
477
|
-
_context2.next =
|
491
|
+
_context2.next = 54;
|
478
492
|
break;
|
479
|
-
case
|
493
|
+
case 53:
|
480
494
|
throw new errors.MissingParameterError('Parameter missing: id');
|
481
|
-
case 52:
|
482
|
-
_context2.next = 54;
|
483
|
-
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
484
495
|
case 54:
|
496
|
+
_context2.next = 56;
|
497
|
+
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
498
|
+
case 56:
|
485
499
|
response = _context2.sent;
|
486
500
|
return _context2.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
487
|
-
case
|
501
|
+
case 58:
|
488
502
|
case "end":
|
489
503
|
return _context2.stop();
|
490
504
|
}
|
@@ -707,6 +721,7 @@ _Automation = Automation;
|
|
707
721
|
// ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
|
708
722
|
// name - string - Name for this automation.
|
709
723
|
// overwrite_files - boolean - If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten if they appear to be the same file size as the newly incoming file. Use the `:always_overwrite_size_matching_files` option to override this.
|
724
|
+
// path_time_zone - string - Timezone to use when rendering timestamps in paths.
|
710
725
|
// trigger - string - How this automation is triggered to run.
|
711
726
|
// 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
|
712
727
|
// value - object - A Hash of attributes specific to the automation type.
|
@@ -818,36 +833,42 @@ _Automation = Automation;
|
|
818
833
|
}
|
819
834
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
820
835
|
case 34:
|
821
|
-
if (!(params.
|
836
|
+
if (!(params.path_time_zone && !(0, _utils.isString)(params.path_time_zone))) {
|
822
837
|
_context7.next = 36;
|
823
838
|
break;
|
824
839
|
}
|
825
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
840
|
+
throw new errors.InvalidParameterError("Bad parameter: path_time_zone must be of type String, received ".concat((0, _utils.getType)(params.path_time_zone)));
|
826
841
|
case 36:
|
827
|
-
if (!(params.
|
842
|
+
if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
|
828
843
|
_context7.next = 38;
|
829
844
|
break;
|
830
845
|
}
|
831
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
846
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
|
832
847
|
case 38:
|
833
|
-
if (!(params.
|
848
|
+
if (!(params.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
|
834
849
|
_context7.next = 40;
|
835
850
|
break;
|
836
851
|
}
|
837
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
852
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
|
838
853
|
case 40:
|
839
|
-
if (!(params.
|
854
|
+
if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
|
840
855
|
_context7.next = 42;
|
841
856
|
break;
|
842
857
|
}
|
843
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
858
|
+
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
|
844
859
|
case 42:
|
845
|
-
|
846
|
-
|
860
|
+
if (!(params.automation && !(0, _utils.isString)(params.automation))) {
|
861
|
+
_context7.next = 44;
|
862
|
+
break;
|
863
|
+
}
|
864
|
+
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
|
847
865
|
case 44:
|
866
|
+
_context7.next = 46;
|
867
|
+
return _Api.default.sendRequest('/automations', 'POST', params, options);
|
868
|
+
case 46:
|
848
869
|
response = _context7.sent;
|
849
870
|
return _context7.abrupt("return", new _Automation(response === null || response === void 0 ? void 0 : response.data, options));
|
850
|
-
case
|
871
|
+
case 48:
|
851
872
|
case "end":
|
852
873
|
return _context7.stop();
|
853
874
|
}
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
package/src/models/Automation.js
CHANGED
@@ -140,6 +140,13 @@ class Automation {
|
|
140
140
|
this.attributes.path = value
|
141
141
|
}
|
142
142
|
|
143
|
+
// string # Timezone to use when rendering timestamps in paths.
|
144
|
+
getPathTimeZone = () => this.attributes.path_time_zone
|
145
|
+
|
146
|
+
setPathTimeZone = value => {
|
147
|
+
this.attributes.path_time_zone = value
|
148
|
+
}
|
149
|
+
|
143
150
|
// int64 # If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
|
144
151
|
getRecurringDay = () => this.attributes.recurring_day
|
145
152
|
|
@@ -291,6 +298,7 @@ class Automation {
|
|
291
298
|
// ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
|
292
299
|
// name - string - Name for this automation.
|
293
300
|
// overwrite_files - boolean - If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten if they appear to be the same file size as the newly incoming file. Use the `:always_overwrite_size_matching_files` option to override this.
|
301
|
+
// path_time_zone - string - Timezone to use when rendering timestamps in paths.
|
294
302
|
// trigger - string - How this automation is triggered to run.
|
295
303
|
// 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
|
296
304
|
// value - object - A Hash of attributes specific to the automation type.
|
@@ -370,6 +378,10 @@ class Automation {
|
|
370
378
|
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
371
379
|
}
|
372
380
|
|
381
|
+
if (params.path_time_zone && !isString(params.path_time_zone)) {
|
382
|
+
throw new errors.InvalidParameterError(`Bad parameter: path_time_zone must be of type String, received ${getType(params.path_time_zone)}`)
|
383
|
+
}
|
384
|
+
|
373
385
|
if (params.trigger && !isString(params.trigger)) {
|
374
386
|
throw new errors.InvalidParameterError(`Bad parameter: trigger must be of type String, received ${getType(params.trigger)}`)
|
375
387
|
}
|
@@ -511,6 +523,7 @@ class Automation {
|
|
511
523
|
// ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
|
512
524
|
// name - string - Name for this automation.
|
513
525
|
// overwrite_files - boolean - If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten if they appear to be the same file size as the newly incoming file. Use the `:always_overwrite_size_matching_files` option to override this.
|
526
|
+
// path_time_zone - string - Timezone to use when rendering timestamps in paths.
|
514
527
|
// trigger - string - How this automation is triggered to run.
|
515
528
|
// 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
|
516
529
|
// value - object - A Hash of attributes specific to the automation type.
|
@@ -581,6 +594,10 @@ class Automation {
|
|
581
594
|
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
582
595
|
}
|
583
596
|
|
597
|
+
if (params.path_time_zone && !isString(params.path_time_zone)) {
|
598
|
+
throw new errors.InvalidParameterError(`Bad parameter: path_time_zone must be of type String, received ${getType(params.path_time_zone)}`)
|
599
|
+
}
|
600
|
+
|
584
601
|
if (params.trigger && !isString(params.trigger)) {
|
585
602
|
throw new errors.InvalidParameterError(`Bad parameter: trigger must be of type String, received ${getType(params.trigger)}`)
|
586
603
|
}
|