@pdfvector/util 0.2.0 → 0.3.0

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.
@@ -47,4 +47,5 @@ export declare function buildClientReadmeAcademicParseSection(): string;
47
47
  export declare function buildCreditCostsMarkdownTable(): string;
48
48
  export declare function buildClientReadmeCreditCostsSection(): string;
49
49
  export declare function buildPdfVectorApiSkillMarkdown(): string;
50
+ export { dedicatedInstanceMonthlyCredits } from "./dedicated-instance-monthly-credits.js";
50
51
  //# sourceMappingURL=api-docs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-docs.d.ts","sourceRoot":"","sources":["../../lib/api-docs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,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CAAsC,CACrD,MAAM,EAAE,MAAM,GACZ,oBAAoB,CAyCtB;AAED,wBAAgB,qCAAqC,IAAI,MAAM,CAoB9D;AAED,wBAAgB,qCAAqC,IAAI,MAAM,CAiB9D;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAQtD;AAED,wBAAgB,mCAAmC,IAAI,MAAM,CAE5D;AA8BD,wBAAgB,8BAA8B,IAAI,MAAM,CAoGvD;AAED,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC"}
@@ -1801,3 +1801,4 @@ ${operations}
1801
1801
  - For Academic Parse, do not invent metadata. Use returned fields such as \`title\`, \`doi\`, \`providerURL\`, and \`pdfURL\`.
1802
1802
  `;
1803
1803
  }
1804
+ export { dedicatedInstanceMonthlyCredits } from "./dedicated-instance-monthly-credits.js";
@@ -132,4 +132,14 @@ export declare const remove: import("@orpc/contract").ContractProcedureBuilderWi
132
132
  }, z.core.$strip>, z.ZodObject<{
133
133
  success: z.ZodBoolean;
134
134
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
135
+ export declare const getCredits: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
136
+ id: z.ZodNumber;
137
+ }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
138
+ total: z.ZodNumber;
139
+ used: z.ZodNumber;
140
+ reserved: z.ZodNumber;
141
+ remaining: z.ZodNumber;
142
+ resetsAt: z.ZodNullable<z.ZodDate>;
143
+ eligible: z.ZodBoolean;
144
+ }, z.core.$strip>>, Record<never, never>, Record<never, never>>;
135
145
  //# sourceMappingURL=instances.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/instance/instances.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA+BzB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;+DAAqC,CAAC;AAEvD,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAEsD,CAAC;AAEvE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DASK,CAAC;AAEzB,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;8DAEM,CAAC;AAEzB,eAAO,MAAM,MAAM;;;;8DAEyB,CAAC"}
1
+ {"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/instance/instances.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA+BzB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;+DAAqC,CAAC;AAEvD,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAEsD,CAAC;AAEvE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DASK,CAAC;AAEzB,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;8DAEM,CAAC;AAEzB,eAAO,MAAM,MAAM;;;;8DAEyB,CAAC;AAE7C,eAAO,MAAM,UAAU;;;;;;;;;+DAarB,CAAC"}
@@ -44,3 +44,15 @@ export const retry = oc
44
44
  export const remove = oc
45
45
  .input(z.object({ id: z.number() }))
46
46
  .output(z.object({ success: z.boolean() }));
47
+ export const getCredits = oc
48
+ .input(z.object({ id: z.number().int().positive() }))
49
+ .output(z
50
+ .object({
51
+ total: z.number().int().nonnegative(),
52
+ used: z.number().int().nonnegative(),
53
+ reserved: z.number().int().nonnegative(),
54
+ remaining: z.number().int().nonnegative(),
55
+ resetsAt: z.date().nullable(),
56
+ eligible: z.boolean(),
57
+ })
58
+ .nullable());
@@ -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),
@@ -0,0 +1,2 @@
1
+ export declare const dedicatedInstanceMonthlyCredits = 200000;
2
+ //# sourceMappingURL=dedicated-instance-monthly-credits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dedicated-instance-monthly-credits.d.ts","sourceRoot":"","sources":["../../lib/dedicated-instance-monthly-credits.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,SAAU,CAAC"}
@@ -0,0 +1 @@
1
+ export const dedicatedInstanceMonthlyCredits = 200_000;
@@ -1,5 +1,6 @@
1
1
  export * from "./api-source.js";
2
2
  export * from "./date.js";
3
+ export * from "./dedicated-instance-monthly-credits.js";
3
4
  export * from "./environment.js";
4
5
  export * from "./format.js";
5
6
  export * from "./free-tier.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,sCAAsC,CAAC;AACrD,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
package/.tsc/lib/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./api-source.js";
2
2
  export * from "./date.js";
3
+ export * from "./dedicated-instance-monthly-credits.js";
3
4
  export * from "./environment.js";
4
5
  export * from "./format.js";
5
6
  export * from "./free-tier.js";
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @pdfvector/util
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#398](https://github.com/phuctm97/pdfvector/pull/398) [`757ceaf`](https://github.com/phuctm97/pdfvector/commit/757ceafff9ffcb693ff67a7e93ce77211980522e) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Give each eligible Enterprise dedicated instance 200,000 monthly credits, including the included instance and separately billed instances. Keep the 100,000-credit General Instance pool separate, preserve balances when replacing an instance, and refresh annual subscriptions monthly. Show each instance's allowance, usage, reservations, and next reset in the client.
8
+
9
+ ## 0.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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.
14
+
3
15
  ## 0.2.0
4
16
 
5
17
  ### 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.3.0",
4
4
  "type": "module",
5
5
  "main": "./.tsc/lib/index.js",
6
6
  "exports": {