@pdfvector/util 0.0.17 → 0.0.19

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,14 +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 pro tier. */
24
- export declare const proTierAdditionalFormats: readonly ["Image (PNG, JPG)"];
25
- /** Formats added by the max/auto tier (superset of pro). */
23
+ /** Formats added by the max/auto tier. */
26
24
  export declare const maxTierAdditionalFormats: readonly ["Image (PNG, JPG, TIFF, BMP, HEIF)"];
27
25
  /** Short human-readable summary of all supported formats. */
28
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";
29
27
  /** Long human-readable summary of all supported formats. */
30
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
+ };
31
35
  /** Pre-built format note for API descriptions (used in contract model descriptions). */
32
36
  export declare const formatsByTierDescription: string;
33
37
  /** Academic/grant API: fixed credits per request */
package/.tsc/lib/tier.js CHANGED
@@ -54,9 +54,7 @@ export const allTierFormats = [
54
54
  "EPUB",
55
55
  "Bibliography (.bib, .ris, .nbib, .enw)",
56
56
  ];
57
- /** Formats added by the pro tier. */
58
- export const proTierAdditionalFormats = ["Image (PNG, JPG)"];
59
- /** Formats added by the max/auto tier (superset of pro). */
57
+ /** Formats added by the max/auto tier. */
60
58
  export const maxTierAdditionalFormats = [
61
59
  "Image (PNG, JPG, TIFF, BMP, HEIF)",
62
60
  ];
@@ -68,11 +66,17 @@ export const allSupportedFormatsLong = "PDF, Word (.docx), Excel (.xlsx), PowerP
68
66
  "Plain Text (.txt, .md, .tsv, .xml), RTF, HTML, " +
69
67
  "OpenDocument (.odt, .ods, .odp), EPUB, " +
70
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
+ };
71
75
  /** Pre-built format note for API descriptions (used in contract model descriptions). */
72
76
  export const formatsByTierDescription = "Supported formats by tier:\n" +
73
77
  `- All tiers: ${allTierFormats.join(", ")}.\n` +
74
- `- Pro adds: ${proTierAdditionalFormats.join(", ")}.\n` +
75
- `- Max/Auto adds: ${maxTierAdditionalFormats.join(", ")}.`;
78
+ `- Max/Auto adds: ${maxTierAdditionalFormats.join(", ")}. ` +
79
+ `Image dimensions must be between ${imageDimensionLimits.minPixels}×${imageDimensionLimits.minPixels} and ${imageDimensionLimits.maxPixels}×${imageDimensionLimits.maxPixels} pixels.`;
76
80
  // ─── Academic credit costs ────────────────────────────────────────────
77
81
  /** Academic/grant API: fixed credits per request */
78
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.19
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#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
9
+
10
+ ## 0.0.18
11
+ ### Patch Changes
12
+
13
+
14
+
15
+ - [#181](https://github.com/phuctm97/pdfvector/pull/181) [`383829a`](https://github.com/phuctm97/pdfvector/commit/383829a2d4239fd6640fbabafe725c4373a8a4aa) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Restrict image parsing to max/auto tiers with Azure DI and add text pre-check
16
+
3
17
  ## 0.0.17
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.17",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "main": ".tsc/lib/index.js",
6
6
  "files": [