@sap-ux/fiori-mcp-server 0.0.2 → 0.0.3

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.
@@ -2,4 +2,5 @@ export declare const LATEST_UI5_VERSION = "1.136.7";
2
2
  export declare const GENERATE_FIORI_UI_APP_ID = "generate-fiori-ui-app";
3
3
  export declare const ADD_PAGE = "add-page";
4
4
  export declare const DELETE_PAGE = "delete-page";
5
+ export declare const CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID = "create-controller-extension";
5
6
  //# sourceMappingURL=constant.d.ts.map
package/dist/constant.js CHANGED
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DELETE_PAGE = exports.ADD_PAGE = exports.GENERATE_FIORI_UI_APP_ID = exports.LATEST_UI5_VERSION = void 0;
3
+ exports.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID = exports.DELETE_PAGE = exports.ADD_PAGE = exports.GENERATE_FIORI_UI_APP_ID = exports.LATEST_UI5_VERSION = void 0;
4
4
  exports.LATEST_UI5_VERSION = '1.136.7';
5
5
  exports.GENERATE_FIORI_UI_APP_ID = 'generate-fiori-ui-app';
6
6
  exports.ADD_PAGE = 'add-page';
7
7
  exports.DELETE_PAGE = 'delete-page';
8
+ exports.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID = 'create-controller-extension';
8
9
  //# sourceMappingURL=constant.js.map
@@ -5,6 +5,7 @@ const src_1 = require("@sap/ux-specification/dist/types/src");
5
5
  const page_editor_api_1 = require("../../../page-editor-api");
6
6
  const utils_1 = require("../../utils");
7
7
  const path_1 = require("path");
8
+ const constant_1 = require("../../../constant");
8
9
  /**
9
10
  * Retrieves the parameter definitions for creating a controller extension.
10
11
  *
@@ -34,7 +35,7 @@ function getParameters() {
34
35
  };
35
36
  }
36
37
  exports.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY = {
37
- functionalityId: 'create-controller-extension',
38
+ functionalityId: constant_1.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID,
38
39
  name: 'Add new controller extension by creating javascript or typescript file and updates manifest.json with entry',
39
40
  description: 'Add new controller extension by creating javascript or typescript file and updates manifest.json with entry. Controller extensions allow users to extensiate default behaviour with custom controllers code.',
40
41
  parameters: Object.values(getParameters())
@@ -4,6 +4,7 @@ exports.FUNCTIONALITIES_HANDLERS = exports.FUNCTIONALITIES_DETAILS = void 0;
4
4
  const page_1 = require("./page");
5
5
  const controller_extension_1 = require("./controller-extension");
6
6
  const generate_fiori_ui_app_1 = require("./generate-fiori-ui-app");
7
+ const constant_1 = require("../../constant");
7
8
  exports.FUNCTIONALITIES_DETAILS = [
8
9
  page_1.ADD_PAGE_FUNCTIONALITY,
9
10
  generate_fiori_ui_app_1.GENERATE_FIORI_UI_APP,
@@ -11,9 +12,9 @@ exports.FUNCTIONALITIES_DETAILS = [
11
12
  controller_extension_1.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY
12
13
  ];
13
14
  exports.FUNCTIONALITIES_HANDLERS = new Map([
14
- [page_1.ADD_PAGE_FUNCTIONALITY.functionalityId, page_1.addPageHandlers],
15
- [page_1.DELETE_PAGE_FUNCTIONALITY.functionalityId, page_1.deletePageHandlers],
16
- [generate_fiori_ui_app_1.GENERATE_FIORI_UI_APP.functionalityId, generate_fiori_ui_app_1.generateFioriUIAppHandlers],
17
- [controller_extension_1.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY.functionalityId, controller_extension_1.createControllerExtensionHandlers]
15
+ [constant_1.ADD_PAGE, page_1.addPageHandlers],
16
+ [constant_1.DELETE_PAGE, page_1.deletePageHandlers],
17
+ [constant_1.GENERATE_FIORI_UI_APP_ID, generate_fiori_ui_app_1.generateFioriUIAppHandlers],
18
+ [constant_1.CREATE_CONTROLLER_EXTENSION_FUNCTIONALITY_ID, controller_extension_1.createControllerExtensionHandlers]
18
19
  ]);
19
20
  //# sourceMappingURL=functionalities.js.map
@@ -1,4 +1,4 @@
1
- import type { GetFunctionalityDetailsInput, GetFunctionalityDetailsOutput } from '../types';
1
+ import type { FunctionalityId, GetFunctionalityDetailsInput, GetFunctionalityDetailsOutput } from '../types';
2
2
  import type { PropertyPath } from '../page-editor-api';
3
3
  /**
4
4
  * Retrieves functionality details based on the provided input parameters.
@@ -17,7 +17,7 @@ export declare function getFunctionalityDetails(params: GetFunctionalityDetailsI
17
17
  * @returns An object containing the resolved page name (if applicable) and property path.
18
18
  * @throws Error if the functionalityId parameter has an invalid format.
19
19
  */
