@composio/core 0.1.12-alpha.8 → 0.1.12
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/README.md +3 -3
- package/dist/index.cjs +2720 -1265
- package/dist/index.d.cts +1313 -331
- package/dist/index.d.ts +1313 -331
- package/dist/index.js +2692 -1262
- package/package.json +6 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import ComposioClient from '@composio/client';
|
|
2
|
-
import { z
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { TriggerInstanceListActiveParams, TriggerInstanceUpsertParams, TriggerInstanceUpsertResponse, TriggerInstanceRemoveUpsertResponse, TriggerInstanceUpdateStatusParams, TriggersTypeListParams, TriggersTypeListResponse, TriggersTypeRetrieveResponse, TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ToolExecuteResponse as ToolExecuteResponse$1, ToolRetrieveEnumResponse, ToolGetInputParams, ToolGetInputResponse, ToolProxyResponse } from '@composio/client/resources/tools';
|
|
4
|
+
import { TriggersTypeListParams, TriggersTypeListResponse, TriggersTypeRetrieveResponse, TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
|
|
6
5
|
import { AuthConfigUpdateResponse, AuthConfigDeleteResponse, AuthConfigUpdateStatusResponse } from '@composio/client/resources/auth-configs';
|
|
7
6
|
import { ConnectedAccountRetrieveResponse as ConnectedAccountRetrieveResponse$1, ConnectedAccountListResponse as ConnectedAccountListResponse$1, ConnectedAccountDeleteResponse, ConnectedAccountRefreshResponse, ConnectedAccountUpdateStatusParams, ConnectedAccountUpdateStatusResponse } from '@composio/client/resources/connected-accounts';
|
|
8
7
|
import { OpenAI } from 'openai';
|
|
@@ -18,8 +17,50 @@ declare const ToolSchema: z.ZodObject<{
|
|
|
18
17
|
slug: z.ZodString;
|
|
19
18
|
name: z.ZodString;
|
|
20
19
|
description: z.ZodOptional<z.ZodString>;
|
|
21
|
-
inputParameters: z.ZodOptional<z.
|
|
22
|
-
|
|
20
|
+
inputParameters: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"object">;
|
|
22
|
+
properties: z.ZodRecord<z.ZodString, z.ZodType<unknown, z.ZodTypeDef, unknown>>;
|
|
23
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
title: z.ZodOptional<z.ZodString>;
|
|
25
|
+
description: z.ZodOptional<z.ZodString>;
|
|
26
|
+
additionalProperties: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
type: "object";
|
|
29
|
+
properties: Record<string, unknown>;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
title?: string | undefined;
|
|
32
|
+
required?: string[] | undefined;
|
|
33
|
+
additionalProperties?: boolean | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
type: "object";
|
|
36
|
+
properties: Record<string, unknown>;
|
|
37
|
+
description?: string | undefined;
|
|
38
|
+
title?: string | undefined;
|
|
39
|
+
required?: string[] | undefined;
|
|
40
|
+
additionalProperties?: boolean | undefined;
|
|
41
|
+
}>>;
|
|
42
|
+
outputParameters: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"object">;
|
|
44
|
+
properties: z.ZodRecord<z.ZodString, z.ZodType<unknown, z.ZodTypeDef, unknown>>;
|
|
45
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
46
|
+
title: z.ZodOptional<z.ZodString>;
|
|
47
|
+
description: z.ZodOptional<z.ZodString>;
|
|
48
|
+
additionalProperties: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
type: "object";
|
|
51
|
+
properties: Record<string, unknown>;
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
title?: string | undefined;
|
|
54
|
+
required?: string[] | undefined;
|
|
55
|
+
additionalProperties?: boolean | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
type: "object";
|
|
58
|
+
properties: Record<string, unknown>;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
title?: string | undefined;
|
|
61
|
+
required?: string[] | undefined;
|
|
62
|
+
additionalProperties?: boolean | undefined;
|
|
63
|
+
}>>;
|
|
23
64
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
24
65
|
toolkit: z.ZodOptional<z.ZodObject<{
|
|
25
66
|
slug: z.ZodString;
|
|
@@ -40,8 +81,22 @@ declare const ToolSchema: z.ZodObject<{
|
|
|
40
81
|
name: string;
|
|
41
82
|
tags: string[];
|
|
42
83
|
description?: string | undefined;
|
|
43
|
-
inputParameters?:
|
|
44
|
-
|
|
84
|
+
inputParameters?: {
|
|
85
|
+
type: "object";
|
|
86
|
+
properties: Record<string, unknown>;
|
|
87
|
+
description?: string | undefined;
|
|
88
|
+
title?: string | undefined;
|
|
89
|
+
required?: string[] | undefined;
|
|
90
|
+
additionalProperties?: boolean | undefined;
|
|
91
|
+
} | undefined;
|
|
92
|
+
outputParameters?: {
|
|
93
|
+
type: "object";
|
|
94
|
+
properties: Record<string, unknown>;
|
|
95
|
+
description?: string | undefined;
|
|
96
|
+
title?: string | undefined;
|
|
97
|
+
required?: string[] | undefined;
|
|
98
|
+
additionalProperties?: boolean | undefined;
|
|
99
|
+
} | undefined;
|
|
45
100
|
toolkit?: {
|
|
46
101
|
slug: string;
|
|
47
102
|
name: string;
|
|
@@ -52,8 +107,22 @@ declare const ToolSchema: z.ZodObject<{
|
|
|
52
107
|
slug: string;
|
|
53
108
|
name: string;
|
|
54
109
|
description?: string | undefined;
|
|
55
|
-
inputParameters?:
|
|
56
|
-
|
|
110
|
+
inputParameters?: {
|
|
111
|
+
type: "object";
|
|
112
|
+
properties: Record<string, unknown>;
|
|
113
|
+
description?: string | undefined;
|
|
114
|
+
title?: string | undefined;
|
|
115
|
+
required?: string[] | undefined;
|
|
116
|
+
additionalProperties?: boolean | undefined;
|
|
117
|
+
} | undefined;
|
|
118
|
+
outputParameters?: {
|
|
119
|
+
type: "object";
|
|
120
|
+
properties: Record<string, unknown>;
|
|
121
|
+
description?: string | undefined;
|
|
122
|
+
title?: string | undefined;
|
|
123
|
+
required?: string[] | undefined;
|
|
124
|
+
additionalProperties?: boolean | undefined;
|
|
125
|
+
} | undefined;
|
|
57
126
|
tags?: string[] | undefined;
|
|
58
127
|
toolkit?: {
|
|
59
128
|
slug: string;
|
|
@@ -67,32 +136,75 @@ type Tool = z.infer<typeof ToolSchema>;
|
|
|
67
136
|
* Plain SDK level Tool List
|
|
68
137
|
*/
|
|
69
138
|
type ToolList = Array<Tool>;
|
|
139
|
+
type ToolsOnlyParams = {
|
|
140
|
+
tools: string[];
|
|
141
|
+
toolkits?: never;
|
|
142
|
+
important?: never;
|
|
143
|
+
cursor?: never;
|
|
144
|
+
limit?: never;
|
|
145
|
+
search?: never;
|
|
146
|
+
};
|
|
147
|
+
type ToolkitsOnlyParams = {
|
|
148
|
+
tools?: never;
|
|
149
|
+
toolkits?: string[];
|
|
150
|
+
important?: boolean;
|
|
151
|
+
cursor?: string;
|
|
152
|
+
limit?: number;
|
|
153
|
+
search?: never;
|
|
154
|
+
};
|
|
155
|
+
type ToolkitSearchOnlyParams = {
|
|
156
|
+
tools?: never;
|
|
157
|
+
toolkits?: string[];
|
|
158
|
+
important?: never;
|
|
159
|
+
cursor?: string;
|
|
160
|
+
limit?: number;
|
|
161
|
+
search?: string;
|
|
162
|
+
};
|
|
70
163
|
/**
|
|
71
164
|
* ToolListParams is the parameters for the list of tools.
|
|
165
|
+
* You must provide either tools or toolkits, but not both.
|
|
72
166
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
167
|
+
type ToolListParams = ToolsOnlyParams | ToolkitsOnlyParams | ToolkitSearchOnlyParams;
|
|
168
|
+
declare const ToolListParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
169
|
+
tools: z.ZodArray<z.ZodString, "many">;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
tools: string[];
|
|
172
|
+
}, {
|
|
173
|
+
tools: string[];
|
|
174
|
+
}>, z.ZodObject<{
|
|
175
|
+
toolkits: z.ZodArray<z.ZodString, "many">;
|
|
176
|
+
important: z.ZodOptional<z.ZodBoolean>;
|
|
75
177
|
cursor: z.ZodOptional<z.ZodString>;
|
|
76
|
-
|
|
77
|
-
limit: z.ZodOptional<z.ZodString>;
|
|
178
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
78
179
|
search: z.ZodOptional<z.ZodString>;
|
|
79
|
-
toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
180
|
}, "strip", z.ZodTypeAny, {
|
|
81
|
-
|
|
181
|
+
toolkits: string[];
|
|
182
|
+
important?: boolean | undefined;
|
|
82
183
|
cursor?: string | undefined;
|
|
83
|
-
|
|
84
|
-
limit?: string | undefined;
|
|
184
|
+
limit?: number | undefined;
|
|
85
185
|
search?: string | undefined;
|
|
86
|
-
toolkits?: string[] | undefined;
|
|
87
186
|
}, {
|
|
88
|
-
|
|
187
|
+
toolkits: string[];
|
|
188
|
+
important?: boolean | undefined;
|
|
89
189
|
cursor?: string | undefined;
|
|
90
|
-
|
|
91
|
-
limit?: string | undefined;
|
|
190
|
+
limit?: number | undefined;
|
|
92
191
|
search?: string | undefined;
|
|
192
|
+
}>, z.ZodObject<{
|
|
193
|
+
search: z.ZodString;
|
|
194
|
+
toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
195
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
196
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
search: string;
|
|
93
199
|
toolkits?: string[] | undefined;
|
|
94
|
-
|
|
95
|
-
|
|
200
|
+
cursor?: string | undefined;
|
|
201
|
+
limit?: number | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
search: string;
|
|
204
|
+
toolkits?: string[] | undefined;
|
|
205
|
+
cursor?: string | undefined;
|
|
206
|
+
limit?: number | undefined;
|
|
207
|
+
}>]>;
|
|
96
208
|
/**
|
|
97
209
|
* CustomAuthParams is the parameters for the custom authentication.
|
|
98
210
|
*/
|
|
@@ -230,21 +342,63 @@ declare const ToolExecuteResponseSchema: z.ZodObject<{
|
|
|
230
342
|
sessionInfo?: unknown;
|
|
231
343
|
}>;
|
|
232
344
|
type ToolExecuteResponse = z.infer<typeof ToolExecuteResponseSchema>;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
345
|
+
declare const ToolProxyParamsSchema: z.ZodObject<{
|
|
346
|
+
endpoint: z.ZodString;
|
|
347
|
+
method: z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH"]>;
|
|
348
|
+
body: z.ZodOptional<z.ZodUnknown>;
|
|
349
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
350
|
+
in: z.ZodEnum<["query", "header"]>;
|
|
351
|
+
name: z.ZodString;
|
|
352
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
353
|
+
}, "strip", z.ZodTypeAny, {
|
|
354
|
+
name: string;
|
|
355
|
+
value: string | number;
|
|
356
|
+
in: "query" | "header";
|
|
357
|
+
}, {
|
|
358
|
+
name: string;
|
|
359
|
+
value: string | number;
|
|
360
|
+
in: "query" | "header";
|
|
361
|
+
}>, "many">;
|
|
362
|
+
connectedAccountId: z.ZodOptional<z.ZodString>;
|
|
363
|
+
}, "strip", z.ZodTypeAny, {
|
|
364
|
+
parameters: {
|
|
365
|
+
name: string;
|
|
366
|
+
value: string | number;
|
|
367
|
+
in: "query" | "header";
|
|
368
|
+
}[];
|
|
369
|
+
endpoint: string;
|
|
370
|
+
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
371
|
+
body?: unknown;
|
|
372
|
+
connectedAccountId?: string | undefined;
|
|
373
|
+
}, {
|
|
374
|
+
parameters: {
|
|
375
|
+
name: string;
|
|
376
|
+
value: string | number;
|
|
377
|
+
in: "query" | "header";
|
|
378
|
+
}[];
|
|
379
|
+
endpoint: string;
|
|
380
|
+
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
381
|
+
body?: unknown;
|
|
382
|
+
connectedAccountId?: string | undefined;
|
|
236
383
|
}>;
|
|
237
|
-
type
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
interface CustomToolOptions<T extends CustomToolInputParameter = CustomToolInputParameter> {
|
|
241
|
-
slug: string;
|
|
384
|
+
type ToolProxyParams = z.infer<typeof ToolProxyParamsSchema>;
|
|
385
|
+
|
|
386
|
+
type BaseCustomToolOptions<T extends z.ZodType> = {
|
|
242
387
|
name: string;
|
|
243
|
-
toolkitSlug?: string | null;
|
|
244
388
|
description?: string;
|
|
389
|
+
slug: string;
|
|
245
390
|
inputParams: T;
|
|
246
|
-
|
|
247
|
-
|
|
391
|
+
};
|
|
392
|
+
type ToolkitBasedExecute<T extends z.ZodType> = {
|
|
393
|
+
execute: (input: z.infer<T>, authCredentials: Record<string, unknown>, executeToolRequest: (data: ToolProxyParams) => Promise<ToolExecuteResponse$1>) => Promise<ToolExecuteResponse$1>;
|
|
394
|
+
toolkitSlug: string;
|
|
395
|
+
};
|
|
396
|
+
type StandaloneExecute<T extends z.ZodType> = {
|
|
397
|
+
execute: (input: z.infer<T>) => Promise<ToolExecuteResponse$1>;
|
|
398
|
+
toolkitSlug?: never;
|
|
399
|
+
};
|
|
400
|
+
type CustomToolOptions<T extends z.ZodType> = BaseCustomToolOptions<T> & (ToolkitBasedExecute<T> | StandaloneExecute<T>);
|
|
401
|
+
type CustomToolInputParameter = z.ZodType;
|
|
248
402
|
interface ExecuteMetadata {
|
|
249
403
|
userId: string;
|
|
250
404
|
connectedAccountId?: string;
|
|
@@ -302,11 +456,12 @@ declare abstract class BaseProvider {
|
|
|
302
456
|
_setExecuteToolFn(executeToolFn: GlobalExecuteToolFn): void;
|
|
303
457
|
/**
|
|
304
458
|
* @public
|
|
305
|
-
*
|
|
306
|
-
* This function is used by
|
|
459
|
+
* Global function to execute a tool.
|
|
460
|
+
* This function is used by providerds to implement helper functions to execute tools.
|
|
307
461
|
* This is a 1:1 mapping of the `execute` method in the `Tools` class.
|
|
308
462
|
* @param {string} toolSlug - The slug of the tool to execute.
|
|
309
|
-
* @param {
|
|
463
|
+
* @param {ToolExecuteParams} body - The body of the tool execution.
|
|
464
|
+
* @param {ExecuteToolModifiers} modifers - The modifiers of the tool execution.
|
|
310
465
|
* @returns {Promise<string>} The result of the tool execution.
|
|
311
466
|
*/
|
|
312
467
|
executeTool(toolSlug: string, body: ToolExecuteParams, modifers?: ExecuteToolModifiers): Promise<ToolExecuteResponse>;
|
|
@@ -376,7 +531,7 @@ type BaseComposioProvider<TToolCollection, TTool> = BaseNonAgenticProvider<TTool
|
|
|
376
531
|
* @example
|
|
377
532
|
* ```typescript
|
|
378
533
|
* // Add authentication headers to all tool requests
|
|
379
|
-
* const
|
|
534
|
+
* const beforeExecute = (toolSlug, toolkitSlug, params) => {
|
|
380
535
|
* return {
|
|
381
536
|
* ...params,
|
|
382
537
|
* customAuthParams: {
|
|
@@ -390,7 +545,7 @@ type BaseComposioProvider<TToolCollection, TTool> = BaseNonAgenticProvider<TTool
|
|
|
390
545
|
* };
|
|
391
546
|
*
|
|
392
547
|
* // Transform input parameters for a specific tool
|
|
393
|
-
* const
|
|
548
|
+
* const beforeExecute = (toolSlug, toolkitSlug, params) => {
|
|
394
549
|
* if (toolSlug === 'GITHUB_SEARCH_REPOS') {
|
|
395
550
|
* // Convert simple query to structured query format
|
|
396
551
|
* return {
|
|
@@ -405,7 +560,7 @@ type BaseComposioProvider<TToolCollection, TTool> = BaseNonAgenticProvider<TTool
|
|
|
405
560
|
* };
|
|
406
561
|
* ```
|
|
407
562
|
*/
|
|
408
|
-
type
|
|
563
|
+
type beforeExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExecuteParams: ToolExecuteParams) => Promise<ToolExecuteParams>;
|
|
409
564
|
/**
|
|
410
565
|
* Modifier for altering the tool execution response after execution completes.
|
|
411
566
|
*
|
|
@@ -424,7 +579,7 @@ type BeforeToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExe
|
|
|
424
579
|
* @example
|
|
425
580
|
* ```typescript
|
|
426
581
|
* // Transform the response data format
|
|
427
|
-
* const
|
|
582
|
+
* const afterExecute = (toolSlug, toolkitSlug, response) => {
|
|
428
583
|
* if (toolSlug === 'GITHUB_LIST_REPOS' && response.successful) {
|
|
429
584
|
* // Transform the returned repos into a simpler format
|
|
430
585
|
* return {
|
|
@@ -442,7 +597,7 @@ type BeforeToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExe
|
|
|
442
597
|
* };
|
|
443
598
|
*
|
|
444
599
|
* // Add error handling with custom messages
|
|
445
|
-
* const
|
|
600
|
+
* const afterExecute = (toolSlug, toolkitSlug, response) => {
|
|
446
601
|
* if (!response.successful) {
|
|
447
602
|
* return {
|
|
448
603
|
* ...response,
|
|
@@ -456,7 +611,7 @@ type BeforeToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExe
|
|
|
456
611
|
* };
|
|
457
612
|
* ```
|
|
458
613
|
*/
|
|
459
|
-
type
|
|
614
|
+
type afterExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExecuteResponse: ToolExecuteResponse) => Promise<ToolExecuteResponse>;
|
|
460
615
|
/**
|
|
461
616
|
* Modifier for altering the tool schema before it's exposed to consumers.
|
|
462
617
|
*
|
|
@@ -475,7 +630,7 @@ type AfterToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExec
|
|
|
475
630
|
* @example
|
|
476
631
|
* ```typescript
|
|
477
632
|
* // Modify the input parameters for a specific tool
|
|
478
|
-
* const
|
|
633
|
+
* const modifySchema = (toolSlug, toolkitSlug, toolSchema) => {
|
|
479
634
|
* if (toolSlug === 'HACKERNEWS_GET_USER') {
|
|
480
635
|
* return {
|
|
481
636
|
* ...toolSchema,
|
|
@@ -493,7 +648,7 @@ type AfterToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExec
|
|
|
493
648
|
* };
|
|
494
649
|
*
|
|
495
650
|
* // Add custom descriptions to all tools in a toolkit
|
|
496
|
-
* const
|
|
651
|
+
* const modifySchema = (toolSlug, toolkitSlug, toolSchema) => {
|
|
497
652
|
* if (toolkitSlug === 'github') {
|
|
498
653
|
* return {
|
|
499
654
|
* ...toolSchema,
|
|
@@ -505,7 +660,7 @@ type AfterToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExec
|
|
|
505
660
|
* };
|
|
506
661
|
*
|
|
507
662
|
* // Simplify tool schemas for a specific consumer
|
|
508
|
-
* const
|
|
663
|
+
* const modifySchema = (toolSlug, toolkitSlug, toolSchema) => {
|
|
509
664
|
* // Remove advanced or complex parameters
|
|
510
665
|
* const { complexParam1, complexParam2, ...simpleInputParams } = toolSchema.inputParameters;
|
|
511
666
|
*
|
|
@@ -516,7 +671,7 @@ type AfterToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExec
|
|
|
516
671
|
* };
|
|
517
672
|
* ```
|
|
518
673
|
*/
|
|
519
|
-
type TransformToolSchemaModifier = (toolSlug: string, toolkitSlug: string, toolSchema: Tool) => Tool
|
|
674
|
+
type TransformToolSchemaModifier = (toolSlug: string, toolkitSlug: string, toolSchema: Tool) => Tool | Promise<Tool>;
|
|
520
675
|
/**
|
|
521
676
|
* Options for non-agentic tool configuration.
|
|
522
677
|
*
|
|
@@ -529,7 +684,7 @@ type TransformToolSchemaModifier = (toolSlug: string, toolkitSlug: string, toolS
|
|
|
529
684
|
* const tools = await composio.tools.get('default', {
|
|
530
685
|
* toolkits: ['github']
|
|
531
686
|
* }, {
|
|
532
|
-
*
|
|
687
|
+
* modifySchema: (toolSlug, toolkitSlug, schema) => {
|
|
533
688
|
* // Custom schema modifications
|
|
534
689
|
* return schema;
|
|
535
690
|
* }
|
|
@@ -541,7 +696,7 @@ type ToolOptions = {
|
|
|
541
696
|
* Function to transform tool schemas before they're exposed to consumers.
|
|
542
697
|
* This allows customizing input/output parameters, descriptions, and other metadata.
|
|
543
698
|
*/
|
|
544
|
-
|
|
699
|
+
modifySchema?: TransformToolSchemaModifier;
|
|
545
700
|
};
|
|
546
701
|
/**
|
|
547
702
|
* Options for configuring tool execution behavior.
|
|
@@ -557,11 +712,11 @@ type ToolOptions = {
|
|
|
557
712
|
* userId: 'default',
|
|
558
713
|
* arguments: { owner: 'composio' }
|
|
559
714
|
* }, {
|
|
560
|
-
*
|
|
715
|
+
* beforeExecute: (toolSlug, toolkitSlug, params) => {
|
|
561
716
|
* console.log(`Executing ${toolSlug} from ${toolkitSlug}`);
|
|
562
717
|
* return params;
|
|
563
718
|
* },
|
|
564
|
-
*
|
|
719
|
+
* afterExecute: (toolSlug, toolkitSlug, response) => {
|
|
565
720
|
* if (response.successful) {
|
|
566
721
|
* console.log(`Successfully executed ${toolSlug}`);
|
|
567
722
|
* }
|
|
@@ -575,12 +730,12 @@ type ExecuteToolModifiers = {
|
|
|
575
730
|
* Function to intercept and modify tool execution parameters before the tool is executed.
|
|
576
731
|
* This allows customizing the request based on tool-specific needs.
|
|
577
732
|
*/
|
|
578
|
-
|
|
733
|
+
beforeExecute?: beforeExecuteModifier;
|
|
579
734
|
/**
|
|
580
735
|
* Function to intercept and modify tool execution responses after the tool has executed.
|
|
581
736
|
* This allows transforming the response or implementing custom error handling.
|
|
582
737
|
*/
|
|
583
|
-
|
|
738
|
+
afterExecute?: afterExecuteModifier;
|
|
584
739
|
};
|
|
585
740
|
/**
|
|
586
741
|
* Options for agentic tool configuration.
|
|
@@ -593,7 +748,7 @@ type ExecuteToolModifiers = {
|
|
|
593
748
|
* ```typescript
|
|
594
749
|
* // Configure agentic tools with schema and execution modifications
|
|
595
750
|
* const agenticTools = await vercel.tools.get('default', 'GITHUB_GET_REPOS', {
|
|
596
|
-
*
|
|
751
|
+
* modifySchema: (toolSlug, toolkitSlug, schema) => {
|
|
597
752
|
* return {
|
|
598
753
|
* ...schema,
|
|
599
754
|
* description: `Enhanced ${toolSlug} for better context`
|
|
@@ -601,14 +756,14 @@ type ExecuteToolModifiers = {
|
|
|
601
756
|
* },
|
|
602
757
|
*
|
|
603
758
|
* // Intercept before execution
|
|
604
|
-
*
|
|
759
|
+
* beforeExecute: (toolSlug, toolkitSlug, params) => {
|
|
605
760
|
* // Add analytics tracking
|
|
606
761
|
* trackToolUsage(toolSlug);
|
|
607
762
|
* return params;
|
|
608
763
|
* },
|
|
609
764
|
*
|
|
610
765
|
* // Transform after execution
|
|
611
|
-
*
|
|
766
|
+
* afterExecute: (toolSlug, toolkitSlug, response) => {
|
|
612
767
|
* // Log results and handle errors
|
|
613
768
|
* if (!response.successful) {
|
|
614
769
|
* logToolError(toolSlug, response.error);
|
|
@@ -631,7 +786,7 @@ type AgenticToolOptions = ToolOptions & ExecuteToolModifiers;
|
|
|
631
786
|
* ```typescript
|
|
632
787
|
* // With standard provider (non-agentic)
|
|
633
788
|
* const tools = await composio.tools.get('default', 'GITHUB_GET_REPOS', {
|
|
634
|
-
*
|
|
789
|
+
* modifySchema: (toolSlug, toolkitSlug, schema) => schema
|
|
635
790
|
* });
|
|
636
791
|
*
|
|
637
792
|
* // With agentic provider (e.g., VercelProvider)
|
|
@@ -641,9 +796,9 @@ type AgenticToolOptions = ToolOptions & ExecuteToolModifiers;
|
|
|
641
796
|
* });
|
|
642
797
|
*
|
|
643
798
|
* const agenticTools = await vercel.tools.get('default', 'GITHUB_GET_REPOS', {
|
|
644
|
-
*
|
|
645
|
-
*
|
|
646
|
-
*
|
|
799
|
+
* modifySchema: (toolSlug, toolkitSlug, schema) => schema,
|
|
800
|
+
* beforeExecute: (toolSlug, toolkitSlug, params) => params,
|
|
801
|
+
* afterExecute: (toolSlug, toolkitSlug, response) => response
|
|
647
802
|
* });
|
|
648
803
|
* ```
|
|
649
804
|
*/
|
|
@@ -727,7 +882,7 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
|
|
|
727
882
|
* );
|
|
728
883
|
* ```
|
|
729
884
|
*/
|
|
730
|
-
getRawComposioTools(userId: string, query
|
|
885
|
+
getRawComposioTools(userId: string, query: ToolListParams, modifier?: TransformToolSchemaModifier): Promise<ToolList>;
|
|
731
886
|
/**
|
|
732
887
|
* Retrieves a tool by its Slug.
|
|
733
888
|
* This method is used to get the raw tools from the composio API.
|
|
@@ -781,7 +936,7 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
|
|
|
781
936
|
*
|
|
782
937
|
* // Get a tool with schema modifications
|
|
783
938
|
* const tool = await composio.tools.get('default', 'GITHUB_GET_REPOS', {
|
|
784
|
-
*
|
|
939
|
+
* modifySchema: (toolSlug, toolkitSlug, schema) => {
|
|
785
940
|
* // Customize the tool schema
|
|
786
941
|
* return {...schema, description: 'Custom description'};
|
|
787
942
|
* }
|
|
@@ -791,8 +946,10 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
|
|
|
791
946
|
get<T extends TProvider>(userId: string, slug: string, options?: ProviderOptions<TProvider>): Promise<ReturnType<T['wrapTools']>>;
|
|
792
947
|
/**
|
|
793
948
|
* @internal
|
|
949
|
+
* @description
|
|
794
950
|
* Creates a function that executes a tool.
|
|
795
|
-
* This function is used by agentic
|
|
951
|
+
* This function is used by agentic toolsets to execute the tool
|
|
952
|
+
*
|
|
796
953
|
* @param {string} userId - The user id
|
|
797
954
|
* @param {ExecuteToolModifiers} modifiers - The modifiers to be applied to the tool
|
|
798
955
|
* @returns {ExecuteToolFn} The execute tool function
|
|
@@ -844,11 +1001,11 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
|
|
|
844
1001
|
* userId: 'default',
|
|
845
1002
|
* arguments: { owner: 'composio', repo: 'sdk' }
|
|
846
1003
|
* }, {
|
|
847
|
-
*
|
|
1004
|
+
* beforeExecute: (toolSlug, toolkitSlug, params) => {
|
|
848
1005
|
* // Modify params before execution
|
|
849
1006
|
* return params;
|
|
850
1007
|
* },
|
|
851
|
-
*
|
|
1008
|
+
* afterExecute: (toolSlug, toolkitSlug, result) => {
|
|
852
1009
|
* // Transform result after execution
|
|
853
1010
|
* return result;
|
|
854
1011
|
* }
|
|
@@ -859,9 +1016,16 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
|
|
|
859
1016
|
/**
|
|
860
1017
|
* Fetches the list of all available tools in the Composio SDK.
|
|
861
1018
|
*
|
|
862
|
-
* This method is mostly used by the CLI
|
|
1019
|
+
* This method is mostly used by the CLI to get the list of tools.
|
|
863
1020
|
* No filtering is done on the tools, the list is cached in the backend, no further optimization is required.
|
|
864
|
-
* @returns {
|
|
1021
|
+
* @returns {Promise<ToolRetrieveEnumResponse>} The complete list of all available tools with their metadata
|
|
1022
|
+
*
|
|
1023
|
+
* @example
|
|
1024
|
+
* ```typescript
|
|
1025
|
+
* // Get all available tools as an enum
|
|
1026
|
+
* const toolsEnum = await composio.tools.getToolsEnum();
|
|
1027
|
+
* console.log(toolsEnum.items);
|
|
1028
|
+
* ```
|
|
865
1029
|
*/
|
|
866
1030
|
getToolsEnum(): Promise<ToolRetrieveEnumResponse>;
|
|
867
1031
|
/**
|
|
@@ -871,13 +1035,40 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
|
|
|
871
1035
|
*
|
|
872
1036
|
* @param {string} slug - The ID of the tool to find input for
|
|
873
1037
|
* @param {ToolGetInputParams} body - The parameters to be passed to the tool
|
|
874
|
-
* @returns
|
|
1038
|
+
* @returns {Promise<ToolGetInputResponse>} The input parameters schema for the specified tool
|
|
1039
|
+
*
|
|
1040
|
+
* @example
|
|
1041
|
+
* ```typescript
|
|
1042
|
+
* // Get input parameters for a specific tool
|
|
1043
|
+
* const inputParams = await composio.tools.getInput('GITHUB_CREATE_ISSUE', {
|
|
1044
|
+
* userId: 'default'
|
|
1045
|
+
* });
|
|
1046
|
+
* console.log(inputParams.schema);
|
|
1047
|
+
* ```
|
|
875
1048
|
*/
|
|
876
1049
|
getInput(slug: string, body: ToolGetInputParams): Promise<ToolGetInputResponse>;
|
|
877
1050
|
/**
|
|
878
|
-
* Proxies a custom request to a toolkit/integration
|
|
879
|
-
*
|
|
880
|
-
*
|
|
1051
|
+
* Proxies a custom request to a toolkit/integration.
|
|
1052
|
+
*
|
|
1053
|
+
* This method allows sending custom requests to a specific toolkit or integration
|
|
1054
|
+
* when you need more flexibility than the standard tool execution methods provide.
|
|
1055
|
+
*
|
|
1056
|
+
* @param {ToolProxyParams} body - The parameters for the proxy request including toolkit slug and custom data
|
|
1057
|
+
* @returns {Promise<ToolProxyResponse>} The response from the proxied request
|
|
1058
|
+
*
|
|
1059
|
+
* @example
|
|
1060
|
+
* ```typescript
|
|
1061
|
+
* // Send a custom request to a toolkit
|
|
1062
|
+
* const response = await composio.tools.proxyExecute({
|
|
1063
|
+
* toolkitSlug: 'github',
|
|
1064
|
+
* userId: 'default',
|
|
1065
|
+
* data: {
|
|
1066
|
+
* endpoint: '/repos/owner/repo/issues',
|
|
1067
|
+
* method: 'GET'
|
|
1068
|
+
* }
|
|
1069
|
+
* });
|
|
1070
|
+
* console.log(response.data);
|
|
1071
|
+
* ```
|
|
881
1072
|
*/
|
|
882
1073
|
proxyExecute(body: ToolProxyParams): Promise<ToolProxyResponse>;
|
|
883
1074
|
/**
|
|
@@ -891,31 +1082,41 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
|
|
|
891
1082
|
*
|
|
892
1083
|
* @example
|
|
893
1084
|
* ```typescript
|
|
894
|
-
*
|
|
1085
|
+
* // creating a custom tool with a toolkit
|
|
1086
|
+
* await composio.tools.createCustomTool({
|
|
895
1087
|
* name: 'My Custom Tool',
|
|
896
1088
|
* description: 'A custom tool that does something specific',
|
|
897
1089
|
* slug: 'MY_CUSTOM_TOOL',
|
|
898
|
-
*
|
|
899
|
-
*
|
|
900
|
-
*
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
*
|
|
905
|
-
* outputParameters: {
|
|
906
|
-
* result: {
|
|
907
|
-
* type: 'string',
|
|
908
|
-
* description: 'The result of the operation'
|
|
909
|
-
* }
|
|
910
|
-
* },
|
|
911
|
-
* handler: async (params, context) => {
|
|
1090
|
+
* userId: 'default',
|
|
1091
|
+
* connectedAccountId: '123',
|
|
1092
|
+
* toolkitSlug: 'github',
|
|
1093
|
+
* inputParameters: z.object({
|
|
1094
|
+
* param1: z.string().describe('First parameter'),
|
|
1095
|
+
* }),
|
|
1096
|
+
* execute: async (input, authCredentials, executeToolRequest) => {
|
|
912
1097
|
* // Custom logic here
|
|
913
1098
|
* return { data: { result: 'Success!' } };
|
|
914
1099
|
* }
|
|
915
1100
|
* });
|
|
916
1101
|
* ```
|
|
1102
|
+
*
|
|
1103
|
+
* @example
|
|
1104
|
+
* ```typescript
|
|
1105
|
+
* // creating a custom tool without a toolkit
|
|
1106
|
+
* await composio.tools.createCustomTool({
|
|
1107
|
+
* name: 'My Custom Tool',
|
|
1108
|
+
* description: 'A custom tool that does something specific',
|
|
1109
|
+
* slug: 'MY_CUSTOM_TOOL',
|
|
1110
|
+
* inputParameters: z.object({
|
|
1111
|
+
* param1: z.string().describe('First parameter'),
|
|
1112
|
+
* }),
|
|
1113
|
+
* execute: async (input) => {
|
|
1114
|
+
* // Custom logic here
|
|
1115
|
+
* return { data: { result: 'Success!' } };
|
|
1116
|
+
* }
|
|
1117
|
+
* });
|
|
917
1118
|
*/
|
|
918
|
-
createCustomTool(body: CustomToolOptions): Promise<Tool>;
|
|
1119
|
+
createCustomTool<T extends CustomToolInputParameter>(body: CustomToolOptions<T>): Promise<Tool>;
|
|
919
1120
|
}
|
|
920
1121
|
|
|
921
1122
|
declare const ToolkitsListParamsSchema: z.ZodObject<{
|
|
@@ -960,27 +1161,27 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
960
1161
|
}, "strip", z.ZodTypeAny, {
|
|
961
1162
|
logo?: string | undefined;
|
|
962
1163
|
description?: string | undefined;
|
|
1164
|
+
createdAt?: string | undefined;
|
|
1165
|
+
updatedAt?: string | undefined;
|
|
963
1166
|
categories?: {
|
|
964
1167
|
slug: string;
|
|
965
1168
|
name: string;
|
|
966
1169
|
}[] | undefined;
|
|
967
1170
|
appUrl?: string | undefined;
|
|
968
|
-
createdAt?: string | undefined;
|
|
969
1171
|
toolsCount?: number | undefined;
|
|
970
1172
|
triggersCount?: number | undefined;
|
|
971
|
-
updatedAt?: string | undefined;
|
|
972
1173
|
}, {
|
|
973
1174
|
logo?: string | undefined;
|
|
974
1175
|
description?: string | undefined;
|
|
1176
|
+
createdAt?: string | undefined;
|
|
1177
|
+
updatedAt?: string | undefined;
|
|
975
1178
|
categories?: {
|
|
976
1179
|
slug: string;
|
|
977
1180
|
name: string;
|
|
978
1181
|
}[] | undefined;
|
|
979
1182
|
appUrl?: string | undefined;
|
|
980
|
-
createdAt?: string | undefined;
|
|
981
1183
|
toolsCount?: number | undefined;
|
|
982
1184
|
triggersCount?: number | undefined;
|
|
983
|
-
updatedAt?: string | undefined;
|
|
984
1185
|
}>;
|
|
985
1186
|
isLocalToolkit: z.ZodBoolean;
|
|
986
1187
|
authSchemes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -992,15 +1193,15 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
992
1193
|
meta: {
|
|
993
1194
|
logo?: string | undefined;
|
|
994
1195
|
description?: string | undefined;
|
|
1196
|
+
createdAt?: string | undefined;
|
|
1197
|
+
updatedAt?: string | undefined;
|
|
995
1198
|
categories?: {
|
|
996
1199
|
slug: string;
|
|
997
1200
|
name: string;
|
|
998
1201
|
}[] | undefined;
|
|
999
1202
|
appUrl?: string | undefined;
|
|
1000
|
-
createdAt?: string | undefined;
|
|
1001
1203
|
toolsCount?: number | undefined;
|
|
1002
1204
|
triggersCount?: number | undefined;
|
|
1003
|
-
updatedAt?: string | undefined;
|
|
1004
1205
|
};
|
|
1005
1206
|
isLocalToolkit: boolean;
|
|
1006
1207
|
authSchemes?: string[] | undefined;
|
|
@@ -1012,15 +1213,15 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
1012
1213
|
meta: {
|
|
1013
1214
|
logo?: string | undefined;
|
|
1014
1215
|
description?: string | undefined;
|
|
1216
|
+
createdAt?: string | undefined;
|
|
1217
|
+
updatedAt?: string | undefined;
|
|
1015
1218
|
categories?: {
|
|
1016
1219
|
slug: string;
|
|
1017
1220
|
name: string;
|
|
1018
1221
|
}[] | undefined;
|
|
1019
1222
|
appUrl?: string | undefined;
|
|
1020
|
-
createdAt?: string | undefined;
|
|
1021
1223
|
toolsCount?: number | undefined;
|
|
1022
1224
|
triggersCount?: number | undefined;
|
|
1023
|
-
updatedAt?: string | undefined;
|
|
1024
1225
|
};
|
|
1025
1226
|
isLocalToolkit: boolean;
|
|
1026
1227
|
authSchemes?: string[] | undefined;
|
|
@@ -1036,15 +1237,15 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
1036
1237
|
meta: {
|
|
1037
1238
|
logo?: string | undefined;
|
|
1038
1239
|
description?: string | undefined;
|
|
1240
|
+
createdAt?: string | undefined;
|
|
1241
|
+
updatedAt?: string | undefined;
|
|
1039
1242
|
categories?: {
|
|
1040
1243
|
slug: string;
|
|
1041
1244
|
name: string;
|
|
1042
1245
|
}[] | undefined;
|
|
1043
1246
|
appUrl?: string | undefined;
|
|
1044
|
-
createdAt?: string | undefined;
|
|
1045
1247
|
toolsCount?: number | undefined;
|
|
1046
1248
|
triggersCount?: number | undefined;
|
|
1047
|
-
updatedAt?: string | undefined;
|
|
1048
1249
|
};
|
|
1049
1250
|
isLocalToolkit: boolean;
|
|
1050
1251
|
authSchemes?: string[] | undefined;
|
|
@@ -1060,15 +1261,15 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
1060
1261
|
meta: {
|
|
1061
1262
|
logo?: string | undefined;
|
|
1062
1263
|
description?: string | undefined;
|
|
1264
|
+
createdAt?: string | undefined;
|
|
1265
|
+
updatedAt?: string | undefined;
|
|
1063
1266
|
categories?: {
|
|
1064
1267
|
slug: string;
|
|
1065
1268
|
name: string;
|
|
1066
1269
|
}[] | undefined;
|
|
1067
1270
|
appUrl?: string | undefined;
|
|
1068
|
-
createdAt?: string | undefined;
|
|
1069
1271
|
toolsCount?: number | undefined;
|
|
1070
1272
|
triggersCount?: number | undefined;
|
|
1071
|
-
updatedAt?: string | undefined;
|
|
1072
1273
|
};
|
|
1073
1274
|
isLocalToolkit: boolean;
|
|
1074
1275
|
authSchemes?: string[] | undefined;
|
|
@@ -1103,27 +1304,27 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
|
1103
1304
|
}, "strip", z.ZodTypeAny, {
|
|
1104
1305
|
logo?: string | undefined;
|
|
1105
1306
|
description?: string | undefined;
|
|
1307
|
+
createdAt?: string | undefined;
|
|
1308
|
+
updatedAt?: string | undefined;
|
|
1106
1309
|
categories?: {
|
|
1107
1310
|
slug: string;
|
|
1108
1311
|
name: string;
|
|
1109
1312
|
}[] | undefined;
|
|
1110
1313
|
appUrl?: string | undefined;
|
|
1111
|
-
createdAt?: string | undefined;
|
|
1112
1314
|
toolsCount?: number | undefined;
|
|
1113
1315
|
triggersCount?: number | undefined;
|
|
1114
|
-
updatedAt?: string | undefined;
|
|
1115
1316
|
}, {
|
|
1116
1317
|
logo?: string | undefined;
|
|
1117
1318
|
description?: string | undefined;
|
|
1319
|
+
createdAt?: string | undefined;
|
|
1320
|
+
updatedAt?: string | undefined;
|
|
1118
1321
|
categories?: {
|
|
1119
1322
|
slug: string;
|
|
1120
1323
|
name: string;
|
|
1121
1324
|
}[] | undefined;
|
|
1122
1325
|
appUrl?: string | undefined;
|
|
1123
|
-
createdAt?: string | undefined;
|
|
1124
1326
|
toolsCount?: number | undefined;
|
|
1125
1327
|
triggersCount?: number | undefined;
|
|
1126
|
-
updatedAt?: string | undefined;
|
|
1127
1328
|
}>;
|
|
1128
1329
|
isLocalToolkit: z.ZodBoolean;
|
|
1129
1330
|
composioManagedAuthSchemes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -1396,15 +1597,15 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
|
1396
1597
|
meta: {
|
|
1397
1598
|
logo?: string | undefined;
|
|
1398
1599
|
description?: string | undefined;
|
|
1600
|
+
createdAt?: string | undefined;
|
|
1601
|
+
updatedAt?: string | undefined;
|
|
1399
1602
|
categories?: {
|
|
1400
1603
|
slug: string;
|
|
1401
1604
|
name: string;
|
|
1402
1605
|
}[] | undefined;
|
|
1403
1606
|
appUrl?: string | undefined;
|
|
1404
|
-
createdAt?: string | undefined;
|
|
1405
1607
|
toolsCount?: number | undefined;
|
|
1406
1608
|
triggersCount?: number | undefined;
|
|
1407
|
-
updatedAt?: string | undefined;
|
|
1408
1609
|
};
|
|
1409
1610
|
isLocalToolkit: boolean;
|
|
1410
1611
|
composioManagedAuthSchemes?: string[] | undefined;
|
|
@@ -1451,15 +1652,15 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
|
1451
1652
|
meta: {
|
|
1452
1653
|
logo?: string | undefined;
|
|
1453
1654
|
description?: string | undefined;
|
|
1655
|
+
createdAt?: string | undefined;
|
|
1656
|
+
updatedAt?: string | undefined;
|
|
1454
1657
|
categories?: {
|
|
1455
1658
|
slug: string;
|
|
1456
1659
|
name: string;
|
|
1457
1660
|
}[] | undefined;
|
|
1458
1661
|
appUrl?: string | undefined;
|
|
1459
|
-
createdAt?: string | undefined;
|
|
1460
1662
|
toolsCount?: number | undefined;
|
|
1461
1663
|
triggersCount?: number | undefined;
|
|
1462
|
-
updatedAt?: string | undefined;
|
|
1463
1664
|
};
|
|
1464
1665
|
isLocalToolkit: boolean;
|
|
1465
1666
|
composioManagedAuthSchemes?: string[] | undefined;
|
|
@@ -1536,24 +1737,23 @@ type ToolkitRetrieveCategoriesResponse = z.infer<typeof ToolkitRetrieveCategorie
|
|
|
1536
1737
|
* Connected Account create parameters
|
|
1537
1738
|
*/
|
|
1538
1739
|
declare const ConnectedAccountStatuses: {
|
|
1539
|
-
readonly
|
|
1540
|
-
readonly INACTIVE: "INACTIVE";
|
|
1541
|
-
readonly DELETED: "DELETED";
|
|
1740
|
+
readonly INITIALIZING: "INITIALIZING";
|
|
1542
1741
|
readonly INITIATED: "INITIATED";
|
|
1543
|
-
readonly
|
|
1742
|
+
readonly ACTIVE: "ACTIVE";
|
|
1544
1743
|
readonly FAILED: "FAILED";
|
|
1744
|
+
readonly EXPIRED: "EXPIRED";
|
|
1545
1745
|
};
|
|
1546
1746
|
type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
|
|
1547
1747
|
type CreateConnectedAccountOptions = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1548
1748
|
declare const CreateConnectedAccountOptionsSchema: z.ZodObject<{
|
|
1549
|
-
|
|
1749
|
+
callbackUrl: z.ZodOptional<z.ZodString>;
|
|
1550
1750
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1551
1751
|
}, "strip", z.ZodTypeAny, {
|
|
1552
1752
|
data?: Record<string, unknown> | undefined;
|
|
1553
|
-
|
|
1753
|
+
callbackUrl?: string | undefined;
|
|
1554
1754
|
}, {
|
|
1555
1755
|
data?: Record<string, unknown> | undefined;
|
|
1556
|
-
|
|
1756
|
+
callbackUrl?: string | undefined;
|
|
1557
1757
|
}>;
|
|
1558
1758
|
type CreateConnectedAccountOptionsSchema = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1559
1759
|
declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
@@ -1565,19 +1765,19 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
1565
1765
|
isDisabled: z.ZodBoolean;
|
|
1566
1766
|
}, "strip", z.ZodTypeAny, {
|
|
1567
1767
|
id: string;
|
|
1568
|
-
authScheme: "
|
|
1768
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1569
1769
|
isComposioManaged: boolean;
|
|
1570
1770
|
isDisabled: boolean;
|
|
1571
1771
|
}, {
|
|
1572
1772
|
id: string;
|
|
1573
|
-
authScheme: "
|
|
1773
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1574
1774
|
isComposioManaged: boolean;
|
|
1575
1775
|
isDisabled: boolean;
|
|
1576
1776
|
}>;
|
|
1577
1777
|
userId: z.ZodString;
|
|
1578
1778
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1579
1779
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1580
|
-
status: z.ZodEnum<["
|
|
1780
|
+
status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED"]>;
|
|
1581
1781
|
statusReason: z.ZodNullable<z.ZodString>;
|
|
1582
1782
|
toolkit: z.ZodObject<{
|
|
1583
1783
|
slug: z.ZodString;
|
|
@@ -1591,43 +1791,43 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
1591
1791
|
createdAt: z.ZodString;
|
|
1592
1792
|
updatedAt: z.ZodString;
|
|
1593
1793
|
}, "strip", z.ZodTypeAny, {
|
|
1594
|
-
status: "
|
|
1794
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1595
1795
|
toolkit: {
|
|
1596
1796
|
slug: string;
|
|
1597
1797
|
};
|
|
1598
1798
|
userId: string;
|
|
1599
1799
|
data: Record<string, unknown>;
|
|
1600
|
-
createdAt: string;
|
|
1601
|
-
updatedAt: string;
|
|
1602
|
-
id: string;
|
|
1603
1800
|
authConfig: {
|
|
1604
1801
|
id: string;
|
|
1605
|
-
authScheme: "
|
|
1802
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1606
1803
|
isComposioManaged: boolean;
|
|
1607
1804
|
isDisabled: boolean;
|
|
1608
1805
|
};
|
|
1806
|
+
id: string;
|
|
1609
1807
|
isDisabled: boolean;
|
|
1610
1808
|
statusReason: string | null;
|
|
1809
|
+
createdAt: string;
|
|
1810
|
+
updatedAt: string;
|
|
1611
1811
|
params?: Record<string, unknown> | undefined;
|
|
1612
1812
|
testRequestEndpoint?: string | undefined;
|
|
1613
1813
|
}, {
|
|
1614
|
-
status: "
|
|
1814
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1615
1815
|
toolkit: {
|
|
1616
1816
|
slug: string;
|
|
1617
1817
|
};
|
|
1618
1818
|
userId: string;
|
|
1619
1819
|
data: Record<string, unknown>;
|
|
1620
|
-
createdAt: string;
|
|
1621
|
-
updatedAt: string;
|
|
1622
|
-
id: string;
|
|
1623
1820
|
authConfig: {
|
|
1624
1821
|
id: string;
|
|
1625
|
-
authScheme: "
|
|
1822
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1626
1823
|
isComposioManaged: boolean;
|
|
1627
1824
|
isDisabled: boolean;
|
|
1628
1825
|
};
|
|
1826
|
+
id: string;
|
|
1629
1827
|
isDisabled: boolean;
|
|
1630
1828
|
statusReason: string | null;
|
|
1829
|
+
createdAt: string;
|
|
1830
|
+
updatedAt: string;
|
|
1631
1831
|
params?: Record<string, unknown> | undefined;
|
|
1632
1832
|
testRequestEndpoint?: string | undefined;
|
|
1633
1833
|
}>;
|
|
@@ -1638,7 +1838,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
|
|
|
1638
1838
|
labels: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
1639
1839
|
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1640
1840
|
orderBy: z.ZodOptional<z.ZodEnum<["created_at", "updated_at"]>>;
|
|
1641
|
-
statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["
|
|
1841
|
+
statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED"]>, "many">>>;
|
|
1642
1842
|
toolkitSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
1643
1843
|
userIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
1644
1844
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1647,7 +1847,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
|
|
|
1647
1847
|
authConfigIds?: string[] | null | undefined;
|
|
1648
1848
|
labels?: string[] | null | undefined;
|
|
1649
1849
|
orderBy?: "created_at" | "updated_at" | undefined;
|
|
1650
|
-
statuses?: ("
|
|
1850
|
+
statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED")[] | null | undefined;
|
|
1651
1851
|
toolkitSlugs?: string[] | null | undefined;
|
|
1652
1852
|
userIds?: string[] | null | undefined;
|
|
1653
1853
|
}, {
|
|
@@ -1656,7 +1856,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
|
|
|
1656
1856
|
authConfigIds?: string[] | null | undefined;
|
|
1657
1857
|
labels?: string[] | null | undefined;
|
|
1658
1858
|
orderBy?: "created_at" | "updated_at" | undefined;
|
|
1659
|
-
statuses?: ("
|
|
1859
|
+
statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED")[] | null | undefined;
|
|
1660
1860
|
toolkitSlugs?: string[] | null | undefined;
|
|
1661
1861
|
userIds?: string[] | null | undefined;
|
|
1662
1862
|
}>;
|
|
@@ -1671,19 +1871,19 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
1671
1871
|
isDisabled: z.ZodBoolean;
|
|
1672
1872
|
}, "strip", z.ZodTypeAny, {
|
|
1673
1873
|
id: string;
|
|
1674
|
-
authScheme: "
|
|
1874
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1675
1875
|
isComposioManaged: boolean;
|
|
1676
1876
|
isDisabled: boolean;
|
|
1677
1877
|
}, {
|
|
1678
1878
|
id: string;
|
|
1679
|
-
authScheme: "
|
|
1879
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1680
1880
|
isComposioManaged: boolean;
|
|
1681
1881
|
isDisabled: boolean;
|
|
1682
1882
|
}>;
|
|
1683
1883
|
userId: z.ZodString;
|
|
1684
1884
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1685
1885
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1686
|
-
status: z.ZodEnum<["
|
|
1886
|
+
status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED"]>;
|
|
1687
1887
|
statusReason: z.ZodNullable<z.ZodString>;
|
|
1688
1888
|
toolkit: z.ZodObject<{
|
|
1689
1889
|
slug: z.ZodString;
|
|
@@ -1697,43 +1897,43 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
1697
1897
|
createdAt: z.ZodString;
|
|
1698
1898
|
updatedAt: z.ZodString;
|
|
1699
1899
|
}, "strip", z.ZodTypeAny, {
|
|
1700
|
-
status: "
|
|
1900
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1701
1901
|
toolkit: {
|
|
1702
1902
|
slug: string;
|
|
1703
1903
|
};
|
|
1704
1904
|
userId: string;
|
|
1705
1905
|
data: Record<string, unknown>;
|
|
1706
|
-
createdAt: string;
|
|
1707
|
-
updatedAt: string;
|
|
1708
|
-
id: string;
|
|
1709
1906
|
authConfig: {
|
|
1710
1907
|
id: string;
|
|
1711
|
-
authScheme: "
|
|
1908
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1712
1909
|
isComposioManaged: boolean;
|
|
1713
1910
|
isDisabled: boolean;
|
|
1714
1911
|
};
|
|
1912
|
+
id: string;
|
|
1715
1913
|
isDisabled: boolean;
|
|
1716
1914
|
statusReason: string | null;
|
|
1915
|
+
createdAt: string;
|
|
1916
|
+
updatedAt: string;
|
|
1717
1917
|
params?: Record<string, unknown> | undefined;
|
|
1718
1918
|
testRequestEndpoint?: string | undefined;
|
|
1719
1919
|
}, {
|
|
1720
|
-
status: "
|
|
1920
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1721
1921
|
toolkit: {
|
|
1722
1922
|
slug: string;
|
|
1723
1923
|
};
|
|
1724
1924
|
userId: string;
|
|
1725
1925
|
data: Record<string, unknown>;
|
|
1726
|
-
createdAt: string;
|
|
1727
|
-
updatedAt: string;
|
|
1728
|
-
id: string;
|
|
1729
1926
|
authConfig: {
|
|
1730
1927
|
id: string;
|
|
1731
|
-
authScheme: "
|
|
1928
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1732
1929
|
isComposioManaged: boolean;
|
|
1733
1930
|
isDisabled: boolean;
|
|
1734
1931
|
};
|
|
1932
|
+
id: string;
|
|
1735
1933
|
isDisabled: boolean;
|
|
1736
1934
|
statusReason: string | null;
|
|
1935
|
+
createdAt: string;
|
|
1936
|
+
updatedAt: string;
|
|
1737
1937
|
params?: Record<string, unknown> | undefined;
|
|
1738
1938
|
testRequestEndpoint?: string | undefined;
|
|
1739
1939
|
}>, "many">;
|
|
@@ -1741,23 +1941,23 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
1741
1941
|
totalPages: z.ZodNumber;
|
|
1742
1942
|
}, "strip", z.ZodTypeAny, {
|
|
1743
1943
|
items: {
|
|
1744
|
-
status: "
|
|
1944
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1745
1945
|
toolkit: {
|
|
1746
1946
|
slug: string;
|
|
1747
1947
|
};
|
|
1748
1948
|
userId: string;
|
|
1749
1949
|
data: Record<string, unknown>;
|
|
1750
|
-
createdAt: string;
|
|
1751
|
-
updatedAt: string;
|
|
1752
|
-
id: string;
|
|
1753
1950
|
authConfig: {
|
|
1754
1951
|
id: string;
|
|
1755
|
-
authScheme: "
|
|
1952
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1756
1953
|
isComposioManaged: boolean;
|
|
1757
1954
|
isDisabled: boolean;
|
|
1758
1955
|
};
|
|
1956
|
+
id: string;
|
|
1759
1957
|
isDisabled: boolean;
|
|
1760
1958
|
statusReason: string | null;
|
|
1959
|
+
createdAt: string;
|
|
1960
|
+
updatedAt: string;
|
|
1761
1961
|
params?: Record<string, unknown> | undefined;
|
|
1762
1962
|
testRequestEndpoint?: string | undefined;
|
|
1763
1963
|
}[];
|
|
@@ -1765,23 +1965,23 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
1765
1965
|
totalPages: number;
|
|
1766
1966
|
}, {
|
|
1767
1967
|
items: {
|
|
1768
|
-
status: "
|
|
1968
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1769
1969
|
toolkit: {
|
|
1770
1970
|
slug: string;
|
|
1771
1971
|
};
|
|
1772
1972
|
userId: string;
|
|
1773
1973
|
data: Record<string, unknown>;
|
|
1774
|
-
createdAt: string;
|
|
1775
|
-
updatedAt: string;
|
|
1776
|
-
id: string;
|
|
1777
1974
|
authConfig: {
|
|
1778
1975
|
id: string;
|
|
1779
|
-
authScheme: "
|
|
1976
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1780
1977
|
isComposioManaged: boolean;
|
|
1781
1978
|
isDisabled: boolean;
|
|
1782
1979
|
};
|
|
1980
|
+
id: string;
|
|
1783
1981
|
isDisabled: boolean;
|
|
1784
1982
|
statusReason: string | null;
|
|
1983
|
+
createdAt: string;
|
|
1984
|
+
updatedAt: string;
|
|
1785
1985
|
params?: Record<string, unknown> | undefined;
|
|
1786
1986
|
testRequestEndpoint?: string | undefined;
|
|
1787
1987
|
}[];
|
|
@@ -1803,7 +2003,7 @@ declare class ConnectionRequest {
|
|
|
1803
2003
|
id: string;
|
|
1804
2004
|
status?: ConnectedAccountStatus;
|
|
1805
2005
|
redirectUrl?: string | null;
|
|
1806
|
-
constructor(client: ComposioClient, connectedAccountId: string,
|
|
2006
|
+
constructor(client: ComposioClient, connectedAccountId: string, status?: ConnectedAccountStatus, redirectUrl?: string | null);
|
|
1807
2007
|
/**
|
|
1808
2008
|
* Transforms the raw connected account response from the Composio API to the SDK format.
|
|
1809
2009
|
*
|
|
@@ -1844,30 +2044,16 @@ declare class ConnectionRequest {
|
|
|
1844
2044
|
* ```
|
|
1845
2045
|
*/
|
|
1846
2046
|
waitForConnection(timeout?: number): Promise<ConnectedAccountRetrieveResponse>;
|
|
2047
|
+
/**
|
|
2048
|
+
* Returns a JSON-serializable representation of the connection request
|
|
2049
|
+
* Excludes the private client property to avoid cyclic reference issues
|
|
2050
|
+
*/
|
|
2051
|
+
toJSON(): Record<string, unknown>;
|
|
2052
|
+
/**
|
|
2053
|
+
* Returns a string representation of the connection request
|
|
2054
|
+
*/
|
|
2055
|
+
toString(): string;
|
|
1847
2056
|
}
|
|
1848
|
-
declare const connectionRequest: (client: ComposioClient) => {
|
|
1849
|
-
waitForConnection: (connectedAccountId: string, timeout?: number) => Promise<{
|
|
1850
|
-
status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
|
|
1851
|
-
toolkit: {
|
|
1852
|
-
slug: string;
|
|
1853
|
-
};
|
|
1854
|
-
userId: string;
|
|
1855
|
-
data: Record<string, unknown>;
|
|
1856
|
-
createdAt: string;
|
|
1857
|
-
updatedAt: string;
|
|
1858
|
-
id: string;
|
|
1859
|
-
authConfig: {
|
|
1860
|
-
id: string;
|
|
1861
|
-
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1862
|
-
isComposioManaged: boolean;
|
|
1863
|
-
isDisabled: boolean;
|
|
1864
|
-
};
|
|
1865
|
-
isDisabled: boolean;
|
|
1866
|
-
statusReason: string | null;
|
|
1867
|
-
params?: Record<string, unknown> | undefined;
|
|
1868
|
-
testRequestEndpoint?: string | undefined;
|
|
1869
|
-
}>;
|
|
1870
|
-
};
|
|
1871
2057
|
|
|
1872
2058
|
/**
|
|
1873
2059
|
* Toolkits class
|
|
@@ -1890,6 +2076,20 @@ declare class Toolkits {
|
|
|
1890
2076
|
* @private
|
|
1891
2077
|
*/
|
|
1892
2078
|
private getToolkits;
|
|
2079
|
+
/**
|
|
2080
|
+
* Retrieves a specific toolkit by its slug identifier.
|
|
2081
|
+
*
|
|
2082
|
+
* This method fetches a single toolkit from the Composio API and transforms
|
|
2083
|
+
* the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
|
|
2084
|
+
*
|
|
2085
|
+
* @param {string} slug - The unique slug identifier of the toolkit to retrieve
|
|
2086
|
+
* @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
|
|
2087
|
+
* @throws {ValidationError} If the response cannot be properly parsed
|
|
2088
|
+
* @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
|
|
2089
|
+
*
|
|
2090
|
+
* @private
|
|
2091
|
+
*/
|
|
2092
|
+
private getToolkitBySlug;
|
|
1893
2093
|
/**
|
|
1894
2094
|
* Retrieves a specific toolkit by its slug identifier.
|
|
1895
2095
|
*
|
|
@@ -1929,20 +2129,6 @@ declare class Toolkits {
|
|
|
1929
2129
|
* ```
|
|
1930
2130
|
*/
|
|
1931
2131
|
get(query: ToolkitListParams): Promise<ToolKitListResponse>;
|
|
1932
|
-
/**
|
|
1933
|
-
* Retrieves a specific toolkit by its slug identifier.
|
|
1934
|
-
*
|
|
1935
|
-
* This method fetches a single toolkit from the Composio API and transforms
|
|
1936
|
-
* the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
|
|
1937
|
-
*
|
|
1938
|
-
* @param {string} slug - The unique slug identifier of the toolkit to retrieve
|
|
1939
|
-
* @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
|
|
1940
|
-
* @throws {ValidationError} If the response cannot be properly parsed
|
|
1941
|
-
* @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
|
|
1942
|
-
*
|
|
1943
|
-
* @private
|
|
1944
|
-
*/
|
|
1945
|
-
private getToolkitBySlug;
|
|
1946
2132
|
/**
|
|
1947
2133
|
* Retrieves all toolkit categories available in the Composio SDK.
|
|
1948
2134
|
*
|
|
@@ -1974,53 +2160,275 @@ declare class Toolkits {
|
|
|
1974
2160
|
authorize(userId: string, toolkitSlug: string): Promise<ConnectionRequest>;
|
|
1975
2161
|
}
|
|
1976
2162
|
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
appName: z.ZodOptional<z.ZodString>;
|
|
2163
|
+
declare const TriggerSubscribeParamSchema: z.ZodObject<{
|
|
2164
|
+
toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1980
2165
|
triggerId: z.ZodOptional<z.ZodString>;
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
2166
|
+
connectedAccountId: z.ZodOptional<z.ZodString>;
|
|
2167
|
+
authConfigId: z.ZodOptional<z.ZodString>;
|
|
2168
|
+
triggerSlug: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1984
2169
|
triggerData: z.ZodOptional<z.ZodString>;
|
|
1985
|
-
|
|
2170
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
1986
2171
|
}, "strip", z.ZodTypeAny, {
|
|
1987
|
-
|
|
2172
|
+
toolkits?: string[] | undefined;
|
|
2173
|
+
connectedAccountId?: string | undefined;
|
|
2174
|
+
userId?: string | undefined;
|
|
1988
2175
|
triggerId?: string | undefined;
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
triggerName?: string | undefined;
|
|
2176
|
+
authConfigId?: string | undefined;
|
|
2177
|
+
triggerSlug?: string[] | undefined;
|
|
1992
2178
|
triggerData?: string | undefined;
|
|
1993
|
-
entityId?: string | undefined;
|
|
1994
2179
|
}, {
|
|
1995
|
-
|
|
2180
|
+
toolkits?: string[] | undefined;
|
|
2181
|
+
connectedAccountId?: string | undefined;
|
|
2182
|
+
userId?: string | undefined;
|
|
1996
2183
|
triggerId?: string | undefined;
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
triggerName?: string | undefined;
|
|
2184
|
+
authConfigId?: string | undefined;
|
|
2185
|
+
triggerSlug?: string[] | undefined;
|
|
2000
2186
|
triggerData?: string | undefined;
|
|
2001
|
-
entityId?: string | undefined;
|
|
2002
2187
|
}>;
|
|
2003
|
-
type TriggerSubscribeParams = z.infer<typeof
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2188
|
+
type TriggerSubscribeParams = z.infer<typeof TriggerSubscribeParamSchema>;
|
|
2189
|
+
declare const TriggerInstanceListActiveParamsSchema: z.ZodObject<{
|
|
2190
|
+
authConfigIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
2191
|
+
connectedAccountIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
2192
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2193
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
2194
|
+
showDisabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
2195
|
+
triggerIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
2196
|
+
triggerNames: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
2197
|
+
}, "strip", z.ZodTypeAny, {
|
|
2198
|
+
limit?: number | undefined;
|
|
2199
|
+
authConfigIds?: string[] | null | undefined;
|
|
2200
|
+
connectedAccountIds?: string[] | null | undefined;
|
|
2201
|
+
page?: number | undefined;
|
|
2202
|
+
showDisabled?: boolean | null | undefined;
|
|
2203
|
+
triggerIds?: string[] | null | undefined;
|
|
2204
|
+
triggerNames?: string[] | null | undefined;
|
|
2205
|
+
}, {
|
|
2206
|
+
limit?: number | undefined;
|
|
2207
|
+
authConfigIds?: string[] | null | undefined;
|
|
2208
|
+
connectedAccountIds?: string[] | null | undefined;
|
|
2209
|
+
page?: number | undefined;
|
|
2210
|
+
showDisabled?: boolean | null | undefined;
|
|
2211
|
+
triggerIds?: string[] | null | undefined;
|
|
2212
|
+
triggerNames?: string[] | null | undefined;
|
|
2213
|
+
}>;
|
|
2214
|
+
type TriggerInstanceListActiveParams = z.infer<typeof TriggerInstanceListActiveParamsSchema>;
|
|
2215
|
+
declare const TriggerInstanceListActiveResponseSchema: z.ZodObject<{
|
|
2216
|
+
items: z.ZodArray<z.ZodObject<{
|
|
2217
|
+
id: z.ZodString;
|
|
2218
|
+
connectedAccountId: z.ZodString;
|
|
2219
|
+
disabledAt: z.ZodNullable<z.ZodString>;
|
|
2220
|
+
state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2221
|
+
triggerConfig: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2222
|
+
triggerName: z.ZodString;
|
|
2223
|
+
updatedAt: z.ZodString;
|
|
2224
|
+
triggerData: z.ZodOptional<z.ZodString>;
|
|
2225
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
2226
|
+
}, "strip", z.ZodTypeAny, {
|
|
2227
|
+
connectedAccountId: string;
|
|
2011
2228
|
id: string;
|
|
2012
|
-
|
|
2229
|
+
updatedAt: string;
|
|
2230
|
+
disabledAt: string | null;
|
|
2231
|
+
state: Record<string, unknown>;
|
|
2232
|
+
triggerConfig: Record<string, unknown>;
|
|
2013
2233
|
triggerName: string;
|
|
2014
|
-
|
|
2234
|
+
uuid?: string | undefined;
|
|
2235
|
+
triggerData?: string | undefined;
|
|
2236
|
+
}, {
|
|
2237
|
+
connectedAccountId: string;
|
|
2238
|
+
id: string;
|
|
2239
|
+
updatedAt: string;
|
|
2240
|
+
disabledAt: string | null;
|
|
2241
|
+
state: Record<string, unknown>;
|
|
2015
2242
|
triggerConfig: Record<string, unknown>;
|
|
2016
|
-
|
|
2243
|
+
triggerName: string;
|
|
2244
|
+
uuid?: string | undefined;
|
|
2245
|
+
triggerData?: string | undefined;
|
|
2246
|
+
}>, "many">;
|
|
2247
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
2248
|
+
totalPages: z.ZodNumber;
|
|
2249
|
+
}, "strip", z.ZodTypeAny, {
|
|
2250
|
+
items: {
|
|
2251
|
+
connectedAccountId: string;
|
|
2252
|
+
id: string;
|
|
2253
|
+
updatedAt: string;
|
|
2254
|
+
disabledAt: string | null;
|
|
2255
|
+
state: Record<string, unknown>;
|
|
2256
|
+
triggerConfig: Record<string, unknown>;
|
|
2257
|
+
triggerName: string;
|
|
2258
|
+
uuid?: string | undefined;
|
|
2259
|
+
triggerData?: string | undefined;
|
|
2260
|
+
}[];
|
|
2261
|
+
nextCursor: string | null;
|
|
2262
|
+
totalPages: number;
|
|
2263
|
+
}, {
|
|
2264
|
+
items: {
|
|
2265
|
+
connectedAccountId: string;
|
|
2266
|
+
id: string;
|
|
2267
|
+
updatedAt: string;
|
|
2268
|
+
disabledAt: string | null;
|
|
2269
|
+
state: Record<string, unknown>;
|
|
2270
|
+
triggerConfig: Record<string, unknown>;
|
|
2271
|
+
triggerName: string;
|
|
2272
|
+
uuid?: string | undefined;
|
|
2273
|
+
triggerData?: string | undefined;
|
|
2274
|
+
}[];
|
|
2275
|
+
nextCursor: string | null;
|
|
2276
|
+
totalPages: number;
|
|
2277
|
+
}>;
|
|
2278
|
+
type TriggerInstanceListActiveResponse = z.infer<typeof TriggerInstanceListActiveResponseSchema>;
|
|
2279
|
+
declare const TriggerInstanceUpsertParamsSchema: z.ZodObject<{
|
|
2280
|
+
connectedAccountId: z.ZodOptional<z.ZodString>;
|
|
2281
|
+
triggerConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2282
|
+
}, "strip", z.ZodTypeAny, {
|
|
2283
|
+
connectedAccountId?: string | undefined;
|
|
2284
|
+
triggerConfig?: Record<string, unknown> | undefined;
|
|
2285
|
+
}, {
|
|
2286
|
+
connectedAccountId?: string | undefined;
|
|
2287
|
+
triggerConfig?: Record<string, unknown> | undefined;
|
|
2288
|
+
}>;
|
|
2289
|
+
type TriggerInstanceUpsertParams = z.infer<typeof TriggerInstanceUpsertParamsSchema>;
|
|
2290
|
+
declare const TriggerInstanceUpsertResponseSchema: z.ZodObject<{
|
|
2291
|
+
triggerId: z.ZodString;
|
|
2292
|
+
}, "strip", z.ZodTypeAny, {
|
|
2293
|
+
triggerId: string;
|
|
2294
|
+
}, {
|
|
2295
|
+
triggerId: string;
|
|
2296
|
+
}>;
|
|
2297
|
+
type TriggerInstanceUpsertResponse = z.infer<typeof TriggerInstanceUpsertResponseSchema>;
|
|
2298
|
+
declare const TriggerInstanceManageUpdateParamsSchema: z.ZodObject<{
|
|
2299
|
+
status: z.ZodEnum<["enable", "disable"]>;
|
|
2300
|
+
}, "strip", z.ZodTypeAny, {
|
|
2301
|
+
status: "enable" | "disable";
|
|
2302
|
+
}, {
|
|
2303
|
+
status: "enable" | "disable";
|
|
2304
|
+
}>;
|
|
2305
|
+
type TriggerInstanceManageUpdateParams = z.infer<typeof TriggerInstanceManageUpdateParamsSchema>;
|
|
2306
|
+
declare const TriggerInstanceManageUpdateResponseSchema: z.ZodObject<{
|
|
2307
|
+
status: z.ZodEnum<["success"]>;
|
|
2308
|
+
}, "strip", z.ZodTypeAny, {
|
|
2309
|
+
status: "success";
|
|
2310
|
+
}, {
|
|
2311
|
+
status: "success";
|
|
2312
|
+
}>;
|
|
2313
|
+
type TriggerInstanceManageUpdateResponse = z.infer<typeof TriggerInstanceManageUpdateResponseSchema>;
|
|
2314
|
+
declare const TriggerInstanceManageDeleteResponseSchema: z.ZodObject<{
|
|
2315
|
+
triggerId: z.ZodString;
|
|
2316
|
+
}, "strip", z.ZodTypeAny, {
|
|
2317
|
+
triggerId: string;
|
|
2318
|
+
}, {
|
|
2319
|
+
triggerId: string;
|
|
2320
|
+
}>;
|
|
2321
|
+
type TriggerInstanceManageDeleteResponse = z.infer<typeof TriggerInstanceManageDeleteResponseSchema>;
|
|
2322
|
+
declare const IncomingTriggerPayloadSchema: z.ZodObject<{
|
|
2323
|
+
id: z.ZodString;
|
|
2324
|
+
triggerSlug: z.ZodString;
|
|
2325
|
+
toolkitSlug: z.ZodString;
|
|
2326
|
+
userId: z.ZodString;
|
|
2327
|
+
payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2328
|
+
originalPayload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2329
|
+
metadata: z.ZodObject<{
|
|
2330
|
+
id: z.ZodString;
|
|
2331
|
+
toolkitSlug: z.ZodString;
|
|
2332
|
+
triggerSlug: z.ZodString;
|
|
2333
|
+
triggerData: z.ZodOptional<z.ZodString>;
|
|
2334
|
+
triggerConfig: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2335
|
+
connectedAccount: z.ZodObject<{
|
|
2336
|
+
id: z.ZodString;
|
|
2337
|
+
uuid: z.ZodString;
|
|
2338
|
+
authConfigId: z.ZodString;
|
|
2339
|
+
authConfigUUID: z.ZodString;
|
|
2340
|
+
userId: z.ZodString;
|
|
2341
|
+
status: z.ZodEnum<["ACTIVE", "INACTIVE"]>;
|
|
2342
|
+
}, "strip", z.ZodTypeAny, {
|
|
2343
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2344
|
+
userId: string;
|
|
2345
|
+
id: string;
|
|
2346
|
+
uuid: string;
|
|
2347
|
+
authConfigId: string;
|
|
2348
|
+
authConfigUUID: string;
|
|
2349
|
+
}, {
|
|
2350
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2351
|
+
userId: string;
|
|
2352
|
+
id: string;
|
|
2353
|
+
uuid: string;
|
|
2354
|
+
authConfigId: string;
|
|
2355
|
+
authConfigUUID: string;
|
|
2356
|
+
}>;
|
|
2357
|
+
}, "strip", z.ZodTypeAny, {
|
|
2358
|
+
id: string;
|
|
2359
|
+
toolkitSlug: string;
|
|
2360
|
+
triggerSlug: string;
|
|
2361
|
+
triggerConfig: Record<string, unknown>;
|
|
2362
|
+
connectedAccount: {
|
|
2363
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2364
|
+
userId: string;
|
|
2365
|
+
id: string;
|
|
2366
|
+
uuid: string;
|
|
2367
|
+
authConfigId: string;
|
|
2368
|
+
authConfigUUID: string;
|
|
2369
|
+
};
|
|
2370
|
+
triggerData?: string | undefined;
|
|
2371
|
+
}, {
|
|
2372
|
+
id: string;
|
|
2373
|
+
toolkitSlug: string;
|
|
2374
|
+
triggerSlug: string;
|
|
2375
|
+
triggerConfig: Record<string, unknown>;
|
|
2376
|
+
connectedAccount: {
|
|
2377
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2378
|
+
userId: string;
|
|
2017
2379
|
id: string;
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2380
|
+
uuid: string;
|
|
2381
|
+
authConfigId: string;
|
|
2382
|
+
authConfigUUID: string;
|
|
2021
2383
|
};
|
|
2384
|
+
triggerData?: string | undefined;
|
|
2385
|
+
}>;
|
|
2386
|
+
}, "strip", z.ZodTypeAny, {
|
|
2387
|
+
userId: string;
|
|
2388
|
+
id: string;
|
|
2389
|
+
toolkitSlug: string;
|
|
2390
|
+
triggerSlug: string;
|
|
2391
|
+
metadata: {
|
|
2392
|
+
id: string;
|
|
2393
|
+
toolkitSlug: string;
|
|
2394
|
+
triggerSlug: string;
|
|
2395
|
+
triggerConfig: Record<string, unknown>;
|
|
2396
|
+
connectedAccount: {
|
|
2397
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2398
|
+
userId: string;
|
|
2399
|
+
id: string;
|
|
2400
|
+
uuid: string;
|
|
2401
|
+
authConfigId: string;
|
|
2402
|
+
authConfigUUID: string;
|
|
2403
|
+
};
|
|
2404
|
+
triggerData?: string | undefined;
|
|
2022
2405
|
};
|
|
2023
|
-
|
|
2406
|
+
payload?: Record<string, unknown> | undefined;
|
|
2407
|
+
originalPayload?: Record<string, unknown> | undefined;
|
|
2408
|
+
}, {
|
|
2409
|
+
userId: string;
|
|
2410
|
+
id: string;
|
|
2411
|
+
toolkitSlug: string;
|
|
2412
|
+
triggerSlug: string;
|
|
2413
|
+
metadata: {
|
|
2414
|
+
id: string;
|
|
2415
|
+
toolkitSlug: string;
|
|
2416
|
+
triggerSlug: string;
|
|
2417
|
+
triggerConfig: Record<string, unknown>;
|
|
2418
|
+
connectedAccount: {
|
|
2419
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2420
|
+
userId: string;
|
|
2421
|
+
id: string;
|
|
2422
|
+
uuid: string;
|
|
2423
|
+
authConfigId: string;
|
|
2424
|
+
authConfigUUID: string;
|
|
2425
|
+
};
|
|
2426
|
+
triggerData?: string | undefined;
|
|
2427
|
+
};
|
|
2428
|
+
payload?: Record<string, unknown> | undefined;
|
|
2429
|
+
originalPayload?: Record<string, unknown> | undefined;
|
|
2430
|
+
}>;
|
|
2431
|
+
type IncomingTriggerPayload = z.infer<typeof IncomingTriggerPayloadSchema>;
|
|
2024
2432
|
|
|
2025
2433
|
/**
|
|
2026
2434
|
* Trigger (Instance) class
|
|
@@ -2029,12 +2437,33 @@ type TriggerData = {
|
|
|
2029
2437
|
*/
|
|
2030
2438
|
declare class Triggers {
|
|
2031
2439
|
private client;
|
|
2440
|
+
private pusherService;
|
|
2032
2441
|
constructor(client: ComposioClient);
|
|
2442
|
+
/**
|
|
2443
|
+
* Parse the trigger instance list active item
|
|
2444
|
+
*
|
|
2445
|
+
* @param response - The response from the composio client
|
|
2446
|
+
* @returns The parsed trigger instance list active item
|
|
2447
|
+
*/
|
|
2448
|
+
private parseTriggerInstanceListActiveItem;
|
|
2033
2449
|
/**
|
|
2034
2450
|
* Fetch list of all the active triggers
|
|
2035
|
-
*
|
|
2451
|
+
*
|
|
2452
|
+
* @param {TriggerInstanceListActiveParams} query - The query parameters to filter the trigger instances
|
|
2453
|
+
* @returns {Promise<TriggerInstanceListActiveResponse>} List of trigger instances
|
|
2454
|
+
*
|
|
2455
|
+
* @throws {ValidationError} If the parameters are invalid
|
|
2456
|
+
* @throws {Error} If the client is not authenticated
|
|
2457
|
+
*
|
|
2458
|
+
* @example
|
|
2459
|
+
* ```ts
|
|
2460
|
+
* const triggers = await triggers.listActive({
|
|
2461
|
+
* authConfigIds: ['123'],
|
|
2462
|
+
* connectedAccountIds: ['456'],
|
|
2463
|
+
* });
|
|
2464
|
+
* ```
|
|
2036
2465
|
*/
|
|
2037
|
-
|
|
2466
|
+
listActive(query?: TriggerInstanceListActiveParams): Promise<TriggerInstanceListActiveResponse>;
|
|
2038
2467
|
/**
|
|
2039
2468
|
* Create a new trigger instance
|
|
2040
2469
|
*
|
|
@@ -2042,47 +2471,36 @@ declare class Triggers {
|
|
|
2042
2471
|
* @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
|
|
2043
2472
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
|
|
2044
2473
|
*/
|
|
2045
|
-
create(slug: string, body: TriggerInstanceUpsertParams
|
|
2474
|
+
create(slug: string, body: TriggerInstanceUpsertParams): Promise<TriggerInstanceUpsertResponse>;
|
|
2046
2475
|
/**
|
|
2047
2476
|
* Update an existing trigger instance
|
|
2048
2477
|
*
|
|
2049
2478
|
* @param {string} slug - The slug of the trigger instance
|
|
2050
|
-
* @param {
|
|
2479
|
+
* @param {TriggerInstanceManageUpdateParams} body - The parameters to create the trigger instance
|
|
2051
2480
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
|
|
2052
2481
|
*/
|
|
2053
|
-
update(slug: string, body:
|
|
2482
|
+
update(slug: string, body: TriggerInstanceManageUpdateParams): Promise<TriggerInstanceManageUpdateResponse>;
|
|
2054
2483
|
/**
|
|
2055
2484
|
* Delete a trigger instance
|
|
2056
2485
|
*
|
|
2057
|
-
* @param {string}
|
|
2486
|
+
* @param {string} triggerId - The slug of the trigger instance
|
|
2058
2487
|
* @returns
|
|
2059
2488
|
*/
|
|
2060
|
-
delete(
|
|
2061
|
-
/**
|
|
2062
|
-
* Update the status of a trigger
|
|
2063
|
-
*
|
|
2064
|
-
* @param {TriggerStatusEnum} status - The new status of the trigger
|
|
2065
|
-
* @param {TriggerInstanceUpdateStatusParams} params - The parameters to update the trigger instance
|
|
2066
|
-
* @param {RequestOptions} options - Request options
|
|
2067
|
-
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
|
|
2068
|
-
*/
|
|
2069
|
-
updateStatus(status: TriggerStatusEnum, params: TriggerInstanceUpdateStatusParams, options?: RequestOptions): Promise<ComposioClient.TriggerInstances.TriggerInstanceUpdateStatusResponse>;
|
|
2489
|
+
delete(triggerId: string): Promise<TriggerInstanceManageDeleteResponse>;
|
|
2070
2490
|
/**
|
|
2071
2491
|
* Disable a trigger instance
|
|
2072
2492
|
*
|
|
2073
|
-
* @param {string}
|
|
2074
|
-
* @param {RequestOptions options - Request options
|
|
2493
|
+
* @param {string} triggerId - The id of the trigger instance
|
|
2075
2494
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
|
|
2076
2495
|
*/
|
|
2077
|
-
disable(
|
|
2496
|
+
disable(triggerId: string): Promise<ComposioClient.TriggerInstances.Manage.ManageUpdateResponse>;
|
|
2078
2497
|
/**
|
|
2079
2498
|
* Enable a trigger instance
|
|
2080
2499
|
*
|
|
2081
|
-
* @param {string}
|
|
2082
|
-
* @param {RequestOptions options - Request options
|
|
2500
|
+
* @param {string} triggerId - The id of the trigger instance
|
|
2083
2501
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
|
|
2084
2502
|
*/
|
|
2085
|
-
enable(
|
|
2503
|
+
enable(triggerId: string): Promise<ComposioClient.TriggerInstances.Manage.ManageUpdateResponse>;
|
|
2086
2504
|
/**
|
|
2087
2505
|
* @TODO Learn about trigger types
|
|
2088
2506
|
*/
|
|
@@ -2093,7 +2511,7 @@ declare class Triggers {
|
|
|
2093
2511
|
* @param {RequestOptions} options - Request options
|
|
2094
2512
|
* @returns {Promise<TriggersTypeListResponse>} The list of trigger types
|
|
2095
2513
|
*/
|
|
2096
|
-
listTypes(query?: TriggersTypeListParams
|
|
2514
|
+
listTypes(query?: TriggersTypeListParams): Promise<TriggersTypeListResponse>;
|
|
2097
2515
|
/**
|
|
2098
2516
|
* Retrieve a trigger type by its slug
|
|
2099
2517
|
*
|
|
@@ -2101,7 +2519,7 @@ declare class Triggers {
|
|
|
2101
2519
|
* @param {RequestOptions} options - request options
|
|
2102
2520
|
* @returns {Promise<TriggersTypeRetrieveResponse>} The trigger type object
|
|
2103
2521
|
*/
|
|
2104
|
-
getType(slug: string
|
|
2522
|
+
getType(slug: string): Promise<TriggersTypeRetrieveResponse>;
|
|
2105
2523
|
/**
|
|
2106
2524
|
* Fetches the list of all the available trigger enums
|
|
2107
2525
|
*
|
|
@@ -2109,8 +2527,36 @@ declare class Triggers {
|
|
|
2109
2527
|
* @param options
|
|
2110
2528
|
* @returns
|
|
2111
2529
|
*/
|
|
2112
|
-
listEnum(
|
|
2113
|
-
|
|
2530
|
+
listEnum(): Promise<TriggersTypeRetrieveEnumResponse>;
|
|
2531
|
+
/**
|
|
2532
|
+
* Subscribe to all the triggers
|
|
2533
|
+
*
|
|
2534
|
+
* @param fn - The function to call when a trigger is received
|
|
2535
|
+
* @param filters - The filters to apply to the triggers
|
|
2536
|
+
*
|
|
2537
|
+
* @example
|
|
2538
|
+
* ```ts
|
|
2539
|
+
*
|
|
2540
|
+
* triggers.subscribe((data) => {
|
|
2541
|
+
* console.log(data);
|
|
2542
|
+
* }, );
|
|
2543
|
+
* ```
|
|
2544
|
+
*/
|
|
2545
|
+
subscribe(fn: (_data: IncomingTriggerPayload) => void, filters?: TriggerSubscribeParams): Promise<void>;
|
|
2546
|
+
/**
|
|
2547
|
+
* Unsubscribe from all the triggers
|
|
2548
|
+
*
|
|
2549
|
+
* @returns {Promise<void>}
|
|
2550
|
+
*
|
|
2551
|
+
* @example
|
|
2552
|
+
* ```ts
|
|
2553
|
+
* composio.trigger.subscribe((data) => {
|
|
2554
|
+
* console.log(data);
|
|
2555
|
+
* });
|
|
2556
|
+
*
|
|
2557
|
+
* await triggers.unsubscribe();
|
|
2558
|
+
* ```
|
|
2559
|
+
*/
|
|
2114
2560
|
unsubscribe(): Promise<void>;
|
|
2115
2561
|
}
|
|
2116
2562
|
|
|
@@ -2145,13 +2591,13 @@ declare const CreateAuthConfigParamsSchema: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
2145
2591
|
authScheme: z.ZodEnum<["OAUTH2", "OAUTH1", "OAUTH1A", "API_KEY", "BASIC", "BILLCOM_AUTH", "BEARER_TOKEN", "GOOGLE_SERVICE_ACCOUNT", "NO_AUTH", "BASIC_WITH_JWT", "COMPOSIO_LINK", "CALCOM_AUTH", "SNOWFLAKE"]>;
|
|
2146
2592
|
}, "strip", z.ZodTypeAny, {
|
|
2147
2593
|
type: "use_custom_auth";
|
|
2594
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
2148
2595
|
credentials: Record<string, string | number | boolean>;
|
|
2149
|
-
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
2150
2596
|
name?: string | undefined;
|
|
2151
2597
|
}, {
|
|
2152
2598
|
type: "use_custom_auth";
|
|
2599
|
+
authScheme: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
2153
2600
|
credentials: Record<string, string | number | boolean>;
|
|
2154
|
-
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
2155
2601
|
name?: string | undefined;
|
|
2156
2602
|
}>, z.ZodObject<{
|
|
2157
2603
|
type: z.ZodLiteral<"use_composio_managed_auth">;
|
|
@@ -2201,7 +2647,7 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
|
|
|
2201
2647
|
status: z.ZodEnum<["ENABLED", "DISABLED"]>;
|
|
2202
2648
|
uuid: z.ZodString;
|
|
2203
2649
|
authScheme: z.ZodOptional<z.ZodEnum<["OAUTH2", "OAUTH1", "OAUTH1A", "API_KEY", "BASIC", "BILLCOM_AUTH", "BEARER_TOKEN", "GOOGLE_SERVICE_ACCOUNT", "NO_AUTH", "BASIC_WITH_JWT", "COMPOSIO_LINK", "CALCOM_AUTH", "SNOWFLAKE"]>>;
|
|
2204
|
-
credentials: z.
|
|
2650
|
+
credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2205
2651
|
expectedInputFields: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
2206
2652
|
isComposioManaged: z.ZodOptional<z.ZodBoolean>;
|
|
2207
2653
|
createdBy: z.ZodOptional<z.ZodString>;
|
|
@@ -2215,12 +2661,12 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
|
|
|
2215
2661
|
logo: string;
|
|
2216
2662
|
};
|
|
2217
2663
|
id: string;
|
|
2218
|
-
credentials: Record<string, string | number | boolean>;
|
|
2219
2664
|
noOfConnections: number;
|
|
2220
2665
|
uuid: string;
|
|
2221
|
-
|
|
2222
|
-
authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2666
|
+
authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2223
2667
|
isComposioManaged?: boolean | undefined;
|
|
2668
|
+
createdAt?: string | undefined;
|
|
2669
|
+
credentials?: Record<string, unknown> | undefined;
|
|
2224
2670
|
expectedInputFields?: unknown[] | undefined;
|
|
2225
2671
|
createdBy?: string | undefined;
|
|
2226
2672
|
lastUpdatedAt?: string | undefined;
|
|
@@ -2232,12 +2678,12 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
|
|
|
2232
2678
|
logo: string;
|
|
2233
2679
|
};
|
|
2234
2680
|
id: string;
|
|
2235
|
-
credentials: Record<string, string | number | boolean>;
|
|
2236
2681
|
noOfConnections: number;
|
|
2237
2682
|
uuid: string;
|
|
2238
|
-
|
|
2239
|
-
authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2683
|
+
authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2240
2684
|
isComposioManaged?: boolean | undefined;
|
|
2685
|
+
createdAt?: string | undefined;
|
|
2686
|
+
credentials?: Record<string, unknown> | undefined;
|
|
2241
2687
|
expectedInputFields?: unknown[] | undefined;
|
|
2242
2688
|
createdBy?: string | undefined;
|
|
2243
2689
|
lastUpdatedAt?: string | undefined;
|
|
@@ -2247,16 +2693,16 @@ declare const AuthConfigListParamsSchema: z.ZodObject<{
|
|
|
2247
2693
|
cursor: z.ZodOptional<z.ZodString>;
|
|
2248
2694
|
isComposioManaged: z.ZodOptional<z.ZodBoolean>;
|
|
2249
2695
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
2250
|
-
|
|
2696
|
+
toolkit: z.ZodOptional<z.ZodString>;
|
|
2251
2697
|
}, "strip", z.ZodTypeAny, {
|
|
2698
|
+
toolkit?: string | undefined;
|
|
2252
2699
|
cursor?: string | undefined;
|
|
2253
2700
|
limit?: number | undefined;
|
|
2254
|
-
toolkitSlug?: string | undefined;
|
|
2255
2701
|
isComposioManaged?: boolean | undefined;
|
|
2256
2702
|
}, {
|
|
2703
|
+
toolkit?: string | undefined;
|
|
2257
2704
|
cursor?: string | undefined;
|
|
2258
2705
|
limit?: number | undefined;
|
|
2259
|
-
toolkitSlug?: string | undefined;
|
|
2260
2706
|
isComposioManaged?: boolean | undefined;
|
|
2261
2707
|
}>;
|
|
2262
2708
|
type AuthConfigListParams = z.infer<typeof AuthConfigListParamsSchema>;
|
|
@@ -2278,7 +2724,7 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2278
2724
|
status: z.ZodEnum<["ENABLED", "DISABLED"]>;
|
|
2279
2725
|
uuid: z.ZodString;
|
|
2280
2726
|
authScheme: z.ZodOptional<z.ZodEnum<["OAUTH2", "OAUTH1", "OAUTH1A", "API_KEY", "BASIC", "BILLCOM_AUTH", "BEARER_TOKEN", "GOOGLE_SERVICE_ACCOUNT", "NO_AUTH", "BASIC_WITH_JWT", "COMPOSIO_LINK", "CALCOM_AUTH", "SNOWFLAKE"]>>;
|
|
2281
|
-
credentials: z.
|
|
2727
|
+
credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2282
2728
|
expectedInputFields: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
2283
2729
|
isComposioManaged: z.ZodOptional<z.ZodBoolean>;
|
|
2284
2730
|
createdBy: z.ZodOptional<z.ZodString>;
|
|
@@ -2292,12 +2738,12 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2292
2738
|
logo: string;
|
|
2293
2739
|
};
|
|
2294
2740
|
id: string;
|
|
2295
|
-
credentials: Record<string, string | number | boolean>;
|
|
2296
2741
|
noOfConnections: number;
|
|
2297
2742
|
uuid: string;
|
|
2298
|
-
|
|
2299
|
-
authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2743
|
+
authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2300
2744
|
isComposioManaged?: boolean | undefined;
|
|
2745
|
+
createdAt?: string | undefined;
|
|
2746
|
+
credentials?: Record<string, unknown> | undefined;
|
|
2301
2747
|
expectedInputFields?: unknown[] | undefined;
|
|
2302
2748
|
createdBy?: string | undefined;
|
|
2303
2749
|
lastUpdatedAt?: string | undefined;
|
|
@@ -2309,17 +2755,17 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2309
2755
|
logo: string;
|
|
2310
2756
|
};
|
|
2311
2757
|
id: string;
|
|
2312
|
-
credentials: Record<string, string | number | boolean>;
|
|
2313
2758
|
noOfConnections: number;
|
|
2314
2759
|
uuid: string;
|
|
2315
|
-
|
|
2316
|
-
authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2760
|
+
authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2317
2761
|
isComposioManaged?: boolean | undefined;
|
|
2762
|
+
createdAt?: string | undefined;
|
|
2763
|
+
credentials?: Record<string, unknown> | undefined;
|
|
2318
2764
|
expectedInputFields?: unknown[] | undefined;
|
|
2319
2765
|
createdBy?: string | undefined;
|
|
2320
2766
|
lastUpdatedAt?: string | undefined;
|
|
2321
2767
|
}>, "many">;
|
|
2322
|
-
nextCursor: z.
|
|
2768
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
2323
2769
|
totalPages: z.ZodNumber;
|
|
2324
2770
|
}, "strip", z.ZodTypeAny, {
|
|
2325
2771
|
items: {
|
|
@@ -2330,18 +2776,18 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2330
2776
|
logo: string;
|
|
2331
2777
|
};
|
|
2332
2778
|
id: string;
|
|
2333
|
-
credentials: Record<string, string | number | boolean>;
|
|
2334
2779
|
noOfConnections: number;
|
|
2335
2780
|
uuid: string;
|
|
2336
|
-
|
|
2337
|
-
authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2781
|
+
authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2338
2782
|
isComposioManaged?: boolean | undefined;
|
|
2783
|
+
createdAt?: string | undefined;
|
|
2784
|
+
credentials?: Record<string, unknown> | undefined;
|
|
2339
2785
|
expectedInputFields?: unknown[] | undefined;
|
|
2340
2786
|
createdBy?: string | undefined;
|
|
2341
2787
|
lastUpdatedAt?: string | undefined;
|
|
2342
2788
|
}[];
|
|
2789
|
+
nextCursor: string | null;
|
|
2343
2790
|
totalPages: number;
|
|
2344
|
-
nextCursor?: string | undefined;
|
|
2345
2791
|
}, {
|
|
2346
2792
|
items: {
|
|
2347
2793
|
name: string;
|
|
@@ -2351,18 +2797,18 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2351
2797
|
logo: string;
|
|
2352
2798
|
};
|
|
2353
2799
|
id: string;
|
|
2354
|
-
credentials: Record<string, string | number | boolean>;
|
|
2355
2800
|
noOfConnections: number;
|
|
2356
2801
|
uuid: string;
|
|
2357
|
-
|
|
2358
|
-
authScheme?: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2802
|
+
authScheme?: "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "NO_AUTH" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE" | undefined;
|
|
2359
2803
|
isComposioManaged?: boolean | undefined;
|
|
2804
|
+
createdAt?: string | undefined;
|
|
2805
|
+
credentials?: Record<string, unknown> | undefined;
|
|
2360
2806
|
expectedInputFields?: unknown[] | undefined;
|
|
2361
2807
|
createdBy?: string | undefined;
|
|
2362
2808
|
lastUpdatedAt?: string | undefined;
|
|
2363
2809
|
}[];
|
|
2810
|
+
nextCursor: string | null;
|
|
2364
2811
|
totalPages: number;
|
|
2365
|
-
nextCursor?: string | undefined;
|
|
2366
2812
|
}>;
|
|
2367
2813
|
type AuthConfigListResponse = z.infer<typeof AuthConfigListResponseSchema>;
|
|
2368
2814
|
declare const AuthConfigUpdateParamsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -2445,7 +2891,7 @@ declare class AuthConfigs {
|
|
|
2445
2891
|
*
|
|
2446
2892
|
* // List auth configs for a specific toolkit
|
|
2447
2893
|
* const githubConfigs = await composio.authConfigs.list({
|
|
2448
|
-
*
|
|
2894
|
+
* toolkit: 'github'
|
|
2449
2895
|
* });
|
|
2450
2896
|
*
|
|
2451
2897
|
* // List Composio-managed auth configs
|
|
@@ -2758,22 +3204,53 @@ declare class ConnectedAccounts {
|
|
|
2758
3204
|
* Update the status of a connected account
|
|
2759
3205
|
* @param {string} nanoid - Unique identifier of the connected account
|
|
2760
3206
|
* @param {ConnectedAccountUpdateStatusParams} params - Parameters for updating the status
|
|
2761
|
-
* @param {RequestOptions} options - Request options
|
|
2762
3207
|
* @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
|
|
3208
|
+
*
|
|
3209
|
+
* @example
|
|
3210
|
+
* ```typescript
|
|
3211
|
+
* // Enable a connected account
|
|
3212
|
+
* const updatedAccount = await composio.connectedAccounts.updateStatus('conn_abc123', {
|
|
3213
|
+
* enabled: true
|
|
3214
|
+
* });
|
|
3215
|
+
*
|
|
3216
|
+
* // Disable a connected account with a reason
|
|
3217
|
+
* const disabledAccount = await composio.connectedAccounts.updateStatus('conn_abc123', {
|
|
3218
|
+
* enabled: false,
|
|
3219
|
+
* reason: 'Token expired'
|
|
3220
|
+
* });
|
|
3221
|
+
* ```
|
|
2763
3222
|
*/
|
|
2764
3223
|
updateStatus(nanoid: string, params: ConnectedAccountUpdateStatusParams): Promise<ConnectedAccountUpdateStatusResponse>;
|
|
2765
3224
|
/**
|
|
2766
3225
|
* Enable a connected account
|
|
2767
3226
|
* @param {string} nanoid - Unique identifier of the connected account
|
|
2768
|
-
* @param {RequestOptions} options - Request options
|
|
2769
3227
|
* @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
|
|
3228
|
+
*
|
|
3229
|
+
* @example
|
|
3230
|
+
* ```typescript
|
|
3231
|
+
* // Enable a previously disabled connected account
|
|
3232
|
+
* const enabledAccount = await composio.connectedAccounts.enable('conn_abc123');
|
|
3233
|
+
* console.log(enabledAccount.isDisabled); // false
|
|
3234
|
+
* ```
|
|
2770
3235
|
*/
|
|
2771
3236
|
enable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>;
|
|
2772
3237
|
/**
|
|
2773
3238
|
* Disable a connected account
|
|
2774
3239
|
* @param {string} nanoid - Unique identifier of the connected account
|
|
2775
|
-
* @param {RequestOptions} options - Request options
|
|
2776
3240
|
* @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
|
|
3241
|
+
*
|
|
3242
|
+
* @example
|
|
3243
|
+
* ```typescript
|
|
3244
|
+
* // Disable a connected account
|
|
3245
|
+
* const disabledAccount = await composio.connectedAccounts.disable('conn_abc123');
|
|
3246
|
+
* console.log(disabledAccount.isDisabled); // true
|
|
3247
|
+
*
|
|
3248
|
+
* // You can also use updateStatus with a reason
|
|
3249
|
+
* // const disabledAccount = await composio.connectedAccounts.updateStatus('conn_abc123', {
|
|
3250
|
+
* // enabled: false,
|
|
3251
|
+
* // reason: 'No longer needed'
|
|
3252
|
+
* // });
|
|
3253
|
+
* ```
|
|
2777
3254
|
*/
|
|
2778
3255
|
disable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>;
|
|
2779
3256
|
}
|
|
@@ -2793,6 +3270,13 @@ declare abstract class BaseTelemetryTransport {
|
|
|
2793
3270
|
*/
|
|
2794
3271
|
abstract send(payload: TelemetryTransportParams): Promise<void>;
|
|
2795
3272
|
}
|
|
3273
|
+
/**
|
|
3274
|
+
* A telemetry transport that logs to the console.
|
|
3275
|
+
* This is just for testing purposes.
|
|
3276
|
+
*/
|
|
3277
|
+
declare class ConsoleTelemetryTransport implements BaseTelemetryTransport {
|
|
3278
|
+
send(payload: TelemetryTransportParams): Promise<void>;
|
|
3279
|
+
}
|
|
2796
3280
|
|
|
2797
3281
|
/**
|
|
2798
3282
|
* OpenAI ToolSet
|
|
@@ -2809,61 +3293,308 @@ type OpenAiToolCollection = Array<OpenAiTool>;
|
|
|
2809
3293
|
declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection, OpenAiTool> {
|
|
2810
3294
|
readonly name = "openai";
|
|
2811
3295
|
/**
|
|
2812
|
-
*
|
|
2813
|
-
*
|
|
2814
|
-
*
|
|
2815
|
-
*
|
|
3296
|
+
* Creates a new instance of the OpenAIProvider.
|
|
3297
|
+
*
|
|
3298
|
+
* This is the default provider for the Composio SDK and is automatically
|
|
3299
|
+
* available without additional installation.
|
|
3300
|
+
*
|
|
3301
|
+
* @example
|
|
3302
|
+
* ```typescript
|
|
3303
|
+
* // The OpenAIProvider is used by default when initializing Composio
|
|
3304
|
+
* const composio = new Composio({
|
|
3305
|
+
* apiKey: 'your-api-key'
|
|
3306
|
+
* });
|
|
3307
|
+
*
|
|
3308
|
+
* // You can also explicitly specify it
|
|
3309
|
+
* const composio = new Composio({
|
|
3310
|
+
* apiKey: 'your-api-key',
|
|
3311
|
+
* provider: new OpenAIProvider()
|
|
3312
|
+
* });
|
|
3313
|
+
* ```
|
|
3314
|
+
*/
|
|
3315
|
+
constructor();
|
|
3316
|
+
/**
|
|
3317
|
+
* Wraps a Composio tool in the OpenAI function calling format.
|
|
3318
|
+
*
|
|
3319
|
+
* This method transforms a Composio tool definition into the format
|
|
3320
|
+
* expected by OpenAI's function calling API.
|
|
3321
|
+
*
|
|
3322
|
+
* @param tool - The Composio tool to wrap
|
|
3323
|
+
* @returns The wrapped tool in OpenAI format
|
|
3324
|
+
*
|
|
3325
|
+
* @example
|
|
3326
|
+
* ```typescript
|
|
3327
|
+
* // Wrap a single tool for use with OpenAI
|
|
3328
|
+
* const composioTool = {
|
|
3329
|
+
* slug: 'SEARCH_TOOL',
|
|
3330
|
+
* description: 'Search for information',
|
|
3331
|
+
* inputParameters: {
|
|
3332
|
+
* type: 'object',
|
|
3333
|
+
* properties: {
|
|
3334
|
+
* query: { type: 'string' }
|
|
3335
|
+
* },
|
|
3336
|
+
* required: ['query']
|
|
3337
|
+
* }
|
|
3338
|
+
* };
|
|
3339
|
+
*
|
|
3340
|
+
* const openAITool = provider.wrapTool(composioTool);
|
|
3341
|
+
* ```
|
|
2816
3342
|
*/
|
|
2817
3343
|
wrapTool: (tool: Tool) => OpenAiTool;
|
|
3344
|
+
/**
|
|
3345
|
+
* Wraps multiple Composio tools in the OpenAI function calling format.
|
|
3346
|
+
*
|
|
3347
|
+
* This method transforms a list of Composio tools into the format
|
|
3348
|
+
* expected by OpenAI's function calling API.
|
|
3349
|
+
*
|
|
3350
|
+
* @param tools - Array of Composio tools to wrap
|
|
3351
|
+
* @returns Array of wrapped tools in OpenAI format
|
|
3352
|
+
*
|
|
3353
|
+
* @example
|
|
3354
|
+
* ```typescript
|
|
3355
|
+
* // Wrap multiple tools for use with OpenAI
|
|
3356
|
+
* const composioTools = [
|
|
3357
|
+
* {
|
|
3358
|
+
* slug: 'SEARCH_TOOL',
|
|
3359
|
+
* description: 'Search for information',
|
|
3360
|
+
* inputParameters: {
|
|
3361
|
+
* type: 'object',
|
|
3362
|
+
* properties: {
|
|
3363
|
+
* query: { type: 'string' }
|
|
3364
|
+
* }
|
|
3365
|
+
* }
|
|
3366
|
+
* },
|
|
3367
|
+
* {
|
|
3368
|
+
* slug: 'WEATHER_TOOL',
|
|
3369
|
+
* description: 'Get weather information',
|
|
3370
|
+
* inputParameters: {
|
|
3371
|
+
* type: 'object',
|
|
3372
|
+
* properties: {
|
|
3373
|
+
* location: { type: 'string' }
|
|
3374
|
+
* }
|
|
3375
|
+
* }
|
|
3376
|
+
* }
|
|
3377
|
+
* ];
|
|
3378
|
+
*
|
|
3379
|
+
* const openAITools = provider.wrapTools(composioTools);
|
|
3380
|
+
* ```
|
|
3381
|
+
*/
|
|
2818
3382
|
wrapTools: (tools: Tool[]) => OpenAiToolCollection;
|
|
2819
3383
|
/**
|
|
2820
|
-
*
|
|
2821
|
-
*
|
|
2822
|
-
*
|
|
2823
|
-
*
|
|
3384
|
+
* Executes a tool call from OpenAI's chat completion.
|
|
3385
|
+
*
|
|
3386
|
+
* This method processes a tool call from OpenAI's chat completion API,
|
|
3387
|
+
* executes the corresponding Composio tool, and returns the result.
|
|
3388
|
+
*
|
|
3389
|
+
* @param {string} userId - The user ID for authentication and tracking
|
|
3390
|
+
* @param {OpenAI.ChatCompletionMessageToolCall} tool - The tool call from OpenAI
|
|
3391
|
+
* @param {ExecuteToolFnOptions} [options] - Optional execution options
|
|
3392
|
+
* @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
|
|
3393
|
+
* @returns {Promise<string>} The result of the tool call as a JSON string
|
|
3394
|
+
*
|
|
3395
|
+
* @example
|
|
3396
|
+
* ```typescript
|
|
3397
|
+
* // Execute a tool call from OpenAI
|
|
3398
|
+
* const toolCall = {
|
|
3399
|
+
* id: 'call_abc123',
|
|
3400
|
+
* type: 'function',
|
|
3401
|
+
* function: {
|
|
3402
|
+
* name: 'SEARCH_TOOL',
|
|
3403
|
+
* arguments: '{"query":"composio documentation"}'
|
|
3404
|
+
* }
|
|
3405
|
+
* };
|
|
3406
|
+
*
|
|
3407
|
+
* const result = await provider.executeToolCall(
|
|
3408
|
+
* 'user123',
|
|
3409
|
+
* toolCall,
|
|
3410
|
+
* { connectedAccountId: 'conn_xyz456' }
|
|
3411
|
+
* );
|
|
3412
|
+
* console.log(JSON.parse(result));
|
|
3413
|
+
* ```
|
|
2824
3414
|
*/
|
|
2825
3415
|
executeToolCall(userId: string, tool: OpenAI.ChatCompletionMessageToolCall, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string>;
|
|
2826
3416
|
/**
|
|
2827
|
-
*
|
|
3417
|
+
* Handles tool calls from OpenAI's chat completion response.
|
|
2828
3418
|
*
|
|
2829
|
-
*
|
|
2830
|
-
*
|
|
2831
|
-
*
|
|
3419
|
+
* This method processes tool calls from an OpenAI chat completion response,
|
|
3420
|
+
* executes each tool call, and returns the results.
|
|
3421
|
+
*
|
|
3422
|
+
* @param {string} userId - The user ID for authentication and tracking
|
|
3423
|
+
* @param {OpenAI.ChatCompletion} chatCompletion - The chat completion response from OpenAI
|
|
3424
|
+
* @param {ExecuteToolFnOptions} [options] - Optional execution options
|
|
3425
|
+
* @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
|
|
3426
|
+
* @returns {Promise<string[]>} Array of tool execution results as JSON strings
|
|
3427
|
+
*
|
|
3428
|
+
* @example
|
|
3429
|
+
* ```typescript
|
|
3430
|
+
* // Handle tool calls from a chat completion response
|
|
3431
|
+
* const chatCompletion = {
|
|
3432
|
+
* choices: [
|
|
3433
|
+
* {
|
|
3434
|
+
* message: {
|
|
3435
|
+
* tool_calls: [
|
|
3436
|
+
* {
|
|
3437
|
+
* id: 'call_abc123',
|
|
3438
|
+
* type: 'function',
|
|
3439
|
+
* function: {
|
|
3440
|
+
* name: 'SEARCH_TOOL',
|
|
3441
|
+
* arguments: '{"query":"composio documentation"}'
|
|
3442
|
+
* }
|
|
3443
|
+
* }
|
|
3444
|
+
* ]
|
|
3445
|
+
* }
|
|
3446
|
+
* }
|
|
3447
|
+
* ]
|
|
3448
|
+
* };
|
|
3449
|
+
*
|
|
3450
|
+
* const results = await provider.handleToolCalls(
|
|
3451
|
+
* 'user123',
|
|
3452
|
+
* chatCompletion,
|
|
3453
|
+
* { connectedAccountId: 'conn_xyz456' }
|
|
3454
|
+
* );
|
|
3455
|
+
* console.log(results); // Array of tool execution results
|
|
3456
|
+
* ```
|
|
2832
3457
|
*/
|
|
2833
|
-
|
|
3458
|
+
handleToolCalls(userId: string, chatCompletion: OpenAI.ChatCompletion, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string[]>;
|
|
2834
3459
|
/**
|
|
2835
|
-
* Handles all the tool calls from the
|
|
3460
|
+
* Handles all the tool calls from the OpenAI Assistant API.
|
|
2836
3461
|
*
|
|
2837
|
-
*
|
|
2838
|
-
*
|
|
2839
|
-
*
|
|
3462
|
+
* This method processes tool calls from an OpenAI Assistant run,
|
|
3463
|
+
* executes each tool call, and returns the tool outputs for submission.
|
|
3464
|
+
*
|
|
3465
|
+
* @param {string} userId - The user ID for authentication and tracking
|
|
3466
|
+
* @param {OpenAI.Beta.Threads.Run} run - The Assistant run object containing tool calls
|
|
3467
|
+
* @param {ExecuteToolFnOptions} [options] - Optional execution options
|
|
3468
|
+
* @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
|
|
3469
|
+
* @returns {Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>} Array of tool outputs for submission
|
|
3470
|
+
*
|
|
3471
|
+
* @example
|
|
3472
|
+
* ```typescript
|
|
3473
|
+
* // Handle tool calls from an OpenAI Assistant run
|
|
3474
|
+
* const run = {
|
|
3475
|
+
* id: 'run_abc123',
|
|
3476
|
+
* required_action: {
|
|
3477
|
+
* submit_tool_outputs: {
|
|
3478
|
+
* tool_calls: [
|
|
3479
|
+
* {
|
|
3480
|
+
* id: 'call_xyz789',
|
|
3481
|
+
* type: 'function',
|
|
3482
|
+
* function: {
|
|
3483
|
+
* name: 'SEARCH_TOOL',
|
|
3484
|
+
* arguments: '{"query":"composio documentation"}'
|
|
3485
|
+
* }
|
|
3486
|
+
* }
|
|
3487
|
+
* ]
|
|
3488
|
+
* }
|
|
3489
|
+
* }
|
|
3490
|
+
* };
|
|
3491
|
+
*
|
|
3492
|
+
* const toolOutputs = await provider.handleAssistantMessage(
|
|
3493
|
+
* 'user123',
|
|
3494
|
+
* run,
|
|
3495
|
+
* { connectedAccountId: 'conn_xyz456' }
|
|
3496
|
+
* );
|
|
3497
|
+
*
|
|
3498
|
+
* // Submit tool outputs back to OpenAI
|
|
3499
|
+
* await openai.beta.threads.runs.submitToolOutputs(
|
|
3500
|
+
* thread.id,
|
|
3501
|
+
* run.id,
|
|
3502
|
+
* { tool_outputs: toolOutputs }
|
|
3503
|
+
* );
|
|
3504
|
+
* ```
|
|
2840
3505
|
*/
|
|
2841
3506
|
handleAssistantMessage(userId: string, run: OpenAI.Beta.Threads.Run, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>;
|
|
2842
3507
|
/**
|
|
2843
3508
|
* Waits for the assistant stream and handles the tool calls.
|
|
2844
3509
|
*
|
|
2845
|
-
*
|
|
2846
|
-
*
|
|
2847
|
-
*
|
|
2848
|
-
*
|
|
2849
|
-
* @
|
|
3510
|
+
* This method processes an OpenAI Assistant stream, handles any tool calls
|
|
3511
|
+
* that require action, and yields each event from the stream. It's designed
|
|
3512
|
+
* for streaming Assistant responses while handling tool calls in real-time.
|
|
3513
|
+
*
|
|
3514
|
+
* @param {string} userId - The user ID for authentication and tracking
|
|
3515
|
+
* @param {OpenAI} client - The OpenAI client instance
|
|
3516
|
+
* @param {Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>} runStream - The Assistant run stream
|
|
3517
|
+
* @param {OpenAI.Beta.Threads.Thread} thread - The thread object
|
|
3518
|
+
* @param {ExecuteToolFnOptions} [options] - Optional execution options
|
|
3519
|
+
* @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
|
|
3520
|
+
* @returns {AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>} Generator yielding stream events
|
|
3521
|
+
*
|
|
3522
|
+
* @example
|
|
3523
|
+
* ```typescript
|
|
3524
|
+
* // Process an OpenAI Assistant stream with tool calls
|
|
3525
|
+
* const thread = await openai.beta.threads.create();
|
|
3526
|
+
* const runStream = openai.beta.threads.runs.stream(thread.id, {
|
|
3527
|
+
* assistant_id: 'asst_abc123',
|
|
3528
|
+
* tools: provider.wrapTools(composioTools)
|
|
3529
|
+
* });
|
|
3530
|
+
*
|
|
3531
|
+
* // Process the stream and handle tool calls
|
|
3532
|
+
* const streamProcessor = provider.waitAndHandleAssistantStreamToolCalls(
|
|
3533
|
+
* 'user123',
|
|
3534
|
+
* openai,
|
|
3535
|
+
* runStream,
|
|
3536
|
+
* thread,
|
|
3537
|
+
* { connectedAccountId: 'conn_xyz456' }
|
|
3538
|
+
* );
|
|
3539
|
+
*
|
|
3540
|
+
* // Consume the stream events
|
|
3541
|
+
* for await (const event of streamProcessor) {
|
|
3542
|
+
* if (event.event === 'thread.message.delta') {
|
|
3543
|
+
* console.log(event.data.delta.content);
|
|
3544
|
+
* }
|
|
3545
|
+
* }
|
|
3546
|
+
* ```
|
|
2850
3547
|
*/
|
|
2851
3548
|
waitAndHandleAssistantStreamToolCalls(userId: string, client: OpenAI, runStream: Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>, thread: OpenAI.Beta.Threads.Thread, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>;
|
|
2852
3549
|
/**
|
|
2853
3550
|
* Waits for the assistant tool calls and handles them.
|
|
2854
3551
|
*
|
|
2855
|
-
*
|
|
2856
|
-
*
|
|
2857
|
-
*
|
|
2858
|
-
*
|
|
2859
|
-
* @
|
|
3552
|
+
* This method polls an OpenAI Assistant run until it completes or requires action,
|
|
3553
|
+
* handles any tool calls, and returns the final run object. It's designed for
|
|
3554
|
+
* non-streaming Assistant interactions.
|
|
3555
|
+
*
|
|
3556
|
+
* @param {string} userId - The user ID for authentication and tracking
|
|
3557
|
+
* @param {OpenAI} client - The OpenAI client instance
|
|
3558
|
+
* @param {OpenAI.Beta.Threads.Run} run - The initial run object
|
|
3559
|
+
* @param {OpenAI.Beta.Threads.Thread} thread - The thread object
|
|
3560
|
+
* @param {ExecuteToolFnOptions} [options] - Optional execution options
|
|
3561
|
+
* @param {ExecuteToolModifiers} [modifiers] - Optional execution modifiers
|
|
3562
|
+
* @returns {Promise<OpenAI.Beta.Threads.Run>} The final run object after completion
|
|
3563
|
+
*
|
|
3564
|
+
* @example
|
|
3565
|
+
* ```typescript
|
|
3566
|
+
* // Process an OpenAI Assistant run with tool calls
|
|
3567
|
+
* const thread = await openai.beta.threads.create();
|
|
3568
|
+
* await openai.beta.threads.messages.create(thread.id, {
|
|
3569
|
+
* role: 'user',
|
|
3570
|
+
* content: 'Find information about Composio'
|
|
3571
|
+
* });
|
|
3572
|
+
*
|
|
3573
|
+
* let run = await openai.beta.threads.runs.create(thread.id, {
|
|
3574
|
+
* assistant_id: 'asst_abc123',
|
|
3575
|
+
* tools: provider.wrapTools(composioTools)
|
|
3576
|
+
* });
|
|
3577
|
+
*
|
|
3578
|
+
* // Wait for the run to complete, handling any tool calls
|
|
3579
|
+
* run = await provider.waitAndHandleAssistantToolCalls(
|
|
3580
|
+
* 'user123',
|
|
3581
|
+
* openai,
|
|
3582
|
+
* run,
|
|
3583
|
+
* thread,
|
|
3584
|
+
* { connectedAccountId: 'conn_xyz456' }
|
|
3585
|
+
* );
|
|
3586
|
+
*
|
|
3587
|
+
* // Get the final messages after run completion
|
|
3588
|
+
* const messages = await openai.beta.threads.messages.list(thread.id);
|
|
3589
|
+
* console.log(messages.data[0].content);
|
|
3590
|
+
* ```
|
|
2860
3591
|
*/
|
|
2861
3592
|
waitAndHandleAssistantToolCalls(userId: string, client: OpenAI, run: OpenAI.Beta.Threads.Run, thread: OpenAI.Beta.Threads.Thread, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.Beta.Threads.Runs.Run>;
|
|
2862
3593
|
}
|
|
2863
3594
|
|
|
2864
3595
|
type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown> = OpenAIProvider> = {
|
|
2865
|
-
apiKey?: string;
|
|
2866
|
-
baseURL?: string;
|
|
3596
|
+
apiKey?: string | null;
|
|
3597
|
+
baseURL?: string | null;
|
|
2867
3598
|
allowTracking?: boolean;
|
|
2868
3599
|
allowTracing?: boolean;
|
|
2869
3600
|
provider?: TProvider;
|
|
@@ -2884,7 +3615,6 @@ declare class Composio<TProvider extends BaseComposioProvider<unknown, unknown>
|
|
|
2884
3615
|
* @type {ComposioConfig<TProvider>}
|
|
2885
3616
|
*/
|
|
2886
3617
|
private config;
|
|
2887
|
-
private telemetry;
|
|
2888
3618
|
/**
|
|
2889
3619
|
* Core models for Composio.
|
|
2890
3620
|
*/
|
|
@@ -2894,25 +3624,39 @@ declare class Composio<TProvider extends BaseComposioProvider<unknown, unknown>
|
|
|
2894
3624
|
provider: TProvider;
|
|
2895
3625
|
authConfigs: AuthConfigs;
|
|
2896
3626
|
connectedAccounts: ConnectedAccounts;
|
|
2897
|
-
experimental: {
|
|
2898
|
-
connectionRequest: ReturnType<typeof connectionRequest>;
|
|
2899
|
-
};
|
|
2900
|
-
/**
|
|
2901
|
-
* @param {Object} config Configuration for the Composio SDK.
|
|
2902
|
-
* @param {string} config.apiKey The API key for the Composio SDK.
|
|
2903
|
-
* @param {string} config.baseURL The base URL for the Composio SDK.
|
|
2904
|
-
* @param {string} config.runtime The runtime for the Composio SDK.
|
|
2905
|
-
* @param {boolean} config.allowTracking Whether to allow analytics / tracking. Defaults to true.
|
|
2906
|
-
* @param {boolean} config.allowTracing Whether to allow tracing. Defaults to true.
|
|
2907
|
-
* @param {TProvider} config.provider The provider to use for this Composio instance.
|
|
2908
|
-
*/
|
|
2909
|
-
constructor(config: ComposioConfig<TProvider>);
|
|
2910
3627
|
/**
|
|
2911
|
-
*
|
|
2912
|
-
*
|
|
2913
|
-
*
|
|
3628
|
+
* Creates a new instance of the Composio SDK.
|
|
3629
|
+
*
|
|
3630
|
+
* The constructor initializes the SDK with the provided configuration options,
|
|
3631
|
+
* sets up the API client, and initializes all core models (tools, toolkits, etc.).
|
|
3632
|
+
*
|
|
3633
|
+
* @param {ComposioConfig<TProvider>} config - Configuration options for the Composio SDK
|
|
3634
|
+
* @param {string} [config.apiKey] - The API key for authenticating with the Composio API
|
|
3635
|
+
* @param {string} [config.baseURL] - The base URL for the Composio API (defaults to production URL)
|
|
3636
|
+
* @param {boolean} [config.allowTracking=true] - Whether to allow anonymous usage analytics
|
|
3637
|
+
* @param {boolean} [config.allowTracing=true] - Whether to allow request tracing for debugging
|
|
3638
|
+
* @param {TProvider} [config.provider] - The provider to use for this Composio instance (defaults to OpenAIProvider)
|
|
3639
|
+
* @param {BaseTelemetryTransport} [config.telemetryTransport] - Custom telemetry transport implementation
|
|
3640
|
+
*
|
|
3641
|
+
* @example
|
|
3642
|
+
* ```typescript
|
|
3643
|
+
* // Initialize with default configuration
|
|
3644
|
+
* const composio = new Composio();
|
|
3645
|
+
*
|
|
3646
|
+
* // Initialize with custom API key and base URL
|
|
3647
|
+
* const composio = new Composio({
|
|
3648
|
+
* apiKey: 'your-api-key',
|
|
3649
|
+
* baseURL: 'https://api.composio.dev'
|
|
3650
|
+
* });
|
|
3651
|
+
*
|
|
3652
|
+
* // Initialize with custom provider
|
|
3653
|
+
* const composio = new Composio({
|
|
3654
|
+
* apiKey: 'your-api-key',
|
|
3655
|
+
* provider: new CustomProvider()
|
|
3656
|
+
* });
|
|
3657
|
+
* ```
|
|
2914
3658
|
*/
|
|
2915
|
-
|
|
3659
|
+
constructor(config?: ComposioConfig<TProvider>);
|
|
2916
3660
|
/**
|
|
2917
3661
|
* Get the Composio SDK client.
|
|
2918
3662
|
* @returns {ComposioClient} The Composio API client.
|
|
@@ -2935,6 +3679,244 @@ declare class ComposioProvider extends BaseNonAgenticProvider<Array<CustomTool>,
|
|
|
2935
3679
|
wrapTools(tools: Tool[]): CustomTool[];
|
|
2936
3680
|
}
|
|
2937
3681
|
|
|
2938
|
-
|
|
3682
|
+
/**
|
|
3683
|
+
* Convert a JSON schema to a Zod schema
|
|
3684
|
+
* @param jsonSchema - The JSON schema to convert
|
|
3685
|
+
* @returns The Zod schema
|
|
3686
|
+
*
|
|
3687
|
+
* @example
|
|
3688
|
+
* ```ts
|
|
3689
|
+
* const zodSchema = jsonSchemaToZodSchema({
|
|
3690
|
+
* type: 'object',
|
|
3691
|
+
* properties: {
|
|
3692
|
+
* name: { type: 'string' },
|
|
3693
|
+
* },
|
|
3694
|
+
* });
|
|
3695
|
+
*
|
|
3696
|
+
* console.log(zodSchema);
|
|
3697
|
+
* ```
|
|
3698
|
+
*/
|
|
3699
|
+
declare function jsonSchemaToZodSchema(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
|
|
3700
|
+
|
|
3701
|
+
declare const LOG_LEVELS: {
|
|
3702
|
+
readonly silent: -1;
|
|
3703
|
+
readonly error: 0;
|
|
3704
|
+
readonly warn: 1;
|
|
3705
|
+
readonly info: 2;
|
|
3706
|
+
readonly debug: 3;
|
|
3707
|
+
};
|
|
3708
|
+
type LogLevel = keyof typeof LOG_LEVELS;
|
|
3709
|
+
interface LoggerOptions {
|
|
3710
|
+
level?: LogLevel;
|
|
3711
|
+
includeTimestamp?: boolean;
|
|
3712
|
+
}
|
|
3713
|
+
declare class Logger {
|
|
3714
|
+
private readonly level;
|
|
3715
|
+
private readonly includeTimestamp;
|
|
3716
|
+
private readonly console;
|
|
3717
|
+
constructor(options?: LoggerOptions);
|
|
3718
|
+
private formatMessage;
|
|
3719
|
+
private shouldLog;
|
|
3720
|
+
error(...args: unknown[]): void;
|
|
3721
|
+
warn(...args: unknown[]): void;
|
|
3722
|
+
info(...args: unknown[]): void;
|
|
3723
|
+
debug(...args: unknown[]): void;
|
|
3724
|
+
}
|
|
3725
|
+
declare const logger: Logger;
|
|
3726
|
+
|
|
3727
|
+
/**
|
|
3728
|
+
* Options for error handling
|
|
3729
|
+
*/
|
|
3730
|
+
interface ErrorHandleOptions {
|
|
3731
|
+
/** Whether to include the stack trace in the output */
|
|
3732
|
+
includeStack?: boolean;
|
|
3733
|
+
/** Whether to exit the process after handling */
|
|
3734
|
+
exitProcess?: boolean;
|
|
3735
|
+
/** The exit code to use if exiting the process */
|
|
3736
|
+
exitCode?: number;
|
|
3737
|
+
}
|
|
3738
|
+
/**
|
|
3739
|
+
* Options for creating a ComposioError
|
|
3740
|
+
*/
|
|
3741
|
+
type ComposioErrorOptions = {
|
|
3742
|
+
/** Error code for categorizing errors */
|
|
3743
|
+
code?: string;
|
|
3744
|
+
/** HTTP status code associated with the error */
|
|
3745
|
+
statusCode?: number;
|
|
3746
|
+
/** The underlying cause of the error */
|
|
3747
|
+
cause?: unknown;
|
|
3748
|
+
/** Additional metadata associated with the error */
|
|
3749
|
+
meta?: Record<string, unknown>;
|
|
3750
|
+
/** Suggested fixes for the error */
|
|
3751
|
+
possibleFixes?: string[];
|
|
3752
|
+
/** Custom stack trace */
|
|
3753
|
+
stack?: string;
|
|
3754
|
+
};
|
|
3755
|
+
/**
|
|
3756
|
+
* Base error class for all Composio errors
|
|
3757
|
+
*/
|
|
3758
|
+
declare class ComposioError extends Error {
|
|
3759
|
+
/** @readonly Error name */
|
|
3760
|
+
name: string;
|
|
3761
|
+
code?: string;
|
|
3762
|
+
possibleFixes?: string[];
|
|
3763
|
+
errorId?: string;
|
|
3764
|
+
/**
|
|
3765
|
+
* Creates a new ComposioError
|
|
3766
|
+
* @param message Error message
|
|
3767
|
+
* @param options Additional error options
|
|
3768
|
+
*/
|
|
3769
|
+
constructor(message: string, options?: ComposioErrorOptions);
|
|
3770
|
+
/**
|
|
3771
|
+
* Helper method to define a property only if it has a value
|
|
3772
|
+
* @param propertyName Name of the property to define
|
|
3773
|
+
* @param value Value to assign to the property
|
|
3774
|
+
* @private
|
|
3775
|
+
*/
|
|
3776
|
+
private definePropertyIfExists;
|
|
3777
|
+
/**
|
|
3778
|
+
* Helper method to combine stack traces when wrapping errors
|
|
3779
|
+
* This ensures the full call chain is preserved
|
|
3780
|
+
* @param originalStack The stack of the error being wrapped
|
|
3781
|
+
* @param currentStack The stack of the wrapper error
|
|
3782
|
+
* @returns Combined stack trace
|
|
3783
|
+
* @private
|
|
3784
|
+
*/
|
|
3785
|
+
private static combineStackTraces;
|
|
3786
|
+
/**
|
|
3787
|
+
* Extract and normalize error data for formatting
|
|
3788
|
+
* @param includeStack Whether to include stack trace information
|
|
3789
|
+
* @returns Structured error data for formatting
|
|
3790
|
+
* @private
|
|
3791
|
+
*/
|
|
3792
|
+
private getErrorData;
|
|
3793
|
+
/**
|
|
3794
|
+
* Prints a user-friendly, colorful representation of the error to the logger
|
|
3795
|
+
* @param includeStack Whether to include the stack trace in the output (default: false)
|
|
3796
|
+
*/
|
|
3797
|
+
prettyPrint(includeStack?: boolean): void;
|
|
3798
|
+
/**
|
|
3799
|
+
* Static factory method to create and pretty print an error in one step
|
|
3800
|
+
* @param message Error message
|
|
3801
|
+
* @param options Error options
|
|
3802
|
+
* @param includeStack Whether to include the stack trace in the output
|
|
3803
|
+
* @returns The created error instance
|
|
3804
|
+
*/
|
|
3805
|
+
static createAndPrint(message: string, options?: ComposioErrorOptions, includeStack?: boolean): ComposioError;
|
|
3806
|
+
/**
|
|
3807
|
+
* Utility function to handle errors in a consistent way
|
|
3808
|
+
* This properly displays the error and exits the process if needed
|
|
3809
|
+
* @param error The error to handle
|
|
3810
|
+
* @param options Options for error handling
|
|
3811
|
+
*/
|
|
3812
|
+
static handle(error: unknown, options?: ErrorHandleOptions): void;
|
|
3813
|
+
/**
|
|
3814
|
+
* Helper method to handle Zod validation errors
|
|
3815
|
+
* @param error The Zod error to handle
|
|
3816
|
+
* @param includeStack Whether to include the stack trace
|
|
3817
|
+
* @private
|
|
3818
|
+
*/
|
|
3819
|
+
private static handleZodError;
|
|
3820
|
+
/**
|
|
3821
|
+
* Helper method to handle standard Error objects
|
|
3822
|
+
* @param error The standard error to handle
|
|
3823
|
+
* @param includeStack Whether to include the stack trace
|
|
3824
|
+
* @private
|
|
3825
|
+
*/
|
|
3826
|
+
private static handleStandardError;
|
|
3827
|
+
/**
|
|
3828
|
+
* Helper method to handle unknown error types
|
|
3829
|
+
* @param error The unknown error value
|
|
3830
|
+
* @private
|
|
3831
|
+
*/
|
|
3832
|
+
private static handleUnknownError;
|
|
3833
|
+
}
|
|
3834
|
+
|
|
3835
|
+
declare const AuthConfigErrorCodes: {
|
|
3836
|
+
readonly AUTH_CONFIG_NOT_FOUND: "AUTH_CONFIG_NOT_FOUND";
|
|
3837
|
+
};
|
|
3838
|
+
declare class ComposioAuthConfigNotFoundError extends ComposioError {
|
|
3839
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3840
|
+
}
|
|
3841
|
+
|
|
3842
|
+
declare const ConnectedAccountErrorCodes: {
|
|
3843
|
+
readonly CONNECTED_ACCOUNT_NOT_FOUND: "CONNECTED_ACCOUNT_NOT_FOUND";
|
|
3844
|
+
};
|
|
3845
|
+
declare class ComposioConnectedAccountNotFoundError extends ComposioError {
|
|
3846
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3847
|
+
}
|
|
3848
|
+
|
|
3849
|
+
declare const ConnectionRequestErrorCodes: {
|
|
3850
|
+
readonly CONNECTION_REQUEST_TIMEOUT: "CONNECTION_REQUEST_TIMEOUT";
|
|
3851
|
+
readonly CONNECTION_REQUEST_FAILED: "CONNECTION_REQUEST_FAILED";
|
|
3852
|
+
};
|
|
3853
|
+
declare class ConnectionRequestTimeoutError extends ComposioError {
|
|
3854
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3855
|
+
}
|
|
3856
|
+
declare class ConnectionRequestFailedError extends ComposioError {
|
|
3857
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3858
|
+
}
|
|
3859
|
+
|
|
3860
|
+
declare const ToolErrorCodes: {
|
|
3861
|
+
readonly TOOLSET_NOT_DEFINED: "TOOLSET_NOT_DEFINED";
|
|
3862
|
+
readonly TOOL_NOT_FOUND: "TOOL_NOT_FOUND";
|
|
3863
|
+
readonly INVALID_MODIFIER: "INVALID_MODIFIER";
|
|
3864
|
+
readonly CUSTOM_TOOLS_NOT_INITIALIZED: "CUSTOM_TOOLS_NOT_INITIALIZED";
|
|
3865
|
+
readonly TOOL_EXECUTION_ERROR: "TOOL_EXECUTION_ERROR";
|
|
3866
|
+
readonly INVALID_EXECUTE_FUNCTION: "INVALID_EXECUTE_FUNCTION";
|
|
3867
|
+
readonly GLOBAL_EXECUTE_TOOL_FN_NOT_SET: "GLOBAL_EXECUTE_TOOL_FN_NOT_SET";
|
|
3868
|
+
};
|
|
3869
|
+
declare class ComposioProviderNotDefinedError extends ComposioError {
|
|
3870
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3871
|
+
}
|
|
3872
|
+
declare class ComposioToolNotFoundError extends ComposioError {
|
|
3873
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3874
|
+
}
|
|
3875
|
+
declare class ComposioInvalidModifierError extends ComposioError {
|
|
3876
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3877
|
+
}
|
|
3878
|
+
declare class ComposioCustomToolsNotInitializedError extends ComposioError {
|
|
3879
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3880
|
+
}
|
|
3881
|
+
declare class ComposioToolExecutionError extends ComposioError {
|
|
3882
|
+
readonly error: Error;
|
|
3883
|
+
constructor(message?: string, options?: ComposioErrorOptions & {
|
|
3884
|
+
originalError?: Error;
|
|
3885
|
+
});
|
|
3886
|
+
}
|
|
3887
|
+
declare class ComposioInvalidExecuteFunctionError extends ComposioError {
|
|
3888
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3889
|
+
}
|
|
3890
|
+
declare class ComposioGlobalExecuteToolFnNotSetError extends ComposioError {
|
|
3891
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code'>);
|
|
3892
|
+
}
|
|
3893
|
+
|
|
3894
|
+
declare const ToolkitErrorCodes: {
|
|
3895
|
+
readonly TOOLKIT_NOT_FOUND: "TOOLKIT_NOT_FOUND";
|
|
3896
|
+
};
|
|
3897
|
+
declare class ComposioToolkitNotFoundError extends ComposioError {
|
|
3898
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3899
|
+
}
|
|
3900
|
+
declare class ComposioToolkitFetchError extends ComposioError {
|
|
3901
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3902
|
+
}
|
|
3903
|
+
|
|
3904
|
+
/**
|
|
3905
|
+
* Represents an input validation error using Zod.
|
|
3906
|
+
*/
|
|
3907
|
+
declare const ValidationErrorCodes: {
|
|
3908
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
3909
|
+
};
|
|
3910
|
+
declare class ValidationError extends ComposioError {
|
|
3911
|
+
constructor(message?: string, options?: ComposioErrorOptions);
|
|
3912
|
+
private generateUserFriendlyMessage;
|
|
3913
|
+
}
|
|
3914
|
+
|
|
3915
|
+
declare const SDKErrorCodes: {
|
|
3916
|
+
NO_API_KEY_PROVIDED: string;
|
|
3917
|
+
};
|
|
3918
|
+
declare class ComposioNoAPIKeyError extends ComposioError {
|
|
3919
|
+
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3920
|
+
}
|
|
2939
3921
|
|
|
2940
|
-
export { type
|
|
3922
|
+
export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BaseTelemetryTransport, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConsoleTelemetryTransport, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIProvider, type Provider, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, ToolkitErrorCodes, type TransformToolSchemaModifier, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToZodSchema, logger };
|