@composio/core 0.1.6-alpha.0 → 0.1.9-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.cjs +1271 -757
- package/dist/index.d.cts +598 -347
- package/dist/index.d.ts +598 -347
- package/dist/index.js +1239 -727
- package/package.json +4 -6
- package/src/index.ts +23 -0
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { z, ZodObject, ZodString, ZodNumber, ZodBoolean, ZodOptional } from 'zod
|
|
|
3
3
|
import { ToolProxyParams, ToolProxyResponse, ToolRetrieveEnumResponse, ToolGetInputParams, ToolGetInputResponse } from '@composio/client/resources/tools';
|
|
4
4
|
import { RequestOptions } from '@composio/client/internal/request-options';
|
|
5
5
|
import { TriggerInstanceListActiveParams, TriggerInstanceUpsertParams, TriggerInstanceUpsertResponse, TriggerInstanceRemoveUpsertResponse, TriggerInstanceUpdateStatusParams, TriggersTypeListParams, TriggersTypeListResponse, TriggersTypeRetrieveResponse, TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
|
|
6
|
-
import {
|
|
7
|
-
import { ConnectedAccountListParams, ConnectedAccountListResponse,
|
|
6
|
+
import { AuthConfigUpdateResponse, AuthConfigDeleteResponse, AuthConfigUpdateStatusResponse } from '@composio/client/resources/auth-configs';
|
|
7
|
+
import { ConnectedAccountListParams, ConnectedAccountListResponse, ConnectedAccountRetrieveResponse as ConnectedAccountRetrieveResponse$1, ConnectedAccountDeleteResponse, ConnectedAccountRefreshResponse, ConnectedAccountUpdateStatusParams, ConnectedAccountUpdateStatusResponse } from '@composio/client/resources/connected-accounts';
|
|
8
8
|
import { OpenAI } from 'openai';
|
|
9
9
|
import { Stream } from 'openai/streaming';
|
|
10
10
|
|
|
@@ -71,26 +71,26 @@ type ToolList = Array<Tool>;
|
|
|
71
71
|
* ToolListParams is the parameters for the list of tools.
|
|
72
72
|
*/
|
|
73
73
|
declare const ToolListParamsSchema: z.ZodObject<{
|
|
74
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
74
75
|
cursor: z.ZodOptional<z.ZodString>;
|
|
75
76
|
important: z.ZodOptional<z.ZodString>;
|
|
76
77
|
limit: z.ZodOptional<z.ZodString>;
|
|
77
78
|
search: z.ZodOptional<z.ZodString>;
|
|
78
79
|
toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
79
|
-
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
80
|
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
tools?: string[] | undefined;
|
|
81
82
|
cursor?: string | undefined;
|
|
82
83
|
important?: string | undefined;
|
|
83
84
|
limit?: string | undefined;
|
|
84
85
|
search?: string | undefined;
|
|
85
86
|
toolkits?: string[] | undefined;
|
|
86
|
-
tools?: string[] | undefined;
|
|
87
87
|
}, {
|
|
88
|
+
tools?: string[] | undefined;
|
|
88
89
|
cursor?: string | undefined;
|
|
89
90
|
important?: string | undefined;
|
|
90
91
|
limit?: string | undefined;
|
|
91
92
|
search?: string | undefined;
|
|
92
93
|
toolkits?: string[] | undefined;
|
|
93
|
-
tools?: string[] | undefined;
|
|
94
94
|
}>;
|
|
95
95
|
type ToolListParams = z.infer<typeof ToolListParamsSchema>;
|
|
96
96
|
/**
|
|
@@ -250,56 +250,6 @@ interface ExecuteMetadata {
|
|
|
250
250
|
connectedAccountId?: string;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
/**
|
|
254
|
-
* @fileoverview Custom tools class for Composio SDK, used to manage custom tools created by users.
|
|
255
|
-
*
|
|
256
|
-
* @author Musthaq Ahamad <musthaq@composio.dev>
|
|
257
|
-
* @date 2025-05-05
|
|
258
|
-
* @module CustomTools
|
|
259
|
-
*/
|
|
260
|
-
|
|
261
|
-
declare class CustomTools {
|
|
262
|
-
private client;
|
|
263
|
-
private customToolsRegistry;
|
|
264
|
-
constructor(client: ComposioClient);
|
|
265
|
-
/**
|
|
266
|
-
* Create a custom tool and registers it in the registry.
|
|
267
|
-
* This is just an in memory registry and is not persisted.
|
|
268
|
-
* @param {CustomToolOptions} toolOptions CustomToolOptions
|
|
269
|
-
* @returns {Tool} The tool created
|
|
270
|
-
*/
|
|
271
|
-
createTool(toolOptions: CustomToolOptions): Promise<Tool>;
|
|
272
|
-
/**
|
|
273
|
-
* Get all the custom tools from the registry.
|
|
274
|
-
* @param {string[]} param0.toolSlugs The slugs of the tools to get
|
|
275
|
-
* @returns {ToolList} The list of tools
|
|
276
|
-
*/
|
|
277
|
-
getCustomTools({ toolSlugs }: {
|
|
278
|
-
toolSlugs?: string[];
|
|
279
|
-
}): Promise<ToolList>;
|
|
280
|
-
/**
|
|
281
|
-
* Get a custom tool by slug from the registry.
|
|
282
|
-
* @param {string} slug The slug of the tool to get
|
|
283
|
-
* @returns {Tool} The tool
|
|
284
|
-
*/
|
|
285
|
-
getCustomToolBySlug(slug: string): Promise<Tool | null>;
|
|
286
|
-
/**
|
|
287
|
-
* Get the connected account for the user and toolkit.
|
|
288
|
-
* @param {string} toolkitSlug The slug of the toolkit
|
|
289
|
-
* @param {ExecuteMetadata} metadata The metadata of the execution
|
|
290
|
-
* @returns {ConnectedAccount} The connected account
|
|
291
|
-
*/
|
|
292
|
-
private getConnectedAccount;
|
|
293
|
-
/**
|
|
294
|
-
* Execute a custom tool
|
|
295
|
-
* @param {slug} slug The slug of the tool to execute
|
|
296
|
-
* @param {Record<string, unknown>} inputParams The input parameters for the tool
|
|
297
|
-
* @param {ExecuteMetadata} metadata The metadata of the execution
|
|
298
|
-
* @returns {Promise<ToolExecuteResponse>} The response from the tool
|
|
299
|
-
*/
|
|
300
|
-
executeCustomTool(slug: string, inputParams: Record<string, unknown>, metadata: ExecuteMetadata): Promise<ToolExecuteResponse>;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
253
|
/**
|
|
304
254
|
* Base toolset implementation, which needs to be implemented by the extended class.
|
|
305
255
|
* This class is used to create a base toolset by implementing this class.
|
|
@@ -412,17 +362,17 @@ type BaseComposioToolset<TToolCollection, TTool> = BaseNonAgenticToolset<TToolCo
|
|
|
412
362
|
* Modifier for altering the tool execute params
|
|
413
363
|
* Called before the tool execute call
|
|
414
364
|
*/
|
|
415
|
-
type BeforeToolExecuteModifier = (toolSlug: string, toolExecuteParams: ToolExecuteParams) => ToolExecuteParams;
|
|
365
|
+
type BeforeToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExecuteParams: ToolExecuteParams) => ToolExecuteParams;
|
|
416
366
|
/**
|
|
417
367
|
* Modifier for altering the tool execute response
|
|
418
368
|
* Called after the tool execute call
|
|
419
369
|
*/
|
|
420
|
-
type AfterToolExecuteModifier = (toolSlug: string, toolExecuteResponse: ToolExecuteResponse) => ToolExecuteResponse;
|
|
370
|
+
type AfterToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExecuteResponse: ToolExecuteResponse) => ToolExecuteResponse;
|
|
421
371
|
/**
|
|
422
372
|
* Modifier for altering the tool schema
|
|
423
373
|
* Called after the tool schema is retrieved
|
|
424
374
|
*/
|
|
425
|
-
type TransformToolSchemaModifier = (toolSlug: string, toolSchema: Tool) => Tool;
|
|
375
|
+
type TransformToolSchemaModifier = (toolSlug: string, toolkitSlug: string, toolSchema: Tool) => Tool;
|
|
426
376
|
/**
|
|
427
377
|
* Non Agentic tool options. These are used by Non-Agentic toolsets
|
|
428
378
|
*/
|
|
@@ -458,7 +408,7 @@ type ToolsetOptions<T extends BaseComposioToolset<unknown, unknown>> = T extends
|
|
|
458
408
|
*/
|
|
459
409
|
declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset<TToolCollection, TTool>> {
|
|
460
410
|
private client;
|
|
461
|
-
customTools
|
|
411
|
+
private readonly customTools;
|
|
462
412
|
private toolset;
|
|
463
413
|
constructor(client: ComposioClient, toolset: TToolset);
|
|
464
414
|
/**
|
|
@@ -499,8 +449,8 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
|
|
|
499
449
|
* @returns {Promise<Tool>} The tool
|
|
500
450
|
*/
|
|
501
451
|
getComposioToolBySlug(userId: string, slug: string, modifier?: TransformToolSchemaModifier): Promise<Tool>;
|
|
502
|
-
get(userId: string, slug: string, options?: ToolsetOptions<TToolset>): Promise<
|
|
503
|
-
get(userId: string, filters: ToolListParams, options?: ToolsetOptions<TToolset>): Promise<
|
|
452
|
+
get<T extends TToolset>(userId: string, slug: string, options?: ToolsetOptions<TToolset>): Promise<ReturnType<T['wrapTool']>>;
|
|
453
|
+
get<T extends TToolset>(userId: string, filters: ToolListParams, options?: ToolsetOptions<TToolset>): Promise<ReturnType<T['wrapTools']>>;
|
|
504
454
|
/**
|
|
505
455
|
* Creates a function that executes a tool.
|
|
506
456
|
* This function is used by agentic the toolsets to execute the tool
|
|
@@ -509,6 +459,8 @@ declare class Tools<TToolCollection, TTool, TToolset extends BaseComposioToolset
|
|
|
509
459
|
* @returns {ExecuteToolFn} The execute tool function
|
|
510
460
|
*/
|
|
511
461
|
private createExecuteToolFn;
|
|
462
|
+
private handleCustomToolExecution;
|
|
463
|
+
private handleComposioToolExecution;
|
|
512
464
|
/**
|
|
513
465
|
* Exectes a given tool with the provided parameters.
|
|
514
466
|
*
|
|
@@ -573,44 +525,47 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
573
525
|
name: z.ZodString;
|
|
574
526
|
slug: z.ZodString;
|
|
575
527
|
meta: z.ZodObject<{
|
|
576
|
-
categories: z.ZodArray<z.ZodObject<{
|
|
577
|
-
|
|
528
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
529
|
+
slug: z.ZodString;
|
|
578
530
|
name: z.ZodString;
|
|
579
531
|
}, "strip", z.ZodTypeAny, {
|
|
532
|
+
slug: string;
|
|
580
533
|
name: string;
|
|
581
|
-
id: string;
|
|
582
534
|
}, {
|
|
535
|
+
slug: string;
|
|
583
536
|
name: string;
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
createdAt: z.ZodString
|
|
587
|
-
description: z.ZodString
|
|
588
|
-
logo: z.ZodString
|
|
589
|
-
toolsCount: z.ZodNumber
|
|
590
|
-
triggersCount: z.ZodNumber
|
|
591
|
-
updatedAt: z.ZodString
|
|
537
|
+
}>, "many">>;
|
|
538
|
+
appUrl: z.ZodOptional<z.ZodString>;
|
|
539
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
540
|
+
description: z.ZodOptional<z.ZodString>;
|
|
541
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
542
|
+
toolsCount: z.ZodOptional<z.ZodNumber>;
|
|
543
|
+
triggersCount: z.ZodOptional<z.ZodNumber>;
|
|
544
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
592
545
|
}, "strip", z.ZodTypeAny, {
|
|
593
|
-
logo
|
|
594
|
-
description
|
|
595
|
-
categories
|
|
546
|
+
logo?: string | undefined;
|
|
547
|
+
description?: string | undefined;
|
|
548
|
+
categories?: {
|
|
549
|
+
slug: string;
|
|
596
550
|
name: string;
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
createdAt
|
|
600
|
-
toolsCount
|
|
601
|
-
triggersCount
|
|
602
|
-
updatedAt
|
|
551
|
+
}[] | undefined;
|
|
552
|
+
appUrl?: string | undefined;
|
|
553
|
+
createdAt?: string | undefined;
|
|
554
|
+
toolsCount?: number | undefined;
|
|
555
|
+
triggersCount?: number | undefined;
|
|
556
|
+
updatedAt?: string | undefined;
|
|
603
557
|
}, {
|
|
604
|
-
logo
|
|
605
|
-
description
|
|
606
|
-
categories
|
|
558
|
+
logo?: string | undefined;
|
|
559
|
+
description?: string | undefined;
|
|
560
|
+
categories?: {
|
|
561
|
+
slug: string;
|
|
607
562
|
name: string;
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
createdAt
|
|
611
|
-
toolsCount
|
|
612
|
-
triggersCount
|
|
613
|
-
updatedAt
|
|
563
|
+
}[] | undefined;
|
|
564
|
+
appUrl?: string | undefined;
|
|
565
|
+
createdAt?: string | undefined;
|
|
566
|
+
toolsCount?: number | undefined;
|
|
567
|
+
triggersCount?: number | undefined;
|
|
568
|
+
updatedAt?: string | undefined;
|
|
614
569
|
}>;
|
|
615
570
|
isLocalToolkit: z.ZodBoolean;
|
|
616
571
|
authSchemes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -620,16 +575,17 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
620
575
|
slug: string;
|
|
621
576
|
name: string;
|
|
622
577
|
meta: {
|
|
623
|
-
logo
|
|
624
|
-
description
|
|
625
|
-
categories
|
|
578
|
+
logo?: string | undefined;
|
|
579
|
+
description?: string | undefined;
|
|
580
|
+
categories?: {
|
|
581
|
+
slug: string;
|
|
626
582
|
name: string;
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
createdAt
|
|
630
|
-
toolsCount
|
|
631
|
-
triggersCount
|
|
632
|
-
updatedAt
|
|
583
|
+
}[] | undefined;
|
|
584
|
+
appUrl?: string | undefined;
|
|
585
|
+
createdAt?: string | undefined;
|
|
586
|
+
toolsCount?: number | undefined;
|
|
587
|
+
triggersCount?: number | undefined;
|
|
588
|
+
updatedAt?: string | undefined;
|
|
633
589
|
};
|
|
634
590
|
isLocalToolkit: boolean;
|
|
635
591
|
authSchemes?: string[] | undefined;
|
|
@@ -639,16 +595,17 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
639
595
|
slug: string;
|
|
640
596
|
name: string;
|
|
641
597
|
meta: {
|
|
642
|
-
logo
|
|
643
|
-
description
|
|
644
|
-
categories
|
|
598
|
+
logo?: string | undefined;
|
|
599
|
+
description?: string | undefined;
|
|
600
|
+
categories?: {
|
|
601
|
+
slug: string;
|
|
645
602
|
name: string;
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
createdAt
|
|
649
|
-
toolsCount
|
|
650
|
-
triggersCount
|
|
651
|
-
updatedAt
|
|
603
|
+
}[] | undefined;
|
|
604
|
+
appUrl?: string | undefined;
|
|
605
|
+
createdAt?: string | undefined;
|
|
606
|
+
toolsCount?: number | undefined;
|
|
607
|
+
triggersCount?: number | undefined;
|
|
608
|
+
updatedAt?: string | undefined;
|
|
652
609
|
};
|
|
653
610
|
isLocalToolkit: boolean;
|
|
654
611
|
authSchemes?: string[] | undefined;
|
|
@@ -662,16 +619,17 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
662
619
|
slug: string;
|
|
663
620
|
name: string;
|
|
664
621
|
meta: {
|
|
665
|
-
logo
|
|
666
|
-
description
|
|
667
|
-
categories
|
|
622
|
+
logo?: string | undefined;
|
|
623
|
+
description?: string | undefined;
|
|
624
|
+
categories?: {
|
|
625
|
+
slug: string;
|
|
668
626
|
name: string;
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
createdAt
|
|
672
|
-
toolsCount
|
|
673
|
-
triggersCount
|
|
674
|
-
updatedAt
|
|
627
|
+
}[] | undefined;
|
|
628
|
+
appUrl?: string | undefined;
|
|
629
|
+
createdAt?: string | undefined;
|
|
630
|
+
toolsCount?: number | undefined;
|
|
631
|
+
triggersCount?: number | undefined;
|
|
632
|
+
updatedAt?: string | undefined;
|
|
675
633
|
};
|
|
676
634
|
isLocalToolkit: boolean;
|
|
677
635
|
authSchemes?: string[] | undefined;
|
|
@@ -685,16 +643,17 @@ declare const ToolKitListResponseSchema: z.ZodObject<{
|
|
|
685
643
|
slug: string;
|
|
686
644
|
name: string;
|
|
687
645
|
meta: {
|
|
688
|
-
logo
|
|
689
|
-
description
|
|
690
|
-
categories
|
|
646
|
+
logo?: string | undefined;
|
|
647
|
+
description?: string | undefined;
|
|
648
|
+
categories?: {
|
|
649
|
+
slug: string;
|
|
691
650
|
name: string;
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
createdAt
|
|
695
|
-
toolsCount
|
|
696
|
-
triggersCount
|
|
697
|
-
updatedAt
|
|
651
|
+
}[] | undefined;
|
|
652
|
+
appUrl?: string | undefined;
|
|
653
|
+
createdAt?: string | undefined;
|
|
654
|
+
toolsCount?: number | undefined;
|
|
655
|
+
triggersCount?: number | undefined;
|
|
656
|
+
updatedAt?: string | undefined;
|
|
698
657
|
};
|
|
699
658
|
isLocalToolkit: boolean;
|
|
700
659
|
authSchemes?: string[] | undefined;
|
|
@@ -709,51 +668,54 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
|
709
668
|
name: z.ZodString;
|
|
710
669
|
slug: z.ZodString;
|
|
711
670
|
meta: z.ZodObject<{
|
|
712
|
-
categories: z.ZodArray<z.ZodObject<{
|
|
713
|
-
|
|
671
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
672
|
+
slug: z.ZodString;
|
|
714
673
|
name: z.ZodString;
|
|
715
674
|
}, "strip", z.ZodTypeAny, {
|
|
675
|
+
slug: string;
|
|
716
676
|
name: string;
|
|
717
|
-
id: string;
|
|
718
677
|
}, {
|
|
678
|
+
slug: string;
|
|
719
679
|
name: string;
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
createdAt: z.ZodString
|
|
723
|
-
description: z.ZodString
|
|
724
|
-
logo: z.ZodString
|
|
725
|
-
toolsCount: z.ZodNumber
|
|
726
|
-
triggersCount: z.ZodNumber
|
|
727
|
-
updatedAt: z.ZodString
|
|
680
|
+
}>, "many">>;
|
|
681
|
+
appUrl: z.ZodOptional<z.ZodString>;
|
|
682
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
683
|
+
description: z.ZodOptional<z.ZodString>;
|
|
684
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
685
|
+
toolsCount: z.ZodOptional<z.ZodNumber>;
|
|
686
|
+
triggersCount: z.ZodOptional<z.ZodNumber>;
|
|
687
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
728
688
|
}, "strip", z.ZodTypeAny, {
|
|
729
|
-
logo
|
|
730
|
-
description
|
|
731
|
-
categories
|
|
689
|
+
logo?: string | undefined;
|
|
690
|
+
description?: string | undefined;
|
|
691
|
+
categories?: {
|
|
692
|
+
slug: string;
|
|
732
693
|
name: string;
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
createdAt
|
|
736
|
-
toolsCount
|
|
737
|
-
triggersCount
|
|
738
|
-
updatedAt
|
|
694
|
+
}[] | undefined;
|
|
695
|
+
appUrl?: string | undefined;
|
|
696
|
+
createdAt?: string | undefined;
|
|
697
|
+
toolsCount?: number | undefined;
|
|
698
|
+
triggersCount?: number | undefined;
|
|
699
|
+
updatedAt?: string | undefined;
|
|
739
700
|
}, {
|
|
740
|
-
logo
|
|
741
|
-
description
|
|
742
|
-
categories
|
|
701
|
+
logo?: string | undefined;
|
|
702
|
+
description?: string | undefined;
|
|
703
|
+
categories?: {
|
|
704
|
+
slug: string;
|
|
743
705
|
name: string;
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
createdAt
|
|
747
|
-
toolsCount
|
|
748
|
-
triggersCount
|
|
749
|
-
updatedAt
|
|
706
|
+
}[] | undefined;
|
|
707
|
+
appUrl?: string | undefined;
|
|
708
|
+
createdAt?: string | undefined;
|
|
709
|
+
toolsCount?: number | undefined;
|
|
710
|
+
triggersCount?: number | undefined;
|
|
711
|
+
updatedAt?: string | undefined;
|
|
750
712
|
}>;
|
|
751
713
|
isLocalToolkit: z.ZodBoolean;
|
|
752
714
|
composioManagedAuthSchemes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
753
715
|
authConfigDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
754
716
|
name: z.ZodString;
|
|
755
717
|
mode: z.ZodString;
|
|
756
|
-
fields: z.
|
|
718
|
+
fields: z.ZodObject<{
|
|
757
719
|
authConfigCreation: z.ZodObject<{
|
|
758
720
|
optional: z.ZodArray<z.ZodObject<{
|
|
759
721
|
name: z.ZodString;
|
|
@@ -932,13 +894,13 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
|
932
894
|
default?: string | null | undefined;
|
|
933
895
|
}[];
|
|
934
896
|
};
|
|
935
|
-
}
|
|
897
|
+
}>;
|
|
936
898
|
proxy: z.ZodObject<{
|
|
937
|
-
|
|
899
|
+
baseUrl: z.ZodString;
|
|
938
900
|
}, "strip", z.ZodTypeAny, {
|
|
939
|
-
|
|
901
|
+
baseUrl: string;
|
|
940
902
|
}, {
|
|
941
|
-
|
|
903
|
+
baseUrl: string;
|
|
942
904
|
}>;
|
|
943
905
|
}, "strip", z.ZodTypeAny, {
|
|
944
906
|
name: string;
|
|
@@ -972,9 +934,9 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
|
972
934
|
default?: string | null | undefined;
|
|
973
935
|
}[];
|
|
974
936
|
};
|
|
975
|
-
}
|
|
937
|
+
};
|
|
976
938
|
proxy: {
|
|
977
|
-
|
|
939
|
+
baseUrl: string;
|
|
978
940
|
};
|
|
979
941
|
}, {
|
|
980
942
|
name: string;
|
|
@@ -1008,25 +970,26 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
|
1008
970
|
default?: string | null | undefined;
|
|
1009
971
|
}[];
|
|
1010
972
|
};
|
|
1011
|
-
}
|
|
973
|
+
};
|
|
1012
974
|
proxy: {
|
|
1013
|
-
|
|
975
|
+
baseUrl: string;
|
|
1014
976
|
};
|
|
1015
977
|
}>, "many">>;
|
|
1016
978
|
}, "strip", z.ZodTypeAny, {
|
|
1017
979
|
slug: string;
|
|
1018
980
|
name: string;
|
|
1019
981
|
meta: {
|
|
1020
|
-
logo
|
|
1021
|
-
description
|
|
1022
|
-
categories
|
|
982
|
+
logo?: string | undefined;
|
|
983
|
+
description?: string | undefined;
|
|
984
|
+
categories?: {
|
|
985
|
+
slug: string;
|
|
1023
986
|
name: string;
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
createdAt
|
|
1027
|
-
toolsCount
|
|
1028
|
-
triggersCount
|
|
1029
|
-
updatedAt
|
|
987
|
+
}[] | undefined;
|
|
988
|
+
appUrl?: string | undefined;
|
|
989
|
+
createdAt?: string | undefined;
|
|
990
|
+
toolsCount?: number | undefined;
|
|
991
|
+
triggersCount?: number | undefined;
|
|
992
|
+
updatedAt?: string | undefined;
|
|
1030
993
|
};
|
|
1031
994
|
isLocalToolkit: boolean;
|
|
1032
995
|
composioManagedAuthSchemes?: string[] | undefined;
|
|
@@ -1062,25 +1025,26 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
|
1062
1025
|
default?: string | null | undefined;
|
|
1063
1026
|
}[];
|
|
1064
1027
|
};
|
|
1065
|
-
}
|
|
1028
|
+
};
|
|
1066
1029
|
proxy: {
|
|
1067
|
-
|
|
1030
|
+
baseUrl: string;
|
|
1068
1031
|
};
|
|
1069
1032
|
}[] | undefined;
|
|
1070
1033
|
}, {
|
|
1071
1034
|
slug: string;
|
|
1072
1035
|
name: string;
|
|
1073
1036
|
meta: {
|
|
1074
|
-
logo
|
|
1075
|
-
description
|
|
1076
|
-
categories
|
|
1037
|
+
logo?: string | undefined;
|
|
1038
|
+
description?: string | undefined;
|
|
1039
|
+
categories?: {
|
|
1040
|
+
slug: string;
|
|
1077
1041
|
name: string;
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
createdAt
|
|
1081
|
-
toolsCount
|
|
1082
|
-
triggersCount
|
|
1083
|
-
updatedAt
|
|
1042
|
+
}[] | undefined;
|
|
1043
|
+
appUrl?: string | undefined;
|
|
1044
|
+
createdAt?: string | undefined;
|
|
1045
|
+
toolsCount?: number | undefined;
|
|
1046
|
+
triggersCount?: number | undefined;
|
|
1047
|
+
updatedAt?: string | undefined;
|
|
1084
1048
|
};
|
|
1085
1049
|
isLocalToolkit: boolean;
|
|
1086
1050
|
composioManagedAuthSchemes?: string[] | undefined;
|
|
@@ -1116,9 +1080,9 @@ declare const ToolkitRetrieveResponseSchema: z.ZodObject<{
|
|
|
1116
1080
|
default?: string | null | undefined;
|
|
1117
1081
|
}[];
|
|
1118
1082
|
};
|
|
1119
|
-
}
|
|
1083
|
+
};
|
|
1120
1084
|
proxy: {
|
|
1121
|
-
|
|
1085
|
+
baseUrl: string;
|
|
1122
1086
|
};
|
|
1123
1087
|
}[] | undefined;
|
|
1124
1088
|
}>;
|
|
@@ -1153,6 +1117,136 @@ declare const ToolkitRetrieveCategoriesResponseSchema: z.ZodObject<{
|
|
|
1153
1117
|
}>;
|
|
1154
1118
|
type ToolkitRetrieveCategoriesResponse = z.infer<typeof ToolkitRetrieveCategoriesResponseSchema>;
|
|
1155
1119
|
|
|
1120
|
+
/**
|
|
1121
|
+
* Connected Account create parameters
|
|
1122
|
+
*/
|
|
1123
|
+
declare const ConnectedAccountStatuses: {
|
|
1124
|
+
readonly ACTIVE: "ACTIVE";
|
|
1125
|
+
readonly INACTIVE: "INACTIVE";
|
|
1126
|
+
readonly PENDING: "DELETED";
|
|
1127
|
+
readonly INITIATED: "INITIATED";
|
|
1128
|
+
readonly EXPIRED: "EXPIRED";
|
|
1129
|
+
readonly FAILED: "FAILED";
|
|
1130
|
+
};
|
|
1131
|
+
type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
|
|
1132
|
+
type CreateConnectedAccountOptions = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1133
|
+
declare const CreateConnectedAccountOptionsSchema: z.ZodObject<{
|
|
1134
|
+
redirectUrl: z.ZodOptional<z.ZodString>;
|
|
1135
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1136
|
+
}, "strip", z.ZodTypeAny, {
|
|
1137
|
+
data?: Record<string, unknown> | undefined;
|
|
1138
|
+
redirectUrl?: string | undefined;
|
|
1139
|
+
}, {
|
|
1140
|
+
data?: Record<string, unknown> | undefined;
|
|
1141
|
+
redirectUrl?: string | undefined;
|
|
1142
|
+
}>;
|
|
1143
|
+
type CreateConnectedAccountOptionsSchema = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1144
|
+
declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
1145
|
+
id: z.ZodString;
|
|
1146
|
+
authConfig: z.ZodObject<{
|
|
1147
|
+
id: z.ZodString;
|
|
1148
|
+
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"]>;
|
|
1149
|
+
isComposioManaged: z.ZodBoolean;
|
|
1150
|
+
isDisabled: z.ZodBoolean;
|
|
1151
|
+
}, "strip", z.ZodTypeAny, {
|
|
1152
|
+
id: string;
|
|
1153
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1154
|
+
isComposioManaged: boolean;
|
|
1155
|
+
isDisabled: boolean;
|
|
1156
|
+
}, {
|
|
1157
|
+
id: string;
|
|
1158
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1159
|
+
isComposioManaged: boolean;
|
|
1160
|
+
isDisabled: boolean;
|
|
1161
|
+
}>;
|
|
1162
|
+
userId: z.ZodString;
|
|
1163
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1164
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1165
|
+
status: z.ZodEnum<["ACTIVE", "INACTIVE", "DELETED", "INITIATED", "EXPIRED", "FAILED"]>;
|
|
1166
|
+
statusReason: z.ZodNullable<z.ZodString>;
|
|
1167
|
+
toolkit: z.ZodObject<{
|
|
1168
|
+
slug: z.ZodString;
|
|
1169
|
+
}, "strip", z.ZodTypeAny, {
|
|
1170
|
+
slug: string;
|
|
1171
|
+
}, {
|
|
1172
|
+
slug: string;
|
|
1173
|
+
}>;
|
|
1174
|
+
testRequestEndpoint: z.ZodOptional<z.ZodString>;
|
|
1175
|
+
isDisabled: z.ZodBoolean;
|
|
1176
|
+
createdAt: z.ZodString;
|
|
1177
|
+
updatedAt: z.ZodString;
|
|
1178
|
+
}, "strip", z.ZodTypeAny, {
|
|
1179
|
+
params: Record<string, unknown>;
|
|
1180
|
+
status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
|
|
1181
|
+
toolkit: {
|
|
1182
|
+
slug: string;
|
|
1183
|
+
};
|
|
1184
|
+
userId: string;
|
|
1185
|
+
data: Record<string, unknown>;
|
|
1186
|
+
createdAt: string;
|
|
1187
|
+
updatedAt: string;
|
|
1188
|
+
id: string;
|
|
1189
|
+
authConfig: {
|
|
1190
|
+
id: string;
|
|
1191
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1192
|
+
isComposioManaged: boolean;
|
|
1193
|
+
isDisabled: boolean;
|
|
1194
|
+
};
|
|
1195
|
+
isDisabled: boolean;
|
|
1196
|
+
statusReason: string | null;
|
|
1197
|
+
testRequestEndpoint?: string | undefined;
|
|
1198
|
+
}, {
|
|
1199
|
+
params: Record<string, unknown>;
|
|
1200
|
+
status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
|
|
1201
|
+
toolkit: {
|
|
1202
|
+
slug: string;
|
|
1203
|
+
};
|
|
1204
|
+
userId: string;
|
|
1205
|
+
data: Record<string, unknown>;
|
|
1206
|
+
createdAt: string;
|
|
1207
|
+
updatedAt: string;
|
|
1208
|
+
id: string;
|
|
1209
|
+
authConfig: {
|
|
1210
|
+
id: string;
|
|
1211
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1212
|
+
isComposioManaged: boolean;
|
|
1213
|
+
isDisabled: boolean;
|
|
1214
|
+
};
|
|
1215
|
+
isDisabled: boolean;
|
|
1216
|
+
statusReason: string | null;
|
|
1217
|
+
testRequestEndpoint?: string | undefined;
|
|
1218
|
+
}>;
|
|
1219
|
+
type ConnectedAccountRetrieveResponse = z.infer<typeof ConnectedAccountRetrieveResponseSchema>;
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* @fileoverview Connection request class for Composio SDK, used to manage an initiated connection request.
|
|
1223
|
+
*
|
|
1224
|
+
* @author Musthaq Ahamad <musthaq@composio.dev>
|
|
1225
|
+
* @date 2025-05-05
|
|
1226
|
+
* @module ConnectionRequest
|
|
1227
|
+
*/
|
|
1228
|
+
|
|
1229
|
+
declare class ConnectionRequest {
|
|
1230
|
+
private client;
|
|
1231
|
+
private connectedAccountId;
|
|
1232
|
+
private connectedAccountStatus;
|
|
1233
|
+
redirectUrl?: string | null;
|
|
1234
|
+
constructor(client: ComposioClient, connectedAccountId: string, connectedAccountStatus: ConnectedAccountStatus, redirectUrl?: string | null);
|
|
1235
|
+
/**
|
|
1236
|
+
* Transform the response from the Composio API to the SDK format
|
|
1237
|
+
* @param response
|
|
1238
|
+
* @returns
|
|
1239
|
+
*/
|
|
1240
|
+
private transformResponse;
|
|
1241
|
+
/**
|
|
1242
|
+
* Wait for the connection to be established.
|
|
1243
|
+
* The function will poll the Composio API every second until the connection is established or the timeout is reached.
|
|
1244
|
+
* @param {number} timeout - The time in milliseconds to wait for the connection to be established. Default is 30 seconds.
|
|
1245
|
+
* @returns
|
|
1246
|
+
*/
|
|
1247
|
+
waitForConnection(timeout?: number): Promise<ConnectedAccountRetrieveResponse>;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1156
1250
|
/**
|
|
1157
1251
|
* Toolkits class
|
|
1158
1252
|
*
|
|
@@ -1196,6 +1290,15 @@ declare class Toolkits {
|
|
|
1196
1290
|
* @returns {Promise<ToolkitRetrieveCategoriesResponse>} List of categories
|
|
1197
1291
|
*/
|
|
1198
1292
|
listCategories(): Promise<ToolkitRetrieveCategoriesResponse>;
|
|
1293
|
+
/**
|
|
1294
|
+
* Authorizes a user to use a toolkit.
|
|
1295
|
+
* This method will create an auth config if one doesn't exist and initiate a connection request.
|
|
1296
|
+
* @param {string} userId - The user id of the user to authorize
|
|
1297
|
+
* @param {string} toolkitSlug - The slug of the toolkit to authorize
|
|
1298
|
+
* @param {string} authConfigId - The id of the auth config to use
|
|
1299
|
+
* @returns {Promise<ConnectionRequest>} The connection request object
|
|
1300
|
+
*/
|
|
1301
|
+
authorize(userId: string, toolkitSlug: string, authConfigId?: string): Promise<ConnectionRequest>;
|
|
1199
1302
|
}
|
|
1200
1303
|
|
|
1201
1304
|
type TriggerStatusEnum = "enable" | "disable";
|
|
@@ -1338,6 +1441,266 @@ declare class Triggers {
|
|
|
1338
1441
|
unsubscribe(): Promise<void>;
|
|
1339
1442
|
}
|
|
1340
1443
|
|
|
1444
|
+
declare const AuthConfigTypes: {
|
|
1445
|
+
readonly CUSTOM: "use_custom_auth";
|
|
1446
|
+
readonly COMPOSIO_MANAGED: "use_composio_managed_auth";
|
|
1447
|
+
};
|
|
1448
|
+
type AuthConfigType = (typeof AuthConfigTypes)[keyof typeof AuthConfigTypes];
|
|
1449
|
+
declare const AuthSchemeTypes: {
|
|
1450
|
+
readonly OAUTH2: "OAUTH2";
|
|
1451
|
+
readonly OAUTH1: "OAUTH1";
|
|
1452
|
+
readonly OAUTH1A: "OAUTH1A";
|
|
1453
|
+
readonly API_KEY: "API_KEY";
|
|
1454
|
+
readonly BASIC: "BASIC";
|
|
1455
|
+
readonly BILLCOM_AUTH: "BILLCOM_AUTH";
|
|
1456
|
+
readonly BEARER_TOKEN: "BEARER_TOKEN";
|
|
1457
|
+
readonly GOOGLE_SERVICE_ACCOUNT: "GOOGLE_SERVICE_ACCOUNT";
|
|
1458
|
+
readonly NO_AUTH: "NO_AUTH";
|
|
1459
|
+
readonly BASIC_WITH_JWT: "BASIC_WITH_JWT";
|
|
1460
|
+
readonly COMPOSIO_LINK: "COMPOSIO_LINK";
|
|
1461
|
+
readonly CALCOM_AUTH: "CALCOM_AUTH";
|
|
1462
|
+
readonly SNOWFLAKE: "SNOWFLAKE";
|
|
1463
|
+
};
|
|
1464
|
+
type AuthSchemeType = (typeof AuthSchemeTypes)[keyof typeof AuthSchemeTypes];
|
|
1465
|
+
/**
|
|
1466
|
+
* Discriminated union of all possible auth config types.
|
|
1467
|
+
*/
|
|
1468
|
+
declare const CreateAuthConfigParamsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1469
|
+
type: z.ZodLiteral<"use_custom_auth">;
|
|
1470
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1471
|
+
credentials: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
1472
|
+
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"]>;
|
|
1473
|
+
}, "strip", z.ZodTypeAny, {
|
|
1474
|
+
type: "use_custom_auth";
|
|
1475
|
+
credentials: Record<string, string | number | boolean>;
|
|
1476
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1477
|
+
name?: string | undefined;
|
|
1478
|
+
}, {
|
|
1479
|
+
type: "use_custom_auth";
|
|
1480
|
+
credentials: Record<string, string | number | boolean>;
|
|
1481
|
+
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1482
|
+
name?: string | undefined;
|
|
1483
|
+
}>, z.ZodObject<{
|
|
1484
|
+
type: z.ZodLiteral<"use_composio_managed_auth">;
|
|
1485
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1486
|
+
credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1487
|
+
}, "strip", z.ZodTypeAny, {
|
|
1488
|
+
type: "use_composio_managed_auth";
|
|
1489
|
+
name?: string | undefined;
|
|
1490
|
+
credentials?: Record<string, string | number | boolean> | undefined;
|
|
1491
|
+
}, {
|
|
1492
|
+
type: "use_composio_managed_auth";
|
|
1493
|
+
name?: string | undefined;
|
|
1494
|
+
credentials?: Record<string, string | number | boolean> | undefined;
|
|
1495
|
+
}>]>;
|
|
1496
|
+
type CreateAuthConfigParams = z.infer<typeof CreateAuthConfigParamsSchema>;
|
|
1497
|
+
declare const CreateAuthConfigResponseSchema: z.ZodObject<{
|
|
1498
|
+
id: z.ZodString;
|
|
1499
|
+
authScheme: z.ZodString;
|
|
1500
|
+
isComposioManaged: z.ZodBoolean;
|
|
1501
|
+
toolkit: z.ZodString;
|
|
1502
|
+
}, "strip", z.ZodTypeAny, {
|
|
1503
|
+
toolkit: string;
|
|
1504
|
+
id: string;
|
|
1505
|
+
authScheme: string;
|
|
1506
|
+
isComposioManaged: boolean;
|
|
1507
|
+
}, {
|
|
1508
|
+
toolkit: string;
|
|
1509
|
+
id: string;
|
|
1510
|
+
authScheme: string;
|
|
1511
|
+
isComposioManaged: boolean;
|
|
1512
|
+
}>;
|
|
1513
|
+
type CreateAuthConfigResponse = z.infer<typeof CreateAuthConfigResponseSchema>;
|
|
1514
|
+
declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
|
|
1515
|
+
id: z.ZodString;
|
|
1516
|
+
name: z.ZodString;
|
|
1517
|
+
toolkit: z.ZodObject<{
|
|
1518
|
+
logo: z.ZodString;
|
|
1519
|
+
slug: z.ZodString;
|
|
1520
|
+
}, "strip", z.ZodTypeAny, {
|
|
1521
|
+
slug: string;
|
|
1522
|
+
logo: string;
|
|
1523
|
+
}, {
|
|
1524
|
+
slug: string;
|
|
1525
|
+
logo: string;
|
|
1526
|
+
}>;
|
|
1527
|
+
noOfConnections: z.ZodNumber;
|
|
1528
|
+
status: z.ZodEnum<["ENABLED", "DISABLED"]>;
|
|
1529
|
+
uuid: z.ZodString;
|
|
1530
|
+
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"]>>;
|
|
1531
|
+
credentials: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
1532
|
+
expectedInputFields: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
1533
|
+
isComposioManaged: z.ZodOptional<z.ZodBoolean>;
|
|
1534
|
+
createdBy: z.ZodOptional<z.ZodString>;
|
|
1535
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
1536
|
+
lastUpdatedAt: z.ZodOptional<z.ZodString>;
|
|
1537
|
+
}, "strip", z.ZodTypeAny, {
|
|
1538
|
+
name: string;
|
|
1539
|
+
status: "ENABLED" | "DISABLED";
|
|
1540
|
+
toolkit: {
|
|
1541
|
+
slug: string;
|
|
1542
|
+
logo: string;
|
|
1543
|
+
};
|
|
1544
|
+
id: string;
|
|
1545
|
+
credentials: Record<string, string | number | boolean>;
|
|
1546
|
+
noOfConnections: number;
|
|
1547
|
+
uuid: string;
|
|
1548
|
+
createdAt?: string | undefined;
|
|
1549
|
+
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;
|
|
1550
|
+
isComposioManaged?: boolean | undefined;
|
|
1551
|
+
expectedInputFields?: unknown[] | undefined;
|
|
1552
|
+
createdBy?: string | undefined;
|
|
1553
|
+
lastUpdatedAt?: string | undefined;
|
|
1554
|
+
}, {
|
|
1555
|
+
name: string;
|
|
1556
|
+
status: "ENABLED" | "DISABLED";
|
|
1557
|
+
toolkit: {
|
|
1558
|
+
slug: string;
|
|
1559
|
+
logo: string;
|
|
1560
|
+
};
|
|
1561
|
+
id: string;
|
|
1562
|
+
credentials: Record<string, string | number | boolean>;
|
|
1563
|
+
noOfConnections: number;
|
|
1564
|
+
uuid: string;
|
|
1565
|
+
createdAt?: string | undefined;
|
|
1566
|
+
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;
|
|
1567
|
+
isComposioManaged?: boolean | undefined;
|
|
1568
|
+
expectedInputFields?: unknown[] | undefined;
|
|
1569
|
+
createdBy?: string | undefined;
|
|
1570
|
+
lastUpdatedAt?: string | undefined;
|
|
1571
|
+
}>;
|
|
1572
|
+
type AuthConfigRetrieveResponse = z.infer<typeof AuthConfigRetrieveResponseSchema>;
|
|
1573
|
+
declare const AuthConfigListParamsSchema: z.ZodObject<{
|
|
1574
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
1575
|
+
isComposioManaged: z.ZodOptional<z.ZodBoolean>;
|
|
1576
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
1577
|
+
toolkitSlug: z.ZodOptional<z.ZodString>;
|
|
1578
|
+
}, "strip", z.ZodTypeAny, {
|
|
1579
|
+
cursor?: string | undefined;
|
|
1580
|
+
limit?: number | undefined;
|
|
1581
|
+
toolkitSlug?: string | undefined;
|
|
1582
|
+
isComposioManaged?: boolean | undefined;
|
|
1583
|
+
}, {
|
|
1584
|
+
cursor?: string | undefined;
|
|
1585
|
+
limit?: number | undefined;
|
|
1586
|
+
toolkitSlug?: string | undefined;
|
|
1587
|
+
isComposioManaged?: boolean | undefined;
|
|
1588
|
+
}>;
|
|
1589
|
+
type AuthConfigListParams = z.infer<typeof AuthConfigListParamsSchema>;
|
|
1590
|
+
declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
1591
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1592
|
+
id: z.ZodString;
|
|
1593
|
+
name: z.ZodString;
|
|
1594
|
+
toolkit: z.ZodObject<{
|
|
1595
|
+
logo: z.ZodString;
|
|
1596
|
+
slug: z.ZodString;
|
|
1597
|
+
}, "strip", z.ZodTypeAny, {
|
|
1598
|
+
slug: string;
|
|
1599
|
+
logo: string;
|
|
1600
|
+
}, {
|
|
1601
|
+
slug: string;
|
|
1602
|
+
logo: string;
|
|
1603
|
+
}>;
|
|
1604
|
+
noOfConnections: z.ZodNumber;
|
|
1605
|
+
status: z.ZodEnum<["ENABLED", "DISABLED"]>;
|
|
1606
|
+
uuid: z.ZodString;
|
|
1607
|
+
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"]>>;
|
|
1608
|
+
credentials: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
1609
|
+
expectedInputFields: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
1610
|
+
isComposioManaged: z.ZodOptional<z.ZodBoolean>;
|
|
1611
|
+
createdBy: z.ZodOptional<z.ZodString>;
|
|
1612
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
1613
|
+
lastUpdatedAt: z.ZodOptional<z.ZodString>;
|
|
1614
|
+
}, "strip", z.ZodTypeAny, {
|
|
1615
|
+
name: string;
|
|
1616
|
+
status: "ENABLED" | "DISABLED";
|
|
1617
|
+
toolkit: {
|
|
1618
|
+
slug: string;
|
|
1619
|
+
logo: string;
|
|
1620
|
+
};
|
|
1621
|
+
id: string;
|
|
1622
|
+
credentials: Record<string, string | number | boolean>;
|
|
1623
|
+
noOfConnections: number;
|
|
1624
|
+
uuid: string;
|
|
1625
|
+
createdAt?: string | undefined;
|
|
1626
|
+
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;
|
|
1627
|
+
isComposioManaged?: boolean | undefined;
|
|
1628
|
+
expectedInputFields?: unknown[] | undefined;
|
|
1629
|
+
createdBy?: string | undefined;
|
|
1630
|
+
lastUpdatedAt?: string | undefined;
|
|
1631
|
+
}, {
|
|
1632
|
+
name: string;
|
|
1633
|
+
status: "ENABLED" | "DISABLED";
|
|
1634
|
+
toolkit: {
|
|
1635
|
+
slug: string;
|
|
1636
|
+
logo: string;
|
|
1637
|
+
};
|
|
1638
|
+
id: string;
|
|
1639
|
+
credentials: Record<string, string | number | boolean>;
|
|
1640
|
+
noOfConnections: number;
|
|
1641
|
+
uuid: string;
|
|
1642
|
+
createdAt?: string | undefined;
|
|
1643
|
+
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;
|
|
1644
|
+
isComposioManaged?: boolean | undefined;
|
|
1645
|
+
expectedInputFields?: unknown[] | undefined;
|
|
1646
|
+
createdBy?: string | undefined;
|
|
1647
|
+
lastUpdatedAt?: string | undefined;
|
|
1648
|
+
}>, "many">;
|
|
1649
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
1650
|
+
totalPages: z.ZodNumber;
|
|
1651
|
+
}, "strip", z.ZodTypeAny, {
|
|
1652
|
+
items: {
|
|
1653
|
+
name: string;
|
|
1654
|
+
status: "ENABLED" | "DISABLED";
|
|
1655
|
+
toolkit: {
|
|
1656
|
+
slug: string;
|
|
1657
|
+
logo: string;
|
|
1658
|
+
};
|
|
1659
|
+
id: string;
|
|
1660
|
+
credentials: Record<string, string | number | boolean>;
|
|
1661
|
+
noOfConnections: number;
|
|
1662
|
+
uuid: string;
|
|
1663
|
+
createdAt?: string | undefined;
|
|
1664
|
+
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;
|
|
1665
|
+
isComposioManaged?: boolean | undefined;
|
|
1666
|
+
expectedInputFields?: unknown[] | undefined;
|
|
1667
|
+
createdBy?: string | undefined;
|
|
1668
|
+
lastUpdatedAt?: string | undefined;
|
|
1669
|
+
}[];
|
|
1670
|
+
totalPages: number;
|
|
1671
|
+
nextCursor?: string | undefined;
|
|
1672
|
+
}, {
|
|
1673
|
+
items: {
|
|
1674
|
+
name: string;
|
|
1675
|
+
status: "ENABLED" | "DISABLED";
|
|
1676
|
+
toolkit: {
|
|
1677
|
+
slug: string;
|
|
1678
|
+
logo: string;
|
|
1679
|
+
};
|
|
1680
|
+
id: string;
|
|
1681
|
+
credentials: Record<string, string | number | boolean>;
|
|
1682
|
+
noOfConnections: number;
|
|
1683
|
+
uuid: string;
|
|
1684
|
+
createdAt?: string | undefined;
|
|
1685
|
+
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;
|
|
1686
|
+
isComposioManaged?: boolean | undefined;
|
|
1687
|
+
expectedInputFields?: unknown[] | undefined;
|
|
1688
|
+
createdBy?: string | undefined;
|
|
1689
|
+
lastUpdatedAt?: string | undefined;
|
|
1690
|
+
}[];
|
|
1691
|
+
totalPages: number;
|
|
1692
|
+
nextCursor?: string | undefined;
|
|
1693
|
+
}>;
|
|
1694
|
+
type AuthConfigListResponse = z.infer<typeof AuthConfigListResponseSchema>;
|
|
1695
|
+
declare const AuthConfigUpdateParamsSchema: z.ZodObject<{
|
|
1696
|
+
credentials: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
1697
|
+
}, "strip", z.ZodTypeAny, {
|
|
1698
|
+
credentials: Record<string, string | number | boolean>;
|
|
1699
|
+
}, {
|
|
1700
|
+
credentials: Record<string, string | number | boolean>;
|
|
1701
|
+
}>;
|
|
1702
|
+
type AuthConfigUpdateParams = z.infer<typeof AuthConfigUpdateParamsSchema>;
|
|
1703
|
+
|
|
1341
1704
|
/**
|
|
1342
1705
|
* @fileoverview Auth configs class for Composio SDK, used to manage authentication configurations.
|
|
1343
1706
|
*
|
|
@@ -1353,30 +1716,42 @@ declare class Triggers {
|
|
|
1353
1716
|
* Auth configs are used to configure authentication providers and settings.
|
|
1354
1717
|
*/
|
|
1355
1718
|
declare class AuthConfigs {
|
|
1356
|
-
readonly FILE_NAME: string;
|
|
1357
1719
|
private client;
|
|
1358
1720
|
constructor(client: ComposioClient);
|
|
1721
|
+
private parseAuthConfigRetrieveResponse;
|
|
1359
1722
|
/**
|
|
1360
1723
|
* List all auth configs
|
|
1361
1724
|
* @param {AuthConfigListParams} query - Query parameters for filtering auth configs
|
|
1362
1725
|
* @param {RequestOptions} options - Request options
|
|
1363
1726
|
* @returns {Promise<AuthConfigListResponse>} List of auth configs
|
|
1364
1727
|
*/
|
|
1365
|
-
list(query?: AuthConfigListParams
|
|
1728
|
+
list(query?: AuthConfigListParams): Promise<AuthConfigListResponse>;
|
|
1366
1729
|
/**
|
|
1367
1730
|
* Create a new auth config
|
|
1368
|
-
* @param {
|
|
1369
|
-
* @param {
|
|
1370
|
-
* @returns {Promise<
|
|
1731
|
+
* @param {string} toolkit - Unique identifier of the toolkit
|
|
1732
|
+
* @param {CreateAuthConfigParams} options - Options for creating a new auth config
|
|
1733
|
+
* @returns {Promise<CreateAuthConfigResponse>} Created auth config
|
|
1734
|
+
*
|
|
1735
|
+
* @example
|
|
1736
|
+
* const authConfig = await authConfigs.create('my-toolkit', {
|
|
1737
|
+
* type: AuthConfigTypes.CUSTOM,
|
|
1738
|
+
* name: 'My Custom Auth Config',
|
|
1739
|
+
* authScheme: AuthSchemeTypes.API_KEY,
|
|
1740
|
+
* credentials: {
|
|
1741
|
+
* apiKey: '1234567890',
|
|
1742
|
+
* },
|
|
1743
|
+
* });
|
|
1744
|
+
*
|
|
1745
|
+
* @link https://docs.composio.dev/reference/auth-configs/create-auth-config
|
|
1371
1746
|
*/
|
|
1372
|
-
create(
|
|
1747
|
+
create(toolkit: string, options: CreateAuthConfigParams): Promise<CreateAuthConfigResponse>;
|
|
1373
1748
|
/**
|
|
1374
1749
|
* Get an auth config by nanoid
|
|
1375
1750
|
* @param {string} nanoid - Unique identifier of the auth config
|
|
1376
1751
|
* @param {RequestOptions} options - Request options
|
|
1377
1752
|
* @returns {Promise<AuthConfigRetrieveResponse>} Auth config details
|
|
1378
1753
|
*/
|
|
1379
|
-
get(nanoid: string
|
|
1754
|
+
get(nanoid: string): Promise<AuthConfigRetrieveResponse>;
|
|
1380
1755
|
/**
|
|
1381
1756
|
* Update an auth config
|
|
1382
1757
|
* @param {string} nanoid - Unique identifier of the auth config to update
|
|
@@ -1384,14 +1759,14 @@ declare class AuthConfigs {
|
|
|
1384
1759
|
* @param {RequestOptions} options - Request options
|
|
1385
1760
|
* @returns {Promise<AuthConfigUpdateResponse>} Updated auth config
|
|
1386
1761
|
*/
|
|
1387
|
-
update(nanoid: string, data: AuthConfigUpdateParams
|
|
1762
|
+
update(nanoid: string, data: AuthConfigUpdateParams): Promise<AuthConfigUpdateResponse>;
|
|
1388
1763
|
/**
|
|
1389
1764
|
* Delete an auth config
|
|
1390
1765
|
* @param {string} nanoid - Unique identifier of the auth config to delete
|
|
1391
1766
|
* @param {RequestOptions} options - Request options
|
|
1392
1767
|
* @returns {Promise<AuthConfigDeleteResponse>} Response from deletion
|
|
1393
1768
|
*/
|
|
1394
|
-
delete(nanoid: string
|
|
1769
|
+
delete(nanoid: string): Promise<AuthConfigDeleteResponse>;
|
|
1395
1770
|
/**
|
|
1396
1771
|
* Update the status of an auth config
|
|
1397
1772
|
* @param {string} status - The status to update the auth config to
|
|
@@ -1399,150 +1774,21 @@ declare class AuthConfigs {
|
|
|
1399
1774
|
* @param {RequestOptions} options - Request options
|
|
1400
1775
|
* @returns {Promise<AuthConfigUpdateStatusResponse>} Updated auth config details
|
|
1401
1776
|
*/
|
|
1402
|
-
updateStatus(status: 'ENABLED' | 'DISABLED', nanoid: string
|
|
1777
|
+
updateStatus(status: 'ENABLED' | 'DISABLED', nanoid: string): Promise<AuthConfigUpdateStatusResponse>;
|
|
1403
1778
|
/**
|
|
1404
1779
|
* Enable an auth config
|
|
1405
1780
|
* @param {string} nanoid - Unique identifier of the auth config
|
|
1406
1781
|
* @param {RequestOptions} options - Request options
|
|
1407
1782
|
* @returns {Promise<AuthConfigUpdateStatusResponse>} Updated auth config details
|
|
1408
1783
|
*/
|
|
1409
|
-
enable(nanoid: string
|
|
1784
|
+
enable(nanoid: string): Promise<AuthConfigUpdateStatusResponse>;
|
|
1410
1785
|
/**
|
|
1411
1786
|
* Disable an auth config
|
|
1412
1787
|
* @param {string} nanoid - Unique identifier of the auth config
|
|
1413
1788
|
* @param {RequestOptions} options - Request options
|
|
1414
1789
|
* @returns {Promise<AuthConfigUpdateStatusResponse>} Updated auth config details
|
|
1415
1790
|
*/
|
|
1416
|
-
disable(nanoid: string
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
/**
|
|
1420
|
-
* Connected Account create parameters
|
|
1421
|
-
*/
|
|
1422
|
-
declare const ConnectedAccountStatuses: {
|
|
1423
|
-
readonly ACTIVE: "ACTIVE";
|
|
1424
|
-
readonly INACTIVE: "INACTIVE";
|
|
1425
|
-
readonly PENDING: "DELETED";
|
|
1426
|
-
readonly INITIATED: "INITIATED";
|
|
1427
|
-
readonly EXPIRED: "EXPIRED";
|
|
1428
|
-
readonly FAILED: "FAILED";
|
|
1429
|
-
};
|
|
1430
|
-
type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
|
|
1431
|
-
type CreateConnectedAccountOptions = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1432
|
-
declare const CreateConnectedAccountOptionsSchema: z.ZodObject<{
|
|
1433
|
-
redirectUrl: z.ZodOptional<z.ZodString>;
|
|
1434
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1435
|
-
}, "strip", z.ZodTypeAny, {
|
|
1436
|
-
data?: Record<string, unknown> | undefined;
|
|
1437
|
-
redirectUrl?: string | undefined;
|
|
1438
|
-
}, {
|
|
1439
|
-
data?: Record<string, unknown> | undefined;
|
|
1440
|
-
redirectUrl?: string | undefined;
|
|
1441
|
-
}>;
|
|
1442
|
-
type CreateConnectedAccountOptionsSchema = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1443
|
-
declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
1444
|
-
id: z.ZodString;
|
|
1445
|
-
authConfig: z.ZodObject<{
|
|
1446
|
-
id: z.ZodString;
|
|
1447
|
-
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"]>;
|
|
1448
|
-
isComposioManaged: z.ZodBoolean;
|
|
1449
|
-
isDisabled: z.ZodBoolean;
|
|
1450
|
-
}, "strip", z.ZodTypeAny, {
|
|
1451
|
-
id: string;
|
|
1452
|
-
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1453
|
-
isComposioManaged: boolean;
|
|
1454
|
-
isDisabled: boolean;
|
|
1455
|
-
}, {
|
|
1456
|
-
id: string;
|
|
1457
|
-
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1458
|
-
isComposioManaged: boolean;
|
|
1459
|
-
isDisabled: boolean;
|
|
1460
|
-
}>;
|
|
1461
|
-
userId: z.ZodString;
|
|
1462
|
-
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1463
|
-
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1464
|
-
status: z.ZodEnum<["ACTIVE", "INACTIVE", "DELETED", "INITIATED", "EXPIRED", "FAILED"]>;
|
|
1465
|
-
statusReason: z.ZodNullable<z.ZodString>;
|
|
1466
|
-
toolkit: z.ZodObject<{
|
|
1467
|
-
slug: z.ZodString;
|
|
1468
|
-
}, "strip", z.ZodTypeAny, {
|
|
1469
|
-
slug: string;
|
|
1470
|
-
}, {
|
|
1471
|
-
slug: string;
|
|
1472
|
-
}>;
|
|
1473
|
-
testRequestEndpoint: z.ZodOptional<z.ZodString>;
|
|
1474
|
-
isDisabled: z.ZodBoolean;
|
|
1475
|
-
createdAt: z.ZodString;
|
|
1476
|
-
updatedAt: z.ZodString;
|
|
1477
|
-
}, "strip", z.ZodTypeAny, {
|
|
1478
|
-
params: Record<string, unknown>;
|
|
1479
|
-
status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
|
|
1480
|
-
toolkit: {
|
|
1481
|
-
slug: string;
|
|
1482
|
-
};
|
|
1483
|
-
userId: string;
|
|
1484
|
-
data: Record<string, unknown>;
|
|
1485
|
-
id: string;
|
|
1486
|
-
createdAt: string;
|
|
1487
|
-
updatedAt: string;
|
|
1488
|
-
authConfig: {
|
|
1489
|
-
id: string;
|
|
1490
|
-
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1491
|
-
isComposioManaged: boolean;
|
|
1492
|
-
isDisabled: boolean;
|
|
1493
|
-
};
|
|
1494
|
-
isDisabled: boolean;
|
|
1495
|
-
statusReason: string | null;
|
|
1496
|
-
testRequestEndpoint?: string | undefined;
|
|
1497
|
-
}, {
|
|
1498
|
-
params: Record<string, unknown>;
|
|
1499
|
-
status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
|
|
1500
|
-
toolkit: {
|
|
1501
|
-
slug: string;
|
|
1502
|
-
};
|
|
1503
|
-
userId: string;
|
|
1504
|
-
data: Record<string, unknown>;
|
|
1505
|
-
id: string;
|
|
1506
|
-
createdAt: string;
|
|
1507
|
-
updatedAt: string;
|
|
1508
|
-
authConfig: {
|
|
1509
|
-
id: string;
|
|
1510
|
-
authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
|
|
1511
|
-
isComposioManaged: boolean;
|
|
1512
|
-
isDisabled: boolean;
|
|
1513
|
-
};
|
|
1514
|
-
isDisabled: boolean;
|
|
1515
|
-
statusReason: string | null;
|
|
1516
|
-
testRequestEndpoint?: string | undefined;
|
|
1517
|
-
}>;
|
|
1518
|
-
type ConnectedAccountRetrieveResponse = z.infer<typeof ConnectedAccountRetrieveResponseSchema>;
|
|
1519
|
-
|
|
1520
|
-
/**
|
|
1521
|
-
* @fileoverview Connection request class for Composio SDK, used to manage an initiated connection request.
|
|
1522
|
-
*
|
|
1523
|
-
* @author Musthaq Ahamad <musthaq@composio.dev>
|
|
1524
|
-
* @date 2025-05-05
|
|
1525
|
-
* @module ConnectionRequest
|
|
1526
|
-
*/
|
|
1527
|
-
|
|
1528
|
-
declare class ConnectionRequest {
|
|
1529
|
-
private client;
|
|
1530
|
-
private connectedAccountId;
|
|
1531
|
-
private connectedAccountStatus;
|
|
1532
|
-
constructor(client: ComposioClient, connectedAccountId: string, connectedAccountStatus: ConnectedAccountStatus);
|
|
1533
|
-
/**
|
|
1534
|
-
* Transform the response from the Composio API to the SDK format
|
|
1535
|
-
* @param response
|
|
1536
|
-
* @returns
|
|
1537
|
-
*/
|
|
1538
|
-
private transformResponse;
|
|
1539
|
-
/**
|
|
1540
|
-
* Wait for the connection to be established.
|
|
1541
|
-
* The function will poll the Composio API every second until the connection is established or the timeout is reached.
|
|
1542
|
-
* @param {number} timeout - The time in milliseconds to wait for the connection to be established. Default is 30 seconds.
|
|
1543
|
-
* @returns
|
|
1544
|
-
*/
|
|
1545
|
-
waitForConnection(timeout?: number): Promise<ConnectedAccountRetrieveResponse>;
|
|
1791
|
+
disable(nanoid: string): Promise<AuthConfigUpdateStatusResponse>;
|
|
1546
1792
|
}
|
|
1547
1793
|
|
|
1548
1794
|
/**
|
|
@@ -1570,12 +1816,24 @@ declare class ConnectedAccounts {
|
|
|
1570
1816
|
*/
|
|
1571
1817
|
list(query?: ConnectedAccountListParams): Promise<ConnectedAccountListResponse>;
|
|
1572
1818
|
/**
|
|
1573
|
-
*
|
|
1574
|
-
*
|
|
1575
|
-
*
|
|
1576
|
-
* @
|
|
1819
|
+
* Compound function to create a new connected account.
|
|
1820
|
+
* This function creates a new connected account and returns a connection request.
|
|
1821
|
+
* Users can then wait for the connection to be established using the `waitForConnection` method.
|
|
1822
|
+
* @param {string} userId - User ID of the connected account
|
|
1823
|
+
* @param {string} authConfigId - Auth config ID of the connected account
|
|
1824
|
+
* @param {CreateConnectedAccountOptions} data - Data for creating a new connected account
|
|
1825
|
+
* @returns {Promise<ConnectionRequest>} Connection request object
|
|
1826
|
+
*
|
|
1827
|
+
* @example
|
|
1828
|
+
* const connectionRequest = await composio.createConnectedAccount('user_123', 'auth_config_123', {
|
|
1829
|
+
* data: {
|
|
1830
|
+
* name: 'My Connected Account',
|
|
1831
|
+
* },
|
|
1832
|
+
* });
|
|
1833
|
+
*
|
|
1834
|
+
* @link https://docs.composio.dev/reference/connected-accounts/create-connected-account
|
|
1577
1835
|
*/
|
|
1578
|
-
|
|
1836
|
+
initiate(userId: string, authConfigId: string, options?: CreateConnectedAccountOptions): Promise<ConnectionRequest>;
|
|
1579
1837
|
/**
|
|
1580
1838
|
* Get a connected account by nanoid
|
|
1581
1839
|
* @param {string} nanoid - Unique identifier of the connected account
|
|
@@ -1619,14 +1877,6 @@ declare class ConnectedAccounts {
|
|
|
1619
1877
|
* @returns {Promise<ConnectedAccountUpdateStatusResponse>} Updated connected account details
|
|
1620
1878
|
*/
|
|
1621
1879
|
disable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>;
|
|
1622
|
-
/**
|
|
1623
|
-
* Compound function to create a new connected account.
|
|
1624
|
-
* This function creates a new connected account and returns a connection request.
|
|
1625
|
-
* Users can then wait for the connection to be established using the `waitForConnection` method.
|
|
1626
|
-
* @param {CreateConnectedAccountParams} data - Data for creating a new connected account
|
|
1627
|
-
* @returns {Promise<ConnectionRequest>} Connection request object
|
|
1628
|
-
*/
|
|
1629
|
-
createConnectedAccount(userId: string, authConfigId: string, options?: CreateConnectedAccountOptions): Promise<ConnectionRequest>;
|
|
1630
1880
|
}
|
|
1631
1881
|
|
|
1632
1882
|
type AcceptableJSONValue = Record<string, unknown> | Array<Record<string, unknown>> | string | number | boolean | null | undefined;
|
|
@@ -1673,7 +1923,7 @@ declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection,
|
|
|
1673
1923
|
* @param {string} userId - The user id.
|
|
1674
1924
|
* @returns {Promise<string>} The result of the tool call.
|
|
1675
1925
|
*/
|
|
1676
|
-
executeToolCall(userId: string, tool: OpenAI.ChatCompletionMessageToolCall, options
|
|
1926
|
+
executeToolCall(userId: string, tool: OpenAI.ChatCompletionMessageToolCall, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string>;
|
|
1677
1927
|
/**
|
|
1678
1928
|
* Handle the tool call from the assistant.
|
|
1679
1929
|
*
|
|
@@ -1681,7 +1931,7 @@ declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection,
|
|
|
1681
1931
|
* @param {string} userId - The user id.
|
|
1682
1932
|
* @returns {Promise<string[]>} The results of the tool call.
|
|
1683
1933
|
*/
|
|
1684
|
-
handleToolCall(userId: string, chatCompletion: OpenAI.ChatCompletion, options
|
|
1934
|
+
handleToolCall(userId: string, chatCompletion: OpenAI.ChatCompletion, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string[]>;
|
|
1685
1935
|
/**
|
|
1686
1936
|
* Handles all the tool calls from the assistant.
|
|
1687
1937
|
*
|
|
@@ -1689,7 +1939,7 @@ declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection,
|
|
|
1689
1939
|
* @param {string} userId - The user id.
|
|
1690
1940
|
* @returns {Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>} The tool outputs.
|
|
1691
1941
|
*/
|
|
1692
|
-
handleAssistantMessage(userId: string, run: OpenAI.Beta.Threads.Run, options
|
|
1942
|
+
handleAssistantMessage(userId: string, run: OpenAI.Beta.Threads.Run, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<OpenAI.Beta.Threads.Runs.RunSubmitToolOutputsParams.ToolOutput[]>;
|
|
1693
1943
|
/**
|
|
1694
1944
|
* Waits for the assistant stream and handles the tool calls.
|
|
1695
1945
|
*
|
|
@@ -1699,7 +1949,7 @@ declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection,
|
|
|
1699
1949
|
* @param {string} userId - The user id.
|
|
1700
1950
|
* @returns {AsyncGenerator<OpenAI.Beta.Assistants.AssistantStreamEvent, void, unknown>} The run stream.
|
|
1701
1951
|
*/
|
|
1702
|
-
waitAndHandleAssistantStreamToolCalls(userId: string, client: OpenAI, runStream: Stream<OpenAI.Beta.Assistants.AssistantStreamEvent>, thread: OpenAI.Beta.Threads.Thread, options
|
|
1952
|
+
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>;
|
|
1703
1953
|
/**
|
|
1704
1954
|
* Waits for the assistant tool calls and handles them.
|
|
1705
1955
|
*
|
|
@@ -1709,7 +1959,7 @@ declare class OpenAIToolset extends BaseNonAgenticToolset<OpenAiToolCollection,
|
|
|
1709
1959
|
* @param {string} userId - The user id.
|
|
1710
1960
|
* @returns {Promise<OpenAI.Beta.Threads.Run>} The run object.
|
|
1711
1961
|
*/
|
|
1712
|
-
waitAndHandleAssistantToolCalls(userId: string, client: OpenAI, run: OpenAI.Beta.Threads.Run, thread: OpenAI.Beta.Threads.Thread, options
|
|
1962
|
+
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>;
|
|
1713
1963
|
}
|
|
1714
1964
|
|
|
1715
1965
|
type ComposioConfig<TToolset extends BaseComposioToolset<unknown, unknown> = OpenAIToolset> = {
|
|
@@ -1744,8 +1994,9 @@ declare class Composio<TToolset extends BaseComposioToolset<unknown, unknown> =
|
|
|
1744
1994
|
triggers: Triggers;
|
|
1745
1995
|
toolset: TToolset;
|
|
1746
1996
|
authConfigs: AuthConfigs;
|
|
1997
|
+
createAuthConfig: AuthConfigs['create'];
|
|
1747
1998
|
connectedAccounts: ConnectedAccounts;
|
|
1748
|
-
|
|
1999
|
+
initiateConnection: ConnectedAccounts['initiate'];
|
|
1749
2000
|
/**
|
|
1750
2001
|
* @param {Object} config Configuration for the Composio SDK.
|
|
1751
2002
|
* @param {string} config.apiKey The API key for the Composio SDK.
|
|
@@ -1800,4 +2051,4 @@ declare class ComposioToolset extends BaseNonAgenticToolset<Array<CustomTool>, C
|
|
|
1800
2051
|
|
|
1801
2052
|
declare function jsonSchemaToModel(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
|
|
1802
2053
|
|
|
1803
|
-
export { type AfterToolExecuteModifier, type AgenticToolOptions, BaseAgenticToolset, type BaseComposioToolset, BaseNonAgenticToolset, BaseTelemetryTransport, type BeforeToolExecuteModifier, Composio, ComposioToolset, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIToolset, type Tool, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, type Toolset, type TransformToolSchemaModifier, jsonSchemaToModel };
|
|
2054
|
+
export { type AfterToolExecuteModifier, type AgenticToolOptions, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticToolset, type BaseComposioToolset, BaseNonAgenticToolset, BaseTelemetryTransport, type BeforeToolExecuteModifier, Composio, ComposioToolset, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIToolset, type Tool, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, type Toolset, type TransformToolSchemaModifier, jsonSchemaToModel };
|