@composio/client 0.1.0-alpha.1 → 0.1.0-alpha.11

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 (476) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/LICENSE +1 -1
  3. package/README.md +31 -31
  4. package/api-promise.js +2 -15
  5. package/api-promise.js.map +1 -1
  6. package/client.d.mts +32 -29
  7. package/client.d.mts.map +1 -1
  8. package/client.d.ts +32 -29
  9. package/client.d.ts.map +1 -1
  10. package/client.js +95 -113
  11. package/client.js.map +1 -1
  12. package/client.mjs +88 -83
  13. package/client.mjs.map +1 -1
  14. package/core/api-promise.d.mts +2 -3
  15. package/core/api-promise.d.mts.map +1 -1
  16. package/core/api-promise.d.ts +2 -3
  17. package/core/api-promise.d.ts.map +1 -1
  18. package/core/api-promise.js +4 -14
  19. package/core/api-promise.js.map +1 -1
  20. package/core/api-promise.mjs +1 -11
  21. package/core/api-promise.mjs.map +1 -1
  22. package/core/error.d.mts +2 -3
  23. package/core/error.d.mts.map +1 -1
  24. package/core/error.d.ts +2 -3
  25. package/core/error.d.ts.map +1 -1
  26. package/core/error.js +4 -4
  27. package/core/error.js.map +1 -1
  28. package/core/error.mjs +2 -2
  29. package/core/error.mjs.map +1 -1
  30. package/core/resource.d.mts +3 -3
  31. package/core/resource.d.mts.map +1 -1
  32. package/core/resource.d.ts +3 -3
  33. package/core/resource.d.ts.map +1 -1
  34. package/core/resource.js.map +1 -1
  35. package/core/resource.mjs.map +1 -1
  36. package/error.js +2 -15
  37. package/error.js.map +1 -1
  38. package/index.d.mts +3 -3
  39. package/index.d.mts.map +1 -1
  40. package/index.d.ts +3 -3
  41. package/index.d.ts.map +1 -1
  42. package/index.js +4 -4
  43. package/index.js.map +1 -1
  44. package/index.mjs +3 -3
  45. package/index.mjs.map +1 -1
  46. package/internal/builtin-types.d.mts +0 -2
  47. package/internal/builtin-types.d.mts.map +1 -1
  48. package/internal/builtin-types.d.ts +0 -2
  49. package/internal/builtin-types.d.ts.map +1 -1
  50. package/internal/detect-platform.js.map +1 -1
  51. package/internal/detect-platform.mjs.map +1 -1
  52. package/internal/errors.d.mts.map +1 -1
  53. package/internal/errors.d.ts.map +1 -1
  54. package/internal/errors.js +2 -2
  55. package/internal/errors.js.map +1 -1
  56. package/internal/errors.mjs.map +1 -1
  57. package/internal/headers.d.mts +1 -2
  58. package/internal/headers.d.mts.map +1 -1
  59. package/internal/headers.d.ts +1 -2
  60. package/internal/headers.d.ts.map +1 -1
  61. package/internal/headers.js +3 -1
  62. package/internal/headers.js.map +1 -1
  63. package/internal/headers.mjs +3 -1
  64. package/internal/headers.mjs.map +1 -1
  65. package/internal/parse.d.mts +2 -3
  66. package/internal/parse.d.mts.map +1 -1
  67. package/internal/parse.d.ts +2 -3
  68. package/internal/parse.d.ts.map +1 -1
  69. package/internal/parse.js +1 -2
  70. package/internal/parse.js.map +1 -1
  71. package/internal/parse.mjs.map +1 -1
  72. package/internal/qs/formats.d.mts +6 -0
  73. package/internal/qs/formats.d.mts.map +1 -0
  74. package/internal/qs/formats.d.ts +6 -0
  75. package/internal/qs/formats.d.ts.map +1 -0
  76. package/internal/qs/formats.js +11 -0
  77. package/internal/qs/formats.js.map +1 -0
  78. package/internal/qs/formats.mjs +8 -0
  79. package/internal/qs/formats.mjs.map +1 -0
  80. package/internal/qs/index.d.mts +10 -0
  81. package/internal/qs/index.d.mts.map +1 -0
  82. package/internal/qs/index.d.ts +10 -0
  83. package/internal/qs/index.d.ts.map +1 -0
  84. package/internal/qs/index.js +14 -0
  85. package/internal/qs/index.js.map +1 -0
  86. package/internal/qs/index.mjs +10 -0
  87. package/internal/qs/index.mjs.map +1 -0
  88. package/internal/qs/stringify.d.mts +3 -0
  89. package/internal/qs/stringify.d.mts.map +1 -0
  90. package/internal/qs/stringify.d.ts +3 -0
  91. package/internal/qs/stringify.d.ts.map +1 -0
  92. package/internal/qs/stringify.js +279 -0
  93. package/internal/qs/stringify.js.map +1 -0
  94. package/internal/qs/stringify.mjs +276 -0
  95. package/internal/qs/stringify.mjs.map +1 -0
  96. package/internal/qs/types.d.mts +57 -0
  97. package/internal/qs/types.d.mts.map +1 -0
  98. package/internal/qs/types.d.ts +57 -0
  99. package/internal/qs/types.d.ts.map +1 -0
  100. package/internal/qs/types.js +3 -0
  101. package/internal/qs/types.js.map +1 -0
  102. package/internal/qs/types.mjs +2 -0
  103. package/internal/qs/types.mjs.map +1 -0
  104. package/internal/qs/utils.d.mts +14 -0
  105. package/internal/qs/utils.d.mts.map +1 -0
  106. package/internal/qs/utils.d.ts +14 -0
  107. package/internal/qs/utils.d.ts.map +1 -0
  108. package/internal/qs/utils.js +229 -0
  109. package/internal/qs/utils.js.map +1 -0
  110. package/internal/qs/utils.mjs +217 -0
  111. package/internal/qs/utils.mjs.map +1 -0
  112. package/internal/request-options.d.mts +0 -1
  113. package/internal/request-options.d.mts.map +1 -1
  114. package/internal/request-options.d.ts +0 -1
  115. package/internal/request-options.d.ts.map +1 -1
  116. package/internal/shims.js +6 -7
  117. package/internal/shims.js.map +1 -1
  118. package/internal/shims.mjs +1 -1
  119. package/internal/shims.mjs.map +1 -1
  120. package/internal/to-file.d.mts +0 -1
  121. package/internal/to-file.d.mts.map +1 -1
  122. package/internal/to-file.d.ts +0 -1
  123. package/internal/to-file.d.ts.map +1 -1
  124. package/internal/to-file.js +4 -4
  125. package/internal/to-file.js.map +1 -1
  126. package/internal/to-file.mjs +3 -2
  127. package/internal/to-file.mjs.map +1 -1
  128. package/internal/tslib.js +81 -0
  129. package/internal/tslib.mjs +17 -0
  130. package/internal/types.d.mts +0 -1
  131. package/internal/types.d.mts.map +1 -1
  132. package/internal/types.d.ts +0 -1
  133. package/internal/types.d.ts.map +1 -1
  134. package/internal/uploads.d.mts +5 -7
  135. package/internal/uploads.d.mts.map +1 -1
  136. package/internal/uploads.d.ts +5 -7
  137. package/internal/uploads.d.ts.map +1 -1
  138. package/internal/uploads.js +16 -6
  139. package/internal/uploads.js.map +1 -1
  140. package/internal/uploads.mjs +12 -3
  141. package/internal/uploads.mjs.map +1 -1
  142. package/internal/utils/base64.d.mts.map +1 -1
  143. package/internal/utils/base64.d.ts.map +1 -1
  144. package/internal/utils/base64.js +14 -9
  145. package/internal/utils/base64.js.map +1 -1
  146. package/internal/utils/base64.mjs +15 -10
  147. package/internal/utils/base64.mjs.map +1 -1
  148. package/internal/utils/bytes.d.mts +4 -0
  149. package/internal/utils/bytes.d.mts.map +1 -0
  150. package/internal/utils/bytes.d.ts +4 -0
  151. package/internal/utils/bytes.d.ts.map +1 -0
  152. package/internal/utils/bytes.js +31 -0
  153. package/internal/utils/bytes.js.map +1 -0
  154. package/internal/utils/bytes.mjs +26 -0
  155. package/internal/utils/bytes.mjs.map +1 -0
  156. package/internal/utils/env.d.mts.map +1 -1
  157. package/internal/utils/env.d.ts.map +1 -1
  158. package/internal/utils/env.js.map +1 -1
  159. package/internal/utils/env.mjs.map +1 -1
  160. package/internal/utils/log.d.mts +3 -4
  161. package/internal/utils/log.d.mts.map +1 -1
  162. package/internal/utils/log.d.ts +3 -4
  163. package/internal/utils/log.d.ts.map +1 -1
  164. package/internal/utils/log.js +2 -2
  165. package/internal/utils/log.js.map +1 -1
  166. package/internal/utils/log.mjs.map +1 -1
  167. package/internal/utils/path.d.mts.map +1 -1
  168. package/internal/utils/path.d.ts.map +1 -1
  169. package/internal/utils/path.js +3 -3
  170. package/internal/utils/path.js.map +1 -1
  171. package/internal/utils/path.mjs +2 -2
  172. package/internal/utils/path.mjs.map +1 -1
  173. package/internal/utils/sleep.d.mts.map +1 -1
  174. package/internal/utils/sleep.d.ts.map +1 -1
  175. package/internal/utils/uuid.d.mts +1 -1
  176. package/internal/utils/uuid.d.mts.map +1 -1
  177. package/internal/utils/uuid.d.ts +1 -1
  178. package/internal/utils/uuid.d.ts.map +1 -1
  179. package/internal/utils/uuid.js +1 -2
  180. package/internal/utils/uuid.js.map +1 -1
  181. package/internal/utils/uuid.mjs +1 -2
  182. package/internal/utils/uuid.mjs.map +1 -1
  183. package/internal/utils/values.d.mts.map +1 -1
  184. package/internal/utils/values.d.ts.map +1 -1
  185. package/internal/utils/values.js +10 -10
  186. package/internal/utils/values.js.map +1 -1
  187. package/internal/utils/values.mjs +6 -6
  188. package/internal/utils/values.mjs.map +1 -1
  189. package/internal/utils.js +7 -20
  190. package/internal/utils.js.map +1 -1
  191. package/package.json +5 -9
  192. package/resource.js +2 -15
  193. package/resource.js.map +1 -1
  194. package/resources/auth-configs.d.mts +232 -41
  195. package/resources/auth-configs.d.mts.map +1 -1
  196. package/resources/auth-configs.d.ts +232 -41
  197. package/resources/auth-configs.d.ts.map +1 -1
  198. package/resources/auth-configs.js +64 -0
  199. package/resources/auth-configs.js.map +1 -1
  200. package/resources/auth-configs.mjs +64 -0
  201. package/resources/auth-configs.mjs.map +1 -1
  202. package/resources/connected-accounts.d.mts +176 -216
  203. package/resources/connected-accounts.d.mts.map +1 -1
  204. package/resources/connected-accounts.d.ts +176 -216
  205. package/resources/connected-accounts.d.ts.map +1 -1
  206. package/resources/connected-accounts.js +70 -0
  207. package/resources/connected-accounts.js.map +1 -1
  208. package/resources/connected-accounts.mjs +70 -0
  209. package/resources/connected-accounts.mjs.map +1 -1
  210. package/resources/files.d.mts +159 -0
  211. package/resources/files.d.mts.map +1 -0
  212. package/resources/files.d.ts +159 -0
  213. package/resources/files.d.ts.map +1 -0
  214. package/resources/files.js +39 -0
  215. package/resources/files.js.map +1 -0
  216. package/resources/files.mjs +35 -0
  217. package/resources/files.mjs.map +1 -0
  218. package/resources/index.d.mts +5 -4
  219. package/resources/index.d.mts.map +1 -1
  220. package/resources/index.d.ts +5 -4
  221. package/resources/index.d.ts.map +1 -1
  222. package/resources/index.js +7 -5
  223. package/resources/index.js.map +1 -1
  224. package/resources/index.mjs +3 -2
  225. package/resources/index.mjs.map +1 -1
  226. package/resources/mcp/command.d.mts +4 -0
  227. package/resources/mcp/command.d.mts.map +1 -0
  228. package/resources/mcp/command.d.ts +4 -0
  229. package/resources/mcp/command.d.ts.map +1 -0
  230. package/resources/mcp/command.js +9 -0
  231. package/resources/mcp/command.js.map +1 -0
  232. package/resources/mcp/command.mjs +5 -0
  233. package/resources/mcp/command.mjs.map +1 -0
  234. package/resources/mcp/index.d.mts +3 -0
  235. package/resources/mcp/index.d.mts.map +1 -0
  236. package/resources/mcp/index.d.ts +3 -0
  237. package/resources/mcp/index.d.ts.map +1 -0
  238. package/resources/mcp/index.js +9 -0
  239. package/resources/mcp/index.js.map +1 -0
  240. package/resources/mcp/index.mjs +4 -0
  241. package/resources/mcp/index.mjs.map +1 -0
  242. package/resources/mcp/mcp.d.mts +411 -0
  243. package/resources/mcp/mcp.d.mts.map +1 -0
  244. package/resources/mcp/mcp.d.ts +411 -0
  245. package/resources/mcp/mcp.d.ts.map +1 -0
  246. package/resources/mcp/mcp.js +101 -0
  247. package/resources/mcp/mcp.js.map +1 -0
  248. package/resources/mcp/mcp.mjs +96 -0
  249. package/resources/mcp/mcp.mjs.map +1 -0
  250. package/resources/mcp.d.mts +2 -0
  251. package/resources/mcp.d.mts.map +1 -0
  252. package/resources/mcp.d.ts +2 -0
  253. package/resources/mcp.d.ts.map +1 -0
  254. package/resources/mcp.js +6 -0
  255. package/resources/mcp.js.map +1 -0
  256. package/resources/mcp.mjs +3 -0
  257. package/resources/mcp.mjs.map +1 -0
  258. package/resources/migration.d.mts +32 -0
  259. package/resources/migration.d.mts.map +1 -0
  260. package/resources/migration.d.ts +32 -0
  261. package/resources/migration.d.ts.map +1 -0
  262. package/resources/migration.js +17 -0
  263. package/resources/migration.js.map +1 -0
  264. package/resources/migration.mjs +13 -0
  265. package/resources/migration.mjs.map +1 -0
  266. package/resources/org/api-key.d.mts +28 -0
  267. package/resources/org/api-key.d.mts.map +1 -1
  268. package/resources/org/api-key.d.ts +28 -0
  269. package/resources/org/api-key.d.ts.map +1 -1
  270. package/resources/org/api-key.js +20 -0
  271. package/resources/org/api-key.js.map +1 -1
  272. package/resources/org/api-key.mjs +20 -0
  273. package/resources/org/api-key.mjs.map +1 -1
  274. package/resources/org/org.js +3 -25
  275. package/resources/org/org.js.map +1 -1
  276. package/resources/org/project/api-keys.d.mts +97 -20
  277. package/resources/org/project/api-keys.d.mts.map +1 -1
  278. package/resources/org/project/api-keys.d.ts +97 -20
  279. package/resources/org/project/api-keys.d.ts.map +1 -1
  280. package/resources/org/project/api-keys.js +57 -0
  281. package/resources/org/project/api-keys.js.map +1 -1
  282. package/resources/org/project/api-keys.mjs +57 -0
  283. package/resources/org/project/api-keys.mjs.map +1 -1
  284. package/resources/org/project/project.d.mts +182 -7
  285. package/resources/org/project/project.d.mts.map +1 -1
  286. package/resources/org/project/project.d.ts +182 -7
  287. package/resources/org/project/project.d.ts.map +1 -1
  288. package/resources/org/project/project.js +56 -26
  289. package/resources/org/project/project.js.map +1 -1
  290. package/resources/org/project/project.mjs +52 -0
  291. package/resources/org/project/project.mjs.map +1 -1
  292. package/resources/org/project/trigger.d.mts +101 -5
  293. package/resources/org/project/trigger.d.mts.map +1 -1
  294. package/resources/org/project/trigger.d.ts +101 -5
  295. package/resources/org/project/trigger.d.ts.map +1 -1
  296. package/resources/org/project/trigger.js +21 -0
  297. package/resources/org/project/trigger.js.map +1 -1
  298. package/resources/org/project/trigger.mjs +21 -0
  299. package/resources/org/project/trigger.mjs.map +1 -1
  300. package/resources/org/project/webhook.d.mts +88 -14
  301. package/resources/org/project/webhook.d.mts.map +1 -1
  302. package/resources/org/project/webhook.d.ts +88 -14
  303. package/resources/org/project/webhook.d.ts.map +1 -1
  304. package/resources/org/project/webhook.js +51 -1
  305. package/resources/org/project/webhook.js.map +1 -1
  306. package/resources/org/project/webhook.mjs +51 -1
  307. package/resources/org/project/webhook.mjs.map +1 -1
  308. package/resources/org/project.js +2 -15
  309. package/resources/org/project.js.map +1 -1
  310. package/resources/org.js +2 -15
  311. package/resources/org.js.map +1 -1
  312. package/resources/team-members.d.mts +12 -0
  313. package/resources/team-members.d.mts.map +1 -1
  314. package/resources/team-members.d.ts +12 -0
  315. package/resources/team-members.d.ts.map +1 -1
  316. package/resources/team-members.js +12 -0
  317. package/resources/team-members.js.map +1 -1
  318. package/resources/team-members.mjs +12 -0
  319. package/resources/team-members.mjs.map +1 -1
  320. package/resources/toolkits.d.mts +215 -4
  321. package/resources/toolkits.d.mts.map +1 -1
  322. package/resources/toolkits.d.ts +215 -4
  323. package/resources/toolkits.d.ts.map +1 -1
  324. package/resources/toolkits.js +20 -2
  325. package/resources/toolkits.js.map +1 -1
  326. package/resources/toolkits.mjs +20 -2
  327. package/resources/toolkits.mjs.map +1 -1
  328. package/resources/tools.d.mts +295 -21
  329. package/resources/tools.d.mts.map +1 -1
  330. package/resources/tools.d.ts +295 -21
  331. package/resources/tools.d.ts.map +1 -1
  332. package/resources/tools.js +67 -0
  333. package/resources/tools.js.map +1 -1
  334. package/resources/tools.mjs +67 -0
  335. package/resources/tools.mjs.map +1 -1
  336. package/resources/trigger-instances/handle.d.mts +2 -2
  337. package/resources/trigger-instances/handle.d.mts.map +1 -1
  338. package/resources/trigger-instances/handle.d.ts +2 -2
  339. package/resources/trigger-instances/handle.d.ts.map +1 -1
  340. package/resources/trigger-instances/handle.js.map +1 -1
  341. package/resources/trigger-instances/handle.mjs.map +1 -1
  342. package/resources/trigger-instances/index.d.mts +1 -1
  343. package/resources/trigger-instances/index.d.mts.map +1 -1
  344. package/resources/trigger-instances/index.d.ts +1 -1
  345. package/resources/trigger-instances/index.d.ts.map +1 -1
  346. package/resources/trigger-instances/index.js.map +1 -1
  347. package/resources/trigger-instances/index.mjs.map +1 -1
  348. package/resources/trigger-instances/trigger-instances.d.mts +51 -31
  349. package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
  350. package/resources/trigger-instances/trigger-instances.d.ts +51 -31
  351. package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
  352. package/resources/trigger-instances/trigger-instances.js +3 -32
  353. package/resources/trigger-instances/trigger-instances.js.map +1 -1
  354. package/resources/trigger-instances/trigger-instances.mjs +1 -8
  355. package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
  356. package/resources/trigger-instances.js +2 -15
  357. package/resources/trigger-instances.js.map +1 -1
  358. package/resources/triggers-types.d.mts +105 -4
  359. package/resources/triggers-types.d.mts.map +1 -1
  360. package/resources/triggers-types.d.ts +105 -4
  361. package/resources/triggers-types.d.ts.map +1 -1
  362. package/resources/triggers-types.js +29 -0
  363. package/resources/triggers-types.js.map +1 -1
  364. package/resources/triggers-types.mjs +29 -0
  365. package/resources/triggers-types.mjs.map +1 -1
  366. package/resources.js +2 -15
  367. package/resources.js.map +1 -1
  368. package/src/client.ts +128 -94
  369. package/src/core/api-promise.ts +4 -4
  370. package/src/core/error.ts +2 -2
  371. package/src/core/resource.ts +3 -3
  372. package/src/index.ts +3 -3
  373. package/src/internal/headers.ts +4 -3
  374. package/src/internal/parse.ts +2 -2
  375. package/src/internal/qs/LICENSE.md +13 -0
  376. package/src/internal/qs/README.md +3 -0
  377. package/src/internal/qs/formats.ts +9 -0
  378. package/src/internal/qs/index.ts +13 -0
  379. package/src/internal/qs/stringify.ts +388 -0
  380. package/src/internal/qs/types.ts +71 -0
  381. package/src/internal/qs/utils.ts +265 -0
  382. package/src/internal/shims.ts +1 -1
  383. package/src/internal/to-file.ts +4 -2
  384. package/src/internal/uploads.ts +21 -9
  385. package/src/internal/utils/base64.ts +16 -13
  386. package/src/internal/utils/bytes.ts +32 -0
  387. package/src/internal/utils/log.ts +3 -3
  388. package/src/internal/utils/path.ts +2 -4
  389. package/src/internal/utils/uuid.ts +1 -3
  390. package/src/internal/utils/values.ts +6 -6
  391. package/src/resources/auth-configs.ts +258 -49
  392. package/src/resources/connected-accounts.ts +192 -302
  393. package/src/resources/files.ts +209 -0
  394. package/src/resources/index.ts +24 -11
  395. package/src/resources/mcp/command.ts +5 -0
  396. package/src/resources/mcp/index.ts +14 -0
  397. package/src/resources/mcp/mcp.ts +522 -0
  398. package/src/resources/mcp.ts +3 -0
  399. package/src/resources/migration.ts +46 -0
  400. package/src/resources/org/api-key.ts +28 -0
  401. package/src/resources/org/project/api-keys.ts +97 -20
  402. package/src/resources/org/project/project.ts +182 -13
  403. package/src/resources/org/project/trigger.ts +101 -9
  404. package/src/resources/org/project/webhook.ts +88 -14
  405. package/src/resources/team-members.ts +12 -0
  406. package/src/resources/toolkits.ts +230 -4
  407. package/src/resources/tools.ts +316 -21
  408. package/src/resources/trigger-instances/handle.ts +10 -2
  409. package/src/resources/trigger-instances/index.ts +0 -3
  410. package/src/resources/trigger-instances/trigger-instances.ts +55 -44
  411. package/src/resources/triggers-types.ts +107 -6
  412. package/src/version.ts +1 -1
  413. package/uploads.js +2 -15
  414. package/uploads.js.map +1 -1
  415. package/version.d.mts +1 -1
  416. package/version.d.mts.map +1 -1
  417. package/version.d.ts +1 -1
  418. package/version.d.ts.map +1 -1
  419. package/version.js +1 -1
  420. package/version.js.map +1 -1
  421. package/version.mjs +1 -1
  422. package/version.mjs.map +1 -1
  423. package/internal/shims/crypto.d.mts +0 -13
  424. package/internal/shims/crypto.d.mts.map +0 -1
  425. package/internal/shims/crypto.d.ts +0 -13
  426. package/internal/shims/crypto.d.ts.map +0 -1
  427. package/internal/shims/crypto.js +0 -13
  428. package/internal/shims/crypto.js.map +0 -1
  429. package/internal/shims/crypto.mjs +0 -9
  430. package/internal/shims/crypto.mjs.map +0 -1
  431. package/internal/shims/file.d.mts +0 -23
  432. package/internal/shims/file.d.mts.map +0 -1
  433. package/internal/shims/file.d.ts +0 -23
  434. package/internal/shims/file.d.ts.map +0 -1
  435. package/internal/shims/file.js +0 -16
  436. package/internal/shims/file.js.map +0 -1
  437. package/internal/shims/file.mjs +0 -12
  438. package/internal/shims/file.mjs.map +0 -1
  439. package/internal/shims/getBuiltinModule.d.mts +0 -11
  440. package/internal/shims/getBuiltinModule.d.mts.map +0 -1
  441. package/internal/shims/getBuiltinModule.d.ts +0 -11
  442. package/internal/shims/getBuiltinModule.d.ts.map +0 -1
  443. package/internal/shims/getBuiltinModule.js +0 -68
  444. package/internal/shims/getBuiltinModule.js.map +0 -1
  445. package/internal/shims/getBuiltinModule.mjs +0 -64
  446. package/internal/shims/getBuiltinModule.mjs.map +0 -1
  447. package/internal/shims/nullGetBuiltinModule.d.mts +0 -2
  448. package/internal/shims/nullGetBuiltinModule.d.mts.map +0 -1
  449. package/internal/shims/nullGetBuiltinModule.d.ts +0 -2
  450. package/internal/shims/nullGetBuiltinModule.d.ts.map +0 -1
  451. package/internal/shims/nullGetBuiltinModule.js +0 -5
  452. package/internal/shims/nullGetBuiltinModule.js.map +0 -1
  453. package/internal/shims/nullGetBuiltinModule.mjs +0 -2
  454. package/internal/shims/nullGetBuiltinModule.mjs.map +0 -1
  455. package/resources/action-execution.d.mts +0 -155
  456. package/resources/action-execution.d.mts.map +0 -1
  457. package/resources/action-execution.d.ts +0 -155
  458. package/resources/action-execution.d.ts.map +0 -1
  459. package/resources/action-execution.js +0 -19
  460. package/resources/action-execution.js.map +0 -1
  461. package/resources/action-execution.mjs +0 -15
  462. package/resources/action-execution.mjs.map +0 -1
  463. package/resources/trigger.d.mts +0 -73
  464. package/resources/trigger.d.mts.map +0 -1
  465. package/resources/trigger.d.ts +0 -73
  466. package/resources/trigger.d.ts.map +0 -1
  467. package/resources/trigger.js +0 -12
  468. package/resources/trigger.js.map +0 -1
  469. package/resources/trigger.mjs +0 -8
  470. package/resources/trigger.mjs.map +0 -1
  471. package/src/internal/shims/crypto.ts +0 -18
  472. package/src/internal/shims/file.ts +0 -32
  473. package/src/internal/shims/getBuiltinModule.ts +0 -64
  474. package/src/internal/shims/nullGetBuiltinModule.ts +0 -1
  475. package/src/resources/action-execution.ts +0 -244
  476. package/src/resources/trigger.ts +0 -108
