n8n-node-sap-hana 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.
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 [Dein Name]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # n8n-nodes-sap-hana
2
+
3
+ Dieses Paket enthält einen n8n-Node für SAP HANA Datenbankabfragen.
4
+
5
+ ## Installation
6
+
7
+ Führe den folgenden Befehl in deinem n8n-Root-Verzeichnis aus:
8
+
9
+ ```
10
+ npm install n8n-nodes-sap-hana
11
+ ```
12
+
13
+ Alternativ kannst du auch den n8n Community Nodes-Bereich nutzen, um diesen Node zu installieren.
14
+
15
+ ## Voraussetzungen
16
+
17
+ - n8n Version 0.125.0 oder höher
18
+ - SAP HANA Client (`@sap/hana-client`)
19
+
20
+ ## Funktionen
21
+
22
+ Der SAP HANA Node ermöglicht die Ausführung von benutzerdefinierten SQL-Abfragen auf einer SAP HANA Datenbank. Du kannst beliebige SQL-Abfragen erstellen und ausführen, um Daten aus deiner SAP HANA Datenbank abzurufen.
23
+
24
+ ## Credentials
25
+
26
+ Um diesen Node zu verwenden, musst du folgende Zugangsdaten konfigurieren:
27
+
28
+ - **Server IP**: Die IP-Adresse des SAP HANA Servers
29
+ - **Port**: Der Port des SAP HANA Servers (Standard: 30013)
30
+ - **Datenbankname**: Der Name der Datenbank (Standard: NDB)
31
+ - **Benutzername**: Der Benutzername für die SAP HANA Datenbank
32
+ - **Passwort**: Das Passwort für die SAP HANA Datenbank
33
+
34
+ ## Entwicklung
35
+
36
+ ### Build
37
+
38
+ ```
39
+ npm run build
40
+ ```
41
+
42
+ ### Entwicklungsmodus
43
+
44
+ ```
45
+ npm run dev
46
+ ```
47
+
48
+ ## Lizenz
49
+
50
+ [MIT](LICENSE.md)
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SapHanaCredentials = void 0;
4
+ class SapHanaCredentials {
5
+ constructor() {
6
+ this.name = 'sapHanaCredentials';
7
+ this.displayName = 'SAP HANA Credentials';
8
+ this.documentationUrl = '';
9
+ this.properties = [
10
+ {
11
+ displayName: 'Server IP',
12
+ name: 'serverIp',
13
+ type: 'string',
14
+ default: '',
15
+ placeholder: '192.168.1.1',
16
+ description: 'IP-Adresse des SAP HANA Servers',
17
+ },
18
+ {
19
+ displayName: 'Port',
20
+ name: 'port',
21
+ type: 'number',
22
+ default: 30013,
23
+ description: 'Port des SAP HANA Servers (Standard: 30013)',
24
+ },
25
+ {
26
+ displayName: 'Datenbankname',
27
+ name: 'databaseName',
28
+ type: 'string',
29
+ default: 'NDB',
30
+ description: 'Name der Datenbank',
31
+ },
32
+ {
33
+ displayName: 'Benutzername',
34
+ name: 'username',
35
+ type: 'string',
36
+ default: '',
37
+ description: 'Benutzername für die SAP HANA Datenbank',
38
+ },
39
+ {
40
+ displayName: 'Passwort',
41
+ name: 'password',
42
+ type: 'string',
43
+ typeOptions: {
44
+ password: true,
45
+ },
46
+ default: '',
47
+ description: 'Passwort für die SAP HANA Datenbank',
48
+ },
49
+ ];
50
+ }
51
+ }
52
+ exports.SapHanaCredentials = SapHanaCredentials;
53
+ //# sourceMappingURL=SapHanaCredentials.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SapHanaCredentials.credentials.js","sourceRoot":"","sources":["../../credentials/SapHanaCredentials.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,kBAAkB;IAA/B;QACC,SAAI,GAAG,oBAAoB,CAAC;QAC5B,gBAAW,GAAG,sBAAsB,CAAC;QACrC,qBAAgB,GAAG,EAAE,CAAC;QACtB,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,aAAa;gBAC1B,WAAW,EAAE,iCAAiC;aAC9C;YACD;gBACC,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,6CAA6C;aAC1D;YACD;gBACC,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,oBAAoB;aACjC;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,yCAAyC;aACtD;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,qCAAqC;aAClD;SACD,CAAC;IACH,CAAC;CAAA;AA7CD,gDA6CC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SapHana = exports.SapHanaCredentials = void 0;
4
+ const SapHanaCredentials_credentials_1 = require("./credentials/SapHanaCredentials.credentials");
5
+ Object.defineProperty(exports, "SapHanaCredentials", { enumerable: true, get: function () { return SapHanaCredentials_credentials_1.SapHanaCredentials; } });
6
+ const SapHana_node_1 = require("./nodes/SapHana/SapHana.node");
7
+ Object.defineProperty(exports, "SapHana", { enumerable: true, get: function () { return SapHana_node_1.SapHana; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,iGAAkF;AAIjF,mGAJQ,mDAAkB,OAIR;AAHnB,+DAAuD;AAItD,wFAJQ,sBAAO,OAIR"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.SapHana = void 0;
27
+ const n8n_workflow_1 = require("n8n-workflow");
28
+ const hana = __importStar(require("@sap/hana-client"));
29
+ class SapHana {
30
+ constructor() {
31
+ this.description = {
32
+ displayName: 'SAP HANA',
33
+ name: 'sapHana',
34
+ icon: 'file:./sapHana.svg',
35
+ group: ['transform'],
36
+ version: 1,
37
+ description: 'Führt Abfragen auf einer SAP HANA Datenbank aus',
38
+ defaults: {
39
+ name: 'SAP HANA',
40
+ },
41
+ inputs: ['main'],
42
+ outputs: ['main'],
43
+ credentials: [
44
+ {
45
+ name: 'sapHanaCredentials',
46
+ required: true,
47
+ },
48
+ ],
49
+ properties: [
50
+ {
51
+ displayName: 'SQL-Abfrage',
52
+ name: 'query',
53
+ type: 'string',
54
+ typeOptions: {
55
+ rows: 5,
56
+ },
57
+ default: '',
58
+ placeholder: 'SELECT * FROM Schema.Table',
59
+ description: 'Die SQL-Abfrage, die ausgeführt werden soll',
60
+ },
61
+ ],
62
+ };
63
+ }
64
+ async execute() {
65
+ const returnData = [];
66
+ const credentials = await this.getCredentials('sapHanaCredentials');
67
+ const serverIp = credentials.serverIp;
68
+ const port = credentials.port;
69
+ const databaseName = credentials.databaseName;
70
+ const username = credentials.username;
71
+ const password = credentials.password;
72
+ const conn = hana.createConnection();
73
+ const connectionString = `serverNode=${serverIp}:${port};DatabaseName=${databaseName};UID=${username};pwd=${password}`;
74
+ try {
75
+ conn.connect(connectionString);
76
+ const query = this.getNodeParameter('query', 0);
77
+ const result = conn.exec(query);
78
+ for (const item of result) {
79
+ returnData.push({
80
+ json: item,
81
+ pairedItem: {
82
+ item: 0,
83
+ },
84
+ });
85
+ }
86
+ conn.disconnect();
87
+ return [returnData];
88
+ }
89
+ catch (error) {
90
+ try {
91
+ conn.disconnect();
92
+ }
93
+ catch { }
94
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Fehler bei der Ausführung: ${error.message}`);
95
+ }
96
+ }
97
+ }
98
+ exports.SapHana = SapHana;
99
+ //# sourceMappingURL=SapHana.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SapHana.node.js","sourceRoot":"","sources":["../../../nodes/SapHana/SapHana.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAKsB;AAGtB,uDAAyC;AAEzC,MAAa,OAAO;IAApB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE;gBACT,IAAI,EAAE,UAAU;aAChB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,oBAAoB;oBAC1B,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,aAAa;oBAC1B,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE;wBACZ,IAAI,EAAE,CAAC;qBACP;oBACD,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,4BAA4B;oBACzC,WAAW,EAAE,6CAA6C;iBAC1D;aACD;SACD,CAAC;IAiDH,CAAC;IA/CA,KAAK,CAAC,OAAO;QACZ,MAAM,UAAU,GAAyB,EAAE,CAAC;QAG5C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;QACpE,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAkB,CAAC;QAChD,MAAM,IAAI,GAAG,WAAW,CAAC,IAAc,CAAC;QACxC,MAAM,YAAY,GAAG,WAAW,CAAC,YAAsB,CAAC;QACxD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAkB,CAAC;QAChD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAkB,CAAC;QAGhD,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACrC,MAAM,gBAAgB,GAAG,cAAc,QAAQ,IAAI,IAAI,iBAAiB,YAAY,QAAQ,QAAQ,QAAQ,QAAQ,EAAE,CAAC;QAEvH,IAAI;YAEH,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;YAG/B,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAW,CAAC;YAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAGhC,KAAK,MAAM,IAAI,IAAI,MAA+B,EAAE;gBACnD,UAAU,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,IAAI;oBACV,UAAU,EAAE;wBACX,IAAI,EAAE,CAAC;qBACP;iBACD,CAAC,CAAC;aACH;YAGD,IAAI,CAAC,UAAU,EAAE,CAAC;YAElB,OAAO,CAAC,UAAU,CAAC,CAAC;SACpB;QAAC,OAAO,KAAK,EAAE;YAEf,IAAI;gBACH,IAAI,CAAC,UAAU,EAAE,CAAC;aAClB;YAAC,MAAM,GAAE;YAGV,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,8BAA8B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;SAC5F;IACF,CAAC;CACD;AAjFD,0BAiFC"}
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
2
+ <path d="M16 2C8.268 2 2 4.686 2 8v16c0 3.314 6.268 6 14 6s14-2.686 14-6V8c0-3.314-6.268-6-14-6z" fill="none" stroke="currentColor" stroke-width="2"/>
3
+ <path d="M30 8c0 3.314-6.268 6-14 6S2 11.314 2 8" fill="none" stroke="currentColor" stroke-width="2"/>
4
+ <path d="M30 16c0 3.314-6.268 6-14 6S2 19.314 2 16" fill="none" stroke="currentColor" stroke-width="2"/>
5
+ </svg>
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "n8n-node-sap-hana",
3
+ "version": "0.1.0",
4
+ "description": "n8n node für SAP HANA Datenbankabfragen",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "sap-hana",
8
+ "n8n"
9
+ ],
10
+ "license": "MIT",
11
+ "homepage": "",
12
+ "author": {
13
+ "name": "Dein Name",
14
+ "email": "deine.email@example.com"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/deinusername/n8n-nodes-sap-hana.git"
19
+ },
20
+ "main": "index.js",
21
+ "scripts": {
22
+ "build": "npx rimraf dist && tsc && gulp build:icons",
23
+ "dev": "tsc --watch",
24
+ "format": "prettier nodes credentials --write",
25
+ "lint": "eslint nodes credentials package.json",
26
+ "lintfix": "eslint nodes credentials package.json --fix",
27
+ "prepublishOnly": "npm run build"
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "n8n": {
33
+ "n8nNodesApiVersion": 1,
34
+ "credentials": [
35
+ "dist/credentials/SapHanaCredentials.credentials.js"
36
+ ],
37
+ "nodes": [
38
+ "dist/nodes/SapHana/SapHana.node.js"
39
+ ]
40
+ },
41
+ "devDependencies": {
42
+ "@types/express": "^4.17.14",
43
+ "@types/request-promise-native": "~1.0.18",
44
+ "@typescript-eslint/parser": "~5.45",
45
+ "eslint-plugin-n8n-nodes-base": "^1.11.0",
46
+ "gulp": "^4.0.2",
47
+ "n8n-core": "^0.125.0",
48
+ "n8n-workflow": "^0.107.0",
49
+ "prettier": "^2.7.1",
50
+ "rimraf": "^6.0.1",
51
+ "typescript": "~4.8.4"
52
+ },
53
+ "dependencies": {
54
+ "@sap/hana-client": "^2.15.22"
55
+ }
56
+ }