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.
@@ -1,14 +1,8 @@
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
- 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 (0, pino_1.default)({
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 (0, pino_1.default)({
18
+ return pino({
25
19
  level: process.env.LOG_LEVEL ?? 'info',
26
20
  });
27
21
  }
28
- exports.logger = createLogger();
22
+ export const logger = createLogger();
@@ -1,21 +1,4 @@
1
- "use strict";
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}`;