@composio/client 0.1.0-alpha.24 → 0.1.0-alpha.26

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 (221) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/client.d.mts +4 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -3
  9. package/client.mjs.map +1 -1
  10. package/internal/request-options.d.mts +42 -0
  11. package/internal/request-options.d.mts.map +1 -1
  12. package/internal/request-options.d.ts +42 -0
  13. package/internal/request-options.d.ts.map +1 -1
  14. package/internal/request-options.js.map +1 -1
  15. package/internal/request-options.mjs.map +1 -1
  16. package/internal/types.d.mts +8 -6
  17. package/internal/types.d.mts.map +1 -1
  18. package/internal/types.d.ts +8 -6
  19. package/internal/types.d.ts.map +1 -1
  20. package/internal/uploads.js +1 -1
  21. package/internal/uploads.js.map +1 -1
  22. package/internal/uploads.mjs +1 -1
  23. package/internal/uploads.mjs.map +1 -1
  24. package/internal/utils/log.js +1 -1
  25. package/internal/utils/log.js.map +1 -1
  26. package/internal/utils/log.mjs +1 -1
  27. package/internal/utils/log.mjs.map +1 -1
  28. package/internal/utils/path.d.mts.map +1 -1
  29. package/internal/utils/path.d.ts.map +1 -1
  30. package/internal/utils/path.js +26 -5
  31. package/internal/utils/path.js.map +1 -1
  32. package/internal/utils/path.mjs +26 -5
  33. package/internal/utils/path.mjs.map +1 -1
  34. package/package.json +1 -1
  35. package/resources/auth-configs.d.mts +43 -11
  36. package/resources/auth-configs.d.mts.map +1 -1
  37. package/resources/auth-configs.d.ts +43 -11
  38. package/resources/auth-configs.d.ts.map +1 -1
  39. package/resources/connected-accounts.d.mts +2153 -633
  40. package/resources/connected-accounts.d.mts.map +1 -1
  41. package/resources/connected-accounts.d.ts +2153 -633
  42. package/resources/connected-accounts.d.ts.map +1 -1
  43. package/resources/connected-accounts.js +7 -2
  44. package/resources/connected-accounts.js.map +1 -1
  45. package/resources/connected-accounts.mjs +7 -2
  46. package/resources/connected-accounts.mjs.map +1 -1
  47. package/resources/files.d.mts +14 -1
  48. package/resources/files.d.mts.map +1 -1
  49. package/resources/files.d.ts +14 -1
  50. package/resources/files.d.ts.map +1 -1
  51. package/resources/index.d.mts +1 -2
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +1 -2
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +1 -3
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +0 -1
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/mcp/mcp.d.mts +5 -9
  60. package/resources/mcp/mcp.d.mts.map +1 -1
  61. package/resources/mcp/mcp.d.ts +5 -9
  62. package/resources/mcp/mcp.d.ts.map +1 -1
  63. package/resources/mcp/mcp.js +1 -1
  64. package/resources/mcp/mcp.js.map +1 -1
  65. package/resources/mcp/mcp.mjs +1 -1
  66. package/resources/mcp/mcp.mjs.map +1 -1
  67. package/resources/toolkits.d.mts +17 -2
  68. package/resources/toolkits.d.mts.map +1 -1
  69. package/resources/toolkits.d.ts +17 -2
  70. package/resources/toolkits.d.ts.map +1 -1
  71. package/resources/tools.d.mts +36 -13
  72. package/resources/tools.d.mts.map +1 -1
  73. package/resources/tools.d.ts +36 -13
  74. package/resources/tools.d.ts.map +1 -1
  75. package/resources/trigger-instances/trigger-instances.d.mts +24 -7
  76. package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
  77. package/resources/trigger-instances/trigger-instances.d.ts +24 -7
  78. package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
  79. package/resources/trigger-instances/trigger-instances.js.map +1 -1
  80. package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
  81. package/resources/triggers-types.d.mts +40 -19
  82. package/resources/triggers-types.d.mts.map +1 -1
  83. package/resources/triggers-types.d.ts +40 -19
  84. package/resources/triggers-types.d.ts.map +1 -1
  85. package/src/client.ts +5 -5
  86. package/src/internal/request-options.ts +53 -0
  87. package/src/internal/types.ts +9 -6
  88. package/src/internal/uploads.ts +1 -1
  89. package/src/internal/utils/log.ts +1 -1
  90. package/src/internal/utils/path.ts +32 -7
  91. package/src/resources/auth-configs.ts +34 -11
  92. package/src/resources/connected-accounts.ts +4045 -1211
  93. package/src/resources/files.ts +18 -1
  94. package/src/resources/index.ts +1 -1
  95. package/src/resources/mcp/mcp.ts +6 -11
  96. package/src/resources/toolkits.ts +23 -2
  97. package/src/resources/tools.ts +20 -13
  98. package/src/resources/trigger-instances/trigger-instances.ts +19 -7
  99. package/src/resources/triggers-types.ts +36 -19
  100. package/src/version.ts +1 -1
  101. package/version.d.mts +1 -1
  102. package/version.d.ts +1 -1
  103. package/version.js +1 -1
  104. package/version.mjs +1 -1
  105. package/resources/v3/auth/auth.d.mts +0 -10
  106. package/resources/v3/auth/auth.d.mts.map +0 -1
  107. package/resources/v3/auth/auth.d.ts +0 -10
  108. package/resources/v3/auth/auth.d.ts.map +0 -1
  109. package/resources/v3/auth/auth.js +0 -17
  110. package/resources/v3/auth/auth.js.map +0 -1
  111. package/resources/v3/auth/auth.mjs +0 -12
  112. package/resources/v3/auth/auth.mjs.map +0 -1
  113. package/resources/v3/auth/index.d.mts +0 -3
  114. package/resources/v3/auth/index.d.mts.map +0 -1
  115. package/resources/v3/auth/index.d.ts +0 -3
  116. package/resources/v3/auth/index.d.ts.map +0 -1
  117. package/resources/v3/auth/index.js +0 -9
  118. package/resources/v3/auth/index.js.map +0 -1
  119. package/resources/v3/auth/index.mjs +0 -4
  120. package/resources/v3/auth/index.mjs.map +0 -1
  121. package/resources/v3/auth/session.d.mts +0 -246
  122. package/resources/v3/auth/session.d.mts.map +0 -1
  123. package/resources/v3/auth/session.d.ts +0 -246
  124. package/resources/v3/auth/session.d.ts.map +0 -1
  125. package/resources/v3/auth/session.js +0 -25
  126. package/resources/v3/auth/session.js.map +0 -1
  127. package/resources/v3/auth/session.mjs +0 -21
  128. package/resources/v3/auth/session.mjs.map +0 -1
  129. package/resources/v3/auth.d.mts +0 -2
  130. package/resources/v3/auth.d.mts.map +0 -1
  131. package/resources/v3/auth.d.ts +0 -2
  132. package/resources/v3/auth.d.ts.map +0 -1
  133. package/resources/v3/auth.js +0 -6
  134. package/resources/v3/auth.js.map +0 -1
  135. package/resources/v3/auth.mjs +0 -3
  136. package/resources/v3/auth.mjs.map +0 -1
  137. package/resources/v3/cli.d.mts +0 -167
  138. package/resources/v3/cli.d.mts.map +0 -1
  139. package/resources/v3/cli.d.ts +0 -167
  140. package/resources/v3/cli.d.ts.map +0 -1
  141. package/resources/v3/cli.js +0 -55
  142. package/resources/v3/cli.js.map +0 -1
  143. package/resources/v3/cli.mjs +0 -51
  144. package/resources/v3/cli.mjs.map +0 -1
  145. package/resources/v3/index.d.mts +0 -5
  146. package/resources/v3/index.d.mts.map +0 -1
  147. package/resources/v3/index.d.ts +0 -5
  148. package/resources/v3/index.d.ts.map +0 -1
  149. package/resources/v3/index.js +0 -13
  150. package/resources/v3/index.js.map +0 -1
  151. package/resources/v3/index.mjs +0 -6
  152. package/resources/v3/index.mjs.map +0 -1
  153. package/resources/v3/internal/action-execution.d.mts +0 -153
  154. package/resources/v3/internal/action-execution.d.mts.map +0 -1
  155. package/resources/v3/internal/action-execution.d.ts +0 -153
  156. package/resources/v3/internal/action-execution.d.ts.map +0 -1
  157. package/resources/v3/internal/action-execution.js +0 -38
  158. package/resources/v3/internal/action-execution.js.map +0 -1
  159. package/resources/v3/internal/action-execution.mjs +0 -34
  160. package/resources/v3/internal/action-execution.mjs.map +0 -1
  161. package/resources/v3/internal/index.d.mts +0 -4
  162. package/resources/v3/internal/index.d.mts.map +0 -1
  163. package/resources/v3/internal/index.d.ts +0 -4
  164. package/resources/v3/internal/index.d.ts.map +0 -1
  165. package/resources/v3/internal/index.js +0 -11
  166. package/resources/v3/internal/index.js.map +0 -1
  167. package/resources/v3/internal/index.mjs +0 -5
  168. package/resources/v3/internal/index.mjs.map +0 -1
  169. package/resources/v3/internal/internal.d.mts +0 -14
  170. package/resources/v3/internal/internal.d.mts.map +0 -1
  171. package/resources/v3/internal/internal.d.ts +0 -14
  172. package/resources/v3/internal/internal.d.ts.map +0 -1
  173. package/resources/v3/internal/internal.js +0 -21
  174. package/resources/v3/internal/internal.js.map +0 -1
  175. package/resources/v3/internal/internal.mjs +0 -16
  176. package/resources/v3/internal/internal.mjs.map +0 -1
  177. package/resources/v3/internal/trigger.d.mts +0 -84
  178. package/resources/v3/internal/trigger.d.mts.map +0 -1
  179. package/resources/v3/internal/trigger.d.ts +0 -84
  180. package/resources/v3/internal/trigger.d.ts.map +0 -1
  181. package/resources/v3/internal/trigger.js +0 -23
  182. package/resources/v3/internal/trigger.js.map +0 -1
  183. package/resources/v3/internal/trigger.mjs +0 -19
  184. package/resources/v3/internal/trigger.mjs.map +0 -1
  185. package/resources/v3/internal.d.mts +0 -2
  186. package/resources/v3/internal.d.mts.map +0 -1
  187. package/resources/v3/internal.d.ts +0 -2
  188. package/resources/v3/internal.d.ts.map +0 -1
  189. package/resources/v3/internal.js +0 -6
  190. package/resources/v3/internal.js.map +0 -1
  191. package/resources/v3/internal.mjs +0 -3
  192. package/resources/v3/internal.mjs.map +0 -1
  193. package/resources/v3/v3.d.mts +0 -18
  194. package/resources/v3/v3.d.mts.map +0 -1
  195. package/resources/v3/v3.d.ts +0 -18
  196. package/resources/v3/v3.d.ts.map +0 -1
  197. package/resources/v3/v3.js +0 -25
  198. package/resources/v3/v3.js.map +0 -1
  199. package/resources/v3/v3.mjs +0 -20
  200. package/resources/v3/v3.mjs.map +0 -1
  201. package/resources/v3.d.mts +0 -2
  202. package/resources/v3.d.mts.map +0 -1
  203. package/resources/v3.d.ts +0 -2
  204. package/resources/v3.d.ts.map +0 -1
  205. package/resources/v3.js +0 -6
  206. package/resources/v3.js.map +0 -1
  207. package/resources/v3.mjs +0 -3
  208. package/resources/v3.mjs.map +0 -1
  209. package/src/resources/v3/auth/auth.ts +0 -15
  210. package/src/resources/v3/auth/index.ts +0 -4
  211. package/src/resources/v3/auth/session.ts +0 -298
  212. package/src/resources/v3/auth.ts +0 -3
  213. package/src/resources/v3/cli.ts +0 -209
  214. package/src/resources/v3/index.ts +0 -13
  215. package/src/resources/v3/internal/action-execution.ts +0 -236
  216. package/src/resources/v3/internal/index.ts +0 -10
  217. package/src/resources/v3/internal/internal.ts +0 -35
  218. package/src/resources/v3/internal/trigger.ts +0 -122
  219. package/src/resources/v3/internal.ts +0 -3
  220. package/src/resources/v3/v3.ts +0 -41
  221. package/src/resources/v3.ts +0 -3
