@tabstack/sdk 1.0.5 → 2.0.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 (513) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/LICENSE +1 -1
  3. package/README.md +282 -356
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +186 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +186 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +467 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +463 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/streaming.d.mts +33 -0
  45. package/core/streaming.d.mts.map +1 -0
  46. package/core/streaming.d.ts +33 -0
  47. package/core/streaming.d.ts.map +1 -0
  48. package/core/streaming.js +263 -0
  49. package/core/streaming.js.map +1 -0
  50. package/core/streaming.mjs +258 -0
  51. package/core/streaming.mjs.map +1 -0
  52. package/core/uploads.d.mts +3 -0
  53. package/core/uploads.d.mts.map +1 -0
  54. package/core/uploads.d.ts +3 -0
  55. package/core/uploads.d.ts.map +1 -0
  56. package/core/uploads.js +6 -0
  57. package/core/uploads.js.map +1 -0
  58. package/core/uploads.mjs +2 -0
  59. package/core/uploads.mjs.map +1 -0
  60. package/error.d.mts +2 -0
  61. package/error.d.mts.map +1 -0
  62. package/error.d.ts +2 -0
  63. package/error.d.ts.map +1 -0
  64. package/error.js +6 -0
  65. package/error.js.map +1 -0
  66. package/error.mjs +2 -0
  67. package/error.mjs.map +1 -0
  68. package/index.d.mts +6 -0
  69. package/index.d.mts.map +1 -0
  70. package/index.d.ts +6 -0
  71. package/index.d.ts.map +1 -0
  72. package/index.js +30 -0
  73. package/index.js.map +1 -0
  74. package/index.mjs +7 -0
  75. package/index.mjs.map +1 -0
  76. package/internal/builtin-types.d.mts +73 -0
  77. package/internal/builtin-types.d.mts.map +1 -0
  78. package/internal/builtin-types.d.ts +73 -0
  79. package/internal/builtin-types.d.ts.map +1 -0
  80. package/internal/builtin-types.js +4 -0
  81. package/internal/builtin-types.js.map +1 -0
  82. package/internal/builtin-types.mjs +3 -0
  83. package/internal/builtin-types.mjs.map +1 -0
  84. package/internal/decoders/line.d.mts +17 -0
  85. package/internal/decoders/line.d.mts.map +1 -0
  86. package/internal/decoders/line.d.ts +17 -0
  87. package/internal/decoders/line.d.ts.map +1 -0
  88. package/internal/decoders/line.js +113 -0
  89. package/internal/decoders/line.js.map +1 -0
  90. package/internal/decoders/line.mjs +108 -0
  91. package/internal/decoders/line.mjs.map +1 -0
  92. package/internal/detect-platform.d.mts +15 -0
  93. package/internal/detect-platform.d.mts.map +1 -0
  94. package/internal/detect-platform.d.ts +15 -0
  95. package/internal/detect-platform.d.ts.map +1 -0
  96. package/internal/detect-platform.js +162 -0
  97. package/internal/detect-platform.js.map +1 -0
  98. package/internal/detect-platform.mjs +157 -0
  99. package/internal/detect-platform.mjs.map +1 -0
  100. package/internal/errors.d.mts +3 -0
  101. package/internal/errors.d.mts.map +1 -0
  102. package/internal/errors.d.ts +3 -0
  103. package/internal/errors.d.ts.map +1 -0
  104. package/internal/errors.js +41 -0
  105. package/internal/errors.js.map +1 -0
  106. package/internal/errors.mjs +36 -0
  107. package/internal/errors.mjs.map +1 -0
  108. package/internal/headers.d.mts +20 -0
  109. package/internal/headers.d.mts.map +1 -0
  110. package/internal/headers.d.ts +20 -0
  111. package/internal/headers.d.ts.map +1 -0
  112. package/internal/headers.js +79 -0
  113. package/internal/headers.js.map +1 -0
  114. package/internal/headers.mjs +74 -0
  115. package/internal/headers.mjs.map +1 -0
  116. package/internal/parse.d.mts +12 -0
  117. package/internal/parse.d.mts.map +1 -0
  118. package/internal/parse.d.ts +12 -0
  119. package/internal/parse.d.ts.map +1 -0
  120. package/internal/parse.js +45 -0
  121. package/internal/parse.js.map +1 -0
  122. package/internal/parse.mjs +42 -0
  123. package/internal/parse.mjs.map +1 -0
  124. package/internal/request-options.d.mts +77 -0
  125. package/internal/request-options.d.mts.map +1 -0
  126. package/internal/request-options.d.ts +77 -0
  127. package/internal/request-options.d.ts.map +1 -0
  128. package/internal/request-options.js +14 -0
  129. package/internal/request-options.js.map +1 -0
  130. package/internal/request-options.mjs +10 -0
  131. package/internal/request-options.mjs.map +1 -0
  132. package/internal/shim-types.d.mts +17 -0
  133. package/internal/shim-types.d.mts.map +1 -0
  134. package/internal/shim-types.d.ts +17 -0
  135. package/internal/shim-types.d.ts.map +1 -0
  136. package/internal/shim-types.js +4 -0
  137. package/internal/shim-types.js.map +1 -0
  138. package/internal/shim-types.mjs +3 -0
  139. package/internal/shim-types.mjs.map +1 -0
  140. package/internal/shims.d.mts +20 -0
  141. package/internal/shims.d.mts.map +1 -0
  142. package/internal/shims.d.ts +20 -0
  143. package/internal/shims.d.ts.map +1 -0
  144. package/internal/shims.js +92 -0
  145. package/internal/shims.js.map +1 -0
  146. package/internal/shims.mjs +85 -0
  147. package/internal/shims.mjs.map +1 -0
  148. package/internal/to-file.d.mts +45 -0
  149. package/internal/to-file.d.mts.map +1 -0
  150. package/internal/to-file.d.ts +45 -0
  151. package/internal/to-file.d.ts.map +1 -0
  152. package/internal/to-file.js +91 -0
  153. package/internal/to-file.js.map +1 -0
  154. package/internal/to-file.mjs +88 -0
  155. package/internal/to-file.mjs.map +1 -0
  156. package/internal/tslib.js +81 -0
  157. package/internal/tslib.mjs +17 -0
  158. package/internal/types.d.mts +69 -0
  159. package/internal/types.d.mts.map +1 -0
  160. package/internal/types.d.ts +69 -0
  161. package/internal/types.d.ts.map +1 -0
  162. package/internal/types.js +4 -0
  163. package/internal/types.js.map +1 -0
  164. package/internal/types.mjs +3 -0
  165. package/internal/types.mjs.map +1 -0
  166. package/internal/uploads.d.mts +42 -0
  167. package/internal/uploads.d.mts.map +1 -0
  168. package/internal/uploads.d.ts +42 -0
  169. package/internal/uploads.d.ts.map +1 -0
  170. package/internal/uploads.js +141 -0
  171. package/internal/uploads.js.map +1 -0
  172. package/internal/uploads.mjs +131 -0
  173. package/internal/uploads.mjs.map +1 -0
  174. package/internal/utils/base64.d.mts +3 -0
  175. package/internal/utils/base64.d.mts.map +1 -0
  176. package/internal/utils/base64.d.ts +3 -0
  177. package/internal/utils/base64.d.ts.map +1 -0
  178. package/internal/utils/base64.js +38 -0
  179. package/internal/utils/base64.js.map +1 -0
  180. package/internal/utils/base64.mjs +33 -0
  181. package/internal/utils/base64.mjs.map +1 -0
  182. package/internal/utils/bytes.d.mts +4 -0
  183. package/internal/utils/bytes.d.mts.map +1 -0
  184. package/internal/utils/bytes.d.ts +4 -0
  185. package/internal/utils/bytes.d.ts.map +1 -0
  186. package/internal/utils/bytes.js +31 -0
  187. package/internal/utils/bytes.js.map +1 -0
  188. package/internal/utils/bytes.mjs +26 -0
  189. package/internal/utils/bytes.mjs.map +1 -0
  190. package/internal/utils/env.d.mts +9 -0
  191. package/internal/utils/env.d.mts.map +1 -0
  192. package/internal/utils/env.d.ts +9 -0
  193. package/internal/utils/env.d.ts.map +1 -0
  194. package/internal/utils/env.js +22 -0
  195. package/internal/utils/env.js.map +1 -0
  196. package/internal/utils/env.mjs +18 -0
  197. package/internal/utils/env.mjs.map +1 -0
  198. package/internal/utils/log.d.mts +37 -0
  199. package/internal/utils/log.d.mts.map +1 -0
  200. package/internal/utils/log.d.ts +37 -0
  201. package/internal/utils/log.d.ts.map +1 -0
  202. package/internal/utils/log.js +85 -0
  203. package/internal/utils/log.js.map +1 -0
  204. package/internal/utils/log.mjs +79 -0
  205. package/internal/utils/log.mjs.map +1 -0
  206. package/internal/utils/path.d.mts +15 -0
  207. package/internal/utils/path.d.mts.map +1 -0
  208. package/internal/utils/path.d.ts +15 -0
  209. package/internal/utils/path.d.ts.map +1 -0
  210. package/internal/utils/path.js +79 -0
  211. package/internal/utils/path.js.map +1 -0
  212. package/internal/utils/path.mjs +74 -0
  213. package/internal/utils/path.mjs.map +1 -0
  214. package/internal/utils/sleep.d.mts +2 -0
  215. package/internal/utils/sleep.d.mts.map +1 -0
  216. package/internal/utils/sleep.d.ts +2 -0
  217. package/internal/utils/sleep.d.ts.map +1 -0
  218. package/internal/utils/sleep.js +7 -0
  219. package/internal/utils/sleep.js.map +1 -0
  220. package/internal/utils/sleep.mjs +3 -0
  221. package/internal/utils/sleep.mjs.map +1 -0
  222. package/internal/utils/uuid.d.mts +5 -0
  223. package/internal/utils/uuid.d.mts.map +1 -0
  224. package/internal/utils/uuid.d.ts +5 -0
  225. package/internal/utils/uuid.d.ts.map +1 -0
  226. package/internal/utils/uuid.js +19 -0
  227. package/internal/utils/uuid.js.map +1 -0
  228. package/internal/utils/uuid.mjs +15 -0
  229. package/internal/utils/uuid.mjs.map +1 -0
  230. package/internal/utils/values.d.mts +18 -0
  231. package/internal/utils/values.d.mts.map +1 -0
  232. package/internal/utils/values.d.ts +18 -0
  233. package/internal/utils/values.d.ts.map +1 -0
  234. package/internal/utils/values.js +112 -0
  235. package/internal/utils/values.js.map +1 -0
  236. package/internal/utils/values.mjs +94 -0
  237. package/internal/utils/values.mjs.map +1 -0
  238. package/internal/utils.d.mts +7 -0
  239. package/internal/utils.d.mts.map +1 -0
  240. package/internal/utils.d.ts +7 -0
  241. package/internal/utils.d.ts.map +1 -0
  242. package/internal/utils.js +11 -0
  243. package/internal/utils.js.map +1 -0
  244. package/internal/utils.mjs +8 -0
  245. package/internal/utils.mjs.map +1 -0
  246. package/package.json +139 -82
  247. package/resource.d.mts +2 -0
  248. package/resource.d.mts.map +1 -0
  249. package/resource.d.ts +2 -0
  250. package/resource.d.ts.map +1 -0
  251. package/resource.js +6 -0
  252. package/resource.js.map +1 -0
  253. package/resource.mjs +2 -0
  254. package/resource.mjs.map +1 -0
  255. package/resources/agent.d.mts +74 -0
  256. package/resources/agent.d.mts.map +1 -0
  257. package/resources/agent.d.ts +74 -0
  258. package/resources/agent.d.ts.map +1 -0
  259. package/resources/agent.js +45 -0
  260. package/resources/agent.js.map +1 -0
  261. package/resources/agent.mjs +41 -0
  262. package/resources/agent.mjs.map +1 -0
  263. package/resources/extract.d.mts +118 -0
  264. package/resources/extract.d.mts.map +1 -0
  265. package/resources/extract.d.ts +118 -0
  266. package/resources/extract.d.ts.map +1 -0
  267. package/resources/extract.js +37 -0
  268. package/resources/extract.js.map +1 -0
  269. package/resources/extract.mjs +33 -0
  270. package/resources/extract.mjs.map +1 -0
  271. package/resources/generate.d.mts +45 -0
  272. package/resources/generate.d.mts.map +1 -0
  273. package/resources/generate.d.ts +45 -0
  274. package/resources/generate.d.ts.map +1 -0
  275. package/resources/generate.js +26 -0
  276. package/resources/generate.js.map +1 -0
  277. package/resources/generate.mjs +22 -0
  278. package/resources/generate.mjs.map +1 -0
  279. package/resources/index.d.mts +4 -0
  280. package/resources/index.d.mts.map +1 -0
  281. package/resources/index.d.ts +4 -0
  282. package/resources/index.d.ts.map +1 -0
  283. package/resources/index.js +11 -0
  284. package/resources/index.js.map +1 -0
  285. package/resources/index.mjs +5 -0
  286. package/resources/index.mjs.map +1 -0
  287. package/resources.d.mts +2 -0
  288. package/resources.d.mts.map +1 -0
  289. package/resources.d.ts +2 -0
  290. package/resources.d.ts.map +1 -0
  291. package/resources.js +5 -0
  292. package/resources.js.map +1 -0
  293. package/resources.mjs +2 -0
  294. package/resources.mjs.map +1 -0
  295. package/src/api-promise.ts +2 -0
  296. package/src/client.ts +756 -0
  297. package/src/core/README.md +3 -0
  298. package/src/core/api-promise.ts +92 -0
  299. package/src/core/error.ts +130 -0
  300. package/src/core/resource.ts +11 -0
  301. package/src/core/streaming.ts +315 -0
  302. package/src/core/uploads.ts +2 -0
  303. package/src/error.ts +2 -0
  304. package/src/index.ts +22 -0
  305. package/src/internal/README.md +3 -0
  306. package/src/internal/builtin-types.ts +93 -0
  307. package/src/internal/decoders/line.ts +135 -0
  308. package/src/internal/detect-platform.ts +196 -0
  309. package/src/internal/errors.ts +33 -0
  310. package/src/internal/headers.ts +97 -0
  311. package/src/internal/parse.ts +64 -0
  312. package/src/internal/request-options.ts +93 -0
  313. package/src/internal/shim-types.ts +26 -0
  314. package/src/internal/shims.ts +107 -0
  315. package/src/internal/to-file.ts +154 -0
  316. package/src/internal/types.ts +95 -0
  317. package/src/internal/uploads.ts +187 -0
  318. package/src/internal/utils/base64.ts +40 -0
  319. package/src/internal/utils/bytes.ts +32 -0
  320. package/src/internal/utils/env.ts +18 -0
  321. package/src/internal/utils/log.ts +126 -0
  322. package/src/internal/utils/path.ts +88 -0
  323. package/src/internal/utils/sleep.ts +3 -0
  324. package/src/internal/utils/uuid.ts +17 -0
  325. package/src/internal/utils/values.ts +105 -0
  326. package/src/internal/utils.ts +8 -0
  327. package/src/lib/.keep +4 -0
  328. package/src/resource.ts +2 -0
  329. package/src/resources/agent.ts +93 -0
  330. package/src/resources/extract.ts +147 -0
  331. package/src/resources/generate.ts +53 -0
  332. package/src/resources/index.ts +11 -0
  333. package/src/resources.ts +1 -0
  334. package/src/streaming.ts +2 -0
  335. package/src/tsconfig.json +11 -0
  336. package/src/uploads.ts +2 -0
  337. package/src/version.ts +1 -0
  338. package/streaming.d.mts +2 -0
  339. package/streaming.d.mts.map +1 -0
  340. package/streaming.d.ts +2 -0
  341. package/streaming.d.ts.map +1 -0
  342. package/streaming.js +6 -0
  343. package/streaming.js.map +1 -0
  344. package/streaming.mjs +2 -0
  345. package/streaming.mjs.map +1 -0
  346. package/uploads.d.mts +2 -0
  347. package/uploads.d.mts.map +1 -0
  348. package/uploads.d.ts +2 -0
  349. package/uploads.d.ts.map +1 -0
  350. package/uploads.js +6 -0
  351. package/uploads.js.map +1 -0
  352. package/uploads.mjs +2 -0
  353. package/uploads.mjs.map +1 -0
  354. package/version.d.mts +2 -0
  355. package/version.d.mts.map +1 -0
  356. package/version.d.ts +2 -0
  357. package/version.d.ts.map +1 -0
  358. package/version.js +5 -0
  359. package/version.js.map +1 -0
  360. package/version.mjs +2 -0
  361. package/version.mjs.map +1 -0
  362. package/dist/cjs/agent.d.ts +0 -156
  363. package/dist/cjs/agent.d.ts.map +0 -1
  364. package/dist/cjs/agent.js +0 -211
  365. package/dist/cjs/agent.js.map +0 -1
  366. package/dist/cjs/agent.test.d.ts +0 -5
  367. package/dist/cjs/agent.test.d.ts.map +0 -1
  368. package/dist/cjs/agent.test.js +0 -441
  369. package/dist/cjs/agent.test.js.map +0 -1
  370. package/dist/cjs/client.d.ts +0 -58
  371. package/dist/cjs/client.d.ts.map +0 -1
  372. package/dist/cjs/client.js +0 -58
  373. package/dist/cjs/client.js.map +0 -1
  374. package/dist/cjs/client.test.d.ts +0 -5
  375. package/dist/cjs/client.test.d.ts.map +0 -1
  376. package/dist/cjs/client.test.js +0 -255
  377. package/dist/cjs/client.test.js.map +0 -1
  378. package/dist/cjs/exceptions.d.ts +0 -57
  379. package/dist/cjs/exceptions.d.ts.map +0 -1
  380. package/dist/cjs/exceptions.js +0 -95
  381. package/dist/cjs/exceptions.js.map +0 -1
  382. package/dist/cjs/exceptions.test.d.ts +0 -5
  383. package/dist/cjs/exceptions.test.d.ts.map +0 -1
  384. package/dist/cjs/exceptions.test.js +0 -239
  385. package/dist/cjs/exceptions.test.js.map +0 -1
  386. package/dist/cjs/extract.d.ts +0 -151
  387. package/dist/cjs/extract.d.ts.map +0 -1
  388. package/dist/cjs/extract.js +0 -165
  389. package/dist/cjs/extract.js.map +0 -1
  390. package/dist/cjs/extract.test.d.ts +0 -5
  391. package/dist/cjs/extract.test.d.ts.map +0 -1
  392. package/dist/cjs/extract.test.js +0 -250
  393. package/dist/cjs/extract.test.js.map +0 -1
  394. package/dist/cjs/generate.d.ts +0 -113
  395. package/dist/cjs/generate.d.ts.map +0 -1
  396. package/dist/cjs/generate.js +0 -124
  397. package/dist/cjs/generate.js.map +0 -1
  398. package/dist/cjs/generate.test.d.ts +0 -5
  399. package/dist/cjs/generate.test.d.ts.map +0 -1
  400. package/dist/cjs/generate.test.js +0 -314
  401. package/dist/cjs/generate.test.js.map +0 -1
  402. package/dist/cjs/index.d.ts +0 -52
  403. package/dist/cjs/index.d.ts.map +0 -1
  404. package/dist/cjs/index.js +0 -72
  405. package/dist/cjs/index.js.map +0 -1
  406. package/dist/cjs/package.json +0 -3
  407. package/dist/cjs/types.d.ts +0 -73
  408. package/dist/cjs/types.d.ts.map +0 -1
  409. package/dist/cjs/types.js +0 -118
  410. package/dist/cjs/types.js.map +0 -1
  411. package/dist/cjs/types.test.d.ts +0 -5
  412. package/dist/cjs/types.test.d.ts.map +0 -1
  413. package/dist/cjs/types.test.js +0 -370
  414. package/dist/cjs/types.test.js.map +0 -1
  415. package/dist/cjs/util/http.d.ts +0 -29
  416. package/dist/cjs/util/http.d.ts.map +0 -1
  417. package/dist/cjs/util/http.js +0 -201
  418. package/dist/cjs/util/http.js.map +0 -1
  419. package/dist/cjs/util/http.test.d.ts +0 -5
  420. package/dist/cjs/util/http.test.d.ts.map +0 -1
  421. package/dist/cjs/util/http.test.js +0 -237
  422. package/dist/cjs/util/http.test.js.map +0 -1
  423. package/dist/esm/agent.d.ts +0 -156
  424. package/dist/esm/agent.d.ts.map +0 -1
  425. package/dist/esm/agent.js +0 -207
  426. package/dist/esm/agent.js.map +0 -1
  427. package/dist/esm/agent.test.d.ts +0 -5
  428. package/dist/esm/agent.test.d.ts.map +0 -1
  429. package/dist/esm/agent.test.js +0 -439
  430. package/dist/esm/agent.test.js.map +0 -1
  431. package/dist/esm/client.d.ts +0 -58
  432. package/dist/esm/client.d.ts.map +0 -1
  433. package/dist/esm/client.js +0 -54
  434. package/dist/esm/client.js.map +0 -1
  435. package/dist/esm/client.test.d.ts +0 -5
  436. package/dist/esm/client.test.d.ts.map +0 -1
  437. package/dist/esm/client.test.js +0 -253
  438. package/dist/esm/client.test.js.map +0 -1
  439. package/dist/esm/exceptions.d.ts +0 -57
  440. package/dist/esm/exceptions.d.ts.map +0 -1
  441. package/dist/esm/exceptions.js +0 -85
  442. package/dist/esm/exceptions.js.map +0 -1
  443. package/dist/esm/exceptions.test.d.ts +0 -5
  444. package/dist/esm/exceptions.test.d.ts.map +0 -1
  445. package/dist/esm/exceptions.test.js +0 -237
  446. package/dist/esm/exceptions.test.js.map +0 -1
  447. package/dist/esm/extract.d.ts +0 -151
  448. package/dist/esm/extract.d.ts.map +0 -1
  449. package/dist/esm/extract.js +0 -161
  450. package/dist/esm/extract.js.map +0 -1
  451. package/dist/esm/extract.test.d.ts +0 -5
  452. package/dist/esm/extract.test.d.ts.map +0 -1
  453. package/dist/esm/extract.test.js +0 -248
  454. package/dist/esm/extract.test.js.map +0 -1
  455. package/dist/esm/generate.d.ts +0 -113
  456. package/dist/esm/generate.d.ts.map +0 -1
  457. package/dist/esm/generate.js +0 -120
  458. package/dist/esm/generate.js.map +0 -1
  459. package/dist/esm/generate.test.d.ts +0 -5
  460. package/dist/esm/generate.test.d.ts.map +0 -1
  461. package/dist/esm/generate.test.js +0 -312
  462. package/dist/esm/generate.test.js.map +0 -1
  463. package/dist/esm/index.d.ts +0 -52
  464. package/dist/esm/index.d.ts.map +0 -1
  465. package/dist/esm/index.js +0 -53
  466. package/dist/esm/index.js.map +0 -1
  467. package/dist/esm/package.json +0 -3
  468. package/dist/esm/types.d.ts +0 -73
  469. package/dist/esm/types.d.ts.map +0 -1
  470. package/dist/esm/types.js +0 -110
  471. package/dist/esm/types.js.map +0 -1
  472. package/dist/esm/types.test.d.ts +0 -5
  473. package/dist/esm/types.test.d.ts.map +0 -1
  474. package/dist/esm/types.test.js +0 -368
  475. package/dist/esm/types.test.js.map +0 -1
  476. package/dist/esm/util/http.d.ts +0 -29
  477. package/dist/esm/util/http.d.ts.map +0 -1
  478. package/dist/esm/util/http.js +0 -164
  479. package/dist/esm/util/http.js.map +0 -1
  480. package/dist/esm/util/http.test.d.ts +0 -5
  481. package/dist/esm/util/http.test.d.ts.map +0 -1
  482. package/dist/esm/util/http.test.js +0 -232
  483. package/dist/esm/util/http.test.js.map +0 -1
  484. package/dist/types/agent.d.ts +0 -156
  485. package/dist/types/agent.d.ts.map +0 -1
  486. package/dist/types/agent.test.d.ts +0 -5
  487. package/dist/types/agent.test.d.ts.map +0 -1
  488. package/dist/types/client.d.ts +0 -58
  489. package/dist/types/client.d.ts.map +0 -1
  490. package/dist/types/client.test.d.ts +0 -5
  491. package/dist/types/client.test.d.ts.map +0 -1
  492. package/dist/types/exceptions.d.ts +0 -57
  493. package/dist/types/exceptions.d.ts.map +0 -1
  494. package/dist/types/exceptions.test.d.ts +0 -5
  495. package/dist/types/exceptions.test.d.ts.map +0 -1
  496. package/dist/types/extract.d.ts +0 -151
  497. package/dist/types/extract.d.ts.map +0 -1
  498. package/dist/types/extract.test.d.ts +0 -5
  499. package/dist/types/extract.test.d.ts.map +0 -1
  500. package/dist/types/generate.d.ts +0 -113
  501. package/dist/types/generate.d.ts.map +0 -1
  502. package/dist/types/generate.test.d.ts +0 -5
  503. package/dist/types/generate.test.d.ts.map +0 -1
  504. package/dist/types/index.d.ts +0 -52
  505. package/dist/types/index.d.ts.map +0 -1
  506. package/dist/types/types.d.ts +0 -73
  507. package/dist/types/types.d.ts.map +0 -1
  508. package/dist/types/types.test.d.ts +0 -5
  509. package/dist/types/types.test.d.ts.map +0 -1
  510. package/dist/types/util/http.d.ts +0 -29
  511. package/dist/types/util/http.d.ts.map +0 -1
  512. package/dist/types/util/http.test.d.ts +0 -5
  513. package/dist/types/util/http.test.d.ts.map +0 -1
