@st-gr/abap-adt-skill 1.0.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/dist/client.js +79 -0
- package/dist/commands/activate.js +58 -0
- package/dist/commands/atc.js +39 -0
- package/dist/commands/classinfo.js +33 -0
- package/dist/commands/completion.js +57 -0
- package/dist/commands/create.js +69 -0
- package/dist/commands/debug.js +217 -0
- package/dist/commands/definition.js +66 -0
- package/dist/commands/delete.js +36 -0
- package/dist/commands/exec.js +112 -0
- package/dist/commands/package.js +24 -0
- package/dist/commands/pretty-print.js +57 -0
- package/dist/commands/quickfix.js +78 -0
- package/dist/commands/read.js +31 -0
- package/dist/commands/rename.js +40 -0
- package/dist/commands/run.js +16 -0
- package/dist/commands/search.js +25 -0
- package/dist/commands/structure.js +39 -0
- package/dist/commands/syntax.js +75 -0
- package/dist/commands/systems.js +514 -0
- package/dist/commands/table.js +65 -0
- package/dist/commands/test.js +100 -0
- package/dist/commands/transport.js +110 -0
- package/dist/commands/users.js +19 -0
- package/dist/commands/whereused.js +30 -0
- package/dist/commands/write.js +131 -0
- package/dist/diag-debug.js +47 -0
- package/dist/diag-raw.js +144 -0
- package/dist/diag-write.js +42 -0
- package/dist/index.js +336 -0
- package/dist/test-write.js +69 -0
- package/dist/util/credentials.js +42 -0
- package/dist/util/error-handler.js +39 -0
- package/dist/util/formatter.js +27 -0
- package/dist/util/landscape.js +121 -0
- package/dist/util/network.js +112 -0
- package/package.json +24 -0
|
@@ -0,0 +1,112 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.isPrivateIP = isPrivateIP;
|
|
37
|
+
exports.assertPrivateHost = assertPrivateHost;
|
|
38
|
+
exports.probePort = probePort;
|
|
39
|
+
const dns = __importStar(require("dns"));
|
|
40
|
+
const net = __importStar(require("net"));
|
|
41
|
+
/**
|
|
42
|
+
* Check if an IP address is in a private/reserved range.
|
|
43
|
+
* Private ranges: 10.x, 172.16-31.x, 192.168.x, 127.x, 169.254.x, fc00::/7, ::1
|
|
44
|
+
*/
|
|
45
|
+
function isPrivateIP(ip) {
|
|
46
|
+
// IPv4
|
|
47
|
+
const parts = ip.split(".");
|
|
48
|
+
if (parts.length === 4) {
|
|
49
|
+
const [a, b] = parts.map(Number);
|
|
50
|
+
if (a === 10)
|
|
51
|
+
return true;
|
|
52
|
+
if (a === 172 && b >= 16 && b <= 31)
|
|
53
|
+
return true;
|
|
54
|
+
if (a === 192 && b === 168)
|
|
55
|
+
return true;
|
|
56
|
+
if (a === 127)
|
|
57
|
+
return true;
|
|
58
|
+
if (a === 169 && b === 254)
|
|
59
|
+
return true;
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
// IPv6
|
|
63
|
+
if (ip === "::1")
|
|
64
|
+
return true;
|
|
65
|
+
if (ip.toLowerCase().startsWith("fc") || ip.toLowerCase().startsWith("fd"))
|
|
66
|
+
return true;
|
|
67
|
+
if (ip.toLowerCase().startsWith("fe80"))
|
|
68
|
+
return true;
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Verify that a hostname resolves to a private IP address.
|
|
73
|
+
* Aborts with a clear error if DNS fails or the IP is public (VPN may be down).
|
|
74
|
+
*/
|
|
75
|
+
async function assertPrivateHost(hostname) {
|
|
76
|
+
let address;
|
|
77
|
+
try {
|
|
78
|
+
const result = await dns.promises.lookup(hostname);
|
|
79
|
+
address = result.address;
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
if (err.code === "ENOTFOUND") {
|
|
83
|
+
throw new Error(`Cannot resolve hostname '${hostname}' — check VPN connection.`);
|
|
84
|
+
}
|
|
85
|
+
throw new Error(`DNS lookup failed for '${hostname}': ${err.message}`);
|
|
86
|
+
}
|
|
87
|
+
if (!isPrivateIP(address)) {
|
|
88
|
+
throw new Error(`Host '${hostname}' resolves to public IP ${address} — VPN may be down. ` +
|
|
89
|
+
`Refusing to send credentials over an insecure connection.`);
|
|
90
|
+
}
|
|
91
|
+
return address;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* TCP port probe — checks if a port is open without sending any HTTP traffic.
|
|
95
|
+
*/
|
|
96
|
+
function probePort(hostname, port, timeoutMs = 3000) {
|
|
97
|
+
return new Promise(resolve => {
|
|
98
|
+
const socket = net.createConnection({ host: hostname, port, timeout: timeoutMs });
|
|
99
|
+
socket.once("connect", () => {
|
|
100
|
+
socket.destroy();
|
|
101
|
+
resolve(true);
|
|
102
|
+
});
|
|
103
|
+
socket.once("timeout", () => {
|
|
104
|
+
socket.destroy();
|
|
105
|
+
resolve(false);
|
|
106
|
+
});
|
|
107
|
+
socket.once("error", () => {
|
|
108
|
+
socket.destroy();
|
|
109
|
+
resolve(false);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@st-gr/abap-adt-skill",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI for SAP ABAP ADT operations, usable standalone or as a Claude Code skill",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"abap-adt": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": ["dist/", "README.md"],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"prepublishOnly": "npm run build"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@st-gr/abap-adt-api-patched": "^7.1.1-patched.1",
|
|
16
|
+
"commander": "^12.0.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^5.8.0",
|
|
20
|
+
"@types/node": "^20.0.0"
|
|
21
|
+
},
|
|
22
|
+
"keywords": ["abap", "sap", "adt", "claude-code", "skill"],
|
|
23
|
+
"license": "MIT"
|
|
24
|
+
}
|