@@ -37,11 +37,13 @@ export declare class TriggersTypes extends APIResource {
37
37
  }
38
38
  export interface TriggersTypeRetrieveResponse {
39
39
  /**
40
- * Configuration parameters required for the trigger
40
+ * Configuration schema required to set up this trigger
41
41
  */
42
- config: Record<string, unknown>;
42
+ config: {
43
+ [key: string]: unknown;
44
+ };
43
45
  /**
44
- * Detailed description of what the trigger does and when it fires
46
+ * Detailed description of what the trigger does
45
47
  */
46
48
  description: string;
47
49
  /**
@@ -49,56 +51,70 @@ export interface TriggersTypeRetrieveResponse {
49
51
  */
50
52
  instructions: string;
51
53
  /**
52
- * Display name of the trigger type
54
+ * Human-readable name of the trigger
53
55
  */
54
56
  name: string;
55
57
  /**
56
- * Structure of the event payload that will be delivered by this trigger
58
+ * Schema of the data payload this trigger will deliver when it fires
57
59
  */
58
- payload: Record<string, unknown>;
60
+ payload: {
61
+ [key: string]: unknown;
62
+ };
59
63
  /**
60
64
  * Unique identifier for the trigger type
61
65
  */
62
66
  slug: string;
63
67
  /**
64
- * Information about the toolkit that contains this trigger
68
+ * Information about the toolkit that provides this trigger
65
69
  */
66
70
  toolkit: TriggersTypeRetrieveResponse.Toolkit;
71
+ /**
72
+ * The trigger mechanism - either webhook (event-based) or poll (scheduled check)
73
+ */
74
+ type: 'webhook' | 'poll';
67
75
  }
