Lines 69-109javascript
69exports.findRelatedArticles = findRelatedArticles;
70exports.getLawById = getLawById;
71exports.getArticlesByLawId = getArticlesByLawId;
72exports.rebuildFTSIndex = rebuildFTSIndex;
73exports.insertExecutionLog = insertExecutionLog;
74exports.insertDailySyncSummary = insertDailySyncSummary;
75exports.getRecentExecutionLogs = getRecentExecutionLogs;
76exports.getDailySyncSummary = getDailySyncSummary;
77exports.findLawByMstId = findLawByMstId;
78exports.findPendingLawByMstId = findPendingLawByMstId;
79exports.insertPendingLaw = insertPendingLaw;
80exports.updatePendingLawStatus = updatePendingLawStatus;
81exports.normalizeLawName = normalizeLawName;
82exports.normalizeArticleNo = normalizeArticleNo;
83exports.normalizeCaseId = normalizeCaseId;
84exports.generateChecksum = generateChecksum;
85const better_sqlite3_1 = __importDefault(require("better-sqlite3"));
86const fs = __importStar(require("fs"));
87const path = __importStar(require("path"));
88const crypto = __importStar(require("crypto"));
89const law_name_normalizer_1 = require("../normalize/law-name-normalizer");
90const DB_PATH = process.env.KOREA_LAW_DB_PATH || path.join(__dirname, '../../data/korea-law.db');
91const SCHEMA_PATH = path.join(__dirname, 'schema.sql');
LowWeak Crypto
Package source references weak cryptographic algorithms.
dist/db/database.jsView on unpkg · L89 92const SCHEMA_HYBRID_PATH = path.join(__dirname, 'schema-hybrid.sql');
93const SCHEMA_EXTENDED_PATH = path.join(__dirname, 'schema-extended.sql');
94const SCHEMA_KRX_PATH = path.join(__dirname, 'schema-krx.sql');
95const SCHEMA_CONSTPET_PATH = path.join(__dirname, 'schema-construction-petitions.sql');
96const MIGRATIONS_DIR = path.join(__dirname, 'migrations');
101function initDatabase() {
105 const dataDir = path.dirname(DB_PATH);
106 if (!fs.existsSync(dataDir)) {
107 fs.mkdirSync(dataDir, { recursive: true });
109 db = new better_sqlite3_1.default(DB_PATH);