@mixedbread/sdk 0.1.0-alpha.8

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 (277) hide show
  1. package/CHANGELOG.md +210 -0
  2. package/LICENSE +201 -0
  3. package/README.md +360 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +89 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +241 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +914 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +882 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +47 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +113 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +97 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +148 -0
  87. package/index.d.ts +148 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +151 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +108 -0
  92. package/index.mjs.map +1 -0
  93. package/lib/polling.d.ts +48 -0
  94. package/lib/polling.d.ts.map +1 -0
  95. package/lib/polling.js +75 -0
  96. package/lib/polling.js.map +1 -0
  97. package/lib/polling.mjs +71 -0
  98. package/lib/polling.mjs.map +1 -0
  99. package/package.json +124 -0
  100. package/pagination.d.ts +30 -0
  101. package/pagination.d.ts.map +1 -0
  102. package/pagination.js +45 -0
  103. package/pagination.js.map +1 -0
  104. package/pagination.mjs +41 -0
  105. package/pagination.mjs.map +1 -0
  106. package/resource.d.ts +6 -0
  107. package/resource.d.ts.map +1 -0
  108. package/resource.js +11 -0
  109. package/resource.js.map +1 -0
  110. package/resource.mjs +7 -0
  111. package/resource.mjs.map +1 -0
  112. package/resources/extractions/content.d.ts +35 -0
  113. package/resources/extractions/content.d.ts.map +1 -0
  114. package/resources/extractions/content.js +19 -0
  115. package/resources/extractions/content.js.map +1 -0
  116. package/resources/extractions/content.mjs +15 -0
  117. package/resources/extractions/content.mjs.map +1 -0
  118. package/resources/extractions/extractions.d.ts +18 -0
  119. package/resources/extractions/extractions.d.ts.map +1 -0
  120. package/resources/extractions/extractions.js +47 -0
  121. package/resources/extractions/extractions.js.map +1 -0
  122. package/resources/extractions/extractions.mjs +20 -0
  123. package/resources/extractions/extractions.mjs.map +1 -0
  124. package/resources/extractions/index.d.ts +5 -0
  125. package/resources/extractions/index.d.ts.map +1 -0
  126. package/resources/extractions/index.js +13 -0
  127. package/resources/extractions/index.js.map +1 -0
  128. package/resources/extractions/index.mjs +6 -0
  129. package/resources/extractions/index.mjs.map +1 -0
  130. package/resources/extractions/jobs.d.ts +44 -0
  131. package/resources/extractions/jobs.d.ts.map +1 -0
  132. package/resources/extractions/jobs.js +29 -0
  133. package/resources/extractions/jobs.js.map +1 -0
  134. package/resources/extractions/jobs.mjs +25 -0
  135. package/resources/extractions/jobs.mjs.map +1 -0
  136. package/resources/extractions/schema.d.ts +85 -0
  137. package/resources/extractions/schema.d.ts.map +1 -0
  138. package/resources/extractions/schema.js +39 -0
  139. package/resources/extractions/schema.js.map +1 -0
  140. package/resources/extractions/schema.mjs +35 -0
  141. package/resources/extractions/schema.mjs.map +1 -0
  142. package/resources/files.d.ts +125 -0
  143. package/resources/files.d.ts.map +1 -0
  144. package/resources/files.js +99 -0
  145. package/resources/files.js.map +1 -0
  146. package/resources/files.mjs +71 -0
  147. package/resources/files.mjs.map +1 -0
  148. package/resources/index.d.ts +7 -0
  149. package/resources/index.d.ts.map +1 -0
  150. package/resources/index.js +30 -0
  151. package/resources/index.js.map +1 -0
  152. package/resources/index.mjs +7 -0
  153. package/resources/index.mjs.map +1 -0
  154. package/resources/parsing/index.d.ts +3 -0
  155. package/resources/parsing/index.d.ts.map +1 -0
  156. package/resources/parsing/index.js +10 -0
  157. package/resources/parsing/index.js.map +1 -0
  158. package/resources/parsing/index.mjs +4 -0
  159. package/resources/parsing/index.mjs.map +1 -0
  160. package/resources/parsing/jobs.d.ts +278 -0
  161. package/resources/parsing/jobs.d.ts.map +1 -0
  162. package/resources/parsing/jobs.js +147 -0
  163. package/resources/parsing/jobs.js.map +1 -0
  164. package/resources/parsing/jobs.mjs +119 -0
  165. package/resources/parsing/jobs.mjs.map +1 -0
  166. package/resources/parsing/parsing.d.ts +10 -0
  167. package/resources/parsing/parsing.d.ts.map +1 -0
  168. package/resources/parsing/parsing.js +40 -0
  169. package/resources/parsing/parsing.js.map +1 -0
  170. package/resources/parsing/parsing.mjs +13 -0
  171. package/resources/parsing/parsing.mjs.map +1 -0
  172. package/resources/shared.d.ts +35 -0
  173. package/resources/shared.d.ts.map +1 -0
  174. package/resources/shared.js +4 -0
  175. package/resources/shared.js.map +1 -0
  176. package/resources/shared.mjs +3 -0
  177. package/resources/shared.mjs.map +1 -0
  178. package/resources/top-level.d.ts +11 -0
  179. package/resources/top-level.d.ts.map +1 -0
  180. package/resources/top-level.js +4 -0
  181. package/resources/top-level.js.map +1 -0
  182. package/resources/top-level.mjs +3 -0
  183. package/resources/top-level.mjs.map +1 -0
  184. package/resources/vector-stores/files.d.ts +280 -0
  185. package/resources/vector-stores/files.d.ts.map +1 -0
  186. package/resources/vector-stores/files.js +167 -0
  187. package/resources/vector-stores/files.js.map +1 -0
  188. package/resources/vector-stores/files.mjs +139 -0
  189. package/resources/vector-stores/files.mjs.map +1 -0
  190. package/resources/vector-stores/index.d.ts +3 -0
  191. package/resources/vector-stores/index.d.ts.map +1 -0
  192. package/resources/vector-stores/index.js +11 -0
  193. package/resources/vector-stores/index.js.map +1 -0
  194. package/resources/vector-stores/index.mjs +4 -0
  195. package/resources/vector-stores/index.mjs.map +1 -0
  196. package/resources/vector-stores/vector-stores.d.ts +400 -0
  197. package/resources/vector-stores/vector-stores.d.ts.map +1 -0
  198. package/resources/vector-stores/vector-stores.js +121 -0
  199. package/resources/vector-stores/vector-stores.js.map +1 -0
  200. package/resources/vector-stores/vector-stores.mjs +93 -0
  201. package/resources/vector-stores/vector-stores.mjs.map +1 -0
  202. package/shims/node.d.ts +30 -0
  203. package/shims/node.d.ts.map +1 -0
  204. package/shims/node.js +31 -0
  205. package/shims/node.js.map +1 -0
  206. package/shims/node.mjs +5 -0
  207. package/shims/node.mjs.map +1 -0
  208. package/shims/web.d.ts +26 -0
  209. package/shims/web.d.ts.map +1 -0
  210. package/shims/web.js +31 -0
  211. package/shims/web.js.map +1 -0
  212. package/shims/web.mjs +5 -0
  213. package/shims/web.mjs.map +1 -0
  214. package/src/_shims/MultipartBody.ts +9 -0
  215. package/src/_shims/README.md +46 -0
  216. package/src/_shims/auto/runtime-bun.ts +4 -0
  217. package/src/_shims/auto/runtime-node.ts +4 -0
  218. package/src/_shims/auto/runtime.ts +4 -0
  219. package/src/_shims/auto/types-node.ts +4 -0
  220. package/src/_shims/auto/types.d.ts +101 -0
  221. package/src/_shims/auto/types.js +3 -0
  222. package/src/_shims/auto/types.mjs +3 -0
  223. package/src/_shims/bun-runtime.ts +14 -0
  224. package/src/_shims/index.d.ts +81 -0
  225. package/src/_shims/index.js +13 -0
  226. package/src/_shims/index.mjs +7 -0
  227. package/src/_shims/manual-types.d.ts +12 -0
  228. package/src/_shims/manual-types.js +3 -0
  229. package/src/_shims/manual-types.mjs +3 -0
  230. package/src/_shims/node-runtime.ts +81 -0
  231. package/src/_shims/node-types.d.ts +42 -0
  232. package/src/_shims/node-types.js +3 -0
  233. package/src/_shims/node-types.mjs +3 -0
  234. package/src/_shims/registry.ts +67 -0
  235. package/src/_shims/web-runtime.ts +103 -0
  236. package/src/_shims/web-types.d.ts +83 -0
  237. package/src/_shims/web-types.js +3 -0
  238. package/src/_shims/web-types.mjs +3 -0
  239. package/src/core.ts +1208 -0
  240. package/src/error.ts +130 -0
  241. package/src/index.ts +294 -0
  242. package/src/lib/.keep +4 -0
  243. package/src/lib/polling.ts +115 -0
  244. package/src/pagination.ts +82 -0
  245. package/src/resource.ts +11 -0
  246. package/src/resources/extractions/content.ts +43 -0
  247. package/src/resources/extractions/extractions.ts +47 -0
  248. package/src/resources/extractions/index.ts +14 -0
  249. package/src/resources/extractions/jobs.ts +55 -0
  250. package/src/resources/extractions/schema.ts +111 -0
  251. package/src/resources/files.ts +181 -0
  252. package/src/resources/index.ts +32 -0
  253. package/src/resources/parsing/index.ts +12 -0
  254. package/src/resources/parsing/jobs.ts +438 -0
  255. package/src/resources/parsing/parsing.ts +32 -0
  256. package/src/resources/shared.ts +41 -0
  257. package/src/resources/top-level.ts +14 -0
  258. package/src/resources/vector-stores/files.ts +434 -0
  259. package/src/resources/vector-stores/index.ts +30 -0
  260. package/src/resources/vector-stores/vector-stores.ts +561 -0
  261. package/src/shims/node.ts +50 -0
  262. package/src/shims/web.ts +50 -0
  263. package/src/tsconfig.json +11 -0
  264. package/src/uploads.ts +255 -0
  265. package/src/version.ts +1 -0
  266. package/uploads.d.ts +75 -0
  267. package/uploads.d.ts.map +1 -0
  268. package/uploads.js +171 -0
  269. package/uploads.js.map +1 -0
  270. package/uploads.mjs +158 -0
  271. package/uploads.mjs.map +1 -0
  272. package/version.d.ts +2 -0
  273. package/version.d.ts.map +1 -0
  274. package/version.js +5 -0
  275. package/version.js.map +1 -0
  276. package/version.mjs +2 -0
  277. package/version.mjs.map +1 -0
