backendless 7.3.2 → 7.3.3

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.
@@ -133,8 +133,7 @@ var Automations = /*#__PURE__*/function () {
133
133
  }, {
134
134
  key: "activateFlowTriggerById",
135
135
  value: function () {
136
- var _activateFlowTriggerById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flowId, triggerId, data, executionId) {
137
- var query;
136
+ var _activateFlowTriggerById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flowId, triggerId, data, execution) {
138
137
  return _regenerator["default"].wrap(function _callee4$(_context4) {
139
138
  while (1) switch (_context4.prev = _context4.next) {
140
139
  case 0:
@@ -156,22 +155,22 @@ var Automations = /*#__PURE__*/function () {
156
155
  }
157
156
  throw new Error('The "data" argument must be an object.');
158
157
  case 6:
159
- if (!(executionId !== undefined && (typeof executionId !== 'string' || !executionId))) {
158
+ if (!(execution !== undefined && (typeof execution !== 'string' || !execution))) {
160
159
  _context4.next = 8;
161
160
  break;
162
161
  }
163
- throw new Error('The "executionId" argument must be a non-empty string.');
162
+ throw new Error(
163
+ // eslint-disable-next-line
164
+ 'The "execution" argument must be a non-empty string and must be one of this values: "any", "all" or Execution ID.');
164
165
  case 8:
165
- query = {};
166
- if (executionId) {
167
- query.executionId = executionId;
168
- }
169
166
  return _context4.abrupt("return", this.app.request.post({
170
167
  url: "".concat(this.app.urls.automationFlow(), "/").concat(flowId, "/trigger/").concat(triggerId, "/activate"),
171
168
  data: data || {},
172
- query: query
169
+ query: {
170
+ execution: execution
171
+ }
173
172
  }));
174
- case 11:
173
+ case 9:
175
174
  case "end":
176
175
  return _context4.stop();
177
176
  }
@@ -133,8 +133,7 @@ var Automations = /*#__PURE__*/function () {
133
133
  }, {
134
134
  key: "activateFlowTriggerById",
135
135
  value: function () {
136
- var _activateFlowTriggerById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flowId, triggerId, data, executionId) {
137
- var query;
136
+ var _activateFlowTriggerById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flowId, triggerId, data, execution) {
138
137
  return _regenerator["default"].wrap(function _callee4$(_context4) {
139
138
  while (1) switch (_context4.prev = _context4.next) {
140
139
  case 0:
@@ -156,22 +155,22 @@ var Automations = /*#__PURE__*/function () {
156
155
  }
157
156
  throw new Error('The "data" argument must be an object.');
158
157
  case 6:
159
- if (!(executionId !== undefined && (typeof executionId !== 'string' || !executionId))) {
158
+ if (!(execution !== undefined && (typeof execution !== 'string' || !execution))) {
160
159
  _context4.next = 8;
161
160
  break;
162
161
  }
163
- throw new Error('The "executionId" argument must be a non-empty string.');
162
+ throw new Error(
163
+ // eslint-disable-next-line
164
+ 'The "execution" argument must be a non-empty string and must be one of this values: "any", "all" or Execution ID.');
164
165
  case 8:
165
- query = {};
166
- if (executionId) {
167
- query.executionId = executionId;
168
- }
169
166
  return _context4.abrupt("return", this.app.request.post({
170
167
  url: "".concat(this.app.urls.automationFlow(), "/").concat(flowId, "/trigger/").concat(triggerId, "/activate"),
171
168
  data: data || {},
172
- query: query
169
+ query: {
170
+ execution: execution
171
+ }
173
172
  }));
174
- case 11:
173
+ case 9:
175
174
  case "end":
176
175
  return _context4.stop();
177
176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backendless",
3
- "version": "7.3.2",
3
+ "version": "7.3.3",
4
4
  "description": "Backendless JavaScript SDK for Node.js and the browser",
5
5
  "browser": "dist/backendless.js",
6
6
  "main": "lib/index.js",
@@ -58,7 +58,7 @@ export default class Automations {
58
58
  })
59
59
  }
60
60
 
61
- async activateFlowTriggerById(flowId, triggerId, data, executionId) {
61
+ async activateFlowTriggerById(flowId, triggerId, data, execution) {
62
62
  if (!flowId || typeof flowId !== 'string') {
63
63
  throw new Error('The "flowId" argument must be provided and must be a string.')
64
64
  }
@@ -71,20 +71,17 @@ export default class Automations {
71
71
  throw new Error('The "data" argument must be an object.')
72
72
  }
73
73
 
74
- if (executionId !== undefined && (typeof executionId !== 'string' || !executionId)) {
75
- throw new Error('The "executionId" argument must be a non-empty string.')
76
- }
77
-
78
- const query = {}
79
-
80
- if (executionId) {
81
- query.executionId = executionId
74
+ if (execution !== undefined && (typeof execution !== 'string' || !execution)) {
75
+ throw new Error(
76
+ // eslint-disable-next-line
77
+ 'The "execution" argument must be a non-empty string and must be one of this values: "any", "all" or Execution ID.'
78
+ )
82
79
  }
83
80
 
84
81
  return this.app.request.post({
85
82
  url : `${this.app.urls.automationFlow()}/${flowId}/trigger/${triggerId}/activate`,
86
83
  data : data || {},
87
- query: query,
84
+ query: { execution },
88
85
  })
89
86
  }
90
87
  }