@gavdi/cap-mcp 1.1.2 → 1.1.4
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 +1 -1
- package/lib/annotations/utils.js +13 -2
- package/lib/mcp/validation.js +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# CAP MCP Plugin - AI With Ease
|
|
2
|
-
  
|
|
2
|
+
   
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
package/lib/annotations/utils.js
CHANGED
|
@@ -20,10 +20,21 @@ const logger_1 = require("../logger");
|
|
|
20
20
|
* @returns Object containing serviceName and target
|
|
21
21
|
*/
|
|
22
22
|
function splitDefinitionName(definition) {
|
|
23
|
+
if (definition?.length <= 0) {
|
|
24
|
+
throw new Error("Invalid definition name. Cannot be split");
|
|
25
|
+
}
|
|
23
26
|
const splitted = definition.split(".");
|
|
27
|
+
if (splitted.length <= 1) {
|
|
28
|
+
return {
|
|
29
|
+
serviceName: splitted[0],
|
|
30
|
+
target: "",
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const target = splitted.pop();
|
|
34
|
+
const serviceName = splitted.join(".");
|
|
24
35
|
return {
|
|
25
|
-
serviceName:
|
|
26
|
-
target:
|
|
36
|
+
serviceName: serviceName,
|
|
37
|
+
target: target ?? "",
|
|
27
38
|
};
|
|
28
39
|
}
|
|
29
40
|
/**
|
package/lib/mcp/validation.js
CHANGED
|
@@ -64,7 +64,7 @@ exports.ODataQueryValidationSchemas = {
|
|
|
64
64
|
.string()
|
|
65
65
|
.min(1)
|
|
66
66
|
.max(200)
|
|
67
|
-
.regex(/^[a-zA-Z_][a-zA-Z0-9_
|
|
67
|
+
.regex(/^[a-zA-Z_][a-zA-Z0-9_]*(?:\s+(asc|desc))?(?:\s*,\s*[a-zA-Z_][a-zA-Z0-9_]*(?:\s+(asc|desc))?)*$/i),
|
|
68
68
|
filter: zod_1.z.string().min(1).max(1000),
|
|
69
69
|
};
|
|
70
70
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gavdi/cap-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "MCP Pluging for CAP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MCP",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"test": "NODE_ENV=test jest --silent --testTimeout=30000",
|
|
27
27
|
"test:unit": "NODE_ENV=test jest --silent test/unit --testTimeout=30000",
|
|
28
28
|
"test:integration": "NODE_ENV=test jest --silent test/integration --testTimeout=30000",
|
|
29
|
+
"test:coverage": "NODE_ENV=test jest --silent --coverage --testTimeout=30000",
|
|
30
|
+
"test:coverage:unit": "NODE_ENV=test jest --silent --coverage test/unit --testTimeout=30000",
|
|
31
|
+
"test:coverage:integration": "NODE_ENV=test jest --silent --coverage test/integration --testTimeout=30000",
|
|
32
|
+
"coverage:report": "NODE_ENV=test jest --silent --coverage --passWithNoTests --testTimeout=30000",
|
|
29
33
|
"build": "tsc",
|
|
30
34
|
"inspect": "npx @modelcontextprotocol/inspector",
|
|
31
35
|
"prepare": "husky",
|
|
@@ -37,11 +41,11 @@
|
|
|
37
41
|
"release": "release-it"
|
|
38
42
|
},
|
|
39
43
|
"peerDependencies": {
|
|
40
|
-
"@sap/cds": "^9",
|
|
44
|
+
"@sap/cds": "^9.4.3",
|
|
41
45
|
"express": "^4"
|
|
42
46
|
},
|
|
43
47
|
"dependencies": {
|
|
44
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
48
|
+
"@modelcontextprotocol/sdk": "^1.19.1",
|
|
45
49
|
"@sap/xssec": "^4.9.1",
|
|
46
50
|
"helmet": "^8.1.0",
|
|
47
51
|
"zod": "^3.25.67",
|