postgresai 0.14.0-dev.77 → 0.14.0-dev.79
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/bin/postgres-ai.ts +23 -4
- package/dist/bin/postgres-ai.js +30 -6
- package/package.json +1 -1
package/bin/postgres-ai.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { maskSecret } from "../lib/util";
|
|
|
20
20
|
import { createInterface } from "readline";
|
|
21
21
|
import * as childProcess from "child_process";
|
|
22
22
|
import { REPORT_GENERATORS, CHECK_INFO, generateAllReports } from "../lib/checkup";
|
|
23
|
+
import { getAllCheckupEntries, getCheckupEntry, isValidCheckupCode } from "../lib/checkup-dictionary";
|
|
23
24
|
import { createCheckupReport, uploadCheckupReportJson, RpcError, formatRpcErrorForDisplay, withRetry } from "../lib/checkup-api";
|
|
24
25
|
|
|
25
26
|
// Singleton readline interface for stdin prompts
|
|
@@ -1641,10 +1642,18 @@ program
|
|
|
1641
1642
|
}
|
|
1642
1643
|
});
|
|
1643
1644
|
|
|
1645
|
+
// Build help text showing all checks from dictionary with express-mode indicators
|
|
1646
|
+
const expressCheckIds = new Set(Object.keys(REPORT_GENERATORS));
|
|
1647
|
+
const allChecks = getAllCheckupEntries();
|
|
1648
|
+
const checkHelpLines = allChecks.map((entry) => {
|
|
1649
|
+
const isExpress = expressCheckIds.has(entry.code);
|
|
1650
|
+
return ` ${entry.code}: ${entry.title}${isExpress ? "" : " (*)"}`;
|
|
1651
|
+
});
|
|
1652
|
+
|
|
1644
1653
|
program
|
|
1645
1654
|
.command("checkup [conn]")
|
|
1646
1655
|
.description("generate health check reports directly from PostgreSQL (express mode)")
|
|
1647
|
-
.option("--check-id <id>", `specific check to run
|
|
1656
|
+
.option("--check-id <id>", `specific check to run (see list below), or ALL`, "ALL")
|
|
1648
1657
|
.option("--node-name <name>", "node name for reports", "node-01")
|
|
1649
1658
|
.option("--output <path>", "output directory for JSON files")
|
|
1650
1659
|
.option("--[no-]upload", "upload JSON results to PostgresAI (default: enabled; requires API key)", undefined)
|
|
@@ -1658,7 +1667,10 @@ program
|
|
|
1658
1667
|
[
|
|
1659
1668
|
"",
|
|
1660
1669
|
"Available checks:",
|
|
1661
|
-
...
|
|
1670
|
+
...checkHelpLines,
|
|
1671
|
+
"",
|
|
1672
|
+
" (*) = not yet available in express mode (coming soon)",
|
|
1673
|
+
" ALL = run all express-mode checks",
|
|
1662
1674
|
"",
|
|
1663
1675
|
"Examples:",
|
|
1664
1676
|
" postgresai checkup postgresql://user:pass@host:5432/db",
|
|
@@ -1725,8 +1737,15 @@ program
|
|
|
1725
1737
|
const generator = REPORT_GENERATORS[checkId];
|
|
1726
1738
|
if (!generator) {
|
|
1727
1739
|
spinner.stop();
|
|
1728
|
-
|
|
1729
|
-
|
|
1740
|
+
// Check if it's a valid check ID from the dictionary (just not implemented in express mode)
|
|
1741
|
+
const dictEntry = getCheckupEntry(checkId);
|
|
1742
|
+
if (dictEntry) {
|
|
1743
|
+
console.error(`Check ${checkId} (${dictEntry.title}) is not yet available in express mode.`);
|
|
1744
|
+
console.error(`Express-mode checks: ${Object.keys(CHECK_INFO).join(", ")}`);
|
|
1745
|
+
} else {
|
|
1746
|
+
console.error(`Unknown check ID: ${opts.checkId}`);
|
|
1747
|
+
console.error(`See 'postgresai checkup --help' for available checks.`);
|
|
1748
|
+
}
|
|
1730
1749
|
process.exitCode = 1;
|
|
1731
1750
|
return;
|
|
1732
1751
|
}
|
package/dist/bin/postgres-ai.js
CHANGED
|
@@ -13064,7 +13064,7 @@ var {
|
|
|
13064
13064
|
// package.json
|
|
13065
13065
|
var package_default = {
|
|
13066
13066
|
name: "postgresai",
|
|
13067
|
-
version: "0.14.0-dev.
|
|
13067
|
+
version: "0.14.0-dev.79",
|
|
13068
13068
|
description: "postgres_ai CLI",
|
|
13069
13069
|
license: "Apache-2.0",
|
|
13070
13070
|
private: false,
|
|
@@ -15889,7 +15889,7 @@ var Result = import_lib.default.Result;
|
|
|
15889
15889
|
var TypeOverrides = import_lib.default.TypeOverrides;
|
|
15890
15890
|
var defaults = import_lib.default.defaults;
|
|
15891
15891
|
// package.json
|
|
15892
|
-
var version = "0.14.0-dev.
|
|
15892
|
+
var version = "0.14.0-dev.79";
|
|
15893
15893
|
var package_default2 = {
|
|
15894
15894
|
name: "postgresai",
|
|
15895
15895
|
version,
|
|
@@ -27895,6 +27895,15 @@ async function generateAllReports(client, nodeName = "node-01", onProgress) {
|
|
|
27895
27895
|
return reports;
|
|
27896
27896
|
}
|
|
27897
27897
|
|
|
27898
|
+
// lib/checkup-dictionary.ts
|
|
27899
|
+
var dictionaryByCode2 = new Map(CHECKUP_DICTIONARY_DATA.map((entry) => [entry.code, entry]));
|
|
27900
|
+
function getAllCheckupEntries() {
|
|
27901
|
+
return CHECKUP_DICTIONARY_DATA;
|
|
27902
|
+
}
|
|
27903
|
+
function getCheckupEntry(code) {
|
|
27904
|
+
return dictionaryByCode2.get(code.toUpperCase()) ?? null;
|
|
27905
|
+
}
|
|
27906
|
+
|
|
27898
27907
|
// lib/checkup-api.ts
|
|
27899
27908
|
import * as https from "https";
|
|
27900
27909
|
import { URL as URL3 } from "url";
|
|
@@ -29401,10 +29410,19 @@ program2.command("unprepare-db [conn]").description("remove monitoring setup: dr
|
|
|
29401
29410
|
closeReadline();
|
|
29402
29411
|
}
|
|
29403
29412
|
});
|
|
29404
|
-
|
|
29413
|
+
var expressCheckIds = new Set(Object.keys(REPORT_GENERATORS));
|
|
29414
|
+
var allChecks = getAllCheckupEntries();
|
|
29415
|
+
var checkHelpLines = allChecks.map((entry) => {
|
|
29416
|
+
const isExpress = expressCheckIds.has(entry.code);
|
|
29417
|
+
return ` ${entry.code}: ${entry.title}${isExpress ? "" : " (*)"}`;
|
|
29418
|
+
});
|
|
29419
|
+
program2.command("checkup [conn]").description("generate health check reports directly from PostgreSQL (express mode)").option("--check-id <id>", `specific check to run (see list below), or ALL`, "ALL").option("--node-name <name>", "node name for reports", "node-01").option("--output <path>", "output directory for JSON files").option("--[no-]upload", "upload JSON results to PostgresAI (default: enabled; requires API key)", undefined).option("--project <project>", "project name or ID for remote upload (used with --upload; defaults to config defaultProject; auto-generated on first run)").option("--json", "output JSON to stdout (implies --no-upload)").addHelpText("after", [
|
|
29405
29420
|
"",
|
|
29406
29421
|
"Available checks:",
|
|
29407
|
-
...
|
|
29422
|
+
...checkHelpLines,
|
|
29423
|
+
"",
|
|
29424
|
+
" (*) = not yet available in express mode (coming soon)",
|
|
29425
|
+
" ALL = run all express-mode checks",
|
|
29408
29426
|
"",
|
|
29409
29427
|
"Examples:",
|
|
29410
29428
|
" postgresai checkup postgresql://user:pass@host:5432/db",
|
|
@@ -29460,8 +29478,14 @@ program2.command("checkup [conn]").description("generate health check reports di
|
|
|
29460
29478
|
const generator = REPORT_GENERATORS[checkId];
|
|
29461
29479
|
if (!generator) {
|
|
29462
29480
|
spinner.stop();
|
|
29463
|
-
|
|
29464
|
-
|
|
29481
|
+
const dictEntry = getCheckupEntry(checkId);
|
|
29482
|
+
if (dictEntry) {
|
|
29483
|
+
console.error(`Check ${checkId} (${dictEntry.title}) is not yet available in express mode.`);
|
|
29484
|
+
console.error(`Express-mode checks: ${Object.keys(CHECK_INFO).join(", ")}`);
|
|
29485
|
+
} else {
|
|
29486
|
+
console.error(`Unknown check ID: ${opts.checkId}`);
|
|
29487
|
+
console.error(`See 'postgresai checkup --help' for available checks.`);
|
|
29488
|
+
}
|
|
29465
29489
|
process.exitCode = 1;
|
|
29466
29490
|
return;
|
|
29467
29491
|
}
|