@give-tech/lingxi-mcp-server 1.0.0
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 +193 -0
- package/dist/client.d.ts +11 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +46 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/lingxi-client.d.ts +59 -0
- package/dist/lingxi-client.d.ts.map +1 -0
- package/dist/lingxi-client.js +380 -0
- package/dist/lingxi-client.js.map +1 -0
- package/dist/tools/api.d.ts +176 -0
- package/dist/tools/api.d.ts.map +1 -0
- package/dist/tools/api.js +188 -0
- package/dist/tools/api.js.map +1 -0
- package/dist/tools/document.d.ts +103 -0
- package/dist/tools/document.d.ts.map +1 -0
- package/dist/tools/document.js +125 -0
- package/dist/tools/document.js.map +1 -0
- package/dist/tools/model.d.ts +176 -0
- package/dist/tools/model.d.ts.map +1 -0
- package/dist/tools/model.js +178 -0
- package/dist/tools/model.js.map +1 -0
- package/dist/tools/module.d.ts +111 -0
- package/dist/tools/module.d.ts.map +1 -0
- package/dist/tools/module.js +126 -0
- package/dist/tools/module.js.map +1 -0
- package/dist/tools/project.d.ts +17 -0
- package/dist/tools/project.d.ts.map +1 -0
- package/dist/tools/project.js +25 -0
- package/dist/tools/project.js.map +1 -0
- package/dist/tools/team.d.ts +92 -0
- package/dist/tools/team.d.ts.map +1 -0
- package/dist/tools/team.js +109 -0
- package/dist/tools/team.js.map +1 -0
- package/dist/types.d.ts +238 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
// Lingxi API 客户端
|
|
2
|
+
export class LingxiClient {
|
|
3
|
+
config;
|
|
4
|
+
constructor(config) {
|
|
5
|
+
this.config = config;
|
|
6
|
+
}
|
|
7
|
+
get log() {
|
|
8
|
+
return this.config.log || {
|
|
9
|
+
info: () => { },
|
|
10
|
+
error: () => { },
|
|
11
|
+
debug: () => { },
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
getHeaders() {
|
|
15
|
+
const headers = {
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
};
|
|
18
|
+
if (this.config.token) {
|
|
19
|
+
headers['Authorization'] = `Bearer ${this.config.token}`;
|
|
20
|
+
}
|
|
21
|
+
return headers;
|
|
22
|
+
}
|
|
23
|
+
async request(path, options = {}) {
|
|
24
|
+
const url = `${this.config.baseUrl}${path}`;
|
|
25
|
+
this.log.debug(`Request: ${options.method || 'GET'} ${url}`);
|
|
26
|
+
const response = await fetch(url, {
|
|
27
|
+
...options,
|
|
28
|
+
headers: {
|
|
29
|
+
...this.getHeaders(),
|
|
30
|
+
...options.headers,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
if (!response.ok) {
|
|
34
|
+
const errorText = await response.text();
|
|
35
|
+
this.log.error(`API Error: ${response.status} ${response.statusText}`, errorText);
|
|
36
|
+
throw new Error(`Lingxi API error: ${response.status} ${response.statusText}\n${errorText}`);
|
|
37
|
+
}
|
|
38
|
+
const data = await response.json();
|
|
39
|
+
return data.data || data;
|
|
40
|
+
}
|
|
41
|
+
// ==================== 基础 API ====================
|
|
42
|
+
// 获取团队列表
|
|
43
|
+
async getTeams() {
|
|
44
|
+
return this.request('/api/v1/teams');
|
|
45
|
+
}
|
|
46
|
+
// 获取项目列表
|
|
47
|
+
async getProjects(teamId) {
|
|
48
|
+
let path = '/api/v1/projects';
|
|
49
|
+
if (teamId) {
|
|
50
|
+
path += `?team_id=${teamId}`;
|
|
51
|
+
}
|
|
52
|
+
return this.request(path);
|
|
53
|
+
}
|
|
54
|
+
// 获取项目详情
|
|
55
|
+
async getProject(projectId) {
|
|
56
|
+
return this.request(`/api/v1/projects/${projectId}`);
|
|
57
|
+
}
|
|
58
|
+
// 获取项目模块列表
|
|
59
|
+
async getModules(projectId) {
|
|
60
|
+
return this.request(`/api/v1/projects/${projectId}/modules`);
|
|
61
|
+
}
|
|
62
|
+
// 获取模块 API 列表
|
|
63
|
+
async getAPIs(moduleId) {
|
|
64
|
+
return this.request(`/api/v1/modules/${moduleId}/apis`);
|
|
65
|
+
}
|
|
66
|
+
// 获取 API 详情
|
|
67
|
+
async getAPI(apiId) {
|
|
68
|
+
return this.request(`/api/v1/apis/${apiId}`);
|
|
69
|
+
}
|
|
70
|
+
// ==================== 扩展 API ====================
|
|
71
|
+
// 获取 API 的 JSON Schema
|
|
72
|
+
async getAPISchema(apiId) {
|
|
73
|
+
const api = await this.getAPI(apiId);
|
|
74
|
+
const schema = {
|
|
75
|
+
request: {},
|
|
76
|
+
response: {},
|
|
77
|
+
};
|
|
78
|
+
// Path 参数 Schema
|
|
79
|
+
if (api.path_params && api.path_params.length > 0) {
|
|
80
|
+
schema.request.pathParams = this.buildParamSchema(api.path_params);
|
|
81
|
+
}
|
|
82
|
+
// Query 参数 Schema
|
|
83
|
+
if (api.query_params && api.query_params.length > 0) {
|
|
84
|
+
schema.request.queryParams = this.buildParamSchema(api.query_params);
|
|
85
|
+
}
|
|
86
|
+
// Header 参数 Schema
|
|
87
|
+
if (api.header_params && api.header_params.length > 0) {
|
|
88
|
+
schema.request.headers = this.buildParamSchema(api.header_params);
|
|
89
|
+
}
|
|
90
|
+
// Request Body Schema
|
|
91
|
+
if (api.request_body) {
|
|
92
|
+
schema.request.body = this.buildBodySchema(api.request_body);
|
|
93
|
+
}
|
|
94
|
+
// Response Body Schema
|
|
95
|
+
if (api.response_body) {
|
|
96
|
+
schema.response.body = this.buildBodySchema(api.response_body);
|
|
97
|
+
}
|
|
98
|
+
return schema;
|
|
99
|
+
}
|
|
100
|
+
// 调用 API(通过 Lingxi 后端代理)
|
|
101
|
+
async callAPI(apiId, params) {
|
|
102
|
+
const startTime = performance.now();
|
|
103
|
+
try {
|
|
104
|
+
// 首先获取 API 信息
|
|
105
|
+
const api = await this.getAPI(apiId);
|
|
106
|
+
// 构建 URL
|
|
107
|
+
let url = api.path;
|
|
108
|
+
if (params?.pathParams) {
|
|
109
|
+
Object.entries(params.pathParams).forEach(([key, value]) => {
|
|
110
|
+
url = url.replace(`{${key}}`, encodeURIComponent(value));
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// 添加查询参数
|
|
114
|
+
if (params?.queryParams && Object.keys(params.queryParams).length > 0) {
|
|
115
|
+
const searchParams = new URLSearchParams();
|
|
116
|
+
Object.entries(params.queryParams).forEach(([key, value]) => {
|
|
117
|
+
searchParams.append(key, value);
|
|
118
|
+
});
|
|
119
|
+
url += `?${searchParams.toString()}`;
|
|
120
|
+
}
|
|
121
|
+
// 构建请求头
|
|
122
|
+
const headers = {
|
|
123
|
+
...this.getHeaders(),
|
|
124
|
+
...params?.headers,
|
|
125
|
+
};
|
|
126
|
+
// 构建请求体
|
|
127
|
+
let body = undefined;
|
|
128
|
+
if (params?.body && ['POST', 'PUT', 'PATCH'].includes(api.method)) {
|
|
129
|
+
body = JSON.stringify(params.body);
|
|
130
|
+
}
|
|
131
|
+
// 发送请求(直接调用目标 API,不经过代理)
|
|
132
|
+
// 注意:这需要目标 API 支持 CORS
|
|
133
|
+
const targetUrl = `${this.config.baseUrl.replace(/:\d+$/, '')}:${api.path.startsWith('/') ? '' : '/'}${api.path}`;
|
|
134
|
+
const fullUrl = this.buildFullUrl(url, params?.queryParams);
|
|
135
|
+
this.log.debug(`Calling API: ${api.method} ${fullUrl}`);
|
|
136
|
+
const response = await fetch(fullUrl, {
|
|
137
|
+
method: api.method,
|
|
138
|
+
headers,
|
|
139
|
+
body: ['GET', 'HEAD'].includes(api.method) ? undefined : body,
|
|
140
|
+
});
|
|
141
|
+
const endTime = performance.now();
|
|
142
|
+
// 获取响应头
|
|
143
|
+
const responseHeaders = {};
|
|
144
|
+
response.headers.forEach((value, key) => {
|
|
145
|
+
responseHeaders[key] = value;
|
|
146
|
+
});
|
|
147
|
+
// 获取响应体
|
|
148
|
+
const responseBody = await response.text();
|
|
149
|
+
const responseSize = new Blob([responseBody]).size;
|
|
150
|
+
return {
|
|
151
|
+
status: response.status,
|
|
152
|
+
statusText: response.statusText,
|
|
153
|
+
headers: responseHeaders,
|
|
154
|
+
body: responseBody,
|
|
155
|
+
size: this.formatSize(responseSize),
|
|
156
|
+
time: Math.round(endTime - startTime),
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
const endTime = performance.now();
|
|
161
|
+
this.log.error('Call API error:', error);
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// 导出 OpenAPI 文档
|
|
166
|
+
async exportOpenAPI(projectId, moduleId) {
|
|
167
|
+
// 获取项目信息
|
|
168
|
+
const project = await this.getProject(projectId);
|
|
169
|
+
// 获取模块和 API
|
|
170
|
+
let modules;
|
|
171
|
+
if (moduleId) {
|
|
172
|
+
const module = await this.request(`/api/v1/modules/${moduleId}`);
|
|
173
|
+
modules = [module];
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
modules = await this.getModules(projectId);
|
|
177
|
+
}
|
|
178
|
+
// 构建 OpenAPI 文档
|
|
179
|
+
const openapi = {
|
|
180
|
+
openapi: '3.0.0',
|
|
181
|
+
info: {
|
|
182
|
+
title: `${project.name} API`,
|
|
183
|
+
description: project.description || '',
|
|
184
|
+
version: '1.0.0',
|
|
185
|
+
},
|
|
186
|
+
servers: [
|
|
187
|
+
{
|
|
188
|
+
url: this.config.baseUrl,
|
|
189
|
+
description: 'Lingxi API Server',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
paths: {},
|
|
193
|
+
};
|
|
194
|
+
// 收集所有 API
|
|
195
|
+
for (const module of modules) {
|
|
196
|
+
const apis = await this.getAPIs(module.id);
|
|
197
|
+
for (const api of apis) {
|
|
198
|
+
const path = api.path;
|
|
199
|
+
if (!openapi.paths[path]) {
|
|
200
|
+
openapi.paths[path] = {};
|
|
201
|
+
}
|
|
202
|
+
const method = api.method.toLowerCase();
|
|
203
|
+
openapi.paths[path][method] = {
|
|
204
|
+
summary: api.name,
|
|
205
|
+
description: api.description,
|
|
206
|
+
parameters: this.buildOpenAPIParameters(api),
|
|
207
|
+
requestBody: this.buildOpenAPIRequestBody(api),
|
|
208
|
+
responses: {
|
|
209
|
+
'200': {
|
|
210
|
+
description: '成功',
|
|
211
|
+
content: this.buildOpenAPIResponseContent(api.response_body),
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return openapi;
|
|
218
|
+
}
|
|
219
|
+
// ==================== 辅助方法 ====================
|
|
220
|
+
buildParamSchema(params) {
|
|
221
|
+
const properties = {};
|
|
222
|
+
const required = [];
|
|
223
|
+
for (const param of params) {
|
|
224
|
+
properties[param.name] = {
|
|
225
|
+
type: this.mapTypeToJSONSchemaType(param.type),
|
|
226
|
+
description: param.description,
|
|
227
|
+
};
|
|
228
|
+
if (param.required) {
|
|
229
|
+
required.push(param.name);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties,
|
|
235
|
+
required,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
buildBodySchema(body) {
|
|
239
|
+
if (body.type === 'primitive' && body.primitive_type) {
|
|
240
|
+
return {
|
|
241
|
+
type: this.mapTypeToJSONSchemaType(body.primitive_type),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
if (body.type === 'array' && body.items) {
|
|
245
|
+
return {
|
|
246
|
+
type: 'array',
|
|
247
|
+
items: this.buildItemsSchema(body.items),
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
if (body.type === 'anonymous' && body.fields) {
|
|
251
|
+
return {
|
|
252
|
+
type: 'object',
|
|
253
|
+
properties: this.buildFieldsSchema(body.fields),
|
|
254
|
+
required: body.fields.filter(f => f.required).map(f => f.name),
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
if ((body.type === 'model' || body.type === 'generic_model') && body.model_id) {
|
|
258
|
+
return {
|
|
259
|
+
type: 'object',
|
|
260
|
+
description: `Model reference: ${body.model_id}`,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
return { type: 'object' };
|
|
264
|
+
}
|
|
265
|
+
buildItemsSchema(items) {
|
|
266
|
+
if (items.primitive_type) {
|
|
267
|
+
return { type: this.mapTypeToJSONSchemaType(items.primitive_type) };
|
|
268
|
+
}
|
|
269
|
+
if (items.fields && items.fields.length > 0) {
|
|
270
|
+
return {
|
|
271
|
+
type: 'object',
|
|
272
|
+
properties: this.buildFieldsSchema(items.fields),
|
|
273
|
+
required: items.fields.filter(f => f.required).map(f => f.name),
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
return { type: 'object' };
|
|
277
|
+
}
|
|
278
|
+
buildFieldsSchema(fields) {
|
|
279
|
+
const properties = {};
|
|
280
|
+
for (const field of fields) {
|
|
281
|
+
properties[field.name] = {
|
|
282
|
+
type: this.mapTypeToJSONSchemaType(field.type),
|
|
283
|
+
description: field.description,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
return properties;
|
|
287
|
+
}
|
|
288
|
+
mapTypeToJSONSchemaType(type) {
|
|
289
|
+
const typeMap = {
|
|
290
|
+
string: 'string',
|
|
291
|
+
integer: 'integer',
|
|
292
|
+
decimal: 'number',
|
|
293
|
+
boolean: 'boolean',
|
|
294
|
+
time: 'string',
|
|
295
|
+
array: 'array',
|
|
296
|
+
};
|
|
297
|
+
return typeMap[type] || 'string';
|
|
298
|
+
}
|
|
299
|
+
buildFullUrl(path, queryParams) {
|
|
300
|
+
let url = this.config.baseUrl + path;
|
|
301
|
+
if (queryParams && Object.keys(queryParams).length > 0) {
|
|
302
|
+
const searchParams = new URLSearchParams();
|
|
303
|
+
Object.entries(queryParams).forEach(([key, value]) => {
|
|
304
|
+
searchParams.append(key, value);
|
|
305
|
+
});
|
|
306
|
+
url += `?${searchParams.toString()}`;
|
|
307
|
+
}
|
|
308
|
+
return url;
|
|
309
|
+
}
|
|
310
|
+
formatSize(bytes) {
|
|
311
|
+
if (bytes === 0)
|
|
312
|
+
return '0 B';
|
|
313
|
+
const k = 1024;
|
|
314
|
+
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
315
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
316
|
+
return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + ' ' + sizes[i];
|
|
317
|
+
}
|
|
318
|
+
buildOpenAPIParameters(api) {
|
|
319
|
+
const parameters = [];
|
|
320
|
+
// Path 参数
|
|
321
|
+
if (api.path_params) {
|
|
322
|
+
for (const param of api.path_params) {
|
|
323
|
+
parameters.push({
|
|
324
|
+
name: param.name,
|
|
325
|
+
in: 'path',
|
|
326
|
+
required: true,
|
|
327
|
+
schema: { type: this.mapTypeToJSONSchemaType(param.type) },
|
|
328
|
+
description: param.description,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
// Query 参数
|
|
333
|
+
if (api.query_params) {
|
|
334
|
+
for (const param of api.query_params) {
|
|
335
|
+
parameters.push({
|
|
336
|
+
name: param.name,
|
|
337
|
+
in: 'query',
|
|
338
|
+
required: param.required,
|
|
339
|
+
schema: { type: this.mapTypeToJSONSchemaType(param.type) },
|
|
340
|
+
description: param.description,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
// Header 参数
|
|
345
|
+
if (api.header_params) {
|
|
346
|
+
for (const param of api.header_params) {
|
|
347
|
+
parameters.push({
|
|
348
|
+
name: param.name,
|
|
349
|
+
in: 'header',
|
|
350
|
+
required: param.required,
|
|
351
|
+
schema: { type: 'string' },
|
|
352
|
+
description: param.description,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return parameters;
|
|
357
|
+
}
|
|
358
|
+
buildOpenAPIRequestBody(api) {
|
|
359
|
+
if (!api.request_body)
|
|
360
|
+
return undefined;
|
|
361
|
+
return {
|
|
362
|
+
required: true,
|
|
363
|
+
content: {
|
|
364
|
+
'application/json': {
|
|
365
|
+
schema: this.buildBodySchema(api.request_body),
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
buildOpenAPIResponseContent(responseBody) {
|
|
371
|
+
if (!responseBody)
|
|
372
|
+
return undefined;
|
|
373
|
+
return {
|
|
374
|
+
'application/json': {
|
|
375
|
+
schema: this.buildBodySchema(responseBody),
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
//# sourceMappingURL=lingxi-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lingxi-client.js","sourceRoot":"","sources":["../src/lingxi-client.ts"],"names":[],"mappings":"AAAA,iBAAiB;AAyBjB,MAAM,OAAO,YAAY;IACf,MAAM,CAAqB;IAEnC,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,IAAY,GAAG;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI;YACxB,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;YACd,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;YACf,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;SAChB,CAAC;IACJ,CAAC;IAEO,UAAU;QAChB,MAAM,OAAO,GAA2B;YACtC,cAAc,EAAE,kBAAkB;SACnC,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACtB,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC3D,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,KAAK,CAAC,OAAO,CACnB,IAAY,EACZ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ient } from '../client.js';
|
|
2
|
+
import type { Api } from '../types.js';
|
|
3
|
+
export declare function registerApiTools(client: ApiClient): ({
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
moduleId: {
|
|
10
|
+
type: "string";
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
id?: undefined;
|
|
14
|
+
name?: undefined;
|
|
15
|
+
method?: undefined;
|
|
16
|
+
path?: undefined;
|
|
17
|
+
description?: undefined;
|
|
18
|
+
tags?: undefined;
|
|
19
|
+
status?: undefined;
|
|
20
|
+
};
|
|
21
|
+
required: string[];
|
|
22
|
+
};
|
|
23
|
+
handler: (input: unknown) => Promise<Api[]>;
|
|
24
|
+
} | {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object";
|
|
29
|
+
properties: {
|
|
30
|
+
id: {
|
|
31
|
+
type: "string";
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
moduleId?: undefined;
|
|
35
|
+
name?: undefined;
|
|
36
|
+
method?: undefined;
|
|
37
|
+
path?: undefined;
|
|
38
|
+
description?: undefined;
|
|
39
|
+
tags?: undefined;
|
|
40
|
+
status?: undefined;
|
|
41
|
+
};
|
|
42
|
+
required: string[];
|
|
43
|
+
};
|
|
44
|
+
handler: (input: unknown) => Promise<Api>;
|
|
45
|
+
} | {
|
|
46
|
+
name: string;
|
|
47
|
+
description: string;
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: "object";
|
|
50
|
+
properties: {
|
|
51
|
+
moduleId: {
|
|
52
|
+
type: "string";
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
name: {
|
|
56
|
+
type: "string";
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
method: {
|
|
60
|
+
type: "string";
|
|
61
|
+
description: string;
|
|
62
|
+
enum: string[];
|
|
63
|
+
};
|
|
64
|
+
path: {
|
|
65
|
+
type: "string";
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
description: {
|
|
69
|
+
type: "string";
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
tags: {
|
|
73
|
+
type: "array";
|
|
74
|
+
items: {
|
|
75
|
+
type: "string";
|
|
76
|
+
};
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
id?: undefined;
|
|
80
|
+
status?: undefined;
|
|
81
|
+
};
|
|
82
|
+
required: string[];
|
|
83
|
+
};
|
|
84
|
+
handler: (input: unknown) => Promise<Api>;
|
|
85
|
+
} | {
|
|
86
|
+
name: string;
|
|
87
|
+
description: string;
|
|
88
|
+
inputSchema: {
|
|
89
|
+
type: "object";
|
|
90
|
+
properties: {
|
|
91
|
+
id: {
|
|
92
|
+
type: "string";
|
|
93
|
+
description: string;
|
|
94
|
+
};
|
|
95
|
+
name: {
|
|
96
|
+
type: "string";
|
|
97
|
+
description: string;
|
|
98
|
+
};
|
|
99
|
+
method: {
|
|
100
|
+
type: "string";
|
|
101
|
+
description: string;
|
|
102
|
+
enum: string[];
|
|
103
|
+
};
|
|
104
|
+
path: {
|
|
105
|
+
type: "string";
|
|
106
|
+
description: string;
|
|
107
|
+
};
|
|
108
|
+
description: {
|
|
109
|
+
type: "string";
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
112
|
+
tags: {
|
|
113
|
+
type: "array";
|
|
114
|
+
items: {
|
|
115
|
+
type: "string";
|
|
116
|
+
};
|
|
117
|
+
description: string;
|
|
118
|
+
};
|
|
119
|
+
moduleId?: undefined;
|
|
120
|
+
status?: undefined;
|
|
121
|
+
};
|
|
122
|
+
required: string[];
|
|
123
|
+
};
|
|
124
|
+
handler: (input: unknown) => Promise<Api>;
|
|
125
|
+
} | {
|
|
126
|
+
name: string;
|
|
127
|
+
description: string;
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: "object";
|
|
130
|
+
properties: {
|
|
131
|
+
id: {
|
|
132
|
+
type: "string";
|
|
133
|
+
description: string;
|
|
134
|
+
};
|
|
135
|
+
moduleId?: undefined;
|
|
136
|
+
name?: undefined;
|
|
137
|
+
method?: undefined;
|
|
138
|
+
path?: undefined;
|
|
139
|
+
description?: undefined;
|
|
140
|
+
tags?: undefined;
|
|
141
|
+
status?: undefined;
|
|
142
|
+
};
|
|
143
|
+
required: string[];
|
|
144
|
+
};
|
|
145
|
+
handler: (input: unknown) => Promise<{
|
|
146
|
+
message: string;
|
|
147
|
+
}>;
|
|
148
|
+
} | {
|
|
149
|
+
name: string;
|
|
150
|
+
description: string;
|
|
151
|
+
inputSchema: {
|
|
152
|
+
type: "object";
|
|
153
|
+
properties: {
|
|
154
|
+
id: {
|
|
155
|
+
type: "string";
|
|
156
|
+
description: string;
|
|
157
|
+
};
|
|
158
|
+
status: {
|
|
159
|
+
type: "number";
|
|
160
|
+
description: string;
|
|
161
|
+
enum: number[];
|
|
162
|
+
};
|
|
163
|
+
moduleId?: undefined;
|
|
164
|
+
name?: undefined;
|
|
165
|
+
method?: undefined;
|
|
166
|
+
path?: undefined;
|
|
167
|
+
description?: undefined;
|
|
168
|
+
tags?: undefined;
|
|
169
|
+
};
|
|
170
|
+
required: string[];
|
|
171
|
+
};
|
|
172
|
+
handler: (input: unknown) => Promise<{
|
|
173
|
+
message: string;
|
|
174
|
+
}>;
|
|
175
|
+
})[];
|
|
176
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/tools/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,GAAG,EAAsC,MAAM,aAAa,CAAC;AAE3E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;qBAerB,OAAO;;;;;;;;;;;;;;;;;;;;;qBAkBP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAwCP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsDP,OAAO;;;;;;;;;;;;;;;;;;;;;qBAyBP,OAAO;iBAEU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqBvB,OAAO;iBAKO,MAAM;;KAOhD"}
|