files.com 1.0.252 → 1.0.253

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.252
1
+ 1.0.253
@@ -22,6 +22,10 @@
22
22
  "description": "example",
23
23
  "path": "example",
24
24
  "user_id": 1,
25
+ "sync_ids": [
26
+ 1,
27
+ 2
28
+ ],
25
29
  "user_ids": [
26
30
  1,
27
31
  2
@@ -56,6 +60,7 @@
56
60
  * `description` (string): Description for the this Automation.
57
61
  * `path` (string): Path on which this Automation runs. Supports globs. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
58
62
  * `user_id` (int64): User ID of the Automation's creator.
63
+ * `sync_ids` (array): IDs of remote sync folder behaviors to run by this Automation
59
64
  * `user_ids` (array): IDs of Users for the Automation (i.e. who to Request File from)
60
65
  * `group_ids` (array): IDs of Groups for the Automation (i.e. who to Request File from)
61
66
  * `webhook_url` (string): If trigger is `webhook`, this is the URL of the webhook to trigger the Automation.
@@ -115,6 +120,7 @@ await Automation.create({
115
120
  'destination_replace_to': "example",
116
121
  'interval': "year",
117
122
  'path': "example",
123
+ 'sync_ids': [1,2],
118
124
  'user_ids': [1,2],
119
125
  'group_ids': [1,2],
120
126
  'schedule': {"days_of_week":[0,1,3],"times_of_day":["7:30","11:30"],"time_zone":"Eastern Time (US & Canada)"},
@@ -138,6 +144,7 @@ await Automation.create({
138
144
  * `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.
139
145
  * `interval` (string): How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
140
146
  * `path` (string): Path on which this Automation runs. Supports globs.
147
+ * `sync_ids` (string): A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
141
148
  * `user_ids` (string): A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
142
149
  * `group_ids` (string): A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
143
150
  * `schedule` (object): Custom schedule for running this automation.
@@ -163,6 +170,7 @@ await automation.update({
163
170
  'destination_replace_to': "example",
164
171
  'interval': "year",
165
172
  'path': "example",
173
+ 'sync_ids': [1,2],
166
174
  'user_ids': [1,2],
167
175
  'group_ids': [1,2],
168
176
  'schedule': {"days_of_week":[0,1,3],"times_of_day":["7:30","11:30"],"time_zone":"Eastern Time (US & Canada)"},
@@ -186,6 +194,7 @@ await automation.update({
186
194
  * `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.
187
195
  * `interval` (string): How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
188
196
  * `path` (string): Path on which this Automation runs. Supports globs.
197
+ * `sync_ids` (string): A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
189
198
  * `user_ids` (string): A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
190
199
  * `group_ids` (string): A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
191
200
  * `schedule` (object): Custom schedule for running this automation.
@@ -219,6 +228,10 @@ await automation.update({
219
228
  "description": "example",
220
229
  "path": "example",
221
230
  "user_id": 1,
231
+ "sync_ids": [
232
+ 1,
233
+ 2
234
+ ],
222
235
  "user_ids": [
223
236
  1,
224
237
  2
@@ -143,6 +143,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
143
143
  (0, _defineProperty2.default)(this, "setUserId", function (value) {
144
144
  _this.attributes.user_id = value;
145
145
  });
146
+ // array # IDs of remote sync folder behaviors to run by this Automation
147
+ (0, _defineProperty2.default)(this, "getSyncIds", function () {
148
+ return _this.attributes.sync_ids;
149
+ });
150
+ (0, _defineProperty2.default)(this, "setSyncIds", function (value) {
151
+ _this.attributes.sync_ids = value;
152
+ });
146
153
  // array # IDs of Users for the Automation (i.e. who to Request File from)
147
154
  (0, _defineProperty2.default)(this, "getUserIds", function () {
148
155
  return _this.attributes.user_ids;
@@ -193,6 +200,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
193
200
  // 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.
194
201
  // interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
195
202
  // path - string - Path on which this Automation runs. Supports globs.
203
+ // sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
196
204
  // user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
197
205
  // group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
198
206
  // schedule - object - Custom schedule for running this automation.
@@ -272,68 +280,74 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
272
280
  }
273
281
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(path)));
274
282
  case 22:
275
- if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
283
+ if (!(params['sync_ids'] && !(0, _utils.isString)(params['sync_ids']))) {
276
284
  _context.next = 24;
277
285
  break;
278
286
  }
279
- throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(user_ids)));
287
+ throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(sync_ids)));
280
288
  case 24:
281
- if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
289
+ if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
282
290
  _context.next = 26;
283
291
  break;
284
292
  }
285
- throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(group_ids)));
293
+ throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(user_ids)));
286
294
  case 26:
