@composio/client 0.1.0-alpha.14 → 0.1.0-alpha.16

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 (254) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +12 -24
  3. package/client.d.mts +7 -7
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +7 -7
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -3
  10. package/client.mjs.map +1 -1
  11. package/internal/detect-platform.js +3 -3
  12. package/internal/detect-platform.js.map +1 -1
  13. package/internal/detect-platform.mjs +3 -3
  14. package/internal/detect-platform.mjs.map +1 -1
  15. package/internal/shim-types.d.mts +11 -22
  16. package/internal/shim-types.d.mts.map +1 -0
  17. package/internal/shim-types.d.ts +11 -22
  18. package/internal/shim-types.d.ts.map +1 -0
  19. package/internal/shim-types.js +4 -0
  20. package/internal/shim-types.js.map +1 -0
  21. package/internal/shim-types.mjs +3 -0
  22. package/internal/shim-types.mjs.map +1 -0
  23. package/internal/shims.d.mts +2 -2
  24. package/internal/shims.d.mts.map +1 -1
  25. package/internal/shims.d.ts +2 -2
  26. package/internal/shims.d.ts.map +1 -1
  27. package/package.json +1 -4
  28. package/resources/auth-configs.d.mts +3 -3
  29. package/resources/auth-configs.d.mts.map +1 -1
  30. package/resources/auth-configs.d.ts +3 -3
  31. package/resources/auth-configs.d.ts.map +1 -1
  32. package/resources/connected-accounts.d.mts +5262 -52
  33. package/resources/connected-accounts.d.mts.map +1 -1
  34. package/resources/connected-accounts.d.ts +5262 -52
  35. package/resources/connected-accounts.d.ts.map +1 -1
  36. package/resources/index.d.mts +3 -3
  37. package/resources/index.d.mts.map +1 -1
  38. package/resources/index.d.ts +3 -3
  39. package/resources/index.d.ts.map +1 -1
  40. package/resources/index.js +3 -3
  41. package/resources/index.js.map +1 -1
  42. package/resources/index.mjs +1 -1
  43. package/resources/index.mjs.map +1 -1
  44. package/resources/mcp/index.d.mts +1 -1
  45. package/resources/mcp/index.d.mts.map +1 -1
  46. package/resources/mcp/index.d.ts +1 -1
  47. package/resources/mcp/index.d.ts.map +1 -1
  48. package/resources/mcp/index.js.map +1 -1
  49. package/resources/mcp/index.mjs.map +1 -1
  50. package/resources/mcp/mcp.d.mts +99 -1
  51. package/resources/mcp/mcp.d.mts.map +1 -1
  52. package/resources/mcp/mcp.d.ts +99 -1
  53. package/resources/mcp/mcp.d.ts.map +1 -1
  54. package/resources/mcp/mcp.js +22 -0
  55. package/resources/mcp/mcp.js.map +1 -1
  56. package/resources/mcp/mcp.mjs +22 -0
  57. package/resources/mcp/mcp.mjs.map +1 -1
  58. package/resources/org/project/api-keys.d.mts +0 -15
  59. package/resources/org/project/api-keys.d.mts.map +1 -1
  60. package/resources/org/project/api-keys.d.ts +0 -15
  61. package/resources/org/project/api-keys.d.ts.map +1 -1
  62. package/resources/tools.d.mts +4 -5
  63. package/resources/tools.d.mts.map +1 -1
  64. package/resources/tools.d.ts +4 -5
  65. package/resources/tools.d.ts.map +1 -1
  66. package/resources/trigger-instances/index.d.mts +2 -1
  67. package/resources/trigger-instances/index.d.mts.map +1 -1
  68. package/resources/trigger-instances/index.d.ts +2 -1
  69. package/resources/trigger-instances/index.d.ts.map +1 -1
  70. package/resources/trigger-instances/index.js +3 -1
  71. package/resources/trigger-instances/index.js.map +1 -1
  72. package/resources/trigger-instances/index.mjs +1 -0
  73. package/resources/trigger-instances/index.mjs.map +1 -1
  74. package/resources/trigger-instances/manage.d.mts +26 -0
  75. package/resources/trigger-instances/manage.d.mts.map +1 -0
  76. package/resources/trigger-instances/manage.d.ts +26 -0
  77. package/resources/trigger-instances/manage.d.ts.map +1 -0
  78. package/resources/trigger-instances/manage.js +16 -0
  79. package/resources/trigger-instances/manage.js.map +1 -0
  80. package/resources/trigger-instances/manage.mjs +12 -0
  81. package/resources/trigger-instances/manage.mjs.map +1 -0
  82. package/resources/trigger-instances/trigger-instances.d.mts +15 -68
  83. package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
  84. package/resources/trigger-instances/trigger-instances.d.ts +15 -68
  85. package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
  86. package/resources/trigger-instances/trigger-instances.js +4 -7
  87. package/resources/trigger-instances/trigger-instances.js.map +1 -1
  88. package/resources/trigger-instances/trigger-instances.mjs +4 -7
  89. package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
  90. package/resources/v3/admin.d.mts +100 -0
  91. package/resources/v3/admin.d.mts.map +1 -0
  92. package/resources/v3/admin.d.ts +100 -0
  93. package/resources/v3/admin.d.ts.map +1 -0
  94. package/resources/v3/admin.js +54 -0
  95. package/resources/v3/admin.js.map +1 -0
  96. package/resources/v3/admin.mjs +50 -0
  97. package/resources/v3/admin.mjs.map +1 -0
  98. package/resources/v3/auth/auth.d.mts +10 -0
  99. package/resources/v3/auth/auth.d.mts.map +1 -0
  100. package/resources/v3/auth/auth.d.ts +10 -0
  101. package/resources/v3/auth/auth.d.ts.map +1 -0
  102. package/resources/{auth → v3/auth}/auth.js +2 -2
  103. package/resources/v3/auth/auth.js.map +1 -0
  104. package/resources/{auth → v3/auth}/auth.mjs +1 -1
  105. package/resources/v3/auth/auth.mjs.map +1 -0
  106. package/resources/v3/auth/index.d.mts +3 -0
  107. package/resources/v3/auth/index.d.mts.map +1 -0
  108. package/resources/v3/auth/index.d.ts +3 -0
  109. package/resources/v3/auth/index.d.ts.map +1 -0
  110. package/resources/v3/auth/index.js.map +1 -0
  111. package/resources/v3/auth/index.mjs.map +1 -0
  112. package/resources/{auth → v3/auth}/session.d.mts +16 -10
  113. package/resources/v3/auth/session.d.mts.map +1 -0
  114. package/resources/{auth → v3/auth}/session.d.ts +16 -10
  115. package/resources/v3/auth/session.d.ts.map +1 -0
  116. package/resources/{auth → v3/auth}/session.js +8 -2
  117. package/resources/v3/auth/session.js.map +1 -0
  118. package/resources/{auth → v3/auth}/session.mjs +8 -2
  119. package/resources/v3/auth/session.mjs.map +1 -0
  120. package/resources/{auth.d.mts.map → v3/auth.d.mts.map} +1 -1
  121. package/resources/v3/auth.d.ts.map +1 -0
  122. package/resources/{auth.js → v3/auth.js} +1 -1
  123. package/resources/v3/auth.js.map +1 -0
  124. package/resources/v3/auth.mjs.map +1 -0
  125. package/resources/v3/cli.d.mts +167 -0
  126. package/resources/v3/cli.d.mts.map +1 -0
  127. package/resources/v3/cli.d.ts +167 -0
  128. package/resources/v3/cli.d.ts.map +1 -0
  129. package/resources/v3/cli.js +55 -0
  130. package/resources/v3/cli.js.map +1 -0
  131. package/resources/v3/cli.mjs +51 -0
  132. package/resources/v3/cli.mjs.map +1 -0
  133. package/resources/v3/index.d.mts +6 -0
  134. package/resources/v3/index.d.mts.map +1 -0
  135. package/resources/v3/index.d.ts +6 -0
  136. package/resources/v3/index.d.ts.map +1 -0
  137. package/resources/v3/index.js +15 -0
  138. package/resources/v3/index.js.map +1 -0
  139. package/resources/v3/index.mjs +7 -0
  140. package/resources/v3/index.mjs.map +1 -0
  141. package/resources/v3/internal/action-execution.d.mts +153 -0
  142. package/resources/v3/internal/action-execution.d.mts.map +1 -0
  143. package/resources/v3/internal/action-execution.d.ts +153 -0
  144. package/resources/v3/internal/action-execution.d.ts.map +1 -0
  145. package/resources/v3/internal/action-execution.js +38 -0
  146. package/resources/v3/internal/action-execution.js.map +1 -0
  147. package/resources/v3/internal/action-execution.mjs +34 -0
  148. package/resources/v3/internal/action-execution.mjs.map +1 -0
  149. package/resources/v3/internal/index.d.mts +4 -0
  150. package/resources/v3/internal/index.d.mts.map +1 -0
  151. package/resources/v3/internal/index.d.ts +4 -0
  152. package/resources/v3/internal/index.d.ts.map +1 -0
  153. package/resources/v3/internal/index.js +11 -0
  154. package/resources/v3/internal/index.js.map +1 -0
  155. package/resources/v3/internal/index.mjs +5 -0
  156. package/resources/v3/internal/index.mjs.map +1 -0
  157. package/resources/v3/internal/internal.d.mts +14 -0
  158. package/resources/v3/internal/internal.d.mts.map +1 -0
  159. package/resources/v3/internal/internal.d.ts +14 -0
  160. package/resources/v3/internal/internal.d.ts.map +1 -0
  161. package/resources/v3/internal/internal.js +21 -0
  162. package/resources/v3/internal/internal.js.map +1 -0
  163. package/resources/v3/internal/internal.mjs +16 -0
  164. package/resources/v3/internal/internal.mjs.map +1 -0
  165. package/resources/v3/internal/trigger.d.mts +84 -0
  166. package/resources/v3/internal/trigger.d.mts.map +1 -0
  167. package/resources/v3/internal/trigger.d.ts +84 -0
  168. package/resources/v3/internal/trigger.d.ts.map +1 -0
  169. package/resources/v3/internal/trigger.js +23 -0
  170. package/resources/v3/internal/trigger.js.map +1 -0
  171. package/resources/v3/internal/trigger.mjs +19 -0
  172. package/resources/v3/internal/trigger.mjs.map +1 -0
  173. package/resources/v3/internal.d.mts +2 -0
  174. package/resources/v3/internal.d.mts.map +1 -0
  175. package/resources/v3/internal.d.ts +2 -0
  176. package/resources/v3/internal.d.ts.map +1 -0
  177. package/resources/v3/internal.js +6 -0
  178. package/resources/v3/internal.js.map +1 -0
  179. package/resources/v3/internal.mjs +3 -0
  180. package/resources/v3/internal.mjs.map +1 -0
  181. package/resources/v3/v3.d.mts +22 -0
  182. package/resources/v3/v3.d.mts.map +1 -0
  183. package/resources/v3/v3.d.ts +22 -0
  184. package/resources/v3/v3.d.ts.map +1 -0
  185. package/resources/v3/v3.js +29 -0
  186. package/resources/v3/v3.js.map +1 -0
  187. package/resources/v3/v3.mjs +24 -0
  188. package/resources/v3/v3.mjs.map +1 -0
  189. package/resources/v3.d.mts +2 -0
  190. package/resources/v3.d.mts.map +1 -0
  191. package/resources/v3.d.ts +2 -0
  192. package/resources/v3.d.ts.map +1 -0
  193. package/resources/v3.js +6 -0
  194. package/resources/v3.js.map +1 -0
  195. package/resources/v3.mjs +3 -0
  196. package/resources/v3.mjs.map +1 -0
  197. package/src/client.ts +9 -11
  198. package/src/internal/detect-platform.ts +3 -3
  199. package/src/internal/shim-types.ts +26 -0
  200. package/src/internal/shims.ts +2 -2
  201. package/src/resources/auth-configs.ts +0 -3
  202. package/src/resources/connected-accounts.ts +10261 -298
  203. package/src/resources/index.ts +3 -4
  204. package/src/resources/mcp/index.ts +2 -0
  205. package/src/resources/mcp/mcp.ts +128 -0
  206. package/src/resources/org/project/api-keys.ts +0 -18
  207. package/src/resources/tools.ts +5 -6
  208. package/src/resources/trigger-instances/index.ts +6 -3
  209. package/src/resources/trigger-instances/manage.ts +46 -0
  210. package/src/resources/trigger-instances/trigger-instances.ts +21 -87
  211. package/src/resources/v3/admin.ts +141 -0
  212. package/src/resources/{auth → v3/auth}/auth.ts +3 -3
  213. package/src/resources/{auth → v3/auth}/index.ts +1 -1
  214. package/src/resources/{auth → v3/auth}/session.ts +16 -10
  215. package/src/resources/v3/cli.ts +209 -0
  216. package/src/resources/v3/index.ts +20 -0
  217. package/src/resources/v3/internal/action-execution.ts +236 -0
  218. package/src/resources/v3/internal/index.ts +10 -0
  219. package/src/resources/v3/internal/internal.ts +35 -0
  220. package/src/resources/v3/internal/trigger.ts +122 -0
  221. package/src/resources/v3/internal.ts +3 -0
  222. package/src/resources/v3/v3.ts +59 -0
  223. package/src/resources/v3.ts +3 -0
  224. package/src/version.ts +1 -1
  225. package/version.d.mts +1 -1
  226. package/version.d.ts +1 -1
  227. package/version.js +1 -1
  228. package/version.mjs +1 -1
  229. package/resources/auth/auth.d.mts +0 -10
  230. package/resources/auth/auth.d.mts.map +0 -1
  231. package/resources/auth/auth.d.ts +0 -10
  232. package/resources/auth/auth.d.ts.map +0 -1
  233. package/resources/auth/auth.js.map +0 -1
  234. package/resources/auth/auth.mjs.map +0 -1
  235. package/resources/auth/index.d.mts +0 -3
  236. package/resources/auth/index.d.mts.map +0 -1
  237. package/resources/auth/index.d.ts +0 -3
  238. package/resources/auth/index.d.ts.map +0 -1
  239. package/resources/auth/index.js.map +0 -1
  240. package/resources/auth/index.mjs.map +0 -1
  241. package/resources/auth/session.d.mts.map +0 -1
  242. package/resources/auth/session.d.ts.map +0 -1
  243. package/resources/auth/session.js.map +0 -1
  244. package/resources/auth/session.mjs.map +0 -1
  245. package/resources/auth.d.ts.map +0 -1
  246. package/resources/auth.js.map +0 -1
  247. package/resources/auth.mjs.map +0 -1
  248. package/src/internal/shim-types.d.ts +0 -28
  249. /package/resources/{auth → v3/auth}/index.js +0 -0
  250. /package/resources/{auth → v3/auth}/index.mjs +0 -0
  251. /package/resources/{auth.d.mts → v3/auth.d.mts} +0 -0
  252. /package/resources/{auth.d.ts → v3/auth.d.ts} +0 -0
  253. /package/resources/{auth.mjs → v3/auth.mjs} +0 -0
  254. /package/src/resources/{auth.ts → v3/auth.ts} +0 -0
