@bimatrix-aud-platform/aud_mcp_server 1.1.74 → 1.1.75
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.
|
@@ -412,6 +412,26 @@ export function writeReportResponse(reportPath, response) {
|
|
|
412
412
|
export function writePullResponse(reportPath, response) {
|
|
413
413
|
const resolvedPath = resolve(reportPath);
|
|
414
414
|
const written = [];
|
|
415
|
+
// 폴더가 비어있지 않으면, 기존 보고서 파일의 ReportCode와 덮어쓰려는 ReportCode가 다른지 검사
|
|
416
|
+
if (existsSync(resolvedPath) && readdirSync(resolvedPath).length > 0) {
|
|
417
|
+
const existingFile = findReportFileInFolder(resolvedPath);
|
|
418
|
+
if (existingFile) {
|
|
419
|
+
try {
|
|
420
|
+
const existingData = JSON.parse(readFileSync(existingFile, "utf-8"));
|
|
421
|
+
const existingReportCode = (existingData.ReportInfo || {}).ReportCode || "";
|
|
422
|
+
const incomingReportCode = response.REPORT_CODE || "";
|
|
423
|
+
if (existingReportCode && incomingReportCode && existingReportCode !== incomingReportCode) {
|
|
424
|
+
throw new Error(`보고서 코드 불일치: 폴더에 이미 다른 보고서(${existingReportCode})가 존재합니다. 덮어쓰려는 보고서 코드: ${incomingReportCode}`);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
catch (e) {
|
|
428
|
+
if (e instanceof Error && e.message.startsWith("보고서 코드 불일치")) {
|
|
429
|
+
throw e;
|
|
430
|
+
}
|
|
431
|
+
// JSON 파싱 실패 등은 무시하고 계속 진행
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
415
435
|
// 1. mtsd 경로 결정 (MTSD 쓰기는 모든 파일 생성 후 수행)
|
|
416
436
|
let mtsdPath = "";
|
|
417
437
|
if (response.ReportModel) {
|
|
@@ -488,6 +508,26 @@ export function writePullResponse(reportPath, response) {
|
|
|
488
508
|
return written;
|
|
489
509
|
}
|
|
490
510
|
// ─── Helpers (private) ─────────────────────────────────────
|
|
511
|
+
/** 폴더 내 보고서 문서 파일 탐색 (.design.json → .mtsd → .sc 우선순위) */
|
|
512
|
+
function findReportFileInFolder(folderPath) {
|
|
513
|
+
if (!existsSync(folderPath)) {
|
|
514
|
+
return null;
|
|
515
|
+
}
|
|
516
|
+
// 1순위: .design.json
|
|
517
|
+
const designPath = join(folderPath, ".design.json");
|
|
518
|
+
if (existsSync(designPath)) {
|
|
519
|
+
return designPath;
|
|
520
|
+
}
|
|
521
|
+
// 2순위: .mtsd, .sc
|
|
522
|
+
const files = readdirSync(folderPath);
|
|
523
|
+
for (const f of files) {
|
|
524
|
+
const lower = f.toLowerCase();
|
|
525
|
+
if (lower.endsWith(".mtsd") || lower.endsWith(".sc")) {
|
|
526
|
+
return join(folderPath, f);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return null;
|
|
530
|
+
}
|
|
491
531
|
/** MTSD에서 DataSource Id 찾기 */
|
|
492
532
|
function getDataSourceId(name, reportDoc) {
|
|
493
533
|
if (!reportDoc?.DataSources?.Datas)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bimatrix-aud-platform/aud_mcp_server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.75",
|
|
4
4
|
"description": "MCP Server for i-AUD MTSD document validation, generation, schema querying, control info extraction, and database operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|