@sap-ux/fiori-mcp-server 0.0.1
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 +201 -0
- package/README.md +99 -0
- package/dist/constant.d.ts +5 -0
- package/dist/constant.js +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/page-editor-api/api.d.ts +48 -0
- package/dist/page-editor-api/api.js +93 -0
- package/dist/page-editor-api/index.d.ts +5 -0
- package/dist/page-editor-api/index.js +24 -0
- package/dist/page-editor-api/json-helper.d.ts +11 -0
- package/dist/page-editor-api/json-helper.js +64 -0
- package/dist/page-editor-api/parser/annotations.d.ts +9 -0
- package/dist/page-editor-api/parser/annotations.js +13 -0
- package/dist/page-editor-api/parser/index.d.ts +3 -0
- package/dist/page-editor-api/parser/index.js +19 -0
- package/dist/page-editor-api/parser/model/AggregationValidator.d.ts +64 -0
- package/dist/page-editor-api/parser/model/AggregationValidator.js +209 -0
- package/dist/page-editor-api/parser/model/ArrayAggregation.d.ts +49 -0
- package/dist/page-editor-api/parser/model/ArrayAggregation.js +122 -0
- package/dist/page-editor-api/parser/model/ObjectAggregation.d.ts +374 -0
- package/dist/page-editor-api/parser/model/ObjectAggregation.js +802 -0
- package/dist/page-editor-api/parser/model/PageEditModel.d.ts +223 -0
- package/dist/page-editor-api/parser/model/PageEditModel.js +954 -0
- package/dist/page-editor-api/parser/model/PageEditProperty.d.ts +38 -0
- package/dist/page-editor-api/parser/model/PageEditProperty.js +49 -0
- package/dist/page-editor-api/parser/model/RootAggregation.d.ts +24 -0
- package/dist/page-editor-api/parser/model/RootAggregation.js +54 -0
- package/dist/page-editor-api/parser/model/actions/ActionAggregation.d.ts +34 -0
- package/dist/page-editor-api/parser/model/actions/ActionAggregation.js +92 -0
- package/dist/page-editor-api/parser/model/actions/ActionsAggregation.d.ts +96 -0
- package/dist/page-editor-api/parser/model/actions/ActionsAggregation.js +252 -0
- package/dist/page-editor-api/parser/model/actions/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/actions/index.js +19 -0
- package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectAggregation.d.ts +17 -0
- package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectAggregation.js +26 -0
- package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectsAggregation.d.ts +46 -0
- package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectsAggregation.js +66 -0
- package/dist/page-editor-api/parser/model/additionalObjects/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/additionalObjects/index.js +19 -0
- package/dist/page-editor-api/parser/model/chart/ChartAggregation.d.ts +41 -0
- package/dist/page-editor-api/parser/model/chart/ChartAggregation.js +94 -0
- package/dist/page-editor-api/parser/model/chart/index.d.ts +2 -0
- package/dist/page-editor-api/parser/model/chart/index.js +18 -0
- package/dist/page-editor-api/parser/model/fields/ConnectedFieldsAggregation.d.ts +9 -0
- package/dist/page-editor-api/parser/model/fields/ConnectedFieldsAggregation.js +13 -0
- package/dist/page-editor-api/parser/model/fields/FieldAggregation.d.ts +25 -0
- package/dist/page-editor-api/parser/model/fields/FieldAggregation.js +42 -0
- package/dist/page-editor-api/parser/model/fields/FieldsAggregation.d.ts +22 -0
- package/dist/page-editor-api/parser/model/fields/FieldsAggregation.js +34 -0
- package/dist/page-editor-api/parser/model/fields/index.d.ts +4 -0
- package/dist/page-editor-api/parser/model/fields/index.js +20 -0
- package/dist/page-editor-api/parser/model/filter-fields/FilterFieldAggregation.d.ts +39 -0
- package/dist/page-editor-api/parser/model/filter-fields/FilterFieldAggregation.js +94 -0
- package/dist/page-editor-api/parser/model/filter-fields/FilterFieldsAggregation.d.ts +36 -0
- package/dist/page-editor-api/parser/model/filter-fields/FilterFieldsAggregation.js +59 -0
- package/dist/page-editor-api/parser/model/filter-fields/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/filter-fields/index.js +19 -0
- package/dist/page-editor-api/parser/model/index.d.ts +19 -0
- package/dist/page-editor-api/parser/model/index.js +35 -0
- package/dist/page-editor-api/parser/model/macros/MacrosRoot.d.ts +48 -0
- package/dist/page-editor-api/parser/model/macros/MacrosRoot.js +114 -0
- package/dist/page-editor-api/parser/model/macros/index.d.ts +2 -0
- package/dist/page-editor-api/parser/model/macros/index.js +18 -0
- package/dist/page-editor-api/parser/model/sections/HeaderSectionsAggregation.d.ts +31 -0
- package/dist/page-editor-api/parser/model/sections/HeaderSectionsAggregation.js +82 -0
- package/dist/page-editor-api/parser/model/sections/SectionAggregation.d.ts +78 -0
- package/dist/page-editor-api/parser/model/sections/SectionAggregation.js +131 -0
- package/dist/page-editor-api/parser/model/sections/SectionsAggregation.d.ts +135 -0
- package/dist/page-editor-api/parser/model/sections/SectionsAggregation.js +402 -0
- package/dist/page-editor-api/parser/model/sections/SectionsObjectAggregation.d.ts +50 -0
- package/dist/page-editor-api/parser/model/sections/SectionsObjectAggregation.js +119 -0
- package/dist/page-editor-api/parser/model/sections/SubSectionsAggregation.d.ts +39 -0
- package/dist/page-editor-api/parser/model/sections/SubSectionsAggregation.js +70 -0
- package/dist/page-editor-api/parser/model/sections/index.d.ts +6 -0
- package/dist/page-editor-api/parser/model/sections/index.js +22 -0
- package/dist/page-editor-api/parser/model/table/ColumnAggregation.d.ts +89 -0
- package/dist/page-editor-api/parser/model/table/ColumnAggregation.js +175 -0
- package/dist/page-editor-api/parser/model/table/ColumnsAggregation.d.ts +113 -0
- package/dist/page-editor-api/parser/model/table/ColumnsAggregation.js +293 -0
- package/dist/page-editor-api/parser/model/table/TableAggregation.d.ts +13 -0
- package/dist/page-editor-api/parser/model/table/TableAggregation.js +21 -0
- package/dist/page-editor-api/parser/model/table/ToolbarAggregation.d.ts +15 -0
- package/dist/page-editor-api/parser/model/table/ToolbarAggregation.js +22 -0
- package/dist/page-editor-api/parser/model/table/index.d.ts +5 -0
- package/dist/page-editor-api/parser/model/table/index.js +21 -0
- package/dist/page-editor-api/parser/model/table/utils.d.ts +12 -0
- package/dist/page-editor-api/parser/model/table/utils.js +44 -0
- package/dist/page-editor-api/parser/model/types/annotations.d.ts +63 -0
- package/dist/page-editor-api/parser/model/types/annotations.js +29 -0
- package/dist/page-editor-api/parser/model/types/common.d.ts +13 -0
- package/dist/page-editor-api/parser/model/types/common.js +3 -0
- package/dist/page-editor-api/parser/model/types/index.d.ts +220 -0
- package/dist/page-editor-api/parser/model/types/index.js +149 -0
- package/dist/page-editor-api/parser/model/utils/annotations.d.ts +38 -0
- package/dist/page-editor-api/parser/model/utils/annotations.js +120 -0
- package/dist/page-editor-api/parser/model/utils/i18n.d.ts +33 -0
- package/dist/page-editor-api/parser/model/utils/i18n.js +69 -0
- package/dist/page-editor-api/parser/model/utils/index.d.ts +6 -0
- package/dist/page-editor-api/parser/model/utils/index.js +22 -0
- package/dist/page-editor-api/parser/model/utils/object.d.ts +25 -0
- package/dist/page-editor-api/parser/model/utils/object.js +68 -0
- package/dist/page-editor-api/parser/model/utils/sort.d.ts +31 -0
- package/dist/page-editor-api/parser/model/utils/sort.js +18 -0
- package/dist/page-editor-api/parser/model/utils/utils.d.ts +94 -0
- package/dist/page-editor-api/parser/model/utils/utils.js +267 -0
- package/dist/page-editor-api/parser/model/views/ViewAggregation.d.ts +62 -0
- package/dist/page-editor-api/parser/model/views/ViewAggregation.js +112 -0
- package/dist/page-editor-api/parser/model/views/ViewsAggregation.d.ts +54 -0
- package/dist/page-editor-api/parser/model/views/ViewsAggregation.js +141 -0
- package/dist/page-editor-api/parser/model/views/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/views/index.js +19 -0
- package/dist/page-editor-api/parser/model/visual-filters/VisualFilterAggregation.d.ts +11 -0
- package/dist/page-editor-api/parser/model/visual-filters/VisualFilterAggregation.js +15 -0
- package/dist/page-editor-api/parser/model/visual-filters/VisualFiltersAggregation.d.ts +11 -0
- package/dist/page-editor-api/parser/model/visual-filters/VisualFiltersAggregation.js +15 -0
- package/dist/page-editor-api/parser/model/visual-filters/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/visual-filters/index.js +19 -0
- package/dist/page-editor-api/parser/tree.d.ts +135 -0
- package/dist/page-editor-api/parser/tree.js +464 -0
- package/dist/page-editor-api/project.d.ts +40 -0
- package/dist/page-editor-api/project.js +124 -0
- package/dist/page-editor-api/sapuxFtfsFileIO.d.ts +84 -0
- package/dist/page-editor-api/sapuxFtfsFileIO.js +195 -0
- package/dist/server.d.ts +35 -0
- package/dist/server.js +120 -0
- package/dist/tools/execute-functionality.d.ts +19 -0
- package/dist/tools/execute-functionality.js +175 -0
- package/dist/tools/functionalities/controller-extension/index.d.ts +4 -0
- package/dist/tools/functionalities/controller-extension/index.js +136 -0
- package/dist/tools/functionalities/functionalities.d.ts +4 -0
- package/dist/tools/functionalities/functionalities.js +19 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/command.d.ts +9 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/command.js +158 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/generate-fiori-ui-app.d.ts +4 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/generate-fiori-ui-app.js +240 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/index.d.ts +2 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/index.js +7 -0
- package/dist/tools/functionalities/index.d.ts +2 -0
- package/dist/tools/functionalities/index.js +18 -0
- package/dist/tools/functionalities/page/add-page.d.ts +5 -0
- package/dist/tools/functionalities/page/add-page.js +89 -0
- package/dist/tools/functionalities/page/application.d.ts +212 -0
- package/dist/tools/functionalities/page/application.js +616 -0
- package/dist/tools/functionalities/page/delete-page.d.ts +4 -0
- package/dist/tools/functionalities/page/delete-page.js +71 -0
- package/dist/tools/functionalities/page/index.d.ts +3 -0
- package/dist/tools/functionalities/page/index.js +10 -0
- package/dist/tools/functionalities/page/service.d.ts +82 -0
- package/dist/tools/functionalities/page/service.js +114 -0
- package/dist/tools/functionalities/page/serviceStore.d.ts +17 -0
- package/dist/tools/functionalities/page/serviceStore.js +34 -0
- package/dist/tools/functionalities/page/types.d.ts +42 -0
- package/dist/tools/functionalities/page/types.js +11 -0
- package/dist/tools/functionalities/page/utils.d.ts +12 -0
- package/dist/tools/functionalities/page/utils.js +63 -0
- package/dist/tools/get-functionality-details.d.ts +24 -0
- package/dist/tools/get-functionality-details.js +142 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.js +55 -0
- package/dist/tools/input-schema/execute-functionality.json +28 -0
- package/dist/tools/input-schema/get-functionality-details.json +24 -0
- package/dist/tools/input-schema/index.d.ts +5 -0
- package/dist/tools/input-schema/index.js +15 -0
- package/dist/tools/input-schema/list-fiori-apps.json +12 -0
- package/dist/tools/input-schema/list-functionality.json +10 -0
- package/dist/tools/list-fiori-apps.d.ts +10 -0
- package/dist/tools/list-fiori-apps.js +33 -0
- package/dist/tools/list-functionalities.d.ts +10 -0
- package/dist/tools/list-functionalities.js +145 -0
- package/dist/tools/output-schema/execute-functionality.json +39 -0
- package/dist/tools/output-schema/get-functionality-details.json +142 -0
- package/dist/tools/output-schema/index.d.ts +5 -0
- package/dist/tools/output-schema/index.js +15 -0
- package/dist/tools/output-schema/list-fiori-apps.json +41 -0
- package/dist/tools/output-schema/list-functionality.json +37 -0
- package/dist/tools/utils.d.ts +16 -0
- package/dist/tools/utils.js +74 -0
- package/dist/types.d.ts +170 -0
- package/dist/types.js +3 -0
- package/package.json +63 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deletePageHandlers = exports.DELETE_PAGE_FUNCTIONALITY = exports.addPageHandlers = exports.ADD_PAGE_FUNCTIONALITY = void 0;
|
|
4
|
+
var add_page_1 = require("./add-page");
|
|
5
|
+
Object.defineProperty(exports, "ADD_PAGE_FUNCTIONALITY", { enumerable: true, get: function () { return add_page_1.ADD_PAGE_FUNCTIONALITY; } });
|
|
6
|
+
Object.defineProperty(exports, "addPageHandlers", { enumerable: true, get: function () { return add_page_1.addPageHandlers; } });
|
|
7
|
+
var delete_page_1 = require("./delete-page");
|
|
8
|
+
Object.defineProperty(exports, "DELETE_PAGE_FUNCTIONALITY", { enumerable: true, get: function () { return delete_page_1.DELETE_PAGE_FUNCTIONALITY; } });
|
|
9
|
+
Object.defineProperty(exports, "deletePageHandlers", { enumerable: true, get: function () { return delete_page_1.deletePageHandlers; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { FioriAnnotationService } from '@sap-ux/fiori-annotation-api';
|
|
2
|
+
import type { MetadataService } from '@sap-ux/odata-entity-model';
|
|
3
|
+
import type { MetadataElement } from '@sap-ux/odata-annotation-core-types';
|
|
4
|
+
import type { Project } from '@sap-ux/project-access';
|
|
5
|
+
export type ServiceOptions = {
|
|
6
|
+
project: Project;
|
|
7
|
+
serviceName: string;
|
|
8
|
+
appName: string;
|
|
9
|
+
};
|
|
10
|
+
type MetadataNode = {
|
|
11
|
+
path: string;
|
|
12
|
+
name: string;
|
|
13
|
+
kind: string;
|
|
14
|
+
mdElement: MetadataElement;
|
|
15
|
+
};
|
|
16
|
+
export interface AllowedEntity {
|
|
17
|
+
entitySet: string;
|
|
18
|
+
entityType: string;
|
|
19
|
+
navigations: AllowedNavigation[];
|
|
20
|
+
}
|
|
21
|
+
export interface AllowedNavigation {
|
|
22
|
+
name: string;
|
|
23
|
+
fullyQualifiedName?: string;
|
|
24
|
+
entitySet: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Represents a service that manages Fiori metadata and annotations.
|
|
28
|
+
*/
|
|
29
|
+
export declare class Service {
|
|
30
|
+
private readonly options;
|
|
31
|
+
metadataService?: MetadataService;
|
|
32
|
+
annotationService?: FioriAnnotationService;
|
|
33
|
+
nodes: MetadataNode[];
|
|
34
|
+
nodesMap: Map<string, MetadataNode>;
|
|
35
|
+
private namespace;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new instance of the Service class.
|
|
38
|
+
*
|
|
39
|
+
* @param options - Configuration options for the service,.
|
|
40
|
+
*/
|
|
41
|
+
constructor(options: ServiceOptions);
|
|
42
|
+
/**
|
|
43
|
+
* Loads and initializes metadata and annotation services.
|
|
44
|
+
*
|
|
45
|
+
* @param refresh - Whether to force a reload of the metadata.
|
|
46
|
+
* @returns A promise that resolves when metadata is loaded.
|
|
47
|
+
*/
|
|
48
|
+
private loadMetadata;
|
|
49
|
+
/**
|
|
50
|
+
* Visits a metadata element and registers it as a node within the service.
|
|
51
|
+
*
|
|
52
|
+
* @param mdElement - The metadata element to process and register.
|
|
53
|
+
*/
|
|
54
|
+
visitMdElement(mdElement: MetadataElement): void;
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves the namespace for the current instance.
|
|
57
|
+
*
|
|
58
|
+
* @returns {Promise<string>} A promise that resolves to the namespace string.
|
|
59
|
+
*/
|
|
60
|
+
getNamespace(): Promise<string>;
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves a list of allowed entities from the loaded metadata.
|
|
63
|
+
* Each entity includes its entity set name, entity type, and navigable properties
|
|
64
|
+
* that are collections (i.e., to-many relationships).
|
|
65
|
+
*
|
|
66
|
+
* @param refresh Refresh metadata by avoiding cached values.
|
|
67
|
+
* @returns A promise that resolves to an array of allowed entities with their navigations.
|
|
68
|
+
*/
|
|
69
|
+
getAllowedEntities(refresh?: boolean): Promise<AllowedEntity[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves the allowed navigation properties for a given entity set or entity type.
|
|
72
|
+
* These are filtered from the allowed entities' navigation collections.
|
|
73
|
+
*
|
|
74
|
+
* @param entitySet Optional entity set name to match.
|
|
75
|
+
* @param entityType Optional entity type name to match.
|
|
76
|
+
* @param refresh Refresh metadata by avoiding cached values.
|
|
77
|
+
* @returns A promise that resolves to an array of allowed navigations.
|
|
78
|
+
*/
|
|
79
|
+
getAllowedNavigations(entitySet?: string, entityType?: string, refresh?: boolean): Promise<AllowedNavigation[]>;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Service = void 0;
|
|
4
|
+
const fiori_annotation_api_1 = require("@sap-ux/fiori-annotation-api");
|
|
5
|
+
const project_access_1 = require("@sap-ux/project-access");
|
|
6
|
+
const annotation_converter_1 = require("@sap-ux/annotation-converter");
|
|
7
|
+
/**
|
|
8
|
+
* Represents a service that manages Fiori metadata and annotations.
|
|
9
|
+
*/
|
|
10
|
+
class Service {
|
|
11
|
+
options;
|
|
12
|
+
metadataService;
|
|
13
|
+
annotationService;
|
|
14
|
+
nodes = [];
|
|
15
|
+
nodesMap = new Map();
|
|
16
|
+
namespace = '';
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new instance of the Service class.
|
|
19
|
+
*
|
|
20
|
+
* @param options - Configuration options for the service,.
|
|
21
|
+
*/
|
|
22
|
+
constructor(options) {
|
|
23
|
+
this.options = options;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Loads and initializes metadata and annotation services.
|
|
27
|
+
*
|
|
28
|
+
* @param refresh - Whether to force a reload of the metadata.
|
|
29
|
+
* @returns A promise that resolves when metadata is loaded.
|
|
30
|
+
*/
|
|
31
|
+
async loadMetadata(refresh = false) {
|
|
32
|
+
if (!refresh && this.metadataService) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const { project, serviceName, appName } = this.options;
|
|
36
|
+
const projectNew = await (0, project_access_1.getProject)(project.root);
|
|
37
|
+
this.annotationService = await fiori_annotation_api_1.FioriAnnotationService.createService(projectNew, serviceName, appName);
|
|
38
|
+
await this.annotationService.sync();
|
|
39
|
+
this.metadataService = this.annotationService.getMetadataService();
|
|
40
|
+
this.namespace = [...this.metadataService.getNamespaces()][0];
|
|
41
|
+
this.metadataService.visitMetadataElements(this.visitMdElement.bind(this));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Visits a metadata element and registers it as a node within the service.
|
|
45
|
+
*
|
|
46
|
+
* @param mdElement - The metadata element to process and register.
|
|
47
|
+
*/
|
|
48
|
+
visitMdElement(mdElement) {
|
|
49
|
+
const { path, name } = mdElement;
|
|
50
|
+
const kind = this.metadataService?.getEdmTargetKinds(path)[0] || '';
|
|
51
|
+
const metadataNode = { path, name, mdElement, kind };
|
|
52
|
+
this.nodes?.push(metadataNode);
|
|
53
|
+
this.nodesMap.set(path, metadataNode);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves the namespace for the current instance.
|
|
57
|
+
*
|
|
58
|
+
* @returns {Promise<string>} A promise that resolves to the namespace string.
|
|
59
|
+
*/
|
|
60
|
+
async getNamespace() {
|
|
61
|
+
await this.loadMetadata();
|
|
62
|
+
return this.namespace;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Retrieves a list of allowed entities from the loaded metadata.
|
|
66
|
+
* Each entity includes its entity set name, entity type, and navigable properties
|
|
67
|
+
* that are collections (i.e., to-many relationships).
|
|
68
|
+
*
|
|
69
|
+
* @param refresh Refresh metadata by avoiding cached values.
|
|
70
|
+
* @returns A promise that resolves to an array of allowed entities with their navigations.
|
|
71
|
+
*/
|
|
72
|
+
async getAllowedEntities(refresh = false) {
|
|
73
|
+
await this.loadMetadata(refresh);
|
|
74
|
+
if (!this.annotationService) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
const allowedEntities = [];
|
|
78
|
+
const rawMetadata = this.annotationService.getSchema();
|
|
79
|
+
const metadata = (0, annotation_converter_1.convert)(rawMetadata);
|
|
80
|
+
for (const entitySet of metadata.entitySets) {
|
|
81
|
+
allowedEntities.push({
|
|
82
|
+
entitySet: entitySet.name,
|
|
83
|
+
entityType: entitySet.entityType.name,
|
|
84
|
+
navigations: entitySet.entityType.navigationProperties
|
|
85
|
+
.filter((navigationProperty) => navigationProperty.isCollection)
|
|
86
|
+
.map((navigationProperty) => {
|
|
87
|
+
const entityType = navigationProperty.targetType;
|
|
88
|
+
const entitySet = metadata.entitySets.find((entitySet) => entitySet.entityTypeName === entityType.name);
|
|
89
|
+
return {
|
|
90
|
+
name: navigationProperty.name,
|
|
91
|
+
fullyQualifiedName: navigationProperty.fullyQualifiedName,
|
|
92
|
+
entitySet: entitySet?.name ?? entityType.name
|
|
93
|
+
};
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return allowedEntities;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Retrieves the allowed navigation properties for a given entity set or entity type.
|
|
101
|
+
* These are filtered from the allowed entities' navigation collections.
|
|
102
|
+
*
|
|
103
|
+
* @param entitySet Optional entity set name to match.
|
|
104
|
+
* @param entityType Optional entity type name to match.
|
|
105
|
+
* @param refresh Refresh metadata by avoiding cached values.
|
|
106
|
+
* @returns A promise that resolves to an array of allowed navigations.
|
|
107
|
+
*/
|
|
108
|
+
async getAllowedNavigations(entitySet, entityType, refresh = false) {
|
|
109
|
+
const allowedEntities = this.getAllowedEntities(refresh);
|
|
110
|
+
return ((await allowedEntities).find((allowedEntity) => allowedEntity.entitySet === entitySet || allowedEntity.entityType === entityType)?.navigations ?? []);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.Service = Service;
|
|
114
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ServiceOptions } from './service';
|
|
2
|
+
import { Service } from './service';
|
|
3
|
+
/**
|
|
4
|
+
* Get service from service store (cache).
|
|
5
|
+
*
|
|
6
|
+
* @param options Service options.
|
|
7
|
+
* @returns Resolved service from service store (cache).
|
|
8
|
+
*/
|
|
9
|
+
export declare function getService(options: ServiceOptions): Promise<Service>;
|
|
10
|
+
/**
|
|
11
|
+
* Removes a service from the `serviceStore`.
|
|
12
|
+
*
|
|
13
|
+
* @param options - The configuration object containing details about the service.
|
|
14
|
+
* @returns `true` if the service was removed successfully.
|
|
15
|
+
*/
|
|
16
|
+
export declare function removeService(options: ServiceOptions): boolean;
|
|
17
|
+
//# sourceMappingURL=serviceStore.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getService = getService;
|
|
4
|
+
exports.removeService = removeService;
|
|
5
|
+
const service_1 = require("./service");
|
|
6
|
+
const serviceStore = new Map();
|
|
7
|
+
/**
|
|
8
|
+
* Get service from service store (cache).
|
|
9
|
+
*
|
|
10
|
+
* @param options Service options.
|
|
11
|
+
* @returns Resolved service from service store (cache).
|
|
12
|
+
*/
|
|
13
|
+
async function getService(options) {
|
|
14
|
+
const key = options.serviceName;
|
|
15
|
+
if (!serviceStore.has(key)) {
|
|
16
|
+
serviceStore.set(key, new service_1.Service(options));
|
|
17
|
+
}
|
|
18
|
+
const service = serviceStore.get(key);
|
|
19
|
+
if (!service) {
|
|
20
|
+
throw new Error(`No service: '${key}'`);
|
|
21
|
+
}
|
|
22
|
+
return service;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Removes a service from the `serviceStore`.
|
|
26
|
+
*
|
|
27
|
+
* @param options - The configuration object containing details about the service.
|
|
28
|
+
* @returns `true` if the service was removed successfully.
|
|
29
|
+
*/
|
|
30
|
+
function removeService(options) {
|
|
31
|
+
const key = options.serviceName;
|
|
32
|
+
return serviceStore.delete(key);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=serviceStore.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { PageTypeV4 } from '@sap/ux-specification/dist/types/src';
|
|
2
|
+
export interface NewBasePage {
|
|
3
|
+
parent?: string;
|
|
4
|
+
pageType: PageTypeV4;
|
|
5
|
+
navigation?: string;
|
|
6
|
+
entitySet?: string;
|
|
7
|
+
newEntity?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface NewObjectPage extends NewBasePage {
|
|
10
|
+
pageType: PageTypeV4.ObjectPage;
|
|
11
|
+
}
|
|
12
|
+
export interface NewListReport extends NewBasePage {
|
|
13
|
+
pageType: PageTypeV4.ListReport;
|
|
14
|
+
}
|
|
15
|
+
export interface NewCustomPage extends NewBasePage {
|
|
16
|
+
pageType: PageTypeV4.CustomPage;
|
|
17
|
+
viewName: string;
|
|
18
|
+
}
|
|
19
|
+
export type NewPage = NewObjectPage | NewListReport | NewCustomPage;
|
|
20
|
+
export interface PageDef {
|
|
21
|
+
pageId: string;
|
|
22
|
+
pageType: string;
|
|
23
|
+
entitySet: string;
|
|
24
|
+
contextPath?: string;
|
|
25
|
+
routePattern?: string;
|
|
26
|
+
viewName?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface AllowedNavigation {
|
|
29
|
+
name: string;
|
|
30
|
+
fullyQualifiedName?: string;
|
|
31
|
+
entitySet: string;
|
|
32
|
+
}
|
|
33
|
+
export interface AllowedNavigationOptions extends AllowedNavigation {
|
|
34
|
+
isNavigation?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare enum MissingNavigationReason {
|
|
37
|
+
NoAnyNavigationsForParent = 1,
|
|
38
|
+
NotFoundNavigationForParent = 2,
|
|
39
|
+
NoEntityProvided = 3,
|
|
40
|
+
NotFoundEntity = 4
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MissingNavigationReason = void 0;
|
|
4
|
+
var MissingNavigationReason;
|
|
5
|
+
(function (MissingNavigationReason) {
|
|
6
|
+
MissingNavigationReason[MissingNavigationReason["NoAnyNavigationsForParent"] = 1] = "NoAnyNavigationsForParent";
|
|
7
|
+
MissingNavigationReason[MissingNavigationReason["NotFoundNavigationForParent"] = 2] = "NotFoundNavigationForParent";
|
|
8
|
+
MissingNavigationReason[MissingNavigationReason["NoEntityProvided"] = 3] = "NoEntityProvided";
|
|
9
|
+
MissingNavigationReason[MissingNavigationReason["NotFoundEntity"] = 4] = "NotFoundEntity";
|
|
10
|
+
})(MissingNavigationReason || (exports.MissingNavigationReason = MissingNavigationReason = {}));
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PageDef } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Generates the id for a new page.
|
|
4
|
+
*
|
|
5
|
+
* @param page - page attributes.
|
|
6
|
+
* @param parentPage - parent page.
|
|
7
|
+
* @param pages - Object with existing pages.
|
|
8
|
+
* @param navigationProperty - navigation property (optional).
|
|
9
|
+
* @returns Generated page id.
|
|
10
|
+
*/
|
|
11
|
+
export declare function generatePageId(page: PageDef, parentPage: string | undefined, pages: PageDef[], navigationProperty?: string): string;
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generatePageId = generatePageId;
|
|
4
|
+
const src_1 = require("@sap/ux-specification/dist/types/src");
|
|
5
|
+
const newPagePrefixForType = new Map([
|
|
6
|
+
[src_1.PageTypeV4.ListReport, 'List'],
|
|
7
|
+
[src_1.PageTypeV4.ObjectPage, src_1.PageTypeV4.ObjectPage],
|
|
8
|
+
[src_1.PageTypeV4.CustomPage, 'Page'],
|
|
9
|
+
[src_1.PageTypeV4.FPMCustomPage, 'Page'],
|
|
10
|
+
[src_1.PageTypeV4.AnalyticalListPage, 'ALP']
|
|
11
|
+
]);
|
|
12
|
+
/**
|
|
13
|
+
* Generates the id for a new V4 page.
|
|
14
|
+
*
|
|
15
|
+
* @param page - page attributes.
|
|
16
|
+
* @param parentPage - parent page; to check if it is a root page.
|
|
17
|
+
* @param navigationProperty - Navigation property (optional).
|
|
18
|
+
* @returns parts = an array of strings that shall be joined to form the page ID.
|
|
19
|
+
*/
|
|
20
|
+
function generatePageIdV4(page, parentPage, navigationProperty) {
|
|
21
|
+
let name = '';
|
|
22
|
+
let parts = [];
|
|
23
|
+
// Populate with page entity or name
|
|
24
|
+
if (page.pageType === src_1.PageTypeV4.CustomPage || page.pageType === src_1.PageTypeV4.FPMCustomPage) {
|
|
25
|
+
const viewId = page.viewName ?? '';
|
|
26
|
+
const names = viewId.split('.');
|
|
27
|
+
name = names[names.length - 1];
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
name = page.contextPath ? page.contextPath.slice(1).replace(/\//g, '_') : page.entitySet;
|
|
31
|
+
}
|
|
32
|
+
parts = [name];
|
|
33
|
+
if (parentPage &&
|
|
34
|
+
navigationProperty &&
|
|
35
|
+
(!page.contextPath || page.contextPath.indexOf(navigationProperty) === -1)) {
|
|
36
|
+
parts.push(navigationProperty);
|
|
37
|
+
}
|
|
38
|
+
// Append page type to last part of page id - it places page type at the end of id without separator
|
|
39
|
+
parts[parts.length - 1] += newPagePrefixForType.get(page.pageType);
|
|
40
|
+
return parts;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Generates the id for a new page.
|
|
44
|
+
*
|
|
45
|
+
* @param page - page attributes.
|
|
46
|
+
* @param parentPage - parent page.
|
|
47
|
+
* @param pages - Object with existing pages.
|
|
48
|
+
* @param navigationProperty - navigation property (optional).
|
|
49
|
+
* @returns Generated page id.
|
|
50
|
+
*/
|
|
51
|
+
function generatePageId(page, parentPage, pages, navigationProperty) {
|
|
52
|
+
// Page generation for V4 page
|
|
53
|
+
const parts = generatePageIdV4(page, parentPage, navigationProperty);
|
|
54
|
+
let pageId = parts.join('_');
|
|
55
|
+
const existingPageIds = pages.map((existingPage) => existingPage.pageId);
|
|
56
|
+
let idx = 0;
|
|
57
|
+
while (existingPageIds.indexOf(pageId) > -1) {
|
|
58
|
+
pageId += idx.toString();
|
|
59
|
+
idx++;
|
|
60
|
+
}
|
|
61
|
+
return pageId;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GetFunctionalityDetailsInput, GetFunctionalityDetailsOutput } from '../types';
|
|
2
|
+
import type { PropertyPath } from '../page-editor-api';
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves functionality details based on the provided input parameters.
|
|
5
|
+
*
|
|
6
|
+
* @param params - The input parameters for getting functionality details.
|
|
7
|
+
* @param params.appPath - The path to the application.
|
|
8
|
+
* @param params.functionalityId - The ID of the functionality to retrieve details for.
|
|
9
|
+
* @returns A promise that resolves to the functionality details output.
|
|
10
|
+
* @throws Error if appPath or functionalityId is not provided.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getFunctionalityDetails(params: GetFunctionalityDetailsInput): Promise<GetFunctionalityDetailsOutput>;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves a functionality ID into a page name and property path.
|
|
15
|
+
*
|
|
16
|
+
* @param functionalityId - The ID of the functionality to resolve, either as a string or an array of strings.
|
|
17
|
+
* @returns An object containing the resolved page name (if applicable) and property path.
|
|
18
|
+
* @throws Error if the functionalityId parameter has an invalid format.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveFunctionality(functionalityId: string | string[]): {
|
|
21
|
+
pageName?: string;
|
|
22
|
+
propertyPath: PropertyPath;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=get-functionality-details.d.ts.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFunctionalityDetails = getFunctionalityDetails;
|
|
4
|
+
exports.resolveFunctionality = resolveFunctionality;
|
|
5
|
+
const page_editor_api_1 = require("../page-editor-api");
|
|
6
|
+
const functionalities_1 = require("./functionalities");
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves functionality details based on the provided input parameters.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The input parameters for getting functionality details.
|
|
12
|
+
* @param params.appPath - The path to the application.
|
|
13
|
+
* @param params.functionalityId - The ID of the functionality to retrieve details for.
|
|
14
|
+
* @returns A promise that resolves to the functionality details output.
|
|
15
|
+
* @throws Error if appPath or functionalityId is not provided.
|
|
16
|
+
*/
|
|
17
|
+
async function getFunctionalityDetails(params) {
|
|
18
|
+
const { appPath, functionalityId } = params;
|
|
19
|
+
if (!appPath) {
|
|
20
|
+
throw new Error('appPath parameter is required');
|
|
21
|
+
}
|
|
22
|
+
if (!functionalityId) {
|
|
23
|
+
throw new Error('functionalityId parameter is required');
|
|
24
|
+
}
|
|
25
|
+
const externalFunctionality = typeof functionalityId === 'string' ? functionalities_1.FUNCTIONALITIES_HANDLERS.get(functionalityId) : undefined;
|
|
26
|
+
if (externalFunctionality) {
|
|
27
|
+
return externalFunctionality.getFunctionalityDetails(params);
|
|
28
|
+
}
|
|
29
|
+
const { pageName, propertyPath } = resolveFunctionality(functionalityId);
|
|
30
|
+
const page = await getDetails(appPath, pageName);
|
|
31
|
+
const details = page ? getPropertyDetails(page, propertyPath) : undefined;
|
|
32
|
+
if (!details) {
|
|
33
|
+
throw new Error('functionalityId was not resolved');
|
|
34
|
+
}
|
|
35
|
+
if (pageName) {
|
|
36
|
+
details.pageName = pageName;
|
|
37
|
+
}
|
|
38
|
+
return details;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Converts TreeNodeProperty objects to Parameter objects.
|
|
42
|
+
*
|
|
43
|
+
* @param properties - An array of TreeNodeProperty objects to convert.
|
|
44
|
+
* @returns An array of Parameter objects.
|
|
45
|
+
*/
|
|
46
|
+
function getParameters(properties) {
|
|
47
|
+
const parameters = [];
|
|
48
|
+
for (const property of properties) {
|
|
49
|
+
const parameter = {
|
|
50
|
+
id: property.name,
|
|
51
|
+
name: property.displayName,
|
|
52
|
+
description: property.description,
|
|
53
|
+
type: property.type,
|
|
54
|
+
currentValue: property.value
|
|
55
|
+
};
|
|
56
|
+
if (property.options) {
|
|
57
|
+
parameter.options = property.options.map((option) => option.key);
|
|
58
|
+
}
|
|
59
|
+
if (property.properties) {
|
|
60
|
+
parameter.parameters = getParameters(property.properties);
|
|
61
|
+
}
|
|
62
|
+
parameters.push(parameter);
|
|
63
|
+
}
|
|
64
|
+
return parameters;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves property details from a page tree node based on the provided property path.
|
|
68
|
+
*
|
|
69
|
+
* @param page - The root TreeNode of the page.
|
|
70
|
+
* @param propertyPath - The path to the desired property.
|
|
71
|
+
* @returns The functionality details output for the specified property, or undefined if not found.
|
|
72
|
+
*/
|
|
73
|
+
function getPropertyDetails(page, propertyPath) {
|
|
74
|
+
const { property, node } = (0, page_editor_api_1.findByPath)([page], propertyPath) ?? {};
|
|
75
|
+
let details;
|
|
76
|
+
if (property) {
|
|
77
|
+
// Property was found by path
|
|
78
|
+
const parameters = getParameters([property]);
|
|
79
|
+
details = {
|
|
80
|
+
functionalityId: 'change-property',
|
|
81
|
+
name: 'Change property',
|
|
82
|
+
// There is issue in cline by applying values with undefined - throws error "Invalid JSON argument".
|
|
83
|
+
// As workaround - I am using approach with null as currently there is no use case where null is real value.
|
|
84
|
+
description: `Change a property. To reset, remove, or restore it to its default value, set the value to null. If the property's description does not specify how to disable the related feature, setting it to null is typically the appropriate way to disable or clear it.`,
|
|
85
|
+
parameters
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
else if (node?.path.length) {
|
|
89
|
+
// Node was found by path - list node properties
|
|
90
|
+
let parameters = [];
|
|
91
|
+
for (const property of node.properties) {
|
|
92
|
+
parameters = parameters.concat(getParameters([property]));
|
|
93
|
+
}
|
|
94
|
+
details = {
|
|
95
|
+
functionalityId: 'change-property',
|
|
96
|
+
name: 'Change property',
|
|
97
|
+
// There is issue in cline by applying values with undefined - throws error "Invalid JSON argument".
|
|
98
|
+
// As workaround - I am using approach with null as currently there is no use case where null is real value.
|
|
99
|
+
description: `Change a property. To reset, remove, or restore it to its default value, set the value to null. If the property's description does not specify how to disable the related feature, setting it to null is typically the appropriate way to disable or clear it.`,
|
|
100
|
+
parameters
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return details;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves the page tree for a given application and page.
|
|
107
|
+
*
|
|
108
|
+
* @param appPath - The path to the application.
|
|
109
|
+
* @param pageName - Optional. The name of the page to retrieve details for.
|
|
110
|
+
* @returns A promise that resolves to the page TreeNode, or undefined if not found.
|
|
111
|
+
*/
|
|
112
|
+
async function getDetails(appPath, pageName) {
|
|
113
|
+
const project = await (0, utils_1.resolveApplication)(appPath);
|
|
114
|
+
if (project?.applicationAccess) {
|
|
115
|
+
const pageEditorApi = new page_editor_api_1.PageEditorApi(project.applicationAccess, pageName);
|
|
116
|
+
return pageEditorApi.getPageTree();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Resolves a functionality ID into a page name and property path.
|
|
121
|
+
*
|
|
122
|
+
* @param functionalityId - The ID of the functionality to resolve, either as a string or an array of strings.
|
|
123
|
+
* @returns An object containing the resolved page name (if applicable) and property path.
|
|
124
|
+
* @throws Error if the functionalityId parameter has an invalid format.
|
|
125
|
+
*/
|
|
126
|
+
function resolveFunctionality(functionalityId) {
|
|
127
|
+
let propertyPath;
|
|
128
|
+
try {
|
|
129
|
+
propertyPath = typeof functionalityId === 'string' ? JSON.parse(functionalityId) : [...functionalityId];
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
// The functionalityId is expected to be either a string array (e.g. "['Id1', 'Id2']") or an array of strings (e.g. ['Id1', 'Id2']).
|
|
133
|
+
throw new Error(`Invalid format of functionalityId parameter, error: ${e}`);
|
|
134
|
+
}
|
|
135
|
+
let pageName;
|
|
136
|
+
if (propertyPath[0] !== 'settings') {
|
|
137
|
+
// Currently all application paths starts with settings and it is simple to detect pagename from path
|
|
138
|
+
pageName = propertyPath.shift()?.toString();
|
|
139
|
+
}
|
|
140
|
+
return { pageName, propertyPath };
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=get-functionality-details.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
export { listFioriApps } from './list-fiori-apps';
|
|
3
|
+
export { listFunctionalities } from './list-functionalities';
|
|
4
|
+
export { getFunctionalityDetails } from './get-functionality-details';
|
|
5
|
+
export { executeFunctionality } from './execute-functionality';
|
|
6
|
+
export declare const tools: Tool[];
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tools = exports.executeFunctionality = exports.getFunctionalityDetails = exports.listFunctionalities = exports.listFioriApps = void 0;
|
|
4
|
+
const output_schema_1 = require("./output-schema");
|
|
5
|
+
const input_schema_1 = require("./input-schema");
|
|
6
|
+
var list_fiori_apps_1 = require("./list-fiori-apps");
|
|
7
|
+
Object.defineProperty(exports, "listFioriApps", { enumerable: true, get: function () { return list_fiori_apps_1.listFioriApps; } });
|
|
8
|
+
var list_functionalities_1 = require("./list-functionalities");
|
|
9
|
+
Object.defineProperty(exports, "listFunctionalities", { enumerable: true, get: function () { return list_functionalities_1.listFunctionalities; } });
|
|
10
|
+
var get_functionality_details_1 = require("./get-functionality-details");
|
|
11
|
+
Object.defineProperty(exports, "getFunctionalityDetails", { enumerable: true, get: function () { return get_functionality_details_1.getFunctionalityDetails; } });
|
|
12
|
+
var execute_functionality_1 = require("./execute-functionality");
|
|
13
|
+
Object.defineProperty(exports, "executeFunctionality", { enumerable: true, get: function () { return execute_functionality_1.executeFunctionality; } });
|
|
14
|
+
exports.tools = [
|
|
15
|
+
{
|
|
16
|
+
name: 'list-fiori-apps',
|
|
17
|
+
description: `Scans a specified directory to find existing SAP Fiori applications that can be modified.
|
|
18
|
+
This is an optional, preliminary tool.
|
|
19
|
+
**Use this first ONLY if the target application's name or path is not already known.**
|
|
20
|
+
The output can be used to ask the user for clarification before starting the main 3-step workflow.`,
|
|
21
|
+
inputSchema: input_schema_1.listFioriAppsInputSchema,
|
|
22
|
+
outputSchema: output_schema_1.listFioriAppsOutputSchema
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'list-functionality',
|
|
26
|
+
description: `**(Step 1 of 3)**
|
|
27
|
+
Gets the complete and exclusive list of supported functionalities to create a new or modify an existing SAP Fiori application.
|
|
28
|
+
This is the **first mandatory step** to begin the workflow and requires a valid absolute path to a SAP Fiori application as input.
|
|
29
|
+
You MUST use a functionalityId from this tool's output to request details to the functionality in 'get-functionality-details' (Step 2).
|
|
30
|
+
You MUST not use a functionalityId as name of a tool.
|
|
31
|
+
Do not guess, assume, or use any functionality not present in this list, as it is invalid and will cause the operation to fail.
|
|
32
|
+
**Note: If the target application is not known, use the list-fiori-apps tool first to identify it.**`,
|
|
33
|
+
inputSchema: input_schema_1.listFunctionalityInputSchema,
|
|
34
|
+
outputSchema: output_schema_1.listFunctionalityOutputSchema
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'get-functionality-details',
|
|
38
|
+
description: `**(Step 2 of 3)**
|
|
39
|
+
Gets the required parameters and detailed information for a specific functionality to create a new or modify an existing SAP Fiori application.
|
|
40
|
+
You MUST provide a functionalityId obtained from 'list-functionality' (Step 1).
|
|
41
|
+
The output of this tool is required for the final step 'execute-functionality' (Step 3).`,
|
|
42
|
+
inputSchema: input_schema_1.getFunctionalityDetailsInputSchema,
|
|
43
|
+
outputSchema: output_schema_1.getFunctionalityDetailsOutputSchema
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'execute-functionality',
|
|
47
|
+
description: `**(Step 3 of 3)**
|
|
48
|
+
Executes a specific functionality to create a new or modify an existing SAP Fiori application with provided parameters.
|
|
49
|
+
This is the **final step** of the workflow and performs the actual creation or modification.
|
|
50
|
+
You MUST provide the exact parameter information obtained from get-functionality-details (Step 2).`,
|
|
51
|
+
inputSchema: input_schema_1.executeFunctionalityInputSchema,
|
|
52
|
+
outputSchema: output_schema_1.executeFunctionalityOutputSchema
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"appPath": {
|
|
5
|
+
"type": "string",
|
|
6
|
+
"description": "Path to the Fiori application. Path should be an absolute path."
|
|
7
|
+
},
|
|
8
|
+
"functionalityId": {
|
|
9
|
+
"anyOf": [
|
|
10
|
+
{
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": ["string", "number"]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "string"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"description": "The ID of the functionality to execute"
|
|
21
|
+
},
|
|
22
|
+
"parameters": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"description": "Parameters for the functionality execution"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": ["functionalityId", "appPath", "parameters"]
|
|
28
|
+
}
|