feat(est-test): 품셈 보기와 품셈자료 붙여넣기

- 원본 BookData 7권 해독(DBISAM 암호 표 Blowfish-CBC, zlib RTF) 서버 book-store.cjs, /api/book 경로
- 목차 트리·본문 표·제목/본문/키워드 검색·본문 강조·복사하기, 단가산출·내역·일위·기계 붙여넣기

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 17:41:02 +09:00
co-authored by Claude Opus 5.5
parent b97ecf47de
commit db9bc2dee4
7 changed files with 530 additions and 1 deletions
+22
View File
@@ -6,6 +6,7 @@ const http = require("node:http"),
crypto = require("node:crypto");
const { importEstx, table: dbisamTable } = require("./import-estx.cjs");
const { readXls } = require("./xls-read.cjs");
const bookStore = require("./book-store.cjs");
const exchange = require("./exchange.cjs");
const { exportEstx } = require("./export-estx.cjs");
const jdl = require("./jdl.cjs");
@@ -87,6 +88,7 @@ const allowed = new Set([
"native-jdl-compare.js",
"native-global-vars.js",
"native-new-estimate.js",
"native-book.js",
"native-wonga-tools.js",
"native-estimate-print.js",
"native-xml-check.js",
@@ -249,6 +251,26 @@ const server = http.createServer(async (req, res) => {
reply(res, 200, importEstx(bytes, name));
return;
}
if (req.method === "GET" && url.pathname.startsWith("/api/book")) {
// 품셈 보기(원본 BookData) — /api/book · /api/book/<책>/tree · /text/<pkid> · /search?q=&mode=title|body|keyword
const [, book, what, id] = url.pathname.slice(1).split("/").slice(1);
reply(
res,
200,
!book
? bookStore.list()
: what === "tree"
? bookStore.tree(book)
: what === "text"
? bookStore.text(book, id)
: what === "search"
? bookStore.search(book, url.searchParams.get("q"), url.searchParams.get("mode"))
: (() => {
throw Error("품셈 요청 경로 없음");
})(),
);
return;
}
if (req.method === "POST" && url.pathname === "/api/read-xls") {
reply(res, 200, readXls(await body(req)));
return;