bridgelist 1.0.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.
@@ -0,0 +1,279 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.generateDocumentation = generateDocumentation;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const ast_analyzer_1 = require("../analyzers/ast-analyzer");
40
+ const project_scanner_1 = require("../utils/project-scanner");
41
+ const process = __importStar(require("node:process"));
42
+ function generateDocumentation(outputPath) {
43
+ let html = `
44
+ <!DOCTYPE html>
45
+ <html lang="en">
46
+ <head>
47
+ <title>bridgelist</title>
48
+ <style>
49
+ * {
50
+ margin: 0;
51
+ padding: 0;
52
+ box-sizing: border-box;
53
+ }
54
+ h1 {
55
+ margin-bottom: 2rem;
56
+ }
57
+ h3, p {
58
+ margin-bottom: 1rem;
59
+ }
60
+ body {
61
+ font-family: Roboto, Helvetica, sans-serif;
62
+ padding: 2rem;
63
+ }
64
+ .mapping-container {
65
+ width: 100%;
66
+ display: flex;
67
+ flex-direction: column;
68
+ align-items: flex-start;
69
+ border: 1px solid #ddd;
70
+ border-radius: 5px;
71
+ padding: 1rem;
72
+ margin: 1rem 0;
73
+ }
74
+ table {
75
+ border-collapse: collapse;
76
+ width: 100%;
77
+ margin: 1rem 0;
78
+ }
79
+ th, td {
80
+ border: 1px solid #ddd;
81
+ padding: 8px;
82
+ }
83
+ th {
84
+ background-color: #f2f2f2;
85
+ text-align: left;
86
+ }
87
+ .arrow {
88
+ color: #666;
89
+ }
90
+ .hidden {
91
+ display: none;
92
+ }
93
+ .show-hide-mapping {
94
+ cursor: pointer;
95
+ padding: 1rem;
96
+ width: 100%;
97
+ background-color: #7ac29d44;
98
+ display: flex;
99
+ justify-content: flex-start;
100
+ gap: 1rem;
101
+ align-items: center;
102
+ user-select: none;
103
+ }
104
+ .collapse {
105
+ width: 24px;
106
+ height: 24px;
107
+ border: 1px solid #000;
108
+ border-radius: 50%;
109
+ display: flex;
110
+ justify-content: center;
111
+ align-items: center;
112
+ pointer-events: none;
113
+ }
114
+ .rotate {
115
+ transform: rotate(180deg);
116
+ }
117
+ input[type="text"] {
118
+ padding: 0.5rem;
119
+ }
120
+ .header {
121
+ position: fixed;
122
+ top: 0;
123
+ left: 0;
124
+ display: flex;
125
+ justify-content: space-between;
126
+ align-items: center;
127
+ height: 5rem;
128
+ padding: 1rem 2rem;
129
+ background-color: #c2e5da;
130
+ width: 100%;
131
+ z-index: 100;
132
+ }
133
+ .container {
134
+ margin-top: 7rem;
135
+ }
136
+ .constant-value {
137
+ background-color: #f9dcbe44;
138
+ }
139
+ .transformed-value {
140
+ background-color: #dae6e366;
141
+ }
142
+ .styled-text {
143
+ font-size: 1.2rem;
144
+ font-weight: lighter;
145
+ }
146
+ .class-method {
147
+ width: 100%;
148
+ display: flex;
149
+ justify-content: space-between;
150
+ align-items: center;
151
+ }
152
+ .class-method-col {
153
+ width: 33%;
154
+ display: flex;
155
+ flex-direction: column;
156
+ }
157
+ @media (max-width: 1024px) {
158
+ .last {
159
+ display: none;
160
+ }
161
+ }
162
+ </style>
163
+ </head>
164
+ <body>
165
+ <div class="header">
166
+ <h1 style="margin: 0; flex: 1">bridgelist</h1>
167
+ <input style="flex: 1;" type="text" id="searchInput" name="search" size="30" placeholder="Search for method or class..." />
168
+ <div style="flex: 1"></div>
169
+ </div>
170
+ <div class="container">
171
+ `;
172
+ const projectRoot = process.cwd();
173
+ const mappingMethods = (0, project_scanner_1.scanProject)(projectRoot);
174
+ for (const mappingMethod of mappingMethods) {
175
+ const mappingRelations = (0, ast_analyzer_1.analyzeMethod)(mappingMethod.filePath, mappingMethod.className, mappingMethod.methodName);
176
+ html += `
177
+
178
+ <div class="mapping-container">
179
+ <div class="class-method">
180
+ <div class="class-method-col">
181
+ <span class="styled-text">Class:</span><h3>${mappingMethod.className}</h3>
182
+ </div>
183
+ <div class="class-method-col">
184
+ <span class="styled-text"> Method:</span><h3>${mappingMethod.methodName}</h3>
185
+ </div>
186
+ <div class="class-method-col last">
187
+ </div>
188
+ </div>
189
+ <p>${mappingMethod.options.description || ''}</p>
190
+ <div class="show-hide-mapping">
191
+ <div class="collapse">
192
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
193
+ <g id="Arrow / Caret_Down_MD">
194
+ <path id="Vector" d="M16 10L12 14L8 10" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
195
+ </g>
196
+ </svg>
197
+ </div>
198
+ <span>Mapping from <strong>${mappingMethod.options.sourceSystem}</strong> to <strong>${mappingMethod.options.targetSystem}</strong></span>
199
+ </div>
200
+ <table class="mapping-table hidden">
201
+ <tr>
202
+ <th>${mappingMethod.options.sourceSystem} Field</th>
203
+ <th></th>
204
+ <th>${mappingMethod.options.targetSystem} Field</th>
205
+ <th>Transformation</th>
206
+ </tr>
207
+ `;
208
+ mappingRelations.forEach(relation => {
209
+ html += `
210
+ <tr>
211
+ <td>${relation.sourceField !== '' ? relation.sourceField : relation.transformation}</td>
212
+ <td class="arrow">&rarr;</td>
213
+ <td>${relation.targetField}</td>
214
+ <td>${relation.transformation || 'Direct mapping'}</td>
215
+ </tr>
216
+ `;
217
+ });
218
+ html += `</table>
219
+ </div>
220
+ </div>`;
221
+ }
222
+ html += `
223
+ <script>
224
+ const collapseButtons = document.querySelectorAll('.show-hide-mapping');
225
+ const mappingTables = document.querySelectorAll('.mapping-table');
226
+ const search = document.getElementById('searchInput');
227
+ const mappingContainers = document.querySelectorAll('.mapping-container');
228
+ const tableRows = document.querySelectorAll('tr');
229
+
230
+ tableRows.forEach(row => {
231
+ const sourceField = row.cells[0].textContent;
232
+ const transformation = row.cells[3].textContent;
233
+ if (sourceField.includes('Constant value')) {
234
+ row.classList.add('constant-value');
235
+ } else if (transformation.includes('Transformed')) {
236
+ row.classList.add('transformed-value');
237
+ } else if (!sourceField.includes('Constant value') && !transformation.includes('Direct mapping')) {
238
+ row.classList.add('transformed-value');
239
+ }
240
+ });
241
+
242
+ search.addEventListener('input', (e) => {
243
+ const searchTerm = e.target.value.toLowerCase();
244
+ mappingContainers.forEach(container => {
245
+ let classMethodName = '';
246
+ const names = container.querySelectorAll('h3');
247
+ names.forEach(name => {
248
+ classMethodName += name.textContent.toLowerCase();
249
+ })
250
+ console.log(classMethodName);
251
+ if (!classMethodName.includes(searchTerm)) {
252
+ container.style.display = 'none';
253
+ } else {
254
+ container.style.display = 'flex';
255
+ }
256
+ });
257
+ });
258
+
259
+ collapseButtons.forEach(button => {
260
+ button.addEventListener('click', function() {
261
+ const table = button.nextElementSibling;
262
+ const caret = button.querySelector('.collapse');
263
+ table.classList.toggle('hidden');
264
+ caret.classList.toggle('rotate');
265
+ });
266
+ });
267
+ </script>
268
+ </body>
269
+ </html>
270
+ `;
271
+ const dir = path.dirname(outputPath);
272
+ if (!fs.existsSync(dir)) {
273
+ fs.mkdirSync(dir, { recursive: true });
274
+ }
275
+ fs.writeFileSync(outputPath, html);
276
+ console.log(`Documentation generated at: ${outputPath}`);
277
+ console.log(`Found ${mappingMethods.length} mapping methods in the project.`);
278
+ }
279
+ //# sourceMappingURL=html-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-generator.js","sourceRoot":"","sources":["../../src/generators/html-generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,sDAuPC;AA7PD,uCAAyB;AACzB,2CAA6B;AAC7B,4DAAwD;AACxD,8DAAqD;AACrD,sDAAwC;AAExC,SAAgB,qBAAqB,CAAC,UAAkB;IACpD,IAAI,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgIZ,CAAC;IACA,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAClC,MAAM,cAAc,GAAG,IAAA,6BAAW,EAAC,WAAW,CAAC,CAAC;IAEhD,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QACzC,MAAM,gBAAgB,GAAG,IAAA,4BAAa,EAClC,aAAa,CAAC,QAAQ,EACtB,aAAa,CAAC,SAAS,EACvB,aAAa,CAAC,UAAU,CAC3B,CAAC;QAEF,IAAI,IAAI;;;;;yDAKyC,aAAa,CAAC,SAAS;;;2DAGrB,aAAa,CAAC,UAAU;;;;;OAK5E,aAAa,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE;;;;;;;;;iCASb,aAAa,CAAC,OAAO,CAAC,YAAY,wBAAwB,aAAa,CAAC,OAAO,CAAC,YAAY;;;;YAIjH,aAAa,CAAC,OAAO,CAAC,YAAY;;YAElC,aAAa,CAAC,OAAO,CAAC,YAAY;;;GAG3C,CAAC;QAEI,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAChC,IAAI,IAAI;;YAER,QAAQ,CAAC,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAA,CAAC,CAAC,QAAQ,CAAC,cAAc;;YAE3E,QAAQ,CAAC,WAAW;YACpB,QAAQ,CAAC,cAAc,IAAI,gBAAgB;;KAElD,CAAC;QACE,CAAC,CAAC,CAAC;QAEH,IAAI,IAAI;;+BAEe,CAAC;IAE5B,CAAC;IAED,IAAI,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDX,CAAC;IACE,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;IACzC,CAAC;IAED,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,+BAA+B,UAAU,EAAE,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,SAAS,cAAc,CAAC,MAAM,kCAAkC,CAAC,CAAC;AAClF,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { GenerateMappingDocumentation } from './decorators/mapping-documentation';
2
+ export { generateDocumentation } from './generators/html-generator';
3
+ export { scanProject } from './utils/project-scanner';
4
+ export * from './types/index';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,cAAc,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.scanProject = exports.generateDocumentation = exports.GenerateMappingDocumentation = void 0;
18
+ var mapping_documentation_1 = require("./decorators/mapping-documentation");
19
+ Object.defineProperty(exports, "GenerateMappingDocumentation", { enumerable: true, get: function () { return mapping_documentation_1.GenerateMappingDocumentation; } });
20
+ var html_generator_1 = require("./generators/html-generator");
21
+ Object.defineProperty(exports, "generateDocumentation", { enumerable: true, get: function () { return html_generator_1.generateDocumentation; } });
22
+ var project_scanner_1 = require("./utils/project-scanner");
23
+ Object.defineProperty(exports, "scanProject", { enumerable: true, get: function () { return project_scanner_1.scanProject; } });
24
+ __exportStar(require("./types/index"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4EAAkF;AAAzE,qIAAA,4BAA4B,OAAA;AACrC,8DAAoE;AAA3D,uHAAA,qBAAqB,OAAA;AAC9B,2DAAsD;AAA7C,8GAAA,WAAW,OAAA;AAEpB,gDAA8B"}
@@ -0,0 +1,5 @@
1
+ export interface MappingDocumentationOptions {
2
+ sourceSystem: string;
3
+ targetSystem: string;
4
+ description?: string;
5
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,2BAA2B;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * represents a method that is decorated with the GenerateMappingDocumentation decorator
3
+ */
4
+ export interface MappingMethodInfo {
5
+ filePath: string;
6
+ className: string;
7
+ methodName: string;
8
+ options: {
9
+ sourceSystem: string;
10
+ targetSystem: string;
11
+ description: string;
12
+ };
13
+ }
14
+ /**
15
+ * Recursively scans a directory for TypeScript files and finds
16
+ * all methods that are decorated with the GenerateMappingDocumentation decorator.
17
+ *
18
+ * @param rootDir The root directory to search
19
+ * @returns An array of MappingMethodInfo objects
20
+ */
21
+ export declare function scanProject(rootDir: string): MappingMethodInfo[];
@@ -0,0 +1,175 @@
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.scanProject = scanProject;
40
+ const fs = __importStar(require("fs"));
41
+ const path = __importStar(require("path"));
42
+ const typescript_1 = __importDefault(require("typescript"));
43
+ /**
44
+ * Recursively scans a directory for TypeScript files and finds
45
+ * all methods that are decorated with the GenerateMappingDocumentation decorator.
46
+ *
47
+ * @param rootDir The root directory to search
48
+ * @returns An array of MappingMethodInfo objects
49
+ */
50
+ function scanProject(rootDir) {
51
+ const results = [];
52
+ const tsFiles = findAllTsFiles(rootDir);
53
+ // search for methods with GenerateMappingDocumentation decorator in each file
54
+ for (const filePath of tsFiles) {
55
+ const mappings = findMappingMethodsInFile(filePath);
56
+ results.push(...mappings);
57
+ }
58
+ return results;
59
+ }
60
+ /**
61
+ * finds all TypeScript files in a directory recursively
62
+ */
63
+ function findAllTsFiles(dir) {
64
+ const files = [];
65
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
66
+ for (const entry of entries) {
67
+ const fullPath = path.join(dir, entry.name);
68
+ if (entry.isDirectory()) {
69
+ if (entry.name !== 'node_modules' && entry.name !== 'dist') {
70
+ files.push(...findAllTsFiles(fullPath));
71
+ }
72
+ }
73
+ else if (entry.isFile() && entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts')) {
74
+ files.push(fullPath);
75
+ }
76
+ }
77
+ return files;
78
+ }
79
+ /**
80
+ * finds all methods that are decorated with the GenerateMappingDocumentation decorator in a file
81
+ */
82
+ function findMappingMethodsInFile(filePath) {
83
+ const methods = [];
84
+ try {
85
+ const sourceCode = fs.readFileSync(filePath, 'utf-8');
86
+ const sourceFile = typescript_1.default.createSourceFile(path.basename(filePath), sourceCode, typescript_1.default.ScriptTarget.Latest, true);
87
+ // search for classes and methods in AST
88
+ function visit(node) {
89
+ // search for classes
90
+ if (typescript_1.default.isClassDeclaration(node) && node.name) {
91
+ const className = node.name.getText();
92
+ // search for methods
93
+ node.members.forEach(member => {
94
+ if (typescript_1.default.isMethodDeclaration(member) && member.name) {
95
+ const methodName = member.name.getText();
96
+ // validate if method has modifiers
97
+ if (member.modifiers) {
98
+ // search for decorators
99
+ for (const modifier of member.modifiers) {
100
+ if (typescript_1.default.isDecorator(modifier)) {
101
+ const decoratorExpr = modifier.expression;
102
+ // verify if decorator is GenerateMappingDocumentation
103
+ if (typescript_1.default.isCallExpression(decoratorExpr)) {
104
+ const decoratorName = decoratorExpr.expression.getText();
105
+ if (decoratorName === 'GenerateMappingDocumentation') {
106
+ // extract options from decorator
107
+ const decoratorOptions = extractDecoratorOptions(decoratorExpr);
108
+ if (decoratorOptions) {
109
+ methods.push({
110
+ filePath,
111
+ className,
112
+ methodName,
113
+ options: decoratorOptions
114
+ });
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ });
123
+ }
124
+ typescript_1.default.forEachChild(node, visit);
125
+ }
126
+ visit(sourceFile);
127
+ }
128
+ catch (error) {
129
+ console.error(`Error analyzing file ${filePath}:`, error);
130
+ }
131
+ return methods;
132
+ }
133
+ /**
134
+ * extracts options from a decorator call expression
135
+ */
136
+ function extractDecoratorOptions(callExpression) {
137
+ if (callExpression.arguments.length === 0) {
138
+ return null;
139
+ }
140
+ // first argument should be an object literal
141
+ const optionsArg = callExpression.arguments[0];
142
+ if (!optionsArg || !typescript_1.default.isObjectLiteralExpression(optionsArg)) {
143
+ return null;
144
+ }
145
+ // extract options from object literal
146
+ let sourceSystem = '';
147
+ let targetSystem = '';
148
+ let description = '';
149
+ optionsArg.properties.forEach(prop => {
150
+ if (typescript_1.default.isPropertyAssignment(prop) && prop.name) {
151
+ const propName = prop.name.getText();
152
+ const value = prop.initializer;
153
+ if (typescript_1.default.isStringLiteral(value)) {
154
+ if (propName === 'sourceSystem') {
155
+ sourceSystem = value.text;
156
+ }
157
+ else if (propName === 'targetSystem') {
158
+ targetSystem = value.text;
159
+ }
160
+ else if (propName === 'description') {
161
+ description = value.text;
162
+ }
163
+ }
164
+ }
165
+ });
166
+ if (!sourceSystem || !targetSystem) {
167
+ return null;
168
+ }
169
+ return {
170
+ sourceSystem,
171
+ targetSystem,
172
+ description
173
+ };
174
+ }
175
+ //# sourceMappingURL=project-scanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-scanner.js","sourceRoot":"","sources":["../../src/utils/project-scanner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,kCAYC;AArCD,uCAAyB;AACzB,2CAA6B;AAC7B,4DAA4B;AAgB5B;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,OAAe;IACvC,MAAM,OAAO,GAAwB,EAAE,CAAC;IAExC,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAExC,8EAA8E;IAC9E,KAAK,MAAM,QAAQ,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,wBAA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