files.com 1.2.43 → 1.2.45

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.43
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",
@@ -77,7 +77,12 @@
77
77
  "paths": [
78
78
  "file.txt"
79
79
  ],
80
- "bundlepaths": "example"
80
+ "bundlepaths": [
81
+ {
82
+ "recursive": true,
83
+ "path": "example"
84
+ }
85
+ ]
81
86
  }
82
87
  ```
83
88
 
@@ -119,7 +124,7 @@
119
124
  * `watermark_value` (object): Preview watermark settings applied to all bundle items. Uses the same keys as Behavior.value
120
125
  * `has_inbox` (boolean): Does this bundle have an associated inbox?
121
126
  * `paths` (array): A list of paths in this bundle. For performance reasons, this is not provided when listing bundles.
122
- * `bundlepaths` (BundlePath): A list of bundlepaths in this bundle. For performance reasons, this is not provided when listing bundles.
127
+ * `bundlepaths` (array): A list of bundlepaths in this bundle. For performance reasons, this is not provided when listing bundles.
123
128
  * `password` (string): Password for this bundle.
124
129
  * `form_field_set_id` (int64): Id of Form Field Set to use with this bundle
125
130
  * `create_snapshot` (boolean): If true, create a snapshot of this bundle's contents.
@@ -395,7 +400,12 @@ await bundle.update({
395
400
  "paths": [
396
401
  "file.txt"
397
402
  ],
398
- "bundlepaths": "example"
403
+ "bundlepaths": [
404
+ {
405
+ "recursive": true,
406
+ "path": "example"
407
+ }
408
+ ]
399
409
  }
400
410
  ```
401
411
 
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.43';
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;
@@ -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.trigger && !(0, _utils.isString)(params.trigger))) {
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: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
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.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
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: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
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.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
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: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
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.automation && !(0, _utils.isString)(params.automation))) {
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: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
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 = 52;
483
+ _context2.next = 54;
470
484
  break;
471
485
  }
472
486
  if (!_this.attributes.id) {
473
- _context2.next = 51;
487
+ _context2.next = 53;
474
488
  break;
475
489
  }
476
490
  params.id = _this.id;
477
- _context2.next = 52;
491
+ _context2.next = 54;
478
492
  break;
479
- case 51:
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 56:
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.trigger && !(0, _utils.isString)(params.trigger))) {
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: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
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.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
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: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
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.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
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: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
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.automation && !(0, _utils.isString)(params.automation))) {
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: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
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
- _context7.next = 44;
846
- return _Api.default.sendRequest('/automations', 'POST', params, options);
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 46:
871
+ case 48:
851
872
  case "end":
852
873
  return _context7.stop();
853
874
  }
@@ -296,7 +296,7 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
296
296
  (0, _defineProperty2.default)(this, "setPaths", function (value) {
297
297
  _this.attributes.paths = value;
298
298
  });
299
- // BundlePath # A list of bundlepaths in this bundle. For performance reasons, this is not provided when listing bundles.
299
+ // array # A list of bundlepaths in this bundle. For performance reasons, this is not provided when listing bundles.
300
300
  (0, _defineProperty2.default)(this, "getBundlepaths", function () {
301
301
  return _this.attributes.bundlepaths;
302
302
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.43",
3
+ "version": "1.2.45",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -5,7 +5,7 @@ const endpointPrefix = '/api/rest/v1'
5
5
  let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
- const version = '1.2.43'
8
+ const version = '1.2.45'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -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
  }
@@ -290,7 +290,7 @@ class Bundle {
290
290
  this.attributes.paths = value
291
291
  }
292
292
 
293
- // BundlePath # A list of bundlepaths in this bundle. For performance reasons, this is not provided when listing bundles.
293
+ // array # A list of bundlepaths in this bundle. For performance reasons, this is not provided when listing bundles.
294
294
  getBundlepaths = () => this.attributes.bundlepaths
295
295
 
296
296
  setBundlepaths = value => {