mcp-server-esa 1.0.3 → 1.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/index.js +183 -19
- package/dist/index.mjs +183 -19
- package/dist/tools/record.d.ts +6 -6
- package/dist/tools/site.d.ts +24 -0
- package/dist/utils/service.d.ts +3 -1
- package/package.json +1 -1
- package/readme.md +190 -145
- package/readme_zh.md +302 -0
- package/src/tools/list-esa-function.ts +27 -15
- package/src/tools/record.ts +9 -9
- package/src/tools/site.ts +152 -2
- package/src/utils/service.ts +26 -0
package/dist/index.js
CHANGED
|
@@ -242,6 +242,14 @@ class Client {
|
|
|
242
242
|
};
|
|
243
243
|
return this.client.callApi(params, request, runtime);
|
|
244
244
|
}
|
|
245
|
+
createRecord(params) {
|
|
246
|
+
const request = new esa20240910_namespaceObject.CreateRecordRequest(params);
|
|
247
|
+
return this.callApi(this.client.createRecord.bind(this.client), request);
|
|
248
|
+
}
|
|
249
|
+
listRecords(params) {
|
|
250
|
+
const request = new esa20240910_namespaceObject.ListRecordsRequest(params);
|
|
251
|
+
return this.callApi(this.client.listRecords.bind(this.client), request);
|
|
252
|
+
}
|
|
245
253
|
constructor(){
|
|
246
254
|
_define_property(this, "client", void 0);
|
|
247
255
|
_define_property(this, "callApi", async (action, request)=>{
|
|
@@ -454,8 +462,8 @@ const deployment_delete = async (request)=>{
|
|
|
454
462
|
success: true
|
|
455
463
|
};
|
|
456
464
|
};
|
|
457
|
-
const
|
|
458
|
-
name: '
|
|
465
|
+
const ER_RECORD_CREATE_TOOL = {
|
|
466
|
+
name: 'er_record_create',
|
|
459
467
|
description: 'Create a record',
|
|
460
468
|
inputSchema: {
|
|
461
469
|
type: 'object',
|
|
@@ -480,8 +488,8 @@ const RECORD_CREATE_TOOL = {
|
|
|
480
488
|
]
|
|
481
489
|
}
|
|
482
490
|
};
|
|
483
|
-
const
|
|
484
|
-
name: '
|
|
491
|
+
const ER_RECORD_DELETE_TOOL = {
|
|
492
|
+
name: 'er_record_delete',
|
|
485
493
|
description: 'Delete a record',
|
|
486
494
|
inputSchema: {
|
|
487
495
|
type: 'object',
|
|
@@ -510,8 +518,8 @@ const RECORD_DELETE_TOOL = {
|
|
|
510
518
|
]
|
|
511
519
|
}
|
|
512
520
|
};
|
|
513
|
-
const
|
|
514
|
-
name: '
|
|
521
|
+
const ER_RECORD_LIST_TOOL = {
|
|
522
|
+
name: 'er_record_list',
|
|
515
523
|
description: 'List all records',
|
|
516
524
|
inputSchema: {
|
|
517
525
|
type: 'object',
|
|
@@ -538,7 +546,7 @@ const RECORD_LIST_TOOL = {
|
|
|
538
546
|
]
|
|
539
547
|
}
|
|
540
548
|
};
|
|
541
|
-
const
|
|
549
|
+
const er_record_create = async (request)=>{
|
|
542
550
|
const res = await service.createRoutineRelatedRecord(request.params.arguments);
|
|
543
551
|
return {
|
|
544
552
|
content: [
|
|
@@ -550,7 +558,7 @@ const record_create = async (request)=>{
|
|
|
550
558
|
success: true
|
|
551
559
|
};
|
|
552
560
|
};
|
|
553
|
-
const
|
|
561
|
+
const er_record_delete = async (request)=>{
|
|
554
562
|
const res = await service.deleteRoutineRelatedRecord(request.params.arguments);
|
|
555
563
|
return {
|
|
556
564
|
content: [
|
|
@@ -562,7 +570,7 @@ const record_delete = async (request)=>{
|
|
|
562
570
|
success: true
|
|
563
571
|
};
|
|
564
572
|
};
|
|
565
|
-
const
|
|
573
|
+
const er_record_list = async (request)=>{
|
|
566
574
|
const res = await service.listRoutineRelatedRecords(request.params.arguments);
|
|
567
575
|
return {
|
|
568
576
|
content: [
|
|
@@ -1027,7 +1035,7 @@ const SITE_ACTIVE_LIST_TOOL = {
|
|
|
1027
1035
|
};
|
|
1028
1036
|
const SITE_MATCH_TOOL = {
|
|
1029
1037
|
name: 'site_match',
|
|
1030
|
-
description: 'Check which site under the account matches the user input',
|
|
1038
|
+
description: 'Check which site under the account matches the user input, user must input recordName',
|
|
1031
1039
|
inputSchema: {
|
|
1032
1040
|
type: 'object',
|
|
1033
1041
|
properties: {
|
|
@@ -1041,6 +1049,156 @@ const SITE_MATCH_TOOL = {
|
|
|
1041
1049
|
]
|
|
1042
1050
|
}
|
|
1043
1051
|
};
|
|
1052
|
+
const SITE_DNS_TYPE_A_RECORD_CREATE_TOOL = {
|
|
1053
|
+
name: 'site_dns_type_a_record_create',
|
|
1054
|
+
description: 'Create a A record for a site.',
|
|
1055
|
+
inputSchema: {
|
|
1056
|
+
type: 'object',
|
|
1057
|
+
properties: {
|
|
1058
|
+
recordName: {
|
|
1059
|
+
type: 'string',
|
|
1060
|
+
description: 'The name of the DNS record (e.g., subdomain or full domain). Required.',
|
|
1061
|
+
examples: [
|
|
1062
|
+
'www.example.com',
|
|
1063
|
+
'sub.example.com'
|
|
1064
|
+
]
|
|
1065
|
+
},
|
|
1066
|
+
siteId: {
|
|
1067
|
+
type: 'number',
|
|
1068
|
+
description: 'The ID of the site, obtained from the ListSites operation. Required.',
|
|
1069
|
+
examples: [
|
|
1070
|
+
1234567890123
|
|
1071
|
+
]
|
|
1072
|
+
},
|
|
1073
|
+
data: {
|
|
1074
|
+
type: 'object',
|
|
1075
|
+
description: 'The data for the DNS record, varying by record type. Required.',
|
|
1076
|
+
properties: {
|
|
1077
|
+
value: {
|
|
1078
|
+
type: 'string',
|
|
1079
|
+
description: 'The IP address of the A record. Required.',
|
|
1080
|
+
examples: [
|
|
1081
|
+
'2.2.2.2'
|
|
1082
|
+
]
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
},
|
|
1087
|
+
required: [
|
|
1088
|
+
'recordName',
|
|
1089
|
+
'siteId',
|
|
1090
|
+
'data'
|
|
1091
|
+
]
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
const SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL = {
|
|
1095
|
+
name: 'site_dns_cname_domain_record_create',
|
|
1096
|
+
description: 'Create a CNAME domain record for a site.',
|
|
1097
|
+
inputSchema: {
|
|
1098
|
+
type: 'object',
|
|
1099
|
+
properties: {
|
|
1100
|
+
recordName: {
|
|
1101
|
+
type: 'string',
|
|
1102
|
+
description: 'The name of the DNS record (e.g., subdomain or full domain). Required.',
|
|
1103
|
+
examples: [
|
|
1104
|
+
'www.example.com',
|
|
1105
|
+
'sub.example.com'
|
|
1106
|
+
]
|
|
1107
|
+
},
|
|
1108
|
+
siteId: {
|
|
1109
|
+
type: 'number',
|
|
1110
|
+
description: 'The ID of the site, obtained from the ListSites operation. Required.',
|
|
1111
|
+
examples: [
|
|
1112
|
+
1234567890123
|
|
1113
|
+
]
|
|
1114
|
+
},
|
|
1115
|
+
data: {
|
|
1116
|
+
type: 'object',
|
|
1117
|
+
description: 'The data for the DNS record, varying by record type. Required.',
|
|
1118
|
+
properties: {
|
|
1119
|
+
value: {
|
|
1120
|
+
type: 'string',
|
|
1121
|
+
description: 'The IP address of the A record. Required.',
|
|
1122
|
+
examples: [
|
|
1123
|
+
'2.2.2.2'
|
|
1124
|
+
]
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
},
|
|
1129
|
+
required: [
|
|
1130
|
+
'recordName',
|
|
1131
|
+
'siteId',
|
|
1132
|
+
'data'
|
|
1133
|
+
]
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
const SITE_RECORD_LIST_TOOL = {
|
|
1137
|
+
name: 'site_record_list',
|
|
1138
|
+
description: 'List all records in a site',
|
|
1139
|
+
inputSchema: {
|
|
1140
|
+
type: 'object',
|
|
1141
|
+
properties: {
|
|
1142
|
+
SiteId: {
|
|
1143
|
+
type: 'number',
|
|
1144
|
+
description: 'The ID of the site, obtained from the ListSites operation. Required.'
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
};
|
|
1149
|
+
const site_dns_type_a_record_create = async (request)=>{
|
|
1150
|
+
const res = await service.createRecord({
|
|
1151
|
+
ttl: 1,
|
|
1152
|
+
proxied: true,
|
|
1153
|
+
bizName: 'web',
|
|
1154
|
+
type: 'A/AAAA',
|
|
1155
|
+
...request.params.arguments
|
|
1156
|
+
});
|
|
1157
|
+
return {
|
|
1158
|
+
content: [
|
|
1159
|
+
{
|
|
1160
|
+
type: 'text',
|
|
1161
|
+
text: JSON.stringify(res)
|
|
1162
|
+
}
|
|
1163
|
+
],
|
|
1164
|
+
success: true
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
1167
|
+
const site_dns_cname_domain_record_create = async (request)=>{
|
|
1168
|
+
const res = await service.createRecord({
|
|
1169
|
+
ttl: 1,
|
|
1170
|
+
proxied: true,
|
|
1171
|
+
bizName: 'web',
|
|
1172
|
+
type: 'CNAME',
|
|
1173
|
+
sourceType: 'Domain',
|
|
1174
|
+
hostPolicy: 'follow_hostname',
|
|
1175
|
+
...request.params.arguments
|
|
1176
|
+
});
|
|
1177
|
+
return {
|
|
1178
|
+
content: [
|
|
1179
|
+
{
|
|
1180
|
+
type: 'text',
|
|
1181
|
+
text: JSON.stringify(res)
|
|
1182
|
+
}
|
|
1183
|
+
],
|
|
1184
|
+
success: true
|
|
1185
|
+
};
|
|
1186
|
+
};
|
|
1187
|
+
const site_record_list = async (request)=>{
|
|
1188
|
+
var _request_params_arguments;
|
|
1189
|
+
const res = await service.listRecords({
|
|
1190
|
+
siteId: (null === (_request_params_arguments = request.params.arguments) || void 0 === _request_params_arguments ? void 0 : _request_params_arguments.SiteId) ?? 0
|
|
1191
|
+
});
|
|
1192
|
+
return {
|
|
1193
|
+
content: [
|
|
1194
|
+
{
|
|
1195
|
+
type: 'text',
|
|
1196
|
+
text: JSON.stringify(res)
|
|
1197
|
+
}
|
|
1198
|
+
],
|
|
1199
|
+
success: true
|
|
1200
|
+
};
|
|
1201
|
+
};
|
|
1044
1202
|
const site_active_list = async ()=>{
|
|
1045
1203
|
const res = await service.listSites({
|
|
1046
1204
|
siteSearchType: 'fuzzy',
|
|
@@ -1090,14 +1248,23 @@ const ESA_OPENAPI_ER_LIST = [
|
|
|
1090
1248
|
ROUTE_UPDATE_TOOL,
|
|
1091
1249
|
ROUTE_GET_TOOL,
|
|
1092
1250
|
SITE_MATCH_TOOL,
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1251
|
+
ER_RECORD_CREATE_TOOL,
|
|
1252
|
+
ER_RECORD_DELETE_TOOL,
|
|
1253
|
+
ER_RECORD_LIST_TOOL,
|
|
1254
|
+
SITE_DNS_TYPE_A_RECORD_CREATE_TOOL,
|
|
1255
|
+
SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL,
|
|
1256
|
+
SITE_RECORD_LIST_TOOL
|
|
1096
1257
|
];
|
|
1097
1258
|
const ESA_OPENAPI_LIST = [
|
|
1098
1259
|
...ESA_OPENAPI_ER_LIST
|
|
1099
1260
|
];
|
|
1100
1261
|
const routineHandlers = {
|
|
1262
|
+
site_dns_type_a_record_create: site_dns_type_a_record_create,
|
|
1263
|
+
site_dns_cname_domain_record_create: site_dns_cname_domain_record_create,
|
|
1264
|
+
site_active_list: site_active_list,
|
|
1265
|
+
site_match: site_match,
|
|
1266
|
+
site_route_list: site_route_list,
|
|
1267
|
+
site_record_list: site_record_list,
|
|
1101
1268
|
routine_create: routine_create,
|
|
1102
1269
|
routine_delete: routine_delete,
|
|
1103
1270
|
routine_list: routine_list,
|
|
@@ -1107,16 +1274,13 @@ const routineHandlers = {
|
|
|
1107
1274
|
routine_route_list: routine_route_list,
|
|
1108
1275
|
canary_area_list: canary_area_list,
|
|
1109
1276
|
deployment_delete: deployment_delete,
|
|
1110
|
-
site_active_list: site_active_list,
|
|
1111
|
-
site_match: site_match,
|
|
1112
|
-
site_route_list: site_route_list,
|
|
1113
1277
|
route_create: route_create,
|
|
1114
1278
|
route_delete: route_delete,
|
|
1115
1279
|
route_update: route_update,
|
|
1116
1280
|
route_get: route_get,
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1281
|
+
er_record_create: er_record_create,
|
|
1282
|
+
er_record_delete: er_record_delete,
|
|
1283
|
+
er_record_list: er_record_list
|
|
1120
1284
|
};
|
|
1121
1285
|
const server = new index_js_namespaceObject.Server({
|
|
1122
1286
|
name: 'esa-server',
|
package/dist/index.mjs
CHANGED
|
@@ -216,6 +216,14 @@ class Client {
|
|
|
216
216
|
};
|
|
217
217
|
return this.client.callApi(params, request, runtime);
|
|
218
218
|
}
|
|
219
|
+
createRecord(params) {
|
|
220
|
+
const request = new __WEBPACK_EXTERNAL_MODULE__alicloud_esa20240910_b5517a12__.CreateRecordRequest(params);
|
|
221
|
+
return this.callApi(this.client.createRecord.bind(this.client), request);
|
|
222
|
+
}
|
|
223
|
+
listRecords(params) {
|
|
224
|
+
const request = new __WEBPACK_EXTERNAL_MODULE__alicloud_esa20240910_b5517a12__.ListRecordsRequest(params);
|
|
225
|
+
return this.callApi(this.client.listRecords.bind(this.client), request);
|
|
226
|
+
}
|
|
219
227
|
constructor(){
|
|
220
228
|
_define_property(this, "client", void 0);
|
|
221
229
|
_define_property(this, "callApi", async (action, request)=>{
|
|
@@ -428,8 +436,8 @@ const deployment_delete = async (request)=>{
|
|
|
428
436
|
success: true
|
|
429
437
|
};
|
|
430
438
|
};
|
|
431
|
-
const
|
|
432
|
-
name: '
|
|
439
|
+
const ER_RECORD_CREATE_TOOL = {
|
|
440
|
+
name: 'er_record_create',
|
|
433
441
|
description: 'Create a record',
|
|
434
442
|
inputSchema: {
|
|
435
443
|
type: 'object',
|
|
@@ -454,8 +462,8 @@ const RECORD_CREATE_TOOL = {
|
|
|
454
462
|
]
|
|
455
463
|
}
|
|
456
464
|
};
|
|
457
|
-
const
|
|
458
|
-
name: '
|
|
465
|
+
const ER_RECORD_DELETE_TOOL = {
|
|
466
|
+
name: 'er_record_delete',
|
|
459
467
|
description: 'Delete a record',
|
|
460
468
|
inputSchema: {
|
|
461
469
|
type: 'object',
|
|
@@ -484,8 +492,8 @@ const RECORD_DELETE_TOOL = {
|
|
|
484
492
|
]
|
|
485
493
|
}
|
|
486
494
|
};
|
|
487
|
-
const
|
|
488
|
-
name: '
|
|
495
|
+
const ER_RECORD_LIST_TOOL = {
|
|
496
|
+
name: 'er_record_list',
|
|
489
497
|
description: 'List all records',
|
|
490
498
|
inputSchema: {
|
|
491
499
|
type: 'object',
|
|
@@ -512,7 +520,7 @@ const RECORD_LIST_TOOL = {
|
|
|
512
520
|
]
|
|
513
521
|
}
|
|
514
522
|
};
|
|
515
|
-
const
|
|
523
|
+
const er_record_create = async (request)=>{
|
|
516
524
|
const res = await service.createRoutineRelatedRecord(request.params.arguments);
|
|
517
525
|
return {
|
|
518
526
|
content: [
|
|
@@ -524,7 +532,7 @@ const record_create = async (request)=>{
|
|
|
524
532
|
success: true
|
|
525
533
|
};
|
|
526
534
|
};
|
|
527
|
-
const
|
|
535
|
+
const er_record_delete = async (request)=>{
|
|
528
536
|
const res = await service.deleteRoutineRelatedRecord(request.params.arguments);
|
|
529
537
|
return {
|
|
530
538
|
content: [
|
|
@@ -536,7 +544,7 @@ const record_delete = async (request)=>{
|
|
|
536
544
|
success: true
|
|
537
545
|
};
|
|
538
546
|
};
|
|
539
|
-
const
|
|
547
|
+
const er_record_list = async (request)=>{
|
|
540
548
|
const res = await service.listRoutineRelatedRecords(request.params.arguments);
|
|
541
549
|
return {
|
|
542
550
|
content: [
|
|
@@ -1001,7 +1009,7 @@ const SITE_ACTIVE_LIST_TOOL = {
|
|
|
1001
1009
|
};
|
|
1002
1010
|
const SITE_MATCH_TOOL = {
|
|
1003
1011
|
name: 'site_match',
|
|
1004
|
-
description: 'Check which site under the account matches the user input',
|
|
1012
|
+
description: 'Check which site under the account matches the user input, user must input recordName',
|
|
1005
1013
|
inputSchema: {
|
|
1006
1014
|
type: 'object',
|
|
1007
1015
|
properties: {
|
|
@@ -1015,6 +1023,156 @@ const SITE_MATCH_TOOL = {
|
|
|
1015
1023
|
]
|
|
1016
1024
|
}
|
|
1017
1025
|
};
|
|
1026
|
+
const SITE_DNS_TYPE_A_RECORD_CREATE_TOOL = {
|
|
1027
|
+
name: 'site_dns_type_a_record_create',
|
|
1028
|
+
description: 'Create a A record for a site.',
|
|
1029
|
+
inputSchema: {
|
|
1030
|
+
type: 'object',
|
|
1031
|
+
properties: {
|
|
1032
|
+
recordName: {
|
|
1033
|
+
type: 'string',
|
|
1034
|
+
description: 'The name of the DNS record (e.g., subdomain or full domain). Required.',
|
|
1035
|
+
examples: [
|
|
1036
|
+
'www.example.com',
|
|
1037
|
+
'sub.example.com'
|
|
1038
|
+
]
|
|
1039
|
+
},
|
|
1040
|
+
siteId: {
|
|
1041
|
+
type: 'number',
|
|
1042
|
+
description: 'The ID of the site, obtained from the ListSites operation. Required.',
|
|
1043
|
+
examples: [
|
|
1044
|
+
1234567890123
|
|
1045
|
+
]
|
|
1046
|
+
},
|
|
1047
|
+
data: {
|
|
1048
|
+
type: 'object',
|
|
1049
|
+
description: 'The data for the DNS record, varying by record type. Required.',
|
|
1050
|
+
properties: {
|
|
1051
|
+
value: {
|
|
1052
|
+
type: 'string',
|
|
1053
|
+
description: 'The IP address of the A record. Required.',
|
|
1054
|
+
examples: [
|
|
1055
|
+
'2.2.2.2'
|
|
1056
|
+
]
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
required: [
|
|
1062
|
+
'recordName',
|
|
1063
|
+
'siteId',
|
|
1064
|
+
'data'
|
|
1065
|
+
]
|
|
1066
|
+
}
|
|
1067
|
+
};
|
|
1068
|
+
const SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL = {
|
|
1069
|
+
name: 'site_dns_cname_domain_record_create',
|
|
1070
|
+
description: 'Create a CNAME domain record for a site.',
|
|
1071
|
+
inputSchema: {
|
|
1072
|
+
type: 'object',
|
|
1073
|
+
properties: {
|
|
1074
|
+
recordName: {
|
|
1075
|
+
type: 'string',
|
|
1076
|
+
description: 'The name of the DNS record (e.g., subdomain or full domain). Required.',
|
|
1077
|
+
examples: [
|
|
1078
|
+
'www.example.com',
|
|
1079
|
+
'sub.example.com'
|
|
1080
|
+
]
|
|
1081
|
+
},
|
|
1082
|
+
siteId: {
|
|
1083
|
+
type: 'number',
|
|
1084
|
+
description: 'The ID of the site, obtained from the ListSites operation. Required.',
|
|
1085
|
+
examples: [
|
|
1086
|
+
1234567890123
|
|
1087
|
+
]
|
|
1088
|
+
},
|
|
1089
|
+
data: {
|
|
1090
|
+
type: 'object',
|
|
1091
|
+
description: 'The data for the DNS record, varying by record type. Required.',
|
|
1092
|
+
properties: {
|
|
1093
|
+
value: {
|
|
1094
|
+
type: 'string',
|
|
1095
|
+
description: 'The IP address of the A record. Required.',
|
|
1096
|
+
examples: [
|
|
1097
|
+
'2.2.2.2'
|
|
1098
|
+
]
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
},
|
|
1103
|
+
required: [
|
|
1104
|
+
'recordName',
|
|
1105
|
+
'siteId',
|
|
1106
|
+
'data'
|
|
1107
|
+
]
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
const SITE_RECORD_LIST_TOOL = {
|
|
1111
|
+
name: 'site_record_list',
|
|
1112
|
+
description: 'List all records in a site',
|
|
1113
|
+
inputSchema: {
|
|
1114
|
+
type: 'object',
|
|
1115
|
+
properties: {
|
|
1116
|
+
SiteId: {
|
|
1117
|
+
type: 'number',
|
|
1118
|
+
description: 'The ID of the site, obtained from the ListSites operation. Required.'
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
};
|
|
1123
|
+
const site_dns_type_a_record_create = async (request)=>{
|
|
1124
|
+
const res = await service.createRecord({
|
|
1125
|
+
ttl: 1,
|
|
1126
|
+
proxied: true,
|
|
1127
|
+
bizName: 'web',
|
|
1128
|
+
type: 'A/AAAA',
|
|
1129
|
+
...request.params.arguments
|
|
1130
|
+
});
|
|
1131
|
+
return {
|
|
1132
|
+
content: [
|
|
1133
|
+
{
|
|
1134
|
+
type: 'text',
|
|
1135
|
+
text: JSON.stringify(res)
|
|
1136
|
+
}
|
|
1137
|
+
],
|
|
1138
|
+
success: true
|
|
1139
|
+
};
|
|
1140
|
+
};
|
|
1141
|
+
const site_dns_cname_domain_record_create = async (request)=>{
|
|
1142
|
+
const res = await service.createRecord({
|
|
1143
|
+
ttl: 1,
|
|
1144
|
+
proxied: true,
|
|
1145
|
+
bizName: 'web',
|
|
1146
|
+
type: 'CNAME',
|
|
1147
|
+
sourceType: 'Domain',
|
|
1148
|
+
hostPolicy: 'follow_hostname',
|
|
1149
|
+
...request.params.arguments
|
|
1150
|
+
});
|
|
1151
|
+
return {
|
|
1152
|
+
content: [
|
|
1153
|
+
{
|
|
1154
|
+
type: 'text',
|
|
1155
|
+
text: JSON.stringify(res)
|
|
1156
|
+
}
|
|
1157
|
+
],
|
|
1158
|
+
success: true
|
|
1159
|
+
};
|
|
1160
|
+
};
|
|
1161
|
+
const site_record_list = async (request)=>{
|
|
1162
|
+
var _request_params_arguments;
|
|
1163
|
+
const res = await service.listRecords({
|
|
1164
|
+
siteId: (null === (_request_params_arguments = request.params.arguments) || void 0 === _request_params_arguments ? void 0 : _request_params_arguments.SiteId) ?? 0
|
|
1165
|
+
});
|
|
1166
|
+
return {
|
|
1167
|
+
content: [
|
|
1168
|
+
{
|
|
1169
|
+
type: 'text',
|
|
1170
|
+
text: JSON.stringify(res)
|
|
1171
|
+
}
|
|
1172
|
+
],
|
|
1173
|
+
success: true
|
|
1174
|
+
};
|
|
1175
|
+
};
|
|
1018
1176
|
const site_active_list = async ()=>{
|
|
1019
1177
|
const res = await service.listSites({
|
|
1020
1178
|
siteSearchType: 'fuzzy',
|
|
@@ -1064,14 +1222,23 @@ const ESA_OPENAPI_ER_LIST = [
|
|
|
1064
1222
|
ROUTE_UPDATE_TOOL,
|
|
1065
1223
|
ROUTE_GET_TOOL,
|
|
1066
1224
|
SITE_MATCH_TOOL,
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1225
|
+
ER_RECORD_CREATE_TOOL,
|
|
1226
|
+
ER_RECORD_DELETE_TOOL,
|
|
1227
|
+
ER_RECORD_LIST_TOOL,
|
|
1228
|
+
SITE_DNS_TYPE_A_RECORD_CREATE_TOOL,
|
|
1229
|
+
SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL,
|
|
1230
|
+
SITE_RECORD_LIST_TOOL
|
|
1070
1231
|
];
|
|
1071
1232
|
const ESA_OPENAPI_LIST = [
|
|
1072
1233
|
...ESA_OPENAPI_ER_LIST
|
|
1073
1234
|
];
|
|
1074
1235
|
const routineHandlers = {
|
|
1236
|
+
site_dns_type_a_record_create: site_dns_type_a_record_create,
|
|
1237
|
+
site_dns_cname_domain_record_create: site_dns_cname_domain_record_create,
|
|
1238
|
+
site_active_list: site_active_list,
|
|
1239
|
+
site_match: site_match,
|
|
1240
|
+
site_route_list: site_route_list,
|
|
1241
|
+
site_record_list: site_record_list,
|
|
1075
1242
|
routine_create: routine_create,
|
|
1076
1243
|
routine_delete: routine_delete,
|
|
1077
1244
|
routine_list: routine_list,
|
|
@@ -1081,16 +1248,13 @@ const routineHandlers = {
|
|
|
1081
1248
|
routine_route_list: routine_route_list,
|
|
1082
1249
|
canary_area_list: canary_area_list,
|
|
1083
1250
|
deployment_delete: deployment_delete,
|
|
1084
|
-
site_active_list: site_active_list,
|
|
1085
|
-
site_match: site_match,
|
|
1086
|
-
site_route_list: site_route_list,
|
|
1087
1251
|
route_create: route_create,
|
|
1088
1252
|
route_delete: route_delete,
|
|
1089
1253
|
route_update: route_update,
|
|
1090
1254
|
route_get: route_get,
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1255
|
+
er_record_create: er_record_create,
|
|
1256
|
+
er_record_delete: er_record_delete,
|
|
1257
|
+
er_record_list: er_record_list
|
|
1094
1258
|
};
|
|
1095
1259
|
const server = new __WEBPACK_EXTERNAL_MODULE__modelcontextprotocol_sdk_server_index_js_269b79bf__.Server({
|
|
1096
1260
|
name: 'esa-server',
|
package/dist/tools/record.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { CallToolRequest, Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
2
|
+
export declare const ER_RECORD_CREATE_TOOL: Tool;
|
|
3
|
+
export declare const ER_RECORD_DELETE_TOOL: Tool;
|
|
4
|
+
export declare const ER_RECORD_LIST_TOOL: Tool;
|
|
5
|
+
export declare const er_record_create: (request: CallToolRequest) => Promise<{
|
|
6
6
|
content: {
|
|
7
7
|
type: string;
|
|
8
8
|
text: string;
|
|
9
9
|
}[];
|
|
10
10
|
success: boolean;
|
|
11
11
|
}>;
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const er_record_delete: (request: CallToolRequest) => Promise<{
|
|
13
13
|
content: {
|
|
14
14
|
type: string;
|
|
15
15
|
text: string;
|
|
16
16
|
}[];
|
|
17
17
|
success: boolean;
|
|
18
18
|
}>;
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const er_record_list: (request: CallToolRequest) => Promise<{
|
|
20
20
|
content: {
|
|
21
21
|
type: string;
|
|
22
22
|
text: string;
|
package/dist/tools/site.d.ts
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { CallToolRequest, Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
export declare const SITE_ACTIVE_LIST_TOOL: Tool;
|
|
3
3
|
export declare const SITE_MATCH_TOOL: Tool;
|
|
4
|
+
export declare const SITE_DNS_TYPE_A_RECORD_CREATE_TOOL: Tool;
|
|
5
|
+
export declare const SITE_DNS_CNAME_DOMAIN_RECORD_CREATE_TOOL: Tool;
|
|
6
|
+
export declare const SITE_RECORD_LIST_TOOL: Tool;
|
|
7
|
+
export declare const site_dns_type_a_record_create: (request: CallToolRequest) => Promise<{
|
|
8
|
+
content: {
|
|
9
|
+
type: string;
|
|
10
|
+
text: string;
|
|
11
|
+
}[];
|
|
12
|
+
success: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const site_dns_cname_domain_record_create: (request: CallToolRequest) => Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: string;
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
success: boolean;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const site_record_list: (request: CallToolRequest) => Promise<{
|
|
22
|
+
content: {
|
|
23
|
+
type: string;
|
|
24
|
+
text: string;
|
|
25
|
+
}[];
|
|
26
|
+
success: boolean;
|
|
27
|
+
}>;
|
|
4
28
|
export declare const site_active_list: () => Promise<{
|
|
5
29
|
content: {
|
|
6
30
|
type: string;
|
package/dist/utils/service.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ESA, { CommitRoutineStagingCodeRequest, CommitRoutineStagingCodeResponse, CreateRoutineRelatedRecordRequest, CreateRoutineRelatedRecordResponse, CreateRoutineRequest, CreateRoutineResponse, CreateRoutineRouteRequest, CreateRoutineRouteResponse, DeleteRoutineCodeVersionRequest, DeleteRoutineCodeVersionResponse, DeleteRoutineRelatedRecordRequest, DeleteRoutineRelatedRecordResponse, DeleteRoutineRequest, DeleteRoutineResponse, DeleteRoutineRouteRequest, DeleteRoutineRouteResponse, GetRoutineRequest, GetRoutineResponse, GetRoutineRouteRequest, GetRoutineRouteResponse, GetRoutineStagingCodeUploadInfoRequest, GetRoutineStagingCodeUploadInfoResponse, ListRoutineRoutesRequest, ListRoutineRoutesResponse, ListSiteRoutesRequest, ListSiteRoutesResponse, ListSitesRequest, ListSitesResponse, PublishRoutineCodeVersionRequest, PublishRoutineCodeVersionResponse, UpdateRoutineRouteRequest, UpdateRoutineRouteResponse } from '@alicloud/esa20240910';
|
|
1
|
+
import ESA, { CommitRoutineStagingCodeRequest, CommitRoutineStagingCodeResponse, CreateRecordRequest, CreateRecordResponse, CreateRoutineRelatedRecordRequest, CreateRoutineRelatedRecordResponse, CreateRoutineRequest, CreateRoutineResponse, CreateRoutineRouteRequest, CreateRoutineRouteResponse, DeleteRoutineCodeVersionRequest, DeleteRoutineCodeVersionResponse, DeleteRoutineRelatedRecordRequest, DeleteRoutineRelatedRecordResponse, DeleteRoutineRequest, DeleteRoutineResponse, DeleteRoutineRouteRequest, DeleteRoutineRouteResponse, GetRoutineRequest, GetRoutineResponse, GetRoutineRouteRequest, GetRoutineRouteResponse, GetRoutineStagingCodeUploadInfoRequest, GetRoutineStagingCodeUploadInfoResponse, ListRecordsRequest, ListRecordsResponse, ListRoutineRoutesRequest, ListRoutineRoutesResponse, ListSiteRoutesRequest, ListSiteRoutesResponse, ListSitesRequest, ListSitesResponse, PublishRoutineCodeVersionRequest, PublishRoutineCodeVersionResponse, UpdateRoutineRouteRequest, UpdateRoutineRouteResponse } from '@alicloud/esa20240910';
|
|
2
2
|
import * as $Util from '@alicloud/tea-util';
|
|
3
3
|
import { CliConfig, GetMatchSiteRequest, ListRoutineRelatedRecordsRequest } from './types';
|
|
4
4
|
export interface ApiMethod<RequestType, ResponseType> {
|
|
@@ -34,6 +34,8 @@ declare class Client {
|
|
|
34
34
|
listRoutineRelatedRecords(requestParams: ListRoutineRelatedRecordsRequest): Promise<{
|
|
35
35
|
[key: string]: any;
|
|
36
36
|
}>;
|
|
37
|
+
createRecord(params: CreateRecordRequest): Promise<CreateRecordResponse>;
|
|
38
|
+
listRecords(params: ListRecordsRequest): Promise<ListRecordsResponse>;
|
|
37
39
|
}
|
|
38
40
|
declare const _default: Client;
|
|
39
41
|
export default _default;
|