files.com 1.0.285 → 1.0.286
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/Errors.md +1 -0
- package/docs/models/Automation.md +15 -0
- package/lib/Errors.js +317 -303
- package/lib/models/Automation.js +161 -108
- package/package.json +1 -1
- package/src/Errors.js +1 -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.
|