files.com 1.0.285 → 1.0.287
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/Errors.md +2 -0
- package/docs/models/Automation.md +15 -0
- package/lib/Errors.js +341 -313
- package/lib/models/Automation.js +161 -108
- package/package.json +1 -1
- package/src/Errors.js +2 -0
- package/src/models/Automation.js +28 -0
package/src/models/Automation.js
CHANGED
@@ -192,6 +192,34 @@ class Automation {
|
|
192
192
|
}
|
193
193
|
|
194
194
|
|
195
|
+
// Manually run automation
|
196
|
+
manualRun = async (params = {}) => {
|
197
|
+
if (!this.attributes.id) {
|
198
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
199
|
+
}
|
200
|
+
|
201
|
+
if (!isObject(params)) {
|
202
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
203
|
+
}
|
204
|
+
|
205
|
+
params.id = this.attributes.id
|
206
|
+
if (params['id'] && !isInt(params['id'])) {
|
207
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
208
|
+
}
|
209
|
+
|
210
|
+
if (!params['id']) {
|
211
|
+
if (this.attributes.id) {
|
212
|
+
params['id'] = this.id
|
213
|
+
} else {
|
214
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
215
|
+
}
|
216
|
+
}
|
217
|
+
|
218
|
+
const response = await Api.sendRequest(`/automations/${encodeURIComponent(params['id'])}/manual_run`, 'POST', params, this.options)
|
219
|
+
|
220
|
+
return response?.data
|
221
|
+
}
|
222
|
+
|
195
223
|
// Parameters:
|
196
224
|
// source - string - Source Path
|
197
225
|
// destination - string - DEPRECATED: Destination Path. Use `destinations` instead.
|