@arcadeai/arcadejs 1.15.0 → 2.1.1

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 (624) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +143 -42
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/bin/cli +53 -0
  12. package/bin/migration-config.json +6 -0
  13. package/client.d.mts +201 -0
  14. package/client.d.mts.map +1 -0
  15. package/client.d.ts +201 -0
  16. package/client.d.ts.map +1 -0
  17. package/client.js +473 -0
  18. package/client.js.map +1 -0
  19. package/client.mjs +469 -0
  20. package/client.mjs.map +1 -0
  21. package/core/api-promise.d.mts +46 -0
  22. package/core/api-promise.d.mts.map +1 -0
  23. package/core/api-promise.d.ts +46 -0
  24. package/core/api-promise.d.ts.map +1 -0
  25. package/core/api-promise.js +74 -0
  26. package/core/api-promise.js.map +1 -0
  27. package/core/api-promise.mjs +70 -0
  28. package/core/api-promise.mjs.map +1 -0
  29. package/core/error.d.mts +46 -0
  30. package/core/error.d.mts.map +1 -0
  31. package/core/error.d.ts +46 -0
  32. package/core/error.d.ts.map +1 -0
  33. package/core/error.js +113 -0
  34. package/core/error.js.map +1 -0
  35. package/core/error.mjs +97 -0
  36. package/core/error.mjs.map +1 -0
  37. package/core/pagination.d.mts +62 -0
  38. package/core/pagination.d.mts.map +1 -0
  39. package/core/pagination.d.ts +62 -0
  40. package/core/pagination.d.ts.map +1 -0
  41. package/core/pagination.js +111 -0
  42. package/core/pagination.js.map +1 -0
  43. package/core/pagination.mjs +105 -0
  44. package/core/pagination.mjs.map +1 -0
  45. package/core/resource.d.mts +6 -0
  46. package/core/resource.d.mts.map +1 -0
  47. package/core/resource.d.ts +6 -0
  48. package/core/resource.d.ts.map +1 -0
  49. package/core/resource.js +11 -0
  50. package/core/resource.js.map +1 -0
  51. package/core/resource.mjs +7 -0
  52. package/core/resource.mjs.map +1 -0
  53. package/core/uploads.d.mts +3 -0
  54. package/core/uploads.d.mts.map +1 -0
  55. package/core/uploads.d.ts +3 -0
  56. package/core/uploads.d.ts.map +1 -0
  57. package/core/uploads.js +6 -0
  58. package/core/uploads.js.map +1 -0
  59. package/core/uploads.mjs +2 -0
  60. package/core/uploads.mjs.map +1 -0
  61. package/error.d.mts +2 -0
  62. package/error.d.mts.map +1 -0
  63. package/error.d.ts +1 -46
  64. package/error.d.ts.map +1 -1
  65. package/error.js +3 -110
  66. package/error.js.map +1 -1
  67. package/error.mjs +1 -96
  68. package/error.mjs.map +1 -1
  69. package/index.d.mts +7 -136
  70. package/index.d.mts.map +1 -0
  71. package/index.d.ts +6 -135
  72. package/index.d.ts.map +1 -1
  73. package/index.js +14 -140
  74. package/index.js.map +1 -1
  75. package/index.mjs +6 -103
  76. package/index.mjs.map +1 -1
  77. package/internal/builtin-types.d.mts +73 -0
  78. package/internal/builtin-types.d.mts.map +1 -0
  79. package/internal/builtin-types.d.ts +73 -0
  80. package/internal/builtin-types.d.ts.map +1 -0
  81. package/internal/builtin-types.js +4 -0
  82. package/internal/builtin-types.js.map +1 -0
  83. package/internal/builtin-types.mjs +3 -0
  84. package/internal/builtin-types.mjs.map +1 -0
  85. package/internal/detect-platform.d.mts +15 -0
  86. package/internal/detect-platform.d.mts.map +1 -0
  87. package/internal/detect-platform.d.ts +15 -0
  88. package/internal/detect-platform.d.ts.map +1 -0
  89. package/internal/detect-platform.js +162 -0
  90. package/internal/detect-platform.js.map +1 -0
  91. package/internal/detect-platform.mjs +157 -0
  92. package/internal/detect-platform.mjs.map +1 -0
  93. package/internal/errors.d.mts +3 -0
  94. package/internal/errors.d.mts.map +1 -0
  95. package/internal/errors.d.ts +3 -0
  96. package/internal/errors.d.ts.map +1 -0
  97. package/internal/errors.js +41 -0
  98. package/internal/errors.js.map +1 -0
  99. package/internal/errors.mjs +36 -0
  100. package/internal/errors.mjs.map +1 -0
  101. package/internal/headers.d.mts +20 -0
  102. package/internal/headers.d.mts.map +1 -0
  103. package/internal/headers.d.ts +20 -0
  104. package/internal/headers.d.ts.map +1 -0
  105. package/internal/headers.js +79 -0
  106. package/internal/headers.js.map +1 -0
  107. package/internal/headers.mjs +74 -0
  108. package/internal/headers.mjs.map +1 -0
  109. package/internal/parse.d.mts +12 -0
  110. package/internal/parse.d.mts.map +1 -0
  111. package/internal/parse.d.ts +12 -0
  112. package/internal/parse.d.ts.map +1 -0
  113. package/internal/parse.js +40 -0
  114. package/internal/parse.js.map +1 -0
  115. package/internal/parse.mjs +37 -0
  116. package/internal/parse.mjs.map +1 -0
  117. package/internal/qs/formats.d.mts +7 -0
  118. package/internal/qs/formats.d.mts.map +1 -0
  119. package/internal/qs/formats.d.ts +1 -0
  120. package/internal/qs/formats.d.ts.map +1 -1
  121. package/internal/qs/formats.js +4 -2
  122. package/internal/qs/formats.js.map +1 -1
  123. package/internal/qs/formats.mjs +2 -1
  124. package/internal/qs/formats.mjs.map +1 -1
  125. package/internal/qs/index.d.mts +10 -0
  126. package/internal/qs/index.d.mts.map +1 -0
  127. package/internal/qs/index.d.ts.map +1 -1
  128. package/internal/qs/stringify.d.mts +3 -0
  129. package/internal/qs/stringify.d.mts.map +1 -0
  130. package/internal/qs/stringify.d.ts.map +1 -1
  131. package/internal/qs/stringify.js +15 -17
  132. package/internal/qs/stringify.js.map +1 -1
  133. package/internal/qs/stringify.mjs +17 -19
  134. package/internal/qs/stringify.mjs.map +1 -1
  135. package/internal/qs/types.d.mts +57 -0
  136. package/internal/qs/types.d.mts.map +1 -0
  137. package/internal/qs/utils.d.mts +15 -0
  138. package/internal/qs/utils.d.mts.map +1 -0
  139. package/internal/qs/utils.d.ts +1 -0
  140. package/internal/qs/utils.d.ts.map +1 -1
  141. package/internal/qs/utils.js +14 -13
  142. package/internal/qs/utils.js.map +1 -1
  143. package/internal/qs/utils.mjs +12 -12
  144. package/internal/qs/utils.mjs.map +1 -1
  145. package/internal/request-options.d.mts +75 -0
  146. package/internal/request-options.d.mts.map +1 -0
  147. package/internal/request-options.d.ts +75 -0
  148. package/internal/request-options.d.ts.map +1 -0
  149. package/internal/request-options.js +14 -0
  150. package/internal/request-options.js.map +1 -0
  151. package/internal/request-options.mjs +10 -0
  152. package/internal/request-options.mjs.map +1 -0
  153. package/internal/shim-types.d.mts +17 -0
  154. package/internal/shim-types.d.mts.map +1 -0
  155. package/internal/shim-types.d.ts +17 -0
  156. package/internal/shim-types.d.ts.map +1 -0
  157. package/internal/shim-types.js +4 -0
  158. package/internal/shim-types.js.map +1 -0
  159. package/internal/shim-types.mjs +3 -0
  160. package/internal/shim-types.mjs.map +1 -0
  161. package/internal/shims.d.mts +20 -0
  162. package/internal/shims.d.mts.map +1 -0
  163. package/internal/shims.d.ts +20 -0
  164. package/internal/shims.d.ts.map +1 -0
  165. package/internal/shims.js +92 -0
  166. package/internal/shims.js.map +1 -0
  167. package/internal/shims.mjs +85 -0
  168. package/internal/shims.mjs.map +1 -0
  169. package/internal/to-file.d.mts +45 -0
  170. package/internal/to-file.d.mts.map +1 -0
  171. package/internal/to-file.d.ts +45 -0
  172. package/internal/to-file.d.ts.map +1 -0
  173. package/internal/to-file.js +91 -0
  174. package/internal/to-file.js.map +1 -0
  175. package/internal/to-file.mjs +88 -0
  176. package/internal/to-file.mjs.map +1 -0
  177. package/internal/tslib.js +81 -0
  178. package/internal/tslib.mjs +17 -0
  179. package/internal/types.d.mts +69 -0
  180. package/internal/types.d.mts.map +1 -0
  181. package/internal/types.d.ts +69 -0
  182. package/internal/types.d.ts.map +1 -0
  183. package/internal/types.js +4 -0
  184. package/internal/types.js.map +1 -0
  185. package/internal/types.mjs +3 -0
  186. package/internal/types.mjs.map +1 -0
  187. package/internal/uploads.d.mts +42 -0
  188. package/internal/uploads.d.mts.map +1 -0
  189. package/internal/uploads.d.ts +42 -0
  190. package/internal/uploads.d.ts.map +1 -0
  191. package/internal/uploads.js +141 -0
  192. package/internal/uploads.js.map +1 -0
  193. package/internal/uploads.mjs +131 -0
  194. package/internal/uploads.mjs.map +1 -0
  195. package/internal/utils/base64.d.mts +3 -0
  196. package/internal/utils/base64.d.mts.map +1 -0
  197. package/internal/utils/base64.d.ts +3 -0
  198. package/internal/utils/base64.d.ts.map +1 -0
  199. package/internal/utils/base64.js +38 -0
  200. package/internal/utils/base64.js.map +1 -0
  201. package/internal/utils/base64.mjs +33 -0
  202. package/internal/utils/base64.mjs.map +1 -0
  203. package/internal/utils/bytes.d.mts +4 -0
  204. package/internal/utils/bytes.d.mts.map +1 -0
  205. package/internal/utils/bytes.d.ts +4 -0
  206. package/internal/utils/bytes.d.ts.map +1 -0
  207. package/internal/utils/bytes.js +31 -0
  208. package/internal/utils/bytes.js.map +1 -0
  209. package/internal/utils/bytes.mjs +26 -0
  210. package/internal/utils/bytes.mjs.map +1 -0
  211. package/internal/utils/env.d.mts +9 -0
  212. package/internal/utils/env.d.mts.map +1 -0
  213. package/internal/utils/env.d.ts +9 -0
  214. package/internal/utils/env.d.ts.map +1 -0
  215. package/internal/utils/env.js +22 -0
  216. package/internal/utils/env.js.map +1 -0
  217. package/internal/utils/env.mjs +18 -0
  218. package/internal/utils/env.mjs.map +1 -0
  219. package/internal/utils/log.d.mts +37 -0
  220. package/internal/utils/log.d.mts.map +1 -0
  221. package/internal/utils/log.d.ts +37 -0
  222. package/internal/utils/log.d.ts.map +1 -0
  223. package/internal/utils/log.js +85 -0
  224. package/internal/utils/log.js.map +1 -0
  225. package/internal/utils/log.mjs +79 -0
  226. package/internal/utils/log.mjs.map +1 -0
  227. package/internal/utils/path.d.mts +15 -0
  228. package/internal/utils/path.d.mts.map +1 -0
  229. package/internal/utils/path.d.ts +15 -0
  230. package/internal/utils/path.d.ts.map +1 -0
  231. package/internal/utils/path.js +79 -0
  232. package/internal/utils/path.js.map +1 -0
  233. package/internal/utils/path.mjs +74 -0
  234. package/internal/utils/path.mjs.map +1 -0
  235. package/internal/utils/sleep.d.mts +2 -0
  236. package/internal/utils/sleep.d.mts.map +1 -0
  237. package/internal/utils/sleep.d.ts +2 -0
  238. package/internal/utils/sleep.d.ts.map +1 -0
  239. package/internal/utils/sleep.js +7 -0
  240. package/internal/utils/sleep.js.map +1 -0
  241. package/internal/utils/sleep.mjs +3 -0
  242. package/internal/utils/sleep.mjs.map +1 -0
  243. package/internal/utils/uuid.d.mts +5 -0
  244. package/internal/utils/uuid.d.mts.map +1 -0
  245. package/internal/utils/uuid.d.ts +5 -0
  246. package/internal/utils/uuid.d.ts.map +1 -0
  247. package/internal/utils/uuid.js +19 -0
  248. package/internal/utils/uuid.js.map +1 -0
  249. package/internal/utils/uuid.mjs +15 -0
  250. package/internal/utils/uuid.mjs.map +1 -0
  251. package/internal/utils/values.d.mts +18 -0
  252. package/internal/utils/values.d.mts.map +1 -0
  253. package/internal/utils/values.d.ts +18 -0
  254. package/internal/utils/values.d.ts.map +1 -0
  255. package/internal/utils/values.js +112 -0
  256. package/internal/utils/values.js.map +1 -0
  257. package/internal/utils/values.mjs +94 -0
  258. package/internal/utils/values.mjs.map +1 -0
  259. package/internal/utils.d.mts +7 -0
  260. package/internal/utils.d.mts.map +1 -0
  261. package/internal/utils.d.ts +7 -0
  262. package/internal/utils.d.ts.map +1 -0
  263. package/internal/utils.js +11 -0
  264. package/internal/utils.js.map +1 -0
  265. package/internal/utils.mjs +8 -0
  266. package/internal/utils.mjs.map +1 -0
  267. package/lib/index.d.mts +3 -0
  268. package/lib/index.d.mts.map +1 -0
  269. package/lib/index.d.ts.map +1 -1
  270. package/lib/index.js +3 -16
  271. package/lib/index.js.map +1 -1
  272. package/lib/zod/types.d.mts +75 -0
  273. package/lib/zod/types.d.mts.map +1 -0
  274. package/lib/zod/types.d.ts.map +1 -1
  275. package/lib/zod/zod.d.mts +50 -0
  276. package/lib/zod/zod.d.mts.map +1 -0
  277. package/lib/zod/zod.d.ts.map +1 -1
  278. package/package.json +130 -79
  279. package/pagination.d.mts +2 -0
  280. package/pagination.d.mts.map +1 -0
  281. package/pagination.d.ts +1 -25
  282. package/pagination.d.ts.map +1 -1
  283. package/pagination.js +3 -43
  284. package/pagination.js.map +1 -1
  285. package/pagination.mjs +1 -41
  286. package/pagination.mjs.map +1 -1
  287. package/resource.d.mts +2 -0
  288. package/resource.d.mts.map +1 -0
  289. package/resource.d.ts +1 -5
  290. package/resource.d.ts.map +1 -1
  291. package/resource.js +3 -8
  292. package/resource.js.map +1 -1
  293. package/resource.mjs +1 -6
  294. package/resource.mjs.map +1 -1
  295. package/resources/admin/admin.d.mts +18 -0
  296. package/resources/admin/admin.d.mts.map +1 -0
  297. package/resources/admin/admin.d.ts +4 -4
  298. package/resources/admin/admin.d.ts.map +1 -1
  299. package/resources/admin/admin.js +5 -38
  300. package/resources/admin/admin.js.map +1 -1
  301. package/resources/admin/admin.mjs +2 -3
  302. package/resources/admin/admin.mjs.map +1 -1
  303. package/resources/admin/auth-providers.d.mts +579 -0
  304. package/resources/admin/auth-providers.d.mts.map +1 -0
  305. package/resources/admin/auth-providers.d.ts +8 -7
  306. package/resources/admin/auth-providers.d.ts.map +1 -1
  307. package/resources/admin/auth-providers.js +6 -5
  308. package/resources/admin/auth-providers.js.map +1 -1
  309. package/resources/admin/auth-providers.mjs +6 -5
  310. package/resources/admin/auth-providers.mjs.map +1 -1
  311. package/resources/admin/index.d.mts +5 -0
  312. package/resources/admin/index.d.mts.map +1 -0
  313. package/resources/admin/index.d.ts +2 -2
  314. package/resources/admin/index.d.ts.map +1 -1
  315. package/resources/admin/index.js +1 -2
  316. package/resources/admin/index.js.map +1 -1
  317. package/resources/admin/index.mjs +1 -1
  318. package/resources/admin/index.mjs.map +1 -1
  319. package/resources/admin/secrets.d.mts +48 -0
  320. package/resources/admin/secrets.d.mts.map +1 -0
  321. package/resources/admin/secrets.d.ts +14 -5
  322. package/resources/admin/secrets.d.ts.map +1 -1
  323. package/resources/admin/secrets.js +12 -4
  324. package/resources/admin/secrets.js.map +1 -1
  325. package/resources/admin/secrets.mjs +12 -4
  326. package/resources/admin/secrets.mjs.map +1 -1
  327. package/resources/admin/user-connections.d.mts +48 -0
  328. package/resources/admin/user-connections.d.mts.map +1 -0
  329. package/resources/admin/user-connections.d.ts +8 -9
  330. package/resources/admin/user-connections.d.ts.map +1 -1
  331. package/resources/admin/user-connections.js +11 -14
  332. package/resources/admin/user-connections.js.map +1 -1
  333. package/resources/admin/user-connections.mjs +10 -12
  334. package/resources/admin/user-connections.mjs.map +1 -1
  335. package/resources/admin.d.mts +2 -0
  336. package/resources/admin.d.mts.map +1 -0
  337. package/resources/admin.d.ts.map +1 -1
  338. package/resources/admin.js +2 -15
  339. package/resources/admin.js.map +1 -1
  340. package/resources/auth.d.mts +156 -0
  341. package/resources/auth.d.mts.map +1 -0
  342. package/resources/auth.d.ts +7 -6
  343. package/resources/auth.d.ts.map +1 -1
  344. package/resources/auth.js +1 -1
  345. package/resources/auth.js.map +1 -1
  346. package/resources/auth.mjs +1 -1
  347. package/resources/auth.mjs.map +1 -1
  348. package/resources/chat/chat.d.mts +136 -0
  349. package/resources/chat/chat.d.mts.map +1 -0
  350. package/resources/chat/chat.d.ts +1 -1
  351. package/resources/chat/chat.d.ts.map +1 -1
  352. package/resources/chat/chat.js +3 -35
  353. package/resources/chat/chat.js.map +1 -1
  354. package/resources/chat/chat.mjs +1 -1
  355. package/resources/chat/completions.d.mts +81 -0
  356. package/resources/chat/completions.d.mts.map +1 -0
  357. package/resources/chat/completions.d.ts +5 -4
  358. package/resources/chat/completions.d.ts.map +1 -1
  359. package/resources/chat/completions.js +2 -2
  360. package/resources/chat/completions.js.map +1 -1
  361. package/resources/chat/completions.mjs +2 -2
  362. package/resources/chat/completions.mjs.map +1 -1
  363. package/resources/chat/index.d.mts +3 -0
  364. package/resources/chat/index.d.mts.map +1 -0
  365. package/resources/chat/index.d.ts.map +1 -1
  366. package/resources/chat.d.mts +2 -0
  367. package/resources/chat.d.mts.map +1 -0
  368. package/resources/chat.d.ts.map +1 -1
  369. package/resources/chat.js +2 -15
  370. package/resources/chat.js.map +1 -1
  371. package/resources/health.d.mts +16 -0
  372. package/resources/health.d.mts.map +1 -0
  373. package/resources/health.d.ts +5 -4
  374. package/resources/health.d.ts.map +1 -1
  375. package/resources/health.js +2 -2
  376. package/resources/health.js.map +1 -1
  377. package/resources/health.mjs +2 -2
  378. package/resources/health.mjs.map +1 -1
  379. package/resources/index.d.mts +8 -0
  380. package/resources/index.d.mts.map +1 -0
  381. package/resources/index.d.ts +2 -2
  382. package/resources/index.d.ts.map +1 -1
  383. package/resources/index.js +3 -19
  384. package/resources/index.js.map +1 -1
  385. package/resources/index.mjs +2 -2
  386. package/resources/index.mjs.map +1 -1
  387. package/resources/shared.d.mts +20 -0
  388. package/resources/shared.d.mts.map +1 -0
  389. package/resources/tools/formatted.d.mts +50 -0
  390. package/resources/tools/formatted.d.mts.map +1 -0
  391. package/resources/tools/formatted.d.ts +8 -10
  392. package/resources/tools/formatted.d.ts.map +1 -1
  393. package/resources/tools/formatted.js +13 -16
  394. package/resources/tools/formatted.js.map +1 -1
  395. package/resources/tools/formatted.mjs +12 -14
  396. package/resources/tools/formatted.mjs.map +1 -1
  397. package/resources/tools/index.d.mts +4 -0
  398. package/resources/tools/index.d.mts.map +1 -0
  399. package/resources/tools/index.d.ts +2 -2
  400. package/resources/tools/index.d.ts.map +1 -1
  401. package/resources/tools/index.js +1 -4
  402. package/resources/tools/index.js.map +1 -1
  403. package/resources/tools/index.mjs +2 -2
  404. package/resources/tools/index.mjs.map +1 -1
  405. package/resources/tools/scheduled.d.mts +41 -0
  406. package/resources/tools/scheduled.d.mts.map +1 -0
  407. package/resources/tools/scheduled.d.ts +7 -7
  408. package/resources/tools/scheduled.d.ts.map +1 -1
  409. package/resources/tools/scheduled.js +12 -10
  410. package/resources/tools/scheduled.js.map +1 -1
  411. package/resources/tools/scheduled.mjs +11 -9
  412. package/resources/tools/scheduled.mjs.map +1 -1
  413. package/resources/tools/tools.d.mts +309 -0
  414. package/resources/tools/tools.d.mts.map +1 -0
  415. package/resources/tools/tools.d.ts +14 -17
  416. package/resources/tools/tools.d.ts.map +1 -1
  417. package/resources/tools/tools.js +16 -55
  418. package/resources/tools/tools.js.map +1 -1
  419. package/resources/tools/tools.mjs +13 -18
  420. package/resources/tools/tools.mjs.map +1 -1
  421. package/resources/tools.d.mts +2 -0
  422. package/resources/tools.d.mts.map +1 -0
  423. package/resources/tools.d.ts.map +1 -1
  424. package/resources/tools.js +2 -15
  425. package/resources/tools.js.map +1 -1
  426. package/resources/workers.d.mts +268 -0
  427. package/resources/workers.d.mts.map +1 -0
  428. package/resources/workers.d.ts +14 -16
  429. package/resources/workers.d.ts.map +1 -1
  430. package/resources/workers.js +18 -23
  431. package/resources/workers.js.map +1 -1
  432. package/resources/workers.mjs +17 -21
  433. package/resources/workers.mjs.map +1 -1
  434. package/resources.d.mts +2 -0
  435. package/resources.d.mts.map +1 -0
  436. package/resources.d.ts.map +1 -1
  437. package/resources.js +2 -15
  438. package/resources.js.map +1 -1
  439. package/src/api-promise.ts +2 -0
  440. package/src/client.ts +839 -0
  441. package/src/core/README.md +3 -0
  442. package/src/core/api-promise.ts +92 -0
  443. package/src/core/error.ts +130 -0
  444. package/src/core/pagination.ts +181 -0
  445. package/src/core/resource.ts +11 -0
  446. package/src/core/uploads.ts +2 -0
  447. package/src/error.ts +2 -130
  448. package/src/index.ts +6 -294
  449. package/src/internal/README.md +3 -0
  450. package/src/internal/builtin-types.ts +93 -0
  451. package/src/internal/detect-platform.ts +196 -0
  452. package/src/internal/errors.ts +33 -0
  453. package/src/internal/headers.ts +97 -0
  454. package/src/internal/parse.ts +56 -0
  455. package/src/internal/qs/formats.ts +2 -1
  456. package/src/internal/qs/stringify.ts +17 -20
  457. package/src/internal/qs/utils.ts +14 -14
  458. package/src/internal/request-options.ts +91 -0
  459. package/src/internal/shim-types.ts +26 -0
  460. package/src/internal/shims.ts +107 -0
  461. package/src/internal/to-file.ts +154 -0
  462. package/src/internal/types.ts +95 -0
  463. package/src/internal/uploads.ts +187 -0
  464. package/src/internal/utils/base64.ts +40 -0
  465. package/src/internal/utils/bytes.ts +32 -0
  466. package/src/internal/utils/env.ts +18 -0
  467. package/src/internal/utils/log.ts +126 -0
  468. package/src/internal/utils/path.ts +88 -0
  469. package/src/internal/utils/sleep.ts +3 -0
  470. package/src/internal/utils/uuid.ts +17 -0
  471. package/src/internal/utils/values.ts +105 -0
  472. package/src/internal/utils.ts +8 -0
  473. package/src/pagination.ts +2 -79
  474. package/src/resource.ts +2 -11
  475. package/src/resources/admin/admin.ts +4 -4
  476. package/src/resources/admin/auth-providers.ts +14 -15
  477. package/src/resources/admin/index.ts +2 -2
  478. package/src/resources/admin/secrets.ts +27 -7
  479. package/src/resources/admin/user-connections.ts +15 -25
  480. package/src/resources/auth.ts +7 -15
  481. package/src/resources/chat/chat.ts +1 -1
  482. package/src/resources/chat/completions.ts +5 -4
  483. package/src/resources/health.ts +5 -4
  484. package/src/resources/index.ts +3 -3
  485. package/src/resources/tools/formatted.ts +15 -31
  486. package/src/resources/tools/index.ts +3 -3
  487. package/src/resources/tools/scheduled.ts +15 -19
  488. package/src/resources/tools/tools.ts +23 -36
  489. package/src/resources/workers.ts +27 -51
  490. package/src/tsconfig.json +2 -2
  491. package/src/uploads.ts +2 -255
  492. package/src/version.ts +1 -1
  493. package/uploads.d.mts +2 -0
  494. package/uploads.d.mts.map +1 -0
  495. package/uploads.d.ts +1 -74
  496. package/uploads.d.ts.map +1 -1
  497. package/uploads.js +3 -168
  498. package/uploads.js.map +1 -1
  499. package/uploads.mjs +1 -157
  500. package/uploads.mjs.map +1 -1
  501. package/version.d.mts +2 -0
  502. package/version.d.mts.map +1 -0
  503. package/version.d.ts +1 -1
  504. package/version.d.ts.map +1 -1
  505. package/version.js +1 -1
  506. package/version.js.map +1 -1
  507. package/version.mjs +1 -1
  508. package/version.mjs.map +1 -1
  509. package/_shims/MultipartBody.d.ts +0 -9
  510. package/_shims/MultipartBody.d.ts.map +0 -1
  511. package/_shims/MultipartBody.js +0 -16
  512. package/_shims/MultipartBody.js.map +0 -1
  513. package/_shims/MultipartBody.mjs +0 -12
  514. package/_shims/MultipartBody.mjs.map +0 -1
  515. package/_shims/README.md +0 -46
  516. package/_shims/auto/runtime-bun.d.ts +0 -5
  517. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  518. package/_shims/auto/runtime-bun.js +0 -21
  519. package/_shims/auto/runtime-bun.js.map +0 -1
  520. package/_shims/auto/runtime-bun.mjs +0 -2
  521. package/_shims/auto/runtime-bun.mjs.map +0 -1
  522. package/_shims/auto/runtime-node.d.ts +0 -5
  523. package/_shims/auto/runtime-node.d.ts.map +0 -1
  524. package/_shims/auto/runtime-node.js +0 -21
  525. package/_shims/auto/runtime-node.js.map +0 -1
  526. package/_shims/auto/runtime-node.mjs +0 -2
  527. package/_shims/auto/runtime-node.mjs.map +0 -1
  528. package/_shims/auto/runtime.d.ts +0 -5
  529. package/_shims/auto/runtime.d.ts.map +0 -1
  530. package/_shims/auto/runtime.js +0 -21
  531. package/_shims/auto/runtime.js.map +0 -1
  532. package/_shims/auto/runtime.mjs +0 -2
  533. package/_shims/auto/runtime.mjs.map +0 -1
  534. package/_shims/auto/types-node.d.ts +0 -5
  535. package/_shims/auto/types-node.d.ts.map +0 -1
  536. package/_shims/auto/types-node.js +0 -21
  537. package/_shims/auto/types-node.js.map +0 -1
  538. package/_shims/auto/types-node.mjs +0 -2
  539. package/_shims/auto/types-node.mjs.map +0 -1
  540. package/_shims/auto/types.d.ts +0 -101
  541. package/_shims/auto/types.js +0 -3
  542. package/_shims/auto/types.mjs +0 -3
  543. package/_shims/bun-runtime.d.ts +0 -6
  544. package/_shims/bun-runtime.d.ts.map +0 -1
  545. package/_shims/bun-runtime.js +0 -13
  546. package/_shims/bun-runtime.js.map +0 -1
  547. package/_shims/bun-runtime.mjs +0 -10
  548. package/_shims/bun-runtime.mjs.map +0 -1
  549. package/_shims/index.d.ts +0 -83
  550. package/_shims/index.js +0 -17
  551. package/_shims/index.mjs +0 -11
  552. package/_shims/manual-types.d.ts +0 -12
  553. package/_shims/manual-types.js +0 -3
  554. package/_shims/manual-types.mjs +0 -3
  555. package/_shims/node-runtime.d.ts +0 -3
  556. package/_shims/node-runtime.d.ts.map +0 -1
  557. package/_shims/node-runtime.js +0 -98
  558. package/_shims/node-runtime.js.map +0 -1
  559. package/_shims/node-runtime.mjs +0 -56
  560. package/_shims/node-runtime.mjs.map +0 -1
  561. package/_shims/node-types.d.ts +0 -42
  562. package/_shims/node-types.js +0 -3
  563. package/_shims/node-types.mjs +0 -3
  564. package/_shims/registry.d.ts +0 -37
  565. package/_shims/registry.d.ts.map +0 -1
  566. package/_shims/registry.js +0 -41
  567. package/_shims/registry.js.map +0 -1
  568. package/_shims/registry.mjs +0 -37
  569. package/_shims/registry.mjs.map +0 -1
  570. package/_shims/web-runtime.d.ts +0 -5
  571. package/_shims/web-runtime.d.ts.map +0 -1
  572. package/_shims/web-runtime.js +0 -77
  573. package/_shims/web-runtime.js.map +0 -1
  574. package/_shims/web-runtime.mjs +0 -71
  575. package/_shims/web-runtime.mjs.map +0 -1
  576. package/_shims/web-types.d.ts +0 -83
  577. package/_shims/web-types.js +0 -3
  578. package/_shims/web-types.mjs +0 -3
  579. package/core.d.ts +0 -253
  580. package/core.d.ts.map +0 -1
  581. package/core.js +0 -924
  582. package/core.js.map +0 -1
  583. package/core.mjs +0 -892
  584. package/core.mjs.map +0 -1
  585. package/shims/node.d.ts +0 -26
  586. package/shims/node.d.ts.map +0 -1
  587. package/shims/node.js +0 -6
  588. package/shims/node.js.map +0 -1
  589. package/shims/node.mjs +0 -4
  590. package/shims/node.mjs.map +0 -1
  591. package/shims/web.d.ts +0 -26
  592. package/shims/web.d.ts.map +0 -1
  593. package/shims/web.js +0 -6
  594. package/shims/web.js.map +0 -1
  595. package/shims/web.mjs +0 -4
  596. package/shims/web.mjs.map +0 -1
  597. package/src/_shims/MultipartBody.ts +0 -9
  598. package/src/_shims/README.md +0 -46
  599. package/src/_shims/auto/runtime-bun.ts +0 -4
  600. package/src/_shims/auto/runtime-node.ts +0 -4
  601. package/src/_shims/auto/runtime.ts +0 -4
  602. package/src/_shims/auto/types-node.ts +0 -4
  603. package/src/_shims/auto/types.d.ts +0 -101
  604. package/src/_shims/auto/types.js +0 -3
  605. package/src/_shims/auto/types.mjs +0 -3
  606. package/src/_shims/bun-runtime.ts +0 -14
  607. package/src/_shims/index.d.ts +0 -83
  608. package/src/_shims/index.js +0 -17
  609. package/src/_shims/index.mjs +0 -11
  610. package/src/_shims/manual-types.d.ts +0 -12
  611. package/src/_shims/manual-types.js +0 -3
  612. package/src/_shims/manual-types.mjs +0 -3
  613. package/src/_shims/node-runtime.ts +0 -81
  614. package/src/_shims/node-types.d.ts +0 -42
  615. package/src/_shims/node-types.js +0 -3
  616. package/src/_shims/node-types.mjs +0 -3
  617. package/src/_shims/registry.ts +0 -67
  618. package/src/_shims/web-runtime.ts +0 -103
  619. package/src/_shims/web-types.d.ts +0 -83
  620. package/src/_shims/web-types.js +0 -3
  621. package/src/_shims/web-types.mjs +0 -3
  622. package/src/core.ts +0 -1236
  623. package/src/shims/node.ts +0 -50
  624. package/src/shims/web.ts +0 -50
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.1 (2026-02-03)
4
+
5
+ Full Changelog: [v2.1.0...v2.1.1](https://github.com/ArcadeAI/arcade-js/compare/v2.1.0...v2.1.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **client:** avoid memory leak with abort signals ([78fa958](https://github.com/ArcadeAI/arcade-js/commit/78fa958eb37992ffc847c3ffe4313cc96a781a42))
10
+
11
+
12
+ ### Chores
13
+
14
+ * **client:** do not parse responses with empty content-length ([68c3094](https://github.com/ArcadeAI/arcade-js/commit/68c309464f01b3934446e7ad5c5b556601460422))
15
+
16
+ ## 2.1.0 (2026-01-27)
17
+
18
+ Full Changelog: [v2.0.0...v2.1.0](https://github.com/ArcadeAI/arcade-js/compare/v2.0.0...v2.1.0)
19
+
20
+ ### Features
21
+
22
+ * **api:** api update ([ae91d65](https://github.com/ArcadeAI/arcade-js/commit/ae91d65e5d580188282efe19788d0a297f2de0e6))
23
+ * **zod:** add zod as a dev dependency ([46289b4](https://github.com/ArcadeAI/arcade-js/commit/46289b48ad9ec6c342d25019b7f319621f91188a))
24
+
25
+ ## 2.0.0 (2026-01-27)
26
+
27
+ Full Changelog: [v1.16.0...v2.0.0](https://github.com/ArcadeAI/arcade-js/compare/v1.16.0...v2.0.0)
28
+
29
+ ### Features
30
+
31
+ * **api:** api update ([7cd3f79](https://github.com/ArcadeAI/arcade-js/commit/7cd3f792463bbb5b59c18fa17188054dd550eff2))
32
+ * complete typescript migration ([#156](https://github.com/ArcadeAI/arcade-js/issues/156)) ([37cb22c](https://github.com/ArcadeAI/arcade-js/commit/37cb22ca58f06a1d634980a7c56c8ca32edd82d4))
33
+
34
+
35
+ ### Chores
36
+
37
+ * break long lines in snippets into multiline ([849f4ab](https://github.com/ArcadeAI/arcade-js/commit/849f4abb2e4fb9a4883c4c956016ae3fcb8cc865))
38
+ * **ci:** upgrade `actions/github-script` ([816d0dc](https://github.com/ArcadeAI/arcade-js/commit/816d0dcc4b80c4f072246141700472e7c542c3cb))
39
+ * **internal:** update `actions/checkout` version ([4d7660f](https://github.com/ArcadeAI/arcade-js/commit/4d7660f04fff9feee30d9f2a5e2c258db3a55cd5))
40
+ * **internal:** upgrade babel, qs, js-yaml ([3027d67](https://github.com/ArcadeAI/arcade-js/commit/3027d677183afb53900af7caf2d22bda2cb2ff05))
41
+ * resolve module exports for lib ([c6b975e](https://github.com/ArcadeAI/arcade-js/commit/c6b975ee89990301fee80813801332d4ab4d4a6e))
42
+ * upgrade lock file ([01e8fdf](https://github.com/ArcadeAI/arcade-js/commit/01e8fdfff2930856cada1fd72e65257bbec017a9))
43
+
44
+ ## 1.16.0 (2025-12-13)
45
+
46
+ Full Changelog: [v1.15.0...v1.16.0](https://github.com/ArcadeAI/arcade-js/compare/v1.15.0...v1.16.0)
47
+
48
+ ### Features
49
+
50
+ * **api:** api update ([b7ca2d2](https://github.com/ArcadeAI/arcade-js/commit/b7ca2d24fa2454a3ee1451728261ac716be89f12))
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * **mcp:** correct code tool API endpoint ([fc6bf5a](https://github.com/ArcadeAI/arcade-js/commit/fc6bf5a6ca643e49747cf4ce663493f7bcd42ff4))
56
+ * **mcp:** return correct lines on typescript errors ([d9e2e83](https://github.com/ArcadeAI/arcade-js/commit/d9e2e8373bccfaf57fd379b305ed6b01629d02a0))
57
+
58
+
59
+ ### Chores
60
+
61
+ * **internal:** codegen related update ([b0959a9](https://github.com/ArcadeAI/arcade-js/commit/b0959a9b2c05d9343e6eb34e86d007b47913ec25))
62
+ * **internal:** codegen related update ([ca10d38](https://github.com/ArcadeAI/arcade-js/commit/ca10d381ea557762282aa9441b070a7abdfa9e2d))
63
+
3
64
  ## 1.15.0 (2025-12-08)
4
65
 
5
66
  Full Changelog: [v1.14.0...v1.15.0](https://github.com/ArcadeAI/arcade-js/compare/v1.14.0...v1.15.0)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Arcade Node API Library
1
+ # Arcade TypeScript API Library
2
2
 
3
- [![NPM version](https://img.shields.io/npm/v/@arcadeai/arcadejs.svg)](https://npmjs.org/package/@arcadeai/arcadejs) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@arcadeai/arcadejs)
3
+ [![NPM version](<https://img.shields.io/npm/v/@arcadeai/arcadejs.svg?label=npm%20(stable)>)](https://npmjs.org/package/@arcadeai/arcadejs) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@arcadeai/arcadejs)
4
4
 
5
5
  This library provides convenient access to the Arcade REST API from server-side TypeScript or JavaScript.
6
6
 
@@ -131,13 +131,46 @@ On timeout, an `APIConnectionTimeoutError` is thrown.
131
131
 
132
132
  Note that requests which time out will be [retried twice by default](#retries).
133
133
 
134
+ ## Auto-pagination
135
+
136
+ List methods in the Arcade API are paginated.
137
+ You can use the `for await … of` syntax to iterate through items across all pages:
138
+
139
+ ```ts
140
+ async function fetchAllUserConnectionResponses(params) {
141
+ const allUserConnectionResponses = [];
142
+ // Automatically fetches more pages as needed.
143
+ for await (const userConnectionResponse of client.admin.userConnections.list()) {
144
+ allUserConnectionResponses.push(userConnectionResponse);
145
+ }
146
+ return allUserConnectionResponses;
147
+ }
148
+ ```
149
+
150
+ Alternatively, you can request a single page at a time:
151
+
152
+ ```ts
153
+ let page = await client.admin.userConnections.list();
154
+ for (const userConnectionResponse of page.items) {
155
+ console.log(userConnectionResponse);
156
+ }
157
+
158
+ // Convenience methods are provided for manually paginating:
159
+ while (page.hasNextPage()) {
160
+ page = await page.getNextPage();
161
+ // ...
162
+ }
163
+ ```
164
+
134
165
  ## Advanced Usage
135
166
 
136
167
  ### Accessing raw Response data (e.g., headers)
137
168
 
138
169
  The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
170
+ This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
139
171
 
140
172
  You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
173
+ Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
141
174
 
142
175
  <!-- prettier-ignore -->
143
176
  ```ts
@@ -156,6 +189,59 @@ console.log(raw.headers.get('X-My-Header'));
156
189
  console.log(chatResponse.id);
157
190
  ```
158
191
 
192
+ ### Logging
193
+
194
+ > [!IMPORTANT]
195
+ > All log messages are intended for debugging only. The format and content of log messages
196
+ > may change between releases.
197
+
198
+ #### Log levels
199
+
200
+ The log level can be configured in two ways:
201
+
202
+ 1. Via the `ARCADE_LOG` environment variable
203
+ 2. Using the `logLevel` client option (overrides the environment variable if set)
204
+
205
+ ```ts
206
+ import Arcade from '@arcadeai/arcadejs';
207
+
208
+ const client = new Arcade({
209
+ logLevel: 'debug', // Show all log messages
210
+ });
211
+ ```
212
+
213
+ Available log levels, from most to least verbose:
214
+
215
+ - `'debug'` - Show debug messages, info, warnings, and errors
216
+ - `'info'` - Show info messages, warnings, and errors
217
+ - `'warn'` - Show warnings and errors (default)
218
+ - `'error'` - Show only errors
219
+ - `'off'` - Disable all logging
220
+
221
+ At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
222
+ Some authentication-related headers are redacted, but sensitive data in request and response bodies
223
+ may still be visible.
224
+
225
+ #### Custom logger
226
+
227
+ By default, this library logs to `globalThis.console`. You can also provide a custom logger.
228
+ Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
229
+
230
+ When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
231
+ below the configured level will not be sent to your logger.
232
+
233
+ ```ts
234
+ import Arcade from '@arcadeai/arcadejs';
235
+ import pino from 'pino';
236
+
237
+ const logger = pino();
238
+
239
+ const client = new Arcade({
240
+ logger: logger.child({ name: 'Arcade' }),
241
+ logLevel: 'debug', // Send all messages to pino, allowing it to filter
242
+ });
243
+ ```
244
+
159
245
  ### Making custom/undocumented requests
160
246
 
161
247
  This library is typed for convenient access to the documented API. If you need to access undocumented
@@ -180,9 +266,8 @@ parameter. This library doesn't validate at runtime that the request matches the
180
266
  send will be sent as-is.
181
267
 
182
268
  ```ts
183
- client.foo.create({
184
- foo: 'my_param',
185
- bar: 12,
269
+ client.tools.execute({
270
+ // ...
186
271
  // @ts-expect-error baz is not yet public
187
272
  baz: 'undocumented option',
188
273
  });
@@ -202,69 +287,85 @@ validate or strip extra properties from the response from the API.
202
287
 
203
288
  ### Customizing the fetch client
204
289
 
205
- By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments.
290
+ By default, this library expects a global `fetch` function is defined.
206
291
 
207
- If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment,
208
- (for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
209
- add the following import before your first import `from "Arcade"`:
292
+ If you want to use a different `fetch` function, you can either polyfill the global:
210
293
 
211
294
  ```ts
212
- // Tell TypeScript and the package to use the global web fetch instead of node-fetch.
213
- // Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
214
- import '@arcadeai/arcadejs/shims/web';
215
- import Arcade from '@arcadeai/arcadejs';
295
+ import fetch from 'my-fetch';
296
+
297
+ globalThis.fetch = fetch;
216
298
  ```
217
299
 
218
- To do the inverse, add `import "@arcadeai/arcadejs/shims/node"` (which does import polyfills).
219
- This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/ArcadeAI/arcade-js/tree/main/src/_shims#readme)).
300
+ Or pass it to the client:
301
+
302
+ ```ts
303
+ import Arcade from '@arcadeai/arcadejs';
304
+ import fetch from 'my-fetch';
305
+
306
+ const client = new Arcade({ fetch });
307
+ ```
220
308
 
221
- ### Logging and middleware
309
+ ### Fetch options
222
310
 
223
- You may also provide a custom `fetch` function when instantiating the client,
224
- which can be used to inspect or alter the `Request` or `Response` before/after each request:
311
+ If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
225
312
 
226
313
  ```ts
227
- import { fetch } from 'undici'; // as one example
228
314
  import Arcade from '@arcadeai/arcadejs';
229
315
 
230
316
  const client = new Arcade({
231
- fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
232
- console.log('About to make a request', url, init);
233
- const response = await fetch(url, init);
234
- console.log('Got response', response);
235
- return response;
317
+ fetchOptions: {
318
+ // `RequestInit` options
236
319
  },
237
320
  });
238
321
  ```
239
322
 
240
- Note that if given a `DEBUG=true` environment variable, this library will log all requests and responses automatically.
241
- This is intended for debugging purposes only and may change in the future without notice.
323
+ #### Configuring proxies
242
324
 
243
- ### Configuring an HTTP(S) Agent (e.g., for proxies)
325
+ To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
326
+ options to requests:
244
327
 
245
- By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests.
328
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
246
329
 
247
- If you would like to disable or customize this behavior, for example to use the API behind a proxy, you can pass an `httpAgent` which is used for all requests (be they http or https), for example:
330
+ ```ts
331
+ import Arcade from '@arcadeai/arcadejs';
332
+ import * as undici from 'undici';
333
+
334
+ const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
335
+ const client = new Arcade({
336
+ fetchOptions: {
337
+ dispatcher: proxyAgent,
338
+ },
339
+ });
340
+ ```
341
+
342
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
248
343
 
249
- <!-- prettier-ignore -->
250
344
  ```ts
251
- import http from 'http';
252
- import { HttpsProxyAgent } from 'https-proxy-agent';
345
+ import Arcade from '@arcadeai/arcadejs';
253
346
 
254
- // Configure the default for all requests:
255
347
  const client = new Arcade({
256
- httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
348
+ fetchOptions: {
349
+ proxy: 'http://localhost:8888',
350
+ },
257
351
  });
352
+ ```
258
353
 
259
- // Override per-request:
260
- await client.chat.completions.create(
261
- { messages: [{ role: 'user', content: 'Hello, how can I use Arcade?' }] },
262
- {
263
- httpAgent: new http.Agent({ keepAlive: false }),
354
+ <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
355
+
356
+ ```ts
357
+ import Arcade from 'npm:@arcadeai/arcadejs';
358
+
359
+ const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
360
+ const client = new Arcade({
361
+ fetchOptions: {
362
+ client: httpClient,
264
363
  },
265
- );
364
+ });
266
365
  ```
267
366
 
367
+ ## Frequently Asked Questions
368
+
268
369
  ## Semantic versioning
269
370
 
270
371
  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
@@ -279,12 +380,12 @@ We are keen for your feedback; please open an [issue](https://www.github.com/Arc
279
380
 
280
381
  ## Requirements
281
382
 
282
- TypeScript >= 4.5 is supported.
383
+ TypeScript >= 4.9 is supported.
283
384
 
284
385
  The following runtimes are supported:
285
386
 
286
387
  - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
287
- - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
388
+ - Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
288
389
  - Deno v1.28.0 or higher.
289
390
  - Bun 1.0 or later.
290
391
  - Cloudflare Workers.
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.mts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.js";
2
+ //# sourceMappingURL=api-promise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.d.ts","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
package/api-promise.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("./internal/tslib.js");
4
+ /** @deprecated Import from ./core/api-promise instead */
5
+ tslib_1.__exportStar(require("./core/api-promise.js"), exports);
6
+ //# sourceMappingURL=api-promise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.js","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,gEAAmC"}
@@ -0,0 +1,2 @@
1
+ export * from "./core/api-promise.mjs";
2
+ //# sourceMappingURL=api-promise.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-promise.mjs","sourceRoot":"","sources":["src/api-promise.ts"],"names":[],"mappings":""}
package/bin/cli ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require('child_process');
4
+
5
+ const commands = {
6
+ migrate: {
7
+ description:
8
+ 'Run migrations to update your code using @arcadeai/arcadejs@1 to be compatible with @arcadeai/arcadejs@2',
9
+ fn: () => {
10
+ const result = spawnSync(
11
+ 'npx',
12
+ [
13
+ '-y',
14
+ 'https://github.com/stainless-api/migrate-ts/releases/download/0.0.2/stainless-api-migrate-0.0.2-6.tgz',
15
+ '--migrationConfig',
16
+ require.resolve('./migration-config.json'),
17
+ ...process.argv.slice(3),
18
+ ],
19
+ { stdio: 'inherit' },
20
+ );
21
+ if (result.status !== 0) {
22
+ process.exit(result.status);
23
+ }
24
+ },
25
+ },
26
+ };
27
+
28
+ function exitWithHelp() {
29
+ console.log(`Usage: arcadeai-arcadejs <subcommand>`);
30
+ console.log();
31
+ console.log('Subcommands:');
32
+
33
+ for (const [name, info] of Object.entries(commands)) {
34
+ console.log(` ${name} ${info.description}`);
35
+ }
36
+
37
+ console.log();
38
+ process.exit(1);
39
+ }
40
+
41
+ if (process.argv.length < 3) {
42
+ exitWithHelp();
43
+ }
44
+
45
+ const commandName = process.argv[2];
46
+
47
+ const command = commands[commandName];
48
+ if (!command) {
49
+ console.log(`Unknown subcommand ${commandName}.`);
50
+ exitWithHelp();
51
+ }
52
+
53
+ command.fn();
@@ -0,0 +1,6 @@
1
+ {
2
+ "pkg": "@arcadeai/arcadejs",
3
+ "githubRepo": "https://github.com/ArcadeAI/arcade-js",
4
+ "clientClass": "Arcade",
5
+ "methods": []
6
+ }
package/client.d.mts ADDED
@@ -0,0 +1,201 @@
1
+ import type { RequestInit, RequestInfo } from "./internal/builtin-types.mjs";
2
+ import type { PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from "./internal/types.mjs";
3
+ export type { Logger, LogLevel } from "./internal/utils/log.mjs";
4
+ import * as Opts from "./internal/request-options.mjs";
5
+ import * as Errors from "./core/error.mjs";
6
+ import * as Pagination from "./core/pagination.mjs";
7
+ import { type OffsetPageParams, OffsetPageResponse } from "./core/pagination.mjs";
8
+ import * as Uploads from "./core/uploads.mjs";
9
+ import * as API from "./resources/index.mjs";
10
+ import { APIPromise } from "./core/api-promise.mjs";
11
+ import { Auth, AuthAuthorizeParams, AuthConfirmUserParams, AuthRequest, AuthStatusParams, ConfirmUserRequest, ConfirmUserResponse } from "./resources/auth.mjs";
12
+ import { Health, HealthSchema } from "./resources/health.mjs";
13
+ import { CreateWorkerRequest, UpdateWorkerRequest, WorkerCreateParams, WorkerHealthResponse, WorkerListParams, WorkerResponse, WorkerResponsesOffsetPage, WorkerToolsParams, WorkerUpdateParams, Workers } from "./resources/workers.mjs";
14
+ import { Admin } from "./resources/admin/admin.mjs";
15
+ import { Chat, ChatMessage, ChatRequest, ChatResponse, Choice, Usage } from "./resources/chat/chat.mjs";
16
+ import { AuthorizeToolRequest, ExecuteToolRequest, ExecuteToolResponse, ToolAuthorizeParams, ToolDefinition, ToolDefinitionsOffsetPage, ToolExecuteParams, ToolExecution, ToolExecutionAttempt, ToolGetParams, ToolListParams, Tools, ValueSchema } from "./resources/tools/tools.mjs";
17
+ import { type Fetch } from "./internal/builtin-types.mjs";
18
+ import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
19
+ import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
20
+ import { type LogLevel, type Logger } from "./internal/utils/log.mjs";
21
+ export interface ClientOptions {
22
+ /**
23
+ * API key used for authorization in header
24
+ */
25
+ apiKey?: string | undefined;
26
+ /**
27
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
28
+ *
29
+ * Defaults to process.env['ARCADE_BASE_URL'].
30
+ */
31
+ baseURL?: string | null | undefined;
32
+ /**
33
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
34
+ * from the server before timing out a single request.
35
+ *
36
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
37
+ * much longer than this timeout before the promise succeeds or fails.
38
+ *
39
+ * @unit milliseconds
40
+ */
41
+ timeout?: number | undefined;
42
+ /**
43
+ * Additional `RequestInit` options to be passed to `fetch` calls.
44
+ * Properties will be overridden by per-request `fetchOptions`.
45
+ */
46
+ fetchOptions?: MergedRequestInit | undefined;
47
+ /**
48
+ * Specify a custom `fetch` function implementation.
49
+ *
50
+ * If not provided, we expect that `fetch` is defined globally.
51
+ */
52
+ fetch?: Fetch | undefined;
53
+ /**
54
+ * The maximum number of times that the client will retry a request in case of a
55
+ * temporary failure, like a network error or a 5XX error from the server.
56
+ *
57
+ * @default 2
58
+ */
59
+ maxRetries?: number | undefined;
60
+ /**
61
+ * Default headers to include with every request to the API.
62
+ *
63
+ * These can be removed in individual requests by explicitly setting the
64
+ * header to `null` in request options.
65
+ */
66
+ defaultHeaders?: HeadersLike | undefined;
67
+ /**
68
+ * Default query parameters to include with every request to the API.
69
+ *
70
+ * These can be removed in individual requests by explicitly setting the
71
+ * param to `undefined` in request options.
72
+ */
73
+ defaultQuery?: Record<string, string | undefined> | undefined;
74
+ /**
75
+ * Set the log level.
76
+ *
77
+ * Defaults to process.env['ARCADE_LOG'] or 'warn' if it isn't set.
78
+ */
79
+ logLevel?: LogLevel | undefined;
80
+ /**
81
+ * Set the logger.
82
+ *
83
+ * Defaults to globalThis.console.
84
+ */
85
+ logger?: Logger | undefined;
86
+ }
87
+ /**
88
+ * API Client for interfacing with the Arcade API.
89
+ */
90
+ export declare class Arcade {
91
+ #private;
92
+ apiKey: string;
93
+ baseURL: string;
94
+ maxRetries: number;
95
+ timeout: number;
96
+ logger: Logger;
97
+ logLevel: LogLevel | undefined;
98
+ fetchOptions: MergedRequestInit | undefined;
99
+ private fetch;
100
+ protected idempotencyHeader?: string;
101
+ private _options;
102
+ /**
103
+ * API Client for interfacing with the Arcade API.
104
+ *
105
+ * @param {string | undefined} [opts.apiKey=process.env['ARCADE_API_KEY'] ?? undefined]
106
+ * @param {string} [opts.baseURL=process.env['ARCADE_BASE_URL'] ?? https://api.arcade.dev] - Override the default base URL for the API.
107
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
108
+ * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
109
+ * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
110
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
111
+ * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
112
+ * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
113
+ */
114
+ constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
115
+ /**
116
+ * Create a new client instance re-using the same options given to the current client with optional overriding.
117
+ */
118
+ withOptions(options: Partial<ClientOptions>): this;
119
+ protected defaultQuery(): Record<string, string | undefined> | undefined;
120
+ protected validateHeaders({ values, nulls }: NullableHeaders): void;
121
+ protected authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined>;
122
+ protected stringifyQuery(query: Record<string, unknown>): string;
123
+ private getUserAgent;
124
+ protected defaultIdempotencyKey(): string;
125
+ protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
126
+ buildURL(path: string, query: Record<string, unknown> | null | undefined, defaultBaseURL?: string | undefined): string;
127
+ /**
128
+ * Used as a callback for mutating the given `FinalRequestOptions` object.
129
+ */
130
+ protected prepareOptions(options: FinalRequestOptions): Promise<void>;
131
+ /**
132
+ * Used as a callback for mutating the given `RequestInit` object.
133
+ *
134
+ * This is useful for cases where you want to add certain headers based off of
135
+ * the request properties, e.g. `method` or `url`.
136
+ */
137
+ protected prepareRequest(request: RequestInit, { url, options }: {
138
+ url: string;
139
+ options: FinalRequestOptions;
140
+ }): Promise<void>;
141
+ get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
142
+ post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
143
+ patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
144
+ put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
145
+ delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
146
+ private methodRequest;
147
+ request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
148
+ private makeRequest;
149
+ getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(path: string, Page: new (...args: any[]) => PageClass, opts?: RequestOptions): Pagination.PagePromise<PageClass, Item>;
150
+ requestAPIList<Item = unknown, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass, options: FinalRequestOptions): Pagination.PagePromise<PageClass, Item>;
151
+ fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
152
+ private shouldRetry;
153
+ private retryRequest;
154
+ private calculateDefaultRetryTimeoutMillis;
155
+ buildRequest(inputOptions: FinalRequestOptions, { retryCount }?: {
156
+ retryCount?: number;
157
+ }): Promise<{
158
+ req: FinalizedRequestInit;
159
+ url: string;
160
+ timeout: number;
161
+ }>;
162
+ private buildHeaders;
163
+ private buildBody;
164
+ static Arcade: typeof Arcade;
165
+ static DEFAULT_TIMEOUT: number;
166
+ static ArcadeError: typeof Errors.ArcadeError;
167
+ static APIError: typeof Errors.APIError;
168
+ static APIConnectionError: typeof Errors.APIConnectionError;
169
+ static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
170
+ static APIUserAbortError: typeof Errors.APIUserAbortError;
171
+ static NotFoundError: typeof Errors.NotFoundError;
172
+ static ConflictError: typeof Errors.ConflictError;
173
+ static RateLimitError: typeof Errors.RateLimitError;
174
+ static BadRequestError: typeof Errors.BadRequestError;
175
+ static AuthenticationError: typeof Errors.AuthenticationError;
176
+ static InternalServerError: typeof Errors.InternalServerError;
177
+ static PermissionDeniedError: typeof Errors.PermissionDeniedError;
178
+ static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
179
+ static toFile: typeof Uploads.toFile;
180
+ admin: API.Admin;
181
+ auth: API.Auth;
182
+ health: API.Health;
183
+ chat: API.Chat;
184
+ tools: API.Tools;
185
+ workers: API.Workers;
186
+ }
187
+ export declare namespace Arcade {
188
+ export type RequestOptions = Opts.RequestOptions;
189
+ export import OffsetPage = Pagination.OffsetPage;
190
+ export { type OffsetPageParams as OffsetPageParams, type OffsetPageResponse as OffsetPageResponse };
191
+ export { Admin as Admin };
192
+ export { Auth as Auth, type AuthRequest as AuthRequest, type ConfirmUserRequest as ConfirmUserRequest, type ConfirmUserResponse as ConfirmUserResponse, type AuthAuthorizeParams as AuthAuthorizeParams, type AuthConfirmUserParams as AuthConfirmUserParams, type AuthStatusParams as AuthStatusParams, };
193
+ export { Health as Health, type HealthSchema as HealthSchema };
194
+ export { Chat as Chat, type ChatMessage as ChatMessage, type ChatRequest as ChatRequest, type ChatResponse as ChatResponse, type Choice as Choice, type Usage as Usage, };
195
+ export { Tools as Tools, type AuthorizeToolRequest as AuthorizeToolRequest, type ExecuteToolRequest as ExecuteToolRequest, type ExecuteToolResponse as ExecuteToolResponse, type ToolDefinition as ToolDefinition, type ToolExecution as ToolExecution, type ToolExecutionAttempt as ToolExecutionAttempt, type ValueSchema as ValueSchema, type ToolDefinitionsOffsetPage as ToolDefinitionsOffsetPage, type ToolListParams as ToolListParams, type ToolAuthorizeParams as ToolAuthorizeParams, type ToolExecuteParams as ToolExecuteParams, type ToolGetParams as ToolGetParams, };
196
+ export { Workers as Workers, type CreateWorkerRequest as CreateWorkerRequest, type UpdateWorkerRequest as UpdateWorkerRequest, type WorkerHealthResponse as WorkerHealthResponse, type WorkerResponse as WorkerResponse, type WorkerResponsesOffsetPage as WorkerResponsesOffsetPage, type WorkerCreateParams as WorkerCreateParams, type WorkerUpdateParams as WorkerUpdateParams, type WorkerListParams as WorkerListParams, type WorkerToolsParams as WorkerToolsParams, };
197
+ export type AuthorizationContext = API.AuthorizationContext;
198
+ export type AuthorizationResponse = API.AuthorizationResponse;
199
+ export type Error = API.Error;
200
+ }
201
+ //# sourceMappingURL=client.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAGT,KAAK,MAAM;OACX,KAAK,UAAU;OACf,EAAgB,KAAK,gBAAgB,EAAE,kBAAkB,EAAE;OAC3D,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EACL,IAAI,EACJ,mBAAmB,EACnB,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACpB;OACM,EAAE,MAAM,EAAE,YAAY,EAAE;OACxB,EACL,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,EACR;OACM,EAAE,KAAK,EAAE;OACT,EAAE,IAAI,EAAE,WAAW,EAAE,WAA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