files.com 1.0.259 → 1.0.260
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/models/Automation.md +7 -0
- package/lib/models/Automation.js +36 -15
- package/package.json +1 -1
- package/src/models/Automation.js +16 -0
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.260
|
@@ -20,6 +20,7 @@
|
|
20
20
|
"destination_replace_from": "example",
|
21
21
|
"destination_replace_to": "example",
|
22
22
|
"description": "example",
|
23
|
+
"recurring_day": 25,
|
23
24
|
"path": "example",
|
24
25
|
"user_id": 1,
|
25
26
|
"sync_ids": [
|
@@ -58,6 +59,7 @@
|
|
58
59
|
* `destination_replace_from` (string): If set, this string in the destination path will be replaced with the value in `destination_replace_to`.
|
59
60
|
* `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.
|
60
61
|
* `description` (string): Description for the this Automation.
|
62
|
+
* `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`.
|
61
63
|
* `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.
|
62
64
|
* `user_id` (int64): User ID of the Automation's creator.
|
63
65
|
* `sync_ids` (array): IDs of remote sync folder behaviors to run by this Automation
|
@@ -129,6 +131,7 @@ await Automation.create({
|
|
129
131
|
'trigger': "realtime",
|
130
132
|
'trigger_actions': ["create"],
|
131
133
|
'value': {"limit":"1"},
|
134
|
+
'recurring_day': 25,
|
132
135
|
'automation': "create_folder",
|
133
136
|
})
|
134
137
|
```
|
@@ -153,6 +156,7 @@ await Automation.create({
|
|
153
156
|
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
154
157
|
* `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
|
155
158
|
* `value` (object): A Hash of attributes specific to the automation type.
|
159
|
+
* `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`.
|
156
160
|
* `automation` (string): Required - Automation type
|
157
161
|
|
158
162
|
---
|
@@ -179,6 +183,7 @@ await automation.update({
|
|
179
183
|
'trigger': "realtime",
|
180
184
|
'trigger_actions': ["create"],
|
181
185
|
'value': {"limit":"1"},
|
186
|
+
'recurring_day': 25,
|
182
187
|
'automation': "create_folder",
|
183
188
|
})
|
184
189
|
```
|
@@ -203,6 +208,7 @@ await automation.update({
|
|
203
208
|
* `trigger` (string): How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
204
209
|
* `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
|
205
210
|
* `value` (object): A Hash of attributes specific to the automation type.
|
211
|
+
* `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`.
|
206
212
|
* `automation` (string): Automation type
|
207
213
|
|
208
214
|
### Example Response
|
@@ -225,6 +231,7 @@ await automation.update({
|
|
225
231
|
"destination_replace_from": "example",
|
226
232
|
"destination_replace_to": "example",
|
227
233
|
"description": "example",
|
234
|
+
"recurring_day": 25,
|
228
235
|
"path": "example",
|
229
236
|
"user_id": 1,
|
230
237
|
"sync_ids": [
|
package/lib/models/Automation.js
CHANGED
@@ -129,6 +129,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
129
129
|
(0, _defineProperty2.default)(this, "setDescription", function (value) {
|
130
130
|
_this.attributes.description = value;
|
131
131
|
});
|
132
|
+
// int64 # If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
|
133
|
+
(0, _defineProperty2.default)(this, "getRecurringDay", function () {
|
134
|
+
return _this.attributes.recurring_day;
|
135
|
+
});
|
136
|
+
(0, _defineProperty2.default)(this, "setRecurringDay", function (value) {
|
137
|
+
_this.attributes.recurring_day = value;
|
138
|
+
});
|
132
139
|
// 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.
|
133
140
|
(0, _defineProperty2.default)(this, "getPath", function () {
|
134
141
|
return _this.attributes.path;
|
@@ -210,6 +217,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
210
217
|
// trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
211
218
|
// 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
|
212
219
|
// value - object - A Hash of attributes specific to the automation type.
|
220
|
+
// 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`.
|
213
221
|
// automation - string - Automation type
|
214
222
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
215
223
|
var params,
|
@@ -322,32 +330,38 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
322
330
|
}
|
323
331
|
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(trigger_actions)));
|
324
332
|
case 36:
|
325
|
-
if (!(params['
|
333
|
+
if (!(params['recurring_day'] && !(0, _utils.isInt)(params['recurring_day']))) {
|
326
334
|
_context.next = 38;
|
327
335
|
break;
|
328
336
|
}
|
329
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
337
|
+
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(recurring_day)));
|
330
338
|
case 38:
|
339
|
+
if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
|
340
|
+
_context.next = 40;
|
341
|
+
break;
|
342
|
+
}
|
343
|
+
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(automation)));
|
344
|
+
case 40:
|
331
345
|
if (params['id']) {
|
332
|
-
_context.next =
|
346
|
+
_context.next = 46;
|
333
347
|
break;
|
334
348
|
}
|
335
349
|
if (!_this.attributes.id) {
|
336
|
-
_context.next =
|
350
|
+
_context.next = 45;
|
337
351
|
break;
|
338
352
|
}
|
339
353
|
params['id'] = _this.id;
|
340
|
-
_context.next =
|
354
|
+
_context.next = 46;
|
341
355
|
break;
|
342
|
-
case
|
356
|
+
case 45:
|
343
357
|
throw new errors.MissingParameterError('Parameter missing: id');
|
344
|
-
case 44:
|
345
|
-
_context.next = 46;
|
346
|
-
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
|
347
358
|
case 46:
|
359
|
+
_context.next = 48;
|
360
|
+
return _Api.default.sendRequest("/automations/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
|
361
|
+
case 48:
|
348
362
|
response = _context.sent;
|
349
363
|
return _context.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
350
|
-
case
|
364
|
+
case 50:
|
351
365
|
case "end":
|
352
366
|
return _context.stop();
|
353
367
|
}
|
@@ -559,6 +573,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
559
573
|
// trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
560
574
|
// 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
|
561
575
|
// value - object - A Hash of attributes specific to the automation type.
|
576
|
+
// 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`.
|
562
577
|
// automation (required) - string - Automation type
|
563
578
|
(0, _defineProperty2.default)(Automation, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
564
579
|
var params,
|
@@ -660,18 +675,24 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
660
675
|
}
|
661
676
|
throw new errors.InvalidParameterError("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(params['trigger_actions'])));
|
662
677
|
case 32:
|
663
|
-
if (!(params['
|
678
|
+
if (!(params['recurring_day'] && !(0, _utils.isInt)(params['recurring_day']))) {
|
664
679
|
_context5.next = 34;
|
665
680
|
break;
|
666
681
|
}
|
667
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
682
|
+
throw new errors.InvalidParameterError("Bad parameter: recurring_day must be of type Int, received ".concat((0, _utils.getType)(params['recurring_day'])));
|
668
683
|
case 34:
|
669
|
-
|
670
|
-
|
684
|
+
if (!(params['automation'] && !(0, _utils.isString)(params['automation']))) {
|
685
|
+
_context5.next = 36;
|
686
|
+
break;
|
687
|
+
}
|
688
|
+
throw new errors.InvalidParameterError("Bad parameter: automation must be of type String, received ".concat((0, _utils.getType)(params['automation'])));
|
671
689
|
case 36:
|
690
|
+
_context5.next = 38;
|
691
|
+
return _Api.default.sendRequest("/automations", 'POST', params, options);
|
692
|
+
case 38:
|
672
693
|
response = _context5.sent;
|
673
694
|
return _context5.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, options));
|
674
|
-
case
|
695
|
+
case 40:
|
675
696
|
case "end":
|
676
697
|
return _context5.stop();
|
677
698
|
}
|
package/package.json
CHANGED
package/src/models/Automation.js
CHANGED
@@ -121,6 +121,13 @@ class Automation {
|
|
121
121
|
this.attributes.description = value
|
122
122
|
}
|
123
123
|
|
124
|
+
// int64 # If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
|
125
|
+
getRecurringDay = () => this.attributes.recurring_day
|
126
|
+
|
127
|
+
setRecurringDay = value => {
|
128
|
+
this.attributes.recurring_day = value
|
129
|
+
}
|
130
|
+
|
124
131
|
// 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.
|
125
132
|
getPath = () => this.attributes.path
|
126
133
|
|
@@ -203,6 +210,7 @@ class Automation {
|
|
203
210
|
// trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
204
211
|
// 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
|
205
212
|
// value - object - A Hash of attributes specific to the automation type.
|
213
|
+
// 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`.
|
206
214
|
// automation - string - Automation type
|
207
215
|
update = async (params = {}) => {
|
208
216
|
if (!this.attributes.id) {
|
@@ -259,6 +267,9 @@ class Automation {
|
|
259
267
|
if (params['trigger_actions'] && !isArray(params['trigger_actions'])) {
|
260
268
|
throw new errors.InvalidParameterError(`Bad parameter: trigger_actions must be of type Array, received ${getType(trigger_actions)}`)
|
261
269
|
}
|
270
|
+
if (params['recurring_day'] && !isInt(params['recurring_day'])) {
|
271
|
+
throw new errors.InvalidParameterError(`Bad parameter: recurring_day must be of type Int, received ${getType(recurring_day)}`)
|
272
|
+
}
|
262
273
|
if (params['automation'] && !isString(params['automation'])) {
|
263
274
|
throw new errors.InvalidParameterError(`Bad parameter: automation must be of type String, received ${getType(automation)}`)
|
264
275
|
}
|
@@ -391,6 +402,7 @@ class Automation {
|
|
391
402
|
// trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
392
403
|
// 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
|
393
404
|
// value - object - A Hash of attributes specific to the automation type.
|
405
|
+
// 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`.
|
394
406
|
// automation (required) - string - Automation type
|
395
407
|
static create = async (params = {}, options = {}) => {
|
396
408
|
if (!params['automation']) {
|
@@ -453,6 +465,10 @@ class Automation {
|
|
453
465
|
throw new errors.InvalidParameterError(`Bad parameter: trigger_actions must be of type Array, received ${getType(params['trigger_actions'])}`)
|
454
466
|
}
|
455
467
|
|
468
|
+
if (params['recurring_day'] && !isInt(params['recurring_day'])) {
|
469
|
+
throw new errors.InvalidParameterError(`Bad parameter: recurring_day must be of type Int, received ${getType(params['recurring_day'])}`)
|
470
|
+
}
|
471
|
+
|
456
472
|
if (params['automation'] && !isString(params['automation'])) {
|
457
473
|
throw new errors.InvalidParameterError(`Bad parameter: automation must be of type String, received ${getType(params['automation'])}`)
|
458
474
|
}
|