backendless 7.4.3 → 7.4.4

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.
@@ -53,35 +53,62 @@ var Automations = /*#__PURE__*/function () {
53
53
  return activateFlow;
54
54
  }()
55
55
  }, {
56
- key: "activateFlowById",
56
+ key: "loadFlowExecutionContext",
57
57
  value: function () {
58
- var _activateFlowById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(flowId, initialData) {
58
+ var _loadFlowExecutionContext = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(executionId) {
59
59
  return _regenerator["default"].wrap(function _callee2$(_context2) {
60
60
  while (1) switch (_context2.prev = _context2.next) {
61
61
  case 0:
62
- if (!(!flowId || typeof flowId !== 'string')) {
62
+ if (!(!executionId || typeof executionId !== 'string')) {
63
63
  _context2.next = 2;
64
64
  break;
65
65
  }
66
+ throw new Error('The "executionId" argument must be provided and must be a string.');
67
+ case 2:
68
+ return _context2.abrupt("return", this.app.request.get({
69
+ url: this.app.urls.automationFlowExecutionContext(executionId)
70
+ }));
71
+ case 3:
72
+ case "end":
73
+ return _context2.stop();
74
+ }
75
+ }, _callee2, this);
76
+ }));
77
+ function loadFlowExecutionContext(_x3) {
78
+ return _loadFlowExecutionContext.apply(this, arguments);
79
+ }
80
+ return loadFlowExecutionContext;
81
+ }()
82
+ }, {
83
+ key: "activateFlowById",
84
+ value: function () {
85
+ var _activateFlowById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(flowId, initialData) {
86
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
87
+ while (1) switch (_context3.prev = _context3.next) {
88
+ case 0:
89
+ if (!(!flowId || typeof flowId !== 'string')) {
90
+ _context3.next = 2;
91
+ break;
92
+ }
66
93
  throw new Error('The "flowId" argument must be provided and must be a string.');
67
94
  case 2:
68
95
  if (!(initialData !== undefined && !_utils["default"].isObject(initialData))) {
69
- _context2.next = 4;
96
+ _context3.next = 4;
70
97
  break;
71
98
  }
72
99
  throw new Error('The "initialData" argument must be an object.');
73
100
  case 4:
74
- return _context2.abrupt("return", this.app.request.post({
101
+ return _context3.abrupt("return", this.app.request.post({
75
102
  url: "".concat(this.app.urls.automationFlow(), "/").concat(flowId, "/activate"),
76
103
  data: initialData || {}
77
104
  }));
78
105
  case 5:
79
106
  case "end":
80
- return _context2.stop();
107
+ return _context3.stop();
81
108
  }
82
- }, _callee2, this);
109
+ }, _callee3, this);
83
110
  }));
