n8n-nodes-sftp-custom 0.1.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.
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SftpApi = void 0;
|
|
4
|
+
class SftpApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'sftpApi';
|
|
7
|
+
this.displayName = 'SFTP API';
|
|
8
|
+
this.properties = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Host',
|
|
11
|
+
name: 'host',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: '',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
displayName: 'Port',
|
|
17
|
+
name: 'port',
|
|
18
|
+
type: 'number',
|
|
19
|
+
default: 22,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Username',
|
|
23
|
+
name: 'username',
|
|
24
|
+
type: 'string',
|
|
25
|
+
default: '',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Password',
|
|
29
|
+
name: 'password',
|
|
30
|
+
type: 'string',
|
|
31
|
+
typeOptions: { password: true },
|
|
32
|
+
default: '',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.SftpApi = SftpApi;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Sftp = void 0;
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
const ssh2_1 = require("ssh2");
|
|
6
|
+
class Sftp {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'SFTP',
|
|
10
|
+
name: 'sftp',
|
|
11
|
+
icon: 'file:sftp.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
description: 'SFTP operations with ssh-dss support',
|
|
15
|
+
defaults: { name: 'SFTP' },
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main'],
|
|
18
|
+
credentials: [
|
|
19
|
+
{
|
|
20
|
+
name: 'sftpApi',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
properties: [
|
|
25
|
+
{
|
|
26
|
+
displayName: 'Operation',
|
|
27
|
+
name: 'operation',
|
|
28
|
+
type: 'options',
|
|
29
|
+
options: [
|
|
30
|
+
{ name: 'Connect Test', value: 'connect' },
|
|
31
|
+
],
|
|
32
|
+
default: 'connect',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async execute() {
|
|
38
|
+
const credentials = await this.getCredentials('sftpApi');
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
const conn = new ssh2_1.Client();
|
|
41
|
+
conn.on('ready', () => {
|
|
42
|
+
conn.end();
|
|
43
|
+
resolve([[{ json: { success: true } }]]);
|
|
44
|
+
});
|
|
45
|
+
conn.on('error', (err) => {
|
|
46
|
+
reject(err);
|
|
47
|
+
});
|
|
48
|
+
conn.connect({
|
|
49
|
+
host: credentials.host,
|
|
50
|
+
port: credentials.port || 22,
|
|
51
|
+
username: credentials.username,
|
|
52
|
+
password: credentials.password,
|
|
53
|
+
algorithms: {
|
|
54
|
+
serverHostKey: ['ssh-dss', 'ssh-rsa', 'ecdsa-sha2-nistp256'],
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.Sftp = Sftp;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
5
|
+
<svg height="800px" width="800px" version="1.1" id="_x32_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
6
|
+
viewBox="0 0 512 512" xml:space="preserve">
|
|
7
|
+
<style type="text/css">
|
|
8
|
+
.st0{fill:#000000;}
|
|
9
|
+
</style>
|
|
10
|
+
<g>
|
|
11
|
+
<path class="st0" d="M0,17.067V153.6h512V17.067H0z M110.933,110.925h-51.2v-51.2h51.2V110.925z"/>
|
|
12
|
+
<path class="st0" d="M0,324.267h512V187.733H0V324.267z M59.733,230.391h51.2v51.2h-51.2V230.391z"/>
|
|
13
|
+
<path class="st0" d="M0,494.933h512V358.4H0V494.933z M59.733,401.058h51.2v51.2h-51.2V401.058z"/>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-sftp-custom",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n node for SFTP with custom algorithms",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/Genevieve-Lee-221/n8n-nodes-sftp-custom",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Genevieve Lee",
|
|
9
|
+
"email": "Genevieve_Lee@compal.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/Genevieve-Lee-221/n8n-nodes-sftp-custom.git"
|
|
14
|
+
},
|
|
15
|
+
"main": "index.js",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc && gulp build:icons",
|
|
18
|
+
"dev": "tsc --watch"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"n8n": {
|
|
24
|
+
"n8nNodesApiVersion": 1,
|
|
25
|
+
"credentials": [
|
|
26
|
+
"dist/credentials/SftpApi.credentials.js"
|
|
27
|
+
],
|
|
28
|
+
"nodes": [
|
|
29
|
+
"dist/nodes/Sftp/Sftp.node.js"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^20.0.0",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
35
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
36
|
+
"eslint": "^8.57.1",
|
|
37
|
+
"eslint-plugin-n8n-nodes-base": "^1.11.0",
|
|
38
|
+
"gulp": "^4.0.2",
|
|
39
|
+
"n8n-workflow": "^1.0.0",
|
|
40
|
+
"prettier": "^3.8.0",
|
|
41
|
+
"typescript": "^5.0.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"ssh2": "^1.17.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"n8n-workflow": "*"
|
|
48
|
+
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"n8n-community-node-package",
|
|
51
|
+
"n8n",
|
|
52
|
+
"sftp",
|
|
53
|
+
"ssh-dss"
|
|
54
|
+
]
|
|
55
|
+
}
|