20
- export declare function resolveFunctionality(functionalityId: string | string[]): {
20
+ export declare function resolveFunctionality(functionalityId: FunctionalityId): {
21
21
  pageName?: string;
22
22
  propertyPath: PropertyPath;
23
23
  };
@@ -3,14 +3,14 @@
3
3
  "properties": {
4
4
  "functionalityId": {
5
5
  "anyOf": [
6
+ {
7
+ "type": "string"
8
+ },
6
9
  {
7
10
  "type": "array",
8
11
  "items": {
9
12
  "type": ["string", "number"]
10
13
  }
11
- },
12
- {
13
- "type": "string"
14
14
  }
15
15
  ],
16
16
  "description": "Identifier to pass as the `functionalityId` parameter when calling `get-functionality-details` or `execute-functionality`"
@@ -61,11 +61,23 @@
61
61
  },
62
62
  {
63
63
  "not": {}
64
+ },
65
+ {
66
+ "type": "null"
64
67
  }
65
68
  ]
66
69
  }
67
70
  },
68
71
  "currentValue": {},
72
+ "examples": {
73
+ "type": "array",
74
+ "items": {
75
+ "type": "string"
76
+ }
77
+ },
78
+ "pattern": {
79
+ "type": "string"
80
+ },
69
81
  "parameters": {
70
82
  "type": "array",
71
83
  "items": {
@@ -103,11 +115,23 @@
103
115
  },
104
116
  {
105
117
  "not": {}
118
+ },
119
+ {
120
+ "type": "null"
106
121
  }
107
122
  ]
108
123
  }
109
124
  },
110
- "currentValue": {}
125
+ "currentValue": {},
126
+ "examples": {
127
+ "type": "array",
128
+ "items": {
129
+ "type": "string"
130
+ }
131
+ },
132
+ "pattern": {
133
+ "type": "string"
134
+ }
111
135
  },
112
136
  "required": ["id", "type"],
113
137
  "additionalProperties": false
@@ -137,6 +161,6 @@
137
161
  "type": "string"
138
162
  }
139
163
  },
140
- "required": ["id", "name", "description", "parameters"],
164
+ "required": ["functionalityId", "name", "description", "parameters"],
141
165
  "additionalProperties": false
142
166
  }
package/dist/types.d.ts CHANGED
@@ -39,14 +39,14 @@ export interface GetFunctionalityDetailsInput {
39
39
  /** Path to the Fiori application */
40
40
  appPath: string;
41
41
  /** ID or array of IDs of the functionality(ies) */
42
- functionalityId: string | string[];
42
+ functionalityId: FunctionalityId;
43
43
  }
44
44
  /**
45
45
  * Output interface for the 'get-functionality-details' functionality
46
46
  */
47
47
  export interface GetFunctionalityDetailsOutput {
48
48
  /** ID of the functionality */
49
- functionalityId: string;
49
+ functionalityId: FunctionalityId;
50
50
  /** Name of the functionality */
51
51
  name: string;
52
52
  /** Description of the functionality */
@@ -69,7 +69,7 @@ export interface GetFunctionalityDetailsOutput {
69
69
  */
70
70
  export interface ExecuteFunctionalitiesInput {
71
71
  /** ID or array of IDs of the functionality(ies) to execute */
72
- functionalityId: string | string[];
72
+ functionalityId: FunctionalityId;
73
73
  /** Parameters for the functionality execution */
74
74
  parameters: {
75
75
  [key: string]: unknown;
@@ -82,7 +82,7 @@ export interface ExecuteFunctionalitiesInput {
82
82
  */
83
83
  export interface ExecuteFunctionalityOutput {
84
84
  /** ID or array of IDs of the executed functionality(ies) */
85
- functionalityId: string | string[];
85
+ functionalityId: FunctionalityId;
86
86
  /** Status of the execution */
87
87
  status: string;
88
88
  /** Message describing the execution result */
@@ -116,10 +116,14 @@ export interface FioriApp {
116
116
  */
117
117
  export interface Functionality {
118
118
  /** ID or array of IDs for the functionality */
119
- functionalityId: Array<string | number> | string;
119
+ functionalityId: FunctionalityId;
120
120
  /** Description of the functionality */
121
121
  description: string;
122
122
  }
123
+ /**
124
+ * Type for functionality id
125
+ */
126
+ export type FunctionalityId = Array<string | number> | string;
123
127
  /**
124
128
  * Interface representing a parameter
125
129
  */
@@ -137,7 +141,7 @@ export interface Parameter {
137
141
  /** Default value of the parameter */
138
142
  defaultValue?: unknown;
139
143
  /** Possible options for the parameter */
140
- options?: Array<string | number | boolean | undefined>;
144
+ options?: Array<string | number | boolean | undefined | null>;
141
145
  /** Current value of the parameter */
142
146
  currentValue?: unknown;
143
147
  /** Examples for the parameter */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fiori-mcp-server",
3
3
  "description": "SAP Fiori - Model Context Protocol (MCP) server",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "keywords": [
6
6
  "SAP Fiori tools",
7
7
  "SAP Fiori elements",
@@ -31,8 +31,8 @@
31
31
  "@types/json-schema": "7.0.5",
32
32
  "@types/mem-fs": "1.1.2",
33
33
  "@sap-ux/i18n": "0.3.3",
34
- "@sap-ux/odata-annotation-core-types": "0.4.5",
35
34
  "@sap-ux/odata-entity-model": "0.3.1",
35
+ "@sap-ux/odata-annotation-core-types": "0.4.5",
36
36
  "@sap-ux/text-document-utils": "0.3.1"
37
37
  },
38
38
  "dependencies": {