@pdfvector/util 0.0.31 → 0.1.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.
Files changed (241) hide show
  1. package/.tsc/lib/api-source.d.ts +1 -1
  2. package/.tsc/lib/api-source.d.ts.map +1 -1
  3. package/.tsc/lib/api-source.js +1 -0
  4. package/.tsc/lib/contract/gateway/index.d.ts +7 -0
  5. package/.tsc/lib/contract/gateway/index.d.ts.map +1 -0
  6. package/.tsc/lib/contract/gateway/index.js +3 -0
  7. package/.tsc/lib/contract/gateway/mcp-account.d.ts +64 -0
  8. package/.tsc/lib/contract/gateway/mcp-account.d.ts.map +1 -0
  9. package/.tsc/lib/contract/gateway/mcp-account.js +38 -0
  10. package/.tsc/lib/contract/gateway/router/admin/billing.d.ts +50 -0
  11. package/.tsc/lib/contract/gateway/router/admin/billing.d.ts.map +1 -0
  12. package/.tsc/lib/contract/gateway/router/admin/billing.js +51 -0
  13. package/.tsc/lib/contract/gateway/router/admin/blog.d.ts +38 -0
  14. package/.tsc/lib/contract/gateway/router/admin/blog.d.ts.map +1 -0
  15. package/.tsc/lib/contract/gateway/router/admin/blog.js +36 -0
  16. package/.tsc/lib/contract/gateway/router/admin/feedback.d.ts +48 -0
  17. package/.tsc/lib/contract/gateway/router/admin/feedback.d.ts.map +1 -0
  18. package/.tsc/lib/contract/gateway/router/admin/feedback.js +52 -0
  19. package/.tsc/lib/contract/gateway/router/admin/instances.d.ts +8 -0
  20. package/.tsc/lib/contract/gateway/router/admin/instances.d.ts.map +1 -0
  21. package/.tsc/lib/contract/gateway/router/admin/instances.js +8 -0
  22. package/.tsc/lib/contract/gateway/router/admin/usage/free.d.ts +108 -0
  23. package/.tsc/lib/contract/gateway/router/admin/usage/free.d.ts.map +1 -0
  24. package/.tsc/lib/contract/gateway/router/admin/usage/free.js +86 -0
  25. package/.tsc/lib/contract/gateway/router/admin/usage/index.d.ts +4 -0
  26. package/.tsc/lib/contract/gateway/router/admin/usage/index.d.ts.map +1 -0
  27. package/.tsc/lib/contract/gateway/router/admin/usage/index.js +3 -0
  28. package/.tsc/lib/contract/gateway/router/admin/usage/overview.d.ts +105 -0
  29. package/.tsc/lib/contract/gateway/router/admin/usage/overview.d.ts.map +1 -0
  30. package/.tsc/lib/contract/gateway/router/admin/usage/overview.js +65 -0
  31. package/.tsc/lib/contract/gateway/router/admin/usage/records.d.ts +72 -0
  32. package/.tsc/lib/contract/gateway/router/admin/usage/records.d.ts.map +1 -0
  33. package/.tsc/lib/contract/gateway/router/admin/usage/records.js +55 -0
  34. package/.tsc/lib/contract/gateway/router/admin/users.d.ts +93 -0
  35. package/.tsc/lib/contract/gateway/router/admin/users.d.ts.map +1 -0
  36. package/.tsc/lib/contract/gateway/router/admin/users.js +101 -0
  37. package/.tsc/lib/contract/gateway/router/admin.d.ts +7 -0
  38. package/.tsc/lib/contract/gateway/router/admin.d.ts.map +1 -0
  39. package/.tsc/lib/contract/gateway/router/admin.js +6 -0
  40. package/.tsc/lib/contract/gateway/router/billing.d.ts +17 -0
  41. package/.tsc/lib/contract/gateway/router/billing.d.ts.map +1 -0
  42. package/.tsc/lib/contract/gateway/router/billing.js +20 -0
  43. package/.tsc/lib/contract/gateway/router/blog.d.ts +35 -0
  44. package/.tsc/lib/contract/gateway/router/blog.d.ts.map +1 -0
  45. package/.tsc/lib/contract/gateway/router/blog.js +29 -0
  46. package/.tsc/lib/contract/gateway/router/feedback.d.ts +14 -0
  47. package/.tsc/lib/contract/gateway/router/feedback.d.ts.map +1 -0
  48. package/.tsc/lib/contract/gateway/router/feedback.js +15 -0
  49. package/.tsc/lib/contract/gateway/router/free-feedback.d.ts +19 -0
  50. package/.tsc/lib/contract/gateway/router/free-feedback.d.ts.map +1 -0
  51. package/.tsc/lib/contract/gateway/router/free-feedback.js +10 -0
  52. package/.tsc/lib/contract/gateway/router/greeting.d.ts +7 -0
  53. package/.tsc/lib/contract/gateway/router/greeting.d.ts.map +1 -0
  54. package/.tsc/lib/contract/gateway/router/greeting.js +11 -0
  55. package/.tsc/lib/contract/gateway/router/health.d.ts +5 -0
  56. package/.tsc/lib/contract/gateway/router/health.d.ts.map +1 -0
  57. package/.tsc/lib/contract/gateway/router/health.js +6 -0
  58. package/.tsc/lib/contract/gateway/router/index.d.ts +10 -0
  59. package/.tsc/lib/contract/gateway/router/index.d.ts.map +1 -0
  60. package/.tsc/lib/contract/gateway/router/index.js +9 -0
  61. package/.tsc/lib/contract/gateway/router/instance/api-keys.d.ts +30 -0
  62. package/.tsc/lib/contract/gateway/router/instance/api-keys.d.ts.map +1 -0
  63. package/.tsc/lib/contract/gateway/router/instance/api-keys.js +20 -0
  64. package/.tsc/lib/contract/gateway/router/instance/instances.d.ts +40 -0
  65. package/.tsc/lib/contract/gateway/router/instance/instances.d.ts.map +1 -0
  66. package/.tsc/lib/contract/gateway/router/instance/instances.js +24 -0
  67. package/.tsc/lib/contract/gateway/router/instance/proxy.d.ts +50 -0
  68. package/.tsc/lib/contract/gateway/router/instance/proxy.d.ts.map +1 -0
  69. package/.tsc/lib/contract/gateway/router/instance/proxy.js +55 -0
  70. package/.tsc/lib/contract/gateway/router/instance/usage.d.ts +205 -0
  71. package/.tsc/lib/contract/gateway/router/instance/usage.d.ts.map +1 -0
  72. package/.tsc/lib/contract/gateway/router/instance/usage.js +92 -0
  73. package/.tsc/lib/contract/gateway/router/instance.d.ts +5 -0
  74. package/.tsc/lib/contract/gateway/router/instance.d.ts.map +1 -0
  75. package/.tsc/lib/contract/gateway/router/instance.js +4 -0
  76. package/.tsc/lib/contract/gateway/router/workspace.d.ts +31 -0
  77. package/.tsc/lib/contract/gateway/router/workspace.d.ts.map +1 -0
  78. package/.tsc/lib/contract/gateway/router/workspace.js +30 -0
  79. package/.tsc/lib/contract/instance/fetchable-url-schema.d.ts +3 -0
  80. package/.tsc/lib/contract/instance/fetchable-url-schema.d.ts.map +1 -0
  81. package/.tsc/lib/contract/instance/fetchable-url-schema.js +5 -0
  82. package/.tsc/lib/contract/instance/index.d.ts +12 -0
  83. package/.tsc/lib/contract/instance/index.d.ts.map +1 -0
  84. package/.tsc/lib/contract/instance/index.js +7 -0
  85. package/.tsc/lib/contract/instance/json-schema-input.d.ts +3 -0
  86. package/.tsc/lib/contract/instance/json-schema-input.d.ts.map +1 -0
  87. package/.tsc/lib/contract/instance/json-schema-input.js +23 -0
  88. package/.tsc/lib/contract/instance/page-markdown-schema.d.ts +6 -0
  89. package/.tsc/lib/contract/instance/page-markdown-schema.d.ts.map +1 -0
  90. package/.tsc/lib/contract/instance/page-markdown-schema.js +9 -0
  91. package/.tsc/lib/contract/instance/pdfvector-model-schema.d.ts +8 -0
  92. package/.tsc/lib/contract/instance/pdfvector-model-schema.d.ts.map +1 -0
  93. package/.tsc/lib/contract/instance/pdfvector-model-schema.js +4 -0
  94. package/.tsc/lib/contract/instance/pdfvector-model.d.ts +4 -0
  95. package/.tsc/lib/contract/instance/pdfvector-model.d.ts.map +1 -0
  96. package/.tsc/lib/contract/instance/pdfvector-model.js +0 -0
  97. package/.tsc/lib/contract/instance/router/academic/fetch.d.ts +69 -0
  98. package/.tsc/lib/contract/instance/router/academic/fetch.d.ts.map +1 -0
  99. package/.tsc/lib/contract/instance/router/academic/fetch.js +119 -0
  100. package/.tsc/lib/contract/instance/router/academic/find-citations.d.ts +70 -0
  101. package/.tsc/lib/contract/instance/router/academic/find-citations.d.ts.map +1 -0
  102. package/.tsc/lib/contract/instance/router/academic/find-citations.js +116 -0
  103. package/.tsc/lib/contract/instance/router/academic/index.d.ts +8 -0
  104. package/.tsc/lib/contract/instance/router/academic/index.d.ts.map +1 -0
  105. package/.tsc/lib/contract/instance/router/academic/index.js +7 -0
  106. package/.tsc/lib/contract/instance/router/academic/paper-graph.d.ts +113 -0
  107. package/.tsc/lib/contract/instance/router/academic/paper-graph.d.ts.map +1 -0
  108. package/.tsc/lib/contract/instance/router/academic/paper-graph.js +144 -0
  109. package/.tsc/lib/contract/instance/router/academic/parse.d.ts +50 -0
  110. package/.tsc/lib/contract/instance/router/academic/parse.d.ts.map +1 -0
  111. package/.tsc/lib/contract/instance/router/academic/parse.js +146 -0
  112. package/.tsc/lib/contract/instance/router/academic/provider.d.ts +18 -0
  113. package/.tsc/lib/contract/instance/router/academic/provider.d.ts.map +1 -0
  114. package/.tsc/lib/contract/instance/router/academic/provider.js +16 -0
  115. package/.tsc/lib/contract/instance/router/academic/search-grants.d.ts +84 -0
  116. package/.tsc/lib/contract/instance/router/academic/search-grants.d.ts.map +1 -0
  117. package/.tsc/lib/contract/instance/router/academic/search-grants.js +171 -0
  118. package/.tsc/lib/contract/instance/router/academic/search.d.ts +83 -0
  119. package/.tsc/lib/contract/instance/router/academic/search.d.ts.map +1 -0
  120. package/.tsc/lib/contract/instance/router/academic/search.js +154 -0
  121. package/.tsc/lib/contract/instance/router/academic/similar-papers.d.ts +89 -0
  122. package/.tsc/lib/contract/instance/router/academic/similar-papers.d.ts.map +1 -0
  123. package/.tsc/lib/contract/instance/router/academic/similar-papers.js +143 -0
  124. package/.tsc/lib/contract/instance/router/admin/get-environment.d.ts +5 -0
  125. package/.tsc/lib/contract/instance/router/admin/get-environment.d.ts.map +1 -0
  126. package/.tsc/lib/contract/instance/router/admin/get-environment.js +13 -0
  127. package/.tsc/lib/contract/instance/router/admin/get-free-usage-records.d.ts +44 -0
  128. package/.tsc/lib/contract/instance/router/admin/get-free-usage-records.d.ts.map +1 -0
  129. package/.tsc/lib/contract/instance/router/admin/get-free-usage-records.js +39 -0
  130. package/.tsc/lib/contract/instance/router/admin/get-provider-usage-records.d.ts +41 -0
  131. package/.tsc/lib/contract/instance/router/admin/get-provider-usage-records.d.ts.map +1 -0
  132. package/.tsc/lib/contract/instance/router/admin/get-provider-usage-records.js +50 -0
  133. package/.tsc/lib/contract/instance/router/admin/get-usage-records.d.ts +49 -0
  134. package/.tsc/lib/contract/instance/router/admin/get-usage-records.d.ts.map +1 -0
  135. package/.tsc/lib/contract/instance/router/admin/get-usage-records.js +44 -0
  136. package/.tsc/lib/contract/instance/router/admin/health-check.d.ts +5 -0
  137. package/.tsc/lib/contract/instance/router/admin/health-check.d.ts.map +1 -0
  138. package/.tsc/lib/contract/instance/router/admin/health-check.js +14 -0
  139. package/.tsc/lib/contract/instance/router/admin/index.d.ts +9 -0
  140. package/.tsc/lib/contract/instance/router/admin/index.d.ts.map +1 -0
  141. package/.tsc/lib/contract/instance/router/admin/index.js +8 -0
  142. package/.tsc/lib/contract/instance/router/admin/set-domain.d.ts +7 -0
  143. package/.tsc/lib/contract/instance/router/admin/set-domain.d.ts.map +1 -0
  144. package/.tsc/lib/contract/instance/router/admin/set-domain.js +20 -0
  145. package/.tsc/lib/contract/instance/router/admin/set-environment.d.ts +7 -0
  146. package/.tsc/lib/contract/instance/router/admin/set-environment.d.ts.map +1 -0
  147. package/.tsc/lib/contract/instance/router/admin/set-environment.js +41 -0
  148. package/.tsc/lib/contract/instance/router/admin/set-version.d.ts +7 -0
  149. package/.tsc/lib/contract/instance/router/admin/set-version.d.ts.map +1 -0
  150. package/.tsc/lib/contract/instance/router/admin/set-version.js +21 -0
  151. package/.tsc/lib/contract/instance/router/authenticate/index.d.ts +2 -0
  152. package/.tsc/lib/contract/instance/router/authenticate/index.d.ts.map +1 -0
  153. package/.tsc/lib/contract/instance/router/authenticate/index.js +1 -0
  154. package/.tsc/lib/contract/instance/router/authenticate/validate-credential.d.ts +7 -0
  155. package/.tsc/lib/contract/instance/router/authenticate/validate-credential.d.ts.map +1 -0
  156. package/.tsc/lib/contract/instance/router/authenticate/validate-credential.js +20 -0
  157. package/.tsc/lib/contract/instance/router/bankStatement/ask.d.ts +32 -0
  158. package/.tsc/lib/contract/instance/router/bankStatement/ask.d.ts.map +1 -0
  159. package/.tsc/lib/contract/instance/router/bankStatement/ask.js +88 -0
  160. package/.tsc/lib/contract/instance/router/bankStatement/extract.d.ts +33 -0
  161. package/.tsc/lib/contract/instance/router/bankStatement/extract.d.ts.map +1 -0
  162. package/.tsc/lib/contract/instance/router/bankStatement/extract.js +113 -0
  163. package/.tsc/lib/contract/instance/router/bankStatement/get-default-spec.d.ts +2 -0
  164. package/.tsc/lib/contract/instance/router/bankStatement/get-default-spec.d.ts.map +1 -0
  165. package/.tsc/lib/contract/instance/router/bankStatement/get-default-spec.js +19 -0
  166. package/.tsc/lib/contract/instance/router/bankStatement/index.d.ts +4 -0
  167. package/.tsc/lib/contract/instance/router/bankStatement/index.d.ts.map +1 -0
  168. package/.tsc/lib/contract/instance/router/bankStatement/index.js +3 -0
  169. package/.tsc/lib/contract/instance/router/bankStatement/parse.d.ts +28 -0
  170. package/.tsc/lib/contract/instance/router/bankStatement/parse.d.ts.map +1 -0
  171. package/.tsc/lib/contract/instance/router/bankStatement/parse.js +105 -0
  172. package/.tsc/lib/contract/instance/router/document/ask.d.ts +32 -0
  173. package/.tsc/lib/contract/instance/router/document/ask.d.ts.map +1 -0
  174. package/.tsc/lib/contract/instance/router/document/ask.js +134 -0
  175. package/.tsc/lib/contract/instance/router/document/extract.d.ts +33 -0
  176. package/.tsc/lib/contract/instance/router/document/extract.d.ts.map +1 -0
  177. package/.tsc/lib/contract/instance/router/document/extract.js +152 -0
  178. package/.tsc/lib/contract/instance/router/document/get-default-spec.d.ts +2 -0
  179. package/.tsc/lib/contract/instance/router/document/get-default-spec.d.ts.map +1 -0
  180. package/.tsc/lib/contract/instance/router/document/get-default-spec.js +19 -0
  181. package/.tsc/lib/contract/instance/router/document/index.d.ts +4 -0
  182. package/.tsc/lib/contract/instance/router/document/index.d.ts.map +1 -0
  183. package/.tsc/lib/contract/instance/router/document/index.js +3 -0
  184. package/.tsc/lib/contract/instance/router/document/parse.d.ts +40 -0
  185. package/.tsc/lib/contract/instance/router/document/parse.d.ts.map +1 -0
  186. package/.tsc/lib/contract/instance/router/document/parse.js +142 -0
  187. package/.tsc/lib/contract/instance/router/free/bank-statement-parse.d.ts +16 -0
  188. package/.tsc/lib/contract/instance/router/free/bank-statement-parse.d.ts.map +1 -0
  189. package/.tsc/lib/contract/instance/router/free/bank-statement-parse.js +87 -0
  190. package/.tsc/lib/contract/instance/router/free/generate-schema.d.ts +8 -0
  191. package/.tsc/lib/contract/instance/router/free/generate-schema.d.ts.map +1 -0
  192. package/.tsc/lib/contract/instance/router/free/generate-schema.js +110 -0
  193. package/.tsc/lib/contract/instance/router/free/index.d.ts +5 -0
  194. package/.tsc/lib/contract/instance/router/free/index.d.ts.map +1 -0
  195. package/.tsc/lib/contract/instance/router/free/index.js +4 -0
  196. package/.tsc/lib/contract/instance/router/free/publication-pdf-url.d.ts +12 -0
  197. package/.tsc/lib/contract/instance/router/free/publication-pdf-url.d.ts.map +1 -0
  198. package/.tsc/lib/contract/instance/router/free/publication-pdf-url.js +86 -0
  199. package/.tsc/lib/contract/instance/router/free/rate-limit-status.d.ts +19 -0
  200. package/.tsc/lib/contract/instance/router/free/rate-limit-status.d.ts.map +1 -0
  201. package/.tsc/lib/contract/instance/router/free/rate-limit-status.js +36 -0
  202. package/.tsc/lib/contract/instance/router/identity/ask.d.ts +32 -0
  203. package/.tsc/lib/contract/instance/router/identity/ask.d.ts.map +1 -0
  204. package/.tsc/lib/contract/instance/router/identity/ask.js +95 -0
  205. package/.tsc/lib/contract/instance/router/identity/extract.d.ts +33 -0
  206. package/.tsc/lib/contract/instance/router/identity/extract.d.ts.map +1 -0
  207. package/.tsc/lib/contract/instance/router/identity/extract.js +103 -0
  208. package/.tsc/lib/contract/instance/router/identity/get-default-spec.d.ts +2 -0
  209. package/.tsc/lib/contract/instance/router/identity/get-default-spec.d.ts.map +1 -0
  210. package/.tsc/lib/contract/instance/router/identity/get-default-spec.js +19 -0
  211. package/.tsc/lib/contract/instance/router/identity/index.d.ts +4 -0
  212. package/.tsc/lib/contract/instance/router/identity/index.d.ts.map +1 -0
  213. package/.tsc/lib/contract/instance/router/identity/index.js +3 -0
  214. package/.tsc/lib/contract/instance/router/identity/parse.d.ts +29 -0
  215. package/.tsc/lib/contract/instance/router/identity/parse.d.ts.map +1 -0
  216. package/.tsc/lib/contract/instance/router/identity/parse.js +109 -0
  217. package/.tsc/lib/contract/instance/router/index.d.ts +9 -0
  218. package/.tsc/lib/contract/instance/router/index.d.ts.map +1 -0
  219. package/.tsc/lib/contract/instance/router/index.js +8 -0
  220. package/.tsc/lib/contract/instance/router/invoice/ask.d.ts +32 -0
  221. package/.tsc/lib/contract/instance/router/invoice/ask.d.ts.map +1 -0
  222. package/.tsc/lib/contract/instance/router/invoice/ask.js +85 -0
  223. package/.tsc/lib/contract/instance/router/invoice/extract.d.ts +33 -0
  224. package/.tsc/lib/contract/instance/router/invoice/extract.d.ts.map +1 -0
  225. package/.tsc/lib/contract/instance/router/invoice/extract.js +109 -0
  226. package/.tsc/lib/contract/instance/router/invoice/get-default-spec.d.ts +2 -0
  227. package/.tsc/lib/contract/instance/router/invoice/get-default-spec.d.ts.map +1 -0
  228. package/.tsc/lib/contract/instance/router/invoice/get-default-spec.js +19 -0
  229. package/.tsc/lib/contract/instance/router/invoice/index.d.ts +4 -0
  230. package/.tsc/lib/contract/instance/router/invoice/index.d.ts.map +1 -0
  231. package/.tsc/lib/contract/instance/router/invoice/index.js +3 -0
  232. package/.tsc/lib/contract/instance/router/invoice/parse.d.ts +28 -0
  233. package/.tsc/lib/contract/instance/router/invoice/parse.d.ts.map +1 -0
  234. package/.tsc/lib/contract/instance/router/invoice/parse.js +100 -0
  235. package/.tsc/lib/contract/instance/supported-mimes.d.ts +35 -0
  236. package/.tsc/lib/contract/instance/supported-mimes.d.ts.map +1 -0
  237. package/.tsc/lib/contract/instance/supported-mimes.js +130 -0
  238. package/.tsc/lib/date.d.ts.map +1 -1
  239. package/.tsc/lib/date.js +3 -5
  240. package/CHANGELOG.md +18 -0
  241. package/package.json +14 -2
