@gavdi/cap-mcp 1.1.3 → 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.
@@ -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: splitted[0],
26
- target: splitted[1],
36
+ serviceName: serviceName,
37
+ target: target ?? "",
27
38
  };
28
39
  }
29
40
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gavdi/cap-mcp",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "MCP Pluging for CAP",
5
5
  "keywords": [
6
6
  "MCP",
@@ -41,7 +41,7 @@
41
41
  "release": "release-it"
42
42
  },
43
43
  "peerDependencies": {
44
- "@sap/cds": "^9",
44
+ "@sap/cds": "^9.4.3",
45
45
  "express": "^4"
46
46
  },
47
47
  "dependencies": {