@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
- return this.helpers.returnJsonArray(responseData);
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="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M512 128C300.25 128 128 300.25 128 512C128 723.75 300.25 896 512 896C723.75 896 896 723.75 896 512C896 300.25 723.75 128 512 128ZM512 832C335.5 832 192 688.5 192 512C192 335.5 335.5 192 512 192C688.5 192 832 335.5 832 512C832 688.5 688.5 832 512 832Z" fill="#2D3748"/>
3
- <path d="M512 256C370.75 256 256 370.75 256 512C256 653.25 370.75 768 512 768C653.25 768 768 653.25 768 512C768 370.75 653.25 256 512 256ZM608 512L448 608V416L608 512Z" fill="#2D3748"/>
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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@watchflow/n8n-nodes-watchflow",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "n8n node for Watchflow.io",
5
5
  "keywords": [
6
6
  "watchflow",