68
76
  export declare namespace TriggersTypeRetrieveResponse {
69
77
  /**
70
- * Information about the toolkit that contains this trigger
78
+ * Information about the toolkit that provides this trigger
71
79
  */
72
80
  interface Toolkit {
73
81
  /**
74
- * URL to the toolkit logo image
82
+ * Logo of the toolkit
75
83
  */
76
84
  logo: string;
77
85
  /**
78
- * Slug of the toolkit
86
+ * Deprecated: Use slug instead
79
87
  */
80
- slug: string;
88
+ name: string;
81
89
  /**
82
- * Unique identifier for the associated toolkit
90
+ * Unique identifier for the parent toolkit
83
91
  */
84
- uuid: string;
92
+ slug: string;
85
93
  }
86
94
  }
87
95
  export interface TriggersTypeListResponse {
96
+ current_page: number;
88
97
  items: Array<TriggersTypeListResponse.Item>;
89
- next_cursor: string | null;
98
+ total_items: number;
90
99
  total_pages: number;
100
+ next_cursor?: string | null;
91
101
  }
92
102
  export declare namespace TriggersTypeListResponse {
93
103
  interface Item {
94
104
  /**
95
105
  * Configuration schema required to set up this trigger
96
106
  */
97
- config: Record<string, unknown>;
107
+ config: {
108
+ [key: string]: unknown;
109
+ };
98
110
  /**
99
111
  * Detailed description of what the trigger does
100
112
  */
101
113
  description: string;
114
+ /**
115
+ * Step-by-step instructions on how to set up and use this trigger
116
+ */
117
+ instructions: string;
102
118
  /**
103
119
  * Human-readable name of the trigger
104
120
  */
@@ -106,7 +122,9 @@ export declare namespace TriggersTypeListResponse {
106
122
  /**
107
123
  * Schema of the data payload this trigger will deliver when it fires
108
124
  */
109
- payload: Record<string, unknown>;
125
+ payload: {
126
+ [key: string]: unknown;
127
+ };
110
128
  /**
111
129
  * Unique identifier for the trigger type
112
130
  */
@@ -130,7 +148,7 @@ export declare namespace TriggersTypeListResponse {
130
148
  */
131
149
  logo: string;
132
150
  /**
133
- * Name of the parent toolkit
151
+ * Deprecated: Use slug instead
134
152
  */
135
153
  name: string;
136
154
  /**
@@ -146,11 +164,14 @@ export declare namespace TriggersTypeListResponse {
146
164
  export type TriggersTypeRetrieveEnumResponse = string;
147
165
  export interface TriggersTypeListParams {
148
166
  /**
149
- * Pagination cursor for fetching next page of results
167
+ * Cursor for pagination. The cursor is a base64 encoded string of the page and
168
+ * limit. The page is the page number and the limit is the number of items per
169
+ * page. The cursor is used to paginate through the items. The cursor is not
170
+ * required for the first page.
150
171
  */
151
172
  cursor?: string;
152
173
  /**
153
- * Number of items to return per page
174
+ * Number of items per page
154
175
  */
155
176
  limit?: number | null;
156
177
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"triggers-types.d.mts","sourceRoot":"","sources":["../src/resources/triggers-types.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;IAI1F;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;;;;;;OAQG;IACH,YAAY,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAG3D;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,4BAA4B,CAAC,OAAO,CAAC;CAC/C;AAED,yBAAiB,4BAA4B,CAAC;IAC5C;;OAEG;IACH,UAAiB,OAA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sBAAsB;IACrC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -37,11 +37,13 @@ export declare class TriggersTypes extends APIResource {
37
37
  }
38
38
  export interface TriggersTypeRetrieveResponse {
39
39
  /**
40
- * Configuration parameters required for the trigger
40
+ * Configuration schema required to set up this trigger
41
41
  */
42
- config: Record<string, unknown>;
42
+ config: {
43
+ [key: string]: unknown;
44
+ };
43
45
  /**
44
- * Detailed description of what the trigger does and when it fires
46
+ * Detailed description of what the trigger does
45
47
  */
46
48
  description: string;
47
49
  /**
@@ -49,56 +51,70 @@ export interface TriggersTypeRetrieveResponse {
49
51
  */
50
52
  instructions: string;
51
53
  /**
52
- * Display name of the trigger type
54
+ * Human-readable name of the trigger
53
55
  */
54
56
  name: string;
55
57
  /**
56
- * Structure of the event payload that will be delivered by this trigger
58
+ * Schema of the data payload this trigger will deliver when it fires
57
59
  */
58
- payload: Record<string, unknown>;
60
+ payload: {
61
+ [key: string]: unknown;
62
+ };
59
63
  /**
60
64
  * Unique identifier for the trigger type
61
65
  */
62
66
  slug: string;
63
67
  /**
64
- * Information about the toolkit that contains this trigger
68
+ * Information about the toolkit that provides this trigger
65
69
  */
66
70
  toolkit: TriggersTypeRetrieveResponse.Toolkit;
71
+ /**
72
+ * The trigger mechanism - either webhook (event-based) or poll (scheduled check)
73
+ */
74
+ type: 'webhook' | 'poll';
67
75
  }
68
76
  export declare namespace TriggersTypeRetrieveResponse {
69
77
  /**
70
- * Information about the toolkit that contains this trigger
78
+ * Information about the toolkit that provides this trigger
71
79
  */
72
80
  interface Toolkit {
73
81
  /**
74
- * URL to the toolkit logo image
82
+ * Logo of the toolkit
75
83
  */
76
84
  logo: string;
77
85
  /**
78
- * Slug of the toolkit
86
+ * Deprecated: Use slug instead
79
87
  */
80
- slug: string;
88
+ name: string;
81
89
  /**
82
- * Unique identifier for the associated toolkit
90
+ * Unique identifier for the parent toolkit
83
91
  */
84
- uuid: string;
92
+ slug: string;
85
93
  }
86
94
  }
87
95
  export interface TriggersTypeListResponse {
96
+ current_page: number;
88
97
  items: Array<TriggersTypeListResponse.Item>;
89
- next_cursor: string | null;
98
+ total_items: number;
90
99
  total_pages: number;
100
+ next_cursor?: string | null;
91
101
  }
92
102
  export declare namespace TriggersTypeListResponse {
93
103
  interface Item {
94
104
  /**
95
105
  * Configuration schema required to set up this trigger
96
106
  */
97
- config: Record<string, unknown>;
107
+ config: {
108
+ [key: string]: unknown;
109
+ };
98
110
  /**
99
111
  * Detailed description of what the trigger does
100
112
  */
101
113
  description: string;
114
+ /**
115
+ * Step-by-step instructions on how to set up and use this trigger
116
+ */
117
+ instructions: string;
102
118
  /**
103
119
  * Human-readable name of the trigger
104
120
  */
@@ -106,7 +122,9 @@ export declare namespace TriggersTypeListResponse {
106
122
  /**
107
123
  * Schema of the data payload this trigger will deliver when it fires
108
124
  */
109
- payload: Record<string, unknown>;
125
+ payload: {
126
+ [key: string]: unknown;
127
+ };
110
128
  /**
111
129
  * Unique identifier for the trigger type
112
130
  */
@@ -130,7 +148,7 @@ export declare namespace TriggersTypeListResponse {
130
148
  */
131
149
  logo: string;
132
150
  /**
133
- * Name of the parent toolkit
151
+ * Deprecated: Use slug instead
134
152
  */
135
153
  name: string;
136
154
  /**
@@ -146,11 +164,14 @@ export declare namespace TriggersTypeListResponse {
146
164
  export type TriggersTypeRetrieveEnumResponse = string;
147
165
  export interface TriggersTypeListParams {
148
166
  /**
149
- * Pagination cursor for fetching next page of results
167
+ * Cursor for pagination. The cursor is a base64 encoded string of the page and
168
+ * limit. The page is the page number and the limit is the number of items per
169
+ * page. The cursor is used to paginate through the items. The cursor is not
170
+ * required for the first page.
150
171
  */
151
172
  cursor?: string;
152
173
  /**
153
- * Number of items to return per page
174
+ * Number of items per page
154
175
  */
155
176
  limit?: number | null;
156
177
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"triggers-types.d.ts","sourceRoot":"","sources":["../src/resources/triggers-types.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;IAI1F;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;;;;;;OAQG;IACH,YAAY,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAG3D;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,4BAA4B,CAAC,OAAO,CAAC;CAC/C;AAED,yBAAiB,4B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AgC,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
package/src/client.ts CHANGED
@@ -39,6 +39,7 @@ import {
39
39
  ConnectedAccountDeleteResponse,
40
40
  ConnectedAccountListParams,
41
41
  ConnectedAccountListResponse,
42
+ ConnectedAccountRefreshParams,
42
43
  ConnectedAccountRefreshResponse,
43
44
  ConnectedAccountRetrieveResponse,
44
45
  ConnectedAccountUpdateStatusParams,
@@ -126,7 +127,6 @@ import {
126
127
  TriggerInstanceUpsertResponse,
127
128
  TriggerInstances,
128
129
  } from './resources/trigger-instances/trigger-instances';
129
- import { V3 } from './resources/v3/v3';
130
130
 
131
131
  const environments = {
132
132
  production: 'https://backend.composio.dev',
@@ -164,6 +164,8 @@ export interface ClientOptions {
164
164
  *
165
165
  * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
166
166
  * much longer than this timeout before the promise succeeds or fails.
167
+ *
168
+ * @unit milliseconds
167
169
  */
168
170
  timeout?: number | undefined;
169
171
  /**
@@ -299,6 +301,7 @@ export class Composio {
299
301
  timeout: this.timeout,
300
302
  logger: this.logger,
301
303
  logLevel: this.logLevel,
304
+ fetch: this.fetch,
302
305
  fetchOptions: this.fetchOptions,
303
306
  apiKey: this.apiKey,
304
307
  ...options,
@@ -833,7 +836,6 @@ export class Composio {
833
836
  mcp: API.Mcp = new API.Mcp(this);
834
837
  files: API.Files = new API.Files(this);
835
838
  migration: API.Migration = new API.Migration(this);
836
- v3: API.V3 = new API.V3(this);
837
839
  }
838
840
  Composio.AuthConfigs = AuthConfigs;
839
841
  Composio.ConnectedAccounts = ConnectedAccounts;
@@ -846,7 +848,6 @@ Composio.TriggersTypes = TriggersTypes;
846
848
  Composio.Mcp = Mcp;
847
849
  Composio.Files = Files;
848
850
  Composio.Migration = Migration;
849
- Composio.V3 = V3;
850
851
  export declare namespace Composio {
851
852
  export type RequestOptions = Opts.RequestOptions;
852
853
 
@@ -874,6 +875,7 @@ export declare namespace Composio {
874
875
  type ConnectedAccountUpdateStatusResponse as ConnectedAccountUpdateStatusResponse,
875
876
  type ConnectedAccountCreateParams as ConnectedAccountCreateParams,
876
877
  type ConnectedAccountListParams as ConnectedAccountListParams,
878
+ type ConnectedAccountRefreshParams as ConnectedAccountRefreshParams,
877
879
  type ConnectedAccountUpdateStatusParams as ConnectedAccountUpdateStatusParams,
878
880
  };
879
881
 
@@ -957,6 +959,4 @@ export declare namespace Composio {
957
959
  type MigrationRetrieveNanoidResponse as MigrationRetrieveNanoidResponse,
958
960
  type MigrationRetrieveNanoidParams as MigrationRetrieveNanoidParams,
959
961
  };
960
-
961
- export { V3 as V3 };
962
962
  }
@@ -9,17 +9,70 @@ import { type HeadersLike } from './headers';
9
9
  export type FinalRequestOptions = RequestOptions & { method: HTTPMethod; path: string };
10
10
 
11
11
  export type RequestOptions = {
12
+ /**
13
+ * The HTTP method for the request (e.g., 'get', 'post', 'put', 'delete').
14
+ */
12
15
  method?: HTTPMethod;
16
+
17
+ /**
18
+ * The URL path for the request.
19
+ *
20
+ * @example "/v1/foo"
21
+ */
13
22
  path?: string;
23
+
24
+ /**
25
+ * Query parameters to include in the request URL.
26
+ */
14
27
  query?: object | undefined | null;
28
+
29
+ /**
30
+ * The request body. Can be a string, JSON object, FormData, or other supported types.
31
+ */
15
32
  body?: unknown;
33
+
34
+ /**
35
+ * HTTP headers to include with the request. Can be a Headers object, plain object, or array of tuples.
36
+ */
16
37
  headers?: HeadersLike;
38
+
39
+ /**
40
+ * The maximum number of times that the client will retry a request in case of a
41
+ * temporary failure, like a network error or a 5XX error from the server.
42
+ *
43
+ * @default 2
44
+ */
17
45
  maxRetries?: number;
46
+
18
47
  stream?: boolean | undefined;
48
+
49
+ /**
50
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
51
+ * from the server before timing out a single request.
52
+ *
53
+ * @unit milliseconds
54
+ */
19
55
  timeout?: number;
56
+
57
+ /**
58
+ * Additional `RequestInit` options to be passed to the underlying `fetch` call.
59
+ * These options will be merged with the client's default fetch options.
60
+ */
20
61
  fetchOptions?: MergedRequestInit;
62
+
63
+ /**
64
+ * An AbortSignal that can be used to cancel the request.
65
+ */
21
66
  signal?: AbortSignal | undefined | null;
67
+
68
+ /**
69
+ * A unique key for this request to enable idempotency.
70
+ */
22
71
  idempotencyKey?: string;
72
+
73
+ /**
74
+ * Override the default base URL for this specific request.
75
+ */
23
76
  defaultBaseURL?: string | undefined;
24
77
 
25
78
  __binaryResponse?: boolean | undefined;
@@ -7,7 +7,7 @@ export type KeysEnum<T> = { [P in keyof Required<T>]: true };
7
7
 
8
8
  export type FinalizedRequestInit = RequestInit & { headers: Headers };
9
9
 
10
- type NotAny<T> = [unknown] extends [T] ? never : T;
10
+ type NotAny<T> = [0] extends [1 & T] ? never : T;
11
11
 
12
12
  /**
13
13
  * Some environments overload the global fetch function, and Parameters<T> only gets the last signature.
@@ -64,13 +64,15 @@ type OverloadedParameters<T> =
64
64
  * [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
65
65
  */
66
66
  /** @ts-ignore For users with \@types/node */
67
- type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types').RequestInit> | NotAny<import('../../node_modules/undici-types').RequestInit> | NotAny<import('../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types').RequestInit>;
67
+ type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit>;
68
68
  /** @ts-ignore For users with undici */
69
- type UndiciRequestInit = NotAny<import('../node_modules/undici').RequestInit> | NotAny<import('../../node_modules/undici').RequestInit> | NotAny<import('../../../node_modules/undici').RequestInit> | NotAny<import('../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici').RequestInit>;
69
+ type UndiciRequestInit = NotAny<import('../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici/index.d.ts').RequestInit>;
70
70
  /** @ts-ignore For users with \@types/bun */
71
71
  type BunRequestInit = globalThis.FetchRequestInit;
72
- /** @ts-ignore For users with node-fetch */
73
- type NodeFetchRequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
72
+ /** @ts-ignore For users with node-fetch@2 */
73
+ type NodeFetch2RequestInit = NotAny<import('../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit>;
74
+ /** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
75
+ type NodeFetch3RequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
74
76
  /** @ts-ignore For users who use Deno */
75
77
  type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
76
78
  /* eslint-enable */
@@ -79,7 +81,8 @@ type RequestInits =
79
81
  | NotAny<UndiciTypesRequestInit>
80
82
  | NotAny<UndiciRequestInit>
81
83
  | NotAny<BunRequestInit>
82
- | NotAny<NodeFetchRequestInit>
84
+ | NotAny<NodeFetch2RequestInit>
85
+ | NotAny<NodeFetch3RequestInit>
83
86
  | NotAny<RequestInit>
84
87
  | NotAny<FetchRequestInit>;
85
88
 
@@ -90,7 +90,7 @@ export const multipartFormRequestOptions = async (
90
90
  return { ...opts, body: await createForm(opts.body, fetch) };
91
91
  };
92
92
 
93
- const supportsFormDataMap = /** @__PURE__ */ new WeakMap<Fetch, Promise<boolean>>();
93
+ const supportsFormDataMap = /* @__PURE__ */ new WeakMap<Fetch, Promise<boolean>>();
94
94
 
95
95
  /**
96
96
  * node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
@@ -58,7 +58,7 @@ const noopLogger = {
58
58
  debug: noop,
59
59
  };
60
60
 
61
- let cachedLoggers = /** @__PURE__ */ new WeakMap<Logger, [LogLevel, Logger]>();
61
+ let cachedLoggers = /* @__PURE__ */ new WeakMap<Logger, [LogLevel, Logger]>();
62
62
 
63
63
  export function loggerFor(client: Composio): Logger {
64
64
  const logger = client.logger;
@@ -12,25 +12,43 @@ export function encodeURIPath(str: string) {
12
12
  return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
13
13
  }
14
14
 
15
+ const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
16
+
15
17
  export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
16
18
  function path(statics: readonly string[], ...params: readonly unknown[]): string {
17
19
  // If there are no params, no processing is needed.
18
20
  if (statics.length === 1) return statics[0]!;
19
21
 
20
22
  let postPath = false;
23
+ const invalidSegments = [];
21
24
  const path = statics.reduce((previousValue, currentValue, index) => {
22
25
  if (/[?#]/.test(currentValue)) {
23
26
  postPath = true;
24
27
  }
25
- return (
26
- previousValue +
27
- currentValue +
28
- (index === params.length ? '' : (postPath ? encodeURIComponent : pathEncoder)(String(params[index])))
29
- );
28
+ const value = params[index];
29
+ let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
30
+ if (
31
+ index !== params.length &&
32
+ (value == null ||
33
+ (typeof value === 'object' &&
34
+ // handle values from other realms
35
+ value.toString ===
36
+ Object.getPrototypeOf(Object.getPrototypeOf((value as any).hasOwnProperty ?? EMPTY) ?? EMPTY)
37
+ ?.toString))
38
+ ) {
39
+ encoded = value + '';
40
+ invalidSegments.push({
41
+ start: previousValue.length + currentValue.length,
42
+ length: encoded.length,
43
+ error: `Value of type ${Object.prototype.toString
44
+ .call(value)
45
+ .slice(8, -1)} is not a valid path parameter`,
46
+ });
47
+ }
48
+ return previousValue + currentValue + (index === params.length ? '' : encoded);
30
49
  }, '');
31
50
 
32
51
  const pathOnly = path.split(/[?#]/, 1)[0]!;
33
- const invalidSegments = [];
34
52
  const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
35
53
  let match;
36
54
 
@@ -39,9 +57,12 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
39
57
  invalidSegments.push({
40
58
  start: match.index,
41
59
  length: match[0].length,
60
+ error: `Value "${match[0]}" can\'t be safely passed as a path parameter`,
42
61
  });
43
62
  }
44
63
 
64
+ invalidSegments.sort((a, b) => a.start - b.start);
65
+
45
66
  if (invalidSegments.length > 0) {
46
67
  let lastEnd = 0;
47
68
  const underline = invalidSegments.reduce((acc, segment) => {
@@ -51,7 +72,11 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
51
72
  return acc + spaces + arrows;
52
73
  }, '');
53
74
 
54
- throw new ComposioError(`Path parameters result in path with invalid segments:\n${path}\n${underline}`);
75
+ throw new ComposioError(
76
+ `Path parameters result in path with invalid segments:\n${invalidSegments
77
+ .map((e) => e.error)
78
+ .join('\n')}\n${path}\n${underline}`,
79
+ );
55
80
  }
56
81
 
57
82
  return path;