feat(file-reader): CSV/TXT/Excel 파일 데이터 소스 — UI 업로드 + 폴더 감시 + 매핑 + 적재
Build and Push Images / build-and-push (push) Has been cancelled

- 신규 테이블 file_reader_configs / file_reader_mappings / file_reader_history (마이그레이션 313)
- 파서: csv-parse + xlsx 라이브러리 추가, CSV/TSV/TXT/XLSX 통합 파서 (parsers.ts)
- 서비스: 파일→매핑→타겟 DB INSERT/UPSERT/REPLACE, 호스트 경로 허용 루트 검증
- 스케줄러: source_mode='watch' 설정마다 node-cron 등록, 1분 주기 reload
- 라우트: /api/file-reader/configs CRUD + preview + run-upload + run-watch + history
- 프론트: 데이터 소스 페이지 "파일 리더" 탭 placeholder → FileReaderConnectionList 컴포넌트
- FileReaderConnectionModal: 기본/파싱/타겟/매핑 통합 폼 + 샘플 업로드 미리보기
- 환경변수 FILE_READER_ALLOWED_ROOTS (콤마 구분, 기본 /home/wace/file-imports,/mnt)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
chpark
2026-05-13 15:38:10 +09:00
parent 77d35220b1
commit 6a1b79dc81
12 changed files with 1861 additions and 11 deletions
+15
View File
@@ -399,6 +399,21 @@ export async function runFleetEdgeRawDeviceEndpointMigration() {
}
}
export async function runFileReaderTablesMigration() {
try {
const sqlFilePath = path.join(
__dirname,
"../../db/migrations/313_create_file_reader_tables.sql"
);
if (!fs.existsSync(sqlFilePath)) return;
const sqlContent = fs.readFileSync(sqlFilePath, "utf8");
await PostgreSQLService.query(sqlContent);
console.log("✅ 파일 리더 테이블 (file_reader_configs/mappings/history) 생성 완료");
} catch (error) {
console.error("❌ 파일 리더 테이블 마이그레이션 실패:", error);
}
}
export async function runOpenClawMigration() {
try {
console.log("🔄 OpenClaw AI 에이전트 마이그레이션 시작...");