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