shincloud-cli 1.1.0 → 1.2.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/dist/index.js CHANGED
@@ -330,6 +330,138 @@ var ApiClient = class {
330
330
  return this.delete(`${this.serverPath()}/ssh/key/${enc(keyId)}`);
331
331
  }
332
332
  // ================================================================
333
+ // リソースモニター
334
+ // ================================================================
335
+ async getResourceMonitor(date) {
336
+ return this.get(`${this.serverPath()}/resource-monitor`, { date });
337
+ }
338
+ // ================================================================
339
+ // WAF設定
340
+ // ================================================================
341
+ async listWaf(params) {
342
+ return this.get(`${this.serverPath()}/waf`, params);
343
+ }
344
+ async updateWaf(domain, data) {
345
+ return this.put(`${this.serverPath()}/waf/${enc(domain)}`, data);
346
+ }
347
+ // ================================================================
348
+ // php.ini設定
349
+ // ================================================================
350
+ async listPhpIni(params) {
351
+ return this.get(`${this.serverPath()}/php-ini`, params);
352
+ }
353
+ async updatePhpIni(domain, data) {
354
+ return this.put(`${this.serverPath()}/php-ini/${enc(domain)}`, data);
355
+ }
356
+ async resetPhpIni(domain) {
357
+ return this.post(`${this.serverPath()}/php-ini/${enc(domain)}/reset`);
358
+ }
359
+ // ================================================================
360
+ // WordPressセキュリティ設定
361
+ // ================================================================
362
+ async getWordPressSecurity(params) {
363
+ return this.get(`${this.serverPath()}/wordpress-security`, params);
364
+ }
365
+ async updateWordPressSecurity(data) {
366
+ return this.post(`${this.serverPath()}/wordpress-security`, data);
367
+ }
368
+ // ================================================================
369
+ // Xアクセラレータ設定
370
+ // ================================================================
371
+ async listXAccelerator(params) {
372
+ return this.get(`${this.serverPath()}/x-accelerator`, params);
373
+ }
374
+ async updateXAccelerator(domain, data) {
375
+ return this.put(`${this.serverPath()}/x-accelerator/${enc(domain)}`, data);
376
+ }
377
+ // ================================================================
378
+ // サーバーキャッシュ設定
379
+ // ================================================================
380
+ async listServerCache(params) {
381
+ return this.get(`${this.serverPath()}/server-cache`, params);
382
+ }
383
+ async updateServerCache(domain, data) {
384
+ return this.put(`${this.serverPath()}/server-cache/${enc(domain)}`, data);
385
+ }
386
+ async clearServerCache(domain) {
387
+ return this.delete(`${this.serverPath()}/server-cache/${enc(domain)}/cache`);
388
+ }
389
+ // ================================================================
390
+ // ブラウザキャッシュ設定
391
+ // ================================================================
392
+ async listBrowserCache(params) {
393
+ return this.get(`${this.serverPath()}/browser-cache`, params);
394
+ }
395
+ async updateBrowserCache(domain, data) {
396
+ return this.put(`${this.serverPath()}/browser-cache/${enc(domain)}`, data);
397
+ }
398
+ // ================================================================
399
+ // サイト転送設定
400
+ // ================================================================
401
+ async listUrlRedirect(params) {
402
+ return this.get(`${this.serverPath()}/url-redirect`, params);
403
+ }
404
+ async addUrlRedirect(data) {
405
+ return this.post(`${this.serverPath()}/url-redirect`, data);
406
+ }
407
+ async deleteUrlRedirect(redirectId) {
408
+ return this.delete(`${this.serverPath()}/url-redirect/${enc(redirectId)}`);
409
+ }
410
+ // ================================================================
411
+ // アクセス拒否設定
412
+ // ================================================================
413
+ async listAccessDeny(params) {
414
+ return this.get(`${this.serverPath()}/access-deny`, params);
415
+ }
416
+ async addAccessDeny(data) {
417
+ return this.post(`${this.serverPath()}/access-deny`, data);
418
+ }
419
+ async updateAccessDeny(denyId, data) {
420
+ return this.put(`${this.serverPath()}/access-deny/${enc(denyId)}`, data);
421
+ }
422
+ async deleteAccessDeny(denyId) {
423
+ return this.delete(`${this.serverPath()}/access-deny/${enc(denyId)}`);
424
+ }
425
+ // ================================================================
426
+ // XPageSpeed設定
427
+ // ================================================================
428
+ async listXPageSpeed(params) {
429
+ return this.get(`${this.serverPath()}/xpagespeed`, params);
430
+ }
431
+ async updateXPageSpeed(domain, data) {
432
+ return this.put(`${this.serverPath()}/xpagespeed/${enc(domain)}`, data);
433
+ }
434
+ // ================================================================
435
+ // 自動バックアップの取得・復元
436
+ // ================================================================
437
+ async listAutoBackupBackupDates() {
438
+ return this.get(`${this.serverPath()}/auto-backup/backup-dates`);
439
+ }
440
+ async listAutoBackup() {
441
+ return this.get(`${this.serverPath()}/auto-backup`);
442
+ }
443
+ async getAutoBackup(requestId) {
444
+ return this.get(`${this.serverPath()}/auto-backup/${enc(requestId)}`);
445
+ }
446
+ async createAutoBackup(data) {
447
+ return this.post(`${this.serverPath()}/auto-backup`, data);
448
+ }
449
+ // ================================================================
450
+ // MySQLバックアップの取得・復元
451
+ // ================================================================
452
+ async listMysqlBackupDatabases() {
453
+ return this.get(`${this.serverPath()}/mysql-backup/databases`);
454
+ }
455
+ async listMysqlBackup() {
456
+ return this.get(`${this.serverPath()}/mysql-backup`);
457
+ }
458
+ async getMysqlBackup(requestId) {
459
+ return this.get(`${this.serverPath()}/mysql-backup/${enc(requestId)}`);
460
+ }
461
+ async createMysqlBackup(data) {
462
+ return this.post(`${this.serverPath()}/mysql-backup`, data);
463
+ }
464
+ // ================================================================
333
465
  // ログ
334
466
  // ================================================================