84
- function activateFlowById(_x3, _x4) {
111
+ function activateFlowById(_x4, _x5) {
85
112
  return _activateFlowById.apply(this, arguments);
86
113
  }
87
114
  return activateFlowById;
@@ -89,29 +116,29 @@ var Automations = /*#__PURE__*/function () {
89
116
  }, {
90
117
  key: "activateFlowTrigger",
91
118
  value: function () {
92
- var _activateFlowTrigger = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(flowName, triggerName, data) {
93
- return _regenerator["default"].wrap(function _callee3$(_context3) {
94
- while (1) switch (_context3.prev = _context3.next) {
119
+ var _activateFlowTrigger = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flowName, triggerName, data) {
120
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
121
+ while (1) switch (_context4.prev = _context4.next) {
95
122
  case 0:
96
123
  if (!(!flowName || typeof flowName !== 'string')) {
97
- _context3.next = 2;
124
+ _context4.next = 2;
98
125
  break;
99
126
  }
100
127
  throw new Error('The "flowName" argument must be provided and must be a string.');
101
128
  case 2:
102
129
  if (!(!triggerName || typeof triggerName !== 'string')) {
103
- _context3.next = 4;
130
+ _context4.next = 4;
104
131
  break;
105
132
  }
106
133
  throw new Error('The "triggerName" argument must be provided and must be a string.');
107
134
  case 4:
108
135
  if (!(data !== undefined && !_utils["default"].isObject(data))) {
109
- _context3.next = 6;
136
+ _context4.next = 6;
110
137
  break;
111
138
  }
112
139
  throw new Error('The "data" argument must be an object.');
113
140
  case 6:
114
- return _context3.abrupt("return", this.app.request.post({
141
+ return _context4.abrupt("return", this.app.request.post({
115
142
  url: "".concat(this.app.urls.automationFlowTrigger(), "/activate-by-name"),
116
143
  query: {
117
144
  flowName: flowName,
@@ -121,11 +148,11 @@ var Automations = /*#__PURE__*/function () {
121
148
  }));
122
149
  case 7:
123
150
  case "end":
124
- return _context3.stop();
151
+ return _context4.stop();
125
152
  }
126
- }, _callee3, this);
153
+ }, _callee4, this);
127
154
  }));
128
- function activateFlowTrigger(_x5, _x6, _x7) {
155
+ function activateFlowTrigger(_x6, _x7, _x8) {
129
156
  return _activateFlowTrigger.apply(this, arguments);
130
157
  }
131
158
  return activateFlowTrigger;
@@ -133,37 +160,37 @@ var Automations = /*#__PURE__*/function () {
133
160
  }, {
134
161
  key: "activateFlowTriggerById",
135
162
  value: function () {
136
- var _activateFlowTriggerById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flowId, triggerId, data, execution) {
137
- return _regenerator["default"].wrap(function _callee4$(_context4) {
138
- while (1) switch (_context4.prev = _context4.next) {
163
+ var _activateFlowTriggerById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(flowId, triggerId, data, execution) {
164
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
165
+ while (1) switch (_context5.prev = _context5.next) {
139
166
  case 0:
140
167
  if (!(!flowId || typeof flowId !== 'string')) {
141
- _context4.next = 2;
168
+ _context5.next = 2;
142
169
  break;
143
170
  }
144
171
  throw new Error('The "flowId" argument must be provided and must be a string.');
145
172
  case 2:
146
173
  if (!(!triggerId || typeof triggerId !== 'string')) {
147
- _context4.next = 4;
174
+ _context5.next = 4;
148
175
  break;
149
176
  }
150
177
  throw new Error('The "triggerId" argument must be provided and must be a string.');
151
178
  case 4:
152
179
  if (!(data !== undefined && !_utils["default"].isObject(data))) {
153
- _context4.next = 6;
180
+ _context5.next = 6;
154
181
  break;
155
182
  }
156
183
  throw new Error('The "data" argument must be an object.');
157
184
  case 6:
158
185
  if (!(execution !== undefined && (typeof execution !== 'string' || !execution))) {
159
- _context4.next = 8;
186
+ _context5.next = 8;
160
187
  break;
161
188
  }
162
189
  throw new Error(
163
190
  // eslint-disable-next-line
164
191
  'The "execution" argument must be a non-empty string and must be one of this values: "any", "all" or Execution ID.');
165
192
  case 8:
166
- return _context4.abrupt("return", this.app.request.post({
193
+ return _context5.abrupt("return", this.app.request.post({
167
194
  url: "".concat(this.app.urls.automationFlow(), "/").concat(flowId, "/trigger/").concat(triggerId, "/activate"),
168
195
  data: data || {},
169
196
  query: {
@@ -172,11 +199,11 @@ var Automations = /*#__PURE__*/function () {
172
199
  }));
173
200
  case 9:
174
201
  case "end":
175
- return _context4.stop();
202
+ return _context5.stop();
176
203
  }
177
- }, _callee4, this);
204
+ }, _callee5, this);
178
205
  }));
179
- function activateFlowTriggerById(_x8, _x9, _x10, _x11) {
206
+ function activateFlowTriggerById(_x9, _x10, _x11, _x12) {
180
207
  return _activateFlowTriggerById.apply(this, arguments);
181
208
  }
182
209
  return activateFlowTriggerById;
package/es/urls.js CHANGED
@@ -36,6 +36,11 @@ var Urls = /*#__PURE__*/function () {
36
36
  value: function automationFlow() {
37
37
  return "".concat(this.automation(), "/flow");
38
38
  }
39
+ }, {
40
+ key: "automationFlowExecutionContext",
41
+ value: function automationFlowExecutionContext(executionId) {
42
+ return "".concat(this.automation(), "/flow/execution-context/").concat(executionId);
43
+ }
39
44
  }, {
40
45
  key: "automationFlowTrigger",
41
46
  value: function automationFlowTrigger() {
@@ -53,35 +53,62 @@ var Automations = /*#__PURE__*/function () {
53
53
  return activateFlow;
54
54
  }()
55
55
  }, {
56
- key: "activateFlowById",
56
+ key: "loadFlowExecutionContext",
57
57
  value: function () {
58
- var _activateFlowById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(flowId, initialData) {
58
+ var _loadFlowExecutionContext = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(executionId) {
59
59
  return _regenerator["default"].wrap(function _callee2$(_context2) {
60
60
  while (1) switch (_context2.prev = _context2.next) {
61
61
  case 0:
62
- if (!(!flowId || typeof flowId !== 'string')) {
62
+ if (!(!executionId || typeof executionId !== 'string')) {
63
63
  _context2.next = 2;
64
64
  break;
65
65
  }
66
+ throw new Error('The "executionId" argument must be provided and must be a string.');
67
+ case 2:
68
+ return _context2.abrupt("return", this.app.request.get({
69
+ url: this.app.urls.automationFlowExecutionContext(executionId)
70
+ }));
71
+ case 3:
72
+ case "end":
73
+ return _context2.stop();
74
+ }
75
+ }, _callee2, this);
76
+ }));
77
+ function loadFlowExecutionContext(_x3) {
78
+ return _loadFlowExecutionContext.apply(this, arguments);
79
+ }
80
+ return loadFlowExecutionContext;
81
+ }()
82
+ }, {
83
+ key: "activateFlowById",
84
+ value: function () {
85
+ var _activateFlowById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(flowId, initialData) {
86
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
87
+ while (1) switch (_context3.prev = _context3.next) {
88
+ case 0:
89
+ if (!(!flowId || typeof flowId !== 'string')) {
90
+ _context3.next = 2;
91
+ break;
92
+ }
66
93
  throw new Error('The "flowId" argument must be provided and must be a string.');
67
94
  case 2:
68
95
  if (!(initialData !== undefined && !_utils["default"].isObject(initialData))) {
69
- _context2.next = 4;
96
+ _context3.next = 4;
70
97
  break;
71
98
  }
72
99
  throw new Error('The "initialData" argument must be an object.');
73
100
  case 4:
74
- return _context2.abrupt("return", this.app.request.post({
101
+ return _context3.abrupt("return", this.app.request.post({
75
102
  url: "".concat(this.app.urls.automationFlow(), "/").concat(flowId, "/activate"),
76
103
  data: initialData || {}
77
104
  }));
78
105
  case 5:
79
106
  case "end":
80
- return _context2.stop();
107
+ return _context3.stop();
81
108
  }
82
- }, _callee2, this);
109
+ }, _callee3, this);
83
110
  }));
84
- function activateFlowById(_x3, _x4) {
111
+ function activateFlowById(_x4, _x5) {
85
112
  return _activateFlowById.apply(this, arguments);
86
113
  }
87
114
  return activateFlowById;
@@ -89,29 +116,29 @@ var Automations = /*#__PURE__*/function () {
89
116
  }, {
90
117
  key: "activateFlowTrigger",
91
118
  value: function () {
92
- var _activateFlowTrigger = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(flowName, triggerName, data) {
93
- return _regenerator["default"].wrap(function _callee3$(_context3) {
94
- while (1) switch (_context3.prev = _context3.next) {
119
+ var _activateFlowTrigger = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flowName, triggerName, data) {
120
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
121
+ while (1) switch (_context4.prev = _context4.next) {
95
122
  case 0:
96
123
  if (!(!flowName || typeof flowName !== 'string')) {
97
- _context3.next = 2;
124
+ _context4.next = 2;
98
125
  break;
99
126
  }
100
127
  throw new Error('The "flowName" argument must be provided and must be a string.');
101
128
  case 2:
102
129
  if (!(!triggerName || typeof triggerName !== 'string')) {
103
- _context3.next = 4;
130
+ _context4.next = 4;
104
131
  break;
105
132
  }
106
133
  throw new Error('The "triggerName" argument must be provided and must be a string.');
107
134
  case 4:
108
135
  if (!(data !== undefined && !_utils["default"].isObject(data))) {
109
- _context3.next = 6;
136
+ _context4.next = 6;
110
137
  break;
111
138
  }
112
139
  throw new Error('The "data" argument must be an object.');
113
140
  case 6:
114
- return _context3.abrupt("return", this.app.request.post({
141
+ return _context4.abrupt("return", this.app.request.post({
115
142
  url: "".concat(this.app.urls.automationFlowTrigger(), "/activate-by-name"),
116
143
  query: {
117
144
  flowName: flowName,
@@ -121,11 +148,11 @@ var Automations = /*#__PURE__*/function () {
121
148
  }));
122
149
  case 7:
123
150
  case "end":
124
- return _context3.stop();
151
+ return _context4.stop();
125
152
  }
126
- }, _callee3, this);
153
+ }, _callee4, this);
127
154
  }));
128
- function activateFlowTrigger(_x5, _x6, _x7) {
155
+ function activateFlowTrigger(_x6, _x7, _x8) {
129
156
  return _activateFlowTrigger.apply(this, arguments);
130
157
  }
131
158
  return activateFlowTrigger;
@@ -133,37 +160,37 @@ var Automations = /*#__PURE__*/function () {
133
160
  }, {
134
161
  key: "activateFlowTriggerById",
135
162
  value: function () {
136
- var _activateFlowTriggerById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flowId, triggerId, data, execution) {
137
- return _regenerator["default"].wrap(function _callee4$(_context4) {
138
- while (1) switch (_context4.prev = _context4.next) {
163
+ var _activateFlowTriggerById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(flowId, triggerId, data, execution) {
164
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
165
+ while (1) switch (_context5.prev = _context5.next) {
139
166
  case 0:
140
167
  if (!(!flowId || typeof flowId !== 'string')) {
141
- _context4.next = 2;
168
+ _context5.next = 2;
142
169
  break;
143
170
  }
144
171
  throw new Error('The "flowId" argument must be provided and must be a string.');
145
172
  case 2:
146
173
  if (!(!triggerId || typeof triggerId !== 'string')) {
147
- _context4.next = 4;
174
+ _context5.next = 4;
148
175
  break;
149
176
  }
150
177
  throw new Error('The "triggerId" argument must be provided and must be a string.');
151
178
  case 4:
152
179
  if (!(data !== undefined && !_utils["default"].isObject(data))) {
153
- _context4.next = 6;
180
+ _context5.next = 6;
154
181
  break;
155
182
  }
156
183
  throw new Error('The "data" argument must be an object.');
157
184
  case 6:
158
185
  if (!(execution !== undefined && (typeof execution !== 'string' || !execution))) {
159
- _context4.next = 8;
186
+ _context5.next = 8;
160
187
  break;
161
188
  }
162
189
  throw new Error(
163
190
  // eslint-disable-next-line
164
191
  'The "execution" argument must be a non-empty string and must be one of this values: "any", "all" or Execution ID.');
165
192
  case 8:
166
- return _context4.abrupt("return", this.app.request.post({
193
+ return _context5.abrupt("return", this.app.request.post({
167
194
  url: "".concat(this.app.urls.automationFlow(), "/").concat(flowId, "/trigger/").concat(triggerId, "/activate"),
168
195
  data: data || {},
169
196
  query: {
@@ -172,11 +199,11 @@ var Automations = /*#__PURE__*/function () {
172
199
  }));
173
200
  case 9:
174
201
  case "end":
175
- return _context4.stop();
202
+ return _context5.stop();
176
203
  }
177
- }, _callee4, this);
204
+ }, _callee5, this);
178
205
  }));
179
- function activateFlowTriggerById(_x8, _x9, _x10, _x11) {
206
+ function activateFlowTriggerById(_x9, _x10, _x11, _x12) {
180
207
  return _activateFlowTriggerById.apply(this, arguments);
181
208
  }
182
209
  return activateFlowTriggerById;
package/lib/urls.js CHANGED
@@ -36,6 +36,11 @@ var Urls = /*#__PURE__*/function () {
36
36
  value: function automationFlow() {
37
37
  return "".concat(this.automation(), "/flow");
38
38
  }
39
+ }, {
40
+ key: "automationFlowExecutionContext",
41
+ value: function automationFlowExecutionContext(executionId) {
42
+ return "".concat(this.automation(), "/flow/execution-context/").concat(executionId);
43
+ }
39
44
  }, {
40
45
  key: "automationFlowTrigger",
41
46
  value: function automationFlowTrigger() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backendless",
3
- "version": "7.4.3",
3
+ "version": "7.4.4",
4
4
  "description": "Backendless JavaScript SDK for Node.js and the browser",
5
5
  "browser": "dist/backendless.js",
6
6
  "main": "lib/index.js",
@@ -23,6 +23,16 @@ export default class Automations {
23
23
  })
24
24
  }
25
25
 
26
+ async loadFlowExecutionContext(executionId) {
27
+ if (!executionId || typeof executionId !== 'string') {
28
+ throw new Error('The "executionId" argument must be provided and must be a string.')
29
+ }
30
+
31
+ return this.app.request.get({
32
+ url : this.app.urls.automationFlowExecutionContext(executionId),
33
+ })
34
+ }
35
+
26
36
  async activateFlowById(flowId, initialData) {
27
37
  if (!flowId || typeof flowId !== 'string') {
28
38
  throw new Error('The "flowId" argument must be provided and must be a string.')
package/src/urls.js CHANGED
@@ -23,6 +23,10 @@ export default class Urls {
23
23
  return `${this.automation()}/flow`
24
24
  }
25
25
 
26
+ automationFlowExecutionContext(executionId) {
27
+ return `${this.automation()}/flow/execution-context/${executionId}`
28
+ }
29
+
26
30
  automationFlowTrigger() {
27
31
  return `${this.automationFlow()}/trigger`
28
32
  }