xserver-mcp 1.3.0 → 1.5.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 +34 -8
- package/dist/index.js +1422 -692
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,6 +17,21 @@ function redactSensitiveValues(value) {
|
|
|
17
17
|
SENSITIVE_FIELD_PATTERN.test(key) ? "[REDACTED]" : redactSensitiveValues(child)
|
|
18
18
|
]));
|
|
19
19
|
}
|
|
20
|
+
function retryAfterSeconds(response) {
|
|
21
|
+
if (response.status !== 429)
|
|
22
|
+
return void 0;
|
|
23
|
+
const value = response.headers.get("retry-after");
|
|
24
|
+
if (value === null || !/^\d+$/.test(value))
|
|
25
|
+
return void 0;
|
|
26
|
+
const seconds = Number(value);
|
|
27
|
+
if (!Number.isSafeInteger(seconds))
|
|
28
|
+
return void 0;
|
|
29
|
+
return seconds;
|
|
30
|
+
}
|
|
31
|
+
function retryAfterGuidance(response) {
|
|
32
|
+
const seconds = retryAfterSeconds(response);
|
|
33
|
+
return seconds === void 0 ? void 0 : `\u518D\u8A66\u884C\u307E\u3067\u306E\u76EE\u5B89: ${seconds}\u79D2`;
|
|
34
|
+
}
|
|
20
35
|
var ApiError = class extends Error {
|
|
21
36
|
httpStatus;
|
|
22
37
|
errorCode;
|
|
@@ -48,6 +63,27 @@ var ApiClient = class {
|
|
|
48
63
|
return `/v1/server/${encodeURIComponent(this.servername)}`;
|
|
49
64
|
}
|
|
50
65
|
// ================================================================
|
|
66
|
+
// サーバーサービスAPI(/v1/server・servername非依存)
|
|
67
|
+
// ================================================================
|
|
68
|
+
async listServerPlans(params) {
|
|
69
|
+
return this.get("/v1/server/plans", params);
|
|
70
|
+
}
|
|
71
|
+
async registerServer(data, idempotencyKey5) {
|
|
72
|
+
return this.post("/v1/server", data, idempotencyHeaders(idempotencyKey5));
|
|
73
|
+
}
|
|
74
|
+
async listServers() {
|
|
75
|
+
return this.get("/v1/server");
|
|
76
|
+
}
|
|
77
|
+
async getServerSignupStatus(servername3) {
|
|
78
|
+
return this.get(`/v1/server/${enc(servername3)}/signup-status`);
|
|
79
|
+
}
|
|
80
|
+
async getServerMemo(servername3) {
|
|
81
|
+
return this.get(`/v1/server/${enc(servername3)}/memo`);
|
|
82
|
+
}
|
|
83
|
+
async updateServerMemo(servername3, data) {
|
|
84
|
+
return this.put(`/v1/server/${enc(servername3)}/memo`, data);
|
|
85
|
+
}
|
|
86
|
+
// ================================================================
|
|
51
87
|
// サーバー情報
|
|
52
88
|
// ================================================================
|
|
53
89
|
async getServerInfo() {
|
|
@@ -536,14 +572,14 @@ var ApiClient = class {
|
|
|
536
572
|
async getDomainPricing(params) {
|
|
537
573
|
return this.get("/v1/domain/pricing", params);
|
|
538
574
|
}
|
|
539
|
-
async registerDomain(data,
|
|
540
|
-
return this.post("/v1/domain", data, idempotencyHeaders(
|
|
575
|
+
async registerDomain(data, idempotencyKey5) {
|
|
576
|
+
return this.post("/v1/domain", data, idempotencyHeaders(idempotencyKey5));
|
|
541
577
|
}
|
|
542
|
-
async transferDomain(domainName2, data,
|
|
543
|
-
return this.post(`${this.domainPath(domainName2)}/transfer`, data, idempotencyHeaders(
|
|
578
|
+
async transferDomain(domainName2, data, idempotencyKey5) {
|
|
579
|
+
return this.post(`${this.domainPath(domainName2)}/transfer`, data, idempotencyHeaders(idempotencyKey5));
|
|
544
580
|
}
|
|
545
|
-
async renewDomain(domainName2, data,
|
|
546
|
-
return this.post(`${this.domainPath(domainName2)}/renew`, data, idempotencyHeaders(
|
|
581
|
+
async renewDomain(domainName2, data, idempotencyKey5) {
|
|
582
|
+
return this.post(`${this.domainPath(domainName2)}/renew`, data, idempotencyHeaders(idempotencyKey5));
|
|
547
583
|
}
|
|
548
584
|
// ================================================================
|
|
549
585
|
// WPhosting API(/v1/wphosting/{contract_id})
|
|
@@ -551,179 +587,266 @@ var ApiClient = class {
|
|
|
551
587
|
wphostingPath(contractId2) {
|
|
552
588
|
return `/v1/wphosting/${enc(contractId2)}`;
|
|
553
589
|
}
|
|
554
|
-
wphostingSitePath(contractId2,
|
|
555
|
-
return `${this.wphostingPath(contractId2)}/sites/${enc(
|
|
590
|
+
wphostingSitePath(contractId2, servername3) {
|
|
591
|
+
return `${this.wphostingPath(contractId2)}/sites/${enc(servername3)}`;
|
|
592
|
+
}
|
|
593
|
+
async listWphostingPlans(params) {
|
|
594
|
+
return this.get("/v1/wphosting/plans", params);
|
|
595
|
+
}
|
|
596
|
+
async registerWphosting(data, idempotencyKey5) {
|
|
597
|
+
return this.post("/v1/wphosting", data, idempotencyHeaders(idempotencyKey5));
|
|
598
|
+
}
|
|
599
|
+
async listWphostingContracts() {
|
|
600
|
+
return this.get("/v1/wphosting");
|
|
601
|
+
}
|
|
602
|
+
async getWphostingMemo(contractId2) {
|
|
603
|
+
return this.get(`${this.wphostingPath(contractId2)}/memo`);
|
|
604
|
+
}
|
|
605
|
+
async updateWphostingMemo(contractId2, data) {
|
|
606
|
+
return this.put(`${this.wphostingPath(contractId2)}/memo`, data);
|
|
556
607
|
}
|
|
557
608
|
async listWphostingSites(contractId2) {
|
|
558
609
|
return this.get(`${this.wphostingPath(contractId2)}/sites`);
|
|
559
610
|
}
|
|
560
|
-
async getWphostingSite(contractId2,
|
|
561
|
-
return this.get(this.wphostingSitePath(contractId2,
|
|
611
|
+
async getWphostingSite(contractId2, servername3) {
|
|
612
|
+
return this.get(this.wphostingSitePath(contractId2, servername3));
|
|
562
613
|
}
|
|
563
|
-
async createWphostingSite(contractId2, data,
|
|
564
|
-
return this.post(`${this.wphostingPath(contractId2)}/sites`, data, idempotencyHeaders(
|
|
614
|
+
async createWphostingSite(contractId2, data, idempotencyKey5) {
|
|
615
|
+
return this.post(`${this.wphostingPath(contractId2)}/sites`, data, idempotencyHeaders(idempotencyKey5));
|
|
565
616
|
}
|
|
566
|
-
async deleteWphostingSite(contractId2,
|
|
567
|
-
return this.delete(this.wphostingSitePath(contractId2,
|
|
617
|
+
async deleteWphostingSite(contractId2, servername3, idempotencyKey5) {
|
|
618
|
+
return this.delete(this.wphostingSitePath(contractId2, servername3), void 0, idempotencyHeaders(idempotencyKey5));
|
|
568
619
|
}
|
|
569
620
|
async getWphostingUsage(contractId2) {
|
|
570
621
|
return this.get(`${this.wphostingPath(contractId2)}/usage`);
|
|
571
622
|
}
|
|
572
|
-
async createWphostingStaging(contractId2,
|
|
573
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
623
|
+
async createWphostingStaging(contractId2, servername3, data, idempotencyKey5) {
|
|
624
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/staging`, data, idempotencyHeaders(idempotencyKey5));
|
|
574
625
|
}
|
|
575
|
-
async listWphostingBackups(contractId2,
|
|
576
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
626
|
+
async listWphostingBackups(contractId2, servername3) {
|
|
627
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/backups`);
|
|
577
628
|
}
|
|
578
|
-
async createWphostingBackup(contractId2,
|
|
579
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
629
|
+
async createWphostingBackup(contractId2, servername3, data, idempotencyKey5) {
|
|
630
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/backups`, data, idempotencyHeaders(idempotencyKey5));
|
|
580
631
|
}
|
|
581
|
-
async restoreWphostingBackup(contractId2,
|
|
582
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
632
|
+
async restoreWphostingBackup(contractId2, servername3, backupId, idempotencyKey5) {
|
|
633
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/backups/${enc(backupId)}/restore`, void 0, idempotencyHeaders(idempotencyKey5));
|
|
583
634
|
}
|
|
584
|
-
async listWphostingBackupRestoreHistory(contractId2,
|
|
585
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
635
|
+
async listWphostingBackupRestoreHistory(contractId2, servername3) {
|
|
636
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/backups/restore-history`);
|
|
586
637
|
}
|
|
587
|
-
async deleteWphostingBackup(contractId2,
|
|
588
|
-
return this.delete(`${this.wphostingSitePath(contractId2,
|
|
638
|
+
async deleteWphostingBackup(contractId2, servername3, backupId) {
|
|
639
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/backups/${enc(backupId)}`);
|
|
589
640
|
}
|
|
590
|
-
async getWphostingWordPress(contractId2,
|
|
591
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
641
|
+
async getWphostingWordPress(contractId2, servername3) {
|
|
642
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/wordpress`);
|
|
592
643
|
}
|
|
593
|
-
async updateWphostingWordPress(contractId2,
|
|
594
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
644
|
+
async updateWphostingWordPress(contractId2, servername3, data) {
|
|
645
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/wordpress`, data);
|
|
595
646
|
}
|
|
596
|
-
async upgradeWphostingWordPress(contractId2,
|
|
597
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
647
|
+
async upgradeWphostingWordPress(contractId2, servername3) {
|
|
648
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/wordpress/update`);
|
|
598
649
|
}
|
|
599
|
-
async getWphostingMaintenanceMode(contractId2,
|
|
600
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
650
|
+
async getWphostingMaintenanceMode(contractId2, servername3) {
|
|
651
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/maintenance-mode`);
|
|
601
652
|
}
|
|
602
|
-
async updateWphostingMaintenanceMode(contractId2,
|
|
603
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
653
|
+
async updateWphostingMaintenanceMode(contractId2, servername3, data) {
|
|
654
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/maintenance-mode`, data);
|
|
604
655
|
}
|
|
605
|
-
async listWphostingPlugins(contractId2,
|
|
606
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
656
|
+
async listWphostingPlugins(contractId2, servername3) {
|
|
657
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/plugins`);
|
|
607
658
|
}
|
|
608
|
-
async installWphostingPlugin(contractId2,
|
|
609
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
659
|
+
async installWphostingPlugin(contractId2, servername3, data) {
|
|
660
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/plugins`, data);
|
|
610
661
|
}
|
|
611
|
-
async updateWphostingPlugin(contractId2,
|
|
612
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
662
|
+
async updateWphostingPlugin(contractId2, servername3, plugin, data) {
|
|
663
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/plugins/${enc(plugin)}`, data);
|
|
613
664
|
}
|
|
614
|
-
async upgradeWphostingPlugin(contractId2,
|
|
615
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
665
|
+
async upgradeWphostingPlugin(contractId2, servername3, plugin) {
|
|
666
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/plugins/${enc(plugin)}/update`);
|
|
616
667
|
}
|
|
617
|
-
async deleteWphostingPlugin(contractId2,
|
|
618
|
-
return this.delete(`${this.wphostingSitePath(contractId2,
|
|
668
|
+
async deleteWphostingPlugin(contractId2, servername3, plugin) {
|
|
669
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/plugins/${enc(plugin)}`);
|
|
619
670
|
}
|
|
620
|
-
async listWphostingThemes(contractId2,
|
|
621
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
671
|
+
async listWphostingThemes(contractId2, servername3) {
|
|
672
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/themes`);
|
|
622
673
|
}
|
|
623
|
-
async installWphostingTheme(contractId2,
|
|
624
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
674
|
+
async installWphostingTheme(contractId2, servername3, data) {
|
|
675
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/themes`, data);
|
|
625
676
|
}
|
|
626
|
-
async updateWphostingTheme(contractId2,
|
|
627
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
677
|
+
async updateWphostingTheme(contractId2, servername3, theme, data) {
|
|
678
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/themes/${enc(theme)}`, data);
|
|
628
679
|
}
|
|
629
|
-
async upgradeWphostingTheme(contractId2,
|
|
630
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
680
|
+
async upgradeWphostingTheme(contractId2, servername3, theme) {
|
|
681
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/themes/${enc(theme)}/update`);
|
|
631
682
|
}
|
|
632
|
-
async deleteWphostingTheme(contractId2,
|
|
633
|
-
return this.delete(`${this.wphostingSitePath(contractId2,
|
|
683
|
+
async deleteWphostingTheme(contractId2, servername3, theme) {
|
|
684
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/themes/${enc(theme)}`);
|
|
634
685
|
}
|
|
635
|
-
async listWphostingDomains(contractId2,
|
|
636
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
686
|
+
async listWphostingDomains(contractId2, servername3) {
|
|
687
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/domains`);
|
|
637
688
|
}
|
|
638
|
-
async addWphostingDomain(contractId2,
|
|
639
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
689
|
+
async addWphostingDomain(contractId2, servername3, data) {
|
|
690
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/domains`, data);
|
|
640
691
|
}
|
|
641
|
-
async verifyWphostingDomain(contractId2,
|
|
642
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
692
|
+
async verifyWphostingDomain(contractId2, servername3, domain2) {
|
|
693
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/verify`);
|
|
643
694
|
}
|
|
644
|
-
async deleteWphostingDomain(contractId2,
|
|
645
|
-
return this.delete(`${this.wphostingSitePath(contractId2,
|
|
695
|
+
async deleteWphostingDomain(contractId2, servername3, domain2) {
|
|
696
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}`);
|
|
646
697
|
}
|
|
647
|
-
async updateWphostingSiteUrl(contractId2,
|
|
648
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
698
|
+
async updateWphostingSiteUrl(contractId2, servername3, data) {
|
|
699
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/site-url`, data);
|
|
649
700
|
}
|
|
650
|
-
async listWphostingDnsRecords(contractId2,
|
|
651
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
701
|
+
async listWphostingDnsRecords(contractId2, servername3, domain2) {
|
|
702
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/dns`);
|
|
652
703
|
}
|
|
653
|
-
async addWphostingDnsRecord(contractId2,
|
|
654
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
704
|
+
async addWphostingDnsRecord(contractId2, servername3, domain2, data) {
|
|
705
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/dns`, data);
|
|
655
706
|
}
|
|
656
|
-
async updateWphostingDnsRecord(contractId2,
|
|
657
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
707
|
+
async updateWphostingDnsRecord(contractId2, servername3, domain2, dnsId2, data) {
|
|
708
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/dns/${enc(dnsId2)}`, data);
|
|
658
709
|
}
|
|
659
|
-
async deleteWphostingDnsRecord(contractId2,
|
|
660
|
-
return this.delete(`${this.wphostingSitePath(contractId2,
|
|
710
|
+
async deleteWphostingDnsRecord(contractId2, servername3, domain2, dnsId2) {
|
|
711
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/domains/${enc(domain2)}/dns/${enc(dnsId2)}`);
|
|
661
712
|
}
|
|
662
|
-
async getWphostingPhpVersion(contractId2,
|
|
663
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
713
|
+
async getWphostingPhpVersion(contractId2, servername3) {
|
|
714
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/php-version`);
|
|
664
715
|
}
|
|
665
|
-
async updateWphostingPhpVersion(contractId2,
|
|
666
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
716
|
+
async updateWphostingPhpVersion(contractId2, servername3, data) {
|
|
717
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/php-version`, data);
|
|
667
718
|
}
|
|
668
|
-
async getWphostingAccessLog(contractId2,
|
|
669
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
719
|
+
async getWphostingAccessLog(contractId2, servername3, params) {
|
|
720
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/access-log`, params);
|
|
670
721
|
}
|
|
671
|
-
async getWphostingErrorLog(contractId2,
|
|
672
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
722
|
+
async getWphostingErrorLog(contractId2, servername3, params) {
|
|
723
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/error-log`, params);
|
|
673
724
|
}
|
|
674
|
-
async listWphostingCron(contractId2,
|
|
675
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
725
|
+
async listWphostingCron(contractId2, servername3) {
|
|
726
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/cron`);
|
|
676
727
|
}
|
|
677
|
-
async addWphostingCron(contractId2,
|
|
678
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
728
|
+
async addWphostingCron(contractId2, servername3, data) {
|
|
729
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/cron`, data);
|
|
679
730
|
}
|
|
680
|
-
async updateWphostingCron(contractId2,
|
|
681
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
731
|
+
async updateWphostingCron(contractId2, servername3, cronId, data) {
|
|
732
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/cron/${enc(cronId)}`, data);
|
|
682
733
|
}
|
|
683
|
-
async deleteWphostingCron(contractId2,
|
|
684
|
-
return this.delete(`${this.wphostingSitePath(contractId2,
|
|
734
|
+
async deleteWphostingCron(contractId2, servername3, cronId) {
|
|
735
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/cron/${enc(cronId)}`);
|
|
685
736
|
}
|
|
686
|
-
async getWphostingSsh(contractId2,
|
|
687
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
737
|
+
async getWphostingSsh(contractId2, servername3) {
|
|
738
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/ssh`);
|
|
688
739
|
}
|
|
689
|
-
async updateWphostingSsh(contractId2,
|
|
690
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
740
|
+
async updateWphostingSsh(contractId2, servername3, data) {
|
|
741
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/ssh`, data);
|
|
691
742
|
}
|
|
692
|
-
async listWphostingSshKeys(contractId2,
|
|
693
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
743
|
+
async listWphostingSshKeys(contractId2, servername3) {
|
|
744
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/ssh/key`);
|
|
694
745
|
}
|
|
695
|
-
async addWphostingSshKey(contractId2,
|
|
696
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
746
|
+
async addWphostingSshKey(contractId2, servername3, data) {
|
|
747
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/ssh/key`, data);
|
|
697
748
|
}
|
|
698
|
-
async updateWphostingSshKey(contractId2,
|
|
699
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
749
|
+
async updateWphostingSshKey(contractId2, servername3, keyId, data) {
|
|
750
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/ssh/key/${enc(keyId)}`, data);
|
|
700
751
|
}
|
|
701
|
-
async deleteWphostingSshKey(contractId2,
|
|
702
|
-
return this.delete(`${this.wphostingSitePath(contractId2,
|
|
752
|
+
async deleteWphostingSshKey(contractId2, servername3, keyId) {
|
|
753
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/ssh/key/${enc(keyId)}`);
|
|
703
754
|
}
|
|
704
|
-
async listWphostingWpUserRoles(contractId2,
|
|
705
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
755
|
+
async listWphostingWpUserRoles(contractId2, servername3) {
|
|
756
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/wp-users/roles`);
|
|
706
757
|
}
|
|
707
|
-
async listWphostingWpUsers(contractId2,
|
|
708
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
758
|
+
async listWphostingWpUsers(contractId2, servername3, params) {
|
|
759
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/wp-users`, params);
|
|
709
760
|
}
|
|
710
|
-
async createWphostingWpUser(contractId2,
|
|
711
|
-
return this.post(`${this.wphostingSitePath(contractId2,
|
|
761
|
+
async createWphostingWpUser(contractId2, servername3, data) {
|
|
762
|
+
return this.post(`${this.wphostingSitePath(contractId2, servername3)}/wp-users`, data);
|
|
712
763
|
}
|
|
713
|
-
async getWphostingWpUser(contractId2,
|
|
714
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
764
|
+
async getWphostingWpUser(contractId2, servername3, userId) {
|
|
765
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/wp-users/${enc(userId)}`);
|
|
715
766
|
}
|
|
716
|
-
async updateWphostingWpUser(contractId2,
|
|
717
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
767
|
+
async updateWphostingWpUser(contractId2, servername3, userId, data) {
|
|
768
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/wp-users/${enc(userId)}`, data);
|
|
718
769
|
}
|
|
719
|
-
async deleteWphostingWpUser(contractId2,
|
|
720
|
-
return this.delete(`${this.wphostingSitePath(contractId2,
|
|
770
|
+
async deleteWphostingWpUser(contractId2, servername3, userId) {
|
|
771
|
+
return this.delete(`${this.wphostingSitePath(contractId2, servername3)}/wp-users/${enc(userId)}`);
|
|
721
772
|
}
|
|
722
|
-
async getWphostingSecurity(contractId2,
|
|
723
|
-
return this.get(`${this.wphostingSitePath(contractId2,
|
|
773
|
+
async getWphostingSecurity(contractId2, servername3) {
|
|
774
|
+
return this.get(`${this.wphostingSitePath(contractId2, servername3)}/security`);
|
|
724
775
|
}
|
|
725
|
-
async updateWphostingSecurity(contractId2,
|
|
726
|
-
return this.put(`${this.wphostingSitePath(contractId2,
|
|
776
|
+
async updateWphostingSecurity(contractId2, servername3, key, data) {
|
|
777
|
+
return this.put(`${this.wphostingSitePath(contractId2, servername3)}/security/${enc(key)}`, data);
|
|
778
|
+
}
|
|
779
|
+
// ================================================================
|
|
780
|
+
// VPS API(/v1/vps)
|
|
781
|
+
// ================================================================
|
|
782
|
+
vpsServerPath(uuid2) {
|
|
783
|
+
return `/v1/vps/servers/${enc(uuid2)}`;
|
|
784
|
+
}
|
|
785
|
+
async listVpsServers() {
|
|
786
|
+
return this.get("/v1/vps/servers");
|
|
787
|
+
}
|
|
788
|
+
async getVpsServer(uuid2) {
|
|
789
|
+
return this.get(this.vpsServerPath(uuid2));
|
|
790
|
+
}
|
|
791
|
+
async updateVpsMemo(uuid2, data) {
|
|
792
|
+
return this.put(`${this.vpsServerPath(uuid2)}/memo`, data);
|
|
793
|
+
}
|
|
794
|
+
async updateVpsName(uuid2, data) {
|
|
795
|
+
return this.put(`${this.vpsServerPath(uuid2)}/name`, data);
|
|
796
|
+
}
|
|
797
|
+
async updateVpsReverseDns(uuid2, data) {
|
|
798
|
+
return this.put(`${this.vpsServerPath(uuid2)}/reverse-dns`, data);
|
|
799
|
+
}
|
|
800
|
+
async getVpsPower(uuid2) {
|
|
801
|
+
return this.get(`${this.vpsServerPath(uuid2)}/power`);
|
|
802
|
+
}
|
|
803
|
+
async startVpsPower(uuid2) {
|
|
804
|
+
return this.post(`${this.vpsServerPath(uuid2)}/power/start`);
|
|
805
|
+
}
|
|
806
|
+
async rebootVpsPower(uuid2, data) {
|
|
807
|
+
return this.post(`${this.vpsServerPath(uuid2)}/power/reboot`, data);
|
|
808
|
+
}
|
|
809
|
+
async stopVpsPower(uuid2) {
|
|
810
|
+
return this.post(`${this.vpsServerPath(uuid2)}/power/stop`);
|
|
811
|
+
}
|
|
812
|
+
async getVpsPacketFilter(uuid2) {
|
|
813
|
+
return this.get(`${this.vpsServerPath(uuid2)}/packet-filter`);
|
|
814
|
+
}
|
|
815
|
+
async updateVpsPacketFilter(uuid2, data) {
|
|
816
|
+
return this.put(`${this.vpsServerPath(uuid2)}/packet-filter`, data);
|
|
817
|
+
}
|
|
818
|
+
async addVpsPacketFilterRule(uuid2, data) {
|
|
819
|
+
return this.post(`${this.vpsServerPath(uuid2)}/packet-filter/rules`, data);
|
|
820
|
+
}
|
|
821
|
+
async updateVpsPacketFilterRule(uuid2, ruleId, data) {
|
|
822
|
+
return this.put(`${this.vpsServerPath(uuid2)}/packet-filter/rules/${enc(ruleId)}`, data);
|
|
823
|
+
}
|
|
824
|
+
async deleteVpsPacketFilterRule(uuid2, ruleId) {
|
|
825
|
+
return this.delete(`${this.vpsServerPath(uuid2)}/packet-filter/rules/${enc(ruleId)}`);
|
|
826
|
+
}
|
|
827
|
+
async listVpsOsImages(uuid2) {
|
|
828
|
+
return this.get(`${this.vpsServerPath(uuid2)}/os-images`);
|
|
829
|
+
}
|
|
830
|
+
async reinstallVpsOs(uuid2, data) {
|
|
831
|
+
return this.post(`${this.vpsServerPath(uuid2)}/os-reinstall`, data);
|
|
832
|
+
}
|
|
833
|
+
async getVpsOsReinstall(uuid2) {
|
|
834
|
+
return this.get(`${this.vpsServerPath(uuid2)}/os-reinstall`);
|
|
835
|
+
}
|
|
836
|
+
async getVpsProtection(uuid2) {
|
|
837
|
+
return this.get(`${this.vpsServerPath(uuid2)}/protection`);
|
|
838
|
+
}
|
|
839
|
+
async updateVpsProtection(uuid2, data) {
|
|
840
|
+
return this.put(`${this.vpsServerPath(uuid2)}/protection`, data);
|
|
841
|
+
}
|
|
842
|
+
async listVpsPlans() {
|
|
843
|
+
return this.get("/v1/vps/plans");
|
|
844
|
+
}
|
|
845
|
+
async registerVps(data, idempotencyKey5) {
|
|
846
|
+
return this.post("/v1/vps/servers", data, idempotencyHeaders(idempotencyKey5));
|
|
847
|
+
}
|
|
848
|
+
async getVpsSignupStatus(id) {
|
|
849
|
+
return this.get(`/v1/vps/signup-status/${enc(id)}`);
|
|
727
850
|
}
|
|
728
851
|
// ================================================================
|
|
729
852
|
// HTTP 基盤
|
|
@@ -776,12 +899,23 @@ var ApiClient = class {
|
|
|
776
899
|
const dbg = (msg) => process.stderr.write(`[DEBUG] ${msg}
|
|
777
900
|
`);
|
|
778
901
|
dbg(`HTTP ${response.status} ${response.statusText}`);
|
|
779
|
-
const debugHeaders = [
|
|
902
|
+
const debugHeaders = [
|
|
903
|
+
"x-ratelimit-limit",
|
|
904
|
+
"x-ratelimit-remaining",
|
|
905
|
+
"x-ratelimit-reset",
|
|
906
|
+
"x-concurrent-limit",
|
|
907
|
+
"x-concurrent-remaining",
|
|
908
|
+
"content-type",
|
|
909
|
+
"location"
|
|
910
|
+
];
|
|
780
911
|
for (const h of debugHeaders) {
|
|
781
912
|
const v = response.headers.get(h);
|
|
782
913
|
if (v !== null)
|
|
783
914
|
dbg(` ${h}: ${v}`);
|
|
784
915
|
}
|
|
916
|
+
const retryAfter = retryAfterSeconds(response);
|
|
917
|
+
if (retryAfter !== void 0)
|
|
918
|
+
dbg(` retry-after: ${retryAfter}`);
|
|
785
919
|
}
|
|
786
920
|
const rateLimitHeader = response.headers.get("x-ratelimit-limit");
|
|
787
921
|
if (rateLimitHeader) {
|
|
@@ -792,12 +926,17 @@ var ApiClient = class {
|
|
|
792
926
|
};
|
|
793
927
|
}
|
|
794
928
|
const text = await response.text();
|
|
929
|
+
if (response.status === 202 && text.trim() === "") {
|
|
930
|
+
const location = response.headers.get("location");
|
|
931
|
+
return { accepted: true, location };
|
|
932
|
+
}
|
|
795
933
|
let data;
|
|
796
934
|
try {
|
|
797
935
|
data = JSON.parse(text);
|
|
798
936
|
} catch {
|
|
799
937
|
if (this.debug) {
|
|
800
|
-
|
|
938
|
+
const bodyBytes = Buffer.byteLength(text, "utf8");
|
|
939
|
+
process.stderr.write(`[DEBUG] Response body omitted because it is not valid JSON (${bodyBytes} bytes)
|
|
801
940
|
`);
|
|
802
941
|
}
|
|
803
942
|
throw new ApiError(`Response parse error (HTTP ${response.status})`, response.status, "PARSE_ERROR", []);
|
|
@@ -806,7 +945,10 @@ var ApiClient = class {
|
|
|
806
945
|
const err = data;
|
|
807
946
|
const errorCode = err?.error?.code || "UNKNOWN_ERROR";
|
|
808
947
|
const errorMessage = err?.error?.message || "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F";
|
|
809
|
-
const errors = err?.error?.errors || [];
|
|
948
|
+
const errors = [...err?.error?.errors || []];
|
|
949
|
+
const retryGuidance = retryAfterGuidance(response);
|
|
950
|
+
if (retryGuidance)
|
|
951
|
+
errors.push(retryGuidance);
|
|
810
952
|
throw new ApiError(errorMessage, response.status, errorCode, errors);
|
|
811
953
|
}
|
|
812
954
|
return data;
|
|
@@ -815,17 +957,139 @@ var ApiClient = class {
|
|
|
815
957
|
function enc(s) {
|
|
816
958
|
return encodeURIComponent(s);
|
|
817
959
|
}
|
|
818
|
-
function idempotencyHeaders(
|
|
819
|
-
return
|
|
960
|
+
function idempotencyHeaders(idempotencyKey5) {
|
|
961
|
+
return idempotencyKey5 === void 0 ? void 0 : { "Idempotency-Key": idempotencyKey5 };
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
// ../../shared/dist/billing-confirmation.js
|
|
965
|
+
function formatYen(value) {
|
|
966
|
+
return `${String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",")}\u5186`;
|
|
967
|
+
}
|
|
968
|
+
function planLabel(planId2, planName) {
|
|
969
|
+
return planName === void 0 || planName === planId2 ? `\u30D7\u30E9\u30F3 ${planId2}` : `${planName}\u30D7\u30E9\u30F3\uFF08${planId2}\uFF09`;
|
|
970
|
+
}
|
|
971
|
+
function planNameFromPlans(plans, planId2) {
|
|
972
|
+
const list = plans?.plans;
|
|
973
|
+
if (!Array.isArray(list))
|
|
974
|
+
return void 0;
|
|
975
|
+
for (const plan of list) {
|
|
976
|
+
const record3 = plan;
|
|
977
|
+
if (record3?.plan_id !== planId2)
|
|
978
|
+
continue;
|
|
979
|
+
if (typeof record3.plan_name !== "string" || record3.plan_name === "") {
|
|
980
|
+
return void 0;
|
|
981
|
+
}
|
|
982
|
+
return record3.plan_name;
|
|
983
|
+
}
|
|
984
|
+
return void 0;
|
|
985
|
+
}
|
|
986
|
+
async function resolvePlanName(fetchPlans, planId2) {
|
|
987
|
+
try {
|
|
988
|
+
return planNameFromPlans(await fetchPlans(), planId2);
|
|
989
|
+
} catch {
|
|
990
|
+
return void 0;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
function billingConfirmationDetailLines(details) {
|
|
994
|
+
const lines = [];
|
|
995
|
+
for (const detail of details) {
|
|
996
|
+
lines.push(`${detail.label}: ${detail.value}`);
|
|
997
|
+
if (detail.note !== void 0)
|
|
998
|
+
lines.push(` \u203B ${detail.note}`);
|
|
999
|
+
}
|
|
1000
|
+
return lines;
|
|
1001
|
+
}
|
|
1002
|
+
function billingPaymentLines(totalPrice) {
|
|
1003
|
+
return [
|
|
1004
|
+
`\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`,
|
|
1005
|
+
"\u304A\u652F\u6255\u3044\u65B9\u6CD5: \u30D7\u30EA\u30DA\u30A4\u30C9\u6B8B\u9AD8\u304B\u3089\u306E\u5F15\u304D\u843D\u3068\u3057"
|
|
1006
|
+
];
|
|
1007
|
+
}
|
|
1008
|
+
function autoRenewDetail(autoRenew, options = {}) {
|
|
1009
|
+
if (!autoRenew) {
|
|
1010
|
+
return {
|
|
1011
|
+
label: "\u81EA\u52D5\u66F4\u65B0",
|
|
1012
|
+
value: "\u7121\u52B9",
|
|
1013
|
+
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"
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
return {
|
|
1017
|
+
label: "\u81EA\u52D5\u66F4\u65B0",
|
|
1018
|
+
value: "\u6709\u52B9\uFF08\u6B21\u56DE\u4EE5\u964D\u306E\u66F4\u65B0\u3082\u81EA\u52D5\u3067\u8AB2\u91D1\u3055\u308C\u307E\u3059\uFF09",
|
|
1019
|
+
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
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
function partnerCodeDetail(partnerCode) {
|
|
1023
|
+
if (partnerCode === void 0)
|
|
1024
|
+
return void 0;
|
|
1025
|
+
return {
|
|
1026
|
+
label: "\u304A\u53D6\u6B21\u5E97\u30B3\u30FC\u30C9",
|
|
1027
|
+
value: partnerCode,
|
|
1028
|
+
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"
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
function serverIdDetail(serverId) {
|
|
1032
|
+
return {
|
|
1033
|
+
label: "\u5E0C\u671B\u30B5\u30FC\u30D0\u30FCID",
|
|
1034
|
+
value: serverId ?? "\u6307\u5B9A\u306A\u3057\uFF08\u81EA\u52D5\u3067\u63A1\u756A\u3055\u308C\u307E\u3059\uFF09"
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
1037
|
+
function compactDetails(details) {
|
|
1038
|
+
return details.filter((detail) => detail !== void 0);
|
|
820
1039
|
}
|
|
821
1040
|
|
|
822
1041
|
// ../../shared/dist/brand-config.js
|
|
1042
|
+
function resolveServerPlanBrand(brand, service, planId2) {
|
|
1043
|
+
if (service === "vps") {
|
|
1044
|
+
return {
|
|
1045
|
+
serviceName: brand.vpsServiceName,
|
|
1046
|
+
termsUrl: brand.vpsTermsUrl,
|
|
1047
|
+
privacyUrl: brand.vpsPrivacyUrl
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
if (service === "server" && planId2 !== void 0) {
|
|
1051
|
+
const override = brand.serverPlanOverrides?.find((o) => planId2.startsWith(o.planIdPrefix));
|
|
1052
|
+
if (override !== void 0) {
|
|
1053
|
+
return {
|
|
1054
|
+
serviceName: override.serviceName,
|
|
1055
|
+
termsUrl: override.termsUrl,
|
|
1056
|
+
privacyUrl: override.privacyUrl
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
return service === "server" ? {
|
|
1061
|
+
serviceName: brand.serverServiceName,
|
|
1062
|
+
termsUrl: brand.serverTermsUrl,
|
|
1063
|
+
privacyUrl: brand.serverPrivacyUrl
|
|
1064
|
+
} : {
|
|
1065
|
+
serviceName: brand.wphostingServiceName,
|
|
1066
|
+
termsUrl: brand.wphostingTermsUrl,
|
|
1067
|
+
privacyUrl: brand.wphostingPrivacyUrl
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
823
1070
|
function domainLegalNoticeLines(brand) {
|
|
824
1071
|
return [
|
|
825
1072
|
`\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04: ${brand.domainTermsUrl}`,
|
|
826
1073
|
`\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066: ${brand.domainPrivacyUrl}`
|
|
827
1074
|
];
|
|
828
1075
|
}
|
|
1076
|
+
function signupOperationName(brand, service, planId2) {
|
|
1077
|
+
const { serviceName } = resolveServerPlanBrand(brand, service, planId2);
|
|
1078
|
+
if (serviceName === void 0) {
|
|
1079
|
+
throw new Error(`${service}\u306E\u30B5\u30FC\u30D3\u30B9\u540D\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093`);
|
|
1080
|
+
}
|
|
1081
|
+
return `${serviceName} \u65B0\u898F\u304A\u7533\u3057\u8FBC\u307F`;
|
|
1082
|
+
}
|
|
1083
|
+
function signupLegalNoticeLines(brand, service, planId2) {
|
|
1084
|
+
const { termsUrl, privacyUrl } = resolveServerPlanBrand(brand, service, planId2);
|
|
1085
|
+
if (termsUrl === void 0 || privacyUrl === void 0) {
|
|
1086
|
+
throw new Error(`${service}\u306E\u5229\u7528\u898F\u7D04\u30FB\u500B\u4EBA\u60C5\u5831URL\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093`);
|
|
1087
|
+
}
|
|
1088
|
+
return [
|
|
1089
|
+
`\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04: ${termsUrl}`,
|
|
1090
|
+
`\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066: ${privacyUrl}`
|
|
1091
|
+
];
|
|
1092
|
+
}
|
|
829
1093
|
|
|
830
1094
|
// ../../shared/dist/domain-acquisition-permission.js
|
|
831
1095
|
function record(value) {
|
|
@@ -877,10 +1141,10 @@ var ServerTargetResolver = class {
|
|
|
877
1141
|
client;
|
|
878
1142
|
constructor(options) {
|
|
879
1143
|
this.fixedServername = options.fixedServername;
|
|
880
|
-
this.createClient = options.createClient ?? ((
|
|
1144
|
+
this.createClient = options.createClient ?? ((servername3) => new ApiClient({
|
|
881
1145
|
apiKey: options.apiKey,
|
|
882
1146
|
apiBase: options.apiBase,
|
|
883
|
-
servername:
|
|
1147
|
+
servername: servername3
|
|
884
1148
|
}));
|
|
885
1149
|
this.accountClient = this.createClient();
|
|
886
1150
|
this.client = new Proxy(this.accountClient, {
|
|
@@ -946,8 +1210,8 @@ function withServerTargetResolution(server, resolver) {
|
|
|
946
1210
|
throw new Error("Server tool registration requires a callback.");
|
|
947
1211
|
}
|
|
948
1212
|
registrationArgs[callbackIndex] = async (input = {}, ...callbackArgs) => {
|
|
949
|
-
const { servername:
|
|
950
|
-
return resolver.run(typeof
|
|
1213
|
+
const { servername: servername3, ...forwardedInput } = input;
|
|
1214
|
+
return resolver.run(typeof servername3 === "string" ? servername3 : void 0, () => callback(forwardedInput, ...callbackArgs));
|
|
951
1215
|
};
|
|
952
1216
|
return Reflect.apply(target.tool, target, registrationArgs);
|
|
953
1217
|
};
|
|
@@ -955,7 +1219,185 @@ function withServerTargetResolution(server, resolver) {
|
|
|
955
1219
|
});
|
|
956
1220
|
}
|
|
957
1221
|
|
|
1222
|
+
// ../core/dist/tools/server/account.js
|
|
1223
|
+
import { z as z2 } from "zod";
|
|
1224
|
+
|
|
1225
|
+
// ../core/dist/billing-confirmation.js
|
|
1226
|
+
import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
|
|
1227
|
+
function billingPreviewResult(preview, legalNoticeLines) {
|
|
1228
|
+
const previewFields = preview !== null && typeof preview === "object" && !Array.isArray(preview) ? preview : { preview };
|
|
1229
|
+
return {
|
|
1230
|
+
...previewFields,
|
|
1231
|
+
legal_notices: [...legalNoticeLines],
|
|
1232
|
+
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."
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
function supportsFormElicitation(server) {
|
|
1236
|
+
const elicitation = server.server.getClientCapabilities()?.elicitation;
|
|
1237
|
+
return elicitation != null && elicitation.form != null;
|
|
1238
|
+
}
|
|
1239
|
+
var BILLING_CONFIRMATION_TIMEOUT_MS = 18e4;
|
|
1240
|
+
function assertBillingFormElicitationSupported(server) {
|
|
1241
|
+
if (!supportsFormElicitation(server)) {
|
|
1242
|
+
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");
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
async function confirmBillingOperation(server, input) {
|
|
1246
|
+
if (!supportsFormElicitation(server)) {
|
|
1247
|
+
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");
|
|
1248
|
+
}
|
|
1249
|
+
const target = input.target ?? input.domain;
|
|
1250
|
+
const targetLabel = input.targetLabel ?? "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3";
|
|
1251
|
+
const yearsLines = input.years == null ? [] : [`- \u5951\u7D04\u5E74\u6570: ${input.years}\u5E74`];
|
|
1252
|
+
const termsLines = input.requireTermsAgreement ? [
|
|
1253
|
+
"- \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"
|
|
1254
|
+
] : [];
|
|
1255
|
+
const legalNoticeLines = input.domain === void 0 ? input.legalNoticeLines : domainLegalNoticeLines(input.brand);
|
|
1256
|
+
const detailLines = billingConfirmationDetailLines(input.details ?? []).map((line) => line.startsWith(" ") ? line : `- ${line}`);
|
|
1257
|
+
const paymentLines = billingPaymentLines(input.totalPrice).map((line) => `- ${line}`);
|
|
1258
|
+
const applicationLines = [
|
|
1259
|
+
`- \u64CD\u4F5C: ${input.operation}`,
|
|
1260
|
+
`- ${targetLabel}: ${target}`,
|
|
1261
|
+
...yearsLines,
|
|
1262
|
+
...detailLines,
|
|
1263
|
+
...paymentLines
|
|
1264
|
+
];
|
|
1265
|
+
const confirmationLines = [
|
|
1266
|
+
...legalNoticeLines.map((line) => `- ${line}`),
|
|
1267
|
+
"- \u7533\u8ACB\u3059\u308B\u3068\u8AB2\u91D1\u3055\u308C\u3001\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\u3002",
|
|
1268
|
+
...termsLines
|
|
1269
|
+
];
|
|
1270
|
+
const message = [
|
|
1271
|
+
"\u8AB2\u91D1\u3092\u4F34\u3046\u64CD\u4F5C\u3067\u3059\u3002",
|
|
1272
|
+
"\u3010\u304A\u7533\u3057\u8FBC\u307F\u5185\u5BB9\u3011",
|
|
1273
|
+
applicationLines.join("\n"),
|
|
1274
|
+
"\u3010\u78BA\u8A8D\u4E8B\u9805\u3011",
|
|
1275
|
+
confirmationLines.join("\n"),
|
|
1276
|
+
"\u5185\u5BB9\u3092\u78BA\u8A8D\u3057\u3001\u627F\u8A8D\u3059\u308B\u5834\u5408\u306E\u307F\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
1277
|
+
].join("\n\n");
|
|
1278
|
+
const properties = {
|
|
1279
|
+
confirm_purchase: {
|
|
1280
|
+
type: "boolean",
|
|
1281
|
+
title: "\u8AB2\u91D1\u3092\u627F\u8A8D\u3059\u308B",
|
|
1282
|
+
description: `${target} / ${formatYen(input.totalPrice)} / ${input.operation}`
|
|
1283
|
+
}
|
|
1284
|
+
};
|
|
1285
|
+
const required = ["confirm_purchase"];
|
|
1286
|
+
if (input.requireTermsAgreement) {
|
|
1287
|
+
properties.agree_to_terms = {
|
|
1288
|
+
type: "boolean",
|
|
1289
|
+
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",
|
|
1290
|
+
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"
|
|
1291
|
+
};
|
|
1292
|
+
required.push("agree_to_terms");
|
|
1293
|
+
}
|
|
1294
|
+
let result;
|
|
1295
|
+
try {
|
|
1296
|
+
result = await server.server.elicitInput({
|
|
1297
|
+
mode: "form",
|
|
1298
|
+
message,
|
|
1299
|
+
requestedSchema: {
|
|
1300
|
+
type: "object",
|
|
1301
|
+
properties,
|
|
1302
|
+
required
|
|
1303
|
+
}
|
|
1304
|
+
}, { timeout: BILLING_CONFIRMATION_TIMEOUT_MS });
|
|
1305
|
+
} catch (error) {
|
|
1306
|
+
if (error instanceof McpError && error.code === ErrorCode.RequestTimeout) {
|
|
1307
|
+
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`);
|
|
1308
|
+
}
|
|
1309
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
1310
|
+
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}`);
|
|
1311
|
+
}
|
|
1312
|
+
if (result.action === "decline" || result.action === "cancel") {
|
|
1313
|
+
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");
|
|
1314
|
+
}
|
|
1315
|
+
if (result.action !== "accept" || result.content == null || typeof result.content !== "object") {
|
|
1316
|
+
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");
|
|
1317
|
+
}
|
|
1318
|
+
const content = result.content;
|
|
1319
|
+
if (content.confirm_purchase !== true) {
|
|
1320
|
+
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");
|
|
1321
|
+
}
|
|
1322
|
+
if (input.requireTermsAgreement && content.agree_to_terms !== true) {
|
|
1323
|
+
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");
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
var billingPreviewAnnotations = {
|
|
1327
|
+
readOnlyHint: true,
|
|
1328
|
+
destructiveHint: false,
|
|
1329
|
+
idempotentHint: true,
|
|
1330
|
+
openWorldHint: true
|
|
1331
|
+
};
|
|
1332
|
+
var billingExecuteAnnotations = {
|
|
1333
|
+
readOnlyHint: false,
|
|
1334
|
+
destructiveHint: true,
|
|
1335
|
+
idempotentHint: true,
|
|
1336
|
+
openWorldHint: true
|
|
1337
|
+
};
|
|
1338
|
+
async function confirmOsReinstallOperation(server, input) {
|
|
1339
|
+
if (!supportsFormElicitation(server)) {
|
|
1340
|
+
throw new Error("OS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\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");
|
|
1341
|
+
}
|
|
1342
|
+
const protectionLine = input.protectionEnabled === true ? "- \u64CD\u4F5C\u4FDD\u8B77\uFF08os_reinstall\uFF09\u306F\u6709\u52B9\u3067\u3059\u3002API \u306F 409 PROTECTED \u3067\u62D2\u5426\u3057\u307E\u3059\u3002" : input.protectionEnabled === false ? "- \u64CD\u4F5C\u4FDD\u8B77\uFF08os_reinstall\uFF09\u306F\u7121\u52B9\u3067\u3059\u3002\u5B9F\u884C\u3059\u308B\u3068\u30C7\u30FC\u30BF\u304C\u524A\u9664\u3055\u308C\u307E\u3059\u3002" : "- \u64CD\u4F5C\u4FDD\u8B77\u306E\u72B6\u614B\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5B9F\u884C\u524D\u306B get_vps_protection \u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";
|
|
1343
|
+
const message = [
|
|
1344
|
+
"OS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u306F\u30B5\u30FC\u30D0\u30FC\u5185\u306E\u30C7\u30FC\u30BF\u30FB\u8A2D\u5B9A\u3092\u3059\u3079\u3066\u524A\u9664\u3057\u307E\u3059\u3002",
|
|
1345
|
+
"\u3010\u5BFE\u8C61\u3011",
|
|
1346
|
+
`- uuid: ${input.uuid}`,
|
|
1347
|
+
`- image_id: ${input.imageId}`,
|
|
1348
|
+
protectionLine,
|
|
1349
|
+
"VPS\u306F\u505C\u6B62\u4E2D\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u8AA4\u64CD\u4F5C\u9632\u6B62\u306B\u306F update_vps_protection \u3067 os_reinstall \u3092 true \u306B\u3067\u304D\u307E\u3059\u3002",
|
|
1350
|
+
"\u5185\u5BB9\u3092\u78BA\u8A8D\u3057\u3001\u627F\u8A8D\u3059\u308B\u5834\u5408\u306E\u307F\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
1351
|
+
].join("\n");
|
|
1352
|
+
let result;
|
|
1353
|
+
try {
|
|
1354
|
+
result = await server.server.elicitInput({
|
|
1355
|
+
mode: "form",
|
|
1356
|
+
message,
|
|
1357
|
+
requestedSchema: {
|
|
1358
|
+
type: "object",
|
|
1359
|
+
properties: {
|
|
1360
|
+
confirm_reinstall: {
|
|
1361
|
+
type: "boolean",
|
|
1362
|
+
title: "\u30C7\u30FC\u30BF\u5168\u6D88\u53BB\u3092\u627F\u8A8D\u3059\u308B",
|
|
1363
|
+
description: `${input.uuid} \u3092 ${input.imageId} \u3067\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B`
|
|
1364
|
+
}
|
|
1365
|
+
},
|
|
1366
|
+
required: ["confirm_reinstall"]
|
|
1367
|
+
}
|
|
1368
|
+
}, { timeout: BILLING_CONFIRMATION_TIMEOUT_MS });
|
|
1369
|
+
} catch (error) {
|
|
1370
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
1371
|
+
throw new Error(`OS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u78BA\u8A8D\uFF08elicitation\uFF09\u306B\u5931\u6557\u3057\u305F\u305F\u3081\u4E2D\u6B62\u3057\u307E\u3057\u305F: ${detail}`);
|
|
1372
|
+
}
|
|
1373
|
+
if (result.action === "decline" || result.action === "cancel") {
|
|
1374
|
+
throw new Error("\u5229\u7528\u8005\u304COS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u78BA\u8A8D\u3092\u62D2\u5426\u307E\u305F\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u305F\u305F\u3081\u3001\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
1375
|
+
}
|
|
1376
|
+
if (result.action !== "accept" || result.content == null || typeof result.content !== "object") {
|
|
1377
|
+
throw new Error("OS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u78BA\u8A8D\u306E\u5FDC\u7B54\u304C\u4E0D\u6B63\u306A\u305F\u3081\u3001\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
1378
|
+
}
|
|
1379
|
+
if (result.content.confirm_reinstall !== true) {
|
|
1380
|
+
throw new Error("\u30C7\u30FC\u30BF\u5168\u6D88\u53BB\u306E\u627F\u8A8D\u304C\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001OS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
958
1384
|
// ../core/dist/helper.js
|
|
1385
|
+
import { stripVTControlCharacters } from "util";
|
|
1386
|
+
var MAX_MCP_ERROR_TEXT_LENGTH = 4096;
|
|
1387
|
+
var LINE_BREAK_PATTERN = /[\r\n\u2028\u2029]+/g;
|
|
1388
|
+
var CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f-\u009f]/g;
|
|
1389
|
+
var TRUNCATED_SUFFIX = "\n[\u30A8\u30E9\u30FC\u51FA\u529B\u3092\u7701\u7565\u3057\u307E\u3057\u305F]";
|
|
1390
|
+
function sanitizeMcpErrorValue(value) {
|
|
1391
|
+
return stripVTControlCharacters(String(value)).replace(LINE_BREAK_PATTERN, " ").replace(CONTROL_CHARACTER_PATTERN, "");
|
|
1392
|
+
}
|
|
1393
|
+
function limitMcpErrorText(value) {
|
|
1394
|
+
if (value.length <= MAX_MCP_ERROR_TEXT_LENGTH)
|
|
1395
|
+
return value;
|
|
1396
|
+
let prefix = value.slice(0, MAX_MCP_ERROR_TEXT_LENGTH - TRUNCATED_SUFFIX.length);
|
|
1397
|
+
if (/[\ud800-\udbff]$/.test(prefix))
|
|
1398
|
+
prefix = prefix.slice(0, -1);
|
|
1399
|
+
return prefix + TRUNCATED_SUFFIX;
|
|
1400
|
+
}
|
|
959
1401
|
function serverToolName(brand, action, feature) {
|
|
960
1402
|
return `${brand.brand}_${action}_server_${feature}`;
|
|
961
1403
|
}
|
|
@@ -965,6 +1407,9 @@ function domainToolName(brand, action, feature) {
|
|
|
965
1407
|
function wphostingToolName(brand, verb, resource) {
|
|
966
1408
|
return `${brand.brand}_${verb}_wphosting_${resource}`;
|
|
967
1409
|
}
|
|
1410
|
+
function vpsToolName(brand, verb, resource) {
|
|
1411
|
+
return `${brand.brand}_${verb}_vps_${resource}`;
|
|
1412
|
+
}
|
|
968
1413
|
async function callApi(fn) {
|
|
969
1414
|
try {
|
|
970
1415
|
const result = await fn();
|
|
@@ -972,16 +1417,87 @@ async function callApi(fn) {
|
|
|
972
1417
|
} catch (e) {
|
|
973
1418
|
let msg;
|
|
974
1419
|
if (e instanceof ApiError) {
|
|
975
|
-
msg = `Error [HTTP ${e.httpStatus}] ${e.errorCode}: ${e.message}`;
|
|
1420
|
+
msg = `Error [HTTP ${e.httpStatus}] ${sanitizeMcpErrorValue(e.errorCode)}: ${sanitizeMcpErrorValue(e.message)}`;
|
|
976
1421
|
if (e.errors.length > 0) {
|
|
977
|
-
msg += "\n" + e.errors.map((err) => ` - ${err}`).join("\n");
|
|
1422
|
+
msg += "\n" + e.errors.map((err) => ` - ${sanitizeMcpErrorValue(err)}`).join("\n");
|
|
978
1423
|
}
|
|
979
1424
|
} else if (e instanceof Error) {
|
|
980
|
-
msg = `Error: ${e.message}`;
|
|
1425
|
+
msg = `Error: ${sanitizeMcpErrorValue(e.message)}`;
|
|
981
1426
|
} else {
|
|
982
|
-
msg = `Error: ${
|
|
1427
|
+
msg = `Error: ${sanitizeMcpErrorValue(e)}`;
|
|
983
1428
|
}
|
|
984
|
-
return { content: [{ type: "text", text: msg }], isError: true };
|
|
1429
|
+
return { content: [{ type: "text", text: limitMcpErrorText(msg) }], isError: true };
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// ../core/dist/tools/server/account.js
|
|
1434
|
+
var planId = z2.string().min(1).max(64).describe("\u30D7\u30E9\u30F3ID");
|
|
1435
|
+
var servername = z2.string().min(1).max(255).describe("\u5BFE\u8C61\u30B5\u30FC\u30D0\u30FC\u306Eservername\uFF08\u660E\u793A\u6307\u5B9A\u5FC5\u9808\uFF09");
|
|
1436
|
+
var memo = z2.string().max(500).describe("\u5951\u7D04\u30E1\u30E2\uFF08\u7A7A\u6587\u5B57\u53EF\u3001500\u6587\u5B57\u4EE5\u5185\uFF09");
|
|
1437
|
+
var expectedTotalPrice = z2.number().int().nonnegative().describe("preview\u3068\u4E00\u81F4\u3059\u308B\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D");
|
|
1438
|
+
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");
|
|
1439
|
+
var signupInput = {
|
|
1440
|
+
plan_id: planId,
|
|
1441
|
+
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"),
|
|
1442
|
+
expected_total_price: expectedTotalPrice,
|
|
1443
|
+
agree_to_terms: z2.literal(true).describe("\u30B5\u30FC\u30D0\u30FC\u5951\u7D04\u306E\u5229\u7528\u898F\u7D04\u3078\u306E\u660E\u793A\u540C\u610F"),
|
|
1444
|
+
server_id: z2.string().regex(/^[a-z][0-9a-z]+$/).optional().describe("\u5E0C\u671B\u30B5\u30FC\u30D0\u30FCID"),
|
|
1445
|
+
partner_code: z2.string().regex(/^[A-Za-z0-9]{1,50}$/).optional().describe("\u30D1\u30FC\u30C8\u30CA\u30FC\u30B3\u30FC\u30C9"),
|
|
1446
|
+
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")
|
|
1447
|
+
};
|
|
1448
|
+
function description(text) {
|
|
1449
|
+
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`;
|
|
1450
|
+
}
|
|
1451
|
+
function registerServerAccountTools(server, client, brand, options = {}) {
|
|
1452
|
+
server.tool(serverToolName(brand, "get", "api_key_info"), description("API\u30AD\u30FC\u60C5\u5831\u3068Server\u30B5\u30FC\u30D3\u30B9\u306E\u6A29\u9650\u30FB\u5BFE\u8C61\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.getMe()));
|
|
1453
|
+
server.tool(serverToolName(brand, "list", "plans"), description("\u7533\u8FBC\u53EF\u80FD\u306A\u30B5\u30FC\u30D0\u30FC\u30D7\u30E9\u30F3\u3092\u53D6\u5F97"), {
|
|
1454
|
+
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")
|
|
1455
|
+
}, async ({ plan_id }) => callApi(() => client.listServerPlans(plan_id ? { plan_id } : void 0)));
|
|
1456
|
+
server.tool(serverToolName(brand, "list", "contracts"), description("\u30B5\u30FC\u30D0\u30FC\u5951\u7D04\u4E00\u89A7\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.listServers()));
|
|
1457
|
+
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)));
|
|
1458
|
+
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)));
|
|
1459
|
+
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 })));
|
|
1460
|
+
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({
|
|
1461
|
+
...input,
|
|
1462
|
+
auto_renew: auto_renew === "enabled",
|
|
1463
|
+
agree_to_terms: true,
|
|
1464
|
+
dry_run: true
|
|
1465
|
+
}), signupLegalNoticeLines(brand, "server", input.plan_id))));
|
|
1466
|
+
if (options.enableHighRiskExecute) {
|
|
1467
|
+
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 () => {
|
|
1468
|
+
const data = {
|
|
1469
|
+
...input,
|
|
1470
|
+
auto_renew: input.auto_renew === "enabled",
|
|
1471
|
+
agree_to_terms: true
|
|
1472
|
+
};
|
|
1473
|
+
const preview = await client.registerServer({
|
|
1474
|
+
...data,
|
|
1475
|
+
dry_run: true
|
|
1476
|
+
});
|
|
1477
|
+
const totalPrice = Number(preview.total_price);
|
|
1478
|
+
if (!Number.isFinite(totalPrice)) {
|
|
1479
|
+
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");
|
|
1480
|
+
}
|
|
1481
|
+
if (totalPrice !== input.expected_total_price) {
|
|
1482
|
+
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`);
|
|
1483
|
+
}
|
|
1484
|
+
assertBillingFormElicitationSupported(server);
|
|
1485
|
+
const planName = await resolvePlanName(() => client.listServerPlans({ plan_id: input.plan_id }), input.plan_id);
|
|
1486
|
+
await confirmBillingOperation(server, {
|
|
1487
|
+
operation: signupOperationName(brand, "server", input.plan_id),
|
|
1488
|
+
target: `${planLabel(input.plan_id, planName)} / \u5951\u7D04\u671F\u9593 ${input.period}\u304B\u6708`,
|
|
1489
|
+
targetLabel: "\u7533\u8FBC\u5185\u5BB9",
|
|
1490
|
+
details: compactDetails([
|
|
1491
|
+
serverIdDetail(input.server_id),
|
|
1492
|
+
autoRenewDetail(input.auto_renew === "enabled"),
|
|
1493
|
+
partnerCodeDetail(input.partner_code)
|
|
1494
|
+
]),
|
|
1495
|
+
legalNoticeLines: signupLegalNoticeLines(brand, "server", input.plan_id),
|
|
1496
|
+
totalPrice,
|
|
1497
|
+
requireTermsAgreement: true
|
|
1498
|
+
});
|
|
1499
|
+
return client.registerServer({ ...data, dry_run: false }, idempotency_key);
|
|
1500
|
+
}));
|
|
985
1501
|
}
|
|
986
1502
|
}
|
|
987
1503
|
|
|
@@ -992,28 +1508,28 @@ function registerServerInfoTools(server, client, brand) {
|
|
|
992
1508
|
}
|
|
993
1509
|
|
|
994
1510
|
// ../core/dist/tools/server/cron.js
|
|
995
|
-
import { z as
|
|
1511
|
+
import { z as z3 } from "zod";
|
|
996
1512
|
function registerCronTools(server, client, brand) {
|
|
997
1513
|
server.tool(serverToolName(brand, "list", "cron"), "Cron\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listCron()));
|
|
998
1514
|
server.tool(serverToolName(brand, "add", "cron"), "Cron\u30B8\u30E7\u30D6\u3092\u65B0\u898F\u8FFD\u52A0", {
|
|
999
|
-
minute:
|
|
1000
|
-
hour:
|
|
1001
|
-
day:
|
|
1002
|
-
month:
|
|
1003
|
-
weekday:
|
|
1004
|
-
command:
|
|
1005
|
-
comment:
|
|
1515
|
+
minute: z3.string().describe("\u5206\uFF080-59, */5 \u7B49\uFF09"),
|
|
1516
|
+
hour: z3.string().describe("\u6642\uFF080-23, * \u7B49\uFF09"),
|
|
1517
|
+
day: z3.string().default("*").describe("\u65E5\uFF081-31, * \u7B49\uFF09"),
|
|
1518
|
+
month: z3.string().default("*").describe("\u6708\uFF081-12, * \u7B49\uFF09"),
|
|
1519
|
+
weekday: z3.string().default("*").describe("\u66DC\u65E5\uFF080-7, * \u7B49\uFF09"),
|
|
1520
|
+
command: z3.string().describe("\u5B9F\u884C\u30B3\u30DE\u30F3\u30C9"),
|
|
1521
|
+
comment: z3.string().optional().describe("\u30E1\u30E2")
|
|
1006
1522
|
}, async (args) => callApi(() => client.addCron(args)));
|
|
1007
1523
|
server.tool(serverToolName(brand, "update", "cron"), "Cron\u30B8\u30E7\u30D6\u3092\u66F4\u65B0", {
|
|
1008
|
-
cron_id:
|
|
1009
|
-
minute:
|
|
1010
|
-
hour:
|
|
1011
|
-
day:
|
|
1012
|
-
month:
|
|
1013
|
-
weekday:
|
|
1014
|
-
command:
|
|
1015
|
-
comment:
|
|
1016
|
-
enabled:
|
|
1524
|
+
cron_id: z3.string().describe("Cron\u306EID"),
|
|
1525
|
+
minute: z3.string().optional().describe("\u5206"),
|
|
1526
|
+
hour: z3.string().optional().describe("\u6642"),
|
|
1527
|
+
day: z3.string().optional().describe("\u65E5"),
|
|
1528
|
+
month: z3.string().optional().describe("\u6708"),
|
|
1529
|
+
weekday: z3.string().optional().describe("\u66DC\u65E5"),
|
|
1530
|
+
command: z3.string().optional().describe("\u5B9F\u884C\u30B3\u30DE\u30F3\u30C9"),
|
|
1531
|
+
comment: z3.string().optional().describe("\u30E1\u30E2"),
|
|
1532
|
+
enabled: z3.boolean().optional().describe("\u6709\u52B9/\u7121\u52B9")
|
|
1017
1533
|
}, async ({ cron_id, ...data }) => callApi(() => {
|
|
1018
1534
|
const update = Object.fromEntries(Object.entries(data).filter(([, value]) => value !== void 0));
|
|
1019
1535
|
if (Object.keys(update).length === 0) {
|
|
@@ -1022,40 +1538,40 @@ function registerCronTools(server, client, brand) {
|
|
|
1022
1538
|
return client.updateCron(cron_id, update);
|
|
1023
1539
|
}));
|
|
1024
1540
|
server.tool(serverToolName(brand, "delete", "cron"), "Cron\u30B8\u30E7\u30D6\u3092\u524A\u9664", {
|
|
1025
|
-
cron_id:
|
|
1541
|
+
cron_id: z3.string().describe("Cron\u306EID")
|
|
1026
1542
|
}, async ({ cron_id }) => callApi(() => client.deleteCron(cron_id)));
|
|
1027
1543
|
}
|
|
1028
1544
|
|
|
1029
1545
|
// ../core/dist/tools/server/ssh.js
|
|
1030
|
-
import { z as
|
|
1546
|
+
import { z as z4 } from "zod";
|
|
1031
1547
|
function registerSshTools(server, client, brand) {
|
|
1032
1548
|
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()));
|
|
1033
1549
|
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", {
|
|
1034
|
-
ssh_enabled:
|
|
1035
|
-
abroad_access_restriction:
|
|
1550
|
+
ssh_enabled: z4.boolean().optional().describe("SSH\u63A5\u7D9A\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
1551
|
+
abroad_access_restriction: z4.boolean().optional().describe("\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u6709\u52B9/\u7121\u52B9")
|
|
1036
1552
|
}, async (args) => callApi(() => client.updateSsh(args)));
|
|
1037
1553
|
server.tool(serverToolName(brand, "list", "ssh_key"), "SSH\u516C\u958B\u9375\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listSshKey()));
|
|
1038
1554
|
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", {
|
|
1039
|
-
label:
|
|
1040
|
-
public_key:
|
|
1041
|
-
generate:
|
|
1042
|
-
passphrase:
|
|
1555
|
+
label: z4.string().describe("\u30E9\u30D9\u30EB"),
|
|
1556
|
+
public_key: z4.string().optional().describe("\u516C\u958B\u9375\uFF08\u624B\u52D5\u767B\u9332\u6642\u3002OpenSSH\u5F62\u5F0F\uFF09"),
|
|
1557
|
+
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"),
|
|
1558
|
+
passphrase: z4.string().optional().describe("\u30D1\u30B9\u30D5\u30EC\u30FC\u30BA\uFF08\u81EA\u52D5\u751F\u6210\u6642\u30026\u301C32\u6587\u5B57\uFF09")
|
|
1043
1559
|
}, async (args) => callApi(() => client.addSshKey(args)));
|
|
1044
1560
|
server.tool(serverToolName(brand, "update", "ssh_key"), "SSH\u516C\u958B\u9375\u306E\u30E9\u30D9\u30EB\u3084\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u66F4\u65B0", {
|
|
1045
|
-
key_id:
|
|
1046
|
-
label:
|
|
1047
|
-
status:
|
|
1561
|
+
key_id: z4.string().describe("\u516C\u958B\u9375ID"),
|
|
1562
|
+
label: z4.string().optional().describe("\u30E9\u30D9\u30EB"),
|
|
1563
|
+
status: z4.enum(["on", "off"]).optional().describe("\u30B9\u30C6\u30FC\u30BF\u30B9")
|
|
1048
1564
|
}, async ({ key_id, ...data }) => callApi(() => client.updateSshKey(key_id, data)));
|
|
1049
1565
|
server.tool(serverToolName(brand, "delete", "ssh_key"), "SSH\u516C\u958B\u9375\u3092\u524A\u9664", {
|
|
1050
|
-
key_id:
|
|
1566
|
+
key_id: z4.string().describe("\u516C\u958B\u9375ID")
|
|
1051
1567
|
}, async ({ key_id }) => callApi(() => client.deleteSshKey(key_id)));
|
|
1052
1568
|
}
|
|
1053
1569
|
|
|
1054
1570
|
// ../core/dist/tools/server/wordpress.js
|
|
1055
|
-
import { z as
|
|
1571
|
+
import { z as z5 } from "zod";
|
|
1056
1572
|
function registerWordpressTools(server, client, brand) {
|
|
1057
1573
|
server.tool(serverToolName(brand, "list", "wordpress"), "WordPress\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1058
|
-
domain:
|
|
1574
|
+
domain: z5.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1059
1575
|
}, async (args) => {
|
|
1060
1576
|
const params = {};
|
|
1061
1577
|
if (args.domain)
|
|
@@ -1063,28 +1579,28 @@ function registerWordpressTools(server, client, brand) {
|
|
|
1063
1579
|
return callApi(() => client.listWordpress(params));
|
|
1064
1580
|
});
|
|
1065
1581
|
server.tool(serverToolName(brand, "add", "wordpress"), "WordPress\u3092\u65B0\u898F\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
1066
|
-
url:
|
|
1067
|
-
title:
|
|
1068
|
-
admin_username:
|
|
1069
|
-
admin_password:
|
|
1070
|
-
admin_email:
|
|
1071
|
-
memo:
|
|
1582
|
+
url: z5.string().describe("\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148URL\uFF08\u4F8B: https://example.com/blog\uFF09"),
|
|
1583
|
+
title: z5.string().describe("\u30B5\u30A4\u30C8\u30BF\u30A4\u30C8\u30EB"),
|
|
1584
|
+
admin_username: z5.string().describe("\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1585
|
+
admin_password: z5.string().describe("\u7BA1\u7406\u8005\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1586
|
+
admin_email: z5.string().describe("\u7BA1\u7406\u8005\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1587
|
+
memo: z5.string().optional().describe("\u30E1\u30E2")
|
|
1072
1588
|
}, async (args) => callApi(() => client.addWordpress(args)));
|
|
1073
1589
|
server.tool(serverToolName(brand, "update", "wordpress"), "WordPress\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
1074
|
-
wp_id:
|
|
1075
|
-
memo:
|
|
1590
|
+
wp_id: z5.string().describe("WordPress\u306EID"),
|
|
1591
|
+
memo: z5.string().optional().describe("\u30E1\u30E2")
|
|
1076
1592
|
}, async ({ wp_id, ...data }) => callApi(() => client.updateWordpress(wp_id, data)));
|
|
1077
1593
|
server.tool(serverToolName(brand, "delete", "wordpress"), "WordPress\u3092\u30A2\u30F3\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
1078
|
-
wp_id:
|
|
1079
|
-
delete_db:
|
|
1594
|
+
wp_id: z5.string().describe("WordPress\u306EID"),
|
|
1595
|
+
delete_db: z5.boolean().optional().describe("\u95A2\u9023\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3082\u524A\u9664\u3059\u308B\u304B")
|
|
1080
1596
|
}, async ({ wp_id, ...data }) => callApi(() => client.deleteWordpress(wp_id, data)));
|
|
1081
1597
|
}
|
|
1082
1598
|
|
|
1083
1599
|
// ../core/dist/tools/server/mail.js
|
|
1084
|
-
import { z as
|
|
1600
|
+
import { z as z6 } from "zod";
|
|
1085
1601
|
function registerMailTools(server, client, brand) {
|
|
1086
1602
|
server.tool(serverToolName(brand, "list", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1087
|
-
domain:
|
|
1603
|
+
domain: z6.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1088
1604
|
}, async (args) => {
|
|
1089
1605
|
const params = {};
|
|
1090
1606
|
if (args.domain)
|
|
@@ -1092,33 +1608,33 @@ function registerMailTools(server, client, brand) {
|
|
|
1092
1608
|
return callApi(() => client.listMail(params));
|
|
1093
1609
|
});
|
|
1094
1610
|
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", {
|
|
1095
|
-
mail_account:
|
|
1611
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
1096
1612
|
}, async ({ mail_account }) => callApi(() => client.getMail(mail_account)));
|
|
1097
1613
|
server.tool(serverToolName(brand, "add", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u4F5C\u6210", {
|
|
1098
|
-
mail_address:
|
|
1099
|
-
password:
|
|
1100
|
-
quota_mb:
|
|
1101
|
-
memo:
|
|
1614
|
+
mail_address: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08user@domain \u5F62\u5F0F\uFF09"),
|
|
1615
|
+
password: z6.string().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1616
|
+
quota_mb: z6.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\uFF09"),
|
|
1617
|
+
memo: z6.string().optional().describe("\u30E1\u30E2")
|
|
1102
1618
|
}, async (args) => callApi(() => client.addMail(args)));
|
|
1103
1619
|
server.tool(serverToolName(brand, "update", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u66F4\u65B0", {
|
|
1104
|
-
mail_account:
|
|
1105
|
-
password:
|
|
1106
|
-
quota_mb:
|
|
1107
|
-
memo:
|
|
1620
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1621
|
+
password: z6.string().optional().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1622
|
+
quota_mb: z6.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\uFF09"),
|
|
1623
|
+
memo: z6.string().optional().describe("\u30E1\u30E2")
|
|
1108
1624
|
}, async ({ mail_account, ...data }) => callApi(() => client.updateMail(mail_account, data)));
|
|
1109
1625
|
server.tool(serverToolName(brand, "delete", "mail"), "\u30E1\u30FC\u30EB\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u524A\u9664", {
|
|
1110
|
-
mail_account:
|
|
1626
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
1111
1627
|
}, async ({ mail_account }) => callApi(() => client.deleteMail(mail_account)));
|
|
1112
1628
|
server.tool(serverToolName(brand, "get", "mail_forwarding"), "\u30E1\u30FC\u30EB\u8EE2\u9001\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
1113
|
-
mail_account:
|
|
1629
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
1114
1630
|
}, async ({ mail_account }) => callApi(() => client.getMailForwarding(mail_account)));
|
|
1115
1631
|
server.tool(serverToolName(brand, "update", "mail_forwarding"), "\u30E1\u30FC\u30EB\u8EE2\u9001\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
1116
|
-
mail_account:
|
|
1117
|
-
forwarding_addresses:
|
|
1118
|
-
keep_in_mailbox:
|
|
1632
|
+
mail_account: z6.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1633
|
+
forwarding_addresses: z6.array(z6.string()).describe("\u8EE2\u9001\u5148\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306E\u914D\u5217"),
|
|
1634
|
+
keep_in_mailbox: z6.boolean().optional().describe("\u30E1\u30FC\u30EB\u30DC\u30C3\u30AF\u30B9\u306B\u3082\u6B8B\u3059\u304B")
|
|
1119
1635
|
}, async ({ mail_account, ...data }) => callApi(() => client.updateMailForwarding(mail_account, data)));
|
|
1120
1636
|
server.tool(serverToolName(brand, "list", "mail_filter"), "\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1121
|
-
domain:
|
|
1637
|
+
domain: z6.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1122
1638
|
}, async (args) => {
|
|
1123
1639
|
const params = {};
|
|
1124
1640
|
if (args.domain)
|
|
@@ -1126,29 +1642,29 @@ function registerMailTools(server, client, brand) {
|
|
|
1126
1642
|
return callApi(() => client.listMailFilter(params));
|
|
1127
1643
|
});
|
|
1128
1644
|
server.tool(serverToolName(brand, "add", "mail_filter"), "\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0", {
|
|
1129
|
-
domain:
|
|
1130
|
-
conditions:
|
|
1131
|
-
keyword:
|
|
1132
|
-
field:
|
|
1133
|
-
match_type:
|
|
1645
|
+
domain: z6.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1646
|
+
conditions: z6.array(z6.object({
|
|
1647
|
+
keyword: z6.string(),
|
|
1648
|
+
field: z6.string(),
|
|
1649
|
+
match_type: z6.string()
|
|
1134
1650
|
})).describe("\u6761\u4EF6"),
|
|
1135
|
-
action:
|
|
1136
|
-
type:
|
|
1137
|
-
target:
|
|
1138
|
-
method:
|
|
1651
|
+
action: z6.object({
|
|
1652
|
+
type: z6.string(),
|
|
1653
|
+
target: z6.string(),
|
|
1654
|
+
method: z6.string()
|
|
1139
1655
|
}).describe("\u30A2\u30AF\u30B7\u30E7\u30F3")
|
|
1140
1656
|
}, async (args) => callApi(() => client.addMailFilter(args)));
|
|
1141
1657
|
server.tool(serverToolName(brand, "delete", "mail_filter"), "\u30E1\u30FC\u30EB\u632F\u308A\u5206\u3051\u30EB\u30FC\u30EB\u3092\u524A\u9664", {
|
|
1142
|
-
filter_id:
|
|
1658
|
+
filter_id: z6.string().describe("\u30D5\u30A3\u30EB\u30BF\u30FCID")
|
|
1143
1659
|
}, async ({ filter_id }) => callApi(() => client.deleteMailFilter(filter_id)));
|
|
1144
1660
|
}
|
|
1145
1661
|
|
|
1146
1662
|
// ../core/dist/tools/server/auto-reply.js
|
|
1147
|
-
import { z as
|
|
1663
|
+
import { z as z7 } from "zod";
|
|
1148
1664
|
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";
|
|
1149
1665
|
function registerAutoReplyTools(server, client, brand) {
|
|
1150
1666
|
server.tool(serverToolName(brand, "list", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1151
|
-
domain:
|
|
1667
|
+
domain: z7.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1152
1668
|
}, async (args) => {
|
|
1153
1669
|
const params = {};
|
|
1154
1670
|
if (args.domain)
|
|
@@ -1156,22 +1672,22 @@ function registerAutoReplyTools(server, client, brand) {
|
|
|
1156
1672
|
return callApi(() => client.listAutoReply(params));
|
|
1157
1673
|
});
|
|
1158
1674
|
server.tool(serverToolName(brand, "get", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u306E\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
1159
|
-
mail_address:
|
|
1675
|
+
mail_address: z7.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
1160
1676
|
}, async ({ mail_address }) => callApi(() => client.getAutoReply(mail_address)));
|
|
1161
1677
|
server.tool(serverToolName(brand, "add", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
1162
|
-
domain:
|
|
1163
|
-
mail_address:
|
|
1164
|
-
from_name:
|
|
1165
|
-
subject:
|
|
1166
|
-
body:
|
|
1167
|
-
quote_incoming:
|
|
1678
|
+
domain: z7.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1679
|
+
mail_address: z7.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1680
|
+
from_name: z7.string().describe("\u9001\u4FE1\u8005\u540D"),
|
|
1681
|
+
subject: z7.string().describe("\u4EF6\u540D"),
|
|
1682
|
+
body: z7.string().describe("\u672C\u6587"),
|
|
1683
|
+
quote_incoming: z7.boolean().describe("\u53D7\u4FE1\u30E1\u30FC\u30EB\u306E\u5F15\u7528\u3092\u542B\u3081\u308B\u304B")
|
|
1168
1684
|
}, async (args) => callApi(() => client.addAutoReply(args)));
|
|
1169
1685
|
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", {
|
|
1170
|
-
mail_address:
|
|
1171
|
-
from_name:
|
|
1172
|
-
subject:
|
|
1173
|
-
body:
|
|
1174
|
-
quote_incoming:
|
|
1686
|
+
mail_address: z7.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9"),
|
|
1687
|
+
from_name: z7.string().optional().describe("\u9001\u4FE1\u8005\u540D"),
|
|
1688
|
+
subject: z7.string().optional().describe("\u4EF6\u540D"),
|
|
1689
|
+
body: z7.string().optional().describe("\u672C\u6587"),
|
|
1690
|
+
quote_incoming: z7.boolean().optional().describe("\u53D7\u4FE1\u30E1\u30FC\u30EB\u306E\u5F15\u7528\u3092\u542B\u3081\u308B\u304B")
|
|
1175
1691
|
}, async ({ mail_address, from_name, subject, body: body2, quote_incoming }) => {
|
|
1176
1692
|
const data = {};
|
|
1177
1693
|
if (from_name !== void 0)
|
|
@@ -1188,15 +1704,15 @@ function registerAutoReplyTools(server, client, brand) {
|
|
|
1188
1704
|
return callApi(() => client.updateAutoReply(mail_address, data));
|
|
1189
1705
|
});
|
|
1190
1706
|
server.tool(serverToolName(brand, "delete", "auto_reply"), "\u81EA\u52D5\u5FDC\u7B54\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
1191
|
-
mail_address:
|
|
1707
|
+
mail_address: z7.string().describe("\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9")
|
|
1192
1708
|
}, async ({ mail_address }) => callApi(() => client.deleteAutoReply(mail_address)));
|
|
1193
1709
|
}
|
|
1194
1710
|
|
|
1195
1711
|
// ../core/dist/tools/server/smtp-abroad-restriction.js
|
|
1196
|
-
import { z as
|
|
1712
|
+
import { z as z8 } from "zod";
|
|
1197
1713
|
function registerSmtpAbroadRestrictionTools(server, client, brand) {
|
|
1198
1714
|
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", {
|
|
1199
|
-
domain:
|
|
1715
|
+
domain: z8.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1200
1716
|
}, async (args) => {
|
|
1201
1717
|
const params = {};
|
|
1202
1718
|
if (args.domain)
|
|
@@ -1204,16 +1720,16 @@ function registerSmtpAbroadRestrictionTools(server, client, brand) {
|
|
|
1204
1720
|
return callApi(() => client.listSmtpAbroadRestriction(params));
|
|
1205
1721
|
});
|
|
1206
1722
|
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", {
|
|
1207
|
-
domain:
|
|
1208
|
-
abroad_access_restriction:
|
|
1723
|
+
domain: z8.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1724
|
+
abroad_access_restriction: z8.boolean().describe("\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u6709\u52B9/\u7121\u52B9")
|
|
1209
1725
|
}, async ({ domain: domain2, abroad_access_restriction }) => callApi(() => client.updateSmtpAbroadRestriction(domain2, { abroad_access_restriction })));
|
|
1210
1726
|
}
|
|
1211
1727
|
|
|
1212
1728
|
// ../core/dist/tools/server/dkim.js
|
|
1213
|
-
import { z as
|
|
1729
|
+
import { z as z9 } from "zod";
|
|
1214
1730
|
function registerDkimTools(server, client, brand) {
|
|
1215
1731
|
server.tool(serverToolName(brand, "list", "dkim"), "DKIM\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1216
|
-
domain:
|
|
1732
|
+
domain: z9.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1217
1733
|
}, async (args) => {
|
|
1218
1734
|
const params = {};
|
|
1219
1735
|
if (args.domain)
|
|
@@ -1221,20 +1737,20 @@ function registerDkimTools(server, client, brand) {
|
|
|
1221
1737
|
return callApi(() => client.listDkim(params));
|
|
1222
1738
|
});
|
|
1223
1739
|
server.tool(serverToolName(brand, "get", "dkim"), "DKIM\u8A2D\u5B9A\u306E\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
1224
|
-
fqdn:
|
|
1740
|
+
fqdn: z9.string().describe("FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09")
|
|
1225
1741
|
}, async ({ fqdn }) => callApi(() => client.getDkim(fqdn)));
|
|
1226
1742
|
server.tool(serverToolName(brand, "update", "dkim"), "DKIM\u8A2D\u5B9A\u306E\u6709\u52B9/\u7121\u52B9\u3092\u5207\u308A\u66FF\u3048", {
|
|
1227
|
-
fqdn:
|
|
1228
|
-
enabled:
|
|
1743
|
+
fqdn: z9.string().describe("FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09"),
|
|
1744
|
+
enabled: z9.boolean().describe("DKIM\u306E\u6709\u52B9/\u7121\u52B9")
|
|
1229
1745
|
}, async ({ fqdn, enabled }) => callApi(() => client.updateDkim(fqdn, { enabled })));
|
|
1230
1746
|
}
|
|
1231
1747
|
|
|
1232
1748
|
// ../core/dist/tools/server/dmarc.js
|
|
1233
|
-
import { z as
|
|
1749
|
+
import { z as z10 } from "zod";
|
|
1234
1750
|
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";
|
|
1235
1751
|
function registerDmarcTools(server, client, brand) {
|
|
1236
1752
|
server.tool(serverToolName(brand, "list", "dmarc"), "\u9001\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
1237
|
-
domain:
|
|
1753
|
+
domain: z10.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1238
1754
|
}, async (args) => {
|
|
1239
1755
|
const params = {};
|
|
1240
1756
|
if (args.domain)
|
|
@@ -1242,10 +1758,10 @@ function registerDmarcTools(server, client, brand) {
|
|
|
1242
1758
|
return callApi(() => client.listDmarc(params));
|
|
1243
1759
|
});
|
|
1244
1760
|
server.tool(serverToolName(brand, "update", "dmarc"), "\u9001\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09", {
|
|
1245
|
-
domain:
|
|
1246
|
-
policy:
|
|
1247
|
-
report_enabled:
|
|
1248
|
-
notification_mail_addresses:
|
|
1761
|
+
domain: z10.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1762
|
+
policy: z10.enum(["none", "quarantine", "reject"]).optional().describe("DMARC\u30DD\u30EA\u30B7\u30FC"),
|
|
1763
|
+
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"),
|
|
1764
|
+
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")
|
|
1249
1765
|
}, async ({ domain: domain2, policy, report_enabled, notification_mail_addresses }) => {
|
|
1250
1766
|
const data = {};
|
|
1251
1767
|
if (policy !== void 0)
|
|
@@ -1263,11 +1779,11 @@ function registerDmarcTools(server, client, brand) {
|
|
|
1263
1779
|
}
|
|
1264
1780
|
|
|
1265
1781
|
// ../core/dist/tools/server/spf.js
|
|
1266
|
-
import { z as
|
|
1267
|
-
var updateActionSchema =
|
|
1782
|
+
import { z as z11 } from "zod";
|
|
1783
|
+
var updateActionSchema = z11.enum(["reset", "enable_gmail", "custom"]);
|
|
1268
1784
|
function registerSpfTools(server, client, brand) {
|
|
1269
1785
|
server.tool(serverToolName(brand, "list", "spf"), "SPF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1270
|
-
domain:
|
|
1786
|
+
domain: z11.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1271
1787
|
}, async (args) => {
|
|
1272
1788
|
const params = {};
|
|
1273
1789
|
if (args.domain)
|
|
@@ -1275,12 +1791,12 @@ function registerSpfTools(server, client, brand) {
|
|
|
1275
1791
|
return callApi(() => client.listSpf(params));
|
|
1276
1792
|
});
|
|
1277
1793
|
server.tool(serverToolName(brand, "add", "spf"), "SPF\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
1278
|
-
fqdn:
|
|
1794
|
+
fqdn: z11.string().describe("FQDN\uFF08example.com \u307E\u305F\u306F sub.example.com\uFF09")
|
|
1279
1795
|
}, async ({ fqdn }) => callApi(() => client.addSpf({ fqdn })));
|
|
1280
1796
|
server.tool(serverToolName(brand, "update", "spf"), "SPF\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
1281
|
-
fqdn:
|
|
1797
|
+
fqdn: z11.string().describe("FQDN"),
|
|
1282
1798
|
action: updateActionSchema.describe("reset: \u6A19\u6E96SPF\u3078\u521D\u671F\u5316 / enable_gmail: Gmail\u8A31\u53EFON / custom: \u30AB\u30B9\u30BF\u30E0\u8A2D\u5B9A"),
|
|
1283
|
-
spf_record:
|
|
1799
|
+
spf_record: z11.string().optional().describe("\u30AB\u30B9\u30BF\u30E0SPF\u30EC\u30B3\u30FC\u30C9\uFF08action=custom \u306E\u3068\u304D\u5FC5\u9808\uFF09")
|
|
1284
1800
|
}, async ({ fqdn, action, spf_record }) => {
|
|
1285
1801
|
const body2 = { action };
|
|
1286
1802
|
if (action === "custom") {
|
|
@@ -1292,19 +1808,19 @@ function registerSpfTools(server, client, brand) {
|
|
|
1292
1808
|
return callApi(() => client.updateSpf(fqdn, body2));
|
|
1293
1809
|
});
|
|
1294
1810
|
server.tool(serverToolName(brand, "delete", "spf"), "SPF\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
1295
|
-
fqdn:
|
|
1811
|
+
fqdn: z11.string().describe("FQDN")
|
|
1296
1812
|
}, async ({ fqdn }) => callApi(() => client.deleteSpf(fqdn)));
|
|
1297
1813
|
}
|
|
1298
1814
|
|
|
1299
1815
|
// ../core/dist/tools/server/spam-filter.js
|
|
1300
|
-
import { z as
|
|
1301
|
-
var filterTypeSchema =
|
|
1302
|
-
var detectionActionSchema =
|
|
1303
|
-
var spamLevelSchema =
|
|
1816
|
+
import { z as z12 } from "zod";
|
|
1817
|
+
var filterTypeSchema = z12.enum(["off", "standard", "cloudmark_authority"]);
|
|
1818
|
+
var detectionActionSchema = z12.enum(["inbox", "spam", "trash", "delete"]);
|
|
1819
|
+
var spamLevelSchema = z12.enum(["very_lenient", "lenient", "normal", "strict", "very_strict", "strictest"]);
|
|
1304
1820
|
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";
|
|
1305
1821
|
function registerSpamFilterTools(server, client, brand) {
|
|
1306
1822
|
server.tool(serverToolName(brand, "list", "spam_filter"), "\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
1307
|
-
domain:
|
|
1823
|
+
domain: z12.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1308
1824
|
}, async (args) => {
|
|
1309
1825
|
const params = {};
|
|
1310
1826
|
if (args.domain)
|
|
@@ -1312,14 +1828,14 @@ function registerSpamFilterTools(server, client, brand) {
|
|
|
1312
1828
|
return callApi(() => client.listSpamFilter(params));
|
|
1313
1829
|
});
|
|
1314
1830
|
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", {
|
|
1315
|
-
domain:
|
|
1831
|
+
domain: z12.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1316
1832
|
filter_type: filterTypeSchema.optional().describe("\u8FF7\u60D1\u30E1\u30FC\u30EB\u30D5\u30A3\u30EB\u30BF"),
|
|
1317
1833
|
detection_action: detectionActionSchema.optional().describe("\u691C\u77E5\u6642\u306E\u51E6\u7406\uFF08inbox / spam / trash / delete\uFF09"),
|
|
1318
|
-
white_list:
|
|
1319
|
-
black_list:
|
|
1834
|
+
white_list: z12.array(z12.string()).optional().describe("\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u7A7A\u914D\u5217\u3067\u30AF\u30EA\u30A2\uFF09"),
|
|
1835
|
+
black_list: z12.array(z12.string()).optional().describe("\u30D6\u30E9\u30C3\u30AF\u30EA\u30B9\u30C8\uFF08\u7A7A\u914D\u5217\u3067\u30AF\u30EA\u30A2\uFF09"),
|
|
1320
1836
|
spam_level: spamLevelSchema.optional().describe("\u6A19\u6E96\u30B9\u30D1\u30E0\u30D5\u30A3\u30EB\u30BF\u5224\u5B9A\u57FA\u6E96"),
|
|
1321
|
-
strict_non_japanese_subject:
|
|
1322
|
-
strict_html_mail:
|
|
1837
|
+
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"),
|
|
1838
|
+
strict_html_mail: z12.boolean().optional().describe("HTML\u30E1\u30FC\u30EB\u306B\u5BFE\u3057\u3066\u5224\u5B9A\u3092\u53B3\u3057\u304F\u3059\u308B")
|
|
1323
1839
|
}, async (args) => {
|
|
1324
1840
|
const { domain: domain2, ...fields } = args;
|
|
1325
1841
|
const data = {};
|
|
@@ -1344,16 +1860,16 @@ function registerSpamFilterTools(server, client, brand) {
|
|
|
1344
1860
|
return callApi(() => client.updateSpamFilter(domain2, data));
|
|
1345
1861
|
});
|
|
1346
1862
|
server.tool(serverToolName(brand, "update", "spam_filter_dmarc_receiver"), "\u53D7\u4FE1\u5074DMARC\u8A2D\u5B9A\u3092\u66F4\u65B0", {
|
|
1347
|
-
domain:
|
|
1348
|
-
dmarc_receiver:
|
|
1863
|
+
domain: z12.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
1864
|
+
dmarc_receiver: z12.boolean().describe("\u53D7\u4FE1\u5074DMARC\u8A2D\u5B9A")
|
|
1349
1865
|
}, async ({ domain: domain2, dmarc_receiver }) => callApi(() => client.updateSpamFilterDmarcReceiver(domain2, { dmarc_receiver })));
|
|
1350
1866
|
}
|
|
1351
1867
|
|
|
1352
1868
|
// ../core/dist/tools/server/ftp.js
|
|
1353
|
-
import { z as
|
|
1869
|
+
import { z as z13 } from "zod";
|
|
1354
1870
|
function registerFtpTools(server, client, brand) {
|
|
1355
1871
|
server.tool(serverToolName(brand, "list", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1356
|
-
domain:
|
|
1872
|
+
domain: z13.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1357
1873
|
}, async (args) => {
|
|
1358
1874
|
const params = {};
|
|
1359
1875
|
if (args.domain)
|
|
@@ -1361,87 +1877,87 @@ function registerFtpTools(server, client, brand) {
|
|
|
1361
1877
|
return callApi(() => client.listFtp(params));
|
|
1362
1878
|
});
|
|
1363
1879
|
server.tool(serverToolName(brand, "add", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u8FFD\u52A0", {
|
|
1364
|
-
ftp_account:
|
|
1365
|
-
password:
|
|
1366
|
-
directory:
|
|
1367
|
-
quota_mb:
|
|
1368
|
-
memo:
|
|
1880
|
+
ftp_account: z13.string().describe("FTP\u30A2\u30AB\u30A6\u30F3\u30C8\uFF08user@domain \u5F62\u5F0F\uFF09"),
|
|
1881
|
+
password: z13.string().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1882
|
+
directory: z13.string().optional().describe("\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"),
|
|
1883
|
+
quota_mb: z13.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\u30020\u3067\u7121\u5236\u9650\uFF09"),
|
|
1884
|
+
memo: z13.string().optional().describe("\u30E1\u30E2")
|
|
1369
1885
|
}, async (args) => callApi(() => client.addFtp(args)));
|
|
1370
1886
|
server.tool(serverToolName(brand, "update", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u66F4\u65B0", {
|
|
1371
|
-
ftp_account:
|
|
1372
|
-
password:
|
|
1373
|
-
directory:
|
|
1374
|
-
quota_mb:
|
|
1375
|
-
memo:
|
|
1887
|
+
ftp_account: z13.string().describe("FTP\u30A2\u30AB\u30A6\u30F3\u30C8"),
|
|
1888
|
+
password: z13.string().optional().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1889
|
+
directory: z13.string().optional().describe("\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"),
|
|
1890
|
+
quota_mb: z13.number().optional().describe("\u5BB9\u91CF\u5236\u9650\uFF08MB\uFF09"),
|
|
1891
|
+
memo: z13.string().optional().describe("\u30E1\u30E2")
|
|
1376
1892
|
}, async ({ ftp_account, ...data }) => callApi(() => client.updateFtp(ftp_account, data)));
|
|
1377
1893
|
server.tool(serverToolName(brand, "delete", "ftp"), "FTP\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u524A\u9664", {
|
|
1378
|
-
ftp_account:
|
|
1894
|
+
ftp_account: z13.string().describe("FTP\u30A2\u30AB\u30A6\u30F3\u30C8")
|
|
1379
1895
|
}, async ({ ftp_account }) => callApi(() => client.deleteFtp(ftp_account)));
|
|
1380
1896
|
}
|
|
1381
1897
|
|
|
1382
1898
|
// ../core/dist/tools/server/database.js
|
|
1383
|
-
import { z as
|
|
1899
|
+
import { z as z14 } from "zod";
|
|
1384
1900
|
function registerDatabaseTools(server, client, brand) {
|
|
1385
1901
|
server.tool(serverToolName(brand, "list", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listDb()));
|
|
1386
1902
|
server.tool(serverToolName(brand, "add", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210", {
|
|
1387
|
-
name_suffix:
|
|
1388
|
-
memo:
|
|
1903
|
+
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"),
|
|
1904
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
1389
1905
|
}, async (args) => callApi(() => client.addDb(args)));
|
|
1390
1906
|
server.tool(serverToolName(brand, "update", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
1391
|
-
db_name:
|
|
1392
|
-
memo:
|
|
1907
|
+
db_name: z14.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D"),
|
|
1908
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
1393
1909
|
}, async ({ db_name, ...data }) => callApi(() => client.updateDb(db_name, data)));
|
|
1394
1910
|
server.tool(serverToolName(brand, "delete", "db"), "MySQL \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u524A\u9664", {
|
|
1395
|
-
db_name:
|
|
1911
|
+
db_name: z14.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D")
|
|
1396
1912
|
}, async ({ db_name }) => callApi(() => client.deleteDb(db_name)));
|
|
1397
1913
|
server.tool(serverToolName(brand, "list", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listDbUser()));
|
|
1398
1914
|
server.tool(serverToolName(brand, "add", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u3092\u4F5C\u6210", {
|
|
1399
|
-
name_suffix:
|
|
1400
|
-
password:
|
|
1401
|
-
memo:
|
|
1915
|
+
name_suffix: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D\u306E\u30B5\u30D5\u30A3\u30C3\u30AF\u30B9"),
|
|
1916
|
+
password: z14.string().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1917
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
1402
1918
|
}, async (args) => callApi(() => client.addDbUser(args)));
|
|
1403
1919
|
server.tool(serverToolName(brand, "update", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u7B49\u3092\u5909\u66F4", {
|
|
1404
|
-
db_user:
|
|
1405
|
-
password:
|
|
1406
|
-
memo:
|
|
1920
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1921
|
+
password: z14.string().optional().describe("\u30D1\u30B9\u30EF\u30FC\u30C9"),
|
|
1922
|
+
memo: z14.string().optional().describe("\u30E1\u30E2")
|
|
1407
1923
|
}, async ({ db_user, ...data }) => callApi(() => client.updateDbUser(db_user, data)));
|
|
1408
1924
|
server.tool(serverToolName(brand, "delete", "db_user"), "MySQL \u30E6\u30FC\u30B6\u30FC\u3092\u524A\u9664", {
|
|
1409
|
-
db_user:
|
|
1925
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D")
|
|
1410
1926
|
}, async ({ db_user }) => callApi(() => client.deleteDbUser(db_user)));
|
|
1411
1927
|
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", {
|
|
1412
|
-
db_user:
|
|
1928
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D")
|
|
1413
1929
|
}, async ({ db_user }) => callApi(() => client.listDbUserGrant(db_user)));
|
|
1414
1930
|
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", {
|
|
1415
|
-
db_user:
|
|
1416
|
-
db_name:
|
|
1931
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1932
|
+
db_name: z14.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D")
|
|
1417
1933
|
}, async ({ db_user, ...data }) => callApi(() => client.addDbUserGrant(db_user, data)));
|
|
1418
1934
|
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", {
|
|
1419
|
-
db_user:
|
|
1420
|
-
db_name:
|
|
1935
|
+
db_user: z14.string().describe("\u30E6\u30FC\u30B6\u30FC\u540D"),
|
|
1936
|
+
db_name: z14.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D")
|
|
1421
1937
|
}, async ({ db_user, ...data }) => callApi(() => client.deleteDbUserGrant(db_user, data)));
|
|
1422
1938
|
}
|
|
1423
1939
|
|
|
1424
1940
|
// ../core/dist/tools/server/domain.js
|
|
1425
|
-
import { z as
|
|
1941
|
+
import { z as z15 } from "zod";
|
|
1426
1942
|
function registerDomainTools(server, client, brand) {
|
|
1427
1943
|
server.tool(serverToolName(brand, "list", "domain"), "\u30C9\u30E1\u30A4\u30F3\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listDomain()));
|
|
1428
1944
|
server.tool(serverToolName(brand, "get", "domain"), "\u30C9\u30E1\u30A4\u30F3\u306E\u8A73\u7D30\u60C5\u5831\u3092\u53D6\u5F97", {
|
|
1429
|
-
domain:
|
|
1945
|
+
domain: z15.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D")
|
|
1430
1946
|
}, async ({ domain: domain2 }) => callApi(() => client.getDomain(domain2)));
|
|
1431
1947
|
server.tool(serverToolName(brand, "add", "domain"), "\u30C9\u30E1\u30A4\u30F3\u3092\u8FFD\u52A0", {
|
|
1432
|
-
domain:
|
|
1433
|
-
ssl:
|
|
1434
|
-
memo:
|
|
1948
|
+
domain: z15.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D"),
|
|
1949
|
+
ssl: z15.boolean().optional().describe("\u7121\u6599SSL\u8A2D\u5B9A\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8: true\uFF09"),
|
|
1950
|
+
memo: z15.string().optional().describe("\u30E1\u30E2")
|
|
1435
1951
|
}, async (args) => callApi(() => client.addDomain(args)));
|
|
1436
1952
|
server.tool(serverToolName(brand, "update", "domain"), "\u30C9\u30E1\u30A4\u30F3\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
1437
|
-
domain:
|
|
1438
|
-
memo:
|
|
1953
|
+
domain: z15.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D"),
|
|
1954
|
+
memo: z15.string().optional().describe("\u30E1\u30E2")
|
|
1439
1955
|
}, async ({ domain: domain2, ...data }) => callApi(() => client.updateDomain(domain2, data)));
|
|
1440
1956
|
server.tool(serverToolName(brand, "delete", "domain"), "\u30C9\u30E1\u30A4\u30F3\u3092\u524A\u9664", {
|
|
1441
|
-
domain:
|
|
1957
|
+
domain: z15.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D")
|
|
1442
1958
|
}, async ({ domain: domain2 }) => callApi(() => client.deleteDomain(domain2)));
|
|
1443
1959
|
server.tool(serverToolName(brand, "list", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1444
|
-
domain:
|
|
1960
|
+
domain: z15.string().optional().describe("\u89AA\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1445
1961
|
}, async (args) => {
|
|
1446
1962
|
const params = {};
|
|
1447
1963
|
if (args.domain)
|
|
@@ -1449,26 +1965,26 @@ function registerDomainTools(server, client, brand) {
|
|
|
1449
1965
|
return callApi(() => client.listSubdomain(params));
|
|
1450
1966
|
});
|
|
1451
1967
|
server.tool(serverToolName(brand, "add", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u3092\u8FFD\u52A0", {
|
|
1452
|
-
subdomain:
|
|
1453
|
-
document_root_type:
|
|
1454
|
-
ssl:
|
|
1455
|
-
memo:
|
|
1968
|
+
subdomain: z15.string().describe("\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF08\u4F8B: blog.example.com\uFF09"),
|
|
1969
|
+
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"),
|
|
1970
|
+
ssl: z15.boolean().optional().describe("\u7121\u6599SSL\u8A2D\u5B9A\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8: true\uFF09"),
|
|
1971
|
+
memo: z15.string().optional().describe("\u30E1\u30E2")
|
|
1456
1972
|
}, async (args) => callApi(() => client.addSubdomain(args)));
|
|
1457
1973
|
server.tool(serverToolName(brand, "update", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
1458
|
-
subdomain:
|
|
1459
|
-
memo:
|
|
1974
|
+
subdomain: z15.string().describe("\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3"),
|
|
1975
|
+
memo: z15.string().optional().describe("\u30E1\u30E2")
|
|
1460
1976
|
}, async ({ subdomain, ...data }) => callApi(() => client.updateSubdomain(subdomain, data)));
|
|
1461
1977
|
server.tool(serverToolName(brand, "delete", "subdomain"), "\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u3092\u524A\u9664", {
|
|
1462
|
-
subdomain:
|
|
1463
|
-
delete_files:
|
|
1978
|
+
subdomain: z15.string().describe("\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3"),
|
|
1979
|
+
delete_files: z15.boolean().optional().describe("\u95A2\u9023\u30D5\u30A1\u30A4\u30EB\u3082\u524A\u9664\u3059\u308B\u304B")
|
|
1464
1980
|
}, async ({ subdomain, ...data }) => callApi(() => client.deleteSubdomain(subdomain, data)));
|
|
1465
1981
|
}
|
|
1466
1982
|
|
|
1467
1983
|
// ../core/dist/tools/server/ssl-dns.js
|
|
1468
|
-
import { z as
|
|
1984
|
+
import { z as z16 } from "zod";
|
|
1469
1985
|
function registerSslDnsTools(server, client, brand) {
|
|
1470
1986
|
server.tool(serverToolName(brand, "list", "ssl"), "SSL\u8A2D\u5B9A\u306E\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1471
|
-
domain:
|
|
1987
|
+
domain: z16.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1472
1988
|
}, async (args) => {
|
|
1473
1989
|
const params = {};
|
|
1474
1990
|
if (args.domain)
|
|
@@ -1476,13 +1992,13 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
1476
1992
|
return callApi(() => client.listSsl(params));
|
|
1477
1993
|
});
|
|
1478
1994
|
server.tool(serverToolName(brand, "install", "ssl"), "\u7121\u6599SSL\uFF08Let's Encrypt\uFF09\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
1479
|
-
common_name:
|
|
1995
|
+
common_name: z16.string().describe("\u30B3\u30E2\u30F3\u30CD\u30FC\u30E0\uFF08\u30C9\u30E1\u30A4\u30F3\u540D\uFF09")
|
|
1480
1996
|
}, async (args) => callApi(() => client.installSsl(args)));
|
|
1481
1997
|
server.tool(serverToolName(brand, "uninstall", "ssl"), "\u7121\u6599SSL\u3092\u30A2\u30F3\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
1482
|
-
common_name:
|
|
1998
|
+
common_name: z16.string().describe("\u30B3\u30E2\u30F3\u30CD\u30FC\u30E0\uFF08\u30C9\u30E1\u30A4\u30F3\u540D\uFF09")
|
|
1483
1999
|
}, async ({ common_name }) => callApi(() => client.uninstallSsl(common_name)));
|
|
1484
2000
|
server.tool(serverToolName(brand, "list", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1485
|
-
domain:
|
|
2001
|
+
domain: z16.string().optional().describe("\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1486
2002
|
}, async (args) => {
|
|
1487
2003
|
const params = {};
|
|
1488
2004
|
if (args.domain)
|
|
@@ -1490,35 +2006,35 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
1490
2006
|
return callApi(() => client.listDns(params));
|
|
1491
2007
|
});
|
|
1492
2008
|
server.tool(serverToolName(brand, "add", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u3092\u8FFD\u52A0", {
|
|
1493
|
-
domain:
|
|
1494
|
-
host:
|
|
1495
|
-
type:
|
|
1496
|
-
content:
|
|
1497
|
-
ttl:
|
|
1498
|
-
priority:
|
|
2009
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2010
|
+
host: z16.string().describe("\u30DB\u30B9\u30C8\u540D\uFF08@\u3067apex\uFF09"),
|
|
2011
|
+
type: z16.string().describe("\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7\uFF08A / AAAA / CNAME / MX / TXT / SRV / CAA\uFF09"),
|
|
2012
|
+
content: z16.string().describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
2013
|
+
ttl: z16.number().optional().describe("TTL\uFF0860-86400\u3002\u30C7\u30D5\u30A9\u30EB\u30C8: 3600\uFF09"),
|
|
2014
|
+
priority: z16.number().optional().describe("\u512A\u5148\u5EA6\uFF08MX/SRV\u30EC\u30B3\u30FC\u30C9\u7528\uFF09")
|
|
1499
2015
|
}, async (args) => callApi(() => client.addDns(args)));
|
|
1500
2016
|
server.tool(serverToolName(brand, "update", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u3092\u66F4\u65B0", {
|
|
1501
|
-
dns_id:
|
|
1502
|
-
domain:
|
|
1503
|
-
host:
|
|
1504
|
-
type:
|
|
1505
|
-
content:
|
|
1506
|
-
ttl:
|
|
1507
|
-
priority:
|
|
2017
|
+
dns_id: z16.string().describe("DNS\u30EC\u30B3\u30FC\u30C9ID"),
|
|
2018
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2019
|
+
host: z16.string().describe("\u30DB\u30B9\u30C8\u540D"),
|
|
2020
|
+
type: z16.string().describe("\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7"),
|
|
2021
|
+
content: z16.string().describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
2022
|
+
ttl: z16.number().optional().describe("TTL"),
|
|
2023
|
+
priority: z16.number().optional().describe("\u512A\u5148\u5EA6")
|
|
1508
2024
|
}, async ({ dns_id, ...data }) => callApi(() => client.updateDns(dns_id, data)));
|
|
1509
2025
|
server.tool(serverToolName(brand, "delete", "dns"), "DNS\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664", {
|
|
1510
|
-
dns_id:
|
|
1511
|
-
domain:
|
|
2026
|
+
dns_id: z16.string().describe("DNS\u30EC\u30B3\u30FC\u30C9ID"),
|
|
2027
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3")
|
|
1512
2028
|
}, async ({ dns_id, ...data }) => callApi(() => client.deleteDns(dns_id, data)));
|
|
1513
2029
|
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()));
|
|
1514
2030
|
server.tool(serverToolName(brand, "update", "php_version"), "\u30C9\u30E1\u30A4\u30F3\u306EPHP\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5909\u66F4", {
|
|
1515
|
-
domain:
|
|
1516
|
-
version:
|
|
2031
|
+
domain: z16.string().describe("\u30C9\u30E1\u30A4\u30F3\u540D"),
|
|
2032
|
+
version: z16.string().describe("PHP\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u4F8B: 8.3.21\uFF09")
|
|
1517
2033
|
}, async ({ domain: domain2, ...data }) => callApi(() => client.updatePhpVersion(domain2, data)));
|
|
1518
2034
|
server.tool(serverToolName(brand, "get", "access_log"), "\u30A2\u30AF\u30BB\u30B9\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
1519
|
-
domain:
|
|
1520
|
-
lines:
|
|
1521
|
-
keyword:
|
|
2035
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2036
|
+
lines: z16.number().optional().describe("\u53D6\u5F97\u884C\u6570\uFF08\u672B\u5C3E\u304B\u3089\uFF09"),
|
|
2037
|
+
keyword: z16.string().optional().describe("\u7D5E\u308A\u8FBC\u307F\u30AD\u30FC\u30EF\u30FC\u30C9")
|
|
1522
2038
|
}, async (args) => {
|
|
1523
2039
|
const params = {};
|
|
1524
2040
|
if (args.domain)
|
|
@@ -1530,9 +2046,9 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
1530
2046
|
return callApi(() => client.getAccessLog(params));
|
|
1531
2047
|
});
|
|
1532
2048
|
server.tool(serverToolName(brand, "get", "error_log"), "\u30A8\u30E9\u30FC\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
1533
|
-
domain:
|
|
1534
|
-
lines:
|
|
1535
|
-
keyword:
|
|
2049
|
+
domain: z16.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2050
|
+
lines: z16.number().optional().describe("\u53D6\u5F97\u884C\u6570\uFF08\u672B\u5C3E\u304B\u3089\uFF09"),
|
|
2051
|
+
keyword: z16.string().optional().describe("\u7D5E\u308A\u8FBC\u307F\u30AD\u30FC\u30EF\u30FC\u30C9")
|
|
1536
2052
|
}, async (args) => {
|
|
1537
2053
|
const params = {};
|
|
1538
2054
|
if (args.domain)
|
|
@@ -1546,19 +2062,19 @@ function registerSslDnsTools(server, client, brand) {
|
|
|
1546
2062
|
}
|
|
1547
2063
|
|
|
1548
2064
|
// ../core/dist/tools/server/resource-monitor.js
|
|
1549
|
-
import { z as
|
|
2065
|
+
import { z as z17 } from "zod";
|
|
1550
2066
|
function registerResourceMonitorTools(server, client, brand) {
|
|
1551
2067
|
server.tool(serverToolName(brand, "get", "resource_monitor"), "\u6307\u5B9A\u65E5\u306ECPU\u30FB\u30E1\u30E2\u30EA\u30FB\u8EE2\u9001\u91CF\u6642\u7CFB\u5217\u3092\u53D6\u5F97", {
|
|
1552
|
-
date:
|
|
2068
|
+
date: z17.string().describe("\u5BFE\u8C61\u65E5\uFF08Y-m-d \u307E\u305F\u306F Ymd\u3002\u5F53\u65E5\u542B\u3080\u76F4\u8FD11\u304B\u6708\uFF09")
|
|
1553
2069
|
}, async ({ date }) => callApi(() => client.getResourceMonitor(date)));
|
|
1554
2070
|
}
|
|
1555
2071
|
|
|
1556
2072
|
// ../core/dist/tools/server/waf.js
|
|
1557
|
-
import { z as
|
|
2073
|
+
import { z as z18 } from "zod";
|
|
1558
2074
|
var PARTIAL_UPDATE_EMPTY_MESSAGE4 = "\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";
|
|
1559
2075
|
function registerWafTools(server, client, brand) {
|
|
1560
2076
|
server.tool(serverToolName(brand, "list", "waf"), "WAF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1561
|
-
domain:
|
|
2077
|
+
domain: z18.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1562
2078
|
}, async (args) => {
|
|
1563
2079
|
const params = {};
|
|
1564
2080
|
if (args.domain)
|
|
@@ -1566,13 +2082,13 @@ function registerWafTools(server, client, brand) {
|
|
|
1566
2082
|
return callApi(() => client.listWaf(params));
|
|
1567
2083
|
});
|
|
1568
2084
|
server.tool(serverToolName(brand, "update", "waf"), "WAF\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09", {
|
|
1569
|
-
domain:
|
|
1570
|
-
xss_protection:
|
|
1571
|
-
sql_injection_protection:
|
|
1572
|
-
file_protection:
|
|
1573
|
-
mail_protection:
|
|
1574
|
-
command_protection:
|
|
1575
|
-
php_protection:
|
|
2085
|
+
domain: z18.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2086
|
+
xss_protection: z18.boolean().optional().describe("XSS\u5BFE\u7B56"),
|
|
2087
|
+
sql_injection_protection: z18.boolean().optional().describe("SQL\u5BFE\u7B56"),
|
|
2088
|
+
file_protection: z18.boolean().optional().describe("\u30D5\u30A1\u30A4\u30EB\u5BFE\u7B56"),
|
|
2089
|
+
mail_protection: z18.boolean().optional().describe("\u30E1\u30FC\u30EB\u5BFE\u7B56"),
|
|
2090
|
+
command_protection: z18.boolean().optional().describe("\u30B3\u30DE\u30F3\u30C9\u5BFE\u7B56"),
|
|
2091
|
+
php_protection: z18.boolean().optional().describe("PHP\u5BFE\u7B56")
|
|
1576
2092
|
}, async (args) => {
|
|
1577
2093
|
const { domain: domain2, ...fields } = args;
|
|
1578
2094
|
const data = {};
|
|
@@ -1596,39 +2112,39 @@ function registerWafTools(server, client, brand) {
|
|
|
1596
2112
|
}
|
|
1597
2113
|
|
|
1598
2114
|
// ../core/dist/tools/server/php-ini.js
|
|
1599
|
-
import { z as
|
|
2115
|
+
import { z as z19 } from "zod";
|
|
1600
2116
|
var PARTIAL_UPDATE_EMPTY_MESSAGE5 = "\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";
|
|
1601
2117
|
var phpIniUpdateSchema = {
|
|
1602
|
-
domain:
|
|
1603
|
-
display_errors:
|
|
1604
|
-
error_reporting:
|
|
1605
|
-
display_startup_errors:
|
|
1606
|
-
"session.auto_start":
|
|
1607
|
-
"session.name":
|
|
1608
|
-
"session.use_cookies":
|
|
1609
|
-
"session.use_only_cookies":
|
|
1610
|
-
"session.use_trans_sid":
|
|
1611
|
-
"session.cookie_lifetime":
|
|
1612
|
-
"session.cookie_path":
|
|
1613
|
-
"session.cookie_domain":
|
|
1614
|
-
"mbstring.language":
|
|
1615
|
-
"mbstring.internal_encoding":
|
|
1616
|
-
"mbstring.http_input":
|
|
1617
|
-
"mbstring.http_output":
|
|
1618
|
-
"mbstring.encoding_translation":
|
|
1619
|
-
"mbstring.detect_order":
|
|
1620
|
-
"mbstring.substitute_character":
|
|
1621
|
-
max_execution_time:
|
|
1622
|
-
max_input_time:
|
|
1623
|
-
memory_limit:
|
|
1624
|
-
post_max_size:
|
|
1625
|
-
upload_max_filesize:
|
|
1626
|
-
register_globals:
|
|
1627
|
-
magic_quotes_gpc:
|
|
1628
|
-
safe_mode:
|
|
1629
|
-
file_uploads:
|
|
1630
|
-
allow_url_fopen:
|
|
1631
|
-
allow_url_include:
|
|
2118
|
+
domain: z19.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2119
|
+
display_errors: z19.string().optional().describe("\u30A8\u30E9\u30FC\u5185\u5BB9\u3092\u753B\u9762\u306B\u51FA\u529B\uFF08On / Off\uFF09"),
|
|
2120
|
+
error_reporting: z19.string().optional().describe("\u30A8\u30E9\u30FC\u51FA\u529B\u30EC\u30D9\u30EB"),
|
|
2121
|
+
display_startup_errors: z19.string().optional().describe("\u8D77\u52D5\u6642\u30A8\u30E9\u30FC\u3092\u8868\u793A\uFF08On / Off\uFF09"),
|
|
2122
|
+
"session.auto_start": z19.string().optional().describe("\u30BB\u30C3\u30B7\u30E7\u30F3\u81EA\u52D5\u958B\u59CB\uFF080 / 1\uFF09"),
|
|
2123
|
+
"session.name": z19.string().optional().describe("\u30BB\u30C3\u30B7\u30E7\u30F3\u540D"),
|
|
2124
|
+
"session.use_cookies": z19.string().optional().describe("\u30BB\u30C3\u30B7\u30E7\u30F3ID\u306B\u30AF\u30C3\u30AD\u30FC\u3092\u4F7F\u7528\uFF080 / 1\uFF09"),
|
|
2125
|
+
"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"),
|
|
2126
|
+
"session.use_trans_sid": z19.string().optional().describe("URL\u3078\u30BB\u30C3\u30B7\u30E7\u30F3ID\u3092\u81EA\u52D5\u8A2D\u5B9A\uFF080 / 1\uFF09"),
|
|
2127
|
+
"session.cookie_lifetime": z19.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u6709\u52B9\u671F\u9593\uFF08\u79D2\uFF09"),
|
|
2128
|
+
"session.cookie_path": z19.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30D1\u30B9"),
|
|
2129
|
+
"session.cookie_domain": z19.string().optional().describe("\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30C9\u30E1\u30A4\u30F3"),
|
|
2130
|
+
"mbstring.language": z19.string().optional().describe("\u30C7\u30D5\u30A9\u30EB\u30C8\u8A00\u8A9E"),
|
|
2131
|
+
"mbstring.internal_encoding": z19.string().optional().describe("\u5185\u90E8\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0"),
|
|
2132
|
+
"mbstring.http_input": z19.string().optional().describe("HTTP\u5165\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB"),
|
|
2133
|
+
"mbstring.http_output": z19.string().optional().describe("HTTP\u51FA\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB"),
|
|
2134
|
+
"mbstring.encoding_translation": z19.string().optional().describe("\u5185\u90E8\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3078\u306E\u5909\u63DB\uFF08On / Off\uFF09"),
|
|
2135
|
+
"mbstring.detect_order": z19.string().optional().describe("\u6587\u5B57\u30B3\u30FC\u30C9\u691C\u51FA"),
|
|
2136
|
+
"mbstring.substitute_character": z19.string().optional().describe("\u7121\u52B9\u6587\u5B57\u306E\u4EE3\u66FF\u6587\u5B57"),
|
|
2137
|
+
max_execution_time: z19.string().optional().describe("\u6700\u5927\u5B9F\u884C\u6642\u9593\uFF08\u79D2\uFF09"),
|
|
2138
|
+
max_input_time: z19.string().optional().describe("\u5165\u529B\u30D1\u30FC\u30B9\u6700\u5927\u6642\u9593\uFF08\u79D2\uFF09"),
|
|
2139
|
+
memory_limit: z19.string().optional().describe("\u6700\u5927\u30E1\u30E2\u30EA"),
|
|
2140
|
+
post_max_size: z19.string().optional().describe("POST\u30C7\u30FC\u30BF\u6700\u5927\u30B5\u30A4\u30BA"),
|
|
2141
|
+
upload_max_filesize: z19.string().optional().describe("\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u30D5\u30A1\u30A4\u30EB\u6700\u5927\u30B5\u30A4\u30BA"),
|
|
2142
|
+
register_globals: z19.string().optional().describe("register_globals\uFF08On / Off\uFF09"),
|
|
2143
|
+
magic_quotes_gpc: z19.string().optional().describe("magic_quotes_gpc\uFF08On / Off\uFF09"),
|
|
2144
|
+
safe_mode: z19.string().optional().describe("safe_mode\uFF08On / Off\uFF09"),
|
|
2145
|
+
file_uploads: z19.string().optional().describe("HTTP\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\uFF08On / Off\uFF09"),
|
|
2146
|
+
allow_url_fopen: z19.string().optional().describe("allow_url_fopen\uFF08On / Off\uFF09"),
|
|
2147
|
+
allow_url_include: z19.string().optional().describe("allow_url_include\uFF08On / Off\uFF09")
|
|
1632
2148
|
};
|
|
1633
2149
|
var PHP_INI_API_KEYS = [
|
|
1634
2150
|
"display_errors",
|
|
@@ -1663,7 +2179,7 @@ var PHP_INI_API_KEYS = [
|
|
|
1663
2179
|
];
|
|
1664
2180
|
function registerPhpIniTools(server, client, brand) {
|
|
1665
2181
|
server.tool(serverToolName(brand, "list", "php_ini"), "php.ini\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
1666
|
-
domain:
|
|
2182
|
+
domain: z19.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1667
2183
|
}, async (args) => {
|
|
1668
2184
|
const params = {};
|
|
1669
2185
|
if (args.domain)
|
|
@@ -1684,18 +2200,18 @@ function registerPhpIniTools(server, client, brand) {
|
|
|
1684
2200
|
return callApi(() => client.updatePhpIni(domain2, data));
|
|
1685
2201
|
});
|
|
1686
2202
|
server.tool(serverToolName(brand, "reset", "php_ini"), "php.ini\u8A2D\u5B9A\u3092\u521D\u671F\u5024\u306B\u623B\u3059", {
|
|
1687
|
-
domain:
|
|
2203
|
+
domain: z19.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3")
|
|
1688
2204
|
}, async ({ domain: domain2 }) => callApi(() => client.resetPhpIni(domain2)));
|
|
1689
2205
|
}
|
|
1690
2206
|
|
|
1691
2207
|
// ../core/dist/tools/server/wordpress-security.js
|
|
1692
|
-
import { z as
|
|
1693
|
-
var enabledTargetSchema =
|
|
1694
|
-
enabled:
|
|
2208
|
+
import { z as z20 } from "zod";
|
|
2209
|
+
var enabledTargetSchema = z20.object({
|
|
2210
|
+
enabled: z20.boolean()
|
|
1695
2211
|
});
|
|
1696
|
-
var foreignIpTargetSchema =
|
|
1697
|
-
enabled:
|
|
1698
|
-
allowed_ip_addresses:
|
|
2212
|
+
var foreignIpTargetSchema = z20.object({
|
|
2213
|
+
enabled: z20.boolean().optional(),
|
|
2214
|
+
allowed_ip_addresses: z20.array(z20.string()).optional()
|
|
1699
2215
|
});
|
|
1700
2216
|
var UPDATE_BLOCKS = [
|
|
1701
2217
|
"comment_restriction",
|
|
@@ -1704,23 +2220,23 @@ var UPDATE_BLOCKS = [
|
|
|
1704
2220
|
"ip_restriction"
|
|
1705
2221
|
];
|
|
1706
2222
|
var wordpressSecurityUpdateSchema = {
|
|
1707
|
-
domain:
|
|
1708
|
-
comment_restriction:
|
|
2223
|
+
domain: z20.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2224
|
+
comment_restriction: z20.object({
|
|
1709
2225
|
bulk_post: enabledTargetSchema.optional(),
|
|
1710
2226
|
foreign_post: enabledTargetSchema.optional()
|
|
1711
2227
|
}).optional().describe("\u30B3\u30E1\u30F3\u30C8\u5236\u9650"),
|
|
1712
|
-
login_attempt_limit:
|
|
1713
|
-
enabled:
|
|
2228
|
+
login_attempt_limit: z20.object({
|
|
2229
|
+
enabled: z20.boolean()
|
|
1714
2230
|
}).optional().describe("\u30ED\u30B0\u30A4\u30F3\u8A66\u884C\u56DE\u6570\u5236\u9650"),
|
|
1715
|
-
foreign_ip_restriction:
|
|
2231
|
+
foreign_ip_restriction: z20.object({
|
|
1716
2232
|
dashboard: foreignIpTargetSchema.optional(),
|
|
1717
2233
|
xml_rpc_api: foreignIpTargetSchema.optional(),
|
|
1718
2234
|
rest_api: foreignIpTargetSchema.optional(),
|
|
1719
2235
|
wlwmanifest: foreignIpTargetSchema.optional()
|
|
1720
2236
|
}).optional().describe("\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650"),
|
|
1721
|
-
ip_restriction:
|
|
1722
|
-
enabled:
|
|
1723
|
-
allowed_ip_addresses:
|
|
2237
|
+
ip_restriction: z20.object({
|
|
2238
|
+
enabled: z20.boolean().optional(),
|
|
2239
|
+
allowed_ip_addresses: z20.array(z20.string()).optional()
|
|
1724
2240
|
}).optional().describe("IP\u30A2\u30C9\u30EC\u30B9\u5236\u9650\uFF08\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\uFF09")
|
|
1725
2241
|
};
|
|
1726
2242
|
function buildUpdateBody(args) {
|
|
@@ -1740,7 +2256,7 @@ function buildUpdateBody(args) {
|
|
|
1740
2256
|
}
|
|
1741
2257
|
function registerWordPressSecurityTools(server, client, brand) {
|
|
1742
2258
|
server.tool(serverToolName(brand, "get", "wordpress_security"), "WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u53D6\u5F97", {
|
|
1743
|
-
domain:
|
|
2259
|
+
domain: z20.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1744
2260
|
}, async (args) => {
|
|
1745
2261
|
const params = {};
|
|
1746
2262
|
if (args.domain)
|
|
@@ -1751,10 +2267,10 @@ function registerWordPressSecurityTools(server, client, brand) {
|
|
|
1751
2267
|
}
|
|
1752
2268
|
|
|
1753
2269
|
// ../core/dist/tools/server/x-accelerator.js
|
|
1754
|
-
import { z as
|
|
2270
|
+
import { z as z21 } from "zod";
|
|
1755
2271
|
function registerXAcceleratorTools(server, client, brand) {
|
|
1756
2272
|
server.tool(serverToolName(brand, "list", "x_accelerator"), "X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1757
|
-
domain:
|
|
2273
|
+
domain: z21.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1758
2274
|
}, async (args) => {
|
|
1759
2275
|
const params = {};
|
|
1760
2276
|
if (args.domain)
|
|
@@ -1762,16 +2278,16 @@ function registerXAcceleratorTools(server, client, brand) {
|
|
|
1762
2278
|
return callApi(() => client.listXAccelerator(params));
|
|
1763
2279
|
});
|
|
1764
2280
|
server.tool(serverToolName(brand, "update", "x_accelerator"), "X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
1765
|
-
domain:
|
|
1766
|
-
xaccelerator_status:
|
|
2281
|
+
domain: z21.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2282
|
+
xaccelerator_status: z21.enum(["off", "v1", "v2"]).describe("X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\uFF08off / v1 / v2\uFF09")
|
|
1767
2283
|
}, async ({ domain: domain2, xaccelerator_status }) => callApi(() => client.updateXAccelerator(domain2, { xaccelerator_status })));
|
|
1768
2284
|
}
|
|
1769
2285
|
|
|
1770
2286
|
// ../core/dist/tools/server/server-cache.js
|
|
1771
|
-
import { z as
|
|
2287
|
+
import { z as z22 } from "zod";
|
|
1772
2288
|
function registerServerCacheTools(server, client, brand) {
|
|
1773
2289
|
server.tool(serverToolName(brand, "list", "server_cache"), "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1774
|
-
domain:
|
|
2290
|
+
domain: z22.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1775
2291
|
}, async (args) => {
|
|
1776
2292
|
const params = {};
|
|
1777
2293
|
if (args.domain)
|
|
@@ -1779,19 +2295,19 @@ function registerServerCacheTools(server, client, brand) {
|
|
|
1779
2295
|
return callApi(() => client.listServerCache(params));
|
|
1780
2296
|
});
|
|
1781
2297
|
server.tool(serverToolName(brand, "update", "server_cache"), "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
1782
|
-
domain:
|
|
1783
|
-
server_cache_status:
|
|
2298
|
+
domain: z22.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2299
|
+
server_cache_status: z22.enum(["on", "off"]).describe("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\uFF08on / off\uFF09")
|
|
1784
2300
|
}, async ({ domain: domain2, server_cache_status }) => callApi(() => client.updateServerCache(domain2, { server_cache_status })));
|
|
1785
2301
|
server.tool(serverToolName(brand, "clear_cache", "server_cache"), "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u306E\u5185\u5BB9\u3092\u524A\u9664\uFF08\u30D1\u30FC\u30B8\uFF09", {
|
|
1786
|
-
domain:
|
|
2302
|
+
domain: z22.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3")
|
|
1787
2303
|
}, async ({ domain: domain2 }) => callApi(() => client.clearServerCache(domain2)));
|
|
1788
2304
|
}
|
|
1789
2305
|
|
|
1790
2306
|
// ../core/dist/tools/server/browser-cache.js
|
|
1791
|
-
import { z as
|
|
2307
|
+
import { z as z23 } from "zod";
|
|
1792
2308
|
function registerBrowserCacheTools(server, client, brand) {
|
|
1793
2309
|
server.tool(serverToolName(brand, "list", "browser_cache"), "\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1794
|
-
domain:
|
|
2310
|
+
domain: z23.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1795
2311
|
}, async (args) => {
|
|
1796
2312
|
const params = {};
|
|
1797
2313
|
if (args.domain)
|
|
@@ -1799,16 +2315,16 @@ function registerBrowserCacheTools(server, client, brand) {
|
|
|
1799
2315
|
return callApi(() => client.listBrowserCache(params));
|
|
1800
2316
|
});
|
|
1801
2317
|
server.tool(serverToolName(brand, "update", "browser_cache"), "\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
1802
|
-
domain:
|
|
1803
|
-
browser_cache_status:
|
|
2318
|
+
domain: z23.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2319
|
+
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")
|
|
1804
2320
|
}, async ({ domain: domain2, browser_cache_status }) => callApi(() => client.updateBrowserCache(domain2, { browser_cache_status })));
|
|
1805
2321
|
}
|
|
1806
2322
|
|
|
1807
2323
|
// ../core/dist/tools/server/url-redirect.js
|
|
1808
|
-
import { z as
|
|
2324
|
+
import { z as z24 } from "zod";
|
|
1809
2325
|
function registerUrlRedirectTools(server, client, brand) {
|
|
1810
2326
|
server.tool(serverToolName(brand, "list", "url_redirect"), "\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1811
|
-
domain:
|
|
2327
|
+
domain: z24.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1812
2328
|
}, async (args) => {
|
|
1813
2329
|
const params = {};
|
|
1814
2330
|
if (args.domain)
|
|
@@ -1816,11 +2332,11 @@ function registerUrlRedirectTools(server, client, brand) {
|
|
|
1816
2332
|
return callApi(() => client.listUrlRedirect(params));
|
|
1817
2333
|
});
|
|
1818
2334
|
server.tool(serverToolName(brand, "add", "url_redirect"), "\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
1819
|
-
domain:
|
|
1820
|
-
from_host:
|
|
1821
|
-
from_path:
|
|
1822
|
-
redirect_to_url:
|
|
1823
|
-
status_code:
|
|
2335
|
+
domain: z24.string().describe("\u5951\u7D04\u30C9\u30E1\u30A4\u30F3"),
|
|
2336
|
+
from_host: z24.string().describe("\u8EE2\u9001\u5143\u30DB\u30B9\u30C8\uFF08FQDN\uFF09"),
|
|
2337
|
+
from_path: z24.string().optional().describe("\u8EE2\u9001\u5143\u30D1\u30B9\uFF08\u7701\u7565\u6642\u306F /\uFF09"),
|
|
2338
|
+
redirect_to_url: z24.string().describe("\u8EE2\u9001\u5148URL\uFF08http \u307E\u305F\u306F https\uFF09"),
|
|
2339
|
+
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")
|
|
1824
2340
|
}, async (args) => {
|
|
1825
2341
|
const data = {
|
|
1826
2342
|
domain: args.domain,
|
|
@@ -1833,15 +2349,15 @@ function registerUrlRedirectTools(server, client, brand) {
|
|
|
1833
2349
|
return callApi(() => client.addUrlRedirect(data));
|
|
1834
2350
|
});
|
|
1835
2351
|
server.tool(serverToolName(brand, "delete", "url_redirect"), "\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
1836
|
-
redirect_id:
|
|
2352
|
+
redirect_id: z24.string().describe("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u306EID")
|
|
1837
2353
|
}, async ({ redirect_id }) => callApi(() => client.deleteUrlRedirect(redirect_id)));
|
|
1838
2354
|
}
|
|
1839
2355
|
|
|
1840
2356
|
// ../core/dist/tools/server/access-deny.js
|
|
1841
|
-
import { z as
|
|
2357
|
+
import { z as z25 } from "zod";
|
|
1842
2358
|
function registerAccessDenyTools(server, client, brand) {
|
|
1843
2359
|
server.tool(serverToolName(brand, "list", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1844
|
-
domain:
|
|
2360
|
+
domain: z25.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1845
2361
|
}, async (args) => {
|
|
1846
2362
|
const params = {};
|
|
1847
2363
|
if (args.domain)
|
|
@@ -1849,9 +2365,9 @@ function registerAccessDenyTools(server, client, brand) {
|
|
|
1849
2365
|
return callApi(() => client.listAccessDeny(params));
|
|
1850
2366
|
});
|
|
1851
2367
|
server.tool(serverToolName(brand, "add", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u8FFD\u52A0", {
|
|
1852
|
-
domain:
|
|
1853
|
-
ip_address:
|
|
1854
|
-
memo:
|
|
2368
|
+
domain: z25.string().describe("\u5951\u7D04\u30C9\u30E1\u30A4\u30F3"),
|
|
2369
|
+
ip_address: z25.string().describe("\u62D2\u5426IP\u30A2\u30C9\u30EC\u30B9\u30FB\u30DB\u30B9\u30C8\uFF08IPv4 / CIDR / \u90E8\u5206IP / \u30DB\u30B9\u30C8\u540D\uFF09"),
|
|
2370
|
+
memo: z25.string().optional().describe("\u30E1\u30E2\uFF08\u6700\u5927500\u6587\u5B57\uFF09")
|
|
1855
2371
|
}, async (args) => {
|
|
1856
2372
|
const data = {
|
|
1857
2373
|
domain: args.domain,
|
|
@@ -1862,16 +2378,16 @@ function registerAccessDenyTools(server, client, brand) {
|
|
|
1862
2378
|
return callApi(() => client.addAccessDeny(data));
|
|
1863
2379
|
});
|
|
1864
2380
|
server.tool(serverToolName(brand, "update", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306E\u30E1\u30E2\u3092\u66F4\u65B0", {
|
|
1865
|
-
deny_id:
|
|
1866
|
-
memo:
|
|
1867
|
-
}, async ({ deny_id, memo }) => callApi(() => client.updateAccessDeny(deny_id, { memo })));
|
|
2381
|
+
deny_id: z25.string().describe("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306EID"),
|
|
2382
|
+
memo: z25.string().describe("\u30E1\u30E2\uFF08\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09")
|
|
2383
|
+
}, async ({ deny_id, memo: memo3 }) => callApi(() => client.updateAccessDeny(deny_id, { memo: memo3 })));
|
|
1868
2384
|
server.tool(serverToolName(brand, "delete", "access_deny"), "\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u524A\u9664", {
|
|
1869
|
-
deny_id:
|
|
2385
|
+
deny_id: z25.string().describe("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306EID")
|
|
1870
2386
|
}, async ({ deny_id }) => callApi(() => client.deleteAccessDeny(deny_id)));
|
|
1871
2387
|
}
|
|
1872
2388
|
|
|
1873
2389
|
// ../core/dist/tools/server/xpagespeed.js
|
|
1874
|
-
import { z as
|
|
2390
|
+
import { z as z26 } from "zod";
|
|
1875
2391
|
var XPAGESPEED_KEYS = [
|
|
1876
2392
|
"xoptimize_images",
|
|
1877
2393
|
"lazyload_images",
|
|
@@ -1881,13 +2397,13 @@ var XPAGESPEED_KEYS = [
|
|
|
1881
2397
|
"lazyload_javascript"
|
|
1882
2398
|
];
|
|
1883
2399
|
var xPageSpeedUpdateSchema = {
|
|
1884
|
-
domain:
|
|
1885
|
-
xoptimize_images:
|
|
1886
|
-
lazyload_images:
|
|
1887
|
-
xoptimize_css:
|
|
1888
|
-
lazyload_css:
|
|
1889
|
-
xoptimize_javascript:
|
|
1890
|
-
lazyload_javascript:
|
|
2400
|
+
domain: z26.string().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3"),
|
|
2401
|
+
xoptimize_images: z26.boolean().optional().describe("\u753B\u50CF\u6700\u9069\u5316\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2402
|
+
lazyload_images: z26.boolean().optional().describe("\u753B\u50CF\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2403
|
+
xoptimize_css: z26.boolean().optional().describe("CSS\u6700\u9069\u5316\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2404
|
+
lazyload_css: z26.boolean().optional().describe("CSS\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2405
|
+
xoptimize_javascript: z26.boolean().optional().describe("JavaScript\u6700\u9069\u5316\u306E\u6709\u52B9/\u7121\u52B9"),
|
|
2406
|
+
lazyload_javascript: z26.boolean().optional().describe("JavaScript\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\u306E\u6709\u52B9/\u7121\u52B9")
|
|
1891
2407
|
};
|
|
1892
2408
|
function buildUpdateBody2(args) {
|
|
1893
2409
|
const { domain: domain2, ...fields } = args;
|
|
@@ -1909,7 +2425,7 @@ function buildUpdateBody2(args) {
|
|
|
1909
2425
|
}
|
|
1910
2426
|
function registerXPageSpeedTools(server, client, brand) {
|
|
1911
2427
|
server.tool(serverToolName(brand, "list", "xpagespeed"), "XPageSpeed\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", {
|
|
1912
|
-
domain:
|
|
2428
|
+
domain: z26.string().optional().describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F")
|
|
1913
2429
|
}, async (args) => {
|
|
1914
2430
|
const params = {};
|
|
1915
2431
|
if (args.domain)
|
|
@@ -1924,22 +2440,22 @@ function registerXPageSpeedTools(server, client, brand) {
|
|
|
1924
2440
|
}
|
|
1925
2441
|
|
|
1926
2442
|
// ../core/dist/tools/server/auto-backup.js
|
|
1927
|
-
import { z as
|
|
1928
|
-
var domainElementSchema =
|
|
1929
|
-
domain:
|
|
1930
|
-
elements:
|
|
2443
|
+
import { z as z27 } from "zod";
|
|
2444
|
+
var domainElementSchema = z27.object({
|
|
2445
|
+
domain: z27.string().describe("\u5951\u7D04\u30C9\u30E1\u30A4\u30F3"),
|
|
2446
|
+
elements: z27.array(z27.enum(["web", "setting", "mail"])).min(1).describe("\u5BFE\u8C61\u7A2E\u5225\uFF08web / setting / mail\uFF09")
|
|
1931
2447
|
});
|
|
1932
2448
|
function registerAutoBackupTools(server, client, brand) {
|
|
1933
2449
|
server.tool(serverToolName(brand, "list", "auto_backup_backup_dates"), "\u9078\u629E\u53EF\u80FD\u306A\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listAutoBackupBackupDates()));
|
|
1934
2450
|
server.tool(serverToolName(brand, "list", "auto_backup"), "\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listAutoBackup()));
|
|
1935
2451
|
server.tool(serverToolName(brand, "get", "auto_backup"), "\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u306E\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
1936
|
-
request_id:
|
|
2452
|
+
request_id: z27.string().describe("\u7533\u8FBCID\uFF08\u6B63\u306E\u6574\u6570\uFF09")
|
|
1937
2453
|
}, async ({ request_id }) => callApi(() => client.getAutoBackup(request_id)));
|
|
1938
2454
|
server.tool(serverToolName(brand, "create", "auto_backup"), "\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u307E\u305F\u306F\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u3080", {
|
|
1939
|
-
backup_date:
|
|
1940
|
-
operation_type:
|
|
1941
|
-
scope:
|
|
1942
|
-
domain_elements:
|
|
2455
|
+
backup_date: z27.string().describe("\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09"),
|
|
2456
|
+
operation_type: z27.enum(["fetch", "restore"]).describe("\u51E6\u7406\u7A2E\u5225\uFF08fetch: \u30C7\u30FC\u30BF\u53D6\u5F97 / restore: \u5FA9\u5143\uFF09"),
|
|
2457
|
+
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"),
|
|
2458
|
+
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")
|
|
1943
2459
|
}, async (args) => {
|
|
1944
2460
|
const data = {
|
|
1945
2461
|
backup_date: args.backup_date,
|
|
@@ -1954,177 +2470,94 @@ function registerAutoBackupTools(server, client, brand) {
|
|
|
1954
2470
|
}
|
|
1955
2471
|
|
|
1956
2472
|
// ../core/dist/tools/server/mysql-backup.js
|
|
1957
|
-
import { z as
|
|
2473
|
+
import { z as z28 } from "zod";
|
|
1958
2474
|
function registerMysqlBackupTools(server, client, brand) {
|
|
1959
2475
|
server.tool(serverToolName(brand, "list", "mysql_backup_databases"), "MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u72B6\u614B\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listMysqlBackupDatabases()));
|
|
1960
2476
|
server.tool(serverToolName(brand, "list", "mysql_backup"), "MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u4E00\u89A7\u3092\u53D6\u5F97", {}, async () => callApi(() => client.listMysqlBackup()));
|
|
1961
2477
|
server.tool(serverToolName(brand, "get", "mysql_backup"), "MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u8A73\u7D30\u3092\u53D6\u5F97", {
|
|
1962
|
-
request_id:
|
|
2478
|
+
request_id: z28.string().describe("\u7533\u8FBC\u8B58\u5225\u5B50\uFF0832\u6587\u5B57\u306E\u5C0F\u6587\u5B5716\u9032\u6570\uFF09")
|
|
1963
2479
|
}, async ({ request_id }) => callApi(() => client.getMysqlBackup(request_id)));
|
|
1964
2480
|
server.tool(serverToolName(brand, "create", "mysql_backup"), "MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u307E\u305F\u306F\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u3080", {
|
|
1965
|
-
db_name:
|
|
1966
|
-
backup_date:
|
|
1967
|
-
operation_type:
|
|
2481
|
+
db_name: z28.string().describe("\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D"),
|
|
2482
|
+
backup_date: z28.string().describe("\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09"),
|
|
2483
|
+
operation_type: z28.enum(["fetch", "restore"]).describe("\u51E6\u7406\u7A2E\u5225\uFF08fetch: \u30C7\u30FC\u30BF\u53D6\u5F97 / restore: \u5FA9\u5143\uFF09")
|
|
1968
2484
|
}, async (args) => callApi(() => client.createMysqlBackup(args)));
|
|
1969
2485
|
}
|
|
1970
2486
|
|
|
1971
2487
|
// ../core/dist/tools/domain/index.js
|
|
1972
|
-
import { z as
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
confirm_purchase: {
|
|
1999
|
-
type: "boolean",
|
|
2000
|
-
title: "\u8AB2\u91D1\u3092\u627F\u8A8D\u3059\u308B",
|
|
2001
|
-
description: `${input.domain} / ${input.totalPrice}\u5186 / ${input.operation}`
|
|
2002
|
-
}
|
|
2003
|
-
};
|
|
2004
|
-
const required = ["confirm_purchase"];
|
|
2005
|
-
if (input.requireTermsAgreement) {
|
|
2006
|
-
properties.agree_to_terms = {
|
|
2007
|
-
type: "boolean",
|
|
2008
|
-
title: "\u300C\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04\u300D\u300C\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066\u300D\u306B\u540C\u610F\u3059\u308B",
|
|
2009
|
-
description: "\u30C9\u30E1\u30A4\u30F3\u53D6\u5F97\u30FB\u79FB\u7BA1\u306E\u300C\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04\u300D\u304A\u3088\u3073\u300C\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066\u300D\u306B\u540C\u610F\u3057\u307E\u3059"
|
|
2010
|
-
};
|
|
2011
|
-
required.push("agree_to_terms");
|
|
2012
|
-
}
|
|
2013
|
-
let result;
|
|
2014
|
-
try {
|
|
2015
|
-
result = await server.server.elicitInput({
|
|
2016
|
-
mode: "form",
|
|
2017
|
-
message,
|
|
2018
|
-
requestedSchema: {
|
|
2019
|
-
type: "object",
|
|
2020
|
-
properties,
|
|
2021
|
-
required
|
|
2022
|
-
}
|
|
2023
|
-
});
|
|
2024
|
-
} catch (error) {
|
|
2025
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
2026
|
-
throw new Error(`\u8AB2\u91D1\u78BA\u8A8D\uFF08elicitation\uFF09\u306B\u5931\u6557\u3057\u305F\u305F\u3081\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F: ${detail}`);
|
|
2027
|
-
}
|
|
2028
|
-
if (result.action === "decline" || result.action === "cancel") {
|
|
2029
|
-
throw new Error("BILLING_CONFIRMATION_DECLINED: \u5229\u7528\u8005\u304C\u8AB2\u91D1\u78BA\u8A8D\u3092\u62D2\u5426\u307E\u305F\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u305F\u305F\u3081\u3001\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
2030
|
-
}
|
|
2031
|
-
if (result.action !== "accept" || result.content == null || typeof result.content !== "object") {
|
|
2032
|
-
throw new Error("BILLING_CONFIRMATION_INVALID: \u8AB2\u91D1\u78BA\u8A8D\u306E\u5FDC\u7B54\u304C\u4E0D\u6B63\u306A\u305F\u3081\u3001\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
2033
|
-
}
|
|
2034
|
-
const content = result.content;
|
|
2035
|
-
if (content.confirm_purchase !== true) {
|
|
2036
|
-
throw new Error("BILLING_CONFIRMATION_NOT_APPROVED: \u8AB2\u91D1\u627F\u8A8D\u304C\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
2037
|
-
}
|
|
2038
|
-
if (input.requireTermsAgreement && content.agree_to_terms !== true) {
|
|
2039
|
-
throw new Error("BILLING_TERMS_NOT_APPROVED: \u300C\u30B5\u30FC\u30D3\u30B9\u5229\u7528\u898F\u7D04\u300D\u304A\u3088\u3073\u300C\u500B\u4EBA\u60C5\u5831\u306E\u53D6\u308A\u6271\u3044\u306B\u3064\u3044\u3066\u300D\u3078\u306E\u540C\u610F\u304C\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u5B9F\u7533\u8ACB\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002");
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
var billingPreviewAnnotations = {
|
|
2043
|
-
readOnlyHint: true,
|
|
2044
|
-
destructiveHint: false,
|
|
2045
|
-
idempotentHint: true,
|
|
2046
|
-
openWorldHint: true
|
|
2047
|
-
};
|
|
2048
|
-
var billingExecuteAnnotations = {
|
|
2049
|
-
readOnlyHint: false,
|
|
2050
|
-
destructiveHint: true,
|
|
2051
|
-
idempotentHint: true,
|
|
2052
|
-
openWorldHint: true
|
|
2053
|
-
};
|
|
2054
|
-
|
|
2055
|
-
// ../core/dist/tools/domain/index.js
|
|
2056
|
-
var domainName = z28.string().min(1).max(255).describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u540D\uFF08\u56FD\u969B\u5316\u30C9\u30E1\u30A4\u30F3\u306FPunycode\uFF09");
|
|
2057
|
-
var dnsId = z28.string().regex(/^[1-9]\d*$/).describe("DNS\u30EC\u30B3\u30FC\u30C9ID\uFF08dns_id\u3001\u6B63\u306E\u6574\u6570\uFF09");
|
|
2058
|
-
var dnsType = z28.enum(["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV"]).describe("DNS\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7");
|
|
2059
|
-
var ttl = z28.number().int().min(60).max(86400).describe("TTL\uFF0860\uFF5E86400\u79D2\uFF09");
|
|
2060
|
-
var priority = z28.number().int().min(0).max(999).describe("\u512A\u5148\u5EA6\uFF080\uFF5E999\uFF09");
|
|
2061
|
-
var expectedTotalPrice = z28.number().int().nonnegative().describe("preview\u3068\u4E00\u81F4\u3059\u308B\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D");
|
|
2062
|
-
var idempotencyKey = z28.string().regex(/^[A-Za-z0-9_-]{8,64}$/).describe("Idempotency-Key\uFF08\u82F1\u6570\u5B57\u30FB_\u30FB-\u30018\uFF5E64\u6587\u5B57\uFF09\u3002\u5374\u4E0B\u3055\u308C\u305F\u7533\u8ACB\u306E\u518D\u9001\u306F\u540C\u3058\u5024\u3092\u4F7F\u3046\u3002\u30B5\u30FC\u30D0\u30FC\u30A8\u30E9\u30FC\u3084\u5FDC\u7B54\u4E0D\u660E\u3067\u7D42\u308F\u3063\u305F\u5834\u5408\u306F\u3001\u540C\u3058\u5024\u306E\u518D\u9001\u304C48\u6642\u9593409 DUPLICATE_REQUEST\u306B\u306A\u308B\u305F\u3081\u3001\u30C9\u30E1\u30A4\u30F3\u8A73\u7D30\u3068\u8ACB\u6C42\u5C65\u6B74\u3067\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3001\u672A\u5B9F\u884C\u306E\u3068\u304D\u3060\u3051\u65B0\u3057\u3044\u5024\u3092\u4F7F\u3046\u3002");
|
|
2063
|
-
var years = z28.number().int().min(1).max(5).describe("\u5951\u7D04\u5E74\u6570\uFF081\uFF5E5\u5E74\uFF09");
|
|
2064
|
-
var currentExpiryDate = z28.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("\u73FE\u5728\u306E\u6709\u52B9\u671F\u9650\uFF08YYYY-MM-DD\u3001\u4E8C\u91CD\u66F4\u65B0\u9632\u6B62\u7528\uFF09");
|
|
2065
|
-
var nameserverHostname = (maximumLength) => z28.string().min(1).max(maximumLength).regex(/^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$/);
|
|
2066
|
-
var nameservers = (minimum, maximum, maximumLength) => z28.array(nameserverHostname(maximumLength)).min(minimum).max(maximum).refine((values) => new Set(values.map((value) => value.toLowerCase())).size === values.length, "\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\u3092\u91CD\u8907\u3057\u3066\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093");
|
|
2067
|
-
var whoisFields = z28.object({
|
|
2068
|
-
organization_name: z28.string().optional(),
|
|
2069
|
-
first_name: z28.string().optional(),
|
|
2070
|
-
last_name: z28.string().optional(),
|
|
2071
|
-
postal_code: z28.string().optional(),
|
|
2072
|
-
state_province: z28.string().optional(),
|
|
2073
|
-
city: z28.string().optional(),
|
|
2074
|
-
address1: z28.string().optional(),
|
|
2075
|
-
address2: z28.string().optional(),
|
|
2076
|
-
email: z28.string().email().optional(),
|
|
2077
|
-
phone: z28.string().optional(),
|
|
2078
|
-
fax: z28.string().optional(),
|
|
2079
|
-
country: z28.string().optional(),
|
|
2080
|
-
role: z28.string().optional()
|
|
2488
|
+
import { z as z29 } from "zod";
|
|
2489
|
+
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");
|
|
2490
|
+
var dnsId = z29.string().regex(/^[1-9]\d*$/).describe("DNS\u30EC\u30B3\u30FC\u30C9ID\uFF08dns_id\u3001\u6B63\u306E\u6574\u6570\uFF09");
|
|
2491
|
+
var dnsType = z29.enum(["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV"]).describe("DNS\u30EC\u30B3\u30FC\u30C9\u30BF\u30A4\u30D7");
|
|
2492
|
+
var ttl = z29.number().int().min(60).max(86400).describe("TTL\uFF0860\uFF5E86400\u79D2\uFF09");
|
|
2493
|
+
var priority = z29.number().int().min(0).max(999).describe("\u512A\u5148\u5EA6\uFF080\uFF5E999\uFF09");
|
|
2494
|
+
var expectedTotalPrice2 = z29.number().int().nonnegative().describe("preview\u3068\u4E00\u81F4\u3059\u308B\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D");
|
|
2495
|
+
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");
|
|
2496
|
+
var years = z29.number().int().min(1).max(5).describe("\u5951\u7D04\u5E74\u6570\uFF081\uFF5E5\u5E74\uFF09");
|
|
2497
|
+
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");
|
|
2498
|
+
var nameserverHostname = (maximumLength) => z29.string().min(1).max(maximumLength).regex(/^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$/);
|
|
2499
|
+
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");
|
|
2500
|
+
var whoisFields = z29.object({
|
|
2501
|
+
organization_name: z29.string().optional(),
|
|
2502
|
+
first_name: z29.string().optional(),
|
|
2503
|
+
last_name: z29.string().optional(),
|
|
2504
|
+
postal_code: z29.string().optional(),
|
|
2505
|
+
state_province: z29.string().optional(),
|
|
2506
|
+
city: z29.string().optional(),
|
|
2507
|
+
address1: z29.string().optional(),
|
|
2508
|
+
address2: z29.string().optional(),
|
|
2509
|
+
email: z29.string().email().optional(),
|
|
2510
|
+
phone: z29.string().optional(),
|
|
2511
|
+
fax: z29.string().optional(),
|
|
2512
|
+
country: z29.string().optional(),
|
|
2513
|
+
role: z29.string().optional()
|
|
2081
2514
|
}).strict().describe("Whois\u767B\u9332\u8005\u60C5\u5831\u3002\u4EE3\u7406\u516C\u958BOFF\u6642\u306F\u516813\u30AD\u30FC\u304C\u5FC5\u8981");
|
|
2082
2515
|
var registrationInput = {
|
|
2083
2516
|
domain: domainName,
|
|
2084
2517
|
years: years.optional().default(1),
|
|
2085
|
-
expected_total_price:
|
|
2086
|
-
agree_to_terms:
|
|
2518
|
+
expected_total_price: expectedTotalPrice2,
|
|
2519
|
+
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"),
|
|
2087
2520
|
nameservers: nameservers(1, 6, 255).optional().describe("\u53D6\u5F97\u6642\u306B\u8A2D\u5B9A\u3059\u308B\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\uFF081\uFF5E6\u4EF6\uFF09")
|
|
2088
2521
|
};
|
|
2089
2522
|
var transferInput = {
|
|
2090
2523
|
domain: domainName,
|
|
2091
|
-
auth_code:
|
|
2092
|
-
expected_total_price:
|
|
2093
|
-
agree_to_terms:
|
|
2524
|
+
auth_code: z29.string().min(1).max(255).describe("\u79FB\u7BA1\u5143\u3067\u53D6\u5F97\u3057\u305FAuthCode"),
|
|
2525
|
+
expected_total_price: expectedTotalPrice2,
|
|
2526
|
+
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")
|
|
2094
2527
|
};
|
|
2095
2528
|
var renewInput = {
|
|
2096
2529
|
domain: domainName,
|
|
2097
2530
|
years,
|
|
2098
2531
|
current_expiry_date: currentExpiryDate,
|
|
2099
|
-
expected_total_price:
|
|
2532
|
+
expected_total_price: expectedTotalPrice2
|
|
2100
2533
|
};
|
|
2101
|
-
function
|
|
2534
|
+
function description2(text) {
|
|
2102
2535
|
return `${text}\u3002\u30C9\u30E1\u30A4\u30F3\u30EC\u30B8\u30B9\u30C8\u30E9\u3067\u4FDD\u6709\u30FB\u7BA1\u7406\u3059\u308B\u30C9\u30E1\u30A4\u30F3\u304C\u5BFE\u8C61\u3067\u3042\u308A\u3001\u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FC\u306EServer API\u3067\u306F\u3042\u308A\u307E\u305B\u3093`;
|
|
2103
2536
|
}
|
|
2104
2537
|
function registerDomainServiceTools(server, client, brand, options = {}) {
|
|
2105
|
-
server.tool(domainToolName(brand, "get", "api_key_info"),
|
|
2106
|
-
server.tool(domainToolName(brand, "list", "domains"),
|
|
2107
|
-
server.tool(domainToolName(brand, "get", "domain"),
|
|
2108
|
-
server.tool(domainToolName(brand, "get", "nameservers"),
|
|
2109
|
-
server.tool(domainToolName(brand, "update", "nameservers"),
|
|
2538
|
+
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()));
|
|
2539
|
+
server.tool(domainToolName(brand, "list", "domains"), description2("\u4FDD\u6709\u30C9\u30E1\u30A4\u30F3\u306E\u4E00\u89A7\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.listDomains()));
|
|
2540
|
+
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)));
|
|
2541
|
+
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)));
|
|
2542
|
+
server.tool(domainToolName(brand, "update", "nameservers"), description2("\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\u30921\uFF5E13\u4EF6\u3067\u5168\u7F6E\u63DB"), {
|
|
2110
2543
|
domain: domainName,
|
|
2111
2544
|
nameservers: nameservers(1, 13, 253).describe("\u7F6E\u63DB\u5F8C\u306E\u30CD\u30FC\u30E0\u30B5\u30FC\u30D0\u30FC\uFF081\uFF5E13\u4EF6\uFF09")
|
|
2112
2545
|
}, async ({ domain: domain2, nameservers: nameservers2 }) => callApi(() => client.updateDomainNameservers(domain2, { nameservers: nameservers2 })));
|
|
2113
|
-
server.tool(domainToolName(brand, "list", "dns"),
|
|
2114
|
-
server.tool(domainToolName(brand, "add", "dns"),
|
|
2546
|
+
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)));
|
|
2547
|
+
server.tool(domainToolName(brand, "add", "dns"), description2("\u30EC\u30B8\u30B9\u30C8\u30E9\u5074DNS\u30EC\u30B3\u30FC\u30C9\u3092\u8FFD\u52A0"), {
|
|
2115
2548
|
domain: domainName,
|
|
2116
2549
|
type: dnsType,
|
|
2117
|
-
host:
|
|
2118
|
-
content:
|
|
2550
|
+
host: z29.string().max(64).describe("\u30DB\u30B9\u30C8\u540D\uFF08apex\u306F@\uFF09"),
|
|
2551
|
+
content: z29.string().max(1024).describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
2119
2552
|
ttl: ttl.optional().default(3600),
|
|
2120
2553
|
priority: priority.optional()
|
|
2121
2554
|
}, async ({ domain: domain2, ...data }) => callApi(() => client.addDomainDns(domain2, data)));
|
|
2122
|
-
server.tool(domainToolName(brand, "update", "dns"),
|
|
2555
|
+
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"), {
|
|
2123
2556
|
domain: domainName,
|
|
2124
2557
|
dns_id: dnsId,
|
|
2125
2558
|
type: dnsType.optional(),
|
|
2126
|
-
host:
|
|
2127
|
-
content:
|
|
2559
|
+
host: z29.string().max(64).optional().describe("\u30DB\u30B9\u30C8\u540D\uFF08apex\u306F@\uFF09"),
|
|
2560
|
+
content: z29.string().max(1024).optional().describe("\u30EC\u30B3\u30FC\u30C9\u5024"),
|
|
2128
2561
|
ttl: ttl.optional(),
|
|
2129
2562
|
priority: priority.optional()
|
|
2130
2563
|
}, async ({ domain: domain2, dns_id, ...data }) => callApi(async () => {
|
|
@@ -2133,19 +2566,19 @@ function registerDomainServiceTools(server, client, brand, options = {}) {
|
|
|
2133
2566
|
}
|
|
2134
2567
|
return client.updateDomainDns(domain2, dns_id, data);
|
|
2135
2568
|
}));
|
|
2136
|
-
server.tool(domainToolName(brand, "delete", "dns"),
|
|
2569
|
+
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"), {
|
|
2137
2570
|
domain: domainName,
|
|
2138
2571
|
dns_id: dnsId,
|
|
2139
|
-
confirmed:
|
|
2572
|
+
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")
|
|
2140
2573
|
}, async ({ domain: domain2, dns_id, confirmed: confirmed2 }) => callApi(async () => {
|
|
2141
2574
|
if (!confirmed2)
|
|
2142
2575
|
throw new Error("confirmed=true is required.");
|
|
2143
2576
|
return client.deleteDomainDns(domain2, dns_id);
|
|
2144
2577
|
}));
|
|
2145
|
-
server.tool(domainToolName(brand, "get", "whois"),
|
|
2146
|
-
server.tool(domainToolName(brand, "update", "whois"),
|
|
2578
|
+
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)));
|
|
2579
|
+
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"), {
|
|
2147
2580
|
domain: domainName,
|
|
2148
|
-
whois_privacy:
|
|
2581
|
+
whois_privacy: z29.boolean().optional().describe("Whois\u4EE3\u7406\u516C\u958B\u3092\u6709\u52B9\u306B\u3059\u308B\u304B"),
|
|
2149
2582
|
fields: whoisFields.optional()
|
|
2150
2583
|
}, async ({ domain: domain2, whois_privacy, fields }) => callApi(async () => {
|
|
2151
2584
|
if (whois_privacy === void 0 && fields === void 0) {
|
|
@@ -2158,16 +2591,16 @@ function registerDomainServiceTools(server, client, brand, options = {}) {
|
|
|
2158
2591
|
data.fields = fields;
|
|
2159
2592
|
return client.updateDomainWhois(domain2, data);
|
|
2160
2593
|
}));
|
|
2161
|
-
server.tool(domainToolName(brand, "get", "registrar_lock"),
|
|
2162
|
-
server.tool(domainToolName(brand, "update", "registrar_lock"),
|
|
2594
|
+
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)));
|
|
2595
|
+
server.tool(domainToolName(brand, "update", "registrar_lock"), description2("\u30EC\u30B8\u30B9\u30C8\u30E9\u30ED\u30C3\u30AF\u3092\u8A2D\u5B9A\u307E\u305F\u306F\u89E3\u9664"), {
|
|
2163
2596
|
domain: domainName,
|
|
2164
|
-
locked:
|
|
2597
|
+
locked: z29.boolean().describe("true\u3067\u30ED\u30C3\u30AF\u3001false\u3067\u89E3\u9664")
|
|
2165
2598
|
}, async ({ domain: domain2, locked }) => callApi(() => client.updateDomainRegistrarLock(domain2, { locked })));
|
|
2166
|
-
server.tool(domainToolName(brand, "check", "domain"),
|
|
2167
|
-
server.tool(domainToolName(brand, "get", "pricing"),
|
|
2168
|
-
tld:
|
|
2599
|
+
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))));
|
|
2600
|
+
server.tool(domainToolName(brand, "get", "pricing"), description2("TLD\u5225\u306E\u7A0E\u8FBC\u4FA1\u683C\u4E00\u89A7\u3092\u53D6\u5F97"), {
|
|
2601
|
+
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")
|
|
2169
2602
|
}, async ({ tld }) => callApi(() => withDomainAcquisitionPermissionDiagnosis(client, () => client.getDomainPricing(tld ? { tld } : void 0))));
|
|
2170
|
-
server.tool(domainToolName(brand, "preview", "registration"),
|
|
2603
|
+
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({
|
|
2171
2604
|
domain_name: domain2,
|
|
2172
2605
|
years: years2,
|
|
2173
2606
|
expected_total_price,
|
|
@@ -2176,9 +2609,9 @@ function registerDomainServiceTools(server, client, brand, options = {}) {
|
|
|
2176
2609
|
...nameservers2 ? { nameservers: nameservers2 } : {}
|
|
2177
2610
|
}))));
|
|
2178
2611
|
if (options.enableHighRiskExecute) {
|
|
2179
|
-
server.tool(domainToolName(brand, "execute", "registration"),
|
|
2612
|
+
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"), {
|
|
2180
2613
|
...registrationInput,
|
|
2181
|
-
idempotency_key:
|
|
2614
|
+
idempotency_key: idempotencyKey2
|
|
2182
2615
|
}, billingExecuteAnnotations, async ({ domain: domain2, years: years2, expected_total_price, nameservers: nameservers2, idempotency_key }) => callApi(async () => {
|
|
2183
2616
|
const data = {
|
|
2184
2617
|
domain_name: domain2,
|
|
@@ -2206,16 +2639,16 @@ function registerDomainServiceTools(server, client, brand, options = {}) {
|
|
|
2206
2639
|
return withDomainAcquisitionPermissionDiagnosis(client, () => client.registerDomain(data, idempotency_key));
|
|
2207
2640
|
}));
|
|
2208
2641
|
}
|
|
2209
|
-
server.tool(domainToolName(brand, "preview", "transfer"),
|
|
2642
|
+
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, {
|
|
2210
2643
|
auth_code,
|
|
2211
2644
|
expected_total_price,
|
|
2212
2645
|
agree_to_terms: true,
|
|
2213
2646
|
dry_run: true
|
|
2214
2647
|
}))));
|
|
2215
2648
|
if (options.enableHighRiskExecute) {
|
|
2216
|
-
server.tool(domainToolName(brand, "execute", "transfer"),
|
|
2649
|
+
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"), {
|
|
2217
2650
|
...transferInput,
|
|
2218
|
-
idempotency_key:
|
|
2651
|
+
idempotency_key: idempotencyKey2
|
|
2219
2652
|
}, billingExecuteAnnotations, async ({ domain: domain2, auth_code, expected_total_price, idempotency_key }) => callApi(async () => {
|
|
2220
2653
|
const data = { auth_code, expected_total_price, agree_to_terms: true };
|
|
2221
2654
|
const preview = await withDomainAcquisitionPermissionDiagnosis(client, () => client.transferDomain(domain2, { ...data, dry_run: true }));
|
|
@@ -2236,16 +2669,16 @@ function registerDomainServiceTools(server, client, brand, options = {}) {
|
|
|
2236
2669
|
return withDomainAcquisitionPermissionDiagnosis(client, () => client.transferDomain(domain2, data, idempotency_key));
|
|
2237
2670
|
}));
|
|
2238
2671
|
}
|
|
2239
|
-
server.tool(domainToolName(brand, "preview", "renew"),
|
|
2672
|
+
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, {
|
|
2240
2673
|
years: years2,
|
|
2241
2674
|
current_expiry_date,
|
|
2242
2675
|
expected_total_price,
|
|
2243
2676
|
dry_run: true
|
|
2244
2677
|
}))));
|
|
2245
2678
|
if (options.enableHighRiskExecute) {
|
|
2246
|
-
server.tool(domainToolName(brand, "execute", "renew"),
|
|
2679
|
+
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"), {
|
|
2247
2680
|
...renewInput,
|
|
2248
|
-
idempotency_key:
|
|
2681
|
+
idempotency_key: idempotencyKey2
|
|
2249
2682
|
}, billingExecuteAnnotations, async ({ domain: domain2, years: years2, current_expiry_date, expected_total_price, idempotency_key }) => callApi(async () => {
|
|
2250
2683
|
const data = { years: years2, current_expiry_date, expected_total_price };
|
|
2251
2684
|
const preview = await withDomainAcquisitionPermissionDiagnosis(client, () => client.renewDomain(domain2, { ...data, dry_run: true }));
|
|
@@ -2269,38 +2702,46 @@ function registerDomainServiceTools(server, client, brand, options = {}) {
|
|
|
2269
2702
|
}
|
|
2270
2703
|
|
|
2271
2704
|
// ../core/dist/tools/wphosting/index.js
|
|
2272
|
-
import { z as
|
|
2273
|
-
var contractId =
|
|
2274
|
-
var
|
|
2275
|
-
var domain =
|
|
2276
|
-
var positiveId = (label) =>
|
|
2277
|
-
var opaqueId = (label) =>
|
|
2278
|
-
var slug = (label) =>
|
|
2279
|
-
var
|
|
2280
|
-
var
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2705
|
+
import { z as z30 } from "zod";
|
|
2706
|
+
var contractId = z30.string().regex(/^WP-[A-Za-z0-9]+$/).max(64).describe("XServer for WordPress\u306E\u5951\u7D04ID\uFF08contract_id\uFF09");
|
|
2707
|
+
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");
|
|
2708
|
+
var domain = z30.string().min(1).max(255).describe("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u540D");
|
|
2709
|
+
var positiveId = (label) => z30.string().regex(/^[1-9]\d*$/).describe(label);
|
|
2710
|
+
var opaqueId = (label) => z30.string().regex(/^[A-Za-z0-9_-]+$/).max(255).describe(label);
|
|
2711
|
+
var slug = (label) => z30.string().min(1).max(255).describe(label);
|
|
2712
|
+
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");
|
|
2713
|
+
var signupInput2 = {
|
|
2714
|
+
plan_id: z30.string().min(1).max(64).describe("\u30D7\u30E9\u30F3ID"),
|
|
2715
|
+
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"),
|
|
2716
|
+
expected_total_price: z30.number().int().nonnegative().describe("preview\u3068\u4E00\u81F4\u3059\u308B\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D"),
|
|
2717
|
+
agree_to_terms: z30.literal(true).describe("WPhosting\u5951\u7D04\u306E\u5229\u7528\u898F\u7D04\u3078\u306E\u660E\u793A\u540C\u610F"),
|
|
2718
|
+
partner_code: z30.string().regex(/^[A-Za-z0-9]{1,50}$/).optional().describe("\u30D1\u30FC\u30C8\u30CA\u30FC\u30B3\u30FC\u30C9"),
|
|
2719
|
+
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")
|
|
2720
|
+
};
|
|
2721
|
+
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");
|
|
2722
|
+
var dnsType2 = z30.enum(["A", "AAAA", "CNAME", "MX", "TXT", "SRV"]);
|
|
2723
|
+
var dnsTtl = z30.number().int().min(60).max(86400);
|
|
2724
|
+
var dnsPriority = z30.number().int().min(0).max(65535);
|
|
2725
|
+
var site = { contract_id: contractId, servername: servername2 };
|
|
2285
2726
|
var cronFields = {
|
|
2286
|
-
minute:
|
|
2287
|
-
hour:
|
|
2288
|
-
day:
|
|
2289
|
-
month:
|
|
2290
|
-
weekday:
|
|
2291
|
-
command:
|
|
2292
|
-
comment:
|
|
2727
|
+
minute: z30.string().min(1).max(64),
|
|
2728
|
+
hour: z30.string().min(1).max(64),
|
|
2729
|
+
day: z30.string().min(1).max(64),
|
|
2730
|
+
month: z30.string().min(1).max(64),
|
|
2731
|
+
weekday: z30.string().min(1).max(64),
|
|
2732
|
+
command: z30.string().min(1).max(5e3),
|
|
2733
|
+
comment: z30.string().max(255).optional()
|
|
2293
2734
|
};
|
|
2294
2735
|
var wpUserOptionalFields = {
|
|
2295
|
-
user_email:
|
|
2296
|
-
user_pass:
|
|
2297
|
-
role:
|
|
2298
|
-
display_name:
|
|
2299
|
-
first_name:
|
|
2300
|
-
last_name:
|
|
2301
|
-
user_url:
|
|
2736
|
+
user_email: z30.string().email().max(100).optional(),
|
|
2737
|
+
user_pass: z30.string().min(7).max(64).optional(),
|
|
2738
|
+
role: z30.string().min(1).max(64).optional(),
|
|
2739
|
+
display_name: z30.string().max(255).optional(),
|
|
2740
|
+
first_name: z30.string().max(255).optional(),
|
|
2741
|
+
last_name: z30.string().max(255).optional(),
|
|
2742
|
+
user_url: z30.string().url().max(255).optional()
|
|
2302
2743
|
};
|
|
2303
|
-
function
|
|
2744
|
+
function description3(text) {
|
|
2304
2745
|
return `${text}\u3002XServer for WordPress\u5951\u7D04\u304C\u5BFE\u8C61\u3067\u3059\u3002\u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FCServer API\u306EWordPress\u30FBDNS\u30FBCron\u30FBSSH\u64CD\u4F5C\u3067\u306F\u3042\u308A\u307E\u305B\u3093`;
|
|
2305
2746
|
}
|
|
2306
2747
|
function body(args, excluded) {
|
|
@@ -2310,7 +2751,7 @@ function requireUpdate(data, message = "\u66F4\u65B0\u9805\u76EE\u30921\u3064\u4
|
|
|
2310
2751
|
if (Object.keys(data).length === 0)
|
|
2311
2752
|
throw new Error(message);
|
|
2312
2753
|
}
|
|
2313
|
-
function registerWphostingTools(server, client, brand) {
|
|
2754
|
+
function registerWphostingTools(server, client, brand, options = {}) {
|
|
2314
2755
|
if (brand.brand !== "xserver") {
|
|
2315
2756
|
throw new Error(`--services=wphosting is not supported for brand "${brand.brand}"; use XServer.`);
|
|
2316
2757
|
}
|
|
@@ -2321,27 +2762,77 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2321
2762
|
throw new Error(`ApiClient.${method} is not available.`);
|
|
2322
2763
|
return fn.apply(client, args);
|
|
2323
2764
|
};
|
|
2324
|
-
const register = (verb, resource, text, schema, method, toArgs) => tools.tool(wphostingToolName(brand, verb, resource),
|
|
2765
|
+
const register = (verb, resource, text, schema, method, toArgs) => tools.tool(wphostingToolName(brand, verb, resource), description3(text), schema, async (args) => callApi(() => invoke(method, toArgs(args))));
|
|
2766
|
+
server.tool(wphostingToolName(brand, "list", "plans"), description3("\u7533\u8FBC\u53EF\u80FD\u306AWPhosting\u30D7\u30E9\u30F3\u3092\u53D6\u5F97"), {
|
|
2767
|
+
plan_id: z30.string().min(1).max(64).optional().describe("\u7D5E\u308A\u8FBC\u3080\u30D7\u30E9\u30F3ID")
|
|
2768
|
+
}, async ({ plan_id }) => callApi(() => client.listWphostingPlans(plan_id ? { plan_id } : void 0)));
|
|
2769
|
+
server.tool(wphostingToolName(brand, "list", "contracts"), description3("WPhosting\u5951\u7D04\u4E00\u89A7\u3092\u53D6\u5F97"), {}, async () => callApi(() => client.listWphostingContracts()));
|
|
2770
|
+
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)));
|
|
2771
|
+
server.tool(wphostingToolName(brand, "update", "memo"), description3("WPhosting\u5951\u7D04\u30E1\u30E2\u3092\u66F4\u65B0"), {
|
|
2772
|
+
contract_id: contractId,
|
|
2773
|
+
memo: z30.string().max(500).describe("\u5951\u7D04\u30E1\u30E2\uFF08\u7A7A\u6587\u5B57\u53EF\u3001500\u6587\u5B57\u4EE5\u5185\uFF09")
|
|
2774
|
+
}, async ({ contract_id, memo: memo3 }) => callApi(() => client.updateWphostingMemo(contract_id, { memo: memo3 })));
|
|
2775
|
+
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({
|
|
2776
|
+
...input,
|
|
2777
|
+
auto_renew: auto_renew === "enabled",
|
|
2778
|
+
agree_to_terms: true,
|
|
2779
|
+
dry_run: true
|
|
2780
|
+
}), signupLegalNoticeLines(brand, "wphosting"))));
|
|
2781
|
+
if (options.enableHighRiskExecute) {
|
|
2782
|
+
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 () => {
|
|
2783
|
+
const data = {
|
|
2784
|
+
...input,
|
|
2785
|
+
auto_renew: input.auto_renew === "enabled",
|
|
2786
|
+
agree_to_terms: true
|
|
2787
|
+
};
|
|
2788
|
+
const preview = await client.registerWphosting({
|
|
2789
|
+
...data,
|
|
2790
|
+
dry_run: true
|
|
2791
|
+
});
|
|
2792
|
+
const totalPrice = Number(preview.total_price);
|
|
2793
|
+
if (!Number.isFinite(totalPrice)) {
|
|
2794
|
+
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");
|
|
2795
|
+
}
|
|
2796
|
+
if (totalPrice !== input.expected_total_price) {
|
|
2797
|
+
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`);
|
|
2798
|
+
}
|
|
2799
|
+
assertBillingFormElicitationSupported(server);
|
|
2800
|
+
const planName = await resolvePlanName(() => client.listWphostingPlans({ plan_id: input.plan_id }), input.plan_id);
|
|
2801
|
+
await confirmBillingOperation(server, {
|
|
2802
|
+
operation: signupOperationName(brand, "wphosting"),
|
|
2803
|
+
target: `${planLabel(input.plan_id, planName)} / \u5951\u7D04\u671F\u9593 ${input.period}\u304B\u6708`,
|
|
2804
|
+
targetLabel: "\u7533\u8FBC\u5185\u5BB9",
|
|
2805
|
+
details: compactDetails([
|
|
2806
|
+
autoRenewDetail(input.auto_renew === "enabled"),
|
|
2807
|
+
partnerCodeDetail(input.partner_code)
|
|
2808
|
+
]),
|
|
2809
|
+
legalNoticeLines: signupLegalNoticeLines(brand, "wphosting"),
|
|
2810
|
+
totalPrice,
|
|
2811
|
+
requireTermsAgreement: true
|
|
2812
|
+
});
|
|
2813
|
+
return client.registerWphosting({ ...data, dry_run: false }, idempotency_key);
|
|
2814
|
+
}));
|
|
2815
|
+
}
|
|
2325
2816
|
register("get", "api_key_info", "API\u30AD\u30FC\u60C5\u5831\u3068WPhosting\u6A29\u9650\u30FB\u5BFE\u8C61\u5951\u7D04\u3092\u53D6\u5F97", {}, "getMe", () => []);
|
|
2326
2817
|
register("list", "sites", "\u5951\u7D04\u5185\u306E\u672C\u756A\u30FB\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\u30B5\u30A4\u30C8\u4E00\u89A7\u3068\u51E6\u7406status\u3092\u53D6\u5F97", { contract_id: contractId }, "listWphostingSites", (a) => [a.contract_id]);
|
|
2327
2818
|
register("get", "site", "\u30B5\u30A4\u30C8\u8A73\u7D30\u3068\u975E\u540C\u671F\u30B5\u30A4\u30C8\u51E6\u7406\u306Estatus\u3092\u53D6\u5F97", site, "getWphostingSite", (a) => [a.contract_id, a.servername]);
|
|
2328
2819
|
register("get", "usage", "\u5951\u7D04\u4E0A\u9650\u3001\u4F7F\u7528\u91CF\u3001\u30B5\u30A4\u30C8\u5225\u5185\u8A33\u3092\u53D6\u5F97", { contract_id: contractId }, "getWphostingUsage", (a) => [a.contract_id]);
|
|
2329
2820
|
register("create", "site", "\u30B5\u30A4\u30C8\u4F5C\u6210\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: get_wphosting_site\u306Estatus\uFF09", {
|
|
2330
2821
|
contract_id: contractId,
|
|
2331
|
-
wp_sitename:
|
|
2332
|
-
wp_username:
|
|
2333
|
-
wp_password:
|
|
2822
|
+
wp_sitename: z30.string().min(1).max(255),
|
|
2823
|
+
wp_username: z30.string().min(1).max(255).regex(/^[0-9A-Za-z _\-.@]+$/),
|
|
2824
|
+
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), {
|
|
2334
2825
|
message: "\u534A\u89D2\u82F1\u5B57\u3068\u6570\u5B57\u307E\u305F\u306F\u8A18\u53F7\u3092\u305D\u308C\u305E\u308C1\u6587\u5B57\u4EE5\u4E0A\u542B\u3081\u3066\u304F\u3060\u3055\u3044"
|
|
2335
2826
|
}),
|
|
2336
|
-
wp_mailaddress:
|
|
2337
|
-
disk_limit_gb:
|
|
2338
|
-
vcpu_limit:
|
|
2339
|
-
memory_limit_gb:
|
|
2340
|
-
wp_theme:
|
|
2341
|
-
server_id:
|
|
2342
|
-
security_auto_optimize:
|
|
2343
|
-
memo:
|
|
2344
|
-
idempotency_key:
|
|
2827
|
+
wp_mailaddress: z30.string().email().max(100),
|
|
2828
|
+
disk_limit_gb: z30.number().int().min(10),
|
|
2829
|
+
vcpu_limit: z30.number().int().positive(),
|
|
2830
|
+
memory_limit_gb: z30.number().int().positive(),
|
|
2831
|
+
wp_theme: z30.enum(["default", "cocoon-master", "lightning"]).optional(),
|
|
2832
|
+
server_id: z30.string().regex(/^[a-z][a-z0-9]{0,11}$/).optional(),
|
|
2833
|
+
security_auto_optimize: z30.boolean().optional(),
|
|
2834
|
+
memo: z30.string().max(255).optional(),
|
|
2835
|
+
idempotency_key: idempotencyKey3.optional()
|
|
2345
2836
|
}, "createWphostingSite", (a) => {
|
|
2346
2837
|
if (a.wp_password === a.wp_username) {
|
|
2347
2838
|
throw new Error("wp_password\u306Fwp_username\u3068\u7570\u306A\u308B\u6587\u5B57\u5217\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
@@ -2352,21 +2843,21 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2352
2843
|
a.idempotency_key
|
|
2353
2844
|
];
|
|
2354
2845
|
});
|
|
2355
|
-
tools.tool(wphostingToolName(brand, "preview", "site_deletion"),
|
|
2846
|
+
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 () => ({
|
|
2356
2847
|
target: await invoke("getWphostingSite", [a.contract_id, a.servername]),
|
|
2357
2848
|
impact: "\u6307\u5B9A\u30B5\u30A4\u30C8\u3092\u524A\u9664\u3057\u307E\u3059\u3002\u672C\u756A\u30B5\u30A4\u30C8\u306E\u5834\u5408\u306F\u7D10\u3065\u304F\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\u30B5\u30A4\u30C8\u3082\u9023\u52D5\u524A\u9664\u3055\u308C\u3001\u4E00\u89A7\u304B\u3089\u9664\u5916\u3055\u308C\u308B\u307E\u3067\u51E6\u7406\u4E2D\u3067\u3059\u3002",
|
|
2358
2849
|
confirmation_tool: wphostingToolName(brand, "execute", "site_deletion"),
|
|
2359
2850
|
confirmation_destination: "list_wphosting_sites\u3067\u5BFE\u8C61\u3068\u9023\u52D5\u524A\u9664\u5BFE\u8C61\u3092\u518D\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
2360
2851
|
})));
|
|
2361
|
-
register("execute", "site_deletion", "preview\u7D50\u679C\u306E\u660E\u793A\u627F\u8A8D\u5F8C\u306B\u30B5\u30A4\u30C8\u524A\u9664\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: list_wphosting_sites\u304B\u3089\u5BFE\u8C61\u304C\u9664\u5916\uFF09", { ...site, confirmed, idempotency_key:
|
|
2852
|
+
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]);
|
|
2362
2853
|
register("create", "staging", "\u672C\u756A\u30B5\u30A4\u30C8\u306E\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\u4F5C\u6210\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: \u8FD4\u5374servername\u306Eget_wphosting_site status\uFF09", {
|
|
2363
2854
|
...site,
|
|
2364
|
-
disk_limit_gb:
|
|
2365
|
-
vcpu_limit:
|
|
2366
|
-
memory_limit_gb:
|
|
2367
|
-
server_id:
|
|
2368
|
-
security_auto_optimize:
|
|
2369
|
-
idempotency_key:
|
|
2855
|
+
disk_limit_gb: z30.number().int().min(10),
|
|
2856
|
+
vcpu_limit: z30.number().int().positive(),
|
|
2857
|
+
memory_limit_gb: z30.number().int().positive(),
|
|
2858
|
+
server_id: z30.string().min(1).max(12).optional(),
|
|
2859
|
+
security_auto_optimize: z30.boolean().optional(),
|
|
2860
|
+
idempotency_key: idempotencyKey3.optional()
|
|
2370
2861
|
}, "createWphostingStaging", (a) => [
|
|
2371
2862
|
a.contract_id,
|
|
2372
2863
|
a.servername,
|
|
@@ -2376,15 +2867,15 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2376
2867
|
register("list", "backups", "\u624B\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u4E00\u89A7\u3068\u4F5C\u6210status\u3092\u53D6\u5F97", site, "listWphostingBackups", (a) => [a.contract_id, a.servername]);
|
|
2377
2868
|
register("create", "backup", "\u624B\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u4F5C\u6210\u3092\u53D7\u3051\u4ED8\u3051\u308B\uFF08\u78BA\u8A8D\u5148: list_wphosting_backups\u306Estatus\uFF09", {
|
|
2378
2869
|
...site,
|
|
2379
|
-
memo:
|
|
2380
|
-
idempotency_key:
|
|
2870
|
+
memo: z30.string().max(255).optional(),
|
|
2871
|
+
idempotency_key: idempotencyKey3.optional()
|
|
2381
2872
|
}, "createWphostingBackup", (a) => [
|
|
2382
2873
|
a.contract_id,
|
|
2383
2874
|
a.servername,
|
|
2384
2875
|
body(a, ["contract_id", "servername", "idempotency_key"]),
|
|
2385
2876
|
a.idempotency_key
|
|
2386
2877
|
]);
|
|
2387
|
-
tools.tool(wphostingToolName(brand, "preview", "backup_restore"),
|
|
2878
|
+
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 () => ({
|
|
2388
2879
|
backups: await invoke("listWphostingBackups", [
|
|
2389
2880
|
a.contract_id,
|
|
2390
2881
|
a.servername
|
|
@@ -2398,24 +2889,24 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2398
2889
|
...site,
|
|
2399
2890
|
backup_id: opaqueId("\u5FA9\u5143\u3059\u308B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7ID"),
|
|
2400
2891
|
confirmed,
|
|
2401
|
-
idempotency_key:
|
|
2892
|
+
idempotency_key: idempotencyKey3.optional()
|
|
2402
2893
|
}, "restoreWphostingBackup", (a) => [a.contract_id, a.servername, a.backup_id, a.idempotency_key]);
|
|
2403
2894
|
register("list", "backup_restore_history", "\u624B\u52D5\u30FB\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u5FA9\u5143\u306E\u5C65\u6B74\u3068status\u3092\u53D6\u5F97", site, "listWphostingBackupRestoreHistory", (a) => [a.contract_id, a.servername]);
|
|
2404
2895
|
register("delete", "backup", "\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_backups\u3002\u524A\u9664\u5F8C\u306F\u5FA9\u5143\u4E0D\u53EF\uFF09", { ...site, backup_id: opaqueId("\u524A\u9664\u3059\u308B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7ID"), confirmed }, "deleteWphostingBackup", (a) => [a.contract_id, a.servername, a.backup_id]);
|
|
2405
2896
|
register("get", "wordpress", "WordPress\u672C\u4F53\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3068\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u53D6\u5F97", site, "getWphostingWordPress", (a) => [a.contract_id, a.servername]);
|
|
2406
|
-
register("update", "wordpress", "WordPress\u672C\u4F53\u306E\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u5909\u66F4", { ...site, auto_update_scope:
|
|
2897
|
+
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) => [
|
|
2407
2898
|
a.contract_id,
|
|
2408
2899
|
a.servername,
|
|
2409
2900
|
{ auto_update_scope: a.auto_update_scope }
|
|
2410
2901
|
]);
|
|
2411
2902
|
register("upgrade", "wordpress", "WordPress\u672C\u4F53\u3092\u540C\u671F\u66F4\u65B0", site, "upgradeWphostingWordPress", (a) => [a.contract_id, a.servername]);
|
|
2412
2903
|
register("get", "maintenance_mode", "\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9\u30E2\u30FC\u30C9\u8A2D\u5B9A\u3092\u53D6\u5F97", site, "getWphostingMaintenanceMode", (a) => [a.contract_id, a.servername]);
|
|
2413
|
-
register("update", "maintenance_mode", "\u30E1\u30F3\u30C6\u30CA\u30F3\u30B9\u30E2\u30FC\u30C9\u3092\u5909\u66F4", { ...site, enabled:
|
|
2904
|
+
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 }]);
|
|
2414
2905
|
register("list", "plugins", "\u901A\u5E38\u30D7\u30E9\u30B0\u30A4\u30F3\u4E00\u89A7\u3092\u53D6\u5F97\uFF08drop-in/must-use\u3092\u9664\u304F\uFF09", site, "listWphostingPlugins", (a) => [a.contract_id, a.servername]);
|
|
2415
2906
|
register("install", "plugin", "\u516C\u5F0F\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u30D7\u30E9\u30B0\u30A4\u30F3slug\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", {
|
|
2416
2907
|
...site,
|
|
2417
2908
|
plugin: slug("\u30D7\u30E9\u30B0\u30A4\u30F3slug"),
|
|
2418
|
-
activate:
|
|
2909
|
+
activate: z30.boolean().optional()
|
|
2419
2910
|
}, "installWphostingPlugin", (a) => [
|
|
2420
2911
|
a.contract_id,
|
|
2421
2912
|
a.servername,
|
|
@@ -2427,8 +2918,8 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2427
2918
|
register("update", "plugin", "\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u6709\u52B9\u72B6\u614B\u307E\u305F\u306F\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2428
2919
|
...site,
|
|
2429
2920
|
plugin: slug("\u30D7\u30E9\u30B0\u30A4\u30F3slug"),
|
|
2430
|
-
status:
|
|
2431
|
-
auto_update:
|
|
2921
|
+
status: z30.enum(["active", "inactive"]).optional(),
|
|
2922
|
+
auto_update: z30.boolean().optional()
|
|
2432
2923
|
}, "updateWphostingPlugin", (a) => {
|
|
2433
2924
|
const data = body(a, ["contract_id", "servername", "plugin"]);
|
|
2434
2925
|
requireUpdate(data);
|
|
@@ -2437,7 +2928,7 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2437
2928
|
register("upgrade", "plugin", "\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u540C\u671F\u66F4\u65B0", { ...site, plugin: slug("\u30D7\u30E9\u30B0\u30A4\u30F3slug") }, "upgradeWphostingPlugin", (a) => [a.contract_id, a.servername, a.plugin]);
|
|
2438
2929
|
register("delete", "plugin", "\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_plugins\uFF09", { ...site, plugin: slug("\u524A\u9664\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3slug"), confirmed }, "deleteWphostingPlugin", (a) => [a.contract_id, a.servername, a.plugin]);
|
|
2439
2930
|
register("list", "themes", "\u30C6\u30FC\u30DE\u4E00\u89A7\u3092\u53D6\u5F97", site, "listWphostingThemes", (a) => [a.contract_id, a.servername]);
|
|
2440
|
-
register("install", "theme", "\u516C\u5F0F\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u30C6\u30FC\u30DEslug\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB", { ...site, theme: slug("\u30C6\u30FC\u30DEslug"), activate:
|
|
2931
|
+
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) => [
|
|
2441
2932
|
a.contract_id,
|
|
2442
2933
|
a.servername,
|
|
2443
2934
|
{
|
|
@@ -2448,8 +2939,8 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2448
2939
|
register("update", "theme", "\u30C6\u30FC\u30DE\u306Eactive\u5207\u66FF\u307E\u305F\u306F\u81EA\u52D5\u66F4\u65B0\u8A2D\u5B9A\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2449
2940
|
...site,
|
|
2450
2941
|
theme: slug("\u30C6\u30FC\u30DEslug"),
|
|
2451
|
-
status:
|
|
2452
|
-
auto_update:
|
|
2942
|
+
status: z30.literal("active").optional(),
|
|
2943
|
+
auto_update: z30.boolean().optional()
|
|
2453
2944
|
}, "updateWphostingTheme", (a) => {
|
|
2454
2945
|
const data = body(a, ["contract_id", "servername", "theme"]);
|
|
2455
2946
|
requireUpdate(data);
|
|
@@ -2461,7 +2952,7 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2461
2952
|
register("add", "domain", "\u30B5\u30A4\u30C8\u3078\u30C9\u30E1\u30A4\u30F3\u3092\u8FFD\u52A0\uFF08\u5FC5\u8981\u6642\u306F\u6240\u6709\u8005\u78BA\u8A8DTXT\u60C5\u5831\u3092\u8FD4\u3059\uFF09", { ...site, domain }, "addWphostingDomain", (a) => [a.contract_id, a.servername, { domain: a.domain }]);
|
|
2462
2953
|
register("verify", "domain", "\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u306EDNS\u6240\u6709\u8005\u78BA\u8A8D\u3092\u5B9F\u884C", { ...site, domain }, "verifyWphostingDomain", (a) => [a.contract_id, a.servername, a.domain]);
|
|
2463
2954
|
register("delete", "domain", "\u30B5\u30A4\u30C8\u306E\u30C9\u30E1\u30A4\u30F3\u8A2D\u5B9A\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_domains\u3002\u30B5\u30A4\u30C8URL\u4F7F\u7528\u4E2D\u306F\u524A\u9664\u4E0D\u53EF\uFF09", { ...site, domain, confirmed }, "deleteWphostingDomain", (a) => [a.contract_id, a.servername, a.domain]);
|
|
2464
|
-
register("update", "site_url", "\u30B5\u30A4\u30C8\u306E\u30D7\u30E9\u30A4\u30DE\u30EA\u30C9\u30E1\u30A4\u30F3\u3092\u5909\u66F4", { ...site, domain, auto_redirect:
|
|
2955
|
+
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) => [
|
|
2465
2956
|
a.contract_id,
|
|
2466
2957
|
a.servername,
|
|
2467
2958
|
{
|
|
@@ -2473,9 +2964,9 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2473
2964
|
register("add", "dns_record", "\u30B5\u30A4\u30C8\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u3078DNS\u30EC\u30B3\u30FC\u30C9\u3092\u8FFD\u52A0", {
|
|
2474
2965
|
...site,
|
|
2475
2966
|
domain,
|
|
2476
|
-
host:
|
|
2967
|
+
host: z30.string().max(255),
|
|
2477
2968
|
type: dnsType2,
|
|
2478
|
-
content:
|
|
2969
|
+
content: z30.string().max(1024),
|
|
2479
2970
|
ttl: dnsTtl.optional().default(3600),
|
|
2480
2971
|
priority: dnsPriority.optional()
|
|
2481
2972
|
}, "addWphostingDnsRecord", (a) => [
|
|
@@ -2488,9 +2979,9 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2488
2979
|
...site,
|
|
2489
2980
|
domain,
|
|
2490
2981
|
dns_id: positiveId("DNS\u30EC\u30B3\u30FC\u30C9ID"),
|
|
2491
|
-
host:
|
|
2982
|
+
host: z30.string().max(255).optional(),
|
|
2492
2983
|
type: dnsType2.optional(),
|
|
2493
|
-
content:
|
|
2984
|
+
content: z30.string().max(1024).optional(),
|
|
2494
2985
|
ttl: dnsTtl.optional(),
|
|
2495
2986
|
priority: dnsPriority.optional()
|
|
2496
2987
|
}, "updateWphostingDnsRecord", (a) => {
|
|
@@ -2500,23 +2991,23 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2500
2991
|
});
|
|
2501
2992
|
register("delete", "dns_record", "\u30B5\u30A4\u30C8\u8FFD\u52A0\u30C9\u30E1\u30A4\u30F3\u306EDNS\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_dns_records\uFF09", { ...site, domain, dns_id: positiveId("DNS\u30EC\u30B3\u30FC\u30C9ID"), confirmed }, "deleteWphostingDnsRecord", (a) => [a.contract_id, a.servername, a.domain, a.dns_id]);
|
|
2502
2993
|
register("get", "php_version", "\u30B5\u30A4\u30C8\u306EPHP\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u53D6\u5F97", site, "getWphostingPhpVersion", (a) => [a.contract_id, a.servername]);
|
|
2503
|
-
register("update", "php_version", "\u30B5\u30A4\u30C8\u306EPHP\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5909\u66F4", { ...site, version:
|
|
2994
|
+
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 }]);
|
|
2504
2995
|
register("get", "access_log", "\u30B5\u30A4\u30C8\u306E\u30A2\u30AF\u30BB\u30B9\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
2505
2996
|
...site,
|
|
2506
|
-
date:
|
|
2507
|
-
keyword:
|
|
2508
|
-
line_number:
|
|
2997
|
+
date: z30.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
|
|
2998
|
+
keyword: z30.string().max(255).optional(),
|
|
2999
|
+
line_number: z30.number().int().min(1).max(5e4).optional()
|
|
2509
3000
|
}, "getWphostingAccessLog", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2510
3001
|
register("get", "error_log", "\u30B5\u30A4\u30C8\u306E\u30A8\u30E9\u30FC\u30ED\u30B0\u3092\u53D6\u5F97", {
|
|
2511
3002
|
...site,
|
|
2512
|
-
keyword:
|
|
2513
|
-
line_number:
|
|
3003
|
+
keyword: z30.string().max(255).optional(),
|
|
3004
|
+
line_number: z30.number().int().min(1).max(5e4).optional()
|
|
2514
3005
|
}, "getWphostingErrorLog", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2515
3006
|
register("list", "cron", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FCron\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97", site, "listWphostingCron", (a) => [a.contract_id, a.servername]);
|
|
2516
3007
|
register("add", "cron", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FCron\u30B8\u30E7\u30D6\u3092\u8FFD\u52A0", { ...site, ...cronFields }, "addWphostingCron", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2517
3008
|
register("update", "cron", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FCron\u30B8\u30E7\u30D6\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2518
3009
|
...site,
|
|
2519
|
-
cron_id:
|
|
3010
|
+
cron_id: z30.string().min(1).max(255),
|
|
2520
3011
|
minute: cronFields.minute.optional(),
|
|
2521
3012
|
hour: cronFields.hour.optional(),
|
|
2522
3013
|
day: cronFields.day.optional(),
|
|
@@ -2524,18 +3015,18 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2524
3015
|
weekday: cronFields.weekday.optional(),
|
|
2525
3016
|
command: cronFields.command.optional(),
|
|
2526
3017
|
comment: cronFields.comment,
|
|
2527
|
-
enabled:
|
|
3018
|
+
enabled: z30.boolean().optional()
|
|
2528
3019
|
}, "updateWphostingCron", (a) => {
|
|
2529
3020
|
const data = body(a, ["contract_id", "servername", "cron_id"]);
|
|
2530
3021
|
requireUpdate(data);
|
|
2531
3022
|
return [a.contract_id, a.servername, a.cron_id, data];
|
|
2532
3023
|
});
|
|
2533
|
-
register("delete", "cron", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FCron\u30B8\u30E7\u30D6\u3092\u524A\u9664\uFF08\u78BA\u8A8D\u5148: list_wphosting_cron\uFF09", { ...site, cron_id:
|
|
3024
|
+
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]);
|
|
2534
3025
|
register("get", "ssh", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FSSH\u8A2D\u5B9A\u3068\u63A5\u7D9A\u60C5\u5831\u3092\u53D6\u5F97", site, "getWphostingSsh", (a) => [a.contract_id, a.servername]);
|
|
2535
3026
|
register("update", "ssh", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FSSH\u6709\u52B9\u72B6\u614B\u307E\u305F\u306F\u56FD\u5916\u30A2\u30AF\u30BB\u30B9\u5236\u9650\u3092\u5909\u66F4", {
|
|
2536
3027
|
...site,
|
|
2537
|
-
ssh_enabled:
|
|
2538
|
-
abroad_access_restriction:
|
|
3028
|
+
ssh_enabled: z30.boolean().optional(),
|
|
3029
|
+
abroad_access_restriction: z30.boolean().optional()
|
|
2539
3030
|
}, "updateWphostingSsh", (a) => {
|
|
2540
3031
|
const data = body(a, ["contract_id", "servername"]);
|
|
2541
3032
|
requireUpdate(data);
|
|
@@ -2544,10 +3035,10 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2544
3035
|
register("list", "ssh_keys", "\u30B5\u30A4\u30C8\u306B\u89E3\u6C7A\u3055\u308C\u305FSSH\u516C\u958B\u9375\u4E00\u89A7\u3092\u53D6\u5F97", site, "listWphostingSshKeys", (a) => [a.contract_id, a.servername]);
|
|
2545
3036
|
register("add", "ssh_key", "SSH\u516C\u958B\u9375\u3092\u767B\u9332\u307E\u305F\u306F\u9375\u30DA\u30A2\u3092\u751F\u6210\uFF08\u521D\u56DEactive\u9375\u306A\u3089SSH\u3082\u6709\u52B9\u5316\uFF09", {
|
|
2546
3037
|
...site,
|
|
2547
|
-
label:
|
|
2548
|
-
public_key:
|
|
2549
|
-
generate:
|
|
2550
|
-
passphrase:
|
|
3038
|
+
label: z30.string().min(1).max(500),
|
|
3039
|
+
public_key: z30.string().min(1).optional(),
|
|
3040
|
+
generate: z30.boolean().optional(),
|
|
3041
|
+
passphrase: z30.string().min(6).max(32).optional()
|
|
2551
3042
|
}, "addWphostingSshKey", (a) => {
|
|
2552
3043
|
if (a.generate !== true && a.public_key === void 0) {
|
|
2553
3044
|
throw new Error("public_key \u307E\u305F\u306F generate=true \u306E\u3044\u305A\u308C\u304B\u304C\u5FC5\u8981\u3067\u3059\u3002");
|
|
@@ -2567,8 +3058,8 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2567
3058
|
register("update", "ssh_key", "SSH\u516C\u958B\u9375\u306E\u30E9\u30D9\u30EB\u307E\u305F\u306Fstatus\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
2568
3059
|
...site,
|
|
2569
3060
|
key_id: positiveId("SSH\u516C\u958B\u9375ID"),
|
|
2570
|
-
label:
|
|
2571
|
-
status:
|
|
3061
|
+
label: z30.string().min(1).max(500).optional(),
|
|
3062
|
+
status: z30.enum(["on", "off"]).optional()
|
|
2572
3063
|
}, "updateWphostingSshKey", (a) => {
|
|
2573
3064
|
const data = body(a, ["contract_id", "servername", "key_id"]);
|
|
2574
3065
|
requireUpdate(data);
|
|
@@ -2578,27 +3069,27 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2578
3069
|
register("list", "wp_user_roles", "WordPress\u30E6\u30FC\u30B6\u30FC\u6A29\u9650\u30B0\u30EB\u30FC\u30D7\u4E00\u89A7\u3092\u53D6\u5F97", site, "listWphostingWpUserRoles", (a) => [a.contract_id, a.servername]);
|
|
2579
3070
|
register("list", "wp_users", "WordPress\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u3092\u691C\u7D22\u30FB\u4E26\u3079\u66FF\u3048\u3066\u53D6\u5F97", {
|
|
2580
3071
|
...site,
|
|
2581
|
-
search:
|
|
2582
|
-
orderby:
|
|
3072
|
+
search: z30.string().max(255).optional(),
|
|
3073
|
+
orderby: z30.enum([
|
|
2583
3074
|
"ID",
|
|
2584
3075
|
"user_login",
|
|
2585
3076
|
"display_name",
|
|
2586
3077
|
"user_email",
|
|
2587
3078
|
"user_registered"
|
|
2588
3079
|
]).optional(),
|
|
2589
|
-
order:
|
|
3080
|
+
order: z30.enum(["asc", "desc"]).optional()
|
|
2590
3081
|
}, "listWphostingWpUsers", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2591
3082
|
register("create", "wp_user", "WordPress\u30E6\u30FC\u30B6\u30FC\u3092\u4F5C\u6210", {
|
|
2592
3083
|
...site,
|
|
2593
|
-
user_login:
|
|
2594
|
-
user_email:
|
|
2595
|
-
user_pass:
|
|
2596
|
-
role:
|
|
2597
|
-
display_name:
|
|
2598
|
-
first_name:
|
|
2599
|
-
last_name:
|
|
2600
|
-
user_url:
|
|
2601
|
-
send_email:
|
|
3084
|
+
user_login: z30.string().min(1).max(60),
|
|
3085
|
+
user_email: z30.string().email().max(100),
|
|
3086
|
+
user_pass: z30.string().min(7).max(64),
|
|
3087
|
+
role: z30.string().min(1).max(64),
|
|
3088
|
+
display_name: z30.string().max(255).optional(),
|
|
3089
|
+
first_name: z30.string().max(255).optional(),
|
|
3090
|
+
last_name: z30.string().max(255).optional(),
|
|
3091
|
+
user_url: z30.string().url().max(255).optional(),
|
|
3092
|
+
send_email: z30.boolean().optional()
|
|
2602
3093
|
}, "createWphostingWpUser", (a) => [a.contract_id, a.servername, body(a, ["contract_id", "servername"])]);
|
|
2603
3094
|
register("get", "wp_user", "WordPress\u30E6\u30FC\u30B6\u30FC\u8A73\u7D30\u3092\u53D6\u5F97", { ...site, user_id: positiveId("WordPress\u30E6\u30FC\u30B6\u30FCID") }, "getWphostingWpUser", (a) => [a.contract_id, a.servername, a.user_id]);
|
|
2604
3095
|
register("update", "wp_user", "WordPress\u30E6\u30FC\u30B6\u30FC\u3092\u90E8\u5206\u66F4\u65B0", {
|
|
@@ -2614,13 +3105,221 @@ function registerWphostingTools(server, client, brand) {
|
|
|
2614
3105
|
register("list", "security_settings", "\u516C\u958B\u5BFE\u8C6110\u30AD\u30FC\u306EWordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u53D6\u5F97", site, "getWphostingSecurity", (a) => [a.contract_id, a.servername]);
|
|
2615
3106
|
register("update", "security_setting", "WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u5909\u66F4", {
|
|
2616
3107
|
...site,
|
|
2617
|
-
key:
|
|
2618
|
-
is_enable:
|
|
3108
|
+
key: z30.string().regex(/^[a-z0-9_]+$/).max(100).describe("list_wphosting_security_settings\u3067\u53D6\u5F97\u3057\u305F\u8A2D\u5B9Akey"),
|
|
3109
|
+
is_enable: z30.boolean()
|
|
2619
3110
|
}, "updateWphostingSecurity", (a) => [a.contract_id, a.servername, a.key, { is_enable: a.is_enable }]);
|
|
2620
3111
|
}
|
|
2621
3112
|
|
|
3113
|
+
// ../core/dist/tools/vps/index.js
|
|
3114
|
+
import { z as z31 } from "zod";
|
|
3115
|
+
var readOnlyAnnotations = {
|
|
3116
|
+
readOnlyHint: true,
|
|
3117
|
+
destructiveHint: false,
|
|
3118
|
+
idempotentHint: true,
|
|
3119
|
+
openWorldHint: true
|
|
3120
|
+
};
|
|
3121
|
+
var additiveWriteAnnotations = {
|
|
3122
|
+
readOnlyHint: false,
|
|
3123
|
+
destructiveHint: false,
|
|
3124
|
+
idempotentHint: false,
|
|
3125
|
+
openWorldHint: true
|
|
3126
|
+
};
|
|
3127
|
+
var idempotentWriteAnnotations = {
|
|
3128
|
+
readOnlyHint: false,
|
|
3129
|
+
destructiveHint: false,
|
|
3130
|
+
idempotentHint: true,
|
|
3131
|
+
openWorldHint: true
|
|
3132
|
+
};
|
|
3133
|
+
var destructiveWriteAnnotations = {
|
|
3134
|
+
readOnlyHint: false,
|
|
3135
|
+
destructiveHint: true,
|
|
3136
|
+
idempotentHint: true,
|
|
3137
|
+
openWorldHint: true
|
|
3138
|
+
};
|
|
3139
|
+
var destructiveNonIdempotentWriteAnnotations = {
|
|
3140
|
+
readOnlyHint: false,
|
|
3141
|
+
destructiveHint: true,
|
|
3142
|
+
idempotentHint: false,
|
|
3143
|
+
openWorldHint: true
|
|
3144
|
+
};
|
|
3145
|
+
var uuid = z31.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).describe("VPS\u306E uuid\uFF08list_vps_servers \u3067\u53D6\u5F97\uFF09");
|
|
3146
|
+
var memo2 = z31.string().max(500).describe("\u30E1\u30E2\uFF08\u7A7A\u6587\u5B57\u3067\u524A\u9664\u3001500\u6587\u5B57\u4EE5\u5185\uFF09");
|
|
3147
|
+
var expectedTotalPrice3 = z31.number().int().nonnegative().describe("preview\u3068\u4E00\u81F4\u3059\u308B\u7A0E\u8FBC\u5408\u8A08\u91D1\u984D");
|
|
3148
|
+
var idempotencyKey4 = z31.string().regex(/^[A-Za-z0-9_-]{8,64}$/).describe("Idempotency-Key\uFF08\u82F1\u6570\u5B57\u30FB_\u30FB-\u30018\uFF5E64\u6587\u5B57\uFF09");
|
|
3149
|
+
var packetFilterType = z31.enum(["ssh", "web", "web_http", "mysql", "postgresql", "mail", "rdp", "custom"]).describe("\u30EB\u30FC\u30EB\u7A2E\u5225");
|
|
3150
|
+
function vpsSignupScopeLabel(brand) {
|
|
3151
|
+
return brand.brand === "shincloud" ? "\u30B7\u30F3VPS\uFF08\u30B9\u30BF\u30F3\u30C0\u30FC\u30C9\u30FB\u5927\u5BB9\u91CF\u30E1\u30E2\u30EA\uFF09" : "VPS\u30FB\u30D3\u30B8\u30CD\u30B9VPS";
|
|
3152
|
+
}
|
|
3153
|
+
function vpsPlanIdExample(brand) {
|
|
3154
|
+
return brand.brand === "shincloud" ? "vps-2gb / vps-highmem-4gb" : "vps-4gb / business-4gb";
|
|
3155
|
+
}
|
|
3156
|
+
var signupInput3 = (brand) => ({
|
|
3157
|
+
plan_id: z31.string().min(1).max(64).describe(`\u30D7\u30E9\u30F3ID\uFF08${vpsPlanIdExample(brand)} \u306A\u3069\uFF09`),
|
|
3158
|
+
period: z31.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"),
|
|
3159
|
+
image_id: z31.string().min(1).describe("OS\u30A4\u30E1\u30FC\u30B8ID\uFF08list_vps_plans \u306E os_images[].image_id\uFF09"),
|
|
3160
|
+
root_password: z31.string().min(9).max(70).describe("root\u30D1\u30B9\u30EF\u30FC\u30C9\uFF089\u301C70\u6587\u5B57\uFF09"),
|
|
3161
|
+
expected_total_price: expectedTotalPrice3,
|
|
3162
|
+
agree_to_terms: z31.literal(true).describe("VPS\u5951\u7D04\u306E\u5229\u7528\u898F\u7D04\u3078\u306E\u660E\u793A\u540C\u610F"),
|
|
3163
|
+
name: z31.string().min(1).max(50).optional().describe("\u30B5\u30FC\u30D0\u30FC\u540D"),
|
|
3164
|
+
ssh_key_name: z31.string().min(1).optional().describe("\u767B\u9332\u6E08\u307FSSH\u30AD\u30FC\u540D"),
|
|
3165
|
+
ssh_public_key: z31.string().min(1).optional().describe("\u767B\u9332\u3059\u308B\u516C\u958B\u9375\uFF08ssh_key_name \u3068\u4F75\u7528\uFF09"),
|
|
3166
|
+
partner_code: z31.string().regex(/^[A-Za-z0-9]{1,50}$/).optional().describe("\u304A\u53D6\u6B21\u5E97\u30B3\u30FC\u30C9"),
|
|
3167
|
+
auto_renew: z31.enum(["enabled", "disabled"]).describe("\u81EA\u52D5\u66F4\u65B0\uFF08enabled: \u6709\u52B9 / disabled: \u7121\u52B9\u3001\u660E\u793A\u6307\u5B9A\u5FC5\u9808\uFF09")
|
|
3168
|
+
});
|
|
3169
|
+
var osReinstallInput = {
|
|
3170
|
+
uuid,
|
|
3171
|
+
image_id: z31.string().min(1).describe("\u30A4\u30E1\u30FC\u30B8ID\uFF08list_vps_os_images \u306E image_id\uFF09"),
|
|
3172
|
+
root_password: z31.string().min(9).max(70).describe("\u7BA1\u7406\u8005\u30D1\u30B9\u30EF\u30FC\u30C9\uFF089\u301C70\u6587\u5B57\uFF09"),
|
|
3173
|
+
ssh_key_name: z31.string().min(1).optional().describe("\u767B\u9332\u6E08\u307FSSH\u30AD\u30FC\u540D\uFF08Windows\u3067\u306F\u6307\u5B9A\u4E0D\u53EF\uFF09"),
|
|
3174
|
+
ssh_public_key: z31.string().min(1).optional().describe("\u767B\u9332\u3059\u308B\u516C\u958B\u9375"),
|
|
3175
|
+
basic_password: z31.string().min(12).max(64).regex(/^[A-Za-z0-9]+$/).optional().describe("\u7BA1\u7406\u30C4\u30FC\u30EBBasic\u8A8D\u8A3C\uFF08requires_basic_password \u306E\u30A4\u30E1\u30FC\u30B8\u306E\u307F\u3002\u534A\u89D2\u82F1\u6570\u5B5712\u301C64\u6587\u5B57\uFF09")
|
|
3176
|
+
};
|
|
3177
|
+
function description4(text) {
|
|
3178
|
+
return `${text}\u3002\u5BFE\u8C61\u306F uuid \u3067\u6307\u5B9A\u3057\u307E\u3059\u3002Star8 \u306B\u306F VPS \u306F\u3042\u308A\u307E\u305B\u3093`;
|
|
3179
|
+
}
|
|
3180
|
+
function acceptedNextStep(checkTool) {
|
|
3181
|
+
return {
|
|
3182
|
+
next_step: `202 Accepted \u3067\u3059\u3002\u5B8C\u4E86\u307E\u3067\u30DD\u30FC\u30EA\u30F3\u30B0\u305B\u305A\u3001${checkTool} \u3067\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`
|
|
3183
|
+
};
|
|
3184
|
+
}
|
|
3185
|
+
async function protectionEnabled(client, target) {
|
|
3186
|
+
try {
|
|
3187
|
+
const result = await client.getVpsProtection(target);
|
|
3188
|
+
return result.protection?.os_reinstall ?? null;
|
|
3189
|
+
} catch {
|
|
3190
|
+
return null;
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
function registerVpsTools(server, client, brand, options = {}) {
|
|
3194
|
+
if (brand.brand !== "xserver" && brand.brand !== "shincloud") {
|
|
3195
|
+
throw new Error(`--services=vps is not supported for brand "${brand.brand}"; use XServer or \u30B7\u30F3\u30AF\u30E9\u30A6\u30C9.`);
|
|
3196
|
+
}
|
|
3197
|
+
server.tool(vpsToolName(brand, "list", "servers"), description4("\u5951\u7D04\u4E2D\u306EVPS\u4E00\u89A7\u3092\u53D6\u5F97"), {}, readOnlyAnnotations, async () => callApi(() => client.listVpsServers()));
|
|
3198
|
+
server.tool(vpsToolName(brand, "get", "server"), description4("VPS\u8A73\u7D30\u3092\u53D6\u5F97"), { uuid }, readOnlyAnnotations, async ({ uuid: target }) => callApi(() => client.getVpsServer(target)));
|
|
3199
|
+
server.tool(vpsToolName(brand, "update", "memo"), description4("VPS\u30E1\u30E2\u3092\u5909\u66F4"), { uuid, memo: memo2 }, destructiveWriteAnnotations, async ({ uuid: target, memo: value }) => callApi(() => client.updateVpsMemo(target, { memo: value })));
|
|
3200
|
+
server.tool(vpsToolName(brand, "update", "name"), description4("VPS\u30B5\u30FC\u30D0\u30FC\u540D\u3092\u5909\u66F4"), {
|
|
3201
|
+
uuid,
|
|
3202
|
+
name: z31.string().min(1).max(50).describe("\u30B5\u30FC\u30D0\u30FC\u540D\uFF08\u534A\u89D2\u82F1\u5C0F\u6587\u5B57\u30FB\u6570\u5B57\u30FB-\u30FB_\uFF09")
|
|
3203
|
+
}, destructiveWriteAnnotations, async ({ uuid: target, name }) => callApi(() => client.updateVpsName(target, { name })));
|
|
3204
|
+
server.tool(vpsToolName(brand, "update", "reverse_dns"), description4("\u9006\u5F15\u304D\u30DB\u30B9\u30C8\u540D\u3092\u5909\u66F4"), {
|
|
3205
|
+
uuid,
|
|
3206
|
+
hostname: z31.string().min(1).max(253).describe("\u9006\u5F15\u304D\u30DB\u30B9\u30C8\u540D")
|
|
3207
|
+
}, destructiveWriteAnnotations, async ({ uuid: target, hostname }) => callApi(() => client.updateVpsReverseDns(target, { hostname })));
|
|
3208
|
+
server.tool(vpsToolName(brand, "get", "power"), description4("\u96FB\u6E90\u72B6\u614B\u3092\u53D6\u5F97\u3002start/reboot/stop \u306E\u9032\u6357\u78BA\u8A8D\u5148"), { uuid }, readOnlyAnnotations, async ({ uuid: target }) => callApi(() => client.getVpsPower(target)));
|
|
3209
|
+
for (const [verb, method] of [
|
|
3210
|
+
["start", "startVpsPower"],
|
|
3211
|
+
["reboot", "rebootVpsPower"],
|
|
3212
|
+
["stop", "stopVpsPower"]
|
|
3213
|
+
]) {
|
|
3214
|
+
server.tool(vpsToolName(brand, verb, "power"), description4(`VPS\u3092${verb === "start" ? "\u8D77\u52D5" : verb === "reboot" ? "\u518D\u8D77\u52D5" : "\u505C\u6B62"}\uFF08202 Accepted\u3002get_vps_power \u3067\u78BA\u8A8D\uFF09`), { uuid }, verb === "start" ? idempotentWriteAnnotations : verb === "stop" ? destructiveWriteAnnotations : destructiveNonIdempotentWriteAnnotations, async ({ uuid: target }) => callApi(async () => {
|
|
3215
|
+
const result = await client[method](target);
|
|
3216
|
+
return {
|
|
3217
|
+
...result,
|
|
3218
|
+
...acceptedNextStep(vpsToolName(brand, "get", "power"))
|
|
3219
|
+
};
|
|
3220
|
+
}));
|
|
3221
|
+
}
|
|
3222
|
+
server.tool(vpsToolName(brand, "get", "packet_filter"), description4("\u30D1\u30B1\u30C3\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u8A2D\u5B9A\u3092\u53D6\u5F97"), { uuid }, readOnlyAnnotations, async ({ uuid: target }) => callApi(() => client.getVpsPacketFilter(target)));
|
|
3223
|
+
server.tool(vpsToolName(brand, "update", "packet_filter"), description4("\u30D1\u30B1\u30C3\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u306E\u6709\u52B9/\u7121\u52B9\u3092\u5207\u66FF"), { uuid, enabled: z31.boolean().describe("true \u3067\u6709\u52B9 / false \u3067\u7121\u52B9") }, destructiveWriteAnnotations, async ({ uuid: target, enabled }) => callApi(() => client.updateVpsPacketFilter(target, { enabled })));
|
|
3224
|
+
server.tool(vpsToolName(brand, "add", "packet_filter_rule"), description4("\u30D1\u30B1\u30C3\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u306E\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0"), {
|
|
3225
|
+
uuid,
|
|
3226
|
+
type: packetFilterType,
|
|
3227
|
+
protocol: z31.enum(["tcp", "udp", "icmp"]).optional().describe("custom \u306E\u5834\u5408\u306F\u5FC5\u9808"),
|
|
3228
|
+
port: z31.string().optional().describe("\u5358\u4E00\u307E\u305F\u306F\u7BC4\u56F2\u3002custom \u306E icmp \u4EE5\u5916\u3067\u5FC5\u9808"),
|
|
3229
|
+
allowed_ip: z31.string().optional().describe("all \u307E\u305F\u306F IP/CIDR\uFF08custom \u306E\u307F\uFF09"),
|
|
3230
|
+
memo: z31.string().max(500).optional().describe("\u30E1\u30E2\uFF08custom \u306E\u307F\uFF09")
|
|
3231
|
+
}, additiveWriteAnnotations, async ({ uuid: target, ...data }) => callApi(() => client.addVpsPacketFilterRule(target, data)));
|
|
3232
|
+
server.tool(vpsToolName(brand, "update", "packet_filter_rule"), description4("\u30D1\u30B1\u30C3\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u306E\u30EB\u30FC\u30EB\u3092\u5909\u66F4"), {
|
|
3233
|
+
uuid,
|
|
3234
|
+
rule_id: z31.number().int().positive().describe("\u30EB\u30FC\u30EBID"),
|
|
3235
|
+
protocol: z31.enum(["tcp", "udp", "icmp"]).optional(),
|
|
3236
|
+
port: z31.string().optional(),
|
|
3237
|
+
allowed_ip: z31.string().optional(),
|
|
3238
|
+
memo: z31.string().max(500).optional()
|
|
3239
|
+
}, destructiveWriteAnnotations, async ({ uuid: target, rule_id, ...data }) => callApi(() => client.updateVpsPacketFilterRule(target, String(rule_id), data)));
|
|
3240
|
+
server.tool(vpsToolName(brand, "delete", "packet_filter_rule"), description4("\u30D1\u30B1\u30C3\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u306E\u30EB\u30FC\u30EB\u3092\u524A\u9664"), { uuid, rule_id: z31.number().int().positive().describe("\u30EB\u30FC\u30EBID") }, destructiveWriteAnnotations, async ({ uuid: target, rule_id }) => callApi(() => client.deleteVpsPacketFilterRule(target, String(rule_id))));
|
|
3241
|
+
server.tool(vpsToolName(brand, "list", "os_images"), description4("\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3067\u304D\u308B\u30A4\u30E1\u30FC\u30B8\u4E00\u89A7\u3092\u53D6\u5F97\u3002requires_basic_password \u3092\u78BA\u8A8D\u3059\u308B\u3053\u3068"), { uuid }, readOnlyAnnotations, async ({ uuid: target }) => callApi(() => client.listVpsOsImages(target)));
|
|
3242
|
+
server.tool(vpsToolName(brand, "get", "os_reinstall"), description4("OS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u306E\u72B6\u6CC1\u3092\u78BA\u8A8D\uFF08\u30DD\u30FC\u30EA\u30F3\u30B0\u63A8\u5968\u9593\u9694 30\u79D2\uFF09"), { uuid }, readOnlyAnnotations, async ({ uuid: target }) => callApi(() => client.getVpsOsReinstall(target)));
|
|
3243
|
+
server.tool(vpsToolName(brand, "preview", "os_reinstall"), description4("OS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u524D\u306B\u5BFE\u8C61\u30FB\u64CD\u4F5C\u4FDD\u8B77\u3092\u78BA\u8A8D\u3002\u30C7\u30FC\u30BF\u5168\u6D88\u53BB\u3002execute \u306F\u9AD8\u30EA\u30B9\u30AF\u30B2\u30FC\u30C8\u304C\u5FC5\u8981"), osReinstallInput, billingPreviewAnnotations, async ({ uuid: target, image_id }) => callApi(async () => {
|
|
3244
|
+
const result = await client.getVpsProtection(target);
|
|
3245
|
+
return {
|
|
3246
|
+
uuid: target,
|
|
3247
|
+
image_id,
|
|
3248
|
+
protection: result.protection,
|
|
3249
|
+
warning: "\u30B5\u30FC\u30D0\u30FC\u5185\u306E\u30C7\u30FC\u30BF\u30FB\u8A2D\u5B9A\u306F\u3059\u3079\u3066\u524A\u9664\u3055\u308C\u307E\u3059\u3002VPS\u306F\u505C\u6B62\u4E2D\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
3250
|
+
next_step: "protection.os_reinstall \u304C true \u306E\u3068\u304D\u306F API \u304C 409 \u3067\u6B62\u307E\u308A\u307E\u3059\u3002\u5B9F\u884C\u3059\u308B\u5834\u5408\u306F execute \u30C4\u30FC\u30EB\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
3251
|
+
};
|
|
3252
|
+
}));
|
|
3253
|
+
server.tool(vpsToolName(brand, "get", "protection"), description4("\u64CD\u4F5C\u4FDD\u8B77\u3092\u53D6\u5F97\uFF08os_reinstall \u304C true \u306A\u3089 API \u304B\u3089\u306E\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3092\u62D2\u5426\uFF09"), { uuid }, readOnlyAnnotations, async ({ uuid: target }) => callApi(() => client.getVpsProtection(target)));
|
|
3254
|
+
server.tool(vpsToolName(brand, "update", "protection"), description4("\u64CD\u4F5C\u4FDD\u8B77\u3092\u5909\u66F4"), {
|
|
3255
|
+
uuid,
|
|
3256
|
+
os_reinstall: z31.boolean().describe("true \u3067\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3092\u62D2\u5426 / false \u3067\u89E3\u9664")
|
|
3257
|
+
}, destructiveWriteAnnotations, async ({ uuid: target, os_reinstall }) => callApi(() => client.updateVpsProtection(target, { os_reinstall })));
|
|
3258
|
+
server.tool(vpsToolName(brand, "list", "plans"), description4(`\u304A\u7533\u3057\u8FBC\u307F\u53EF\u80FD\u306A\u30D7\u30E9\u30F3\u30FB\u6599\u91D1\u30FBOS\u30A4\u30E1\u30FC\u30B8\u3092\u53D6\u5F97\u3002\u7533\u8FBC\u5BFE\u8C61\u306F ${vpsSignupScopeLabel(brand)} \u306E\u307F`), {}, readOnlyAnnotations, async () => callApi(() => client.listVpsPlans()));
|
|
3259
|
+
server.tool(vpsToolName(brand, "get", "signup_status"), description4("\u304A\u7533\u3057\u8FBC\u307F\u72B6\u6CC1\u3092\u78BA\u8A8D\uFF08id \u306F\u7533\u8FBC\u5FDC\u7B54\u306E\u30B5\u30FC\u30D3\u30B9\u30B3\u30FC\u30C9\uFF09"), { id: z31.number().int().positive().describe("\u65B0\u898F\u304A\u7533\u3057\u8FBC\u307F\u5FDC\u7B54\u306E id") }, readOnlyAnnotations, async ({ id }) => callApi(() => client.getVpsSignupStatus(String(id))));
|
|
3260
|
+
server.tool(vpsToolName(brand, "preview", "signup"), description4("\u8AB2\u91D1\u3055\u308C\u308BVPS\u65B0\u898F\u5951\u7D04\u3092 dry-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"), signupInput3(brand), billingPreviewAnnotations, async ({ agree_to_terms: _agreeToTerms, auto_renew, ...input }) => callApi(async () => billingPreviewResult(await client.registerVps({
|
|
3261
|
+
...input,
|
|
3262
|
+
auto_renew: auto_renew === "enabled",
|
|
3263
|
+
agree_to_terms: true,
|
|
3264
|
+
dry_run: true
|
|
3265
|
+
}), signupLegalNoticeLines(brand, "vps", input.plan_id))));
|
|
3266
|
+
if (options.enableHighRiskExecute) {
|
|
3267
|
+
server.tool(vpsToolName(brand, "execute", "signup"), description4(`\u660E\u793A\u627F\u8A8D\u5F8C\u306BVPS\u65B0\u898F\u5951\u7D04\u3092\u5B9F\u7533\u8ACB\uFF08\u8AB2\u91D1\u3055\u308C\u539F\u5247\u53D6\u308A\u6D88\u3057\u4E0D\u53EF\u3002\u5BFE\u8C61\u306F ${vpsSignupScopeLabel(brand)}\uFF09`), { ...signupInput3(brand), idempotency_key: idempotencyKey4 }, billingExecuteAnnotations, async ({ agree_to_terms: _agreeToTerms, idempotency_key, ...input }) => callApi(async () => {
|
|
3268
|
+
const data = {
|
|
3269
|
+
...input,
|
|
3270
|
+
auto_renew: input.auto_renew === "enabled",
|
|
3271
|
+
agree_to_terms: true
|
|
3272
|
+
};
|
|
3273
|
+
const preview = await client.registerVps({
|
|
3274
|
+
...data,
|
|
3275
|
+
dry_run: true
|
|
3276
|
+
});
|
|
3277
|
+
const totalPrice = Number(preview.total_price);
|
|
3278
|
+
if (!Number.isFinite(totalPrice)) {
|
|
3279
|
+
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");
|
|
3280
|
+
}
|
|
3281
|
+
if (totalPrice !== input.expected_total_price) {
|
|
3282
|
+
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`);
|
|
3283
|
+
}
|
|
3284
|
+
assertBillingFormElicitationSupported(server);
|
|
3285
|
+
const planName = await resolvePlanName(() => client.listVpsPlans(), input.plan_id);
|
|
3286
|
+
await confirmBillingOperation(server, {
|
|
3287
|
+
operation: signupOperationName(brand, "vps", input.plan_id),
|
|
3288
|
+
target: `${planLabel(input.plan_id, planName)} / \u5951\u7D04\u671F\u9593 ${input.period}\u304B\u6708 / ${input.image_id}`,
|
|
3289
|
+
targetLabel: "\u7533\u8FBC\u5185\u5BB9",
|
|
3290
|
+
details: compactDetails([
|
|
3291
|
+
autoRenewDetail(input.auto_renew === "enabled"),
|
|
3292
|
+
partnerCodeDetail(input.partner_code)
|
|
3293
|
+
]),
|
|
3294
|
+
legalNoticeLines: signupLegalNoticeLines(brand, "vps", input.plan_id),
|
|
3295
|
+
totalPrice,
|
|
3296
|
+
requireTermsAgreement: true
|
|
3297
|
+
});
|
|
3298
|
+
return client.registerVps({ ...data, dry_run: false }, idempotency_key);
|
|
3299
|
+
}));
|
|
3300
|
+
server.tool(vpsToolName(brand, "execute", "os_reinstall"), description4("\u660E\u793A\u627F\u8A8D\u5F8C\u306BOS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3092\u5B9F\u884C\uFF08\u30C7\u30FC\u30BF\u5168\u6D88\u53BB\u3002202 Accepted\u3002get_vps_os_reinstall \u3067\u78BA\u8A8D\uFF09"), osReinstallInput, destructiveNonIdempotentWriteAnnotations, async ({ uuid: target, image_id, root_password, ...optional }) => callApi(async () => {
|
|
3301
|
+
const protection = await protectionEnabled(client, target);
|
|
3302
|
+
await confirmOsReinstallOperation(server, {
|
|
3303
|
+
uuid: target,
|
|
3304
|
+
imageId: image_id,
|
|
3305
|
+
protectionEnabled: protection
|
|
3306
|
+
});
|
|
3307
|
+
const result = await client.reinstallVpsOs(target, {
|
|
3308
|
+
image_id,
|
|
3309
|
+
root_password,
|
|
3310
|
+
...optional
|
|
3311
|
+
});
|
|
3312
|
+
return {
|
|
3313
|
+
...result,
|
|
3314
|
+
...acceptedNextStep(vpsToolName(brand, "get", "os_reinstall"))
|
|
3315
|
+
};
|
|
3316
|
+
}));
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
|
|
2622
3320
|
// ../core/dist/tools/index.js
|
|
2623
|
-
function registerServerTools(server, client, brand, resolver) {
|
|
3321
|
+
function registerServerTools(server, client, brand, resolver, options = {}) {
|
|
3322
|
+
registerServerAccountTools(server, client, brand, options);
|
|
2624
3323
|
const targetServer = resolver ? withServerTargetResolution(server, resolver) : server;
|
|
2625
3324
|
const targetClient = resolver?.client ?? client;
|
|
2626
3325
|
registerServerInfoTools(targetServer, targetClient, brand);
|
|
@@ -2654,18 +3353,21 @@ function registerServerTools(server, client, brand, resolver) {
|
|
|
2654
3353
|
function registerAllTools(server, client, brand, service = "server", options = {}) {
|
|
2655
3354
|
const services = Array.isArray(service) ? [...new Set(service)] : [service];
|
|
2656
3355
|
if (services.includes("server")) {
|
|
2657
|
-
registerServerTools(server, client, brand, options.serverTargetResolver);
|
|
3356
|
+
registerServerTools(server, client, brand, options.serverTargetResolver, options);
|
|
2658
3357
|
}
|
|
2659
3358
|
if (services.includes("domain")) {
|
|
2660
3359
|
registerDomainServiceTools(server, client, brand, options);
|
|
2661
3360
|
}
|
|
2662
3361
|
if (services.includes("wphosting")) {
|
|
2663
|
-
registerWphostingTools(server, client, brand);
|
|
3362
|
+
registerWphostingTools(server, client, brand, options);
|
|
3363
|
+
}
|
|
3364
|
+
if (services.includes("vps")) {
|
|
3365
|
+
registerVpsTools(server, client, brand, options);
|
|
2664
3366
|
}
|
|
2665
3367
|
}
|
|
2666
3368
|
|
|
2667
3369
|
// ../core/dist/index.js
|
|
2668
|
-
var MCP_SERVICES = ["server", "domain", "wphosting"];
|
|
3370
|
+
var MCP_SERVICES = ["server", "domain", "wphosting", "vps"];
|
|
2669
3371
|
function optionValue(argv, index) {
|
|
2670
3372
|
const arg = argv[index];
|
|
2671
3373
|
if (arg === "--services") {
|
|
@@ -2733,6 +3435,11 @@ XSERVER_SERVERNAME\u7B49\u304C\u3042\u308B\u5834\u5408\u306F\u305D\u306E\u30B5\u
|
|
|
2733
3435
|
\u5BFE\u8C61\u306Fcontract_id\uFF08\u5951\u7D04\uFF09\u3068site servername\uFF08\u672C\u756A\u307E\u305F\u306F\u30B9\u30C6\u30FC\u30B8\u30F3\u30B0\u74B0\u5883\uFF09\u306E2\u8EF8\u3067\u5FC5\u305A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u66F8\u304D\u8FBC\u307F\u524D\u306B\u4E21\u65B9\u3092\u5229\u7528\u8005\u3078\u63D0\u793A\u3057\u3001\u5BFE\u8C61\u304C\u66D6\u6627\u306A\u3089\u63A8\u6E2C\u305B\u305A\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
2734
3436
|
202\u64CD\u4F5C\u306Foperations API\u3092\u4F7F\u308F\u305A\u3001\u5404\u30C4\u30FC\u30EB\u8AAC\u660E\u306B\u8A18\u8F09\u3057\u305F\u30B5\u30A4\u30C8\u3001\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3001\u5FA9\u5143\u5C65\u6B74\u306E\u78BA\u8A8D\u5148\u3067status\u307E\u305F\u306F\u5BFE\u8C61\u306E\u6D88\u5931\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
2735
3437
|
\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`);
|
|
3438
|
+
}
|
|
3439
|
+
if (services.includes("vps")) {
|
|
3440
|
+
sections.push(`VPS \u2014 ${brand.displayName}\u306EVPS\u3092\u7BA1\u7406\u3057\u307E\u3059\u3002\u5BFE\u8C61\u306F uuid \u3067\u3059\u3002Star8 \u306B VPS \u306F\u3042\u308A\u307E\u305B\u3093\u3002
|
|
3441
|
+
\u96FB\u6E90\u64CD\u4F5C\u3068OS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u306F202 Accepted\uFF08\u672C\u6587\u306A\u3057\uFF0BLocation\uFF09\u3067\u3059\u3002\u30C4\u30FC\u30EB\u5185\u3067\u5B8C\u4E86\u307E\u3067\u5F85\u305F\u305A\u3001get_vps_power / get_vps_os_reinstall \u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
3442
|
+
OS\u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u306F\u30C7\u30FC\u30BF\u5168\u6D88\u53BB\u3067\u3059\u3002execute \u306E\u524D\u306B protection \u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3001form elicitation \u306B\u3088\u308B\u627F\u8A8D\u304C\u5FC5\u9808\u3067\u3059\u3002\u65B0\u898F\u304A\u7533\u3057\u8FBC\u307F\u306F ${vpsSignupScopeLabel(brand)} \u306E\u307F\u3067\u3001\u8AB2\u91D1 execute \u306E\u524D\u306B preview \u304C\u5FC5\u8981\u3067\u3059\u3002`);
|
|
2736
3443
|
}
|
|
2737
3444
|
return `${brand.displayName} MCP \u2014 \u6709\u52B9\u306A\u30B5\u30FC\u30D3\u30B9: ${services.join(", ")}
|
|
2738
3445
|
|
|
@@ -2743,12 +3450,16 @@ ${common}`;
|
|
|
2743
3450
|
async function run(brand, options) {
|
|
2744
3451
|
const envPrefix = brand.brand.toUpperCase();
|
|
2745
3452
|
const apiKey = process.env[`${envPrefix}_API_KEY`] ?? process.env["XSERVER_API_KEY"];
|
|
2746
|
-
const
|
|
3453
|
+
const servername3 = process.env[`${envPrefix}_SERVERNAME`] ?? process.env["XSERVER_SERVERNAME"];
|
|
2747
3454
|
const baseUrl = process.env[`${envPrefix}_API_BASE_URL`];
|
|
2748
3455
|
const enableHighRiskExecute = (process.env[`${envPrefix}_MCP_ENABLE_HIGH_RISK_EXECUTE`] ?? process.env.XSERVER_MCP_ENABLE_HIGH_RISK_EXECUTE) === "1";
|
|
2749
3456
|
let services;
|
|
2750
3457
|
try {
|
|
2751
|
-
const supportedServices =
|
|
3458
|
+
const supportedServices = ["server", "domain"];
|
|
3459
|
+
if (brand.brand === "xserver")
|
|
3460
|
+
supportedServices.push("wphosting");
|
|
3461
|
+
if (brand.brand === "xserver" || brand.brand === "shincloud")
|
|
3462
|
+
supportedServices.push("vps");
|
|
2752
3463
|
services = parseMcpServices(process.argv.slice(2), supportedServices);
|
|
2753
3464
|
} catch (error) {
|
|
2754
3465
|
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -2763,12 +3474,12 @@ async function run(brand, options) {
|
|
|
2763
3474
|
const client = new ApiClient({
|
|
2764
3475
|
apiKey,
|
|
2765
3476
|
apiBase,
|
|
2766
|
-
servername:
|
|
3477
|
+
servername: servername3
|
|
2767
3478
|
});
|
|
2768
3479
|
const serverTargetResolver = services.includes("server") ? new ServerTargetResolver({
|
|
2769
3480
|
apiKey,
|
|
2770
3481
|
apiBase,
|
|
2771
|
-
fixedServername:
|
|
3482
|
+
fixedServername: servername3
|
|
2772
3483
|
}) : void 0;
|
|
2773
3484
|
const server = new McpServer({
|
|
2774
3485
|
name: options.name,
|
|
@@ -2787,7 +3498,7 @@ async function run(brand, options) {
|
|
|
2787
3498
|
// package.json
|
|
2788
3499
|
var package_default = {
|
|
2789
3500
|
name: "xserver-mcp",
|
|
2790
|
-
version: "1.
|
|
3501
|
+
version: "1.5.0",
|
|
2791
3502
|
description: "Official MCP server for XServer API \u2014 manage your XServer hosting from AI assistants",
|
|
2792
3503
|
type: "module",
|
|
2793
3504
|
bin: {
|
|
@@ -2837,8 +3548,27 @@ await run({
|
|
|
2837
3548
|
brand: "xserver",
|
|
2838
3549
|
apiBase: "https://api.xserver.ne.jp",
|
|
2839
3550
|
displayName: "XServer",
|
|
3551
|
+
serverServiceName: "XServer \u30EC\u30F3\u30BF\u30EB\u30B5\u30FC\u30D0\u30FC",
|
|
3552
|
+
wphostingServiceName: "XServer for WordPress",
|
|
2840
3553
|
domainTermsUrl: "https://www.xdomain.ne.jp/rule/rule.php",
|
|
2841
3554
|
domainPrivacyUrl: "https://www.xdomain.ne.jp/privacy_announcement.php",
|
|
3555
|
+
serverTermsUrl: "https://www.xserver.ne.jp/rule/rule.php",
|
|
3556
|
+
serverPrivacyUrl: "https://www.xserver.ne.jp/privacy_announcement.php",
|
|
3557
|
+
// XServerビジネスは server サービスに `xbiz-` 接頭辞のプランとして同居しており、
|
|
3558
|
+
// サービス名・規約URLが XS とは別。plan_id で出し分ける(CLI 側と同じ設定)。
|
|
3559
|
+
serverPlanOverrides: [
|
|
3560
|
+
{
|
|
3561
|
+
planIdPrefix: "xbiz-",
|
|
3562
|
+
serviceName: "XServer\u30D3\u30B8\u30CD\u30B9",
|
|
3563
|
+
termsUrl: "https://business.xserver.ne.jp/rule.php",
|
|
3564
|
+
privacyUrl: "https://business.xserver.ne.jp/privacy_announcement.php"
|
|
3565
|
+
}
|
|
3566
|
+
],
|
|
3567
|
+
wphostingTermsUrl: "https://wp.xserver.ne.jp/rule/rule.php",
|
|
3568
|
+
wphostingPrivacyUrl: "https://wp.xserver.ne.jp/privacy_announcement.php",
|
|
3569
|
+
vpsServiceName: "XServer VPS",
|
|
3570
|
+
vpsTermsUrl: "https://vps.xserver.ne.jp/rule/rule.php",
|
|
3571
|
+
vpsPrivacyUrl: "https://vps.xserver.ne.jp/privacy_announcement.php",
|
|
2842
3572
|
commandName: "xserver-mcp",
|
|
2843
3573
|
configDir: "xserver-mcp"
|
|
2844
3574
|
}, {
|