@linkt/sdk 0.2.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 (444) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE +201 -0
  3. package/README.md +424 -0
  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 +206 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +206 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +473 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +469 -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/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +35 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +32 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/qs/formats.d.mts +7 -0
  109. package/internal/qs/formats.d.mts.map +1 -0
  110. package/internal/qs/formats.d.ts +7 -0
  111. package/internal/qs/formats.d.ts.map +1 -0
  112. package/internal/qs/formats.js +13 -0
  113. package/internal/qs/formats.js.map +1 -0
  114. package/internal/qs/formats.mjs +9 -0
  115. package/internal/qs/formats.mjs.map +1 -0
  116. package/internal/qs/index.d.mts +10 -0
  117. package/internal/qs/index.d.mts.map +1 -0
  118. package/internal/qs/index.d.ts +10 -0
  119. package/internal/qs/index.d.ts.map +1 -0
  120. package/internal/qs/index.js +14 -0
  121. package/internal/qs/index.js.map +1 -0
  122. package/internal/qs/index.mjs +10 -0
  123. package/internal/qs/index.mjs.map +1 -0
  124. package/internal/qs/stringify.d.mts +3 -0
  125. package/internal/qs/stringify.d.mts.map +1 -0
  126. package/internal/qs/stringify.d.ts +3 -0
  127. package/internal/qs/stringify.d.ts.map +1 -0
  128. package/internal/qs/stringify.js +277 -0
  129. package/internal/qs/stringify.js.map +1 -0
  130. package/internal/qs/stringify.mjs +274 -0
  131. package/internal/qs/stringify.mjs.map +1 -0
  132. package/internal/qs/types.d.mts +57 -0
  133. package/internal/qs/types.d.mts.map +1 -0
  134. package/internal/qs/types.d.ts +57 -0
  135. package/internal/qs/types.d.ts.map +1 -0
  136. package/internal/qs/types.js +3 -0
  137. package/internal/qs/types.js.map +1 -0
  138. package/internal/qs/types.mjs +2 -0
  139. package/internal/qs/types.mjs.map +1 -0
  140. package/internal/qs/utils.d.mts +15 -0
  141. package/internal/qs/utils.d.mts.map +1 -0
  142. package/internal/qs/utils.d.ts +15 -0
  143. package/internal/qs/utils.d.ts.map +1 -0
  144. package/internal/qs/utils.js +230 -0
  145. package/internal/qs/utils.js.map +1 -0
  146. package/internal/qs/utils.mjs +217 -0
  147. package/internal/qs/utils.mjs.map +1 -0
  148. package/internal/request-options.d.mts +75 -0
  149. package/internal/request-options.d.mts.map +1 -0
  150. package/internal/request-options.d.ts +75 -0
  151. package/internal/request-options.d.ts.map +1 -0
  152. package/internal/request-options.js +14 -0
  153. package/internal/request-options.js.map +1 -0
  154. package/internal/request-options.mjs +10 -0
  155. package/internal/request-options.mjs.map +1 -0
  156. package/internal/shim-types.d.mts +17 -0
  157. package/internal/shim-types.d.mts.map +1 -0
  158. package/internal/shim-types.d.ts +17 -0
  159. package/internal/shim-types.d.ts.map +1 -0
  160. package/internal/shim-types.js +4 -0
  161. package/internal/shim-types.js.map +1 -0
  162. package/internal/shim-types.mjs +3 -0
  163. package/internal/shim-types.mjs.map +1 -0
  164. package/internal/shims.d.mts +20 -0
  165. package/internal/shims.d.mts.map +1 -0
  166. package/internal/shims.d.ts +20 -0
  167. package/internal/shims.d.ts.map +1 -0
  168. package/internal/shims.js +92 -0
  169. package/internal/shims.js.map +1 -0
  170. package/internal/shims.mjs +85 -0
  171. package/internal/shims.mjs.map +1 -0
  172. package/internal/to-file.d.mts +45 -0
  173. package/internal/to-file.d.mts.map +1 -0
  174. package/internal/to-file.d.ts +45 -0
  175. package/internal/to-file.d.ts.map +1 -0
  176. package/internal/to-file.js +91 -0
  177. package/internal/to-file.js.map +1 -0
  178. package/internal/to-file.mjs +88 -0
  179. package/internal/to-file.mjs.map +1 -0
  180. package/internal/tslib.js +81 -0
  181. package/internal/tslib.mjs +17 -0
  182. package/internal/types.d.mts +69 -0
  183. package/internal/types.d.mts.map +1 -0
  184. package/internal/types.d.ts +69 -0
  185. package/internal/types.d.ts.map +1 -0
  186. package/internal/types.js +4 -0
  187. package/internal/types.js.map +1 -0
  188. package/internal/types.mjs +3 -0
  189. package/internal/types.mjs.map +1 -0
  190. package/internal/uploads.d.mts +42 -0
  191. package/internal/uploads.d.mts.map +1 -0
  192. package/internal/uploads.d.ts +42 -0
  193. package/internal/uploads.d.ts.map +1 -0
  194. package/internal/uploads.js +141 -0
  195. package/internal/uploads.js.map +1 -0
  196. package/internal/uploads.mjs +131 -0
  197. package/internal/uploads.mjs.map +1 -0
  198. package/internal/utils/base64.d.mts +3 -0
  199. package/internal/utils/base64.d.mts.map +1 -0
  200. package/internal/utils/base64.d.ts +3 -0
  201. package/internal/utils/base64.d.ts.map +1 -0
  202. package/internal/utils/base64.js +38 -0
  203. package/internal/utils/base64.js.map +1 -0
  204. package/internal/utils/base64.mjs +33 -0
  205. package/internal/utils/base64.mjs.map +1 -0
  206. package/internal/utils/bytes.d.mts +4 -0
  207. package/internal/utils/bytes.d.mts.map +1 -0
  208. package/internal/utils/bytes.d.ts +4 -0
  209. package/internal/utils/bytes.d.ts.map +1 -0
  210. package/internal/utils/bytes.js +31 -0
  211. package/internal/utils/bytes.js.map +1 -0
  212. package/internal/utils/bytes.mjs +26 -0
  213. package/internal/utils/bytes.mjs.map +1 -0
  214. package/internal/utils/env.d.mts +9 -0
  215. package/internal/utils/env.d.mts.map +1 -0
  216. package/internal/utils/env.d.ts +9 -0
  217. package/internal/utils/env.d.ts.map +1 -0
  218. package/internal/utils/env.js +22 -0
  219. package/internal/utils/env.js.map +1 -0
  220. package/internal/utils/env.mjs +18 -0
  221. package/internal/utils/env.mjs.map +1 -0
  222. package/internal/utils/log.d.mts +37 -0
  223. package/internal/utils/log.d.mts.map +1 -0
  224. package/internal/utils/log.d.ts +37 -0
  225. package/internal/utils/log.d.ts.map +1 -0
  226. package/internal/utils/log.js +86 -0
  227. package/internal/utils/log.js.map +1 -0
  228. package/internal/utils/log.mjs +80 -0
  229. package/internal/utils/log.mjs.map +1 -0
  230. package/internal/utils/path.d.mts +15 -0
  231. package/internal/utils/path.d.mts.map +1 -0
  232. package/internal/utils/path.d.ts +15 -0
  233. package/internal/utils/path.d.ts.map +1 -0
  234. package/internal/utils/path.js +79 -0
  235. package/internal/utils/path.js.map +1 -0
  236. package/internal/utils/path.mjs +74 -0
  237. package/internal/utils/path.mjs.map +1 -0
  238. package/internal/utils/sleep.d.mts +2 -0
  239. package/internal/utils/sleep.d.mts.map +1 -0
  240. package/internal/utils/sleep.d.ts +2 -0
  241. package/internal/utils/sleep.d.ts.map +1 -0
  242. package/internal/utils/sleep.js +7 -0
  243. package/internal/utils/sleep.js.map +1 -0
  244. package/internal/utils/sleep.mjs +3 -0
  245. package/internal/utils/sleep.mjs.map +1 -0
  246. package/internal/utils/uuid.d.mts +5 -0
  247. package/internal/utils/uuid.d.mts.map +1 -0
  248. package/internal/utils/uuid.d.ts +5 -0
  249. package/internal/utils/uuid.d.ts.map +1 -0
  250. package/internal/utils/uuid.js +19 -0
  251. package/internal/utils/uuid.js.map +1 -0
  252. package/internal/utils/uuid.mjs +15 -0
  253. package/internal/utils/uuid.mjs.map +1 -0
  254. package/internal/utils/values.d.mts +18 -0
  255. package/internal/utils/values.d.mts.map +1 -0
  256. package/internal/utils/values.d.ts +18 -0
  257. package/internal/utils/values.d.ts.map +1 -0
  258. package/internal/utils/values.js +112 -0
  259. package/internal/utils/values.js.map +1 -0
  260. package/internal/utils/values.mjs +94 -0
  261. package/internal/utils/values.mjs.map +1 -0
  262. package/internal/utils.d.mts +7 -0
  263. package/internal/utils.d.mts.map +1 -0
  264. package/internal/utils.d.ts +7 -0
  265. package/internal/utils.d.ts.map +1 -0
  266. package/internal/utils.js +11 -0
  267. package/internal/utils.js.map +1 -0
  268. package/internal/utils.mjs +8 -0
  269. package/internal/utils.mjs.map +1 -0
  270. package/package.json +137 -0
  271. package/resource.d.mts +2 -0
  272. package/resource.d.mts.map +1 -0
  273. package/resource.d.ts +2 -0
  274. package/resource.d.ts.map +1 -0
  275. package/resource.js +6 -0
  276. package/resource.js.map +1 -0
  277. package/resource.mjs +2 -0
  278. package/resource.mjs.map +1 -0
  279. package/resources/files.d.mts +170 -0
  280. package/resources/files.d.mts.map +1 -0
  281. package/resources/files.d.ts +170 -0
  282. package/resources/files.d.ts.map +1 -0
  283. package/resources/files.js +39 -0
  284. package/resources/files.js.map +1 -0
  285. package/resources/files.mjs +35 -0
  286. package/resources/files.mjs.map +1 -0
  287. package/resources/icp.d.mts +162 -0
  288. package/resources/icp.d.mts.map +1 -0
  289. package/resources/icp.d.ts +162 -0
  290. package/resources/icp.d.ts.map +1 -0
  291. package/resources/icp.js +69 -0
  292. package/resources/icp.js.map +1 -0
  293. package/resources/icp.mjs +65 -0
  294. package/resources/icp.mjs.map +1 -0
  295. package/resources/index.d.mts +7 -0
  296. package/resources/index.d.mts.map +1 -0
  297. package/resources/index.d.ts +7 -0
  298. package/resources/index.d.ts.map +1 -0
  299. package/resources/index.js +17 -0
  300. package/resources/index.js.map +1 -0
  301. package/resources/index.mjs +8 -0
  302. package/resources/index.mjs.map +1 -0
  303. package/resources/run.d.mts +224 -0
  304. package/resources/run.d.mts.map +1 -0
  305. package/resources/run.d.ts +224 -0
  306. package/resources/run.d.ts.map +1 -0
  307. package/resources/run.js +107 -0
  308. package/resources/run.js.map +1 -0
  309. package/resources/run.mjs +103 -0
  310. package/resources/run.mjs.map +1 -0
  311. package/resources/sheet/entity.d.mts +52 -0
  312. package/resources/sheet/entity.d.mts.map +1 -0
  313. package/resources/sheet/entity.d.ts +52 -0
  314. package/resources/sheet/entity.d.ts.map +1 -0
  315. package/resources/sheet/entity.js +45 -0
  316. package/resources/sheet/entity.js.map +1 -0
  317. package/resources/sheet/entity.mjs +41 -0
  318. package/resources/sheet/entity.mjs.map +1 -0
  319. package/resources/sheet/index.d.mts +4 -0
  320. package/resources/sheet/index.d.mts.map +1 -0
  321. package/resources/sheet/index.d.ts +4 -0
  322. package/resources/sheet/index.d.ts.map +1 -0
  323. package/resources/sheet/index.js +11 -0
  324. package/resources/sheet/index.js.map +1 -0
  325. package/resources/sheet/index.mjs +5 -0
  326. package/resources/sheet/index.mjs.map +1 -0
  327. package/resources/sheet/schema.d.mts +207 -0
  328. package/resources/sheet/schema.d.mts.map +1 -0
  329. package/resources/sheet/schema.d.ts +207 -0
  330. package/resources/sheet/schema.d.ts.map +1 -0
  331. package/resources/sheet/schema.js +65 -0
  332. package/resources/sheet/schema.js.map +1 -0
  333. package/resources/sheet/schema.mjs +61 -0
  334. package/resources/sheet/schema.mjs.map +1 -0
  335. package/resources/sheet/sheet.d.mts +195 -0
  336. package/resources/sheet/sheet.d.mts.map +1 -0
  337. package/resources/sheet/sheet.d.ts +195 -0
  338. package/resources/sheet/sheet.d.ts.map +1 -0
  339. package/resources/sheet/sheet.js +90 -0
  340. package/resources/sheet/sheet.js.map +1 -0
  341. package/resources/sheet/sheet.mjs +85 -0
  342. package/resources/sheet/sheet.mjs.map +1 -0
  343. package/resources/sheet.d.mts +2 -0
  344. package/resources/sheet.d.mts.map +1 -0
  345. package/resources/sheet.d.ts +2 -0
  346. package/resources/sheet.d.ts.map +1 -0
  347. package/resources/sheet.js +6 -0
  348. package/resources/sheet.js.map +1 -0
  349. package/resources/sheet.mjs +3 -0
  350. package/resources/sheet.mjs.map +1 -0
  351. package/resources/signal.d.mts +79 -0
  352. package/resources/signal.d.mts.map +1 -0
  353. package/resources/signal.d.ts +79 -0
  354. package/resources/signal.d.ts.map +1 -0
  355. package/resources/signal.js +26 -0
  356. package/resources/signal.js.map +1 -0
  357. package/resources/signal.mjs +22 -0
  358. package/resources/signal.mjs.map +1 -0
  359. package/resources/task.d.mts +717 -0
  360. package/resources/task.d.mts.map +1 -0
  361. package/resources/task.d.ts +717 -0
  362. package/resources/task.d.ts.map +1 -0
  363. package/resources/task.js +108 -0
  364. package/resources/task.js.map +1 -0
  365. package/resources/task.mjs +104 -0
  366. package/resources/task.mjs.map +1 -0
  367. package/resources.d.mts +2 -0
  368. package/resources.d.mts.map +1 -0
  369. package/resources.d.ts +2 -0
  370. package/resources.d.ts.map +1 -0
  371. package/resources.js +5 -0
  372. package/resources.js.map +1 -0
  373. package/resources.mjs +2 -0
  374. package/resources.mjs.map +1 -0
  375. package/src/api-promise.ts +2 -0
  376. package/src/client.ts +877 -0
  377. package/src/core/README.md +3 -0
  378. package/src/core/api-promise.ts +92 -0
  379. package/src/core/error.ts +130 -0
  380. package/src/core/resource.ts +11 -0
  381. package/src/core/uploads.ts +2 -0
  382. package/src/error.ts +2 -0
  383. package/src/index.ts +22 -0
  384. package/src/internal/README.md +3 -0
  385. package/src/internal/builtin-types.ts +93 -0
  386. package/src/internal/detect-platform.ts +196 -0
  387. package/src/internal/errors.ts +33 -0
  388. package/src/internal/headers.ts +97 -0
  389. package/src/internal/parse.ts +50 -0
  390. package/src/internal/qs/LICENSE.md +13 -0
  391. package/src/internal/qs/README.md +3 -0
  392. package/src/internal/qs/formats.ts +10 -0
  393. package/src/internal/qs/index.ts +13 -0
  394. package/src/internal/qs/stringify.ts +385 -0
  395. package/src/internal/qs/types.ts +71 -0
  396. package/src/internal/qs/utils.ts +265 -0
  397. package/src/internal/request-options.ts +91 -0
  398. package/src/internal/shim-types.ts +26 -0
  399. package/src/internal/shims.ts +107 -0
  400. package/src/internal/to-file.ts +154 -0
  401. package/src/internal/types.ts +95 -0
  402. package/src/internal/uploads.ts +187 -0
  403. package/src/internal/utils/base64.ts +40 -0
  404. package/src/internal/utils/bytes.ts +32 -0
  405. package/src/internal/utils/env.ts +18 -0
  406. package/src/internal/utils/log.ts +127 -0
  407. package/src/internal/utils/path.ts +88 -0
  408. package/src/internal/utils/sleep.ts +3 -0
  409. package/src/internal/utils/uuid.ts +17 -0
  410. package/src/internal/utils/values.ts +105 -0
  411. package/src/internal/utils.ts +8 -0
  412. package/src/lib/.keep +4 -0
  413. package/src/resource.ts +2 -0
  414. package/src/resources/files.ts +219 -0
  415. package/src/resources/icp.ts +227 -0
  416. package/src/resources/index.ts +64 -0
  417. package/src/resources/run.ts +293 -0
  418. package/src/resources/sheet/entity.ts +97 -0
  419. package/src/resources/sheet/index.ts +30 -0
  420. package/src/resources/sheet/schema.ts +246 -0
  421. package/src/resources/sheet/sheet.ts +318 -0
  422. package/src/resources/sheet.ts +3 -0
  423. package/src/resources/signal.ts +117 -0
  424. package/src/resources/task.ts +912 -0
  425. package/src/resources.ts +1 -0
  426. package/src/tsconfig.json +11 -0
  427. package/src/uploads.ts +2 -0
  428. package/src/version.ts +1 -0
  429. package/uploads.d.mts +2 -0
  430. package/uploads.d.mts.map +1 -0
  431. package/uploads.d.ts +2 -0
  432. package/uploads.d.ts.map +1 -0
  433. package/uploads.js +6 -0
  434. package/uploads.js.map +1 -0
  435. package/uploads.mjs +2 -0
  436. package/uploads.mjs.map +1 -0
  437. package/version.d.mts +2 -0
  438. package/version.d.mts.map +1 -0
  439. package/version.d.ts +2 -0
  440. package/version.d.ts.map +1 -0
  441. package/version.js +5 -0
  442. package/version.js.map +1 -0
  443. package/version.mjs +2 -0
  444. package/version.mjs.map +1 -0
