@sap-ux/fiori-mcp-server 0.0.4 → 0.0.5
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/tools/execute-functionality.d.ts +2 -2
- package/dist/tools/functionalities/functionalities.d.ts +58 -1
- package/dist/tools/functionalities/generate-fiori-ui-app/command.d.ts +2 -2
- package/dist/tools/get-functionality-details.js +1 -1
- package/dist/tools/index.js +44 -10
- package/dist/tools/utils.d.ts +10 -0
- package/dist/tools/utils.js +49 -1
- package/dist/types/basic.d.ts +123 -0
- package/dist/types/basic.js +108 -0
- package/dist/types/index.d.ts +38 -0
- package/dist/{types.js → types/index.js} +1 -1
- package/dist/types/input.d.ts +29 -0
- package/dist/types/input.js +77 -0
- package/dist/types/output.d.ts +125 -0
- package/dist/types/output.js +97 -0
- package/package.json +5 -5
- package/dist/tools/input-schema/execute-functionality.json +0 -28
- package/dist/tools/input-schema/get-functionality-details.json +0 -24
- package/dist/tools/input-schema/index.d.ts +0 -5
- package/dist/tools/input-schema/index.js +0 -15
- package/dist/tools/input-schema/list-fiori-apps.json +0 -12
- package/dist/tools/input-schema/list-functionality.json +0 -10
- package/dist/tools/output-schema/execute-functionality.json +0 -39
- package/dist/tools/output-schema/get-functionality-details.json +0 -166
- package/dist/tools/output-schema/index.d.ts +0 -5
- package/dist/tools/output-schema/index.js +0 -15
- package/dist/tools/output-schema/list-fiori-apps.json +0 -41
- package/dist/tools/output-schema/list-functionality.json +0 -37
- package/dist/types.d.ts +0 -174
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExecuteFunctionalityInput, ExecuteFunctionalityOutput } from '../types';
|
|
2
2
|
import { PageEditorApi } from '../page-editor-api';
|
|
3
3
|
/**
|
|
4
4
|
* Executes a functionality based on the provided parameters.
|
|
@@ -7,7 +7,7 @@ import { PageEditorApi } from '../page-editor-api';
|
|
|
7
7
|
* @returns A promise that resolves to the execution output
|
|
8
8
|
* @throws Error if required parameters are missing
|
|
9
9
|
*/
|
|
10
|
-
export declare function executeFunctionality(params:
|
|
10
|
+
export declare function executeFunctionality(params: ExecuteFunctionalityInput): Promise<ExecuteFunctionalityOutput>;
|
|
11
11
|
/**
|
|
12
12
|
* Retrieves the PageEditorApi instance for the given application path and page name.
|
|
13
13
|
*
|
|
@@ -1,4 +1,61 @@
|
|
|
1
1
|
import type { FunctionalityHandlers } from '../../types';
|
|
2
|
-
export declare const FUNCTIONALITIES_DETAILS:
|
|
2
|
+
export declare const FUNCTIONALITIES_DETAILS: {
|
|
3
|
+
functionalityId: string | (string | number)[];
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
id: string;
|
|
8
|
+
type: "string" | "number" | "boolean" | "object" | "array";
|
|
9
|
+
name?: string | undefined;
|
|
10
|
+
required?: boolean | undefined;
|
|
11
|
+
description?: string | undefined;
|
|
12
|
+
defaultValue?: unknown;
|
|
13
|
+
options?: (string | number | boolean | null)[] | undefined;
|
|
14
|
+
currentValue?: unknown;
|
|
15
|
+
examples?: string[] | undefined;
|
|
16
|
+
pattern?: string | undefined;
|
|
17
|
+
parameters?: {
|
|
18
|
+
id: string;
|
|
19
|
+
type: "string" | "number" | "boolean" | "object" | "array";
|
|
20
|
+
name?: string | undefined;
|
|
21
|
+
required?: boolean | undefined;
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
defaultValue?: unknown;
|
|
24
|
+
options?: (string | number | boolean | null)[] | undefined;
|
|
25
|
+
currentValue?: unknown;
|
|
26
|
+
examples?: string[] | undefined;
|
|
27
|
+
pattern?: string | undefined;
|
|
28
|
+
parameters?: {
|
|
29
|
+
id: string;
|
|
30
|
+
type: "string" | "number" | "boolean" | "object" | "array";
|
|
31
|
+
name?: string | undefined;
|
|
32
|
+
required?: boolean | undefined;
|
|
33
|
+
description?: string | undefined;
|
|
34
|
+
defaultValue?: unknown;
|
|
35
|
+
options?: (string | number | boolean | null)[] | undefined;
|
|
36
|
+
currentValue?: unknown;
|
|
37
|
+
examples?: string[] | undefined;
|
|
38
|
+
pattern?: string | undefined;
|
|
39
|
+
parameters?: {
|
|
40
|
+
id: string;
|
|
41
|
+
type: "string" | "number" | "boolean" | "object" | "array";
|
|
42
|
+
name?: string | undefined;
|
|
43
|
+
required?: boolean | undefined;
|
|
44
|
+
description?: string | undefined;
|
|
45
|
+
defaultValue?: unknown;
|
|
46
|
+
options?: (string | number | boolean | null)[] | undefined;
|
|
47
|
+
currentValue?: unknown;
|
|
48
|
+
examples?: string[] | undefined;
|
|
49
|
+
pattern?: string | undefined;
|
|
50
|
+
}[] | undefined;
|
|
51
|
+
}[] | undefined;
|
|
52
|
+
}[] | undefined;
|
|
53
|
+
}[];
|
|
54
|
+
technicalDescription?: string | undefined;
|
|
55
|
+
prerequisites?: string[] | undefined;
|
|
56
|
+
impact?: string | undefined;
|
|
57
|
+
examples?: string[] | undefined;
|
|
58
|
+
pageName?: string | undefined;
|
|
59
|
+
}[];
|
|
3
60
|
export declare const FUNCTIONALITIES_HANDLERS: Map<string, FunctionalityHandlers>;
|
|
4
61
|
//# sourceMappingURL=functionalities.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExecuteFunctionalityInput, ExecuteFunctionalityOutput } from '../../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Method to generate fiori app.
|
|
4
4
|
*
|
|
5
5
|
* @param params Input parameters for application generation.
|
|
6
6
|
* @returns Application generation execution output.
|
|
7
7
|
*/
|
|
8
|
-
export declare function command(params:
|
|
8
|
+
export declare function command(params: ExecuteFunctionalityInput): Promise<ExecuteFunctionalityOutput>;
|
|
9
9
|
//# sourceMappingURL=command.d.ts.map
|
|
@@ -54,7 +54,7 @@ function getParameters(properties) {
|
|
|
54
54
|
currentValue: property.value
|
|
55
55
|
};
|
|
56
56
|
if (property.options) {
|
|
57
|
-
parameter.options = property.options.map((option) => option.key);
|
|
57
|
+
parameter.options = property.options.map((option) => option.key ?? null);
|
|
58
58
|
}
|
|
59
59
|
if (property.properties) {
|
|
60
60
|
parameter.parameters = getParameters(property.properties);
|
package/dist/tools/index.js
CHANGED
|
@@ -1,8 +1,42 @@
|
|
|
1
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
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.tools = exports.executeFunctionality = exports.getFunctionalityDetails = exports.listFunctionalities = exports.listFioriApps = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
37
|
+
const Input = __importStar(require("../types/input"));
|
|
38
|
+
const Output = __importStar(require("../types/output"));
|
|
39
|
+
const utils_1 = require("./utils");
|
|
6
40
|
var list_fiori_apps_1 = require("./list-fiori-apps");
|
|
7
41
|
Object.defineProperty(exports, "listFioriApps", { enumerable: true, get: function () { return list_fiori_apps_1.listFioriApps; } });
|
|
8
42
|
var list_functionalities_1 = require("./list-functionalities");
|
|
@@ -18,8 +52,8 @@ exports.tools = [
|
|
|
18
52
|
This is an optional, preliminary tool.
|
|
19
53
|
**Use this first ONLY if the target application's name or path is not already known.**
|
|
20
54
|
The output can be used to ask the user for clarification before starting the main 3-step workflow.`,
|
|
21
|
-
inputSchema:
|
|
22
|
-
outputSchema:
|
|
55
|
+
inputSchema: (0, utils_1.convertToSchema)(Input.ListFioriAppsInputSchema),
|
|
56
|
+
outputSchema: (0, utils_1.convertToSchema)(Output.ListFioriAppsOutputSchema)
|
|
23
57
|
},
|
|
24
58
|
{
|
|
25
59
|
name: 'list-functionality',
|
|
@@ -30,8 +64,8 @@ exports.tools = [
|
|
|
30
64
|
You MUST not use a functionalityId as name of a tool.
|
|
31
65
|
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
66
|
**Note: If the target application is not known, use the list-fiori-apps tool first to identify it.**`,
|
|
33
|
-
inputSchema:
|
|
34
|
-
outputSchema:
|
|
67
|
+
inputSchema: (0, utils_1.convertToSchema)(Input.ListFunctionalitiesInputSchema),
|
|
68
|
+
outputSchema: (0, utils_1.convertToSchema)(Output.ListFunctionalitiesOutputSchema)
|
|
35
69
|
},
|
|
36
70
|
{
|
|
37
71
|
name: 'get-functionality-details',
|
|
@@ -39,8 +73,8 @@ exports.tools = [
|
|
|
39
73
|
Gets the required parameters and detailed information for a specific functionality to create a new or modify an existing SAP Fiori application.
|
|
40
74
|
You MUST provide a functionalityId obtained from 'list-functionality' (Step 1).
|
|
41
75
|
The output of this tool is required for the final step 'execute-functionality' (Step 3).`,
|
|
42
|
-
inputSchema:
|
|
43
|
-
outputSchema:
|
|
76
|
+
inputSchema: (0, utils_1.convertToSchema)(Input.GetFunctionalityDetailsInputSchema),
|
|
77
|
+
outputSchema: (0, utils_1.convertToSchema)(Output.GetFunctionalityDetailsOutputSchema)
|
|
44
78
|
},
|
|
45
79
|
{
|
|
46
80
|
name: 'execute-functionality',
|
|
@@ -48,8 +82,8 @@ exports.tools = [
|
|
|
48
82
|
Executes a specific functionality to create a new or modify an existing SAP Fiori application with provided parameters.
|
|
49
83
|
This is the **final step** of the workflow and performs the actual creation or modification.
|
|
50
84
|
You MUST provide the exact parameter information obtained from get-functionality-details (Step 2).`,
|
|
51
|
-
inputSchema:
|
|
52
|
-
outputSchema:
|
|
85
|
+
inputSchema: (0, utils_1.convertToSchema)(Input.ExecuteFunctionalityInputSchema),
|
|
86
|
+
outputSchema: (0, utils_1.convertToSchema)(Output.ExecuteFunctionalityOutputSchema)
|
|
53
87
|
}
|
|
54
88
|
];
|
|
55
89
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as zod from 'zod';
|
|
1
2
|
import type { Appdetails } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Resolves the application details from a given path.
|
|
@@ -13,4 +14,13 @@ export declare function resolveApplication(path: string): Promise<Appdetails | u
|
|
|
13
14
|
* @returns The relative path for the extension folder, or undefined if the directory type is not recognized.
|
|
14
15
|
*/
|
|
15
16
|
export declare const getDefaultExtensionFolder: (directory: string) => string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Converts a Zod schema into a JSON Schema object.
|
|
19
|
+
* Additionally function removes the `$schema` property (if present),
|
|
20
|
+
* since it is unnecessary for mcp server.
|
|
21
|
+
*
|
|
22
|
+
* @param schema - A Zod schema instance to be converted.
|
|
23
|
+
* @returns A JSON Schema object representing the given Zod schema.
|
|
24
|
+
*/
|
|
25
|
+
export declare const convertToSchema: (schema: zod.ZodType) => zod.core.JSONSchema.JSONSchema;
|
|
16
26
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/tools/utils.js
CHANGED
|
@@ -1,9 +1,43 @@
|
|
|
1
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
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDefaultExtensionFolder = void 0;
|
|
36
|
+
exports.convertToSchema = exports.getDefaultExtensionFolder = void 0;
|
|
4
37
|
exports.resolveApplication = resolveApplication;
|
|
5
38
|
const project_access_1 = require("@sap-ux/project-access");
|
|
6
39
|
const path_1 = require("path");
|
|
40
|
+
const zod = __importStar(require("zod"));
|
|
7
41
|
/**
|
|
8
42
|
* Resolves the application details from a given path.
|
|
9
43
|
*
|
|
@@ -71,4 +105,18 @@ const getDefaultExtensionFolder = (directory) => {
|
|
|
71
105
|
return subFolder;
|
|
72
106
|
};
|
|
73
107
|
exports.getDefaultExtensionFolder = getDefaultExtensionFolder;
|
|
108
|
+
/**
|
|
109
|
+
* Converts a Zod schema into a JSON Schema object.
|
|
110
|
+
* Additionally function removes the `$schema` property (if present),
|
|
111
|
+
* since it is unnecessary for mcp server.
|
|
112
|
+
*
|
|
113
|
+
* @param schema - A Zod schema instance to be converted.
|
|
114
|
+
* @returns A JSON Schema object representing the given Zod schema.
|
|
115
|
+
*/
|
|
116
|
+
const convertToSchema = (schema) => {
|
|
117
|
+
const jsonSchema = zod.toJSONSchema(schema);
|
|
118
|
+
delete jsonSchema.$schema;
|
|
119
|
+
return jsonSchema;
|
|
120
|
+
};
|
|
121
|
+
exports.convertToSchema = convertToSchema;
|
|
74
122
|
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as zod from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Interface representing a Fiori application
|
|
4
|
+
*/
|
|
5
|
+
export declare const FioriAppSchema: zod.ZodObject<{
|
|
6
|
+
name: zod.ZodString;
|
|
7
|
+
appPath: zod.ZodString;
|
|
8
|
+
projectPath: zod.ZodString;
|
|
9
|
+
projectType: zod.ZodEnum<{
|
|
10
|
+
EDMXBackend: "EDMXBackend";
|
|
11
|
+
CAPJava: "CAPJava";
|
|
12
|
+
CAPNodejs: "CAPNodejs";
|
|
13
|
+
}>;
|
|
14
|
+
odataVersion: zod.ZodString;
|
|
15
|
+
}, zod.z.core.$strip>;
|
|
16
|
+
/**
|
|
17
|
+
* Type for functionality id
|
|
18
|
+
*/
|
|
19
|
+
export declare const FunctionalityIdSchema: zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>>]>;
|
|
20
|
+
export type Test = zod.infer<typeof FunctionalityIdSchema>;
|
|
21
|
+
/**
|
|
22
|
+
* Schema representing a functionality
|
|
23
|
+
*/
|
|
24
|
+
export declare const FunctionalitySchema: zod.ZodObject<{
|
|
25
|
+
functionalityId: zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>>]>;
|
|
26
|
+
description: zod.ZodString;
|
|
27
|
+
}, zod.z.core.$strip>;
|
|
28
|
+
/**
|
|
29
|
+
* Schema for a Parameter
|
|
30
|
+
*/
|
|
31
|
+
declare const BaseParameterSchema: zod.ZodObject<{
|
|
32
|
+
id: zod.ZodString;
|
|
33
|
+
name: zod.ZodOptional<zod.ZodString>;
|
|
34
|
+
type: zod.ZodEnum<{
|
|
35
|
+
string: "string";
|
|
36
|
+
number: "number";
|
|
37
|
+
boolean: "boolean";
|
|
38
|
+
object: "object";
|
|
39
|
+
array: "array";
|
|
40
|
+
}>;
|
|
41
|
+
required: zod.ZodOptional<zod.ZodBoolean>;
|
|
42
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
43
|
+
defaultValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
44
|
+
options: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber, zod.ZodBoolean, zod.ZodNull]>>>;
|
|
45
|
+
currentValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
46
|
+
examples: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
47
|
+
pattern: zod.ZodOptional<zod.ZodString>;
|
|
48
|
+
}, zod.z.core.$strip>;
|
|
49
|
+
export declare const ParameterSchema: zod.ZodObject<{
|
|
50
|
+
id: zod.ZodString;
|
|
51
|
+
name: zod.ZodOptional<zod.ZodString>;
|
|
52
|
+
type: zod.ZodEnum<{
|
|
53
|
+
string: "string";
|
|
54
|
+
number: "number";
|
|
55
|
+
boolean: "boolean";
|
|
56
|
+
object: "object";
|
|
57
|
+
array: "array";
|
|
58
|
+
}>;
|
|
59
|
+
required: zod.ZodOptional<zod.ZodBoolean>;
|
|
60
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
61
|
+
defaultValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
62
|
+
options: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber, zod.ZodBoolean, zod.ZodNull]>>>;
|
|
63
|
+
currentValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
64
|
+
examples: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
65
|
+
pattern: zod.ZodOptional<zod.ZodString>;
|
|
66
|
+
parameters: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
67
|
+
id: zod.ZodString;
|
|
68
|
+
name: zod.ZodOptional<zod.ZodString>;
|
|
69
|
+
type: zod.ZodEnum<{
|
|
70
|
+
string: "string";
|
|
71
|
+
number: "number";
|
|
72
|
+
boolean: "boolean";
|
|
73
|
+
object: "object";
|
|
74
|
+
array: "array";
|
|
75
|
+
}>;
|
|
76
|
+
required: zod.ZodOptional<zod.ZodBoolean>;
|
|
77
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
78
|
+
defaultValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
79
|
+
options: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber, zod.ZodBoolean, zod.ZodNull]>>>;
|
|
80
|
+
currentValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
81
|
+
examples: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
82
|
+
pattern: zod.ZodOptional<zod.ZodString>;
|
|
83
|
+
parameters: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
84
|
+
id: zod.ZodString;
|
|
85
|
+
name: zod.ZodOptional<zod.ZodString>;
|
|
86
|
+
type: zod.ZodEnum<{
|
|
87
|
+
string: "string";
|
|
88
|
+
number: "number";
|
|
89
|
+
boolean: "boolean";
|
|
90
|
+
object: "object";
|
|
91
|
+
array: "array";
|
|
92
|
+
}>;
|
|
93
|
+
required: zod.ZodOptional<zod.ZodBoolean>;
|
|
94
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
95
|
+
defaultValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
96
|
+
options: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber, zod.ZodBoolean, zod.ZodNull]>>>;
|
|
97
|
+
currentValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
98
|
+
examples: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
99
|
+
pattern: zod.ZodOptional<zod.ZodString>;
|
|
100
|
+
parameters: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
101
|
+
id: zod.ZodString;
|
|
102
|
+
name: zod.ZodOptional<zod.ZodString>;
|
|
103
|
+
type: zod.ZodEnum<{
|
|
104
|
+
string: "string";
|
|
105
|
+
number: "number";
|
|
106
|
+
boolean: "boolean";
|
|
107
|
+
object: "object";
|
|
108
|
+
array: "array";
|
|
109
|
+
}>;
|
|
110
|
+
required: zod.ZodOptional<zod.ZodBoolean>;
|
|
111
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
112
|
+
defaultValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
113
|
+
options: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber, zod.ZodBoolean, zod.ZodNull]>>>;
|
|
114
|
+
currentValue: zod.ZodOptional<zod.ZodUnknown>;
|
|
115
|
+
examples: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
116
|
+
pattern: zod.ZodOptional<zod.ZodString>;
|
|
117
|
+
}, zod.z.core.$strip>>>;
|
|
118
|
+
}, zod.z.core.$strip>>>;
|
|
119
|
+
}, zod.z.core.$strip>>>;
|
|
120
|
+
}, zod.z.core.$strip>;
|
|
121
|
+
export type Parameter = zod.infer<typeof BaseParameterSchema>;
|
|
122
|
+
export {};
|
|
123
|
+
//# sourceMappingURL=basic.d.ts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
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.ParameterSchema = exports.FunctionalitySchema = exports.FunctionalityIdSchema = exports.FioriAppSchema = void 0;
|
|
37
|
+
const zod = __importStar(require("zod"));
|
|
38
|
+
/**
|
|
39
|
+
* Interface representing a Fiori application
|
|
40
|
+
*/
|
|
41
|
+
exports.FioriAppSchema = zod.object({
|
|
42
|
+
/** Name of the Fiori application */
|
|
43
|
+
name: zod
|
|
44
|
+
.string()
|
|
45
|
+
.describe("Name of the Fiori application. Usually derived from the `sap.app/id` field in the application's manifest.json."),
|
|
46
|
+
/** Path to the Fiori application */
|
|
47
|
+
appPath: zod.string().describe("Absolute path to the Fiori application's root directory."),
|
|
48
|
+
/** Path to project */
|
|
49
|
+
projectPath: zod
|
|
50
|
+
.string()
|
|
51
|
+
.describe('Absolute path to the root directory of the project containing this Fiori application. For EDMXBackend (standalone) projects, this is the same as `appPath`. For CAP projects, this points to the CAP project root, which may contain multiple Fiori applications.'),
|
|
52
|
+
/** Type of the Fiori project */
|
|
53
|
+
projectType: zod
|
|
54
|
+
.enum(['EDMXBackend', 'CAPJava', 'CAPNodejs'])
|
|
55
|
+
.describe('Type of project the application belongs to.'),
|
|
56
|
+
/** OData version of the Fiori application */
|
|
57
|
+
odataVersion: zod.string().describe("OData protocol version used by the application's main service.")
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Type for functionality id
|
|
61
|
+
*/
|
|
62
|
+
exports.FunctionalityIdSchema = zod.union([zod.string(), zod.array(zod.union([zod.string(), zod.number()]))]);
|
|
63
|
+
/**
|
|
64
|
+
* Schema representing a functionality
|
|
65
|
+
*/
|
|
66
|
+
exports.FunctionalitySchema = zod.object({
|
|
67
|
+
functionalityId: exports.FunctionalityIdSchema.describe('Identifier to pass as the `functionalityId` parameter when calling `get-functionality-details` or `execute-functionality`'),
|
|
68
|
+
description: zod.string()
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Schema for a Parameter
|
|
72
|
+
*/
|
|
73
|
+
const BaseParameterSchema = zod.object({
|
|
74
|
+
/** ID of the parameter */
|
|
75
|
+
id: zod.string(),
|
|
76
|
+
/** Name of the parameter */
|
|
77
|
+
name: zod.string().optional(),
|
|
78
|
+
/** Type of the parameter */
|
|
79
|
+
type: zod.enum(['string', 'number', 'boolean', 'array', 'object']),
|
|
80
|
+
/** Whether the parameter is required */
|
|
81
|
+
required: zod.boolean().optional(),
|
|
82
|
+
/** Description of the parameter */
|
|
83
|
+
description: zod.string().optional(),
|
|
84
|
+
/** Default value of the parameter */
|
|
85
|
+
defaultValue: zod.unknown().optional(),
|
|
86
|
+
/** Possible options for the parameter */
|
|
87
|
+
options: zod.array(zod.union([zod.string(), zod.number(), zod.boolean(), zod.null()])).optional(),
|
|
88
|
+
/** Current value of the parameter */
|
|
89
|
+
currentValue: zod.unknown().optional(),
|
|
90
|
+
/** Examples for the parameter */
|
|
91
|
+
examples: zod.array(zod.string()).optional(),
|
|
92
|
+
/** Regex pattern to validate the value of this parameter */
|
|
93
|
+
pattern: zod.string().optional()
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Parameters with nesting
|
|
97
|
+
*/
|
|
98
|
+
const NestedParameterSchema = BaseParameterSchema.extend({
|
|
99
|
+
parameters: zod
|
|
100
|
+
.array(BaseParameterSchema.extend({
|
|
101
|
+
parameters: zod.array(BaseParameterSchema).optional()
|
|
102
|
+
}))
|
|
103
|
+
.optional()
|
|
104
|
+
});
|
|
105
|
+
exports.ParameterSchema = BaseParameterSchema.extend({
|
|
106
|
+
parameters: zod.array(NestedParameterSchema).optional()
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=basic.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type * as zod from 'zod';
|
|
2
|
+
import type { ApplicationAccess } from '@sap-ux/project-access';
|
|
3
|
+
import type { FioriAppSchema, FunctionalityIdSchema, FunctionalitySchema, ParameterSchema } from './basic';
|
|
4
|
+
import type { ExecuteFunctionalityInputSchema, GetFunctionalityDetailsInputSchema, ListFioriAppsInputSchema, ListFunctionalitiesInputSchema } from './input';
|
|
5
|
+
import type { ExecuteFunctionalityOutputSchema, GetFunctionalityDetailsOutputSchema, ListFioriAppsOutputSchema, ListFunctionalitiesOutputSchema } from './output';
|
|
6
|
+
export type FioriApp = zod.infer<typeof FioriAppSchema>;
|
|
7
|
+
export type FunctionalityId = zod.infer<typeof FunctionalityIdSchema>;
|
|
8
|
+
export type Parameter = zod.infer<typeof ParameterSchema>;
|
|
9
|
+
export type Functionality = zod.infer<typeof FunctionalitySchema>;
|
|
10
|
+
export type ListFioriAppsInput = zod.infer<typeof ListFioriAppsInputSchema>;
|
|
11
|
+
export type ListFioriAppsOutput = zod.infer<typeof ListFioriAppsOutputSchema>;
|
|
12
|
+
export type ListFunctionalitiesInput = zod.infer<typeof ListFunctionalitiesInputSchema>;
|
|
13
|
+
export type ListFunctionalitiesOutput = zod.infer<typeof ListFunctionalitiesOutputSchema>;
|
|
14
|
+
export type GetFunctionalityDetailsInput = zod.infer<typeof GetFunctionalityDetailsInputSchema>;
|
|
15
|
+
export type GetFunctionalityDetailsOutput = zod.infer<typeof GetFunctionalityDetailsOutputSchema>;
|
|
16
|
+
export type ExecuteFunctionalityInput = zod.infer<typeof ExecuteFunctionalityInputSchema>;
|
|
17
|
+
export type ExecuteFunctionalityOutput = zod.infer<typeof ExecuteFunctionalityOutputSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Interface for functionality handlers
|
|
20
|
+
*/
|
|
21
|
+
export interface FunctionalityHandlers {
|
|
22
|
+
/** Handler for getting functionality details */
|
|
23
|
+
getFunctionalityDetails: (params: GetFunctionalityDetailsInput) => Promise<GetFunctionalityDetailsOutput>;
|
|
24
|
+
/** Handler for executing functionality */
|
|
25
|
+
executeFunctionality: (params: ExecuteFunctionalityInput) => Promise<ExecuteFunctionalityOutput>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Interface representing application details
|
|
29
|
+
*/
|
|
30
|
+
export interface Appdetails {
|
|
31
|
+
/** Root path of the application */
|
|
32
|
+
root: string;
|
|
33
|
+
/** ID of the application */
|
|
34
|
+
appId: string;
|
|
35
|
+
/** Access details for the application */
|
|
36
|
+
applicationAccess?: ApplicationAccess;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as zod from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Input interface for the 'list-fiori-apps' functionality
|
|
4
|
+
*/
|
|
5
|
+
export declare const ListFioriAppsInputSchema: zod.ZodObject<{
|
|
6
|
+
searchPath: zod.ZodArray<zod.ZodString>;
|
|
7
|
+
}, zod.z.core.$strip>;
|
|
8
|
+
/**
|
|
9
|
+
* Input interface for the 'list-functionality' functionality
|
|
10
|
+
*/
|
|
11
|
+
export declare const ListFunctionalitiesInputSchema: zod.ZodObject<{
|
|
12
|
+
appPath: zod.ZodString;
|
|
13
|
+
}, zod.z.core.$strip>;
|
|
14
|
+
/**
|
|
15
|
+
* Input interface for the 'get-functionality-details' functionality
|
|
16
|
+
*/
|
|
17
|
+
export declare const GetFunctionalityDetailsInputSchema: zod.ZodObject<{
|
|
18
|
+
appPath: zod.ZodString;
|
|
19
|
+
functionalityId: zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>>]>;
|
|
20
|
+
}, zod.z.core.$strip>;
|
|
21
|
+
/**
|
|
22
|
+
* Input interface for the 'execute-functionality' functionality
|
|
23
|
+
*/
|
|
24
|
+
export declare const ExecuteFunctionalityInputSchema: zod.ZodObject<{
|
|
25
|
+
functionalityId: zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>>]>;
|
|
26
|
+
parameters: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
|
|
27
|
+
appPath: zod.ZodString;
|
|
28
|
+
}, zod.z.core.$strip>;
|
|
29
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
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.ExecuteFunctionalityInputSchema = exports.GetFunctionalityDetailsInputSchema = exports.ListFunctionalitiesInputSchema = exports.ListFioriAppsInputSchema = void 0;
|
|
37
|
+
const zod = __importStar(require("zod"));
|
|
38
|
+
const basic_1 = require("./basic");
|
|
39
|
+
/**
|
|
40
|
+
* Input interface for the 'list-fiori-apps' functionality
|
|
41
|
+
*/
|
|
42
|
+
exports.ListFioriAppsInputSchema = zod.object({
|
|
43
|
+
/** Array of paths to search for Fiori applications */
|
|
44
|
+
searchPath: zod
|
|
45
|
+
.array(zod.string())
|
|
46
|
+
.describe('Path to search for Fiori applications (defaults to current directory). If VSCode - list of VS Code workspace folder paths(`workspace.workspaceFolders`)')
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Input interface for the 'list-functionality' functionality
|
|
50
|
+
*/
|
|
51
|
+
exports.ListFunctionalitiesInputSchema = zod.object({
|
|
52
|
+
/** Path to the Fiori application */
|
|
53
|
+
appPath: zod
|
|
54
|
+
.string()
|
|
55
|
+
.describe('Path to the root folder of the Fiori application (where package.json and ui5.yaml reside). Path should be an absolute path.')
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Input interface for the 'get-functionality-details' functionality
|
|
59
|
+
*/
|
|
60
|
+
exports.GetFunctionalityDetailsInputSchema = zod.object({
|
|
61
|
+
/** Path to the Fiori application */
|
|
62
|
+
appPath: zod.string().describe('Path to the Fiori application. Path should be an absolute path.'),
|
|
63
|
+
/** ID or array of IDs of the functionality(ies) */
|
|
64
|
+
functionalityId: basic_1.FunctionalityIdSchema.describe('The ID of the functionality to get details for')
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Input interface for the 'execute-functionality' functionality
|
|
68
|
+
*/
|
|
69
|
+
exports.ExecuteFunctionalityInputSchema = zod.object({
|
|
70
|
+
/** ID or array of IDs of the functionality(ies) to execute */
|
|
71
|
+
functionalityId: basic_1.FunctionalityIdSchema.describe('The ID of the functionality to execute'),
|
|
72
|
+
/** Parameters for the functionality execution */
|
|
73
|
+
parameters: zod.record(zod.string(), zod.unknown()).describe('Parameters for the functionality execution'),
|
|
74
|
+
/** Path to the Fiori application */
|
|
75
|
+
appPath: zod.string().describe('Path to the Fiori application. Path should be an absolute path.')
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=input.js.map
|