@clazic/kordoc 2.7.1 → 2.7.3

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/utils.ts
4
- var VERSION = true ? "2.7.1" : "0.0.0-dev";
4
+ var VERSION = true ? "2.7.3" : "0.0.0-dev";
5
5
  function toArrayBuffer(buf) {
6
6
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
7
7
  return buf.buffer;
@@ -105,4 +105,4 @@ export {
105
105
  classifyError,
106
106
  normalizeKordocError
107
107
  };
108
- //# sourceMappingURL=chunk-YIJCHZLO.js.map
108
+ //# sourceMappingURL=chunk-CIR4TB4K.js.map
@@ -7,7 +7,7 @@ import {
7
7
  precheckZipSize,
8
8
  sanitizeHref,
9
9
  toArrayBuffer
10
- } from "./chunk-YIJCHZLO.js";
10
+ } from "./chunk-CIR4TB4K.js";
11
11
  import {
12
12
  parsePageRange
13
13
  } from "./chunk-MOL7MDBG.js";
@@ -9847,19 +9847,19 @@ var CACHE_DIR = join2(homedir(), ".cache", "kordoc", "libreoffice");
9847
9847
  var VERSION_FILE = join2(CACHE_DIR, "version");
9848
9848
  var PACKAGES = {
9849
9849
  darwin: {
9850
- url: "https://download.documentfoundation.org/libreoffice/stable/24.8.4/mac/x86_64/LibreOffice_24.8.4_MacOS_x86-64.dmg",
9850
+ url: "https://ftp.osuosl.org/pub/tdf/libreoffice/stable/26.2.3/mac/x86_64/LibreOffice_26.2.3_MacOS_x86-64.dmg",
9851
9851
  binPath: "LibreOffice.app/Contents/MacOS/soffice",
9852
9852
  sizeMb: 300
9853
9853
  },
9854
9854
  linux: {
9855
- url: "https://download.documentfoundation.org/libreoffice/stable/24.8.4/deb/x86_64/LibreOffice_24.8.4_Linux_x86-64_deb.tar.gz",
9856
- binPath: "opt/libreoffice24.8/program/soffice",
9857
- sizeMb: 200
9855
+ url: "https://ftp.osuosl.org/pub/tdf/libreoffice/stable/26.2.3/deb/x86_64/LibreOffice_26.2.3_Linux_x86-64_deb.tar.gz",
9856
+ binPath: "opt/libreoffice26.2/program/soffice",
9857
+ sizeMb: 210
9858
9858
  },
9859
9859
  win32: {
9860
- url: "https://download.documentfoundation.org/libreoffice/stable/24.8.4/win/x86_64/LibreOffice_24.8.4_Win_x86-64.msi",
9860
+ url: "https://ftp.osuosl.org/pub/tdf/libreoffice/stable/26.2.3/win/x86_64/LibreOffice_26.2.3_Win_x86-64.msi",
9861
9861
  binPath: "LibreOffice/program/soffice.exe",
9862
- sizeMb: 350
9862
+ sizeMb: 360
9863
9863
  }
9864
9864
  };
9865
9865
  async function findInPath() {
@@ -9912,6 +9912,7 @@ async function findInDefaultPaths() {
9912
9912
  }
9913
9913
  async function downloadWithProgress(url, dest, totalBytes, onProgress) {
9914
9914
  const response = await fetch(url);
9915
+ if (!response.ok) throw new Error(`\uB2E4\uC6B4\uB85C\uB4DC \uC2E4\uD328: HTTP ${response.status} (${url})`);
9915
9916
  if (!response.body) throw new Error("\uB2E4\uC6B4\uB85C\uB4DC \uC2E4\uD328: response body \uC5C6\uC74C");
9916
9917
  const file = createWriteStream(dest);
9917
9918
  const reader = response.body.getReader();
@@ -10084,14 +10085,15 @@ async function resolveSoffice(emitter, autoInstall = true) {
10084
10085
 
10085
10086
  // src/convert/libreoffice.ts
10086
10087
  var libreConvert = libre.convert;
10087
- async function convertBuffer(buffer, targetExt, timeoutMs = 6e4) {
10088
+ async function convertBuffer(buffer, targetExt, timeoutMs = 6e4, sofficePath) {
10088
10089
  return new Promise((resolve2, reject) => {
10089
10090
  const timer = setTimeout(() => {
10090
10091
  reject(
10091
10092
  new ConvertError("TIMEOUT", `\uBCC0\uD658 \uD0C0\uC784\uC544\uC6C3 (${timeoutMs}ms \uCD08\uACFC)`)
10092
10093
  );
10093
10094
  }, timeoutMs);
10094
- libreConvert(buffer, targetExt, void 0, (err, done) => {
10095
+ const opts = sofficePath ? { sofficeBinaryPaths: [sofficePath] } : void 0;
10096
+ libreConvert(buffer, targetExt, opts, (err, done) => {
10095
10097
  clearTimeout(timer);
10096
10098
  if (err || !done) {
10097
10099
  reject(
@@ -10259,7 +10261,7 @@ async function convertToPdf(input, options) {
10259
10261
  try {
10260
10262
  emitter.convertStart("\uBCC0\uD658 \uC2DC\uC791...");
10261
10263
  emitter.progress(10, "\uBCC0\uD658 \uC911...");
10262
- const pdf = await convertBuffer(buffer, ".pdf", options?.timeoutMs);
10264
+ const pdf = await convertBuffer(buffer, ".pdf", options?.timeoutMs, sofficePath);
10263
10265
  emitter.progress(100, "\uBCC0\uD658 \uC644\uB8CC");
10264
10266
  emitter.convertDone("\uBCC0\uD658 \uC644\uB8CC");
10265
10267
  const result = {
@@ -10689,4 +10691,4 @@ export {
10689
10691
  cfb/cfb.js:
10690
10692
  (*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
10691
10693
  */
10692
- //# sourceMappingURL=chunk-FZJLIDFL.js.map
10694
+ //# sourceMappingURL=chunk-WE7MWE73.js.map