n8n-nodes-version 0.2.0 → 0.2.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-version",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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/ganzerhurensohn/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>
|