token-goat 2.9.12 → 2.9.14

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.
Files changed (45) hide show
  1. package/README.md +20 -1
  2. package/dist/token-goat-chunk-2ESBO4IN.mjs +209 -0
  3. package/dist/token-goat-chunk-3BTK54F3.mjs +1733 -0
  4. package/dist/{token-goat-chunk-6NIGPPN6.mjs → token-goat-chunk-3XQPEJMV.mjs} +1 -1
  5. package/dist/token-goat-chunk-4SDX3QP3.mjs +122 -0
  6. package/dist/token-goat-chunk-7OGKZ7AP.mjs +142 -0
  7. package/dist/token-goat-chunk-AH6QILZM.mjs +26 -0
  8. package/dist/token-goat-chunk-AMYCQJX4.mjs +1548 -0
  9. package/dist/{token-goat-chunk-OTW7LC4Y.mjs → token-goat-chunk-ASVVF4JV.mjs} +13 -10
  10. package/dist/{token-goat-chunk-GCXX67HM.mjs → token-goat-chunk-DAMXYVIW.mjs} +12477 -12156
  11. package/dist/token-goat-chunk-DBNY4RLN.mjs +308 -0
  12. package/dist/token-goat-chunk-EG3663UT.mjs +226 -0
  13. package/dist/token-goat-chunk-EZNVAIR3.mjs +21 -0
  14. package/dist/token-goat-chunk-GMOUBOX4.mjs +386 -0
  15. package/dist/{token-goat-chunk-6F5TLJC7.mjs → token-goat-chunk-HF6H7RNK.mjs} +1 -1
  16. package/dist/{token-goat-chunk-GM6QZWCF.mjs → token-goat-chunk-IT6O3PNN.mjs} +2660 -6877
  17. package/dist/token-goat-chunk-NEI4NC54.mjs +424 -0
  18. package/dist/token-goat-chunk-O5WAMISC.mjs +167 -0
  19. package/dist/{token-goat-chunk-LHLQFGWQ.mjs → token-goat-chunk-OMNQUUIT.mjs} +9 -27
  20. package/dist/{token-goat-chunk-SF2CKCFQ.mjs → token-goat-chunk-PGGDW7DZ.mjs} +30 -13
  21. package/dist/token-goat-chunk-POBYR64E.mjs +1632 -0
  22. package/dist/token-goat-chunk-PRJVGIC5.mjs +58 -0
  23. package/dist/{token-goat-chunk-4CK445AW.mjs → token-goat-chunk-RUDOKYPJ.mjs} +10074 -9765
  24. package/dist/token-goat-chunk-SAQ5PG4L.mjs +2634 -0
  25. package/dist/token-goat-chunk-T2IWWTHB.mjs +3155 -0
  26. package/dist/{token-goat-chunk-TOGYS5A7.mjs → token-goat-chunk-VZYD4OZB.mjs} +1469 -5752
  27. package/dist/token-goat-chunk-XEH6KBWW.mjs +23 -0
  28. package/dist/token-goat-chunk-XQF5J25J.mjs +33 -0
  29. package/dist/token-goat-chunk-XTQAOTSO.mjs +89 -0
  30. package/dist/{token-goat-chunk-THLHC6QJ.mjs → token-goat-chunk-XVZ4MNQC.mjs} +614 -603
  31. package/dist/token-goat-chunk-Y4AFKTHK.mjs +22 -0
  32. package/dist/token-goat-chunk-YHGTGG6K.mjs +396 -0
  33. package/dist/{token-goat-chunk-SBYRP3X4.mjs → token-goat-chunk-YTQHZJXW.mjs} +61 -27
  34. package/dist/token-goat-chunk-Z6UXPYJA.mjs +62 -0
  35. package/dist/token-goat-chunk-ZD4EM4LR.mjs +30 -0
  36. package/dist/token-goat-chunk-ZFM4PWXL.mjs +585 -0
  37. package/dist/{token-goat-chunk-A6QTLAWO.mjs → token-goat-chunk-ZYNNQ36L.mjs} +128 -328
  38. package/dist/token-goat-hook.mjs +12 -6
  39. package/dist/token-goat.core.mjs +22 -7
  40. package/docs/cli.md +12 -8
  41. package/docs/security.md +1 -1
  42. package/package.json +4 -2
  43. package/dist/token-goat-chunk-HKFOH6JH.mjs +0 -28
  44. package/dist/token-goat-chunk-LOCOX2ML.mjs +0 -3564
  45. package/dist/token-goat-chunk-VRWX6QYW.mjs +0 -24
