@pdfvector/util 0.2.0 → 0.2.1

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.
@@ -20,6 +20,31 @@ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWit
20
20
  type: z.ZodOptional<z.ZodString>;
21
21
  }, z.core.$strip>>;
22
22
  }, z.core.$strip>, z.ZodObject<{
23
+ documentFormat: z.ZodOptional<z.ZodEnum<{
24
+ csv: "csv";
25
+ docx: "docx";
26
+ html: "html";
27
+ json: "json";
28
+ md: "md";
29
+ odp: "odp";
30
+ ods: "ods";
31
+ odt: "odt";
32
+ pdf: "pdf";
33
+ pptx: "pptx";
34
+ rtf: "rtf";
35
+ tsv: "tsv";
36
+ txt: "txt";
37
+ vtt: "vtt";
38
+ xlsx: "xlsx";
39
+ xml: "xml";
40
+ }>>;
41
+ pageUnit: z.ZodOptional<z.ZodEnum<{
42
+ chunk: "chunk";
43
+ page: "page";
44
+ sheet: "sheet";
45
+ slide: "slide";
46
+ }>>;
47
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
48
  markdown: z.ZodString;
24
49
  pageCount: z.ZodNumber;
25
50
  model: z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/instance/router/document/parse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8JxB,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAYS,CAAC"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/instance/router/document/parse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgMxB,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAYS,CAAC"}
@@ -54,6 +54,36 @@ const parseInputSchema = z.object({
54
54
  "Useful for long-running operations that may exceed client timeout limits."),
55
55
  });
56
56
  const parseOutputSchema = z.object({
57
+ documentFormat: z
58
+ .enum([
59
+ "pdf",
60
+ "docx",
61
+ "xlsx",
62
+ "pptx",
63
+ "odt",
64
+ "ods",
65
+ "odp",
66
+ "txt",
67
+ "md",
68
+ "html",
69
+ "csv",
70
+ "tsv",
71
+ "xml",
72
+ "json",
73
+ "rtf",
74
+ "vtt",
75
+ ])
76
+ .optional()
77
+ .describe("Detected native document format when supplied by the parser."),
78
+ pageUnit: z
79
+ .enum(["page", "sheet", "slide", "chunk"])
80
+ .optional()
81
+ .describe("Billing/output unit: physical PDF page, worksheet, slide, or logical text chunk of at most 4000 Unicode characters; not a rendered Office page."),
82
+ warnings: z
83
+ .array(z.string().max(1000))
84
+ .max(100)
85
+ .optional()
86
+ .describe("Extraction limitations and best-effort accuracy warnings when supplied by the parser."),
57
87
  markdown: z.string().describe("Extracted text content from the document"),
58
88
  pageCount: z.number().int().describe("Total number of pages in the document"),
59
89
  model: pdfvectorModelSchema.describe(outputModelDescription),
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @pdfvector/util
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#395](https://github.com/phuctm97/pdfvector/pull/395) [`3036236`](https://github.com/phuctm97/pdfvector/commit/3036236c0d62db2ac978ddf5e099e596ac331d8c) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add bounded native document parsing with PDF layout recovery, Office and text adapters, explicit format/pagination metadata, safe input preflight, and retained extraction warnings. Add durable asynchronous and multipart/ZIP batch parsing with same-key recovery and a bundled offline API reference. Preserve idempotent local credit accounting, align gateway source metadata with the 32 MiB native input limit, and reject unsupported or empty documents before reservation.
8
+
3
9
  ## 0.2.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/util",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "./.tsc/lib/index.js",
6
6
  "exports": {