xserver-mcp 1.2.0 → 1.4.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 +105 -33
- package/dist/index.js +1912 -433
- 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;
|
|
@@ -37,6 +48,27 @@ var ApiClient = class {
|
|
|
37
48
|
return `/v1/server/${encodeURIComponent(this.servername)}`;
|
|
38
49
|
}
|
|
39
50
|
// ================================================================
|
|
51
|
+
// サーバーサービスAPI(/v1/server・servername非依存)
|
|
52
|
+
// ================================================================
|
|
53
|
+
async listServerPlans(params) {
|
|
54
|
+
return this.get("/v1/server/plans", params);
|
|
55
|
+
}
|
|
56
|
+
async registerServer(data, idempotencyKey4) {
|
|
57
|
+
return this.post("/v1/server", data, idempotencyHeaders(idempotencyKey4));
|
|
58
|
+
}
|
|
59
|
+
async listServers() {
|
|
60
|
+
return this.get("/v1/server");
|
|
61
|
+
}
|
|
62
|
+
async getServerSignupStatus(servername3) {
|
|
63
|
+
return this.get(`/v1/server/${enc(servername3)}/signup-status`);
|
|
64
|
+
}
|
|
65
|
+
async getServerMemo(servername3) {
|
|
66
|
+
return this.get(`/v1/server/${enc(servername3)}/memo`);
|
|
67
|
+
}
|
|
68
|
+
async updateServerMemo(servername3, data) {
|
|
69
|
+
return this.put(`/v1/server/${enc(servername3)}/memo`, data);
|
|
70
|
+
}
|
|
71
|
+
// ================================================================
|
|
40
72
|
// サーバー情報
|
|
41
73
|
// ================================================================
|
|
42
74
|
async getServerInfo() {
|
|
@@ -117,11 +149,11 @@ var ApiClient = class {
|
|
|
117
149
|
async listSpamFilter(params) {
|
|
118
150
|
return this.get(`${this.serverPath()}/spam-filter`, params);
|
|
119
151
|
}
|
|
120
|
-
async updateSpamFilter(
|
|
121
|
-
return this.put(`${this.serverPath()}/spam-filter/${enc(
|
|
152
|
+
async updateSpamFilter(domain2, data) {
|
|
153
|
+
return this.put(`${this.serverPath()}/spam-filter/${enc(domain2)}`, data);
|
|
122
154
|
}
|
|
123
|
-
async updateSpamFilterDmarcReceiver(
|
|
124
|
-
return this.put(`${this.serverPath()}/spam-filter/${enc(
|
|
155
|
+
async updateSpamFilterDmarcReceiver(domain2, data) {
|
|
156
|
+
return this.put(`${this.serverPath()}/spam-filter/${enc(domain2)}/dmarc-receiver`, data);
|
|
125
157
|
}
|
|
126
158
|
// ================================================================
|
|
127
159
|
// 自動応答設定
|
|
@@ -147,8 +179,8 @@ var ApiClient = class {
|
|
|
147
179
|
async listSmtpAbroadRestriction(params) {
|
|
148
180
|
return this.get(`${this.serverPath()}/smtp-abroad-restriction`, params);
|
|
149
181
|
}
|
|
150
|
-
async updateSmtpAbroadRestriction(
|
|
151
|
-
return this.put(`${this.serverPath()}/smtp-abroad-restriction/${enc(
|
|
182
|
+
async updateSmtpAbroadRestriction(domain2, data) {
|
|
183
|
+
return this.put(`${this.serverPath()}/smtp-abroad-restriction/${enc(domain2)}`, data);
|
|
152
184
|
}
|
|
153
185
|
// ================================================================
|
|
154
186
|
// DKIM設定
|
|
@@ -183,8 +215,8 @@ var ApiClient = class {
|
|
|
183
215
|
async listDmarc(params) {
|
|
184
216
|
return this.get(`${this.serverPath()}/dmarc`, params);
|
|
185
217
|
}
|
|
186
|
-
async updateDmarc(
|
|
187
|
-
return this.put(`${this.serverPath()}/dmarc/${enc(
|
|
218
|
+
async updateDmarc(domain2, data) {
|
|
219
|
+
return this.put(`${this.serverPath()}/dmarc/${enc(domain2)}`, data);
|
|
188
220
|
}
|
|
189
221
|
// ================================================================
|
|
190
222
|
// FTP
|
|
@@ -243,8 +275,8 @@ var ApiClient = class {
|
|
|
243
275
|
async getPhpVersion(params) {
|
|
244
276
|
return this.get(`${this.serverPath()}/php-version`, params);
|
|
245
277
|
}
|
|
246
|
-
async updatePhpVersion(
|
|
247
|
-
return this.put(`${this.serverPath()}/php-version/${enc(
|
|
278
|
+
async updatePhpVersion(domain2, data) {
|
|
279
|
+
return this.put(`${this.serverPath()}/php-version/${enc(domain2)}`, data);
|
|
248
280
|
}
|
|
249
281
|
// ================================================================
|
|
250
282
|
// ドメイン(サーバーパネル)
|
|
@@ -252,20 +284,20 @@ var ApiClient = class {
|
|
|
252
284
|
async listDomain() {
|
|
253
285
|
return this.get(`${this.serverPath()}/domain`);
|
|
254
286
|
}
|
|
255
|
-
async getDomain(
|
|
256
|
-
return this.get(`${this.serverPath()}/domain/${enc(
|
|
287
|
+
async getDomain(domain2) {
|
|
288
|
+
return this.get(`${this.serverPath()}/domain/${enc(domain2)}`);
|
|
257
289
|
}
|
|
258
290
|
async addDomain(data) {
|
|
259
291
|
return this.post(`${this.serverPath()}/domain`, data);
|
|
260
292
|
}
|
|
261
|
-
async updateDomain(
|
|
262
|
-
return this.put(`${this.serverPath()}/domain/${enc(
|
|
293
|
+
async updateDomain(domain2, data) {
|
|
294
|
+
return this.put(`${this.serverPath()}/domain/${enc(domain2)}`, data);
|
|
263
295
|
}
|
|
264
|
-
async deleteDomain(
|
|
265
|
-
return this.delete(`${this.serverPath()}/domain/${enc(
|
|
296
|
+
async deleteDomain(domain2, data) {
|
|
297
|
+
return this.delete(`${this.serverPath()}/domain/${enc(domain2)}`, data);
|
|
266
298
|
}
|
|
267
|
-
async resetDomain(
|
|
268
|
-
return this.post(`${this.serverPath()}/domain/${enc(
|
|
299
|
+
async resetDomain(domain2, data) {
|
|
300
|
+
return this.post(`${this.serverPath()}/domain/${enc(domain2)}/reset`, data);
|
|
269
301
|
}
|
|
270
302
|
// ================================================================
|
|
271
303
|
// サブドメイン
|
|
@@ -303,11 +335,11 @@ var ApiClient = class {
|
|
|
303
335
|
async addDns(data) {
|
|
304
336
|
return this.post(`${this.serverPath()}/dns`, data);
|
|
305
337
|
}
|
|
306
|
-
async updateDns(
|
|
307
|
-
return this.put(`${this.serverPath()}/dns/${enc(
|
|
338
|
+
async updateDns(dnsId2, data) {
|
|
339
|
+
return this.put(`${this.serverPath()}/dns/${enc(dnsId2)}`, data);
|
|
308
340
|
}
|
|
309
|
-
async deleteDns(
|
|
310
|
-
return this.delete(`${this.serverPath()}/dns/${enc(
|
|
341
|
+
async deleteDns(dnsId2, data) {
|
|
342
|
+
return this.delete(`${this.serverPath()}/dns/${enc(dnsId2)}`, data);
|
|
311
343
|
}
|
|
312
344
|
// ================================================================
|
|
313
345
|
// SSH
|
|
@@ -342,8 +374,8 @@ var ApiClient = class {
|
|
|
342
374
|
async listWaf(params) {
|
|
343
375
|
return this.get(`${this.serverPath()}/waf`, params);
|
|
344
376
|
}
|
|
345
|
-
async updateWaf(
|
|
346
|
-
return this.put(`${this.serverPath()}/waf/${enc(
|
|
377
|
+
async updateWaf(domain2, data) {
|
|
378
|
+
return this.put(`${this.serverPath()}/waf/${enc(domain2)}`, data);
|
|
347
379
|
}
|
|
348
380
|
// ================================================================
|
|
349
381
|
// php.ini設定
|
|
@@ -351,11 +383,11 @@ var ApiClient = class {
|
|
|
351
383
|
async listPhpIni(params) {
|
|
352
384
|
return this.get(`${this.serverPath()}/php-ini`, params);
|
|
353
385
|
}
|
|
354
|
-
async updatePhpIni(
|
|
355
|
-
return this.put(`${this.serverPath()}/php-ini/${enc(
|
|
386
|
+
async updatePhpIni(domain2, data) {
|
|
387
|
+
return this.put(`${this.serverPath()}/php-ini/${enc(domain2)}`, data);
|
|
356
388
|
}
|
|
357
|
-
async resetPhpIni(
|
|
358
|
-
return this.post(`${this.serverPath()}/php-ini/${enc(
|
|
389
|
+
async resetPhpIni(domain2) {
|
|
390
|
+
return this.post(`${this.serverPath()}/php-ini/${enc(domain2)}/reset`);
|
|
359
391
|
}
|
|
360
392
|
// ================================================================
|
|
361
393
|
// WordPressセキュリティ設定
|
|
@@ -372,8 +404,8 @@ var ApiClient = class {
|
|
|
372
404
|
async listXAccelerator(params) {
|
|
373
405
|
return this.get(`${this.serverPath()}/x-accelerator`, params);
|
|
374
406
|
}
|
|
375
|
-
async updateXAccelerator(
|
|
376
|
-
return this.put(`${this.serverPath()}/x-accelerator/${enc(
|
|
407
|
+
async updateXAccelerator(domain2, data) {
|
|
408
|
+
return this.put(`${this.serverPath()}/x-accelerator/${enc(domain2)}`, data);
|
|
377
409
|
}
|
|
378
410
|
// ================================================================
|
|
379
411
|
// サーバーキャッシュ設定
|
|
@@ -381,11 +413,11 @@ var ApiClient = class {
|
|
|
381
413
|
async listServerCache(params) {
|
|
382
414
|
return this.get(`${this.serverPath()}/server-cache`, params);
|
|
383
415
|
}
|
|
384
|
-
async updateServerCache(
|
|
385
|
-
return this.put(`${this.serverPath()}/server-cache/${enc(
|
|
416
|
+
async updateServerCache(domain2, data) {
|
|
417
|
+
return this.put(`${this.serverPath()}/server-cache/${enc(domain2)}`, data);
|
|
386
418
|
}
|
|
387
|
-
async clearServerCache(
|
|
388
|
-
return this.delete(`${this.serverPath()}/server-cache/${enc(
|
|
419
|
+
async clearServerCache(domain2) {
|
|
420
|
+
return this.delete(`${this.serverPath()}/server-cache/${enc(domain2)}/cache`);
|
|
389
421
|
}
|
|
390
422
|
// ================================================================
|
|
391
423
|
// ブラウザキャッシュ設定
|
|
@@ -393,8 +425,8 @@ var ApiClient = class {
|
|
|
393
425
|
async listBrowserCache(params) {
|
|
394
426
|
return this.get(`${this.serverPath()}/browser-cache`, params);
|
|
395
427
|
}
|
|
396
|
-
async updateBrowserCache(
|
|
397
|
-
return this.put(`${this.serverPath()}/browser-cache/${enc(
|
|
428
|
+
async updateBrowserCache(domain2, data) {
|
|
429
|
+
return this.put(`${this.serverPath()}/browser-cache/${enc(domain2)}`, data);
|
|
398
430
|
}
|
|
399
431
|
// ================================================================
|
|
400
432
|
// サイト転送設定
|
|
@@ -429,8 +461,8 @@ var ApiClient = class {
|
|
|
429
461
|
async listXPageSpeed(params) {
|
|
430
462
|
return this.get(`${this.serverPath()}/xpagespeed`, params);
|
|
431
463
|
}
|
|
432
|
-
async updateXPageSpeed(
|
|
433
|
-
return this.put(`${this.serverPath()}/xpagespeed/${enc(
|
|
464
|
+
async updateXPageSpeed(domain2, data) {
|
|
465
|
+
return this.put(`${this.serverPath()}/xpagespeed/${enc(domain2)}`, data);
|
|
434
466
|
}
|
|
435
467
|
// ================================================================
|
|
436
468
|
// 自動バックアップの取得・復元
|
|
@@ -478,6 +510,258 @@ var ApiClient = class {
|
|
|
478
510
|
return this.get("/v1/me");
|
|
479
511
|
}
|
|
480
512
|
// ================================================================
|
|
513
|
+
// ドメインサービスAPI(/v1/domain・servername非依存)
|
|
514
|
+
// ================================================================
|
|
515
|
+
domainPath(domainName2) {
|
|
516
|
+
return `/v1/domain/${enc(domainName2)}`;
|
|
517
|
+
}
|
|
518
|
+
async listDomains() {
|
|
519
|
+
return this.get("/v1/domain");
|
|
520
|
+
}
|
|
521
|
+
async getDomainDetail(domainName2) {
|
|
522
|
+
return this.get(this.domainPath(domainName2));
|
|
523
|
+
}
|
|
524
|
+
async getDomainNameservers(domainName2) {
|
|
525
|
+
return this.get(`${this.domainPath(domainName2)}/nameservers`);
|
|
526
|
+
}
|
|
527
|
+
async updateDomainNameservers(domainName2, data) {
|
|
528
|
+
return this.put(`${this.domainPath(domainName2)}/nameservers`, data);
|
|
529
|
+
}
|
|
530
|
+
async getDomainWhois(domainName2) {
|
|
531
|
+
return this.get(`${this.domainPath(domainName2)}/whois`);
|
|
532
|
+
}
|
|
533
|
+
async updateDomainWhois(domainName2, data) {
|
|
534
|
+
return this.put(`${this.domainPath(domainName2)}/whois`, data);
|
|
535
|
+
}
|
|
536
|
+
async getDomainRegistrarLock(domainName2) {
|
|
537
|
+
return this.get(`${this.domainPath(domainName2)}/registrar-lock`);
|
|
538
|
+
}
|
|
539
|
+
async updateDomainRegistrarLock(domainName2, data) {
|
|
540
|
+
return this.put(`${this.domainPath(domainName2)}/registrar-lock`, data);
|
|
541
|
+
}
|
|
542
|
+
async listDomainDns(domainName2) {
|
|
543
|
+
return this.get(`${this.domainPath(domainName2)}/dns`);
|
|
544
|
+
}
|
|
545
|
+
async addDomainDns(domainName2, data) {
|
|
546
|
+
return this.post(`${this.domainPath(domainName2)}/dns`, data);
|
|
547
|
+
}
|
|
548
|
+
async updateDomainDns(domainName2, dnsId2, data) {
|
|
549
|
+
return this.put(`${this.domainPath(domainName2)}/dns/${enc(dnsId2)}`, data);
|
|
550
|
+
}
|
|
551
|
+
async deleteDomainDns(domainName2, dnsId2) {
|
|
552
|
+
return this.delete(`${this.domainPath(domainName2)}/dns/${enc(dnsId2)}`);
|
|
553
|
+
}
|
|
554
|
+
async checkDomain(domainName2) {
|
|
555
|
+
return this.get("/v1/domain/check", { domain_name: domainName2 });
|
|
556
|
+
}
|
|
557
|
+
async getDomainPricing(params) {
|
|
558
|
+
return this.get("/v1/domain/pricing", params);
|
|
559
|
+
}
|
|
560
|
+
async registerDomain(data, idempotencyKey4) {
|
|
561
|
+
return this.post("/v1/domain", data, idempotencyHeaders(idempotencyKey4));
|
|
562
|
+
}
|
|
563
|
+
async transferDomain(domainName2, data, idempotencyKey4) {
|
|
564
|
+
return this.post(`${this.domainPath(domainName2)}/transfer`, data, idempotencyHeaders(idempotencyKey4));
|
|
565
|
+
}
|
|
566
|
+
async renewDomain(domainName2, data, idempotencyKey4) {
|
|
567
|
+
return this.post(`${this.domainPath(domainName2)}/renew`, data, idempotencyHeaders(idempotencyKey4));
|
|
568
|
+
}
|
|
569
|
+
// ================================================================
|
|
570
|
+
// WPhosting API(/v1/wphosting/{contract_id})
|
|
571
|
+
// ================================================================
|
|
572
|
+
wphostingPath(contractId2) {
|
|
573
|
+
return `/v1/wphosting/${enc(contractId2)}`;
|
|
574
|
+
}
|
|
575
|
+
wphostingSitePath(contractId2, servername3) {
|
|
576
|
+
return `${this.wphostingPath(contractId2)}/sites/${enc(servername3)}`;
|
|
577
|
+
}
|
|
578
|
+
async listWphostingPlans(params) {
|
|
579
|
+
return this.get("/v1/wphosting/plans", params);
|
|
580
|
+
}
|
|
581
|
+
async registerWphosting(data, idempotencyKey4) {
|
|
582
|
+
return this.post("/v1/wphosting", data, idempotencyHeaders(idempotencyKey4));
|
|
583
|
+
}
|
|
584
|
+
async listWphostingContracts() {
|
|
585
|
+
return this.get("/v1/wphosting");
|
|
586
|
+
}
|
|
587
|
+
async getWphostingMemo(contractId2) {
|
|
588
|
+
return this.get(`${this.wphostingPath(contractId2)}/memo`);
|
|
589
|
+
}
|
|
590
|
+
async updateWphostingMemo(contractId2, data) {
|
|
591
|
+
return this.put(`${this.wphostingPath(contractId2)}/memo`, data);
|
|
592
|
+
}
|
|
593
|
+
async listWphostingSites(contractId2) {
|
|
594
|
+
return this.get(`${this.wphostingPath(contractId2)}/sites`);
|
|
595
|
+
}
|
|
596
|
+
async getWphostingSite(contractId2, servername3) {
|
|
597
|
+
return this.get(this.wphostingSitePath(contractId2, servername3));
|
|
598
|
+
}
|
|
599
|
+
async createWphostingSite(contractId2, data, idempotencyKey4) {
|
|
600
|
+
return this.post(`${this.wphostingPath(contractId2)}/sites`, data, idempotencyHeaders(idempotencyKey4));
|
|
601
|
+
}
|
|
602
|
+
async deleteWphostingSite(contractId2, servername3, idempotencyKey4) {
|
|
603
|
+
return this.delete(this.wphostingSitePath(contractId2, servername3), void 0, idempotencyHeaders(idempotencyKey4));
|
|
604
|
+
}
|
|
605
|
+
async getWphostingUsage(contractId2) {
|
|
606
|
+
return this.get(`${this.wphostingPath(contractId2)}/usage`);
|
|
607
|
+
}
|
|
608
|
+
async createWphostingStaging(contractId2, servername3, data, idempotencyKey4) {
|
|
609
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/staging`, data, idempotencyHeaders(idempotencyKey4));
|
|
610
|
+
}
|
|
611
|
+
async listWphostingBackups(contractId2, servername3) {
|
|
612
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/backups`);
|
|
613
|
+
}
|
|
614
|
+
async createWphostingBackup(contractId2, servername3, data, idempotencyKey4) {
|
|
615
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/backups`, data, idempotencyHeaders(idempotencyKey4));
|
|
616
|
+
}
|
|
617
|
+
async restoreWphostingBackup(contractId2, servername3, backupId, idempotencyKey4) {
|
|
618
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/backups/${enc(backupId)}/restore`, void 0, idempotencyHeaders(idempotencyKey4));
|
|
619
|
+
}
|
|
620
|
+
async listWphostingBackupRestoreHistory(contractId2, servername3) {
|
|
621
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/backups/restore-history`);
|
|
622
|
+
}
|
|
623
|
+
async deleteWphostingBackup(contractId2, servername3, backupId) {
|
|
624
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/backups/${enc(backupId)}`);
|
|
625
|
+
}
|
|
626
|
+
async getWphostingWordPress(contractId2, servername3) {
|
|
627
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/wordpress`);
|
|
628
|
+
}
|
|
629
|
+
async updateWphostingWordPress(contractId2, servername3, data) {
|
|
630
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/wordpress`, data);
|
|
631
|
+
}
|
|
632
|
+
async upgradeWphostingWordPress(contractId2, servername3) {
|
|
633
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/wordpress/update`);
|
|
634
|
+
}
|
|
635
|
+
async getWphostingMaintenanceMode(contractId2, servername3) {
|
|
636
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/maintenance-mode`);
|
|
637
|
+
}
|
|
638
|
+
async updateWphostingMaintenanceMode(contractId2, servername3, data) {
|
|
639
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/maintenance-mode`, data);
|
|
640
|
+
}
|
|
641
|
+
async listWphostingPlugins(contractId2, servername3) {
|
|
642
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/plugins`);
|
|
643
|
+
}
|
|
644
|
+
async installWphostingPlugin(contractId2, servername3, data) {
|
|
645
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/plugins`, data);
|
|
646
|
+
}
|
|
647
|
+
async updateWphostingPlugin(contractId2, servername3, plugin, data) {
|
|
648
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/plugins/${enc(plugin)}`, data);
|
|
649
|
+
}
|
|
650
|
+
async upgradeWphostingPlugin(contractId2, servername3, plugin) {
|
|
651
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/plugins/${enc(plugin)}/update`);
|
|
652
|
+
}
|
|
653
|
+
async deleteWphostingPlugin(contractId2, servername3, plugin) {
|
|
654
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/plugins/${enc(plugin)}`);
|
|
655
|
+
}
|
|
656
|
+
async listWphostingThemes(contractId2, servername3) {
|
|
657
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/themes`);
|
|
658
|
+
}
|
|
659
|
+
async installWphostingTheme(contractId2, servername3, data) {
|
|
660
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/themes`, data);
|
|
661
|
+
}
|
|
662
|
+
async updateWphostingTheme(contractId2, servername3, theme, data) {
|
|
663
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/themes/${enc(theme)}`, data);
|
|
664
|
+
}
|
|
665
|
+
async upgradeWphostingTheme(contractId2, servername3, theme) {
|
|
666
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/themes/${enc(theme)}/update`);
|
|
667
|
+
}
|
|
668
|
+
async deleteWphostingTheme(contractId2, servername3, theme) {
|
|
669
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/themes/${enc(theme)}`);
|
|
670
|
+
}
|
|
671
|
+
async listWphostingDomains(contractId2, servername3) {
|
|
672
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/domains`);
|
|
673
|
+
}
|
|
674
|
+
async addWphostingDomain(contractId2, servername3, data) {
|
|
675
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/domains`, data);
|
|
676
|
+
}
|
|
677
|
+
async verifyWphostingDomain(contractId2, servername3, domain2) {
|
|
678
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/verify`);
|
|
679
|
+
}
|
|
680
|
+
async deleteWphostingDomain(contractId2, servername3, domain2) {
|
|
681
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}`);
|
|
682
|
+
}
|
|
683
|
+
async updateWphostingSiteUrl(contractId2, servername3, data) {
|
|
684
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/site-url`, data);
|
|
685
|
+
}
|
|
686
|
+
async listWphostingDnsRecords(contractId2, servername3, domain2) {
|
|
687
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/dns`);
|
|
688
|
+
}
|
|
689
|
+
async addWphostingDnsRecord(contractId2, servername3, domain2, data) {
|
|
690
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/dns`, data);
|
|
691
|
+
}
|
|
692
|
+
async updateWphostingDnsRecord(contractId2, servername3, domain2, dnsId2, data) {
|
|
693
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/dns/${enc(dnsId2)}`, data);
|
|
694
|
+
}
|
|
695
|
+
async deleteWphostingDnsRecord(contractId2, servername3, domain2, dnsId2) {
|
|
696
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/dns/${enc(dnsId2)}`);
|
|
697
|
+
}
|
|
698
|
+
async getWphostingPhpVersion(contractId2, servername3) {
|
|
699
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/php-version`);
|
|
700
|
+
}
|
|
701
|
+
async updateWphostingPhpVersion(contractId2, servername3, data) {
|
|
702
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/php-version`, data);
|
|
703
|
+
}
|
|
704
|
+
async getWphostingAccessLog(contractId2, servername3, params) {
|
|
705
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/access-log`, params);
|
|
706
|
+
}
|
|
707
|
+
async getWphostingErrorLog(contractId2, servername3, params) {
|
|
708
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/error-log`, params);
|
|
709
|
+
}
|
|
710
|
+
async listWphostingCron(contractId2, servername3) {
|
|
711
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/cron`);
|
|
712
|
+
}
|
|
713
|
+
async addWphostingCron(contractId2, servername3, data) {
|
|
714
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/cron`, data);
|
|
715
|
+
}
|
|
716
|
+
async updateWphostingCron(contractId2, servername3, cronId, data) {
|
|
717
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/cron/${enc(cronId)}`, data);
|
|
718
|
+
}
|
|
719
|
+
async deleteWphostingCron(contractId2, servername3, cronId) {
|
|
720
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/cron/${enc(cronId)}`);
|
|
721
|
+
}
|
|
722
|
+
async getWphostingSsh(contractId2, servername3) {
|
|
723
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/ssh`);
|
|
724
|
+
}
|
|
725
|
+
async updateWphostingSsh(contractId2, servername3, data) {
|
|
726
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/ssh`, data);
|
|
727
|
+
}
|
|
728
|
+
async listWphostingSshKeys(contractId2, servername3) {
|
|
729
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/ssh/key`);
|
|
730
|
+
}
|
|
731
|
+
async addWphostingSshKey(contractId2, servername3, data) {
|
|
732
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/ssh/key`, data);
|
|
733
|
+
}
|
|
734
|
+
async updateWphostingSshKey(contractId2, servername3, keyId, data) {
|
|
735
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/ssh/key/${enc(keyId)}`, data);
|
|
736
|
+
}
|
|
737
|
+
async deleteWphostingSshKey(contractId2, servername3, keyId) {
|
|
738
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/ssh/key/${enc(keyId)}`);
|
|
739
|
+
}
|
|
740
|
+
async listWphostingWpUserRoles(contractId2, servername3) {
|
|
741
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/wp-users/roles`);
|
|
742
|
+
}
|
|
743
|
+
async listWphostingWpUsers(contractId2, servername3, params) {
|
|
744
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/wp-users`, params);
|
|
745
|
+
}
|
|
746
|
+
async createWphostingWpUser(contractId2, servername3, data) {
|
|
747
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/wp-users`, data);
|
|
748
|
+
}
|
|
749
|
+
async getWphostingWpUser(contractId2, servername3, userId) {
|
|
750
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/wp-users/${enc(userId)}`);
|
|
751
|
+
}
|
|
752
|
+
async updateWphostingWpUser(contractId2, servername3, userId, data) {
|
|
753
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/wp-users/${enc(userId)}`, data);
|
|
754
|
+
}
|
|
755
|
+
async deleteWphostingWpUser(contractId2, servername3, userId) {
|
|
756
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/wp-users/${enc(userId)}`);
|
|
757
|
+
}
|
|
758
|
+
async getWphostingSecurity(contractId2, servername3) {
|
|
759
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/security`);
|
|
760
|
+
}
|
|
761
|
+
async updateWphostingSecurity(contractId2, servername3, key, data) {
|
|
762
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/security/${enc(key)}`, data);
|
|
763
|
+
}
|
|
764
|
+
// ================================================================
|
|
481
765
|
// HTTP 基盤
|
|
482
766
|
// ================================================================
|
|
483
767
|
async get(path, params) {
|
|
@@ -487,35 +771,36 @@ var ApiClient = class {
|
|
|
487
771
|
}
|
|
488
772
|
return this.request("GET", url);
|
|
489
773
|
}
|
|
490
|
-
async post(path, data) {
|
|
491
|
-
return this.request("POST", `${this.apiBase}${path}`, data);
|
|
774
|
+
async post(path, data, headers) {
|
|
775
|
+
return this.request("POST", `${this.apiBase}${path}`, data, headers);
|
|
492
776
|
}
|
|
493
777
|
async put(path, data) {
|
|
494
778
|
return this.request("PUT", `${this.apiBase}${path}`, data);
|
|
495
779
|
}
|
|
496
|
-
async delete(path, data) {
|
|
497
|
-
return this.request("DELETE", `${this.apiBase}${path}`, data);
|
|
780
|
+
async delete(path, data, headers) {
|
|
781
|
+
return this.request("DELETE", `${this.apiBase}${path}`, data, headers);
|
|
498
782
|
}
|
|
499
|
-
async request(method, url,
|
|
783
|
+
async request(method, url, body2, additionalHeaders) {
|
|
500
784
|
const headers = {
|
|
501
785
|
"Authorization": `Bearer ${this.apiKey}`,
|
|
502
|
-
"Accept": "application/json"
|
|
786
|
+
"Accept": "application/json",
|
|
787
|
+
...additionalHeaders
|
|
503
788
|
};
|
|
504
789
|
const init = {
|
|
505
790
|
method,
|
|
506
791
|
headers,
|
|
507
792
|
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
508
793
|
};
|
|
509
|
-
if (
|
|
794
|
+
if (body2 && method !== "GET") {
|
|
510
795
|
headers["Content-Type"] = "application/json";
|
|
511
|
-
init.body = JSON.stringify(
|
|
796
|
+
init.body = JSON.stringify(body2);
|
|
512
797
|
}
|
|
513
798
|
if (this.debug) {
|
|
514
799
|
const dbg = (msg) => process.stderr.write(`[DEBUG] ${msg}
|
|
515
800
|
`);
|
|
516
801
|
dbg(`${method} ${url}`);
|
|
517
|
-
if (
|
|
518
|
-
dbg(`Body: ${
|
|
802
|
+
if (body2)
|
|
803
|
+
dbg(`Body: ${JSON.stringify(redactSensitiveValues(body2))}`);
|
|
519
804
|
}
|
|
520
805
|
let response;
|
|
521
806
|
try {
|
|
@@ -566,11 +851,388 @@ var ApiClient = class {
|
|
|
566
851
|
function enc(s) {
|
|
567
852
|
return encodeURIComponent(s);
|
|
568
853
|
}
|
|
854
|
+
function idempotencyHeaders(idempotencyKey4) {
|
|
855
|
+
return idempotencyKey4 === void 0 ? void 0 : { "Idempotency-Key": idempotencyKey4 };
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
// ../../shared/dist/billing-confirmation.js
|
|
859
|
+
function formatYen(value) {
|
|
860
|
+
return `${String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",")}\u5186`;
|
|
861
|
+
}
|
|
862
|
+
function planLabel(planId2, planName) {
|
|
863
|
+
return planName === void 0 || planName === planId2 ? `\u30D7\u30E9\u30F3 ${planId2}` : `${planName}\u30D7\u30E9\u30F3\uFF08${planId2}\uFF09`;
|
|
864
|
+
}
|
|
865
|
+
function planNameFromPlans(plans, planId2) {
|
|
866
|
+
const list = plans?.plans;
|
|
867
|
+
if (!Array.isArray(list))
|
|
868
|
+
return void 0;
|
|
869
|
+
for (const plan of list) {
|
|
870
|
+
const record3 = plan;
|
|
871
|
+
if (record3?.plan_id !== planId2)
|
|
872
|
+
continue;
|
|
873
|
+
if (typeof record3.plan_name !== "string" || record3.plan_name === "") {
|
|
874
|
+
return void 0;
|
|
875
|
+
}
|
|
876
|
+
return record3.plan_name;
|
|
877
|
+
}
|
|
878
|
+
return void 0;
|
|
879
|
+
}
|
|
880
|
+
async function resolvePlanName(fetchPlans, planId2) {
|
|
881
|
+
try {
|
|
882
|
+
return planNameFromPlans(await fetchPlans(), planId2);
|
|
883
|
+
} catch {
|
|
884
|
+
return void 0;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
function billingConfirmationDetailLines(details) {
|
|
888
|
+
const lines = [];
|
|
889
|
+
for (const detail of details) {
|
|
890
|
+
lines.push(`${detail.label}: ${detail.value}`);
|
|
891
|
+
if (detail.note !== void 0)
|
|
892
|
+
lines.push(` \u203B ${detail.note}`);
|
|
893
|
+
}
|
|
894
|
+
return lines;
|
|
895
|
+
}
|
|
896
|
+
function billingPaymentLines(totalPrice) {
|
|
897
|
+
return [
|
|
898
|
+
`\u304A\u652F\u6255\u3044\u91D1\u984D: ${formatYen(totalPrice)}\uFF08\u7A0E\u8FBC\u30FB\u30AD\u30E3\u30F3\u30DA\u30FC\u30F3\u9069\u7528\u5F8C\u306E\u5B9F\u652F\u6255\u984D\uFF09`,
|
|
899
|
+
"\u304A\u652F\u6255\u3044\u65B9\u6CD5: \u30D7\u30EA\u30DA\u30A4\u30C9\u6B8B\u9AD8\u304B\u3089\u306E\u5F15\u304D\u843D\u3068\u3057"
|
|
900
|
+
];
|
|
901
|
+
}
|
|
902
|
+
function autoRenewDetail(autoRenew, options = {}) {
|
|
903
|
+
if (!autoRenew) {
|
|
904
|
+
return {
|
|
905
|
+
label: "\u81EA\u52D5\u66F4\u65B0",
|
|
906
|
+
value: "\u7121\u52B9",
|
|
907
|
+
note: "\u5951\u7D04\u671F\u9650\u307E\u3067\u306B\u624B\u52D5\u3067\u66F4\u65B0\u3057\u306A\u3044\u5834\u5408\u306F\u5931\u52B9\u3057\u307E\u3059\u3002"
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
return {
|
|
911
|
+
label: "\u81EA\u52D5\u66F4\u65B0",
|
|
912
|
+
value: "\u6709\u52B9\uFF08\u6B21\u56DE\u4EE5\u964D\u306E\u66F4\u65B0\u3082\u81EA\u52D5\u3067\u8AB2\u91D1\u3055\u308C\u307E\u3059\uFF09",
|
|
913
|
+
note: options.fromDefault ? `${options.optionName ?? "--auto-renew"} \u3092\u6307\u5B9A\u3057\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u65E2\u5B9A\u5024\u306E\u6709\u52B9\u304C\u9069\u7528\u3055\u308C\u307E\u3059\u3002` : void 0
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
function partnerCodeDetail(partnerCode) {
|
|
917
|
+
if (partnerCode === void 0)
|
|
918
|
+
return void 0;
|
|
919
|
+
return {
|
|
920
|
+
label: "\u304A\u53D6\u6B21\u5E97\u30B3\u30FC\u30C9",
|
|
921
|
+
value: partnerCode,
|
|
922
|
+
note: "\u5B58\u5728\u3057\u306A\u3044\u30B3\u30FC\u30C9\u3067\u3082\u7533\u8FBC\u306F\u6210\u7ACB\u3057\u3001\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u305B\u3093\u3002\u8868\u8A18\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
function serverIdDetail(serverId) {
|
|
926
|
+
return {
|
|
927
|
+
label: "\u5E0C\u671B\u30B5\u30FC\u30D0\u30FCID",
|
|
928
|
+
value: serverId ?? "\u6307\u5B9A\u306A\u3057\uFF08\u81EA\u52D5\u3067\u63A1\u756A\u3055\u308C\u307E\u3059\uFF09"
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
function compactDetails(details) {
|
|
932
|
+
return details.filter((detail) => detail !== void 0);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
// ../../shared/dist/brand-config.js
|
|
936
|
+
function resolveServerPlanBrand(brand, service, planId2) {
|
|
937
|
+
if (service === "server" && planId2 !== void 0) {
|
|
938
|
+
const override = brand.serverPlanOverrides?.find((o) => planId2.startsWith(o.planIdPrefix));
|
|
939
|
+
if (override !== void 0) {
|
|
940
|
+
return {
|
|
941
|
+
serviceName: override.serviceName,
|
|
942
|
+
termsUrl: override.termsUrl,
|
|
943
|
+
privacyUrl: override.privacyUrl
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
return service === "server" ? {
|
|
948
|
+
serviceName: brand.serverServiceName,
|
|
949
|
+
termsUrl: brand.serverTermsUrl,
|
|
950
|
+
privacyUrl: brand.serverPrivacyUrl
|
|
951
|
+
} : {
|
|
952
|
+
serviceName: brand.wphostingServiceName,
|
|
953
|
+
termsUrl: brand.wphostingTermsUrl,
|
|
954
|
+
privacyUrl: brand.wphostingPrivacyUrl
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
function domainLegalNoticeLines(brand) {
|
|
958
|
+
return [
|
|
959
|
+
`\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04: ${brand.domainTermsUrl}`,
|
|
960
|
+
`\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066: ${brand.domainPrivacyUrl}`
|
|
961
|
+
];
|
|
962
|
+
}
|
|
963
|
+
function signupOperationName(brand, service, planId2) {
|
|
964
|
+
const { serviceName } = resolveServerPlanBrand(brand, service, planId2);
|
|
965
|
+
if (serviceName === void 0) {
|
|
966
|
+
throw new Error(`${service}\u306E\u30B5\u30FC\u30D3\u30B9\u540D\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093`);
|
|
967
|
+
}
|
|
968
|
+
return `${serviceName} \u65B0\u898F\u304A\u7533\u3057\u8FBC\u307F`;
|
|
969
|
+
}
|
|
970
|
+
function signupLegalNoticeLines(brand, service, planId2) {
|
|
971
|
+
const { termsUrl, privacyUrl } = resolveServerPlanBrand(brand, service, planId2);
|
|
972
|
+
if (termsUrl === void 0 || privacyUrl === void 0) {
|
|
973
|
+
throw new Error(`${service}\u306E\u5229\u7528\u898F\u7D04\u30FB\u500B\u4EBA\u60C5\u5831URL\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093`);
|
|
974
|
+
}
|
|
975
|
+
return [
|
|
976
|
+
`\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04: ${termsUrl}`,
|
|
977
|
+
`\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066: ${privacyUrl}`
|
|
978
|
+
];
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
// ../../shared/dist/domain-acquisition-permission.js
|
|
982
|
+
function record(value) {
|
|
983
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
984
|
+
}
|
|
985
|
+
function diagnosedForbidden(message) {
|
|
986
|
+
return new ApiError(message, 403, "FORBIDDEN", []);
|
|
987
|
+
}
|
|
988
|
+
async function withDomainAcquisitionPermissionDiagnosis(client, request) {
|
|
989
|
+
try {
|
|
990
|
+
return await request();
|
|
991
|
+
} catch (error) {
|
|
992
|
+
if (!(error instanceof ApiError) || error.httpStatus !== 403 || error.errorCode !== "FORBIDDEN") {
|
|
993
|
+
throw error;
|
|
994
|
+
}
|
|
995
|
+
let meData;
|
|
996
|
+
try {
|
|
997
|
+
meData = await client.getMe();
|
|
998
|
+
} catch {
|
|
999
|
+
throw error;
|
|
1000
|
+
}
|
|
1001
|
+
const services = record(meData.services);
|
|
1002
|
+
const domain2 = record(services?.domain);
|
|
1003
|
+
if (!domain2) {
|
|
1004
|
+
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");
|
|
1005
|
+
}
|
|
1006
|
+
if (domain2.allow_acquisition === false) {
|
|
1007
|
+
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");
|
|
1008
|
+
}
|
|
1009
|
+
throw error;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
// ../core/dist/server-target.js
|
|
1014
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
1015
|
+
import { z } from "zod";
|
|
1016
|
+
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");
|
|
1017
|
+
function record2(value) {
|
|
1018
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
1019
|
+
}
|
|
1020
|
+
function strings(value) {
|
|
1021
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string" && item !== "") : [];
|
|
1022
|
+
}
|
|
1023
|
+
var ServerTargetResolver = class {
|
|
1024
|
+
fixedServername;
|
|
1025
|
+
createClient;
|
|
1026
|
+
accountClient;
|
|
1027
|
+
activeClient = new AsyncLocalStorage();
|
|
1028
|
+
client;
|
|
1029
|
+
constructor(options) {
|
|
1030
|
+
this.fixedServername = options.fixedServername;
|
|
1031
|
+
this.createClient = options.createClient ?? ((servername3) => new ApiClient({
|
|
1032
|
+
apiKey: options.apiKey,
|
|
1033
|
+
apiBase: options.apiBase,
|
|
1034
|
+
servername: servername3
|
|
1035
|
+
}));
|
|
1036
|
+
this.accountClient = this.createClient();
|
|
1037
|
+
this.client = new Proxy(this.accountClient, {
|
|
1038
|
+
get: (target, property) => {
|
|
1039
|
+
const active = this.activeClient.getStore() ?? target;
|
|
1040
|
+
const value = Reflect.get(active, property, active);
|
|
1041
|
+
return typeof value === "function" ? value.bind(active) : value;
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
async resolve(requestedServername) {
|
|
1046
|
+
if (this.fixedServername) {
|
|
1047
|
+
if (requestedServername && requestedServername !== this.fixedServername) {
|
|
1048
|
+
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`);
|
|
1049
|
+
}
|
|
1050
|
+
return this.fixedServername;
|
|
1051
|
+
}
|
|
1052
|
+
if (requestedServername) {
|
|
1053
|
+
return requestedServername;
|
|
1054
|
+
}
|
|
1055
|
+
const meData = await this.accountClient.getMe();
|
|
1056
|
+
const server = record2(record2(meData.services)?.server);
|
|
1057
|
+
if (!server) {
|
|
1058
|
+
throw new Error("\u3053\u306EAPI\u30AD\u30FC\u3067\u306FServer API\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002");
|
|
1059
|
+
}
|
|
1060
|
+
const targetMode = server.target_mode;
|
|
1061
|
+
const targets = strings(server.targets);
|
|
1062
|
+
if (targetMode === "selected" && targets.length === 1) {
|
|
1063
|
+
return targets[0];
|
|
1064
|
+
}
|
|
1065
|
+
if (targetMode === "selected" && targets.length > 1) {
|
|
1066
|
+
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(", ")}`);
|
|
1067
|
+
}
|
|
1068
|
+
if (targetMode === "all") {
|
|
1069
|
+
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");
|
|
1070
|
+
}
|
|
1071
|
+
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");
|
|
1072
|
+
}
|
|
1073
|
+
async run(requestedServername, operation) {
|
|
1074
|
+
const resolvedServername = await this.resolve(requestedServername);
|
|
1075
|
+
const client = this.createClient(resolvedServername);
|
|
1076
|
+
return this.activeClient.run(client, operation);
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
function withServerTargetResolution(server, resolver) {
|
|
1080
|
+
return new Proxy(server, {
|
|
1081
|
+
get(target, property, receiver) {
|
|
1082
|
+
if (property !== "tool") {
|
|
1083
|
+
return Reflect.get(target, property, receiver);
|
|
1084
|
+
}
|
|
1085
|
+
return (...registrationArgs) => {
|
|
1086
|
+
if (registrationArgs.length < 4) {
|
|
1087
|
+
throw new Error("Server tool registration requires an input schema.");
|
|
1088
|
+
}
|
|
1089
|
+
const schema = record2(registrationArgs[2]);
|
|
1090
|
+
if (!schema) {
|
|
1091
|
+
throw new Error("Server tool input schema must be an object.");
|
|
1092
|
+
}
|
|
1093
|
+
registrationArgs[2] = { ...schema, servername: servernameInput };
|
|
1094
|
+
const callbackIndex = registrationArgs.length - 1;
|
|
1095
|
+
const callback = registrationArgs[callbackIndex];
|
|
1096
|
+
if (typeof callback !== "function") {
|
|
1097
|
+
throw new Error("Server tool registration requires a callback.");
|
|
1098
|
+
}
|
|
1099
|
+
registrationArgs[callbackIndex] = async (input = {}, ...callbackArgs) => {
|
|
1100
|
+
const { servername: servername3, ...forwardedInput } = input;
|
|
1101
|
+
return resolver.run(typeof servername3 === "string" ? servername3 : void 0, () => callback(forwardedInput, ...callbackArgs));
|
|
1102
|
+
};
|
|
1103
|
+
return Reflect.apply(target.tool, target, registrationArgs);
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
// ../core/dist/tools/server/account.js
|
|
1110
|
+
import { z as z2 } from "zod";
|
|
1111
|
+
|
|
1112
|
+
// ../core/dist/billing-confirmation.js
|
|
1113
|
+
import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
|
|
1114
|
+
function billingPreviewResult(preview, legalNoticeLines) {
|
|
1115
|
+
const previewFields = preview !== null && typeof preview === "object" && !Array.isArray(preview) ? preview : { preview };
|
|
1116
|
+
return {
|
|
1117
|
+
...previewFields,
|
|
1118
|
+
legal_notices: [...legalNoticeLines],
|
|
1119
|
+
next_step: "Present legal_notices as clickable Markdown links in chat. After the user reviews them, invoke the execute tool to show the final confirmation form."
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function supportsFormElicitation(server) {
|
|
1123
|
+
const elicitation = server.server.getClientCapabilities()?.elicitation;
|
|
1124
|
+
return elicitation != null && elicitation.form != null;
|
|
1125
|
+
}
|
|
1126
|
+
var BILLING_CONFIRMATION_TIMEOUT_MS = 18e4;
|
|
1127
|
+
function assertBillingFormElicitationSupported(server) {
|
|
1128
|
+
if (!supportsFormElicitation(server)) {
|
|
1129
|
+
throw new Error("\u8AB2\u91D1\u64CD\u4F5C\u306B\u306F MCP form elicitation \u5BFE\u5FDC\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\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");
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
async function confirmBillingOperation(server, input) {
|
|
1133
|
+
if (!supportsFormElicitation(server)) {
|
|
1134
|
+
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");
|
|
1135
|
+
}
|
|
1136
|
+
const target = input.target ?? input.domain;
|
|
1137
|
+
const targetLabel = input.targetLabel ?? "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3";
|
|
1138
|
+
const yearsLines = input.years == null ? [] : [`- \u5951\u7D04\u5E74\u6570: ${input.years}\u5E74`];
|
|
1139
|
+
const termsLines = input.requireTermsAgreement ? [
|
|
1140
|
+
"- \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\u3002"
|
|
1141
|
+
] : [];
|
|
1142
|
+
const legalNoticeLines = input.domain === void 0 ? input.legalNoticeLines : domainLegalNoticeLines(input.brand);
|
|
1143
|
+
const detailLines = billingConfirmationDetailLines(input.details ?? []).map((line) => line.startsWith(" ") ? line : `- ${line}`);
|
|
1144
|
+
const paymentLines = billingPaymentLines(input.totalPrice).map((line) => `- ${line}`);
|
|
1145
|
+
const applicationLines = [
|
|
1146
|
+
`- \u64CD\u4F5C: ${input.operation}`,
|
|
1147
|
+
`- ${targetLabel}: ${target}`,
|
|
1148
|
+
...yearsLines,
|
|
1149
|
+
...detailLines,
|
|
1150
|
+
...paymentLines
|
|
1151
|
+
];
|
|
1152
|
+
const confirmationLines = [
|
|
1153
|
+
...legalNoticeLines.map((line) => `- ${line}`),
|
|
1154
|
+
"- \u7533\u8ACB\u3059\u308B\u3068\u8AB2\u91D1\u3055\u308C\u3001\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\u3002",
|
|
1155
|
+
...termsLines
|
|
1156
|
+
];
|
|
1157
|
+
const message = [
|
|
1158
|
+
"\u8AB2\u91D1\u3092\u4F34\u3046\u64CD\u4F5C\u3067\u3059\u3002",
|
|
1159
|
+
"\u3010\u304A\u7533\u3057\u8FBC\u307F\u5185\u5BB9\u3011",
|
|
1160
|
+
applicationLines.join("\n"),
|
|
1161
|
+
"\u3010\u78BA\u8A8D\u4E8B\u9805\u3011",
|
|
1162
|
+
confirmationLines.join("\n"),
|
|
1163
|
+
"\u5185\u5BB9\u3092\u78BA\u8A8D\u3057\u3001\u627F\u8A8D\u3059\u308B\u5834\u5408\u306E\u307F\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
1164
|
+
].join("\n\n");
|
|
1165
|
+
const properties = {
|
|
1166
|
+
confirm_purchase: {
|
|
1167
|
+
type: "boolean",
|
|
1168
|
+
title: "\u8AB2\u91D1\u3092\u627F\u8A8D\u3059\u308B",
|
|
1169
|
+
description: `${target} / ${formatYen(input.totalPrice)} / ${input.operation}`
|
|
1170
|
+
}
|
|
1171
|
+
};
|
|
1172
|
+
const required = ["confirm_purchase"];
|
|
1173
|
+
if (input.requireTermsAgreement) {
|
|
1174
|
+
properties.agree_to_terms = {
|
|
1175
|
+
type: "boolean",
|
|
1176
|
+
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",
|
|
1177
|
+
description: input.domain == null ? "\u3053\u306E\u7533\u8FBC\u306B\u9069\u7528\u3055\u308C\u308B\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" : "\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"
|
|
1178
|
+
};
|
|
1179
|
+
required.push("agree_to_terms");
|
|
1180
|
+
}
|
|
1181
|
+
let result;
|
|
1182
|
+
try {
|
|
1183
|
+
result = await server.server.elicitInput({
|
|
1184
|
+
mode: "form",
|
|
1185
|
+
message,
|
|
1186
|
+
requestedSchema: {
|
|
1187
|
+
type: "object",
|
|
1188
|
+
properties,
|
|
1189
|
+
required
|
|
1190
|
+
}
|
|
1191
|
+
}, { timeout: BILLING_CONFIRMATION_TIMEOUT_MS });
|
|
1192
|
+
} catch (error) {
|
|
1193
|
+
if (error instanceof McpError && error.code === ErrorCode.RequestTimeout) {
|
|
1194
|
+
throw new Error(`BILLING_CONFIRMATION_TIMEOUT: \u8AB2\u91D1\u78BA\u8A8D\u306E\u5FDC\u7B54\u304C${Math.round(BILLING_CONFIRMATION_TIMEOUT_MS / 1e3)}\u79D2\u4EE5\u5185\u306B\u5F97\u3089\u308C\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002\u7533\u8ACB\u306F\u9001\u4FE1\u3057\u3066\u3044\u306A\u3044\u305F\u3081\u8AB2\u91D1\u306F\u767A\u751F\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u898F\u7D04\u306E\u78BA\u8A8D\u3092\u7D42\u3048\u3066\u304B\u3089\u3001\u540C\u3058\u51AA\u7B49\u6027\u30AD\u30FC\u3067\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);
|
|
1195
|
+
}
|
|
1196
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
1197
|
+
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}`);
|
|
1198
|
+
}
|
|
1199
|
+
if (result.action === "decline" || result.action === "cancel") {
|
|
1200
|
+
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");
|
|
1201
|
+
}
|
|
1202
|
+
if (result.action !== "accept" || result.content == null || typeof result.content !== "object") {
|
|
1203
|
+
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");
|
|
1204
|
+
}
|
|
1205
|
+
const content = result.content;
|
|
1206
|
+
if (content.confirm_purchase !== true) {
|
|
1207
|
+
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");
|
|
1208
|
+
}
|
|
1209
|
+
if (input.requireTermsAgreement && content.agree_to_terms !== true) {
|
|
1210
|
+
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");
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
var billingPreviewAnnotations = {
|
|
1214
|
+
readOnlyHint: true,
|
|
1215
|
+
destructiveHint: false,
|
|
1216
|
+
idempotentHint: true,
|
|
1217
|
+
openWorldHint: true
|
|
1218
|
+
};
|
|
1219
|
+
var billingExecuteAnnotations = {
|
|
1220
|
+
readOnlyHint: false,
|
|
1221
|
+
destructiveHint: true,
|
|
1222
|
+
idempotentHint: true,
|
|
1223
|
+
openWorldHint: true
|
|
1224
|
+
};
|
|
569
1225
|
|
|
570
1226
|
// ../core/dist/helper.js
|
|
571
1227
|
function serverToolName(brand, action, feature) {
|
|
572
1228
|
return `${brand.brand}_${action}_server_${feature}`;
|
|
573
1229
|
}
|
|
1230
|
+
function domainToolName(brand, action, feature) {
|
|
1231
|
+
return `${brand.brand}_${action}_domain_${feature}`;
|
|
1232
|
+
}
|
|
1233
|
+
function wphostingToolName(brand, verb, resource) {
|
|
1234
|
+
return `${brand.brand}_${verb}_wphosting_${resource}`;
|
|
1235
|
+
}
|
|
574
1236
|
async function callApi(fn) {
|
|
575
1237
|
try {
|
|
576
1238
|
const result = await fn();
|
|
@@ -591,6 +1253,76 @@ async function callApi(fn) {
|
|
|
591
1253
|
}
|
|
592
1254
|
}
|
|
593
1255
|
|
|
1256
|
+
// ../core/dist/tools/server/account.js
|
|
1257
|
+
var planId = z2.string().min(1).max(64).describe("\u30D7\u30E9\u30F3ID");
|
|
1258
|
+
var servername = z2.string().min(1).max(255).describe("\u5BFE\u8C61\u30B5\u30FC\u30D0\u30FC\u306Eservername\uFF08\u660E\u793A\u6307\u5B9A\u5FC5\u9808\uFF09");
|
|
1259
|
+
var memo = z2.string().max(500).describe("\u5951\u7D04\u30E1\u30E2\uFF08\u7A7A\u6587\u5B57\u53EF\u3001500\u6587\u5B57\u4EE5\u5185\uFF09");
|
|
1260
|
+
var expectedTotalPrice = z2.number().int().nonnegative().describe("preview\u3068\u4E00\u81F4\u3059\u308B\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D");
|
|
1261
|
+
var idempotencyKey = z2.string().regex(/^[A-Za-z0-9_-]{8,64}$/).describe("Idempotency-Key\uFF08\u82F1\u6570\u5B57\u30FB_\u30FB-\u30018\uFF5E64\u6587\u5B57\uFF09");
|
|
1262
|
+
var signupInput = {
|
|
1263
|
+
plan_id: planId,
|
|
1264
|
+
period: z2.number().int().min(1).max(60).describe("\u5951\u7D04\u671F\u9593\uFF08\u6708\u6570\u3002\u30D7\u30E9\u30F3\u53D6\u5F97\u30C4\u30FC\u30EB\u304C\u8FD4\u3057\u305F months \u304B\u3089\u6307\u5B9A\uFF09"),
|
|
1265
|
+
expected_total_price: expectedTotalPrice,
|
|
1266
|
+
agree_to_terms: z2.literal(true).describe("\u30B5\u30FC\u30D0\u30FC\u5951\u7D04\u306E\u5229\u7528\u898F\u7D04\u3078\u306E\u660E\u793A\u540C\u610F"),
|
|
1267
|
+
server_id: z2.string().regex(/^[a-z][0-9a-z]+$/).optional().describe("\u5E0C\u671B\u30B5\u30FC\u30D0\u30FCID"),
|
|
1268
|
+
partner_code: z2.string().regex(/^[A-Za-z0-9]{1,50}$/).optional().describe("\u30D1\u30FC\u30C8\u30CA\u30FC\u30B3\u30FC\u30C9"),
|
|
1269
|
+
auto_renew: z2.enum(["enabled", "disabled"]).describe("\u81EA\u52D5\u66F4\u65B0\uFF08enabled: \u6709\u52B9 / disabled: \u7121\u52B9\u3001\u660E\u793A\u6307\u5B9A\u5FC5\u9808\uFF09")
|
|
1270
|
+
};
|
|
1271
|
+
function description(text) {
|
|
1272
|
+
return `${text}\u3002servername\u89E3\u6C7A\u3092\u884C\u308F\u306A\u3044Server\u30A2\u30AB\u30A6\u30F3\u30C8\u30FB\u5951\u7D04\u30EC\u30D9\u30EB\u306E\u64CD\u4F5C\u3067\u3059`;
|
|
1273
|
+
}
|
|
1274
|
+
function registerServerAccountTools(server, client, brand, options = {}) {
|
|
1275
|
+
server.tool(serverToolName(brand, "list", "plans"), description("\u7533\u8FBC\u53EF\u80FD\u306A\u30B5\u30FC\u30D0\u30FC\u30D7\u30E9\u30F3\u3092\u53D6\u5F97"), {
|
|
1276
|
+
plan_id: z2.string().min(1).max(64).optional().describe("\u7D5E\u308A\u8FBC\u3080\u30D7\u30E9\u30F3ID\u3002\u8907\u6570\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A")
|
|
1277
|
+
}, async ({ plan_id }) => callApi(() => client.listServerPlans(plan_id ? { plan_id } : void 0)));
|
|
1278
|
+
server.tool(serverToolName(brand, "list", "contracts"), description("\u30B5\u30FC\u30D0\u30FC\u5951\u7D04\u4E00\u89A7\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.listServers()));
|
|
1279
|
+
server.tool(serverToolName(brand, "get", "signup_status"), description("\u30B5\u30FC\u30D0\u30FC\u7533\u8FBC\u51E6\u7406\u72B6\u6CC1\u3092\u53D6\u5F97"), { servername }, async ({ servername: target }) => callApi(() => client.getServerSignupStatus(target)));
|
|
1280
|
+
server.tool(serverToolName(brand, "get", "memo"), description("\u30B5\u30FC\u30D0\u30FC\u5951\u7D04\u30E1\u30E2\u3092\u53D6\u5F97"), { servername }, async ({ servername: target }) => callApi(() => client.getServerMemo(target)));
|
|
1281
|
+
server.tool(serverToolName(brand, "update", "memo"), description("\u30B5\u30FC\u30D0\u30FC\u5951\u7D04\u30E1\u30E2\u3092\u66F4\u65B0"), { servername, memo }, async ({ servername: target, memo: value }) => callApi(() => client.updateServerMemo(target, { memo: value })));
|
|
1282
|
+
server.tool(serverToolName(brand, "preview", "signup"), description("\u8AB2\u91D1\u3055\u308C\u308B\u30B5\u30FC\u30D0\u30FC\u65B0\u898F\u5951\u7D04\u3092dry-run\u3057\u3001\u5B9F\u7533\u8ACB\u524D\u306E\u91D1\u984D\u3092\u78BA\u8A8D\u3002\u7D50\u679C\u306E legal_notices \u3092\u30C1\u30E3\u30C3\u30C8\u4E0A\u306E\u30AF\u30EA\u30C3\u30AF\u53EF\u80FD\u306AMarkdown\u30EA\u30F3\u30AF\u3068\u3057\u3066\u5229\u7528\u8005\u3078\u63D0\u793A\u3057\u3066\u304B\u3089execute\u3092\u6848\u5185\u3057\u3066\u304F\u3060\u3055\u3044"), signupInput, billingPreviewAnnotations, async ({ agree_to_terms: _agreeToTerms, auto_renew, ...input }) => callApi(async () => billingPreviewResult(await client.registerServer({
|
|
1283
|
+
...input,
|
|
1284
|
+
auto_renew: auto_renew === "enabled",
|
|
1285
|
+
agree_to_terms: true,
|
|
1286
|
+
dry_run: true
|
|
1287
|
+
}), signupLegalNoticeLines(brand, "server", input.plan_id))));
|
|
1288
|
+
if (options.enableHighRiskExecute) {
|
|
1289
|
+
server.tool(serverToolName(brand, "execute", "signup"), description("\u660E\u793A\u627F\u8A8D\u5F8C\u306B\u30B5\u30FC\u30D0\u30FC\u65B0\u898F\u5951\u7D04\u3092\u5B9F\u7533\u8ACB\uFF08\u8AB2\u91D1\u3055\u308C\u539F\u5247\u53D6\u308A\u6D88\u3057\u4E0D\u53EF\uFF09\u3002\u4E8B\u524D\u306Bpreview\u306E legal_notices \u3092\u30C1\u30E3\u30C3\u30C8\u4E0A\u3078\u63D0\u793A\u3057\u3001\u5229\u7528\u8005\u304CURL\u3092\u78BA\u8A8D\u3067\u304D\u308B\u72B6\u614B\u306B\u3057\u3066\u304F\u3060\u3055\u3044"), { ...signupInput, idempotency_key: idempotencyKey }, billingExecuteAnnotations, async ({ agree_to_terms: _agreeToTerms, idempotency_key, ...input }) => callApi(async () => {
|
|
1290
|
+
const data = {
|
|
1291
|
+
...input,
|
|
1292
|
+
auto_renew: input.auto_renew === "enabled",
|
|
1293
|
+
agree_to_terms: true
|
|
1294
|
+
};
|
|
1295
|
+
const preview = await client.registerServer({
|
|
1296
|
+
...data,
|
|
1297
|
+
dry_run: true
|
|
1298
|
+
});
|
|
1299
|
+
const totalPrice = Number(preview.total_price);
|
|
1300
|
+
if (!Number.isFinite(totalPrice)) {
|
|
1301
|
+
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");
|
|
1302
|
+
}
|
|
1303
|
+
if (totalPrice !== input.expected_total_price) {
|
|
1304
|
+
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 ${input.expected_total_price}\u5186\uFF09\u3002`);
|
|
1305
|
+
}
|
|
1306
|
+
assertBillingFormElicitationSupported(server);
|
|
1307
|
+
const planName = await resolvePlanName(() => client.listServerPlans({ plan_id: input.plan_id }), input.plan_id);
|
|
1308
|
+
await confirmBillingOperation(server, {
|
|
1309
|
+
operation: signupOperationName(brand, "server", input.plan_id),
|
|
1310
|
+
target: `${planLabel(input.plan_id, planName)} / \u5951\u7D04\u671F\u9593 ${input.period}\u304B\u6708`,
|
|
1311
|
+
targetLabel: "\u7533\u8FBC\u5185\u5BB9",
|
|
1312
|
+
details: compactDetails([
|
|
1313
|
+
serverIdDetail(input.server_id),
|
|
1314
|
+
autoRenewDetail(input.auto_renew === "enabled"),
|
|
1315
|
+
partnerCodeDetail(input.partner_code)
|
|
1316
|
+
]),
|
|
1317
|
+
legalNoticeLines: signupLegalNoticeLines(brand, "server", input.plan_id),
|
|
1318
|
+
totalPrice,
|
|
1319
|
+
requireTermsAgreement: true
|
|
1320
|
+
});
|
|
1321
|
+
return client.registerServer({ ...data, dry_run: false }, idempotency_key);
|
|
1322
|
+
}));
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
|
|
594
1326
|
// ../core/dist/tools/server/server-info.js
|
|
595
1327
|
function registerServerInfoTools(server, client, brand) {
|
|
596
1328
|
server.tool(serverToolName(brand, "get", "info"), "\u30B5\u30FC\u30D0\u30FC\u306EOS\u30FBCPU\u30FB\u30E1\u30E2\u30EA\u30FB\u5229\u7528\u53EF\u80FD\u306APHP/DB\u30D0\u30FC\u30B8\u30E7\u30F3\u7B49\u3092\u53D6\u5F97", {}, async () => callApi(() => client.getServerInfo()));
|
|
@@ -598,64 +1330,70 @@ function registerServerInfoTools(server, client, brand) {
|
|
|
598
1330
|
}
|
|
599
1331
|
|
|
600
1332
|
// ../core/dist/tools/server/cron.js
|
|
601
|
-
import { z } from "zod";
|
|
1333
|
+
import { z as z3 } from "zod";
|
|
602
1334
|
function registerCronTools(server, client, brand) {
|
|
603
1335
|
server.tool(serverToolName(brand, "list", "cron"), "Cron\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listCron()));
|
|
604
1336
|
server.tool(serverToolName(brand, "add", "cron"), "Cron\u30B8\u30E7\u30D6\u3092\u65B0\u898F\u8FFD\u52A0", {
|
|
605
|
-
minute:
|
|
606
|
-
hour:
|
|
607
|
-
day:
|
|
608
|
-
month:
|
|
609
|
-
weekday:
|
|
610
|
-
command:
|
|
611
|
-
comment:
|
|
1337
|
+
minute: z3.string().describe("\u5206\uFF080-59, */5 \u7B49\uFF09"),
|
|
1338
|
+
hour: z3.string().describe("\u6642\uFF080-23, * \u7B49\uFF09"),
|
|
1339
|
+
day: z3.string().default("*").describe("\u65E5\uFF081-31, * \u7B49\uFF09"),
|
|
1340
|
+
month: z3.string().default("*").describe("\u6708\uFF081-12, * \u7B49\uFF09"),
|
|
1341
|
+
weekday: z3.string().default("*").describe("\u66DC\u65E5\uFF080-7, * \u7B49\uFF09"),
|
|
1342
|
+
command: z3.string().describe("\u5B9F\u884C\u30B3\u30DE\u30F3\u30C9"),
|
|
1343
|
+
comment: z3.string().optional().describe("\u30E1\u30E2")
|
|
612
1344
|
}, async (args) => callApi(() => client.addCron(args)));
|
|
613
1345
|
server.tool(serverToolName(brand, "update", "cron"), "Cron\u30B8\u30E7\u30D6\u3092\u66F4\u65B0", {
|
|
614
|
-
cron_id:
|
|
615
|
-
minute:
|
|
616
|
-
hour:
|
|
617
|
-
day:
|
|
618
|
-
month:
|
|
619
|
-
weekday:
|
|
620
|
-
command:
|
|
621
|
-
comment:
|
|
622
|
-
enabled:
|
|
623
|
-
}, async ({ cron_id, ...data }) => callApi(() =>
|
|
1346
|
+
cron_id: z3.string().describe("Cron\u306EID"),
|
|
1347
|
+
minute: z3.string().optional().describe("\u5206"),
|
|
1348
|
+
hour: z3.string().optional().describe("\u6642"),
|
|
1349
|
+
day: z3.string().optional().describe("\u65E5"),
|
|
1350
|
+
month: z3.string().optional().describe("\u6708"),
|
|
1351
|
+
weekday: z3.string().optional().describe("\u66DC\u65E5"),
|
|
1352
|
+
command: z3.string().optional().describe("\u5B9F\u884C\u30B3\u30DE\u30F3\u30C9"),
|
|
1353
|
+
comment: z3.string().optional().describe("\u30E1\u30E2"),
|
|
1354
|
+
enabled: z3.boolean().optional().describe("\u6709\u52B9/\u7121\u52B9")
|
|
1355
|
+
}, async ({ cron_id, ...data }) => callApi(() => {
|
|
1356
|
+
const update = Object.fromEntries(Object.entries(data).filter(([, value]) => value !== void 0));
|
|
1357
|
+
if (Object.keys(update).length === 0) {
|
|
1358
|
+
throw new Error("\u66F4\u65B0\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
1359
|
+
}
|
|
1360
|
+
return client.updateCron(cron_id, update);
|
|
1361
|
+
}));
|
|
624
1362
|
server.tool(serverToolName(brand, "delete", "cron"), "Cron\u30B8\u30E7\u30D6\u3092\u524A\u9664", {
|
|
625
|
-
cron_id:
|
|
1363
|
+
cron_id: z3.string().describe("Cron\u306EID")
|
|
626
1364
|
}, async ({ cron_id }) => callApi(() => client.deleteCron(cron_id)));
|
|
627
1365
|
}
|
|
628
1366
|
|
|
629
1367
|
// ../core/dist/tools/server/ssh.js
|
|
630
|
-
import { z as
|
|
1368
|
+
import { z as z4 } from "zod";
|
|
631
1369
|
function registerSshTools(server, client, brand) {
|
|
632
1370
|
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()));
|
|
633
1371
|
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", {
|
|
634
|
-
ssh_enabled:
|
|
635
|
-
abroad_access_restriction:
|
|
1372
|
+
ssh_enabled: z4.boolean().optional().describe("SSH\u63A5\u7D9A\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
1373
|
+
abroad_access_restriction: z4.boolean().optional().describe("\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u6709\u52B9/\u7121\u52B9")
|
|
636
1374
|
}, async (args) => callApi(() => client.updateSsh(args)));
|
|
637
1375
|
server.tool(serverToolName(brand, "list", "ssh_key"), "SSH\u516C\u958B\u9375\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listSshKey()));
|
|
638
1376
|
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", {
|
|
639
|
-
label:
|
|
640
|
-
public_key:
|
|
641
|
-
generate:
|
|
642
|
-
passphrase:
|
|
1377
|
+
label: z4.string().describe("\u30E9\u30D9\u30EB"),
|
|
1378
|
+
public_key: z4.string().optional().describe("\u516C\u958B\u9375\uFF08\u624B\u52D5\u767B\u9332\u6642\u3002OpenSSH\u5F62\u5F0F\uFF09"),
|
|
1379
|
+
generate: z4.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"),
|
|
1380
|
+
passphrase: z4.string().optional().describe("\u30D1\u30B9\u30D5\u30EC\u30FC\u30BA\uFF08\u81EA\u52D5\u751F\u6210\u6642\u30026\u301C32\u6587\u5B57\uFF09")
|
|
643
1381
|
}, async (args) => callApi(() => client.addSshKey(args)));
|
|
644
1382
|
server.tool(serverToolName(brand, "update", "ssh_key"), "SSH\u516C\u958B\u9375\u306E\u30E9\u30D9\u30EB\u3084\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u66F4\u65B0", {
|
|
645
|
-
key_id:
|
|
646
|
-
label:
|
|
647
|
-
status:
|
|
1383
|
+
key_id: z4.string().describe("\u516C\u958B\u9375ID"),
|
|
1384
|
+
label: z4.string().optional().describe("\u30E9\u30D9\u30EB"),
|
|
1385
|
+
status: z4.enum(["on", "off"]).optional().describe("\u30B9\u30C6\u30FC\u30BF\u30B9")
|
|
648
1386
|
}, async ({ key_id, ...data }) => callApi(() => client.updateSshKey(key_id, data)));
|
|
649
1387
|
server.tool(serverToolName(brand, "delete", "ssh_key"), "SSH\u516C\u958B\u9375\u3092\u524A\u9664", {
|
|
650
|
-
key_id:
|
|
1388
|
+
key_id: z4.string().describe("\u516C\u958B\u9375ID")
|
|
651
1389
|
}, async ({ key_id }) => callApi(() => client.deleteSshKey(key_id)));
|
|
652
1390
|
}
|
|
653
1391
|
|
|
654
1392
|
// ../core/dist/tools/server/wordpress.js
|
|
655
|
-
import { z as
|
|
1393
|
+
import { z as z5 } from "zod";
|
|
656
1394
|
function registerWordpressTools(server, client, brand) {
|
|
657
1395
|
server.tool(serverToolName(brand, "list", "wordpress"), "WordPress\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
658
|
-
domain:
|
|
1396
|
+
domain: z5.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
659
1397
|
}, async (args) => {
|
|
660
1398
|
const params = {};
|
|
661
1399
|
if (args.domain)
|
|
@@ -663,28 +1401,28 @@ function registerWordpressTools(server, client, brand) {
|
|
|
663
1401
|
return callApi(() => client.listWordpress(params));
|
|
664
1402
|
});
|
|
665
1403
|
server.tool(serverToolName(brand, "add", "wordpress"), "WordPress\u3092\u65B0\u898F\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
666
|
-
url:
|
|
667
|
-
title:
|
|
668
|
-
admin_username:
|
|
669
|
-
admin_password:
|
|
670
|
-
admin_email:
|
|
671
|
-
memo:
|
|
1404
|
+
url: z5.string().describe("\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148URL\uFF08\u4F8B: https://example.com/blog\uFF09"),
|
|
1405
|
+
title: z5.string().describe("\u30B5\u30A4\u30C8\u30BF\u30A4\u30C8\u30EB"),
|
|
1406
|
+
admin_username: z5.string().describe("\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1407
|
+
admin_password: z5.string().describe("\u7BA1\u7406\u8005\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1408
|
+
admin_email: z5.string().describe("\u7BA1\u7406\u8005\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1409
|
+
memo: z5.string().optional().describe("\u30E1\u30E2")
|
|
672
1410
|
}, async (args) => callApi(() => client.addWordpress(args)));
|
|
673
1411
|
server.tool(serverToolName(brand, "update", "wordpress"), "WordPress\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
674
|
-
wp_id:
|
|
675
|
-
memo:
|
|
1412
|
+
wp_id: z5.string().describe("WordPress\u306EID"),
|
|
1413
|
+
memo: z5.string().optional().describe("\u30E1\u30E2")
|
|
676
1414
|
}, async ({ wp_id, ...data }) => callApi(() => client.updateWordpress(wp_id, data)));
|
|
677
1415
|
server.tool(serverToolName(brand, "delete", "wordpress"), "WordPress\u3092\u30A2\u30F3\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
678
|
-
wp_id:
|
|
679
|
-
delete_db:
|
|
1416
|
+
wp_id: z5.string().describe("WordPress\u306EID"),
|
|
1417
|
+
delete_db: z5.boolean().optional().describe("\u95A2\u9023\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3082\u524A\u9664\u3059\u308B\u304B")
|
|
680
1418
|
}, async ({ wp_id, ...data }) => callApi(() => client.deleteWordpress(wp_id, data)));
|
|
681
1419
|
}
|
|
682
1420
|
|
|
683
1421
|
// ../core/dist/tools/server/mail.js
|
|
684
|
-
import { z as
|
|
1422
|
+
import { z as z6 } from "zod";
|
|
685
1423
|
function registerMailTools(server, client, brand) {
|
|
686
1424
|
server.tool(serverToolName(brand, "list", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
687
|
-
domain:
|
|
1425
|
+
domain: z6.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
688
1426
|
}, async (args) => {
|
|
689
1427
|
const params = {};
|
|
690
1428
|
if (args.domain)
|
|
@@ -692,33 +1430,33 @@ function registerMailTools(server, client, brand) {
|
|
|
692
1430
|
return callApi(() => client.listMail(params));
|
|
693
1431
|
});
|
|
694
1432
|
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", {
|
|
695
|
-
mail_account:
|
|
1433
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
696
1434
|
}, async ({ mail_account }) => callApi(() => client.getMail(mail_account)));
|
|
697
1435
|
server.tool(serverToolName(brand, "add", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u4F5C\u6210", {
|
|
698
|
-
mail_address:
|
|
699
|
-
password:
|
|
700
|
-
quota_mb:
|
|
701
|
-
memo:
|
|
1436
|
+
mail_address: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08user@domain \u5F62\u5F0F\uFF09"),
|
|
1437
|
+
password: z6.string().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1438
|
+
quota_mb: z6.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\uFF09"),
|
|
1439
|
+
memo: z6.string().optional().describe("\u30E1\u30E2")
|
|
702
1440
|
}, async (args) => callApi(() => client.addMail(args)));
|
|
703
1441
|
server.tool(serverToolName(brand, "update", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u66F4\u65B0", {
|
|
704
|
-
mail_account:
|
|
705
|
-
password:
|
|
706
|
-
quota_mb:
|
|
707
|
-
memo:
|
|
1442
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1443
|
+
password: z6.string().optional().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1444
|
+
quota_mb: z6.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\uFF09"),
|
|
1445
|
+
memo: z6.string().optional().describe("\u30E1\u30E2")
|
|
708
1446
|
}, async ({ mail_account, ...data }) => callApi(() => client.updateMail(mail_account, data)));
|
|
709
1447
|
server.tool(serverToolName(brand, "delete", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u524A\u9664", {
|
|
710
|
-
mail_account:
|
|
1448
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
711
1449
|
}, async ({ mail_account }) => callApi(() => client.deleteMail(mail_account)));
|
|
712
1450
|
server.tool(serverToolName(brand, "get", "mail_forwarding"), "\u30E1\u30FC\u30EB\u8EE2\u9001\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
713
|
-
mail_account:
|
|
1451
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
714
1452
|
}, async ({ mail_account }) => callApi(() => client.getMailForwarding(mail_account)));
|
|
715
1453
|
server.tool(serverToolName(brand, "update", "mail_forwarding"), "\u30E1\u30FC\u30EB\u8EE2\u9001\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
716
|
-
mail_account:
|
|
717
|
-
forwarding_addresses:
|
|
718
|
-
keep_in_mailbox:
|
|
1454
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1455
|
+
forwarding_addresses: z6.array(z6.string()).describe("\u8EE2\u9001\u5148\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306E\u914D\u5217"),
|
|
1456
|
+
keep_in_mailbox: z6.boolean().optional().describe("\u30E1\u30FC\u30EB\u30DC\u30C3\u30AF\u30B9\u306B\u3082\u6B8B\u3059\u304B")
|
|
719
1457
|
}, async ({ mail_account, ...data }) => callApi(() => client.updateMailForwarding(mail_account, data)));
|
|
720
1458
|
server.tool(serverToolName(brand, "list", "mail_filter"), "\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
721
|
-
domain:
|
|
1459
|
+
domain: z6.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
722
1460
|
}, async (args) => {
|
|
723
1461
|
const params = {};
|
|
724
1462
|
if (args.domain)
|
|
@@ -726,29 +1464,29 @@ function registerMailTools(server, client, brand) {
|
|
|
726
1464
|
return callApi(() => client.listMailFilter(params));
|
|
727
1465
|
});
|
|
728
1466
|
server.tool(serverToolName(brand, "add", "mail_filter"), "\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0", {
|
|
729
|
-
domain:
|
|
730
|
-
conditions:
|
|
731
|
-
keyword:
|
|
732
|
-
field:
|
|
733
|
-
match_type:
|
|
1467
|
+
domain: z6.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1468
|
+
conditions: z6.array(z6.object({
|
|
1469
|
+
keyword: z6.string(),
|
|
1470
|
+
field: z6.string(),
|
|
1471
|
+
match_type: z6.string()
|
|
734
1472
|
})).describe("\u6761\u4EF6"),
|
|
735
|
-
action:
|
|
736
|
-
type:
|
|
737
|
-
target:
|
|
738
|
-
method:
|
|
1473
|
+
action: z6.object({
|
|
1474
|
+
type: z6.string(),
|
|
1475
|
+
target: z6.string(),
|
|
1476
|
+
method: z6.string()
|
|
739
1477
|
}).describe("\u30A2\u30AF\u30B7\u30E7\u30F3")
|
|
740
1478
|
}, async (args) => callApi(() => client.addMailFilter(args)));
|
|
741
1479
|
server.tool(serverToolName(brand, "delete", "mail_filter"), "\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u30EB\u30FC\u30EB\u3092\u524A\u9664", {
|
|
742
|
-
filter_id:
|
|
1480
|
+
filter_id: z6.string().describe("\u30D5\u30A3\u30EB\u30BF\u30FCID")
|
|
743
1481
|
}, async ({ filter_id }) => callApi(() => client.deleteMailFilter(filter_id)));
|
|
744
1482
|
}
|
|
745
1483
|
|
|
746
1484
|
// ../core/dist/tools/server/auto-reply.js
|
|
747
|
-
import { z as
|
|
1485
|
+
import { z as z7 } from "zod";
|
|
748
1486
|
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";
|
|
749
1487
|
function registerAutoReplyTools(server, client, brand) {
|
|
750
1488
|
server.tool(serverToolName(brand, "list", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
751
|
-
domain:
|
|
1489
|
+
domain: z7.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
752
1490
|
}, async (args) => {
|
|
753
1491
|
const params = {};
|
|
754
1492
|
if (args.domain)
|
|
@@ -756,30 +1494,30 @@ function registerAutoReplyTools(server, client, brand) {
|
|
|
756
1494
|
return callApi(() => client.listAutoReply(params));
|
|
757
1495
|
});
|
|
758
1496
|
server.tool(serverToolName(brand, "get", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u306E\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
759
|
-
mail_address:
|
|
1497
|
+
mail_address: z7.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
760
1498
|
}, async ({ mail_address }) => callApi(() => client.getAutoReply(mail_address)));
|
|
761
1499
|
server.tool(serverToolName(brand, "add", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
762
|
-
domain:
|
|
763
|
-
mail_address:
|
|
764
|
-
from_name:
|
|
765
|
-
subject:
|
|
766
|
-
body:
|
|
767
|
-
quote_incoming:
|
|
1500
|
+
domain: z7.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1501
|
+
mail_address: z7.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1502
|
+
from_name: z7.string().describe("\u9001\u4FE1\u8005\u540D"),
|
|
1503
|
+
subject: z7.string().describe("\u4EF6\u540D"),
|
|
1504
|
+
body: z7.string().describe("\u672C\u6587"),
|
|
1505
|
+
quote_incoming: z7.boolean().describe("\u53D7\u4FE1\u30E1\u30FC\u30EB\u306E\u5F15\u7528\u3092\u542B\u3081\u308B\u304B")
|
|
768
1506
|
}, async (args) => callApi(() => client.addAutoReply(args)));
|
|
769
1507
|
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", {
|
|
770
|
-
mail_address:
|
|
771
|
-
from_name:
|
|
772
|
-
subject:
|
|
773
|
-
body:
|
|
774
|
-
quote_incoming:
|
|
775
|
-
}, async ({ mail_address, from_name, subject, body, quote_incoming }) => {
|
|
1508
|
+
mail_address: z7.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1509
|
+
from_name: z7.string().optional().describe("\u9001\u4FE1\u8005\u540D"),
|
|
1510
|
+
subject: z7.string().optional().describe("\u4EF6\u540D"),
|
|
1511
|
+
body: z7.string().optional().describe("\u672C\u6587"),
|
|
1512
|
+
quote_incoming: z7.boolean().optional().describe("\u53D7\u4FE1\u30E1\u30FC\u30EB\u306E\u5F15\u7528\u3092\u542B\u3081\u308B\u304B")
|
|
1513
|
+
}, async ({ mail_address, from_name, subject, body: body2, quote_incoming }) => {
|
|
776
1514
|
const data = {};
|
|
777
1515
|
if (from_name !== void 0)
|
|
778
1516
|
data.from_name = from_name;
|
|
779
1517
|
if (subject !== void 0)
|
|
780
1518
|
data.subject = subject;
|
|
781
|
-
if (
|
|
782
|
-
data.body =
|
|
1519
|
+
if (body2 !== void 0)
|
|
1520
|
+
data.body = body2;
|
|
783
1521
|
if (quote_incoming !== void 0)
|
|
784
1522
|
data.quote_incoming = quote_incoming;
|
|
785
1523
|
if (Object.keys(data).length === 0) {
|
|
@@ -788,15 +1526,15 @@ function registerAutoReplyTools(server, client, brand) {
|
|
|
788
1526
|
return callApi(() => client.updateAutoReply(mail_address, data));
|
|
789
1527
|
});
|
|
790
1528
|
server.tool(serverToolName(brand, "delete", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
791
|
-
mail_address:
|
|
1529
|
+
mail_address: z7.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
792
1530
|
}, async ({ mail_address }) => callApi(() => client.deleteAutoReply(mail_address)));
|
|
793
1531
|
}
|
|
794
1532
|
|
|
795
1533
|
// ../core/dist/tools/server/smtp-abroad-restriction.js
|
|
796
|
-
import { z as
|
|
1534
|
+
import { z as z8 } from "zod";
|
|
797
1535
|
function registerSmtpAbroadRestrictionTools(server, client, brand) {
|
|
798
1536
|
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", {
|
|
799
|
-
domain:
|
|
1537
|
+
domain: z8.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
800
1538
|
}, async (args) => {
|
|
801
1539
|
const params = {};
|
|
802
1540
|
if (args.domain)
|
|
@@ -804,16 +1542,16 @@ function registerSmtpAbroadRestrictionTools(server, client, brand) {
|
|
|
804
1542
|
return callApi(() => client.listSmtpAbroadRestriction(params));
|
|
805
1543
|
});
|
|
806
1544
|
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", {
|
|
807
|
-
domain:
|
|
808
|
-
abroad_access_restriction:
|
|
809
|
-
}, async ({ domain, abroad_access_restriction }) => callApi(() => client.updateSmtpAbroadRestriction(
|
|
1545
|
+
domain: z8.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1546
|
+
abroad_access_restriction: z8.boolean().describe("\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u6709\u52B9/\u7121\u52B9")
|
|
1547
|
+
}, async ({ domain: domain2, abroad_access_restriction }) => callApi(() => client.updateSmtpAbroadRestriction(domain2, { abroad_access_restriction })));
|
|
810
1548
|
}
|
|
811
1549
|
|
|
812
1550
|
// ../core/dist/tools/server/dkim.js
|
|
813
|
-
import { z as
|
|
1551
|
+
import { z as z9 } from "zod";
|
|
814
1552
|
function registerDkimTools(server, client, brand) {
|
|
815
1553
|
server.tool(serverToolName(brand, "list", "dkim"), "DKIM\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
816
|
-
domain:
|
|
1554
|
+
domain: z9.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
817
1555
|
}, async (args) => {
|
|
818
1556
|
const params = {};
|
|
819
1557
|
if (args.domain)
|
|
@@ -821,20 +1559,20 @@ function registerDkimTools(server, client, brand) {
|
|
|
821
1559
|
return callApi(() => client.listDkim(params));
|
|
822
1560
|
});
|
|
823
1561
|
server.tool(serverToolName(brand, "get", "dkim"), "DKIM\u8A2D\u5B9A\u306E\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
824
|
-
fqdn:
|
|
1562
|
+
fqdn: z9.string().describe("FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09")
|
|
825
1563
|
}, async ({ fqdn }) => callApi(() => client.getDkim(fqdn)));
|
|
826
1564
|
server.tool(serverToolName(brand, "update", "dkim"), "DKIM\u8A2D\u5B9A\u306E\u6709\u52B9/\u7121\u52B9\u3092\u5207\u308A\u66FF\u3048", {
|
|
827
|
-
fqdn:
|
|
828
|
-
enabled:
|
|
1565
|
+
fqdn: z9.string().describe("FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09"),
|
|
1566
|
+
enabled: z9.boolean().describe("DKIM\u306E\u6709\u52B9/\u7121\u52B9")
|
|
829
1567
|
}, async ({ fqdn, enabled }) => callApi(() => client.updateDkim(fqdn, { enabled })));
|
|
830
1568
|
}
|
|
831
1569
|
|
|
832
1570
|
// ../core/dist/tools/server/dmarc.js
|
|
833
|
-
import { z as
|
|
1571
|
+
import { z as z10 } from "zod";
|
|
834
1572
|
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";
|
|
835
1573
|
function registerDmarcTools(server, client, brand) {
|
|
836
1574
|
server.tool(serverToolName(brand, "list", "dmarc"), "\u9001\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
837
|
-
domain:
|
|
1575
|
+
domain: z10.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
838
1576
|
}, async (args) => {
|
|
839
1577
|
const params = {};
|
|
840
1578
|
if (args.domain)
|
|
@@ -842,11 +1580,11 @@ function registerDmarcTools(server, client, brand) {
|
|
|
842
1580
|
return callApi(() => client.listDmarc(params));
|
|
843
1581
|
});
|
|
844
1582
|
server.tool(serverToolName(brand, "update", "dmarc"), "\u9001\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09", {
|
|
845
|
-
domain:
|
|
846
|
-
policy:
|
|
847
|
-
report_enabled:
|
|
848
|
-
notification_mail_addresses:
|
|
849
|
-
}, async ({ domain, policy, report_enabled, notification_mail_addresses }) => {
|
|
1583
|
+
domain: z10.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1584
|
+
policy: z10.enum(["none", "quarantine", "reject"]).optional().describe("DMARC\u30DD\u30EA\u30B7\u30FC"),
|
|
1585
|
+
report_enabled: z10.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"),
|
|
1586
|
+
notification_mail_addresses: z10.array(z10.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")
|
|
1587
|
+
}, async ({ domain: domain2, policy, report_enabled, notification_mail_addresses }) => {
|
|
850
1588
|
const data = {};
|
|
851
1589
|
if (policy !== void 0)
|
|
852
1590
|
data.policy = policy;
|
|
@@ -858,16 +1596,16 @@ function registerDmarcTools(server, client, brand) {
|
|
|
858
1596
|
if (Object.keys(data).length === 0) {
|
|
859
1597
|
throw new Error(PARTIAL_UPDATE_EMPTY_MESSAGE2);
|
|
860
1598
|
}
|
|
861
|
-
return callApi(() => client.updateDmarc(
|
|
1599
|
+
return callApi(() => client.updateDmarc(domain2, data));
|
|
862
1600
|
});
|
|
863
1601
|
}
|
|
864
1602
|
|
|
865
1603
|
// ../core/dist/tools/server/spf.js
|
|
866
|
-
import { z as
|
|
867
|
-
var updateActionSchema =
|
|
1604
|
+
import { z as z11 } from "zod";
|
|
1605
|
+
var updateActionSchema = z11.enum(["reset", "enable_gmail", "custom"]);
|
|
868
1606
|
function registerSpfTools(server, client, brand) {
|
|
869
1607
|
server.tool(serverToolName(brand, "list", "spf"), "SPF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
870
|
-
domain:
|
|
1608
|
+
domain: z11.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
871
1609
|
}, async (args) => {
|
|
872
1610
|
const params = {};
|
|
873
1611
|
if (args.domain)
|
|
@@ -875,36 +1613,36 @@ function registerSpfTools(server, client, brand) {
|
|
|
875
1613
|
return callApi(() => client.listSpf(params));
|
|
876
1614
|
});
|
|
877
1615
|
server.tool(serverToolName(brand, "add", "spf"), "SPF\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
878
|
-
fqdn:
|
|
1616
|
+
fqdn: z11.string().describe("FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09")
|
|
879
1617
|
}, async ({ fqdn }) => callApi(() => client.addSpf({ fqdn })));
|
|
880
1618
|
server.tool(serverToolName(brand, "update", "spf"), "SPF\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
881
|
-
fqdn:
|
|
1619
|
+
fqdn: z11.string().describe("FQDN"),
|
|
882
1620
|
action: updateActionSchema.describe("reset: \u6A19\u6E96SPF\u3078\u521D\u671F\u5316 / enable_gmail: Gmail\u8A31\u53EFON / custom: \u30AB\u30B9\u30BF\u30E0\u8A2D\u5B9A"),
|
|
883
|
-
spf_record:
|
|
1621
|
+
spf_record: z11.string().optional().describe("\u30AB\u30B9\u30BF\u30E0SPF\u30EC\u30B3\u30FC\u30C9\uFF08action=custom \u306E\u3068\u304D\u5FC5\u9808\uFF09")
|
|
884
1622
|
}, async ({ fqdn, action, spf_record }) => {
|
|
885
|
-
const
|
|
1623
|
+
const body2 = { action };
|
|
886
1624
|
if (action === "custom") {
|
|
887
1625
|
if (spf_record === void 0 || spf_record === "") {
|
|
888
1626
|
throw new Error("action=custom \u306E\u3068\u304D\u306F spf_record \u304C\u5FC5\u9808\u3067\u3059");
|
|
889
1627
|
}
|
|
890
|
-
|
|
1628
|
+
body2.spf_record = spf_record;
|
|
891
1629
|
}
|
|
892
|
-
return callApi(() => client.updateSpf(fqdn,
|
|
1630
|
+
return callApi(() => client.updateSpf(fqdn, body2));
|
|
893
1631
|
});
|
|
894
1632
|
server.tool(serverToolName(brand, "delete", "spf"), "SPF\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
895
|
-
fqdn:
|
|
1633
|
+
fqdn: z11.string().describe("FQDN")
|
|
896
1634
|
}, async ({ fqdn }) => callApi(() => client.deleteSpf(fqdn)));
|
|
897
1635
|
}
|
|
898
1636
|
|
|
899
1637
|
// ../core/dist/tools/server/spam-filter.js
|
|
900
|
-
import { z as
|
|
901
|
-
var filterTypeSchema =
|
|
902
|
-
var detectionActionSchema =
|
|
903
|
-
var spamLevelSchema =
|
|
1638
|
+
import { z as z12 } from "zod";
|
|
1639
|
+
var filterTypeSchema = z12.enum(["off", "standard", "cloudmark_authority"]);
|
|
1640
|
+
var detectionActionSchema = z12.enum(["inbox", "spam", "trash", "delete"]);
|
|
1641
|
+
var spamLevelSchema = z12.enum(["very_lenient", "lenient", "normal", "strict", "very_strict", "strictest"]);
|
|
904
1642
|
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";
|
|
905
1643
|
function registerSpamFilterTools(server, client, brand) {
|
|
906
1644
|
server.tool(serverToolName(brand, "list", "spam_filter"), "\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
907
|
-
domain:
|
|
1645
|
+
domain: z12.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
908
1646
|
}, async (args) => {
|
|
909
1647
|
const params = {};
|
|
910
1648
|
if (args.domain)
|
|
@@ -912,16 +1650,16 @@ function registerSpamFilterTools(server, client, brand) {
|
|
|
912
1650
|
return callApi(() => client.listSpamFilter(params));
|
|
913
1651
|
});
|
|
914
1652
|
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", {
|
|
915
|
-
domain:
|
|
1653
|
+
domain: z12.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
916
1654
|
filter_type: filterTypeSchema.optional().describe("\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF"),
|
|
917
1655
|
detection_action: detectionActionSchema.optional().describe("\u691C\u77E5\u6642\u306E\u51E6\u7406\uFF08inbox / spam / trash / delete\uFF09"),
|
|
918
|
-
white_list:
|
|
919
|
-
black_list:
|
|
1656
|
+
white_list: z12.array(z12.string()).optional().describe("\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u7A7A\u914D\u5217\u3067\u30AF\u30EA\u30A2\uFF09"),
|
|
1657
|
+
black_list: z12.array(z12.string()).optional().describe("\u30D6\u30E9\u30C3\u30AF\u30EA\u30B9\u30C8\uFF08\u7A7A\u914D\u5217\u3067\u30AF\u30EA\u30A2\uFF09"),
|
|
920
1658
|
spam_level: spamLevelSchema.optional().describe("\u6A19\u6E96\u30B9\u30D1\u30E0\u30D5\u30A3\u30EB\u30BF\u5224\u5B9A\u57FA\u6E96"),
|
|
921
|
-
strict_non_japanese_subject:
|
|
922
|
-
strict_html_mail:
|
|
1659
|
+
strict_non_japanese_subject: z12.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"),
|
|
1660
|
+
strict_html_mail: z12.boolean().optional().describe("HTML\u30E1\u30FC\u30EB\u306B\u5BFE\u3057\u3066\u5224\u5B9A\u3092\u53B3\u3057\u304F\u3059\u308B")
|
|
923
1661
|
}, async (args) => {
|
|
924
|
-
const { domain, ...fields } = args;
|
|
1662
|
+
const { domain: domain2, ...fields } = args;
|
|
925
1663
|
const data = {};
|
|
926
1664
|
if (fields.filter_type !== void 0)
|
|
927
1665
|
data.filter_type = fields.filter_type;
|
|
@@ -941,19 +1679,19 @@ function registerSpamFilterTools(server, client, brand) {
|
|
|
941
1679
|
if (Object.keys(data).length === 0) {
|
|
942
1680
|
throw new Error(PARTIAL_UPDATE_EMPTY_MESSAGE3);
|
|
943
1681
|
}
|
|
944
|
-
return callApi(() => client.updateSpamFilter(
|
|
1682
|
+
return callApi(() => client.updateSpamFilter(domain2, data));
|
|
945
1683
|
});
|
|
946
1684
|
server.tool(serverToolName(brand, "update", "spam_filter_dmarc_receiver"), "\u53D7\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
947
|
-
domain:
|
|
948
|
-
dmarc_receiver:
|
|
949
|
-
}, async ({ domain, dmarc_receiver }) => callApi(() => client.updateSpamFilterDmarcReceiver(
|
|
1685
|
+
domain: z12.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1686
|
+
dmarc_receiver: z12.boolean().describe("\u53D7\u4FE1\u5074DMARC\u8A2D\u5B9A")
|
|
1687
|
+
}, async ({ domain: domain2, dmarc_receiver }) => callApi(() => client.updateSpamFilterDmarcReceiver(domain2, { dmarc_receiver })));
|
|
950
1688
|
}
|
|
951
1689
|
|
|
952
1690
|
// ../core/dist/tools/server/ftp.js
|
|
953
|
-
import { z as
|
|
1691
|
+
import { z as z13 } from "zod";
|
|
954
1692
|
function registerFtpTools(server, client, brand) {
|
|
955
1693
|
server.tool(serverToolName(brand, "list", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
956
|
-
domain:
|
|
1694
|
+
domain: z13.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
957
1695
|
}, async (args) => {
|
|
958
1696
|
const params = {};
|
|
959
1697
|
if (args.domain)
|
|
@@ -961,87 +1699,87 @@ function registerFtpTools(server, client, brand) {
|
|
|
961
1699
|
return callApi(() => client.listFtp(params));
|
|
962
1700
|
});
|
|
963
1701
|
server.tool(serverToolName(brand, "add", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u8FFD\u52A0", {
|
|
964
|
-
ftp_account:
|
|
965
|
-
password:
|
|
966
|
-
directory:
|
|
967
|
-
quota_mb:
|
|
968
|
-
memo:
|
|
1702
|
+
ftp_account: z13.string().describe("FTP\u30A2\u30AB\u30A6\u30F3\u30C8\uFF08user@domain \u5F62\u5F0F\uFF09"),
|
|
1703
|
+
password: z13.string().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1704
|
+
directory: z13.string().optional().describe("\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"),
|
|
1705
|
+
quota_mb: z13.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\u30020\u3067\u7121\u5236\u9650\uFF09"),
|
|
1706
|
+
memo: z13.string().optional().describe("\u30E1\u30E2")
|
|
969
1707
|
}, async (args) => callApi(() => client.addFtp(args)));
|
|
970
1708
|
server.tool(serverToolName(brand, "update", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u66F4\u65B0", {
|
|
971
|
-
ftp_account:
|
|
972
|
-
password:
|
|
973
|
-
directory:
|
|
974
|
-
quota_mb:
|
|
975
|
-
memo:
|
|
1709
|
+
ftp_account: z13.string().describe("FTP\u30A2\u30AB\u30A6\u30F3\u30C8"),
|
|
1710
|
+
password: z13.string().optional().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1711
|
+
directory: z13.string().optional().describe("\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"),
|
|
1712
|
+
quota_mb: z13.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\uFF09"),
|
|
1713
|
+
memo: z13.string().optional().describe("\u30E1\u30E2")
|
|
976
1714
|
}, async ({ ftp_account, ...data }) => callApi(() => client.updateFtp(ftp_account, data)));
|
|
977
1715
|
server.tool(serverToolName(brand, "delete", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u524A\u9664", {
|
|
978
|
-
ftp_account:
|
|
1716
|
+
ftp_account: z13.string().describe("FTP\u30A2\u30AB\u30A6\u30F3\u30C8")
|
|
979
1717
|
}, async ({ ftp_account }) => callApi(() => client.deleteFtp(ftp_account)));
|
|
980
1718
|
}
|
|
981
1719
|
|
|
982
1720
|
// ../core/dist/tools/server/database.js
|
|
983
|
-
import { z as
|
|
1721
|
+
import { z as z14 } from "zod";
|
|
984
1722
|
function registerDatabaseTools(server, client, brand) {
|
|
985
1723
|
server.tool(serverToolName(brand, "list", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listDb()));
|
|
986
1724
|
server.tool(serverToolName(brand, "add", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210", {
|
|
987
|
-
name_suffix:
|
|
988
|
-
memo:
|
|
1725
|
+
name_suffix: z14.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"),
|
|
1726
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
989
1727
|
}, async (args) => callApi(() => client.addDb(args)));
|
|
990
1728
|
server.tool(serverToolName(brand, "update", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
991
|
-
db_name:
|
|
992
|
-
memo:
|
|
1729
|
+
db_name: z14.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D"),
|
|
1730
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
993
1731
|
}, async ({ db_name, ...data }) => callApi(() => client.updateDb(db_name, data)));
|
|
994
1732
|
server.tool(serverToolName(brand, "delete", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u524A\u9664", {
|
|
995
|
-
db_name:
|
|
1733
|
+
db_name: z14.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D")
|
|
996
1734
|
}, async ({ db_name }) => callApi(() => client.deleteDb(db_name)));
|
|
997
1735
|
server.tool(serverToolName(brand, "list", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listDbUser()));
|
|
998
1736
|
server.tool(serverToolName(brand, "add", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u3092\u4F5C\u6210", {
|
|
999
|
-
name_suffix:
|
|
1000
|
-
password:
|
|
1001
|
-
memo:
|
|
1737
|
+
name_suffix: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D\u306E\u30B5\u30D5\u30A3\u30C3\u30AF\u30B9"),
|
|
1738
|
+
password: z14.string().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1739
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
1002
1740
|
}, async (args) => callApi(() => client.addDbUser(args)));
|
|
1003
1741
|
server.tool(serverToolName(brand, "update", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u7B49\u3092\u5909\u66F4", {
|
|
1004
|
-
db_user:
|
|
1005
|
-
password:
|
|
1006
|
-
memo:
|
|
1742
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1743
|
+
password: z14.string().optional().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1744
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
1007
1745
|
}, async ({ db_user, ...data }) => callApi(() => client.updateDbUser(db_user, data)));
|
|
1008
1746
|
server.tool(serverToolName(brand, "delete", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u3092\u524A\u9664", {
|
|
1009
|
-
db_user:
|
|
1747
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D")
|
|
1010
1748
|
}, async ({ db_user }) => callApi(() => client.deleteDbUser(db_user)));
|
|
1011
1749
|
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", {
|
|
1012
|
-
db_user:
|
|
1750
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D")
|
|
1013
1751
|
}, async ({ db_user }) => callApi(() => client.listDbUserGrant(db_user)));
|
|
1014
1752
|
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", {
|
|
1015
|
-
db_user:
|
|
1016
|
-
db_name:
|
|
1753
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1754
|
+
db_name: z14.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D")
|
|
1017
1755
|
}, async ({ db_user, ...data }) => callApi(() => client.addDbUserGrant(db_user, data)));
|
|
1018
1756
|
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", {
|
|
1019
|
-
db_user:
|
|
1020
|
-
db_name:
|
|
1757
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1758
|
+
db_name: z14.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D")
|
|
1021
1759
|
}, async ({ db_user, ...data }) => callApi(() => client.deleteDbUserGrant(db_user, data)));
|
|
1022
1760
|
}
|
|
1023
1761
|
|
|
1024
1762
|
// ../core/dist/tools/server/domain.js
|
|
1025
|
-
import { z as
|
|
1763
|
+
import { z as z15 } from "zod";
|
|
1026
1764
|
function registerDomainTools(server, client, brand) {
|
|
1027
1765
|
server.tool(serverToolName(brand, "list", "domain"), "\u30C9\u30E1\u30A4\u30F3\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listDomain()));
|
|
1028
1766
|
server.tool(serverToolName(brand, "get", "domain"), "\u30C9\u30E1\u30A4\u30F3\u306E\u8A73\u7D30\u60C5\u5831\u3092\u53D6\u5F97", {
|
|
1029
|
-
domain:
|
|
1030
|
-
}, async ({ domain }) => callApi(() => client.getDomain(
|
|
1767
|
+
domain: z15.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D")
|
|
1768
|
+
}, async ({ domain: domain2 }) => callApi(() => client.getDomain(domain2)));
|
|
1031
1769
|
server.tool(serverToolName(brand, "add", "domain"), "\u30C9\u30E1\u30A4\u30F3\u3092\u8FFD\u52A0", {
|
|
1032
|
-
domain:
|
|
1033
|
-
ssl:
|
|
1034
|
-
memo:
|
|
1770
|
+
domain: z15.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D"),
|
|
1771
|
+
ssl: z15.boolean().optional().describe("\u7121\u6599SSL\u8A2D\u5B9A\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8: true\uFF09"),
|
|
1772
|
+
memo: z15.string().optional().describe("\u30E1\u30E2")
|
|
1035
1773
|
}, async (args) => callApi(() => client.addDomain(args)));
|
|
1036
1774
|
server.tool(serverToolName(brand, "update", "domain"), "\u30C9\u30E1\u30A4\u30F3\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
1037
|
-
domain:
|
|
1038
|
-
memo:
|
|
1039
|
-
}, async ({ domain, ...data }) => callApi(() => client.updateDomain(
|
|
1775
|
+
domain: z15.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D"),
|
|
1776
|
+
memo: z15.string().optional().describe("\u30E1\u30E2")
|
|
1777
|
+
}, async ({ domain: domain2, ...data }) => callApi(() => client.updateDomain(domain2, data)));
|
|
1040
1778
|
server.tool(serverToolName(brand, "delete", "domain"), "\u30C9\u30E1\u30A4\u30F3\u3092\u524A\u9664", {
|
|
1041
|
-
domain:
|
|
1042
|
-
}, async ({ domain }) => callApi(() => client.deleteDomain(
|
|
1779
|
+
domain: z15.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D")
|
|
1780
|
+
}, async ({ domain: domain2 }) => callApi(() => client.deleteDomain(domain2)));
|
|
1043
1781
|
server.tool(serverToolName(brand, "list", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1044
|
-
domain:
|
|
1782
|
+
domain: z15.string().optional().describe("\u89AA\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1045
1783
|
}, async (args) => {
|
|
1046
1784
|
const params = {};
|
|
1047
1785
|
if (args.domain)
|
|
@@ -1049,26 +1787,26 @@ function registerDomainTools(server, client, brand) {
|
|
|
1049
1787
|
return callApi(() => client.listSubdomain(params));
|
|
1050
1788
|
});
|
|
1051
1789
|
server.tool(serverToolName(brand, "add", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u3092\u8FFD\u52A0", {
|
|
1052
|
-
subdomain:
|
|
1053
|
-
document_root_type:
|
|
1054
|
-
ssl:
|
|
1055
|
-
memo:
|
|
1790
|
+
subdomain: z15.string().describe("\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF08\u4F8B: blog.example.com\uFF09"),
|
|
1791
|
+
document_root_type: z15.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"),
|
|
1792
|
+
ssl: z15.boolean().optional().describe("\u7121\u6599SSL\u8A2D\u5B9A\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8: true\uFF09"),
|
|
1793
|
+
memo: z15.string().optional().describe("\u30E1\u30E2")
|
|
1056
1794
|
}, async (args) => callApi(() => client.addSubdomain(args)));
|
|
1057
1795
|
server.tool(serverToolName(brand, "update", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
1058
|
-
subdomain:
|
|
1059
|
-
memo:
|
|
1796
|
+
subdomain: z15.string().describe("\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3"),
|
|
1797
|
+
memo: z15.string().optional().describe("\u30E1\u30E2")
|
|
1060
1798
|
}, async ({ subdomain, ...data }) => callApi(() => client.updateSubdomain(subdomain, data)));
|
|
1061
1799
|
server.tool(serverToolName(brand, "delete", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u3092\u524A\u9664", {
|
|
1062
|
-
subdomain:
|
|
1063
|
-
delete_files:
|
|
1800
|
+
subdomain: z15.string().describe("\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3"),
|
|
1801
|
+
delete_files: z15.boolean().optional().describe("\u95A2\u9023\u30D5\u30A1\u30A4\u30EB\u3082\u524A\u9664\u3059\u308B\u304B")
|
|
1064
1802
|
}, async ({ subdomain, ...data }) => callApi(() => client.deleteSubdomain(subdomain, data)));
|
|
1065
1803
|
}
|
|
1066
1804
|
|
|
1067
1805
|
// ../core/dist/tools/server/ssl-dns.js
|
|
1068
|
-
import { z as
|
|
1806
|
+
import { z as z16 } from "zod";
|
|
1069
1807
|
function registerSslDnsTools(server, client, brand) {
|
|
1070
1808
|
server.tool(serverToolName(brand, "list", "ssl"), "SSL\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1071
|
-
domain:
|
|
1809
|
+
domain: z16.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1072
1810
|
}, async (args) => {
|
|
1073
1811
|
const params = {};
|
|
1074
1812
|
if (args.domain)
|
|
@@ -1076,13 +1814,13 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
1076
1814
|
return callApi(() => client.listSsl(params));
|
|
1077
1815
|
});
|
|
1078
1816
|
server.tool(serverToolName(brand, "install", "ssl"), "\u7121\u6599SSL\uFF08Let's Encrypt\uFF09\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
1079
|
-
common_name:
|
|
1817
|
+
common_name: z16.string().describe("\u30B3\u30E2\u30F3\u30CD\u30FC\u30E0\uFF08\u30C9\u30E1\u30A4\u30F3\u540D\uFF09")
|
|
1080
1818
|
}, async (args) => callApi(() => client.installSsl(args)));
|
|
1081
1819
|
server.tool(serverToolName(brand, "uninstall", "ssl"), "\u7121\u6599SSL\u3092\u30A2\u30F3\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
1082
|
-
common_name:
|
|
1820
|
+
common_name: z16.string().describe("\u30B3\u30E2\u30F3\u30CD\u30FC\u30E0\uFF08\u30C9\u30E1\u30A4\u30F3\u540D\uFF09")
|
|
1083
1821
|
}, async ({ common_name }) => callApi(() => client.uninstallSsl(common_name)));
|
|
1084
1822
|
server.tool(serverToolName(brand, "list", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1085
|
-
domain:
|
|
1823
|
+
domain: z16.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1086
1824
|
}, async (args) => {
|
|
1087
1825
|
const params = {};
|
|
1088
1826
|
if (args.domain)
|
|
@@ -1090,35 +1828,35 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
1090
1828
|
return callApi(() => client.listDns(params));
|
|
1091
1829
|
});
|
|
1092
1830
|
server.tool(serverToolName(brand, "add", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u3092\u8FFD\u52A0", {
|
|
1093
|
-
domain:
|
|
1094
|
-
host:
|
|
1095
|
-
type:
|
|
1096
|
-
content:
|
|
1097
|
-
ttl:
|
|
1098
|
-
priority:
|
|
1831
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1832
|
+
host: z16.string().describe("\u30DB\u30B9\u30C8\u540D\uFF08@\u3067apex\uFF09"),
|
|
1833
|
+
type: z16.string().describe("\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7\uFF08A / AAAA / CNAME / MX / TXT / SRV / CAA\uFF09"),
|
|
1834
|
+
content: z16.string().describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
1835
|
+
ttl: z16.number().optional().describe("TTL\uFF0860-86400\u3002\u30C7\u30D5\u30A9\u30EB\u30C8: 3600\uFF09"),
|
|
1836
|
+
priority: z16.number().optional().describe("\u512A\u5148\u5EA6\uFF08MX/SRV\u30EC\u30B3\u30FC\u30C9\u7528\uFF09")
|
|
1099
1837
|
}, async (args) => callApi(() => client.addDns(args)));
|
|
1100
1838
|
server.tool(serverToolName(brand, "update", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u3092\u66F4\u65B0", {
|
|
1101
|
-
dns_id:
|
|
1102
|
-
domain:
|
|
1103
|
-
host:
|
|
1104
|
-
type:
|
|
1105
|
-
content:
|
|
1106
|
-
ttl:
|
|
1107
|
-
priority:
|
|
1839
|
+
dns_id: z16.string().describe("DNS\u30EC\u30B3\u30FC\u30C9ID"),
|
|
1840
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1841
|
+
host: z16.string().describe("\u30DB\u30B9\u30C8\u540D"),
|
|
1842
|
+
type: z16.string().describe("\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7"),
|
|
1843
|
+
content: z16.string().describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
1844
|
+
ttl: z16.number().optional().describe("TTL"),
|
|
1845
|
+
priority: z16.number().optional().describe("\u512A\u5148\u5EA6")
|
|
1108
1846
|
}, async ({ dns_id, ...data }) => callApi(() => client.updateDns(dns_id, data)));
|
|
1109
1847
|
server.tool(serverToolName(brand, "delete", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664", {
|
|
1110
|
-
dns_id:
|
|
1111
|
-
domain:
|
|
1848
|
+
dns_id: z16.string().describe("DNS\u30EC\u30B3\u30FC\u30C9ID"),
|
|
1849
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3")
|
|
1112
1850
|
}, async ({ dns_id, ...data }) => callApi(() => client.deleteDns(dns_id, data)));
|
|
1113
1851
|
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()));
|
|
1114
1852
|
server.tool(serverToolName(brand, "update", "php_version"), "\u30C9\u30E1\u30A4\u30F3\u306EPHP\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5909\u66F4", {
|
|
1115
|
-
domain:
|
|
1116
|
-
version:
|
|
1117
|
-
}, async ({ domain, ...data }) => callApi(() => client.updatePhpVersion(
|
|
1853
|
+
domain: z16.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D"),
|
|
1854
|
+
version: z16.string().describe("PHP\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u4F8B: 8.3.21\uFF09")
|
|
1855
|
+
}, async ({ domain: domain2, ...data }) => callApi(() => client.updatePhpVersion(domain2, data)));
|
|
1118
1856
|
server.tool(serverToolName(brand, "get", "access_log"), "\u30A2\u30AF\u30BB\u30B9\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
1119
|
-
domain:
|
|
1120
|
-
lines:
|
|
1121
|
-
keyword:
|
|
1857
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1858
|
+
lines: z16.number().optional().describe("\u53D6\u5F97\u884C\u6570\uFF08\u672B\u5C3E\u304B\u3089\uFF09"),
|
|
1859
|
+
keyword: z16.string().optional().describe("\u7D5E\u308A\u8FBC\u307F\u30AD\u30FC\u30EF\u30FC\u30C9")
|
|
1122
1860
|
}, async (args) => {
|
|
1123
1861
|
const params = {};
|
|
1124
1862
|
if (args.domain)
|
|
@@ -1130,9 +1868,9 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
1130
1868
|
return callApi(() => client.getAccessLog(params));
|
|
1131
1869
|
});
|
|
1132
1870
|
server.tool(serverToolName(brand, "get", "error_log"), "\u30A8\u30E9\u30FC\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
1133
|
-
domain:
|
|
1134
|
-
lines:
|
|
1135
|
-
keyword:
|
|
1871
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1872
|
+
lines: z16.number().optional().describe("\u53D6\u5F97\u884C\u6570\uFF08\u672B\u5C3E\u304B\u3089\uFF09"),
|
|
1873
|
+
keyword: z16.string().optional().describe("\u7D5E\u308A\u8FBC\u307F\u30AD\u30FC\u30EF\u30FC\u30C9")
|
|
1136
1874
|
}, async (args) => {
|
|
1137
1875
|
const params = {};
|
|
1138
1876
|
if (args.domain)
|
|
@@ -1146,19 +1884,19 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
1146
1884
|
}
|
|
1147
1885
|
|
|
1148
1886
|
// ../core/dist/tools/server/resource-monitor.js
|
|
1149
|
-
import { z as
|
|
1887
|
+
import { z as z17 } from "zod";
|
|
1150
1888
|
function registerResourceMonitorTools(server, client, brand) {
|
|
1151
1889
|
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", {
|
|
1152
|
-
date:
|
|
1890
|
+
date: z17.string().describe("\u5BFE\u8C61\u65E5\uFF08Y-m-d \u307E\u305F\u306F Ymd\u3002\u5F53\u65E5\u542B\u3080\u76F4\u8FD11\u304B\u6708\uFF09")
|
|
1153
1891
|
}, async ({ date }) => callApi(() => client.getResourceMonitor(date)));
|
|
1154
1892
|
}
|
|
1155
1893
|
|
|
1156
1894
|
// ../core/dist/tools/server/waf.js
|
|
1157
|
-
import { z as
|
|
1895
|
+
import { z as z18 } from "zod";
|
|
1158
1896
|
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";
|
|
1159
1897
|
function registerWafTools(server, client, brand) {
|
|
1160
1898
|
server.tool(serverToolName(brand, "list", "waf"), "WAF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1161
|
-
domain:
|
|
1899
|
+
domain: z18.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1162
1900
|
}, async (args) => {
|
|
1163
1901
|
const params = {};
|
|
1164
1902
|
if (args.domain)
|
|
@@ -1166,15 +1904,15 @@ function registerWafTools(server, client, brand) {
|
|
|
1166
1904
|
return callApi(() => client.listWaf(params));
|
|
1167
1905
|
});
|
|
1168
1906
|
server.tool(serverToolName(brand, "update", "waf"), "WAF\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09", {
|
|
1169
|
-
domain:
|
|
1170
|
-
xss_protection:
|
|
1171
|
-
sql_injection_protection:
|
|
1172
|
-
file_protection:
|
|
1173
|
-
mail_protection:
|
|
1174
|
-
command_protection:
|
|
1175
|
-
php_protection:
|
|
1907
|
+
domain: z18.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1908
|
+
xss_protection: z18.boolean().optional().describe("XSS\u5BFE\u7B56"),
|
|
1909
|
+
sql_injection_protection: z18.boolean().optional().describe("SQL\u5BFE\u7B56"),
|
|
1910
|
+
file_protection: z18.boolean().optional().describe("\u30D5\u30A1\u30A4\u30EB\u5BFE\u7B56"),
|
|
1911
|
+
mail_protection: z18.boolean().optional().describe("\u30E1\u30FC\u30EB\u5BFE\u7B56"),
|
|
1912
|
+
command_protection: z18.boolean().optional().describe("\u30B3\u30DE\u30F3\u30C9\u5BFE\u7B56"),
|
|
1913
|
+
php_protection: z18.boolean().optional().describe("PHP\u5BFE\u7B56")
|
|
1176
1914
|
}, async (args) => {
|
|
1177
|
-
const { domain, ...fields } = args;
|
|
1915
|
+
const { domain: domain2, ...fields } = args;
|
|
1178
1916
|
const data = {};
|
|
1179
1917
|
if (fields.xss_protection !== void 0)
|
|
1180
1918
|
data.xss_protection = fields.xss_protection;
|
|
@@ -1191,44 +1929,44 @@ function registerWafTools(server, client, brand) {
|
|
|
1191
1929
|
if (Object.keys(data).length === 0) {
|
|
1192
1930
|
throw new Error(PARTIAL_UPDATE_EMPTY_MESSAGE4);
|
|
1193
1931
|
}
|
|
1194
|
-
return callApi(() => client.updateWaf(
|
|
1932
|
+
return callApi(() => client.updateWaf(domain2, data));
|
|
1195
1933
|
});
|
|
1196
1934
|
}
|
|
1197
1935
|
|
|
1198
1936
|
// ../core/dist/tools/server/php-ini.js
|
|
1199
|
-
import { z as
|
|
1937
|
+
import { z as z19 } from "zod";
|
|
1200
1938
|
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";
|
|
1201
1939
|
var phpIniUpdateSchema = {
|
|
1202
|
-
domain:
|
|
1203
|
-
display_errors:
|
|
1204
|
-
error_reporting:
|
|
1205
|
-
display_startup_errors:
|
|
1206
|
-
"session.auto_start":
|
|
1207
|
-
"session.name":
|
|
1208
|
-
"session.use_cookies":
|
|
1209
|
-
"session.use_only_cookies":
|
|
1210
|
-
"session.use_trans_sid":
|
|
1211
|
-
"session.cookie_lifetime":
|
|
1212
|
-
"session.cookie_path":
|
|
1213
|
-
"session.cookie_domain":
|
|
1214
|
-
"mbstring.language":
|
|
1215
|
-
"mbstring.internal_encoding":
|
|
1216
|
-
"mbstring.http_input":
|
|
1217
|
-
"mbstring.http_output":
|
|
1218
|
-
"mbstring.encoding_translation":
|
|
1219
|
-
"mbstring.detect_order":
|
|
1220
|
-
"mbstring.substitute_character":
|
|
1221
|
-
max_execution_time:
|
|
1222
|
-
max_input_time:
|
|
1223
|
-
memory_limit:
|
|
1224
|
-
post_max_size:
|
|
1225
|
-
upload_max_filesize:
|
|
1226
|
-
register_globals:
|
|
1227
|
-
magic_quotes_gpc:
|
|
1228
|
-
safe_mode:
|
|
1229
|
-
file_uploads:
|
|
1230
|
-
allow_url_fopen:
|
|
1231
|
-
allow_url_include:
|
|
1940
|
+
domain: z19.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1941
|
+
display_errors: z19.string().optional().describe("\u30A8\u30E9\u30FC\u5185\u5BB9\u3092\u753B\u9762\u306B\u51FA\u529B\uFF08On / Off\uFF09"),
|
|
1942
|
+
error_reporting: z19.string().optional().describe("\u30A8\u30E9\u30FC\u51FA\u529B\u30EC\u30D9\u30EB"),
|
|
1943
|
+
display_startup_errors: z19.string().optional().describe("\u8D77\u52D5\u6642\u30A8\u30E9\u30FC\u3092\u8868\u793A\uFF08On / Off\uFF09"),
|
|
1944
|
+
"session.auto_start": z19.string().optional().describe("\u30BB\u30C3\u30B7\u30E7\u30F3\u81EA\u52D5\u958B\u59CB\uFF080 / 1\uFF09"),
|
|
1945
|
+
"session.name": z19.string().optional().describe("\u30BB\u30C3\u30B7\u30E7\u30F3\u540D"),
|
|
1946
|
+
"session.use_cookies": z19.string().optional().describe("\u30BB\u30C3\u30B7\u30E7\u30F3ID\u306B\u30AF\u30C3\u30AD\u30FC\u3092\u4F7F\u7528\uFF080 / 1\uFF09"),
|
|
1947
|
+
"session.use_only_cookies": z19.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u306E\u307F\u3067\u30BB\u30C3\u30B7\u30E7\u30F3ID\u3092\u4FDD\u5B58\uFF080 / 1\uFF09"),
|
|
1948
|
+
"session.use_trans_sid": z19.string().optional().describe("URL\u3078\u30BB\u30C3\u30B7\u30E7\u30F3ID\u3092\u81EA\u52D5\u8A2D\u5B9A\uFF080 / 1\uFF09"),
|
|
1949
|
+
"session.cookie_lifetime": z19.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u6709\u52B9\u671F\u9593\uFF08\u79D2\uFF09"),
|
|
1950
|
+
"session.cookie_path": z19.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30D1\u30B9"),
|
|
1951
|
+
"session.cookie_domain": z19.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30C9\u30E1\u30A4\u30F3"),
|
|
1952
|
+
"mbstring.language": z19.string().optional().describe("\u30C7\u30D5\u30A9\u30EB\u30C8\u8A00\u8A9E"),
|
|
1953
|
+
"mbstring.internal_encoding": z19.string().optional().describe("\u5185\u90E8\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0"),
|
|
1954
|
+
"mbstring.http_input": z19.string().optional().describe("HTTP\u5165\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB"),
|
|
1955
|
+
"mbstring.http_output": z19.string().optional().describe("HTTP\u51FA\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB"),
|
|
1956
|
+
"mbstring.encoding_translation": z19.string().optional().describe("\u5185\u90E8\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3078\u306E\u5909\u63DB\uFF08On / Off\uFF09"),
|
|
1957
|
+
"mbstring.detect_order": z19.string().optional().describe("\u6587\u5B57\u30B3\u30FC\u30C9\u691C\u51FA"),
|
|
1958
|
+
"mbstring.substitute_character": z19.string().optional().describe("\u7121\u52B9\u6587\u5B57\u306E\u4EE3\u66FF\u6587\u5B57"),
|
|
1959
|
+
max_execution_time: z19.string().optional().describe("\u6700\u5927\u5B9F\u884C\u6642\u9593\uFF08\u79D2\uFF09"),
|
|
1960
|
+
max_input_time: z19.string().optional().describe("\u5165\u529B\u30D1\u30FC\u30B9\u6700\u5927\u6642\u9593\uFF08\u79D2\uFF09"),
|
|
1961
|
+
memory_limit: z19.string().optional().describe("\u6700\u5927\u30E1\u30E2\u30EA"),
|
|
1962
|
+
post_max_size: z19.string().optional().describe("POST\u30C7\u30FC\u30BF\u6700\u5927\u30B5\u30A4\u30BA"),
|
|
1963
|
+
upload_max_filesize: z19.string().optional().describe("\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u30D5\u30A1\u30A4\u30EB\u6700\u5927\u30B5\u30A4\u30BA"),
|
|
1964
|
+
register_globals: z19.string().optional().describe("register_globals\uFF08On / Off\uFF09"),
|
|
1965
|
+
magic_quotes_gpc: z19.string().optional().describe("magic_quotes_gpc\uFF08On / Off\uFF09"),
|
|
1966
|
+
safe_mode: z19.string().optional().describe("safe_mode\uFF08On / Off\uFF09"),
|
|
1967
|
+
file_uploads: z19.string().optional().describe("HTTP\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\uFF08On / Off\uFF09"),
|
|
1968
|
+
allow_url_fopen: z19.string().optional().describe("allow_url_fopen\uFF08On / Off\uFF09"),
|
|
1969
|
+
allow_url_include: z19.string().optional().describe("allow_url_include\uFF08On / Off\uFF09")
|
|
1232
1970
|
};
|
|
1233
1971
|
var PHP_INI_API_KEYS = [
|
|
1234
1972
|
"display_errors",
|
|
@@ -1263,7 +2001,7 @@ var PHP_INI_API_KEYS = [
|
|
|
1263
2001
|
];
|
|
1264
2002
|
function registerPhpIniTools(server, client, brand) {
|
|
1265
2003
|
server.tool(serverToolName(brand, "list", "php_ini"), "php.ini\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
1266
|
-
domain:
|
|
2004
|
+
domain: z19.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1267
2005
|
}, async (args) => {
|
|
1268
2006
|
const params = {};
|
|
1269
2007
|
if (args.domain)
|
|
@@ -1271,7 +2009,7 @@ function registerPhpIniTools(server, client, brand) {
|
|
|
1271
2009
|
return callApi(() => client.listPhpIni(params));
|
|
1272
2010
|
});
|
|
1273
2011
|
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) => {
|
|
1274
|
-
const { domain, ...fields } = args;
|
|
2012
|
+
const { domain: domain2, ...fields } = args;
|
|
1275
2013
|
const data = {};
|
|
1276
2014
|
for (const key of PHP_INI_API_KEYS) {
|
|
1277
2015
|
const value = fields[key];
|
|
@@ -1281,21 +2019,21 @@ function registerPhpIniTools(server, client, brand) {
|
|
|
1281
2019
|
if (Object.keys(data).length === 0) {
|
|
1282
2020
|
throw new Error(PARTIAL_UPDATE_EMPTY_MESSAGE5);
|
|
1283
2021
|
}
|
|
1284
|
-
return callApi(() => client.updatePhpIni(
|
|
2022
|
+
return callApi(() => client.updatePhpIni(domain2, data));
|
|
1285
2023
|
});
|
|
1286
2024
|
server.tool(serverToolName(brand, "reset", "php_ini"), "php.ini\u8A2D\u5B9A\u3092\u521D\u671F\u5024\u306B\u623B\u3059", {
|
|
1287
|
-
domain:
|
|
1288
|
-
}, async ({ domain }) => callApi(() => client.resetPhpIni(
|
|
2025
|
+
domain: z19.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3")
|
|
2026
|
+
}, async ({ domain: domain2 }) => callApi(() => client.resetPhpIni(domain2)));
|
|
1289
2027
|
}
|
|
1290
2028
|
|
|
1291
2029
|
// ../core/dist/tools/server/wordpress-security.js
|
|
1292
|
-
import { z as
|
|
1293
|
-
var enabledTargetSchema =
|
|
1294
|
-
enabled:
|
|
2030
|
+
import { z as z20 } from "zod";
|
|
2031
|
+
var enabledTargetSchema = z20.object({
|
|
2032
|
+
enabled: z20.boolean()
|
|
1295
2033
|
});
|
|
1296
|
-
var foreignIpTargetSchema =
|
|
1297
|
-
enabled:
|
|
1298
|
-
allowed_ip_addresses:
|
|
2034
|
+
var foreignIpTargetSchema = z20.object({
|
|
2035
|
+
enabled: z20.boolean().optional(),
|
|
2036
|
+
allowed_ip_addresses: z20.array(z20.string()).optional()
|
|
1299
2037
|
});
|
|
1300
2038
|
var UPDATE_BLOCKS = [
|
|
1301
2039
|
"comment_restriction",
|
|
@@ -1304,31 +2042,31 @@ var UPDATE_BLOCKS = [
|
|
|
1304
2042
|
"ip_restriction"
|
|
1305
2043
|
];
|
|
1306
2044
|
var wordpressSecurityUpdateSchema = {
|
|
1307
|
-
domain:
|
|
1308
|
-
comment_restriction:
|
|
2045
|
+
domain: z20.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2046
|
+
comment_restriction: z20.object({
|
|
1309
2047
|
bulk_post: enabledTargetSchema.optional(),
|
|
1310
2048
|
foreign_post: enabledTargetSchema.optional()
|
|
1311
2049
|
}).optional().describe("\u30B3\u30E1\u30F3\u30C8\u5236\u9650"),
|
|
1312
|
-
login_attempt_limit:
|
|
1313
|
-
enabled:
|
|
2050
|
+
login_attempt_limit: z20.object({
|
|
2051
|
+
enabled: z20.boolean()
|
|
1314
2052
|
}).optional().describe("\u30ED\u30B0\u30A4\u30F3\u8A66\u884C\u56DE\u6570\u5236\u9650"),
|
|
1315
|
-
foreign_ip_restriction:
|
|
2053
|
+
foreign_ip_restriction: z20.object({
|
|
1316
2054
|
dashboard: foreignIpTargetSchema.optional(),
|
|
1317
2055
|
xml_rpc_api: foreignIpTargetSchema.optional(),
|
|
1318
2056
|
rest_api: foreignIpTargetSchema.optional(),
|
|
1319
2057
|
wlwmanifest: foreignIpTargetSchema.optional()
|
|
1320
2058
|
}).optional().describe("\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650"),
|
|
1321
|
-
ip_restriction:
|
|
1322
|
-
enabled:
|
|
1323
|
-
allowed_ip_addresses:
|
|
2059
|
+
ip_restriction: z20.object({
|
|
2060
|
+
enabled: z20.boolean().optional(),
|
|
2061
|
+
allowed_ip_addresses: z20.array(z20.string()).optional()
|
|
1324
2062
|
}).optional().describe("IP\u30A2\u30C9\u30EC\u30B9\u5236\u9650\uFF08\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\uFF09")
|
|
1325
2063
|
};
|
|
1326
2064
|
function buildUpdateBody(args) {
|
|
1327
|
-
const
|
|
1328
|
-
if (typeof
|
|
2065
|
+
const domain2 = args.domain;
|
|
2066
|
+
if (typeof domain2 !== "string" || domain2 === "") {
|
|
1329
2067
|
throw new Error("domain \u306F\u5FC5\u9808\u3067\u3059");
|
|
1330
2068
|
}
|
|
1331
|
-
const data = { domain };
|
|
2069
|
+
const data = { domain: domain2 };
|
|
1332
2070
|
for (const key of UPDATE_BLOCKS) {
|
|
1333
2071
|
if (args[key] !== void 0)
|
|
1334
2072
|
data[key] = args[key];
|
|
@@ -1340,7 +2078,7 @@ function buildUpdateBody(args) {
|
|
|
1340
2078
|
}
|
|
1341
2079
|
function registerWordPressSecurityTools(server, client, brand) {
|
|
1342
2080
|
server.tool(serverToolName(brand, "get", "wordpress_security"), "WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
1343
|
-
domain:
|
|
2081
|
+
domain: z20.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1344
2082
|
}, async (args) => {
|
|
1345
2083
|
const params = {};
|
|
1346
2084
|
if (args.domain)
|
|
@@ -1351,10 +2089,10 @@ function registerWordPressSecurityTools(server, client, brand) {
|
|
|
1351
2089
|
}
|
|
1352
2090
|
|
|
1353
2091
|
// ../core/dist/tools/server/x-accelerator.js
|
|
1354
|
-
import { z as
|
|
2092
|
+
import { z as z21 } from "zod";
|
|
1355
2093
|
function registerXAcceleratorTools(server, client, brand) {
|
|
1356
2094
|
server.tool(serverToolName(brand, "list", "x_accelerator"), "X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1357
|
-
domain:
|
|
2095
|
+
domain: z21.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1358
2096
|
}, async (args) => {
|
|
1359
2097
|
const params = {};
|
|
1360
2098
|
if (args.domain)
|
|
@@ -1362,16 +2100,16 @@ function registerXAcceleratorTools(server, client, brand) {
|
|
|
1362
2100
|
return callApi(() => client.listXAccelerator(params));
|
|
1363
2101
|
});
|
|
1364
2102
|
server.tool(serverToolName(brand, "update", "x_accelerator"), "X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
1365
|
-
domain:
|
|
1366
|
-
xaccelerator_status:
|
|
1367
|
-
}, async ({ domain, xaccelerator_status }) => callApi(() => client.updateXAccelerator(
|
|
2103
|
+
domain: z21.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2104
|
+
xaccelerator_status: z21.enum(["off", "v1", "v2"]).describe("X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\uFF08off / v1 / v2\uFF09")
|
|
2105
|
+
}, async ({ domain: domain2, xaccelerator_status }) => callApi(() => client.updateXAccelerator(domain2, { xaccelerator_status })));
|
|
1368
2106
|
}
|
|
1369
2107
|
|
|
1370
2108
|
// ../core/dist/tools/server/server-cache.js
|
|
1371
|
-
import { z as
|
|
2109
|
+
import { z as z22 } from "zod";
|
|
1372
2110
|
function registerServerCacheTools(server, client, brand) {
|
|
1373
2111
|
server.tool(serverToolName(brand, "list", "server_cache"), "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1374
|
-
domain:
|
|
2112
|
+
domain: z22.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1375
2113
|
}, async (args) => {
|
|
1376
2114
|
const params = {};
|
|
1377
2115
|
if (args.domain)
|
|
@@ -1379,19 +2117,19 @@ function registerServerCacheTools(server, client, brand) {
|
|
|
1379
2117
|
return callApi(() => client.listServerCache(params));
|
|
1380
2118
|
});
|
|
1381
2119
|
server.tool(serverToolName(brand, "update", "server_cache"), "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
1382
|
-
domain:
|
|
1383
|
-
server_cache_status:
|
|
1384
|
-
}, async ({ domain, server_cache_status }) => callApi(() => client.updateServerCache(
|
|
2120
|
+
domain: z22.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2121
|
+
server_cache_status: z22.enum(["on", "off"]).describe("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\uFF08on / off\uFF09")
|
|
2122
|
+
}, async ({ domain: domain2, server_cache_status }) => callApi(() => client.updateServerCache(domain2, { server_cache_status })));
|
|
1385
2123
|
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", {
|
|
1386
|
-
domain:
|
|
1387
|
-
}, async ({ domain }) => callApi(() => client.clearServerCache(
|
|
2124
|
+
domain: z22.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3")
|
|
2125
|
+
}, async ({ domain: domain2 }) => callApi(() => client.clearServerCache(domain2)));
|
|
1388
2126
|
}
|
|
1389
2127
|
|
|
1390
2128
|
// ../core/dist/tools/server/browser-cache.js
|
|
1391
|
-
import { z as
|
|
2129
|
+
import { z as z23 } from "zod";
|
|
1392
2130
|
function registerBrowserCacheTools(server, client, brand) {
|
|
1393
2131
|
server.tool(serverToolName(brand, "list", "browser_cache"), "\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1394
|
-
domain:
|
|
2132
|
+
domain: z23.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1395
2133
|
}, async (args) => {
|
|
1396
2134
|
const params = {};
|
|
1397
2135
|
if (args.domain)
|
|
@@ -1399,16 +2137,16 @@ function registerBrowserCacheTools(server, client, brand) {
|
|
|
1399
2137
|
return callApi(() => client.listBrowserCache(params));
|
|
1400
2138
|
});
|
|
1401
2139
|
server.tool(serverToolName(brand, "update", "browser_cache"), "\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
1402
|
-
domain:
|
|
1403
|
-
browser_cache_status:
|
|
1404
|
-
}, async ({ domain, browser_cache_status }) => callApi(() => client.updateBrowserCache(
|
|
2140
|
+
domain: z23.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2141
|
+
browser_cache_status: z23.enum(["all", "ignore-css-js", "off"]).describe("\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\uFF08all / ignore-css-js / off\uFF09")
|
|
2142
|
+
}, async ({ domain: domain2, browser_cache_status }) => callApi(() => client.updateBrowserCache(domain2, { browser_cache_status })));
|
|
1405
2143
|
}
|
|
1406
2144
|
|
|
1407
2145
|
// ../core/dist/tools/server/url-redirect.js
|
|
1408
|
-
import { z as
|
|
2146
|
+
import { z as z24 } from "zod";
|
|
1409
2147
|
function registerUrlRedirectTools(server, client, brand) {
|
|
1410
2148
|
server.tool(serverToolName(brand, "list", "url_redirect"), "\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1411
|
-
domain:
|
|
2149
|
+
domain: z24.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1412
2150
|
}, async (args) => {
|
|
1413
2151
|
const params = {};
|
|
1414
2152
|
if (args.domain)
|
|
@@ -1416,11 +2154,11 @@ function registerUrlRedirectTools(server, client, brand) {
|
|
|
1416
2154
|
return callApi(() => client.listUrlRedirect(params));
|
|
1417
2155
|
});
|
|
1418
2156
|
server.tool(serverToolName(brand, "add", "url_redirect"), "\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
1419
|
-
domain:
|
|
1420
|
-
from_host:
|
|
1421
|
-
from_path:
|
|
1422
|
-
redirect_to_url:
|
|
1423
|
-
status_code:
|
|
2157
|
+
domain: z24.string().describe("\u5951\u7D04\u30C9\u30E1\u30A4\u30F3"),
|
|
2158
|
+
from_host: z24.string().describe("\u8EE2\u9001\u5143\u30DB\u30B9\u30C8\uFF08FQDN\uFF09"),
|
|
2159
|
+
from_path: z24.string().optional().describe("\u8EE2\u9001\u5143\u30D1\u30B9\uFF08\u7701\u7565\u6642\u306F /\uFF09"),
|
|
2160
|
+
redirect_to_url: z24.string().describe("\u8EE2\u9001\u5148URL\uFF08http \u307E\u305F\u306F https\uFF09"),
|
|
2161
|
+
status_code: z24.union([z24.literal(301), z24.literal(302)]).describe("\u8EE2\u9001\u6642\u306E\u30B9\u30C6\u30FC\u30BF\u30B9\u30B3\u30FC\u30C9\uFF08301 / 302\uFF09")
|
|
1424
2162
|
}, async (args) => {
|
|
1425
2163
|
const data = {
|
|
1426
2164
|
domain: args.domain,
|
|
@@ -1433,15 +2171,15 @@ function registerUrlRedirectTools(server, client, brand) {
|
|
|
1433
2171
|
return callApi(() => client.addUrlRedirect(data));
|
|
1434
2172
|
});
|
|
1435
2173
|
server.tool(serverToolName(brand, "delete", "url_redirect"), "\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
1436
|
-
redirect_id:
|
|
2174
|
+
redirect_id: z24.string().describe("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u306EID")
|
|
1437
2175
|
}, async ({ redirect_id }) => callApi(() => client.deleteUrlRedirect(redirect_id)));
|
|
1438
2176
|
}
|
|
1439
2177
|
|
|
1440
2178
|
// ../core/dist/tools/server/access-deny.js
|
|
1441
|
-
import { z as
|
|
2179
|
+
import { z as z25 } from "zod";
|
|
1442
2180
|
function registerAccessDenyTools(server, client, brand) {
|
|
1443
2181
|
server.tool(serverToolName(brand, "list", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1444
|
-
domain:
|
|
2182
|
+
domain: z25.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1445
2183
|
}, async (args) => {
|
|
1446
2184
|
const params = {};
|
|
1447
2185
|
if (args.domain)
|
|
@@ -1449,9 +2187,9 @@ function registerAccessDenyTools(server, client, brand) {
|
|
|
1449
2187
|
return callApi(() => client.listAccessDeny(params));
|
|
1450
2188
|
});
|
|
1451
2189
|
server.tool(serverToolName(brand, "add", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
1452
|
-
domain:
|
|
1453
|
-
ip_address:
|
|
1454
|
-
memo:
|
|
2190
|
+
domain: z25.string().describe("\u5951\u7D04\u30C9\u30E1\u30A4\u30F3"),
|
|
2191
|
+
ip_address: z25.string().describe("\u62D2\u5426IP\u30A2\u30C9\u30EC\u30B9\u30FB\u30DB\u30B9\u30C8\uFF08IPv4 / CIDR / \u90E8\u5206IP / \u30DB\u30B9\u30C8\u540D\uFF09"),
|
|
2192
|
+
memo: z25.string().optional().describe("\u30E1\u30E2\uFF08\u6700\u5927500\u6587\u5B57\uFF09")
|
|
1455
2193
|
}, async (args) => {
|
|
1456
2194
|
const data = {
|
|
1457
2195
|
domain: args.domain,
|
|
@@ -1462,16 +2200,16 @@ function registerAccessDenyTools(server, client, brand) {
|
|
|
1462
2200
|
return callApi(() => client.addAccessDeny(data));
|
|
1463
2201
|
});
|
|
1464
2202
|
server.tool(serverToolName(brand, "update", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
1465
|
-
deny_id:
|
|
1466
|
-
memo:
|
|
1467
|
-
}, async ({ deny_id, memo }) => callApi(() => client.updateAccessDeny(deny_id, { memo })));
|
|
2203
|
+
deny_id: z25.string().describe("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306EID"),
|
|
2204
|
+
memo: z25.string().describe("\u30E1\u30E2\uFF08\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09")
|
|
2205
|
+
}, async ({ deny_id, memo: memo2 }) => callApi(() => client.updateAccessDeny(deny_id, { memo: memo2 })));
|
|
1468
2206
|
server.tool(serverToolName(brand, "delete", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
1469
|
-
deny_id:
|
|
2207
|
+
deny_id: z25.string().describe("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306EID")
|
|
1470
2208
|
}, async ({ deny_id }) => callApi(() => client.deleteAccessDeny(deny_id)));
|
|
1471
2209
|
}
|
|
1472
2210
|
|
|
1473
2211
|
// ../core/dist/tools/server/xpagespeed.js
|
|
1474
|
-
import { z as
|
|
2212
|
+
import { z as z26 } from "zod";
|
|
1475
2213
|
var XPAGESPEED_KEYS = [
|
|
1476
2214
|
"xoptimize_images",
|
|
1477
2215
|
"lazyload_images",
|
|
@@ -1481,17 +2219,17 @@ var XPAGESPEED_KEYS = [
|
|
|
1481
2219
|
"lazyload_javascript"
|
|
1482
2220
|
];
|
|
1483
2221
|
var xPageSpeedUpdateSchema = {
|
|
1484
|
-
domain:
|
|
1485
|
-
xoptimize_images:
|
|
1486
|
-
lazyload_images:
|
|
1487
|
-
xoptimize_css:
|
|
1488
|
-
lazyload_css:
|
|
1489
|
-
xoptimize_javascript:
|
|
1490
|
-
lazyload_javascript:
|
|
2222
|
+
domain: z26.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2223
|
+
xoptimize_images: z26.boolean().optional().describe("\u753B\u50CF\u6700\u9069\u5316\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2224
|
+
lazyload_images: z26.boolean().optional().describe("\u753B\u50CF\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2225
|
+
xoptimize_css: z26.boolean().optional().describe("CSS\u6700\u9069\u5316\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2226
|
+
lazyload_css: z26.boolean().optional().describe("CSS\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2227
|
+
xoptimize_javascript: z26.boolean().optional().describe("JavaScript\u6700\u9069\u5316\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2228
|
+
lazyload_javascript: z26.boolean().optional().describe("JavaScript\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\u306E\u6709\u52B9/\u7121\u52B9")
|
|
1491
2229
|
};
|
|
1492
2230
|
function buildUpdateBody2(args) {
|
|
1493
|
-
const { domain, ...fields } = args;
|
|
1494
|
-
if (typeof
|
|
2231
|
+
const { domain: domain2, ...fields } = args;
|
|
2232
|
+
if (typeof domain2 !== "string" || domain2 === "") {
|
|
1495
2233
|
throw new Error("domain \u306F\u5FC5\u9808\u3067\u3059");
|
|
1496
2234
|
}
|
|
1497
2235
|
const data = {};
|
|
@@ -1509,7 +2247,7 @@ function buildUpdateBody2(args) {
|
|
|
1509
2247
|
}
|
|
1510
2248
|
function registerXPageSpeedTools(server, client, brand) {
|
|
1511
2249
|
server.tool(serverToolName(brand, "list", "xpagespeed"), "XPageSpeed\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1512
|
-
domain:
|
|
2250
|
+
domain: z26.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1513
2251
|
}, async (args) => {
|
|
1514
2252
|
const params = {};
|
|
1515
2253
|
if (args.domain)
|
|
@@ -1517,29 +2255,29 @@ function registerXPageSpeedTools(server, client, brand) {
|
|
|
1517
2255
|
return callApi(() => client.listXPageSpeed(params));
|
|
1518
2256
|
});
|
|
1519
2257
|
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) => {
|
|
1520
|
-
const { domain, ...fields } = args;
|
|
1521
|
-
const data = buildUpdateBody2({ domain, ...fields });
|
|
1522
|
-
return callApi(() => client.updateXPageSpeed(
|
|
2258
|
+
const { domain: domain2, ...fields } = args;
|
|
2259
|
+
const data = buildUpdateBody2({ domain: domain2, ...fields });
|
|
2260
|
+
return callApi(() => client.updateXPageSpeed(domain2, data));
|
|
1523
2261
|
});
|
|
1524
2262
|
}
|
|
1525
2263
|
|
|
1526
2264
|
// ../core/dist/tools/server/auto-backup.js
|
|
1527
|
-
import { z as
|
|
1528
|
-
var domainElementSchema =
|
|
1529
|
-
domain:
|
|
1530
|
-
elements:
|
|
2265
|
+
import { z as z27 } from "zod";
|
|
2266
|
+
var domainElementSchema = z27.object({
|
|
2267
|
+
domain: z27.string().describe("\u5951\u7D04\u30C9\u30E1\u30A4\u30F3"),
|
|
2268
|
+
elements: z27.array(z27.enum(["web", "setting", "mail"])).min(1).describe("\u5BFE\u8C61\u7A2E\u5225\uFF08web / setting / mail\uFF09")
|
|
1531
2269
|
});
|
|
1532
2270
|
function registerAutoBackupTools(server, client, brand) {
|
|
1533
2271
|
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()));
|
|
1534
2272
|
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()));
|
|
1535
2273
|
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", {
|
|
1536
|
-
request_id:
|
|
2274
|
+
request_id: z27.string().describe("\u7533\u8FBCID\uFF08\u6B63\u306E\u6574\u6570\uFF09")
|
|
1537
2275
|
}, async ({ request_id }) => callApi(() => client.getAutoBackup(request_id)));
|
|
1538
2276
|
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", {
|
|
1539
|
-
backup_date:
|
|
1540
|
-
operation_type:
|
|
1541
|
-
scope:
|
|
1542
|
-
domain_elements:
|
|
2277
|
+
backup_date: z27.string().describe("\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09"),
|
|
2278
|
+
operation_type: z27.enum(["fetch", "restore"]).describe("\u51E6\u7406\u7A2E\u5225\uFF08fetch: \u30C7\u30FC\u30BF\u53D6\u5F97 / restore: \u5FA9\u5143\uFF09"),
|
|
2279
|
+
scope: z27.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"),
|
|
2280
|
+
domain_elements: z27.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")
|
|
1543
2281
|
}, async (args) => {
|
|
1544
2282
|
const data = {
|
|
1545
2283
|
backup_date: args.backup_date,
|
|
@@ -1554,85 +2292,808 @@ function registerAutoBackupTools(server, client, brand) {
|
|
|
1554
2292
|
}
|
|
1555
2293
|
|
|
1556
2294
|
// ../core/dist/tools/server/mysql-backup.js
|
|
1557
|
-
import { z as
|
|
2295
|
+
import { z as z28 } from "zod";
|
|
1558
2296
|
function registerMysqlBackupTools(server, client, brand) {
|
|
1559
2297
|
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()));
|
|
1560
2298
|
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()));
|
|
1561
2299
|
server.tool(serverToolName(brand, "get", "mysql_backup"), "MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
1562
|
-
request_id:
|
|
2300
|
+
request_id: z28.string().describe("\u7533\u8FBC\u8B58\u5225\u5B50\uFF0832\u6587\u5B57\u306E\u5C0F\u6587\u5B5716\u9032\u6570\uFF09")
|
|
1563
2301
|
}, async ({ request_id }) => callApi(() => client.getMysqlBackup(request_id)));
|
|
1564
2302
|
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", {
|
|
1565
|
-
db_name:
|
|
1566
|
-
backup_date:
|
|
1567
|
-
operation_type:
|
|
2303
|
+
db_name: z28.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D"),
|
|
2304
|
+
backup_date: z28.string().describe("\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09"),
|
|
2305
|
+
operation_type: z28.enum(["fetch", "restore"]).describe("\u51E6\u7406\u7A2E\u5225\uFF08fetch: \u30C7\u30FC\u30BF\u53D6\u5F97 / restore: \u5FA9\u5143\uFF09")
|
|
1568
2306
|
}, async (args) => callApi(() => client.createMysqlBackup(args)));
|
|
1569
2307
|
}
|
|
1570
2308
|
|
|
2309
|
+
// ../core/dist/tools/domain/index.js
|
|
2310
|
+
import { z as z29 } from "zod";
|
|
2311
|
+
var domainName = z29.string().min(1).max(255).describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u540D\uFF08\u56FD\u969B\u5316\u30C9\u30E1\u30A4\u30F3\u306FPunycode\uFF09");
|
|
2312
|
+
var dnsId = z29.string().regex(/^[1-9]\d*$/).describe("DNS\u30EC\u30B3\u30FC\u30C9ID\uFF08dns_id\u3001\u6B63\u306E\u6574\u6570\uFF09");
|
|
2313
|
+
var dnsType = z29.enum(["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV"]).describe("DNS\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7");
|
|
2314
|
+
var ttl = z29.number().int().min(60).max(86400).describe("TTL\uFF0860\uFF5E86400\u79D2\uFF09");
|
|
2315
|
+
var priority = z29.number().int().min(0).max(999).describe("\u512A\u5148\u5EA6\uFF080\uFF5E999\uFF09");
|
|
2316
|
+
var expectedTotalPrice2 = z29.number().int().nonnegative().describe("preview\u3068\u4E00\u81F4\u3059\u308B\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D");
|
|
2317
|
+
var idempotencyKey2 = z29.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");
|
|
2318
|
+
var years = z29.number().int().min(1).max(5).describe("\u5951\u7D04\u5E74\u6570\uFF081\uFF5E5\u5E74\uFF09");
|
|
2319
|
+
var currentExpiryDate = z29.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");
|
|
2320
|
+
var nameserverHostname = (maximumLength) => z29.string().min(1).max(maximumLength).regex(/^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$/);
|
|
2321
|
+
var nameservers = (minimum, maximum, maximumLength) => z29.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");
|
|
2322
|
+
var whoisFields = z29.object({
|
|
2323
|
+
organization_name: z29.string().optional(),
|
|
2324
|
+
first_name: z29.string().optional(),
|
|
2325
|
+
last_name: z29.string().optional(),
|
|
2326
|
+
postal_code: z29.string().optional(),
|
|
2327
|
+
state_province: z29.string().optional(),
|
|
2328
|
+
city: z29.string().optional(),
|
|
2329
|
+
address1: z29.string().optional(),
|
|
2330
|
+
address2: z29.string().optional(),
|
|
2331
|
+
email: z29.string().email().optional(),
|
|
2332
|
+
phone: z29.string().optional(),
|
|
2333
|
+
fax: z29.string().optional(),
|
|
2334
|
+
country: z29.string().optional(),
|
|
2335
|
+
role: z29.string().optional()
|
|
2336
|
+
}).strict().describe("Whois\u767B\u9332\u8005\u60C5\u5831\u3002\u4EE3\u7406\u516C\u958BOFF\u6642\u306F\u516813\u30AD\u30FC\u304C\u5FC5\u8981");
|
|
2337
|
+
var registrationInput = {
|
|
2338
|
+
domain: domainName,
|
|
2339
|
+
years: years.optional().default(1),
|
|
2340
|
+
expected_total_price: expectedTotalPrice2,
|
|
2341
|
+
agree_to_terms: z29.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"),
|
|
2342
|
+
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")
|
|
2343
|
+
};
|
|
2344
|
+
var transferInput = {
|
|
2345
|
+
domain: domainName,
|
|
2346
|
+
auth_code: z29.string().min(1).max(255).describe("\u79FB\u7BA1\u5143\u3067\u53D6\u5F97\u3057\u305FAuthCode"),
|
|
2347
|
+
expected_total_price: expectedTotalPrice2,
|
|
2348
|
+
agree_to_terms: z29.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")
|
|
2349
|
+
};
|
|
2350
|
+
var renewInput = {
|
|
2351
|
+
domain: domainName,
|
|
2352
|
+
years,
|
|
2353
|
+
current_expiry_date: currentExpiryDate,
|
|
2354
|
+
expected_total_price: expectedTotalPrice2
|
|
2355
|
+
};
|
|
2356
|
+
function description2(text) {
|
|
2357
|
+
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`;
|
|
2358
|
+
}
|
|
2359
|
+
function registerDomainServiceTools(server, client, brand, options = {}) {
|
|
2360
|
+
server.tool(domainToolName(brand, "get", "api_key_info"), description2("API\u30AD\u30FC\u60C5\u5831\u3068Domain\u30B5\u30FC\u30D3\u30B9\u306E\u6A29\u9650\u30FB\u5BFE\u8C61\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.getMe()));
|
|
2361
|
+
server.tool(domainToolName(brand, "list", "domains"), description2("\u4FDD\u6709\u30C9\u30E1\u30A4\u30F3\u306E\u4E00\u89A7\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.listDomains()));
|
|
2362
|
+
server.tool(domainToolName(brand, "get", "domain"), description2("\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)));
|
|
2363
|
+
server.tool(domainToolName(brand, "get", "nameservers"), description2("\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\u8A2D\u5B9A\u3092\u53D6\u5F97"), { domain: domainName }, async ({ domain: domain2 }) => callApi(() => client.getDomainNameservers(domain2)));
|
|
2364
|
+
server.tool(domainToolName(brand, "update", "nameservers"), description2("\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\u30921\uFF5E13\u4EF6\u3067\u5168\u7F6E\u63DB"), {
|
|
2365
|
+
domain: domainName,
|
|
2366
|
+
nameservers: nameservers(1, 13, 253).describe("\u7F6E\u63DB\u5F8C\u306E\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\uFF081\uFF5E13\u4EF6\uFF09")
|
|
2367
|
+
}, async ({ domain: domain2, nameservers: nameservers2 }) => callApi(() => client.updateDomainNameservers(domain2, { nameservers: nameservers2 })));
|
|
2368
|
+
server.tool(domainToolName(brand, "list", "dns"), description2("\u30EC\u30B8\u30B9\u30C8\u30E9\u5074DNS\u30EC\u30B3\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97"), { domain: domainName }, async ({ domain: domain2 }) => callApi(() => client.listDomainDns(domain2)));
|
|
2369
|
+
server.tool(domainToolName(brand, "add", "dns"), description2("\u30EC\u30B8\u30B9\u30C8\u30E9\u5074DNS\u30EC\u30B3\u30FC\u30C9\u3092\u8FFD\u52A0"), {
|
|
2370
|
+
domain: domainName,
|
|
2371
|
+
type: dnsType,
|
|
2372
|
+
host: z29.string().max(64).describe("\u30DB\u30B9\u30C8\u540D\uFF08apex\u306F@\uFF09"),
|
|
2373
|
+
content: z29.string().max(1024).describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
2374
|
+
ttl: ttl.optional().default(3600),
|
|
2375
|
+
priority: priority.optional()
|
|
2376
|
+
}, async ({ domain: domain2, ...data }) => callApi(() => client.addDomainDns(domain2, data)));
|
|
2377
|
+
server.tool(domainToolName(brand, "update", "dns"), description2("\u6307\u5B9A\u3057\u305F\u30EC\u30B8\u30B9\u30C8\u30E9\u5074DNS\u30EC\u30B3\u30FC\u30C9\u3092\u90E8\u5206\u66F4\u65B0"), {
|
|
2378
|
+
domain: domainName,
|
|
2379
|
+
dns_id: dnsId,
|
|
2380
|
+
type: dnsType.optional(),
|
|
2381
|
+
host: z29.string().max(64).optional().describe("\u30DB\u30B9\u30C8\u540D\uFF08apex\u306F@\uFF09"),
|
|
2382
|
+
content: z29.string().max(1024).optional().describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
2383
|
+
ttl: ttl.optional(),
|
|
2384
|
+
priority: priority.optional()
|
|
2385
|
+
}, async ({ domain: domain2, dns_id, ...data }) => callApi(async () => {
|
|
2386
|
+
if (Object.keys(data).length === 0) {
|
|
2387
|
+
throw new Error("DNS\u66F4\u65B0\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
2388
|
+
}
|
|
2389
|
+
return client.updateDomainDns(domain2, dns_id, data);
|
|
2390
|
+
}));
|
|
2391
|
+
server.tool(domainToolName(brand, "delete", "dns"), description2("\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"), {
|
|
2392
|
+
domain: domainName,
|
|
2393
|
+
dns_id: dnsId,
|
|
2394
|
+
confirmed: z29.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")
|
|
2395
|
+
}, async ({ domain: domain2, dns_id, confirmed: confirmed2 }) => callApi(async () => {
|
|
2396
|
+
if (!confirmed2)
|
|
2397
|
+
throw new Error("confirmed=true is required.");
|
|
2398
|
+
return client.deleteDomainDns(domain2, dns_id);
|
|
2399
|
+
}));
|
|
2400
|
+
server.tool(domainToolName(brand, "get", "whois"), description2("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)));
|
|
2401
|
+
server.tool(domainToolName(brand, "update", "whois"), description2("Whois\u767B\u9332\u8005\u60C5\u5831\u307E\u305F\u306F\u4EE3\u7406\u516C\u958B\u8A2D\u5B9A\u3092\u66F4\u65B0"), {
|
|
2402
|
+
domain: domainName,
|
|
2403
|
+
whois_privacy: z29.boolean().optional().describe("Whois\u4EE3\u7406\u516C\u958B\u3092\u6709\u52B9\u306B\u3059\u308B\u304B"),
|
|
2404
|
+
fields: whoisFields.optional()
|
|
2405
|
+
}, async ({ domain: domain2, whois_privacy, fields }) => callApi(async () => {
|
|
2406
|
+
if (whois_privacy === void 0 && fields === void 0) {
|
|
2407
|
+
throw new Error("whois_privacy \u307E\u305F\u306F fields \u306E\u3044\u305A\u308C\u304B\u304C\u5FC5\u8981\u3067\u3059\u3002");
|
|
2408
|
+
}
|
|
2409
|
+
const data = {};
|
|
2410
|
+
if (whois_privacy !== void 0)
|
|
2411
|
+
data.whois_privacy = whois_privacy;
|
|
2412
|
+
if (fields !== void 0)
|
|
2413
|
+
data.fields = fields;
|
|
2414
|
+
return client.updateDomainWhois(domain2, data);
|
|
2415
|
+
}));
|
|
2416
|
+
server.tool(domainToolName(brand, "get", "registrar_lock"), description2("\u30EC\u30B8\u30B9\u30C8\u30E9\u30ED\u30C3\u30AF\u72B6\u614B\u3092\u53D6\u5F97"), { domain: domainName }, async ({ domain: domain2 }) => callApi(() => client.getDomainRegistrarLock(domain2)));
|
|
2417
|
+
server.tool(domainToolName(brand, "update", "registrar_lock"), description2("\u30EC\u30B8\u30B9\u30C8\u30E9\u30ED\u30C3\u30AF\u3092\u8A2D\u5B9A\u307E\u305F\u306F\u89E3\u9664"), {
|
|
2418
|
+
domain: domainName,
|
|
2419
|
+
locked: z29.boolean().describe("true\u3067\u30ED\u30C3\u30AF\u3001false\u3067\u89E3\u9664")
|
|
2420
|
+
}, async ({ domain: domain2, locked }) => callApi(() => client.updateDomainRegistrarLock(domain2, { locked })));
|
|
2421
|
+
server.tool(domainToolName(brand, "check", "domain"), description2("\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))));
|
|
2422
|
+
server.tool(domainToolName(brand, "get", "pricing"), description2("TLD\u5225\u306E\u7A0E\u8FBC\u4FA1\u683C\u4E00\u89A7\u3092\u53D6\u5F97"), {
|
|
2423
|
+
tld: z29.string().optional().describe("\u7D5E\u308A\u8FBC\u3080TLD\u3002\u8907\u6570\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF08\u4F8B: com,net,jp\uFF09")
|
|
2424
|
+
}, async ({ tld }) => callApi(() => withDomainAcquisitionPermissionDiagnosis(client, () => client.getDomainPricing(tld ? { tld } : void 0))));
|
|
2425
|
+
server.tool(domainToolName(brand, "preview", "registration"), description2("\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({
|
|
2426
|
+
domain_name: domain2,
|
|
2427
|
+
years: years2,
|
|
2428
|
+
expected_total_price,
|
|
2429
|
+
agree_to_terms: true,
|
|
2430
|
+
dry_run: true,
|
|
2431
|
+
...nameservers2 ? { nameservers: nameservers2 } : {}
|
|
2432
|
+
}))));
|
|
2433
|
+
if (options.enableHighRiskExecute) {
|
|
2434
|
+
server.tool(domainToolName(brand, "execute", "registration"), description2("\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"), {
|
|
2435
|
+
...registrationInput,
|
|
2436
|
+
idempotency_key: idempotencyKey2
|
|
2437
|
+
}, billingExecuteAnnotations, async ({ domain: domain2, years: years2, expected_total_price, nameservers: nameservers2, idempotency_key }) => callApi(async () => {
|
|
2438
|
+
const data = {
|
|
2439
|
+
domain_name: domain2,
|
|
2440
|
+
years: years2,
|
|
2441
|
+
expected_total_price,
|
|
2442
|
+
agree_to_terms: true,
|
|
2443
|
+
...nameservers2 ? { nameservers: nameservers2 } : {}
|
|
2444
|
+
};
|
|
2445
|
+
const preview = await withDomainAcquisitionPermissionDiagnosis(client, () => client.registerDomain({ ...data, dry_run: true }));
|
|
2446
|
+
const totalPrice = Number(preview.total_price);
|
|
2447
|
+
if (!Number.isFinite(totalPrice)) {
|
|
2448
|
+
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");
|
|
2449
|
+
}
|
|
2450
|
+
if (totalPrice !== expected_total_price) {
|
|
2451
|
+
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`);
|
|
2452
|
+
}
|
|
2453
|
+
await confirmBillingOperation(server, {
|
|
2454
|
+
operation: "\u30C9\u30E1\u30A4\u30F3\u65B0\u898F\u53D6\u5F97",
|
|
2455
|
+
domain: domain2,
|
|
2456
|
+
totalPrice,
|
|
2457
|
+
brand,
|
|
2458
|
+
years: years2,
|
|
2459
|
+
requireTermsAgreement: true
|
|
2460
|
+
});
|
|
2461
|
+
return withDomainAcquisitionPermissionDiagnosis(client, () => client.registerDomain(data, idempotency_key));
|
|
2462
|
+
}));
|
|
2463
|
+
}
|
|
2464
|
+
server.tool(domainToolName(brand, "preview", "transfer"), description2("\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, {
|
|
2465
|
+
auth_code,
|
|
2466
|
+
expected_total_price,
|
|
2467
|
+
agree_to_terms: true,
|
|
2468
|
+
dry_run: true
|
|
2469
|
+
}))));
|
|
2470
|
+
if (options.enableHighRiskExecute) {
|
|
2471
|
+
server.tool(domainToolName(brand, "execute", "transfer"), description2("\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"), {
|
|
2472
|
+
...transferInput,
|
|
2473
|
+
idempotency_key: idempotencyKey2
|
|
2474
|
+
}, billingExecuteAnnotations, async ({ domain: domain2, auth_code, expected_total_price, idempotency_key }) => callApi(async () => {
|
|
2475
|
+
const data = { auth_code, expected_total_price, agree_to_terms: true };
|
|
2476
|
+
const preview = await withDomainAcquisitionPermissionDiagnosis(client, () => client.transferDomain(domain2, { ...data, dry_run: true }));
|
|
2477
|
+
const totalPrice = Number(preview.total_price);
|
|
2478
|
+
if (!Number.isFinite(totalPrice)) {
|
|
2479
|
+
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");
|
|
2480
|
+
}
|
|
2481
|
+
if (totalPrice !== expected_total_price) {
|
|
2482
|
+
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`);
|
|
2483
|
+
}
|
|
2484
|
+
await confirmBillingOperation(server, {
|
|
2485
|
+
operation: "\u30C9\u30E1\u30A4\u30F3\u79FB\u7BA1",
|
|
2486
|
+
domain: domain2,
|
|
2487
|
+
totalPrice,
|
|
2488
|
+
brand,
|
|
2489
|
+
requireTermsAgreement: true
|
|
2490
|
+
});
|
|
2491
|
+
return withDomainAcquisitionPermissionDiagnosis(client, () => client.transferDomain(domain2, data, idempotency_key));
|
|
2492
|
+
}));
|
|
2493
|
+
}
|
|
2494
|
+
server.tool(domainToolName(brand, "preview", "renew"), description2("\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, {
|
|
2495
|
+
years: years2,
|
|
2496
|
+
current_expiry_date,
|
|
2497
|
+
expected_total_price,
|
|
2498
|
+
dry_run: true
|
|
2499
|
+
}))));
|
|
2500
|
+
if (options.enableHighRiskExecute) {
|
|
2501
|
+
server.tool(domainToolName(brand, "execute", "renew"), description2("\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"), {
|
|
2502
|
+
...renewInput,
|
|
2503
|
+
idempotency_key: idempotencyKey2
|
|
2504
|
+
}, billingExecuteAnnotations, async ({ domain: domain2, years: years2, current_expiry_date, expected_total_price, idempotency_key }) => callApi(async () => {
|
|
2505
|
+
const data = { years: years2, current_expiry_date, expected_total_price };
|
|
2506
|
+
const preview = await withDomainAcquisitionPermissionDiagnosis(client, () => client.renewDomain(domain2, { ...data, dry_run: true }));
|
|
2507
|
+
const totalPrice = Number(preview.total_price);
|
|
2508
|
+
if (!Number.isFinite(totalPrice)) {
|
|
2509
|
+
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");
|
|
2510
|
+
}
|
|
2511
|
+
if (totalPrice !== expected_total_price) {
|
|
2512
|
+
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`);
|
|
2513
|
+
}
|
|
2514
|
+
await confirmBillingOperation(server, {
|
|
2515
|
+
operation: "\u30C9\u30E1\u30A4\u30F3\u5951\u7D04\u66F4\u65B0",
|
|
2516
|
+
domain: domain2,
|
|
2517
|
+
totalPrice,
|
|
2518
|
+
brand,
|
|
2519
|
+
years: years2
|
|
2520
|
+
});
|
|
2521
|
+
return withDomainAcquisitionPermissionDiagnosis(client, () => client.renewDomain(domain2, data, idempotency_key));
|
|
2522
|
+
}));
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
// ../core/dist/tools/wphosting/index.js
|
|
2527
|
+
import { z as z30 } from "zod";
|
|
2528
|
+
var contractId = z30.string().regex(/^WP-[A-Za-z0-9]+$/).max(64).describe("XServer for WordPress\u306E\u5951\u7D04ID\uFF08contract_id\uFF09");
|
|
2529
|
+
var servername2 = z30.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");
|
|
2530
|
+
var domain = z30.string().min(1).max(255).describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u540D");
|
|
2531
|
+
var positiveId = (label) => z30.string().regex(/^[1-9]\d*$/).describe(label);
|
|
2532
|
+
var opaqueId = (label) => z30.string().regex(/^[A-Za-z0-9_-]+$/).max(255).describe(label);
|
|
2533
|
+
var slug = (label) => z30.string().min(1).max(255).describe(label);
|
|
2534
|
+
var idempotencyKey3 = z30.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");
|
|
2535
|
+
var signupInput2 = {
|
|
2536
|
+
plan_id: z30.string().min(1).max(64).describe("\u30D7\u30E9\u30F3ID"),
|
|
2537
|
+
period: z30.number().int().min(1).max(60).describe("\u5951\u7D04\u671F\u9593\uFF08\u6708\u6570\u3002\u30D7\u30E9\u30F3\u53D6\u5F97\u30C4\u30FC\u30EB\u304C\u8FD4\u3057\u305F months \u304B\u3089\u6307\u5B9A\uFF09"),
|
|
2538
|
+
expected_total_price: z30.number().int().nonnegative().describe("preview\u3068\u4E00\u81F4\u3059\u308B\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D"),
|
|
2539
|
+
agree_to_terms: z30.literal(true).describe("WPhosting\u5951\u7D04\u306E\u5229\u7528\u898F\u7D04\u3078\u306E\u660E\u793A\u540C\u610F"),
|
|
2540
|
+
partner_code: z30.string().regex(/^[A-Za-z0-9]{1,50}$/).optional().describe("\u30D1\u30FC\u30C8\u30CA\u30FC\u30B3\u30FC\u30C9"),
|
|
2541
|
+
auto_renew: z30.enum(["enabled", "disabled"]).describe("\u81EA\u52D5\u66F4\u65B0\uFF08enabled: \u6709\u52B9 / disabled: \u7121\u52B9\u3001\u660E\u793A\u6307\u5B9A\u5FC5\u9808\uFF09")
|
|
2542
|
+
};
|
|
2543
|
+
var confirmed = z30.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");
|
|
2544
|
+
var dnsType2 = z30.enum(["A", "AAAA", "CNAME", "MX", "TXT", "SRV"]);
|
|
2545
|
+
var dnsTtl = z30.number().int().min(60).max(86400);
|
|
2546
|
+
var dnsPriority = z30.number().int().min(0).max(65535);
|
|
2547
|
+
var site = { contract_id: contractId, servername: servername2 };
|
|
2548
|
+
var cronFields = {
|
|
2549
|
+
minute: z30.string().min(1).max(64),
|
|
2550
|
+
hour: z30.string().min(1).max(64),
|
|
2551
|
+
day: z30.string().min(1).max(64),
|
|
2552
|
+
month: z30.string().min(1).max(64),
|
|
2553
|
+
weekday: z30.string().min(1).max(64),
|
|
2554
|
+
command: z30.string().min(1).max(5e3),
|
|
2555
|
+
comment: z30.string().max(255).optional()
|
|
2556
|
+
};
|
|
2557
|
+
var wpUserOptionalFields = {
|
|
2558
|
+
user_email: z30.string().email().max(100).optional(),
|
|
2559
|
+
user_pass: z30.string().min(7).max(64).optional(),
|
|
2560
|
+
role: z30.string().min(1).max(64).optional(),
|
|
2561
|
+
display_name: z30.string().max(255).optional(),
|
|
2562
|
+
first_name: z30.string().max(255).optional(),
|
|
2563
|
+
last_name: z30.string().max(255).optional(),
|
|
2564
|
+
user_url: z30.string().url().max(255).optional()
|
|
2565
|
+
};
|
|
2566
|
+
function description3(text) {
|
|
2567
|
+
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`;
|
|
2568
|
+
}
|
|
2569
|
+
function body(args, excluded) {
|
|
2570
|
+
return Object.fromEntries(Object.entries(args).filter(([key]) => !excluded.includes(key)));
|
|
2571
|
+
}
|
|
2572
|
+
function requireUpdate(data, message = "\u66F4\u65B0\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002") {
|
|
2573
|
+
if (Object.keys(data).length === 0)
|
|
2574
|
+
throw new Error(message);
|
|
2575
|
+
}
|
|
2576
|
+
function registerWphostingTools(server, client, brand, options = {}) {
|
|
2577
|
+
if (brand.brand !== "xserver") {
|
|
2578
|
+
throw new Error(`--services=wphosting is not supported for brand "${brand.brand}"; use XServer.`);
|
|
2579
|
+
}
|
|
2580
|
+
const tools = server;
|
|
2581
|
+
const invoke = (method, args = []) => {
|
|
2582
|
+
const fn = client[method];
|
|
2583
|
+
if (typeof fn !== "function")
|
|
2584
|
+
throw new Error(`ApiClient.${method} is not available.`);
|
|
2585
|
+
return fn.apply(client, args);
|
|
2586
|
+
};
|
|
2587
|
+
const register = (verb, resource, text, schema, method, toArgs) => tools.tool(wphostingToolName(brand, verb, resource), description3(text), schema, async (args) => callApi(() => invoke(method, toArgs(args))));
|
|
2588
|
+
server.tool(wphostingToolName(brand, "list", "plans"), description3("\u7533\u8FBC\u53EF\u80FD\u306AWPhosting\u30D7\u30E9\u30F3\u3092\u53D6\u5F97"), {
|
|
2589
|
+
plan_id: z30.string().min(1).max(64).optional().describe("\u7D5E\u308A\u8FBC\u3080\u30D7\u30E9\u30F3ID")
|
|
2590
|
+
}, async ({ plan_id }) => callApi(() => client.listWphostingPlans(plan_id ? { plan_id } : void 0)));
|
|
2591
|
+
server.tool(wphostingToolName(brand, "list", "contracts"), description3("WPhosting\u5951\u7D04\u4E00\u89A7\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.listWphostingContracts()));
|
|
2592
|
+
server.tool(wphostingToolName(brand, "get", "memo"), description3("WPhosting\u5951\u7D04\u30E1\u30E2\u3092\u53D6\u5F97"), { contract_id: contractId }, async ({ contract_id }) => callApi(() => client.getWphostingMemo(contract_id)));
|
|
2593
|
+
server.tool(wphostingToolName(brand, "update", "memo"), description3("WPhosting\u5951\u7D04\u30E1\u30E2\u3092\u66F4\u65B0"), {
|
|
2594
|
+
contract_id: contractId,
|
|
2595
|
+
memo: z30.string().max(500).describe("\u5951\u7D04\u30E1\u30E2\uFF08\u7A7A\u6587\u5B57\u53EF\u3001500\u6587\u5B57\u4EE5\u5185\uFF09")
|
|
2596
|
+
}, async ({ contract_id, memo: memo2 }) => callApi(() => client.updateWphostingMemo(contract_id, { memo: memo2 })));
|
|
2597
|
+
server.tool(wphostingToolName(brand, "preview", "signup"), description3("\u8AB2\u91D1\u3055\u308C\u308BWPhosting\u65B0\u898F\u5951\u7D04\u3092dry-run\u3057\u3001\u5B9F\u7533\u8ACB\u524D\u306E\u91D1\u984D\u3092\u78BA\u8A8D\u3002\u7D50\u679C\u306E legal_notices \u3092\u30C1\u30E3\u30C3\u30C8\u4E0A\u306E\u30AF\u30EA\u30C3\u30AF\u53EF\u80FD\u306AMarkdown\u30EA\u30F3\u30AF\u3068\u3057\u3066\u5229\u7528\u8005\u3078\u63D0\u793A\u3057\u3066\u304B\u3089execute\u3092\u6848\u5185\u3057\u3066\u304F\u3060\u3055\u3044"), signupInput2, billingPreviewAnnotations, async ({ agree_to_terms: _agreeToTerms, auto_renew, ...input }) => callApi(async () => billingPreviewResult(await client.registerWphosting({
|
|
2598
|
+
...input,
|
|
2599
|
+
auto_renew: auto_renew === "enabled",
|
|
2600
|
+
agree_to_terms: true,
|
|
2601
|
+
dry_run: true
|
|
2602
|
+
}), signupLegalNoticeLines(brand, "wphosting"))));
|
|
2603
|
+
if (options.enableHighRiskExecute) {
|
|
2604
|
+
server.tool(wphostingToolName(brand, "execute", "signup"), description3("\u660E\u793A\u627F\u8A8D\u5F8C\u306BWPhosting\u65B0\u898F\u5951\u7D04\u3092\u5B9F\u7533\u8ACB\uFF08\u8AB2\u91D1\u3055\u308C\u539F\u5247\u53D6\u308A\u6D88\u3057\u4E0D\u53EF\uFF09\u3002\u4E8B\u524D\u306Bpreview\u306E legal_notices \u3092\u30C1\u30E3\u30C3\u30C8\u4E0A\u3078\u63D0\u793A\u3057\u3001\u5229\u7528\u8005\u304CURL\u3092\u78BA\u8A8D\u3067\u304D\u308B\u72B6\u614B\u306B\u3057\u3066\u304F\u3060\u3055\u3044"), { ...signupInput2, idempotency_key: idempotencyKey3 }, billingExecuteAnnotations, async ({ agree_to_terms: _agreeToTerms, idempotency_key, ...input }) => callApi(async () => {
|
|
2605
|
+
const data = {
|
|
2606
|
+
...input,
|
|
2607
|
+
auto_renew: input.auto_renew === "enabled",
|
|
2608
|
+
agree_to_terms: true
|
|
2609
|
+
};
|
|
2610
|
+
const preview = await client.registerWphosting({
|
|
2611
|
+
...data,
|
|
2612
|
+
dry_run: true
|
|
2613
|
+
});
|
|
2614
|
+
const totalPrice = Number(preview.total_price);
|
|
2615
|
+
if (!Number.isFinite(totalPrice)) {
|
|
2616
|
+
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");
|
|
2617
|
+
}
|
|
2618
|
+
if (totalPrice !== input.expected_total_price) {
|
|
2619
|
+
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 ${input.expected_total_price}\u5186\uFF09\u3002`);
|
|
2620
|
+
}
|
|
2621
|
+
assertBillingFormElicitationSupported(server);
|
|
2622
|
+
const planName = await resolvePlanName(() => client.listWphostingPlans({ plan_id: input.plan_id }), input.plan_id);
|
|
2623
|
+
await confirmBillingOperation(server, {
|
|
2624
|
+
operation: signupOperationName(brand, "wphosting"),
|
|
2625
|
+
target: `${planLabel(input.plan_id, planName)} / \u5951\u7D04\u671F\u9593 ${input.period}\u304B\u6708`,
|
|
2626
|
+
targetLabel: "\u7533\u8FBC\u5185\u5BB9",
|
|
2627
|
+
details: compactDetails([
|
|
2628
|
+
autoRenewDetail(input.auto_renew === "enabled"),
|
|
2629
|
+
partnerCodeDetail(input.partner_code)
|
|
2630
|
+
]),
|
|
2631
|
+
legalNoticeLines: signupLegalNoticeLines(brand, "wphosting"),
|
|
2632
|
+
totalPrice,
|
|
2633
|
+
requireTermsAgreement: true
|
|
2634
|
+
});
|
|
2635
|
+
return client.registerWphosting({ ...data, dry_run: false }, idempotency_key);
|
|
2636
|
+
}));
|
|
2637
|
+
}
|
|
2638
|
+
register("get", "api_key_info", "API\u30AD\u30FC\u60C5\u5831\u3068WPhosting\u6A29\u9650\u30FB\u5BFE\u8C61\u5951\u7D04\u3092\u53D6\u5F97", {}, "getMe", () => []);
|
|
2639
|
+
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]);
|
|
2640
|
+
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]);
|
|
2641
|
+
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]);
|
|
2642
|
+
register("create", "site", "\u30B5\u30A4\u30C8\u4F5C\u6210\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: get_wphosting_site\u306Estatus\uFF09", {
|
|
2643
|
+
contract_id: contractId,
|
|
2644
|
+
wp_sitename: z30.string().min(1).max(255),
|
|
2645
|
+
wp_username: z30.string().min(1).max(255).regex(/^[0-9A-Za-z _\-.@]+$/),
|
|
2646
|
+
wp_password: z30.string().min(7).max(64).regex(/^[A-Za-z0-9!#$%=~^|:_\[\]().+\-*\/@&<>`;?,]+$/).refine((value) => /[A-Za-z]/.test(value) && /[^A-Za-z]/.test(value), {
|
|
2647
|
+
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"
|
|
2648
|
+
}),
|
|
2649
|
+
wp_mailaddress: z30.string().email().max(100),
|
|
2650
|
+
disk_limit_gb: z30.number().int().min(10),
|
|
2651
|
+
vcpu_limit: z30.number().int().positive(),
|
|
2652
|
+
memory_limit_gb: z30.number().int().positive(),
|
|
2653
|
+
wp_theme: z30.enum(["default", "cocoon-master", "lightning"]).optional(),
|
|
2654
|
+
server_id: z30.string().regex(/^[a-z][a-z0-9]{0,11}$/).optional(),
|
|
2655
|
+
security_auto_optimize: z30.boolean().optional(),
|
|
2656
|
+
memo: z30.string().max(255).optional(),
|
|
2657
|
+
idempotency_key: idempotencyKey3.optional()
|
|
2658
|
+
}, "createWphostingSite", (a) => {
|
|
2659
|
+
if (a.wp_password === a.wp_username) {
|
|
2660
|
+
throw new Error("wp_password\u306Fwp_username\u3068\u7570\u306A\u308B\u6587\u5B57\u5217\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
2661
|
+
}
|
|
2662
|
+
return [
|
|
2663
|
+
a.contract_id,
|
|
2664
|
+
body(a, ["contract_id", "idempotency_key"]),
|
|
2665
|
+
a.idempotency_key
|
|
2666
|
+
];
|
|
2667
|
+
});
|
|
2668
|
+
tools.tool(wphostingToolName(brand, "preview", "site_deletion"), description3("\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 () => ({
|
|
2669
|
+
target: await invoke("getWphostingSite", [a.contract_id, a.servername]),
|
|
2670
|
+
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",
|
|
2671
|
+
confirmation_tool: wphostingToolName(brand, "execute", "site_deletion"),
|
|
2672
|
+
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"
|
|
2673
|
+
})));
|
|
2674
|
+
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: idempotencyKey3.optional() }, "deleteWphostingSite", (a) => [a.contract_id, a.servername, a.idempotency_key]);
|
|
2675
|
+
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", {
|
|
2676
|
+
...site,
|
|
2677
|
+
disk_limit_gb: z30.number().int().min(10),
|
|
2678
|
+
vcpu_limit: z30.number().int().positive(),
|
|
2679
|
+
memory_limit_gb: z30.number().int().positive(),
|
|
2680
|
+
server_id: z30.string().min(1).max(12).optional(),
|
|
2681
|
+
security_auto_optimize: z30.boolean().optional(),
|
|
2682
|
+
idempotency_key: idempotencyKey3.optional()
|
|
2683
|
+
}, "createWphostingStaging", (a) => [
|
|
2684
|
+
a.contract_id,
|
|
2685
|
+
a.servername,
|
|
2686
|
+
body(a, ["contract_id", "servername", "idempotency_key"]),
|
|
2687
|
+
a.idempotency_key
|
|
2688
|
+
]);
|
|
2689
|
+
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]);
|
|
2690
|
+
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", {
|
|
2691
|
+
...site,
|
|
2692
|
+
memo: z30.string().max(255).optional(),
|
|
2693
|
+
idempotency_key: idempotencyKey3.optional()
|
|
2694
|
+
}, "createWphostingBackup", (a) => [
|
|
2695
|
+
a.contract_id,
|
|
2696
|
+
a.servername,
|
|
2697
|
+
body(a, ["contract_id", "servername", "idempotency_key"]),
|
|
2698
|
+
a.idempotency_key
|
|
2699
|
+
]);
|
|
2700
|
+
tools.tool(wphostingToolName(brand, "preview", "backup_restore"), description3("\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 () => ({
|
|
2701
|
+
backups: await invoke("listWphostingBackups", [
|
|
2702
|
+
a.contract_id,
|
|
2703
|
+
a.servername
|
|
2704
|
+
]),
|
|
2705
|
+
target_backup_id: a.backup_id,
|
|
2706
|
+
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",
|
|
2707
|
+
confirmation_tool: wphostingToolName(brand, "execute", "backup_restore"),
|
|
2708
|
+
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"
|
|
2709
|
+
})));
|
|
2710
|
+
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", {
|
|
2711
|
+
...site,
|
|
2712
|
+
backup_id: opaqueId("\u5FA9\u5143\u3059\u308B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7ID"),
|
|
2713
|
+
confirmed,
|
|
2714
|
+
idempotency_key: idempotencyKey3.optional()
|
|
2715
|
+
}, "restoreWphostingBackup", (a) => [a.contract_id, a.servername, a.backup_id, a.idempotency_key]);
|
|
2716
|
+
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]);
|
|
2717
|
+
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]);
|
|
2718
|
+
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]);
|
|
2719
|
+
register("update", "wordpress", "WordPress\u672C\u4F53\u306E\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u5909\u66F4", { ...site, auto_update_scope: z30.enum(["none", "minor", "all"]) }, "updateWphostingWordPress", (a) => [
|
|
2720
|
+
a.contract_id,
|
|
2721
|
+
a.servername,
|
|
2722
|
+
{ auto_update_scope: a.auto_update_scope }
|
|
2723
|
+
]);
|
|
2724
|
+
register("upgrade", "wordpress", "WordPress\u672C\u4F53\u3092\u540C\u671F\u66F4\u65B0", site, "upgradeWphostingWordPress", (a) => [a.contract_id, a.servername]);
|
|
2725
|
+
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]);
|
|
2726
|
+
register("update", "maintenance_mode", "\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9\u30E2\u30FC\u30C9\u3092\u5909\u66F4", { ...site, enabled: z30.boolean() }, "updateWphostingMaintenanceMode", (a) => [a.contract_id, a.servername, { enabled: a.enabled }]);
|
|
2727
|
+
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]);
|
|
2728
|
+
register("install", "plugin", "\u516C\u5F0F\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u30D7\u30E9\u30B0\u30A4\u30F3slug\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
2729
|
+
...site,
|
|
2730
|
+
plugin: slug("\u30D7\u30E9\u30B0\u30A4\u30F3slug"),
|
|
2731
|
+
activate: z30.boolean().optional()
|
|
2732
|
+
}, "installWphostingPlugin", (a) => [
|
|
2733
|
+
a.contract_id,
|
|
2734
|
+
a.servername,
|
|
2735
|
+
{
|
|
2736
|
+
plugin: a.plugin,
|
|
2737
|
+
...a.activate === void 0 ? {} : { activate: a.activate }
|
|
2738
|
+
}
|
|
2739
|
+
]);
|
|
2740
|
+
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", {
|
|
2741
|
+
...site,
|
|
2742
|
+
plugin: slug("\u30D7\u30E9\u30B0\u30A4\u30F3slug"),
|
|
2743
|
+
status: z30.enum(["active", "inactive"]).optional(),
|
|
2744
|
+
auto_update: z30.boolean().optional()
|
|
2745
|
+
}, "updateWphostingPlugin", (a) => {
|
|
2746
|
+
const data = body(a, ["contract_id", "servername", "plugin"]);
|
|
2747
|
+
requireUpdate(data);
|
|
2748
|
+
return [a.contract_id, a.servername, a.plugin, data];
|
|
2749
|
+
});
|
|
2750
|
+
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]);
|
|
2751
|
+
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]);
|
|
2752
|
+
register("list", "themes", "\u30C6\u30FC\u30DE\u4E00\u89A7\u3092\u53D6\u5F97", site, "listWphostingThemes", (a) => [a.contract_id, a.servername]);
|
|
2753
|
+
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: z30.boolean().optional() }, "installWphostingTheme", (a) => [
|
|
2754
|
+
a.contract_id,
|
|
2755
|
+
a.servername,
|
|
2756
|
+
{
|
|
2757
|
+
theme: a.theme,
|
|
2758
|
+
...a.activate === void 0 ? {} : { activate: a.activate }
|
|
2759
|
+
}
|
|
2760
|
+
]);
|
|
2761
|
+
register("update", "theme", "\u30C6\u30FC\u30DE\u306Eactive\u5207\u66FF\u307E\u305F\u306F\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2762
|
+
...site,
|
|
2763
|
+
theme: slug("\u30C6\u30FC\u30DEslug"),
|
|
2764
|
+
status: z30.literal("active").optional(),
|
|
2765
|
+
auto_update: z30.boolean().optional()
|
|
2766
|
+
}, "updateWphostingTheme", (a) => {
|
|
2767
|
+
const data = body(a, ["contract_id", "servername", "theme"]);
|
|
2768
|
+
requireUpdate(data);
|
|
2769
|
+
return [a.contract_id, a.servername, a.theme, data];
|
|
2770
|
+
});
|
|
2771
|
+
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]);
|
|
2772
|
+
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]);
|
|
2773
|
+
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]);
|
|
2774
|
+
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 }]);
|
|
2775
|
+
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]);
|
|
2776
|
+
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]);
|
|
2777
|
+
register("update", "site_url", "\u30B5\u30A4\u30C8\u306E\u30D7\u30E9\u30A4\u30DE\u30EA\u30C9\u30E1\u30A4\u30F3\u3092\u5909\u66F4", { ...site, domain, auto_redirect: z30.boolean().optional() }, "updateWphostingSiteUrl", (a) => [
|
|
2778
|
+
a.contract_id,
|
|
2779
|
+
a.servername,
|
|
2780
|
+
{
|
|
2781
|
+
domain: a.domain,
|
|
2782
|
+
...a.auto_redirect === void 0 ? {} : { auto_redirect: a.auto_redirect }
|
|
2783
|
+
}
|
|
2784
|
+
]);
|
|
2785
|
+
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]);
|
|
2786
|
+
register("add", "dns_record", "\u30B5\u30A4\u30C8\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u3078DNS\u30EC\u30B3\u30FC\u30C9\u3092\u8FFD\u52A0", {
|
|
2787
|
+
...site,
|
|
2788
|
+
domain,
|
|
2789
|
+
host: z30.string().max(255),
|
|
2790
|
+
type: dnsType2,
|
|
2791
|
+
content: z30.string().max(1024),
|
|
2792
|
+
ttl: dnsTtl.optional().default(3600),
|
|
2793
|
+
priority: dnsPriority.optional()
|
|
2794
|
+
}, "addWphostingDnsRecord", (a) => [
|
|
2795
|
+
a.contract_id,
|
|
2796
|
+
a.servername,
|
|
2797
|
+
a.domain,
|
|
2798
|
+
body(a, ["contract_id", "servername", "domain"])
|
|
2799
|
+
]);
|
|
2800
|
+
register("update", "dns_record", "\u30B5\u30A4\u30C8\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u306EDNS\u30EC\u30B3\u30FC\u30C9\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2801
|
+
...site,
|
|
2802
|
+
domain,
|
|
2803
|
+
dns_id: positiveId("DNS\u30EC\u30B3\u30FC\u30C9ID"),
|
|
2804
|
+
host: z30.string().max(255).optional(),
|
|
2805
|
+
type: dnsType2.optional(),
|
|
2806
|
+
content: z30.string().max(1024).optional(),
|
|
2807
|
+
ttl: dnsTtl.optional(),
|
|
2808
|
+
priority: dnsPriority.optional()
|
|
2809
|
+
}, "updateWphostingDnsRecord", (a) => {
|
|
2810
|
+
const data = body(a, ["contract_id", "servername", "domain", "dns_id"]);
|
|
2811
|
+
requireUpdate(data);
|
|
2812
|
+
return [a.contract_id, a.servername, a.domain, a.dns_id, data];
|
|
2813
|
+
});
|
|
2814
|
+
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]);
|
|
2815
|
+
register("get", "php_version", "\u30B5\u30A4\u30C8\u306EPHP\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u53D6\u5F97", site, "getWphostingPhpVersion", (a) => [a.contract_id, a.servername]);
|
|
2816
|
+
register("update", "php_version", "\u30B5\u30A4\u30C8\u306EPHP\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5909\u66F4", { ...site, version: z30.string().min(1).max(16) }, "updateWphostingPhpVersion", (a) => [a.contract_id, a.servername, { version: a.version }]);
|
|
2817
|
+
register("get", "access_log", "\u30B5\u30A4\u30C8\u306E\u30A2\u30AF\u30BB\u30B9\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
2818
|
+
...site,
|
|
2819
|
+
date: z30.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
|
|
2820
|
+
keyword: z30.string().max(255).optional(),
|
|
2821
|
+
line_number: z30.number().int().min(1).max(5e4).optional()
|
|
2822
|
+
}, "getWphostingAccessLog", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2823
|
+
register("get", "error_log", "\u30B5\u30A4\u30C8\u306E\u30A8\u30E9\u30FC\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
2824
|
+
...site,
|
|
2825
|
+
keyword: z30.string().max(255).optional(),
|
|
2826
|
+
line_number: z30.number().int().min(1).max(5e4).optional()
|
|
2827
|
+
}, "getWphostingErrorLog", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2828
|
+
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]);
|
|
2829
|
+
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"])]);
|
|
2830
|
+
register("update", "cron", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FCron\u30B8\u30E7\u30D6\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2831
|
+
...site,
|
|
2832
|
+
cron_id: z30.string().min(1).max(255),
|
|
2833
|
+
minute: cronFields.minute.optional(),
|
|
2834
|
+
hour: cronFields.hour.optional(),
|
|
2835
|
+
day: cronFields.day.optional(),
|
|
2836
|
+
month: cronFields.month.optional(),
|
|
2837
|
+
weekday: cronFields.weekday.optional(),
|
|
2838
|
+
command: cronFields.command.optional(),
|
|
2839
|
+
comment: cronFields.comment,
|
|
2840
|
+
enabled: z30.boolean().optional()
|
|
2841
|
+
}, "updateWphostingCron", (a) => {
|
|
2842
|
+
const data = body(a, ["contract_id", "servername", "cron_id"]);
|
|
2843
|
+
requireUpdate(data);
|
|
2844
|
+
return [a.contract_id, a.servername, a.cron_id, data];
|
|
2845
|
+
});
|
|
2846
|
+
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: z30.string().min(1).max(255), confirmed }, "deleteWphostingCron", (a) => [a.contract_id, a.servername, a.cron_id]);
|
|
2847
|
+
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]);
|
|
2848
|
+
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", {
|
|
2849
|
+
...site,
|
|
2850
|
+
ssh_enabled: z30.boolean().optional(),
|
|
2851
|
+
abroad_access_restriction: z30.boolean().optional()
|
|
2852
|
+
}, "updateWphostingSsh", (a) => {
|
|
2853
|
+
const data = body(a, ["contract_id", "servername"]);
|
|
2854
|
+
requireUpdate(data);
|
|
2855
|
+
return [a.contract_id, a.servername, data];
|
|
2856
|
+
});
|
|
2857
|
+
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]);
|
|
2858
|
+
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", {
|
|
2859
|
+
...site,
|
|
2860
|
+
label: z30.string().min(1).max(500),
|
|
2861
|
+
public_key: z30.string().min(1).optional(),
|
|
2862
|
+
generate: z30.boolean().optional(),
|
|
2863
|
+
passphrase: z30.string().min(6).max(32).optional()
|
|
2864
|
+
}, "addWphostingSshKey", (a) => {
|
|
2865
|
+
if (a.generate !== true && a.public_key === void 0) {
|
|
2866
|
+
throw new Error("public_key \u307E\u305F\u306F generate=true \u306E\u3044\u305A\u308C\u304B\u304C\u5FC5\u8981\u3067\u3059\u3002");
|
|
2867
|
+
}
|
|
2868
|
+
if (a.generate === true && a.public_key !== void 0) {
|
|
2869
|
+
throw new Error("generate=true\u3068public_key\u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002");
|
|
2870
|
+
}
|
|
2871
|
+
if (a.generate !== true && a.passphrase !== void 0) {
|
|
2872
|
+
throw new Error("passphrase\u306Fgenerate=true\u306E\u5834\u5408\u3060\u3051\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002");
|
|
2873
|
+
}
|
|
2874
|
+
return [
|
|
2875
|
+
a.contract_id,
|
|
2876
|
+
a.servername,
|
|
2877
|
+
body(a, ["contract_id", "servername"])
|
|
2878
|
+
];
|
|
2879
|
+
});
|
|
2880
|
+
register("update", "ssh_key", "SSH\u516C\u958B\u9375\u306E\u30E9\u30D9\u30EB\u307E\u305F\u306Fstatus\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2881
|
+
...site,
|
|
2882
|
+
key_id: positiveId("SSH\u516C\u958B\u9375ID"),
|
|
2883
|
+
label: z30.string().min(1).max(500).optional(),
|
|
2884
|
+
status: z30.enum(["on", "off"]).optional()
|
|
2885
|
+
}, "updateWphostingSshKey", (a) => {
|
|
2886
|
+
const data = body(a, ["contract_id", "servername", "key_id"]);
|
|
2887
|
+
requireUpdate(data);
|
|
2888
|
+
return [a.contract_id, a.servername, a.key_id, data];
|
|
2889
|
+
});
|
|
2890
|
+
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]);
|
|
2891
|
+
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]);
|
|
2892
|
+
register("list", "wp_users", "WordPress\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u3092\u691C\u7D22\u30FB\u4E26\u3079\u66FF\u3048\u3066\u53D6\u5F97", {
|
|
2893
|
+
...site,
|
|
2894
|
+
search: z30.string().max(255).optional(),
|
|
2895
|
+
orderby: z30.enum([
|
|
2896
|
+
"ID",
|
|
2897
|
+
"user_login",
|
|
2898
|
+
"display_name",
|
|
2899
|
+
"user_email",
|
|
2900
|
+
"user_registered"
|
|
2901
|
+
]).optional(),
|
|
2902
|
+
order: z30.enum(["asc", "desc"]).optional()
|
|
2903
|
+
}, "listWphostingWpUsers", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2904
|
+
register("create", "wp_user", "WordPress\u30E6\u30FC\u30B6\u30FC\u3092\u4F5C\u6210", {
|
|
2905
|
+
...site,
|
|
2906
|
+
user_login: z30.string().min(1).max(60),
|
|
2907
|
+
user_email: z30.string().email().max(100),
|
|
2908
|
+
user_pass: z30.string().min(7).max(64),
|
|
2909
|
+
role: z30.string().min(1).max(64),
|
|
2910
|
+
display_name: z30.string().max(255).optional(),
|
|
2911
|
+
first_name: z30.string().max(255).optional(),
|
|
2912
|
+
last_name: z30.string().max(255).optional(),
|
|
2913
|
+
user_url: z30.string().url().max(255).optional(),
|
|
2914
|
+
send_email: z30.boolean().optional()
|
|
2915
|
+
}, "createWphostingWpUser", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2916
|
+
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]);
|
|
2917
|
+
register("update", "wp_user", "WordPress\u30E6\u30FC\u30B6\u30FC\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2918
|
+
...site,
|
|
2919
|
+
user_id: positiveId("WordPress\u30E6\u30FC\u30B6\u30FCID"),
|
|
2920
|
+
...wpUserOptionalFields
|
|
2921
|
+
}, "updateWphostingWpUser", (a) => {
|
|
2922
|
+
const data = body(a, ["contract_id", "servername", "user_id"]);
|
|
2923
|
+
requireUpdate(data);
|
|
2924
|
+
return [a.contract_id, a.servername, a.user_id, data];
|
|
2925
|
+
});
|
|
2926
|
+
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]);
|
|
2927
|
+
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]);
|
|
2928
|
+
register("update", "security_setting", "WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
2929
|
+
...site,
|
|
2930
|
+
key: z30.string().regex(/^[a-z0-9_]+$/).max(100).describe("list_wphosting_security_settings\u3067\u53D6\u5F97\u3057\u305F\u8A2D\u5B9Akey"),
|
|
2931
|
+
is_enable: z30.boolean()
|
|
2932
|
+
}, "updateWphostingSecurity", (a) => [a.contract_id, a.servername, a.key, { is_enable: a.is_enable }]);
|
|
2933
|
+
}
|
|
2934
|
+
|
|
1571
2935
|
// ../core/dist/tools/index.js
|
|
1572
|
-
function
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
2936
|
+
function registerServerTools(server, client, brand, resolver, options = {}) {
|
|
2937
|
+
registerServerAccountTools(server, client, brand, options);
|
|
2938
|
+
const targetServer = resolver ? withServerTargetResolution(server, resolver) : server;
|
|
2939
|
+
const targetClient = resolver?.client ?? client;
|
|
2940
|
+
registerServerInfoTools(targetServer, targetClient, brand);
|
|
2941
|
+
registerCronTools(targetServer, targetClient, brand);
|
|
2942
|
+
registerSshTools(targetServer, targetClient, brand);
|
|
2943
|
+
registerWordpressTools(targetServer, targetClient, brand);
|
|
2944
|
+
registerMailTools(targetServer, targetClient, brand);
|
|
2945
|
+
registerAutoReplyTools(targetServer, targetClient, brand);
|
|
2946
|
+
registerSmtpAbroadRestrictionTools(targetServer, targetClient, brand);
|
|
2947
|
+
registerDkimTools(targetServer, targetClient, brand);
|
|
2948
|
+
registerDmarcTools(targetServer, targetClient, brand);
|
|
2949
|
+
registerSpfTools(targetServer, targetClient, brand);
|
|
2950
|
+
registerSpamFilterTools(targetServer, targetClient, brand);
|
|
2951
|
+
registerFtpTools(targetServer, targetClient, brand);
|
|
2952
|
+
registerDatabaseTools(targetServer, targetClient, brand);
|
|
2953
|
+
registerDomainTools(targetServer, targetClient, brand);
|
|
2954
|
+
registerSslDnsTools(targetServer, targetClient, brand);
|
|
2955
|
+
registerResourceMonitorTools(targetServer, targetClient, brand);
|
|
2956
|
+
registerWafTools(targetServer, targetClient, brand);
|
|
2957
|
+
registerPhpIniTools(targetServer, targetClient, brand);
|
|
2958
|
+
registerWordPressSecurityTools(targetServer, targetClient, brand);
|
|
2959
|
+
registerXAcceleratorTools(targetServer, targetClient, brand);
|
|
2960
|
+
registerServerCacheTools(targetServer, targetClient, brand);
|
|
2961
|
+
registerBrowserCacheTools(targetServer, targetClient, brand);
|
|
2962
|
+
registerUrlRedirectTools(targetServer, targetClient, brand);
|
|
2963
|
+
registerAccessDenyTools(targetServer, targetClient, brand);
|
|
2964
|
+
registerXPageSpeedTools(targetServer, targetClient, brand);
|
|
2965
|
+
registerAutoBackupTools(targetServer, targetClient, brand);
|
|
2966
|
+
registerMysqlBackupTools(targetServer, targetClient, brand);
|
|
2967
|
+
}
|
|
2968
|
+
function registerAllTools(server, client, brand, service = "server", options = {}) {
|
|
2969
|
+
const services = Array.isArray(service) ? [...new Set(service)] : [service];
|
|
2970
|
+
if (services.includes("server")) {
|
|
2971
|
+
registerServerTools(server, client, brand, options.serverTargetResolver, options);
|
|
2972
|
+
}
|
|
2973
|
+
if (services.includes("domain")) {
|
|
2974
|
+
registerDomainServiceTools(server, client, brand, options);
|
|
2975
|
+
}
|
|
2976
|
+
if (services.includes("wphosting")) {
|
|
2977
|
+
registerWphostingTools(server, client, brand, options);
|
|
2978
|
+
}
|
|
1600
2979
|
}
|
|
1601
2980
|
|
|
1602
2981
|
// ../core/dist/index.js
|
|
2982
|
+
var MCP_SERVICES = ["server", "domain", "wphosting"];
|
|
2983
|
+
function optionValue(argv, index) {
|
|
2984
|
+
const arg = argv[index];
|
|
2985
|
+
if (arg === "--services") {
|
|
2986
|
+
const value = argv[index + 1];
|
|
2987
|
+
if (!value || value.startsWith("--")) {
|
|
2988
|
+
throw new Error("--services requires a value.");
|
|
2989
|
+
}
|
|
2990
|
+
return { value, nextIndex: index + 1 };
|
|
2991
|
+
}
|
|
2992
|
+
return { value: arg.slice("--services=".length), nextIndex: index };
|
|
2993
|
+
}
|
|
2994
|
+
function parseMcpServices(argv = process.argv.slice(2), supportedServices = MCP_SERVICES) {
|
|
2995
|
+
let servicesValue;
|
|
2996
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
2997
|
+
const arg = argv[i];
|
|
2998
|
+
if (arg === "--services" || arg.startsWith("--services=")) {
|
|
2999
|
+
if (servicesValue !== void 0) {
|
|
3000
|
+
throw new Error("--services may be specified only once.");
|
|
3001
|
+
}
|
|
3002
|
+
const parsed = optionValue(argv, i);
|
|
3003
|
+
if (!parsed.value)
|
|
3004
|
+
throw new Error("--services requires a value.");
|
|
3005
|
+
servicesValue = parsed.value;
|
|
3006
|
+
i = parsed.nextIndex;
|
|
3007
|
+
} else {
|
|
3008
|
+
throw new Error(`Unknown argument "${arg}"; only --services is supported.`);
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
if (servicesValue === void 0)
|
|
3012
|
+
return ["server"];
|
|
3013
|
+
if (servicesValue === "all") {
|
|
3014
|
+
throw new Error("--services=all is not supported; list each service explicitly.");
|
|
3015
|
+
}
|
|
3016
|
+
const values = servicesValue.split(",").map((value) => value.trim());
|
|
3017
|
+
if (values.length === 0 || values.some((value) => value === "")) {
|
|
3018
|
+
throw new Error("--services must be a comma-separated list without empty values.");
|
|
3019
|
+
}
|
|
3020
|
+
if (new Set(values).size !== values.length) {
|
|
3021
|
+
throw new Error("--services must not contain duplicate services.");
|
|
3022
|
+
}
|
|
3023
|
+
for (const value of values) {
|
|
3024
|
+
if (!supportedServices.includes(value)) {
|
|
3025
|
+
throw new Error(`Unknown or unsupported service "${value}".`);
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
return values;
|
|
3029
|
+
}
|
|
3030
|
+
function instructionsFor(services, brand) {
|
|
3031
|
+
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
|
|
3032
|
+
\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`;
|
|
3033
|
+
const sections = [];
|
|
3034
|
+
if (services.includes("server")) {
|
|
3035
|
+
sections.push(`Server \u2014 ${brand.displayName}\u306E\u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FC\u3092\u7BA1\u7406\u3057\u307E\u3059\u3002
|
|
3036
|
+
\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
|
|
3037
|
+
\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
|
|
3038
|
+
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`);
|
|
3039
|
+
}
|
|
3040
|
+
if (services.includes("domain")) {
|
|
3041
|
+
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
|
|
3042
|
+
\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
|
|
3043
|
+
\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`);
|
|
3044
|
+
}
|
|
3045
|
+
if (services.includes("wphosting")) {
|
|
3046
|
+
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
|
|
3047
|
+
\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
|
|
3048
|
+
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
|
|
3049
|
+
\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`);
|
|
3050
|
+
}
|
|
3051
|
+
return `${brand.displayName} MCP \u2014 \u6709\u52B9\u306A\u30B5\u30FC\u30D3\u30B9: ${services.join(", ")}
|
|
3052
|
+
|
|
3053
|
+
${sections.join("\n\n")}
|
|
3054
|
+
|
|
3055
|
+
${common}`;
|
|
3056
|
+
}
|
|
1603
3057
|
async function run(brand, options) {
|
|
1604
3058
|
const envPrefix = brand.brand.toUpperCase();
|
|
1605
3059
|
const apiKey = process.env[`${envPrefix}_API_KEY`] ?? process.env["XSERVER_API_KEY"];
|
|
1606
|
-
const
|
|
3060
|
+
const servername3 = process.env[`${envPrefix}_SERVERNAME`] ?? process.env["XSERVER_SERVERNAME"];
|
|
1607
3061
|
const baseUrl = process.env[`${envPrefix}_API_BASE_URL`];
|
|
3062
|
+
const enableHighRiskExecute = (process.env[`${envPrefix}_MCP_ENABLE_HIGH_RISK_EXECUTE`] ?? process.env.XSERVER_MCP_ENABLE_HIGH_RISK_EXECUTE) === "1";
|
|
3063
|
+
let services;
|
|
3064
|
+
try {
|
|
3065
|
+
const supportedServices = brand.brand === "xserver" ? ["server", "domain", "wphosting"] : ["server", "domain"];
|
|
3066
|
+
services = parseMcpServices(process.argv.slice(2), supportedServices);
|
|
3067
|
+
} catch (error) {
|
|
3068
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
3069
|
+
process.exit(1);
|
|
3070
|
+
}
|
|
1608
3071
|
if (!apiKey) {
|
|
1609
3072
|
console.error(`Error: ${envPrefix}_API_KEY environment variable is required.`);
|
|
1610
3073
|
console.error(`Get your API key at the ${brand.displayName} control panel.`);
|
|
1611
3074
|
process.exit(1);
|
|
1612
3075
|
}
|
|
1613
|
-
|
|
1614
|
-
console.error(`Error: ${envPrefix}_SERVERNAME environment variable is required.`);
|
|
1615
|
-
process.exit(1);
|
|
1616
|
-
}
|
|
3076
|
+
const apiBase = baseUrl ?? brand.apiBase;
|
|
1617
3077
|
const client = new ApiClient({
|
|
1618
3078
|
apiKey,
|
|
1619
|
-
apiBase
|
|
1620
|
-
servername
|
|
3079
|
+
apiBase,
|
|
3080
|
+
servername: servername3
|
|
1621
3081
|
});
|
|
3082
|
+
const serverTargetResolver = services.includes("server") ? new ServerTargetResolver({
|
|
3083
|
+
apiKey,
|
|
3084
|
+
apiBase,
|
|
3085
|
+
fixedServername: servername3
|
|
3086
|
+
}) : void 0;
|
|
1622
3087
|
const server = new McpServer({
|
|
1623
3088
|
name: options.name,
|
|
1624
3089
|
version: options.version
|
|
1625
3090
|
}, {
|
|
1626
|
-
instructions:
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
\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
|
|
1633
|
-
\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`
|
|
3091
|
+
instructions: instructionsFor(services, brand)
|
|
3092
|
+
});
|
|
3093
|
+
registerAllTools(server, client, brand, services, {
|
|
3094
|
+
enableHighRiskExecute,
|
|
3095
|
+
serverTargetResolver
|
|
1634
3096
|
});
|
|
1635
|
-
registerAllTools(server, client, brand);
|
|
1636
3097
|
const transport = new StdioServerTransport();
|
|
1637
3098
|
await server.connect(transport);
|
|
1638
3099
|
}
|
|
@@ -1640,7 +3101,7 @@ DNS\u30EC\u30B3\u30FC\u30C9\u7BA1\u7406\u3001PHP\u30D0\u30FC\u30B8\u30E7\u30F3\u
|
|
|
1640
3101
|
// package.json
|
|
1641
3102
|
var package_default = {
|
|
1642
3103
|
name: "xserver-mcp",
|
|
1643
|
-
version: "1.
|
|
3104
|
+
version: "1.4.0",
|
|
1644
3105
|
description: "Official MCP server for XServer API \u2014 manage your XServer hosting from AI assistants",
|
|
1645
3106
|
type: "module",
|
|
1646
3107
|
bin: {
|
|
@@ -1673,7 +3134,7 @@ var package_default = {
|
|
|
1673
3134
|
access: "public"
|
|
1674
3135
|
},
|
|
1675
3136
|
dependencies: {
|
|
1676
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
3137
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
1677
3138
|
zod: "^3.24.0"
|
|
1678
3139
|
},
|
|
1679
3140
|
devDependencies: {
|
|
@@ -1690,6 +3151,24 @@ await run({
|
|
|
1690
3151
|
brand: "xserver",
|
|
1691
3152
|
apiBase: "https://api.xserver.ne.jp",
|
|
1692
3153
|
displayName: "XServer",
|
|
3154
|
+
serverServiceName: "XServer \u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FC",
|
|
3155
|
+
wphostingServiceName: "XServer for WordPress",
|
|
3156
|
+
domainTermsUrl: "https://www.xdomain.ne.jp/rule/rule.php",
|
|
3157
|
+
domainPrivacyUrl: "https://www.xdomain.ne.jp/privacy_announcement.php",
|
|
3158
|
+
serverTermsUrl: "https://www.xserver.ne.jp/rule/rule.php",
|
|
3159
|
+
serverPrivacyUrl: "https://www.xserver.ne.jp/privacy_announcement.php",
|
|
3160
|
+
// XServerビジネスは server サービスに `xbiz-` 接頭辞のプランとして同居しており、
|
|
3161
|
+
// サービス名・規約URLが XS とは別。plan_id で出し分ける(CLI 側と同じ設定)。
|
|
3162
|
+
serverPlanOverrides: [
|
|
3163
|
+
{
|
|
3164
|
+
planIdPrefix: "xbiz-",
|
|
3165
|
+
serviceName: "XServer\u30D3\u30B8\u30CD\u30B9",
|
|
3166
|
+
termsUrl: "https://business.xserver.ne.jp/rule.php",
|
|
3167
|
+
privacyUrl: "https://business.xserver.ne.jp/privacy_announcement.php"
|
|
3168
|
+
}
|
|
3169
|
+
],
|
|
3170
|
+
wphostingTermsUrl: "https://wp.xserver.ne.jp/rule/rule.php",
|
|
3171
|
+
wphostingPrivacyUrl: "https://wp.xserver.ne.jp/privacy_announcement.php",
|
|
1693
3172
|
commandName: "xserver-mcp",
|
|
1694
3173
|
configDir: "xserver-mcp"
|
|
1695
3174
|
}, {
|