287
- if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
295
+ if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
288
296
  _context.next = 28;
289
297
  break;
290
298
  }
291
- throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(description)));
299
+ throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(group_ids)));
292
300
  case 28:
293
- if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
301
+ if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
294
302
  _context.next = 30;
295
303
  break;
296
304
  }
297
- throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(name)));
305
+ throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(description)));
298
306
  case 30:
299
- if (!(params['trigger'] && !(0, _utils.isString)(params['trigger']))) {
307
+ if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
300
308
  _context.next = 32;
301
309
  break;
302
310
  }
303
- throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(trigger)));
311
+ throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(name)));
304
312
  case 32:
305
- if (!(params['trigger_actions'] && !(0, _utils.isArray)(params['trigger_actions']))) {
313
+ if (!(params['trigger'] && !(0, _utils.isString)(params['trigger']))) {
306
314
  _context.next = 34;
307
315
  break;
308
316
  }
309
- throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(trigger_actions)));
317
+ throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(trigger)));
310
318
  case 34:
311
- if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
319
+ if (!(params['trigger_actions'] && !(0, _utils.isArray)(params['trigger_actions']))) {
312
320
  _context.next = 36;
313
321
  break;
314
322
  }
315
- throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(automation)));
323
+ throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(trigger_actions)));
316
324
  case 36:
325
+ if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
326
+ _context.next = 38;
327
+ break;
328
+ }
329
+ throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(automation)));
330
+ case 38:
317
331
  if (params['id']) {
318
- _context.next = 42;
332
+ _context.next = 44;
319
333
  break;
320
334
  }
321
335
  if (!_this.attributes.id) {
322
- _context.next = 41;
336
+ _context.next = 43;
323
337
  break;
324
338
  }
325
339
  params['id'] = _this.id;
326
- _context.next = 42;
340
+ _context.next = 44;
327
341
  break;
328
- case 41:
342
+ case 43:
329
343
  throw new errors.MissingParameterError('Parameter missing: id');
330
- case 42:
331
- _context.next = 44;
332
- return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
333
344
  case 44:
345
+ _context.next = 46;
346
+ return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
347
+ case 46:
334
348
  response = _context.sent;
335
349
  return _context.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, _this.options));
336
- case 46:
350
+ case 48:
337
351
  case "end":
338
352
  return _context.stop();
339
353
  }
@@ -536,6 +550,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
536
550
  // 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.
537
551
  // interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
538
552
  // path - string - Path on which this Automation runs. Supports globs.
553
+ // sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
539
554
  // user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
540
555
  // group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
541
556
  // schedule - object - Custom schedule for running this automation.
@@ -604,54 +619,60 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
604
619
  }
605
620
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
606
621
  case 18:
607
- if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
622
+ if (!(params['sync_ids'] && !(0, _utils.isString)(params['sync_ids']))) {
608
623
  _context5.next = 20;
609
624
  break;
610
625
  }
611
- throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params['user_ids'])));
626
+ throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params['sync_ids'])));
612
627
  case 20:
613
- if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
628
+ if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
614
629
  _context5.next = 22;
615
630
  break;
616
631
  }
617
- throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params['group_ids'])));
632
+ throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params['user_ids'])));
618
633
  case 22:
619
- if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
634
+ if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
620
635
  _context5.next = 24;
621
636
  break;
622
637
  }
623
- throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
638
+ throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params['group_ids'])));
624
639
  case 24:
