@mixedbread/sdk 0.1.0-alpha.10

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 (284) hide show
  1. package/CHANGELOG.md +230 -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 +915 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +883 -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 +169 -0
  87. package/index.d.ts +169 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +175 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +132 -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/embeddings.d.ts +177 -0
  113. package/resources/embeddings.d.ts.map +1 -0
  114. package/resources/embeddings.js +20 -0
  115. package/resources/embeddings.js.map +1 -0
  116. package/resources/embeddings.mjs +16 -0
  117. package/resources/embeddings.mjs.map +1 -0
  118. package/resources/extractions/content.d.ts +33 -0
  119. package/resources/extractions/content.d.ts.map +1 -0
  120. package/resources/extractions/content.js +19 -0
  121. package/resources/extractions/content.js.map +1 -0
  122. package/resources/extractions/content.mjs +15 -0
  123. package/resources/extractions/content.mjs.map +1 -0
  124. package/resources/extractions/extractions.d.ts +18 -0
  125. package/resources/extractions/extractions.d.ts.map +1 -0
  126. package/resources/extractions/extractions.js +47 -0
  127. package/resources/extractions/extractions.js.map +1 -0
  128. package/resources/extractions/extractions.mjs +20 -0
  129. package/resources/extractions/extractions.mjs.map +1 -0
  130. package/resources/extractions/index.d.ts +5 -0
  131. package/resources/extractions/index.d.ts.map +1 -0
  132. package/resources/extractions/index.js +13 -0
  133. package/resources/extractions/index.js.map +1 -0
  134. package/resources/extractions/index.mjs +6 -0
  135. package/resources/extractions/index.mjs.map +1 -0
  136. package/resources/extractions/jobs.d.ts +84 -0
  137. package/resources/extractions/jobs.d.ts.map +1 -0
  138. package/resources/extractions/jobs.js +29 -0
  139. package/resources/extractions/jobs.js.map +1 -0
  140. package/resources/extractions/jobs.mjs +25 -0
  141. package/resources/extractions/jobs.mjs.map +1 -0
  142. package/resources/extractions/schema.d.ts +85 -0
  143. package/resources/extractions/schema.d.ts.map +1 -0
  144. package/resources/extractions/schema.js +39 -0
  145. package/resources/extractions/schema.js.map +1 -0
  146. package/resources/extractions/schema.mjs +35 -0
  147. package/resources/extractions/schema.mjs.map +1 -0
  148. package/resources/files.d.ts +125 -0
  149. package/resources/files.d.ts.map +1 -0
  150. package/resources/files.js +99 -0
  151. package/resources/files.js.map +1 -0
  152. package/resources/files.mjs +71 -0
  153. package/resources/files.mjs.map +1 -0
  154. package/resources/index.d.ts +8 -0
  155. package/resources/index.d.ts.map +1 -0
  156. package/resources/index.js +32 -0
  157. package/resources/index.js.map +1 -0
  158. package/resources/index.mjs +8 -0
  159. package/resources/index.mjs.map +1 -0
  160. package/resources/parsing/index.d.ts +3 -0
  161. package/resources/parsing/index.d.ts.map +1 -0
  162. package/resources/parsing/index.js +10 -0
  163. package/resources/parsing/index.js.map +1 -0
  164. package/resources/parsing/index.mjs +4 -0
  165. package/resources/parsing/index.mjs.map +1 -0
  166. package/resources/parsing/jobs.d.ts +290 -0
  167. package/resources/parsing/jobs.d.ts.map +1 -0
  168. package/resources/parsing/jobs.js +147 -0
  169. package/resources/parsing/jobs.js.map +1 -0
  170. package/resources/parsing/jobs.mjs +119 -0
  171. package/resources/parsing/jobs.mjs.map +1 -0
  172. package/resources/parsing/parsing.d.ts +10 -0
  173. package/resources/parsing/parsing.d.ts.map +1 -0
  174. package/resources/parsing/parsing.js +40 -0
  175. package/resources/parsing/parsing.js.map +1 -0
  176. package/resources/parsing/parsing.mjs +13 -0
  177. package/resources/parsing/parsing.mjs.map +1 -0
  178. package/resources/shared.d.ts +35 -0
  179. package/resources/shared.d.ts.map +1 -0
  180. package/resources/shared.js +4 -0
  181. package/resources/shared.js.map +1 -0
  182. package/resources/shared.mjs +3 -0
  183. package/resources/shared.mjs.map +1 -0
  184. package/resources/top-level.d.ts +165 -0
  185. package/resources/top-level.d.ts.map +1 -0
  186. package/resources/top-level.js +4 -0
  187. package/resources/top-level.js.map +1 -0
  188. package/resources/top-level.mjs +3 -0
  189. package/resources/top-level.mjs.map +1 -0
  190. package/resources/vector-stores/files.d.ts +284 -0
  191. package/resources/vector-stores/files.d.ts.map +1 -0
  192. package/resources/vector-stores/files.js +167 -0
  193. package/resources/vector-stores/files.js.map +1 -0
  194. package/resources/vector-stores/files.mjs +139 -0
  195. package/resources/vector-stores/files.mjs.map +1 -0
  196. package/resources/vector-stores/index.d.ts +3 -0
  197. package/resources/vector-stores/index.d.ts.map +1 -0
  198. package/resources/vector-stores/index.js +11 -0
  199. package/resources/vector-stores/index.js.map +1 -0
  200. package/resources/vector-stores/index.mjs +4 -0
  201. package/resources/vector-stores/index.mjs.map +1 -0
  202. package/resources/vector-stores/vector-stores.d.ts +425 -0
  203. package/resources/vector-stores/vector-stores.d.ts.map +1 -0
  204. package/resources/vector-stores/vector-stores.js +121 -0
  205. package/resources/vector-stores/vector-stores.js.map +1 -0
  206. package/resources/vector-stores/vector-stores.mjs +93 -0
  207. package/resources/vector-stores/vector-stores.mjs.map +1 -0
  208. package/shims/node.d.ts +30 -0
  209. package/shims/node.d.ts.map +1 -0
  210. package/shims/node.js +31 -0
  211. package/shims/node.js.map +1 -0
  212. package/shims/node.mjs +5 -0
  213. package/shims/node.mjs.map +1 -0
  214. package/shims/web.d.ts +26 -0
  215. package/shims/web.d.ts.map +1 -0
  216. package/shims/web.js +31 -0
  217. package/shims/web.js.map +1 -0
  218. package/shims/web.mjs +5 -0
  219. package/shims/web.mjs.map +1 -0
  220. package/src/_shims/MultipartBody.ts +9 -0
  221. package/src/_shims/README.md +46 -0
  222. package/src/_shims/auto/runtime-bun.ts +4 -0
  223. package/src/_shims/auto/runtime-node.ts +4 -0
  224. package/src/_shims/auto/runtime.ts +4 -0
  225. package/src/_shims/auto/types-node.ts +4 -0
  226. package/src/_shims/auto/types.d.ts +101 -0
  227. package/src/_shims/auto/types.js +3 -0
  228. package/src/_shims/auto/types.mjs +3 -0
  229. package/src/_shims/bun-runtime.ts +14 -0
  230. package/src/_shims/index.d.ts +81 -0
  231. package/src/_shims/index.js +13 -0
  232. package/src/_shims/index.mjs +7 -0
  233. package/src/_shims/manual-types.d.ts +12 -0
  234. package/src/_shims/manual-types.js +3 -0
  235. package/src/_shims/manual-types.mjs +3 -0
  236. package/src/_shims/node-runtime.ts +81 -0
  237. package/src/_shims/node-types.d.ts +42 -0
  238. package/src/_shims/node-types.js +3 -0
  239. package/src/_shims/node-types.mjs +3 -0
  240. package/src/_shims/registry.ts +67 -0
  241. package/src/_shims/web-runtime.ts +103 -0
  242. package/src/_shims/web-types.d.ts +83 -0
  243. package/src/_shims/web-types.js +3 -0
  244. package/src/_shims/web-types.mjs +3 -0
  245. package/src/core.ts +1208 -0
  246. package/src/error.ts +130 -0
  247. package/src/index.ts +346 -0
  248. package/src/lib/.keep +4 -0
  249. package/src/lib/polling.ts +115 -0
  250. package/src/pagination.ts +82 -0
  251. package/src/resource.ts +11 -0
  252. package/src/resources/embeddings.ts +248 -0
  253. package/src/resources/extractions/content.ts +42 -0
  254. package/src/resources/extractions/extractions.ts +47 -0
  255. package/src/resources/extractions/index.ts +14 -0
  256. package/src/resources/extractions/jobs.ts +105 -0
  257. package/src/resources/extractions/schema.ts +111 -0
  258. package/src/resources/files.ts +181 -0
  259. package/src/resources/index.ts +39 -0
  260. package/src/resources/parsing/index.ts +12 -0
  261. package/src/resources/parsing/jobs.ts +453 -0
  262. package/src/resources/parsing/parsing.ts +32 -0
  263. package/src/resources/shared.ts +41 -0
  264. package/src/resources/top-level.ts +231 -0
  265. package/src/resources/vector-stores/files.ts +439 -0
  266. package/src/resources/vector-stores/index.ts +31 -0
  267. package/src/resources/vector-stores/vector-stores.ts +592 -0
  268. package/src/shims/node.ts +50 -0
  269. package/src/shims/web.ts +50 -0
  270. package/src/tsconfig.json +11 -0
  271. package/src/uploads.ts +255 -0
  272. package/src/version.ts +1 -0
  273. package/uploads.d.ts +75 -0
  274. package/uploads.d.ts.map +1 -0
  275. package/uploads.js +171 -0
  276. package/uploads.js.map +1 -0
  277. package/uploads.mjs +158 -0
  278. package/uploads.mjs.map +1 -0
  279. package/version.d.ts +2 -0
  280. package/version.d.ts.map +1 -0
  281. package/version.js +5 -0
  282. package/version.js.map +1 -0
  283. package/version.mjs +2 -0
  284. package/version.mjs.map +1 -0
