infrawise 0.4.2 → 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.
- package/README.md +21 -48
- package/dist/adapters/aws.js +50 -64
- package/dist/adapters/dynamodb.js +17 -22
- package/dist/adapters/logs.js +12 -16
- package/dist/adapters/mongodb.js +10 -16
- package/dist/adapters/mysql.js +8 -17
- package/dist/adapters/postgres.js +9 -13
- package/dist/adapters/terraform.js +14 -56
- package/dist/analyzers/aws-services.js +7 -17
- package/dist/analyzers/dynamodb.js +6 -12
- package/dist/analyzers/index.js +13 -41
- package/dist/analyzers/mongodb.js +4 -9
- package/dist/analyzers/mysql.js +4 -9
- package/dist/analyzers/postgres.js +3 -9
- package/dist/analyzers/rds.js +5 -13
- package/dist/analyzers/terraform.js +1 -5
- package/dist/cli/commands/analyze.js +178 -215
- package/dist/cli/commands/auth.js +24 -30
- package/dist/cli/commands/dev.js +84 -43
- package/dist/cli/commands/doctor.js +35 -74
- package/dist/cli/commands/init.js +33 -72
- package/dist/cli/index.js +21 -28
- package/dist/cli/utils.js +40 -86
- package/dist/context/index.js +49 -85
- package/dist/core/cache.js +5 -43
- package/dist/core/config.js +43 -81
- package/dist/core/errors.js +7 -17
- package/dist/core/index.js +4 -22
- package/dist/core/logger.js +4 -10
- package/dist/graph/index.js +15 -32
- package/dist/server/index.js +236 -302
- package/dist/types.js +1 -2
- package/package.json +34 -31
package/dist/core/logger.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
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
|
-
exports.logger = void 0;
|
|
7
|
-
const pino_1 = __importDefault(require("pino"));
|
|
1
|
+
import pino from 'pino';
|
|
8
2
|
function createLogger() {
|
|
9
3
|
const isDevelopment = process.env.NODE_ENV !== 'production';
|
|
10
4
|
if (isDevelopment) {
|
|
11
|
-
return (
|
|
5
|
+
return pino({
|
|
12
6
|
level: process.env.LOG_LEVEL ?? 'info',
|
|
13
7
|
transport: {
|
|
14
8
|
target: 'pino-pretty',
|
|
@@ -21,8 +15,8 @@ function createLogger() {
|
|
|
21
15
|
},
|
|
22
16
|
});
|
|
23
17
|
}
|
|
24
|
-
return (
|
|
18
|
+
return pino({
|
|
25
19
|
level: process.env.LOG_LEVEL ?? 'info',
|
|
26
20
|
});
|
|
27
21
|
}
|
|
28
|
-
|
|
22
|
+
export const logger = createLogger();
|
package/dist/graph/index.js
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildGraph = buildGraph;
|
|
4
|
-
exports.getTableNodes = getTableNodes;
|
|
5
|
-
exports.getFunctionNodes = getFunctionNodes;
|
|
6
|
-
exports.getIndexNodes = getIndexNodes;
|
|
7
|
-
exports.getQueueNodes = getQueueNodes;
|
|
8
|
-
exports.getTopicNodes = getTopicNodes;
|
|
9
|
-
exports.getSecretNodes = getSecretNodes;
|
|
10
|
-
exports.getParameterNodes = getParameterNodes;
|
|
11
|
-
exports.getLogGroupNodes = getLogGroupNodes;
|
|
12
|
-
exports.getLambdaNodes = getLambdaNodes;
|
|
13
|
-
exports.getEdgesForNode = getEdgesForNode;
|
|
14
|
-
exports.getOutgoingEdges = getOutgoingEdges;
|
|
15
|
-
exports.getIncomingEdges = getIncomingEdges;
|
|
16
|
-
exports.getScanEdges = getScanEdges;
|
|
17
|
-
exports.getEdgeFrequency = getEdgeFrequency;
|
|
18
|
-
function buildGraph(operations, dynamoMeta, postgresMeta, mysqlMeta = [], mongoMeta = [], servicesMeta = {}) {
|
|
1
|
+
export function buildGraph(operations, dynamoMeta, postgresMeta, mysqlMeta = [], mongoMeta = [], servicesMeta = {}) {
|
|
19
2
|
const nodes = [];
|
|
20
3
|
const edges = [];
|
|
21
4
|
const nodeIds = new Set();
|
|
@@ -226,46 +209,46 @@ function resolveEdgeType(operationType) {
|
|
|
226
209
|
return 'query';
|
|
227
210
|
}
|
|
228
211
|
// ── Typed node selectors ─────────────────────────────────────────────────────
|
|
229
|
-
function getTableNodes(graph) {
|
|
212
|
+
export function getTableNodes(graph) {
|
|
230
213
|
return graph.nodes.filter((n) => n.type === 'table');
|
|
231
214
|
}
|
|
232
|
-
function getFunctionNodes(graph) {
|
|
215
|
+
export function getFunctionNodes(graph) {
|
|
233
216
|
return graph.nodes.filter((n) => n.type === 'function');
|
|
234
217
|
}
|
|
235
|
-
function getIndexNodes(graph) {
|
|
218
|
+
export function getIndexNodes(graph) {
|
|
236
219
|
return graph.nodes.filter((n) => n.type === 'index');
|
|
237
220
|
}
|
|
238
|
-
function getQueueNodes(graph) {
|
|
221
|
+
export function getQueueNodes(graph) {
|
|
239
222
|
return graph.nodes.filter((n) => n.type === 'queue');
|
|
240
223
|
}
|
|
241
|
-
function getTopicNodes(graph) {
|
|
224
|
+
export function getTopicNodes(graph) {
|
|
242
225
|
return graph.nodes.filter((n) => n.type === 'topic');
|
|
243
226
|
}
|
|
244
|
-
function getSecretNodes(graph) {
|
|
227
|
+
export function getSecretNodes(graph) {
|
|
245
228
|
return graph.nodes.filter((n) => n.type === 'secret');
|
|
246
229
|
}
|
|
247
|
-
function getParameterNodes(graph) {
|
|
230
|
+
export function getParameterNodes(graph) {
|
|
248
231
|
return graph.nodes.filter((n) => n.type === 'parameter');
|
|
249
232
|
}
|
|
250
|
-
function getLogGroupNodes(graph) {
|
|
233
|
+
export function getLogGroupNodes(graph) {
|
|
251
234
|
return graph.nodes.filter((n) => n.type === 'log_group');
|
|
252
235
|
}
|
|
253
|
-
function getLambdaNodes(graph) {
|
|
236
|
+
export function getLambdaNodes(graph) {
|
|
254
237
|
return graph.nodes.filter((n) => n.type === 'lambda');
|
|
255
238
|
}
|
|
256
|
-
function getEdgesForNode(graph, nodeId) {
|
|
239
|
+
export function getEdgesForNode(graph, nodeId) {
|
|
257
240
|
return graph.edges.filter((e) => e.from === nodeId || e.to === nodeId);
|
|
258
241
|
}
|
|
259
|
-
function getOutgoingEdges(graph, nodeId) {
|
|
242
|
+
export function getOutgoingEdges(graph, nodeId) {
|
|
260
243
|
return graph.edges.filter((e) => e.from === nodeId);
|
|
261
244
|
}
|
|
262
|
-
function getIncomingEdges(graph, nodeId) {
|
|
245
|
+
export function getIncomingEdges(graph, nodeId) {
|
|
263
246
|
return graph.edges.filter((e) => e.to === nodeId);
|
|
264
247
|
}
|
|
265
|
-
function getScanEdges(graph) {
|
|
248
|
+
export function getScanEdges(graph) {
|
|
266
249
|
return graph.edges.filter((e) => e.type === 'scan');
|
|
267
250
|
}
|
|
268
|
-
function getEdgeFrequency(graph) {
|
|
251
|
+
export function getEdgeFrequency(graph) {
|
|
269
252
|
const freq = new Map();
|
|
270
253
|
for (const edge of graph.edges) {
|
|
271
254
|
const key = `${edge.from}->${edge.to}`;
|