625
- if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
640
+ if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
626
641
  _context5.next = 26;
627
642
  break;
628
643
  }
629
- throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
644
+ throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
630
645
  case 26:
631
- if (!(params['trigger'] && !(0, _utils.isString)(params['trigger']))) {
646
+ if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
632
647
  _context5.next = 28;
633
648
  break;
634
649
  }
635
- throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params['trigger'])));
650
+ throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
636
651
  case 28:
637
- if (!(params['trigger_actions'] && !(0, _utils.isArray)(params['trigger_actions']))) {
652
+ if (!(params['trigger'] && !(0, _utils.isString)(params['trigger']))) {
638
653
  _context5.next = 30;
639
654
  break;
640
655
  }
641
- throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params['trigger_actions'])));
656
+ throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params['trigger'])));
642
657
  case 30:
643
- if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
658
+ if (!(params['trigger_actions'] && !(0, _utils.isArray)(params['trigger_actions']))) {
644
659
  _context5.next = 32;
645
660
  break;
646
661
  }
647
- throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params['automation'])));
662
+ throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params['trigger_actions'])));
648
663
  case 32:
649
- _context5.next = 34;
650
- return _Api.default.sendRequest("/automations", 'POST', params, options);
664
+ if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
665
+ _context5.next = 34;
666
+ break;
667
+ }
668
+ throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params['automation'])));
651
669
  case 34:
670
+ _context5.next = 36;
671
+ return _Api.default.sendRequest("/automations", 'POST', params, options);
672
+ case 36:
652
673
  response = _context5.sent;
653
674
  return _context5.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, options));
654
- case 36:
675
+ case 38:
655
676
  case "end":
656
677
  return _context5.stop();
657
678
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.252",
3
+ "version": "1.0.253",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -135,6 +135,13 @@ class Automation {
135
135
  this.attributes.user_id = value
136
136
  }
137
137
 
138
+ // array # IDs of remote sync folder behaviors to run by this Automation
139
+ getSyncIds = () => this.attributes.sync_ids
140
+
141
+ setSyncIds = value => {
142
+ this.attributes.sync_ids = value
143
+ }
144
+
138
145
  // array # IDs of Users for the Automation (i.e. who to Request File from)
139
146
  getUserIds = () => this.attributes.user_ids
140
147
 
@@ -186,6 +193,7 @@ class Automation {
186
193
  // 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.
187
194
  // interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
188
195
  // path - string - Path on which this Automation runs. Supports globs.
196
+ // sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
189
197
  // user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
190
198
  // group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
191
199
  // schedule - object - Custom schedule for running this automation.
@@ -230,6 +238,9 @@ class Automation {
230
238
  if (params['path'] && !isString(params['path'])) {
231
239
  throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
232
240
  }
241
+ if (params['sync_ids'] && !isString(params['sync_ids'])) {
242
+ throw new errors.InvalidParameterError(`Bad parameter: sync_ids must be of type String, received ${getType(sync_ids)}`)
243
+ }
233
244
  if (params['user_ids'] && !isString(params['user_ids'])) {
234
245
  throw new errors.InvalidParameterError(`Bad parameter: user_ids must be of type String, received ${getType(user_ids)}`)
235
246
  }
@@ -371,6 +382,7 @@ class Automation {
371
382
  // 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.
372
383
  // interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
373
384
  // path - string - Path on which this Automation runs. Supports globs.
385
+ // sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
374
386
  // user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
375
387
  // group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
376
388
  // schedule - object - Custom schedule for running this automation.
@@ -414,6 +426,10 @@ class Automation {
414
426
  throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
415
427
  }
416
428
 
429
+ if (params['sync_ids'] && !isString(params['sync_ids'])) {
430
+ throw new errors.InvalidParameterError(`Bad parameter: sync_ids must be of type String, received ${getType(params['sync_ids'])}`)
431
+ }
432
+
417
433
  if (params['user_ids'] && !isString(params['user_ids'])) {
418
434
  throw new errors.InvalidParameterError(`Bad parameter: user_ids must be of type String, received ${getType(params['user_ids'])}`)
419
435
  }