@@ -0,0 +1,86 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { z } from "zod";
3
+ const inputSchema = z.object({
4
+ ids: z
5
+ .array(z.string().min(1, "Each ID must be a non-empty string"), {
6
+ message: "ids is required and must be an array of strings",
7
+ })
8
+ .min(1, "ids must contain at least 1 identifier")
9
+ .max(20, "ids must contain at most 20 identifiers")
10
+ .describe("Publication identifiers: DOI (e.g. 10.1371/journal.pone.0185809), PubMed ID (e.g. 33116299), ArXiv ID (e.g. 1706.03762), or other supported format"),
11
+ });
12
+ const resultSchema = z.object({
13
+ id: z.string().describe("The input publication identifier"),
14
+ pdfUrl: z
15
+ .string()
16
+ .optional()
17
+ .describe("Direct URL to the publication PDF, if available"),
18
+ title: z.string().optional().describe("Title of the publication"),
19
+ });
20
+ const outputSchema = z.object({
21
+ results: z.array(resultSchema).describe("Results for each input ID"),
22
+ requestId: z
23
+ .number()
24
+ .int()
25
+ .describe("Unique request identifier for this API call"),
26
+ });
27
+ const requestExamples = {
28
+ "Single ArXiv ID": {
29
+ summary: "Get PDF URL for an ArXiv paper",
30
+ value: {
31
+ ids: ["1706.03762"],
32
+ },
33
+ },
34
+ "Multiple IDs": {
35
+ summary: "Batch lookup with mixed identifier types",
36
+ value: {
37
+ ids: ["1706.03762", "33116299", "10.1371/journal.pone.0185809"],
38
+ },
39
+ },
40
+ "Single PubMed ID": {
41
+ summary: "Get PDF URL for a PubMed paper",
42
+ value: {
43
+ ids: ["33116299"],
44
+ },
45
+ },
46
+ };
47
+ const responseExample = {
48
+ results: [
49
+ {
50
+ id: "1706.03762",
51
+ pdfUrl: "https://arxiv.org/pdf/1706.03762v7",
52
+ title: "Attention Is All You Need",
53
+ },
54
+ {
55
+ id: "33116299",
56
+ pdfUrl: "https://www.nature.com/articles/s41586-020-2901-9.pdf",
57
+ title: "Identification of SARS-CoV-2 inhibitors using lung and colonic organoids",
58
+ },
59
+ ],
60
+ requestId: 42,
61
+ };
62
+ export const publicationPdfUrl = oc
63
+ .route({
64
+ summary: "Free: Get publication PDF URL",
65
+ description: "Look up publications by DOI, PubMed ID, ArXiv ID, or other identifiers and return their PDF URLs if available. Accepts up to 20 IDs per request. Rate limited to 20 requests per IP per day.",
66
+ tags: ["Free"],
67
+ spec: (op) => {
68
+ op.security = [];
69
+ const reqBody = op.requestBody;
70
+ if (reqBody?.content) {
71
+ for (const mediaType of Object.values(reqBody.content)) {
72
+ mediaType["examples"] = requestExamples;
73
+ }
74
+ }
75
+ const responses = op.responses;
76
+ const okResponse = responses?.["200"];
77
+ if (okResponse?.content) {
78
+ for (const mediaType of Object.values(okResponse.content)) {
79
+ mediaType["example"] = responseExample;
80
+ }
81
+ }
82
+ return op;
83
+ },
84
+ })
85
+ .input(inputSchema)
86
+ .output(outputSchema);
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ export declare const rateLimitStatus: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
3
+ bankStatementParse: z.ZodObject<{
4
+ limit: z.ZodNumber;
5
+ used: z.ZodNumber;
6
+ remaining: z.ZodNumber;
7
+ }, z.core.$strip>;
8
+ generateSchema: z.ZodObject<{
9
+ limit: z.ZodNumber;
10
+ used: z.ZodNumber;
11
+ remaining: z.ZodNumber;
12
+ }, z.core.$strip>;
13
+ publicationPdfUrl: z.ZodObject<{
14
+ limit: z.ZodNumber;
15
+ used: z.ZodNumber;
16
+ remaining: z.ZodNumber;
17
+ }, z.core.$strip>;
18
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
19
+ //# sourceMappingURL=rate-limit-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limit-status.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/instance/router/free/rate-limit-status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;8DAuBN,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { z } from "zod";
3
+ const limitSchema = z.object({
4
+ limit: z.number().int().describe("Maximum requests allowed per day"),
5
+ used: z.number().int().describe("Requests used today"),
6
+ remaining: z.number().int().describe("Requests remaining today"),
7
+ });
8
+ const outputSchema = z.object({
9
+ bankStatementParse: limitSchema.describe("Bank statement parse limits"),
10
+ generateSchema: limitSchema.describe("JSON schema generator limits"),
11
+ publicationPdfUrl: limitSchema.describe("Publication PDF URL lookup limits"),
12
+ });
13
+ const responseExample = {
14
+ bankStatementParse: { limit: 5, used: 2, remaining: 3 },
15
+ generateSchema: { limit: 10, used: 0, remaining: 10 },
16
+ publicationPdfUrl: { limit: 20, used: 5, remaining: 15 },
17
+ };
18
+ export const rateLimitStatus = oc
19
+ .route({
20
+ method: "GET",
21
+ summary: "Free: Get rate limit status",
22
+ description: "Check the remaining rate limit for all free API endpoints. Limits are per IP and reset daily at midnight UTC.",
23
+ tags: ["Free"],
24
+ spec: (op) => {
25
+ op.security = [];
26
+ const responses = op.responses;
27
+ const okResponse = responses?.["200"];
28
+ if (okResponse?.content) {
29
+ for (const mediaType of Object.values(okResponse.content)) {
30
+ mediaType["example"] = responseExample;
31
+ }
32
+ }
33
+ return op;
34
+ },
35
+ })
36
+ .output(outputSchema);
@@ -0,0 +1,32 @@
1
+ import { z } from "zod";
2
+ export declare const ask: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
3
+ url: z.ZodOptional<z.ZodURL>;
4
+ file: z.ZodOptional<z.ZodFile>;
5
+ base64: z.ZodOptional<z.ZodString>;
6
+ question: z.ZodString;
7
+ model: z.ZodDefault<z.ZodEnum<{
8
+ auto: "auto";
9
+ max: "max";
10
+ mini: "mini";
11
+ nano: "nano";
12
+ pro: "pro";
13
+ }>>;
14
+ documentId: z.ZodOptional<z.ZodString>;
15
+ callback: z.ZodOptional<z.ZodObject<{
16
+ url: z.ZodURL;
17
+ type: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>, z.ZodObject<{
20
+ markdown: z.ZodString;
21
+ pageCount: z.ZodNumber;
22
+ model: z.ZodEnum<{
23
+ max: "max";
24
+ mini: "mini";
25
+ nano: "nano";
26
+ pro: "pro";
27
+ }>;
28
+ credits: z.ZodNumber;
29
+ requestId: z.ZodNumber;
30
+ documentId: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
32
+ //# sourceMappingURL=ask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/instance/router/identity/ask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyGxB,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAYS,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
3
+ import { z } from "zod";
4
+ import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
5
+ import { pdfvectorModelSchema } from "../../pdfvector-model-schema.js";
6
+ import { outputAskModelDescription, specializedAskModelDescription, supportedFileFormatsDescription, supportedFileMimeErrorMessage, supportedFileMimes, supportedFileTypesLong, } from "../../supported-mimes.js";
7
+ import { getDefaultSpec } from "./get-default-spec.js";
8
+ const specializedModelSchema = z
9
+ .enum(["auto", ...pdfvectorModelSchema.options])
10
+ .default("auto");
11
+ const askInputSchema = z.object({
12
+ url: fetchableUrlSchema
13
+ .optional()
14
+ .describe("URL of the identity document file to fetch and parse"),
15
+ file: z
16
+ .file()
17
+ .mime([...supportedFileMimes], supportedFileMimeErrorMessage)
18
+ .optional()
19
+ .describe(`Identity document file upload via multipart form-data (${supportedFileFormatsDescription})`),
20
+ base64: z
21
+ .string()
22
+ .optional()
23
+ .describe("Base64-encoded identity document file content"),
24
+ question: z
25
+ .string()
26
+ .min(4, "question must be at least 4 characters")
27
+ .describe("The question to answer about the identity document"),
28
+ model: specializedModelSchema.describe(specializedAskModelDescription),
29
+ documentId: z
30
+ .string()
31
+ .trim()
32
+ .min(1)
33
+ .max(512)
34
+ .optional()
35
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
36
+ callback: z
37
+ .object({
38
+ url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
39
+ type: z
40
+ .string()
41
+ .optional()
42
+ .describe("Callback type identifier (e.g. 'zapier')"),
43
+ })
44
+ .optional()
45
+ .describe("Optional webhook callback for async processing. " +
46
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
47
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
48
+ "Useful for long-running operations that may exceed client timeout limits."),
49
+ });
50
+ const askOutputSchema = z.object({
51
+ markdown: z.string().describe("The answer to the question"),
52
+ pageCount: z.number().int().describe("Total number of pages in the document"),
53
+ model: pdfvectorModelSchema.describe(outputAskModelDescription),
54
+ credits: z
55
+ .number()
56
+ .int()
57
+ .describe("Number of credits consumed by this API call. Cost per page: nano=6, mini=10, pro=14, max=18."),
58
+ requestId: z
59
+ .number()
60
+ .int()
61
+ .describe("Unique request identifier for this API call"),
62
+ documentId: z
63
+ .string()
64
+ .optional()
65
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
66
+ });
67
+ const requestExamples = {
68
+ "Ask from URL": {
69
+ summary: "Ask from URL",
70
+ value: {
71
+ url: "https://example.com/identity-document.pdf",
72
+ question: "What is the name on this identity document?",
73
+ },
74
+ },
75
+ "Ask from base64": {
76
+ summary: "Ask from base64",
77
+ value: {
78
+ base64: "JVBERi0xLjAKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqIDIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbMyAwIFJdL0NvdW50IDE+PmVuZG9iaiAzIDAgb2JqPDwvVHlwZS9QYWdlL01lZGlhQm94WzAgMCAzIDNdL1BhcmVudCAyIDAgUj4+ZW5kb2JqCnhyZWYKMCA0CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAwOSAwMDAwMCBuIAowMDAwMDAwMDU4IDAwMDAwIG4gCjAwMDAwMDAxMTUgMDAwMDAgbiAKdHJhaWxlcjw8L1NpemUgNC9Sb290IDEgMCBSPj4Kc3RhcnR4cmVmCjE5MAolJUVPRg==",
79
+ question: "What is the document number?",
80
+ },
81
+ },
82
+ };
83
+ export const ask = oc
84
+ .route({
85
+ summary: "Ask a question about an identity document",
86
+ description: `Parse an identity document and answer a question about its content using AI. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
87
+ tags: ["Identity"],
88
+ spec: (op) => {
89
+ const spec = getDefaultSpec(op, requestExamples);
90
+ spec["x-codeSamples"] = getOpenApiCodeSamples("identity-ask");
91
+ return spec;
92
+ },
93
+ })
94
+ .input(askInputSchema)
95
+ .output(askOutputSchema);
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export declare const extract: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
3
+ url: z.ZodOptional<z.ZodURL>;
4
+ file: z.ZodOptional<z.ZodFile>;
5
+ base64: z.ZodOptional<z.ZodString>;
6
+ prompt: z.ZodString;
7
+ schema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<unknown, string>>, z.ZodRecord<z.ZodString, z.ZodUnknown>>]>;
8
+ model: z.ZodDefault<z.ZodEnum<{
9
+ auto: "auto";
10
+ max: "max";
11
+ mini: "mini";
12
+ nano: "nano";
13
+ pro: "pro";
14
+ }>>;
15
+ documentId: z.ZodOptional<z.ZodString>;
16
+ callback: z.ZodOptional<z.ZodObject<{
17
+ url: z.ZodURL;
18
+ type: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>>;
20
+ }, z.core.$strip>, z.ZodObject<{
21
+ data: z.ZodUnknown;
22
+ pageCount: z.ZodNumber;
23
+ model: z.ZodEnum<{
24
+ max: "max";
25
+ mini: "mini";
26
+ nano: "nano";
27
+ pro: "pro";
28
+ }>;
29
+ credits: z.ZodNumber;
30
+ requestId: z.ZodNumber;
31
+ documentId: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
33
+ //# sourceMappingURL=extract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/instance/router/identity/extract.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwHxB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAYS,CAAC"}
@@ -0,0 +1,103 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
3
+ import { z } from "zod";
4
+ import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
5
+ import { jsonSchemaInput } from "../../json-schema-input.js";
6
+ import { pdfvectorModelSchema } from "../../pdfvector-model-schema.js";
7
+ import { outputExtractModelDescription, specializedExtractModelDescription, supportedFileFormatsDescription, supportedFileMimeErrorMessage, supportedFileMimes, supportedFileTypesLong, } from "../../supported-mimes.js";
8
+ import { getDefaultSpec } from "./get-default-spec.js";
9
+ const specializedModelSchema = z
10
+ .enum(["auto", ...pdfvectorModelSchema.options])
11
+ .default("auto");
12
+ const extractInputSchema = z.object({
13
+ url: fetchableUrlSchema
14
+ .optional()
15
+ .describe("URL of the identity document file to fetch and parse"),
16
+ file: z
17
+ .file()
18
+ .mime([...supportedFileMimes], supportedFileMimeErrorMessage)
19
+ .optional()
20
+ .describe(`Identity document file upload via multipart form-data (${supportedFileFormatsDescription})`),
21
+ base64: z
22
+ .string()
23
+ .optional()
24
+ .describe("Base64-encoded identity document file content"),
25
+ prompt: z
26
+ .string()
27
+ .min(4, "prompt must be at least 4 characters")
28
+ .describe("The prompt instructing the AI how to extract data from the identity document"),
29
+ schema: jsonSchemaInput.describe("JSON Schema describing the structure of the data to extract from the identity document. Can be a JSON object or a JSON string."),
30
+ model: specializedModelSchema.describe(specializedExtractModelDescription),
31
+ documentId: z
32
+ .string()
33
+ .trim()
34
+ .min(1)
35
+ .max(512)
36
+ .optional()
37
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
38
+ callback: z
39
+ .object({
40
+ url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
41
+ type: z
42
+ .string()
43
+ .optional()
44
+ .describe("Callback type identifier (e.g. 'zapier')"),
45
+ })
46
+ .optional()
47
+ .describe("Optional webhook callback for async processing. " +
48
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
49
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
50
+ "Useful for long-running operations that may exceed client timeout limits."),
51
+ });
52
+ const extractOutputSchema = z.object({
53
+ data: z
54
+ .unknown()
55
+ .refine((val) => val != null &&
56
+ (typeof val !== "object" || Object.keys(val).length > 0), { message: "Extracted data must not be empty" })
57
+ .describe("Extracted structured data matching the provided JSON Schema"),
58
+ pageCount: z.number().int().describe("Total number of pages in the document"),
59
+ model: pdfvectorModelSchema.describe(outputExtractModelDescription),
60
+ credits: z
61
+ .number()
62
+ .int()
63
+ .describe("Number of credits consumed by this API call. Cost per page: nano=6, mini=10, pro=14, max=18."),
64
+ requestId: z
65
+ .number()
66
+ .int()
67
+ .describe("Unique request identifier for this API call"),
68
+ documentId: z
69
+ .string()
70
+ .optional()
71
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
72
+ });
73
+ const requestExamples = {
74
+ "Extract from URL": {
75
+ summary: "Extract from URL",
76
+ value: {
77
+ url: "https://example.com/identity-document.pdf",
78
+ prompt: "Extract the name, date of birth, and document number",
79
+ schema: JSON.stringify({
80
+ type: "object",
81
+ properties: {
82
+ name: { type: "string" },
83
+ dateOfBirth: { type: "string" },
84
+ documentNumber: { type: "string" },
85
+ },
86
+ required: ["name", "dateOfBirth", "documentNumber"],
87
+ }),
88
+ },
89
+ },
90
+ };
91
+ export const extract = oc
92
+ .route({
93
+ summary: "Extract structured data from an identity document",
94
+ description: `Parse an identity document and extract structured data matching a provided JSON Schema using AI. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
95
+ tags: ["Identity"],
96
+ spec: (op) => {
97
+ const spec = getDefaultSpec(op, requestExamples);
98
+ spec["x-codeSamples"] = getOpenApiCodeSamples("identity-extract");
99
+ return spec;
100
+ },
101
+ })
102
+ .input(extractInputSchema)
103
+ .output(extractOutputSchema);
@@ -0,0 +1,2 @@
1
+ export declare function getDefaultSpec(op: Record<string, unknown>, requestExamples: Record<string, unknown>): Record<string, unknown>;
2
+ //# sourceMappingURL=get-default-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-default-spec.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/instance/router/identity/get-default-spec.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAC7B,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBzB"}
@@ -0,0 +1,19 @@
1
+ export function getDefaultSpec(op, requestExamples) {
2
+ op["security"] = [{ bearerAuth: [] }];
3
+ const params = (op["parameters"] ?? []);
4
+ params.push({
5
+ name: "x-pdfvector-document-id",
6
+ in: "header",
7
+ required: false,
8
+ schema: { type: "string", default: "my-doc-123" },
9
+ description: "Optional document ID to associate with this request. Returned in the response and saved for usage tracking.",
10
+ });
11
+ op["parameters"] = params;
12
+ const reqBody = op["requestBody"];
13
+ if (reqBody?.content) {
14
+ for (const mediaType of Object.values(reqBody.content)) {
15
+ mediaType["examples"] = requestExamples;
16
+ }
17
+ }
18
+ return op;
19
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./ask.js";
2
+ export * from "./extract.js";
3
+ export * from "./parse.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/instance/router/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./ask.js";
2
+ export * from "./extract.js";
3
+ export * from "./parse.js";
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ export declare const parse: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
3
+ url: z.ZodOptional<z.ZodURL>;
4
+ file: z.ZodOptional<z.ZodFile>;
5
+ base64: z.ZodOptional<z.ZodString>;
6
+ model: z.ZodDefault<z.ZodEnum<{
7
+ auto: "auto";
8
+ max: "max";
9
+ pro: "pro";
10
+ }>>;
11
+ documentId: z.ZodOptional<z.ZodString>;
12
+ callback: z.ZodOptional<z.ZodObject<{
13
+ url: z.ZodURL;
14
+ type: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>>;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ markdown: z.ZodString;
18
+ pageCount: z.ZodNumber;
19
+ model: z.ZodEnum<{
20
+ max: "max";
21
+ pro: "pro";
22
+ }>;
23
+ documentType: z.ZodOptional<z.ZodString>;
24
+ html: z.ZodOptional<z.ZodString>;
25
+ credits: z.ZodNumber;
26
+ requestId: z.ZodNumber;
27
+ documentId: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
29
+ //# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/instance/router/identity/parse.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4HxB,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;8DAYS,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { getOpenApiCodeSamples } from "@pdfvector/api-docs";
3
+ import { z } from "zod";
4
+ import { fetchableUrlSchema } from "../../fetchable-url-schema.js";
5
+ import { specializedParseModelDescription, supportedFileFormatsDescription, supportedFileMimeErrorMessage, supportedFileMimes, supportedFileTypesLong, } from "../../supported-mimes.js";
6
+ import { getDefaultSpec } from "./get-default-spec.js";
7
+ const specializedParseModelSchema = z
8
+ .enum(["pro", "max", "auto"], {
9
+ message: "model must be one of: pro, max, auto",
10
+ })
11
+ .default("auto");
12
+ const parseInputSchema = z.object({
13
+ url: fetchableUrlSchema
14
+ .optional()
15
+ .describe("URL of the identity document file to fetch and parse"),
16
+ file: z
17
+ .file()
18
+ .mime([...supportedFileMimes], supportedFileMimeErrorMessage)
19
+ .optional()
20
+ .describe(`Identity document file upload via multipart form-data (${supportedFileFormatsDescription})`),
21
+ base64: z
22
+ .string()
23
+ .optional()
24
+ .describe("Base64-encoded identity document file content"),
25
+ model: specializedParseModelSchema.describe(specializedParseModelDescription("identity document")),
26
+ documentId: z
27
+ .string()
28
+ .trim()
29
+ .min(1)
30
+ .max(512)
31
+ .optional()
32
+ .describe("Optional external document ID for usage attribution. The x-pdfvector-document-id header takes precedence when both are provided."),
33
+ callback: z
34
+ .object({
35
+ url: fetchableUrlSchema.describe("Webhook URL where results will be POSTed when processing completes"),
36
+ type: z
37
+ .string()
38
+ .optional()
39
+ .describe("Callback type identifier (e.g. 'zapier')"),
40
+ })
41
+ .optional()
42
+ .describe("Optional webhook callback for async processing. " +
43
+ "When provided, the server returns 202 immediately and POSTs the full response payload to the callback URL when processing completes. " +
44
+ "On error, the callback receives a POST with X-Pdfvector-Callback-Failed: true header and error details in the body. " +
45
+ "Useful for long-running operations that may exceed client timeout limits."),
46
+ });
47
+ const parseOutputSchema = z.object({
48
+ markdown: z
49
+ .string()
50
+ .describe("Extracted text content from the identity document"),
51
+ pageCount: z.number().int().describe("Total number of pages in the document"),
52
+ model: z
53
+ .enum(["pro", "max"])
54
+ .describe("Model tier used to parse the identity document"),
55
+ documentType: z
56
+ .string()
57
+ .optional()
58
+ .describe("Detected identity document type (e.g., passport, driver's license)"),
59
+ html: z
60
+ .string()
61
+ .optional()
62
+ .describe("Full HTML representation of the document content. Only available when using the 'max' model. " +
63
+ "Preserves rich formatting, tables, selection marks, and visual layout that cannot be fully represented in markdown."),
64
+ credits: z
65
+ .number()
66
+ .int()
67
+ .describe("Number of credits consumed by this API call. Cost per page: pro=6, max=10."),
68
+ requestId: z
69
+ .number()
70
+ .int()
71
+ .describe("Unique request identifier for this API call"),
72
+ documentId: z
73
+ .string()
74
+ .optional()
75
+ .describe("Document ID if provided via x-pdfvector-document-id header or request body"),
76
+ });
77
+ const requestExamples = {
78
+ "Parse from URL": {
79
+ summary: "Parse from URL",
80
+ value: {
81
+ url: "https://example.com/identity-document.pdf",
82
+ },
83
+ },
84
+ "Parse from base64": {
85
+ summary: "Parse from base64",
86
+ value: {
87
+ base64: "JVBERi0xLjAKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqIDIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbMyAwIFJdL0NvdW50IDE+PmVuZG9iaiAzIDAgb2JqPDwvVHlwZS9QYWdlL01lZGlhQm94WzAgMCAzIDNdL1BhcmVudCAyIDAgUj4+ZW5kb2JqCnhyZWYKMCA0CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAwOSAwMDAwMCBuIAowMDAwMDAwMDU4IDAwMDAwIG4gCjAwMDAwMDAxMTUgMDAwMDAgbiAKdHJhaWxlcjw8L1NpemUgNC9Sb290IDEgMCBSPj4Kc3RhcnR4cmVmCjE5MAolJUVPRg==",
88
+ },
89
+ },
90
+ "Parse from file upload": {
91
+ summary: "Parse from file upload",
92
+ value: {
93
+ file: "(binary)",
94
+ },
95
+ },
96
+ };
97
+ export const parse = oc
98
+ .route({
99
+ summary: "Parse an identity document",
100
+ description: `Extract text and structured data from an identity document. Supports ${supportedFileTypesLong}. Provide the document via file upload, a public URL, or a base64-encoded string.`,
101
+ tags: ["Identity"],
102
+ spec: (op) => {
103
+ const spec = getDefaultSpec(op, requestExamples);
104
+ spec["x-codeSamples"] = getOpenApiCodeSamples("identity-parse");
105
+ return spec;
106
+ },
107
+ })
108
+ .input(parseInputSchema)
109
+ .output(parseOutputSchema);
@@ -0,0 +1,9 @@
1
+ export * as academic from "./academic/index.js";
2
+ export * as admin from "./admin/index.js";
3
+ export * as authenticate from "./authenticate/index.js";
4
+ export * as bankStatement from "./bankStatement/index.js";
5
+ export * as document from "./document/index.js";
6
+ export * as free from "./free/index.js";
7
+ export * as identity from "./identity/index.js";
8
+ export * as invoice from "./invoice/index.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/instance/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * as academic from "./academic/index.js";
2
+ export * as admin from "./admin/index.js";
3
+ export * as authenticate from "./authenticate/index.js";
4
+ export * as bankStatement from "./bankStatement/index.js";
5
+ export * as document from "./document/index.js";
6
+ export * as free from "./free/index.js";
7
+ export * as identity from "./identity/index.js";
8
+ export * as invoice from "./invoice/index.js";