@watchflow/n8n-nodes-watchflow 0.2.0 → 0.3.0
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Watchflow = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
4
5
|
const ApiHelper_1 = require("./modules/ApiHelper");
|
|
5
6
|
const Heartbeat_1 = require("./modules/Heartbeat");
|
|
6
7
|
class Watchflow {
|
|
@@ -148,10 +149,10 @@ class Watchflow {
|
|
|
148
149
|
}
|
|
149
150
|
catch (error) {
|
|
150
151
|
if (this.continueOnFail()) {
|
|
151
|
-
returnData.push({ json: { error: error.message } });
|
|
152
|
+
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
152
153
|
continue;
|
|
153
154
|
}
|
|
154
|
-
throw error;
|
|
155
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error, { itemIndex: i });
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
return [returnData];
|
|
@@ -8,13 +8,12 @@ class ApiHelper {
|
|
|
8
8
|
async request(method, url, body, headers = {}, option = {}) {
|
|
9
9
|
const options = {
|
|
10
10
|
url: `https://api.watchflow.io/heartbeat${url}`,
|
|
11
|
-
method,
|
|
11
|
+
method: method,
|
|
12
12
|
body,
|
|
13
13
|
headers: {
|
|
14
14
|
'Content-Type': 'application/json',
|
|
15
15
|
...headers,
|
|
16
16
|
},
|
|
17
|
-
json: true,
|
|
18
17
|
...option,
|
|
19
18
|
};
|
|
20
19
|
return this.executeFunctions.helpers.httpRequestWithAuthentication.call(this.executeFunctions, 'watchflowApi', options);
|
|
@@ -40,5 +40,9 @@ async function executeHeartbeat(apiHelper, itemIndex) {
|
|
|
40
40
|
body.data = data;
|
|
41
41
|
}
|
|
42
42
|
const responseData = await apiHelper.request('POST', endpoint, body);
|
|
43
|
-
|
|
43
|
+
const executionData = this.helpers.returnJsonArray(responseData);
|
|
44
|
+
return executionData.map((item) => ({
|
|
45
|
+
...item,
|
|
46
|
+
pairedItem: { item: itemIndex },
|
|
47
|
+
}));
|
|
44
48
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<
|
|
3
|
-
<
|
|
1
|
+
<svg width="54" height="22" viewBox="0 0 54 22" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
2
|
+
<circle cx="7" cy="16" r="4.5" fill="#FFD60A" opacity="1" stroke="#0B1220" stroke-width="1" />
|
|
3
|
+
<circle cx="22" cy="16" r="4.5" fill="#FFD60A" opacity="0.85" stroke="#0B1220" stroke-width="1" />
|
|
4
|
+
<circle cx="36" cy="7" r="4.5" fill="#FFD60A" opacity="0.7" stroke="#0B1220" stroke-width="1" />
|
|
5
|
+
<circle cx="47" cy="16" r="4.5" fill="#FFD60A" opacity="0.55" stroke="#0B1220" stroke-width="1" />
|
|
4
6
|
</svg>
|