@nodetool-ai/document-processing 0.8.14 → 0.8.17

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 +1 @@
1
- 2026-11-19T19:42:35.832Z
1
+ 2026-11-26T15:01:54.860Z
package/dist/index.d.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  import type { ParseResult } from "@llamaindex/liteparse";
2
2
  /** Load the explicitly installed PDF parser without launching it at import time. */
3
3
  export declare function loadLiteParse(): Promise<typeof import("@llamaindex/liteparse")>;
4
- /** Parse document bytes using the same parser as the full server. */
5
- export declare function parsePdfBuffer(buffer: Buffer): Promise<ParseResult>;
4
+ /**
5
+ * Parse document bytes using the same parser as the full server. `maxPages`
6
+ * stops the parser after that many pages instead of parsing the whole file.
7
+ */
8
+ export declare function parsePdfBuffer(buffer: Buffer, options?: {
9
+ maxPages?: number;
10
+ }): Promise<ParseResult>;
6
11
  export interface PdfTextResult {
7
12
  readonly text: string;
8
13
  readonly pages: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,oFAAoF;AACpF,wBAAsB,aAAa,IAAI,OAAO,CAAC,cAAc,uBAAuB,CAAC,CAAC,CAMrF;AAED,qEAAqE;AACrE,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAGzE;AAED,MAAM,WAAW,aAAa;IAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAEhF,+DAA+D;AAC/D,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAG3E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI1E,oFAAoF;AACpF,wBAAsB,aAAa,IAAI,OAAO,CAAC,cAAc,uBAAuB,CAAC,CAAC,CAMrF;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,OAAO,CAAC,WAAW,CAAC,CAKtB;AAED,MAAM,WAAW,aAAa;IAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAEhF,+DAA+D;AAC/D,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAG3E"}
package/dist/index.js CHANGED
@@ -9,10 +9,16 @@ export async function loadLiteParse() {
9
9
  throw missingRuntimePackageError("@llamaindex/liteparse", "pdf-js", cause);
10
10
  }
11
11
  }
12
- /** Parse document bytes using the same parser as the full server. */
13
- export async function parsePdfBuffer(buffer) {
12
+ /**
13
+ * Parse document bytes using the same parser as the full server. `maxPages`
14
+ * stops the parser after that many pages instead of parsing the whole file.
15
+ */
16
+ export async function parsePdfBuffer(buffer, options = {}) {
14
17
  const { LiteParse } = await loadLiteParse();
15
- return new LiteParse({ ocrEnabled: false }).parse(buffer, true);
18
+ const config = { ocrEnabled: false };
19
+ if (options.maxPages !== undefined)
20
+ config.maxPages = options.maxPages;
21
+ return new LiteParse(config).parse(buffer, true);
16
22
  }
17
23
  /** Extract the PDF text layer, leaving scanned pages empty. */
18
24
  export async function extractPdfText(buffer) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAA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A0B,CAAC,uBAAuB,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,OAAO,GAA0B,EAAE;IAEnC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,aAAa,EAAE,CAAC;IAC5C,MAAM,MAAM,GAA6B,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;IAC/D,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;QAAE,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IACvE,OAAO,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACnD,CAAC;AAID,+DAA+D;AAC/D,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAc;IACjD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;AACzG,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodetool-ai/document-processing",
3
- "version": "0.8.14",
3
+ "version": "0.8.17",
4
4
  "description": "PDF processing for explicitly installed document features",
5
5
  "type": "module",
6
6
  "engines": {
@@ -23,8 +23,8 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@llamaindex/liteparse": "^1.5.2",
26
- "@nodetool-ai/config": "0.8.14",
27
- "@nodetool-ai/protocol": "0.8.14"
26
+ "@nodetool-ai/config": "0.8.17",
27
+ "@nodetool-ai/protocol": "0.8.17"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^22.0.0",