infrawise 0.5.0 → 0.6.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.
@@ -1,49 +1,7 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.extractTerraformSchema = extractTerraformSchema;
40
- exports.extractCloudFormationSchema = extractCloudFormationSchema;
41
- exports.extractCDKSchema = extractCDKSchema;
42
- exports.extractIaCSchema = extractIaCSchema;
43
- const fs = __importStar(require("fs"));
44
- const path = __importStar(require("path"));
45
- const js_yaml_1 = __importDefault(require("js-yaml"));
46
- const core_1 = require("../core");
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import yaml from 'js-yaml';
4
+ import { logger } from '../core/index.js';
47
5
  function emptySchema() {
48
6
  return {
49
7
  dynamoTables: [],
@@ -118,10 +76,10 @@ function tfGSINames(body) {
118
76
  }
119
77
  return names;
120
78
  }
121
- async function extractTerraformSchema(repoPath) {
79
+ export async function extractTerraformSchema(repoPath) {
122
80
  const schema = emptySchema();
123
81
  const tfFiles = findFilesRecursively(repoPath, ['.tf']);
124
- core_1.logger.debug(`Found ${tfFiles.length} Terraform file(s)`);
82
+ logger.debug(`Found ${tfFiles.length} Terraform file(s)`);
125
83
  for (const filePath of tfFiles) {
126
84
  let content;
127
85
  try {
@@ -227,7 +185,7 @@ function parseCFNFile(filePath) {
227
185
  return null;
228
186
  let parsed;
229
187
  try {
230
- parsed = filePath.endsWith('.json') ? JSON.parse(content) : js_yaml_1.default.load(content);
188
+ parsed = filePath.endsWith('.json') ? JSON.parse(content) : yaml.load(content);
231
189
  }
232
190
  catch {
233
191
  return null;
@@ -361,10 +319,10 @@ function processCFNResources(resources, schema, filePath, source) {
361
319
  }
362
320
  }
363
321
  }
364
- async function extractCloudFormationSchema(repoPath) {
322
+ export async function extractCloudFormationSchema(repoPath) {
365
323
  const schema = emptySchema();
366
324
  const cfnFiles = findFilesRecursively(repoPath, ['.yaml', '.yml', '.json']);
367
- core_1.logger.debug(`Scanning ${cfnFiles.length} potential CloudFormation file(s)`);
325
+ logger.debug(`Scanning ${cfnFiles.length} potential CloudFormation file(s)`);
368
326
  for (const filePath of cfnFiles) {
369
327
  const parsed = parseCFNFile(filePath);
370
328
  if (!parsed)
@@ -377,7 +335,7 @@ async function extractCloudFormationSchema(repoPath) {
377
335
  return schema;
378
336
  }
379
337
  // ─── CDK parser ───────────────────────────────────────────────────────────────
380
- async function extractCDKSchema(repoPath) {
338
+ export async function extractCDKSchema(repoPath) {
381
339
  const schema = emptySchema();
382
340
  // Strategy 1: Parse cdk.out/*.template.json (synthesized CloudFormation)
383
341
  const cdkOutDir = path.join(repoPath, 'cdk.out');
@@ -385,7 +343,7 @@ async function extractCDKSchema(repoPath) {
385
343
  const templateFiles = fs.readdirSync(cdkOutDir)
386
344
  .filter((f) => f.endsWith('.template.json'))
387
345
  .map((f) => path.join(cdkOutDir, f));
388
- core_1.logger.debug(`Found ${templateFiles.length} CDK synthesized template(s) in cdk.out/`);
346
+ logger.debug(`Found ${templateFiles.length} CDK synthesized template(s) in cdk.out/`);
389
347
  for (const filePath of templateFiles) {
390
348
  const parsed = parseCFNFile(filePath);
391
349
  if (!parsed)
@@ -400,7 +358,7 @@ async function extractCDKSchema(repoPath) {
400
358
  if (schema.queues.length === 0 && schema.topics.length === 0 && schema.lambdas.length === 0) {
401
359
  const cdkJsonPath = path.join(repoPath, 'cdk.json');
402
360
  if (fs.existsSync(cdkJsonPath)) {
403
- core_1.logger.debug('CDK project detected (cdk.json found) — run `cdk synth` for full IaC analysis');
361
+ logger.debug('CDK project detected (cdk.json found) — run `cdk synth` for full IaC analysis');
404
362
  }
405
363
  }
406
364
  return schema;
@@ -494,7 +452,7 @@ function mergeSchemas(...schemas) {
494
452
  }
495
453
  return merged;
496
454
  }
497
- async function extractIaCSchema(repoPath) {
455
+ export async function extractIaCSchema(repoPath) {
498
456
  const [tfSchema, cfnSchema, cdkSchema] = await Promise.all([
499
457
  extractTerraformSchema(repoPath),
500
458
  extractCloudFormationSchema(repoPath),
@@ -505,6 +463,6 @@ async function extractIaCSchema(repoPath) {
505
463
  merged.mongoClusters.length + merged.queues.length + merged.topics.length +
506
464
  merged.lambdas.length + merged.buckets.length + merged.parameters.length +
507
465
  merged.secrets.length + merged.apiGateways.length;
508
- core_1.logger.debug(`IaC schema total: ${total} resource(s) across TF/CFN/CDK`);
466
+ logger.debug(`IaC schema total: ${total} resource(s) across TF/CFN/CDK`);
509
467
  return merged;
510
468
  }
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LambdaHighTimeoutAnalyzer = exports.LambdaDefaultMemoryAnalyzer = exports.MissingLogRetentionAnalyzer = exports.MissingSecretRotationAnalyzer = exports.LargeQueueBacklogAnalyzer = exports.UnencryptedQueueAnalyzer = exports.MissingDLQAnalyzer = void 0;
4
1
  // ─── SQS ─────────────────────────────────────────────────────────────────────
5
- class MissingDLQAnalyzer {
2
+ export class MissingDLQAnalyzer {
6
3
  name = 'MissingDLQAnalyzer';
7
4
  async analyze(graph) {
8
5
  const findings = [];
@@ -22,8 +19,7 @@ class MissingDLQAnalyzer {
22
19
  return findings;
23
20
  }
24
21
  }
25
- exports.MissingDLQAnalyzer = MissingDLQAnalyzer;
26
- class UnencryptedQueueAnalyzer {
22
+ export class UnencryptedQueueAnalyzer {
27
23
  name = 'UnencryptedQueueAnalyzer';
28
24
  async analyze(graph) {
29
25
  const findings = [];
@@ -43,8 +39,7 @@ class UnencryptedQueueAnalyzer {
43
39
  return findings;
44
40
  }
45
41
  }
46
- exports.UnencryptedQueueAnalyzer = UnencryptedQueueAnalyzer;
47
- class LargeQueueBacklogAnalyzer {
42
+ export class LargeQueueBacklogAnalyzer {
48
43
  name = 'LargeQueueBacklogAnalyzer';
49
44
  threshold;
50
45
  constructor(threshold = 1000) {
@@ -69,9 +64,8 @@ class LargeQueueBacklogAnalyzer {
69
64
  return findings;
70
65
  }
71
66
  }
72
- exports.LargeQueueBacklogAnalyzer = LargeQueueBacklogAnalyzer;
73
67
  // ─── Secrets Manager ─────────────────────────────────────────────────────────
74
- class MissingSecretRotationAnalyzer {
68
+ export class MissingSecretRotationAnalyzer {
75
69
  name = 'MissingSecretRotationAnalyzer';
76
70
  async analyze(graph) {
77
71
  const findings = [];
@@ -91,9 +85,8 @@ class MissingSecretRotationAnalyzer {
91
85
  return findings;
92
86
  }
93
87
  }
94
- exports.MissingSecretRotationAnalyzer = MissingSecretRotationAnalyzer;
95
88
  // ─── CloudWatch Logs ─────────────────────────────────────────────────────────
96
- class MissingLogRetentionAnalyzer {
89
+ export class MissingLogRetentionAnalyzer {
97
90
  name = 'MissingLogRetentionAnalyzer';
98
91
  async analyze(graph) {
99
92
  const findings = [];
@@ -122,9 +115,8 @@ class MissingLogRetentionAnalyzer {
122
115
  return findings;
123
116
  }
124
117
  }
125
- exports.MissingLogRetentionAnalyzer = MissingLogRetentionAnalyzer;
126
118
  // ─── Lambda ───────────────────────────────────────────────────────────────────
127
- class LambdaDefaultMemoryAnalyzer {
119
+ export class LambdaDefaultMemoryAnalyzer {
128
120
  name = 'LambdaDefaultMemoryAnalyzer';
129
121
  async analyze(graph) {
130
122
  const findings = [];
@@ -144,8 +136,7 @@ class LambdaDefaultMemoryAnalyzer {
144
136
  return findings;
145
137
  }
146
138
  }
147
- exports.LambdaDefaultMemoryAnalyzer = LambdaDefaultMemoryAnalyzer;
148
- class LambdaHighTimeoutAnalyzer {
139
+ export class LambdaHighTimeoutAnalyzer {
149
140
  name = 'LambdaHighTimeoutAnalyzer';
150
141
  async analyze(graph) {
151
142
  const findings = [];
@@ -165,4 +156,3 @@ class LambdaHighTimeoutAnalyzer {
165
156
  return findings;
166
157
  }
167
158
  }
168
- exports.LambdaHighTimeoutAnalyzer = LambdaHighTimeoutAnalyzer;
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HotPartitionAnalyzer = exports.MissingGSIAnalyzer = exports.FullTableScanAnalyzer = void 0;
4
- const graph_1 = require("../graph");
1
+ import { getScanEdges, getEdgeFrequency } from '../graph/index.js';
5
2
  /**
6
3
  * Detects full table scans on DynamoDB tables.
7
4
  * A full scan without any filters is always a high-severity issue.
8
5
  */
9
- class FullTableScanAnalyzer {
6
+ export class FullTableScanAnalyzer {
10
7
  name = 'FullTableScanAnalyzer';
11
8
  async analyze(graph) {
12
9
  const findings = [];
13
- const scanEdges = (0, graph_1.getScanEdges)(graph);
10
+ const scanEdges = getScanEdges(graph);
14
11
  // Find which tables are being scanned
15
12
  const scannedTableIds = new Set();
16
13
  for (const edge of scanEdges) {
@@ -46,12 +43,11 @@ class FullTableScanAnalyzer {
46
43
  return findings;
47
44
  }
48
45
  }
49
- exports.FullTableScanAnalyzer = FullTableScanAnalyzer;
50
46
  /**
51
47
  * Detects when a DynamoDB table is accessed without a GSI covering
52
48
  * the access pattern, which forces an expensive scan or inefficient query.
53
49
  */
54
- class MissingGSIAnalyzer {
50
+ export class MissingGSIAnalyzer {
55
51
  name = 'MissingGSIAnalyzer';
56
52
  async analyze(graph) {
57
53
  const findings = [];
@@ -87,12 +83,11 @@ class MissingGSIAnalyzer {
87
83
  return findings;
88
84
  }
89
85
  }
90
- exports.MissingGSIAnalyzer = MissingGSIAnalyzer;
91
86
  /**
92
87
  * Detects hot partition patterns — when the same table/partition
93
88
  * is accessed with very high frequency from many code paths.
94
89
  */
95
- class HotPartitionAnalyzer {
90
+ export class HotPartitionAnalyzer {
96
91
  name = 'HotPartitionAnalyzer';
97
92
  hotThreshold;
98
93
  constructor(hotThreshold = 5) {
@@ -100,7 +95,7 @@ class HotPartitionAnalyzer {
100
95
  }
101
96
  async analyze(graph) {
102
97
  const findings = [];
103
- const edgeFrequency = (0, graph_1.getEdgeFrequency)(graph);
98
+ const edgeFrequency = getEdgeFrequency(graph);
104
99
  // Count how many distinct functions access each DynamoDB table
105
100
  const tableAccessCount = new Map();
106
101
  for (const edge of graph.edges) {
@@ -141,4 +136,3 @@ class HotPartitionAnalyzer {
141
136
  return findings;
142
137
  }
143
138
  }
144
- exports.HotPartitionAnalyzer = HotPartitionAnalyzer;
@@ -1,57 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RDSNoMultiAZAnalyzer = exports.RDSNoDeletionProtectionAnalyzer = exports.RDSUnencryptedAnalyzer = exports.RDSNoBackupAnalyzer = exports.RDSPubliclyAccessibleAnalyzer = exports.LambdaHighTimeoutAnalyzer = exports.LambdaDefaultMemoryAnalyzer = exports.MissingLogRetentionAnalyzer = exports.MissingSecretRotationAnalyzer = exports.LargeQueueBacklogAnalyzer = exports.UnencryptedQueueAnalyzer = exports.MissingDLQAnalyzer = exports.IaCDriftAnalyzer = exports.MongoCollectionScanAnalyzer = exports.MissingMongoIndexAnalyzer = exports.MySQLFullTableScanAnalyzer = exports.MissingMySQLIndexAnalyzer = exports.LargeSelectAnalyzer = exports.NplusOneAnalyzer = exports.MissingIndexAnalyzer = exports.HotPartitionAnalyzer = exports.MissingGSIAnalyzer = exports.FullTableScanAnalyzer = void 0;
4
- exports.runAllAnalyzers = runAllAnalyzers;
5
- exports.summarizeFindings = summarizeFindings;
6
- const core_1 = require("../core");
7
- var dynamodb_1 = require("./dynamodb");
8
- Object.defineProperty(exports, "FullTableScanAnalyzer", { enumerable: true, get: function () { return dynamodb_1.FullTableScanAnalyzer; } });
9
- Object.defineProperty(exports, "MissingGSIAnalyzer", { enumerable: true, get: function () { return dynamodb_1.MissingGSIAnalyzer; } });
10
- Object.defineProperty(exports, "HotPartitionAnalyzer", { enumerable: true, get: function () { return dynamodb_1.HotPartitionAnalyzer; } });
11
- var postgres_1 = require("./postgres");
12
- Object.defineProperty(exports, "MissingIndexAnalyzer", { enumerable: true, get: function () { return postgres_1.MissingIndexAnalyzer; } });
13
- Object.defineProperty(exports, "NplusOneAnalyzer", { enumerable: true, get: function () { return postgres_1.NplusOneAnalyzer; } });
14
- Object.defineProperty(exports, "LargeSelectAnalyzer", { enumerable: true, get: function () { return postgres_1.LargeSelectAnalyzer; } });
15
- var mysql_1 = require("./mysql");
16
- Object.defineProperty(exports, "MissingMySQLIndexAnalyzer", { enumerable: true, get: function () { return mysql_1.MissingMySQLIndexAnalyzer; } });
17
- Object.defineProperty(exports, "MySQLFullTableScanAnalyzer", { enumerable: true, get: function () { return mysql_1.MySQLFullTableScanAnalyzer; } });
18
- var mongodb_1 = require("./mongodb");
19
- Object.defineProperty(exports, "MissingMongoIndexAnalyzer", { enumerable: true, get: function () { return mongodb_1.MissingMongoIndexAnalyzer; } });
20
- Object.defineProperty(exports, "MongoCollectionScanAnalyzer", { enumerable: true, get: function () { return mongodb_1.MongoCollectionScanAnalyzer; } });
21
- var terraform_1 = require("./terraform");
22
- Object.defineProperty(exports, "IaCDriftAnalyzer", { enumerable: true, get: function () { return terraform_1.IaCDriftAnalyzer; } });
23
- var aws_services_1 = require("./aws-services");
24
- Object.defineProperty(exports, "MissingDLQAnalyzer", { enumerable: true, get: function () { return aws_services_1.MissingDLQAnalyzer; } });
25
- Object.defineProperty(exports, "UnencryptedQueueAnalyzer", { enumerable: true, get: function () { return aws_services_1.UnencryptedQueueAnalyzer; } });
26
- Object.defineProperty(exports, "LargeQueueBacklogAnalyzer", { enumerable: true, get: function () { return aws_services_1.LargeQueueBacklogAnalyzer; } });
27
- Object.defineProperty(exports, "MissingSecretRotationAnalyzer", { enumerable: true, get: function () { return aws_services_1.MissingSecretRotationAnalyzer; } });
28
- Object.defineProperty(exports, "MissingLogRetentionAnalyzer", { enumerable: true, get: function () { return aws_services_1.MissingLogRetentionAnalyzer; } });
29
- Object.defineProperty(exports, "LambdaDefaultMemoryAnalyzer", { enumerable: true, get: function () { return aws_services_1.LambdaDefaultMemoryAnalyzer; } });
30
- Object.defineProperty(exports, "LambdaHighTimeoutAnalyzer", { enumerable: true, get: function () { return aws_services_1.LambdaHighTimeoutAnalyzer; } });
31
- var rds_1 = require("./rds");
32
- Object.defineProperty(exports, "RDSPubliclyAccessibleAnalyzer", { enumerable: true, get: function () { return rds_1.RDSPubliclyAccessibleAnalyzer; } });
33
- Object.defineProperty(exports, "RDSNoBackupAnalyzer", { enumerable: true, get: function () { return rds_1.RDSNoBackupAnalyzer; } });
34
- Object.defineProperty(exports, "RDSUnencryptedAnalyzer", { enumerable: true, get: function () { return rds_1.RDSUnencryptedAnalyzer; } });
35
- Object.defineProperty(exports, "RDSNoDeletionProtectionAnalyzer", { enumerable: true, get: function () { return rds_1.RDSNoDeletionProtectionAnalyzer; } });
36
- Object.defineProperty(exports, "RDSNoMultiAZAnalyzer", { enumerable: true, get: function () { return rds_1.RDSNoMultiAZAnalyzer; } });
37
- async function runAllAnalyzers(graph, analyzers) {
1
+ import { logger } from '../core/index.js';
2
+ export { FullTableScanAnalyzer, MissingGSIAnalyzer, HotPartitionAnalyzer } from './dynamodb.js';
3
+ export { MissingIndexAnalyzer, NplusOneAnalyzer, LargeSelectAnalyzer } from './postgres.js';
4
+ export { MissingMySQLIndexAnalyzer, MySQLFullTableScanAnalyzer } from './mysql.js';
5
+ export { MissingMongoIndexAnalyzer, MongoCollectionScanAnalyzer } from './mongodb.js';
6
+ export { IaCDriftAnalyzer } from './terraform.js';
7
+ export { MissingDLQAnalyzer, UnencryptedQueueAnalyzer, LargeQueueBacklogAnalyzer, MissingSecretRotationAnalyzer, MissingLogRetentionAnalyzer, LambdaDefaultMemoryAnalyzer, LambdaHighTimeoutAnalyzer, } from './aws-services.js';
8
+ export { RDSPubliclyAccessibleAnalyzer, RDSNoBackupAnalyzer, RDSUnencryptedAnalyzer, RDSNoDeletionProtectionAnalyzer, RDSNoMultiAZAnalyzer, } from './rds.js';
9
+ export async function runAllAnalyzers(graph, analyzers) {
38
10
  const allFindings = [];
39
11
  for (const analyzer of analyzers) {
40
12
  try {
41
- core_1.logger.debug(`Running analyzer: ${analyzer.name}`);
13
+ logger.debug(`Running analyzer: ${analyzer.name}`);
42
14
  const findings = await analyzer.analyze(graph);
43
- core_1.logger.debug(`[${analyzer.name}] found ${findings.length} issue(s)`);
15
+ logger.debug(`[${analyzer.name}] found ${findings.length} issue(s)`);
44
16
  allFindings.push(...findings);
45
17
  }
46
18
  catch (err) {
47
- core_1.logger.warn(`Analyzer "${analyzer.name}" failed: ${err instanceof Error ? err.message : String(err)}`);
19
+ logger.warn(`Analyzer "${analyzer.name}" failed: ${err instanceof Error ? err.message : String(err)}`);
48
20
  }
49
21
  }
50
22
  const severityOrder = { high: 0, medium: 1, low: 2 };
51
23
  allFindings.sort((a, b) => severityOrder[a.severity] - severityOrder[b.severity]);
52
24
  return allFindings;
53
25
  }
54
- function summarizeFindings(findings) {
26
+ export function summarizeFindings(findings) {
55
27
  const counts = { total: findings.length, high: 0, medium: 0, low: 0 };
56
28
  for (const f of findings)
57
29
  counts[f.severity]++;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MongoCollectionScanAnalyzer = exports.MissingMongoIndexAnalyzer = void 0;
4
- const graph_1 = require("../graph");
1
+ import { getScanEdges } from '../graph/index.js';
5
2
  /**
6
3
  * Detects MongoDB collections that are queried without any secondary indexes.
7
4
  */
8
- class MissingMongoIndexAnalyzer {
5
+ export class MissingMongoIndexAnalyzer {
9
6
  name = 'MissingMongoIndexAnalyzer';
10
7
  async analyze(graph) {
11
8
  const findings = [];
@@ -37,15 +34,14 @@ class MissingMongoIndexAnalyzer {
37
34
  return findings;
38
35
  }
39
36
  }
40
- exports.MissingMongoIndexAnalyzer = MissingMongoIndexAnalyzer;
41
37
  /**
42
38
  * Detects collection scan operations on MongoDB collections.
43
39
  */
44
- class MongoCollectionScanAnalyzer {
40
+ export class MongoCollectionScanAnalyzer {
45
41
  name = 'MongoCollectionScanAnalyzer';
46
42
  async analyze(graph) {
47
43
  const findings = [];
48
- const scanEdges = (0, graph_1.getScanEdges)(graph);
44
+ const scanEdges = getScanEdges(graph);
49
45
  const scannedCollIds = new Set();
50
46
  for (const edge of scanEdges) {
51
47
  const targetNode = graph.nodes.find((n) => n.id === edge.to);
@@ -79,4 +75,3 @@ class MongoCollectionScanAnalyzer {
79
75
  return findings;
80
76
  }
81
77
  }
82
- exports.MongoCollectionScanAnalyzer = MongoCollectionScanAnalyzer;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MySQLFullTableScanAnalyzer = exports.MissingMySQLIndexAnalyzer = void 0;
4
- const graph_1 = require("../graph");
1
+ import { getScanEdges } from '../graph/index.js';
5
2
  /**
6
3
  * Detects MySQL tables that are queried without any indexes defined.
7
4
  */
8
- class MissingMySQLIndexAnalyzer {
5
+ export class MissingMySQLIndexAnalyzer {
9
6
  name = 'MissingMySQLIndexAnalyzer';
10
7
  async analyze(graph) {
11
8
  const findings = [];
@@ -37,15 +34,14 @@ class MissingMySQLIndexAnalyzer {
37
34
  return findings;
38
35
  }
39
36
  }
40
- exports.MissingMySQLIndexAnalyzer = MissingMySQLIndexAnalyzer;
41
37
  /**
42
38
  * Detects full table scans on MySQL tables.
43
39
  */
44
- class MySQLFullTableScanAnalyzer {
40
+ export class MySQLFullTableScanAnalyzer {
45
41
  name = 'MySQLFullTableScanAnalyzer';
46
42
  async analyze(graph) {
47
43
  const findings = [];
48
- const scanEdges = (0, graph_1.getScanEdges)(graph);
44
+ const scanEdges = getScanEdges(graph);
49
45
  const scannedTableIds = new Set();
50
46
  for (const edge of scanEdges) {
51
47
  const targetNode = graph.nodes.find((n) => n.id === edge.to);
@@ -79,4 +75,3 @@ class MySQLFullTableScanAnalyzer {
79
75
  return findings;
80
76
  }
81
77
  }
82
- exports.MySQLFullTableScanAnalyzer = MySQLFullTableScanAnalyzer;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LargeSelectAnalyzer = exports.NplusOneAnalyzer = exports.MissingIndexAnalyzer = void 0;
4
1
  /**
5
2
  * Detects PostgreSQL table columns that are used in WHERE patterns
6
3
  * but don't have a corresponding index.
7
4
  */
8
- class MissingIndexAnalyzer {
5
+ export class MissingIndexAnalyzer {
9
6
  name = 'MissingIndexAnalyzer';
10
7
  async analyze(graph) {
11
8
  const findings = [];
@@ -39,12 +36,11 @@ class MissingIndexAnalyzer {
39
36
  return findings;
40
37
  }
41
38
  }
42
- exports.MissingIndexAnalyzer = MissingIndexAnalyzer;
43
39
  /**
44
40
  * Detects N+1 query patterns — same function making multiple queries
45
41
  * to the same table inside what is likely a loop.
46
42
  */
47
- class NplusOneAnalyzer {
43
+ export class NplusOneAnalyzer {
48
44
  name = 'NplusOneAnalyzer';
49
45
  async analyze(graph) {
50
46
  const findings = [];
@@ -92,12 +88,11 @@ class NplusOneAnalyzer {
92
88
  return findings;
93
89
  }
94
90
  }
95
- exports.NplusOneAnalyzer = NplusOneAnalyzer;
96
91
  /**
97
92
  * Detects SELECT * usage patterns which read all columns even when
98
93
  * only a subset is needed, wasting I/O and memory.
99
94
  */
100
- class LargeSelectAnalyzer {
95
+ export class LargeSelectAnalyzer {
101
96
  name = 'LargeSelectAnalyzer';
102
97
  async analyze(graph) {
103
98
  const findings = [];
@@ -145,4 +140,3 @@ class LargeSelectAnalyzer {
145
140
  return findings;
146
141
  }
147
142
  }
148
- exports.LargeSelectAnalyzer = LargeSelectAnalyzer;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RDSNoMultiAZAnalyzer = exports.RDSNoDeletionProtectionAnalyzer = exports.RDSUnencryptedAnalyzer = exports.RDSNoBackupAnalyzer = exports.RDSPubliclyAccessibleAnalyzer = void 0;
4
1
  // ─── RDS ─────────────────────────────────────────────────────────────────────
5
- class RDSPubliclyAccessibleAnalyzer {
2
+ export class RDSPubliclyAccessibleAnalyzer {
6
3
  name = 'RDSPubliclyAccessibleAnalyzer';
7
4
  async analyze(graph) {
8
5
  const findings = [];
@@ -22,8 +19,7 @@ class RDSPubliclyAccessibleAnalyzer {
22
19
  return findings;
23
20
  }
24
21
  }
25
- exports.RDSPubliclyAccessibleAnalyzer = RDSPubliclyAccessibleAnalyzer;
26
- class RDSNoBackupAnalyzer {
22
+ export class RDSNoBackupAnalyzer {
27
23
  name = 'RDSNoBackupAnalyzer';
28
24
  async analyze(graph) {
29
25
  const findings = [];
@@ -43,8 +39,7 @@ class RDSNoBackupAnalyzer {
43
39
  return findings;
44
40
  }
45
41
  }
46
- exports.RDSNoBackupAnalyzer = RDSNoBackupAnalyzer;
47
- class RDSUnencryptedAnalyzer {
42
+ export class RDSUnencryptedAnalyzer {
48
43
  name = 'RDSUnencryptedAnalyzer';
49
44
  async analyze(graph) {
50
45
  const findings = [];
@@ -64,8 +59,7 @@ class RDSUnencryptedAnalyzer {
64
59
  return findings;
65
60
  }
66
61
  }
67
- exports.RDSUnencryptedAnalyzer = RDSUnencryptedAnalyzer;
68
- class RDSNoDeletionProtectionAnalyzer {
62
+ export class RDSNoDeletionProtectionAnalyzer {
69
63
  name = 'RDSNoDeletionProtectionAnalyzer';
70
64
  async analyze(graph) {
71
65
  const findings = [];
@@ -85,8 +79,7 @@ class RDSNoDeletionProtectionAnalyzer {
85
79
  return findings;
86
80
  }
87
81
  }
88
- exports.RDSNoDeletionProtectionAnalyzer = RDSNoDeletionProtectionAnalyzer;
89
- class RDSNoMultiAZAnalyzer {
82
+ export class RDSNoMultiAZAnalyzer {
90
83
  name = 'RDSNoMultiAZAnalyzer';
91
84
  async analyze(graph) {
92
85
  const findings = [];
@@ -106,4 +99,3 @@ class RDSNoMultiAZAnalyzer {
106
99
  return findings;
107
100
  }
108
101
  }
109
- exports.RDSNoMultiAZAnalyzer = RDSNoMultiAZAnalyzer;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IaCDriftAnalyzer = void 0;
4
- class IaCDriftAnalyzer {
1
+ export class IaCDriftAnalyzer {
5
2
  name = 'IaCDriftAnalyzer';
6
3
  iacSchema = null;
7
4
  setIaCSchema(schema) {
@@ -92,4 +89,3 @@ class IaCDriftAnalyzer {
92
89
  return findings;
93
90
  }
94
91
  }
95
- exports.IaCDriftAnalyzer = IaCDriftAnalyzer;