@composio/core 0.23.0 → 0.25.0
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.
- package/dist/{CustomTool-CnJxXr07.mjs → CustomTool-BYHB7sPs.mjs} +1 -1
- package/dist/{CustomTool-CnHdegDK.d.mts → CustomTool-DZY1yLHN.d.mts} +1 -1
- package/dist/{cancellation-BQibgpRG.mjs → cancellation-D-tMPk48.mjs} +1 -1
- package/dist/{composio-Dq708dZS.d.mts → composio-B8AENilE.d.mts} +74 -62
- package/dist/{customTool.types-B8lVpHOP.d.mts → customTool.types-Bi6-keZC.d.mts} +612 -141
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +22 -22
- package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +8 -8
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +1 -1
- package/dist/docs/reference/sdk-reference/typescript/keyring.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/logs.mdx +5 -5
- package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +15 -15
- package/dist/docs/reference/sdk-reference/typescript/meta.json +1 -1
- package/dist/docs/reference/sdk-reference/typescript/session-configs.mdx +5 -5
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +56 -21
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +6 -6
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +22 -22
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +18 -18
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +25 -25
- package/dist/docs/reference/sdk-reference/typescript/usage.mdx +6 -6
- package/dist/docs/reference/sdk-reference/typescript/webhook-endpoints.mdx +14 -14
- package/dist/docs/reference/sdk-reference/typescript/webhook-subscriptions.mdx +13 -13
- package/dist/{errors-BN15NcCW.mjs → errors-Cly0vXFh.mjs} +5 -5
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/index.d.mts +31 -7
- package/dist/index.mjs +382 -147
- package/dist/{types-eTw8Yw7Y.d.mts → types-BGDMkEUl.d.mts} +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.mjs +2 -2
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/package.json +8 -8
- package/src/composio.ts +19 -16
- package/src/errors/ToolRouterErrors.ts +5 -5
- package/src/lib/toolRouterParams.ts +44 -16
- package/src/models/MCP.ts +20 -1
- package/src/models/ToolRouter.ts +9 -0
- package/src/models/ToolRouterSession.ts +68 -0
- package/src/models/Triggers.ts +8 -6
- package/src/services/pusher/Pusher.ts +159 -88
- package/src/types/pusher.types.ts +2 -0
- package/src/types/toolRouter.types.ts +190 -19
- package/src/utils/session.ts +25 -47
- package/src/utils/transformers/toolRouterResponseTransform.ts +8 -2
- package/src/utils/userCallback.ts +41 -0
|
@@ -50,7 +50,7 @@ Retrieves the version changelog of every toolkit (the last 10 versions
|
|
|
50
50
|
per toolkit).
|
|
51
51
|
|
|
52
52
|
```typescript
|
|
53
|
-
async changelog(requestOptions?: ComposioRequestOptions): Promise<
|
|
53
|
+
async changelog(requestOptions?: ComposioRequestOptions): Promise<ToolkitChangelogResponse>
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
**Parameters**
|
|
@@ -61,7 +61,7 @@ async changelog(requestOptions?: ComposioRequestOptions): Promise<{ items: { dis
|
|
|
61
61
|
|
|
62
62
|
**Returns**
|
|
63
63
|
|
|
64
|
-
`Promise
|
|
64
|
+
`Promise<ToolkitChangelogResponse>` — Toolkits with their recent version changelogs
|
|
65
65
|
|
|
66
66
|
**Example**
|
|
67
67
|
|
|
@@ -80,7 +80,7 @@ Retrieves a specific toolkit by its slug identifier.
|
|
|
80
80
|
**Overload 1**
|
|
81
81
|
|
|
82
82
|
```typescript
|
|
83
|
-
async get(slug: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
83
|
+
async get(slug: string, requestOptions?: ComposioRequestOptions): Promise<ToolkitRetrieveResponse>
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
**Parameters**
|
|
@@ -92,24 +92,24 @@ async get(slug: string, requestOptions?: ComposioRequestOptions): Promise<{ auth
|
|
|
92
92
|
|
|
93
93
|
**Returns**
|
|
94
94
|
|
|
95
|
-
`Promise
|
|
95
|
+
`Promise<ToolkitRetrieveResponse>` — The toolkit object with detailed information
|
|
96
96
|
|
|
97
97
|
**Overload 2**
|
|
98
98
|
|
|
99
99
|
```typescript
|
|
100
|
-
async get(query?:
|
|
100
|
+
async get(query?: ToolkitListParams, requestOptions?: ComposioRequestOptions): Promise<ToolKitListResponse>
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
**Parameters**
|
|
104
104
|
|
|
105
105
|
| Name | Type | Description |
|
|
106
106
|
|------|------|-------------|
|
|
107
|
-
| `query?` |
|
|
107
|
+
| `query?` | `ToolkitListParams` | The query parameters to filter toolkits |
|
|
108
108
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
109
109
|
|
|
110
110
|
**Returns**
|
|
111
111
|
|
|
112
|
-
`Promise
|
|
112
|
+
`Promise<ToolKitListResponse>` — A paginated list of toolkits matching the query criteria
|
|
113
113
|
|
|
114
114
|
**Example**
|
|
115
115
|
|
|
@@ -127,7 +127,7 @@ console.log(githubToolkit.authConfigDetails); // Authentication configuration de
|
|
|
127
127
|
Retrieves the fields required for creating an auth config for a toolkit.
|
|
128
128
|
|
|
129
129
|
```typescript
|
|
130
|
-
async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeType, options?: { requiredOnly?: boolean }): Promise
|
|
130
|
+
async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeType, options?: { requiredOnly?: boolean }): Promise<ToolkitAuthFieldsResponse>
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
**Parameters**
|
|
@@ -140,7 +140,7 @@ async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeTyp
|
|
|
140
140
|
|
|
141
141
|
**Returns**
|
|
142
142
|
|
|
143
|
-
`Promise
|
|
143
|
+
`Promise<ToolkitAuthFieldsResponse>` — The fields required for creating an auth config
|
|
144
144
|
|
|
145
145
|
---
|
|
146
146
|
|
|
@@ -149,7 +149,7 @@ async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeTyp
|
|
|
149
149
|
Retrieves the fields required for initiating a connected account for a toolkit.
|
|
150
150
|
|
|
151
151
|
```typescript
|
|
152
|
-
async getConnectedAccountInitiationFields(toolkitSlug: string, authScheme: AuthSchemeType, options?: { requiredOnly?: boolean }): Promise
|
|
152
|
+
async getConnectedAccountInitiationFields(toolkitSlug: string, authScheme: AuthSchemeType, options?: { requiredOnly?: boolean }): Promise<ToolkitAuthFieldsResponse>
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
**Parameters**
|
|
@@ -162,7 +162,7 @@ async getConnectedAccountInitiationFields(toolkitSlug: string, authScheme: AuthS
|
|
|
162
162
|
|
|
163
163
|
**Returns**
|
|
164
164
|
|
|
165
|
-
`Promise
|
|
165
|
+
`Promise<ToolkitAuthFieldsResponse>` — The fields required for initiating a connected account
|
|
166
166
|
|
|
167
167
|
---
|
|
168
168
|
|
|
@@ -174,7 +174,7 @@ Returns the same transformed shape as `composio.toolkits.get({ ... })`.
|
|
|
174
174
|
Unknown slugs are simply absent from the result.
|
|
175
175
|
|
|
176
176
|
```typescript
|
|
177
|
-
async getMany(slugs: string[], params?:
|
|
177
|
+
async getMany(slugs: string[], params?: ToolkitGetManyParams, requestOptions?: ComposioRequestOptions): Promise<ToolKitListResponse>
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
**Parameters**
|
|
@@ -182,12 +182,12 @@ async getMany(slugs: string[], params?: { category?: string; cursor?: string; li
|
|
|
182
182
|
| Name | Type | Description |
|
|
183
183
|
|------|------|-------------|
|
|
184
184
|
| `slugs` | `string[]` | The toolkit slugs to retrieve (at least one) |
|
|
185
|
-
| `params?` |
|
|
185
|
+
| `params?` | `ToolkitGetManyParams` | Optional filters and pagination, as for `list` |
|
|
186
186
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
187
187
|
|
|
188
188
|
**Returns**
|
|
189
189
|
|
|
190
|
-
`Promise
|
|
190
|
+
`Promise<ToolKitListResponse>` — The matching toolkits
|
|
191
191
|
|
|
192
192
|
**Example**
|
|
193
193
|
|
|
@@ -206,7 +206,7 @@ This method fetches the complete list of categories from the Composio API
|
|
|
206
206
|
and transforms the response to use camelCase property naming.
|
|
207
207
|
|
|
208
208
|
```typescript
|
|
209
|
-
async listCategories(requestOptions?: ComposioRequestOptions): Promise<
|
|
209
|
+
async listCategories(requestOptions?: ComposioRequestOptions): Promise<ToolkitRetrieveCategoriesResponse>
|
|
210
210
|
```
|
|
211
211
|
|
|
212
212
|
**Parameters**
|
|
@@ -217,7 +217,7 @@ async listCategories(requestOptions?: ComposioRequestOptions): Promise<{ items:
|
|
|
217
217
|
|
|
218
218
|
**Returns**
|
|
219
219
|
|
|
220
|
-
`Promise
|
|
220
|
+
`Promise<ToolkitRetrieveCategoriesResponse>` — The list of toolkit categories
|
|
221
221
|
|
|
222
222
|
**Example**
|
|
223
223
|
|
|
@@ -240,7 +240,7 @@ Pass a dimension and a value as `grantContext` to
|
|
|
240
240
|
`composio.toolkits.recommendScopes()` to tailor the recommendation.
|
|
241
241
|
|
|
242
242
|
```typescript
|
|
243
|
-
async listGrantContexts(toolkitSlug: string, params?:
|
|
243
|
+
async listGrantContexts(toolkitSlug: string, params?: ToolkitListGrantContextsParams, requestOptions?: ComposioRequestOptions): Promise<ToolkitListGrantContextsResponse>
|
|
244
244
|
```
|
|
245
245
|
|
|
246
246
|
**Parameters**
|
|
@@ -248,12 +248,12 @@ async listGrantContexts(toolkitSlug: string, params?: { authScheme?: 'OAUTH2' |
|
|
|
248
248
|
| Name | Type | Description |
|
|
249
249
|
|------|------|-------------|
|
|
250
250
|
| `toolkitSlug` | `string` | The toolkit to list grant contexts for |
|
|
251
|
-
| `params?` |
|
|
251
|
+
| `params?` | `ToolkitListGrantContextsParams` | Optional auth scheme and toolkit version |
|
|
252
252
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
253
253
|
|
|
254
254
|
**Returns**
|
|
255
255
|
|
|
256
|
-
`Promise
|
|
256
|
+
`Promise<ToolkitListGrantContextsResponse>` — The dimensions and the default grant context
|
|
257
257
|
|
|
258
258
|
**Example**
|
|
259
259
|
|
|
@@ -279,7 +279,7 @@ scope per requirement) and `fewest` (smallest set covering everything).
|
|
|
279
279
|
Pass `toolkitVersion` from a previous answer to pin the computation.
|
|
280
280
|
|
|
281
281
|
```typescript
|
|
282
|
-
async recommendScopes(toolkitSlug: string, params:
|
|
282
|
+
async recommendScopes(toolkitSlug: string, params: ToolkitRecommendScopesParams, requestOptions?: ComposioRequestOptions): Promise<ToolkitRecommendScopesResponse>
|
|
283
283
|
```
|
|
284
284
|
|
|
285
285
|
**Parameters**
|
|
@@ -287,12 +287,12 @@ async recommendScopes(toolkitSlug: string, params: { authScheme?: 'OAUTH2' | 'OA
|
|
|
287
287
|
| Name | Type | Description |
|
|
288
288
|
|------|------|-------------|
|
|
289
289
|
| `toolkitSlug` | `string` | The toolkit to recommend scopes for |
|
|
290
|
-
| `params` |
|
|
290
|
+
| `params` | `ToolkitRecommendScopesParams` | Tools to cover (`[]` for the whole toolkit), auth scheme, grant context and scope constraints |
|
|
291
291
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
292
292
|
|
|
293
293
|
**Returns**
|
|
294
294
|
|
|
295
|
-
`Promise
|
|
295
|
+
`Promise<ToolkitRecommendScopesResponse>` — The recommended scope sets
|
|
296
296
|
|
|
297
297
|
**Example**
|
|
298
298
|
|
|
@@ -26,7 +26,7 @@ the execution will throw a `ComposioToolVersionRequiredError` unless `dangerousl
|
|
|
26
26
|
This helps prevent unexpected behavior when new toolkit versions are released.
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
|
-
async execute(slug: string, body:
|
|
29
|
+
async execute(slug: string, body: ToolExecuteParams, options?: ExecuteToolModifiers & ComposioRequestOptions): Promise<ToolExecuteResponse>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
**Parameters**
|
|
@@ -34,12 +34,12 @@ async execute(slug: string, body: { allowTracing?: boolean; arguments?: Record<s
|
|
|
34
34
|
| Name | Type | Description |
|
|
35
35
|
|------|------|-------------|
|
|
36
36
|
| `slug` | `string` | The slug/ID of the tool to be executed |
|
|
37
|
-
| `body` |
|
|
38
|
-
| `options?` |
|
|
37
|
+
| `body` | `ToolExecuteParams` | The parameters to be passed to the tool |
|
|
38
|
+
| `options?` | `ExecuteToolModifiers & ComposioRequestOptions` | Optional modifiers and request options |
|
|
39
39
|
|
|
40
40
|
**Returns**
|
|
41
41
|
|
|
42
|
-
`Promise
|
|
42
|
+
`Promise<ToolExecuteResponse>` — The response from the tool execution
|
|
43
43
|
|
|
44
44
|
**Example**
|
|
45
45
|
|
|
@@ -104,7 +104,7 @@ const result = await composio.tools.execute('HACKERNEWS_GET_FRONTPAGE', {
|
|
|
104
104
|
Executes a tool based on a tool router session.
|
|
105
105
|
|
|
106
106
|
```typescript
|
|
107
|
-
async executeSessionTool(toolSlug: string, body:
|
|
107
|
+
async executeSessionTool(toolSlug: string, body: ToolExecuteMetaParams, modifiers?: SessionExecuteMetaModifiers, tool?: Tool, options?: ToolRouterSessionExecuteOptions, requestOptions?: ComposioRequestOptions): Promise<ToolExecuteResponse>
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
**Parameters**
|
|
@@ -112,15 +112,15 @@ async executeSessionTool(toolSlug: string, body: { arguments?: Record<string, un
|
|
|
112
112
|
| Name | Type | Description |
|
|
113
113
|
|------|------|-------------|
|
|
114
114
|
| `toolSlug` | `string` | The slug of the tool to execute |
|
|
115
|
-
| `body` |
|
|
115
|
+
| `body` | `ToolExecuteMetaParams` | The execution parameters |
|
|
116
116
|
| `modifiers?` | `SessionExecuteMetaModifiers` | The modifiers to apply to the tool |
|
|
117
|
-
| `tool?` |
|
|
117
|
+
| `tool?` | `Tool` | Optional tool schema used to resolve toolkit metadata for modifiers |
|
|
118
118
|
| `options?` | `ToolRouterSessionExecuteOptions` | |
|
|
119
119
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
120
120
|
|
|
121
121
|
**Returns**
|
|
122
122
|
|
|
123
|
-
`Promise
|
|
123
|
+
`Promise<ToolExecuteResponse>` — The response from the tool execution
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
@@ -132,7 +132,7 @@ This method fetches the tools from the Composio API and wraps them using the pro
|
|
|
132
132
|
**Overload 1**
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
|
-
async get(userId: string, filters: ToolListParams, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType
|
|
135
|
+
async get(userId: string, filters: ToolListParams, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType<T['wrapTools']>>
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
**Parameters**
|
|
@@ -145,12 +145,12 @@ async get(userId: string, filters: ToolListParams, options?: ProviderOptions & C
|
|
|
145
145
|
|
|
146
146
|
**Returns**
|
|
147
147
|
|
|
148
|
-
`Promise<ReturnType
|
|
148
|
+
`Promise<ReturnType<T['wrapTools']>>` — The wrapped tools collection
|
|
149
149
|
|
|
150
150
|
**Overload 2**
|
|
151
151
|
|
|
152
152
|
```typescript
|
|
153
|
-
async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType
|
|
153
|
+
async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType<T['wrapTools']>>
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
**Parameters**
|
|
@@ -163,7 +163,7 @@ async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequ
|
|
|
163
163
|
|
|
164
164
|
**Returns**
|
|
165
165
|
|
|
166
|
-
`Promise<ReturnType
|
|
166
|
+
`Promise<ReturnType<T['wrapTools']>>` — The wrapped tool
|
|
167
167
|
|
|
168
168
|
**Example**
|
|
169
169
|
|
|
@@ -230,7 +230,7 @@ Tool Router session, then use `session.tools()`, `session.customTools()`, or
|
|
|
230
230
|
`session.execute()`.
|
|
231
231
|
|
|
232
232
|
```typescript
|
|
233
|
-
async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, requestOptions?: ComposioRequestOptions): Promise<
|
|
233
|
+
async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, requestOptions?: ComposioRequestOptions): Promise<Tool>
|
|
234
234
|
```
|
|
235
235
|
|
|
236
236
|
**Parameters**
|
|
@@ -243,7 +243,7 @@ async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, req
|
|
|
243
243
|
|
|
244
244
|
**Returns**
|
|
245
245
|
|
|
246
|
-
`Promise
|
|
246
|
+
`Promise<Tool>` — The requested tool with its complete schema and metadata
|
|
247
247
|
|
|
248
248
|
**Example**
|
|
249
249
|
|
|
@@ -396,7 +396,7 @@ This method is mostly used by the CLI to get the list of tools.
|
|
|
396
396
|
No filtering is done on the tools, the list is cached in the backend, no further optimization is required.
|
|
397
397
|
|
|
398
398
|
```typescript
|
|
399
|
-
async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<
|
|
399
|
+
async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<ToolRetrieveEnumResponse>
|
|
400
400
|
```
|
|
401
401
|
|
|
402
402
|
**Parameters**
|
|
@@ -407,7 +407,7 @@ async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<string[]>
|
|
|
407
407
|
|
|
408
408
|
**Returns**
|
|
409
409
|
|
|
410
|
-
`Promise<
|
|
410
|
+
`Promise<ToolRetrieveEnumResponse>` — The complete list of all available tools with their metadata
|
|
411
411
|
|
|
412
412
|
**Example**
|
|
413
413
|
|
|
@@ -433,14 +433,14 @@ already include a path. Google Calendar's base URL is
|
|
|
433
433
|
and returns a 404 from Google). An absolute URL on the same domain is sent as-is.
|
|
434
434
|
|
|
435
435
|
```typescript
|
|
436
|
-
async proxyExecute(body:
|
|
436
|
+
async proxyExecute(body: ToolProxyParams, requestOptions?: ComposioRequestOptions): Promise<ToolProxyResponse>
|
|
437
437
|
```
|
|
438
438
|
|
|
439
439
|
**Parameters**
|
|
440
440
|
|
|
441
441
|
| Name | Type | Description |
|
|
442
442
|
|------|------|-------------|
|
|
443
|
-
| `body` |
|
|
443
|
+
| `body` | `ToolProxyParams` | The proxy request |
|
|
444
444
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
445
445
|
|
|
446
446
|
**Returns**
|
|
@@ -20,7 +20,7 @@ Create a new trigger instance for a user
|
|
|
20
20
|
If the connected account id is not provided, the first connected account for the user and toolkit will be used
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
|
-
async create(userId: string, slug: string, body?:
|
|
23
|
+
async create(userId: string, slug: string, body?: TriggerInstanceUpsertParams, requestOptions?: ComposioRequestOptions): Promise<TriggerInstanceUpsertResponse>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
**Parameters**
|
|
@@ -29,12 +29,12 @@ async create(userId: string, slug: string, body?: { connectedAccountId?: string;
|
|
|
29
29
|
|------|------|-------------|
|
|
30
30
|
| `userId` | `string` | The user id of the trigger instance |
|
|
31
31
|
| `slug` | `string` | The slug of the trigger instance |
|
|
32
|
-
| `body?` |
|
|
32
|
+
| `body?` | `TriggerInstanceUpsertParams` | The parameters to create the trigger instance |
|
|
33
33
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
34
34
|
|
|
35
35
|
**Returns**
|
|
36
36
|
|
|
37
|
-
`Promise
|
|
37
|
+
`Promise<TriggerInstanceUpsertResponse>` — The created trigger instance
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
@@ -43,7 +43,7 @@ async create(userId: string, slug: string, body?: { connectedAccountId?: string;
|
|
|
43
43
|
Delete a trigger instance
|
|
44
44
|
|
|
45
45
|
```typescript
|
|
46
|
-
async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
46
|
+
async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promise<TriggerInstanceManageDeleteResponse>
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
**Parameters**
|
|
@@ -55,7 +55,7 @@ async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promis
|
|
|
55
55
|
|
|
56
56
|
**Returns**
|
|
57
57
|
|
|
58
|
-
`Promise
|
|
58
|
+
`Promise<TriggerInstanceManageDeleteResponse>`
|
|
59
59
|
|
|
60
60
|
---
|
|
61
61
|
|
|
@@ -107,7 +107,7 @@ Retrieve a trigger type by its slug for the provided version of the app
|
|
|
107
107
|
Use the global toolkit versions param when initializing composio to pass a toolkitversion
|
|
108
108
|
|
|
109
109
|
```typescript
|
|
110
|
-
async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
110
|
+
async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<TriggersTypeRetrieveResponse>
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
**Parameters**
|
|
@@ -119,7 +119,7 @@ async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<{
|
|
|
119
119
|
|
|
120
120
|
**Returns**
|
|
121
121
|
|
|
122
|
-
`Promise
|
|
122
|
+
`Promise<TriggersTypeRetrieveResponse>` — The trigger type object
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
@@ -128,19 +128,19 @@ async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<{
|
|
|
128
128
|
Fetch list of all the active triggers
|
|
129
129
|
|
|
130
130
|
```typescript
|
|
131
|
-
async listActive(query?:
|
|
131
|
+
async listActive(query?: TriggerInstanceListActiveParams, requestOptions?: ComposioRequestOptions): Promise<TriggerInstanceListActiveResponse>
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
**Parameters**
|
|
135
135
|
|
|
136
136
|
| Name | Type | Description |
|
|
137
137
|
|------|------|-------------|
|
|
138
|
-
| `query?` |
|
|
138
|
+
| `query?` | `TriggerInstanceListActiveParams` | The query parameters to filter the trigger instances |
|
|
139
139
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
140
140
|
|
|
141
141
|
**Returns**
|
|
142
142
|
|
|
143
|
-
`Promise
|
|
143
|
+
`Promise<TriggerInstanceListActiveResponse>` — List of trigger instances
|
|
144
144
|
|
|
145
145
|
**Example**
|
|
146
146
|
|
|
@@ -160,7 +160,7 @@ Fetches the list of all the available trigger enums
|
|
|
160
160
|
This method is used by the CLI where filters are not required.
|
|
161
161
|
|
|
162
162
|
```typescript
|
|
163
|
-
async listEnum(requestOptions?: ComposioRequestOptions): Promise<
|
|
163
|
+
async listEnum(requestOptions?: ComposioRequestOptions): Promise<TriggersTypeRetrieveEnumResponse>
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
**Parameters**
|
|
@@ -171,7 +171,7 @@ async listEnum(requestOptions?: ComposioRequestOptions): Promise<string[]>
|
|
|
171
171
|
|
|
172
172
|
**Returns**
|
|
173
173
|
|
|
174
|
-
`Promise<
|
|
174
|
+
`Promise<TriggersTypeRetrieveEnumResponse>`
|
|
175
175
|
|
|
176
176
|
---
|
|
177
177
|
|
|
@@ -180,19 +180,19 @@ async listEnum(requestOptions?: ComposioRequestOptions): Promise<string[]>
|
|
|
180
180
|
List all the trigger types
|
|
181
181
|
|
|
182
182
|
```typescript
|
|
183
|
-
async listTypes(query?:
|
|
183
|
+
async listTypes(query?: TriggersTypeListParams, requestOptions?: ComposioRequestOptions): Promise<TriggersTypeListResponse>
|
|
184
184
|
```
|
|
185
185
|
|
|
186
186
|
**Parameters**
|
|
187
187
|
|
|
188
188
|
| Name | Type | Description |
|
|
189
189
|
|------|------|-------------|
|
|
190
|
-
| `query?` |
|
|
190
|
+
| `query?` | `TriggersTypeListParams` | The query parameters to filter the trigger types |
|
|
191
191
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
192
192
|
|
|
193
193
|
**Returns**
|
|
194
194
|
|
|
195
|
-
`Promise
|
|
195
|
+
`Promise<TriggersTypeListResponse>` — The list of trigger types
|
|
196
196
|
|
|
197
197
|
---
|
|
198
198
|
|
|
@@ -283,14 +283,14 @@ If a subscription already exists, the first subscription is updated. Otherwise a
|
|
|
283
283
|
subscription is created. By default this subscribes to V3 trigger message events.
|
|
284
284
|
|
|
285
285
|
```typescript
|
|
286
|
-
async setWebhookSubscription(params:
|
|
286
|
+
async setWebhookSubscription(params: SetWebhookSubscriptionParams): Promise<WebhookSubscription>
|
|
287
287
|
```
|
|
288
288
|
|
|
289
289
|
**Parameters**
|
|
290
290
|
|
|
291
291
|
| Name | Type |
|
|
292
292
|
|------|------|
|
|
293
|
-
| `params` |
|
|
293
|
+
| `params` | `SetWebhookSubscriptionParams` |
|
|
294
294
|
|
|
295
295
|
**Returns**
|
|
296
296
|
|
|
@@ -311,15 +311,15 @@ await composio.triggers.setWebhookSubscription({
|
|
|
311
311
|
Subscribe to all the triggers
|
|
312
312
|
|
|
313
313
|
```typescript
|
|
314
|
-
async subscribe(fn: (_data:
|
|
314
|
+
async subscribe(fn: (_data: IncomingTriggerPayload) => void, filters?: TriggerSubscribeParams, onSubscriptionError?: (data: Record<string, unknown>) => void): Promise<void>
|
|
315
315
|
```
|
|
316
316
|
|
|
317
317
|
**Parameters**
|
|
318
318
|
|
|
319
319
|
| Name | Type | Description |
|
|
320
320
|
|------|------|-------------|
|
|
321
|
-
| `fn` | `(_data:
|
|
322
|
-
| `filters?` |
|
|
321
|
+
| `fn` | `(_data: IncomingTriggerPayload) => void` | The function to call when a trigger is received |
|
|
322
|
+
| `filters?` | `TriggerSubscribeParams` | The filters to apply to the triggers |
|
|
323
323
|
| `onSubscriptionError?` | `(data: Record<string, unknown>) => void` | Optional callback invoked with the raw Pusher payload when the underlying subscription fails (for example on auth or permission rejection). The subscribe promise still resolves; this is the only programmatic signal of the failure. Errors thrown from — or promises rejected by — the callback are contained and logged. |
|
|
324
324
|
|
|
325
325
|
**Returns**
|
|
@@ -365,7 +365,7 @@ await triggers.unsubscribe();
|
|
|
365
365
|
Update an existing trigger instance
|
|
366
366
|
|
|
367
367
|
```typescript
|
|
368
|
-
async update(triggerId: string, body:
|
|
368
|
+
async update(triggerId: string, body: TriggerInstanceManageUpdateParams, requestOptions?: ComposioRequestOptions): Promise<TriggerInstanceManageUpdateResponse>
|
|
369
369
|
```
|
|
370
370
|
|
|
371
371
|
**Parameters**
|
|
@@ -373,12 +373,12 @@ async update(triggerId: string, body: { status: 'enable' | 'disable' }, requestO
|
|
|
373
373
|
| Name | Type | Description |
|
|
374
374
|
|------|------|-------------|
|
|
375
375
|
| `triggerId` | `string` | The Id of the trigger instance |
|
|
376
|
-
| `body` |
|
|
376
|
+
| `body` | `TriggerInstanceManageUpdateParams` | The parameters to update the trigger instance |
|
|
377
377
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
378
378
|
|
|
379
379
|
**Returns**
|
|
380
380
|
|
|
381
|
-
`Promise
|
|
381
|
+
`Promise<TriggerInstanceManageUpdateResponse>` — The updated trigger instance response
|
|
382
382
|
|
|
383
383
|
---
|
|
384
384
|
|
|
@@ -394,14 +394,14 @@ The signature is computed as: `HMAC-SHA256(${webhookId}.${webhookTimestamp}.${pa
|
|
|
394
394
|
and is expected in the format: `v1,base64EncodedSignature`
|
|
395
395
|
|
|
396
396
|
```typescript
|
|
397
|
-
async verifyWebhook(params:
|
|
397
|
+
async verifyWebhook(params: VerifyWebhookParams): Promise<VerifyWebhookResult>
|
|
398
398
|
```
|
|
399
399
|
|
|
400
400
|
**Parameters**
|
|
401
401
|
|
|
402
402
|
| Name | Type | Description |
|
|
403
403
|
|------|------|-------------|
|
|
404
|
-
| `params` |
|
|
404
|
+
| `params` | `VerifyWebhookParams` | The verification parameters |
|
|
405
405
|
|
|
406
406
|
**Returns**
|
|
407
407
|
|