@@ -0,0 +1,147 @@
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.JobListResponsesLimitOffset = exports.Jobs = void 0;
28
+ const resource_1 = require("../../resource.js");
29
+ const core_1 = require("../../core.js");
30
+ const pagination_1 = require("../../pagination.js");
31
+ const polling = __importStar(require("../../lib/polling.js"));
32
+ class Jobs extends resource_1.APIResource {
33
+ /**
34
+ * Start a parse job for the provided file.
35
+ *
36
+ * Args: params: The parameters for creating a parse job.
37
+ *
38
+ * Returns: The created parsing job.
39
+ */
40
+ create(body, options) {
41
+ return this._client.post('/v1/parsing/jobs', { body, ...options });
42
+ }
43
+ /**
44
+ * Get detailed information about a specific parse job.
45
+ *
46
+ * Args: job_id: The ID of the parse job.
47
+ *
48
+ * Returns: Detailed information about the parse job.
49
+ */
50
+ retrieve(jobId, options) {
51
+ return this._client.get(`/v1/parsing/jobs/${jobId}`, options);
52
+ }
53
+ list(query = {}, options) {
54
+ if ((0, core_1.isRequestOptions)(query)) {
55
+ return this.list({}, query);
56
+ }
57
+ return this._client.getAPIList('/v1/parsing/jobs', JobListResponsesLimitOffset, { query, ...options });
58
+ }
59
+ /**
60
+ * Delete a specific parse job.
61
+ *
62
+ * Args: job_id: The ID of the parse job to delete.
63
+ *
64
+ * Returns: The deleted parsing job.
65
+ */
66
+ delete(jobId, options) {
67
+ return this._client.delete(`/v1/parsing/jobs/${jobId}`, options);
68
+ }
69
+ /**
70
+ * Cancel a specific parse job.
71
+ *
72
+ * Args: job_id: The ID of the parse job to cancel.
73
+ *
74
+ * Returns: The cancelled parsing job.
75
+ */
76
+ cancel(jobId, options) {
77
+ return this._client.patch(`/v1/parsing/jobs/${jobId}`, options);
78
+ }
79
+ /**
80
+ * Poll for a job's status until it reaches a terminal state.
81
+ *
82
+ * @param jobId - The ID of the job to poll
83
+ * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
84
+ * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
85
+ * @param options - Additional request options
86
+ * @returns The job object once it reaches a terminal state
87
+ */
88
+ async poll(jobId, pollIntervalMs, pollTimeoutMs, options) {
89
+ const pollingIntervalMs = pollIntervalMs || 500;
90
+ const pollingTimeoutMs = pollTimeoutMs;
91
+ return polling.poll({
92
+ fn: () => this.retrieve(jobId, options),
93
+ condition: (result) => result.status === 'completed' || result.status === 'failed' || result.status === 'cancelled',
94
+ intervalSeconds: pollingIntervalMs / 1000,
95
+ ...(pollingTimeoutMs && { timeoutSeconds: pollingTimeoutMs / 1000 }),
96
+ });
97
+ }
98
+ /**
99
+ * Create a parsing job and wait for it to complete.
100
+ *
101
+ * @param body - Parameters for creating a parse job
102
+ * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
103
+ * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
104
+ * @param options - Additional request options
105
+ * @returns The job object once it reaches a terminal state
106
+ */
107
+ async createAndPoll(body, pollIntervalMs, pollTimeoutMs, options) {
108
+ const job = await this.create(body, options);
109
+ return this.poll(job.id, pollIntervalMs, pollTimeoutMs, options);
110
+ }
111
+ /**
112
+ * Upload a file to the files API and then create a parsing job for it.
113
+ * Note the job will be asynchronously processed.
114
+ *
115
+ * @param file - The file to upload
116
+ * @param body - Additional parameters for creating a parse job
117
+ * @param options - Additional request options
118
+ * @returns The created parsing job
119
+ */
120
+ async upload(file, body, options) {
121
+ const fileUploadResponse = await this._client.files.create({ file }, options);
122
+ return this.create({
123
+ file_id: fileUploadResponse.id,
124
+ ...body,
125
+ }, options);
126
+ }
127
+ /**
128
+ * Upload a file and create a parsing job, then poll until processing is complete.
129
+ *
130
+ * @param file - The file to upload
131
+ * @param body - Additional parameters for creating a parse job
132
+ * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
133
+ * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
134
+ * @param options - Additional request options
135
+ * @returns The job object once it reaches a terminal state
136
+ */
137
+ async uploadAndPoll(file, body, pollIntervalMs, pollTimeoutMs, options) {
138
+ const job = await this.upload(file, body, options);
139
+ return this.poll(job.id, pollIntervalMs, pollTimeoutMs, options);
140
+ }
141
+ }
142
+ exports.Jobs = Jobs;
143
+ class JobListResponsesLimitOffset extends pagination_1.LimitOffset {
144
+ }
145
+ exports.JobListResponsesLimitOffset = JobListResponsesLimitOffset;
146
+ Jobs.JobListResponsesLimitOffset = JobListResponsesLimitOffset;
147
+ //# sourceMappingURL=jobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/resources/parsing/jobs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,oDAAuE;AACvE,8DAA6C;AAG7C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;OAMG;IACH,MAAM,CAAC,IAAqB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,KAAa,EAAE,OAA6B;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAcD,IAAI,CACF,QAA6C,EAAE,EAC/C,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,2BAA2B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,KAAa,EAAE,OAA6B;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,oBAAoB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;OAMG;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AAO,CAAC,CAAC;QAE9E,OAAO,IAAI,CAAC,MAAM,CAChB;YACE,OAAO,EAAE,kBAAkB,CAAC,EAAE;YAC9B,GAAG,IAAI;SACR,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,aAAa,CACjB,IAAgB,EAChB,IAAuC,EACvC,cAAuB,EACvB,aAAsB,EACtB,OAA6B;QAE7B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;CACF;AA9JD,oBA8JC;AAED,MAAa,2BAA4B,SAAQ,wBAA4B;CAAG;AAAhF,kEAAgF;AAgRhF,IAAI,CAAC,2BAA2B,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,119 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../resource.mjs";
3
+ import { isRequestOptions } from "../../core.mjs";
4
+ import { LimitOffset } from "../../pagination.mjs";
5
+ import * as polling from "../../lib/polling.mjs";
6
+ export class Jobs extends APIResource {
7
+ /**
8
+ * Start a parse job for the provided file.
9
+ *
10
+ * Args: params: The parameters for creating a parse job.
11
+ *
12
+ * Returns: The created parsing job.
13
+ */
14
+ create(body, options) {
15
+ return this._client.post('/v1/parsing/jobs', { body, ...options });
16
+ }
17
+ /**
18
+ * Get detailed information about a specific parse job.
19
+ *
20
+ * Args: job_id: The ID of the parse job.
21
+ *
22
+ * Returns: Detailed information about the parse job.
23
+ */
24
+ retrieve(jobId, options) {
25
+ return this._client.get(`/v1/parsing/jobs/${jobId}`, options);
26
+ }
27
+ list(query = {}, options) {
28
+ if (isRequestOptions(query)) {
29
+ return this.list({}, query);
30
+ }
31
+ return this._client.getAPIList('/v1/parsing/jobs', JobListResponsesLimitOffset, { query, ...options });
32
+ }
33
+ /**
34
+ * Delete a specific parse job.
35
+ *
36
+ * Args: job_id: The ID of the parse job to delete.
37
+ *
38
+ * Returns: The deleted parsing job.
39
+ */
40
+ delete(jobId, options) {
41
+ return this._client.delete(`/v1/parsing/jobs/${jobId}`, options);
42
+ }
43
+ /**
44
+ * Cancel a specific parse job.
45
+ *
46
+ * Args: job_id: The ID of the parse job to cancel.
47
+ *
48
+ * Returns: The cancelled parsing job.
49
+ */
50
+ cancel(jobId, options) {
51
+ return this._client.patch(`/v1/parsing/jobs/${jobId}`, options);
52
+ }
53
+ /**
54
+ * Poll for a job's status until it reaches a terminal state.
55
+ *
56
+ * @param jobId - The ID of the job to poll
57
+ * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
58
+ * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
59
+ * @param options - Additional request options
60
+ * @returns The job object once it reaches a terminal state
61
+ */
62
+ async poll(jobId, pollIntervalMs, pollTimeoutMs, options) {
63
+ const pollingIntervalMs = pollIntervalMs || 500;
64
+ const pollingTimeoutMs = pollTimeoutMs;
65
+ return polling.poll({
66
+ fn: () => this.retrieve(jobId, options),
67
+ condition: (result) => result.status === 'completed' || result.status === 'failed' || result.status === 'cancelled',
68
+ intervalSeconds: pollingIntervalMs / 1000,
69
+ ...(pollingTimeoutMs && { timeoutSeconds: pollingTimeoutMs / 1000 }),
70
+ });
71
+ }
72
+ /**
73
+ * Create a parsing job and wait for it to complete.
74
+ *
75
+ * @param body - Parameters for creating a parse job
76
+ * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
77
+ * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
78
+ * @param options - Additional request options
79
+ * @returns The job object once it reaches a terminal state
80
+ */
81
+ async createAndPoll(body, pollIntervalMs, pollTimeoutMs, options) {
82
+ const job = await this.create(body, options);
83
+ return this.poll(job.id, pollIntervalMs, pollTimeoutMs, options);
84
+ }
85
+ /**
86
+ * Upload a file to the files API and then create a parsing job for it.
87
+ * Note the job will be asynchronously processed.
88
+ *
89
+ * @param file - The file to upload
90
+ * @param body - Additional parameters for creating a parse job
91
+ * @param options - Additional request options
92
+ * @returns The created parsing job
93
+ */
94
+ async upload(file, body, options) {
95
+ const fileUploadResponse = await this._client.files.create({ file }, options);
96
+ return this.create({
97
+ file_id: fileUploadResponse.id,
98
+ ...body,
99
+ }, options);
100
+ }
101
+ /**
102
+ * Upload a file and create a parsing job, then poll until processing is complete.
103
+ *
104
+ * @param file - The file to upload
105
+ * @param body - Additional parameters for creating a parse job
106
+ * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
107
+ * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
108
+ * @param options - Additional request options
109
+ * @returns The job object once it reaches a terminal state
110
+ */
111
+ async uploadAndPoll(file, body, pollIntervalMs, pollTimeoutMs, options) {
112
+ const job = await this.upload(file, body, options);
113
+ return this.poll(job.id, pollIntervalMs, pollTimeoutMs, options);
114
+ }
115
+ }
116
+ export class JobListResponsesLimitOffset extends LimitOffset {
117
+ }
118
+ Jobs.JobListResponsesLimitOffset = JobListResponsesLimitOffset;
119
+ //# sourceMappingURL=jobs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.mjs","sourceRoot":"","sources":["../../src/resources/parsing/jobs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,EAAE,WAAW,EAA0B;OACvC,KAAK,OAAO;AAGnB,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;OAMG;IACH,MAAM,CAAC,IAAqB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,KAAa,EAAE,O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+ import { JobCreateParams, JobDeleteResponse, JobListParams, JobListResponse, JobListResponsesLimitOffset, Jobs, ParsingJob } from "./jobs.js";
4
+ export declare class Parsing extends APIResource {
5
+ jobs: JobsAPI.Jobs;
6
+ }
7
+ export declare namespace Parsing {
8
+ export { Jobs as Jobs, type ParsingJob as ParsingJob, type JobListResponse as JobListResponse, type JobDeleteResponse as JobDeleteResponse, JobListResponsesLimitOffset as JobListResponsesLimitOffset, type JobCreateParams as JobCreateParams, type JobListParams as JobListParams, };
9
+ }
10
+ //# sourceMappingURL=parsing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsing.d.ts","sourceRoot":"","sources":["../../src/resources/parsing/parsing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,QAAQ,CAAC;AAClC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,2BAA2B,EAC3B,IAAI,EACJ,UAAU,EACX,MAAM,QAAQ,CAAC;AAEhB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;CACrD;AAKD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,IAAI,IAAI,IAAI,EACZ,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,2BAA2B,IAAI,2BAA2B,EAC1D,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,aAAa,IAAI,aAAa,GACpC,CAAC;CACH"}
@@ -0,0 +1,40 @@
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.Parsing = void 0;
28
+ const resource_1 = require("../../resource.js");
29
+ const JobsAPI = __importStar(require("./jobs.js"));
30
+ const jobs_1 = require("./jobs.js");
31
+ class Parsing extends resource_1.APIResource {
32
+ constructor() {
33
+ super(...arguments);
34
+ this.jobs = new JobsAPI.Jobs(this._client);
35
+ }
36
+ }
37
+ exports.Parsing = Parsing;
38
+ Parsing.Jobs = jobs_1.Jobs;
39
+ Parsing.JobListResponsesLimitOffset = jobs_1.JobListResponsesLimitOffset;
40
+ //# sourceMappingURL=parsing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsing.js","sourceRoot":"","sources":["../../src/resources/parsing/parsing.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,mDAAkC;AAClC,oCAQgB;AAEhB,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;CAAA;AAFD,0BAEC;AAED,OAAO,CAAC,IAAI,GAAG,WAAI,CAAC;AACpB,OAAO,CAAC,2BAA2B,GAAG,kCAA2B,CAAC"}
@@ -0,0 +1,13 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../resource.mjs";
3
+ import * as JobsAPI from "./jobs.mjs";
4
+ import { JobListResponsesLimitOffset, Jobs, } from "./jobs.mjs";
5
+ export class Parsing extends APIResource {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.jobs = new JobsAPI.Jobs(this._client);
9
+ }
10
+ }
11
+ Parsing.Jobs = Jobs;
12
+ Parsing.JobListResponsesLimitOffset = JobListResponsesLimitOffset;
13
+ //# sourceMappingURL=parsing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsing.mjs","sourceRoot":"","sources":["../../src/resources/parsing/parsing.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAKL,2BAA2B,EAC3B,IAAI,GAEL;AAED,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;CAAA;AAED,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB,OAAO,CAAC,2BAA2B,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Represents a filter with AND, OR, and NOT conditions.
3
+ */
4
+ export interface SearchFilter {
5
+ /**
6
+ * List of conditions or filters to be ANDed together
7
+ */
8
+ all?: Array<SearchFilter | SearchFilterCondition> | null;
9
+ /**
10
+ * List of conditions or filters to be ORed together
11
+ */
12
+ any?: Array<SearchFilter | SearchFilterCondition> | null;
13
+ /**
14
+ * List of conditions or filters to be NOTed
15
+ */
16
+ none?: Array<SearchFilter | SearchFilterCondition> | null;
17
+ }
18
+ /**
19
+ * Represents a condition with a field, operator, and value.
20
+ */
21
+ export interface SearchFilterCondition {
22
+ /**
23
+ * The field to apply the condition on
24
+ */
25
+ key: string;
26
+ /**
27
+ * The value to compare against
28
+ */
29
+ value: unknown;
30
+ /**
31
+ * The operator for the condition
32
+ */
33
+ operator: 'eq' | 'not_eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'like' | 'not_like';
34
+ }
35
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,qBAAqB,CAAC,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,qBAAqB,CAAC,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,qBAAqB,CAAC,GAAG,IAAI,CAAC;CAC3D;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;CACjG"}
@@ -0,0 +1,4 @@
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
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":";AAAA,sFAAsF"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export {};
3
+ //# sourceMappingURL=shared.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.mjs","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Info Pydantic Response Service Message
3
+ */
4
+ export interface InfoResponse {
5
+ name: string;
6
+ version: string;
7
+ }
8
+ export interface RerankResponse {
9
+ /**
10
+ * The usage of the model
11
+ */
12
+ usage: RerankResponse.Usage;
13
+ /**
14
+ * The model used
15
+ */
16
+ model: string;
17
+ /**
18
+ * The ranked documents.
19
+ */
20
+ data: Array<RerankResponse.Data>;
21
+ /**
22
+ * The object type of the response
23
+ */
24
+ object?: 'list' | 'parsing_job' | 'job' | 'embedding' | 'embedding_dict' | 'text_document' | 'file' | 'vector_store' | 'vector_store.file' | 'api_key';
25
+ /**
26
+ * The number of documents to return.
27
+ */
28
+ top_k: number;
29
+ /**
30
+ * Whether to return the documents.
31
+ */
32
+ return_input: boolean;
33
+ }
34
+ export declare namespace RerankResponse {
35
+ /**
36
+ * The usage of the model
37
+ */
38
+ interface Usage {
39
+ /**
40
+ * The number of tokens used for the prompt
41
+ */
42
+ prompt_tokens: number;
43
+ /**
44
+ * The total number of tokens used
45
+ */
46
+ total_tokens: number;
47
+ /**
48
+ * The number of tokens used for the completion
49
+ */
50
+ completion_tokens?: number | null;
51
+ }
52
+ interface Data {
53
+ index: number;
54
+ /**
55
+ * The score of the document.
56
+ */
57
+ score: number;
58
+ /**
59
+ * The input document.
60
+ */
61
+ input: unknown;
62
+ /**
63
+ * The object type.
64
+ */
65
+ object?: 'list' | 'parsing_job' | 'job' | 'embedding' | 'embedding_dict' | 'text_document' | 'file' | 'vector_store' | 'vector_store.file' | 'api_key';
66
+ }
67
+ }
68
+ export interface EmbedParams {
69
+ /**
70
+ * The model to use for creating embeddings.
71
+ */
72
+ model: string;
73
+ /**
74
+ * The input to create embeddings for.
75
+ */
76
+ input: string | EmbedParams.ImageURLInput | EmbedParams.TextInput;
77
+ /**
78
+ * The number of dimensions to use for the embeddings.
79
+ */
80
+ dimensions?: number | null;
81
+ /**
82
+ * The prompt to use for the embedding creation.
83
+ */
84
+ prompt?: string | null;
85
+ /**
86
+ * Whether to normalize the embeddings.
87
+ */
88
+ normalized?: boolean;
89
+ /**
90
+ * The encoding format of the embeddings.
91
+ */
92
+ encoding_format?: 'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8' | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
93
+ }
94
+ export declare namespace EmbedParams {
95
+ /**
96
+ * Model for image input validation.
97
+ */
98
+ interface ImageURLInput {
99
+ /**
100
+ * Input type identifier
101
+ */
102
+ type?: 'image_url';
103
+ /**
104
+ * The image input specification.
105
+ */
106
+ image: ImageURLInput.Image;
107
+ }
108
+ namespace ImageURLInput {
109
+ /**
110
+ * The image input specification.
111
+ */
112
+ interface Image {
113
+ /**
114
+ * The image URL. Can be either a URL or a Data URI.
115
+ */
116
+ url: string;
117
+ }
118
+ }
119
+ /**
120
+ * Model for text input validation.
121
+ *
122
+ * Attributes: type: Input type identifier, always "text" text: The actual text
123
+ * content, with length and whitespace constraints
124
+ */
125
+ interface TextInput {
126
+ /**
127
+ * Input type identifier
128
+ */
129
+ type?: 'text';
130
+ /**
131
+ * Text content to process
132
+ */
133
+ text: string;
134
+ }
135
+ }
136
+ export interface RerankParams {
137
+ /**
138
+ * The model to use for reranking documents.
139
+ */
140
+ model?: string;
141
+ /**
142
+ * The query to rerank the documents.
143
+ */
144
+ query: string;
145
+ /**
146
+ * The input documents to rerank.
147
+ */
148
+ input: Array<string | unknown>;
149
+ /**
150
+ * The fields of the documents to rank.
151
+ */
152
+ rank_fields?: Array<string> | null;
153
+ /**
154
+ * The number of documents to return.
155
+ */
156
+ top_k?: number;
157
+ /**
158
+ * Whether to return the documents.
159
+ */
160
+ return_input?: boolean;
161
+ }
162
+ export declare namespace TopLevel {
163
+ export { type InfoResponse as InfoResponse, type RerankResponse as RerankResponse, type EmbedParams as EmbedParams, type RerankParams as RerankParams, };
164
+ }
165
+ //# sourceMappingURL=top-level.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-level.d.ts","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EACH,MAAM,GACN,aAAa,GACb,KAAK,GACL,WAAW,GACX,gBAAgB,GAChB,eAAe,GACf,MAAM,GACN,cAAc,GACd,mBAAmB,GACnB,SAAS,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,yBAAiB,cAAc,CAAC;IAC9B;;OAEG;IACH,UAAiB,KAAK;QACpB;;WAEG;QACH,aAAa,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACnC;IAED,UAAiB,IAAI;QACnB,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,KAAK,EAAE,OAAO,CAAC;QAEf;;WAEG;QACH,MAAM,CAAC,EACH,MAAM,GACN,aAAa,GACb,KAAK,GACL,WAAW,GACX,gBAAgB,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;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,YAAY,IAAI,YAAY,GAClC,CAAC;CACH"}
@@ -0,0 +1,4 @@
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
+ //# sourceMappingURL=top-level.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-level.js","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":";AAAA,sFAAsF"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export {};
3
+ //# sourceMappingURL=top-level.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-level.mjs","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"AAAA,sFAAsF"}