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.
- package/dist/backendless.js +62 -30
- package/dist/backendless.js.map +1 -1
- package/dist/backendless.min.js +2 -2
- package/es/automations/index.js +56 -29
- package/es/urls.js +5 -0
- package/lib/automations/index.js +56 -29
- package/lib/urls.js +5 -0
- package/package.json +1 -1
- package/src/automations/index.js +10 -0
- package/src/urls.js +4 -0
package/es/automations/index.js
CHANGED
|
@@ -53,35 +53,62 @@ var Automations = /*#__PURE__*/function () {
|
|
|
53
53
|
return activateFlow;
|
|
54
54
|
}()
|
|
55
55
|
}, {
|
|
56
|
-
key: "
|
|
56
|
+
key: "loadFlowExecutionContext",
|
|
57
57
|
value: function () {
|
|
58
|
-
var
|
|
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 (!(!
|
|
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
|
-
|
|
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
|
|
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
|
|
107
|
+
return _context3.stop();
|
|
81
108
|
}
|
|
82
|
-
},
|
|
109
|
+
}, _callee3, this);
|
|
83
110
|
}));
|
|
84
|
-
function activateFlowById(
|
|
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
|
|
93
|
-
return _regenerator["default"].wrap(function
|
|
94
|
-
while (1) switch (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
151
|
+
return _context4.stop();
|
|
125
152
|
}
|
|
126
|
-
},
|
|
153
|
+
}, _callee4, this);
|
|
127
154
|
}));
|
|
128
|
-
function activateFlowTrigger(
|
|
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
|
|
137
|
-
return _regenerator["default"].wrap(function
|
|
138
|
-
while (1) switch (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
202
|
+
return _context5.stop();
|
|
176
203
|
}
|
|
177
|
-
},
|
|
204
|
+
}, _callee5, this);
|
|
178
205
|
}));
|
|
179
|
-
function activateFlowTriggerById(
|
|
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() {
|
package/lib/automations/index.js
CHANGED
|
@@ -53,35 +53,62 @@ var Automations = /*#__PURE__*/function () {
|
|
|
53
53
|
return activateFlow;
|
|
54
54
|
}()
|
|
55
55
|
}, {
|
|
56
|
-
key: "
|
|
56
|
+
key: "loadFlowExecutionContext",
|
|
57
57
|
value: function () {
|
|
58
|
-
var
|
|
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 (!(!
|
|
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
|
-
|
|
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
|
|
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
|
|
107
|
+
return _context3.stop();
|
|
81
108
|
}
|
|
82
|
-
},
|
|
109
|
+
}, _callee3, this);
|
|
83
110
|
}));
|
|
84
|
-
function activateFlowById(
|
|
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
|
|
93
|
-
return _regenerator["default"].wrap(function
|
|
94
|
-
while (1) switch (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
151
|
+
return _context4.stop();
|
|
125
152
|
}
|
|
126
|
-
},
|
|
153
|
+
}, _callee4, this);
|
|
127
154
|
}));
|
|
128
|
-
function activateFlowTrigger(
|
|
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
|
|
137
|
-
return _regenerator["default"].wrap(function
|
|
138
|
-
while (1) switch (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
202
|
+
return _context5.stop();
|
|
176
203
|
}
|
|
177
|
-
},
|
|
204
|
+
}, _callee5, this);
|
|
178
205
|
}));
|
|
179
|
-
function activateFlowTriggerById(
|
|
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
package/src/automations/index.js
CHANGED
|
@@ -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
|
}
|