@@ -0,0 +1,23 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ pptxAllSlidesText,
5
+ pptxNotesText,
6
+ pptxOutline,
7
+ pptxSlideText,
8
+ pptxTextGrep
9
+ } from "./token-goat-chunk-2ESBO4IN.mjs";
10
+ import "./token-goat-chunk-YHGTGG6K.mjs";
11
+ import "./token-goat-chunk-XTQAOTSO.mjs";
12
+ import "./token-goat-chunk-AH6QILZM.mjs";
13
+ import "./token-goat-chunk-Y4AFKTHK.mjs";
14
+ import "./token-goat-chunk-AMYCQJX4.mjs";
15
+ import "./token-goat-chunk-GMOUBOX4.mjs";
16
+ import "./token-goat-chunk-A37V4PBF.mjs";
17
+ export {
18
+ pptxAllSlidesText,
19
+ pptxNotesText,
20
+ pptxOutline,
21
+ pptxSlideText,
22
+ pptxTextGrep
23
+ };
@@ -0,0 +1,33 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ XlsxScanTooLargeError,
5
+ allSheetsHeadText,
6
+ formatXlsxColumns,
7
+ formatXlsxRange,
8
+ headSheet,
9
+ listSheets,
10
+ querySheet,
11
+ rangeSheet,
12
+ xlsxColumns
13
+ } from "./token-goat-chunk-ZFM4PWXL.mjs";
14
+ import "./token-goat-chunk-EG3663UT.mjs";
15
+ import "./token-goat-chunk-3BTK54F3.mjs";
16
+ import "./token-goat-chunk-YHGTGG6K.mjs";
17
+ import "./token-goat-chunk-XTQAOTSO.mjs";
18
+ import "./token-goat-chunk-AH6QILZM.mjs";
19
+ import "./token-goat-chunk-Y4AFKTHK.mjs";
20
+ import "./token-goat-chunk-AMYCQJX4.mjs";
21
+ import "./token-goat-chunk-GMOUBOX4.mjs";
22
+ import "./token-goat-chunk-A37V4PBF.mjs";
23
+ export {
24
+ XlsxScanTooLargeError,
25
+ allSheetsHeadText,
26
+ formatXlsxColumns,
27
+ formatXlsxRange,
28
+ headSheet,
29
+ listSheets,
30
+ querySheet,
31
+ rangeSheet,
32
+ xlsxColumns
33
+ };
@@ -0,0 +1,89 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ DocumentRefusedError
5
+ } from "./token-goat-chunk-Y4AFKTHK.mjs";
6
+ import {
7
+ init_define_import_meta_env
8
+ } from "./token-goat-chunk-A37V4PBF.mjs";
9
+
10
+ // src/zip_bounds.ts
11
+ init_define_import_meta_env();
12
+ var MAX_ZIP_INPUT_BYTES = 50 * 1024 * 1024;
13
+ var MAX_ZIP_OUTPUT_BYTES = 500 * 1024 * 1024;
14
+ var STREAM_CHUNK_BYTES = 64 * 1024;
15
+ var ZipOutputTooLargeError = class extends DocumentRefusedError {
16
+ constructor(entryName, limitBytes, decompressedSoFarBytes) {
17
+ super(
18
+ `zip entry '${entryName}' is over the ${Math.round(limitBytes / (1024 * 1024))}MB decompressed-size limit (over ${Math.round(decompressedSoFarBytes / (1024 * 1024))}MB decompressed so far)`,
19
+ "ZipOutputTooLargeError"
20
+ );
21
+ }
22
+ };
23
+ var ZipInputTooLargeError = class extends DocumentRefusedError {
24
+ constructor(filePath, sizeBytes, limitBytes) {
25
+ super(
26
+ `${filePath} is ${Math.round(sizeBytes / (1024 * 1024))}MB, over the ${Math.round(limitBytes / (1024 * 1024))}MB limit for zip-format archives`,
27
+ "ZipInputTooLargeError"
28
+ );
29
+ }
30
+ };
31
+ function concatChunks(chunks, total) {
32
+ const out = new Uint8Array(total);
33
+ let offset = 0;
34
+ for (const chunk of chunks) {
35
+ out.set(chunk, offset);
36
+ offset += chunk.length;
37
+ }
38
+ return out;
39
+ }
40
+ function unzipBounded(mod, data, opts) {
41
+ mod.unzipSync(data, { filter: () => false });
42
+ const results = {};
43
+ let firstError;
44
+ let totalDecompressed = 0;
45
+ const unzip = new mod.Unzip((file) => {
46
+ if (firstError !== void 0 || !opts.shouldExtract(file.name)) return;
47
+ if (typeof file.originalSize === "number" && totalDecompressed + file.originalSize > opts.limitBytes) {
48
+ firstError = new ZipOutputTooLargeError(file.name, opts.limitBytes, totalDecompressed + file.originalSize);
49
+ return;
50
+ }
51
+ const chunks = [];
52
+ let entryTotal = 0;
53
+ file.ondata = (err, chunk, final) => {
54
+ if (firstError !== void 0) return;
55
+ if (err) {
56
+ firstError = err instanceof Error ? err : new Error(String(err));
57
+ return;
58
+ }
59
+ entryTotal += chunk.length;
60
+ totalDecompressed += chunk.length;
61
+ if (totalDecompressed > opts.limitBytes) {
62
+ firstError = new ZipOutputTooLargeError(file.name, opts.limitBytes, totalDecompressed);
63
+ return;
64
+ }
65
+ chunks.push(chunk);
66
+ if (final) results[file.name] = concatChunks(chunks, entryTotal);
67
+ };
68
+ file.start();
69
+ });
70
+ unzip.register(mod.UnzipInflate);
71
+ let offset = 0;
72
+ for (; ; ) {
73
+ const end = Math.min(offset + STREAM_CHUNK_BYTES, data.length);
74
+ const isFinal = end >= data.length;
75
+ unzip.push(data.subarray(offset, end), isFinal);
76
+ offset = end;
77
+ if (firstError !== void 0 || isFinal) break;
78
+ }
79
+ if (firstError !== void 0) throw firstError;
80
+ return results;
81
+ }
82
+
83
+ export {
84
+ MAX_ZIP_INPUT_BYTES,
85
+ MAX_ZIP_OUTPUT_BYTES,
86
+ ZipOutputTooLargeError,
87
+ ZipInputTooLargeError,
88
+ unzipBounded
89
+ };