package/pagination.js ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.LimitOffset = void 0;
5
+ const core_1 = require("./core.js");
6
+ class LimitOffset extends core_1.AbstractPage {
7
+ constructor(client, response, body, options) {
8
+ super(client, response, body, options);
9
+ this.data = body.data || [];
10
+ this.pagination = body.pagination || {};
11
+ }
12
+ getPaginatedItems() {
13
+ return this.data ?? [];
14
+ }
15
+ // @deprecated Please use `nextPageInfo()` instead
16
+ nextPageParams() {
17
+ const info = this.nextPageInfo();
18
+ if (!info)
19
+ return null;
20
+ if ('params' in info)
21
+ return info.params;
22
+ const params = Object.fromEntries(info.url.searchParams);
23
+ if (!Object.keys(params).length)
24
+ return null;
25
+ return params;
26
+ }
27
+ nextPageInfo() {
28
+ const offset = this.pagination?.offset;
29
+ if (!offset) {
30
+ return null;
31
+ }
32
+ const length = this.getPaginatedItems().length;
33
+ const currentCount = offset + length;
34
+ const totalCount = this.pagination?.total;
35
+ if (!totalCount) {
36
+ return null;
37
+ }
38
+ if (currentCount < totalCount) {
39
+ return { params: { offset: currentCount } };
40
+ }
41
+ return null;
42
+ }
43
+ }
44
+ exports.LimitOffset = LimitOffset;
45
+ //# sourceMappingURL=pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.js","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAA0F;AA4B1F,MAAa,WAAkB,SAAQ,mBAAkB;IAKvD,YACE,MAAiB,EACjB,QAAkB,EAClB,IAA+B,EAC/B,OAA4B;QAE5B,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAEvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;IAC1C,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,kDAAkD;IAClD,cAAc;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,IAAI,QAAQ,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,YAAY;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,IAAI,CAAC;SACb;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,MAAM,CAAC;QAC/C,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;QAErC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,IAAI,CAAC;SACb;QAED,IAAI,YAAY,GAAG,UAAU,EAAE;YAC7B,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC;SAC7C;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAnDD,kCAmDC"}
package/pagination.mjs ADDED
@@ -0,0 +1,41 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { AbstractPage } from "./core.mjs";
3
+ export class LimitOffset extends AbstractPage {
4
+ constructor(client, response, body, options) {
5
+ super(client, response, body, options);
6
+ this.data = body.data || [];
7
+ this.pagination = body.pagination || {};
8
+ }
9
+ getPaginatedItems() {
10
+ return this.data ?? [];
11
+ }
12
+ // @deprecated Please use `nextPageInfo()` instead
13
+ nextPageParams() {
14
+ const info = this.nextPageInfo();
15
+ if (!info)
16
+ return null;
17
+ if ('params' in info)
18
+ return info.params;
19
+ const params = Object.fromEntries(info.url.searchParams);
20
+ if (!Object.keys(params).length)
21
+ return null;
22
+ return params;
23
+ }
24
+ nextPageInfo() {
25
+ const offset = this.pagination?.offset;
26
+ if (!offset) {
27
+ return null;
28
+ }
29
+ const length = this.getPaginatedItems().length;
30
+ const currentCount = offset + length;
31
+ const totalCount = this.pagination?.total;
32
+ if (!totalCount) {
33
+ return null;
34
+ }
35
+ if (currentCount < totalCount) {
36
+ return { params: { offset: currentCount } };
37
+ }
38
+ return null;
39
+ }
40
+ }
41
+ //# sourceMappingURL=pagination.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.mjs","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,YAAY,EAAsD;AA4B3E,MAAM,OAAO,WAAkB,SAAQ,YAAkB;IAKvD,YACE,MAAiB,EACjB,QAAkB,EAClB,IAA+B,EAC/B,OAA4B;QAE5B,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAEvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;IAC1C,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,kDAAkD;IAClD,cAAc;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,IAAI,QAAQ,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,YAAY;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,IAAI,CAAC;SACb;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,MAAM,CAAC;QAC/C,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;QAErC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,IAAI,CAAC;SACb;QAED,IAAI,YAAY,GAAG,UAAU,EAAE;YAC7B,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC;SAC7C;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
package/resource.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import type { Mixedbread } from "./index.js";
2
+ export declare class APIResource {
3
+ protected _client: Mixedbread;
4
+ constructor(client: Mixedbread);
5
+ }
6
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,WAAW;IACtB,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC;gBAElB,MAAM,EAAE,UAAU;CAG/B"}
package/resource.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.APIResource = void 0;
5
+ class APIResource {
6
+ constructor(client) {
7
+ this._client = client;
8
+ }
9
+ }
10
+ exports.APIResource = APIResource;
11
+ //# sourceMappingURL=resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAItF,MAAa,WAAW;IAGtB,YAAY,MAAkB;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF;AAND,kCAMC"}
package/resource.mjs ADDED
@@ -0,0 +1,7 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export class APIResource {
3
+ constructor(client) {
4
+ this._client = client;
5
+ }
6
+ }
7
+ //# sourceMappingURL=resource.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,MAAM,OAAO,WAAW;IAGtB,YAAY,MAAkB;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,35 @@
1
+ import { APIResource } from "../../resource.js";
2
+ import * as Core from "../../core.js";
3
+ export declare class Content extends APIResource {
4
+ /**
5
+ * Extract content from a string using the provided schema.
6
+ *
7
+ * Args: params: The parameters for extracting content from a string.
8
+ *
9
+ * Returns: The extracted content.
10
+ */
11
+ create(body: ContentCreateParams, options?: Core.RequestOptions): Core.APIPromise<ExtractionResult>;
12
+ }
13
+ /**
14
+ * Result of an extraction operation.
15
+ */
16
+ export interface ExtractionResult {
17
+ /**
18
+ * The extracted data
19
+ */
20
+ data: unknown;
21
+ }
22
+ export interface ContentCreateParams {
23
+ /**
24
+ * The content to extract from
25
+ */
26
+ content: string;
27
+ /**
28
+ * The JSON schema to use for extraction
29
+ */
30
+ json_schema: unknown;
31
+ }
32
+ export declare namespace Content {
33
+ export { type ExtractionResult as ExtractionResult, type ContentCreateParams as ContentCreateParams };
34
+ }
35
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/resources/extractions/content.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;CAGpG;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CACvG"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Content = void 0;
5
+ const resource_1 = require("../../resource.js");
6
+ class Content extends resource_1.APIResource {
7
+ /**
8
+ * Extract content from a string using the provided schema.
9
+ *
10
+ * Args: params: The parameters for extracting content from a string.
11
+ *
12
+ * Returns: The extracted content.
13
+ */
14
+ create(body, options) {
15
+ return this._client.post('/v1/extractions/content', { body, ...options });
16
+ }
17
+ }
18
+ exports.Content = Content;
19
+ //# sourceMappingURL=content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/resources/extractions/content.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;OAMG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF;AAXD,0BAWC"}
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../resource.mjs";
3
+ export class Content extends APIResource {
4
+ /**
5
+ * Extract content from a string using the provided schema.
6
+ *
7
+ * Args: params: The parameters for extracting content from a string.
8
+ *
9
+ * Returns: The extracted content.
10
+ */
11
+ create(body, options) {
12
+ return this._client.post('/v1/extractions/content', { body, ...options });
13
+ }
14
+ }
15
+ //# sourceMappingURL=content.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.mjs","sourceRoot":"","sources":["../../src/resources/extractions/content.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;OAMG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ import { APIResource } from "../../resource.js";
2
+ import * as ContentAPI from "./content.js";
3
+ import { Content, ContentCreateParams, ExtractionResult } from "./content.js";
4
+ import * as JobsAPI from "./jobs.js";
5
+ import { ExtractionJob, JobCreateParams, Jobs } from "./jobs.js";
6
+ import * as SchemaAPI from "./schema.js";
7
+ import { CreatedJsonSchema, EnhancedJsonSchema, Schema, SchemaCreateParams, SchemaEnhanceParams, SchemaValidateParams, ValidatedJsonSchema } from "./schema.js";
8
+ export declare class Extractions extends APIResource {
9
+ jobs: JobsAPI.Jobs;
10
+ schema: SchemaAPI.Schema;
11
+ content: ContentAPI.Content;
12
+ }
13
+ export declare namespace Extractions {
14
+ export { Jobs as Jobs, type ExtractionJob as ExtractionJob, type JobCreateParams as JobCreateParams };
15
+ export { Schema as Schema, type CreatedJsonSchema as CreatedJsonSchema, type EnhancedJsonSchema as EnhancedJsonSchema, type ValidatedJsonSchema as ValidatedJsonSchema, type SchemaCreateParams as SchemaCreateParams, type SchemaEnhanceParams as SchemaEnhanceParams, type SchemaValidateParams as SchemaValidateParams, };
16
+ export { Content as Content, type ExtractionResult as ExtractionResult, type ContentCreateParams as ContentCreateParams, };
17
+ }
18
+ //# sourceMappingURL=extractions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractions.d.ts","sourceRoot":"","sources":["../../src/resources/extractions/extractions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO,KAAK,OAAO,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,EACN,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,qBAAa,WAAY,SAAQ,WAAW;IAC1C,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;IACpD,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAC9D,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;CACpE;AAMD,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,aAAa,IAAI,aAAa,EAAE,KAAK,eAAe,IAAI,eAAe,EAAE,CAAC;IAEtG,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.Extractions = void 0;
28
+ const resource_1 = require("../../resource.js");
29
+ const ContentAPI = __importStar(require("./content.js"));
30
+ const content_1 = require("./content.js");
31
+ const JobsAPI = __importStar(require("./jobs.js"));
32
+ const jobs_1 = require("./jobs.js");
33
+ const SchemaAPI = __importStar(require("./schema.js"));
34
+ const schema_1 = require("./schema.js");
35
+ class Extractions extends resource_1.APIResource {
36
+ constructor() {
37
+ super(...arguments);
38
+ this.jobs = new JobsAPI.Jobs(this._client);
39
+ this.schema = new SchemaAPI.Schema(this._client);
40
+ this.content = new ContentAPI.Content(this._client);
41
+ }
42
+ }
43
+ exports.Extractions = Extractions;
44
+ Extractions.Jobs = jobs_1.Jobs;
45
+ Extractions.Schema = schema_1.Schema;
46
+ Extractions.Content = content_1.Content;
47
+ //# sourceMappingURL=extractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractions.js","sourceRoot":"","sources":["../../src/resources/extractions/extractions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,yDAAwC;AACxC,0CAA2E;AAC3E,mDAAkC;AAClC,oCAA8D;AAC9D,uDAAsC;AACtC,wCAQkB;AAElB,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAJD,kCAIC;AAED,WAAW,CAAC,IAAI,GAAG,WAAI,CAAC;AACxB,WAAW,CAAC,MAAM,GAAG,eAAM,CAAC;AAC5B,WAAW,CAAC,OAAO,GAAG,iBAAO,CAAC"}
@@ -0,0 +1,20 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../resource.mjs";
3
+ import * as ContentAPI from "./content.mjs";
4
+ import { Content } from "./content.mjs";
5
+ import * as JobsAPI from "./jobs.mjs";
6
+ import { Jobs } from "./jobs.mjs";
7
+ import * as SchemaAPI from "./schema.mjs";
8
+ import { Schema, } from "./schema.mjs";
9
+ export class Extractions extends APIResource {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.jobs = new JobsAPI.Jobs(this._client);
13
+ this.schema = new SchemaAPI.Schema(this._client);
14
+ this.content = new ContentAPI.Content(this._client);
15
+ }
16
+ }
17
+ Extractions.Jobs = Jobs;
18
+ Extractions.Schema = Schema;
19
+ Extractions.Content = Content;
20
+ //# sourceMappingURL=extractions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractions.mjs","sourceRoot":"","sources":["../../src/resources/extractions/extractions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAAE,OAAO,EAAyC;OAClD,KAAK,OAAO;OACZ,EAAkC,IAAI,EAAE;OACxC,KAAK,SAAS;OACd,EAGL,MAAM,GAKP;AAED,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;CAAA;AAED,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;AACxB,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC;AAC5B,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { Content, type ExtractionResult, type ContentCreateParams } from "./content.js";
2
+ export { Extractions } from "./extractions.js";
3
+ export { Jobs, type ExtractionJob, type JobCreateParams } from "./jobs.js";
4
+ export { Schema, type CreatedJsonSchema, type EnhancedJsonSchema, type ValidatedJsonSchema, type SchemaCreateParams, type SchemaEnhanceParams, type SchemaValidateParams, } from "./schema.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/extractions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AACxE,OAAO,EACL,MAAM,EACN,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,UAAU,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Schema = exports.Jobs = exports.Extractions = exports.Content = void 0;
5
+ var content_1 = require("./content.js");
6
+ Object.defineProperty(exports, "Content", { enumerable: true, get: function () { return content_1.Content; } });
7
+ var extractions_1 = require("./extractions.js");
8
+ Object.defineProperty(exports, "Extractions", { enumerable: true, get: function () { return extractions_1.Extractions; } });
9
+ var jobs_1 = require("./jobs.js");
10
+ Object.defineProperty(exports, "Jobs", { enumerable: true, get: function () { return jobs_1.Jobs; } });
11
+ var schema_1 = require("./schema.js");
12
+ Object.defineProperty(exports, "Schema", { enumerable: true, get: function () { return schema_1.Schema; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/extractions/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAAqF;AAA5E,kGAAA,OAAO,OAAA;AAChB,gDAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,kCAAwE;AAA/D,4FAAA,IAAI,OAAA;AACb,sCAQkB;AAPhB,gGAAA,MAAM,OAAA"}
@@ -0,0 +1,6 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Content } from "./content.mjs";
3
+ export { Extractions } from "./extractions.mjs";
4
+ export { Jobs } from "./jobs.mjs";
5
+ export { Schema, } from "./schema.mjs";
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/extractions/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,OAAO,EAAmD;OAC5D,EAAE,WAAW,EAAE;OACf,EAAE,IAAI,EAA4C;OAClD,EACL,MAAM,GAOP"}
@@ -0,0 +1,44 @@
1
+ import { APIResource } from "../../resource.js";
2
+ import * as Core from "../../core.js";
3
+ import * as ContentAPI from "./content.js";
4
+ export declare class Jobs extends APIResource {
5
+ /**
6
+ * Start an extraction job for the provided file and schema.
7
+ *
8
+ * Args: params: The parameters for creating an extraction job.
9
+ *
10
+ * Returns: The created extraction job.
11
+ */
12
+ create(body: JobCreateParams, options?: Core.RequestOptions): Core.APIPromise<ExtractionJob>;
13
+ /**
14
+ * Get detailed information about a specific extraction job.
15
+ *
16
+ * Args: job_id: The ID of the extraction job.
17
+ *
18
+ * Returns: Detailed information about the extraction job.
19
+ */
20
+ retrieve(jobId: string, options?: Core.RequestOptions): Core.APIPromise<ExtractionJob>;
21
+ }
22
+ /**
23
+ * A job for extracting structured data from documents.
24
+ */
25
+ export interface ExtractionJob {
26
+ /**
27
+ * Result of an extraction operation.
28
+ */
29
+ result: ContentAPI.ExtractionResult | null;
30
+ }
31
+ export interface JobCreateParams {
32
+ /**
33
+ * The ID of the file to extract from
34
+ */
35
+ file_id: string;
36
+ /**
37
+ * The JSON schema to use for extraction
38
+ */
39
+ json_schema: unknown;
40
+ }
41
+ export declare namespace Jobs {
42
+ export { type ExtractionJob as ExtractionJob, type JobCreateParams as JobCreateParams };
43
+ }
44
+ //# sourceMappingURL=jobs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../src/resources/extractions/jobs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,WAAW,CAAC;AAExC,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;IAI5F;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;CAGvF;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC,gBAAgB,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EAAE,KAAK,aAAa,IAAI,aAAa,EAAE,KAAK,eAAe,IAAI,eAAe,EAAE,CAAC;CACzF"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Jobs = void 0;
5
+ const resource_1 = require("../../resource.js");
6
+ class Jobs extends resource_1.APIResource {
7
+ /**
8
+ * Start an extraction job for the provided file and schema.
9
+ *
10
+ * Args: params: The parameters for creating an extraction job.
11
+ *
12
+ * Returns: The created extraction job.
13
+ */
14
+ create(body, options) {
15
+ return this._client.post('/v1/extractions/jobs', { body, ...options });
16
+ }
17
+ /**
18
+ * Get detailed information about a specific extraction job.
19
+ *
20
+ * Args: job_id: The ID of the extraction job.
21
+ *
22
+ * Returns: Detailed information about the extraction job.
23
+ */
24
+ retrieve(jobId, options) {
25
+ return this._client.get(`/v1/extractions/jobs/${jobId}`, options);
26
+ }
27
+ }
28
+ exports.Jobs = Jobs;
29
+ //# sourceMappingURL=jobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/resources/extractions/jobs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAI7C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;OAMG;IACH,MAAM,CAAC,IAAqB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,KAAa,EAAE,OAA6B;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF;AAtBD,oBAsBC"}
@@ -0,0 +1,25 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../resource.mjs";
3
+ export class Jobs extends APIResource {
4
+ /**
5
+ * Start an extraction job for the provided file and schema.
6
+ *
7
+ * Args: params: The parameters for creating an extraction job.
8
+ *
9
+ * Returns: The created extraction job.
10
+ */
11
+ create(body, options) {
12
+ return this._client.post('/v1/extractions/jobs', { body, ...options });
13
+ }
14
+ /**
15
+ * Get detailed information about a specific extraction job.
16
+ *
17
+ * Args: job_id: The ID of the extraction job.
18
+ *
19
+ * Returns: Detailed information about the extraction job.
20
+ */
21
+ retrieve(jobId, options) {
22
+ return this._client.get(`/v1/extractions/jobs/${jobId}`, options);
23
+ }
24
+ }
25
+ //# sourceMappingURL=jobs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.mjs","sourceRoot":"","sources":["../../src/resources/extractions/jobs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;OAMG;IACH,MAAM,CAAC,IAAqB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,KAAa,EAAE,OAA6B;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF"}
@@ -0,0 +1,85 @@
1
+ import { APIResource } from "../../resource.js";
2
+ import * as Core from "../../core.js";
3
+ export declare class Schema extends APIResource {
4
+ /**
5
+ * Create a schema with the provided parameters.
6
+ *
7
+ * Args: params: The parameters for creating a schema.
8
+ *
9
+ * Returns: The created schema.
10
+ */
11
+ create(body: SchemaCreateParams, options?: Core.RequestOptions): Core.APIPromise<CreatedJsonSchema>;
12
+ /**
13
+ * Enhance a schema by enriching the descriptions to aid extraction.
14
+ *
15
+ * Args: params: The parameters for enhancing a schema.
16
+ *
17
+ * Returns: The enhanced schema.
18
+ */
19
+ enhance(body: SchemaEnhanceParams, options?: Core.RequestOptions): Core.APIPromise<EnhancedJsonSchema>;
20
+ /**
21
+ * Validate a schema.
22
+ *
23
+ * Args: params: The parameters for validating a schema.
24
+ *
25
+ * Returns: The validation result.
26
+ */
27
+ validate(body: SchemaValidateParams, options?: Core.RequestOptions): Core.APIPromise<ValidatedJsonSchema>;
28
+ }
29
+ /**
30
+ * Result of creating a JSON schema.
31
+ */
32
+ export interface CreatedJsonSchema {
33
+ /**
34
+ * The created JSON schema
35
+ */
36
+ json_schema: unknown;
37
+ }
38
+ /**
39
+ * Result of enhancing a JSON schema.
40
+ */
41
+ export interface EnhancedJsonSchema {
42
+ /**
43
+ * The enhanced JSON schema
44
+ */
45
+ json_schema: unknown;
46
+ }
47
+ /**
48
+ * Result of validating a JSON schema.
49
+ */
50
+ export interface ValidatedJsonSchema {
51
+ /**
52
+ * Whether the schema is valid
53
+ */
54
+ is_valid: boolean;
55
+ /**
56
+ * List of validation errors
57
+ */
58
+ errors: Array<string>;
59
+ /**
60
+ * The validated JSON schema
61
+ */
62
+ json_schema: unknown;
63
+ }
64
+ export interface SchemaCreateParams {
65
+ /**
66
+ * Description of the data to extract
67
+ */
68
+ description: string;
69
+ }
70
+ export interface SchemaEnhanceParams {
71
+ /**
72
+ * The JSON schema to enhance
73
+ */
74
+ json_schema: unknown;
75
+ }
76
+ export interface SchemaValidateParams {
77
+ /**
78
+ * The JSON schema to validate
79
+ */
80
+ json_schema: unknown;
81
+ }
82
+ export declare namespace Schema {
83
+ export { type CreatedJsonSchema as CreatedJsonSchema, type EnhancedJsonSchema as EnhancedJsonSchema, type ValidatedJsonSchema as ValidatedJsonSchema, type SchemaCreateParams as SchemaCreateParams, type SchemaEnhanceParams as SchemaEnhanceParams, type SchemaValidateParams as SchemaValidateParams, };
84
+ }
85
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/resources/extractions/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;IAInG;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAItG;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;CAG1G;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEtB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Schema = void 0;
5
+ const resource_1 = require("../../resource.js");
6
+ class Schema extends resource_1.APIResource {
7
+ /**
8
+ * Create a schema with the provided parameters.
9
+ *
10
+ * Args: params: The parameters for creating a schema.
11
+ *
12
+ * Returns: The created schema.
13
+ */
14
+ create(body, options) {
15
+ return this._client.post('/v1/extractions/schema', { body, ...options });
16
+ }
17
+ /**
18
+ * Enhance a schema by enriching the descriptions to aid extraction.
19
+ *
20
+ * Args: params: The parameters for enhancing a schema.
21
+ *
22
+ * Returns: The enhanced schema.
23
+ */
24
+ enhance(body, options) {
25
+ return this._client.post('/v1/extractions/schema/enhance', { body, ...options });
26
+ }
27
+ /**
28
+ * Validate a schema.
29
+ *
30
+ * Args: params: The parameters for validating a schema.
31
+ *
32
+ * Returns: The validation result.
33
+ */
34
+ validate(body, options) {
35
+ return this._client.post('/v1/extractions/schema/validate', { body, ...options });
36
+ }
37
+ }
38
+ exports.Schema = Schema;
39
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/resources/extractions/schema.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;OAMG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,IAAyB,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,IAA0B,EAAE,OAA6B;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;CACF;AAjCD,wBAiCC"}