package/src/client.ts CHANGED
@@ -12,6 +12,7 @@ import type { APIResponseProps } from './internal/parse';
12
12
  import { getPlatformHeaders } from './internal/detect-platform';
13
13
  import * as Shims from './internal/shims';
14
14
  import * as Opts from './internal/request-options';
15
+ import * as qs from './internal/qs';
15
16
  import { VERSION } from './version';
16
17
  import * as Errors from './core/error';
17
18
  import * as Uploads from './core/uploads';
@@ -20,13 +21,6 @@ import { APIPromise } from './core/api-promise';
20
21
  import { type Fetch } from './internal/builtin-types';
21
22
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
22
23
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
23
- import {
24
- ActionExecution,
25
- ActionExecutionLogParams,
26
- ActionExecutionLogResponse,
27
- ActionExecutionRetrieveFieldsResponse,
28
- ActionExecutionRetrieveLogResponse,
29
- } from './resources/action-execution';
30
24
  import {
31
25
  AuthConfigCreateParams,
32
26
  AuthConfigCreateResponse,
@@ -52,6 +46,18 @@ import {
52
46
  ConnectedAccountUpdateStatusResponse,
53
47
  ConnectedAccounts,
54
48
  } from './resources/connected-accounts';
49
+ import {
50
+ FileCreatePresignedURLParams,
51
+ FileCreatePresignedURLResponse,
52
+ FileListParams,
53
+ FileListResponse,
54
+ Files,
55
+ } from './resources/files';
56
+ import {
57
+ Migration,
58
+ MigrationRetrieveNanoidParams,
59
+ MigrationRetrieveNanoidResponse,
60
+ } from './resources/migration';
55
61
  import {
56
62
  TeamMemberInviteParams,
57
63
  TeamMemberInviteResponse,
@@ -64,6 +70,7 @@ import {
64
70
  import {
65
71
  ToolkitListParams,
66
72
  ToolkitListResponse,
73
+ ToolkitRetrieveCategoriesParams,
67
74
  ToolkitRetrieveCategoriesResponse,
68
75
  ToolkitRetrieveResponse,
69
76
  Toolkits,
@@ -81,7 +88,6 @@ import {
81
88
  ToolRetrieveResponse,
82
89
  Tools,
83
90
  } from './resources/tools';
84
- import { Trigger, TriggerLogParams, TriggerLogResponse } from './resources/trigger';
85
91
  import {
86
92
  TriggersTypeListParams,
87
93
  TriggersTypeListResponse,
@@ -92,13 +98,21 @@ import {
92
98
  import { readEnv } from './internal/utils/env';
93
99
  import { formatRequestDetails, loggerFor } from './internal/utils/log';
94
100
  import { isEmptyObj } from './internal/utils/values';
101
+ import {
102
+ Mcp,
103
+ McpDeleteResponse,
104
+ McpRetrieveAppParams,
105
+ McpRetrieveAppResponse,
106
+ McpRetrieveResponse,
107
+ McpUpdateParams,
108
+ McpUpdateResponse,
109
+ McpValidateParams,
110
+ McpValidateResponse,
111
+ } from './resources/mcp/mcp';
95
112
  import { Org } from './resources/org/org';
96
113
  import {
97
114
  TriggerInstanceListActiveParams,
98
115
  TriggerInstanceListActiveResponse,
99
- TriggerInstanceRemoveUpsertResponse,
100
- TriggerInstanceUpdateStatusParams,
101
- TriggerInstanceUpdateStatusResponse,
102
116
  TriggerInstanceUpsertParams,
103
117
  TriggerInstanceUpsertResponse,
104
118
  TriggerInstances,
@@ -107,15 +121,15 @@ import {
107
121
  const environments = {
108
122
  production: 'https://backend.composio.dev',
109
123
  staging: 'https://staging-backend.composio.dev',
110
- local: 'http://localhost:9901',
124
+ local: 'http://localhost:9900',
111
125
  };
112
126
  type Environment = keyof typeof environments;
113
127
 
114
128
  export interface ClientOptions {
115
129
  /**
116
- * Defaults to process.env['COMPOSIO_API_KEY'].
130
+ * API key authentication
117
131
  */
118
- apiKey?: string | undefined;
132
+ apiKey?: string | null | undefined;
119
133
 
120
134
  /**
121
135
  * Specifies the environment to use for the API.
@@ -123,14 +137,14 @@ export interface ClientOptions {
123
137
  * Each environment maps to a different base URL:
124
138
  * - `production` corresponds to `https://backend.composio.dev`
125
139
  * - `staging` corresponds to `https://staging-backend.composio.dev`
126
- * - `local` corresponds to `http://localhost:9901`
140
+ * - `local` corresponds to `http://localhost:9900`
127
141
  */
128
142
  environment?: Environment | undefined;
129
143
 
130
144
  /**
131
145
  * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
132
146
  *
133
- * Defaults to process.env['COMPOSIO_SDK_BASE_URL'].
147
+ * Defaults to process.env['COMPOSIO_BASE_URL'].
134
148
  */
135
149
  baseURL?: string | null | undefined;
136
150
 
@@ -182,7 +196,7 @@ export interface ClientOptions {
182
196
  /**
183
197
  * Set the log level.
184
198
  *
185
- * Defaults to process.env['COMPOSIO_SDK_LOG'] or 'warn' if it isn't set.
199
+ * Defaults to process.env['COMPOSIO_LOG'] or 'warn' if it isn't set.
186
200
  */
187
201
  logLevel?: LogLevel | undefined;
188
202
 
@@ -195,10 +209,10 @@ export interface ClientOptions {
195
209
  }
196
210
 
197
211
  /**
198
- * API Client for interfacing with the Composio SDK API.
212
+ * API Client for interfacing with the Composio API.
199
213
  */
200
- export class ComposioSDK {
201
- apiKey: string;
214
+ export class Composio {
215
+ apiKey: string | null;
202
216
 
203
217
  baseURL: string;
204
218
  maxRetries: number;
@@ -213,11 +227,11 @@ export class ComposioSDK {
213
227
  private _options: ClientOptions;
214
228
 
215
229
  /**
216
- * API Client for interfacing with the Composio SDK API.
230
+ * API Client for interfacing with the Composio API.
217
231
  *
218
- * @param {string | undefined} [opts.apiKey=process.env['COMPOSIO_API_KEY'] ?? undefined]
232
+ * @param {string | null | undefined} [opts.apiKey=process.env['COMPOSIO_API_KEY'] ?? null]
219
233
  * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
220
- * @param {string} [opts.baseURL=process.env['COMPOSIO_SDK_BASE_URL'] ?? https://backend.composio.dev] - Override the default base URL for the API.
234
+ * @param {string} [opts.baseURL=process.env['COMPOSIO_BASE_URL'] ?? https://backend.composio.dev] - Override the default base URL for the API.
221
235
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
222
236
  * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
223
237
  * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -226,16 +240,10 @@ export class ComposioSDK {
226
240
  * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
227
241
  */
228
242
  constructor({
229
- baseURL = readEnv('COMPOSIO_SDK_BASE_URL'),
230
- apiKey = readEnv('COMPOSIO_API_KEY'),
243
+ baseURL = readEnv('COMPOSIO_BASE_URL'),
244
+ apiKey = readEnv('COMPOSIO_API_KEY') ?? null,
231
245
  ...opts
232
246
  }: ClientOptions = {}) {
233
- if (apiKey === undefined) {
234
- throw new Errors.ComposioSDKError(
235
- "The COMPOSIO_API_KEY environment variable is missing or empty; either provide it, or instantiate the ComposioSDK client with an apiKey option, like new ComposioSDK({ apiKey: 'My API Key' }).",
236
- );
237
- }
238
-
239
247
  const options: ClientOptions = {
240
248
  apiKey,
241
249
  ...opts,
@@ -244,20 +252,20 @@ export class ComposioSDK {
244
252
  };
245
253
 
246
254
  if (baseURL && opts.environment) {
247
- throw new Errors.ComposioSDKError(
248
- 'Ambiguous URL; The `baseURL` option (or COMPOSIO_SDK_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null',
255
+ throw new Errors.ComposioError(
256
+ 'Ambiguous URL; The `baseURL` option (or COMPOSIO_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null',
249
257
  );
250
258
  }
251
259
 
252
260
  this.baseURL = options.baseURL || environments[options.environment || 'production'];
253
- this.timeout = options.timeout ?? ComposioSDK.DEFAULT_TIMEOUT /* 1 minute */;
261
+ this.timeout = options.timeout ?? Composio.DEFAULT_TIMEOUT /* 1 minute */;
254
262
  this.logger = options.logger ?? console;
255
263
  const defaultLogLevel = 'warn';
256
264
  // Set default logLevel early so that we can log a warning in parseLogLevel.
257
265
  this.logLevel = defaultLogLevel;
258
266
  this.logLevel =
259
267
  parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??
260
- parseLogLevel(readEnv('COMPOSIO_SDK_LOG'), "process.env['COMPOSIO_SDK_LOG']", this) ??
268
+ parseLogLevel(readEnv('COMPOSIO_LOG'), "process.env['COMPOSIO_LOG']", this) ??
261
269
  defaultLogLevel;
262
270
  this.fetchOptions = options.fetchOptions;
263
271
  this.maxRetries = options.maxRetries ?? 2;
@@ -269,36 +277,50 @@ export class ComposioSDK {
269
277
  this.apiKey = apiKey;
270
278
  }
271
279
 
280
+ /**
281
+ * Create a new client instance re-using the same options given to the current client with optional overriding.
282
+ */
283
+ withOptions(options: Partial<ClientOptions>): this {
284
+ return new (this.constructor as any as new (props: ClientOptions) => typeof this)({
285
+ ...this._options,
286
+ environment: options.environment ? options.environment : undefined,
287
+ baseURL: options.environment ? undefined : this.baseURL,
288
+ maxRetries: this.maxRetries,
289
+ timeout: this.timeout,
290
+ logger: this.logger,
291
+ logLevel: this.logLevel,
292
+ fetchOptions: this.fetchOptions,
293
+ apiKey: this.apiKey,
294
+ ...options,
295
+ });
296
+ }
297
+
272
298
  protected defaultQuery(): Record<string, string | undefined> | undefined {
273
299
  return this._options.defaultQuery;
274
300
  }
275
301
 
276
302
  protected validateHeaders({ values, nulls }: NullableHeaders) {
277
- return;
303
+ if (this.apiKey && values.get('x-api-key')) {
304
+ return;
305
+ }
306
+ if (nulls.has('x-api-key')) {
307
+ return;
308
+ }
309
+
310
+ throw new Error(
311
+ 'Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-api-key" headers to be explicitly omitted',
312
+ );
278
313
  }
279
314
 
280
315
  protected authHeaders(opts: FinalRequestOptions): NullableHeaders | undefined {
281
- return buildHeaders([{ 'X-Api-Key': this.apiKey }]);
316
+ if (this.apiKey == null) {
317
+ return undefined;
318
+ }
319
+ return buildHeaders([{ 'x-api-key': this.apiKey }]);
282
320
  }
283
321
 
284
- /**
285
- * Basic re-implementation of `qs.stringify` for primitive types.
286
- */
287
322
  protected stringifyQuery(query: Record<string, unknown>): string {
288
- return Object.entries(query)
289
- .filter(([_, value]) => typeof value !== 'undefined')
290
- .map(([key, value]) => {
291
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
292
- return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
293
- }
294
- if (value === null) {
295
- return `${encodeURIComponent(key)}=`;
296
- }
297
- throw new Errors.ComposioSDKError(
298
- `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
299
- );
300
- })
301
- .join('&');
323
+ return qs.stringify(query, { arrayFormat: 'comma' });
302
324
  }
303
325
 
304
326
  private getUserAgent(): string {
@@ -573,12 +595,12 @@ export class ComposioSDK {
573
595
  fetchOptions.method = method.toUpperCase();
574
596
  }
575
597
 
576
- return (
598
+ try {
577
599
  // use undefined this binding; fetch errors if bound to something else in browser/cloudflare
578
- this.fetch.call(undefined, url, fetchOptions).finally(() => {
579
- clearTimeout(timeout);
580
- })
581
- );
600
+ return await this.fetch.call(undefined, url, fetchOptions);
601
+ } finally {
602
+ clearTimeout(timeout);
603
+ }
582
604
  }
583
605
 
584
606
  private shouldRetry(response: Response): boolean {
@@ -659,17 +681,17 @@ export class ComposioSDK {
659
681
  }
660
682
 
661
683
  buildRequest(
662
- options: FinalRequestOptions,
684
+ inputOptions: FinalRequestOptions,
663
685
  { retryCount = 0 }: { retryCount?: number } = {},
664
686
  ): { req: FinalizedRequestInit; url: string; timeout: number } {
665
- options = { ...options };
687
+ const options = { ...inputOptions };
666
688
  const { method, path, query } = options;
667
689
 
668
690
  const url = this.buildURL(path!, query as Record<string, unknown>);
669
691
  if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
670
692
  options.timeout = options.timeout ?? this.timeout;
671
693
  const { bodyHeaders, body } = this.buildBody({ options });
672
- const reqHeaders = this.buildHeaders({ options, method, bodyHeaders, retryCount });
694
+ const reqHeaders = this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount });
673
695
 
674
696
  const req: FinalizedRequestInit = {
675
697
  method,
@@ -759,10 +781,10 @@ export class ComposioSDK {
759
781
  }
760
782
  }
761
783
 
762
- static ComposioSDK = this;
784
+ static Composio = this;
763
785
  static DEFAULT_TIMEOUT = 60000; // 1 minute
764
786
 
765
- static ComposioSDKError = Errors.ComposioSDKError;
787
+ static ComposioError = Errors.ComposioError;
766
788
  static APIError = Errors.APIError;
767
789
  static APIConnectionError = Errors.APIConnectionError;
768
790
  static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
@@ -780,26 +802,28 @@ export class ComposioSDK {
780
802
 
781
803
  authConfigs: API.AuthConfigs = new API.AuthConfigs(this);
782
804
  connectedAccounts: API.ConnectedAccounts = new API.ConnectedAccounts(this);
783
- trigger: API.Trigger = new API.Trigger(this);
784
- actionExecution: API.ActionExecution = new API.ActionExecution(this);
785
805
  org: API.Org = new API.Org(this);
786
806
  teamMembers: API.TeamMembers = new API.TeamMembers(this);
787
807
  toolkits: API.Toolkits = new API.Toolkits(this);
788
808
  tools: API.Tools = new API.Tools(this);
789
809
  triggerInstances: API.TriggerInstances = new API.TriggerInstances(this);
790
810
  triggersTypes: API.TriggersTypes = new API.TriggersTypes(this);
811
+ mcp: API.Mcp = new API.Mcp(this);
812
+ files: API.Files = new API.Files(this);
813
+ migration: API.Migration = new API.Migration(this);
791
814
  }
792
- ComposioSDK.AuthConfigs = AuthConfigs;
793
- ComposioSDK.ConnectedAccounts = ConnectedAccounts;
794
- ComposioSDK.Trigger = Trigger;
795
- ComposioSDK.ActionExecution = ActionExecution;
796
- ComposioSDK.Org = Org;
797
- ComposioSDK.TeamMembers = TeamMembers;
798
- ComposioSDK.Toolkits = Toolkits;
799
- ComposioSDK.Tools = Tools;
800
- ComposioSDK.TriggerInstances = TriggerInstances;
801
- ComposioSDK.TriggersTypes = TriggersTypes;
802
- export declare namespace ComposioSDK {
815
+ Composio.AuthConfigs = AuthConfigs;
816
+ Composio.ConnectedAccounts = ConnectedAccounts;
817
+ Composio.Org = Org;
818
+ Composio.TeamMembers = TeamMembers;
819
+ Composio.Toolkits = Toolkits;
820
+ Composio.Tools = Tools;
821
+ Composio.TriggerInstances = TriggerInstances;
822
+ Composio.TriggersTypes = TriggersTypes;
823
+ Composio.Mcp = Mcp;
824
+ Composio.Files = Files;
825
+ Composio.Migration = Migration;
826
+ export declare namespace Composio {
803
827
  export type RequestOptions = Opts.RequestOptions;
804
828
 
805
829
  export {
@@ -829,20 +853,6 @@ export declare namespace ComposioSDK {
829
853
  type ConnectedAccountUpdateStatusParams as ConnectedAccountUpdateStatusParams,
830
854
  };
831
855
 
832
- export {
833
- Trigger as Trigger,
834
- type TriggerLogResponse as TriggerLogResponse,
835
- type TriggerLogParams as TriggerLogParams,
836
- };
837
-
838
- export {
839
- ActionExecution as ActionExecution,
840
- type ActionExecutionLogResponse as ActionExecutionLogResponse,
841
- type ActionExecutionRetrieveFieldsResponse as ActionExecutionRetrieveFieldsResponse,
842
- type ActionExecutionRetrieveLogResponse as ActionExecutionRetrieveLogResponse,
843
- type ActionExecutionLogParams as ActionExecutionLogParams,
844
- };
845
-
846
856
  export { Org as Org };
847
857
 
848
858
  export {
@@ -861,6 +871,7 @@ export declare namespace ComposioSDK {
861
871
  type ToolkitListResponse as ToolkitListResponse,
862
872
  type ToolkitRetrieveCategoriesResponse as ToolkitRetrieveCategoriesResponse,
863
873
  type ToolkitListParams as ToolkitListParams,
874
+ type ToolkitRetrieveCategoriesParams as ToolkitRetrieveCategoriesParams,
864
875
  };
865
876
 
866
877
  export {
@@ -880,11 +891,8 @@ export declare namespace ComposioSDK {
880
891
  export {
881
892
  TriggerInstances as TriggerInstances,
882
893
  type TriggerInstanceListActiveResponse as TriggerInstanceListActiveResponse,
883
- type TriggerInstanceRemoveUpsertResponse as TriggerInstanceRemoveUpsertResponse,
884
- type TriggerInstanceUpdateStatusResponse as TriggerInstanceUpdateStatusResponse,
885
894
  type TriggerInstanceUpsertResponse as TriggerInstanceUpsertResponse,
886
895
  type TriggerInstanceListActiveParams as TriggerInstanceListActiveParams,
887
- type TriggerInstanceUpdateStatusParams as TriggerInstanceUpdateStatusParams,
888
896
  type TriggerInstanceUpsertParams as TriggerInstanceUpsertParams,
889
897
  };
890
898
 
@@ -895,4 +903,30 @@ export declare namespace ComposioSDK {
895
903
  type TriggersTypeRetrieveEnumResponse as TriggersTypeRetrieveEnumResponse,
896
904
  type TriggersTypeListParams as TriggersTypeListParams,
897
905
  };
906
+
907
+ export {
908
+ Mcp as Mcp,
909
+ type McpRetrieveResponse as McpRetrieveResponse,
910
+ type McpUpdateResponse as McpUpdateResponse,
911
+ type McpDeleteResponse as McpDeleteResponse,
912
+ type McpRetrieveAppResponse as McpRetrieveAppResponse,
913
+ type McpValidateResponse as McpValidateResponse,
914
+ type McpUpdateParams as McpUpdateParams,
915
+ type McpRetrieveAppParams as McpRetrieveAppParams,
916
+ type McpValidateParams as McpValidateParams,
917
+ };
918
+
919
+ export {
920
+ Files as Files,
921
+ type FileListResponse as FileListResponse,
922
+ type FileCreatePresignedURLResponse as FileCreatePresignedURLResponse,
923
+ type FileListParams as FileListParams,
924
+ type FileCreatePresignedURLParams as FileCreatePresignedURLParams,
925
+ };
926
+
927
+ export {
928
+ Migration as Migration,
929
+ type MigrationRetrieveNanoidResponse as MigrationRetrieveNanoidResponse,
930
+ type MigrationRetrieveNanoidParams as MigrationRetrieveNanoidParams,
931
+ };
898
932
  }
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { type ComposioSDK } from '../client';
3
+ import { type Composio } from '../client';
4
4
 
5
5
  import { type PromiseOrValue } from '../internal/types';
6
6
  import { APIResponseProps, defaultParseResponse } from '../internal/parse';
@@ -11,13 +11,13 @@ import { APIResponseProps, defaultParseResponse } from '../internal/parse';
11
11
  */
12
12
  export class APIPromise<T> extends Promise<T> {
13
13
  private parsedPromise: Promise<T> | undefined;
14
- #client: ComposioSDK;
14
+ #client: Composio;
15
15
 
16
16
  constructor(
17
- client: ComposioSDK,
17
+ client: Composio,
18
18
  private responsePromise: Promise<APIResponseProps>,
19
19
  private parseResponse: (
20
- client: ComposioSDK,
20
+ client: Composio,
21
21
  props: APIResponseProps,
22
22
  ) => PromiseOrValue<T> = defaultParseResponse,
23
23
  ) {
package/src/core/error.ts CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  import { castToError } from '../internal/errors';
4
4
 
5
- export class ComposioSDKError extends Error {}
5
+ export class ComposioError extends Error {}
6
6
 
7
7
  export class APIError<
8
8
  TStatus extends number | undefined = number | undefined,
9
9
  THeaders extends Headers | undefined = Headers | undefined,
10
10
  TError extends Object | undefined = Object | undefined,
11
- > extends ComposioSDKError {
11
+ > extends ComposioError {
12
12
  /** HTTP status for the response that caused the error */
13
13
  readonly status: TStatus;
14
14
  /** HTTP headers for the response that caused the error */
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import type { ComposioSDK } from '../client';
3
+ import type { Composio } from '../client';
4
4
 
5
5
  export class APIResource {
6
- protected _client: ComposioSDK;
6
+ protected _client: Composio;
7
7
 
8
- constructor(client: ComposioSDK) {
8
+ constructor(client: Composio) {
9
9
  this._client = client;
10
10
  }
11
11
  }
package/src/index.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { ComposioSDK as default } from './client';
3
+ export { Composio as default } from './client';
4
4
 
5
5
  export { type Uploadable, toFile } from './core/uploads';
6
6
  export { APIPromise } from './core/api-promise';
7
- export { ComposioSDK, type ClientOptions } from './client';
7
+ export { Composio, type ClientOptions } from './client';
8
8
  export {
9
- ComposioSDKError,
9
+ ComposioError,
10
10
  APIError,
11
11
  APIConnectionError,
12
12
  APIConnectionTimeoutError,
@@ -3,7 +3,7 @@
3
3
  type HeaderValue = string | undefined | null;
4
4
  export type HeadersLike =
5
5
  | Headers
6
- | readonly [string, HeaderValue][]
6
+ | readonly HeaderValue[][]
7
7
  | Record<string, HeaderValue | readonly HeaderValue[]>
8
8
  | undefined
9
9
  | null
@@ -40,7 +40,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
40
40
  }
41
41
 
42
42
  let shouldClear = false;
43
- let iter: Iterable<readonly [string, HeaderValue | readonly HeaderValue[]]>;
43
+ let iter: Iterable<readonly (HeaderValue | readonly HeaderValue[])[]>;
44
44
  if (headers instanceof Headers) {
45
45
  iter = headers.entries();
46
46
  } else if (isArray(headers)) {
@@ -51,6 +51,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
51
51
  }
52
52
  for (let row of iter) {
53
53
  const name = row[0];
54
+ if (typeof name !== 'string') throw new TypeError('expected header name to be a string');
54
55
  const values = isArray(row[1]) ? row[1] : [row[1]];
55
56
  let didClear = false;
56
57
  for (const value of values) {
@@ -70,8 +71,8 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
70
71
  export const buildHeaders = (newHeaders: HeadersLike[]): NullableHeaders => {
71
72
  const targetHeaders = new Headers();
72
73
  const nullHeaders = new Set<string>();
73
- const seenHeaders = new Set<string>();
74
74
  for (const headers of newHeaders) {
75
+ const seenHeaders = new Set<string>();
75
76
  for (const [name, value] of iterateHeaders(headers)) {
76
77
  const lowerName = name.toLowerCase();
77
78
  if (!seenHeaders.has(lowerName)) {
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import type { FinalRequestOptions } from './request-options';
4
- import { type ComposioSDK } from '../client';
4
+ import { type Composio } from '../client';
5
5
  import { formatRequestDetails, loggerFor } from './utils/log';
6
6
 
7
7
  export type APIResponseProps = {
@@ -13,7 +13,7 @@ export type APIResponseProps = {
13
13
  startTime: number;
14
14
  };
15
15
 
16
- export async function defaultParseResponse<T>(client: ComposioSDK, props: APIResponseProps): Promise<T> {
16
+ export async function defaultParseResponse<T>(client: Composio, props: APIResponseProps): Promise<T> {
17
17
  const { response, requestLogID, retryOfRequestLogID, startTime } = props;
18
18
  const body = await (async () => {
19
19
  // fetch refuses to read the body when the status code is 204.
@@ -0,0 +1,13 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
+
11
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,3 @@
1
+ # qs
2
+
3
+ This is a vendored version of [neoqs](https://github.com/PuruVJ/neoqs) which is a TypeScript rewrite of [qs](https://github.com/ljharb/qs), a query string library.
@@ -0,0 +1,9 @@
1
+ import type { Format } from './types';
2
+
3
+ export const default_format: Format = 'RFC3986';
4
+ export const formatters: Record<Format, (str: PropertyKey) => string> = {
5
+ RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'),
6
+ RFC3986: (v: PropertyKey) => String(v),
7
+ };
8
+ export const RFC1738 = 'RFC1738';
9
+ export const RFC3986 = 'RFC3986';
@@ -0,0 +1,13 @@
1
+ import { default_format, formatters, RFC1738, RFC3986 } from './formats';
2
+
3
+ const formats = {
4
+ formatters,
5
+ RFC1738,
6
+ RFC3986,
7
+ default: default_format,
8
+ };
9
+
10
+ export { stringify } from './stringify';
11
+ export { formats };
12
+
13
+ export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types';