n8n-nodes-version 0.2.0 → 0.2.2
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/README.md
CHANGED
|
@@ -1,30 +1,47 @@
|
|
|
1
|
-
# n8n-version
|
|
1
|
+
# n8n-nodes-version
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/n8n-nodes-version)
|
|
4
|
+
[](https://www.npmjs.com/package/n8n-nodes-version)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
n8n nodes to check the current installed version, monitor for updates, and fetch changelogs directly from GitHub.
|
|
8
|
+
|
|
9
|
+
**Note:** [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
10
|
+
[Icon](https://icons8.com/icon/9sDRgODM0vNc/refresh) provided by [icons8.com](https://icons8.com/)
|
|
11
|
+
|
|
12
|
+
---
|
|
7
13
|
|
|
8
14
|
## Features
|
|
9
15
|
|
|
10
|
-
- Check
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- Trigger workflows based on version status
|
|
16
|
+
- **Check Current Version**: Retrieve the installed version of your n8n instance.
|
|
17
|
+
- **Update Monitoring**: Compare your version with the latest release on [npm](https://www.npmjs.com/package/n8n).
|
|
18
|
+
- **Changelog Retrieval**: Fetch detailed release notes directly from the official GitHub repository.
|
|
19
|
+
- **Automation Triggers**: Start workflows automatically when updates are available.
|
|
15
20
|
|
|
16
|
-
##
|
|
21
|
+
## Installation
|
|
17
22
|
|
|
18
|
-
###
|
|
23
|
+
### via n8n UI (Recommended)
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
1. Go to **Settings > Community Nodes**.
|
|
26
|
+
2. Click **Install a community node**.
|
|
27
|
+
3. Enter `n8n-nodes-version` in the text field.
|
|
28
|
+
4. Agree to the risks and click **Install**.
|
|
21
29
|
|
|
22
|
-
|
|
30
|
+
### via npm (CLI)
|
|
23
31
|
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
For Docker-based or manual installations, run the following command in your n8n root directory:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install n8n-nodes-version
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Nodes
|
|
41
|
+
|
|
42
|
+
### Version Checker
|
|
43
|
+
|
|
44
|
+
Retrieves version information and optionally fetches changelogs.
|
|
28
45
|
|
|
29
46
|
**Output Example:**
|
|
30
47
|
|
|
@@ -40,41 +57,15 @@ Checks the current n8n version and provides various options:
|
|
|
40
57
|
|
|
41
58
|
### Version Trigger
|
|
42
59
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
**Properties:**
|
|
46
|
-
|
|
47
|
-
- **Cron Expression**: Schedule for version checks (e.g., `0 * * * *` for hourly)
|
|
48
|
-
- **Trigger Condition**:
|
|
49
|
-
- **Update Available**: Trigger when new version exists
|
|
50
|
-
- **On Latest Version**: Trigger when already up-to-date
|
|
51
|
-
- **Always**: Trigger on every check
|
|
52
|
-
|
|
53
|
-
**Use Cases:**
|
|
54
|
-
|
|
55
|
-
- Automated update notifications
|
|
56
|
-
- Monitoring version status
|
|
57
|
-
- Scheduled version audits
|
|
58
|
-
|
|
59
|
-
## Installation
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
npm install n8n-nodes-version
|
|
63
|
-
```
|
|
60
|
+
A schedule-based trigger that fires workflows based on version status.
|
|
64
61
|
|
|
65
|
-
|
|
62
|
+
**Configuration:**
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
npm run dev
|
|
70
|
-
|
|
71
|
-
# Build
|
|
72
|
-
npm run build
|
|
64
|
+
- **Cron Expression**: Define how often to check (e.g., `0 * * * *`).
|
|
65
|
+
- **Trigger Condition**: Choose between `Update Available`, `On Latest Version`, or `Always`.
|
|
73
66
|
|
|
74
|
-
|
|
75
|
-
npm run lint
|
|
76
|
-
```
|
|
67
|
+
---
|
|
77
68
|
|
|
78
|
-
## License
|
|
69
|
+
## 📄 License
|
|
79
70
|
|
|
80
|
-
MIT
|
|
71
|
+
[MIT](https://opensource.org/licenses/MIT)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-version",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "n8n nodes to check version, monitor updates, and fetch changelogs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package"
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"name": "Community",
|
|
12
12
|
"email": "example@example.com"
|
|
13
13
|
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/jamesmoorwalter/n8n-version-node.git"
|
|
17
|
+
},
|
|
14
18
|
"scripts": {
|
|
15
19
|
"build": "tsc && gulp build:icons",
|
|
16
20
|
"dev": "tsc --watch",
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.N8nChangelog = void 0;
|
|
7
|
-
const https_1 = __importDefault(require("https"));
|
|
8
|
-
/**
|
|
9
|
-
* Fetch changelog from GitHub releases
|
|
10
|
-
*/
|
|
11
|
-
function getChangelog(version) {
|
|
12
|
-
return new Promise((resolve) => {
|
|
13
|
-
try {
|
|
14
|
-
const options = {
|
|
15
|
-
hostname: 'api.github.com',
|
|
16
|
-
path: `/repos/n8n-io/n8n/releases/tags/n8n@${version}`,
|
|
17
|
-
headers: {
|
|
18
|
-
'User-Agent': 'n8n-changelog-node',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
https_1.default
|
|
22
|
-
.get(options, (res) => {
|
|
23
|
-
let data = '';
|
|
24
|
-
res.on('data', (chunk) => (data += chunk));
|
|
25
|
-
res.on('end', () => {
|
|
26
|
-
try {
|
|
27
|
-
if (res.statusCode === 404) {
|
|
28
|
-
resolve({ body: '', error: `Release n8n@${version} not found` });
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (res.statusCode !== 200) {
|
|
32
|
-
resolve({ body: '', error: `GitHub API returned status ${res.statusCode}` });
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const parsed = JSON.parse(data);
|
|
36
|
-
resolve({ body: parsed.body || '' });
|
|
37
|
-
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
console.error('[Changelog] Failed to parse GitHub response:', err);
|
|
40
|
-
resolve({ body: '', error: 'Failed to parse GitHub response' });
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
})
|
|
44
|
-
.on('error', (err) => {
|
|
45
|
-
console.error('[Changelog] Failed to fetch from GitHub:', err);
|
|
46
|
-
resolve({ body: '', error: `Failed to fetch from GitHub: ${err.message}` });
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
catch (err) {
|
|
50
|
-
console.error('[Changelog] Unexpected error:', err);
|
|
51
|
-
resolve({ body: '', error: `Unexpected error: ${err}` });
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Strip markdown links from text
|
|
57
|
-
*/
|
|
58
|
-
function stripMarkdownLinks(text) {
|
|
59
|
-
return text.replace(/\[([^\]]+)\]\([^\)]+\)/g, '$1');
|
|
60
|
-
}
|
|
61
|
-
class N8nChangelog {
|
|
62
|
-
constructor() {
|
|
63
|
-
this.description = {
|
|
64
|
-
displayName: 'n8n Changelog',
|
|
65
|
-
name: 'n8nChangelog',
|
|
66
|
-
icon: 'file:n8n-version.svg',
|
|
67
|
-
group: ['transform'],
|
|
68
|
-
version: 1,
|
|
69
|
-
description: 'Fetches changelog for a specific n8n version from GitHub',
|
|
70
|
-
defaults: {
|
|
71
|
-
name: 'n8n Changelog',
|
|
72
|
-
},
|
|
73
|
-
inputs: ['main'],
|
|
74
|
-
outputs: ['main'],
|
|
75
|
-
properties: [
|
|
76
|
-
{
|
|
77
|
-
displayName: 'Version Source',
|
|
78
|
-
name: 'versionSource',
|
|
79
|
-
type: 'options',
|
|
80
|
-
options: [
|
|
81
|
-
{
|
|
82
|
-
name: 'From Parameter',
|
|
83
|
-
value: 'parameter',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'From Input',
|
|
87
|
-
value: 'input',
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
default: 'parameter',
|
|
91
|
-
description: 'Where to get the version from',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
displayName: 'Version',
|
|
95
|
-
name: 'version',
|
|
96
|
-
type: 'string',
|
|
97
|
-
default: '',
|
|
98
|
-
placeholder: '1.0.0',
|
|
99
|
-
description: 'The n8n version to fetch changelog for (e.g., "1.0.0")',
|
|
100
|
-
displayOptions: {
|
|
101
|
-
show: {
|
|
102
|
-
versionSource: ['parameter'],
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
displayName: 'Version Field',
|
|
108
|
-
name: 'versionField',
|
|
109
|
-
type: 'string',
|
|
110
|
-
default: 'latestVersion',
|
|
111
|
-
description: 'The field name containing the version in input data',
|
|
112
|
-
displayOptions: {
|
|
113
|
-
show: {
|
|
114
|
-
versionSource: ['input'],
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
displayName: 'Include Links',
|
|
120
|
-
name: 'includeLinks',
|
|
121
|
-
type: 'boolean',
|
|
122
|
-
default: true,
|
|
123
|
-
description: 'Whether to keep markdown links in the changelog text',
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
async execute() {
|
|
129
|
-
const items = this.getInputData();
|
|
130
|
-
const returnData = [];
|
|
131
|
-
for (let i = 0; i < items.length; i++) {
|
|
132
|
-
try {
|
|
133
|
-
const versionSource = this.getNodeParameter('versionSource', i);
|
|
134
|
-
const includeLinks = this.getNodeParameter('includeLinks', i);
|
|
135
|
-
let version;
|
|
136
|
-
if (versionSource === 'input') {
|
|
137
|
-
const versionField = this.getNodeParameter('versionField', i);
|
|
138
|
-
version = items[i].json[versionField];
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
version = this.getNodeParameter('version', i);
|
|
142
|
-
}
|
|
143
|
-
if (!version) {
|
|
144
|
-
returnData.push({
|
|
145
|
-
json: {
|
|
146
|
-
error: 'No version provided',
|
|
147
|
-
changelog: '',
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
const { body, error } = await getChangelog(version);
|
|
153
|
-
let changelog = body;
|
|
154
|
-
if (!includeLinks && changelog) {
|
|
155
|
-
changelog = stripMarkdownLinks(changelog);
|
|
156
|
-
}
|
|
157
|
-
returnData.push({
|
|
158
|
-
json: {
|
|
159
|
-
version,
|
|
160
|
-
changelog,
|
|
161
|
-
error: error || undefined,
|
|
162
|
-
},
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
catch (err) {
|
|
166
|
-
console.error('[Changelog] Error processing item:', err);
|
|
167
|
-
returnData.push({
|
|
168
|
-
json: {
|
|
169
|
-
error: `Failed to process: ${err}`,
|
|
170
|
-
changelog: '',
|
|
171
|
-
},
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
return [returnData];
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
exports.N8nChangelog = N8nChangelog;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,256,256" width="256px" height="256px" fill-rule="nonzero"><g fill="#f188a2" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><g transform="scale(5.12,5.12)"><path d="M20,3c-5.514,0 -10,4.486 -10,10v20.17188l-3.58594,-3.58594c-0.37701,-0.38755 -0.89487,-0.60597 -1.43555,-0.60547c-0.81349,0.00101 -1.54533,0.49459 -1.85108,1.24844c-0.30574,0.75385 -0.12447,1.61777 0.4585,2.18515l7,7c0.78106,0.78074 2.04706,0.78074 2.82812,0l7,-7c0.52248,-0.50163 0.73295,-1.24653 0.55024,-1.94742c-0.18271,-0.70088 -0.73006,-1.24823 -1.43094,-1.43094c-0.70088,-0.18271 -1.44578,0.02776 -1.94742,0.55024l-3.58594,3.58594v-20.17187c0,-3.309 2.691,-6 6,-6h10.46875l0.26563,-4zM37.9707,10c-0.52023,0.00778 -1.01695,0.21796 -1.38477,0.58594l-7,7c-0.52248,0.50163 -0.73295,1.24653 -0.55024,1.94742c0.18271,0.70088 0.73006,1.24823 1.43094,1.43094c0.70088,0.18271 1.44578,-0.02776 1.94742,-0.55024l3.58594,-3.58594v20.17188c0,3.309 -2.691,6 -6,6h-10.49023l-0.25391,4h10.74414c5.514,0 10,-4.486 10,-10v-20.17187l3.58594,3.58594c0.50163,0.52248 1.24653,0.73295 1.94742,0.55024c0.70088,-0.18271 1.24823,-0.73006 1.43094,-1.43094c0.18271,-0.70088 -0.02776,-1.44578 -0.55024,-1.94742l-7,-7c-0.38217,-0.38233 -0.90283,-0.5937 -1.44336,-0.58594z"></path></g></g></svg>
|