files.com 1.2.50 → 1.2.52

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.50
1
+ 1.2.52
@@ -15,6 +15,7 @@
15
15
  "destination"
16
16
  ],
17
17
  "disabled": true,
18
+ "flatten_destination_structure": true,
18
19
  "group_ids": [
19
20
  1,
20
21
  2
@@ -69,6 +70,7 @@
69
70
  * `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.
70
71
  * `destinations` (array): Destination Paths
71
72
  * `disabled` (boolean): If true, this automation will not run.
73
+ * `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.
72
74
  * `group_ids` (array): IDs of Groups for the Automation (i.e. who to Request File from)
73
75
  * `ignore_locked_folders` (boolean): If true, the Lock Folders behavior will be disregarded for automated actions.
74
76
  * `interval` (string): If trigger is `daily`, this specifies how often to run this automation. One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
@@ -151,6 +153,7 @@ await Automation.create({
151
153
  'always_overwrite_size_matching_files': true,
152
154
  'description': "example",
153
155
  'disabled': true,
156
+ 'flatten_destination_structure': true,
154
157
  'ignore_locked_folders': true,
155
158
  'name': "example",
156
159
  'overwrite_files': true,
@@ -182,6 +185,7 @@ await Automation.create({
182
185
  * `always_overwrite_size_matching_files` (boolean): Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage.
183
186
  * `description` (string): Description for the this Automation.
184
187
  * `disabled` (boolean): If true, this automation will not run.
188
+ * `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.
185
189
  * `ignore_locked_folders` (boolean): If true, the Lock Folders behavior will be disregarded for automated actions.
186
190
  * `name` (string): Name for this automation.
187
191
  * `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.
@@ -230,6 +234,7 @@ await automation.update({
230
234
  'always_overwrite_size_matching_files': true,
231
235
  'description': "example",
232
236
  'disabled': true,
237
+ 'flatten_destination_structure': true,
233
238
  'ignore_locked_folders': true,
234
239
  'name': "example",
235
240
  'overwrite_files': true,
@@ -261,6 +266,7 @@ await automation.update({
261
266
  * `always_overwrite_size_matching_files` (boolean): Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage.
262
267
  * `description` (string): Description for the this Automation.
263
268
  * `disabled` (boolean): If true, this automation will not run.
269
+ * `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.
264
270
  * `ignore_locked_folders` (boolean): If true, the Lock Folders behavior will be disregarded for automated actions.
265
271
  * `name` (string): Name for this automation.
266
272
  * `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.
@@ -286,6 +292,7 @@ await automation.update({
286
292
  "destination"
287
293
  ],
288
294
  "disabled": true,
295
+ "flatten_destination_structure": true,
289
296
  "group_ids": [
290
297
  1,
291
298
  2
@@ -13,7 +13,8 @@
13
13
  "value": {
14
14
  "key": "example value"
15
15
  },
16
- "disable_parent_folder_behavior": true
16
+ "disable_parent_folder_behavior": true,
17
+ "recursive": true
17
18
  }
18
19
  ```
19
20
 
@@ -25,6 +26,7 @@
25
26
  * `description` (string): Description for this behavior.
26
27
  * `value` (object): Settings for this behavior. See the section above for an example value to provide here. Formatting is different for each Behavior type. May be sent as nested JSON or a single JSON-encoded string. If using XML encoding for the API call, this data must be sent as a JSON-encoded string.
27
28
  * `disable_parent_folder_behavior` (boolean): If true, the parent folder's behavior will be disabled for this folder.
29
+ * `recursive` (boolean): Is behavior recursive?
28
30
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
29
31
  * `attachment_delete` (boolean): If true, will delete the file stored in attachment
30
32
 
@@ -80,7 +82,7 @@ await Behavior.listFor(path, {
80
82
  * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `behavior`.
81
83
  * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `behavior`.
82
84
  * `path` (string): Required - Path to operate on.
83
- * `recursive` (string): Show behaviors above this path?
85
+ * `ancestor_behaviors` (string): Show behaviors above this path?
84
86
  * `behavior` (string): DEPRECATED: If set only shows folder behaviors matching this behavior type. Use `filter[behavior]` instead.
85
87
 
86
88
  ---
@@ -91,6 +93,7 @@ await Behavior.listFor(path, {
91
93
  await Behavior.create({
92
94
  'value': "{\"method\": \"GET\"}",
93
95
  'disable_parent_folder_behavior': true,
96
+ 'recursive': true,
94
97
  'name': "example",
95
98
  'description': "example",
96
99
  'path': "path",
@@ -104,6 +107,7 @@ await Behavior.create({
104
107
  * `value` (string): The value of the folder behavior. Can be an integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
105
108
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
106
109
  * `disable_parent_folder_behavior` (boolean): If true, the parent folder's behavior will be disabled for this folder.
110
+ * `recursive` (boolean): Is behavior recursive?
107
111
  * `name` (string): Name for this behavior.
108
112
  * `description` (string): Description for this behavior.
109
113
  * `path` (string): Required - Folder behaviors path.
@@ -144,6 +148,7 @@ const [behavior] = await Behavior.list()
144
148
  await behavior.update({
145
149
  'value': "{\"method\": \"GET\"}",
146
150
  'disable_parent_folder_behavior': true,
151
+ 'recursive': true,
147
152
  'name': "example",
148
153
  'description': "example",
149
154
  'behavior': "webhook",
@@ -158,6 +163,7 @@ await behavior.update({
158
163
  * `value` (string): The value of the folder behavior. Can be an integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
159
164
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
160
165
  * `disable_parent_folder_behavior` (boolean): If true, the parent folder's behavior will be disabled for this folder.
166
+ * `recursive` (boolean): Is behavior recursive?
161
167
  * `name` (string): Name for this behavior.
162
168
  * `description` (string): Description for this behavior.
163
169
  * `behavior` (string): Behavior type.
@@ -177,7 +183,8 @@ await behavior.update({
177
183
  "value": {
178
184
  "key": "example value"
179
185
  },
180
- "disable_parent_folder_behavior": true
186
+ "disable_parent_folder_behavior": true,
187
+ "recursive": true
181
188
  }
182
189
  ```
183
190
 
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.50';
14
+ var version = '1.2.52';
15
15
  var userAgent = "Files.com JavaScript SDK v".concat(version);
16
16
  var logLevel = _Logger.LogLevel.INFO;
17
17
  var debugRequest = false;
@@ -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
+ // 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
+ (0, _defineProperty2.default)(this, "getFlattenDestinationStructure", function () {
101
+ return _this.attributes.flatten_destination_structure;
102
+ });
103
+ (0, _defineProperty2.default)(this, "setFlattenDestinationStructure", function (value) {
104
+ _this.attributes.flatten_destination_structure = value;
105
+ });
99
106
  // array # IDs of Groups for the Automation (i.e. who to Request File from)
100
107
  (0, _defineProperty2.default)(this, "getGroupIds", function () {
101
108
  return _this.attributes.group_ids;
@@ -323,6 +330,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
323
330
  // always_overwrite_size_matching_files - boolean - Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage.
324
331
  // description - string - Description for the this Automation.
325
332
  // disabled - boolean - If true, this automation will not run.
333
+ // 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.
326
334
  // ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
327
335
  // name - string - Name for this automation.
328
336
  // 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.
@@ -718,6 +726,7 @@ _Automation = Automation;
718
726
  // always_overwrite_size_matching_files - boolean - Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage.
719
727
  // description - string - Description for the this Automation.
720
728
  // disabled - boolean - If true, this automation will not run.
729
+ // 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.
721
730
  // ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
722
731
  // name - string - Name for this automation.
723
732
  // 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.
@@ -89,6 +89,13 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
89
89
  (0, _defineProperty2.default)(this, "setDisableParentFolderBehavior", function (value) {
90
90
  _this.attributes.disable_parent_folder_behavior = value;
91
91
  });
92
+ // boolean # Is behavior recursive?
93
+ (0, _defineProperty2.default)(this, "getRecursive", function () {
94
+ return _this.attributes.recursive;
95
+ });
96
+ (0, _defineProperty2.default)(this, "setRecursive", function (value) {
97
+ _this.attributes.recursive = value;
98
+ });
92
99
  // file # Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
93
100
  (0, _defineProperty2.default)(this, "getAttachmentFile", function () {
94
101
  return _this.attributes.attachment_file;
@@ -107,6 +114,7 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
107
114
  // value - string - The value of the folder behavior. Can be an integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
108
115
  // attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
109
116
  // disable_parent_folder_behavior - boolean - If true, the parent folder's behavior will be disabled for this folder.
117
+ // recursive - boolean - Is behavior recursive?
110
118
  // name - string - Name for this behavior.
111
119
  // description - string - Description for this behavior.
112
120
  // behavior - string - Behavior type.
@@ -394,7 +402,7 @@ _Behavior = Behavior;
394
402
  // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `behavior`.
395
403
  // filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `behavior`.
396
404
  // path (required) - string - Path to operate on.
397
- // recursive - string - Show behaviors above this path?
405
+ // ancestor_behaviors - string - Show behaviors above this path?
398
406
  // behavior - string - DEPRECATED: If set only shows folder behaviors matching this behavior type. Use `filter[behavior]` instead.
399
407
  (0, _defineProperty2.default)(Behavior, "listFor", /*#__PURE__*/function () {
400
408
  var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(path) {
@@ -439,11 +447,11 @@ _Behavior = Behavior;
439
447
  }
440
448
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
441
449
  case 13:
442
- if (!(params.recursive && !(0, _utils.isString)(params.recursive))) {
450
+ if (!(params.ancestor_behaviors && !(0, _utils.isString)(params.ancestor_behaviors))) {
443
451
  _context6.next = 15;
444
452
  break;
445
453
  }
446
- throw new errors.InvalidParameterError("Bad parameter: recursive must be of type String, received ".concat((0, _utils.getType)(params.recursive)));
454
+ throw new errors.InvalidParameterError("Bad parameter: ancestor_behaviors must be of type String, received ".concat((0, _utils.getType)(params.ancestor_behaviors)));
447
455
  case 15:
448
456
  if (!(params.behavior && !(0, _utils.isString)(params.behavior))) {
449
457
  _context6.next = 17;
@@ -472,6 +480,7 @@ _Behavior = Behavior;
472
480
  // value - string - The value of the folder behavior. Can be an integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
473
481
  // attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
474
482
  // disable_parent_folder_behavior - boolean - If true, the parent folder's behavior will be disabled for this folder.
483
+ // recursive - boolean - Is behavior recursive?
475
484
  // name - string - Name for this behavior.
476
485
  // description - string - Description for this behavior.
477
486
  // path (required) - string - Folder behaviors path.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.50",
3
+ "version": "1.2.52",
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.50'
8
+ const version = '1.2.52'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -91,6 +91,13 @@ class Automation {
91
91
  this.attributes.disabled = value
92
92
  }
93
93
 
94
+ // 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
+ getFlattenDestinationStructure = () => this.attributes.flatten_destination_structure
96
+
97
+ setFlattenDestinationStructure = value => {
98
+ this.attributes.flatten_destination_structure = value
99
+ }
100
+
94
101
  // array # IDs of Groups for the Automation (i.e. who to Request File from)
95
102
  getGroupIds = () => this.attributes.group_ids
96
103
 
@@ -295,6 +302,7 @@ class Automation {
295
302
  // always_overwrite_size_matching_files - boolean - Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage.
296
303
  // description - string - Description for the this Automation.
297
304
  // disabled - boolean - If true, this automation will not run.
305
+ // 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.
298
306
  // ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
299
307
  // name - string - Name for this automation.
300
308
  // 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.
@@ -520,6 +528,7 @@ class Automation {
520
528
  // always_overwrite_size_matching_files - boolean - Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is `true` we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage.
521
529
  // description - string - Description for the this Automation.
522
530
  // disabled - boolean - If true, this automation will not run.
531
+ // 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.
523
532
  // ignore_locked_folders - boolean - If true, the Lock Folders behavior will be disregarded for automated actions.
524
533
  // name - string - Name for this automation.
525
534
  // 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.
@@ -84,6 +84,13 @@ class Behavior {
84
84
  this.attributes.disable_parent_folder_behavior = value
85
85
  }
86
86
 
87
+ // boolean # Is behavior recursive?
88
+ getRecursive = () => this.attributes.recursive
89
+
90
+ setRecursive = value => {
91
+ this.attributes.recursive = value
92
+ }
93
+
87
94
  // file # Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
88
95
  getAttachmentFile = () => this.attributes.attachment_file
89
96
 
@@ -102,6 +109,7 @@ class Behavior {
102
109
  // value - string - The value of the folder behavior. Can be an integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
103
110
  // attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
104
111
  // disable_parent_folder_behavior - boolean - If true, the parent folder's behavior will be disabled for this folder.
112
+ // recursive - boolean - Is behavior recursive?
105
113
  // name - string - Name for this behavior.
106
114
  // description - string - Description for this behavior.
107
115
  // behavior - string - Behavior type.
@@ -249,7 +257,7 @@ class Behavior {
249
257
  // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `behavior`.
250
258
  // filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `behavior`.
251
259
  // path (required) - string - Path to operate on.
252
- // recursive - string - Show behaviors above this path?
260
+ // ancestor_behaviors - string - Show behaviors above this path?
253
261
  // behavior - string - DEPRECATED: If set only shows folder behaviors matching this behavior type. Use `filter[behavior]` instead.
254
262
  static listFor = async (path, params = {}, options = {}) => {
255
263
  if (!isObject(params)) {
@@ -274,8 +282,8 @@ class Behavior {
274
282
  throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params.path)}`)
275
283
  }
276
284
 
277
- if (params.recursive && !isString(params.recursive)) {
278
- throw new errors.InvalidParameterError(`Bad parameter: recursive must be of type String, received ${getType(params.recursive)}`)
285
+ if (params.ancestor_behaviors && !isString(params.ancestor_behaviors)) {
286
+ throw new errors.InvalidParameterError(`Bad parameter: ancestor_behaviors must be of type String, received ${getType(params.ancestor_behaviors)}`)
279
287
  }
280
288
 
281
289
  if (params.behavior && !isString(params.behavior)) {
@@ -291,6 +299,7 @@ class Behavior {
291
299
  // value - string - The value of the folder behavior. Can be an integer, array, or hash depending on the type of folder behavior. See The Behavior Types section for example values for each type of behavior.
292
300
  // attachment_file - file - Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
293
301
  // disable_parent_folder_behavior - boolean - If true, the parent folder's behavior will be disabled for this folder.
302
+ // recursive - boolean - Is behavior recursive?
294
303
  // name - string - Name for this behavior.
295
304
  // description - string - Description for this behavior.
296
305
  // path (required) - string - Folder behaviors path.