@composio/client 2.0.0-rc.6 → 2.0.0-rc.7

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 (166) hide show
  1. package/README.md +51 -3
  2. package/dist/{api-key-revocation-CSNyQo6m.mjs → api-key-revocation-BPURmRJx.mjs} +1 -1
  3. package/dist/{auth-configs-DAS68quO.mjs → auth-configs-DYkxc_It.mjs} +1 -1
  4. package/dist/{auth-BpeKOtkr.mjs → auth-iqhTmHa9.mjs} +1 -1
  5. package/dist/{clanker-CdTX3VrN.mjs → clanker-CzfQDpuy.mjs} +1 -1
  6. package/dist/{cli-BwAcGYUv.mjs → cli-Er9a9rGs.mjs} +2 -2
  7. package/dist/{client-Cu0FrKmX.d.mts → client-CcYk8XXt.d.mts} +3849 -684
  8. package/dist/{connected-accounts-Bri1c8_y.mjs → connected-accounts-DDgErVLd.mjs} +8 -1
  9. package/dist/{consumer-C-Sr8ilJ.mjs → consumer-BPCfagDO.mjs} +2 -2
  10. package/dist/custom-Cs019zcM.mjs +31 -0
  11. package/dist/{custom-CZ41HKuF.mjs → custom-VZyKhTTG.mjs} +2 -1
  12. package/dist/error-DPPtjCl1.mjs +75 -0
  13. package/dist/{files-nKAca7MP.mjs → files-C1QA5PTw.mjs} +1 -1
  14. package/dist/{files-Bw-q9jvQ.mjs → files-hhfQpMSx.mjs} +1 -1
  15. package/dist/{generate-22I_8m4Q.mjs → generate-iwm8bHWW.mjs} +2 -1
  16. package/dist/{generated-operations-BQO2JR1q.mjs → generated-operations-CJ7bbwvC.mjs} +40 -74
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.mjs +41 -26
  19. package/dist/keyring-Dkcbmstv.mjs +17 -0
  20. package/dist/{link-D68LLK4Z.mjs → link-Dk-yWRgc.mjs} +1 -1
  21. package/dist/{logs-D51p26Kb.mjs → logs-DnZUgpLM.mjs} +3 -3
  22. package/dist/{manage-D8yy7vO-.mjs → manage-DfB0PrkM.mjs} +1 -1
  23. package/dist/{mcp-YTLiywS3.mjs → mcp-BfStaFrR.mjs} +12 -3
  24. package/dist/{org-Cutt-dnU.mjs → org-bXBx5whI.mjs} +6 -6
  25. package/dist/{owner-ZVJeAZpU.mjs → owner-BlJ0zURX.mjs} +1 -1
  26. package/dist/pagination.d.mts +56 -0
  27. package/dist/pagination.mjs +50 -0
  28. package/dist/{project-DKhGV5KP.mjs → project-B0ax2ZoD.mjs} +1 -1
  29. package/dist/{project-D0caI7O8.mjs → project-BeWloPLZ.mjs} +1 -1
  30. package/dist/{project-BObd0xOa.mjs → project-BnMfaNjl.mjs} +1 -1
  31. package/dist/{project-C8ZpAfnV.mjs → project-CGi2urmA.mjs} +1 -1
  32. package/dist/{realtime-CtLFFEf8.mjs → realtime-BNfA3u3B.mjs} +1 -1
  33. package/dist/resources/api-key-revocation.d.mts +1 -1
  34. package/dist/resources/api-key-revocation.mjs +1 -1
  35. package/dist/resources/auth/auth.d.mts +1 -1
  36. package/dist/resources/auth/auth.mjs +1 -1
  37. package/dist/resources/auth/index.d.mts +1 -1
  38. package/dist/resources/auth/index.mjs +2 -2
  39. package/dist/resources/auth/session.d.mts +1 -1
  40. package/dist/resources/auth/session.mjs +1 -1
  41. package/dist/resources/auth-configs.d.mts +1 -1
  42. package/dist/resources/auth-configs.mjs +1 -1
  43. package/dist/resources/auth.d.mts +1 -1
  44. package/dist/resources/auth.mjs +2 -2
  45. package/dist/resources/cli/cli.d.mts +1 -1
  46. package/dist/resources/cli/cli.mjs +1 -1
  47. package/dist/resources/cli/index.d.mts +1 -1
  48. package/dist/resources/cli/index.mjs +2 -2
  49. package/dist/resources/cli/realtime.d.mts +1 -1
  50. package/dist/resources/cli/realtime.mjs +1 -1
  51. package/dist/resources/cli.d.mts +1 -1
  52. package/dist/resources/cli.mjs +2 -2
  53. package/dist/resources/connected-accounts.d.mts +1 -1
  54. package/dist/resources/connected-accounts.mjs +1 -1
  55. package/dist/resources/custom.d.mts +2 -0
  56. package/dist/resources/custom.mjs +3 -0
  57. package/dist/resources/files.d.mts +1 -1
  58. package/dist/resources/files.mjs +1 -1
  59. package/dist/resources/index.d.mts +1 -1
  60. package/dist/resources/index.mjs +13 -13
  61. package/dist/resources/keyring.d.mts +2 -0
  62. package/dist/resources/keyring.mjs +3 -0
  63. package/dist/resources/link.d.mts +1 -1
  64. package/dist/resources/link.mjs +1 -1
  65. package/dist/resources/logs/index.d.mts +1 -1
  66. package/dist/resources/logs/index.mjs +3 -3
  67. package/dist/resources/logs/logs.d.mts +1 -1
  68. package/dist/resources/logs/logs.mjs +1 -1
  69. package/dist/resources/logs/tools.d.mts +1 -1
  70. package/dist/resources/logs/tools.mjs +1 -1
  71. package/dist/resources/logs/triggers.d.mts +1 -1
  72. package/dist/resources/logs/triggers.mjs +1 -1
  73. package/dist/resources/logs.d.mts +1 -1
  74. package/dist/resources/logs.mjs +3 -3
  75. package/dist/resources/mcp/custom.d.mts +1 -1
  76. package/dist/resources/mcp/custom.mjs +1 -1
  77. package/dist/resources/mcp/generate.d.mts +1 -1
  78. package/dist/resources/mcp/generate.mjs +1 -1
  79. package/dist/resources/mcp/index.d.mts +1 -1
  80. package/dist/resources/mcp/index.mjs +3 -3
  81. package/dist/resources/mcp/mcp.d.mts +1 -1
  82. package/dist/resources/mcp/mcp.mjs +1 -1
  83. package/dist/resources/mcp.d.mts +1 -1
  84. package/dist/resources/mcp.mjs +3 -3
  85. package/dist/resources/org/clanker.d.mts +1 -1
  86. package/dist/resources/org/clanker.mjs +1 -1
  87. package/dist/resources/org/consumer/consumer.d.mts +1 -1
  88. package/dist/resources/org/consumer/consumer.mjs +1 -1
  89. package/dist/resources/org/consumer/index.d.mts +1 -1
  90. package/dist/resources/org/consumer/index.mjs +2 -2
  91. package/dist/resources/org/consumer/project.d.mts +1 -1
  92. package/dist/resources/org/consumer/project.mjs +1 -1
  93. package/dist/resources/org/consumer.d.mts +1 -1
  94. package/dist/resources/org/consumer.mjs +2 -2
  95. package/dist/resources/org/index.d.mts +1 -1
  96. package/dist/resources/org/index.mjs +6 -6
  97. package/dist/resources/org/org.d.mts +1 -1
  98. package/dist/resources/org/org.mjs +1 -1
  99. package/dist/resources/org/owner/index.d.mts +1 -1
  100. package/dist/resources/org/owner/index.mjs +2 -2
  101. package/dist/resources/org/owner/owner.d.mts +1 -1
  102. package/dist/resources/org/owner/owner.mjs +1 -1
  103. package/dist/resources/org/owner/project.d.mts +1 -1
  104. package/dist/resources/org/owner/project.mjs +1 -1
  105. package/dist/resources/org/owner.d.mts +1 -1
  106. package/dist/resources/org/owner.mjs +2 -2
  107. package/dist/resources/org/project.d.mts +1 -1
  108. package/dist/resources/org/project.mjs +1 -1
  109. package/dist/resources/org/usage.d.mts +1 -1
  110. package/dist/resources/org/usage.mjs +1 -1
  111. package/dist/resources/org.d.mts +1 -1
  112. package/dist/resources/org.mjs +6 -6
  113. package/dist/resources/project/index.d.mts +1 -1
  114. package/dist/resources/project/index.mjs +1 -1
  115. package/dist/resources/project/project.d.mts +1 -1
  116. package/dist/resources/project/project.mjs +1 -1
  117. package/dist/resources/project/usage.d.mts +1 -1
  118. package/dist/resources/project/usage.mjs +1 -1
  119. package/dist/resources/project.d.mts +1 -1
  120. package/dist/resources/project.mjs +1 -1
  121. package/dist/resources/tool-router/index.d.mts +1 -1
  122. package/dist/resources/tool-router/index.mjs +2 -2
  123. package/dist/resources/tool-router/session/files.d.mts +1 -1
  124. package/dist/resources/tool-router/session/files.mjs +1 -1
  125. package/dist/resources/tool-router/session/index.d.mts +1 -1
  126. package/dist/resources/tool-router/session/index.mjs +2 -2
  127. package/dist/resources/tool-router/session/session.d.mts +1 -1
  128. package/dist/resources/tool-router/session/session.mjs +1 -1
  129. package/dist/resources/tool-router/session.d.mts +1 -1
  130. package/dist/resources/tool-router/session.mjs +2 -2
  131. package/dist/resources/tool-router/tool-router.d.mts +1 -1
  132. package/dist/resources/tool-router/tool-router.mjs +1 -1
  133. package/dist/resources/tool-router.d.mts +1 -1
  134. package/dist/resources/tool-router.mjs +2 -2
  135. package/dist/resources/toolkits.d.mts +1 -1
  136. package/dist/resources/toolkits.mjs +1 -1
  137. package/dist/resources/tools.d.mts +1 -1
  138. package/dist/resources/tools.mjs +1 -1
  139. package/dist/resources/trigger-instances/index.d.mts +1 -1
  140. package/dist/resources/trigger-instances/index.mjs +2 -2
  141. package/dist/resources/trigger-instances/manage.d.mts +1 -1
  142. package/dist/resources/trigger-instances/manage.mjs +1 -1
  143. package/dist/resources/trigger-instances/trigger-instances.d.mts +1 -1
  144. package/dist/resources/trigger-instances/trigger-instances.mjs +1 -1
  145. package/dist/resources/trigger-instances.d.mts +1 -1
  146. package/dist/resources/trigger-instances.mjs +2 -2
  147. package/dist/resources/triggers-types.d.mts +1 -1
  148. package/dist/resources/triggers-types.mjs +1 -1
  149. package/dist/resources/webhook-endpoints.d.mts +1 -1
  150. package/dist/resources/webhook-endpoints.mjs +1 -1
  151. package/dist/resources/webhook-subscriptions.d.mts +1 -1
  152. package/dist/resources/webhook-subscriptions.mjs +1 -1
  153. package/dist/{session-Byj-qri0.mjs → session-B78Twedd.mjs} +1 -1
  154. package/dist/{session-BFEAeE9G.mjs → session-D3Azxyck.mjs} +2 -2
  155. package/dist/{tool-router-CyuTk9t-.mjs → tool-router-Bx1tQfx-.mjs} +1 -1
  156. package/dist/{toolkits-Bck41m7-.mjs → toolkits-DFC0JDvT.mjs} +15 -1
  157. package/dist/{tools-D8kKy_iy.mjs → tools-Bv2Txlel.mjs} +1 -1
  158. package/dist/{tools-Bvbrgij6.mjs → tools-EL1x4SBb.mjs} +2 -1
  159. package/dist/{trigger-instances-B3oj-IJW.mjs → trigger-instances-BI-STHc4.mjs} +2 -2
  160. package/dist/{triggers-types-CHJxtojA.mjs → triggers-types-CJWi--Kk.mjs} +1 -1
  161. package/dist/{triggers-CirhOG03.mjs → triggers-vTkWuT5B.mjs} +1 -1
  162. package/dist/{usage-CD53euIq.mjs → usage-DspCrBUv.mjs} +1 -1
  163. package/dist/{usage-C5VBnFfd.mjs → usage-cffJ-ds7.mjs} +1 -1
  164. package/dist/{webhook-endpoints-gTzzFJ1c.mjs → webhook-endpoints-DSN8i5KN.mjs} +1 -1
  165. package/dist/{webhook-subscriptions-bZFki65N.mjs → webhook-subscriptions-Bgsnr29T.mjs} +1 -1
  166. package/package.json +17 -5
