postgresai 0.16.0-rc.4 → 0.16.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 +154 -0
- package/dist/bin/postgres-ai.js +2911 -255
- package/package.json +12 -3
- package/schemas/A002.schema.json +63 -0
- package/schemas/A003.schema.json +73 -0
- package/schemas/A004.schema.json +81 -0
- package/schemas/A007.schema.json +71 -0
- package/schemas/A013.schema.json +61 -0
- package/schemas/D001.schema.json +71 -0
- package/schemas/D004.schema.json +136 -0
- package/schemas/F001.schema.json +73 -0
- package/schemas/F002.schema.json +108 -0
- package/schemas/F003.schema.json +138 -0
- package/schemas/F004.schema.json +125 -0
- package/schemas/F005.schema.json +131 -0
- package/schemas/F009.schema.json +155 -0
- package/schemas/G001.schema.json +135 -0
- package/schemas/G003.schema.json +90 -0
- package/schemas/H001.schema.json +141 -0
- package/schemas/H002.schema.json +129 -0
- package/schemas/H004.schema.json +128 -0
- package/schemas/I001.schema.json +149 -0
- package/schemas/K001.schema.json +161 -0
- package/schemas/K003.schema.json +163 -0
- package/schemas/K004.schema.json +110 -0
- package/schemas/K005.schema.json +110 -0
- package/schemas/K006.schema.json +110 -0
- package/schemas/K007.schema.json +110 -0
- package/schemas/K008.schema.json +110 -0
- package/schemas/M001.schema.json +119 -0
- package/schemas/M002.schema.json +110 -0
- package/schemas/M003.schema.json +128 -0
- package/schemas/N001.schema.json +161 -0
- package/schemas/query.schema.json +62 -0
- package/CHANGELOG.md +0 -11
- package/bin/postgres-ai.ts +0 -5578
- package/bun.lock +0 -258
- package/bunfig.toml +0 -20
- package/lib/aas-onboard.ts +0 -251
- package/lib/auth-server.ts +0 -285
- package/lib/checkup-api.ts +0 -526
- package/lib/checkup-dictionary.ts +0 -103
- package/lib/checkup-summary.ts +0 -338
- package/lib/checkup.ts +0 -2261
- package/lib/config.ts +0 -171
- package/lib/init.ts +0 -1152
- package/lib/instances.ts +0 -245
- package/lib/issues.ts +0 -1060
- package/lib/mcp-server.ts +0 -667
- package/lib/metrics-loader.ts +0 -134
- package/lib/pkce.ts +0 -79
- package/lib/reports.ts +0 -373
- package/lib/storage.ts +0 -367
- package/lib/supabase.ts +0 -826
- package/lib/util.ts +0 -134
- package/packages/postgres-ai/README.md +0 -26
- package/packages/postgres-ai/bin/postgres-ai.js +0 -27
- package/packages/postgres-ai/package.json +0 -27
- package/scripts/embed-checkup-dictionary.ts +0 -115
- package/scripts/embed-metrics.ts +0 -160
- package/scripts/generate-release-notes.ts +0 -668
- package/test/PERMISSION_CHECK_TEST_SUMMARY.md +0 -139
- package/test/aas-onboard.test.ts +0 -301
- package/test/auth.test.ts +0 -287
- package/test/checkup.integration.test.ts +0 -413
- package/test/checkup.test.ts +0 -3626
- package/test/compose-cmd.test.ts +0 -120
- package/test/config-consistency.test.ts +0 -352
- package/test/init.integration.test.ts +0 -438
- package/test/init.test.ts +0 -1816
- package/test/issues.cli.test.ts +0 -1162
- package/test/issues.test.ts +0 -456
- package/test/mcp-server.test.ts +0 -2530
- package/test/monitoring.test.ts +0 -746
- package/test/permission-check-sql.test.ts +0 -116
- package/test/reports.cli.test.ts +0 -793
- package/test/reports.test.ts +0 -977
- package/test/schema-validation.test.ts +0 -231
- package/test/storage.test.ts +0 -935
- package/test/supabase.test.ts +0 -709
- package/test/targets-add-config.test.ts +0 -28
- package/test/test-utils.ts +0 -190
- package/test/upgrade.test.ts +0 -1056
- package/test/util.test.ts +0 -44
- package/tsconfig.json +0 -20
package/test/util.test.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
|
|
3
|
-
import { formatHttpError } from "../lib/util";
|
|
4
|
-
|
|
5
|
-
describe("formatHttpError", () => {
|
|
6
|
-
test("appends auth remediation hint on 401 with JSON body", () => {
|
|
7
|
-
const msg = formatHttpError(
|
|
8
|
-
"Failed to fetch issues",
|
|
9
|
-
401,
|
|
10
|
-
'{"hint": "Please check validity of token", "details": "Invalid token"}'
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
expect(msg).toContain("HTTP 401");
|
|
14
|
-
expect(msg).toContain("Run 'postgresai auth'");
|
|
15
|
-
expect(msg).toContain("PGAI_API_KEY");
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test("appends auth remediation hint on 401 with HTML body (early-return path)", () => {
|
|
19
|
-
const msg = formatHttpError("Failed to fetch issues", 401, "<html><body>Unauthorized</body></html>");
|
|
20
|
-
|
|
21
|
-
expect(msg).toContain("HTTP 401");
|
|
22
|
-
expect(msg).toContain("Run 'postgresai auth'");
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("appends auth remediation hint on 401 without body", () => {
|
|
26
|
-
const msg = formatHttpError("Failed to fetch issues", 401);
|
|
27
|
-
|
|
28
|
-
expect(msg).toContain("Run 'postgresai auth'");
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test("does not append auth hint for non-401 statuses", () => {
|
|
32
|
-
expect(formatHttpError("Failed to fetch issues", 403, '{"message": "denied"}')).not.toContain(
|
|
33
|
-
"Run 'postgresai auth'"
|
|
34
|
-
);
|
|
35
|
-
expect(formatHttpError("Failed to fetch issues", 500)).not.toContain("Run 'postgresai auth'");
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
test("keeps structured JSON error details before the hint", () => {
|
|
39
|
-
const msg = formatHttpError("Failed to fetch issues", 401, '{"message": "Invalid token"}');
|
|
40
|
-
|
|
41
|
-
expect(msg.indexOf("Invalid token")).toBeGreaterThan(-1);
|
|
42
|
-
expect(msg.indexOf("Invalid token")).toBeLessThan(msg.indexOf("Run 'postgresai auth'"));
|
|
43
|
-
});
|
|
44
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"lib": ["ESNext"],
|
|
7
|
-
"types": ["bun-types"],
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"noEmit": true,
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": false,
|
|
15
|
-
"allowSyntheticDefaultImports": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true
|
|
17
|
-
},
|
|
18
|
-
"include": ["bin/**/*", "lib/**/*", "test/**/*"],
|
|
19
|
-
"exclude": ["node_modules", "dist"]
|
|
20
|
-
}
|