@@ -1,239 +0,0 @@
1
- "use strict";
2
- /**
3
- * Tests for Exception classes
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const exceptions_1 = require("./exceptions");
7
- describe('Exception Classes', () => {
8
- describe('TabstackError', () => {
9
- it('should create error with message', () => {
10
- const error = new exceptions_1.TabstackError('Test error');
11
- expect(error).toBeInstanceOf(Error);
12
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
13
- expect(error.message).toBe('Test error');
14
- expect(error.name).toBe('TabstackError');
15
- });
16
- it('should create error with message and status code', () => {
17
- const error = new exceptions_1.TabstackError('Test error', 418);
18
- expect(error.message).toBe('Test error');
19
- expect(error.statusCode).toBe(418);
20
- });
21
- it('should create error without status code', () => {
22
- const error = new exceptions_1.TabstackError('Test error');
23
- expect(error.message).toBe('Test error');
24
- expect(error.statusCode).toBeUndefined();
25
- });
26
- it('should have correct prototype chain', () => {
27
- const error = new exceptions_1.TabstackError('Test');
28
- expect(Object.getPrototypeOf(error)).toBe(exceptions_1.TabstackError.prototype);
29
- });
30
- it('should be catchable as Error', () => {
31
- try {
32
- throw new exceptions_1.TabstackError('Test');
33
- }
34
- catch (error) {
35
- expect(error).toBeInstanceOf(Error);
36
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
37
- }
38
- });
39
- });
40
- describe('BadRequestError', () => {
41
- it('should create error with message', () => {
42
- const error = new exceptions_1.BadRequestError('Invalid request');
43
- expect(error).toBeInstanceOf(Error);
44
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
45
- expect(error).toBeInstanceOf(exceptions_1.BadRequestError);
46
- expect(error.message).toBe('Invalid request');
47
- expect(error.name).toBe('BadRequestError');
48
- });
49
- it('should have status code 400', () => {
50
- const error = new exceptions_1.BadRequestError('Test');
51
- expect(error.statusCode).toBe(400);
52
- });
53
- it('should have correct prototype chain', () => {
54
- const error = new exceptions_1.BadRequestError('Test');
55
- expect(Object.getPrototypeOf(error)).toBe(exceptions_1.BadRequestError.prototype);
56
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
57
- });
58
- it('should be catchable as TabstackError', () => {
59
- try {
60
- throw new exceptions_1.BadRequestError('Test');
61
- }
62
- catch (error) {
63
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
64
- expect(error).toBeInstanceOf(exceptions_1.BadRequestError);
65
- }
66
- });
67
- });
68
- describe('UnauthorizedError', () => {
69
- it('should create error with custom message', () => {
70
- const error = new exceptions_1.UnauthorizedError('Custom auth error');
71
- expect(error).toBeInstanceOf(Error);
72
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
73
- expect(error).toBeInstanceOf(exceptions_1.UnauthorizedError);
74
- expect(error.message).toBe('Custom auth error');
75
- expect(error.name).toBe('UnauthorizedError');
76
- });
77
- it('should have default message', () => {
78
- const error = new exceptions_1.UnauthorizedError();
79
- expect(error.message).toBe('Unauthorized - Invalid or missing API key');
80
- });
81
- it('should have status code 401', () => {
82
- const error = new exceptions_1.UnauthorizedError();
83
- expect(error.statusCode).toBe(401);
84
- });
85
- it('should have correct prototype chain', () => {
86
- const error = new exceptions_1.UnauthorizedError();
87
- expect(Object.getPrototypeOf(error)).toBe(exceptions_1.UnauthorizedError.prototype);
88
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
89
- });
90
- });
91
- describe('InvalidURLError', () => {
92
- it('should create error with custom message', () => {
93
- const error = new exceptions_1.InvalidURLError('URL is malformed');
94
- expect(error).toBeInstanceOf(Error);
95
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
96
- expect(error).toBeInstanceOf(exceptions_1.InvalidURLError);
97
- expect(error.message).toBe('URL is malformed');
98
- expect(error.name).toBe('InvalidURLError');
99
- });
100
- it('should have default message', () => {
101
- const error = new exceptions_1.InvalidURLError();
102
- expect(error.message).toBe('Invalid or inaccessible URL');
103
- });
104
- it('should have status code 422', () => {
105
- const error = new exceptions_1.InvalidURLError();
106
- expect(error.statusCode).toBe(422);
107
- });
108
- it('should have correct prototype chain', () => {
109
- const error = new exceptions_1.InvalidURLError();
110
- expect(Object.getPrototypeOf(error)).toBe(exceptions_1.InvalidURLError.prototype);
111
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
112
- });
113
- });
114
- describe('ServerError', () => {
115
- it('should create error with custom message', () => {
116
- const error = new exceptions_1.ServerError('Database connection failed');
117
- expect(error).toBeInstanceOf(Error);
118
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
119
- expect(error).toBeInstanceOf(exceptions_1.ServerError);
120
- expect(error.message).toBe('Database connection failed');
121
- expect(error.name).toBe('ServerError');
122
- });
123
- it('should have default message', () => {
124
- const error = new exceptions_1.ServerError();
125
- expect(error.message).toBe('Internal server error');
126
- });
127
- it('should have status code 500', () => {
128
- const error = new exceptions_1.ServerError();
129
- expect(error.statusCode).toBe(500);
130
- });
131
- it('should have correct prototype chain', () => {
132
- const error = new exceptions_1.ServerError();
133
- expect(Object.getPrototypeOf(error)).toBe(exceptions_1.ServerError.prototype);
134
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
135
- });
136
- });
137
- describe('ServiceUnavailableError', () => {
138
- it('should create error with custom message', () => {
139
- const error = new exceptions_1.ServiceUnavailableError('Automate service is down');
140
- expect(error).toBeInstanceOf(Error);
141
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
142
- expect(error).toBeInstanceOf(exceptions_1.ServiceUnavailableError);
143
- expect(error.message).toBe('Automate service is down');
144
- expect(error.name).toBe('ServiceUnavailableError');
145
- });
146
- it('should have default message', () => {
147
- const error = new exceptions_1.ServiceUnavailableError();
148
- expect(error.message).toBe('Service unavailable');
149
- });
150
- it('should have status code 503', () => {
151
- const error = new exceptions_1.ServiceUnavailableError();
152
- expect(error.statusCode).toBe(503);
153
- });
154
- it('should have correct prototype chain', () => {
155
- const error = new exceptions_1.ServiceUnavailableError();
156
- expect(Object.getPrototypeOf(error)).toBe(exceptions_1.ServiceUnavailableError.prototype);
157
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
158
- });
159
- });
160
- describe('APIError', () => {
161
- it('should create error with message and status code', () => {
162
- const error = new exceptions_1.APIError('Rate limit exceeded', 429);
163
- expect(error).toBeInstanceOf(Error);
164
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
165
- expect(error).toBeInstanceOf(exceptions_1.APIError);
166
- expect(error.message).toBe('Rate limit exceeded');
167
- expect(error.statusCode).toBe(429);
168
- expect(error.name).toBe('APIError');
169
- });
170
- it('should accept any status code', () => {
171
- const error = new exceptions_1.APIError('Teapot', 418);
172
- expect(error.statusCode).toBe(418);
173
- });
174
- it('should have correct prototype chain', () => {
175
- const error = new exceptions_1.APIError('Test', 999);
176
- expect(Object.getPrototypeOf(error)).toBe(exceptions_1.APIError.prototype);
177
- expect(error).toBeInstanceOf(exceptions_1.TabstackError);
178
- });
179
- });
180
- describe('Error inheritance and type checking', () => {
181
- it('should distinguish between different error types', () => {
182
- const badRequest = new exceptions_1.BadRequestError('Bad');
183
- const unauthorized = new exceptions_1.UnauthorizedError('Unauth');
184
- const serverError = new exceptions_1.ServerError('Server');
185
- expect(badRequest).not.toBeInstanceOf(exceptions_1.UnauthorizedError);
186
- expect(unauthorized).not.toBeInstanceOf(exceptions_1.BadRequestError);
187
- expect(serverError).not.toBeInstanceOf(exceptions_1.UnauthorizedError);
188
- expect(badRequest).toBeInstanceOf(exceptions_1.TabstackError);
189
- expect(unauthorized).toBeInstanceOf(exceptions_1.TabstackError);
190
- expect(serverError).toBeInstanceOf(exceptions_1.TabstackError);
191
- });
192
- it('should preserve error properties when caught and rethrown', () => {
193
- try {
194
- throw new exceptions_1.InvalidURLError('Bad URL');
195
- }
196
- catch (error) {
197
- if (error instanceof exceptions_1.InvalidURLError) {
198
- expect(error.message).toBe('Bad URL');
199
- expect(error.statusCode).toBe(422);
200
- expect(error.name).toBe('InvalidURLError');
201
- }
202
- else {
203
- fail('Error should be InvalidURLError');
204
- }
205
- }
206
- });
207
- it('should work with instanceof checks in catch blocks', () => {
208
- const testError = (error) => {
209
- if (error instanceof exceptions_1.BadRequestError) {
210
- return 'bad-request';
211
- }
212
- else if (error instanceof exceptions_1.UnauthorizedError) {
213
- return 'unauthorized';
214
- }
215
- else if (error instanceof exceptions_1.TabstackError) {
216
- return 'tabstack-error';
217
- }
218
- return 'unknown';
219
- };
220
- expect(testError(new exceptions_1.BadRequestError('test'))).toBe('bad-request');
221
- expect(testError(new exceptions_1.UnauthorizedError('test'))).toBe('unauthorized');
222
- expect(testError(new exceptions_1.ServerError('test'))).toBe('tabstack-error');
223
- expect(testError(new Error('test'))).toBe('unknown');
224
- });
225
- });
226
- describe('Error stack traces', () => {
227
- it('should have stack trace', () => {
228
- const error = new exceptions_1.TabstackError('Test');
229
- expect(error.stack).toBeDefined();
230
- expect(error.stack).toContain('TabstackError');
231
- });
232
- it('should have stack trace for derived errors', () => {
233
- const error = new exceptions_1.BadRequestError('Test');
234
- expect(error.stack).toBeDefined();
235
- expect(error.stack).toContain('BadRequestError');
236
- });
237
- });
238
- });
239
- //# sourceMappingURL=exceptions.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exceptions.test.js","sourceRoot":"","sources":["../../src/exceptions.test.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAEH,6CAQsB;AAEtB,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;YAC1C,MAAM,KAAK,GAAG,IAAI,0BAAa,CAAC,YAAY,CAAC,CAAC;YAC9C,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,IAAI,wBAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAClE,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;YACjC,MAAM,KAAK,GAAG,IAAI,0BAAa,CAAC,MAAM,CAAC,CAAC;YACxC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;YACpD,MAAM,KAAK,GAAG,IAAI,4BAAe,CAAC,MAAM,CAAC,CAAC;YAC1C,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,151 +0,0 @@
1
- /**
2
- * Extract operator for Tabstack SDK
3
- */
4
- import { HTTPClient } from './util/http';
5
- import { MarkdownResponse, JsonResponse } from './types';
6
- export interface ExtractMarkdownOptions {
7
- metadata?: boolean;
8
- nocache?: boolean;
9
- }
10
- export interface ExtractJsonOptions {
11
- nocache?: boolean;
12
- }
13
- /**
14
- * Extract operator for converting and extracting web content
15
- *
16
- * This class provides methods for extracting content from URLs in various formats:
17
- * - Markdown conversion
18
- * - Structured JSON extraction
19
- */
20
- export declare class Extract {
21
- private httpClient;
22
- constructor(httpClient: HTTPClient);
23
- /**
24
- * Convert URL content to Markdown format
25
- *
26
- * Fetches a URL and converts its HTML content to clean Markdown format with
27
- * optional metadata extraction. By default, metadata is included in the content
28
- * as YAML frontmatter. When metadata option is true, it's also returned as
29
- * a separate field in the response.
30
- *
31
- * @param url - URL to fetch and convert to markdown
32
- * @param options - Optional extraction options
33
- * @param options.metadata - Include extracted metadata (Open Graph and HTML metadata) as a separate field in the response. Default: false
34
- * @param options.nocache - Bypass cache and force fresh data retrieval. Default: false
35
- *
36
- * @returns MarkdownResponse containing the converted content and optional metadata
37
- *
38
- * @throws {BadRequestError} When URL is missing
39
- * @throws {UnauthorizedError} When API key is invalid or missing
40
- * @throws {InvalidURLError} When URL is invalid or inaccessible
41
- * @throws {ServerError} When server fails to fetch or convert the content
42
- *
43
- * @example
44
- * Basic usage:
45
- * ```typescript
46
- * const result = await tabs.extract.markdown('https://example.com/blog/article');
47
- * console.log(result.content); // Markdown with YAML frontmatter
48
- * ```
49
- *
50
- * @example
51
- * With separate metadata field:
52
- * ```typescript
53
- * const result = await tabs.extract.markdown('https://example.com/blog/article', {
54
- * metadata: true
55
- * });
56
- * console.log(result.content); // Markdown without frontmatter
57
- * console.log(result.metadata?.title); // "Example Article Title"
58
- * console.log(result.metadata?.author); // "Example Author"
59
- * console.log(result.metadata?.image); // "https://example.com/images/article.jpg"
60
- * ```
61
- *
62
- * @example
63
- * Force fresh data retrieval:
64
- * ```typescript
65
- * const result = await tabs.extract.markdown('https://example.com/blog/article', {
66
- * nocache: true
67
- * });
68
- * ```
69
- */
70
- markdown(url: string, options?: ExtractMarkdownOptions): Promise<MarkdownResponse>;
71
- /**
72
- * Extract structured JSON from URL content
73
- *
74
- * Fetches a URL and extracts structured data according to a provided JSON schema.
75
- * The schema defines what data to extract and its structure.
76
- *
77
- * @param url - URL to fetch and extract data from
78
- * @param schema - JSON schema object defining the structure of data to extract
79
- * @param options - Optional extraction options
80
- * @param options.nocache - Bypass cache and force fresh data retrieval. Default: false
81
- *
82
- * @returns JsonResponse containing the extracted data matching the schema
83
- *
84
- * @throws {BadRequestError} When URL or schema is missing, or schema format is invalid
85
- * @throws {UnauthorizedError} When API key is invalid or missing
86
- * @throws {InvalidURLError} When URL is invalid
87
- * @throws {ServerError} When server fails to fetch URL, page is too large, or JSON generation fails
88
- *
89
- * @example
90
- * Extract news stories:
91
- * ```typescript
92
- * const schema = {
93
- * type: 'object',
94
- * properties: {
95
- * stories: {
96
- * type: 'array',
97
- * items: {
98
- * type: 'object',
99
- * properties: {
100
- * title: { type: 'string' },
101
- * points: { type: 'number' },
102
- * author: { type: 'string' }
103
- * },
104
- * required: ['title', 'points', 'author']
105
- * }
106
- * }
107
- * },
108
- * required: ['stories']
109
- * };
110
- *
111
- * const result = await tabs.extract.json('https://news.ycombinator.com', schema);
112
- * console.log(result.data.stories); // Array of story objects
113
- * ```
114
- *
115
- * @example
116
- * Extract product information:
117
- * ```typescript
118
- * const schema = {
119
- * type: 'object',
120
- * properties: {
121
- * name: { type: 'string' },
122
- * price: { type: 'number' },
123
- * inStock: { type: 'boolean' },
124
- * features: {
125
- * type: 'array',
126
- * items: { type: 'string' }
127
- * }
128
- * },
129
- * required: ['name', 'price', 'inStock']
130
- * };
131
- *
132
- * const result = await tabs.extract.json(
133
- * 'https://example-store.com/product/wireless-headphones',
134
- * schema
135
- * );
136
- * console.log(result.data.name); // "Premium Wireless Headphones"
137
- * console.log(result.data.price); // 299.99
138
- * console.log(result.data.inStock); // true
139
- * ```
140
- *
141
- * @example
142
- * Force fresh data retrieval:
143
- * ```typescript
144
- * const result = await tabs.extract.json('https://news.ycombinator.com', schema, {
145
- * nocache: true
146
- * });
147
- * ```
148
- */
149
- json<T = unknown>(url: string, schema: Record<string, unknown>, options?: ExtractJsonOptions): Promise<JsonResponse<T>>;
150
- }
151
- //# sourceMappingURL=extract.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/extract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;GAMG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAYxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6EG;IACG,IAAI,CAAC,CAAC,GAAG,OAAO,EACpB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAU5B"}
@@ -1,165 +0,0 @@
1
- "use strict";
2
- /**
3
- * Extract operator for Tabstack SDK
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Extract = void 0;
7
- const types_1 = require("./types");
8
- /**
9
- * Extract operator for converting and extracting web content
10
- *
11
- * This class provides methods for extracting content from URLs in various formats:
12
- * - Markdown conversion
13
- * - Structured JSON extraction
14
- */
15
- class Extract {
16
- constructor(httpClient) {
17
- this.httpClient = httpClient;
18
- }
19
- /**
20
- * Convert URL content to Markdown format
21
- *
22
- * Fetches a URL and converts its HTML content to clean Markdown format with
23
- * optional metadata extraction. By default, metadata is included in the content
24
- * as YAML frontmatter. When metadata option is true, it's also returned as
25
- * a separate field in the response.
26
- *
27
- * @param url - URL to fetch and convert to markdown
28
- * @param options - Optional extraction options
29
- * @param options.metadata - Include extracted metadata (Open Graph and HTML metadata) as a separate field in the response. Default: false
30
- * @param options.nocache - Bypass cache and force fresh data retrieval. Default: false
31
- *
32
- * @returns MarkdownResponse containing the converted content and optional metadata
33
- *
34
- * @throws {BadRequestError} When URL is missing
35
- * @throws {UnauthorizedError} When API key is invalid or missing
36
- * @throws {InvalidURLError} When URL is invalid or inaccessible
37
- * @throws {ServerError} When server fails to fetch or convert the content
38
- *
39
- * @example
40
- * Basic usage:
41
- * ```typescript
42
- * const result = await tabs.extract.markdown('https://example.com/blog/article');
43
- * console.log(result.content); // Markdown with YAML frontmatter
44
- * ```
45
- *
46
- * @example
47
- * With separate metadata field:
48
- * ```typescript
49
- * const result = await tabs.extract.markdown('https://example.com/blog/article', {
50
- * metadata: true
51
- * });
52
- * console.log(result.content); // Markdown without frontmatter
53
- * console.log(result.metadata?.title); // "Example Article Title"
54
- * console.log(result.metadata?.author); // "Example Author"
55
- * console.log(result.metadata?.image); // "https://example.com/images/article.jpg"
56
- * ```
57
- *
58
- * @example
59
- * Force fresh data retrieval:
60
- * ```typescript
61
- * const result = await tabs.extract.markdown('https://example.com/blog/article', {
62
- * nocache: true
63
- * });
64
- * ```
65
- */
66
- async markdown(url, options) {
67
- const requestData = { url };
68
- if (options?.metadata)
69
- requestData.metadata = options.metadata;
70
- if (options?.nocache)
71
- requestData.nocache = options.nocache;
72
- const response = await this.httpClient.post('v1/extract/markdown', requestData);
73
- return types_1.MarkdownResponse.fromJSON(response);
74
- }
75
- /**
76
- * Extract structured JSON from URL content
77
- *
78
- * Fetches a URL and extracts structured data according to a provided JSON schema.
79
- * The schema defines what data to extract and its structure.
80
- *
81
- * @param url - URL to fetch and extract data from
82
- * @param schema - JSON schema object defining the structure of data to extract
83
- * @param options - Optional extraction options
84
- * @param options.nocache - Bypass cache and force fresh data retrieval. Default: false
85
- *
86
- * @returns JsonResponse containing the extracted data matching the schema
87
- *
88
- * @throws {BadRequestError} When URL or schema is missing, or schema format is invalid
89
- * @throws {UnauthorizedError} When API key is invalid or missing
90
- * @throws {InvalidURLError} When URL is invalid
91
- * @throws {ServerError} When server fails to fetch URL, page is too large, or JSON generation fails
92
- *
93
- * @example
94
- * Extract news stories:
95
- * ```typescript
96
- * const schema = {
97
- * type: 'object',
98
- * properties: {
99
- * stories: {
100
- * type: 'array',
101
- * items: {
102
- * type: 'object',
103
- * properties: {
104
- * title: { type: 'string' },
105
- * points: { type: 'number' },
106
- * author: { type: 'string' }
107
- * },
108
- * required: ['title', 'points', 'author']
109
- * }
110
- * }
111
- * },
112
- * required: ['stories']
113
- * };
114
- *
115
- * const result = await tabs.extract.json('https://news.ycombinator.com', schema);
116
- * console.log(result.data.stories); // Array of story objects
117
- * ```
118
- *
119
- * @example
120
- * Extract product information:
121
- * ```typescript
122
- * const schema = {
123
- * type: 'object',
124
- * properties: {
125
- * name: { type: 'string' },
126
- * price: { type: 'number' },
127
- * inStock: { type: 'boolean' },
128
- * features: {
129
- * type: 'array',
130
- * items: { type: 'string' }
131
- * }
132
- * },
133
- * required: ['name', 'price', 'inStock']
134
- * };
135
- *
136
- * const result = await tabs.extract.json(
137
- * 'https://example-store.com/product/wireless-headphones',
138
- * schema
139
- * );
140
- * console.log(result.data.name); // "Premium Wireless Headphones"
141
- * console.log(result.data.price); // 299.99
142
- * console.log(result.data.inStock); // true
143
- * ```
144
- *
145
- * @example
146
- * Force fresh data retrieval:
147
- * ```typescript
148
- * const result = await tabs.extract.json('https://news.ycombinator.com', schema, {
149
- * nocache: true
150
- * });
151
- * ```
152
- */
153
- async json(url, schema, options) {
154
- const requestData = {
155
- url,
156
- json_schema: schema,
157
- };
158
- if (options?.nocache)
159
- requestData.nocache = options.nocache;
160
- const response = await this.httpClient.post('v1/extract/json', requestData);
161
- return types_1.JsonResponse.fromJSON(response);
162
- }
163
- }
164
- exports.Extract = Extract;
165
- //# sourceMappingURL=extract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/extract.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,mCAAyD;AAWzD;;;;;;GAMG;AACH,MAAa,OAAO;IAClB,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,KAAK,CAAC,QAAQ,CAAC,GAAW,EAAE,OAAgC;QAC1D,MAAM,WAAW,GAA4B,EAAE,GAAG,EAAE,CAAC;QACrD,IAAI,OAAO,EAAE,QAAQ;YAAE,WAAW,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC/D,IAAI,OAAO,EAAE,OAAO;YAAE,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAE5D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACzC,qBAAqB,EACrB,WAAW,CACZ,CAAC;QACF,OAAO,wBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6EG;IACH,KAAK,CAAC,IAAI,CACR,GAAW,EACX,MAA+B,EAC/B,OAA4B;QAE5B,MAAM,WAAW,GAA4B;YAC3C,GAAG;YACH,WAAW,EAAE,MAAM;SACpB,CAAC;QACF,IAAI,OAAO,EAAE,OAAO;YAAE,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAE5D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAI,iBAAiB,EAAE,WAAW,CAAC,CAAC;QAC/E,OAAO,oBAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF;AA1JD,0BA0JC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Tests for Extract operator
3
- */
4
- export {};
5
- //# sourceMappingURL=extract.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract.test.d.ts","sourceRoot":"","sources":["../../src/extract.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}