@pdfvector/util 0.0.18 → 0.0.20

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.
@@ -4,6 +4,7 @@ export * from "./free-tier";
4
4
  export * from "./get-error-message";
5
5
  export * from "./plan";
6
6
  export * from "./tier";
7
+ export * from "./usage-status";
7
8
  export declare const isCI: boolean;
8
9
  export declare const isLocal: boolean;
9
10
  export declare const isLive: boolean;
package/.tsc/lib/index.js CHANGED
@@ -4,6 +4,7 @@ export * from "./free-tier";
4
4
  export * from "./get-error-message";
5
5
  export * from "./plan";
6
6
  export * from "./tier";
7
+ export * from "./usage-status";
7
8
  function getCIWithBun() {
8
9
  try {
9
10
  return Bun.env.CI;
@@ -20,12 +20,18 @@ export declare const specializedParseCosts: {
20
20
  export declare const specializedAskExtractCosts: Record<ModelTier, number>;
21
21
  /** Formats supported by all tiers (nano, mini, pro, max, auto). */
22
22
  export declare const allTierFormats: readonly ["PDF", "Word (.docx)", "Excel (.xlsx)", "PowerPoint (.pptx)", "CSV", "Text (.txt, .md, .tsv, .xml)", "HTML", "RTF", "OpenDocument (.odt, .ods, .odp)", "EPUB", "Bibliography (.bib, .ris, .nbib, .enw)"];
23
- /** Formats added by the max/auto tier. */
24
- export declare const maxTierAdditionalFormats: readonly ["Image (PNG, JPG, TIFF, BMP, HEIF)"];
23
+ /** Formats added by the pro/max/auto tiers. */
24
+ export declare const proTierAdditionalFormats: readonly ["Image (PNG, JPG, TIFF, BMP, HEIF)"];
25
25
  /** Short human-readable summary of all supported formats. */
26
26
  export declare const allSupportedFormatsShort = "PDF, DOCX, XLSX, PPTX, CSV, PNG, JPG, TIFF, BMP, HEIF, TXT, MD, TSV, XML, RTF, HTML, ODT, ODS, ODP, EPUB, BIB, RIS, NBIB, ENW";
27
27
  /** Long human-readable summary of all supported formats. */
28
28
  export declare const allSupportedFormatsLong: string;
29
+ /** Image dimension limits enforced by the underlying OCR engine (Azure Document Intelligence).
30
+ * Images outside this range are rejected with HTTP 400 before processing begins. */
31
+ export declare const imageDimensionLimits: {
32
+ readonly minPixels: 50;
33
+ readonly maxPixels: 10000;
34
+ };
29
35
  /** Pre-built format note for API descriptions (used in contract model descriptions). */
30
36
  export declare const formatsByTierDescription: string;
31
37
  /** Academic/grant API: fixed credits per request */
package/.tsc/lib/tier.js CHANGED
@@ -54,8 +54,8 @@ export const allTierFormats = [
54
54
  "EPUB",
55
55
  "Bibliography (.bib, .ris, .nbib, .enw)",
56
56
  ];
57
- /** Formats added by the max/auto tier. */
58
- export const maxTierAdditionalFormats = [
57
+ /** Formats added by the pro/max/auto tiers. */
58
+ export const proTierAdditionalFormats = [
59
59
  "Image (PNG, JPG, TIFF, BMP, HEIF)",
60
60
  ];
61
61
  /** Short human-readable summary of all supported formats. */
@@ -66,10 +66,17 @@ export const allSupportedFormatsLong = "PDF, Word (.docx), Excel (.xlsx), PowerP
66
66
  "Plain Text (.txt, .md, .tsv, .xml), RTF, HTML, " +
67
67
  "OpenDocument (.odt, .ods, .odp), EPUB, " +
68
68
  "and Bibliography (.bib, .ris, .nbib, .enw) files";
69
+ /** Image dimension limits enforced by the underlying OCR engine (Azure Document Intelligence).
70
+ * Images outside this range are rejected with HTTP 400 before processing begins. */
71
+ export const imageDimensionLimits = {
72
+ minPixels: 50,
73
+ maxPixels: 10000,
74
+ };
69
75
  /** Pre-built format note for API descriptions (used in contract model descriptions). */
70
76
  export const formatsByTierDescription = "Supported formats by tier:\n" +
71
77
  `- All tiers: ${allTierFormats.join(", ")}.\n` +
72
- `- Max/Auto adds: ${maxTierAdditionalFormats.join(", ")}.`;
78
+ `- Pro/Max/Auto adds: ${proTierAdditionalFormats.join(", ")}. ` +
79
+ `Image dimensions must be between ${imageDimensionLimits.minPixels}×${imageDimensionLimits.minPixels} and ${imageDimensionLimits.maxPixels}×${imageDimensionLimits.maxPixels} pixels.`;
73
80
  // ─── Academic credit costs ────────────────────────────────────────────
74
81
  /** Academic/grant API: fixed credits per request */
75
82
  export const academicCreditCosts = {
@@ -0,0 +1,4 @@
1
+ export declare const usageStatuses: readonly ["success", "user_error", "system_error"];
2
+ export type UsageStatus = (typeof usageStatuses)[number];
3
+ export declare const errorStages: readonly ["auth", "validation", "preprocessing", "processing"];
4
+ export type ErrorStage = (typeof errorStages)[number];
@@ -0,0 +1,7 @@
1
+ export const usageStatuses = ["success", "user_error", "system_error"];
2
+ export const errorStages = [
3
+ "auth",
4
+ "validation",
5
+ "preprocessing",
6
+ "processing",
7
+ ];
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @pdfvector/util
2
2
 
3
+ ## 0.0.20
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [`868be37`](https://github.com/phuctm97/pdfvector/commit/868be37857f362a428f52b5ea0ce6b359b858c20) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Migrate document parsing to Form Parser with Pro image support
9
+
10
+ ## 0.0.19
11
+ ### Patch Changes
12
+
13
+
14
+
15
+ - [#199](https://github.com/phuctm97/pdfvector/pull/199) [`761547d`](https://github.com/phuctm97/pdfvector/commit/761547db6ad1cf6bd11ea7a1f56b6f4806c72f6a) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Redesign request usage tracking with 3-state taxonomy
16
+
3
17
  ## 0.0.18
4
18
  ### Patch Changes
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/util",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "type": "module",
5
5
  "main": ".tsc/lib/index.js",
6
6
  "files": [