package/README.md CHANGED
@@ -17,6 +17,54 @@ const session = await composio.toolRouter.session.create({ user_id: 'user_123' }
17
17
  console.log(session.session_id, session.mcp.url)
18
18
  ```
19
19
 
20
+ ### Pagination
21
+
22
+ Use the `@composio/client/pagination` subpath to traverse list operations that return the standard
23
+ `items` and `next_cursor` fields:
24
+
25
+ ```ts
26
+ import { paginate } from '@composio/client/pagination'
27
+
28
+ const toolkits = paginate(({ cursor }) =>
29
+ composio.toolkits.list({ cursor, limit: 100 }),
30
+ )
31
+
32
+ for await (const toolkit of toolkits) {
33
+ console.log(toolkit.slug)
34
+ }
35
+ ```
36
+
37
+ Item iteration is lazy. Each traversal starts from the first page, and breaking early stops fetching
38
+ more pages. Use `iterPages()` when page metadata matters, or `toArray()` to collect every item; avoid
39
+ `toArray()` when the full result may not fit comfortably in memory.
40
+
41
+ ```ts
42
+ for await (const page of toolkits.iterPages()) {
43
+ console.log(page.items.length)
44
+ }
45
+
46
+ const allToolkits = await toolkits.toArray()
47
+ ```
48
+
49
+ For another response shape, provide an adapter. Custom cursors must be strings or numbers so repeated
50
+ values can be detected reliably across independently decoded pages:
51
+
52
+ ```ts
53
+ const results = paginate(
54
+ ({ cursor }) => loadPage(cursor),
55
+ {
56
+ items: page => page.data,
57
+ nextCursor: page => page.nextCursor,
58
+ },
59
+ )
60
+ ```
61
+
62
+ A repeated cursor cycle throws `ComposioError` instead of requesting pages indefinitely. An empty
63
+ cursor ends traversal. When a response omits `next_cursor` but numeric `current_page` and
64
+ `total_pages` metadata shows that more pages exist, the default adapter fails instead of silently
65
+ returning partial results; provide a custom adapter for that response shape. Requests are sequential
66
+ and inherit the normal client retry/backoff path, but this is not proactive/shared rate-limit pacing.
67
+
20
68
  Use `fromEnv` when configuration must come from a specific environment snapshot instead of the
21
69
  host process. Explicit options replace mapped values, so this is safe for tests, workers, and
22
70
  applications that load configuration themselves:
@@ -27,7 +75,7 @@ const composio = Composio.fromEnv(config, { environment: 'staging' })
27
75
 
28
76
  `fromEnv` recognizes `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY`, `COMPOSIO_ORG_API_KEY`,
29
77
  `COMPOSIO_BASE_URL`, `COMPOSIO_ALLOW_INSECURE_HTTP`, `COMPOSIO_CUSTOM_HEADERS`, and
30
- `COMPOSIO_LOG`. Derived clients created with `withOptions()` keep using the resolved snapshot and do
78
+ `COMPOSIO_LOG_LEVEL`. Derived clients created with `withOptions()` keep using the resolved snapshot and do
31
79
  not fall back to ambient values.
32
80
 
33
81
  Inject a `Transport` when an application or test needs to own HTTP dispatch. The transport receives
@@ -76,8 +124,8 @@ Toolchain is pinned via [mise](https://mise.jdx.dev) (`mise install`): Node 24,
76
124
  ```sh
77
125
  pnpm install
78
126
  pnpm generate # hey-api + compat codegen: spec/openapi.json → src/generated + src/compat/resources (do not edit)
79
- pnpm lint # eslint over src, test, packages/codegen
80
- pnpm typecheck # tsgo (TS native) over src+test, incl. type tests
127
+ pnpm lint # eslint over src, test, codegen, parity, and demo
128
+ pnpm typecheck # tsgo (TS native), including type tests and demo
81
129
  pnpm typecheck:tsc # same programs under tsc — both compilers must pass
82
130
  pnpm codegen:check # verify committed src/compat/resources matches the generator
83
131
  pnpm test # unit tests (MSW mocks) + codegen tests
@@ -1,4 +1,4 @@
1
- import { c as withOperation, n as generatedOperation } from "./generated-operations-BQO2JR1q.mjs";
1
+ import { c as withOperation, n as generatedOperation } from "./generated-operations-CJ7bbwvC.mjs";
2
2
 
3
3
  //#region src/compat/resources/api-key-revocation.ts
4
4
  const OP_CREATE = generatedOperation("apiKeyRevocation.create");
@@ -1,4 +1,4 @@
1
- import { a as path, c as withOperation, n as generatedOperation } from "./generated-operations-BQO2JR1q.mjs";
1
+ import { a as path, c as withOperation, n as generatedOperation } from "./generated-operations-CJ7bbwvC.mjs";
2
2
 
3
3
  //#region src/compat/resources/auth-configs.ts
4
4
  const OP_CREATE = generatedOperation("authConfigs.create");
@@ -1,4 +1,4 @@
1
- import { t as Session } from "./session-Byj-qri0.mjs";
1
+ import { t as Session } from "./session-B78Twedd.mjs";
2
2
 
3
3
  //#region src/compat/resources/auth/auth.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { c as withOperation, n as generatedOperation } from "./generated-operations-BQO2JR1q.mjs";
1
+ import { c as withOperation, n as generatedOperation } from "./generated-operations-CJ7bbwvC.mjs";
2
2
 
3
3
  //#region src/compat/resources/org/clanker.ts
4
4
  const OP_CREATE_CLAIM = generatedOperation("org.clanker.createClaim");
@@ -1,5 +1,5 @@
1
- import { c as withOperation, n as generatedOperation, p as mergeHeaders } from "./generated-operations-BQO2JR1q.mjs";
2
- import { t as Realtime } from "./realtime-CtLFFEf8.mjs";
1
+ import { c as withOperation, n as generatedOperation, p as mergeHeaders } from "./generated-operations-CJ7bbwvC.mjs";
2
+ import { t as Realtime } from "./realtime-BNfA3u3B.mjs";
3
3
 
4
4
  //#region src/compat/resources/cli/cli.ts
5
5
  const OP_CREATE_CODACT_FAILURE = generatedOperation("cli.createCodactFailure");