files.com 1.2.285 → 1.2.287
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 +14 -1
- package/docs/models/Sync.md +0 -9
- package/lib/Files.js +1 -1
- package/lib/models/Automation.js +104 -83
- package/lib/models/Sync.js +0 -15
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/Automation.js +17 -0
- package/src/models/Sync.js +0 -4
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.287
|
|
@@ -70,6 +70,10 @@
|
|
|
70
70
|
],
|
|
71
71
|
"schedule_time_zone": "Eastern Time (US & Canada)",
|
|
72
72
|
"source": "example",
|
|
73
|
+
"legacy_sync_ids": [
|
|
74
|
+
1,
|
|
75
|
+
2
|
|
76
|
+
],
|
|
73
77
|
"sync_ids": [
|
|
74
78
|
1,
|
|
75
79
|
2
|
|
@@ -122,7 +126,8 @@
|
|
|
122
126
|
* `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.
|
|
123
127
|
* `schedule_time_zone` (string): If trigger is `custom_schedule`, Custom schedule Time Zone for when the automation should be run.
|
|
124
128
|
* `source` (string): Source path/glob. See Automation docs for exact description, but this is used to filter for files in the `path` to find files to operate on. Supports globs, except on remote mounts.
|
|
125
|
-
* `
|
|
129
|
+
* `legacy_sync_ids` (array(int64)): IDs of remote sync folder behaviors to run by this Automation
|
|
130
|
+
* `sync_ids` (array(int64)): IDs of syncs to run by this Automation. This is the new way to specify syncs, and it is recommended to use this instead of `legacy_sync_ids`.
|
|
126
131
|
* `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
|
|
127
132
|
* `trigger` (string): How this automation is triggered to run.
|
|
128
133
|
* `user_id` (int64): User ID of the Automation's creator.
|
|
@@ -176,6 +181,7 @@ await Automation.create({
|
|
|
176
181
|
'destination_replace_to': "example",
|
|
177
182
|
'interval': "year",
|
|
178
183
|
'path': "example",
|
|
184
|
+
'legacy_sync_ids': [1,2],
|
|
179
185
|
'sync_ids': [1,2],
|
|
180
186
|
'user_ids': [1,2],
|
|
181
187
|
'group_ids': [1,2],
|
|
@@ -214,6 +220,7 @@ await Automation.create({
|
|
|
214
220
|
* `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.
|
|
215
221
|
* `interval` (string): How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
|
|
216
222
|
* `path` (string): Path on which this Automation runs. Supports globs, except on remote mounts.
|
|
223
|
+
* `legacy_sync_ids` (string): A list of legacy sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
217
224
|
* `sync_ids` (string): A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
218
225
|
* `user_ids` (string): A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
219
226
|
* `group_ids` (string): A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
@@ -270,6 +277,7 @@ await automation.update({
|
|
|
270
277
|
'destination_replace_to': "example",
|
|
271
278
|
'interval': "year",
|
|
272
279
|
'path': "example",
|
|
280
|
+
'legacy_sync_ids': [1,2],
|
|
273
281
|
'sync_ids': [1,2],
|
|
274
282
|
'user_ids': [1,2],
|
|
275
283
|
'group_ids': [1,2],
|
|
@@ -308,6 +316,7 @@ await automation.update({
|
|
|
308
316
|
* `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.
|
|
309
317
|
* `interval` (string): How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
|
|
310
318
|
* `path` (string): Path on which this Automation runs. Supports globs, except on remote mounts.
|
|
319
|
+
* `legacy_sync_ids` (string): A list of legacy sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
311
320
|
* `sync_ids` (string): A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
312
321
|
* `user_ids` (string): A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
313
322
|
* `group_ids` (string): A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
@@ -405,6 +414,10 @@ await automation.update({
|
|
|
405
414
|
],
|
|
406
415
|
"schedule_time_zone": "Eastern Time (US & Canada)",
|
|
407
416
|
"source": "example",
|
|
417
|
+
"legacy_sync_ids": [
|
|
418
|
+
1,
|
|
419
|
+
2
|
|
420
|
+
],
|
|
408
421
|
"sync_ids": [
|
|
409
422
|
1,
|
|
410
423
|
2
|
package/docs/models/Sync.md
CHANGED
|
@@ -149,15 +149,6 @@ await Sync.create({
|
|
|
149
149
|
* `schedule_days_of_week` (array(int64)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
|
|
150
150
|
* `schedule_times_of_day` (array(string)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
|
|
151
151
|
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
## Migrate Legacy Syncs to Syncs
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
await Sync.createMigrateTo
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
|
|
161
152
|
---
|
|
162
153
|
|
|
163
154
|
## Manually Run Sync
|
package/lib/Files.js
CHANGED
|
@@ -12,7 +12,7 @@ var apiKey;
|
|
|
12
12
|
var baseUrl = 'https://app.files.com';
|
|
13
13
|
var sessionId = null;
|
|
14
14
|
var language = null;
|
|
15
|
-
var version = '1.2.
|
|
15
|
+
var version = '1.2.287';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
package/lib/models/Automation.js
CHANGED
|
@@ -250,6 +250,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
|
250
250
|
_this.attributes.source = value;
|
|
251
251
|
});
|
|
252
252
|
// array(int64) # IDs of remote sync folder behaviors to run by this Automation
|
|
253
|
+
(0, _defineProperty2.default)(this, "getLegacySyncIds", function () {
|
|
254
|
+
return _this.attributes.legacy_sync_ids;
|
|
255
|
+
});
|
|
256
|
+
(0, _defineProperty2.default)(this, "setLegacySyncIds", function (value) {
|
|
257
|
+
_this.attributes.legacy_sync_ids = value;
|
|
258
|
+
});
|
|
259
|
+
// array(int64) # IDs of syncs to run by this Automation. This is the new way to specify syncs, and it is recommended to use this instead of `legacy_sync_ids`.
|
|
253
260
|
(0, _defineProperty2.default)(this, "getSyncIds", function () {
|
|
254
261
|
return _this.attributes.sync_ids;
|
|
255
262
|
});
|
|
@@ -361,6 +368,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
|
361
368
|
// 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.
|
|
362
369
|
// interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
|
|
363
370
|
// path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
|
|
371
|
+
// legacy_sync_ids - string - A list of legacy sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
364
372
|
// sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
365
373
|
// user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
366
374
|
// group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
@@ -450,134 +458,140 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
|
450
458
|
}
|
|
451
459
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
452
460
|
case 9:
|
|
453
|
-
if (!(params.
|
|
461
|
+
if (!(params.legacy_sync_ids && !(0, _utils.isString)(params.legacy_sync_ids))) {
|
|
454
462
|
_context2.next = 10;
|
|
455
463
|
break;
|
|
456
464
|
}
|
|
457
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
465
|
+
throw new errors.InvalidParameterError("Bad parameter: legacy_sync_ids must be of type String, received ".concat((0, _utils.getType)(params.legacy_sync_ids)));
|
|
458
466
|
case 10:
|
|
459
|
-
if (!(params.
|
|
467
|
+
if (!(params.sync_ids && !(0, _utils.isString)(params.sync_ids))) {
|
|
460
468
|
_context2.next = 11;
|
|
461
469
|
break;
|
|
462
470
|
}
|
|
463
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
471
|
+
throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params.sync_ids)));
|
|
464
472
|
case 11:
|
|
465
|
-
if (!(params.
|
|
473
|
+
if (!(params.user_ids && !(0, _utils.isString)(params.user_ids))) {
|
|
466
474
|
_context2.next = 12;
|
|
467
475
|
break;
|
|
468
476
|
}
|
|
469
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
477
|
+
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params.user_ids)));
|
|
470
478
|
case 12:
|
|
471
|
-
if (!(params.
|
|
479
|
+
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
|
|
472
480
|
_context2.next = 13;
|
|
473
481
|
break;
|
|
474
482
|
}
|
|
475
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
483
|
+
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
|
|
476
484
|
case 13:
|
|
477
|
-
if (!(params.
|
|
485
|
+
if (!(params.schedule_days_of_week && !(0, _utils.isArray)(params.schedule_days_of_week))) {
|
|
478
486
|
_context2.next = 14;
|
|
479
487
|
break;
|
|
480
488
|
}
|
|
481
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
489
|
+
throw new errors.InvalidParameterError("Bad parameter: schedule_days_of_week must be of type Array, received ".concat((0, _utils.getType)(params.schedule_days_of_week)));
|
|
482
490
|
case 14:
|
|
483
|
-
if (!(params.
|
|
491
|
+
if (!(params.schedule_times_of_day && !(0, _utils.isArray)(params.schedule_times_of_day))) {
|
|
484
492
|
_context2.next = 15;
|
|
485
493
|
break;
|
|
486
494
|
}
|
|
487
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
495
|
+
throw new errors.InvalidParameterError("Bad parameter: schedule_times_of_day must be of type Array, received ".concat((0, _utils.getType)(params.schedule_times_of_day)));
|
|
488
496
|
case 15:
|
|
489
|
-
if (!(params.
|
|
497
|
+
if (!(params.schedule_time_zone && !(0, _utils.isString)(params.schedule_time_zone))) {
|
|
490
498
|
_context2.next = 16;
|
|
491
499
|
break;
|
|
492
500
|
}
|
|
493
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
501
|
+
throw new errors.InvalidParameterError("Bad parameter: schedule_time_zone must be of type String, received ".concat((0, _utils.getType)(params.schedule_time_zone)));
|
|
494
502
|
case 16:
|
|
495
|
-
if (!(params.
|
|
503
|
+
if (!(params.holiday_region && !(0, _utils.isString)(params.holiday_region))) {
|
|
496
504
|
_context2.next = 17;
|
|
497
505
|
break;
|
|
498
506
|
}
|
|
499
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
507
|
+
throw new errors.InvalidParameterError("Bad parameter: holiday_region must be of type String, received ".concat((0, _utils.getType)(params.holiday_region)));
|
|
500
508
|
case 17:
|
|
501
|
-
if (!(params.
|
|
509
|
+
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
|
502
510
|
_context2.next = 18;
|
|
503
511
|
break;
|
|
504
512
|
}
|
|
505
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
513
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
|
506
514
|
case 18:
|
|
507
|
-
if (!(params.
|
|
515
|
+
if (!(params.exclude_pattern && !(0, _utils.isString)(params.exclude_pattern))) {
|
|
508
516
|
_context2.next = 19;
|
|
509
517
|
break;
|
|
510
518
|
}
|
|
511
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
519
|
+
throw new errors.InvalidParameterError("Bad parameter: exclude_pattern must be of type String, received ".concat((0, _utils.getType)(params.exclude_pattern)));
|
|
512
520
|
case 19:
|
|
513
|
-
if (!(params.
|
|
521
|
+
if (!(params.import_urls && !(0, _utils.isArray)(params.import_urls))) {
|
|
514
522
|
_context2.next = 20;
|
|
515
523
|
break;
|
|
516
524
|
}
|
|
517
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
525
|
+
throw new errors.InvalidParameterError("Bad parameter: import_urls must be of type Array, received ".concat((0, _utils.getType)(params.import_urls)));
|
|
518
526
|
case 20:
|
|
519
|
-
if (!(params.
|
|
527
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
520
528
|
_context2.next = 21;
|
|
521
529
|
break;
|
|
522
530
|
}
|
|
523
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
531
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
524
532
|
case 21:
|
|
525
|
-
if (!(params.
|
|
533
|
+
if (!(params.path_time_zone && !(0, _utils.isString)(params.path_time_zone))) {
|
|
526
534
|
_context2.next = 22;
|
|
527
535
|
break;
|
|
528
536
|
}
|
|
529
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
537
|
+
throw new errors.InvalidParameterError("Bad parameter: path_time_zone must be of type String, received ".concat((0, _utils.getType)(params.path_time_zone)));
|
|
530
538
|
case 22:
|
|
531
|
-
if (!(params.
|
|
539
|
+
if (!(params.retry_on_failure_interval_in_minutes && !(0, _utils.isInt)(params.retry_on_failure_interval_in_minutes))) {
|
|
532
540
|
_context2.next = 23;
|
|
533
541
|
break;
|
|
534
542
|
}
|
|
535
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
543
|
+
throw new errors.InvalidParameterError("Bad parameter: retry_on_failure_interval_in_minutes must be of type Int, received ".concat((0, _utils.getType)(params.retry_on_failure_interval_in_minutes)));
|
|
536
544
|
case 23:
|
|
537
|
-
if (!(params.
|
|
545
|
+
if (!(params.retry_on_failure_number_of_attempts && !(0, _utils.isInt)(params.retry_on_failure_number_of_attempts))) {
|
|
538
546
|
_context2.next = 24;
|
|
539
547
|
break;
|
|
540
548
|
}
|
|
541
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
549
|
+
throw new errors.InvalidParameterError("Bad parameter: retry_on_failure_number_of_attempts must be of type Int, received ".concat((0, _utils.getType)(params.retry_on_failure_number_of_attempts)));
|
|
542
550
|
case 24:
|
|
543
|
-
if (!(params.
|
|
551
|
+
if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
|
|
544
552
|
_context2.next = 25;
|
|
545
553
|
break;
|
|
546
554
|
}
|
|
547
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
555
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
|
|
548
556
|
case 25:
|
|
549
|
-
if (!(params.
|
|
557
|
+
if (!(params.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
|
|
550
558
|
_context2.next = 26;
|
|
551
559
|
break;
|
|
552
560
|
}
|
|
553
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
561
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
|
|
554
562
|
case 26:
|
|
555
|
-
if (!(params.
|
|
563
|
+
if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
|
|
556
564
|
_context2.next = 27;
|
|
557
565
|
break;
|
|
558
566
|
}
|
|
559
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
567
|
+
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
|
|
560
568
|
case 27:
|
|
569
|
+
if (!(params.automation && !(0, _utils.isString)(params.automation))) {
|
|
570
|
+
_context2.next = 28;
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
|
|
574
|
+
case 28:
|
|
561
575
|
if (params.id) {
|
|
562
|
-
_context2.next =
|
|
576
|
+
_context2.next = 30;
|
|
563
577
|
break;
|
|
564
578
|
}
|
|
565
579
|
if (!_this.attributes.id) {
|
|
566
|
-
_context2.next =
|
|
580
|
+
_context2.next = 29;
|
|
567
581
|
break;
|
|
568
582
|
}
|
|
569
583
|
params.id = _this.id;
|
|
570
|
-
_context2.next =
|
|
584
|
+
_context2.next = 30;
|
|
571
585
|
break;
|
|
572
|
-
case 28:
|
|
573
|
-
throw new errors.MissingParameterError('Parameter missing: id');
|
|
574
586
|
case 29:
|
|
575
|
-
|
|
576
|
-
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
587
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
|
577
588
|
case 30:
|
|
589
|
+
_context2.next = 31;
|
|
590
|
+
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
591
|
+
case 31:
|
|
578
592
|
response = _context2.sent;
|
|
579
593
|
return _context2.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
580
|
-
case
|
|
594
|
+
case 32:
|
|
581
595
|
case "end":
|
|
582
596
|
return _context2.stop();
|
|
583
597
|
}
|
|
@@ -786,6 +800,7 @@ _Automation = Automation;
|
|
|
786
800
|
// 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.
|
|
787
801
|
// interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
|
|
788
802
|
// path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
|
|
803
|
+
// legacy_sync_ids - string - A list of legacy sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
789
804
|
// sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
790
805
|
// user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
791
806
|
// group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
@@ -864,120 +879,126 @@ _Automation = Automation;
|
|
|
864
879
|
}
|
|
865
880
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
866
881
|
case 7:
|
|
867
|
-
if (!(params.
|
|
882
|
+
if (!(params.legacy_sync_ids && !(0, _utils.isString)(params.legacy_sync_ids))) {
|
|
868
883
|
_context7.next = 8;
|
|
869
884
|
break;
|
|
870
885
|
}
|
|
871
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
886
|
+
throw new errors.InvalidParameterError("Bad parameter: legacy_sync_ids must be of type String, received ".concat((0, _utils.getType)(params.legacy_sync_ids)));
|
|
872
887
|
case 8:
|
|
873
|
-
if (!(params.
|
|
888
|
+
if (!(params.sync_ids && !(0, _utils.isString)(params.sync_ids))) {
|
|
874
889
|
_context7.next = 9;
|
|
875
890
|
break;
|
|
876
891
|
}
|
|
877
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
892
|
+
throw new errors.InvalidParameterError("Bad parameter: sync_ids must be of type String, received ".concat((0, _utils.getType)(params.sync_ids)));
|
|
878
893
|
case 9:
|
|
879
|
-
if (!(params.
|
|
894
|
+
if (!(params.user_ids && !(0, _utils.isString)(params.user_ids))) {
|
|
880
895
|
_context7.next = 10;
|
|
881
896
|
break;
|
|
882
897
|
}
|
|
883
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
898
|
+
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params.user_ids)));
|
|
884
899
|
case 10:
|
|
885
|
-
if (!(params.
|
|
900
|
+
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
|
|
886
901
|
_context7.next = 11;
|
|
887
902
|
break;
|
|
888
903
|
}
|
|
889
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
904
|
+
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
|
|
890
905
|
case 11:
|
|
891
|
-
if (!(params.
|
|
906
|
+
if (!(params.schedule_days_of_week && !(0, _utils.isArray)(params.schedule_days_of_week))) {
|
|
892
907
|
_context7.next = 12;
|
|
893
908
|
break;
|
|
894
909
|
}
|
|
895
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
910
|
+
throw new errors.InvalidParameterError("Bad parameter: schedule_days_of_week must be of type Array, received ".concat((0, _utils.getType)(params.schedule_days_of_week)));
|
|
896
911
|
case 12:
|
|
897
|
-
if (!(params.
|
|
912
|
+
if (!(params.schedule_times_of_day && !(0, _utils.isArray)(params.schedule_times_of_day))) {
|
|
898
913
|
_context7.next = 13;
|
|
899
914
|
break;
|
|
900
915
|
}
|
|
901
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
916
|
+
throw new errors.InvalidParameterError("Bad parameter: schedule_times_of_day must be of type Array, received ".concat((0, _utils.getType)(params.schedule_times_of_day)));
|
|
902
917
|
case 13:
|
|
903
|
-
if (!(params.
|
|
918
|
+
if (!(params.schedule_time_zone && !(0, _utils.isString)(params.schedule_time_zone))) {
|
|
904
919
|
_context7.next = 14;
|
|
905
920
|
break;
|
|
906
921
|
}
|
|
907
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
922
|
+
throw new errors.InvalidParameterError("Bad parameter: schedule_time_zone must be of type String, received ".concat((0, _utils.getType)(params.schedule_time_zone)));
|
|
908
923
|
case 14:
|
|
909
|
-
if (!(params.
|
|
924
|
+
if (!(params.holiday_region && !(0, _utils.isString)(params.holiday_region))) {
|
|
910
925
|
_context7.next = 15;
|
|
911
926
|
break;
|
|
912
927
|
}
|
|
913
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
928
|
+
throw new errors.InvalidParameterError("Bad parameter: holiday_region must be of type String, received ".concat((0, _utils.getType)(params.holiday_region)));
|
|
914
929
|
case 15:
|
|
915
|
-
if (!(params.
|
|
930
|
+
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
|
916
931
|
_context7.next = 16;
|
|
917
932
|
break;
|
|
918
933
|
}
|
|
919
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
934
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
|
920
935
|
case 16:
|
|
921
|
-
if (!(params.
|
|
936
|
+
if (!(params.exclude_pattern && !(0, _utils.isString)(params.exclude_pattern))) {
|
|
922
937
|
_context7.next = 17;
|
|
923
938
|
break;
|
|
924
939
|
}
|
|
925
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
940
|
+
throw new errors.InvalidParameterError("Bad parameter: exclude_pattern must be of type String, received ".concat((0, _utils.getType)(params.exclude_pattern)));
|
|
926
941
|
case 17:
|
|
927
|
-
if (!(params.
|
|
942
|
+
if (!(params.import_urls && !(0, _utils.isArray)(params.import_urls))) {
|
|
928
943
|
_context7.next = 18;
|
|
929
944
|
break;
|
|
930
945
|
}
|
|
931
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
946
|
+
throw new errors.InvalidParameterError("Bad parameter: import_urls must be of type Array, received ".concat((0, _utils.getType)(params.import_urls)));
|
|
932
947
|
case 18:
|
|
933
|
-
if (!(params.
|
|
948
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
934
949
|
_context7.next = 19;
|
|
935
950
|
break;
|
|
936
951
|
}
|
|
937
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
952
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
938
953
|
case 19:
|
|
939
|
-
if (!(params.
|
|
954
|
+
if (!(params.path_time_zone && !(0, _utils.isString)(params.path_time_zone))) {
|
|
940
955
|
_context7.next = 20;
|
|
941
956
|
break;
|
|
942
957
|
}
|
|
943
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
958
|
+
throw new errors.InvalidParameterError("Bad parameter: path_time_zone must be of type String, received ".concat((0, _utils.getType)(params.path_time_zone)));
|
|
944
959
|
case 20:
|
|
945
|
-
if (!(params.
|
|
960
|
+
if (!(params.retry_on_failure_interval_in_minutes && !(0, _utils.isInt)(params.retry_on_failure_interval_in_minutes))) {
|
|
946
961
|
_context7.next = 21;
|
|
947
962
|
break;
|
|
948
963
|
}
|
|
949
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
964
|
+
throw new errors.InvalidParameterError("Bad parameter: retry_on_failure_interval_in_minutes must be of type Int, received ".concat((0, _utils.getType)(params.retry_on_failure_interval_in_minutes)));
|
|
950
965
|
case 21:
|
|
951
|
-
if (!(params.
|
|
966
|
+
if (!(params.retry_on_failure_number_of_attempts && !(0, _utils.isInt)(params.retry_on_failure_number_of_attempts))) {
|
|
952
967
|
_context7.next = 22;
|
|
953
968
|
break;
|
|
954
969
|
}
|
|
955
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
970
|
+
throw new errors.InvalidParameterError("Bad parameter: retry_on_failure_number_of_attempts must be of type Int, received ".concat((0, _utils.getType)(params.retry_on_failure_number_of_attempts)));
|
|
956
971
|
case 22:
|
|
957
|
-
if (!(params.
|
|
972
|
+
if (!(params.trigger && !(0, _utils.isString)(params.trigger))) {
|
|
958
973
|
_context7.next = 23;
|
|
959
974
|
break;
|
|
960
975
|
}
|
|
961
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
976
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger must be of type String, received ".concat((0, _utils.getType)(params.trigger)));
|
|
962
977
|
case 23:
|
|
963
|
-
if (!(params.
|
|
978
|
+
if (!(params.trigger_actions && !(0, _utils.isArray)(params.trigger_actions))) {
|
|
964
979
|
_context7.next = 24;
|
|
965
980
|
break;
|
|
966
981
|
}
|
|
967
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
982
|
+
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params.trigger_actions)));
|
|
968
983
|
case 24:
|
|
969
|
-
if (!(params.
|
|
984
|
+
if (!(params.recurring_day && !(0, _utils.isInt)(params.recurring_day))) {
|
|
970
985
|
_context7.next = 25;
|
|
971
986
|
break;
|
|
972
987
|
}
|
|
973
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
988
|
+
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params.recurring_day)));
|
|
974
989
|
case 25:
|
|
975
|
-
|
|
976
|
-
|
|
990
|
+
if (!(params.automation && !(0, _utils.isString)(params.automation))) {
|
|
991
|
+
_context7.next = 26;
|
|
992
|
+
break;
|
|
993
|
+
}
|
|
994
|
+
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params.automation)));
|
|
977
995
|
case 26:
|
|
996
|
+
_context7.next = 27;
|
|
997
|
+
return _Api.default.sendRequest('/automations', 'POST', params, options);
|
|
998
|
+
case 27:
|
|
978
999
|
response = _context7.sent;
|
|
979
1000
|
return _context7.abrupt("return", new _Automation(response === null || response === void 0 ? void 0 : response.data, options));
|
|
980
|
-
case
|
|
1001
|
+
case 28:
|
|
981
1002
|
case "end":
|
|
982
1003
|
return _context7.stop();
|
|
983
1004
|
}
|
package/lib/models/Sync.js
CHANGED
|
@@ -740,21 +740,6 @@ _Sync = Sync;
|
|
|
740
740
|
}
|
|
741
741
|
}, _callee7);
|
|
742
742
|
})));
|
|
743
|
-
(0, _defineProperty2.default)(Sync, "createMigrateTo", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
744
|
-
var options,
|
|
745
|
-
_args8 = arguments;
|
|
746
|
-
return _regenerator.default.wrap(function (_context8) {
|
|
747
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
748
|
-
case 0:
|
|
749
|
-
options = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
|
750
|
-
_context8.next = 1;
|
|
751
|
-
return _Api.default.sendRequest('/syncs/migrate_to_syncs', 'POST', {}, options);
|
|
752
|
-
case 1:
|
|
753
|
-
case "end":
|
|
754
|
-
return _context8.stop();
|
|
755
|
-
}
|
|
756
|
-
}, _callee8);
|
|
757
|
-
})));
|
|
758
743
|
var _default = exports.default = Sync;
|
|
759
744
|
module.exports = Sync;
|
|
760
745
|
module.exports.default = Sync;
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
package/src/models/Automation.js
CHANGED
|
@@ -246,6 +246,13 @@ class Automation {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
// array(int64) # IDs of remote sync folder behaviors to run by this Automation
|
|
249
|
+
getLegacySyncIds = () => this.attributes.legacy_sync_ids
|
|
250
|
+
|
|
251
|
+
setLegacySyncIds = value => {
|
|
252
|
+
this.attributes.legacy_sync_ids = value
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// array(int64) # IDs of syncs to run by this Automation. This is the new way to specify syncs, and it is recommended to use this instead of `legacy_sync_ids`.
|
|
249
256
|
getSyncIds = () => this.attributes.sync_ids
|
|
250
257
|
|
|
251
258
|
setSyncIds = value => {
|
|
@@ -334,6 +341,7 @@ class Automation {
|
|
|
334
341
|
// 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.
|
|
335
342
|
// interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
|
|
336
343
|
// path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
|
|
344
|
+
// legacy_sync_ids - string - A list of legacy sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
337
345
|
// sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
338
346
|
// user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
339
347
|
// group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
@@ -398,6 +406,10 @@ class Automation {
|
|
|
398
406
|
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params.path)}`)
|
|
399
407
|
}
|
|
400
408
|
|
|
409
|
+
if (params.legacy_sync_ids && !isString(params.legacy_sync_ids)) {
|
|
410
|
+
throw new errors.InvalidParameterError(`Bad parameter: legacy_sync_ids must be of type String, received ${getType(params.legacy_sync_ids)}`)
|
|
411
|
+
}
|
|
412
|
+
|
|
401
413
|
if (params.sync_ids && !isString(params.sync_ids)) {
|
|
402
414
|
throw new errors.InvalidParameterError(`Bad parameter: sync_ids must be of type String, received ${getType(params.sync_ids)}`)
|
|
403
415
|
}
|
|
@@ -581,6 +593,7 @@ class Automation {
|
|
|
581
593
|
// 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.
|
|
582
594
|
// interval - string - How often to run this automation? One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
|
|
583
595
|
// path - string - Path on which this Automation runs. Supports globs, except on remote mounts.
|
|
596
|
+
// legacy_sync_ids - string - A list of legacy sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
584
597
|
// sync_ids - string - A list of sync IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
585
598
|
// user_ids - string - A list of user IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
586
599
|
// group_ids - string - A list of group IDs the automation is associated with. If sent as a string, it should be comma-delimited.
|
|
@@ -636,6 +649,10 @@ class Automation {
|
|
|
636
649
|
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params.path)}`)
|
|
637
650
|
}
|
|
638
651
|
|
|
652
|
+
if (params.legacy_sync_ids && !isString(params.legacy_sync_ids)) {
|
|
653
|
+
throw new errors.InvalidParameterError(`Bad parameter: legacy_sync_ids must be of type String, received ${getType(params.legacy_sync_ids)}`)
|
|
654
|
+
}
|
|
655
|
+
|
|
639
656
|
if (params.sync_ids && !isString(params.sync_ids)) {
|
|
640
657
|
throw new errors.InvalidParameterError(`Bad parameter: sync_ids must be of type String, received ${getType(params.sync_ids)}`)
|
|
641
658
|
}
|
package/src/models/Sync.js
CHANGED