@dataparade/cli 0.0.13 → 0.0.14

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.
Files changed (74) hide show
  1. package/dist/package.json +2 -2
  2. package/dist/src/ai-enrichment/candidate-selector.d.ts +4 -4
  3. package/dist/src/ai-enrichment/candidate-selector.js +37 -32
  4. package/dist/src/ai-enrichment/fallbacks.js +130 -3
  5. package/dist/src/ai-enrichment/merge-rules.d.ts +3 -3
  6. package/dist/src/ai-enrichment/merge-rules.js +118 -40
  7. package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.d.ts +2 -2
  8. package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.js +3 -3
  9. package/dist/src/ai-enrichment/property-priority.d.ts +5 -0
  10. package/dist/src/ai-enrichment/property-priority.js +23 -0
  11. package/dist/src/ai-enrichment/provider-prompt.d.ts +5 -5
  12. package/dist/src/ai-enrichment/provider-prompt.js +24 -19
  13. package/dist/src/ai-enrichment/red-flags.d.ts +46 -0
  14. package/dist/src/ai-enrichment/red-flags.js +365 -0
  15. package/dist/src/ai-enrichment/third-party-evidence.d.ts +3 -3
  16. package/dist/src/ai-enrichment/third-party-evidence.js +96 -93
  17. package/dist/src/cli.d.ts +1 -1
  18. package/dist/src/cli.js +158 -141
  19. package/dist/src/core/pipeline/orchestrator-result.d.ts +9 -1
  20. package/dist/src/core/pipeline/orchestrator.d.ts +2 -2
  21. package/dist/src/core/pipeline/scan-pipeline.d.ts +2 -2
  22. package/dist/src/core/pipeline/scan-pipeline.js +46 -34
  23. package/dist/src/output/json.d.ts +11 -3
  24. package/dist/src/output/json.js +10 -5
  25. package/dist/tests/unit/ai-enrichment/candidate-selector.spec.js +80 -49
  26. package/dist/tests/unit/ai-enrichment/fallbacks.spec.js +78 -0
  27. package/dist/tests/unit/ai-enrichment/merge-rules.spec.js +510 -264
  28. package/dist/tests/unit/ai-enrichment/provider-prompt.spec.js +80 -77
  29. package/dist/tests/unit/ai-enrichment/red-flags.spec.js +227 -0
  30. package/dist/tests/unit/ai-enrichment/third-party-evidence.spec.js +38 -34
  31. package/dist/tests/unit/cli/scan-command-e2e-backend-lambda-orphan.spec.d.ts +1 -0
  32. package/dist/tests/unit/cli/scan-command-e2e-backend-lambda-orphan.spec.js +60 -0
  33. package/dist/tests/unit/cli/scan-command-e2e-occupied-section-hubs.spec.d.ts +1 -0
  34. package/dist/tests/unit/cli/scan-command-e2e-occupied-section-hubs.spec.js +58 -0
  35. package/dist/tests/unit/cli/scan-command-e2e-ruby-basic.spec.d.ts +1 -0
  36. package/dist/tests/unit/cli/scan-command-e2e-ruby-basic.spec.js +46 -0
  37. package/dist/tests/unit/cli/scan-quota-flow.spec.js +8 -0
  38. package/package.json +2 -2
  39. package/dist/tests/fixtures/e2e-ts-sample/db-client-import.d.ts +0 -2
  40. package/dist/tests/fixtures/e2e-ts-sample/db-client-import.js +0 -8
  41. package/dist/tests/fixtures/e2e-ts-sample/db.d.ts +0 -3
  42. package/dist/tests/fixtures/e2e-ts-sample/db.js +0 -7
  43. package/dist/tests/fixtures/e2e-ts-sample/external-api.d.ts +0 -1
  44. package/dist/tests/fixtures/e2e-ts-sample/external-api.js +0 -18
  45. package/dist/tests/fixtures/e2e-ts-sample/pg-client.d.ts +0 -3
  46. package/dist/tests/fixtures/e2e-ts-sample/pg-client.js +0 -7
  47. package/dist/tests/fixtures/e2e-ts-sample/server.d.ts +0 -14
  48. package/dist/tests/fixtures/e2e-ts-sample/server.js +0 -4
  49. package/dist/tests/fixtures/e2e-ts-sentry-route-env/server.js +0 -24
  50. package/dist/tests/fixtures/ingest-basic/src/index.d.ts +0 -1
  51. package/dist/tests/fixtures/ingest-basic/src/index.js +0 -6
  52. package/dist/tests/fixtures/mixed-language-basic/api.d.ts +0 -2
  53. package/dist/tests/fixtures/mixed-language-basic/api.js +0 -12
  54. package/dist/tests/fixtures/monorepo-app-plus-terraform/packages/app/app/route.d.ts +0 -1
  55. package/dist/tests/fixtures/monorepo-app-plus-terraform/packages/app/app/route.js +0 -6
  56. package/dist/tests/fixtures/monorepo-front-back-sections/backend/app/route.d.ts +0 -1
  57. package/dist/tests/fixtures/monorepo-front-back-sections/backend/app/route.js +0 -6
  58. package/dist/tests/fixtures/monorepo-front-back-sections/frontend/app/route.d.ts +0 -1
  59. package/dist/tests/fixtures/monorepo-front-back-sections/frontend/app/route.js +0 -7
  60. package/dist/tests/fixtures/typescript-basic/app/route.d.ts +0 -1
  61. package/dist/tests/fixtures/typescript-basic/app/route.js +0 -7
  62. package/dist/tests/fixtures/typescript-basic/db-client-import.d.ts +0 -2
  63. package/dist/tests/fixtures/typescript-basic/db-client-import.js +0 -8
  64. package/dist/tests/fixtures/typescript-basic/db.d.ts +0 -3
  65. package/dist/tests/fixtures/typescript-basic/db.js +0 -7
  66. package/dist/tests/fixtures/typescript-basic/external-api.d.ts +0 -1
  67. package/dist/tests/fixtures/typescript-basic/external-api.js +0 -18
  68. package/dist/tests/fixtures/typescript-basic/pg-client.d.ts +0 -3
  69. package/dist/tests/fixtures/typescript-basic/pg-client.js +0 -7
  70. package/dist/tests/fixtures/typescript-basic/server.d.ts +0 -14
  71. package/dist/tests/fixtures/typescript-basic/server.js +0 -4
  72. package/dist/tests/fixtures/typescript-dependency-manifests-basic/src/index.d.ts +0 -0
  73. package/dist/tests/fixtures/typescript-dependency-manifests-basic/src/index.js +0 -2
  74. /package/dist/tests/{fixtures/e2e-ts-sentry-route-env/server.d.ts → unit/ai-enrichment/red-flags.spec.d.ts} +0 -0
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_1 = __importDefault(require("fs"));
7
+ const os_1 = __importDefault(require("os"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const cli_1 = require("../../../src/cli");
10
+ const dataflow_wrapper_schema_1 = require("../../../src/core/schema/dataflow-wrapper.schema");
11
+ describe('cli scan command - backend lambda handler absorb', () => {
12
+ it('absorbs the AWS handler into Aws Lambda and wires the section hub', async () => {
13
+ const fixturesRoot = path_1.default.join(__dirname, '..', '..', 'fixtures', 'backend-lambda-orphan');
14
+ const outputPath = path_1.default.join(os_1.default.tmpdir(), `dataparade-scan-e2e-backend-lambda-orphan-${Date.now()}.json`);
15
+ await (0, cli_1.run)([
16
+ 'node',
17
+ 'cli',
18
+ 'scan',
19
+ fixturesRoot,
20
+ '--output',
21
+ outputPath,
22
+ '--no-ai-inference',
23
+ '--skip-auto-upload',
24
+ ]);
25
+ const contents = fs_1.default.readFileSync(outputPath, 'utf8');
26
+ const parsed = JSON.parse(contents);
27
+ const validation = (0, dataflow_wrapper_schema_1.validateDataflowJson)(parsed);
28
+ expect(validation.ok).toBe(true);
29
+ if (!validation.ok)
30
+ return;
31
+ const { graph, metadata } = validation.value;
32
+ const backendNodes = graph.nodes.filter((n) => n?.data?.section_id === 'backend');
33
+ expect(backendNodes.length).toBeGreaterThanOrEqual(1);
34
+ const hubs = backendNodes.filter((n) => n?.data?.isMainApplication === true ||
35
+ n?.data?.isMainApplication === 'true');
36
+ expect(hubs.length).toBeGreaterThanOrEqual(1);
37
+ const hubIds = new Set(hubs.map((h) => h.id));
38
+ const handlerNodes = backendNodes.filter((n) => {
39
+ if (hubIds.has(n.id))
40
+ return false;
41
+ const subType = String(n?.data?.componentSubType ?? n?.data?.subType ?? '');
42
+ return (subType === 'function' || n?.data?.handlerType === 'serverless_handler');
43
+ });
44
+ expect(handlerNodes).toHaveLength(0);
45
+ const lambdaNodes = backendNodes.filter((n) => n?.data?.managed_service_key === 'lambda' ||
46
+ (String(n?.data?.componentSubType ?? '') === 'compute_service' &&
47
+ /lambda/i.test(String(n?.data?.label ?? ''))));
48
+ expect(lambdaNodes.length).toBeGreaterThanOrEqual(1);
49
+ const lambdaIds = new Set(lambdaNodes.map((n) => n.id));
50
+ const hubLinkedToLambda = graph.edges.some((e) => (hubIds.has(e.source) && lambdaIds.has(e.target)) ||
51
+ (hubIds.has(e.target) && lambdaIds.has(e.source)));
52
+ expect(hubLinkedToLambda).toBe(true);
53
+ const redFlags = metadata
54
+ ?.redFlags;
55
+ const blocking = (redFlags ?? []).filter((f) => f.sectionId === 'backend' &&
56
+ (f.code === 'missing_section_hub' || f.code === 'disconnected_handler'));
57
+ expect(blocking).toHaveLength(0);
58
+ fs_1.default.unlinkSync(outputPath);
59
+ }, 30000);
60
+ });
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_1 = __importDefault(require("fs"));
7
+ const os_1 = __importDefault(require("os"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const cli_1 = require("../../../src/cli");
10
+ const dataflow_wrapper_schema_1 = require("../../../src/core/schema/dataflow-wrapper.schema");
11
+ describe('cli scan command - occupied section hubs', () => {
12
+ it('gives every non-empty service section a main-app hub and hub→third_party edges', async () => {
13
+ const fixturesRoot = path_1.default.join(__dirname, '..', '..', 'fixtures', 'tooling-third-party-only');
14
+ const outputPath = path_1.default.join(os_1.default.tmpdir(), `dataparade-scan-e2e-occupied-section-hubs-${Date.now()}.json`);
15
+ await (0, cli_1.run)([
16
+ 'node',
17
+ 'cli',
18
+ 'scan',
19
+ fixturesRoot,
20
+ '--output',
21
+ outputPath,
22
+ '--no-ai-inference',
23
+ '--skip-auto-upload',
24
+ ]);
25
+ const contents = fs_1.default.readFileSync(outputPath, 'utf8');
26
+ const parsed = JSON.parse(contents);
27
+ const validation = (0, dataflow_wrapper_schema_1.validateDataflowJson)(parsed);
28
+ expect(validation.ok).toBe(true);
29
+ if (!validation.ok)
30
+ return;
31
+ const { graph } = validation.value;
32
+ const sectionIds = new Set(graph.nodes
33
+ .map((n) => n?.data?.section_id)
34
+ .filter((v) => typeof v === 'string' && v.trim().length > 0));
35
+ for (const sectionId of sectionIds) {
36
+ if (sectionId === 'root' ||
37
+ sectionId === 'global' ||
38
+ sectionId === '<unsectioned>') {
39
+ continue;
40
+ }
41
+ const sectionNodes = graph.nodes.filter((n) => n?.data?.section_id === sectionId);
42
+ if (sectionNodes.length === 0)
43
+ continue;
44
+ const hubs = sectionNodes.filter((n) => n?.data?.isMainApplication === true ||
45
+ n?.data?.isMainApplication === 'true');
46
+ expect(hubs.length).toBeGreaterThanOrEqual(1);
47
+ const thirdParties = sectionNodes.filter((n) => n?.type === 'third_party' || n?.type === 'third_party_service');
48
+ if (thirdParties.length === 0)
49
+ continue;
50
+ const hubIds = new Set(hubs.map((h) => h.id));
51
+ for (const tp of thirdParties) {
52
+ const linked = graph.edges.some((e) => hubIds.has(e.source) && e.target === tp.id);
53
+ expect(linked).toBe(true);
54
+ }
55
+ }
56
+ fs_1.default.unlinkSync(outputPath);
57
+ }, 20000);
58
+ });
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_1 = __importDefault(require("fs"));
7
+ const os_1 = __importDefault(require("os"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const cli_1 = require("../../../src/cli");
10
+ const dataflow_wrapper_schema_1 = require("../../../src/core/schema/dataflow-wrapper.schema");
11
+ describe('cli scan command - Ruby basic', () => {
12
+ it('emits runtime boundaries without model components', async () => {
13
+ const fixturesRoot = path_1.default.join(__dirname, '..', '..', 'fixtures', 'ruby-basic');
14
+ const outputPath = path_1.default.join(os_1.default.tmpdir(), `dataparade-scan-e2e-ruby-basic-${Date.now()}.json`);
15
+ await (0, cli_1.run)([
16
+ 'node',
17
+ 'cli',
18
+ 'scan',
19
+ fixturesRoot,
20
+ '--output',
21
+ outputPath,
22
+ '--no-ai-inference',
23
+ '--skip-auto-upload',
24
+ ]);
25
+ const validation = (0, dataflow_wrapper_schema_1.validateDataflowJson)(JSON.parse(fs_1.default.readFileSync(outputPath, 'utf8')));
26
+ expect(validation.ok).toBe(true);
27
+ if (!validation.ok)
28
+ return;
29
+ const nodes = validation.value.graph.nodes;
30
+ expect(nodes.filter((node) => {
31
+ const data = node.data;
32
+ return (data.componentType === 'asset' && data.componentSubType === 'database');
33
+ })).toHaveLength(1);
34
+ expect(nodes.filter((node) => {
35
+ const data = node.data;
36
+ return (data.componentType === 'asset' && data.componentSubType === 'api');
37
+ })).toHaveLength(1);
38
+ expect(nodes.some((node) => {
39
+ const data = node.data;
40
+ return (data.componentType === 'third_party' && data.serviceName === 'stripe');
41
+ })).toBe(true);
42
+ expect(nodes.some((node) => ['User', 'Post'].includes(String(node.data.label)))).toBe(false);
43
+ expect(validation.value.graph.edges.some((edge) => edge.source === edge.target)).toBe(false);
44
+ fs_1.default.unlinkSync(outputPath);
45
+ }, 15000);
46
+ });
@@ -28,8 +28,16 @@ describe("scan quota flow", () => {
28
28
  fs_1.default.rmSync(tempRoot, { recursive: true, force: true });
29
29
  delete process.env.DATAPARADE_WORKSPACE_API_KEY;
30
30
  delete process.env.DATAPARADE_SKIP_AUTO_UPLOAD;
31
+ delete process.env.SCAN_HOSTED_INFER_PROXY_URL;
31
32
  process.exitCode = 0;
32
33
  });
34
+ it("skips anonymous AI session when hosted infer proxy is configured", async () => {
35
+ process.env.SCAN_HOSTED_INFER_PROXY_URL = "http://127.0.0.1:9/infer";
36
+ process.env.DATAPARADE_SKIP_AUTO_UPLOAD = "true";
37
+ await (0, cli_1.run)(["node", "cli", "scan", tempRoot, "--ai-inference"]);
38
+ expect(fetchMock).not.toHaveBeenCalled();
39
+ expect(process.exitCode ?? 0).toBe(0);
40
+ });
33
41
  it("skips quota API when workspace key is present but AI is disabled", async () => {
34
42
  process.env.DATAPARADE_WORKSPACE_API_KEY = "dp_live_test";
35
43
  process.env.DATAPARADE_SKIP_AUTO_UPLOAD = "true";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataparade/cli",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "dataPARADE CLI — scan codebases for privacy and security data flows",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -54,7 +54,7 @@
54
54
  "eval:models": "pnpm exec node dist/src/evals/run-model-matrix.js"
55
55
  },
56
56
  "dependencies": {
57
- "@dataparade/scanner": "github:DataParade-io/scanner#998fb12b2db667dd7ff305e34c716634b867e806",
57
+ "@dataparade/scanner": "github:DataParade-io/scanner#4363d8ce2925e3457923432e3de1703e0f9ab46f",
58
58
  "@sentry/node": "^10.38.0",
59
59
  "commander": "^12.1.0",
60
60
  "dotenv": "^16.4.7",
@@ -1,2 +0,0 @@
1
- import "./pg-client";
2
- export declare function ensurePgClientLoaded(): void;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensurePgClientLoaded = ensurePgClientLoaded;
4
- require("./pg-client");
5
- function ensurePgClientLoaded() {
6
- // This module exists so the TypeScript analyzer sees a module import containing
7
- // "pg" and can emit a database_connection finding for tests.
8
- }
@@ -1,3 +0,0 @@
1
- type QueryResultRow = Record<string, unknown>;
2
- export declare function getUserById(id: string): Promise<QueryResultRow>;
3
- export {};
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUserById = getUserById;
4
- async function getUserById(id) {
5
- const result = await pool.query("SELECT * FROM users WHERE id = $1", [id]);
6
- return result.rows[0];
7
- }
@@ -1 +0,0 @@
1
- export declare function callExternalApi(): Promise<any>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.callExternalApi = callExternalApi;
4
- async function callExternalApi() {
5
- const apiKey = process.env.API_KEY;
6
- // Use a host that matches a known third-party (stripe) so the
7
- // external_api_call pattern plus classifier will produce a third_party
8
- // component and a corresponding data flow in tests.
9
- const response = await fetch("https://api.stripe.com/v1/customers", {
10
- headers: {
11
- "x-api-key": apiKey ?? "test-key",
12
- },
13
- });
14
- if (!response.ok) {
15
- throw new Error("API request failed");
16
- }
17
- return response.json();
18
- }
@@ -1,3 +0,0 @@
1
- type QueryResultRow = Record<string, unknown>;
2
- export declare function runHealthCheck(): Promise<QueryResultRow | undefined>;
3
- export {};
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runHealthCheck = runHealthCheck;
4
- async function runHealthCheck() {
5
- const result = await pool.query("SELECT 1", []);
6
- return result.rows[0];
7
- }
@@ -1,14 +0,0 @@
1
- type E2eRequestLike = {
2
- [key: string]: unknown;
3
- };
4
- type E2eResponseLike = {
5
- send: (body: unknown) => void;
6
- };
7
- declare const e2eApp: {
8
- get: (path: string, ...handlers: Array<(req: E2eRequestLike, res: E2eResponseLike, next?: () => void) => void>) => void;
9
- };
10
- declare const e2ePassport: {
11
- authenticate: (strategy: string, options?: {
12
- session?: boolean;
13
- }) => (req: E2eRequestLike, res: E2eResponseLike, next: (() => void) | undefined) => void;
14
- };
@@ -1,4 +0,0 @@
1
- "use strict";
2
- e2eApp.get("/users", e2ePassport.authenticate("jwt", { session: false }), (req, res) => {
3
- res.send("ok");
4
- });
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const express_1 = __importDefault(require("express"));
7
- const app = (0, express_1.default)();
8
- // Express route (used by `express_route` detection).
9
- app.get("/users", (req, res) => {
10
- res.send("ok");
11
- });
12
- // Env var usage (used by `env_variable` detection).
13
- const apiKey = process.env.API_KEY;
14
- const awsRegion = process.env.AWS_REGION;
15
- // Sentry ingestion (used by `external_api_call` detection with serviceName inference).
16
- async function callSentry() {
17
- await fetch("https://o0.ingest.sentry.io/api/123/envelope/", {
18
- method: "POST",
19
- body: "{}",
20
- });
21
- }
22
- void apiKey;
23
- void awsRegion;
24
- void callSentry;
@@ -1 +0,0 @@
1
- export declare function main(): void;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.main = main;
4
- function main() {
5
- console.log("hello from index.ts");
6
- }
@@ -1,2 +0,0 @@
1
- declare const app: any;
2
- export default app;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const express_1 = __importDefault(require("express"));
7
- const app = (0, express_1.default)();
8
- app.get("/health", async (_req, res) => {
9
- await fetch("https://api.stripe.com/v1/charges");
10
- res.json({ ok: true });
11
- });
12
- exports.default = app;
@@ -1 +0,0 @@
1
- export declare function GET(): Promise<void>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET = GET;
4
- async function GET() {
5
- // Minimal route handler for express_route detection in the app section.
6
- }
@@ -1 +0,0 @@
1
- export declare function GET(): Promise<void>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET = GET;
4
- async function GET() {
5
- // Minimal route handler for backend section (express_route detection).
6
- }
@@ -1 +0,0 @@
1
- export declare function GET(): Promise<void>;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET = GET;
4
- async function GET() {
5
- // Minimal Next.js-style route handler used to trigger express_route
6
- // detection via heuristics.
7
- }
@@ -1 +0,0 @@
1
- export declare function GET(): Promise<void>;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET = GET;
4
- async function GET() {
5
- // Minimal Next.js-style route handler used to trigger express_route
6
- // detection via heuristics; body is irrelevant for tests.
7
- }
@@ -1,2 +0,0 @@
1
- import "./pg-client";
2
- export declare function ensurePgClientLoaded(): void;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensurePgClientLoaded = ensurePgClientLoaded;
4
- require("./pg-client");
5
- function ensurePgClientLoaded() {
6
- // This module exists so the TypeScript analyzer sees a module import containing
7
- // \"pg\" and can emit a database_connection finding for tests.
8
- }
@@ -1,3 +0,0 @@
1
- type QueryResultRow = Record<string, unknown>;
2
- export declare function getUserById(id: string): Promise<QueryResultRow>;
3
- export {};
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUserById = getUserById;
4
- async function getUserById(id) {
5
- const result = await pool.query("SELECT * FROM users WHERE id = $1", [id]);
6
- return result.rows[0];
7
- }
@@ -1 +0,0 @@
1
- export declare function callExternalApi(): Promise<any>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.callExternalApi = callExternalApi;
4
- async function callExternalApi() {
5
- const apiKey = process.env.API_KEY;
6
- // Use a host that matches a known third-party (stripe) so the
7
- // external_api_call pattern plus classifier will produce a third_party
8
- // component and a corresponding data flow in tests.
9
- const response = await fetch("https://api.stripe.com/v1/customers", {
10
- headers: {
11
- "x-api-key": apiKey ?? "test-key",
12
- },
13
- });
14
- if (!response.ok) {
15
- throw new Error("API request failed");
16
- }
17
- return response.json();
18
- }
@@ -1,3 +0,0 @@
1
- type QueryResultRow = Record<string, unknown>;
2
- export declare function runHealthCheck(): Promise<QueryResultRow | undefined>;
3
- export {};
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runHealthCheck = runHealthCheck;
4
- async function runHealthCheck() {
5
- const result = await pool.query("SELECT 1", []);
6
- return result.rows[0];
7
- }
@@ -1,14 +0,0 @@
1
- type RequestLike = {
2
- [key: string]: unknown;
3
- };
4
- type ResponseLike = {
5
- send: (body: unknown) => void;
6
- };
7
- declare const app: {
8
- get: (path: string, ...handlers: Array<(req: RequestLike, res: ResponseLike, next?: () => void) => void>) => void;
9
- };
10
- declare const passport: {
11
- authenticate: (strategy: string, options?: {
12
- session?: boolean;
13
- }) => (req: RequestLike, res: ResponseLike, next: (() => void) | undefined) => void;
14
- };
@@ -1,4 +0,0 @@
1
- "use strict";
2
- app.get("/users", passport.authenticate("jwt", { session: false }), (req, res) => {
3
- res.send("ok");
4
- });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- // Intentionally empty: we rely on package.json for third-party detection.