335
467
  async getAccessLog(params) {
@@ -500,13 +632,19 @@ function formatTable(data) {
500
632
  const obj = data;
501
633
  const arrayEntry = Object.entries(obj).find(([, v]) => Array.isArray(v) && (v.length === 0 || typeof v[0] === "object" && v[0] !== null));
502
634
  if (arrayEntry) {
503
- const scalarEntries = Object.entries(obj).filter(([k]) => k !== arrayEntry[0]);
635
+ const [arrayKey, arrayValue] = arrayEntry;
636
+ const scalarEntries = Object.entries(obj).filter(([k]) => k !== arrayKey);
504
637
  const parts = [];
505
638
  if (scalarEntries.length > 0) {
506
639
  parts.push(renderKeyValueTable(Object.fromEntries(scalarEntries)));
507
640
  parts.push("");
508
641
  }
509
- parts.push(renderArrayTable(arrayEntry[1]));
642
+ const items = arrayValue;
643
+ if (items.length === 0) {
644
+ parts.push(scalarEntries.length > 0 ? `${arrayKey} (0\u4EF6)` : "(\u30C7\u30FC\u30BF\u306A\u3057)");
645
+ } else {
646
+ parts.push(renderArrayTable(items));
647
+ }
510
648
  return parts.join("\n");
511
649
  }
512
650
  return renderKeyValueTable(obj);
@@ -522,10 +660,23 @@ function renderKeyValueTable(obj) {
522
660
  const lines = entries.map((e) => `${padRight(e.key, maxKeyLen)} ${e.value}`);
523
661
  return lines.join("\n");
524
662
  }
663
+ function collectTableKeys(items) {
664
+ const keys = [];
665
+ const seen = /* @__PURE__ */ new Set();
666
+ for (const item of items) {
667
+ for (const key of Object.keys(item)) {
668
+ if (!seen.has(key)) {
669
+ seen.add(key);
670
+ keys.push(key);
671
+ }
672
+ }
673
+ }
674
+ return keys;
675
+ }
525
676
  function renderArrayTable(items) {
526
677
  if (items.length === 0)
527
678
  return "(\u30C7\u30FC\u30BF\u306A\u3057)";
528
- const keys = Object.keys(items[0]);
679
+ const keys = collectTableKeys(items);
529
680
  const colWidths = keys.map((key) => {
530
681
  const headerWidth = displayWidth(key);
531
682
  const maxDataWidth = Math.max(...items.map((item) => displayWidth(formatValue(item[key]))));
@@ -1455,6 +1606,495 @@ function registerLogCommands(parent, brand) {
1455
1606
  });
1456
1607
  }
1457
1608
 
1609
+ // ../core/dist/commands/server/resource-monitor/index.js
1610
+ function registerResourceMonitorCommands(parent, brand) {
1611
+ const resourceMonitor = parent.command("resource-monitor").description("\u30EA\u30BD\u30FC\u30B9\u30E2\u30CB\u30BF\u30FC");
1612
+ resourceMonitor.command("get").description("\u6307\u5B9A\u65E5\u306ECPU\u30FB\u30E1\u30E2\u30EA\u30FB\u8EE2\u9001\u91CF\u6642\u7CFB\u5217\u3092\u53D6\u5F97").requiredOption("--date <date>", "\u5BFE\u8C61\u65E5\uFF08Y-m-d \u307E\u305F\u306F Ymd\u3002\u5F53\u65E5\u542B\u3080\u76F4\u8FD11\u304B\u6708\uFF09").action(async (opts) => {
1613
+ const client = resolveClient(parent, brand);
1614
+ printResult(await client.getResourceMonitor(opts.date), getFormat(parent));
1615
+ });
1616
+ }
1617
+
1618
+ // ../core/dist/commands/server/waf/index.js
1619
+ function registerWafCommands(parent, brand) {
1620
+ const waf = parent.command("waf").description("WAF\u8A2D\u5B9A");
1621
+ waf.command("list").description("WAF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
1622
+ const client = resolveClient(parent, brand);
1623
+ const params = {};
1624
+ if (opts.domain)
1625
+ params.domain = opts.domain;
1626
+ printResult(await client.listWaf(params), getFormat(parent));
1627
+ });
1628
+ waf.command("update <domain>").description("WAF\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09").option("--xss-protection <value>", "XSS\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--sql-injection-protection <value>", "SQL\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--file-protection <value>", "\u30D5\u30A1\u30A4\u30EB\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--mail-protection <value>", "\u30E1\u30FC\u30EB\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--command-protection <value>", "\u30B3\u30DE\u30F3\u30C9\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").option("--php-protection <value>", "PHP\u5BFE\u7B56\uFF08true/false \u307E\u305F\u306F 1/0\uFF09").action(async (domain, opts) => {
1629
+ const data = {};
1630
+ if (opts.xssProtection !== void 0)
1631
+ data.xss_protection = opts.xssProtection;
1632
+ if (opts.sqlInjectionProtection !== void 0)
1633
+ data.sql_injection_protection = opts.sqlInjectionProtection;
1634
+ if (opts.fileProtection !== void 0)
1635
+ data.file_protection = opts.fileProtection;
1636
+ if (opts.mailProtection !== void 0)
1637
+ data.mail_protection = opts.mailProtection;
1638
+ if (opts.commandProtection !== void 0)
1639
+ data.command_protection = opts.commandProtection;
1640
+ if (opts.phpProtection !== void 0)
1641
+ data.php_protection = opts.phpProtection;
1642
+ if (Object.keys(data).length === 0) {
1643
+ throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
1644
+ }
1645
+ const client = resolveClient(parent, brand);
1646
+ printResult(await client.updateWaf(domain, data), getFormat(parent));
1647
+ });
1648
+ }
1649
+
1650
+ // ../core/dist/commands/server/php-ini/index.js
1651
+ var PHP_INI_UPDATE_OPTIONS = [
1652
+ { cli: "display-errors", api: "display_errors", desc: "\u30A8\u30E9\u30FC\u5185\u5BB9\u3092\u753B\u9762\u306B\u51FA\u529B\uFF08On / Off\uFF09" },
1653
+ { cli: "error-reporting", api: "error_reporting", desc: "\u30A8\u30E9\u30FC\u51FA\u529B\u30EC\u30D9\u30EB" },
1654
+ { cli: "display-startup-errors", api: "display_startup_errors", desc: "\u8D77\u52D5\u6642\u30A8\u30E9\u30FC\u3092\u8868\u793A\uFF08On / Off\uFF09" },
1655
+ { cli: "session-auto-start", api: "session.auto_start", desc: "\u30BB\u30C3\u30B7\u30E7\u30F3\u81EA\u52D5\u958B\u59CB\uFF080 / 1\uFF09" },
1656
+ { cli: "session-name", api: "session.name", desc: "\u30BB\u30C3\u30B7\u30E7\u30F3\u540D" },
1657
+ { cli: "session-use-cookies", api: "session.use_cookies", desc: "\u30BB\u30C3\u30B7\u30E7\u30F3ID\u306B\u30AF\u30C3\u30AD\u30FC\u3092\u4F7F\u7528\uFF080 / 1\uFF09" },
1658
+ { cli: "session-use-only-cookies", api: "session.use_only_cookies", desc: "\u30AF\u30C3\u30AD\u30FC\u306E\u307F\u3067\u30BB\u30C3\u30B7\u30E7\u30F3ID\u3092\u4FDD\u5B58\uFF080 / 1\uFF09" },
1659
+ { cli: "session-use-trans-sid", api: "session.use_trans_sid", desc: "URL\u3078\u30BB\u30C3\u30B7\u30E7\u30F3ID\u3092\u81EA\u52D5\u8A2D\u5B9A\uFF080 / 1\uFF09" },
1660
+ { cli: "session-cookie-lifetime", api: "session.cookie_lifetime", desc: "\u30AF\u30C3\u30AD\u30FC\u6709\u52B9\u671F\u9593\uFF08\u79D2\uFF09" },
1661
+ { cli: "session-cookie-path", api: "session.cookie_path", desc: "\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30D1\u30B9" },
1662
+ { cli: "session-cookie-domain", api: "session.cookie_domain", desc: "\u30AF\u30C3\u30AD\u30FC\u3092\u6709\u52B9\u3068\u3059\u308B\u30C9\u30E1\u30A4\u30F3" },
1663
+ { cli: "mbstring-language", api: "mbstring.language", desc: "\u30C7\u30D5\u30A9\u30EB\u30C8\u8A00\u8A9E" },
1664
+ { cli: "mbstring-internal-encoding", api: "mbstring.internal_encoding", desc: "\u5185\u90E8\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0" },
1665
+ { cli: "mbstring-http-input", api: "mbstring.http_input", desc: "HTTP\u5165\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB" },
1666
+ { cli: "mbstring-http-output", api: "mbstring.http_output", desc: "HTTP\u51FA\u529B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5909\u63DB" },
1667
+ { cli: "mbstring-encoding-translation", api: "mbstring.encoding_translation", desc: "\u5185\u90E8\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3078\u306E\u5909\u63DB\uFF08On / Off\uFF09" },
1668
+ { cli: "mbstring-detect-order", api: "mbstring.detect_order", desc: "\u6587\u5B57\u30B3\u30FC\u30C9\u691C\u51FA" },
1669
+ { cli: "mbstring-substitute-character", api: "mbstring.substitute_character", desc: "\u7121\u52B9\u6587\u5B57\u306E\u4EE3\u66FF\u6587\u5B57" },
1670
+ { cli: "max-execution-time", api: "max_execution_time", desc: "\u6700\u5927\u5B9F\u884C\u6642\u9593\uFF08\u79D2\uFF09" },
1671
+ { cli: "max-input-time", api: "max_input_time", desc: "\u5165\u529B\u30D1\u30FC\u30B9\u6700\u5927\u6642\u9593\uFF08\u79D2\uFF09" },
1672
+ { cli: "memory-limit", api: "memory_limit", desc: "\u6700\u5927\u30E1\u30E2\u30EA" },
1673
+ { cli: "post-max-size", api: "post_max_size", desc: "POST\u30C7\u30FC\u30BF\u6700\u5927\u30B5\u30A4\u30BA" },
1674
+ { cli: "upload-max-filesize", api: "upload_max_filesize", desc: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u30D5\u30A1\u30A4\u30EB\u6700\u5927\u30B5\u30A4\u30BA" },
1675
+ { cli: "register-globals", api: "register_globals", desc: "register_globals\uFF08On / Off\uFF09" },
1676
+ { cli: "magic-quotes-gpc", api: "magic_quotes_gpc", desc: "magic_quotes_gpc\uFF08On / Off\uFF09" },
1677
+ { cli: "safe-mode", api: "safe_mode", desc: "safe_mode\uFF08On / Off\u3002user_ini_active \u304C true \u306E\u3068\u304D\u306F\u5909\u66F4\u4E0D\u53EF\uFF09" },
1678
+ { cli: "file-uploads", api: "file_uploads", desc: "HTTP\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\uFF08On / Off\u3002user_ini_active \u304C true \u306E\u3068\u304D\u306F\u5909\u66F4\u4E0D\u53EF\uFF09" },
1679
+ { cli: "allow-url-fopen", api: "allow_url_fopen", desc: "allow_url_fopen\uFF08On / Off\u3002user_ini_active \u304C true \u306E\u3068\u304D\u306F\u5909\u66F4\u4E0D\u53EF\uFF09" },
1680
+ { cli: "allow-url-include", api: "allow_url_include", desc: "allow_url_include\uFF08On / Off\u3002user_ini_active \u304C true \u306E\u3068\u304D\u306F\u5909\u66F4\u4E0D\u53EF\uFF09" }
1681
+ ];
1682
+ function cliOptionToCamelCase(cli) {
1683
+ return cli.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
1684
+ }
1685
+ function buildUpdateData(opts) {
1686
+ const data = {};
1687
+ for (const { cli, api } of PHP_INI_UPDATE_OPTIONS) {
1688
+ const value = opts[cliOptionToCamelCase(cli)];
1689
+ if (value !== void 0)
1690
+ data[api] = value;
1691
+ }
1692
+ return data;
1693
+ }
1694
+ function registerPhpIniCommands(parent, brand) {
1695
+ const phpIni = parent.command("php-ini").description("php.ini\u8A2D\u5B9A\uFF08php-version \u3068\u306F\u5225\uFF09");
1696
+ phpIni.command("list").description("php.ini\u8A2D\u5B9A\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
1697
+ const client = resolveClient(parent, brand);
1698
+ const params = {};
1699
+ if (opts.domain)
1700
+ params.domain = opts.domain;
1701
+ printResult(await client.listPhpIni(params), getFormat(parent));
1702
+ });
1703
+ const update = phpIni.command("update <domain>").description("php.ini\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09");
1704
+ for (const { cli, desc } of PHP_INI_UPDATE_OPTIONS) {
1705
+ update.option(`--${cli} <value>`, desc);
1706
+ }
1707
+ update.action(async (domain, opts) => {
1708
+ const data = buildUpdateData(opts);
1709
+ if (Object.keys(data).length === 0) {
1710
+ throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
1711
+ }
1712
+ const client = resolveClient(parent, brand);
1713
+ printResult(await client.updatePhpIni(domain, data), getFormat(parent));
1714
+ });
1715
+ phpIni.command("reset <domain>").description("php.ini\u8A2D\u5B9A\u3092\u521D\u671F\u5024\u306B\u623B\u3059").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(async (domain) => {
1716
+ await confirmDestructiveAction(parent, `\u30C9\u30E1\u30A4\u30F3 "${domain}" \u306E php.ini \u3092\u521D\u671F\u5024\u306B\u623B\u3057\u307E\u3059\u3002\u3053\u306E\u64CD\u4F5C\u306F\u53D6\u308A\u6D88\u3057\u3067\u304D\u307E\u305B\u3093\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
1717
+ const client = resolveClient(parent, brand);
1718
+ printResult(await client.resetPhpIni(domain), getFormat(parent));
1719
+ });
1720
+ }
1721
+
1722
+ // ../core/dist/commands/server/wordpress-security/index.js
1723
+ var UPDATE_BLOCKS = [
1724
+ "comment_restriction",
1725
+ "login_attempt_limit",
1726
+ "foreign_ip_restriction",
1727
+ "ip_restriction"
1728
+ ];
1729
+ var UPDATE_OPTIONS = [
1730
+ { cli: "comment-restriction-bulk-post-enabled", desc: "\u5358\u4E00\u30E6\u30FC\u30B6\u30FC\u304B\u3089\u306E\u5927\u91CF\u6295\u7A3F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1731
+ { cli: "comment-restriction-foreign-post-enabled", desc: "\u56FD\u5916\u304B\u3089\u306E\u6295\u7A3F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1732
+ { cli: "login-attempt-limit-enabled", desc: "\u30ED\u30B0\u30A4\u30F3\u8A66\u884C\u56DE\u6570\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1733
+ { cli: "foreign-ip-dashboard-enabled", desc: "\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9 \u30A2\u30AF\u30BB\u30B9\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1734
+ { cli: "foreign-ip-dashboard-allowed-ips", desc: '\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9 \u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' },
1735
+ { cli: "foreign-ip-xml-rpc-api-enabled", desc: "XML-RPC API \u30A2\u30AF\u30BB\u30B9\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1736
+ { cli: "foreign-ip-xml-rpc-api-allowed-ips", desc: 'XML-RPC API \u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' },
1737
+ { cli: "foreign-ip-rest-api-enabled", desc: "REST API \u30A2\u30AF\u30BB\u30B9\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1738
+ { cli: "foreign-ip-rest-api-allowed-ips", desc: 'REST API \u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' },
1739
+ { cli: "foreign-ip-wlwmanifest-enabled", desc: "wlwmanifest.xml \u30A2\u30AF\u30BB\u30B9\u5236\u9650\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1740
+ { cli: "foreign-ip-wlwmanifest-allowed-ips", desc: 'wlwmanifest.xml \u30A2\u30AF\u30BB\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' },
1741
+ { cli: "ip-restriction-enabled", desc: "IP\u30A2\u30C9\u30EC\u30B9\u5236\u9650\uFF08\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\uFF09\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1742
+ { cli: "ip-restriction-allowed-ips", desc: 'IP\u30A2\u30C9\u30EC\u30B9\u5236\u9650\u306E\u30DB\u30EF\u30A4\u30C8\u30EA\u30B9\u30C8\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A IPv4 \u307E\u305F\u306F CIDR\u3002\u901A\u5E38\u306F\u30AF\u30A9\u30FC\u30C8\u4E0D\u8981\u3002\u7A7A\u306B\u3059\u308B\u5834\u5408\u306E\u307F ""\uFF09' }
1743
+ ];
1744
+ function parseIpAddressList(value) {
1745
+ if (value === "") {
1746
+ return [];
1747
+ }
1748
+ return value.split(",").map((a) => a.trim()).filter((a) => a !== "");
1749
+ }
1750
+ function parseBooleanParam(label, value) {
1751
+ const normalized = value.trim().toLowerCase();
1752
+ if (normalized !== "true" && normalized !== "false" && normalized !== "1" && normalized !== "0") {
1753
+ throw new ApiError("\u5165\u529B\u5024\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093", 422, "VALIDATION_ERROR", [`${label}\u306F true/false \u307E\u305F\u306F 1/0 \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`]);
1754
+ }
1755
+ return normalized === "true" || normalized === "1";
1756
+ }
1757
+ function setForeignIpTarget(block, target, enabledLabel, enabled, allowedIps) {
1758
+ const entry = {};
1759
+ if (enabled !== void 0)
1760
+ entry.enabled = parseBooleanParam(enabledLabel, enabled);
1761
+ if (allowedIps !== void 0)
1762
+ entry.allowed_ip_addresses = parseIpAddressList(allowedIps);
1763
+ if (Object.keys(entry).length > 0)
1764
+ block[target] = entry;
1765
+ }
1766
+ function buildUpdateData2(domain, opts) {
1767
+ const data = { domain };
1768
+ const commentRestriction = {};
1769
+ if (opts.commentRestrictionBulkPostEnabled !== void 0) {
1770
+ commentRestriction.bulk_post = {
1771
+ enabled: parseBooleanParam("\u5358\u4E00\u30E6\u30FC\u30B6\u30FC\u304B\u3089\u306E\u5927\u91CF\u6295\u7A3F", opts.commentRestrictionBulkPostEnabled)
1772
+ };
1773
+ }
1774
+ if (opts.commentRestrictionForeignPostEnabled !== void 0) {
1775
+ commentRestriction.foreign_post = {
1776
+ enabled: parseBooleanParam("\u56FD\u5916\u304B\u3089\u306E\u6295\u7A3F", opts.commentRestrictionForeignPostEnabled)
1777
+ };
1778
+ }
1779
+ if (Object.keys(commentRestriction).length > 0) {
1780
+ data.comment_restriction = commentRestriction;
1781
+ }
1782
+ if (opts.loginAttemptLimitEnabled !== void 0) {
1783
+ data.login_attempt_limit = {
1784
+ enabled: parseBooleanParam("\u30ED\u30B0\u30A4\u30F3\u8A66\u884C\u56DE\u6570\u5236\u9650", opts.loginAttemptLimitEnabled)
1785
+ };
1786
+ }
1787
+ const foreignIpRestriction = {};
1788
+ setForeignIpTarget(foreignIpRestriction, "dashboard", "\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9 \u30A2\u30AF\u30BB\u30B9\u5236\u9650", opts.foreignIpDashboardEnabled, opts.foreignIpDashboardAllowedIps);
1789
+ setForeignIpTarget(foreignIpRestriction, "xml_rpc_api", "XML-RPC API \u30A2\u30AF\u30BB\u30B9\u5236\u9650", opts.foreignIpXmlRpcApiEnabled, opts.foreignIpXmlRpcApiAllowedIps);
1790
+ setForeignIpTarget(foreignIpRestriction, "rest_api", "REST API \u30A2\u30AF\u30BB\u30B9\u5236\u9650", opts.foreignIpRestApiEnabled, opts.foreignIpRestApiAllowedIps);
1791
+ setForeignIpTarget(foreignIpRestriction, "wlwmanifest", "wlwmanifest.xml \u30A2\u30AF\u30BB\u30B9\u5236\u9650", opts.foreignIpWlwmanifestEnabled, opts.foreignIpWlwmanifestAllowedIps);
1792
+ if (Object.keys(foreignIpRestriction).length > 0) {
1793
+ data.foreign_ip_restriction = foreignIpRestriction;
1794
+ }
1795
+ const ipRestriction = {};
1796
+ if (opts.ipRestrictionEnabled !== void 0) {
1797
+ ipRestriction.enabled = parseBooleanParam("IP\u30A2\u30C9\u30EC\u30B9\u5236\u9650\uFF08\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\uFF09", opts.ipRestrictionEnabled);
1798
+ }
1799
+ if (opts.ipRestrictionAllowedIps !== void 0) {
1800
+ ipRestriction.allowed_ip_addresses = parseIpAddressList(opts.ipRestrictionAllowedIps);
1801
+ }
1802
+ if (Object.keys(ipRestriction).length > 0) {
1803
+ data.ip_restriction = ipRestriction;
1804
+ }
1805
+ if (!UPDATE_BLOCKS.some((key) => key in data)) {
1806
+ throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
1807
+ }
1808
+ return data;
1809
+ }
1810
+ function registerWordPressSecurityCommands(parent, brand) {
1811
+ const wordpressSecurity = parent.command("wordpress-security").description("WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A");
1812
+ wordpressSecurity.command("get").description("WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
1813
+ const client = resolveClient(parent, brand);
1814
+ const params = {};
1815
+ if (opts.domain)
1816
+ params.domain = opts.domain;
1817
+ printResult(await client.getWordPressSecurity(params), getFormat(parent));
1818
+ });
1819
+ const update = wordpressSecurity.command("update <domain>").description("WordPress\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u3092\u66F4\u65B0\uFF08\u6307\u5B9A\u3057\u305F\u9805\u76EE\u306E\u307F\uFF09");
1820
+ for (const { cli, desc } of UPDATE_OPTIONS) {
1821
+ update.option(`--${cli} <value>`, desc);
1822
+ }
1823
+ update.action(async (domain, opts) => {
1824
+ const data = buildUpdateData2(domain, opts);
1825
+ const client = resolveClient(parent, brand);
1826
+ printResult(await client.updateWordPressSecurity(data), getFormat(parent));
1827
+ });
1828
+ }
1829
+
1830
+ // ../core/dist/commands/server/x-accelerator/index.js
1831
+ function registerXAcceleratorCommands(parent, brand) {
1832
+ const xAccelerator = parent.command("x-accelerator").description("X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A");
1833
+ xAccelerator.command("list").description("X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
1834
+ const client = resolveClient(parent, brand);
1835
+ const params = {};
1836
+ if (opts.domain)
1837
+ params.domain = opts.domain;
1838
+ printResult(await client.listXAccelerator(params), getFormat(parent));
1839
+ });
1840
+ xAccelerator.command("update <domain>").description("X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\u3092\u5909\u66F4").requiredOption("--xaccelerator-status <status>", "X\u30A2\u30AF\u30BB\u30E9\u30EC\u30FC\u30BF\u8A2D\u5B9A\uFF08off / v1 / v2\uFF09").action(async (domain, opts) => {
1841
+ const client = resolveClient(parent, brand);
1842
+ printResult(await client.updateXAccelerator(domain, { xaccelerator_status: opts.xacceleratorStatus }), getFormat(parent));
1843
+ });
1844
+ }
1845
+
1846
+ // ../core/dist/commands/server/server-cache/index.js
1847
+ function registerServerCacheCommands(parent, brand) {
1848
+ const serverCache = parent.command("server-cache").description("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A");
1849
+ serverCache.command("list").description("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
1850
+ const client = resolveClient(parent, brand);
1851
+ const params = {};
1852
+ if (opts.domain)
1853
+ params.domain = opts.domain;
1854
+ printResult(await client.listServerCache(params), getFormat(parent));
1855
+ });
1856
+ serverCache.command("update <domain>").description("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4").requiredOption("--server-cache-status <status>", "\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\uFF08on / off\uFF09").action(async (domain, opts) => {
1857
+ const client = resolveClient(parent, brand);
1858
+ printResult(await client.updateServerCache(domain, { server_cache_status: opts.serverCacheStatus }), getFormat(parent));
1859
+ });
1860
+ serverCache.command("clear-cache <domain>").description("\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u306E\u5185\u5BB9\u3092\u524A\u9664\uFF08\u30D1\u30FC\u30B8\uFF09").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(async (domain) => {
1861
+ await confirmDestructiveAction(parent, `\u30C9\u30E1\u30A4\u30F3 "${domain}" \u306E\u30B5\u30FC\u30D0\u30FC\u30AD\u30E3\u30C3\u30B7\u30E5\u5185\u5BB9\u3092\u524A\u9664\u3057\u307E\u3059\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
1862
+ const client = resolveClient(parent, brand);
1863
+ printResult(await client.clearServerCache(domain), getFormat(parent));
1864
+ });
1865
+ }
1866
+
1867
+ // ../core/dist/commands/server/browser-cache/index.js
1868
+ function registerBrowserCacheCommands(parent, brand) {
1869
+ const browserCache = parent.command("browser-cache").description("\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A");
1870
+ browserCache.command("list").description("\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
1871
+ const client = resolveClient(parent, brand);
1872
+ const params = {};
1873
+ if (opts.domain)
1874
+ params.domain = opts.domain;
1875
+ printResult(await client.listBrowserCache(params), getFormat(parent));
1876
+ });
1877
+ browserCache.command("update <domain>").description("\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\u3092\u5909\u66F4").requiredOption("--browser-cache-status <status>", "\u30D6\u30E9\u30A6\u30B6\u30AD\u30E3\u30C3\u30B7\u30E5\u8A2D\u5B9A\uFF08all / ignore-css-js / off\uFF09").action(async (domain, opts) => {
1878
+ const client = resolveClient(parent, brand);
1879
+ printResult(await client.updateBrowserCache(domain, { browser_cache_status: opts.browserCacheStatus }), getFormat(parent));
1880
+ });
1881
+ }
1882
+
1883
+ // ../core/dist/commands/server/url-redirect/index.js
1884
+ function registerUrlRedirectCommands(parent, brand) {
1885
+ const urlRedirect = parent.command("url-redirect").description("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A");
1886
+ urlRedirect.command("list").description("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
1887
+ const client = resolveClient(parent, brand);
1888
+ const params = {};
1889
+ if (opts.domain)
1890
+ params.domain = opts.domain;
1891
+ printResult(await client.listUrlRedirect(params), getFormat(parent));
1892
+ });
1893
+ urlRedirect.command("add").description("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u8FFD\u52A0").requiredOption("--domain <domain>", "\u5951\u7D04\u30C9\u30E1\u30A4\u30F3").requiredOption("--from-host <host>", "\u8EE2\u9001\u5143\u30DB\u30B9\u30C8\uFF08FQDN\uFF09").option("--from-path <path>", "\u8EE2\u9001\u5143\u30D1\u30B9\uFF08\u7701\u7565\u6642\u306F /\u3002\u5148\u982D\u304C / \u3067\u306A\u3044\u5834\u5408\u306F API \u5074\u3067 / \u3092\u4ED8\u4E0E\uFF09").requiredOption("--redirect-to-url <url>", "\u8EE2\u9001\u5148URL\uFF08http \u307E\u305F\u306F https\uFF09").requiredOption("--status-code <code>", "\u8EE2\u9001\u6642\u306E\u30B9\u30C6\u30FC\u30BF\u30B9\u30B3\u30FC\u30C9\uFF08301 / 302\uFF09").action(async (opts) => {
1894
+ const client = resolveClient(parent, brand);
1895
+ const data = {
1896
+ domain: opts.domain,
1897
+ from_host: opts.fromHost,
1898
+ redirect_to_url: opts.redirectToUrl,
1899
+ status_code: Number(opts.statusCode)
1900
+ };
1901
+ if (opts.fromPath !== void 0)
1902
+ data.from_path = opts.fromPath;
1903
+ printResult(await client.addUrlRedirect(data), getFormat(parent));
1904
+ });
1905
+ urlRedirect.command("delete <redirectId>").description("\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A\u3092\u524A\u9664").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(async (redirectId) => {
1906
+ await confirmDestructiveAction(parent, `\u30B5\u30A4\u30C8\u8EE2\u9001\u8A2D\u5B9A "${redirectId}" \u3092\u524A\u9664\u3057\u307E\u3059\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
1907
+ const client = resolveClient(parent, brand);
1908
+ printResult(await client.deleteUrlRedirect(redirectId), getFormat(parent));
1909
+ });
1910
+ }
1911
+
1912
+ // ../core/dist/commands/server/access-deny/index.js
1913
+ function registerAccessDenyCommands(parent, brand) {
1914
+ const accessDeny = parent.command("access-deny").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A");
1915
+ accessDeny.command("list").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
1916
+ const client = resolveClient(parent, brand);
1917
+ const params = {};
1918
+ if (opts.domain)
1919
+ params.domain = opts.domain;
1920
+ printResult(await client.listAccessDeny(params), getFormat(parent));
1921
+ });
1922
+ accessDeny.command("add").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u8FFD\u52A0").requiredOption("--domain <domain>", "\u5951\u7D04\u30C9\u30E1\u30A4\u30F3").requiredOption("--ip-address <address>", "\u62D2\u5426IP\u30A2\u30C9\u30EC\u30B9\u30FB\u30DB\u30B9\u30C8\uFF08IPv4 / CIDR / \u90E8\u5206IP / \u30DB\u30B9\u30C8\u540D\uFF09").option("--memo <memo>", "\u30E1\u30E2\uFF08\u6700\u5927500\u6587\u5B57\uFF09").action(async (opts) => {
1923
+ const client = resolveClient(parent, brand);
1924
+ const data = {
1925
+ domain: opts.domain,
1926
+ ip_address: opts.ipAddress
1927
+ };
1928
+ if (opts.memo !== void 0)
1929
+ data.memo = opts.memo;
1930
+ printResult(await client.addAccessDeny(data), getFormat(parent));
1931
+ });
1932
+ accessDeny.command("update <denyId>").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u306E\u30E1\u30E2\u3092\u66F4\u65B0").option("--memo <memo>", "\u30E1\u30E2\uFF08\u7701\u7565\u307E\u305F\u306F\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09").action(async (denyId, opts) => {
1933
+ if (opts.memo === void 0) {
1934
+ throw new Error("--memo \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
1935
+ }
1936
+ const client = resolveClient(parent, brand);
1937
+ printResult(await client.updateAccessDeny(denyId, { memo: opts.memo }), getFormat(parent));
1938
+ });
1939
+ accessDeny.command("delete <denyId>").description("\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A\u3092\u524A\u9664").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(async (denyId) => {
1940
+ await confirmDestructiveAction(parent, `\u30A2\u30AF\u30BB\u30B9\u62D2\u5426\u8A2D\u5B9A "${denyId}" \u3092\u524A\u9664\u3057\u307E\u3059\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
1941
+ const client = resolveClient(parent, brand);
1942
+ printResult(await client.deleteAccessDeny(denyId), getFormat(parent));
1943
+ });
1944
+ }
1945
+
1946
+ // ../core/dist/commands/server/xpagespeed/index.js
1947
+ var UPDATE_OPTIONS2 = [
1948
+ { cli: "xoptimize-images", api: "xoptimize_images", label: "\u753B\u50CF\u6700\u9069\u5316", desc: "\u753B\u50CF\u6700\u9069\u5316\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1949
+ { cli: "lazyload-images", api: "lazyload_images", label: "\u753B\u50CF\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F", desc: "\u753B\u50CF\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1950
+ { cli: "xoptimize-css", api: "xoptimize_css", label: "CSS\u6700\u9069\u5316", desc: "CSS\u6700\u9069\u5316\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1951
+ { cli: "lazyload-css", api: "lazyload_css", label: "CSS\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F", desc: "CSS\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1952
+ { cli: "xoptimize-javascript", api: "xoptimize_javascript", label: "JavaScript\u6700\u9069\u5316", desc: "JavaScript\u6700\u9069\u5316\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" },
1953
+ { cli: "lazyload-javascript", api: "lazyload_javascript", label: "JavaScript\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F", desc: "JavaScript\u9045\u5EF6\u8AAD\u307F\u8FBC\u307F\uFF08true/false \u307E\u305F\u306F 1/0\uFF09" }
1954
+ ];
1955
+ function cliOptionToCamelCase2(cli) {
1956
+ return cli.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
1957
+ }
1958
+ function parseBooleanParam2(label, value) {
1959
+ const normalized = value.trim().toLowerCase();
1960
+ if (normalized !== "true" && normalized !== "false" && normalized !== "1" && normalized !== "0") {
1961
+ throw new ApiError("\u5165\u529B\u5024\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093", 422, "VALIDATION_ERROR", [`${label}\u306F true/false \u307E\u305F\u306F 1/0 \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`]);
1962
+ }
1963
+ return normalized === "true" || normalized === "1";
1964
+ }
1965
+ function buildUpdateData3(opts) {
1966
+ const data = {};
1967
+ for (const { cli, api, label } of UPDATE_OPTIONS2) {
1968
+ const value = opts[cliOptionToCamelCase2(cli)];
1969
+ if (value !== void 0)
1970
+ data[api] = parseBooleanParam2(label, value);
1971
+ }
1972
+ if (Object.keys(data).length === 0) {
1973
+ throw new Error("\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
1974
+ }
1975
+ if (Object.keys(data).length > 1) {
1976
+ throw new Error("1\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u5909\u66F4\u3067\u304D\u308B\u306E\u306F1\u3064\u306E\u6700\u9069\u5316\u6A5F\u80FD\u306E\u307F\u3067\u3059");
1977
+ }
1978
+ return data;
1979
+ }
1980
+ function registerXPageSpeedCommands(parent, brand) {
1981
+ const xPageSpeed = parent.command("xpagespeed").description("XPageSpeed\u8A2D\u5B9A");
1982
+ xPageSpeed.command("list").description("XPageSpeed\u8A2D\u5B9A\u4E00\u89A7\u3092\u53D6\u5F97").option("--domain <domain>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u3067\u7D5E\u308A\u8FBC\u307F").action(async (opts) => {
1983
+ const client = resolveClient(parent, brand);
1984
+ const params = {};
1985
+ if (opts.domain)
1986
+ params.domain = opts.domain;
1987
+ printResult(await client.listXPageSpeed(params), getFormat(parent));
1988
+ });
1989
+ const update = xPageSpeed.command("update <domain>").description("XPageSpeed\u306E\u6700\u9069\u5316\u6A5F\u80FD\u3092\u5909\u66F4\uFF081\u30EA\u30AF\u30A8\u30B9\u30C8\u30671\u6A5F\u80FD\u306E\u307F\uFF09");
1990
+ for (const { cli, desc } of UPDATE_OPTIONS2) {
1991
+ update.option(`--${cli} <value>`, desc);
1992
+ }
1993
+ update.action(async (domain, opts) => {
1994
+ const data = buildUpdateData3(opts);
1995
+ const client = resolveClient(parent, brand);
1996
+ printResult(await client.updateXPageSpeed(domain, data), getFormat(parent));
1997
+ });
1998
+ }
1999
+
2000
+ // ../core/dist/commands/server/auto-backup/index.js
2001
+ var DOMAIN_ELEMENT_TYPES = ["web", "setting", "mail"];
2002
+ function validationError(...errors) {
2003
+ throw new ApiError("\u5165\u529B\u5024\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093", 422, "VALIDATION_ERROR", errors);
2004
+ }
2005
+ function collectFlagValue(value, previous) {
2006
+ return previous.concat([value]);
2007
+ }
2008
+ function parseDomainElementEntry(part) {
2009
+ const equalIndex = part.indexOf("=");
2010
+ if (equalIndex === -1) {
2011
+ validationError("domain_elements \u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002example.com=web,setting \u5F62\u5F0F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
2012
+ }
2013
+ const domain = part.slice(0, equalIndex).trim();
2014
+ const elementsRaw = part.slice(equalIndex + 1).trim();
2015
+ if (domain === "" || elementsRaw === "") {
2016
+ validationError("domain_elements \u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002example.com=web,setting \u5F62\u5F0F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
2017
+ }
2018
+ const elements = elementsRaw.split(",").map((e) => e.trim()).filter((e) => e !== "");
2019
+ if (elements.length === 0) {
2020
+ validationError(`domain_elements \u306E ${domain} \u306B elements\uFF08${DOMAIN_ELEMENT_TYPES.join(", ")}\uFF09\u30921\u4EF6\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`);
2021
+ }
2022
+ return { domain, elements };
2023
+ }
2024
+ function parseDomainElements(values) {
2025
+ if (values.length === 0) {
2026
+ validationError("scope \u304C selected \u306E\u5834\u5408\u3001domain_elements \u30921\u4EF6\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
2027
+ }
2028
+ return values.map((value) => parseDomainElementEntry(value.trim()));
2029
+ }
2030
+ function registerAutoBackupCommands(parent, brand) {
2031
+ const autoBackup = parent.command("auto-backup").description("\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u30FB\u5FA9\u5143");
2032
+ autoBackup.command("backup-dates").description("\u9078\u629E\u53EF\u80FD\u306A\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\u4E00\u89A7\u3092\u53D6\u5F97").action(async () => {
2033
+ const client = resolveClient(parent, brand);
2034
+ printResult(await client.listAutoBackupBackupDates(), getFormat(parent));
2035
+ });
2036
+ autoBackup.command("list").description("\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u4E00\u89A7\u3092\u53D6\u5F97").action(async () => {
2037
+ const client = resolveClient(parent, brand);
2038
+ printResult(await client.listAutoBackup(), getFormat(parent));
2039
+ });
2040
+ autoBackup.command("show <requestId>").description("\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u306E\u8A73\u7D30\u3092\u53D6\u5F97").action(async (requestId) => {
2041
+ const client = resolveClient(parent, brand);
2042
+ printResult(await client.getAutoBackup(requestId), getFormat(parent));
2043
+ });
2044
+ autoBackup.command("create").description("\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u307E\u305F\u306F\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u3080").requiredOption("--backup-date <date>", "\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09").requiredOption("--operation-type <type>", "\u51E6\u7406\u7A2E\u5225\uFF08fetch / restore\uFF09").requiredOption("--scope <scope>", "\u51E6\u7406\u65B9\u6CD5\uFF08all / selected\uFF09").option("--domain-elements <value>", "\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\uFF08scope=selected \u306E\u3068\u304D\u5FC5\u9808\u3002\u7E70\u308A\u8FD4\u3057\u53EF\uFF09\u3002\u5F62\u5F0F: example.com=web,setting\uFF08elements: web / setting / mail\uFF09", collectFlagValue, []).option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7\uFF08restore \u6642\uFF09").action(async (opts) => {
2045
+ const operationType = opts.operationType;
2046
+ const scope = opts.scope;
2047
+ if (operationType === "restore") {
2048
+ await confirmDestructiveAction(parent, "\u81EA\u52D5\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u307F\u307E\u3059\u3002\u30B5\u30FC\u30D0\u30FC\u4E0A\u306E\u30C7\u30FC\u30BF\u304C\u4E0A\u66F8\u304D\u3055\u308C\u3001\u53D6\u308A\u6D88\u3057\u3067\u304D\u307E\u305B\u3093\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F");
2049
+ }
2050
+ const data = {
2051
+ backup_date: opts.backupDate,
2052
+ operation_type: operationType,
2053
+ scope
2054
+ };
2055
+ const domainElementValues = opts.domainElements;
2056
+ if (scope === "selected") {
2057
+ if (domainElementValues.length === 0) {
2058
+ validationError("scope \u304C selected \u306E\u5834\u5408\u3001--domain-elements \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
2059
+ }
2060
+ data.domain_elements = parseDomainElements(domainElementValues);
2061
+ } else if (domainElementValues.length > 0) {
2062
+ validationError("\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F \u51E6\u7406\u65B9\u6CD5 \u304C selected \u306E\u5834\u5408\u306E\u307F\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002");
2063
+ }
2064
+ const client = resolveClient(parent, brand);
2065
+ printResult(await client.createAutoBackup(data), getFormat(parent));
2066
+ });
2067
+ }
2068
+
2069
+ // ../core/dist/commands/server/mysql-backup/index.js
2070
+ function registerMysqlBackupCommands(parent, brand) {
2071
+ const mysqlBackup = parent.command("mysql-backup").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u30FB\u5FA9\u5143");
2072
+ mysqlBackup.command("databases").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u72B6\u614B\u3092\u53D6\u5F97").action(async () => {
2073
+ const client = resolveClient(parent, brand);
2074
+ printResult(await client.listMysqlBackupDatabases(), getFormat(parent));
2075
+ });
2076
+ mysqlBackup.command("list").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u4E00\u89A7\u3092\u53D6\u5F97").action(async () => {
2077
+ const client = resolveClient(parent, brand);
2078
+ printResult(await client.listMysqlBackup(), getFormat(parent));
2079
+ });
2080
+ mysqlBackup.command("show <requestId>").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u7533\u8FBC\u5C65\u6B74\u8A73\u7D30\u3092\u53D6\u5F97").action(async (requestId) => {
2081
+ const client = resolveClient(parent, brand);
2082
+ printResult(await client.getMysqlBackup(requestId), getFormat(parent));
2083
+ });
2084
+ mysqlBackup.command("create").description("MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u306E\u53D6\u5F97\u307E\u305F\u306F\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u3080").requiredOption("--db-name <name>", "\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D").requiredOption("--backup-date <date>", "\u5BFE\u8C61\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u65E5\uFF08Y-m-d\uFF09").requiredOption("--operation-type <type>", "\u51E6\u7406\u7A2E\u5225\uFF08fetch / restore\uFF09").option("-y, --yes", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7\uFF08restore \u6642\uFF09").action(async (opts) => {
2085
+ const operationType = opts.operationType;
2086
+ if (operationType === "restore") {
2087
+ await confirmDestructiveAction(parent, `\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9 "${opts.dbName}" \u306E MySQL\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u5FA9\u5143\u3092\u7533\u3057\u8FBC\u307F\u307E\u3059\u3002\u5BFE\u8C61 DB \u304C\u4E0A\u66F8\u304D\u3055\u308C\u3001\u53D6\u308A\u6D88\u3057\u3067\u304D\u307E\u305B\u3093\u3002\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F`);
2088
+ }
2089
+ const client = resolveClient(parent, brand);
2090
+ printResult(await client.createMysqlBackup({
2091
+ db_name: opts.dbName,
2092
+ backup_date: opts.backupDate,
2093
+ operation_type: operationType
2094
+ }), getFormat(parent));
2095
+ });
2096
+ }
2097
+
1458
2098
  // ../core/dist/commands/me/index.js
1459
2099
  function registerMeCommand(program, brand) {
1460
2100
  program.command("me").description("\u73FE\u5728\u306EAPI\u30AD\u30FC\u60C5\u5831\u3092\u8868\u793A").action(async (_opts, cmd) => {
@@ -1508,6 +2148,18 @@ function run(brand, version = "0.0.0") {
1508
2148
  registerSslCommands(server, brand);
1509
2149
  registerDnsCommands(server, brand);
1510
2150
  registerLogCommands(server, brand);
2151
+ registerResourceMonitorCommands(server, brand);
2152
+ registerWafCommands(server, brand);
2153
+ registerPhpIniCommands(server, brand);
2154
+ registerWordPressSecurityCommands(server, brand);
2155
+ registerXAcceleratorCommands(server, brand);
2156
+ registerServerCacheCommands(server, brand);
2157
+ registerBrowserCacheCommands(server, brand);
2158
+ registerUrlRedirectCommands(server, brand);
2159
+ registerAccessDenyCommands(server, brand);
2160
+ registerXPageSpeedCommands(server, brand);
2161
+ registerAutoBackupCommands(server, brand);
2162
+ registerMysqlBackupCommands(server, brand);
1511
2163
  program.parseAsync(process.argv).catch((err) => {
1512
2164
  if (err instanceof ApiError) {
1513
2165
  console.error(`\u30A8\u30E9\u30FC [${err.errorCode}]: ${err.message}`);
@@ -1530,7 +2182,7 @@ function run(brand, version = "0.0.0") {
1530
2182
  // package.json
1531
2183
  var package_default = {
1532
2184
  name: "shincloud-cli",
1533
- version: "1.1.0",
2185
+ version: "1.2.0",
1534
2186
  description: "Official CLI for Shincloud API \u2014 manage your Shincloud hosting from the terminal",
1535
2187
  type: "module",
1536
2188
  bin: {