xserver-mcp 1.1.0 → 1.3.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 +100 -33
- package/dist/index.js +1992 -276
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6,6 +6,17 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
6
6
|
|
|
7
7
|
// ../../shared/dist/api-client.js
|
|
8
8
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
9
|
+
var SENSITIVE_FIELD_PATTERN = /(?:password|passphrase|private_key|secret|token|user_pass|auth_code)$/i;
|
|
10
|
+
function redactSensitiveValues(value) {
|
|
11
|
+
if (Array.isArray(value))
|
|
12
|
+
return value.map(redactSensitiveValues);
|
|
13
|
+
if (typeof value !== "object" || value === null)
|
|
14
|
+
return value;
|
|
15
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [
|
|
16
|
+
key,
|
|
17
|
+
SENSITIVE_FIELD_PATTERN.test(key) ? "[REDACTED]" : redactSensitiveValues(child)
|
|
18
|
+
]));
|
|
19
|
+
}
|
|
9
20
|
var ApiError = class extends Error {
|
|
10
21
|
httpStatus;
|
|
11
22
|
errorCode;
|
|
@@ -117,11 +128,11 @@ var ApiClient = class {
|
|
|
117
128
|
async listSpamFilter(params) {
|
|
118
129
|
return this.get(`${this.serverPath()}/spam-filter`, params);
|
|
119
130
|
}
|
|
120
|
-
async updateSpamFilter(
|
|
121
|
-
return this.put(`${this.serverPath()}/spam-filter/${enc(
|
|
131
|
+
async updateSpamFilter(domain2, data) {
|
|
132
|
+
return this.put(`${this.serverPath()}/spam-filter/${enc(domain2)}`, data);
|
|
122
133
|
}
|
|
123
|
-
async updateSpamFilterDmarcReceiver(
|
|
124
|
-
return this.put(`${this.serverPath()}/spam-filter/${enc(
|
|
134
|
+
async updateSpamFilterDmarcReceiver(domain2, data) {
|
|
135
|
+
return this.put(`${this.serverPath()}/spam-filter/${enc(domain2)}/dmarc-receiver`, data);
|
|
125
136
|
}
|
|
126
137
|
// ================================================================
|
|
127
138
|
// 自動応答設定
|
|
@@ -147,8 +158,8 @@ var ApiClient = class {
|
|
|
147
158
|
async listSmtpAbroadRestriction(params) {
|
|
148
159
|
return this.get(`${this.serverPath()}/smtp-abroad-restriction`, params);
|
|
149
160
|
}
|
|
150
|
-
async updateSmtpAbroadRestriction(
|
|
151
|
-
return this.put(`${this.serverPath()}/smtp-abroad-restriction/${enc(
|
|
161
|
+
async updateSmtpAbroadRestriction(domain2, data) {
|
|
162
|
+
return this.put(`${this.serverPath()}/smtp-abroad-restriction/${enc(domain2)}`, data);
|
|
152
163
|
}
|
|
153
164
|
// ================================================================
|
|
154
165
|
// DKIM設定
|
|
@@ -183,8 +194,8 @@ var ApiClient = class {
|
|
|
183
194
|
async listDmarc(params) {
|
|
184
195
|
return this.get(`${this.serverPath()}/dmarc`, params);
|
|
185
196
|
}
|
|
186
|
-
async updateDmarc(
|
|
187
|
-
return this.put(`${this.serverPath()}/dmarc/${enc(
|
|
197
|
+
async updateDmarc(domain2, data) {
|
|
198
|
+
return this.put(`${this.serverPath()}/dmarc/${enc(domain2)}`, data);
|
|
188
199
|
}
|
|
189
200
|
// ================================================================
|
|
190
201
|
// FTP
|
|
@@ -243,8 +254,8 @@ var ApiClient = class {
|
|
|
243
254
|
async getPhpVersion(params) {
|
|
244
255
|
return this.get(`${this.serverPath()}/php-version`, params);
|
|
245
256
|
}
|
|
246
|
-
async updatePhpVersion(
|
|
247
|
-
return this.put(`${this.serverPath()}/php-version/${enc(
|
|
257
|
+
async updatePhpVersion(domain2, data) {
|
|
258
|
+
return this.put(`${this.serverPath()}/php-version/${enc(domain2)}`, data);
|
|
248
259
|
}
|
|
249
260
|
// ================================================================
|
|
250
261
|
// ドメイン(サーバーパネル)
|
|
@@ -252,20 +263,20 @@ var ApiClient = class {
|
|
|
252
263
|
async listDomain() {
|
|
253
264
|
return this.get(`${this.serverPath()}/domain`);
|
|
254
265
|
}
|
|
255
|
-
async getDomain(
|
|
256
|
-
return this.get(`${this.serverPath()}/domain/${enc(
|
|
266
|
+
async getDomain(domain2) {
|
|
267
|
+
return this.get(`${this.serverPath()}/domain/${enc(domain2)}`);
|
|
257
268
|
}
|
|
258
269
|
async addDomain(data) {
|
|
259
270
|
return this.post(`${this.serverPath()}/domain`, data);
|
|
260
271
|
}
|
|
261
|
-
async updateDomain(
|
|
262
|
-
return this.put(`${this.serverPath()}/domain/${enc(
|
|
272
|
+
async updateDomain(domain2, data) {
|
|
273
|
+
return this.put(`${this.serverPath()}/domain/${enc(domain2)}`, data);
|
|
263
274
|
}
|
|
264
|
-
async deleteDomain(
|
|
265
|
-
return this.delete(`${this.serverPath()}/domain/${enc(
|
|
275
|
+
async deleteDomain(domain2, data) {
|
|
276
|
+
return this.delete(`${this.serverPath()}/domain/${enc(domain2)}`, data);
|
|
266
277
|
}
|
|
267
|
-
async resetDomain(
|
|
268
|
-
return this.post(`${this.serverPath()}/domain/${enc(
|
|
278
|
+
async resetDomain(domain2, data) {
|
|
279
|
+
return this.post(`${this.serverPath()}/domain/${enc(domain2)}/reset`, data);
|
|
269
280
|
}
|
|
270
281
|
// ================================================================
|
|
271
282
|
// サブドメイン
|
|
@@ -303,11 +314,11 @@ var ApiClient = class {
|
|
|
303
314
|
async addDns(data) {
|
|
304
315
|
return this.post(`${this.serverPath()}/dns`, data);
|
|
305
316
|
}
|
|
306
|
-
async updateDns(
|
|
307
|
-
return this.put(`${this.serverPath()}/dns/${enc(
|
|
317
|
+
async updateDns(dnsId2, data) {
|
|
318
|
+
return this.put(`${this.serverPath()}/dns/${enc(dnsId2)}`, data);
|
|
308
319
|
}
|
|
309
|
-
async deleteDns(
|
|
310
|
-
return this.delete(`${this.serverPath()}/dns/${enc(
|
|
320
|
+
async deleteDns(dnsId2, data) {
|
|
321
|
+
return this.delete(`${this.serverPath()}/dns/${enc(dnsId2)}`, data);
|
|
311
322
|
}
|
|
312
323
|
// ================================================================
|
|
313
324
|
// SSH
|
|
@@ -331,6 +342,138 @@ var ApiClient = class {
|
|
|
331
342
|
return this.delete(`${this.serverPath()}/ssh/key/${enc(keyId)}`);
|
|
332
343
|
}
|
|
333
344
|
// ================================================================
|
|
345
|
+
// リソースモニター
|
|
346
|
+
// ================================================================
|
|
347
|
+
async getResourceMonitor(date) {
|
|
348
|
+
return this.get(`${this.serverPath()}/resource-monitor`, { date });
|
|
349
|
+
}
|
|
350
|
+
// ================================================================
|
|
351
|
+
// WAF設定
|
|
352
|
+
// ================================================================
|
|
353
|
+
async listWaf(params) {
|
|
354
|
+
return this.get(`${this.serverPath()}/waf`, params);
|
|
355
|
+
}
|
|
356
|
+
async updateWaf(domain2, data) {
|
|
357
|
+
return this.put(`${this.serverPath()}/waf/${enc(domain2)}`, data);
|
|
358
|
+
}
|
|
359
|
+
// ================================================================
|
|
360
|
+
// php.ini設定
|
|
361
|
+
// ================================================================
|
|
362
|
+
async listPhpIni(params) {
|
|
363
|
+
return this.get(`${this.serverPath()}/php-ini`, params);
|
|
364
|
+
}
|
|
365
|
+
async updatePhpIni(domain2, data) {
|
|
366
|
+
return this.put(`${this.serverPath()}/php-ini/${enc(domain2)}`, data);
|
|
367
|
+
}
|
|
368
|
+
async resetPhpIni(domain2) {
|
|
369
|
+
return this.post(`${this.serverPath()}/php-ini/${enc(domain2)}/reset`);
|
|
370
|
+
}
|
|
371
|
+
// ================================================================
|
|
372
|
+
// WordPressセキュリティ設定
|
|
373
|
+
// ================================================================
|
|
374
|
+
async getWordPressSecurity(params) {
|
|
375
|
+
return this.get(`${this.serverPath()}/wordpress-security`, params);
|
|
376
|
+
}
|
|
377
|
+
async updateWordPressSecurity(data) {
|
|
378
|
+
return this.post(`${this.serverPath()}/wordpress-security`, data);
|
|
379
|
+
}
|
|
380
|
+
// ================================================================
|
|
381
|
+
// Xアクセラレータ設定
|
|
382
|
+
// ================================================================
|
|
383
|
+
async listXAccelerator(params) {
|
|
384
|
+
return this.get(`${this.serverPath()}/x-accelerator`, params);
|
|
385
|
+
}
|
|
386
|
+
async updateXAccelerator(domain2, data) {
|
|
387
|
+
return this.put(`${this.serverPath()}/x-accelerator/${enc(domain2)}`, data);
|
|
388
|
+
}
|
|
389
|
+
// ================================================================
|
|
390
|
+
// サーバーキャッシュ設定
|
|
391
|
+
// ================================================================
|
|
392
|
+
async listServerCache(params) {
|
|
393
|
+
return this.get(`${this.serverPath()}/server-cache`, params);
|
|
394
|
+
}
|
|
395
|
+
async updateServerCache(domain2, data) {
|
|
396
|
+
return this.put(`${this.serverPath()}/server-cache/${enc(domain2)}`, data);
|
|
397
|
+
}
|
|
398
|
+
async clearServerCache(domain2) {
|
|
399
|
+
return this.delete(`${this.serverPath()}/server-cache/${enc(domain2)}/cache`);
|
|
400
|
+
}
|
|
401
|
+
// ================================================================
|
|
402
|
+
// ブラウザキャッシュ設定
|
|
403
|
+
// ================================================================
|
|
404
|
+
async listBrowserCache(params) {
|
|
405
|
+
return this.get(`${this.serverPath()}/browser-cache`, params);
|
|
406
|
+
}
|
|
407
|
+
async updateBrowserCache(domain2, data) {
|
|
408
|
+
return this.put(`${this.serverPath()}/browser-cache/${enc(domain2)}`, data);
|
|
409
|
+
}
|
|
410
|
+
// ================================================================
|
|
411
|
+
// サイト転送設定
|
|
412
|
+
// ================================================================
|
|
413
|
+
async listUrlRedirect(params) {
|
|
414
|
+
return this.get(`${this.serverPath()}/url-redirect`, params);
|
|
415
|
+
}
|
|
416
|
+
async addUrlRedirect(data) {
|
|
417
|
+
return this.post(`${this.serverPath()}/url-redirect`, data);
|
|
418
|
+
}
|
|
419
|
+
async deleteUrlRedirect(redirectId) {
|
|
420
|
+
return this.delete(`${this.serverPath()}/url-redirect/${enc(redirectId)}`);
|
|
421
|
+
}
|
|
422
|
+
// ================================================================
|
|
423
|
+
// アクセス拒否設定
|
|
424
|
+
// ================================================================
|
|
425
|
+
async listAccessDeny(params) {
|
|
426
|
+
return this.get(`${this.serverPath()}/access-deny`, params);
|
|
427
|
+
}
|
|
428
|
+
async addAccessDeny(data) {
|
|
429
|
+
return this.post(`${this.serverPath()}/access-deny`, data);
|
|
430
|
+
}
|
|
431
|
+
async updateAccessDeny(denyId, data) {
|
|
432
|
+
return this.put(`${this.serverPath()}/access-deny/${enc(denyId)}`, data);
|
|
433
|
+
}
|
|
434
|
+
async deleteAccessDeny(denyId) {
|
|
435
|
+
return this.delete(`${this.serverPath()}/access-deny/${enc(denyId)}`);
|
|
436
|
+
}
|
|
437
|
+
// ================================================================
|
|
438
|
+
// XPageSpeed設定
|
|
439
|
+
// ================================================================
|
|
440
|
+
async listXPageSpeed(params) {
|
|
441
|
+
return this.get(`${this.serverPath()}/xpagespeed`, params);
|
|
442
|
+
}
|
|
443
|
+
async updateXPageSpeed(domain2, data) {
|
|
444
|
+
return this.put(`${this.serverPath()}/xpagespeed/${enc(domain2)}`, data);
|
|
445
|
+
}
|
|
446
|
+
// ================================================================
|
|
447
|
+
// 自動バックアップの取得・復元
|
|
448
|
+
// ================================================================
|
|
449
|
+
async listAutoBackupBackupDates() {
|
|
450
|
+
return this.get(`${this.serverPath()}/auto-backup/backup-dates`);
|
|
451
|
+
}
|
|
452
|
+
async listAutoBackup() {
|
|
453
|
+
return this.get(`${this.serverPath()}/auto-backup`);
|
|
454
|
+
}
|
|
455
|
+
async getAutoBackup(requestId) {
|
|
456
|
+
return this.get(`${this.serverPath()}/auto-backup/${enc(requestId)}`);
|
|
457
|
+
}
|
|
458
|
+
async createAutoBackup(data) {
|
|
459
|
+
return this.post(`${this.serverPath()}/auto-backup`, data);
|
|
460
|
+
}
|
|
461
|
+
// ================================================================
|
|
462
|
+
// MySQLバックアップの取得・復元
|
|
463
|
+
// ================================================================
|
|
464
|
+
async listMysqlBackupDatabases() {
|
|
465
|
+
return this.get(`${this.serverPath()}/mysql-backup/databases`);
|
|
466
|
+
}
|
|
467
|
+
async listMysqlBackup() {
|
|
468
|
+
return this.get(`${this.serverPath()}/mysql-backup`);
|
|
469
|
+
}
|
|
470
|
+
async getMysqlBackup(requestId) {
|
|
471
|
+
return this.get(`${this.serverPath()}/mysql-backup/${enc(requestId)}`);
|
|
472
|
+
}
|
|
473
|
+
async createMysqlBackup(data) {
|
|
474
|
+
return this.post(`${this.serverPath()}/mysql-backup`, data);
|
|
475
|
+
}
|
|
476
|
+
// ================================================================
|
|
334
477
|
// ログ
|
|
335
478
|
// ================================================================
|
|
336
479
|
async getAccessLog(params) {
|
|
@@ -346,6 +489,243 @@ var ApiClient = class {
|
|
|
346
489
|
return this.get("/v1/me");
|
|
347
490
|
}
|
|
348
491
|
// ================================================================
|
|
492
|
+
// ドメインサービスAPI(/v1/domain・servername非依存)
|
|
493
|
+
// ================================================================
|
|
494
|
+
domainPath(domainName2) {
|
|
495
|
+
return `/v1/domain/${enc(domainName2)}`;
|
|
496
|
+
}
|
|
497
|
+
async listDomains() {
|
|
498
|
+
return this.get("/v1/domain");
|
|
499
|
+
}
|
|
500
|
+
async getDomainDetail(domainName2) {
|
|
501
|
+
return this.get(this.domainPath(domainName2));
|
|
502
|
+
}
|
|
503
|
+
async getDomainNameservers(domainName2) {
|
|
504
|
+
return this.get(`${this.domainPath(domainName2)}/nameservers`);
|
|
505
|
+
}
|
|
506
|
+
async updateDomainNameservers(domainName2, data) {
|
|
507
|
+
return this.put(`${this.domainPath(domainName2)}/nameservers`, data);
|
|
508
|
+
}
|
|
509
|
+
async getDomainWhois(domainName2) {
|
|
510
|
+
return this.get(`${this.domainPath(domainName2)}/whois`);
|
|
511
|
+
}
|
|
512
|
+
async updateDomainWhois(domainName2, data) {
|
|
513
|
+
return this.put(`${this.domainPath(domainName2)}/whois`, data);
|
|
514
|
+
}
|
|
515
|
+
async getDomainRegistrarLock(domainName2) {
|
|
516
|
+
return this.get(`${this.domainPath(domainName2)}/registrar-lock`);
|
|
517
|
+
}
|
|
518
|
+
async updateDomainRegistrarLock(domainName2, data) {
|
|
519
|
+
return this.put(`${this.domainPath(domainName2)}/registrar-lock`, data);
|
|
520
|
+
}
|
|
521
|
+
async listDomainDns(domainName2) {
|
|
522
|
+
return this.get(`${this.domainPath(domainName2)}/dns`);
|
|
523
|
+
}
|
|
524
|
+
async addDomainDns(domainName2, data) {
|
|
525
|
+
return this.post(`${this.domainPath(domainName2)}/dns`, data);
|
|
526
|
+
}
|
|
527
|
+
async updateDomainDns(domainName2, dnsId2, data) {
|
|
528
|
+
return this.put(`${this.domainPath(domainName2)}/dns/${enc(dnsId2)}`, data);
|
|
529
|
+
}
|
|
530
|
+
async deleteDomainDns(domainName2, dnsId2) {
|
|
531
|
+
return this.delete(`${this.domainPath(domainName2)}/dns/${enc(dnsId2)}`);
|
|
532
|
+
}
|
|
533
|
+
async checkDomain(domainName2) {
|
|
534
|
+
return this.get("/v1/domain/check", { domain_name: domainName2 });
|
|
535
|
+
}
|
|
536
|
+
async getDomainPricing(params) {
|
|
537
|
+
return this.get("/v1/domain/pricing", params);
|
|
538
|
+
}
|
|
539
|
+
async registerDomain(data, idempotencyKey3) {
|
|
540
|
+
return this.post("/v1/domain", data, idempotencyHeaders(idempotencyKey3));
|
|
541
|
+
}
|
|
542
|
+
async transferDomain(domainName2, data, idempotencyKey3) {
|
|
543
|
+
return this.post(`${this.domainPath(domainName2)}/transfer`, data, idempotencyHeaders(idempotencyKey3));
|
|
544
|
+
}
|
|
545
|
+
async renewDomain(domainName2, data, idempotencyKey3) {
|
|
546
|
+
return this.post(`${this.domainPath(domainName2)}/renew`, data, idempotencyHeaders(idempotencyKey3));
|
|
547
|
+
}
|
|
548
|
+
// ================================================================
|
|
549
|
+
// WPhosting API(/v1/wphosting/{contract_id})
|
|
550
|
+
// ================================================================
|
|
551
|
+
wphostingPath(contractId2) {
|
|
552
|
+
return `/v1/wphosting/${enc(contractId2)}`;
|
|
553
|
+
}
|
|
554
|
+
wphostingSitePath(contractId2, servername2) {
|
|
555
|
+
return `${this.wphostingPath(contractId2)}/sites/${enc(servername2)}`;
|
|
556
|
+
}
|
|
557
|
+
async listWphostingSites(contractId2) {
|
|
558
|
+
return this.get(`${this.wphostingPath(contractId2)}/sites`);
|
|
559
|
+
}
|
|
560
|
+
async getWphostingSite(contractId2, servername2) {
|
|
561
|
+
return this.get(this.wphostingSitePath(contractId2, servername2));
|
|
562
|
+
}
|
|
563
|
+
async createWphostingSite(contractId2, data, idempotencyKey3) {
|
|
564
|
+
return this.post(`${this.wphostingPath(contractId2)}/sites`, data, idempotencyHeaders(idempotencyKey3));
|
|
565
|
+
}
|
|
566
|
+
async deleteWphostingSite(contractId2, servername2, idempotencyKey3) {
|
|
567
|
+
return this.delete(this.wphostingSitePath(contractId2, servername2), void 0, idempotencyHeaders(idempotencyKey3));
|
|
568
|
+
}
|
|
569
|
+
async getWphostingUsage(contractId2) {
|
|
570
|
+
return this.get(`${this.wphostingPath(contractId2)}/usage`);
|
|
571
|
+
}
|
|
572
|
+
async createWphostingStaging(contractId2, servername2, data, idempotencyKey3) {
|
|
573
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/staging`, data, idempotencyHeaders(idempotencyKey3));
|
|
574
|
+
}
|
|
575
|
+
async listWphostingBackups(contractId2, servername2) {
|
|
576
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/backups`);
|
|
577
|
+
}
|
|
578
|
+
async createWphostingBackup(contractId2, servername2, data, idempotencyKey3) {
|
|
579
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/backups`, data, idempotencyHeaders(idempotencyKey3));
|
|
580
|
+
}
|
|
581
|
+
async restoreWphostingBackup(contractId2, servername2, backupId, idempotencyKey3) {
|
|
582
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/backups/${enc(backupId)}/restore`, void 0, idempotencyHeaders(idempotencyKey3));
|
|
583
|
+
}
|
|
584
|
+
async listWphostingBackupRestoreHistory(contractId2, servername2) {
|
|
585
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/backups/restore-history`);
|
|
586
|
+
}
|
|
587
|
+
async deleteWphostingBackup(contractId2, servername2, backupId) {
|
|
588
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername2)}/backups/${enc(backupId)}`);
|
|
589
|
+
}
|
|
590
|
+
async getWphostingWordPress(contractId2, servername2) {
|
|
591
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/wordpress`);
|
|
592
|
+
}
|
|
593
|
+
async updateWphostingWordPress(contractId2, servername2, data) {
|
|
594
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/wordpress`, data);
|
|
595
|
+
}
|
|
596
|
+
async upgradeWphostingWordPress(contractId2, servername2) {
|
|
597
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/wordpress/update`);
|
|
598
|
+
}
|
|
599
|
+
async getWphostingMaintenanceMode(contractId2, servername2) {
|
|
600
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/maintenance-mode`);
|
|
601
|
+
}
|
|
602
|
+
async updateWphostingMaintenanceMode(contractId2, servername2, data) {
|
|
603
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/maintenance-mode`, data);
|
|
604
|
+
}
|
|
605
|
+
async listWphostingPlugins(contractId2, servername2) {
|
|
606
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/plugins`);
|
|
607
|
+
}
|
|
608
|
+
async installWphostingPlugin(contractId2, servername2, data) {
|
|
609
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/plugins`, data);
|
|
610
|
+
}
|
|
611
|
+
async updateWphostingPlugin(contractId2, servername2, plugin, data) {
|
|
612
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/plugins/${enc(plugin)}`, data);
|
|
613
|
+
}
|
|
614
|
+
async upgradeWphostingPlugin(contractId2, servername2, plugin) {
|
|
615
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/plugins/${enc(plugin)}/update`);
|
|
616
|
+
}
|
|
617
|
+
async deleteWphostingPlugin(contractId2, servername2, plugin) {
|
|
618
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername2)}/plugins/${enc(plugin)}`);
|
|
619
|
+
}
|
|
620
|
+
async listWphostingThemes(contractId2, servername2) {
|
|
621
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/themes`);
|
|
622
|
+
}
|
|
623
|
+
async installWphostingTheme(contractId2, servername2, data) {
|
|
624
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/themes`, data);
|
|
625
|
+
}
|
|
626
|
+
async updateWphostingTheme(contractId2, servername2, theme, data) {
|
|
627
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/themes/${enc(theme)}`, data);
|
|
628
|
+
}
|
|
629
|
+
async upgradeWphostingTheme(contractId2, servername2, theme) {
|
|
630
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/themes/${enc(theme)}/update`);
|
|
631
|
+
}
|
|
632
|
+
async deleteWphostingTheme(contractId2, servername2, theme) {
|
|
633
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername2)}/themes/${enc(theme)}`);
|
|
634
|
+
}
|
|
635
|
+
async listWphostingDomains(contractId2, servername2) {
|
|
636
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/domains`);
|
|
637
|
+
}
|
|
638
|
+
async addWphostingDomain(contractId2, servername2, data) {
|
|
639
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/domains`, data);
|
|
640
|
+
}
|
|
641
|
+
async verifyWphostingDomain(contractId2, servername2, domain2) {
|
|
642
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/domains/${enc(domain2)}/verify`);
|
|
643
|
+
}
|
|
644
|
+
async deleteWphostingDomain(contractId2, servername2, domain2) {
|
|
645
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername2)}/domains/${enc(domain2)}`);
|
|
646
|
+
}
|
|
647
|
+
async updateWphostingSiteUrl(contractId2, servername2, data) {
|
|
648
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/site-url`, data);
|
|
649
|
+
}
|
|
650
|
+
async listWphostingDnsRecords(contractId2, servername2, domain2) {
|
|
651
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/domains/${enc(domain2)}/dns`);
|
|
652
|
+
}
|
|
653
|
+
async addWphostingDnsRecord(contractId2, servername2, domain2, data) {
|
|
654
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/domains/${enc(domain2)}/dns`, data);
|
|
655
|
+
}
|
|
656
|
+
async updateWphostingDnsRecord(contractId2, servername2, domain2, dnsId2, data) {
|
|
657
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/domains/${enc(domain2)}/dns/${enc(dnsId2)}`, data);
|
|
658
|
+
}
|
|
659
|
+
async deleteWphostingDnsRecord(contractId2, servername2, domain2, dnsId2) {
|
|
660
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername2)}/domains/${enc(domain2)}/dns/${enc(dnsId2)}`);
|
|
661
|
+
}
|
|
662
|
+
async getWphostingPhpVersion(contractId2, servername2) {
|
|
663
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/php-version`);
|
|
664
|
+
}
|
|
665
|
+
async updateWphostingPhpVersion(contractId2, servername2, data) {
|
|
666
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/php-version`, data);
|
|
667
|
+
}
|
|
668
|
+
async getWphostingAccessLog(contractId2, servername2, params) {
|
|
669
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/access-log`, params);
|
|
670
|
+
}
|
|
671
|
+
async getWphostingErrorLog(contractId2, servername2, params) {
|
|
672
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/error-log`, params);
|
|
673
|
+
}
|
|
674
|
+
async listWphostingCron(contractId2, servername2) {
|
|
675
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/cron`);
|
|
676
|
+
}
|
|
677
|
+
async addWphostingCron(contractId2, servername2, data) {
|
|
678
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/cron`, data);
|
|
679
|
+
}
|
|
680
|
+
async updateWphostingCron(contractId2, servername2, cronId, data) {
|
|
681
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/cron/${enc(cronId)}`, data);
|
|
682
|
+
}
|
|
683
|
+
async deleteWphostingCron(contractId2, servername2, cronId) {
|
|
684
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername2)}/cron/${enc(cronId)}`);
|
|
685
|
+
}
|
|
686
|
+
async getWphostingSsh(contractId2, servername2) {
|
|
687
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/ssh`);
|
|
688
|
+
}
|
|
689
|
+
async updateWphostingSsh(contractId2, servername2, data) {
|
|
690
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/ssh`, data);
|
|
691
|
+
}
|
|
692
|
+
async listWphostingSshKeys(contractId2, servername2) {
|
|
693
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/ssh/key`);
|
|
694
|
+
}
|
|
695
|
+
async addWphostingSshKey(contractId2, servername2, data) {
|
|
696
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/ssh/key`, data);
|
|
697
|
+
}
|
|
698
|
+
async updateWphostingSshKey(contractId2, servername2, keyId, data) {
|
|
699
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/ssh/key/${enc(keyId)}`, data);
|
|
700
|
+
}
|
|
701
|
+
async deleteWphostingSshKey(contractId2, servername2, keyId) {
|
|
702
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername2)}/ssh/key/${enc(keyId)}`);
|
|
703
|
+
}
|
|
704
|
+
async listWphostingWpUserRoles(contractId2, servername2) {
|
|
705
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/wp-users/roles`);
|
|
706
|
+
}
|
|
707
|
+
async listWphostingWpUsers(contractId2, servername2, params) {
|
|
708
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/wp-users`, params);
|
|
709
|
+
}
|
|
710
|
+
async createWphostingWpUser(contractId2, servername2, data) {
|
|
711
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername2)}/wp-users`, data);
|
|
712
|
+
}
|
|
713
|
+
async getWphostingWpUser(contractId2, servername2, userId) {
|
|
714
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/wp-users/${enc(userId)}`);
|
|
715
|
+
}
|
|
716
|
+
async updateWphostingWpUser(contractId2, servername2, userId, data) {
|
|
717
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/wp-users/${enc(userId)}`, data);
|
|
718
|
+
}
|
|
719
|
+
async deleteWphostingWpUser(contractId2, servername2, userId) {
|
|
720
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername2)}/wp-users/${enc(userId)}`);
|
|
721
|
+
}
|
|
722
|
+
async getWphostingSecurity(contractId2, servername2) {
|
|
723
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername2)}/security`);
|
|
724
|
+
}
|
|
725
|
+
async updateWphostingSecurity(contractId2, servername2, key, data) {
|
|
726
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername2)}/security/${enc(key)}`, data);
|
|
727
|
+
}
|
|
728
|
+
// ================================================================
|
|
349
729
|
// HTTP 基盤
|
|
350
730
|
// ================================================================
|
|
351
731
|
async get(path, params) {
|
|
@@ -355,35 +735,36 @@ var ApiClient = class {
|
|
|
355
735
|
}
|
|
356
736
|
return this.request("GET", url);
|
|
357
737
|
}
|
|
358
|
-
async post(path, data) {
|
|
359
|
-
return this.request("POST", `${this.apiBase}${path}`, data);
|
|
738
|
+
async post(path, data, headers) {
|
|
739
|
+
return this.request("POST", `${this.apiBase}${path}`, data, headers);
|
|
360
740
|
}
|
|
361
741
|
async put(path, data) {
|
|
362
742
|
return this.request("PUT", `${this.apiBase}${path}`, data);
|
|
363
743
|
}
|
|
364
|
-
async delete(path, data) {
|
|
365
|
-
return this.request("DELETE", `${this.apiBase}${path}`, data);
|
|
744
|
+
async delete(path, data, headers) {
|
|
745
|
+
return this.request("DELETE", `${this.apiBase}${path}`, data, headers);
|
|
366
746
|
}
|
|
367
|
-
async request(method, url,
|
|
747
|
+
async request(method, url, body2, additionalHeaders) {
|
|
368
748
|
const headers = {
|
|
369
749
|
"Authorization": `Bearer ${this.apiKey}`,
|
|
370
|
-
"Accept": "application/json"
|
|
750
|
+
"Accept": "application/json",
|
|
751
|
+
...additionalHeaders
|
|
371
752
|
};
|
|
372
753
|
const init = {
|
|
373
754
|
method,
|
|
374
755
|
headers,
|
|
375
756
|
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
376
757
|
};
|
|
377
|
-
if (
|
|
758
|
+
if (body2 && method !== "GET") {
|
|
378
759
|
headers["Content-Type"] = "application/json";
|
|
379
|
-
init.body = JSON.stringify(
|
|
760
|
+
init.body = JSON.stringify(body2);
|
|
380
761
|
}
|
|
381
762
|
if (this.debug) {
|
|
382
763
|
const dbg = (msg) => process.stderr.write(`[DEBUG] ${msg}
|
|
383
764
|
`);
|
|
384
765
|
dbg(`${method} ${url}`);
|
|
385
|
-
if (
|
|
386
|
-
dbg(`Body: ${
|
|
766
|
+
if (body2)
|
|
767
|
+
dbg(`Body: ${JSON.stringify(redactSensitiveValues(body2))}`);
|
|
387
768
|
}
|
|
388
769
|
let response;
|
|
389
770
|
try {
|
|
@@ -434,11 +815,156 @@ var ApiClient = class {
|
|
|
434
815
|
function enc(s) {
|
|
435
816
|
return encodeURIComponent(s);
|
|
436
817
|
}
|
|
818
|
+
function idempotencyHeaders(idempotencyKey3) {
|
|
819
|
+
return idempotencyKey3 === void 0 ? void 0 : { "Idempotency-Key": idempotencyKey3 };
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// ../../shared/dist/brand-config.js
|
|
823
|
+
function domainLegalNoticeLines(brand) {
|
|
824
|
+
return [
|
|
825
|
+
`\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04: ${brand.domainTermsUrl}`,
|
|
826
|
+
`\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066: ${brand.domainPrivacyUrl}`
|
|
827
|
+
];
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
// ../../shared/dist/domain-acquisition-permission.js
|
|
831
|
+
function record(value) {
|
|
832
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
833
|
+
}
|
|
834
|
+
function diagnosedForbidden(message) {
|
|
835
|
+
return new ApiError(message, 403, "FORBIDDEN", []);
|
|
836
|
+
}
|
|
837
|
+
async function withDomainAcquisitionPermissionDiagnosis(client, request) {
|
|
838
|
+
try {
|
|
839
|
+
return await request();
|
|
840
|
+
} catch (error) {
|
|
841
|
+
if (!(error instanceof ApiError) || error.httpStatus !== 403 || error.errorCode !== "FORBIDDEN") {
|
|
842
|
+
throw error;
|
|
843
|
+
}
|
|
844
|
+
let meData;
|
|
845
|
+
try {
|
|
846
|
+
meData = await client.getMe();
|
|
847
|
+
} catch {
|
|
848
|
+
throw error;
|
|
849
|
+
}
|
|
850
|
+
const services = record(meData.services);
|
|
851
|
+
const domain2 = record(services?.domain);
|
|
852
|
+
if (!domain2) {
|
|
853
|
+
throw diagnosedForbidden("\u3053\u306EAPI\u30AD\u30FC\u3067\u306FDomain API\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002Domain\u30B5\u30FC\u30D3\u30B9\u3092\u542B\u3080API\u30AD\u30FC\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
854
|
+
}
|
|
855
|
+
if (domain2.allow_acquisition === false) {
|
|
856
|
+
throw diagnosedForbidden("\u3053\u306EAPI\u30AD\u30FC\u3067\u306F\u3001\u30C9\u30E1\u30A4\u30F3\u306E\u53D6\u5F97\u53EF\u80FD\u6027\u30FB\u4FA1\u683C\u78BA\u8A8D\u30FB\u65B0\u898F\u53D6\u5F97\u30FB\u79FB\u7BA1\u30FB\u5951\u7D04\u66F4\u65B0\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002API\u30AD\u30FC\u7BA1\u7406\u753B\u9762\u3067\u300C\u3053\u306E\u30AD\u30FC\u3067\u30C9\u30E1\u30A4\u30F3\u306E\u65B0\u898F\u53D6\u5F97\u30FB\u79FB\u7BA1\u30FB\u66F4\u65B0\uFF08\u304A\u7533\u3057\u8FBC\u307F\uFF09\u3092\u8A31\u53EF\u3059\u308B\u300D\u3092\u6709\u52B9\u306B\u3057\u305FAPI\u30AD\u30FC\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
857
|
+
}
|
|
858
|
+
throw error;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
// ../core/dist/server-target.js
|
|
863
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
864
|
+
import { z } from "zod";
|
|
865
|
+
var servernameInput = z.string().min(1).max(255).optional().describe("\u5BFE\u8C61\u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FC\u306Eservername\u3002\u74B0\u5883\u5909\u6570\u3067\u56FA\u5B9A\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u7701\u7565\u3057\u3001\u56FA\u5B9A\u5024\u3068\u7570\u306A\u308B\u5024\u306F\u6307\u5B9A\u4E0D\u53EF");
|
|
866
|
+
function record2(value) {
|
|
867
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
868
|
+
}
|
|
869
|
+
function strings(value) {
|
|
870
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string" && item !== "") : [];
|
|
871
|
+
}
|
|
872
|
+
var ServerTargetResolver = class {
|
|
873
|
+
fixedServername;
|
|
874
|
+
createClient;
|
|
875
|
+
accountClient;
|
|
876
|
+
activeClient = new AsyncLocalStorage();
|
|
877
|
+
client;
|
|
878
|
+
constructor(options) {
|
|
879
|
+
this.fixedServername = options.fixedServername;
|
|
880
|
+
this.createClient = options.createClient ?? ((servername2) => new ApiClient({
|
|
881
|
+
apiKey: options.apiKey,
|
|
882
|
+
apiBase: options.apiBase,
|
|
883
|
+
servername: servername2
|
|
884
|
+
}));
|
|
885
|
+
this.accountClient = this.createClient();
|
|
886
|
+
this.client = new Proxy(this.accountClient, {
|
|
887
|
+
get: (target, property) => {
|
|
888
|
+
const active = this.activeClient.getStore() ?? target;
|
|
889
|
+
const value = Reflect.get(active, property, active);
|
|
890
|
+
return typeof value === "function" ? value.bind(active) : value;
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
async resolve(requestedServername) {
|
|
895
|
+
if (this.fixedServername) {
|
|
896
|
+
if (requestedServername && requestedServername !== this.fixedServername) {
|
|
897
|
+
throw new Error(`\u3053\u306EMCP\u306F\u30B5\u30FC\u30D0\u30FC\u300C${this.fixedServername}\u300D\u306B\u56FA\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u300C${requestedServername}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002`);
|
|
898
|
+
}
|
|
899
|
+
return this.fixedServername;
|
|
900
|
+
}
|
|
901
|
+
if (requestedServername) {
|
|
902
|
+
return requestedServername;
|
|
903
|
+
}
|
|
904
|
+
const meData = await this.accountClient.getMe();
|
|
905
|
+
const server = record2(record2(meData.services)?.server);
|
|
906
|
+
if (!server) {
|
|
907
|
+
throw new Error("\u3053\u306EAPI\u30AD\u30FC\u3067\u306FServer API\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002");
|
|
908
|
+
}
|
|
909
|
+
const targetMode = server.target_mode;
|
|
910
|
+
const targets = strings(server.targets);
|
|
911
|
+
if (targetMode === "selected" && targets.length === 1) {
|
|
912
|
+
return targets[0];
|
|
913
|
+
}
|
|
914
|
+
if (targetMode === "selected" && targets.length > 1) {
|
|
915
|
+
throw new Error(`\u5BFE\u8C61\u30B5\u30FC\u30D0\u30FC\u304C\u8907\u6570\u3042\u308A\u307E\u3059\u3002servername\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 \u5019\u88DC: ${targets.join(", ")}`);
|
|
916
|
+
}
|
|
917
|
+
if (targetMode === "all") {
|
|
918
|
+
throw new Error("\u3053\u306EAPI\u30AD\u30FC\u306F\u3059\u3079\u3066\u306E\u30B5\u30FC\u30D0\u30FC\u3092\u5BFE\u8C61\u3068\u3057\u3066\u3044\u308B\u305F\u3081\u3001\u5BFE\u8C61\u3092\u81EA\u52D5\u9078\u629E\u3067\u304D\u307E\u305B\u3093\u3002servername\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
919
|
+
}
|
|
920
|
+
throw new Error("\u5BFE\u8C61\u30B5\u30FC\u30D0\u30FC\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002servername\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
921
|
+
}
|
|
922
|
+
async run(requestedServername, operation) {
|
|
923
|
+
const resolvedServername = await this.resolve(requestedServername);
|
|
924
|
+
const client = this.createClient(resolvedServername);
|
|
925
|
+
return this.activeClient.run(client, operation);
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
function withServerTargetResolution(server, resolver) {
|
|
929
|
+
return new Proxy(server, {
|
|
930
|
+
get(target, property, receiver) {
|
|
931
|
+
if (property !== "tool") {
|
|
932
|
+
return Reflect.get(target, property, receiver);
|
|
933
|
+
}
|
|
934
|
+
return (...registrationArgs) => {
|
|
935
|
+
if (registrationArgs.length < 4) {
|
|
936
|
+
throw new Error("Server tool registration requires an input schema.");
|
|
937
|
+
}
|
|
938
|
+
const schema = record2(registrationArgs[2]);
|
|
939
|
+
if (!schema) {
|
|
940
|
+
throw new Error("Server tool input schema must be an object.");
|
|
941
|
+
}
|
|
942
|
+
registrationArgs[2] = { ...schema, servername: servernameInput };
|
|
943
|
+
const callbackIndex = registrationArgs.length - 1;
|
|
944
|
+
const callback = registrationArgs[callbackIndex];
|
|
945
|
+
if (typeof callback !== "function") {
|
|
946
|
+
throw new Error("Server tool registration requires a callback.");
|
|
947
|
+
}
|
|
948
|
+
registrationArgs[callbackIndex] = async (input = {}, ...callbackArgs) => {
|
|
949
|
+
const { servername: servername2, ...forwardedInput } = input;
|
|
950
|
+
return resolver.run(typeof servername2 === "string" ? servername2 : void 0, () => callback(forwardedInput, ...callbackArgs));
|
|
951
|
+
};
|
|
952
|
+
return Reflect.apply(target.tool, target, registrationArgs);
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
}
|
|
437
957
|
|
|
438
958
|
// ../core/dist/helper.js
|
|
439
959
|
function serverToolName(brand, action, feature) {
|
|
440
960
|
return `${brand.brand}_${action}_server_${feature}`;
|
|
441
961
|
}
|
|
962
|
+
function domainToolName(brand, action, feature) {
|
|
963
|
+
return `${brand.brand}_${action}_domain_${feature}`;
|
|
964
|
+
}
|
|
965
|
+
function wphostingToolName(brand, verb, resource) {
|
|
966
|
+
return `${brand.brand}_${verb}_wphosting_${resource}`;
|
|
967
|
+
}
|
|
442
968
|
async function callApi(fn) {
|
|
443
969
|
try {
|
|
444
970
|
const result = await fn();
|
|
@@ -466,64 +992,70 @@ function registerServerInfoTools(server, client, brand) {
|
|
|
466
992
|
}
|
|
467
993
|
|
|
468
994
|
// ../core/dist/tools/server/cron.js
|
|
469
|
-
import { z } from "zod";
|
|
995
|
+
import { z as z2 } from "zod";
|
|
470
996
|
function registerCronTools(server, client, brand) {
|
|
471
997
|
server.tool(serverToolName(brand, "list", "cron"), "Cron\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listCron()));
|
|
472
998
|
server.tool(serverToolName(brand, "add", "cron"), "Cron\u30B8\u30E7\u30D6\u3092\u65B0\u898F\u8FFD\u52A0", {
|
|
473
|
-
minute:
|
|
474
|
-
hour:
|
|
475
|
-
day:
|
|
476
|
-
month:
|
|
477
|
-
weekday:
|
|
478
|
-
command:
|
|
479
|
-
comment:
|
|
999
|
+
minute: z2.string().describe("\u5206\uFF080-59, */5 \u7B49\uFF09"),
|
|
1000
|
+
hour: z2.string().describe("\u6642\uFF080-23, * \u7B49\uFF09"),
|
|
1001
|
+
day: z2.string().default("*").describe("\u65E5\uFF081-31, * \u7B49\uFF09"),
|
|
1002
|
+
month: z2.string().default("*").describe("\u6708\uFF081-12, * \u7B49\uFF09"),
|
|
1003
|
+
weekday: z2.string().default("*").describe("\u66DC\u65E5\uFF080-7, * \u7B49\uFF09"),
|
|
1004
|
+
command: z2.string().describe("\u5B9F\u884C\u30B3\u30DE\u30F3\u30C9"),
|
|
1005
|
+
comment: z2.string().optional().describe("\u30E1\u30E2")
|
|
480
1006
|
}, async (args) => callApi(() => client.addCron(args)));
|
|
481
1007
|
server.tool(serverToolName(brand, "update", "cron"), "Cron\u30B8\u30E7\u30D6\u3092\u66F4\u65B0", {
|
|
482
|
-
cron_id:
|
|
483
|
-
minute:
|
|
484
|
-
hour:
|
|
485
|
-
day:
|
|
486
|
-
month:
|
|
487
|
-
weekday:
|
|
488
|
-
command:
|
|
489
|
-
comment:
|
|
490
|
-
enabled:
|
|
491
|
-
}, async ({ cron_id, ...data }) => callApi(() =>
|
|
1008
|
+
cron_id: z2.string().describe("Cron\u306EID"),
|
|
1009
|
+
minute: z2.string().optional().describe("\u5206"),
|
|
1010
|
+
hour: z2.string().optional().describe("\u6642"),
|
|
1011
|
+
day: z2.string().optional().describe("\u65E5"),
|
|
1012
|
+
month: z2.string().optional().describe("\u6708"),
|
|
1013
|
+
weekday: z2.string().optional().describe("\u66DC\u65E5"),
|
|
1014
|
+
command: z2.string().optional().describe("\u5B9F\u884C\u30B3\u30DE\u30F3\u30C9"),
|
|
1015
|
+
comment: z2.string().optional().describe("\u30E1\u30E2"),
|
|
1016
|
+
enabled: z2.boolean().optional().describe("\u6709\u52B9/\u7121\u52B9")
|
|
1017
|
+
}, async ({ cron_id, ...data }) => callApi(() => {
|
|
1018
|
+
const update = Object.fromEntries(Object.entries(data).filter(([, value]) => value !== void 0));
|
|
1019
|
+
if (Object.keys(update).length === 0) {
|
|
1020
|
+
throw new Error("\u66F4\u65B0\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
1021
|
+
}
|
|
1022
|
+
return client.updateCron(cron_id, update);
|
|
1023
|
+
}));
|
|
492
1024
|
server.tool(serverToolName(brand, "delete", "cron"), "Cron\u30B8\u30E7\u30D6\u3092\u524A\u9664", {
|
|
493
|
-
cron_id:
|
|
1025
|
+
cron_id: z2.string().describe("Cron\u306EID")
|
|
494
1026
|
}, async ({ cron_id }) => callApi(() => client.deleteCron(cron_id)));
|
|
495
1027
|
}
|
|
496
1028
|
|
|
497
1029
|
// ../core/dist/tools/server/ssh.js
|
|
498
|
-
import { z as
|
|
1030
|
+
import { z as z3 } from "zod";
|
|
499
1031
|
function registerSshTools(server, client, brand) {
|
|
500
1032
|
server.tool(serverToolName(brand, "get", "ssh"), "SSH\u8A2D\u5B9A\uFF08\u6709\u52B9/\u7121\u52B9\u3001\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u3001\u63A5\u7D9A\u60C5\u5831\uFF09\u3092\u53D6\u5F97", {}, async () => callApi(() => client.getSsh()));
|
|
501
1033
|
server.tool(serverToolName(brand, "update", "ssh"), "SSH\u8A2D\u5B9A\u3092\u5909\u66F4\uFF08\u6709\u52B9/\u7121\u52B9\u3001\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\uFF09", {
|
|
502
|
-
ssh_enabled:
|
|
503
|
-
abroad_access_restriction:
|
|
1034
|
+
ssh_enabled: z3.boolean().optional().describe("SSH\u63A5\u7D9A\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
1035
|
+
abroad_access_restriction: z3.boolean().optional().describe("\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u6709\u52B9/\u7121\u52B9")
|
|
504
1036
|
}, async (args) => callApi(() => client.updateSsh(args)));
|
|
505
1037
|
server.tool(serverToolName(brand, "list", "ssh_key"), "SSH\u516C\u958B\u9375\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listSshKey()));
|
|
506
1038
|
server.tool(serverToolName(brand, "add", "ssh_key"), "SSH\u516C\u958B\u9375\u3092\u767B\u9332\uFF08\u624B\u52D5\u767B\u9332\u307E\u305F\u306F\u30B5\u30FC\u30D0\u30FC\u5074\u3067\u9375\u30DA\u30A2\u81EA\u52D5\u751F\u6210\uFF09", {
|
|
507
|
-
label:
|
|
508
|
-
public_key:
|
|
509
|
-
generate:
|
|
510
|
-
passphrase:
|
|
1039
|
+
label: z3.string().describe("\u30E9\u30D9\u30EB"),
|
|
1040
|
+
public_key: z3.string().optional().describe("\u516C\u958B\u9375\uFF08\u624B\u52D5\u767B\u9332\u6642\u3002OpenSSH\u5F62\u5F0F\uFF09"),
|
|
1041
|
+
generate: z3.boolean().optional().describe("true\u3067\u30B5\u30FC\u30D0\u30FC\u5074\u3067\u9375\u30DA\u30A2\u3092\u81EA\u52D5\u751F\u6210\uFF08\u79D8\u5BC6\u9375\u304C\u8FD4\u5374\u3055\u308C\u308B\uFF09"),
|
|
1042
|
+
passphrase: z3.string().optional().describe("\u30D1\u30B9\u30D5\u30EC\u30FC\u30BA\uFF08\u81EA\u52D5\u751F\u6210\u6642\u30026\u301C32\u6587\u5B57\uFF09")
|
|
511
1043
|
}, async (args) => callApi(() => client.addSshKey(args)));
|
|
512
1044
|
server.tool(serverToolName(brand, "update", "ssh_key"), "SSH\u516C\u958B\u9375\u306E\u30E9\u30D9\u30EB\u3084\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u66F4\u65B0", {
|
|
513
|
-
key_id:
|
|
514
|
-
label:
|
|
515
|
-
status:
|
|
1045
|
+
key_id: z3.string().describe("\u516C\u958B\u9375ID"),
|
|
1046
|
+
label: z3.string().optional().describe("\u30E9\u30D9\u30EB"),
|
|
1047
|
+
status: z3.enum(["on", "off"]).optional().describe("\u30B9\u30C6\u30FC\u30BF\u30B9")
|
|
516
1048
|
}, async ({ key_id, ...data }) => callApi(() => client.updateSshKey(key_id, data)));
|
|
517
1049
|
server.tool(serverToolName(brand, "delete", "ssh_key"), "SSH\u516C\u958B\u9375\u3092\u524A\u9664", {
|
|
518
|
-
key_id:
|
|
1050
|
+
key_id: z3.string().describe("\u516C\u958B\u9375ID")
|
|
519
1051
|
}, async ({ key_id }) => callApi(() => client.deleteSshKey(key_id)));
|
|
520
1052
|
}
|
|
521
1053
|
|
|
522
1054
|
// ../core/dist/tools/server/wordpress.js
|
|
523
|
-
import { z as
|
|
1055
|
+
import { z as z4 } from "zod";
|
|
524
1056
|
function registerWordpressTools(server, client, brand) {
|
|
525
1057
|
server.tool(serverToolName(brand, "list", "wordpress"), "WordPress\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
526
|
-
domain:
|
|
1058
|
+
domain: z4.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
527
1059
|
}, async (args) => {
|
|
528
1060
|
const params = {};
|
|
529
1061
|
if (args.domain)
|
|
@@ -531,28 +1063,28 @@ function registerWordpressTools(server, client, brand) {
|
|
|
531
1063
|
return callApi(() => client.listWordpress(params));
|
|
532
1064
|
});
|
|
533
1065
|
server.tool(serverToolName(brand, "add", "wordpress"), "WordPress\u3092\u65B0\u898F\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
534
|
-
url:
|
|
535
|
-
title:
|
|
536
|
-
admin_username:
|
|
537
|
-
admin_password:
|
|
538
|
-
admin_email:
|
|
539
|
-
memo:
|
|
1066
|
+
url: z4.string().describe("\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148URL\uFF08\u4F8B: https://example.com/blog\uFF09"),
|
|
1067
|
+
title: z4.string().describe("\u30B5\u30A4\u30C8\u30BF\u30A4\u30C8\u30EB"),
|
|
1068
|
+
admin_username: z4.string().describe("\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1069
|
+
admin_password: z4.string().describe("\u7BA1\u7406\u8005\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1070
|
+
admin_email: z4.string().describe("\u7BA1\u7406\u8005\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1071
|
+
memo: z4.string().optional().describe("\u30E1\u30E2")
|
|
540
1072
|
}, async (args) => callApi(() => client.addWordpress(args)));
|
|
541
1073
|
server.tool(serverToolName(brand, "update", "wordpress"), "WordPress\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
542
|
-
wp_id:
|
|
543
|
-
memo:
|
|
1074
|
+
wp_id: z4.string().describe("WordPress\u306EID"),
|
|
1075
|
+
memo: z4.string().optional().describe("\u30E1\u30E2")
|
|
544
1076
|
}, async ({ wp_id, ...data }) => callApi(() => client.updateWordpress(wp_id, data)));
|
|
545
1077
|
server.tool(serverToolName(brand, "delete", "wordpress"), "WordPress\u3092\u30A2\u30F3\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
546
|
-
wp_id:
|
|
547
|
-
delete_db:
|
|
1078
|
+
wp_id: z4.string().describe("WordPress\u306EID"),
|
|
1079
|
+
delete_db: z4.boolean().optional().describe("\u95A2\u9023\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3082\u524A\u9664\u3059\u308B\u304B")
|
|
548
1080
|
}, async ({ wp_id, ...data }) => callApi(() => client.deleteWordpress(wp_id, data)));
|
|
549
1081
|
}
|
|
550
1082
|
|
|
551
1083
|
// ../core/dist/tools/server/mail.js
|
|
552
|
-
import { z as
|
|
1084
|
+
import { z as z5 } from "zod";
|
|
553
1085
|
function registerMailTools(server, client, brand) {
|
|
554
1086
|
server.tool(serverToolName(brand, "list", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
555
|
-
domain:
|
|
1087
|
+
domain: z5.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
556
1088
|
}, async (args) => {
|
|
557
1089
|
const params = {};
|
|
558
1090
|
if (args.domain)
|
|
@@ -560,33 +1092,33 @@ function registerMailTools(server, client, brand) {
|
|
|
560
1092
|
return callApi(() => client.listMail(params));
|
|
561
1093
|
});
|
|
562
1094
|
server.tool(serverToolName(brand, "get", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u8A73\u7D30\uFF08\u5BB9\u91CF\u7B49\uFF09\u3092\u53D6\u5F97", {
|
|
563
|
-
mail_account:
|
|
1095
|
+
mail_account: z5.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
564
1096
|
}, async ({ mail_account }) => callApi(() => client.getMail(mail_account)));
|
|
565
1097
|
server.tool(serverToolName(brand, "add", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u4F5C\u6210", {
|
|
566
|
-
mail_address:
|
|
567
|
-
password:
|
|
568
|
-
quota_mb:
|
|
569
|
-
memo:
|
|
1098
|
+
mail_address: z5.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08user@domain \u5F62\u5F0F\uFF09"),
|
|
1099
|
+
password: z5.string().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1100
|
+
quota_mb: z5.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\uFF09"),
|
|
1101
|
+
memo: z5.string().optional().describe("\u30E1\u30E2")
|
|
570
1102
|
}, async (args) => callApi(() => client.addMail(args)));
|
|
571
1103
|
server.tool(serverToolName(brand, "update", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u66F4\u65B0", {
|
|
572
|
-
mail_account:
|
|
573
|
-
password:
|
|
574
|
-
quota_mb:
|
|
575
|
-
memo:
|
|
1104
|
+
mail_account: z5.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1105
|
+
password: z5.string().optional().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1106
|
+
quota_mb: z5.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\uFF09"),
|
|
1107
|
+
memo: z5.string().optional().describe("\u30E1\u30E2")
|
|
576
1108
|
}, async ({ mail_account, ...data }) => callApi(() => client.updateMail(mail_account, data)));
|
|
577
1109
|
server.tool(serverToolName(brand, "delete", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u524A\u9664", {
|
|
578
|
-
mail_account:
|
|
1110
|
+
mail_account: z5.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
579
1111
|
}, async ({ mail_account }) => callApi(() => client.deleteMail(mail_account)));
|
|
580
1112
|
server.tool(serverToolName(brand, "get", "mail_forwarding"), "\u30E1\u30FC\u30EB\u8EE2\u9001\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
581
|
-
mail_account:
|
|
1113
|
+
mail_account: z5.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
582
1114
|
}, async ({ mail_account }) => callApi(() => client.getMailForwarding(mail_account)));
|
|
583
1115
|
server.tool(serverToolName(brand, "update", "mail_forwarding"), "\u30E1\u30FC\u30EB\u8EE2\u9001\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
584
|
-
mail_account:
|
|
585
|
-
forwarding_addresses:
|
|
586
|
-
keep_in_mailbox:
|
|
1116
|
+
mail_account: z5.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1117
|
+
forwarding_addresses: z5.array(z5.string()).describe("\u8EE2\u9001\u5148\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306E\u914D\u5217"),
|
|
1118
|
+
keep_in_mailbox: z5.boolean().optional().describe("\u30E1\u30FC\u30EB\u30DC\u30C3\u30AF\u30B9\u306B\u3082\u6B8B\u3059\u304B")
|
|
587
1119
|
}, async ({ mail_account, ...data }) => callApi(() => client.updateMailForwarding(mail_account, data)));
|
|
588
1120
|
server.tool(serverToolName(brand, "list", "mail_filter"), "\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
589
|
-
domain:
|
|
1121
|
+
domain: z5.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
590
1122
|
}, async (args) => {
|
|
591
1123
|
const params = {};
|
|
592
1124
|
if (args.domain)
|
|
@@ -594,29 +1126,29 @@ function registerMailTools(server, client, brand) {
|
|
|
594
1126
|
return callApi(() => client.listMailFilter(params));
|
|
595
1127
|
});
|
|
596
1128
|
server.tool(serverToolName(brand, "add", "mail_filter"), "\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0", {
|
|
597
|
-
domain:
|
|
598
|
-
conditions:
|
|
599
|
-
keyword:
|
|
600
|
-
field:
|
|
601
|
-
match_type:
|
|
1129
|
+
domain: z5.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1130
|
+
conditions: z5.array(z5.object({
|
|
1131
|
+
keyword: z5.string(),
|
|
1132
|
+
field: z5.string(),
|
|
1133
|
+
match_type: z5.string()
|
|
602
1134
|
})).describe("\u6761\u4EF6"),
|
|
603
|
-
action:
|
|
604
|
-
type:
|
|
605
|
-
target:
|
|
606
|
-
method:
|
|
1135
|
+
action: z5.object({
|
|
1136
|
+
type: z5.string(),
|
|
1137
|
+
target: z5.string(),
|
|
1138
|
+
method: z5.string()
|
|
607
1139
|
}).describe("\u30A2\u30AF\u30B7\u30E7\u30F3")
|
|
608
1140
|
}, async (args) => callApi(() => client.addMailFilter(args)));
|
|
609
1141
|
server.tool(serverToolName(brand, "delete", "mail_filter"), "\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u30EB\u30FC\u30EB\u3092\u524A\u9664", {
|
|
610
|
-
filter_id:
|
|
1142
|
+
filter_id: z5.string().describe("\u30D5\u30A3\u30EB\u30BF\u30FCID")
|
|
611
1143
|
}, async ({ filter_id }) => callApi(() => client.deleteMailFilter(filter_id)));
|
|
612
1144
|
}
|
|
613
1145
|
|
|
614
1146
|
// ../core/dist/tools/server/auto-reply.js
|
|
615
|
-
import { z as
|
|
1147
|
+
import { z as z6 } from "zod";
|
|
616
1148
|
var PARTIAL_UPDATE_EMPTY_MESSAGE = "\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";
|
|
617
1149
|
function registerAutoReplyTools(server, client, brand) {
|
|
618
1150
|
server.tool(serverToolName(brand, "list", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
619
|
-
domain:
|
|
1151
|
+
domain: z6.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
620
1152
|
}, async (args) => {
|
|
621
1153
|
const params = {};
|
|
622
1154
|
if (args.domain)
|
|
@@ -624,30 +1156,30 @@ function registerAutoReplyTools(server, client, brand) {
|
|
|
624
1156
|
return callApi(() => client.listAutoReply(params));
|
|
625
1157
|
});
|
|
626
1158
|
server.tool(serverToolName(brand, "get", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u306E\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
627
|
-
mail_address:
|
|
1159
|
+
mail_address: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
628
1160
|
}, async ({ mail_address }) => callApi(() => client.getAutoReply(mail_address)));
|
|
629
1161
|
server.tool(serverToolName(brand, "add", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
630
|
-
domain:
|
|
631
|
-
mail_address:
|
|
632
|
-
from_name:
|
|
633
|
-
subject:
|
|
634
|
-
body:
|
|
635
|
-
quote_incoming:
|
|
1162
|
+
domain: z6.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1163
|
+
mail_address: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1164
|
+
from_name: z6.string().describe("\u9001\u4FE1\u8005\u540D"),
|
|
1165
|
+
subject: z6.string().describe("\u4EF6\u540D"),
|
|
1166
|
+
body: z6.string().describe("\u672C\u6587"),
|
|
1167
|
+
quote_incoming: z6.boolean().describe("\u53D7\u4FE1\u30E1\u30FC\u30EB\u306E\u5F15\u7528\u3092\u542B\u3081\u308B\u304B")
|
|
636
1168
|
}, async (args) => callApi(() => client.addAutoReply(args)));
|
|
637
1169
|
server.tool(serverToolName(brand, "update", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09", {
|
|
638
|
-
mail_address:
|
|
639
|
-
from_name:
|
|
640
|
-
subject:
|
|
641
|
-
body:
|
|
642
|
-
quote_incoming:
|
|
643
|
-
}, async ({ mail_address, from_name, subject, body, quote_incoming }) => {
|
|
1170
|
+
mail_address: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1171
|
+
from_name: z6.string().optional().describe("\u9001\u4FE1\u8005\u540D"),
|
|
1172
|
+
subject: z6.string().optional().describe("\u4EF6\u540D"),
|
|
1173
|
+
body: z6.string().optional().describe("\u672C\u6587"),
|
|
1174
|
+
quote_incoming: z6.boolean().optional().describe("\u53D7\u4FE1\u30E1\u30FC\u30EB\u306E\u5F15\u7528\u3092\u542B\u3081\u308B\u304B")
|
|
1175
|
+
}, async ({ mail_address, from_name, subject, body: body2, quote_incoming }) => {
|
|
644
1176
|
const data = {};
|
|
645
1177
|
if (from_name !== void 0)
|
|
646
1178
|
data.from_name = from_name;
|
|
647
1179
|
if (subject !== void 0)
|
|
648
1180
|
data.subject = subject;
|
|
649
|
-
if (
|
|
650
|
-
data.body =
|
|
1181
|
+
if (body2 !== void 0)
|
|
1182
|
+
data.body = body2;
|
|
651
1183
|
if (quote_incoming !== void 0)
|
|
652
1184
|
data.quote_incoming = quote_incoming;
|
|
653
1185
|
if (Object.keys(data).length === 0) {
|
|
@@ -656,15 +1188,15 @@ function registerAutoReplyTools(server, client, brand) {
|
|
|
656
1188
|
return callApi(() => client.updateAutoReply(mail_address, data));
|
|
657
1189
|
});
|
|
658
1190
|
server.tool(serverToolName(brand, "delete", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
659
|
-
mail_address:
|
|
1191
|
+
mail_address: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
660
1192
|
}, async ({ mail_address }) => callApi(() => client.deleteAutoReply(mail_address)));
|
|
661
1193
|
}
|
|
662
1194
|
|
|
663
1195
|
// ../core/dist/tools/server/smtp-abroad-restriction.js
|
|
664
|
-
import { z as
|
|
1196
|
+
import { z as z7 } from "zod";
|
|
665
1197
|
function registerSmtpAbroadRestrictionTools(server, client, brand) {
|
|
666
1198
|
server.tool(serverToolName(brand, "list", "smtp_abroad_restriction"), "SMTP\u8A8D\u8A3C\u306E\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
667
|
-
domain:
|
|
1199
|
+
domain: z7.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
668
1200
|
}, async (args) => {
|
|
669
1201
|
const params = {};
|
|
670
1202
|
if (args.domain)
|
|
@@ -672,16 +1204,16 @@ function registerSmtpAbroadRestrictionTools(server, client, brand) {
|
|
|
672
1204
|
return callApi(() => client.listSmtpAbroadRestriction(params));
|
|
673
1205
|
});
|
|
674
1206
|
server.tool(serverToolName(brand, "update", "smtp_abroad_restriction"), "SMTP\u8A8D\u8A3C\u306E\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
675
|
-
domain:
|
|
676
|
-
abroad_access_restriction:
|
|
677
|
-
}, async ({ domain, abroad_access_restriction }) => callApi(() => client.updateSmtpAbroadRestriction(
|
|
1207
|
+
domain: z7.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1208
|
+
abroad_access_restriction: z7.boolean().describe("\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u6709\u52B9/\u7121\u52B9")
|
|
1209
|
+
}, async ({ domain: domain2, abroad_access_restriction }) => callApi(() => client.updateSmtpAbroadRestriction(domain2, { abroad_access_restriction })));
|
|
678
1210
|
}
|
|
679
1211
|
|
|
680
1212
|
// ../core/dist/tools/server/dkim.js
|
|
681
|
-
import { z as
|
|
1213
|
+
import { z as z8 } from "zod";
|
|
682
1214
|
function registerDkimTools(server, client, brand) {
|
|
683
1215
|
server.tool(serverToolName(brand, "list", "dkim"), "DKIM\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
684
|
-
domain:
|
|
1216
|
+
domain: z8.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
685
1217
|
}, async (args) => {
|
|
686
1218
|
const params = {};
|
|
687
1219
|
if (args.domain)
|
|
@@ -689,20 +1221,20 @@ function registerDkimTools(server, client, brand) {
|
|
|
689
1221
|
return callApi(() => client.listDkim(params));
|
|
690
1222
|
});
|
|
691
1223
|
server.tool(serverToolName(brand, "get", "dkim"), "DKIM\u8A2D\u5B9A\u306E\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
692
|
-
fqdn:
|
|
1224
|
+
fqdn: z8.string().describe("FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09")
|
|
693
1225
|
}, async ({ fqdn }) => callApi(() => client.getDkim(fqdn)));
|
|
694
1226
|
server.tool(serverToolName(brand, "update", "dkim"), "DKIM\u8A2D\u5B9A\u306E\u6709\u52B9/\u7121\u52B9\u3092\u5207\u308A\u66FF\u3048", {
|
|
695
|
-
fqdn:
|
|
696
|
-
enabled:
|
|
1227
|
+
fqdn: z8.string().describe("FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09"),
|
|
1228
|
+
enabled: z8.boolean().describe("DKIM\u306E\u6709\u52B9/\u7121\u52B9")
|
|
697
1229
|
}, async ({ fqdn, enabled }) => callApi(() => client.updateDkim(fqdn, { enabled })));
|
|
698
1230
|
}
|
|
699
1231
|
|
|
700
1232
|
// ../core/dist/tools/server/dmarc.js
|
|
701
|
-
import { z as
|
|
1233
|
+
import { z as z9 } from "zod";
|
|
702
1234
|
var PARTIAL_UPDATE_EMPTY_MESSAGE2 = "\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";
|
|
703
1235
|
function registerDmarcTools(server, client, brand) {
|
|
704
1236
|
server.tool(serverToolName(brand, "list", "dmarc"), "\u9001\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
705
|
-
domain:
|
|
1237
|
+
domain: z9.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
706
1238
|
}, async (args) => {
|
|
707
1239
|
const params = {};
|
|
708
1240
|
if (args.domain)
|
|
@@ -710,11 +1242,11 @@ function registerDmarcTools(server, client, brand) {
|
|
|
710
1242
|
return callApi(() => client.listDmarc(params));
|
|
711
1243
|
});
|
|
712
1244
|
server.tool(serverToolName(brand, "update", "dmarc"), "\u9001\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09", {
|
|
713
|
-
domain:
|
|
714
|
-
policy:
|
|
715
|
-
report_enabled:
|
|
716
|
-
notification_mail_addresses:
|
|
717
|
-
}, async ({ domain, policy, report_enabled, notification_mail_addresses }) => {
|
|
1245
|
+
domain: z9.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1246
|
+
policy: z9.enum(["none", "quarantine", "reject"]).optional().describe("DMARC\u30DD\u30EA\u30B7\u30FC"),
|
|
1247
|
+
report_enabled: z9.boolean().optional().describe("\u30EC\u30DD\u30FC\u30C8\u901A\u77E5\u306E\u6709\u52B9/\u7121\u52B9\u3002false \u306E\u3068\u304D\u901A\u77E5\u5148\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u81EA\u52D5\u7684\u306B\u7A7A\u306B\u306A\u308B"),
|
|
1248
|
+
notification_mail_addresses: z9.array(z9.string()).optional().describe("\u30EC\u30DD\u30FC\u30C8\u901A\u77E5\u5148\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3002report_enabled \u304C true \u306E\u3068\u304D\u306F1\u4EF6\u4EE5\u4E0A\u5FC5\u9808")
|
|
1249
|
+
}, async ({ domain: domain2, policy, report_enabled, notification_mail_addresses }) => {
|
|
718
1250
|
const data = {};
|
|
719
1251
|
if (policy !== void 0)
|
|
720
1252
|
data.policy = policy;
|
|
@@ -726,16 +1258,16 @@ function registerDmarcTools(server, client, brand) {
|
|
|
726
1258
|
if (Object.keys(data).length === 0) {
|
|
727
1259
|
throw new Error(PARTIAL_UPDATE_EMPTY_MESSAGE2);
|
|
728
1260
|
}
|
|
729
|
-
return callApi(() => client.updateDmarc(
|
|
1261
|
+
return callApi(() => client.updateDmarc(domain2, data));
|
|
730
1262
|
});
|
|
731
1263
|
}
|
|
732
1264
|
|
|
733
1265
|
// ../core/dist/tools/server/spf.js
|
|
734
|
-
import { z as
|
|
735
|
-
var updateActionSchema =
|
|
1266
|
+
import { z as z10 } from "zod";
|
|
1267
|
+
var updateActionSchema = z10.enum(["reset", "enable_gmail", "custom"]);
|
|
736
1268
|
function registerSpfTools(server, client, brand) {
|
|
737
1269
|
server.tool(serverToolName(brand, "list", "spf"), "SPF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
738
|
-
domain:
|
|
1270
|
+
domain: z10.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
739
1271
|
}, async (args) => {
|
|
740
1272
|
const params = {};
|
|
741
1273
|
if (args.domain)
|
|
@@ -743,36 +1275,36 @@ function registerSpfTools(server, client, brand) {
|
|
|
743
1275
|
return callApi(() => client.listSpf(params));
|
|
744
1276
|
});
|
|
745
1277
|
server.tool(serverToolName(brand, "add", "spf"), "SPF\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
746
|
-
fqdn:
|
|
1278
|
+
fqdn: z10.string().describe("FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09")
|
|
747
1279
|
}, async ({ fqdn }) => callApi(() => client.addSpf({ fqdn })));
|
|
748
1280
|
server.tool(serverToolName(brand, "update", "spf"), "SPF\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
749
|
-
fqdn:
|
|
1281
|
+
fqdn: z10.string().describe("FQDN"),
|
|
750
1282
|
action: updateActionSchema.describe("reset: \u6A19\u6E96SPF\u3078\u521D\u671F\u5316 / enable_gmail: Gmail\u8A31\u53EFON / custom: \u30AB\u30B9\u30BF\u30E0\u8A2D\u5B9A"),
|
|
751
|
-
spf_record:
|
|
1283
|
+
spf_record: z10.string().optional().describe("\u30AB\u30B9\u30BF\u30E0SPF\u30EC\u30B3\u30FC\u30C9\uFF08action=custom \u306E\u3068\u304D\u5FC5\u9808\uFF09")
|
|
752
1284
|
}, async ({ fqdn, action, spf_record }) => {
|
|
753
|
-
const
|
|
1285
|
+
const body2 = { action };
|
|
754
1286
|
if (action === "custom") {
|
|
755
1287
|
if (spf_record === void 0 || spf_record === "") {
|
|
756
1288
|
throw new Error("action=custom \u306E\u3068\u304D\u306F spf_record \u304C\u5FC5\u9808\u3067\u3059");
|
|
757
1289
|
}
|
|
758
|
-
|
|
1290
|
+
body2.spf_record = spf_record;
|
|
759
1291
|
}
|
|
760
|
-
return callApi(() => client.updateSpf(fqdn,
|
|
1292
|
+
return callApi(() => client.updateSpf(fqdn, body2));
|
|
761
1293
|
});
|
|
762
1294
|
server.tool(serverToolName(brand, "delete", "spf"), "SPF\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
763
|
-
fqdn:
|
|
1295
|
+
fqdn: z10.string().describe("FQDN")
|
|
764
1296
|
}, async ({ fqdn }) => callApi(() => client.deleteSpf(fqdn)));
|
|
765
1297
|
}
|
|
766
1298
|
|
|
767
1299
|
// ../core/dist/tools/server/spam-filter.js
|
|
768
|
-
import { z as
|
|
769
|
-
var filterTypeSchema =
|
|
770
|
-
var detectionActionSchema =
|
|
771
|
-
var spamLevelSchema =
|
|
1300
|
+
import { z as z11 } from "zod";
|
|
1301
|
+
var filterTypeSchema = z11.enum(["off", "standard", "cloudmark_authority"]);
|
|
1302
|
+
var detectionActionSchema = z11.enum(["inbox", "spam", "trash", "delete"]);
|
|
1303
|
+
var spamLevelSchema = z11.enum(["very_lenient", "lenient", "normal", "strict", "very_strict", "strictest"]);
|
|
772
1304
|
var PARTIAL_UPDATE_EMPTY_MESSAGE3 = "\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";
|
|
773
1305
|
function registerSpamFilterTools(server, client, brand) {
|
|
774
1306
|
server.tool(serverToolName(brand, "list", "spam_filter"), "\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
775
|
-
domain:
|
|
1307
|
+
domain: z11.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
776
1308
|
}, async (args) => {
|
|
777
1309
|
const params = {};
|
|
778
1310
|
if (args.domain)
|
|
@@ -780,16 +1312,16 @@ function registerSpamFilterTools(server, client, brand) {
|
|
|
780
1312
|
return callApi(() => client.listSpamFilter(params));
|
|
781
1313
|
});
|
|
782
1314
|
server.tool(serverToolName(brand, "update", "spam_filter"), "\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09", {
|
|
783
|
-
domain:
|
|
1315
|
+
domain: z11.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
784
1316
|
filter_type: filterTypeSchema.optional().describe("\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF"),
|
|
785
1317
|
detection_action: detectionActionSchema.optional().describe("\u691C\u77E5\u6642\u306E\u51E6\u7406\uFF08inbox / spam / trash / delete\uFF09"),
|
|
786
|
-
white_list:
|
|
787
|
-
black_list:
|
|
1318
|
+
white_list: z11.array(z11.string()).optional().describe("\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u7A7A\u914D\u5217\u3067\u30AF\u30EA\u30A2\uFF09"),
|
|
1319
|
+
black_list: z11.array(z11.string()).optional().describe("\u30D6\u30E9\u30C3\u30AF\u30EA\u30B9\u30C8\uFF08\u7A7A\u914D\u5217\u3067\u30AF\u30EA\u30A2\uFF09"),
|
|
788
1320
|
spam_level: spamLevelSchema.optional().describe("\u6A19\u6E96\u30B9\u30D1\u30E0\u30D5\u30A3\u30EB\u30BF\u5224\u5B9A\u57FA\u6E96"),
|
|
789
|
-
strict_non_japanese_subject:
|
|
790
|
-
strict_html_mail:
|
|
1321
|
+
strict_non_japanese_subject: z11.boolean().optional().describe("\u65E5\u672C\u8A9E\u3092\u542B\u307E\u306A\u3044\u4EF6\u540D\u306B\u5BFE\u3057\u3066\u5224\u5B9A\u3092\u53B3\u3057\u304F\u3059\u308B"),
|
|
1322
|
+
strict_html_mail: z11.boolean().optional().describe("HTML\u30E1\u30FC\u30EB\u306B\u5BFE\u3057\u3066\u5224\u5B9A\u3092\u53B3\u3057\u304F\u3059\u308B")
|
|
791
1323
|
}, async (args) => {
|
|
792
|
-
const { domain, ...fields } = args;
|
|
1324
|
+
const { domain: domain2, ...fields } = args;
|
|
793
1325
|
const data = {};
|
|
794
1326
|
if (fields.filter_type !== void 0)
|
|
795
1327
|
data.filter_type = fields.filter_type;
|
|
@@ -809,19 +1341,19 @@ function registerSpamFilterTools(server, client, brand) {
|
|
|
809
1341
|
if (Object.keys(data).length === 0) {
|
|
810
1342
|
throw new Error(PARTIAL_UPDATE_EMPTY_MESSAGE3);
|
|
811
1343
|
}
|
|
812
|
-
return callApi(() => client.updateSpamFilter(
|
|
1344
|
+
return callApi(() => client.updateSpamFilter(domain2, data));
|
|
813
1345
|
});
|
|
814
1346
|
server.tool(serverToolName(brand, "update", "spam_filter_dmarc_receiver"), "\u53D7\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
815
|
-
domain:
|
|
816
|
-
dmarc_receiver:
|
|
817
|
-
}, async ({ domain, dmarc_receiver }) => callApi(() => client.updateSpamFilterDmarcReceiver(
|
|
1347
|
+
domain: z11.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1348
|
+
dmarc_receiver: z11.boolean().describe("\u53D7\u4FE1\u5074DMARC\u8A2D\u5B9A")
|
|
1349
|
+
}, async ({ domain: domain2, dmarc_receiver }) => callApi(() => client.updateSpamFilterDmarcReceiver(domain2, { dmarc_receiver })));
|
|
818
1350
|
}
|
|
819
1351
|
|
|
820
1352
|
// ../core/dist/tools/server/ftp.js
|
|
821
|
-
import { z as
|
|
1353
|
+
import { z as z12 } from "zod";
|
|
822
1354
|
function registerFtpTools(server, client, brand) {
|
|
823
1355
|
server.tool(serverToolName(brand, "list", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
824
|
-
domain:
|
|
1356
|
+
domain: z12.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
825
1357
|
}, async (args) => {
|
|
826
1358
|
const params = {};
|
|
827
1359
|
if (args.domain)
|
|
@@ -829,87 +1361,87 @@ function registerFtpTools(server, client, brand) {
|
|
|
829
1361
|
return callApi(() => client.listFtp(params));
|
|
830
1362
|
});
|
|
831
1363
|
server.tool(serverToolName(brand, "add", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u8FFD\u52A0", {
|
|
832
|
-
ftp_account:
|
|
833
|
-
password:
|
|
834
|
-
directory:
|
|
835
|
-
quota_mb:
|
|
836
|
-
memo:
|
|
1364
|
+
ftp_account: z12.string().describe("FTP\u30A2\u30AB\u30A6\u30F3\u30C8\uFF08user@domain \u5F62\u5F0F\uFF09"),
|
|
1365
|
+
password: z12.string().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1366
|
+
directory: z12.string().optional().describe("\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"),
|
|
1367
|
+
quota_mb: z12.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\u30020\u3067\u7121\u5236\u9650\uFF09"),
|
|
1368
|
+
memo: z12.string().optional().describe("\u30E1\u30E2")
|
|
837
1369
|
}, async (args) => callApi(() => client.addFtp(args)));
|
|
838
1370
|
server.tool(serverToolName(brand, "update", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u66F4\u65B0", {
|
|
839
|
-
ftp_account:
|
|
840
|
-
password:
|
|
841
|
-
directory:
|
|
842
|
-
quota_mb:
|
|
843
|
-
memo:
|
|
1371
|
+
ftp_account: z12.string().describe("FTP\u30A2\u30AB\u30A6\u30F3\u30C8"),
|
|
1372
|
+
password: z12.string().optional().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1373
|
+
directory: z12.string().optional().describe("\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"),
|
|
1374
|
+
quota_mb: z12.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\uFF09"),
|
|
1375
|
+
memo: z12.string().optional().describe("\u30E1\u30E2")
|
|
844
1376
|
}, async ({ ftp_account, ...data }) => callApi(() => client.updateFtp(ftp_account, data)));
|
|
845
1377
|
server.tool(serverToolName(brand, "delete", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u524A\u9664", {
|
|
846
|
-
ftp_account:
|
|
1378
|
+
ftp_account: z12.string().describe("FTP\u30A2\u30AB\u30A6\u30F3\u30C8")
|
|
847
1379
|
}, async ({ ftp_account }) => callApi(() => client.deleteFtp(ftp_account)));
|
|
848
1380
|
}
|
|
849
1381
|
|
|
850
1382
|
// ../core/dist/tools/server/database.js
|
|
851
|
-
import { z as
|
|
1383
|
+
import { z as z13 } from "zod";
|
|
852
1384
|
function registerDatabaseTools(server, client, brand) {
|
|
853
1385
|
server.tool(serverToolName(brand, "list", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listDb()));
|
|
854
1386
|
server.tool(serverToolName(brand, "add", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210", {
|
|
855
|
-
name_suffix:
|
|
856
|
-
memo:
|
|
1387
|
+
name_suffix: z13.string().describe("DB\u540D\u306E\u30B5\u30D5\u30A3\u30C3\u30AF\u30B9\uFF08\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u306F\u81EA\u52D5\u4ED8\u4E0E\uFF09"),
|
|
1388
|
+
memo: z13.string().optional().describe("\u30E1\u30E2")
|
|
857
1389
|
}, async (args) => callApi(() => client.addDb(args)));
|
|
858
1390
|
server.tool(serverToolName(brand, "update", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
859
|
-
db_name:
|
|
860
|
-
memo:
|
|
1391
|
+
db_name: z13.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D"),
|
|
1392
|
+
memo: z13.string().optional().describe("\u30E1\u30E2")
|
|
861
1393
|
}, async ({ db_name, ...data }) => callApi(() => client.updateDb(db_name, data)));
|
|
862
1394
|
server.tool(serverToolName(brand, "delete", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u524A\u9664", {
|
|
863
|
-
db_name:
|
|
1395
|
+
db_name: z13.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D")
|
|
864
1396
|
}, async ({ db_name }) => callApi(() => client.deleteDb(db_name)));
|
|
865
1397
|
server.tool(serverToolName(brand, "list", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listDbUser()));
|
|
866
1398
|
server.tool(serverToolName(brand, "add", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u3092\u4F5C\u6210", {
|
|
867
|
-
name_suffix:
|
|
868
|
-
password:
|
|
869
|
-
memo:
|
|
1399
|
+
name_suffix: z13.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D\u306E\u30B5\u30D5\u30A3\u30C3\u30AF\u30B9"),
|
|
1400
|
+
password: z13.string().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1401
|
+
memo: z13.string().optional().describe("\u30E1\u30E2")
|
|
870
1402
|
}, async (args) => callApi(() => client.addDbUser(args)));
|
|
871
1403
|
server.tool(serverToolName(brand, "update", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u7B49\u3092\u5909\u66F4", {
|
|
872
|
-
db_user:
|
|
873
|
-
password:
|
|
874
|
-
memo:
|
|
1404
|
+
db_user: z13.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1405
|
+
password: z13.string().optional().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1406
|
+
memo: z13.string().optional().describe("\u30E1\u30E2")
|
|
875
1407
|
}, async ({ db_user, ...data }) => callApi(() => client.updateDbUser(db_user, data)));
|
|
876
1408
|
server.tool(serverToolName(brand, "delete", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u3092\u524A\u9664", {
|
|
877
|
-
db_user:
|
|
1409
|
+
db_user: z13.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D")
|
|
878
1410
|
}, async ({ db_user }) => callApi(() => client.deleteDbUser(db_user)));
|
|
879
1411
|
server.tool(serverToolName(brand, "list", "db_user_grant"), "MySQL \u30E6\u30FC\u30B6\u30FC\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u6A29\u9650\u3092\u53D6\u5F97", {
|
|
880
|
-
db_user:
|
|
1412
|
+
db_user: z13.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D")
|
|
881
1413
|
}, async ({ db_user }) => callApi(() => client.listDbUserGrant(db_user)));
|
|
882
1414
|
server.tool(serverToolName(brand, "add", "db_user_grant"), "MySQL \u30E6\u30FC\u30B6\u30FC\u306B\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u6A29\u9650\u3092\u4ED8\u4E0E", {
|
|
883
|
-
db_user:
|
|
884
|
-
db_name:
|
|
1415
|
+
db_user: z13.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1416
|
+
db_name: z13.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D")
|
|
885
1417
|
}, async ({ db_user, ...data }) => callApi(() => client.addDbUserGrant(db_user, data)));
|
|
886
1418
|
server.tool(serverToolName(brand, "delete", "db_user_grant"), "MySQL \u30E6\u30FC\u30B6\u30FC\u304B\u3089\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u6A29\u9650\u3092\u524A\u9664", {
|
|
887
|
-
db_user:
|
|
888
|
-
db_name:
|
|
1419
|
+
db_user: z13.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1420
|
+
db_name: z13.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D")
|
|
889
1421
|
}, async ({ db_user, ...data }) => callApi(() => client.deleteDbUserGrant(db_user, data)));
|
|
890
1422
|
}
|
|
891
1423
|
|
|
892
1424
|
// ../core/dist/tools/server/domain.js
|
|
893
|
-
import { z as
|
|
1425
|
+
import { z as z14 } from "zod";
|
|
894
1426
|
function registerDomainTools(server, client, brand) {
|
|
895
1427
|
server.tool(serverToolName(brand, "list", "domain"), "\u30C9\u30E1\u30A4\u30F3\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listDomain()));
|
|
896
1428
|
server.tool(serverToolName(brand, "get", "domain"), "\u30C9\u30E1\u30A4\u30F3\u306E\u8A73\u7D30\u60C5\u5831\u3092\u53D6\u5F97", {
|
|
897
|
-
domain:
|
|
898
|
-
}, async ({ domain }) => callApi(() => client.getDomain(
|
|
1429
|
+
domain: z14.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D")
|
|
1430
|
+
}, async ({ domain: domain2 }) => callApi(() => client.getDomain(domain2)));
|
|
899
1431
|
server.tool(serverToolName(brand, "add", "domain"), "\u30C9\u30E1\u30A4\u30F3\u3092\u8FFD\u52A0", {
|
|
900
|
-
domain:
|
|
901
|
-
ssl:
|
|
902
|
-
memo:
|
|
1432
|
+
domain: z14.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D"),
|
|
1433
|
+
ssl: z14.boolean().optional().describe("\u7121\u6599SSL\u8A2D\u5B9A\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8: true\uFF09"),
|
|
1434
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
903
1435
|
}, async (args) => callApi(() => client.addDomain(args)));
|
|
904
1436
|
server.tool(serverToolName(brand, "update", "domain"), "\u30C9\u30E1\u30A4\u30F3\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
905
|
-
domain:
|
|
906
|
-
memo:
|
|
907
|
-
}, async ({ domain, ...data }) => callApi(() => client.updateDomain(
|
|
1437
|
+
domain: z14.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D"),
|
|
1438
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
1439
|
+
}, async ({ domain: domain2, ...data }) => callApi(() => client.updateDomain(domain2, data)));
|
|
908
1440
|
server.tool(serverToolName(brand, "delete", "domain"), "\u30C9\u30E1\u30A4\u30F3\u3092\u524A\u9664", {
|
|
909
|
-
domain:
|
|
910
|
-
}, async ({ domain }) => callApi(() => client.deleteDomain(
|
|
1441
|
+
domain: z14.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D")
|
|
1442
|
+
}, async ({ domain: domain2 }) => callApi(() => client.deleteDomain(domain2)));
|
|
911
1443
|
server.tool(serverToolName(brand, "list", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
912
|
-
domain:
|
|
1444
|
+
domain: z14.string().optional().describe("\u89AA\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
913
1445
|
}, async (args) => {
|
|
914
1446
|
const params = {};
|
|
915
1447
|
if (args.domain)
|
|
@@ -917,26 +1449,26 @@ function registerDomainTools(server, client, brand) {
|
|
|
917
1449
|
return callApi(() => client.listSubdomain(params));
|
|
918
1450
|
});
|
|
919
1451
|
server.tool(serverToolName(brand, "add", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u3092\u8FFD\u52A0", {
|
|
920
|
-
subdomain:
|
|
921
|
-
document_root_type:
|
|
922
|
-
ssl:
|
|
923
|
-
memo:
|
|
1452
|
+
subdomain: z14.string().describe("\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF08\u4F8B: blog.example.com\uFF09"),
|
|
1453
|
+
document_root_type: z14.enum(["subdomain_only", "full_subdomain"]).optional().describe("\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30EB\u30FC\u30C8\u7A2E\u5225\uFF08subdomain_only: /public_html/sub, full_subdomain: /public_html/sub.example.com\uFF09"),
|
|
1454
|
+
ssl: z14.boolean().optional().describe("\u7121\u6599SSL\u8A2D\u5B9A\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8: true\uFF09"),
|
|
1455
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
924
1456
|
}, async (args) => callApi(() => client.addSubdomain(args)));
|
|
925
1457
|
server.tool(serverToolName(brand, "update", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
926
|
-
subdomain:
|
|
927
|
-
memo:
|
|
1458
|
+
subdomain: z14.string().describe("\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3"),
|
|
1459
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
928
1460
|
}, async ({ subdomain, ...data }) => callApi(() => client.updateSubdomain(subdomain, data)));
|
|
929
1461
|
server.tool(serverToolName(brand, "delete", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u3092\u524A\u9664", {
|
|
930
|
-
subdomain:
|
|
931
|
-
delete_files:
|
|
1462
|
+
subdomain: z14.string().describe("\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3"),
|
|
1463
|
+
delete_files: z14.boolean().optional().describe("\u95A2\u9023\u30D5\u30A1\u30A4\u30EB\u3082\u524A\u9664\u3059\u308B\u304B")
|
|
932
1464
|
}, async ({ subdomain, ...data }) => callApi(() => client.deleteSubdomain(subdomain, data)));
|
|
933
1465
|
}
|
|
934
1466
|
|
|
935
1467
|
// ../core/dist/tools/server/ssl-dns.js
|
|
936
|
-
import { z as
|
|
1468
|
+
import { z as z15 } from "zod";
|
|
937
1469
|
function registerSslDnsTools(server, client, brand) {
|
|
938
1470
|
server.tool(serverToolName(brand, "list", "ssl"), "SSL\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
939
|
-
domain:
|
|
1471
|
+
domain: z15.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
940
1472
|
}, async (args) => {
|
|
941
1473
|
const params = {};
|
|
942
1474
|
if (args.domain)
|
|
@@ -944,13 +1476,13 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
944
1476
|
return callApi(() => client.listSsl(params));
|
|
945
1477
|
});
|
|
946
1478
|
server.tool(serverToolName(brand, "install", "ssl"), "\u7121\u6599SSL\uFF08Let's Encrypt\uFF09\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
947
|
-
common_name:
|
|
1479
|
+
common_name: z15.string().describe("\u30B3\u30E2\u30F3\u30CD\u30FC\u30E0\uFF08\u30C9\u30E1\u30A4\u30F3\u540D\uFF09")
|
|
948
1480
|
}, async (args) => callApi(() => client.installSsl(args)));
|
|
949
1481
|
server.tool(serverToolName(brand, "uninstall", "ssl"), "\u7121\u6599SSL\u3092\u30A2\u30F3\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
950
|
-
common_name:
|
|
1482
|
+
common_name: z15.string().describe("\u30B3\u30E2\u30F3\u30CD\u30FC\u30E0\uFF08\u30C9\u30E1\u30A4\u30F3\u540D\uFF09")
|
|
951
1483
|
}, async ({ common_name }) => callApi(() => client.uninstallSsl(common_name)));
|
|
952
1484
|
server.tool(serverToolName(brand, "list", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
953
|
-
domain:
|
|
1485
|
+
domain: z15.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
954
1486
|
}, async (args) => {
|
|
955
1487
|
const params = {};
|
|
956
1488
|
if (args.domain)
|
|
@@ -958,35 +1490,35 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
958
1490
|
return callApi(() => client.listDns(params));
|
|
959
1491
|
});
|
|
960
1492
|
server.tool(serverToolName(brand, "add", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u3092\u8FFD\u52A0", {
|
|
961
|
-
domain:
|
|
962
|
-
host:
|
|
963
|
-
type:
|
|
964
|
-
content:
|
|
965
|
-
ttl:
|
|
966
|
-
priority:
|
|
1493
|
+
domain: z15.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1494
|
+
host: z15.string().describe("\u30DB\u30B9\u30C8\u540D\uFF08@\u3067apex\uFF09"),
|
|
1495
|
+
type: z15.string().describe("\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7\uFF08A / AAAA / CNAME / MX / TXT / SRV / CAA\uFF09"),
|
|
1496
|
+
content: z15.string().describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
1497
|
+
ttl: z15.number().optional().describe("TTL\uFF0860-86400\u3002\u30C7\u30D5\u30A9\u30EB\u30C8: 3600\uFF09"),
|
|
1498
|
+
priority: z15.number().optional().describe("\u512A\u5148\u5EA6\uFF08MX/SRV\u30EC\u30B3\u30FC\u30C9\u7528\uFF09")
|
|
967
1499
|
}, async (args) => callApi(() => client.addDns(args)));
|
|
968
1500
|
server.tool(serverToolName(brand, "update", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u3092\u66F4\u65B0", {
|
|
969
|
-
dns_id:
|
|
970
|
-
domain:
|
|
971
|
-
host:
|
|
972
|
-
type:
|
|
973
|
-
content:
|
|
974
|
-
ttl:
|
|
975
|
-
priority:
|
|
1501
|
+
dns_id: z15.string().describe("DNS\u30EC\u30B3\u30FC\u30C9ID"),
|
|
1502
|
+
domain: z15.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1503
|
+
host: z15.string().describe("\u30DB\u30B9\u30C8\u540D"),
|
|
1504
|
+
type: z15.string().describe("\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7"),
|
|
1505
|
+
content: z15.string().describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
1506
|
+
ttl: z15.number().optional().describe("TTL"),
|
|
1507
|
+
priority: z15.number().optional().describe("\u512A\u5148\u5EA6")
|
|
976
1508
|
}, async ({ dns_id, ...data }) => callApi(() => client.updateDns(dns_id, data)));
|
|
977
1509
|
server.tool(serverToolName(brand, "delete", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664", {
|
|
978
|
-
dns_id:
|
|
979
|
-
domain:
|
|
1510
|
+
dns_id: z15.string().describe("DNS\u30EC\u30B3\u30FC\u30C9ID"),
|
|
1511
|
+
domain: z15.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3")
|
|
980
1512
|
}, async ({ dns_id, ...data }) => callApi(() => client.deleteDns(dns_id, data)));
|
|
981
1513
|
server.tool(serverToolName(brand, "get", "php_version"), "PHP\u30D0\u30FC\u30B8\u30E7\u30F3\u8A2D\u5B9A\uFF08\u5229\u7528\u53EF\u80FD\u30D0\u30FC\u30B8\u30E7\u30F3\u30FB\u30C9\u30E1\u30A4\u30F3\u5225\u306E\u73FE\u5728\u30D0\u30FC\u30B8\u30E7\u30F3\uFF09\u3092\u53D6\u5F97", {}, async () => callApi(() => client.getPhpVersion()));
|
|
982
1514
|
server.tool(serverToolName(brand, "update", "php_version"), "\u30C9\u30E1\u30A4\u30F3\u306EPHP\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5909\u66F4", {
|
|
983
|
-
domain:
|
|
984
|
-
version:
|
|
985
|
-
}, async ({ domain, ...data }) => callApi(() => client.updatePhpVersion(
|
|
1515
|
+
domain: z15.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D"),
|
|
1516
|
+
version: z15.string().describe("PHP\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u4F8B: 8.3.21\uFF09")
|
|
1517
|
+
}, async ({ domain: domain2, ...data }) => callApi(() => client.updatePhpVersion(domain2, data)));
|
|
986
1518
|
server.tool(serverToolName(brand, "get", "access_log"), "\u30A2\u30AF\u30BB\u30B9\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
987
|
-
domain:
|
|
988
|
-
lines:
|
|
989
|
-
keyword:
|
|
1519
|
+
domain: z15.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1520
|
+
lines: z15.number().optional().describe("\u53D6\u5F97\u884C\u6570\uFF08\u672B\u5C3E\u304B\u3089\uFF09"),
|
|
1521
|
+
keyword: z15.string().optional().describe("\u7D5E\u308A\u8FBC\u307F\u30AD\u30FC\u30EF\u30FC\u30C9")
|
|
990
1522
|
}, async (args) => {
|
|
991
1523
|
const params = {};
|
|
992
1524
|
if (args.domain)
|
|
@@ -998,9 +1530,9 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
998
1530
|
return callApi(() => client.getAccessLog(params));
|
|
999
1531
|
});
|
|
1000
1532
|
server.tool(serverToolName(brand, "get", "error_log"), "\u30A8\u30E9\u30FC\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
1001
|
-
domain:
|
|
1002
|
-
lines:
|
|
1003
|
-
keyword:
|
|
1533
|
+
domain: z15.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1534
|
+
lines: z15.number().optional().describe("\u53D6\u5F97\u884C\u6570\uFF08\u672B\u5C3E\u304B\u3089\uFF09"),
|
|
1535
|
+
keyword: z15.string().optional().describe("\u7D5E\u308A\u8FBC\u307F\u30AD\u30FC\u30EF\u30FC\u30C9")
|
|
1004
1536
|
}, async (args) => {
|
|
1005
1537
|
const params = {};
|
|
1006
1538
|
if (args.domain)
|
|
@@ -1013,59 +1545,1241 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
1013
1545
|
});
|
|
1014
1546
|
}
|
|
1015
1547
|
|
|
1548
|
+
// ../core/dist/tools/server/resource-monitor.js
|
|
1549
|
+
import { z as z16 } from "zod";
|
|
1550
|
+
function registerResourceMonitorTools(server, client, brand) {
|
|
1551
|
+
server.tool(serverToolName(brand, "get", "resource_monitor"), "\u6307\u5B9A\u65E5\u306ECPU\u30FB\u30E1\u30E2\u30EA\u30FB\u8EE2\u9001\u91CF\u6642\u7CFB\u5217\u3092\u53D6\u5F97", {
|
|
1552
|
+
date: z16.string().describe("\u5BFE\u8C61\u65E5\uFF08Y-m-d \u307E\u305F\u306F Ymd\u3002\u5F53\u65E5\u542B\u3080\u76F4\u8FD11\u304B\u6708\uFF09")
|
|
1553
|
+
}, async ({ date }) => callApi(() => client.getResourceMonitor(date)));
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
// ../core/dist/tools/server/waf.js
|
|
1557
|
+
import { z as z17 } from "zod";
|
|
1558
|
+
var PARTIAL_UPDATE_EMPTY_MESSAGE4 = "\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";
|
|
1559
|
+
function registerWafTools(server, client, brand) {
|
|
1560
|
+
server.tool(serverToolName(brand, "list", "waf"), "WAF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1561
|
+
domain: z17.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1562
|
+
}, async (args) => {
|
|
1563
|
+
const params = {};
|
|
1564
|
+
if (args.domain)
|
|
1565
|
+
params.domain = args.domain;
|
|
1566
|
+
return callApi(() => client.listWaf(params));
|
|
1567
|
+
});
|
|
1568
|
+
server.tool(serverToolName(brand, "update", "waf"), "WAF\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09", {
|
|
1569
|
+
domain: z17.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1570
|
+
xss_protection: z17.boolean().optional().describe("XSS\u5BFE\u7B56"),
|
|
1571
|
+
sql_injection_protection: z17.boolean().optional().describe("SQL\u5BFE\u7B56"),
|
|
1572
|
+
file_protection: z17.boolean().optional().describe("\u30D5\u30A1\u30A4\u30EB\u5BFE\u7B56"),
|
|
1573
|
+
mail_protection: z17.boolean().optional().describe("\u30E1\u30FC\u30EB\u5BFE\u7B56"),
|
|
1574
|
+
command_protection: z17.boolean().optional().describe("\u30B3\u30DE\u30F3\u30C9\u5BFE\u7B56"),
|
|
1575
|
+
php_protection: z17.boolean().optional().describe("PHP\u5BFE\u7B56")
|
|
1576
|
+
}, async (args) => {
|
|
1577
|
+
const { domain: domain2, ...fields } = args;
|
|
1578
|
+
const data = {};
|
|
1579
|
+
if (fields.xss_protection !== void 0)
|
|
1580
|
+
data.xss_protection = fields.xss_protection;
|
|
1581
|
+
if (fields.sql_injection_protection !== void 0)
|
|
1582
|
+
data.sql_injection_protection = fields.sql_injection_protection;
|
|
1583
|
+
if (fields.file_protection !== void 0)
|
|
1584
|
+
data.file_protection = fields.file_protection;
|
|
1585
|
+
if (fields.mail_protection !== void 0)
|
|
1586
|
+
data.mail_protection = fields.mail_protection;
|
|
1587
|
+
if (fields.command_protection !== void 0)
|
|
1588
|
+
data.command_protection = fields.command_protection;
|
|
1589
|
+
if (fields.php_protection !== void 0)
|
|
1590
|
+
data.php_protection = fields.php_protection;
|
|
1591
|
+
if (Object.keys(data).length === 0) {
|
|
1592
|
+
throw new Error(PARTIAL_UPDATE_EMPTY_MESSAGE4);
|
|
1593
|
+
}
|
|
1594
|
+
return callApi(() => client.updateWaf(domain2, data));
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
// ../core/dist/tools/server/php-ini.js
|
|
1599
|
+
import { z as z18 } from "zod";
|
|
1600
|
+
var PARTIAL_UPDATE_EMPTY_MESSAGE5 = "\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";
|
|
1601
|
+
var phpIniUpdateSchema = {
|
|
1602
|
+
domain: z18.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1603
|
+
display_errors: z18.string().optional().describe("\u30A8\u30E9\u30FC\u5185\u5BB9\u3092\u753B\u9762\u306B\u51FA\u529B\uFF08On / Off\uFF09"),
|
|
1604
|
+
error_reporting: z18.string().optional().describe("\u30A8\u30E9\u30FC\u51FA\u529B\u30EC\u30D9\u30EB"),
|
|
1605
|
+
display_startup_errors: z18.string().optional().describe("\u8D77\u52D5\u6642\u30A8\u30E9\u30FC\u3092\u8868\u793A\uFF08On / Off\uFF09"),
|
|
1606
|
+
"session.auto_start": z18.string().optional().describe("\u30BB\u30C3\u30B7\u30E7\u30F3\u81EA\u52D5\u958B\u59CB\uFF080 / 1\uFF09"),
|
|
1607
|
+
"session.name": z18.string().optional().describe("\u30BB\u30C3\u30B7\u30E7\u30F3\u540D"),
|
|
1608
|
+
"session.use_cookies": z18.string().optional().describe("\u30BB\u30C3\u30B7\u30E7\u30F3ID\u306B\u30AF\u30C3\u30AD\u30FC\u3092\u4F7F\u7528\uFF080 / 1\uFF09"),
|
|
1609
|
+
"session.use_only_cookies": z18.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u306E\u307F\u3067\u30BB\u30C3\u30B7\u30E7\u30F3ID\u3092\u4FDD\u5B58\uFF080 / 1\uFF09"),
|
|
1610
|
+
"session.use_trans_sid": z18.string().optional().describe("URL\u3078\u30BB\u30C3\u30B7\u30E7\u30F3ID\u3092\u81EA\u52D5\u8A2D\u5B9A\uFF080 / 1\uFF09"),
|
|
1611
|
+
"session.cookie_lifetime": z18.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u6709\u52B9\u671F\u9593\uFF08\u79D2\uFF09"),
|
|
1612
|
+
"session.cookie_path": z18.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30D1\u30B9"),
|
|
1613
|
+
"session.cookie_domain": z18.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30C9\u30E1\u30A4\u30F3"),
|
|
1614
|
+
"mbstring.language": z18.string().optional().describe("\u30C7\u30D5\u30A9\u30EB\u30C8\u8A00\u8A9E"),
|
|
1615
|
+
"mbstring.internal_encoding": z18.string().optional().describe("\u5185\u90E8\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0"),
|
|
1616
|
+
"mbstring.http_input": z18.string().optional().describe("HTTP\u5165\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB"),
|
|
1617
|
+
"mbstring.http_output": z18.string().optional().describe("HTTP\u51FA\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB"),
|
|
1618
|
+
"mbstring.encoding_translation": z18.string().optional().describe("\u5185\u90E8\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3078\u306E\u5909\u63DB\uFF08On / Off\uFF09"),
|
|
1619
|
+
"mbstring.detect_order": z18.string().optional().describe("\u6587\u5B57\u30B3\u30FC\u30C9\u691C\u51FA"),
|
|
1620
|
+
"mbstring.substitute_character": z18.string().optional().describe("\u7121\u52B9\u6587\u5B57\u306E\u4EE3\u66FF\u6587\u5B57"),
|
|
1621
|
+
max_execution_time: z18.string().optional().describe("\u6700\u5927\u5B9F\u884C\u6642\u9593\uFF08\u79D2\uFF09"),
|
|
1622
|
+
max_input_time: z18.string().optional().describe("\u5165\u529B\u30D1\u30FC\u30B9\u6700\u5927\u6642\u9593\uFF08\u79D2\uFF09"),
|
|
1623
|
+
memory_limit: z18.string().optional().describe("\u6700\u5927\u30E1\u30E2\u30EA"),
|
|
1624
|
+
post_max_size: z18.string().optional().describe("POST\u30C7\u30FC\u30BF\u6700\u5927\u30B5\u30A4\u30BA"),
|
|
1625
|
+
upload_max_filesize: z18.string().optional().describe("\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u30D5\u30A1\u30A4\u30EB\u6700\u5927\u30B5\u30A4\u30BA"),
|
|
1626
|
+
register_globals: z18.string().optional().describe("register_globals\uFF08On / Off\uFF09"),
|
|
1627
|
+
magic_quotes_gpc: z18.string().optional().describe("magic_quotes_gpc\uFF08On / Off\uFF09"),
|
|
1628
|
+
safe_mode: z18.string().optional().describe("safe_mode\uFF08On / Off\uFF09"),
|
|
1629
|
+
file_uploads: z18.string().optional().describe("HTTP\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\uFF08On / Off\uFF09"),
|
|
1630
|
+
allow_url_fopen: z18.string().optional().describe("allow_url_fopen\uFF08On / Off\uFF09"),
|
|
1631
|
+
allow_url_include: z18.string().optional().describe("allow_url_include\uFF08On / Off\uFF09")
|
|
1632
|
+
};
|
|
1633
|
+
var PHP_INI_API_KEYS = [
|
|
1634
|
+
"display_errors",
|
|
1635
|
+
"error_reporting",
|
|
1636
|
+
"display_startup_errors",
|
|
1637
|
+
"session.auto_start",
|
|
1638
|
+
"session.name",
|
|
1639
|
+
"session.use_cookies",
|
|
1640
|
+
"session.use_only_cookies",
|
|
1641
|
+
"session.use_trans_sid",
|
|
1642
|
+
"session.cookie_lifetime",
|
|
1643
|
+
"session.cookie_path",
|
|
1644
|
+
"session.cookie_domain",
|
|
1645
|
+
"mbstring.language",
|
|
1646
|
+
"mbstring.internal_encoding",
|
|
1647
|
+
"mbstring.http_input",
|
|
1648
|
+
"mbstring.http_output",
|
|
1649
|
+
"mbstring.encoding_translation",
|
|
1650
|
+
"mbstring.detect_order",
|
|
1651
|
+
"mbstring.substitute_character",
|
|
1652
|
+
"max_execution_time",
|
|
1653
|
+
"max_input_time",
|
|
1654
|
+
"memory_limit",
|
|
1655
|
+
"post_max_size",
|
|
1656
|
+
"upload_max_filesize",
|
|
1657
|
+
"register_globals",
|
|
1658
|
+
"magic_quotes_gpc",
|
|
1659
|
+
"safe_mode",
|
|
1660
|
+
"file_uploads",
|
|
1661
|
+
"allow_url_fopen",
|
|
1662
|
+
"allow_url_include"
|
|
1663
|
+
];
|
|
1664
|
+
function registerPhpIniTools(server, client, brand) {
|
|
1665
|
+
server.tool(serverToolName(brand, "list", "php_ini"), "php.ini\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
1666
|
+
domain: z18.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1667
|
+
}, async (args) => {
|
|
1668
|
+
const params = {};
|
|
1669
|
+
if (args.domain)
|
|
1670
|
+
params.domain = args.domain;
|
|
1671
|
+
return callApi(() => client.listPhpIni(params));
|
|
1672
|
+
});
|
|
1673
|
+
server.tool(serverToolName(brand, "update", "php_ini"), "php.ini\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09", phpIniUpdateSchema, async (args) => {
|
|
1674
|
+
const { domain: domain2, ...fields } = args;
|
|
1675
|
+
const data = {};
|
|
1676
|
+
for (const key of PHP_INI_API_KEYS) {
|
|
1677
|
+
const value = fields[key];
|
|
1678
|
+
if (value !== void 0)
|
|
1679
|
+
data[key] = value;
|
|
1680
|
+
}
|
|
1681
|
+
if (Object.keys(data).length === 0) {
|
|
1682
|
+
throw new Error(PARTIAL_UPDATE_EMPTY_MESSAGE5);
|
|
1683
|
+
}
|
|
1684
|
+
return callApi(() => client.updatePhpIni(domain2, data));
|
|
1685
|
+
});
|
|
1686
|
+
server.tool(serverToolName(brand, "reset", "php_ini"), "php.ini\u8A2D\u5B9A\u3092\u521D\u671F\u5024\u306B\u623B\u3059", {
|
|
1687
|
+
domain: z18.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3")
|
|
1688
|
+
}, async ({ domain: domain2 }) => callApi(() => client.resetPhpIni(domain2)));
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
// ../core/dist/tools/server/wordpress-security.js
|
|
1692
|
+
import { z as z19 } from "zod";
|
|
1693
|
+
var enabledTargetSchema = z19.object({
|
|
1694
|
+
enabled: z19.boolean()
|
|
1695
|
+
});
|
|
1696
|
+
var foreignIpTargetSchema = z19.object({
|
|
1697
|
+
enabled: z19.boolean().optional(),
|
|
1698
|
+
allowed_ip_addresses: z19.array(z19.string()).optional()
|
|
1699
|
+
});
|
|
1700
|
+
var UPDATE_BLOCKS = [
|
|
1701
|
+
"comment_restriction",
|
|
1702
|
+
"login_attempt_limit",
|
|
1703
|
+
"foreign_ip_restriction",
|
|
1704
|
+
"ip_restriction"
|
|
1705
|
+
];
|
|
1706
|
+
var wordpressSecurityUpdateSchema = {
|
|
1707
|
+
domain: z19.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1708
|
+
comment_restriction: z19.object({
|
|
1709
|
+
bulk_post: enabledTargetSchema.optional(),
|
|
1710
|
+
foreign_post: enabledTargetSchema.optional()
|
|
1711
|
+
}).optional().describe("\u30B3\u30E1\u30F3\u30C8\u5236\u9650"),
|
|
1712
|
+
login_attempt_limit: z19.object({
|
|
1713
|
+
enabled: z19.boolean()
|
|
1714
|
+
}).optional().describe("\u30ED\u30B0\u30A4\u30F3\u8A66\u884C\u56DE\u6570\u5236\u9650"),
|
|
1715
|
+
foreign_ip_restriction: z19.object({
|
|
1716
|
+
dashboard: foreignIpTargetSchema.optional(),
|
|
1717
|
+
xml_rpc_api: foreignIpTargetSchema.optional(),
|
|
1718
|
+
rest_api: foreignIpTargetSchema.optional(),
|
|
1719
|
+
wlwmanifest: foreignIpTargetSchema.optional()
|
|
1720
|
+
}).optional().describe("\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650"),
|
|
1721
|
+
ip_restriction: z19.object({
|
|
1722
|
+
enabled: z19.boolean().optional(),
|
|
1723
|
+
allowed_ip_addresses: z19.array(z19.string()).optional()
|
|
1724
|
+
}).optional().describe("IP\u30A2\u30C9\u30EC\u30B9\u5236\u9650\uFF08\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\uFF09")
|
|
1725
|
+
};
|
|
1726
|
+
function buildUpdateBody(args) {
|
|
1727
|
+
const domain2 = args.domain;
|
|
1728
|
+
if (typeof domain2 !== "string" || domain2 === "") {
|
|
1729
|
+
throw new Error("domain \u306F\u5FC5\u9808\u3067\u3059");
|
|
1730
|
+
}
|
|
1731
|
+
const data = { domain: domain2 };
|
|
1732
|
+
for (const key of UPDATE_BLOCKS) {
|
|
1733
|
+
if (args[key] !== void 0)
|
|
1734
|
+
data[key] = args[key];
|
|
1735
|
+
}
|
|
1736
|
+
if (!UPDATE_BLOCKS.some((key) => key in data)) {
|
|
1737
|
+
throw new Error("comment_restriction\u3001login_attempt_limit\u3001foreign_ip_restriction\u3001ip_restriction \u306E\u3044\u305A\u308C\u304B1\u3064\u4EE5\u4E0A\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
1738
|
+
}
|
|
1739
|
+
return data;
|
|
1740
|
+
}
|
|
1741
|
+
function registerWordPressSecurityTools(server, client, brand) {
|
|
1742
|
+
server.tool(serverToolName(brand, "get", "wordpress_security"), "WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
1743
|
+
domain: z19.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1744
|
+
}, async (args) => {
|
|
1745
|
+
const params = {};
|
|
1746
|
+
if (args.domain)
|
|
1747
|
+
params.domain = args.domain;
|
|
1748
|
+
return callApi(() => client.getWordPressSecurity(params));
|
|
1749
|
+
});
|
|
1750
|
+
server.tool(serverToolName(brand, "update", "wordpress_security"), "WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u30D6\u30ED\u30C3\u30AF\u306E\u307F\uFF09", wordpressSecurityUpdateSchema, async (args) => callApi(() => client.updateWordPressSecurity(buildUpdateBody(args))));
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
// ../core/dist/tools/server/x-accelerator.js
|
|
1754
|
+
import { z as z20 } from "zod";
|
|
1755
|
+
function registerXAcceleratorTools(server, client, brand) {
|
|
1756
|
+
server.tool(serverToolName(brand, "list", "x_accelerator"), "X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1757
|
+
domain: z20.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1758
|
+
}, async (args) => {
|
|
1759
|
+
const params = {};
|
|
1760
|
+
if (args.domain)
|
|
1761
|
+
params.domain = args.domain;
|
|
1762
|
+
return callApi(() => client.listXAccelerator(params));
|
|
1763
|
+
});
|
|
1764
|
+
server.tool(serverToolName(brand, "update", "x_accelerator"), "X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
1765
|
+
domain: z20.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1766
|
+
xaccelerator_status: z20.enum(["off", "v1", "v2"]).describe("X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\uFF08off / v1 / v2\uFF09")
|
|
1767
|
+
}, async ({ domain: domain2, xaccelerator_status }) => callApi(() => client.updateXAccelerator(domain2, { xaccelerator_status })));
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
// ../core/dist/tools/server/server-cache.js
|
|
1771
|
+
import { z as z21 } from "zod";
|
|
1772
|
+
function registerServerCacheTools(server, client, brand) {
|
|
1773
|
+
server.tool(serverToolName(brand, "list", "server_cache"), "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1774
|
+
domain: z21.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1775
|
+
}, async (args) => {
|
|
1776
|
+
const params = {};
|
|
1777
|
+
if (args.domain)
|
|
1778
|
+
params.domain = args.domain;
|
|
1779
|
+
return callApi(() => client.listServerCache(params));
|
|
1780
|
+
});
|
|
1781
|
+
server.tool(serverToolName(brand, "update", "server_cache"), "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
1782
|
+
domain: z21.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1783
|
+
server_cache_status: z21.enum(["on", "off"]).describe("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\uFF08on / off\uFF09")
|
|
1784
|
+
}, async ({ domain: domain2, server_cache_status }) => callApi(() => client.updateServerCache(domain2, { server_cache_status })));
|
|
1785
|
+
server.tool(serverToolName(brand, "clear_cache", "server_cache"), "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u306E\u5185\u5BB9\u3092\u524A\u9664\uFF08\u30D1\u30FC\u30B8\uFF09", {
|
|
1786
|
+
domain: z21.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3")
|
|
1787
|
+
}, async ({ domain: domain2 }) => callApi(() => client.clearServerCache(domain2)));
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
// ../core/dist/tools/server/browser-cache.js
|
|
1791
|
+
import { z as z22 } from "zod";
|
|
1792
|
+
function registerBrowserCacheTools(server, client, brand) {
|
|
1793
|
+
server.tool(serverToolName(brand, "list", "browser_cache"), "\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1794
|
+
domain: z22.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1795
|
+
}, async (args) => {
|
|
1796
|
+
const params = {};
|
|
1797
|
+
if (args.domain)
|
|
1798
|
+
params.domain = args.domain;
|
|
1799
|
+
return callApi(() => client.listBrowserCache(params));
|
|
1800
|
+
});
|
|
1801
|
+
server.tool(serverToolName(brand, "update", "browser_cache"), "\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
1802
|
+
domain: z22.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1803
|
+
browser_cache_status: z22.enum(["all", "ignore-css-js", "off"]).describe("\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\uFF08all / ignore-css-js / off\uFF09")
|
|
1804
|
+
}, async ({ domain: domain2, browser_cache_status }) => callApi(() => client.updateBrowserCache(domain2, { browser_cache_status })));
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
// ../core/dist/tools/server/url-redirect.js
|
|
1808
|
+
import { z as z23 } from "zod";
|
|
1809
|
+
function registerUrlRedirectTools(server, client, brand) {
|
|
1810
|
+
server.tool(serverToolName(brand, "list", "url_redirect"), "\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1811
|
+
domain: z23.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1812
|
+
}, async (args) => {
|
|
1813
|
+
const params = {};
|
|
1814
|
+
if (args.domain)
|
|
1815
|
+
params.domain = args.domain;
|
|
1816
|
+
return callApi(() => client.listUrlRedirect(params));
|
|
1817
|
+
});
|
|
1818
|
+
server.tool(serverToolName(brand, "add", "url_redirect"), "\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
1819
|
+
domain: z23.string().describe("\u5951\u7D04\u30C9\u30E1\u30A4\u30F3"),
|
|
1820
|
+
from_host: z23.string().describe("\u8EE2\u9001\u5143\u30DB\u30B9\u30C8\uFF08FQDN\uFF09"),
|
|
1821
|
+
from_path: z23.string().optional().describe("\u8EE2\u9001\u5143\u30D1\u30B9\uFF08\u7701\u7565\u6642\u306F /\uFF09"),
|
|
1822
|
+
redirect_to_url: z23.string().describe("\u8EE2\u9001\u5148URL\uFF08http \u307E\u305F\u306F https\uFF09"),
|
|
1823
|
+
status_code: z23.union([z23.literal(301), z23.literal(302)]).describe("\u8EE2\u9001\u6642\u306E\u30B9\u30C6\u30FC\u30BF\u30B9\u30B3\u30FC\u30C9\uFF08301 / 302\uFF09")
|
|
1824
|
+
}, async (args) => {
|
|
1825
|
+
const data = {
|
|
1826
|
+
domain: args.domain,
|
|
1827
|
+
from_host: args.from_host,
|
|
1828
|
+
redirect_to_url: args.redirect_to_url,
|
|
1829
|
+
status_code: args.status_code
|
|
1830
|
+
};
|
|
1831
|
+
if (args.from_path !== void 0)
|
|
1832
|
+
data.from_path = args.from_path;
|
|
1833
|
+
return callApi(() => client.addUrlRedirect(data));
|
|
1834
|
+
});
|
|
1835
|
+
server.tool(serverToolName(brand, "delete", "url_redirect"), "\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
1836
|
+
redirect_id: z23.string().describe("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u306EID")
|
|
1837
|
+
}, async ({ redirect_id }) => callApi(() => client.deleteUrlRedirect(redirect_id)));
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
// ../core/dist/tools/server/access-deny.js
|
|
1841
|
+
import { z as z24 } from "zod";
|
|
1842
|
+
function registerAccessDenyTools(server, client, brand) {
|
|
1843
|
+
server.tool(serverToolName(brand, "list", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1844
|
+
domain: z24.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1845
|
+
}, async (args) => {
|
|
1846
|
+
const params = {};
|
|
1847
|
+
if (args.domain)
|
|
1848
|
+
params.domain = args.domain;
|
|
1849
|
+
return callApi(() => client.listAccessDeny(params));
|
|
1850
|
+
});
|
|
1851
|
+
server.tool(serverToolName(brand, "add", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
1852
|
+
domain: z24.string().describe("\u5951\u7D04\u30C9\u30E1\u30A4\u30F3"),
|
|
1853
|
+
ip_address: z24.string().describe("\u62D2\u5426IP\u30A2\u30C9\u30EC\u30B9\u30FB\u30DB\u30B9\u30C8\uFF08IPv4 / CIDR / \u90E8\u5206IP / \u30DB\u30B9\u30C8\u540D\uFF09"),
|
|
1854
|
+
memo: z24.string().optional().describe("\u30E1\u30E2\uFF08\u6700\u5927500\u6587\u5B57\uFF09")
|
|
1855
|
+
}, async (args) => {
|
|
1856
|
+
const data = {
|
|
1857
|
+
domain: args.domain,
|
|
1858
|
+
ip_address: args.ip_address
|
|
1859
|
+
};
|
|
1860
|
+
if (args.memo !== void 0)
|
|
1861
|
+
data.memo = args.memo;
|
|
1862
|
+
return callApi(() => client.addAccessDeny(data));
|
|
1863
|
+
});
|
|
1864
|
+
server.tool(serverToolName(brand, "update", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
1865
|
+
deny_id: z24.string().describe("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306EID"),
|
|
1866
|
+
memo: z24.string().describe("\u30E1\u30E2\uFF08\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09")
|
|
1867
|
+
}, async ({ deny_id, memo }) => callApi(() => client.updateAccessDeny(deny_id, { memo })));
|
|
1868
|
+
server.tool(serverToolName(brand, "delete", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
1869
|
+
deny_id: z24.string().describe("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306EID")
|
|
1870
|
+
}, async ({ deny_id }) => callApi(() => client.deleteAccessDeny(deny_id)));
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
// ../core/dist/tools/server/xpagespeed.js
|
|
1874
|
+
import { z as z25 } from "zod";
|
|
1875
|
+
var XPAGESPEED_KEYS = [
|
|
1876
|
+
"xoptimize_images",
|
|
1877
|
+
"lazyload_images",
|
|
1878
|
+
"xoptimize_css",
|
|
1879
|
+
"lazyload_css",
|
|
1880
|
+
"xoptimize_javascript",
|
|
1881
|
+
"lazyload_javascript"
|
|
1882
|
+
];
|
|
1883
|
+
var xPageSpeedUpdateSchema = {
|
|
1884
|
+
domain: z25.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1885
|
+
xoptimize_images: z25.boolean().optional().describe("\u753B\u50CF\u6700\u9069\u5316\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
1886
|
+
lazyload_images: z25.boolean().optional().describe("\u753B\u50CF\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
1887
|
+
xoptimize_css: z25.boolean().optional().describe("CSS\u6700\u9069\u5316\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
1888
|
+
lazyload_css: z25.boolean().optional().describe("CSS\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
1889
|
+
xoptimize_javascript: z25.boolean().optional().describe("JavaScript\u6700\u9069\u5316\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
1890
|
+
lazyload_javascript: z25.boolean().optional().describe("JavaScript\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\u306E\u6709\u52B9/\u7121\u52B9")
|
|
1891
|
+
};
|
|
1892
|
+
function buildUpdateBody2(args) {
|
|
1893
|
+
const { domain: domain2, ...fields } = args;
|
|
1894
|
+
if (typeof domain2 !== "string" || domain2 === "") {
|
|
1895
|
+
throw new Error("domain \u306F\u5FC5\u9808\u3067\u3059");
|
|
1896
|
+
}
|
|
1897
|
+
const data = {};
|
|
1898
|
+
for (const key of XPAGESPEED_KEYS) {
|
|
1899
|
+
if (fields[key] !== void 0)
|
|
1900
|
+
data[key] = fields[key];
|
|
1901
|
+
}
|
|
1902
|
+
if (Object.keys(data).length === 0) {
|
|
1903
|
+
throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
1904
|
+
}
|
|
1905
|
+
if (Object.keys(data).length > 1) {
|
|
1906
|
+
throw new Error("1\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u5909\u66F4\u3067\u304D\u308B\u306E\u306F1\u3064\u306E\u6700\u9069\u5316\u6A5F\u80FD\u306E\u307F\u3067\u3059");
|
|
1907
|
+
}
|
|
1908
|
+
return data;
|
|
1909
|
+
}
|
|
1910
|
+
function registerXPageSpeedTools(server, client, brand) {
|
|
1911
|
+
server.tool(serverToolName(brand, "list", "xpagespeed"), "XPageSpeed\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1912
|
+
domain: z25.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1913
|
+
}, async (args) => {
|
|
1914
|
+
const params = {};
|
|
1915
|
+
if (args.domain)
|
|
1916
|
+
params.domain = args.domain;
|
|
1917
|
+
return callApi(() => client.listXPageSpeed(params));
|
|
1918
|
+
});
|
|
1919
|
+
server.tool(serverToolName(brand, "update", "xpagespeed"), "XPageSpeed\u306E\u6700\u9069\u5316\u6A5F\u80FD\u3092\u5909\u66F4\uFF081\u30EA\u30AF\u30A8\u30B9\u30C8\u30671\u6A5F\u80FD\u306E\u307F\uFF09", xPageSpeedUpdateSchema, async (args) => {
|
|
1920
|
+
const { domain: domain2, ...fields } = args;
|
|
1921
|
+
const data = buildUpdateBody2({ domain: domain2, ...fields });
|
|
1922
|
+
return callApi(() => client.updateXPageSpeed(domain2, data));
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
// ../core/dist/tools/server/auto-backup.js
|
|
1927
|
+
import { z as z26 } from "zod";
|
|
1928
|
+
var domainElementSchema = z26.object({
|
|
1929
|
+
domain: z26.string().describe("\u5951\u7D04\u30C9\u30E1\u30A4\u30F3"),
|
|
1930
|
+
elements: z26.array(z26.enum(["web", "setting", "mail"])).min(1).describe("\u5BFE\u8C61\u7A2E\u5225\uFF08web / setting / mail\uFF09")
|
|
1931
|
+
});
|
|
1932
|
+
function registerAutoBackupTools(server, client, brand) {
|
|
1933
|
+
server.tool(serverToolName(brand, "list", "auto_backup_backup_dates"), "\u9078\u629E\u53EF\u80FD\u306A\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listAutoBackupBackupDates()));
|
|
1934
|
+
server.tool(serverToolName(brand, "list", "auto_backup"), "\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listAutoBackup()));
|
|
1935
|
+
server.tool(serverToolName(brand, "get", "auto_backup"), "\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u306E\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
1936
|
+
request_id: z26.string().describe("\u7533\u8FBCID\uFF08\u6B63\u306E\u6574\u6570\uFF09")
|
|
1937
|
+
}, async ({ request_id }) => callApi(() => client.getAutoBackup(request_id)));
|
|
1938
|
+
server.tool(serverToolName(brand, "create", "auto_backup"), "\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u307E\u305F\u306F\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u3080", {
|
|
1939
|
+
backup_date: z26.string().describe("\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09"),
|
|
1940
|
+
operation_type: z26.enum(["fetch", "restore"]).describe("\u51E6\u7406\u7A2E\u5225\uFF08fetch: \u30C7\u30FC\u30BF\u53D6\u5F97 / restore: \u5FA9\u5143\uFF09"),
|
|
1941
|
+
scope: z26.enum(["all", "selected"]).describe("\u51E6\u7406\u65B9\u6CD5\uFF08all: \u30B5\u30FC\u30D0\u30FC\u9818\u57DF\u5168\u4F53 / selected: \u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6307\u5B9A\uFF09"),
|
|
1942
|
+
domain_elements: z26.array(domainElementSchema).optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\uFF08scope=selected \u306E\u3068\u304D\u5FC5\u9808\uFF09")
|
|
1943
|
+
}, async (args) => {
|
|
1944
|
+
const data = {
|
|
1945
|
+
backup_date: args.backup_date,
|
|
1946
|
+
operation_type: args.operation_type,
|
|
1947
|
+
scope: args.scope
|
|
1948
|
+
};
|
|
1949
|
+
if (args.domain_elements !== void 0) {
|
|
1950
|
+
data.domain_elements = args.domain_elements;
|
|
1951
|
+
}
|
|
1952
|
+
return callApi(() => client.createAutoBackup(data));
|
|
1953
|
+
});
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
// ../core/dist/tools/server/mysql-backup.js
|
|
1957
|
+
import { z as z27 } from "zod";
|
|
1958
|
+
function registerMysqlBackupTools(server, client, brand) {
|
|
1959
|
+
server.tool(serverToolName(brand, "list", "mysql_backup_databases"), "MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u72B6\u614B\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listMysqlBackupDatabases()));
|
|
1960
|
+
server.tool(serverToolName(brand, "list", "mysql_backup"), "MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listMysqlBackup()));
|
|
1961
|
+
server.tool(serverToolName(brand, "get", "mysql_backup"), "MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
1962
|
+
request_id: z27.string().describe("\u7533\u8FBC\u8B58\u5225\u5B50\uFF0832\u6587\u5B57\u306E\u5C0F\u6587\u5B5716\u9032\u6570\uFF09")
|
|
1963
|
+
}, async ({ request_id }) => callApi(() => client.getMysqlBackup(request_id)));
|
|
1964
|
+
server.tool(serverToolName(brand, "create", "mysql_backup"), "MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u307E\u305F\u306F\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u3080", {
|
|
1965
|
+
db_name: z27.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D"),
|
|
1966
|
+
backup_date: z27.string().describe("\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09"),
|
|
1967
|
+
operation_type: z27.enum(["fetch", "restore"]).describe("\u51E6\u7406\u7A2E\u5225\uFF08fetch: \u30C7\u30FC\u30BF\u53D6\u5F97 / restore: \u5FA9\u5143\uFF09")
|
|
1968
|
+
}, async (args) => callApi(() => client.createMysqlBackup(args)));
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
// ../core/dist/tools/domain/index.js
|
|
1972
|
+
import { z as z28 } from "zod";
|
|
1973
|
+
|
|
1974
|
+
// ../core/dist/billing-confirmation.js
|
|
1975
|
+
function supportsFormElicitation(server) {
|
|
1976
|
+
const elicitation = server.server.getClientCapabilities()?.elicitation;
|
|
1977
|
+
return elicitation != null && elicitation.form != null;
|
|
1978
|
+
}
|
|
1979
|
+
async function confirmBillingOperation(server, input) {
|
|
1980
|
+
if (!supportsFormElicitation(server)) {
|
|
1981
|
+
throw new Error("\u8AB2\u91D1\u64CD\u4F5C\u306B\u306F MCP form elicitation \u5BFE\u5FDC\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8 (Codex / Claude Code / Cursor \u306E\u5BFE\u8A71\u30E2\u30FC\u30C9\u306A\u3069)\u304C\u5FC5\u8981\u3067\u3059\u3002\u975E\u5BFE\u5FDC\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u3067\u306F\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3002");
|
|
1982
|
+
}
|
|
1983
|
+
const yearsLine = input.years == null ? "" : "\n- \u5951\u7D04\u5E74\u6570: " + input.years + "\u5E74";
|
|
1984
|
+
const termsLine = input.requireTermsAgreement ? "\n- \u300C\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04\u300D\u304A\u3088\u3073\u300C\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066\u300D\u3078\u306E\u540C\u610F\u304C\u5FC5\u8981\u3067\u3059" : "";
|
|
1985
|
+
const message = [
|
|
1986
|
+
"\u8AB2\u91D1\u3092\u4F34\u3046\u64CD\u4F5C\u306E\u6700\u7D42\u78BA\u8A8D\u3067\u3059\u3002",
|
|
1987
|
+
`- \u64CD\u4F5C: ${input.operation}`,
|
|
1988
|
+
`- \u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3: ${input.domain}`,
|
|
1989
|
+
yearsLine,
|
|
1990
|
+
`- \u7A0E\u8FBC\u5408\u8A08: ${input.totalPrice}\u5186`,
|
|
1991
|
+
...domainLegalNoticeLines(input.brand),
|
|
1992
|
+
"- \u7533\u8ACB\u5F8C\u306F\u8AB2\u91D1\u3055\u308C\u3001\u539F\u5247\u53D6\u308A\u6D88\u3057\u3067\u304D\u307E\u305B\u3093",
|
|
1993
|
+
termsLine,
|
|
1994
|
+
"",
|
|
1995
|
+
"\u5185\u5BB9\u3092\u78BA\u8A8D\u3057\u3001\u627F\u8A8D\u3059\u308B\u5834\u5408\u306E\u307F true \u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
1996
|
+
].filter((line) => line !== "").join("\n");
|
|
1997
|
+
const properties = {
|
|
1998
|
+
confirm_purchase: {
|
|
1999
|
+
type: "boolean",
|
|
2000
|
+
title: "\u8AB2\u91D1\u3092\u627F\u8A8D\u3059\u308B",
|
|
2001
|
+
description: `${input.domain} / ${input.totalPrice}\u5186 / ${input.operation}`
|
|
2002
|
+
}
|
|
2003
|
+
};
|
|
2004
|
+
const required = ["confirm_purchase"];
|
|
2005
|
+
if (input.requireTermsAgreement) {
|
|
2006
|
+
properties.agree_to_terms = {
|
|
2007
|
+
type: "boolean",
|
|
2008
|
+
title: "\u300C\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04\u300D\u300C\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066\u300D\u306B\u540C\u610F\u3059\u308B",
|
|
2009
|
+
description: "\u30C9\u30E1\u30A4\u30F3\u53D6\u5F97\u30FB\u79FB\u7BA1\u306E\u300C\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04\u300D\u304A\u3088\u3073\u300C\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066\u300D\u306B\u540C\u610F\u3057\u307E\u3059"
|
|
2010
|
+
};
|
|
2011
|
+
required.push("agree_to_terms");
|
|
2012
|
+
}
|
|
2013
|
+
let result;
|
|
2014
|
+
try {
|
|
2015
|
+
result = await server.server.elicitInput({
|
|
2016
|
+
mode: "form",
|
|
2017
|
+
message,
|
|
2018
|
+
requestedSchema: {
|
|
2019
|
+
type: "object",
|
|
2020
|
+
properties,
|
|
2021
|
+
required
|
|
2022
|
+
}
|
|
2023
|
+
});
|
|
2024
|
+
} catch (error) {
|
|
2025
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
2026
|
+
throw new Error(`\u8AB2\u91D1\u78BA\u8A8D\uFF08elicitation\uFF09\u306B\u5931\u6557\u3057\u305F\u305F\u3081\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F: ${detail}`);
|
|
2027
|
+
}
|
|
2028
|
+
if (result.action === "decline" || result.action === "cancel") {
|
|
2029
|
+
throw new Error("BILLING_CONFIRMATION_DECLINED: \u5229\u7528\u8005\u304C\u8AB2\u91D1\u78BA\u8A8D\u3092\u62D2\u5426\u307E\u305F\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u305F\u305F\u3081\u3001\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
2030
|
+
}
|
|
2031
|
+
if (result.action !== "accept" || result.content == null || typeof result.content !== "object") {
|
|
2032
|
+
throw new Error("BILLING_CONFIRMATION_INVALID: \u8AB2\u91D1\u78BA\u8A8D\u306E\u5FDC\u7B54\u304C\u4E0D\u6B63\u306A\u305F\u3081\u3001\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
2033
|
+
}
|
|
2034
|
+
const content = result.content;
|
|
2035
|
+
if (content.confirm_purchase !== true) {
|
|
2036
|
+
throw new Error("BILLING_CONFIRMATION_NOT_APPROVED: \u8AB2\u91D1\u627F\u8A8D\u304C\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
2037
|
+
}
|
|
2038
|
+
if (input.requireTermsAgreement && content.agree_to_terms !== true) {
|
|
2039
|
+
throw new Error("BILLING_TERMS_NOT_APPROVED: \u300C\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04\u300D\u304A\u3088\u3073\u300C\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066\u300D\u3078\u306E\u540C\u610F\u304C\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
var billingPreviewAnnotations = {
|
|
2043
|
+
readOnlyHint: true,
|
|
2044
|
+
destructiveHint: false,
|
|
2045
|
+
idempotentHint: true,
|
|
2046
|
+
openWorldHint: true
|
|
2047
|
+
};
|
|
2048
|
+
var billingExecuteAnnotations = {
|
|
2049
|
+
readOnlyHint: false,
|
|
2050
|
+
destructiveHint: true,
|
|
2051
|
+
idempotentHint: true,
|
|
2052
|
+
openWorldHint: true
|
|
2053
|
+
};
|
|
2054
|
+
|
|
2055
|
+
// ../core/dist/tools/domain/index.js
|
|
2056
|
+
var domainName = z28.string().min(1).max(255).describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u540D\uFF08\u56FD\u969B\u5316\u30C9\u30E1\u30A4\u30F3\u306FPunycode\uFF09");
|
|
2057
|
+
var dnsId = z28.string().regex(/^[1-9]\d*$/).describe("DNS\u30EC\u30B3\u30FC\u30C9ID\uFF08dns_id\u3001\u6B63\u306E\u6574\u6570\uFF09");
|
|
2058
|
+
var dnsType = z28.enum(["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV"]).describe("DNS\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7");
|
|
2059
|
+
var ttl = z28.number().int().min(60).max(86400).describe("TTL\uFF0860\uFF5E86400\u79D2\uFF09");
|
|
2060
|
+
var priority = z28.number().int().min(0).max(999).describe("\u512A\u5148\u5EA6\uFF080\uFF5E999\uFF09");
|
|
2061
|
+
var expectedTotalPrice = z28.number().int().nonnegative().describe("preview\u3068\u4E00\u81F4\u3059\u308B\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D");
|
|
2062
|
+
var idempotencyKey = z28.string().regex(/^[A-Za-z0-9_-]{8,64}$/).describe("Idempotency-Key\uFF08\u82F1\u6570\u5B57\u30FB_\u30FB-\u30018\uFF5E64\u6587\u5B57\uFF09\u3002\u5374\u4E0B\u3055\u308C\u305F\u7533\u8ACB\u306E\u518D\u9001\u306F\u540C\u3058\u5024\u3092\u4F7F\u3046\u3002\u30B5\u30FC\u30D0\u30FC\u30A8\u30E9\u30FC\u3084\u5FDC\u7B54\u4E0D\u660E\u3067\u7D42\u308F\u3063\u305F\u5834\u5408\u306F\u3001\u540C\u3058\u5024\u306E\u518D\u9001\u304C48\u6642\u9593409 DUPLICATE_REQUEST\u306B\u306A\u308B\u305F\u3081\u3001\u30C9\u30E1\u30A4\u30F3\u8A73\u7D30\u3068\u8ACB\u6C42\u5C65\u6B74\u3067\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3001\u672A\u5B9F\u884C\u306E\u3068\u304D\u3060\u3051\u65B0\u3057\u3044\u5024\u3092\u4F7F\u3046\u3002");
|
|
2063
|
+
var years = z28.number().int().min(1).max(5).describe("\u5951\u7D04\u5E74\u6570\uFF081\uFF5E5\u5E74\uFF09");
|
|
2064
|
+
var currentExpiryDate = z28.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("\u73FE\u5728\u306E\u6709\u52B9\u671F\u9650\uFF08YYYY-MM-DD\u3001\u4E8C\u91CD\u66F4\u65B0\u9632\u6B62\u7528\uFF09");
|
|
2065
|
+
var nameserverHostname = (maximumLength) => z28.string().min(1).max(maximumLength).regex(/^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$/);
|
|
2066
|
+
var nameservers = (minimum, maximum, maximumLength) => z28.array(nameserverHostname(maximumLength)).min(minimum).max(maximum).refine((values) => new Set(values.map((value) => value.toLowerCase())).size === values.length, "\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\u3092\u91CD\u8907\u3057\u3066\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093");
|
|
2067
|
+
var whoisFields = z28.object({
|
|
2068
|
+
organization_name: z28.string().optional(),
|
|
2069
|
+
first_name: z28.string().optional(),
|
|
2070
|
+
last_name: z28.string().optional(),
|
|
2071
|
+
postal_code: z28.string().optional(),
|
|
2072
|
+
state_province: z28.string().optional(),
|
|
2073
|
+
city: z28.string().optional(),
|
|
2074
|
+
address1: z28.string().optional(),
|
|
2075
|
+
address2: z28.string().optional(),
|
|
2076
|
+
email: z28.string().email().optional(),
|
|
2077
|
+
phone: z28.string().optional(),
|
|
2078
|
+
fax: z28.string().optional(),
|
|
2079
|
+
country: z28.string().optional(),
|
|
2080
|
+
role: z28.string().optional()
|
|
2081
|
+
}).strict().describe("Whois\u767B\u9332\u8005\u60C5\u5831\u3002\u4EE3\u7406\u516C\u958BOFF\u6642\u306F\u516813\u30AD\u30FC\u304C\u5FC5\u8981");
|
|
2082
|
+
var registrationInput = {
|
|
2083
|
+
domain: domainName,
|
|
2084
|
+
years: years.optional().default(1),
|
|
2085
|
+
expected_total_price: expectedTotalPrice,
|
|
2086
|
+
agree_to_terms: z28.literal(true).describe("\u30C9\u30E1\u30A4\u30F3\u53D6\u5F97\u306E\u300C\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04\u300D\u304A\u3088\u3073\u300C\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066\u300D\u3078\u306E\u660E\u793A\u540C\u610F"),
|
|
2087
|
+
nameservers: nameservers(1, 6, 255).optional().describe("\u53D6\u5F97\u6642\u306B\u8A2D\u5B9A\u3059\u308B\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\uFF081\uFF5E6\u4EF6\uFF09")
|
|
2088
|
+
};
|
|
2089
|
+
var transferInput = {
|
|
2090
|
+
domain: domainName,
|
|
2091
|
+
auth_code: z28.string().min(1).max(255).describe("\u79FB\u7BA1\u5143\u3067\u53D6\u5F97\u3057\u305FAuthCode"),
|
|
2092
|
+
expected_total_price: expectedTotalPrice,
|
|
2093
|
+
agree_to_terms: z28.literal(true).describe("\u30C9\u30E1\u30A4\u30F3\u79FB\u7BA1\u306E\u300C\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04\u300D\u304A\u3088\u3073\u300C\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066\u300D\u3078\u306E\u660E\u793A\u540C\u610F")
|
|
2094
|
+
};
|
|
2095
|
+
var renewInput = {
|
|
2096
|
+
domain: domainName,
|
|
2097
|
+
years,
|
|
2098
|
+
current_expiry_date: currentExpiryDate,
|
|
2099
|
+
expected_total_price: expectedTotalPrice
|
|
2100
|
+
};
|
|
2101
|
+
function description(text) {
|
|
2102
|
+
return `${text}\u3002\u30C9\u30E1\u30A4\u30F3\u30EC\u30B8\u30B9\u30C8\u30E9\u3067\u4FDD\u6709\u30FB\u7BA1\u7406\u3059\u308B\u30C9\u30E1\u30A4\u30F3\u304C\u5BFE\u8C61\u3067\u3042\u308A\u3001\u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FC\u306EServer API\u3067\u306F\u3042\u308A\u307E\u305B\u3093`;
|
|
2103
|
+
}
|
|
2104
|
+
function registerDomainServiceTools(server, client, brand, options = {}) {
|
|
2105
|
+
server.tool(domainToolName(brand, "get", "api_key_info"), description("API\u30AD\u30FC\u60C5\u5831\u3068Domain\u30B5\u30FC\u30D3\u30B9\u306E\u6A29\u9650\u30FB\u5BFE\u8C61\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.getMe()));
|
|
2106
|
+
server.tool(domainToolName(brand, "list", "domains"), description("\u4FDD\u6709\u30C9\u30E1\u30A4\u30F3\u306E\u4E00\u89A7\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.listDomains()));
|
|
2107
|
+
server.tool(domainToolName(brand, "get", "domain"), description("\u4FDD\u6709\u30C9\u30E1\u30A4\u30F3\u306E\u8A73\u7D30\u30FB\u72B6\u614B\u30FB\u6709\u52B9\u671F\u9650\u3092\u53D6\u5F97"), { domain: domainName }, async ({ domain: domain2 }) => callApi(() => client.getDomainDetail(domain2)));
|
|
2108
|
+
server.tool(domainToolName(brand, "get", "nameservers"), description("\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\u8A2D\u5B9A\u3092\u53D6\u5F97"), { domain: domainName }, async ({ domain: domain2 }) => callApi(() => client.getDomainNameservers(domain2)));
|
|
2109
|
+
server.tool(domainToolName(brand, "update", "nameservers"), description("\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\u30921\uFF5E13\u4EF6\u3067\u5168\u7F6E\u63DB"), {
|
|
2110
|
+
domain: domainName,
|
|
2111
|
+
nameservers: nameservers(1, 13, 253).describe("\u7F6E\u63DB\u5F8C\u306E\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\uFF081\uFF5E13\u4EF6\uFF09")
|
|
2112
|
+
}, async ({ domain: domain2, nameservers: nameservers2 }) => callApi(() => client.updateDomainNameservers(domain2, { nameservers: nameservers2 })));
|
|
2113
|
+
server.tool(domainToolName(brand, "list", "dns"), description("\u30EC\u30B8\u30B9\u30C8\u30E9\u5074DNS\u30EC\u30B3\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97"), { domain: domainName }, async ({ domain: domain2 }) => callApi(() => client.listDomainDns(domain2)));
|
|
2114
|
+
server.tool(domainToolName(brand, "add", "dns"), description("\u30EC\u30B8\u30B9\u30C8\u30E9\u5074DNS\u30EC\u30B3\u30FC\u30C9\u3092\u8FFD\u52A0"), {
|
|
2115
|
+
domain: domainName,
|
|
2116
|
+
type: dnsType,
|
|
2117
|
+
host: z28.string().max(64).describe("\u30DB\u30B9\u30C8\u540D\uFF08apex\u306F@\uFF09"),
|
|
2118
|
+
content: z28.string().max(1024).describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
2119
|
+
ttl: ttl.optional().default(3600),
|
|
2120
|
+
priority: priority.optional()
|
|
2121
|
+
}, async ({ domain: domain2, ...data }) => callApi(() => client.addDomainDns(domain2, data)));
|
|
2122
|
+
server.tool(domainToolName(brand, "update", "dns"), description("\u6307\u5B9A\u3057\u305F\u30EC\u30B8\u30B9\u30C8\u30E9\u5074DNS\u30EC\u30B3\u30FC\u30C9\u3092\u90E8\u5206\u66F4\u65B0"), {
|
|
2123
|
+
domain: domainName,
|
|
2124
|
+
dns_id: dnsId,
|
|
2125
|
+
type: dnsType.optional(),
|
|
2126
|
+
host: z28.string().max(64).optional().describe("\u30DB\u30B9\u30C8\u540D\uFF08apex\u306F@\uFF09"),
|
|
2127
|
+
content: z28.string().max(1024).optional().describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
2128
|
+
ttl: ttl.optional(),
|
|
2129
|
+
priority: priority.optional()
|
|
2130
|
+
}, async ({ domain: domain2, dns_id, ...data }) => callApi(async () => {
|
|
2131
|
+
if (Object.keys(data).length === 0) {
|
|
2132
|
+
throw new Error("DNS\u66F4\u65B0\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
2133
|
+
}
|
|
2134
|
+
return client.updateDomainDns(domain2, dns_id, data);
|
|
2135
|
+
}));
|
|
2136
|
+
server.tool(domainToolName(brand, "delete", "dns"), description("\u6307\u5B9A\u3057\u305F\u30EC\u30B8\u30B9\u30C8\u30E9\u5074DNS\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\uFF08\u540D\u524D\u89E3\u6C7A\u3078\u5F71\u97FF\u3059\u308B\u305F\u3081\u5BFE\u8C61\u3092\u78BA\u8A8D\u3057\u3066\u5B9F\u884C\uFF09"), {
|
|
2137
|
+
domain: domainName,
|
|
2138
|
+
dns_id: dnsId,
|
|
2139
|
+
confirmed: z28.literal(true).describe("\u5BFE\u8C61\u30EC\u30B3\u30FC\u30C9\u3068\u540D\u524D\u89E3\u6C7A\u3078\u306E\u5F71\u97FF\u3092\u5229\u7528\u8005\u304C\u78BA\u8A8D\u6E08\u307F")
|
|
2140
|
+
}, async ({ domain: domain2, dns_id, confirmed: confirmed2 }) => callApi(async () => {
|
|
2141
|
+
if (!confirmed2)
|
|
2142
|
+
throw new Error("confirmed=true is required.");
|
|
2143
|
+
return client.deleteDomainDns(domain2, dns_id);
|
|
2144
|
+
}));
|
|
2145
|
+
server.tool(domainToolName(brand, "get", "whois"), description("Whois\u767B\u9332\u8005\u60C5\u5831\u3068\u4EE3\u7406\u516C\u958B\u8A2D\u5B9A\u3092\u53D6\u5F97"), { domain: domainName }, async ({ domain: domain2 }) => callApi(() => client.getDomainWhois(domain2)));
|
|
2146
|
+
server.tool(domainToolName(brand, "update", "whois"), description("Whois\u767B\u9332\u8005\u60C5\u5831\u307E\u305F\u306F\u4EE3\u7406\u516C\u958B\u8A2D\u5B9A\u3092\u66F4\u65B0"), {
|
|
2147
|
+
domain: domainName,
|
|
2148
|
+
whois_privacy: z28.boolean().optional().describe("Whois\u4EE3\u7406\u516C\u958B\u3092\u6709\u52B9\u306B\u3059\u308B\u304B"),
|
|
2149
|
+
fields: whoisFields.optional()
|
|
2150
|
+
}, async ({ domain: domain2, whois_privacy, fields }) => callApi(async () => {
|
|
2151
|
+
if (whois_privacy === void 0 && fields === void 0) {
|
|
2152
|
+
throw new Error("whois_privacy \u307E\u305F\u306F fields \u306E\u3044\u305A\u308C\u304B\u304C\u5FC5\u8981\u3067\u3059\u3002");
|
|
2153
|
+
}
|
|
2154
|
+
const data = {};
|
|
2155
|
+
if (whois_privacy !== void 0)
|
|
2156
|
+
data.whois_privacy = whois_privacy;
|
|
2157
|
+
if (fields !== void 0)
|
|
2158
|
+
data.fields = fields;
|
|
2159
|
+
return client.updateDomainWhois(domain2, data);
|
|
2160
|
+
}));
|
|
2161
|
+
server.tool(domainToolName(brand, "get", "registrar_lock"), description("\u30EC\u30B8\u30B9\u30C8\u30E9\u30ED\u30C3\u30AF\u72B6\u614B\u3092\u53D6\u5F97"), { domain: domainName }, async ({ domain: domain2 }) => callApi(() => client.getDomainRegistrarLock(domain2)));
|
|
2162
|
+
server.tool(domainToolName(brand, "update", "registrar_lock"), description("\u30EC\u30B8\u30B9\u30C8\u30E9\u30ED\u30C3\u30AF\u3092\u8A2D\u5B9A\u307E\u305F\u306F\u89E3\u9664"), {
|
|
2163
|
+
domain: domainName,
|
|
2164
|
+
locked: z28.boolean().describe("true\u3067\u30ED\u30C3\u30AF\u3001false\u3067\u89E3\u9664")
|
|
2165
|
+
}, async ({ domain: domain2, locked }) => callApi(() => client.updateDomainRegistrarLock(domain2, { locked })));
|
|
2166
|
+
server.tool(domainToolName(brand, "check", "domain"), description("\u30C9\u30E1\u30A4\u30F3\u306E\u53D6\u5F97\u53EF\u5426\u3068\u898B\u7A4D\u4FA1\u683C\u3092\u78BA\u8A8D"), { domain: domainName }, async ({ domain: domain2 }) => callApi(() => withDomainAcquisitionPermissionDiagnosis(client, () => client.checkDomain(domain2))));
|
|
2167
|
+
server.tool(domainToolName(brand, "get", "pricing"), description("TLD\u5225\u306E\u7A0E\u8FBC\u4FA1\u683C\u4E00\u89A7\u3092\u53D6\u5F97"), {
|
|
2168
|
+
tld: z28.string().optional().describe("\u7D5E\u308A\u8FBC\u3080TLD\u3002\u8907\u6570\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF08\u4F8B: com,net,jp\uFF09")
|
|
2169
|
+
}, async ({ tld }) => callApi(() => withDomainAcquisitionPermissionDiagnosis(client, () => client.getDomainPricing(tld ? { tld } : void 0))));
|
|
2170
|
+
server.tool(domainToolName(brand, "preview", "registration"), description("\u8AB2\u91D1\u3055\u308C\u308B\u30C9\u30E1\u30A4\u30F3\u65B0\u898F\u53D6\u5F97\u3092dry-run\u3057\u3001\u5B9F\u7533\u8ACB\u524D\u306E\u91D1\u984D\u3092\u78BA\u8A8D"), registrationInput, billingPreviewAnnotations, async ({ domain: domain2, years: years2, expected_total_price, nameservers: nameservers2 }) => callApi(() => withDomainAcquisitionPermissionDiagnosis(client, () => client.registerDomain({
|
|
2171
|
+
domain_name: domain2,
|
|
2172
|
+
years: years2,
|
|
2173
|
+
expected_total_price,
|
|
2174
|
+
agree_to_terms: true,
|
|
2175
|
+
dry_run: true,
|
|
2176
|
+
...nameservers2 ? { nameservers: nameservers2 } : {}
|
|
2177
|
+
}))));
|
|
2178
|
+
if (options.enableHighRiskExecute) {
|
|
2179
|
+
server.tool(domainToolName(brand, "execute", "registration"), description("\u660E\u793A\u627F\u8A8D\u5F8C\u306B\u30C9\u30E1\u30A4\u30F3\u65B0\u898F\u53D6\u5F97\u3092\u5B9F\u7533\u8ACB\uFF08\u8AB2\u91D1\u3055\u308C\u539F\u5247\u53D6\u308A\u6D88\u3057\u4E0D\u53EF\uFF09"), {
|
|
2180
|
+
...registrationInput,
|
|
2181
|
+
idempotency_key: idempotencyKey
|
|
2182
|
+
}, billingExecuteAnnotations, async ({ domain: domain2, years: years2, expected_total_price, nameservers: nameservers2, idempotency_key }) => callApi(async () => {
|
|
2183
|
+
const data = {
|
|
2184
|
+
domain_name: domain2,
|
|
2185
|
+
years: years2,
|
|
2186
|
+
expected_total_price,
|
|
2187
|
+
agree_to_terms: true,
|
|
2188
|
+
...nameservers2 ? { nameservers: nameservers2 } : {}
|
|
2189
|
+
};
|
|
2190
|
+
const preview = await withDomainAcquisitionPermissionDiagnosis(client, () => client.registerDomain({ ...data, dry_run: true }));
|
|
2191
|
+
const totalPrice = Number(preview.total_price);
|
|
2192
|
+
if (!Number.isFinite(totalPrice)) {
|
|
2193
|
+
throw new Error("dry-run\u7D50\u679C\u304B\u3089\u5408\u8A08\u91D1\u984D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002");
|
|
2194
|
+
}
|
|
2195
|
+
if (totalPrice !== expected_total_price) {
|
|
2196
|
+
throw new Error(`\u4FA1\u683C\u4E0D\u4E00\u81F4\u306E\u305F\u3081\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\uFF08\u898B\u7A4D ${totalPrice}\u5186 / \u6307\u5B9A ${expected_total_price}\u5186\uFF09\u3002`);
|
|
2197
|
+
}
|
|
2198
|
+
await confirmBillingOperation(server, {
|
|
2199
|
+
operation: "\u30C9\u30E1\u30A4\u30F3\u65B0\u898F\u53D6\u5F97",
|
|
2200
|
+
domain: domain2,
|
|
2201
|
+
totalPrice,
|
|
2202
|
+
brand,
|
|
2203
|
+
years: years2,
|
|
2204
|
+
requireTermsAgreement: true
|
|
2205
|
+
});
|
|
2206
|
+
return withDomainAcquisitionPermissionDiagnosis(client, () => client.registerDomain(data, idempotency_key));
|
|
2207
|
+
}));
|
|
2208
|
+
}
|
|
2209
|
+
server.tool(domainToolName(brand, "preview", "transfer"), description("\u8AB2\u91D1\u3055\u308C\u308B\u30C9\u30E1\u30A4\u30F3\u79FB\u7BA1\u3092dry-run\u3057\u3001\u5B9F\u7533\u8ACB\u524D\u306E\u91D1\u984D\u3092\u78BA\u8A8D"), transferInput, billingPreviewAnnotations, async ({ domain: domain2, auth_code, expected_total_price }) => callApi(() => withDomainAcquisitionPermissionDiagnosis(client, () => client.transferDomain(domain2, {
|
|
2210
|
+
auth_code,
|
|
2211
|
+
expected_total_price,
|
|
2212
|
+
agree_to_terms: true,
|
|
2213
|
+
dry_run: true
|
|
2214
|
+
}))));
|
|
2215
|
+
if (options.enableHighRiskExecute) {
|
|
2216
|
+
server.tool(domainToolName(brand, "execute", "transfer"), description("\u660E\u793A\u627F\u8A8D\u5F8C\u306B\u30C9\u30E1\u30A4\u30F3\u79FB\u7BA1\u3092\u5B9F\u7533\u8ACB\uFF08\u8AB2\u91D1\u3055\u308C\u539F\u5247\u53D6\u308A\u6D88\u3057\u4E0D\u53EF\uFF09"), {
|
|
2217
|
+
...transferInput,
|
|
2218
|
+
idempotency_key: idempotencyKey
|
|
2219
|
+
}, billingExecuteAnnotations, async ({ domain: domain2, auth_code, expected_total_price, idempotency_key }) => callApi(async () => {
|
|
2220
|
+
const data = { auth_code, expected_total_price, agree_to_terms: true };
|
|
2221
|
+
const preview = await withDomainAcquisitionPermissionDiagnosis(client, () => client.transferDomain(domain2, { ...data, dry_run: true }));
|
|
2222
|
+
const totalPrice = Number(preview.total_price);
|
|
2223
|
+
if (!Number.isFinite(totalPrice)) {
|
|
2224
|
+
throw new Error("dry-run\u7D50\u679C\u304B\u3089\u5408\u8A08\u91D1\u984D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002");
|
|
2225
|
+
}
|
|
2226
|
+
if (totalPrice !== expected_total_price) {
|
|
2227
|
+
throw new Error(`\u4FA1\u683C\u4E0D\u4E00\u81F4\u306E\u305F\u3081\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\uFF08\u898B\u7A4D ${totalPrice}\u5186 / \u6307\u5B9A ${expected_total_price}\u5186\uFF09\u3002`);
|
|
2228
|
+
}
|
|
2229
|
+
await confirmBillingOperation(server, {
|
|
2230
|
+
operation: "\u30C9\u30E1\u30A4\u30F3\u79FB\u7BA1",
|
|
2231
|
+
domain: domain2,
|
|
2232
|
+
totalPrice,
|
|
2233
|
+
brand,
|
|
2234
|
+
requireTermsAgreement: true
|
|
2235
|
+
});
|
|
2236
|
+
return withDomainAcquisitionPermissionDiagnosis(client, () => client.transferDomain(domain2, data, idempotency_key));
|
|
2237
|
+
}));
|
|
2238
|
+
}
|
|
2239
|
+
server.tool(domainToolName(brand, "preview", "renew"), description("\u8AB2\u91D1\u3055\u308C\u308B\u30C9\u30E1\u30A4\u30F3\u5951\u7D04\u66F4\u65B0\u3092dry-run\u3057\u3001\u5B9F\u7533\u8ACB\u524D\u306E\u91D1\u984D\u3092\u78BA\u8A8D"), renewInput, billingPreviewAnnotations, async ({ domain: domain2, years: years2, current_expiry_date, expected_total_price }) => callApi(() => withDomainAcquisitionPermissionDiagnosis(client, () => client.renewDomain(domain2, {
|
|
2240
|
+
years: years2,
|
|
2241
|
+
current_expiry_date,
|
|
2242
|
+
expected_total_price,
|
|
2243
|
+
dry_run: true
|
|
2244
|
+
}))));
|
|
2245
|
+
if (options.enableHighRiskExecute) {
|
|
2246
|
+
server.tool(domainToolName(brand, "execute", "renew"), description("\u660E\u793A\u627F\u8A8D\u5F8C\u306B\u30C9\u30E1\u30A4\u30F3\u5951\u7D04\u66F4\u65B0\u3092\u5B9F\u7533\u8ACB\uFF08\u8AB2\u91D1\u3055\u308C\u539F\u5247\u53D6\u308A\u6D88\u3057\u4E0D\u53EF\uFF09"), {
|
|
2247
|
+
...renewInput,
|
|
2248
|
+
idempotency_key: idempotencyKey
|
|
2249
|
+
}, billingExecuteAnnotations, async ({ domain: domain2, years: years2, current_expiry_date, expected_total_price, idempotency_key }) => callApi(async () => {
|
|
2250
|
+
const data = { years: years2, current_expiry_date, expected_total_price };
|
|
2251
|
+
const preview = await withDomainAcquisitionPermissionDiagnosis(client, () => client.renewDomain(domain2, { ...data, dry_run: true }));
|
|
2252
|
+
const totalPrice = Number(preview.total_price);
|
|
2253
|
+
if (!Number.isFinite(totalPrice)) {
|
|
2254
|
+
throw new Error("dry-run\u7D50\u679C\u304B\u3089\u5408\u8A08\u91D1\u984D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002");
|
|
2255
|
+
}
|
|
2256
|
+
if (totalPrice !== expected_total_price) {
|
|
2257
|
+
throw new Error(`\u4FA1\u683C\u4E0D\u4E00\u81F4\u306E\u305F\u3081\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\uFF08\u898B\u7A4D ${totalPrice}\u5186 / \u6307\u5B9A ${expected_total_price}\u5186\uFF09\u3002`);
|
|
2258
|
+
}
|
|
2259
|
+
await confirmBillingOperation(server, {
|
|
2260
|
+
operation: "\u30C9\u30E1\u30A4\u30F3\u5951\u7D04\u66F4\u65B0",
|
|
2261
|
+
domain: domain2,
|
|
2262
|
+
totalPrice,
|
|
2263
|
+
brand,
|
|
2264
|
+
years: years2
|
|
2265
|
+
});
|
|
2266
|
+
return withDomainAcquisitionPermissionDiagnosis(client, () => client.renewDomain(domain2, data, idempotency_key));
|
|
2267
|
+
}));
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
// ../core/dist/tools/wphosting/index.js
|
|
2272
|
+
import { z as z29 } from "zod";
|
|
2273
|
+
var contractId = z29.string().regex(/^WP-[A-Za-z0-9]+$/).max(64).describe("XServer for WordPress\u306E\u5951\u7D04ID\uFF08contract_id\uFF09");
|
|
2274
|
+
var servername = z29.string().min(1).max(255).describe("\u5951\u7D04\u5185\u306E\u5BFE\u8C61\u30B5\u30A4\u30C8\u74B0\u5883servername\uFF08\u672C\u756A\u307E\u305F\u306F\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\uFF09");
|
|
2275
|
+
var domain = z29.string().min(1).max(255).describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u540D");
|
|
2276
|
+
var positiveId = (label) => z29.string().regex(/^[1-9]\d*$/).describe(label);
|
|
2277
|
+
var opaqueId = (label) => z29.string().regex(/^[A-Za-z0-9_-]+$/).max(255).describe(label);
|
|
2278
|
+
var slug = (label) => z29.string().min(1).max(255).describe(label);
|
|
2279
|
+
var idempotencyKey2 = z29.string().regex(/^[A-Za-z0-9_-]{8,64}$/).describe("\u518D\u9001\u6642\u3082\u540C\u3058\u5024\u3092\u4F7F\u3046Idempotency-Key\uFF08\u82F1\u6570\u5B57\u30FB_\u30FB-\u30018\uFF5E64\u6587\u5B57\uFF09");
|
|
2280
|
+
var confirmed = z29.literal(true).describe("\u5BFE\u8C61\u3001\u6D88\u5931\u30FB\u4E0A\u66F8\u304D\u30FB\u9023\u52D5\u5F71\u97FF\u3092\u78BA\u8A8D\u5148\u3067\u78BA\u8A8D\u3057\u3001\u5229\u7528\u8005\u304C\u5B9F\u884C\u3092\u660E\u793A\u627F\u8A8D\u6E08\u307F");
|
|
2281
|
+
var dnsType2 = z29.enum(["A", "AAAA", "CNAME", "MX", "TXT", "SRV"]);
|
|
2282
|
+
var dnsTtl = z29.number().int().min(60).max(86400);
|
|
2283
|
+
var dnsPriority = z29.number().int().min(0).max(65535);
|
|
2284
|
+
var site = { contract_id: contractId, servername };
|
|
2285
|
+
var cronFields = {
|
|
2286
|
+
minute: z29.string().min(1).max(64),
|
|
2287
|
+
hour: z29.string().min(1).max(64),
|
|
2288
|
+
day: z29.string().min(1).max(64),
|
|
2289
|
+
month: z29.string().min(1).max(64),
|
|
2290
|
+
weekday: z29.string().min(1).max(64),
|
|
2291
|
+
command: z29.string().min(1).max(5e3),
|
|
2292
|
+
comment: z29.string().max(255).optional()
|
|
2293
|
+
};
|
|
2294
|
+
var wpUserOptionalFields = {
|
|
2295
|
+
user_email: z29.string().email().max(100).optional(),
|
|
2296
|
+
user_pass: z29.string().min(7).max(64).optional(),
|
|
2297
|
+
role: z29.string().min(1).max(64).optional(),
|
|
2298
|
+
display_name: z29.string().max(255).optional(),
|
|
2299
|
+
first_name: z29.string().max(255).optional(),
|
|
2300
|
+
last_name: z29.string().max(255).optional(),
|
|
2301
|
+
user_url: z29.string().url().max(255).optional()
|
|
2302
|
+
};
|
|
2303
|
+
function description2(text) {
|
|
2304
|
+
return `${text}\u3002XServer for WordPress\u5951\u7D04\u304C\u5BFE\u8C61\u3067\u3059\u3002\u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FCServer API\u306EWordPress\u30FBDNS\u30FBCron\u30FBSSH\u64CD\u4F5C\u3067\u306F\u3042\u308A\u307E\u305B\u3093`;
|
|
2305
|
+
}
|
|
2306
|
+
function body(args, excluded) {
|
|
2307
|
+
return Object.fromEntries(Object.entries(args).filter(([key]) => !excluded.includes(key)));
|
|
2308
|
+
}
|
|
2309
|
+
function requireUpdate(data, message = "\u66F4\u65B0\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002") {
|
|
2310
|
+
if (Object.keys(data).length === 0)
|
|
2311
|
+
throw new Error(message);
|
|
2312
|
+
}
|
|
2313
|
+
function registerWphostingTools(server, client, brand) {
|
|
2314
|
+
if (brand.brand !== "xserver") {
|
|
2315
|
+
throw new Error(`--services=wphosting is not supported for brand "${brand.brand}"; use XServer.`);
|
|
2316
|
+
}
|
|
2317
|
+
const tools = server;
|
|
2318
|
+
const invoke = (method, args = []) => {
|
|
2319
|
+
const fn = client[method];
|
|
2320
|
+
if (typeof fn !== "function")
|
|
2321
|
+
throw new Error(`ApiClient.${method} is not available.`);
|
|
2322
|
+
return fn.apply(client, args);
|
|
2323
|
+
};
|
|
2324
|
+
const register = (verb, resource, text, schema, method, toArgs) => tools.tool(wphostingToolName(brand, verb, resource), description2(text), schema, async (args) => callApi(() => invoke(method, toArgs(args))));
|
|
2325
|
+
register("get", "api_key_info", "API\u30AD\u30FC\u60C5\u5831\u3068WPhosting\u6A29\u9650\u30FB\u5BFE\u8C61\u5951\u7D04\u3092\u53D6\u5F97", {}, "getMe", () => []);
|
|
2326
|
+
register("list", "sites", "\u5951\u7D04\u5185\u306E\u672C\u756A\u30FB\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\u30B5\u30A4\u30C8\u4E00\u89A7\u3068\u51E6\u7406status\u3092\u53D6\u5F97", { contract_id: contractId }, "listWphostingSites", (a) => [a.contract_id]);
|
|
2327
|
+
register("get", "site", "\u30B5\u30A4\u30C8\u8A73\u7D30\u3068\u975E\u540C\u671F\u30B5\u30A4\u30C8\u51E6\u7406\u306Estatus\u3092\u53D6\u5F97", site, "getWphostingSite", (a) => [a.contract_id, a.servername]);
|
|
2328
|
+
register("get", "usage", "\u5951\u7D04\u4E0A\u9650\u3001\u4F7F\u7528\u91CF\u3001\u30B5\u30A4\u30C8\u5225\u5185\u8A33\u3092\u53D6\u5F97", { contract_id: contractId }, "getWphostingUsage", (a) => [a.contract_id]);
|
|
2329
|
+
register("create", "site", "\u30B5\u30A4\u30C8\u4F5C\u6210\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: get_wphosting_site\u306Estatus\uFF09", {
|
|
2330
|
+
contract_id: contractId,
|
|
2331
|
+
wp_sitename: z29.string().min(1).max(255),
|
|
2332
|
+
wp_username: z29.string().min(1).max(255).regex(/^[0-9A-Za-z _\-.@]+$/),
|
|
2333
|
+
wp_password: z29.string().min(7).max(64).regex(/^[A-Za-z0-9!#$%=~^|:_\[\]().+\-*\/@&<>`;?,]+$/).refine((value) => /[A-Za-z]/.test(value) && /[^A-Za-z]/.test(value), {
|
|
2334
|
+
message: "\u534A\u89D2\u82F1\u5B57\u3068\u6570\u5B57\u307E\u305F\u306F\u8A18\u53F7\u3092\u305D\u308C\u305E\u308C1\u6587\u5B57\u4EE5\u4E0A\u542B\u3081\u3066\u304F\u3060\u3055\u3044"
|
|
2335
|
+
}),
|
|
2336
|
+
wp_mailaddress: z29.string().email().max(100),
|
|
2337
|
+
disk_limit_gb: z29.number().int().min(10),
|
|
2338
|
+
vcpu_limit: z29.number().int().positive(),
|
|
2339
|
+
memory_limit_gb: z29.number().int().positive(),
|
|
2340
|
+
wp_theme: z29.enum(["default", "cocoon-master", "lightning"]).optional(),
|
|
2341
|
+
server_id: z29.string().regex(/^[a-z][a-z0-9]{0,11}$/).optional(),
|
|
2342
|
+
security_auto_optimize: z29.boolean().optional(),
|
|
2343
|
+
memo: z29.string().max(255).optional(),
|
|
2344
|
+
idempotency_key: idempotencyKey2.optional()
|
|
2345
|
+
}, "createWphostingSite", (a) => {
|
|
2346
|
+
if (a.wp_password === a.wp_username) {
|
|
2347
|
+
throw new Error("wp_password\u306Fwp_username\u3068\u7570\u306A\u308B\u6587\u5B57\u5217\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
2348
|
+
}
|
|
2349
|
+
return [
|
|
2350
|
+
a.contract_id,
|
|
2351
|
+
body(a, ["contract_id", "idempotency_key"]),
|
|
2352
|
+
a.idempotency_key
|
|
2353
|
+
];
|
|
2354
|
+
});
|
|
2355
|
+
tools.tool(wphostingToolName(brand, "preview", "site_deletion"), description2("\u30B5\u30A4\u30C8\u524A\u9664\u524D\u306BGET\u3067\u5BFE\u8C61\u3068\u5F71\u97FF\u3092\u78BA\u8A8D\uFF08\u672C\u756A\u30B5\u30A4\u30C8\u306A\u3089\u7D10\u3065\u304F\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\u3082\u9023\u52D5\u524A\u9664\u3002\u78BA\u8A8D\u5F8C\u306Fexecute_wphosting_site_deletion\uFF09"), site, async (a) => callApi(async () => ({
|
|
2356
|
+
target: await invoke("getWphostingSite", [a.contract_id, a.servername]),
|
|
2357
|
+
impact: "\u6307\u5B9A\u30B5\u30A4\u30C8\u3092\u524A\u9664\u3057\u307E\u3059\u3002\u672C\u756A\u30B5\u30A4\u30C8\u306E\u5834\u5408\u306F\u7D10\u3065\u304F\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\u30B5\u30A4\u30C8\u3082\u9023\u52D5\u524A\u9664\u3055\u308C\u3001\u4E00\u89A7\u304B\u3089\u9664\u5916\u3055\u308C\u308B\u307E\u3067\u51E6\u7406\u4E2D\u3067\u3059\u3002",
|
|
2358
|
+
confirmation_tool: wphostingToolName(brand, "execute", "site_deletion"),
|
|
2359
|
+
confirmation_destination: "list_wphosting_sites\u3067\u5BFE\u8C61\u3068\u9023\u52D5\u524A\u9664\u5BFE\u8C61\u3092\u518D\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
2360
|
+
})));
|
|
2361
|
+
register("execute", "site_deletion", "preview\u7D50\u679C\u306E\u660E\u793A\u627F\u8A8D\u5F8C\u306B\u30B5\u30A4\u30C8\u524A\u9664\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: list_wphosting_sites\u304B\u3089\u5BFE\u8C61\u304C\u9664\u5916\uFF09", { ...site, confirmed, idempotency_key: idempotencyKey2.optional() }, "deleteWphostingSite", (a) => [a.contract_id, a.servername, a.idempotency_key]);
|
|
2362
|
+
register("create", "staging", "\u672C\u756A\u30B5\u30A4\u30C8\u306E\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\u4F5C\u6210\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: \u8FD4\u5374servername\u306Eget_wphosting_site status\uFF09", {
|
|
2363
|
+
...site,
|
|
2364
|
+
disk_limit_gb: z29.number().int().min(10),
|
|
2365
|
+
vcpu_limit: z29.number().int().positive(),
|
|
2366
|
+
memory_limit_gb: z29.number().int().positive(),
|
|
2367
|
+
server_id: z29.string().min(1).max(12).optional(),
|
|
2368
|
+
security_auto_optimize: z29.boolean().optional(),
|
|
2369
|
+
idempotency_key: idempotencyKey2.optional()
|
|
2370
|
+
}, "createWphostingStaging", (a) => [
|
|
2371
|
+
a.contract_id,
|
|
2372
|
+
a.servername,
|
|
2373
|
+
body(a, ["contract_id", "servername", "idempotency_key"]),
|
|
2374
|
+
a.idempotency_key
|
|
2375
|
+
]);
|
|
2376
|
+
register("list", "backups", "\u624B\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u4E00\u89A7\u3068\u4F5C\u6210status\u3092\u53D6\u5F97", site, "listWphostingBackups", (a) => [a.contract_id, a.servername]);
|
|
2377
|
+
register("create", "backup", "\u624B\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u4F5C\u6210\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: list_wphosting_backups\u306Estatus\uFF09", {
|
|
2378
|
+
...site,
|
|
2379
|
+
memo: z29.string().max(255).optional(),
|
|
2380
|
+
idempotency_key: idempotencyKey2.optional()
|
|
2381
|
+
}, "createWphostingBackup", (a) => [
|
|
2382
|
+
a.contract_id,
|
|
2383
|
+
a.servername,
|
|
2384
|
+
body(a, ["contract_id", "servername", "idempotency_key"]),
|
|
2385
|
+
a.idempotency_key
|
|
2386
|
+
]);
|
|
2387
|
+
tools.tool(wphostingToolName(brand, "preview", "backup_restore"), description2("\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u5FA9\u5143\u524D\u306BGET\u3067\u5BFE\u8C61\u3068\u4E0A\u66F8\u304D\u5F71\u97FF\u3092\u78BA\u8A8D\uFF08\u78BA\u8A8D\u5F8C\u306Fexecute_wphosting_backup_restore\uFF09"), { ...site, backup_id: opaqueId("\u5FA9\u5143\u3059\u308B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7ID") }, async (a) => callApi(async () => ({
|
|
2388
|
+
backups: await invoke("listWphostingBackups", [
|
|
2389
|
+
a.contract_id,
|
|
2390
|
+
a.servername
|
|
2391
|
+
]),
|
|
2392
|
+
target_backup_id: a.backup_id,
|
|
2393
|
+
impact: "\u6307\u5B9A\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u5185\u5BB9\u3067\u73FE\u5728\u306E\u30B5\u30A4\u30C8\u5185\u5BB9\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059\u3002\u958B\u59CB\u5F8C\u306F\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\u3002",
|
|
2394
|
+
confirmation_tool: wphostingToolName(brand, "execute", "backup_restore"),
|
|
2395
|
+
confirmation_destination: "list_wphosting_backups\u3067\u5BFE\u8C61\u3092\u78BA\u8A8D\u3057\u3001\u5B9F\u884C\u5F8C\u306Flist_wphosting_backup_restore_history\u3067\u6210\u5426\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
2396
|
+
})));
|
|
2397
|
+
register("execute", "backup_restore", "preview\u7D50\u679C\u306E\u660E\u793A\u627F\u8A8D\u5F8C\u306B\u5FA9\u5143\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: list_wphosting_backup_restore_history\u306Estatus\uFF09", {
|
|
2398
|
+
...site,
|
|
2399
|
+
backup_id: opaqueId("\u5FA9\u5143\u3059\u308B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7ID"),
|
|
2400
|
+
confirmed,
|
|
2401
|
+
idempotency_key: idempotencyKey2.optional()
|
|
2402
|
+
}, "restoreWphostingBackup", (a) => [a.contract_id, a.servername, a.backup_id, a.idempotency_key]);
|
|
2403
|
+
register("list", "backup_restore_history", "\u624B\u52D5\u30FB\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u5FA9\u5143\u306E\u5C65\u6B74\u3068status\u3092\u53D6\u5F97", site, "listWphostingBackupRestoreHistory", (a) => [a.contract_id, a.servername]);
|
|
2404
|
+
register("delete", "backup", "\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_backups\u3002\u524A\u9664\u5F8C\u306F\u5FA9\u5143\u4E0D\u53EF\uFF09", { ...site, backup_id: opaqueId("\u524A\u9664\u3059\u308B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7ID"), confirmed }, "deleteWphostingBackup", (a) => [a.contract_id, a.servername, a.backup_id]);
|
|
2405
|
+
register("get", "wordpress", "WordPress\u672C\u4F53\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3068\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u53D6\u5F97", site, "getWphostingWordPress", (a) => [a.contract_id, a.servername]);
|
|
2406
|
+
register("update", "wordpress", "WordPress\u672C\u4F53\u306E\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u5909\u66F4", { ...site, auto_update_scope: z29.enum(["none", "minor", "all"]) }, "updateWphostingWordPress", (a) => [
|
|
2407
|
+
a.contract_id,
|
|
2408
|
+
a.servername,
|
|
2409
|
+
{ auto_update_scope: a.auto_update_scope }
|
|
2410
|
+
]);
|
|
2411
|
+
register("upgrade", "wordpress", "WordPress\u672C\u4F53\u3092\u540C\u671F\u66F4\u65B0", site, "upgradeWphostingWordPress", (a) => [a.contract_id, a.servername]);
|
|
2412
|
+
register("get", "maintenance_mode", "\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9\u30E2\u30FC\u30C9\u8A2D\u5B9A\u3092\u53D6\u5F97", site, "getWphostingMaintenanceMode", (a) => [a.contract_id, a.servername]);
|
|
2413
|
+
register("update", "maintenance_mode", "\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9\u30E2\u30FC\u30C9\u3092\u5909\u66F4", { ...site, enabled: z29.boolean() }, "updateWphostingMaintenanceMode", (a) => [a.contract_id, a.servername, { enabled: a.enabled }]);
|
|
2414
|
+
register("list", "plugins", "\u901A\u5E38\u30D7\u30E9\u30B0\u30A4\u30F3\u4E00\u89A7\u3092\u53D6\u5F97\uFF08drop-in/must-use\u3092\u9664\u304F\uFF09", site, "listWphostingPlugins", (a) => [a.contract_id, a.servername]);
|
|
2415
|
+
register("install", "plugin", "\u516C\u5F0F\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u30D7\u30E9\u30B0\u30A4\u30F3slug\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
2416
|
+
...site,
|
|
2417
|
+
plugin: slug("\u30D7\u30E9\u30B0\u30A4\u30F3slug"),
|
|
2418
|
+
activate: z29.boolean().optional()
|
|
2419
|
+
}, "installWphostingPlugin", (a) => [
|
|
2420
|
+
a.contract_id,
|
|
2421
|
+
a.servername,
|
|
2422
|
+
{
|
|
2423
|
+
plugin: a.plugin,
|
|
2424
|
+
...a.activate === void 0 ? {} : { activate: a.activate }
|
|
2425
|
+
}
|
|
2426
|
+
]);
|
|
2427
|
+
register("update", "plugin", "\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u6709\u52B9\u72B6\u614B\u307E\u305F\u306F\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2428
|
+
...site,
|
|
2429
|
+
plugin: slug("\u30D7\u30E9\u30B0\u30A4\u30F3slug"),
|
|
2430
|
+
status: z29.enum(["active", "inactive"]).optional(),
|
|
2431
|
+
auto_update: z29.boolean().optional()
|
|
2432
|
+
}, "updateWphostingPlugin", (a) => {
|
|
2433
|
+
const data = body(a, ["contract_id", "servername", "plugin"]);
|
|
2434
|
+
requireUpdate(data);
|
|
2435
|
+
return [a.contract_id, a.servername, a.plugin, data];
|
|
2436
|
+
});
|
|
2437
|
+
register("upgrade", "plugin", "\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u540C\u671F\u66F4\u65B0", { ...site, plugin: slug("\u30D7\u30E9\u30B0\u30A4\u30F3slug") }, "upgradeWphostingPlugin", (a) => [a.contract_id, a.servername, a.plugin]);
|
|
2438
|
+
register("delete", "plugin", "\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_plugins\uFF09", { ...site, plugin: slug("\u524A\u9664\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3slug"), confirmed }, "deleteWphostingPlugin", (a) => [a.contract_id, a.servername, a.plugin]);
|
|
2439
|
+
register("list", "themes", "\u30C6\u30FC\u30DE\u4E00\u89A7\u3092\u53D6\u5F97", site, "listWphostingThemes", (a) => [a.contract_id, a.servername]);
|
|
2440
|
+
register("install", "theme", "\u516C\u5F0F\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u30C6\u30FC\u30DEslug\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", { ...site, theme: slug("\u30C6\u30FC\u30DEslug"), activate: z29.boolean().optional() }, "installWphostingTheme", (a) => [
|
|
2441
|
+
a.contract_id,
|
|
2442
|
+
a.servername,
|
|
2443
|
+
{
|
|
2444
|
+
theme: a.theme,
|
|
2445
|
+
...a.activate === void 0 ? {} : { activate: a.activate }
|
|
2446
|
+
}
|
|
2447
|
+
]);
|
|
2448
|
+
register("update", "theme", "\u30C6\u30FC\u30DE\u306Eactive\u5207\u66FF\u307E\u305F\u306F\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2449
|
+
...site,
|
|
2450
|
+
theme: slug("\u30C6\u30FC\u30DEslug"),
|
|
2451
|
+
status: z29.literal("active").optional(),
|
|
2452
|
+
auto_update: z29.boolean().optional()
|
|
2453
|
+
}, "updateWphostingTheme", (a) => {
|
|
2454
|
+
const data = body(a, ["contract_id", "servername", "theme"]);
|
|
2455
|
+
requireUpdate(data);
|
|
2456
|
+
return [a.contract_id, a.servername, a.theme, data];
|
|
2457
|
+
});
|
|
2458
|
+
register("upgrade", "theme", "\u30C6\u30FC\u30DE\u3092\u540C\u671F\u66F4\u65B0", { ...site, theme: slug("\u30C6\u30FC\u30DEslug") }, "upgradeWphostingTheme", (a) => [a.contract_id, a.servername, a.theme]);
|
|
2459
|
+
register("delete", "theme", "\u30C6\u30FC\u30DE\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_themes\u3002active\u30C6\u30FC\u30DE\u306F\u524A\u9664\u4E0D\u53EF\uFF09", { ...site, theme: slug("\u524A\u9664\u3059\u308B\u30C6\u30FC\u30DEslug"), confirmed }, "deleteWphostingTheme", (a) => [a.contract_id, a.servername, a.theme]);
|
|
2460
|
+
register("list", "domains", "\u30B5\u30A4\u30C8\u306E\u521D\u671F\u30FB\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u4E00\u89A7\u3068Web/SSL/DNS\u72B6\u614B\u3092\u53D6\u5F97", site, "listWphostingDomains", (a) => [a.contract_id, a.servername]);
|
|
2461
|
+
register("add", "domain", "\u30B5\u30A4\u30C8\u3078\u30C9\u30E1\u30A4\u30F3\u3092\u8FFD\u52A0\uFF08\u5FC5\u8981\u6642\u306F\u6240\u6709\u8005\u78BA\u8A8DTXT\u60C5\u5831\u3092\u8FD4\u3059\uFF09", { ...site, domain }, "addWphostingDomain", (a) => [a.contract_id, a.servername, { domain: a.domain }]);
|
|
2462
|
+
register("verify", "domain", "\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u306EDNS\u6240\u6709\u8005\u78BA\u8A8D\u3092\u5B9F\u884C", { ...site, domain }, "verifyWphostingDomain", (a) => [a.contract_id, a.servername, a.domain]);
|
|
2463
|
+
register("delete", "domain", "\u30B5\u30A4\u30C8\u306E\u30C9\u30E1\u30A4\u30F3\u8A2D\u5B9A\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_domains\u3002\u30B5\u30A4\u30C8URL\u4F7F\u7528\u4E2D\u306F\u524A\u9664\u4E0D\u53EF\uFF09", { ...site, domain, confirmed }, "deleteWphostingDomain", (a) => [a.contract_id, a.servername, a.domain]);
|
|
2464
|
+
register("update", "site_url", "\u30B5\u30A4\u30C8\u306E\u30D7\u30E9\u30A4\u30DE\u30EA\u30C9\u30E1\u30A4\u30F3\u3092\u5909\u66F4", { ...site, domain, auto_redirect: z29.boolean().optional() }, "updateWphostingSiteUrl", (a) => [
|
|
2465
|
+
a.contract_id,
|
|
2466
|
+
a.servername,
|
|
2467
|
+
{
|
|
2468
|
+
domain: a.domain,
|
|
2469
|
+
...a.auto_redirect === void 0 ? {} : { auto_redirect: a.auto_redirect }
|
|
2470
|
+
}
|
|
2471
|
+
]);
|
|
2472
|
+
register("list", "dns_records", "\u30B5\u30A4\u30C8\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u306EDNS\u30EC\u30B3\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97", { ...site, domain }, "listWphostingDnsRecords", (a) => [a.contract_id, a.servername, a.domain]);
|
|
2473
|
+
register("add", "dns_record", "\u30B5\u30A4\u30C8\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u3078DNS\u30EC\u30B3\u30FC\u30C9\u3092\u8FFD\u52A0", {
|
|
2474
|
+
...site,
|
|
2475
|
+
domain,
|
|
2476
|
+
host: z29.string().max(255),
|
|
2477
|
+
type: dnsType2,
|
|
2478
|
+
content: z29.string().max(1024),
|
|
2479
|
+
ttl: dnsTtl.optional().default(3600),
|
|
2480
|
+
priority: dnsPriority.optional()
|
|
2481
|
+
}, "addWphostingDnsRecord", (a) => [
|
|
2482
|
+
a.contract_id,
|
|
2483
|
+
a.servername,
|
|
2484
|
+
a.domain,
|
|
2485
|
+
body(a, ["contract_id", "servername", "domain"])
|
|
2486
|
+
]);
|
|
2487
|
+
register("update", "dns_record", "\u30B5\u30A4\u30C8\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u306EDNS\u30EC\u30B3\u30FC\u30C9\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2488
|
+
...site,
|
|
2489
|
+
domain,
|
|
2490
|
+
dns_id: positiveId("DNS\u30EC\u30B3\u30FC\u30C9ID"),
|
|
2491
|
+
host: z29.string().max(255).optional(),
|
|
2492
|
+
type: dnsType2.optional(),
|
|
2493
|
+
content: z29.string().max(1024).optional(),
|
|
2494
|
+
ttl: dnsTtl.optional(),
|
|
2495
|
+
priority: dnsPriority.optional()
|
|
2496
|
+
}, "updateWphostingDnsRecord", (a) => {
|
|
2497
|
+
const data = body(a, ["contract_id", "servername", "domain", "dns_id"]);
|
|
2498
|
+
requireUpdate(data);
|
|
2499
|
+
return [a.contract_id, a.servername, a.domain, a.dns_id, data];
|
|
2500
|
+
});
|
|
2501
|
+
register("delete", "dns_record", "\u30B5\u30A4\u30C8\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u306EDNS\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_dns_records\uFF09", { ...site, domain, dns_id: positiveId("DNS\u30EC\u30B3\u30FC\u30C9ID"), confirmed }, "deleteWphostingDnsRecord", (a) => [a.contract_id, a.servername, a.domain, a.dns_id]);
|
|
2502
|
+
register("get", "php_version", "\u30B5\u30A4\u30C8\u306EPHP\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u53D6\u5F97", site, "getWphostingPhpVersion", (a) => [a.contract_id, a.servername]);
|
|
2503
|
+
register("update", "php_version", "\u30B5\u30A4\u30C8\u306EPHP\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5909\u66F4", { ...site, version: z29.string().min(1).max(16) }, "updateWphostingPhpVersion", (a) => [a.contract_id, a.servername, { version: a.version }]);
|
|
2504
|
+
register("get", "access_log", "\u30B5\u30A4\u30C8\u306E\u30A2\u30AF\u30BB\u30B9\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
2505
|
+
...site,
|
|
2506
|
+
date: z29.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
|
|
2507
|
+
keyword: z29.string().max(255).optional(),
|
|
2508
|
+
line_number: z29.number().int().min(1).max(5e4).optional()
|
|
2509
|
+
}, "getWphostingAccessLog", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2510
|
+
register("get", "error_log", "\u30B5\u30A4\u30C8\u306E\u30A8\u30E9\u30FC\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
2511
|
+
...site,
|
|
2512
|
+
keyword: z29.string().max(255).optional(),
|
|
2513
|
+
line_number: z29.number().int().min(1).max(5e4).optional()
|
|
2514
|
+
}, "getWphostingErrorLog", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2515
|
+
register("list", "cron", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FCron\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", site, "listWphostingCron", (a) => [a.contract_id, a.servername]);
|
|
2516
|
+
register("add", "cron", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FCron\u30B8\u30E7\u30D6\u3092\u8FFD\u52A0", { ...site, ...cronFields }, "addWphostingCron", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2517
|
+
register("update", "cron", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FCron\u30B8\u30E7\u30D6\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2518
|
+
...site,
|
|
2519
|
+
cron_id: z29.string().min(1).max(255),
|
|
2520
|
+
minute: cronFields.minute.optional(),
|
|
2521
|
+
hour: cronFields.hour.optional(),
|
|
2522
|
+
day: cronFields.day.optional(),
|
|
2523
|
+
month: cronFields.month.optional(),
|
|
2524
|
+
weekday: cronFields.weekday.optional(),
|
|
2525
|
+
command: cronFields.command.optional(),
|
|
2526
|
+
comment: cronFields.comment,
|
|
2527
|
+
enabled: z29.boolean().optional()
|
|
2528
|
+
}, "updateWphostingCron", (a) => {
|
|
2529
|
+
const data = body(a, ["contract_id", "servername", "cron_id"]);
|
|
2530
|
+
requireUpdate(data);
|
|
2531
|
+
return [a.contract_id, a.servername, a.cron_id, data];
|
|
2532
|
+
});
|
|
2533
|
+
register("delete", "cron", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FCron\u30B8\u30E7\u30D6\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_cron\uFF09", { ...site, cron_id: z29.string().min(1).max(255), confirmed }, "deleteWphostingCron", (a) => [a.contract_id, a.servername, a.cron_id]);
|
|
2534
|
+
register("get", "ssh", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FSSH\u8A2D\u5B9A\u3068\u63A5\u7D9A\u60C5\u5831\u3092\u53D6\u5F97", site, "getWphostingSsh", (a) => [a.contract_id, a.servername]);
|
|
2535
|
+
register("update", "ssh", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FSSH\u6709\u52B9\u72B6\u614B\u307E\u305F\u306F\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u3092\u5909\u66F4", {
|
|
2536
|
+
...site,
|
|
2537
|
+
ssh_enabled: z29.boolean().optional(),
|
|
2538
|
+
abroad_access_restriction: z29.boolean().optional()
|
|
2539
|
+
}, "updateWphostingSsh", (a) => {
|
|
2540
|
+
const data = body(a, ["contract_id", "servername"]);
|
|
2541
|
+
requireUpdate(data);
|
|
2542
|
+
return [a.contract_id, a.servername, data];
|
|
2543
|
+
});
|
|
2544
|
+
register("list", "ssh_keys", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FSSH\u516C\u958B\u9375\u4E00\u89A7\u3092\u53D6\u5F97", site, "listWphostingSshKeys", (a) => [a.contract_id, a.servername]);
|
|
2545
|
+
register("add", "ssh_key", "SSH\u516C\u958B\u9375\u3092\u767B\u9332\u307E\u305F\u306F\u9375\u30DA\u30A2\u3092\u751F\u6210\uFF08\u521D\u56DEactive\u9375\u306A\u3089SSH\u3082\u6709\u52B9\u5316\uFF09", {
|
|
2546
|
+
...site,
|
|
2547
|
+
label: z29.string().min(1).max(500),
|
|
2548
|
+
public_key: z29.string().min(1).optional(),
|
|
2549
|
+
generate: z29.boolean().optional(),
|
|
2550
|
+
passphrase: z29.string().min(6).max(32).optional()
|
|
2551
|
+
}, "addWphostingSshKey", (a) => {
|
|
2552
|
+
if (a.generate !== true && a.public_key === void 0) {
|
|
2553
|
+
throw new Error("public_key \u307E\u305F\u306F generate=true \u306E\u3044\u305A\u308C\u304B\u304C\u5FC5\u8981\u3067\u3059\u3002");
|
|
2554
|
+
}
|
|
2555
|
+
if (a.generate === true && a.public_key !== void 0) {
|
|
2556
|
+
throw new Error("generate=true\u3068public_key\u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002");
|
|
2557
|
+
}
|
|
2558
|
+
if (a.generate !== true && a.passphrase !== void 0) {
|
|
2559
|
+
throw new Error("passphrase\u306Fgenerate=true\u306E\u5834\u5408\u3060\u3051\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002");
|
|
2560
|
+
}
|
|
2561
|
+
return [
|
|
2562
|
+
a.contract_id,
|
|
2563
|
+
a.servername,
|
|
2564
|
+
body(a, ["contract_id", "servername"])
|
|
2565
|
+
];
|
|
2566
|
+
});
|
|
2567
|
+
register("update", "ssh_key", "SSH\u516C\u958B\u9375\u306E\u30E9\u30D9\u30EB\u307E\u305F\u306Fstatus\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2568
|
+
...site,
|
|
2569
|
+
key_id: positiveId("SSH\u516C\u958B\u9375ID"),
|
|
2570
|
+
label: z29.string().min(1).max(500).optional(),
|
|
2571
|
+
status: z29.enum(["on", "off"]).optional()
|
|
2572
|
+
}, "updateWphostingSshKey", (a) => {
|
|
2573
|
+
const data = body(a, ["contract_id", "servername", "key_id"]);
|
|
2574
|
+
requireUpdate(data);
|
|
2575
|
+
return [a.contract_id, a.servername, a.key_id, data];
|
|
2576
|
+
});
|
|
2577
|
+
register("delete", "ssh_key", "SSH\u516C\u958B\u9375\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_ssh_keys\uFF09", { ...site, key_id: positiveId("SSH\u516C\u958B\u9375ID"), confirmed }, "deleteWphostingSshKey", (a) => [a.contract_id, a.servername, a.key_id]);
|
|
2578
|
+
register("list", "wp_user_roles", "WordPress\u30E6\u30FC\u30B6\u30FC\u6A29\u9650\u30B0\u30EB\u30FC\u30D7\u4E00\u89A7\u3092\u53D6\u5F97", site, "listWphostingWpUserRoles", (a) => [a.contract_id, a.servername]);
|
|
2579
|
+
register("list", "wp_users", "WordPress\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u3092\u691C\u7D22\u30FB\u4E26\u3079\u66FF\u3048\u3066\u53D6\u5F97", {
|
|
2580
|
+
...site,
|
|
2581
|
+
search: z29.string().max(255).optional(),
|
|
2582
|
+
orderby: z29.enum([
|
|
2583
|
+
"ID",
|
|
2584
|
+
"user_login",
|
|
2585
|
+
"display_name",
|
|
2586
|
+
"user_email",
|
|
2587
|
+
"user_registered"
|
|
2588
|
+
]).optional(),
|
|
2589
|
+
order: z29.enum(["asc", "desc"]).optional()
|
|
2590
|
+
}, "listWphostingWpUsers", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2591
|
+
register("create", "wp_user", "WordPress\u30E6\u30FC\u30B6\u30FC\u3092\u4F5C\u6210", {
|
|
2592
|
+
...site,
|
|
2593
|
+
user_login: z29.string().min(1).max(60),
|
|
2594
|
+
user_email: z29.string().email().max(100),
|
|
2595
|
+
user_pass: z29.string().min(7).max(64),
|
|
2596
|
+
role: z29.string().min(1).max(64),
|
|
2597
|
+
display_name: z29.string().max(255).optional(),
|
|
2598
|
+
first_name: z29.string().max(255).optional(),
|
|
2599
|
+
last_name: z29.string().max(255).optional(),
|
|
2600
|
+
user_url: z29.string().url().max(255).optional(),
|
|
2601
|
+
send_email: z29.boolean().optional()
|
|
2602
|
+
}, "createWphostingWpUser", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2603
|
+
register("get", "wp_user", "WordPress\u30E6\u30FC\u30B6\u30FC\u8A73\u7D30\u3092\u53D6\u5F97", { ...site, user_id: positiveId("WordPress\u30E6\u30FC\u30B6\u30FCID") }, "getWphostingWpUser", (a) => [a.contract_id, a.servername, a.user_id]);
|
|
2604
|
+
register("update", "wp_user", "WordPress\u30E6\u30FC\u30B6\u30FC\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2605
|
+
...site,
|
|
2606
|
+
user_id: positiveId("WordPress\u30E6\u30FC\u30B6\u30FCID"),
|
|
2607
|
+
...wpUserOptionalFields
|
|
2608
|
+
}, "updateWphostingWpUser", (a) => {
|
|
2609
|
+
const data = body(a, ["contract_id", "servername", "user_id"]);
|
|
2610
|
+
requireUpdate(data);
|
|
2611
|
+
return [a.contract_id, a.servername, a.user_id, data];
|
|
2612
|
+
});
|
|
2613
|
+
register("delete", "wp_user", "WordPress\u30E6\u30FC\u30B6\u30FC\u3068\u6295\u7A3F\u7B49\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: get_wphosting_wp_user/list_wphosting_wp_users\u3002user_id=1\u306F\u524A\u9664\u4E0D\u53EF\uFF09", { ...site, user_id: positiveId("WordPress\u30E6\u30FC\u30B6\u30FCID"), confirmed }, "deleteWphostingWpUser", (a) => [a.contract_id, a.servername, a.user_id]);
|
|
2614
|
+
register("list", "security_settings", "\u516C\u958B\u5BFE\u8C6110\u30AD\u30FC\u306EWordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u53D6\u5F97", site, "getWphostingSecurity", (a) => [a.contract_id, a.servername]);
|
|
2615
|
+
register("update", "security_setting", "WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
2616
|
+
...site,
|
|
2617
|
+
key: z29.string().regex(/^[a-z0-9_]+$/).max(100).describe("list_wphosting_security_settings\u3067\u53D6\u5F97\u3057\u305F\u8A2D\u5B9Akey"),
|
|
2618
|
+
is_enable: z29.boolean()
|
|
2619
|
+
}, "updateWphostingSecurity", (a) => [a.contract_id, a.servername, a.key, { is_enable: a.is_enable }]);
|
|
2620
|
+
}
|
|
2621
|
+
|
|
1016
2622
|
// ../core/dist/tools/index.js
|
|
1017
|
-
function
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
2623
|
+
function registerServerTools(server, client, brand, resolver) {
|
|
2624
|
+
const targetServer = resolver ? withServerTargetResolution(server, resolver) : server;
|
|
2625
|
+
const targetClient = resolver?.client ?? client;
|
|
2626
|
+
registerServerInfoTools(targetServer, targetClient, brand);
|
|
2627
|
+
registerCronTools(targetServer, targetClient, brand);
|
|
2628
|
+
registerSshTools(targetServer, targetClient, brand);
|
|
2629
|
+
registerWordpressTools(targetServer, targetClient, brand);
|
|
2630
|
+
registerMailTools(targetServer, targetClient, brand);
|
|
2631
|
+
registerAutoReplyTools(targetServer, targetClient, brand);
|
|
2632
|
+
registerSmtpAbroadRestrictionTools(targetServer, targetClient, brand);
|
|
2633
|
+
registerDkimTools(targetServer, targetClient, brand);
|
|
2634
|
+
registerDmarcTools(targetServer, targetClient, brand);
|
|
2635
|
+
registerSpfTools(targetServer, targetClient, brand);
|
|
2636
|
+
registerSpamFilterTools(targetServer, targetClient, brand);
|
|
2637
|
+
registerFtpTools(targetServer, targetClient, brand);
|
|
2638
|
+
registerDatabaseTools(targetServer, targetClient, brand);
|
|
2639
|
+
registerDomainTools(targetServer, targetClient, brand);
|
|
2640
|
+
registerSslDnsTools(targetServer, targetClient, brand);
|
|
2641
|
+
registerResourceMonitorTools(targetServer, targetClient, brand);
|
|
2642
|
+
registerWafTools(targetServer, targetClient, brand);
|
|
2643
|
+
registerPhpIniTools(targetServer, targetClient, brand);
|
|
2644
|
+
registerWordPressSecurityTools(targetServer, targetClient, brand);
|
|
2645
|
+
registerXAcceleratorTools(targetServer, targetClient, brand);
|
|
2646
|
+
registerServerCacheTools(targetServer, targetClient, brand);
|
|
2647
|
+
registerBrowserCacheTools(targetServer, targetClient, brand);
|
|
2648
|
+
registerUrlRedirectTools(targetServer, targetClient, brand);
|
|
2649
|
+
registerAccessDenyTools(targetServer, targetClient, brand);
|
|
2650
|
+
registerXPageSpeedTools(targetServer, targetClient, brand);
|
|
2651
|
+
registerAutoBackupTools(targetServer, targetClient, brand);
|
|
2652
|
+
registerMysqlBackupTools(targetServer, targetClient, brand);
|
|
2653
|
+
}
|
|
2654
|
+
function registerAllTools(server, client, brand, service = "server", options = {}) {
|
|
2655
|
+
const services = Array.isArray(service) ? [...new Set(service)] : [service];
|
|
2656
|
+
if (services.includes("server")) {
|
|
2657
|
+
registerServerTools(server, client, brand, options.serverTargetResolver);
|
|
2658
|
+
}
|
|
2659
|
+
if (services.includes("domain")) {
|
|
2660
|
+
registerDomainServiceTools(server, client, brand, options);
|
|
2661
|
+
}
|
|
2662
|
+
if (services.includes("wphosting")) {
|
|
2663
|
+
registerWphostingTools(server, client, brand);
|
|
2664
|
+
}
|
|
1033
2665
|
}
|
|
1034
2666
|
|
|
1035
2667
|
// ../core/dist/index.js
|
|
2668
|
+
var MCP_SERVICES = ["server", "domain", "wphosting"];
|
|
2669
|
+
function optionValue(argv, index) {
|
|
2670
|
+
const arg = argv[index];
|
|
2671
|
+
if (arg === "--services") {
|
|
2672
|
+
const value = argv[index + 1];
|
|
2673
|
+
if (!value || value.startsWith("--")) {
|
|
2674
|
+
throw new Error("--services requires a value.");
|
|
2675
|
+
}
|
|
2676
|
+
return { value, nextIndex: index + 1 };
|
|
2677
|
+
}
|
|
2678
|
+
return { value: arg.slice("--services=".length), nextIndex: index };
|
|
2679
|
+
}
|
|
2680
|
+
function parseMcpServices(argv = process.argv.slice(2), supportedServices = MCP_SERVICES) {
|
|
2681
|
+
let servicesValue;
|
|
2682
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
2683
|
+
const arg = argv[i];
|
|
2684
|
+
if (arg === "--services" || arg.startsWith("--services=")) {
|
|
2685
|
+
if (servicesValue !== void 0) {
|
|
2686
|
+
throw new Error("--services may be specified only once.");
|
|
2687
|
+
}
|
|
2688
|
+
const parsed = optionValue(argv, i);
|
|
2689
|
+
if (!parsed.value)
|
|
2690
|
+
throw new Error("--services requires a value.");
|
|
2691
|
+
servicesValue = parsed.value;
|
|
2692
|
+
i = parsed.nextIndex;
|
|
2693
|
+
} else {
|
|
2694
|
+
throw new Error(`Unknown argument "${arg}"; only --services is supported.`);
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
if (servicesValue === void 0)
|
|
2698
|
+
return ["server"];
|
|
2699
|
+
if (servicesValue === "all") {
|
|
2700
|
+
throw new Error("--services=all is not supported; list each service explicitly.");
|
|
2701
|
+
}
|
|
2702
|
+
const values = servicesValue.split(",").map((value) => value.trim());
|
|
2703
|
+
if (values.length === 0 || values.some((value) => value === "")) {
|
|
2704
|
+
throw new Error("--services must be a comma-separated list without empty values.");
|
|
2705
|
+
}
|
|
2706
|
+
if (new Set(values).size !== values.length) {
|
|
2707
|
+
throw new Error("--services must not contain duplicate services.");
|
|
2708
|
+
}
|
|
2709
|
+
for (const value of values) {
|
|
2710
|
+
if (!supportedServices.includes(value)) {
|
|
2711
|
+
throw new Error(`Unknown or unsupported service "${value}".`);
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
return values;
|
|
2715
|
+
}
|
|
2716
|
+
function instructionsFor(services, brand) {
|
|
2717
|
+
const common = `\u300C\u30C9\u30E1\u30A4\u30F3\u4E00\u89A7\u300D\u300CDNS\u5909\u66F4\u300D\u306A\u3069\u5BFE\u8C61\u30B5\u30FC\u30D3\u30B9\u304C\u66D6\u6627\u306A\u4F9D\u983C\u3067\u306F\u3001\u64CD\u4F5C\u524D\u306B\u5229\u7528\u8005\u3078\u5BFE\u8C61\u30B5\u30FC\u30D3\u30B9\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
2718
|
+
\u63A8\u6E2C\u3060\u3051\u3067\u66F8\u304D\u8FBC\u307F\u5148\u3092\u9078\u3070\u305A\u3001\u66F8\u304D\u8FBC\u307F\u524D\u306B\u5BFE\u8C61\u30B5\u30FC\u30D3\u30B9\u3001\u5951\u7D04\u3001\u30C9\u30E1\u30A4\u30F3\u307E\u305F\u306F\u30B5\u30A4\u30C8\u3092\u660E\u793A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`;
|
|
2719
|
+
const sections = [];
|
|
2720
|
+
if (services.includes("server")) {
|
|
2721
|
+
sections.push(`Server \u2014 ${brand.displayName}\u306E\u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FC\u3092\u7BA1\u7406\u3057\u307E\u3059\u3002
|
|
2722
|
+
\u30B5\u30FC\u30D0\u30FC\u60C5\u5831\u3001\u30C9\u30E1\u30A4\u30F3\u30FBSSL\u30FBWordPress\u3001\u30E1\u30FC\u30EB\u3001FTP\u3001MySQL\u3001Cron\u3001SSH\u3001DNS\u3001PHP\u3001\u30ED\u30B0\u7B49\u3092\u64CD\u4F5C\u3067\u304D\u307E\u3059\u3002
|
|
2723
|
+
\u64CD\u4F5C\u524D\u306Blist/get\u7CFB\u30C4\u30FC\u30EB\u3067\u73FE\u5728\u306E\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3001delete\u7CFB\u306F\u5B9F\u884C\u524D\u306B\u5229\u7528\u8005\u306E\u78BA\u8A8D\u3092\u53D6\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
2724
|
+
XSERVER_SERVERNAME\u7B49\u304C\u3042\u308B\u5834\u5408\u306F\u305D\u306E\u30B5\u30FC\u30D0\u30FC\u306B\u56FA\u5B9A\u3055\u308C\u307E\u3059\u3002\u672A\u8A2D\u5B9A\u6642\u306F\u30C4\u30FC\u30EB\u306Eservername\u3092\u4F7F\u7528\u3057\u3001\u5BFE\u8C61\u304C1\u53F0\u3060\u3051\u306EAPI\u30AD\u30FC\u306B\u9650\u308A\u7701\u7565\u6642\u306B\u81EA\u52D5\u9078\u629E\u3057\u307E\u3059\u3002\u8907\u6570\u5BFE\u8C61\u307E\u305F\u306F\u3059\u3079\u3066\u5BFE\u8C61\u3067\u306F\u3001\u524D\u56DE\u306E\u64CD\u4F5C\u5148\u3092\u5F15\u304D\u7D99\u304C\u305Aservername\u306E\u6307\u5B9A\u3092\u6C42\u3081\u307E\u3059\u3002`);
|
|
2725
|
+
}
|
|
2726
|
+
if (services.includes("domain")) {
|
|
2727
|
+
sections.push(`Domain \u2014 \u30C9\u30E1\u30A4\u30F3\u30EC\u30B8\u30B9\u30C8\u30E9\u3067\u4FDD\u6709\u30FB\u7BA1\u7406\u3059\u308B\u30C9\u30E1\u30A4\u30F3\u3092\u64CD\u4F5C\u3057\u307E\u3059\u3002\u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FC\u306E\u30C9\u30E1\u30A4\u30F3\u8A2D\u5B9A\u3092\u64CD\u4F5C\u3059\u308BServer API\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
|
|
2728
|
+
\u30C9\u30E1\u30A4\u30F3\u3001\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\u3001\u30EC\u30B8\u30B9\u30C8\u30E9\u5074DNS\u3001Whois\u3001\u30EC\u30B8\u30B9\u30C8\u30E9\u30ED\u30C3\u30AF\u3001\u53D6\u5F97\u30FB\u79FB\u7BA1\u30FB\u66F4\u65B0\u3092\u7BA1\u7406\u3067\u304D\u307E\u3059\u3002
|
|
2729
|
+
\u8AB2\u91D1\u64CD\u4F5C\u306Eexecute\u3092\u547C\u3076\u524D\u306Bpreview\u3092\u5B9F\u884C\u3057\u3001\u5BFE\u8C61\u3001\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D\u3001\u53D6\u308A\u6D88\u305B\u306A\u3044\u3053\u3068\u3092\u5229\u7528\u8005\u3078\u63D0\u793A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u5B9F\u7533\u8ACB\u306FMCP form elicitation\u306B\u3088\u308B\u30CD\u30A4\u30C6\u30A3\u30D6\u78BA\u8A8D\u304C\u5FC5\u9808\u3067\u3059\u3002`);
|
|
2730
|
+
}
|
|
2731
|
+
if (services.includes("wphosting")) {
|
|
2732
|
+
sections.push(`WPhosting \u2014 XServer for WordPress\u5951\u7D04\u30B5\u30A4\u30C8\u3092\u7BA1\u7406\u3057\u307E\u3059\u3002\u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FCServer API\u306EWordPress\u7C21\u5358\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3001DNS\u3001Cron\u3001SSH\u3092\u64CD\u4F5C\u3059\u308B\u30B5\u30FC\u30D3\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
|
|
2733
|
+
\u5BFE\u8C61\u306Fcontract_id\uFF08\u5951\u7D04\uFF09\u3068site servername\uFF08\u672C\u756A\u307E\u305F\u306F\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\u74B0\u5883\uFF09\u306E2\u8EF8\u3067\u5FC5\u305A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u66F8\u304D\u8FBC\u307F\u524D\u306B\u4E21\u65B9\u3092\u5229\u7528\u8005\u3078\u63D0\u793A\u3057\u3001\u5BFE\u8C61\u304C\u66D6\u6627\u306A\u3089\u63A8\u6E2C\u305B\u305A\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
2734
|
+
202\u64CD\u4F5C\u306Foperations API\u3092\u4F7F\u308F\u305A\u3001\u5404\u30C4\u30FC\u30EB\u8AAC\u660E\u306B\u8A18\u8F09\u3057\u305F\u30B5\u30A4\u30C8\u3001\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3001\u5FA9\u5143\u5C65\u6B74\u306E\u78BA\u8A8D\u5148\u3067status\u307E\u305F\u306F\u5BFE\u8C61\u306E\u6D88\u5931\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
2735
|
+
\u30B5\u30A4\u30C8\u524A\u9664\u3068\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u5FA9\u5143\u306Fpreview\u3067\u5BFE\u8C61\u30FB\u5F71\u97FF\u3092\u78BA\u8A8D\u3057\u3001\u660E\u793A\u627F\u8A8D\u5F8C\u306Bexecute\u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);
|
|
2736
|
+
}
|
|
2737
|
+
return `${brand.displayName} MCP \u2014 \u6709\u52B9\u306A\u30B5\u30FC\u30D3\u30B9: ${services.join(", ")}
|
|
2738
|
+
|
|
2739
|
+
${sections.join("\n\n")}
|
|
2740
|
+
|
|
2741
|
+
${common}`;
|
|
2742
|
+
}
|
|
1036
2743
|
async function run(brand, options) {
|
|
1037
2744
|
const envPrefix = brand.brand.toUpperCase();
|
|
1038
2745
|
const apiKey = process.env[`${envPrefix}_API_KEY`] ?? process.env["XSERVER_API_KEY"];
|
|
1039
|
-
const
|
|
2746
|
+
const servername2 = process.env[`${envPrefix}_SERVERNAME`] ?? process.env["XSERVER_SERVERNAME"];
|
|
1040
2747
|
const baseUrl = process.env[`${envPrefix}_API_BASE_URL`];
|
|
2748
|
+
const enableHighRiskExecute = (process.env[`${envPrefix}_MCP_ENABLE_HIGH_RISK_EXECUTE`] ?? process.env.XSERVER_MCP_ENABLE_HIGH_RISK_EXECUTE) === "1";
|
|
2749
|
+
let services;
|
|
2750
|
+
try {
|
|
2751
|
+
const supportedServices = brand.brand === "xserver" ? ["server", "domain", "wphosting"] : ["server", "domain"];
|
|
2752
|
+
services = parseMcpServices(process.argv.slice(2), supportedServices);
|
|
2753
|
+
} catch (error) {
|
|
2754
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
2755
|
+
process.exit(1);
|
|
2756
|
+
}
|
|
1041
2757
|
if (!apiKey) {
|
|
1042
2758
|
console.error(`Error: ${envPrefix}_API_KEY environment variable is required.`);
|
|
1043
2759
|
console.error(`Get your API key at the ${brand.displayName} control panel.`);
|
|
1044
2760
|
process.exit(1);
|
|
1045
2761
|
}
|
|
1046
|
-
|
|
1047
|
-
console.error(`Error: ${envPrefix}_SERVERNAME environment variable is required.`);
|
|
1048
|
-
process.exit(1);
|
|
1049
|
-
}
|
|
2762
|
+
const apiBase = baseUrl ?? brand.apiBase;
|
|
1050
2763
|
const client = new ApiClient({
|
|
1051
2764
|
apiKey,
|
|
1052
|
-
apiBase
|
|
1053
|
-
servername
|
|
2765
|
+
apiBase,
|
|
2766
|
+
servername: servername2
|
|
1054
2767
|
});
|
|
2768
|
+
const serverTargetResolver = services.includes("server") ? new ServerTargetResolver({
|
|
2769
|
+
apiKey,
|
|
2770
|
+
apiBase,
|
|
2771
|
+
fixedServername: servername2
|
|
2772
|
+
}) : void 0;
|
|
1055
2773
|
const server = new McpServer({
|
|
1056
2774
|
name: options.name,
|
|
1057
2775
|
version: options.version
|
|
1058
2776
|
}, {
|
|
1059
|
-
instructions:
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
\u64CD\u4F5C\u524D\u306B\u73FE\u5728\u306E\u72B6\u614B\u3092\u78BA\u8A8D\uFF08list/get\u7CFB\u30C4\u30FC\u30EB\uFF09\u3057\u3066\u304B\u3089\u5909\u66F4\u3092\u884C\u3046\u3053\u3068\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
|
|
1066
|
-
\u7834\u58CA\u7684\u64CD\u4F5C\uFF08delete\u7CFB\uFF09\u306F\u5B9F\u884C\u524D\u306B\u30E6\u30FC\u30B6\u30FC\u306B\u78BA\u8A8D\u3092\u53D6\u3063\u3066\u304F\u3060\u3055\u3044\u3002`
|
|
2777
|
+
instructions: instructionsFor(services, brand)
|
|
2778
|
+
});
|
|
2779
|
+
registerAllTools(server, client, brand, services, {
|
|
2780
|
+
enableHighRiskExecute,
|
|
2781
|
+
serverTargetResolver
|
|
1067
2782
|
});
|
|
1068
|
-
registerAllTools(server, client, brand);
|
|
1069
2783
|
const transport = new StdioServerTransport();
|
|
1070
2784
|
await server.connect(transport);
|
|
1071
2785
|
}
|
|
@@ -1073,7 +2787,7 @@ DNS\u30EC\u30B3\u30FC\u30C9\u7BA1\u7406\u3001PHP\u30D0\u30FC\u30B8\u30E7\u30F3\u
|
|
|
1073
2787
|
// package.json
|
|
1074
2788
|
var package_default = {
|
|
1075
2789
|
name: "xserver-mcp",
|
|
1076
|
-
version: "1.
|
|
2790
|
+
version: "1.3.0",
|
|
1077
2791
|
description: "Official MCP server for XServer API \u2014 manage your XServer hosting from AI assistants",
|
|
1078
2792
|
type: "module",
|
|
1079
2793
|
bin: {
|
|
@@ -1106,7 +2820,7 @@ var package_default = {
|
|
|
1106
2820
|
access: "public"
|
|
1107
2821
|
},
|
|
1108
2822
|
dependencies: {
|
|
1109
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
2823
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
1110
2824
|
zod: "^3.24.0"
|
|
1111
2825
|
},
|
|
1112
2826
|
devDependencies: {
|
|
@@ -1123,6 +2837,8 @@ await run({
|
|
|
1123
2837
|
brand: "xserver",
|
|
1124
2838
|
apiBase: "https://api.xserver.ne.jp",
|
|
1125
2839
|
displayName: "XServer",
|
|
2840
|
+
domainTermsUrl: "https://www.xdomain.ne.jp/rule/rule.php",
|
|
2841
|
+
domainPrivacyUrl: "https://www.xdomain.ne.jp/privacy_announcement.php",
|
|
1126
2842
|
commandName: "xserver-mcp",
|
|
1127
2843
|
configDir: "xserver-mcp"
|
|
1128
2844
|
}, {
|