@@ -0,0 +1,293 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { buildHeaders } from '../internal/headers';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class Run extends APIResource {
10
+ /**
11
+ * Execute an agent by creating a new run.
12
+ *
13
+ * Creates a new workflow execution asynchronously. Prefer using POST
14
+ * /v1/task/{task_id}/execute for task-based workflows.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const run = await client.run.create({
19
+ * agent_id: '5eb7cf5a86d9755df3a6c593',
20
+ * parameters: { foo: 'bar' },
21
+ * });
22
+ * ```
23
+ */
24
+ create(body: RunCreateParams, options?: RequestOptions): APIPromise<RunCreateResponse> {
25
+ return this._client.post('/v1/run', { body, ...options });
26
+ }
27
+
28
+ /**
29
+ * Get a specific run by ID.
30
+ *
31
+ * Automatically refreshes status from Prefect if the run is still active.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const run = await client.run.retrieve(
36
+ * '5eb7cf5a86d9755df3a6c593',
37
+ * );
38
+ * ```
39
+ */
40
+ retrieve(runID: string, options?: RequestOptions): APIPromise<RunRetrieveResponse> {
41
+ return this._client.get(path`/v1/run/${runID}`, options);
42
+ }
43
+
44
+ /**
45
+ * List all runs for the organization.
46
+ *
47
+ * Runs are workflow executions created from tasks. Filter by status to find active
48
+ * runs (RUNNING, PENDING) or completed ones (COMPLETED, FAILED).
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const runs = await client.run.list();
53
+ * ```
54
+ */
55
+ list(query: RunListParams | null | undefined = {}, options?: RequestOptions): APIPromise<RunListResponse> {
56
+ return this._client.get('/v1/run', { query, ...options });
57
+ }
58
+
59
+ /**
60
+ * Delete a run.
61
+ *
62
+ * Permanently deletes the run record. This operation cannot be undone.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * await client.run.delete('5eb7cf5a86d9755df3a6c593');
67
+ * ```
68
+ */
69
+ delete(runID: string, options?: RequestOptions): APIPromise<void> {
70
+ return this._client.delete(path`/v1/run/${runID}`, {
71
+ ...options,
72
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
73
+ });
74
+ }
75
+
76
+ /**
77
+ * Cancel a running workflow.
78
+ *
79
+ * Cancels both the Prefect flow and updates the database record. Only effective
80
+ * for non-terminal runs.
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * await client.run.cancel('5eb7cf5a86d9755df3a6c593');
85
+ * ```
86
+ */
87
+ cancel(runID: string, options?: RequestOptions): APIPromise<void> {
88
+ return this._client.post(path`/v1/run/${runID}/cancel`, {
89
+ ...options,
90
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
91
+ });
92
+ }
93
+
94
+ /**
95
+ * Get the queue status for a run.
96
+ *
97
+ * Shows entities being processed by the workflow. States: queued (waiting),
98
+ * processing (active), completed (done), discarded (skipped). Set
99
+ * include_history=true to see all processed entities.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const response = await client.run.getQueue(
104
+ * '5eb7cf5a86d9755df3a6c593',
105
+ * );
106
+ * ```
107
+ */
108
+ getQueue(
109
+ runID: string,
110
+ query: RunGetQueueParams | null | undefined = {},
111
+ options?: RequestOptions,
112
+ ): APIPromise<RunGetQueueResponse> {
113
+ return this._client.get(path`/v1/run/${runID}/queue`, { query, ...options });
114
+ }
115
+ }
116
+
117
+ export type RunCreateResponse = { [key: string]: unknown };
118
+
119
+ export type RunRetrieveResponse = { [key: string]: unknown };
120
+
121
+ /**
122
+ * Response schema for paginated list of agent runs.
123
+ *
124
+ * Follows the established pattern from other list endpoints:
125
+ *
126
+ * - SheetListResponse (src/api/schema/sheet.py)
127
+ * - ICPListResponse (src/api/schema/icp.py)
128
+ *
129
+ * Attributes: runs: List of AgentRun objects for the current page total: Total
130
+ * number of runs matching the filter criteria page: Current page number (1-based)
131
+ * page_size: Number of items per page
132
+ */
133
+ export interface RunListResponse {
134
+ page: number;
135
+
136
+ page_size: number;
137
+
138
+ runs: Array<{ [key: string]: unknown }>;
139
+
140
+ total: number;
141
+ }
142
+
143
+ /**
144
+ * Response schema for run queue status with optional history.
145
+ *
146
+ * Provides a read-only view into the current state of a run's entity queue,
147
+ * including queued entities, processing history, and statistics.
148
+ *
149
+ * Attributes: entities: List of entities (current queue or full history based on
150
+ * request) stats: Queue statistics or state counts total: Total number of entities
151
+ * returned offset: Offset used for pagination (0-indexed) limit: Maximum number of
152
+ * entities returned state_counts: Optional breakdown of entities by state
153
+ * include_history: Whether response includes historical data
154
+ */
155
+ export interface RunGetQueueResponse {
156
+ entities: Array<{ [key: string]: unknown }>;
157
+
158
+ limit: number;
159
+
160
+ offset: number;
161
+
162
+ stats: { [key: string]: unknown };
163
+
164
+ total: number;
165
+
166
+ include_history?: boolean;
167
+
168
+ state_counts?: { [key: string]: number } | null;
169
+ }
170
+
171
+ export interface RunCreateParams {
172
+ agent_id: string;
173
+
174
+ parameters: { [key: string]: unknown };
175
+
176
+ icp_id?: string | null;
177
+ }
178
+
179
+ export interface RunListParams {
180
+ /**
181
+ * Filter by agent ID (legacy)
182
+ */
183
+ agent_id?: string | null;
184
+
185
+ /**
186
+ * Filter by agent type
187
+ */
188
+ agent_type?: string | null;
189
+
190
+ /**
191
+ * Filter runs created after this date (ISO 8601 format: 2024-01-15T10:30:00Z)
192
+ */
193
+ created_after?: string | null;
194
+
195
+ /**
196
+ * Filter runs created before this date (ISO 8601 format)
197
+ */
198
+ created_before?: string | null;
199
+
200
+ /**
201
+ * Filter by ICP ID
202
+ */
203
+ icp_id?: string | null;
204
+
205
+ /**
206
+ * Sort order: -1 for descending, 1 for ascending
207
+ */
208
+ order?: number | null;
209
+
210
+ /**
211
+ * Page number (1-based)
212
+ */
213
+ page?: number;
214
+
215
+ /**
216
+ * Items per page (max 100)
217
+ */
218
+ page_size?: number;
219
+
220
+ /**
221
+ * Field to sort by (e.g., 'created_at', 'updated_at', 'agent_type')
222
+ */
223
+ sort_by?: string | null;
224
+
225
+ /**
226
+ * Filter by run status (SCHEDULED, PENDING, RUNNING, COMPLETED, FAILED, CANCELED,
227
+ * CRASHED, PAUSED)
228
+ */
229
+ status?:
230
+ | 'SCHEDULED'
231
+ | 'PENDING'
232
+ | 'RUNNING'
233
+ | 'COMPLETED'
234
+ | 'FAILED'
235
+ | 'CANCELED'
236
+ | 'CRASHED'
237
+ | 'PAUSED'
238
+ | null;
239
+
240
+ /**
241
+ * Filter by task ID
242
+ */
243
+ task_id?: string | null;
244
+
245
+ /**
246
+ * Filter by task type (signal, search, profile, ingest)
247
+ */
248
+ task_type?: string | null;
249
+
250
+ /**
251
+ * Filter runs updated after this date (ISO 8601 format)
252
+ */
253
+ updated_after?: string | null;
254
+
255
+ /**
256
+ * Filter runs updated before this date (ISO 8601 format)
257
+ */
258
+ updated_before?: string | null;
259
+ }
260
+
261
+ export interface RunGetQueueParams {
262
+ /**
263
+ * Include processing history from all states
264
+ */
265
+ include_history?: boolean;
266
+
267
+ /**
268
+ * Maximum number of entities to return
269
+ */
270
+ limit?: number;
271
+
272
+ /**
273
+ * Starting position in queue (0-indexed)
274
+ */
275
+ offset?: number;
276
+
277
+ /**
278
+ * Filter by state: queued, processing, completed, discarded
279
+ */
280
+ state?: string | null;
281
+ }
282
+
283
+ export declare namespace Run {
284
+ export {
285
+ type RunCreateResponse as RunCreateResponse,
286
+ type RunRetrieveResponse as RunRetrieveResponse,
287
+ type RunListResponse as RunListResponse,
288
+ type RunGetQueueResponse as RunGetQueueResponse,
289
+ type RunCreateParams as RunCreateParams,
290
+ type RunListParams as RunListParams,
291
+ type RunGetQueueParams as RunGetQueueParams,
292
+ };
293
+ }
@@ -0,0 +1,97 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Entity extends APIResource {
10
+ /**
11
+ * Get a specific entity from a sheet.
12
+ */
13
+ retrieve(
14
+ entityID: string,
15
+ params: EntityRetrieveParams,
16
+ options?: RequestOptions,
17
+ ): APIPromise<EntityRetrieveResponse> {
18
+ const { sheet_id } = params;
19
+ return this._client.get(path`/v1/sheet/${sheet_id}/entity/${entityID}`, options);
20
+ }
21
+
22
+ /**
23
+ * Update the comments on an entity.
24
+ *
25
+ * Pass null to clear existing comments.
26
+ */
27
+ updateComments(
28
+ entityID: string,
29
+ params: EntityUpdateCommentsParams,
30
+ options?: RequestOptions,
31
+ ): APIPromise<void> {
32
+ const { sheet_id, ...body } = params;
33
+ return this._client.put(path`/v1/sheet/${sheet_id}/entity/${entityID}/comments`, {
34
+ body,
35
+ ...options,
36
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
37
+ });
38
+ }
39
+
40
+ /**
41
+ * Update the status of an entity.
42
+ *
43
+ * Use status to mark entities as qualified (true) or disqualified (false) from
44
+ * your target list.
45
+ */
46
+ updateStatus(
47
+ entityID: string,
48
+ params: EntityUpdateStatusParams,
49
+ options?: RequestOptions,
50
+ ): APIPromise<void> {
51
+ const { sheet_id, ...body } = params;
52
+ return this._client.put(path`/v1/sheet/${sheet_id}/entity/${entityID}/status`, {
53
+ body,
54
+ ...options,
55
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
56
+ });
57
+ }
58
+ }
59
+
60
+ export type EntityRetrieveResponse = { [key: string]: unknown };
61
+
62
+ export interface EntityRetrieveParams {
63
+ sheet_id: string;
64
+ }
65
+
66
+ export interface EntityUpdateCommentsParams {
67
+ /**
68
+ * Path param:
69
+ */
70
+ sheet_id: string;
71
+
72
+ /**
73
+ * Body param: Comments for the entity
74
+ */
75
+ comments?: string | null;
76
+ }
77
+
78
+ export interface EntityUpdateStatusParams {
79
+ /**
80
+ * Path param:
81
+ */
82
+ sheet_id: string;
83
+
84
+ /**
85
+ * Body param:
86
+ */
87
+ status: boolean;
88
+ }
89
+
90
+ export declare namespace Entity {
91
+ export {
92
+ type EntityRetrieveResponse as EntityRetrieveResponse,
93
+ type EntityRetrieveParams as EntityRetrieveParams,
94
+ type EntityUpdateCommentsParams as EntityUpdateCommentsParams,
95
+ type EntityUpdateStatusParams as EntityUpdateStatusParams,
96
+ };
97
+ }
@@ -0,0 +1,30 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Entity,
5
+ type EntityRetrieveResponse,
6
+ type EntityRetrieveParams,
7
+ type EntityUpdateCommentsParams,
8
+ type EntityUpdateStatusParams,
9
+ } from './entity';
10
+ export {
11
+ Schema,
12
+ type SchemaGetResponse,
13
+ type SchemaGetDefaultResponse,
14
+ type SchemaGetFieldDefinitionsResponse,
15
+ type SchemaAddFieldsParams,
16
+ type SchemaDeleteFieldsParams,
17
+ } from './schema';
18
+ export {
19
+ SheetResource,
20
+ type EntityType,
21
+ type Sheet,
22
+ type SheetListResponse,
23
+ type SheetExportCsvResponse,
24
+ type SheetGetEntitiesResponse,
25
+ type SheetCreateParams,
26
+ type SheetUpdateParams,
27
+ type SheetListParams,
28
+ type SheetExportCsvParams,
29
+ type SheetGetEntitiesParams,
30
+ } from './sheet';
@@ -0,0 +1,246 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Schema extends APIResource {
10
+ /**
11
+ * Add custom fields to a sheet's entity schema.
12
+ *
13
+ * Custom fields extend the default schema to capture additional data points for
14
+ * entities in this sheet.
15
+ */
16
+ addFields(sheetID: string, body: SchemaAddFieldsParams, options?: RequestOptions): APIPromise<void> {
17
+ return this._client.put(path`/v1/sheet/schema/${sheetID}`, {
18
+ body,
19
+ ...options,
20
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
21
+ });
22
+ }
23
+
24
+ /**
25
+ * Remove custom fields from a sheet's entity schema.
26
+ *
27
+ * Only custom fields can be removed; default fields cannot be deleted. Existing
28
+ * entity data in removed fields remains in the database but becomes inaccessible.
29
+ */
30
+ deleteFields(sheetID: string, body: SchemaDeleteFieldsParams, options?: RequestOptions): APIPromise<void> {
31
+ return this._client.delete(path`/v1/sheet/schema/${sheetID}`, {
32
+ body,
33
+ ...options,
34
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
35
+ });
36
+ }
37
+
38
+ /**
39
+ * Get the schema for a specific sheet.
40
+ *
41
+ * Returns the sheet's current schema including default fields and any custom
42
+ * fields that have been added.
43
+ */
44
+ get(sheetID: string, options?: RequestOptions): APIPromise<SchemaGetResponse> {
45
+ return this._client.get(path`/v1/sheet/schema/${sheetID}`, options);
46
+ }
47
+
48
+ /**
49
+ * Get the default schemas for all entity types.
50
+ *
51
+ * Returns JSON Schema definitions for company, person, job_board, and
52
+ * school_district entity types. Use this to understand the standard fields
53
+ * available before adding custom fields.
54
+ */
55
+ getDefault(options?: RequestOptions): APIPromise<SchemaGetDefaultResponse> {
56
+ return this._client.get('/v1/sheet/schema/default', options);
57
+ }
58
+
59
+ /**
60
+ * Get the available field type definitions.
61
+ *
62
+ * Returns JSON Schema definitions for field types that can be used when adding
63
+ * custom fields to sheets.
64
+ */
65
+ getFieldDefinitions(options?: RequestOptions): APIPromise<SchemaGetFieldDefinitionsResponse> {
66
+ return this._client.get('/v1/sheet/schema/field', options);
67
+ }
68
+ }
69
+
70
+ /**
71
+ * JSON schema for the sheet.
72
+ */
73
+ export interface SchemaGetResponse {
74
+ /**
75
+ * The title of the schema
76
+ */
77
+ title: string;
78
+
79
+ /**
80
+ * The type of the schema
81
+ */
82
+ type: string;
83
+
84
+ /**
85
+ * Definitions for nested schemas
86
+ */
87
+ $defs?: { [key: string]: unknown };
88
+
89
+ /**
90
+ * The properties of the schema
91
+ */
92
+ properties?: { [key: string]: unknown };
93
+
94
+ /**
95
+ * Required fields in the schema
96
+ */
97
+ required?: Array<string>;
98
+ }
99
+
100
+ /**
101
+ * List of default schemas for sheets.
102
+ */
103
+ export interface SchemaGetDefaultResponse {
104
+ schemas: { [key: string]: SchemaGetDefaultResponse.Schemas };
105
+ }
106
+
107
+ export namespace SchemaGetDefaultResponse {
108
+ /**
109
+ * JSON schema for the sheet.
110
+ */
111
+ export interface Schemas {
112
+ /**
113
+ * The title of the schema
114
+ */
115
+ title: string;
116
+
117
+ /**
118
+ * The type of the schema
119
+ */
120
+ type: string;
121
+
122
+ /**
123
+ * Definitions for nested schemas
124
+ */
125
+ $defs?: { [key: string]: unknown };
126
+
127
+ /**
128
+ * The properties of the schema
129
+ */
130
+ properties?: { [key: string]: unknown };
131
+
132
+ /**
133
+ * Required fields in the schema
134
+ */
135
+ required?: Array<string>;
136
+ }
137
+ }
138
+
139
+ /**
140
+ * List of default field definitions for sheets.
141
+ */
142
+ export interface SchemaGetFieldDefinitionsResponse {
143
+ fields: { [key: string]: SchemaGetFieldDefinitionsResponse.Fields };
144
+ }
145
+
146
+ export namespace SchemaGetFieldDefinitionsResponse {
147
+ /**
148
+ * JSON schema for the sheet.
149
+ */
150
+ export interface Fields {
151
+ /**
152
+ * The title of the schema
153
+ */
154
+ title: string;
155
+
156
+ /**
157
+ * The type of the schema
158
+ */
159
+ type: string;
160
+
161
+ /**
162
+ * Definitions for nested schemas
163
+ */
164
+ $defs?: { [key: string]: unknown };
165
+
166
+ /**
167
+ * The properties of the schema
168
+ */
169
+ properties?: { [key: string]: unknown };
170
+
171
+ /**
172
+ * Required fields in the schema
173
+ */
174
+ required?: Array<string>;
175
+ }
176
+ }
177
+
178
+ export interface SchemaAddFieldsParams {
179
+ fields: Array<SchemaAddFieldsParams.Field>;
180
+ }
181
+
182
+ export namespace SchemaAddFieldsParams {
183
+ /**
184
+ * Definition for a custom field in a sheet.
185
+ */
186
+ export interface Field {
187
+ /**
188
+ * Field type
189
+ */
190
+ field_type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'reference' | 'enum';
191
+
192
+ /**
193
+ * Field name
194
+ */
195
+ name: string;
196
+
197
+ /**
198
+ * Additional JSON schema properties
199
+ */
200
+ additional_props?: { [key: string]: unknown };
201
+
202
+ /**
203
+ * Schema for array items when field_type is ARRAY
204
+ */
205
+ array_items?: { [key: string]: unknown } | null;
206
+
207
+ /**
208
+ * Field description
209
+ */
210
+ description?: string;
211
+
212
+ /**
213
+ * List of allowed values when field_type is ENUM
214
+ */
215
+ enum_values?: Array<unknown> | null;
216
+
217
+ /**
218
+ * Properties for object fields when field_type is OBJECT
219
+ */
220
+ properties?: { [key: string]: unknown } | null;
221
+
222
+ /**
223
+ * Referenced model name when field_type is REFERENCE
224
+ */
225
+ reference_model?: string | null;
226
+
227
+ /**
228
+ * Whether field is required - always false for custom fields
229
+ */
230
+ required?: boolean;
231
+ }
232
+ }
233
+
234
+ export interface SchemaDeleteFieldsParams {
235
+ fields: Array<string>;
236
+ }
237
+
238
+ export declare namespace Schema {
239
+ export {
240
+ type SchemaGetResponse as SchemaGetResponse,
241
+ type SchemaGetDefaultResponse as SchemaGetDefaultResponse,
242
+ type SchemaGetFieldDefinitionsResponse as SchemaGetFieldDefinitionsResponse,
243
+ type SchemaAddFieldsParams as SchemaAddFieldsParams,
244
+ type SchemaDeleteFieldsParams as SchemaDeleteFieldsParams,
245
+ };
246
+ }