@@ -1,6 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { Auth } from './auth/auth';
4
3
  export {
5
4
  AuthConfigs,
6
5
  type AuthConfigCreateResponse,
@@ -41,10 +40,12 @@ export {
41
40
  type McpListResponse,
42
41
  type McpDeleteResponse,
43
42
  type McpRetrieveAppResponse,
43
+ type McpValidateResponse,
44
44
  type McpCreateParams,
45
45
  type McpUpdateParams,
46
46
  type McpListParams,
47
47
  type McpRetrieveAppParams,
48
+ type McpValidateParams,
48
49
  } from './mcp/mcp';
49
50
  export {
50
51
  Migration,
@@ -84,12 +85,9 @@ export {
84
85
  } from './tools';
85
86
  export {
86
87
  TriggerInstances,
87
- type TriggerInstanceDeleteResponse,
88
88
  type TriggerInstanceListActiveResponse,
89
- type TriggerInstanceUpdateStatusResponse,
90
89
  type TriggerInstanceUpsertResponse,
91
90
  type TriggerInstanceListActiveParams,
92
- type TriggerInstanceUpdateStatusParams,
93
91
  type TriggerInstanceUpsertParams,
94
92
  } from './trigger-instances/trigger-instances';
95
93
  export {
@@ -99,3 +97,4 @@ export {
99
97
  type TriggersTypeRetrieveEnumResponse,
100
98
  type TriggersTypeListParams,
101
99
  } from './triggers-types';
100
+ export { V3 } from './v3/v3';
@@ -9,8 +9,10 @@ export {
9
9
  type McpListResponse,
10
10
  type McpDeleteResponse,
11
11
  type McpRetrieveAppResponse,
12
+ type McpValidateResponse,
12
13
  type McpCreateParams,
13
14
  type McpUpdateParams,
14
15
  type McpListParams,
15
16
  type McpRetrieveAppParams,
17
+ type McpValidateParams,
16
18
  } from './mcp';
@@ -4,6 +4,7 @@ import { APIResource } from '../../core/resource';
4
4
  import * as CustomAPI from './custom';
5
5
  import { Custom, CustomCreateParams, CustomCreateResponse } from './custom';
6
6
  import { APIPromise } from '../../core/api-promise';
7
+ import { buildHeaders } from '../../internal/headers';
7
8
  import { RequestOptions } from '../../internal/request-options';
8
9
  import { path } from '../../internal/utils/path';
9
10
 
@@ -117,6 +118,32 @@ export class Mcp extends APIResource {
117
118
  ): APIPromise<McpRetrieveAppResponse> {
118
119
  return this._client.get(path`/api/v3/mcp/app/${appKey}`, { query, ...options });
119
120
  }
121
+
122
+ /**
123
+ * Admin-only endpoint that validates a Model Control Protocol (MCP) server and
124
+ * retrieves its complete configuration details, including authentication
125
+ * information. This endpoint is typically used by the MCP service itself to
126
+ * authenticate and authorize connection requests from clients.
127
+ *
128
+ * @example
129
+ * ```ts
130
+ * const response = await client.mcp.validate(
131
+ * '550e8400-e29b-41d4-a716-446655440000',
132
+ * { 'x-composio-admin-token': 'admin_tk_12345abcdef' },
133
+ * );
134
+ * ```
135
+ */
136
+ validate(
137
+ uuid: string,
138
+ params: McpValidateParams,
139
+ options?: RequestOptions,
140
+ ): APIPromise<McpValidateResponse> {
141
+ const { 'x-composio-admin-token': xComposioAdminToken } = params;
142
+ return this._client.get(path`/api/v3/mcp/validate/${uuid}`, {
143
+ ...options,
144
+ headers: buildHeaders([{ 'x-composio-admin-token': xComposioAdminToken }, options?.headers]),
145
+ });
146
+ }
120
147
  }
121
148
 
122
149
  /**
@@ -528,6 +555,98 @@ export namespace McpRetrieveAppResponse {
528
555
  }
529
556
  }
530
557
 
558
+ /**
559
+ * Complete validation and connection details for an MCP server
560
+ */
561
+ export interface McpValidateResponse {
562
+ /**
563
+ * Unique identifier of the validated MCP server
564
+ */
565
+ id: string;
566
+
567
+ /**
568
+ * Client information for the MCP server
569
+ */
570
+ client: McpValidateResponse.Client;
571
+
572
+ /**
573
+ * Human-readable name of the MCP server
574
+ */
575
+ name: string;
576
+
577
+ /**
578
+ * URL endpoint for connecting to this MCP server
579
+ */
580
+ url: string;
581
+
582
+ /**
583
+ * User authentication data for the MCP server
584
+ */
585
+ userData: McpValidateResponse.UserData;
586
+
587
+ /**
588
+ * List of action identifiers enabled for this server
589
+ */
590
+ actions?: Array<string> | null;
591
+
592
+ /**
593
+ * List of application identifiers this server is configured for
594
+ */
595
+ apps?: Array<string>;
596
+
597
+ /**
598
+ * List of connected account identifiers this server can use for authentication
599
+ */
600
+ connectedAccountIds?: Array<string> | null;
601
+
602
+ /**
603
+ * Flag indicating if this server uses custom authentication headers
604
+ */
605
+ customAuthHeaders?: boolean;
606
+
607
+ /**
608
+ * List of entity identifiers this MCP server can interact with
609
+ */
610
+ entityIds?: Array<string> | null;
611
+ }
612
+
613
+ export namespace McpValidateResponse {
614
+ /**
615
+ * Client information for the MCP server
616
+ */
617
+ export interface Client {
618
+ /**
619
+ * Project identifier that owns this MCP server
620
+ */
621
+ id: string;
622
+
623
+ /**
624
+ * Organization identifier that owns the project
625
+ */
626
+ orgId: string;
627
+ }
628
+
629
+ /**
630
+ * User authentication data for the MCP server
631
+ */
632
+ export interface UserData {
633
+ /**
634
+ * User identifier for API access
635
+ */
636
+ id: string;
637
+
638
+ /**
639
+ * API key for authenticating requests to the Composio API
640
+ */
641
+ apiKey: string;
642
+
643
+ /**
644
+ * Email address associated with the API key user
645
+ */
646
+ email: string;
647
+ }
648
+ }
649
+
531
650
  export interface McpCreateParams {
532
651
  /**
533
652
  * Human-readable name to identify this MCP server instance (4-25 characters,
@@ -624,6 +743,13 @@ export interface McpRetrieveAppParams {
624
743
  toolkit?: string;
625
744
  }
626
745
 
746
+ export interface McpValidateParams {
747
+ /**
748
+ * Administrative access token required for validating MCP servers
749
+ */
750
+ 'x-composio-admin-token': string;
751
+ }
752
+
627
753
  Mcp.Custom = Custom;
628
754
 
629
755
  export declare namespace Mcp {
@@ -634,10 +760,12 @@ export declare namespace Mcp {
634
760
  type McpListResponse as McpListResponse,
635
761
  type McpDeleteResponse as McpDeleteResponse,
636
762
  type McpRetrieveAppResponse as McpRetrieveAppResponse,
763
+ type McpValidateResponse as McpValidateResponse,
637
764
  type McpCreateParams as McpCreateParams,
638
765
  type McpUpdateParams as McpUpdateParams,
639
766
  type McpListParams as McpListParams,
640
767
  type McpRetrieveAppParams as McpRetrieveAppParams,
768
+ type McpValidateParams as McpValidateParams,
641
769
  };
642
770
 
643
771
  export {
@@ -99,12 +99,6 @@ export interface APIKeyCreateResponse {
99
99
  */
100
100
  created_at: string;
101
101
 
102
- /**
103
- * @deprecated UTC timestamp indicating when the API key was created. DEPRECATED:
104
- * Use created_at instead.
105
- */
106
- createdAt: string;
107
-
108
102
  /**
109
103
  * The API key string value that should be included in API requests. This value is
110
104
  * only shown once at creation time.
@@ -193,24 +187,12 @@ export interface APIKeyCreateAPIKeyResponse {
193
187
  */
194
188
  created_at: string;
195
189
 
196
- /**
197
- * @deprecated UTC timestamp indicating when the API key was created. Use
198
- * created_at instead.
199
- */
200
- createdAt: string;
201
-
202
190
  /**
203
191
  * The API key string value that should be included in API requests. This value is
204
192
  * only shown once.
205
193
  */
206
194
  key: string;
207
195
 
208
- /**
209
- * @deprecated UTC timestamp indicating when the API key was created. Use
210
- * last_used_at instead.
211
- */
212
- lastUsedAt: string;
213
-
214
196
  /**
215
197
  * Name assigned to help identify the key's purpose. For auto-generated keys, this
216
198
  * will be a random name.
@@ -411,18 +411,17 @@ export interface ToolExecuteParams {
411
411
  */
412
412
  custom_auth_params?: ToolExecuteParams.CustomAuthParams;
413
413
 
414
- /**
415
- * Entity identifier for multi-entity connected accounts (e.g. multiple
416
- * repositories, organizations)
417
- */
418
- entity_id?: string;
419
-
420
414
  /**
421
415
  * Natural language description of the task to perform (mutually exclusive with
422
416
  * arguments)
423
417
  */
424
418
  text?: string;
425
419
 
420
+ /**
421
+ * User id for multi-user connected accounts (e.g. multiple users, organizations)
422
+ */
423
+ user_id?: string;
424
+
426
425
  /**
427
426
  * Tool version to execute (defaults to "latest" if not specified)
428
427
  */
@@ -7,13 +7,16 @@ export {
7
7
  type HandleRetrieveParams,
8
8
  type HandleExecuteParams,
9
9
  } from './handle';
10
+ export {
11
+ Manage,
12
+ type ManageUpdateResponse,
13
+ type ManageDeleteResponse,
14
+ type ManageUpdateParams,
15
+ } from './manage';
10
16
  export {
11
17
  TriggerInstances,
12
- type TriggerInstanceDeleteResponse,
13
18
  type TriggerInstanceListActiveResponse,
14
- type TriggerInstanceUpdateStatusResponse,
15
19
  type TriggerInstanceUpsertResponse,
16
20
  type TriggerInstanceListActiveParams,
17
- type TriggerInstanceUpdateStatusParams,
18
21
  type TriggerInstanceUpsertParams,
19
22
  } from './trigger-instances';
@@ -0,0 +1,46 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ export class Manage extends APIResource {
9
+ update(
10
+ triggerID: string,
11
+ body: ManageUpdateParams,
12
+ options?: RequestOptions,
13
+ ): APIPromise<ManageUpdateResponse> {
14
+ return this._client.patch(path`/api/v3/trigger_instances/manage/${triggerID}`, { body, ...options });
15
+ }
16
+
17
+ delete(triggerID: string, options?: RequestOptions): APIPromise<ManageDeleteResponse> {
18
+ return this._client.delete(path`/api/v3/trigger_instances/manage/${triggerID}`, options);
19
+ }
20
+ }
21
+
22
+ export interface ManageUpdateResponse {
23
+ /**
24
+ * Status of the operation
25
+ */
26
+ status: 'success';
27
+ }
28
+
29
+ export interface ManageDeleteResponse {
30
+ /**
31
+ * The ID of the deleted trigger instance
32
+ */
33
+ trigger_id: string;
34
+ }
35
+
36
+ export interface ManageUpdateParams {
37
+ status: 'enable' | 'disable';
38
+ }
39
+
40
+ export declare namespace Manage {
41
+ export {
42
+ type ManageUpdateResponse as ManageUpdateResponse,
43
+ type ManageDeleteResponse as ManageDeleteResponse,
44
+ type ManageUpdateParams as ManageUpdateParams,
45
+ };
46
+ }
@@ -9,16 +9,15 @@ import {
9
9
  HandleRetrieveParams,
10
10
  HandleRetrieveResponse,
11
11
  } from './handle';
12
+ import * as ManageAPI from './manage';
13
+ import { Manage, ManageDeleteResponse, ManageUpdateParams, ManageUpdateResponse } from './manage';
12
14
  import { APIPromise } from '../../core/api-promise';
13
15
  import { RequestOptions } from '../../internal/request-options';
14
16
  import { path } from '../../internal/utils/path';
15
17
 
16
18
  export class TriggerInstances extends APIResource {
17
19
  handle: HandleAPI.Handle = new HandleAPI.Handle(this._client);
18
-
19
- delete(triggerID: string, options?: RequestOptions): APIPromise<TriggerInstanceDeleteResponse> {
20
- return this._client.delete(path`/api/v3/trigger_instances/delete/${triggerID}`, options);
21
- }
20
+ manage: ManageAPI.Manage = new ManageAPI.Manage(this._client);
22
21
 
23
22
  listActive(
24
23
  query: TriggerInstanceListActiveParams | null | undefined = {},
@@ -27,15 +26,6 @@ export class TriggerInstances extends APIResource {
27
26
  return this._client.get('/api/v3/trigger_instances/active', { query, ...options });
28
27
  }
29
28
 
30
- updateStatus(
31
- status: 'enable' | 'disable',
32
- params: TriggerInstanceUpdateStatusParams,
33
- options?: RequestOptions,
34
- ): APIPromise<TriggerInstanceUpdateStatusResponse> {
35
- const { triggerId } = params;
36
- return this._client.patch(path`/api/v3/trigger_instances/id/${triggerId}/${status}`, options);
37
- }
38
-
39
29
  upsert(
40
30
  slug: string,
41
31
  body: TriggerInstanceUpsertParams | null | undefined = {},
@@ -45,13 +35,6 @@ export class TriggerInstances extends APIResource {
45
35
  }
46
36
  }
47
37
 
48
- export interface TriggerInstanceDeleteResponse {
49
- /**
50
- * The ID of the deleted trigger instance
51
- */
52
- triggerId: string;
53
- }
54
-
55
38
  export interface TriggerInstanceListActiveResponse {
56
39
  items: Array<TriggerInstanceListActiveResponse.Item>;
57
40
 
@@ -73,10 +56,9 @@ export namespace TriggerInstanceListActiveResponse {
73
56
  connected_account_id: string;
74
57
 
75
58
  /**
76
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
77
- * Please use connected_account_id instead.
59
+ * UUID of the connected account this trigger is associated with
78
60
  */
79
- connectedAccountId: string;
61
+ connected_account_uuid: string;
80
62
 
81
63
  /**
82
64
  * ISO 8601 timestamp when the trigger instance was disabled, if applicable
@@ -103,28 +85,15 @@ export namespace TriggerInstanceListActiveResponse {
103
85
  */
104
86
  trigger_name: string;
105
87
 
106
- /**
107
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
108
- * Please use trigger_config instead.
109
- */
110
- triggerConfig: Record<string, unknown>;
111
-
112
- /**
113
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
114
- * Please use trigger_name instead.
115
- */
116
- triggerName: string;
117
-
118
88
  /**
119
89
  * ISO 8601 timestamp when the trigger instance was updated
120
90
  */
121
91
  updated_at: string;
122
92
 
123
93
  /**
124
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
125
- * Please use updated_at instead.
94
+ * ID of the user this trigger is associated with
126
95
  */
127
- updatedAt: string;
96
+ user_id: string;
128
97
 
129
98
  /**
130
99
  * Deprecated fields for the trigger instance
@@ -155,20 +124,13 @@ export namespace TriggerInstanceListActiveResponse {
155
124
  }
156
125
  }
157
126
 
158
- export interface TriggerInstanceUpdateStatusResponse {
159
- /**
160
- * Status of the operation
161
- */
162
- status: 'success';
163
- }
164
-
165
127
  export interface TriggerInstanceUpsertResponse {
166
128
  deprecated: TriggerInstanceUpsertResponse.Deprecated;
167
129
 
168
130
  /**
169
131
  * ID of the updated trigger
170
132
  */
171
- triggerId: string;
133
+ trigger_id: string;
172
134
  }
173
135
 
174
136
  export namespace TriggerInstanceUpsertResponse {
@@ -186,22 +148,14 @@ export interface TriggerInstanceListActiveParams {
186
148
  */
187
149
  auth_config_ids?: Array<string> | null;
188
150
 
189
- /**
190
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
191
- * Please use auth_config_ids instead.
192
- */
193
- authConfigIds?: Array<string> | null;
151
+ authConfigIds?: string;
194
152
 
195
153
  /**
196
154
  * Array of connected account IDs to filter triggers by
197
155
  */
198
156
  connected_account_ids?: Array<string> | null;
199
157
 
200
- /**
201
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
202
- * Please use connected_account_ids instead.
203
- */
204
- connectedAccountIds?: Array<string> | null;
158
+ connectedAccountIds?: string;
205
159
 
206
160
  /**
207
161
  * Array of auth config UUIDs to filter triggers by
@@ -228,11 +182,7 @@ export interface TriggerInstanceListActiveParams {
228
182
  */
229
183
  show_disabled?: boolean | null;
230
184
 
231
- /**
232
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
233
- * Please use show_disabled instead.
234
- */
235
- showDisabled?: boolean | null;
185
+ showDisabled?: string;
236
186
 
237
187
  /**
238
188
  * Array of trigger IDs to filter triggers by
@@ -244,24 +194,9 @@ export interface TriggerInstanceListActiveParams {
244
194
  */
245
195
  trigger_names?: Array<string> | null;
246
196
 
247
- /**
248
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
249
- * Please use trigger_ids instead.
250
- */
251
- triggerIds?: Array<string> | null;
197
+ triggerIds?: string;
252
198
 
253
- /**
254
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
255
- * Please use trigger_names instead.
256
- */
257
- triggerNames?: Array<string> | null;
258
- }
259
-
260
- export interface TriggerInstanceUpdateStatusParams {
261
- /**
262
- * The ID of the trigger instance to update
263
- */
264
- triggerId: string;
199
+ triggerNames?: string;
265
200
  }
266
201
 
267
202
  export interface TriggerInstanceUpsertParams {
@@ -270,12 +205,6 @@ export interface TriggerInstanceUpsertParams {
270
205
  */
271
206
  connected_account_id?: string;
272
207
 
273
- /**
274
- * @deprecated DEPRECATED: This parameter will be removed in a future version.
275
- * Please use connected_account_id instead.
276
- */
277
- connectedAuthId?: string;
278
-
279
208
  /**
280
209
  * Trigger configuration
281
210
  */
@@ -288,15 +217,13 @@ export interface TriggerInstanceUpsertParams {
288
217
  }
289
218
 
290
219
  TriggerInstances.Handle = Handle;
220
+ TriggerInstances.Manage = Manage;
291
221
 
292
222
  export declare namespace TriggerInstances {
293
223
  export {
294
- type TriggerInstanceDeleteResponse as TriggerInstanceDeleteResponse,
295
224
  type TriggerInstanceListActiveResponse as TriggerInstanceListActiveResponse,
296
- type TriggerInstanceUpdateStatusResponse as TriggerInstanceUpdateStatusResponse,
297
225
  type TriggerInstanceUpsertResponse as TriggerInstanceUpsertResponse,
298
226
  type TriggerInstanceListActiveParams as TriggerInstanceListActiveParams,
299
- type TriggerInstanceUpdateStatusParams as TriggerInstanceUpdateStatusParams,
300
227
  type TriggerInstanceUpsertParams as TriggerInstanceUpsertParams,
301
228
  };
302
229
 
@@ -307,4 +234,11 @@ export declare namespace TriggerInstances {
307
234
  type HandleRetrieveParams as HandleRetrieveParams,
308
235
  type HandleExecuteParams as HandleExecuteParams,
309
236
  };
237
+
238
+ export {
239
+ Manage as Manage,
240
+ type ManageUpdateResponse as ManageUpdateResponse,
241
+ type ManageDeleteResponse as ManageDeleteResponse,
242
+ type ManageUpdateParams as ManageUpdateParams,
243
+ };
310
244
  }
@@ -0,0 +1,141 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+
8
+ export class Admin extends APIResource {
9
+ /**
10
+ * Administrative endpoint that retrieves all active connections for a given
11
+ * toolkit slug. This is primarily used for token refresh operations and system
12
+ * maintenance. Only includes non-deleted connections with OAuth2 or JWT
13
+ * authentication types.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const response = await client.v3.admin.listConnections({
18
+ * toolkit_slug: 'google-drive',
19
+ * 'x-composio-admin-token': 'adm_123456789abcdef',
20
+ * });
21
+ * ```
22
+ */
23
+ listConnections(
24
+ params: AdminListConnectionsParams,
25
+ options?: RequestOptions,
26
+ ): APIPromise<AdminListConnectionsResponse> {
27
+ const { 'x-composio-admin-token': xComposioAdminToken, ...query } = params;
28
+ return this._client.get('/api/v3/admin/connections', {
29
+ query,
30
+ ...options,
31
+ headers: buildHeaders([{ 'x-composio-admin-token': xComposioAdminToken }, options?.headers]),
32
+ });
33
+ }
34
+
35
+ /**
36
+ * Administrative endpoint that refreshes authentication tokens for multiple
37
+ * connected accounts in parallel. This is useful for proactive token refresh to
38
+ * prevent authentication failures or for recovering from authentication issues
39
+ * across multiple connections.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const response = await client.v3.admin.refreshAuthTokens({
44
+ * connectionIds: ['conn_123abc', 'conn_456def'],
45
+ * 'x-composio-admin-token': 'adm_123456789abcdef',
46
+ * });
47
+ * ```
48
+ */
49
+ refreshAuthTokens(
50
+ params: AdminRefreshAuthTokensParams,
51
+ options?: RequestOptions,
52
+ ): APIPromise<AdminRefreshAuthTokensResponse> {
53
+ const { 'x-composio-admin-token': xComposioAdminToken, ...body } = params;
54
+ return this._client.post('/api/v3/admin/auth-refresh', {
55
+ body,
56
+ ...options,
57
+ headers: buildHeaders([{ 'x-composio-admin-token': xComposioAdminToken }, options?.headers]),
58
+ });
59
+ }
60
+ }
61
+
62
+ export interface AdminListConnectionsResponse {
63
+ /**
64
+ * Collection of account connection objects, may be empty if no connections exist
65
+ */
66
+ items: Array<AdminListConnectionsResponse.Item>;
67
+ }
68
+
69
+ export namespace AdminListConnectionsResponse {
70
+ export interface Item {
71
+ /**
72
+ * Identifier that can be used with other API endpoints that operate on connections
73
+ */
74
+ id: string;
75
+ }
76
+ }
77
+
78
+ export interface AdminRefreshAuthTokensResponse {
79
+ /**
80
+ * Array of connections that failed to refresh with detailed error information
81
+ */
82
+ failures: Array<AdminRefreshAuthTokensResponse.Failure>;
83
+
84
+ /**
85
+ * List of connections where token refresh was successful or not needed
86
+ */
87
+ success: Array<string>;
88
+ }
89
+
90
+ export namespace AdminRefreshAuthTokensResponse {
91
+ export interface Failure {
92
+ /**
93
+ * Connection ID that failed during refresh
94
+ */
95
+ connectionId: string;
96
+
97
+ /**
98
+ * Specific error code identifying why the refresh operation failed
99
+ */
100
+ error: string;
101
+ }
102
+ }
103
+
104
+ export interface AdminListConnectionsParams {
105
+ /**
106
+ * Query param: The unique identifier slug of the toolkit to filter connections by
107
+ */
108
+ toolkit_slug: string;
109
+
110
+ /**
111
+ * Header param: Admin authentication token required for administrative operations
112
+ */
113
+ 'x-composio-admin-token': string;
114
+ }
115
+
116
+ export interface AdminRefreshAuthTokensParams {
117
+ /**
118
+ * Body param: List of connection identifiers that need token refresh
119
+ */
120
+ connectionIds: Array<string>;
121
+
122
+ /**
123
+ * Header param: Admin authentication token required for administrative operations
124
+ */
125
+ 'x-composio-admin-token': string;
126
+
127
+ /**
128
+ * Body param: Controls processing speed and system load. Higher values process
129
+ * faster but increase load.
130
+ */
131
+ parallelism?: number;
132
+ }
133
+
134
+ export declare namespace Admin {
135
+ export {
136
+ type AdminListConnectionsResponse as AdminListConnectionsResponse,
137
+ type AdminRefreshAuthTokensResponse as AdminRefreshAuthTokensResponse,
138
+ type AdminListConnectionsParams as AdminListConnectionsParams,
139
+ type AdminRefreshAuthTokensParams as AdminRefreshAuthTokensParams,
140
+ };
141
+ }