files.com 1.0.152 → 1.0.153
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/lib/models/Automation.js +14 -36
- package/package.json +1 -1
- package/src/models/Automation.js +0 -16
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.153
|
package/lib/models/Automation.js
CHANGED
@@ -143,12 +143,6 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
143
143
|
(0, _defineProperty2.default)(this, "setTriggerActions", function (value) {
|
144
144
|
_this.attributes.trigger_actions = value;
|
145
145
|
});
|
146
|
-
(0, _defineProperty2.default)(this, "getTriggerActionPath", function () {
|
147
|
-
return _this.attributes.trigger_action_path;
|
148
|
-
});
|
149
|
-
(0, _defineProperty2.default)(this, "setTriggerActionPath", function (value) {
|
150
|
-
_this.attributes.trigger_action_path = value;
|
151
|
-
});
|
152
146
|
(0, _defineProperty2.default)(this, "getValue", function () {
|
153
147
|
return _this.attributes.value;
|
154
148
|
});
|
@@ -308,53 +302,45 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
308
302
|
throw new Error("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(trigger_actions)));
|
309
303
|
|
310
304
|
case 36:
|
311
|
-
if (!(params['trigger_action_path'] && !(0, _utils.isString)(params['trigger_action_path']))) {
|
312
|
-
_context.next = 38;
|
313
|
-
break;
|
314
|
-
}
|
315
|
-
|
316
|
-
throw new Error("Bad parameter: trigger_action_path must be of type String, received ".concat((0, _utils.getType)(trigger_action_path)));
|
317
|
-
|
318
|
-
case 38:
|
319
305
|
if (params['id']) {
|
320
|
-
_context.next =
|
306
|
+
_context.next = 42;
|
321
307
|
break;
|
322
308
|
}
|
323
309
|
|
324
310
|
if (!_this.attributes.id) {
|
325
|
-
_context.next =
|
311
|
+
_context.next = 41;
|
326
312
|
break;
|
327
313
|
}
|
328
314
|
|
329
315
|
params['id'] = _this.id;
|
330
|
-
_context.next =
|
316
|
+
_context.next = 42;
|
331
317
|
break;
|
332
318
|
|
333
|
-
case
|
319
|
+
case 41:
|
334
320
|
throw new Error('Parameter missing: id');
|
335
321
|
|
336
|
-
case
|
322
|
+
case 42:
|
337
323
|
if (params['automation']) {
|
338
|
-
_context.next =
|
324
|
+
_context.next = 48;
|
339
325
|
break;
|
340
326
|
}
|
341
327
|
|
342
328
|
if (!_this.attributes.automation) {
|
343
|
-
_context.next =
|
329
|
+
_context.next = 47;
|
344
330
|
break;
|
345
331
|
}
|
346
332
|
|
347
333
|
params['automation'] = _this.automation;
|
348
|
-
_context.next =
|
334
|
+
_context.next = 48;
|
349
335
|
break;
|
350
336
|
|
351
|
-
case
|
337
|
+
case 47:
|
352
338
|
throw new Error('Parameter missing: automation');
|
353
339
|
|
354
|
-
case
|
340
|
+
case 48:
|
355
341
|
return _context.abrupt("return", _Api.default.sendRequest("/automations/".concat(params['id']), 'PATCH', params, _this.options));
|
356
342
|
|
357
|
-
case
|
343
|
+
case 49:
|
358
344
|
case "end":
|
359
345
|
return _context.stop();
|
360
346
|
}
|
@@ -704,22 +690,14 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
704
690
|
throw new Error("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(trigger_actions)));
|
705
691
|
|
706
692
|
case 32:
|
707
|
-
|
708
|
-
_context5.next = 34;
|
709
|
-
break;
|
710
|
-
}
|
711
|
-
|
712
|
-
throw new Error("Bad parameter: trigger_action_path must be of type String, received ".concat((0, _utils.getType)(trigger_action_path)));
|
713
|
-
|
714
|
-
case 34:
|
715
|
-
_context5.next = 36;
|
693
|
+
_context5.next = 34;
|
716
694
|
return _Api.default.sendRequest("/automations", 'POST', params, options);
|
717
695
|
|
718
|
-
case
|
696
|
+
case 34:
|
719
697
|
response = _context5.sent;
|
720
698
|
return _context5.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, options));
|
721
699
|
|
722
|
-
case
|
700
|
+
case 36:
|
723
701
|
case "end":
|
724
702
|
return _context5.stop();
|
725
703
|
}
|
package/package.json
CHANGED
package/src/models/Automation.js
CHANGED
@@ -141,13 +141,6 @@ class Automation {
|
|
141
141
|
this.attributes.trigger_actions = value
|
142
142
|
}
|
143
143
|
|
144
|
-
// string # If trigger is `action`, this is the path to watch for the specified trigger actions.
|
145
|
-
getTriggerActionPath = () => this.attributes.trigger_action_path
|
146
|
-
|
147
|
-
setTriggerActionPath = value => {
|
148
|
-
this.attributes.trigger_action_path = value
|
149
|
-
}
|
150
|
-
|
151
144
|
// object # A Hash of attributes specific to the automation type.
|
152
145
|
getValue = () => this.attributes.value
|
153
146
|
|
@@ -179,7 +172,6 @@ class Automation {
|
|
179
172
|
// name - string - Name for this automation.
|
180
173
|
// trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
181
174
|
// 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
|
182
|
-
// trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
|
183
175
|
// value - object - A Hash of attributes specific to the automation type.
|
184
176
|
update = async (params = {}) => {
|
185
177
|
if (!this.attributes.id) {
|
@@ -236,9 +228,6 @@ class Automation {
|
|
236
228
|
if (params['trigger_actions'] && !isArray(params['trigger_actions'])) {
|
237
229
|
throw new Error(`Bad parameter: trigger_actions must be of type Array, received ${getType(trigger_actions)}`)
|
238
230
|
}
|
239
|
-
if (params['trigger_action_path'] && !isString(params['trigger_action_path'])) {
|
240
|
-
throw new Error(`Bad parameter: trigger_action_path must be of type String, received ${getType(trigger_action_path)}`)
|
241
|
-
}
|
242
231
|
|
243
232
|
if (!params['id']) {
|
244
233
|
if (this.attributes.id) {
|
@@ -370,7 +359,6 @@ class Automation {
|
|
370
359
|
// name - string - Name for this automation.
|
371
360
|
// trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
372
361
|
// 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
|
373
|
-
// trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
|
374
362
|
// value - object - A Hash of attributes specific to the automation type.
|
375
363
|
static create = async (params = {}, options = {}) => {
|
376
364
|
if (!params['automation']) {
|
@@ -433,10 +421,6 @@ class Automation {
|
|
433
421
|
throw new Error(`Bad parameter: trigger_actions must be of type Array, received ${getType(trigger_actions)}`)
|
434
422
|
}
|
435
423
|
|
436
|
-
if (params['trigger_action_path'] && !isString(params['trigger_action_path'])) {
|
437
|
-
throw new Error(`Bad parameter: trigger_action_path must be of type String, received ${getType(trigger_action_path)}`)
|
438
|
-
}
|
439
|
-
|
440
424
|
const response = await Api.sendRequest(`/automations`, 'POST', params, options)
|
441
425
|
|
442
426
|
return new Automation(response?.data, options)
|