@composio/core 0.1.12-alpha.7 → 0.1.12-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -4,7 +4,7 @@ import { ToolProxyParams, ToolProxyResponse, ToolRetrieveEnumResponse, ToolGetIn
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
6
  import { AuthConfigUpdateResponse, AuthConfigDeleteResponse, AuthConfigUpdateStatusResponse } from '@composio/client/resources/auth-configs';
7
- import { ConnectedAccountListParams, ConnectedAccountListResponse, ConnectedAccountDeleteResponse, ConnectedAccountRefreshResponse, ConnectedAccountUpdateStatusParams, ConnectedAccountUpdateStatusResponse } from '@composio/client/resources/connected-accounts';
7
+ import { ConnectedAccountRetrieveResponse as ConnectedAccountRetrieveResponse$1, ConnectedAccountListResponse as ConnectedAccountListResponse$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
 
@@ -359,47 +359,294 @@ declare abstract class BaseAgenticProvider<TToolCollection, TTool> extends BaseP
359
359
  type BaseComposioProvider<TToolCollection, TTool> = BaseNonAgenticProvider<TToolCollection, TTool> | BaseAgenticProvider<TToolCollection, TTool>;
360
360
 
361
361
  /**
362
- * Modifier for altering the tool execute params
363
- * Called before the tool execute call
362
+ * Modifier for altering the tool execute parameters before execution.
363
+ *
364
+ * This function allows you to intercept and modify the parameters being passed to a tool
365
+ * before the actual execution happens. Common use cases include:
366
+ * - Adding or modifying authentication parameters
367
+ * - Transforming input data to match expected formats
368
+ * - Adding contextual information to the request
369
+ * - Implementing request validation or normalization
370
+ *
371
+ * @param {string} toolSlug - The slug identifier of the tool being executed
372
+ * @param {string} toolkitSlug - The slug identifier of the toolkit containing the tool
373
+ * @param {ToolExecuteParams} toolExecuteParams - The original execution parameters
374
+ * @returns {ToolExecuteParams} The modified execution parameters
375
+ *
376
+ * @example
377
+ * ```typescript
378
+ * // Add authentication headers to all tool requests
379
+ * const beforeToolExecute = (toolSlug, toolkitSlug, params) => {
380
+ * return {
381
+ * ...params,
382
+ * customAuthParams: {
383
+ * ...params.customAuthParams,
384
+ * headers: {
385
+ * ...params.customAuthParams?.headers,
386
+ * 'X-API-Key': 'my-api-key'
387
+ * }
388
+ * }
389
+ * };
390
+ * };
391
+ *
392
+ * // Transform input parameters for a specific tool
393
+ * const beforeToolExecute = (toolSlug, toolkitSlug, params) => {
394
+ * if (toolSlug === 'GITHUB_SEARCH_REPOS') {
395
+ * // Convert simple query to structured query format
396
+ * return {
397
+ * ...params,
398
+ * arguments: {
399
+ * ...params.arguments,
400
+ * q: `${params.arguments.query} in:name,description`
401
+ * }
402
+ * };
403
+ * }
404
+ * return params;
405
+ * };
406
+ * ```
364
407
  */
365
408
  type BeforeToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExecuteParams: ToolExecuteParams) => ToolExecuteParams;
366
409
  /**
367
- * Modifier for altering the tool execute response
368
- * Called after the tool execute call
410
+ * Modifier for altering the tool execution response after execution completes.
411
+ *
412
+ * This function allows you to intercept and modify the response returned from a tool
413
+ * after its execution has completed. Common use cases include:
414
+ * - Transforming response data into a more convenient format
415
+ * - Handling or enhancing error responses
416
+ * - Adding additional context or derived data to successful responses
417
+ * - Implementing cross-cutting concerns like logging or analytics
418
+ *
419
+ * @param {string} toolSlug - The slug identifier of the tool that was executed
420
+ * @param {string} toolkitSlug - The slug identifier of the toolkit containing the tool
421
+ * @param {ToolExecuteResponse} toolExecuteResponse - The original execution response
422
+ * @returns {ToolExecuteResponse} The modified execution response
423
+ *
424
+ * @example
425
+ * ```typescript
426
+ * // Transform the response data format
427
+ * const afterToolExecute = (toolSlug, toolkitSlug, response) => {
428
+ * if (toolSlug === 'GITHUB_LIST_REPOS' && response.successful) {
429
+ * // Transform the returned repos into a simpler format
430
+ * return {
431
+ * ...response,
432
+ * data: {
433
+ * repositories: response.data.items.map(repo => ({
434
+ * name: repo.name,
435
+ * url: repo.html_url,
436
+ * stars: repo.stargazers_count
437
+ * }))
438
+ * }
439
+ * };
440
+ * }
441
+ * return response;
442
+ * };
443
+ *
444
+ * // Add error handling with custom messages
445
+ * const afterToolExecute = (toolSlug, toolkitSlug, response) => {
446
+ * if (!response.successful) {
447
+ * return {
448
+ * ...response,
449
+ * error: {
450
+ * message: `Error using ${toolSlug}: ${response.error?.message || 'Unknown error'}`,
451
+ * code: response.error?.code || 'UNKNOWN_ERROR'
452
+ * }
453
+ * };
454
+ * }
455
+ * return response;
456
+ * };
457
+ * ```
369
458
  */
370
459
  type AfterToolExecuteModifier = (toolSlug: string, toolkitSlug: string, toolExecuteResponse: ToolExecuteResponse) => ToolExecuteResponse;
371
460
  /**
372
- * Modifier for altering the tool schema
373
- * Called after the tool schema is retrieved
461
+ * Modifier for altering the tool schema before it's exposed to consumers.
462
+ *
463
+ * This function allows you to customize the metadata, parameters, and behavior definitions
464
+ * of tools before they are used. Common use cases include:
465
+ * - Customizing input parameter definitions or descriptions
466
+ * - Adding, removing, or modifying parameters to match your application's needs
467
+ * - Changing the name or description of tools to better fit your context
468
+ * - Implementing versioning or feature flagging for tool schemas
469
+ *
470
+ * @param {string} toolSlug - The slug identifier of the tool being modified
471
+ * @param {string} toolkitSlug - The slug identifier of the toolkit containing the tool
472
+ * @param {Tool} toolSchema - The original tool schema
473
+ * @returns {Tool} The modified tool schema
474
+ *
475
+ * @example
476
+ * ```typescript
477
+ * // Modify the input parameters for a specific tool
478
+ * const modifyToolSchema = (toolSlug, toolkitSlug, toolSchema) => {
479
+ * if (toolSlug === 'HACKERNEWS_GET_USER') {
480
+ * return {
481
+ * ...toolSchema,
482
+ * inputParameters: {
483
+ * ...toolSchema.inputParameters,
484
+ * userId: {
485
+ * type: 'string',
486
+ * description: 'The HackerNews username to retrieve information for',
487
+ * required: true
488
+ * }
489
+ * }
490
+ * };
491
+ * }
492
+ * return toolSchema;
493
+ * };
494
+ *
495
+ * // Add custom descriptions to all tools in a toolkit
496
+ * const modifyToolSchema = (toolSlug, toolkitSlug, toolSchema) => {
497
+ * if (toolkitSlug === 'github') {
498
+ * return {
499
+ * ...toolSchema,
500
+ * description: `Company GitHub tool: ${toolSchema.description}`,
501
+ * important: true
502
+ * };
503
+ * }
504
+ * return toolSchema;
505
+ * };
506
+ *
507
+ * // Simplify tool schemas for a specific consumer
508
+ * const modifyToolSchema = (toolSlug, toolkitSlug, toolSchema) => {
509
+ * // Remove advanced or complex parameters
510
+ * const { complexParam1, complexParam2, ...simpleInputParams } = toolSchema.inputParameters;
511
+ *
512
+ * return {
513
+ * ...toolSchema,
514
+ * inputParameters: simpleInputParams
515
+ * };
516
+ * };
517
+ * ```
374
518
  */
375
519
  type TransformToolSchemaModifier = (toolSlug: string, toolkitSlug: string, toolSchema: Tool) => Tool;
376
520
  /**
377
- * Non Agentic tool options. These are used by Non-Agentic toolsets
521
+ * Options for non-agentic tool configuration.
522
+ *
523
+ * These options are used when working with non-agentic tool providers to
524
+ * customize the behavior of tools through schema transformation.
525
+ *
526
+ * @example
527
+ * ```typescript
528
+ * // Configure tools with schema modification
529
+ * const tools = await composio.tools.get('default', {
530
+ * toolkits: ['github']
531
+ * }, {
532
+ * modifyToolSchema: (toolSlug, toolkitSlug, schema) => {
533
+ * // Custom schema modifications
534
+ * return schema;
535
+ * }
536
+ * });
537
+ * ```
378
538
  */
379
539
  type ToolOptions = {
380
540
  /**
381
- * Transform tool schema modifier
541
+ * Function to transform tool schemas before they're exposed to consumers.
542
+ * This allows customizing input/output parameters, descriptions, and other metadata.
382
543
  */
383
544
  modifyToolSchema?: TransformToolSchemaModifier;
384
545
  };
385
546
  /**
386
- * Modifiers for the tool execution
387
- * This is used by execute call and handleToolCall of Non-Agentic toolsets
547
+ * Options for configuring tool execution behavior.
548
+ *
549
+ * These modifiers allow you to intercept and modify tool execution at both
550
+ * the request and response stages, enabling custom behavior, data transformation,
551
+ * error handling, and more.
552
+ *
553
+ * @example
554
+ * ```typescript
555
+ * // Execute a tool with request and response modifications
556
+ * const result = await composio.tools.execute('GITHUB_GET_REPOS', {
557
+ * userId: 'default',
558
+ * arguments: { owner: 'composio' }
559
+ * }, {
560
+ * beforeToolExecute: (toolSlug, toolkitSlug, params) => {
561
+ * console.log(`Executing ${toolSlug} from ${toolkitSlug}`);
562
+ * return params;
563
+ * },
564
+ * afterToolExecute: (toolSlug, toolkitSlug, response) => {
565
+ * if (response.successful) {
566
+ * console.log(`Successfully executed ${toolSlug}`);
567
+ * }
568
+ * return response;
569
+ * }
570
+ * });
571
+ * ```
388
572
  */
389
573
  type ExecuteToolModifiers = {
390
574
  /**
391
- * Before tool execute modifier
575
+ * Function to intercept and modify tool execution parameters before the tool is executed.
576
+ * This allows customizing the request based on tool-specific needs.
392
577
  */
393
578
  beforeToolExecute?: BeforeToolExecuteModifier;
394
579
  /**
395
- * After tool execute modifier
580
+ * Function to intercept and modify tool execution responses after the tool has executed.
581
+ * This allows transforming the response or implementing custom error handling.
396
582
  */
397
583
  afterToolExecute?: AfterToolExecuteModifier;
398
584
  };
399
585
  /**
400
- * Agentic tool options. These are used by Agentic toolsets
586
+ * Options for agentic tool configuration.
587
+ *
588
+ * These options combine schema modification capabilities with execution behavior
589
+ * customization, providing full control over both the definition and execution
590
+ * of tools in agentic contexts (like LLM providers).
591
+ *
592
+ * @example
593
+ * ```typescript
594
+ * // Configure agentic tools with schema and execution modifications
595
+ * const agenticTools = await vercel.tools.get('default', 'GITHUB_GET_REPOS', {
596
+ * modifyToolSchema: (toolSlug, toolkitSlug, schema) => {
597
+ * return {
598
+ * ...schema,
599
+ * description: `Enhanced ${toolSlug} for better context`
600
+ * };
601
+ * },
602
+ *
603
+ * // Intercept before execution
604
+ * beforeToolExecute: (toolSlug, toolkitSlug, params) => {
605
+ * // Add analytics tracking
606
+ * trackToolUsage(toolSlug);
607
+ * return params;
608
+ * },
609
+ *
610
+ * // Transform after execution
611
+ * afterToolExecute: (toolSlug, toolkitSlug, response) => {
612
+ * // Log results and handle errors
613
+ * if (!response.successful) {
614
+ * logToolError(toolSlug, response.error);
615
+ * }
616
+ * return response;
617
+ * }
618
+ * });
619
+ * ```
401
620
  */
402
621
  type AgenticToolOptions = ToolOptions & ExecuteToolModifiers;
622
+ /**
623
+ * Provider-specific options determined by the type of provider being used.
624
+ *
625
+ * This type automatically resolves to either AgenticToolOptions or ToolOptions
626
+ * based on whether the provider is agentic (like OpenAI or Vercel) or non-agentic.
627
+ *
628
+ * @template T - The provider type
629
+ *
630
+ * @example
631
+ * ```typescript
632
+ * // With standard provider (non-agentic)
633
+ * const tools = await composio.tools.get('default', 'GITHUB_GET_REPOS', {
634
+ * modifyToolSchema: (toolSlug, toolkitSlug, schema) => schema
635
+ * });
636
+ *
637
+ * // With agentic provider (e.g., VercelProvider)
638
+ * const vercel = new Composio({
639
+ * apiKey: process.env.COMPOSIO_API_KEY,
640
+ * provider: new VercelProvider()
641
+ * });
642
+ *
643
+ * const agenticTools = await vercel.tools.get('default', 'GITHUB_GET_REPOS', {
644
+ * modifyToolSchema: (toolSlug, toolkitSlug, schema) => schema,
645
+ * beforeToolExecute: (toolSlug, toolkitSlug, params) => params,
646
+ * afterToolExecute: (toolSlug, toolkitSlug, response) => response
647
+ * });
648
+ * ```
649
+ */
403
650
  type ProviderOptions<T extends BaseComposioProvider<unknown, unknown>> = T extends BaseAgenticProvider<unknown, unknown> ? AgenticToolOptions : ToolOptions;
404
651
 
405
652
  /**
@@ -412,15 +659,27 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
412
659
  private provider;
413
660
  constructor(client: ComposioClient, provider: TProvider);
414
661
  /**
415
- * Transform the tool cases
416
- * @param {ToolRetrieveResponse | ComposioToolListResponse['items'][0]} tool - The tool to transform
417
- * @returns {Tool} The transformed tool
662
+ * Transforms tool data from snake_case API format to camelCase for internal SDK use.
663
+ *
664
+ * This method standardizes the property naming convention for tools retrieved from the Composio API,
665
+ * making them more consistent with JavaScript/TypeScript conventions.
666
+ *
667
+ * @param {ToolRetrieveResponse | ComposioToolListResponse['items'][0]} tool - The tool object to transform
668
+ * @returns {Tool} The transformed tool with camelCase properties
669
+ *
670
+ * @private
418
671
  */
419
672
  private transformToolCases;
420
673
  /**
421
- * Transform the tool execute response to camelcase
422
- * @param {ComposioToolExecuteResponse} response - The response to transform
423
- * @returns {ToolExecuteResponse} The transformed response
674
+ * Transforms tool execution response from snake_case API format to camelCase.
675
+ *
676
+ * This method converts the response received from the Composio API to a standardized format
677
+ * with consistent property naming that follows JavaScript/TypeScript conventions.
678
+ *
679
+ * @param {ComposioToolExecuteResponse} response - The raw API response to transform
680
+ * @returns {ToolExecuteResponse} The transformed response with camelCase properties
681
+ *
682
+ * @private
424
683
  */
425
684
  private transformToolExecuteResponse;
426
685
  /**
@@ -438,9 +697,35 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
438
697
  */
439
698
  private getConnectedAccountIdForTool;
440
699
  /**
441
- * Lists all tools available in the Composio SDK as well as custom tools.
442
- * This method fetches the tools from the Composio API in the raw format.
443
- * @returns {ToolList} List of tools
700
+ * Lists all tools available in the Composio SDK including custom tools.
701
+ *
702
+ * This method fetches tools from the Composio API in raw format and combines them with
703
+ * any registered custom tools. The response can be filtered and modified as needed.
704
+ *
705
+ * @param {string} userId - The user ID for whom to fetch the tools
706
+ * @param {ToolListParams} [query={}] - Optional query parameters to filter the tools
707
+ * @param {TransformToolSchemaModifier} [modifier] - Optional function to transform tool schemas
708
+ * @returns {Promise<ToolList>} List of tools matching the query criteria
709
+ *
710
+ * @example
711
+ * ```typescript
712
+ * // Get all tools
713
+ * const tools = await composio.tools.getRawComposioTools('default');
714
+ *
715
+ * // Get tools with filters
716
+ * const githubTools = await composio.tools.getRawComposioTools('default', {
717
+ * toolkits: ['github'],
718
+ * important: true
719
+ * });
720
+ *
721
+ * // Get tools with schema transformation
722
+ * const tools = await composio.tools.getRawComposioTools('default', {},
723
+ * (toolSlug, toolkitSlug, tool) => {
724
+ * // Add custom properties to tool schema
725
+ * return {...tool, customProperty: 'value'};
726
+ * }
727
+ * );
728
+ * ```
444
729
  */
445
730
  getRawComposioTools(userId: string, query?: ToolListParams, modifier?: TransformToolSchemaModifier): Promise<ToolList>;
446
731
  /**
@@ -456,30 +741,51 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
456
741
  */
457
742
  getRawComposioToolBySlug(userId: string, slug: string, modifier?: TransformToolSchemaModifier): Promise<Tool>;
458
743
  /**
459
- * Get a list of tools by their slugs
460
- * @param userId - The user id
461
- * @param filters - The filters for the tools
462
- * @param options - The options for the tools
463
- * @returns The tools
744
+ * Get a list of tools from Composio based on filters.
745
+ * This method fetches the tools from the Composio API and wraps them using the provider.
746
+ *
747
+ * @param {string} userId - The user id to get the tools for
748
+ * @param {ToolListParams} filters - The filters to apply when fetching tools
749
+ * @param {ProviderOptions<TProvider>} [options] - Optional provider options including modifiers
750
+ * @returns {Promise<ReturnType<T['wrapTools']>>} The wrapped tools collection
464
751
  *
465
752
  * @example
466
- * ```ts
753
+ * ```typescript
754
+ * // Get tools from the GitHub toolkit
755
+ * const tools = await composio.tools.get('default', {
756
+ * toolkits: ['github'],
757
+ * limit: 10
758
+ * });
759
+ *
760
+ * // Get tools with search
467
761
  * const tools = await composio.tools.get('default', {
468
- * tools: ['github'],
762
+ * search: 'user',
763
+ * important: true
469
764
  * });
470
765
  * ```
471
766
  */
472
767
  get<T extends TProvider>(userId: string, filters: ToolListParams, options?: ProviderOptions<TProvider>): Promise<ReturnType<T['wrapTools']>>;
473
768
  /**
474
- * Get a tool by its slug
475
- * @param userId - The user id
476
- * @param slug - The slug of the tool
477
- * @param options - The options for the tool
478
- * @returns The tool
769
+ * Get a specific tool by its slug.
770
+ * This method fetches the tool from the Composio API and wraps it using the provider.
771
+ *
772
+ * @param {string} userId - The user id to get the tool for
773
+ * @param {string} slug - The slug of the tool to fetch
774
+ * @param {ProviderOptions<TProvider>} [options] - Optional provider options including modifiers
775
+ * @returns {Promise<ReturnType<T['wrapTools']>>} The wrapped tool
479
776
  *
480
777
  * @example
481
- * ```ts
482
- * const tool = await composio.tools.get('default', 'github');
778
+ * ```typescript
779
+ * // Get a specific tool by slug
780
+ * const hackerNewsUserTool = await composio.tools.get('default', 'HACKERNEWS_GET_USER');
781
+ *
782
+ * // Get a tool with schema modifications
783
+ * const tool = await composio.tools.get('default', 'GITHUB_GET_REPOS', {
784
+ * modifyToolSchema: (toolSlug, toolkitSlug, schema) => {
785
+ * // Customize the tool schema
786
+ * return {...schema, description: 'Custom description'};
787
+ * }
788
+ * });
483
789
  * ```
484
790
  */
485
791
  get<T extends TProvider>(userId: string, slug: string, options?: ProviderOptions<TProvider>): Promise<ReturnType<T['wrapTools']>>;
@@ -511,13 +817,43 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
511
817
  */
512
818
  private handleComposioToolExecution;
513
819
  /**
514
- * Exectes a given tool with the provided parameters.
820
+ * Executes a given tool with the provided parameters.
515
821
  *
516
- * This method calls the Composio API to execute the tool and returns the response.
822
+ * This method calls the Composio API or a custom tool handler to execute the tool and returns the response.
823
+ * It automatically determines whether to use a custom tool or a Composio API tool based on the slug.
517
824
  *
518
- * @param {string} slug - The ID of the tool to be executed
825
+ * @param {string} slug - The slug/ID of the tool to be executed
519
826
  * @param {ToolExecuteParams} body - The parameters to be passed to the tool
827
+ * @param {ExecuteToolModifiers} [modifiers] - Optional modifiers to transform the request or response
520
828
  * @returns {Promise<ToolExecuteResponse>} - The response from the tool execution
829
+ *
830
+ * @throws {ComposioCustomToolsNotInitializedError} If the CustomTools instance is not initialized
831
+ * @throws {ComposioToolNotFoundError} If the tool with the given slug is not found
832
+ * @throws {ComposioToolExecutionError} If there is an error during tool execution
833
+ *
834
+ * @example
835
+ * ```typescript
836
+ * // Execute a Composio API tool
837
+ * const result = await composio.tools.execute('HACKERNEWS_GET_USER', {
838
+ * userId: 'default',
839
+ * arguments: { userId: 'pg' }
840
+ * });
841
+ *
842
+ * // Execute with modifiers
843
+ * const result = await composio.tools.execute('GITHUB_GET_ISSUES', {
844
+ * userId: 'default',
845
+ * arguments: { owner: 'composio', repo: 'sdk' }
846
+ * }, {
847
+ * beforeToolExecute: (toolSlug, toolkitSlug, params) => {
848
+ * // Modify params before execution
849
+ * return params;
850
+ * },
851
+ * afterToolExecute: (toolSlug, toolkitSlug, result) => {
852
+ * // Transform result after execution
853
+ * return result;
854
+ * }
855
+ * });
856
+ * ```
521
857
  */
522
858
  execute(slug: string, body: ToolExecuteParams, modifiers?: ExecuteToolModifiers): Promise<ToolExecuteResponse>;
523
859
  /**
@@ -545,9 +881,39 @@ declare class Tools<TToolCollection, TTool, TProvider extends BaseComposioProvid
545
881
  */
546
882
  proxyExecute(body: ToolProxyParams): Promise<ToolProxyResponse>;
547
883
  /**
548
- * Execute a custom tool
549
- * @param body
550
- * @returns
884
+ * Creates a custom tool that can be used within the Composio SDK.
885
+ *
886
+ * Custom tools allow you to extend the functionality of Composio with your own implementations
887
+ * while keeping a consistent interface for both built-in and custom tools.
888
+ *
889
+ * @param {CustomToolOptions} body - The configuration for the custom tool
890
+ * @returns {Promise<Tool>} The created custom tool
891
+ *
892
+ * @example
893
+ * ```typescript
894
+ * const customTool = await composio.tools.createCustomTool({
895
+ * name: 'My Custom Tool',
896
+ * description: 'A custom tool that does something specific',
897
+ * slug: 'MY_CUSTOM_TOOL',
898
+ * inputParameters: {
899
+ * param1: {
900
+ * type: 'string',
901
+ * description: 'First parameter',
902
+ * required: true
903
+ * }
904
+ * },
905
+ * outputParameters: {
906
+ * result: {
907
+ * type: 'string',
908
+ * description: 'The result of the operation'
909
+ * }
910
+ * },
911
+ * handler: async (params, context) => {
912
+ * // Custom logic here
913
+ * return { data: { result: 'Success!' } };
914
+ * }
915
+ * });
916
+ * ```
551
917
  */
552
918
  createCustomTool(body: CustomToolOptions): Promise<Tool>;
553
919
  }
@@ -1180,14 +1546,14 @@ declare const ConnectedAccountStatuses: {
1180
1546
  type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
1181
1547
  type CreateConnectedAccountOptions = z.infer<typeof CreateConnectedAccountOptionsSchema>;
1182
1548
  declare const CreateConnectedAccountOptionsSchema: z.ZodObject<{
1183
- redirectUrl: z.ZodOptional<z.ZodString>;
1549
+ callbackUrl: z.ZodOptional<z.ZodString>;
1184
1550
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1185
1551
  }, "strip", z.ZodTypeAny, {
1186
1552
  data?: Record<string, unknown> | undefined;
1187
- redirectUrl?: string | undefined;
1553
+ callbackUrl?: string | undefined;
1188
1554
  }, {
1189
1555
  data?: Record<string, unknown> | undefined;
1190
- redirectUrl?: string | undefined;
1556
+ callbackUrl?: string | undefined;
1191
1557
  }>;
1192
1558
  type CreateConnectedAccountOptionsSchema = z.infer<typeof CreateConnectedAccountOptionsSchema>;
1193
1559
  declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
@@ -1210,7 +1576,7 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1210
1576
  }>;
1211
1577
  userId: z.ZodString;
1212
1578
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1213
- params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1579
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1214
1580
  status: z.ZodEnum<["ACTIVE", "INACTIVE", "DELETED", "INITIATED", "EXPIRED", "FAILED"]>;
1215
1581
  statusReason: z.ZodNullable<z.ZodString>;
1216
1582
  toolkit: z.ZodObject<{
@@ -1225,7 +1591,6 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1225
1591
  createdAt: z.ZodString;
1226
1592
  updatedAt: z.ZodString;
1227
1593
  }, "strip", z.ZodTypeAny, {
1228
- params: Record<string, unknown>;
1229
1594
  status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1230
1595
  toolkit: {
1231
1596
  slug: string;
@@ -1243,9 +1608,9 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1243
1608
  };
1244
1609
  isDisabled: boolean;
1245
1610
  statusReason: string | null;
1611
+ params?: Record<string, unknown> | undefined;
1246
1612
  testRequestEndpoint?: string | undefined;
1247
1613
  }, {
1248
- params: Record<string, unknown>;
1249
1614
  status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1250
1615
  toolkit: {
1251
1616
  slug: string;
@@ -1263,9 +1628,167 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
1263
1628
  };
1264
1629
  isDisabled: boolean;
1265
1630
  statusReason: string | null;
1631
+ params?: Record<string, unknown> | undefined;
1266
1632
  testRequestEndpoint?: string | undefined;
1267
1633
  }>;
1268
1634
  type ConnectedAccountRetrieveResponse = z.infer<typeof ConnectedAccountRetrieveResponseSchema>;
1635
+ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
1636
+ authConfigIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1637
+ cursor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1638
+ labels: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1639
+ limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1640
+ orderBy: z.ZodOptional<z.ZodEnum<["created_at", "updated_at"]>>;
1641
+ statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["ACTIVE", "INACTIVE", "DELETED", "INITIATED", "EXPIRED", "FAILED"]>, "many">>>;
1642
+ toolkitSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1643
+ userIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1644
+ }, "strip", z.ZodTypeAny, {
1645
+ cursor?: number | null | undefined;
1646
+ limit?: number | null | undefined;
1647
+ authConfigIds?: string[] | null | undefined;
1648
+ labels?: string[] | null | undefined;
1649
+ orderBy?: "created_at" | "updated_at" | undefined;
1650
+ statuses?: ("ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED")[] | null | undefined;
1651
+ toolkitSlugs?: string[] | null | undefined;
1652
+ userIds?: string[] | null | undefined;
1653
+ }, {
1654
+ cursor?: number | null | undefined;
1655
+ limit?: number | null | undefined;
1656
+ authConfigIds?: string[] | null | undefined;
1657
+ labels?: string[] | null | undefined;
1658
+ orderBy?: "created_at" | "updated_at" | undefined;
1659
+ statuses?: ("ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED")[] | null | undefined;
1660
+ toolkitSlugs?: string[] | null | undefined;
1661
+ userIds?: string[] | null | undefined;
1662
+ }>;
1663
+ type ConnectedAccountListParams = z.infer<typeof ConnectedAccountListParamsSchema>;
1664
+ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
1665
+ items: z.ZodArray<z.ZodObject<{
1666
+ id: z.ZodString;
1667
+ authConfig: z.ZodObject<{
1668
+ id: z.ZodString;
1669
+ 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"]>;
1670
+ isComposioManaged: z.ZodBoolean;
1671
+ isDisabled: z.ZodBoolean;
1672
+ }, "strip", z.ZodTypeAny, {
1673
+ id: string;
1674
+ authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1675
+ isComposioManaged: boolean;
1676
+ isDisabled: boolean;
1677
+ }, {
1678
+ id: string;
1679
+ authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1680
+ isComposioManaged: boolean;
1681
+ isDisabled: boolean;
1682
+ }>;
1683
+ userId: z.ZodString;
1684
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1685
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1686
+ status: z.ZodEnum<["ACTIVE", "INACTIVE", "DELETED", "INITIATED", "EXPIRED", "FAILED"]>;
1687
+ statusReason: z.ZodNullable<z.ZodString>;
1688
+ toolkit: z.ZodObject<{
1689
+ slug: z.ZodString;
1690
+ }, "strip", z.ZodTypeAny, {
1691
+ slug: string;
1692
+ }, {
1693
+ slug: string;
1694
+ }>;
1695
+ testRequestEndpoint: z.ZodOptional<z.ZodString>;
1696
+ isDisabled: z.ZodBoolean;
1697
+ createdAt: z.ZodString;
1698
+ updatedAt: z.ZodString;
1699
+ }, "strip", z.ZodTypeAny, {
1700
+ status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1701
+ toolkit: {
1702
+ slug: string;
1703
+ };
1704
+ userId: string;
1705
+ data: Record<string, unknown>;
1706
+ createdAt: string;
1707
+ updatedAt: string;
1708
+ id: string;
1709
+ authConfig: {
1710
+ id: string;
1711
+ authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1712
+ isComposioManaged: boolean;
1713
+ isDisabled: boolean;
1714
+ };
1715
+ isDisabled: boolean;
1716
+ statusReason: string | null;
1717
+ params?: Record<string, unknown> | undefined;
1718
+ testRequestEndpoint?: string | undefined;
1719
+ }, {
1720
+ status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1721
+ toolkit: {
1722
+ slug: string;
1723
+ };
1724
+ userId: string;
1725
+ data: Record<string, unknown>;
1726
+ createdAt: string;
1727
+ updatedAt: string;
1728
+ id: string;
1729
+ authConfig: {
1730
+ id: string;
1731
+ authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1732
+ isComposioManaged: boolean;
1733
+ isDisabled: boolean;
1734
+ };
1735
+ isDisabled: boolean;
1736
+ statusReason: string | null;
1737
+ params?: Record<string, unknown> | undefined;
1738
+ testRequestEndpoint?: string | undefined;
1739
+ }>, "many">;
1740
+ nextCursor: z.ZodNullable<z.ZodString>;
1741
+ totalPages: z.ZodNumber;
1742
+ }, "strip", z.ZodTypeAny, {
1743
+ items: {
1744
+ status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1745
+ toolkit: {
1746
+ slug: string;
1747
+ };
1748
+ userId: string;
1749
+ data: Record<string, unknown>;
1750
+ createdAt: string;
1751
+ updatedAt: string;
1752
+ id: string;
1753
+ authConfig: {
1754
+ id: string;
1755
+ authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1756
+ isComposioManaged: boolean;
1757
+ isDisabled: boolean;
1758
+ };
1759
+ isDisabled: boolean;
1760
+ statusReason: string | null;
1761
+ params?: Record<string, unknown> | undefined;
1762
+ testRequestEndpoint?: string | undefined;
1763
+ }[];
1764
+ nextCursor: string | null;
1765
+ totalPages: number;
1766
+ }, {
1767
+ items: {
1768
+ status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1769
+ toolkit: {
1770
+ slug: string;
1771
+ };
1772
+ userId: string;
1773
+ data: Record<string, unknown>;
1774
+ createdAt: string;
1775
+ updatedAt: string;
1776
+ id: string;
1777
+ authConfig: {
1778
+ id: string;
1779
+ authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1780
+ isComposioManaged: boolean;
1781
+ isDisabled: boolean;
1782
+ };
1783
+ isDisabled: boolean;
1784
+ statusReason: string | null;
1785
+ params?: Record<string, unknown> | undefined;
1786
+ testRequestEndpoint?: string | undefined;
1787
+ }[];
1788
+ nextCursor: string | null;
1789
+ totalPages: number;
1790
+ }>;
1791
+ type ConnectedAccountListResponse = z.infer<typeof ConnectedAccountListResponseSchema>;
1269
1792
 
1270
1793
  /**
1271
1794
  * @fileoverview Connection request class for Composio SDK, used to manage an initiated connection request.
@@ -1278,46 +1801,50 @@ type ConnectedAccountRetrieveResponse = z.infer<typeof ConnectedAccountRetrieveR
1278
1801
  declare class ConnectionRequest {
1279
1802
  private client;
1280
1803
  id: string;
1281
- status: ConnectedAccountStatus;
1804
+ status?: ConnectedAccountStatus;
1282
1805
  redirectUrl?: string | null;
1283
- constructor(client: ComposioClient, connectedAccountId: string, connectedAccountStatus: ConnectedAccountStatus, redirectUrl?: string | null);
1806
+ constructor(client: ComposioClient, connectedAccountId: string, status?: ConnectedAccountStatus, redirectUrl?: string | null);
1284
1807
  /**
1285
- * Transform the response from the Composio API to the SDK format
1286
- * @param response
1287
- * @returns
1808
+ * Transforms the raw connected account response from the Composio API to the SDK format.
1809
+ *
1810
+ * This method converts property names from snake_case to camelCase and reorganizes
1811
+ * the data structure to match the SDK's standardized format.
1812
+ *
1813
+ * @param {OriginalConnectedAccountResponse} response - The raw API response to transform
1814
+ * @returns {Promise<ConnectedAccountRetrieveResponse>} The transformed response
1815
+ * @throws {ZodError} If the response fails validation against the expected schema
1816
+ *
1817
+ * @private
1288
1818
  */
1289
1819
  private transformResponse;
1290
1820
  /**
1291
- * Wait for the connection to be established.
1292
- * The function will poll the Composio API every second until the connection is established or the timeout is reached.
1293
- * @param {number} timeout - The time in milliseconds to wait for the connection to be established. Default is 30 seconds.
1294
- * @returns
1821
+ * Waits for the connection request to complete and become active.
1822
+ *
1823
+ * This method continuously polls the Composio API to check the status of the connection request
1824
+ * until it either becomes active, enters a terminal error state, or times out.
1825
+ *
1826
+ * @param {number} [timeout=60000] - Maximum time to wait in milliseconds before timing out (default: 60 seconds)
1827
+ * @returns {Promise<ConnectedAccountRetrieveResponse>} The final connected account response when successful
1828
+ * @throws {ComposioConnectedAccountNotFoundError} If the connected account cannot be found
1829
+ * @throws {ConnectionRequestFailedError} If the connection enters a failed, expired, or deleted state
1830
+ * @throws {ConnectionRequestTimeoutError} If the connection request does not complete within the timeout period
1831
+ *
1832
+ * @example
1833
+ * ```typescript
1834
+ * // Wait for connection with default timeout (60 seconds)
1835
+ * try {
1836
+ * const connection = await connectionRequest.waitForConnection();
1837
+ * console.log('Connection established:', connection.id);
1838
+ * } catch (error) {
1839
+ * console.error('Connection failed:', error.message);
1840
+ * }
1841
+ *
1842
+ * // Wait for connection with custom timeout (2 minutes)
1843
+ * const connection = await connectionRequest.waitForConnection(120000);
1844
+ * ```
1295
1845
  */
1296
1846
  waitForConnection(timeout?: number): Promise<ConnectedAccountRetrieveResponse>;
1297
1847
  }
1298
- declare const connectionRequest: (client: ComposioClient) => {
1299
- waitForConnection: (connectedAccountId: string, timeout?: number) => Promise<{
1300
- params: Record<string, unknown>;
1301
- status: "ACTIVE" | "INACTIVE" | "DELETED" | "INITIATED" | "EXPIRED" | "FAILED";
1302
- toolkit: {
1303
- slug: string;
1304
- };
1305
- userId: string;
1306
- data: Record<string, unknown>;
1307
- createdAt: string;
1308
- updatedAt: string;
1309
- id: string;
1310
- authConfig: {
1311
- id: string;
1312
- authScheme: "NO_AUTH" | "OAUTH2" | "OAUTH1" | "OAUTH1A" | "API_KEY" | "BASIC" | "BILLCOM_AUTH" | "BEARER_TOKEN" | "GOOGLE_SERVICE_ACCOUNT" | "BASIC_WITH_JWT" | "COMPOSIO_LINK" | "CALCOM_AUTH" | "SNOWFLAKE";
1313
- isComposioManaged: boolean;
1314
- isDisabled: boolean;
1315
- };
1316
- isDisabled: boolean;
1317
- statusReason: string | null;
1318
- testRequestEndpoint?: string | undefined;
1319
- }>;
1320
- };
1321
1848
 
1322
1849
  /**
1323
1850
  * Toolkits class
@@ -1329,37 +1856,84 @@ declare class Toolkits {
1329
1856
  private client;
1330
1857
  constructor(client: ComposioClient);
1331
1858
  /**
1332
- * List all toolkits available in the Composio SDK.
1333
- * This method fetches the toolkits from the Composio API.
1334
- * @returns {Promise<Toolkit[]>} List of toolkits
1859
+ * Retrieves a list of toolkits based on the provided query parameters.
1860
+ *
1861
+ * This method fetches toolkits from the Composio API and transforms the response
1862
+ * from snake_case to camelCase format for consistency with JavaScript/TypeScript conventions.
1863
+ *
1864
+ * @param {ToolkitListParams} query - The query parameters to filter toolkits
1865
+ * @returns {Promise<ToolKitListResponse>} The transformed list of toolkits
1866
+ *
1867
+ * @private
1335
1868
  */
1336
1869
  private getToolkits;
1337
1870
  /**
1338
- * Fetches a toolkit by its Slug.
1339
- * This method retrieves the toolkit from the Composio API.
1340
- * @param slug - The ID of the toolkit to be retrieved
1341
- * @param options - Request options
1342
- * @returns {Promise<ToolkitRetrieveResponse>} The toolkit object
1343
- */
1344
- private getToolkitBySlug;
1345
- /**
1346
- * @overload
1347
- * Fetches a toolkit by its Slug or a list of toolkits.
1348
- * @param slug - The ID of the toolkit to be retrieved
1349
- * @returns {Promise<ToolkitRetrieveResponse>} The toolkit object
1871
+ * Retrieves a specific toolkit by its slug identifier.
1872
+ *
1873
+ * @param {string} slug - The unique slug identifier of the toolkit to retrieve
1874
+ * @returns {Promise<ToolkitRetrieveResponse>} The toolkit object with detailed information
1875
+ * @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
1876
+ *
1877
+ * @example
1878
+ * ```typescript
1879
+ * // Get a specific toolkit
1880
+ * const githubToolkit = await composio.toolkits.get('github');
1881
+ * console.log(githubToolkit.name); // GitHub
1882
+ * console.log(githubToolkit.authConfigDetails); // Authentication configuration details
1883
+ * ```
1350
1884
  */
1351
1885
  get(slug: string): Promise<ToolkitRetrieveResponse>;
1352
1886
  /**
1353
- * @overload
1354
- * Fetches a list of toolkits.
1355
- * @param query - The parameters to fetch the toolkits
1356
- * @returns {Promise<ToolKitListResponse>} The list of toolkits
1887
+ * Retrieves a list of toolkits based on the provided query parameters.
1888
+ *
1889
+ * @param {ToolkitListParams} query - The query parameters to filter toolkits
1890
+ * @returns {Promise<ToolKitListResponse>} A paginated list of toolkits matching the query criteria
1891
+ *
1892
+ * @example
1893
+ * ```typescript
1894
+ * // Get all toolkits
1895
+ * const allToolkits = await composio.toolkits.get({});
1896
+ *
1897
+ * // Get toolkits by category
1898
+ * const devToolkits = await composio.toolkits.get({
1899
+ * category: 'developer-tools'
1900
+ * });
1901
+ *
1902
+ * // Get local toolkits
1903
+ * const localToolkits = await composio.toolkits.get({
1904
+ * isLocal: true
1905
+ * });
1906
+ * ```
1357
1907
  */
1358
1908
  get(query: ToolkitListParams): Promise<ToolKitListResponse>;
1359
1909
  /**
1360
- * Fetches all categories available in the Composio SDK
1910
+ * Retrieves a specific toolkit by its slug identifier.
1911
+ *
1912
+ * This method fetches a single toolkit from the Composio API and transforms
1913
+ * the response to use camelCase property naming consistent with JavaScript/TypeScript conventions.
1914
+ *
1915
+ * @param {string} slug - The unique slug identifier of the toolkit to retrieve
1916
+ * @returns {Promise<ToolkitRetrieveResponse>} The transformed toolkit object
1917
+ * @throws {ValidationError} If the response cannot be properly parsed
1918
+ * @throws {ComposioToolNotFoundError} If no toolkit with the given slug exists
1361
1919
  *
1362
- * @returns {Promise<ToolkitRetrieveCategoriesResponse>} List of categories
1920
+ * @private
1921
+ */
1922
+ private getToolkitBySlug;
1923
+ /**
1924
+ * Retrieves all toolkit categories available in the Composio SDK.
1925
+ *
1926
+ * This method fetches the complete list of categories from the Composio API
1927
+ * and transforms the response to use camelCase property naming.
1928
+ *
1929
+ * @returns {Promise<ToolkitRetrieveCategoriesResponse>} The list of toolkit categories
1930
+ *
1931
+ * @example
1932
+ * ```typescript
1933
+ * // Get all toolkit categories
1934
+ * const categories = await composio.toolkits.listCategories();
1935
+ * console.log(categories.items); // Array of category objects
1936
+ * ```
1363
1937
  */
1364
1938
  listCategories(): Promise<ToolkitRetrieveCategoriesResponse>;
1365
1939
  /**
@@ -1367,8 +1941,12 @@ declare class Toolkits {
1367
1941
  * This method will create an auth config if one doesn't exist and initiate a connection request.
1368
1942
  * @param {string} userId - The user id of the user to authorize
1369
1943
  * @param {string} toolkitSlug - The slug of the toolkit to authorize
1370
- * @param {string} authConfigId - The id of the auth config to use
1371
1944
  * @returns {Promise<ConnectionRequest>} The connection request object
1945
+ *
1946
+ * @example
1947
+ * ```typescript
1948
+ * const connectionRequest = await composio.toolkits.authorize(userId, 'github');
1949
+ * ```
1372
1950
  */
1373
1951
  authorize(userId: string, toolkitSlug: string): Promise<ConnectionRequest>;
1374
1952
  }
@@ -1600,7 +2178,7 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
1600
2178
  status: z.ZodEnum<["ENABLED", "DISABLED"]>;
1601
2179
  uuid: z.ZodString;
1602
2180
  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"]>>;
1603
- credentials: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
2181
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1604
2182
  expectedInputFields: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1605
2183
  isComposioManaged: z.ZodOptional<z.ZodBoolean>;
1606
2184
  createdBy: z.ZodOptional<z.ZodString>;
@@ -1614,10 +2192,10 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
1614
2192
  logo: string;
1615
2193
  };
1616
2194
  id: string;
1617
- credentials: Record<string, string | number | boolean>;
1618
2195
  noOfConnections: number;
1619
2196
  uuid: string;
1620
2197
  createdAt?: string | undefined;
2198
+ credentials?: Record<string, unknown> | undefined;
1621
2199
  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;
1622
2200
  isComposioManaged?: boolean | undefined;
1623
2201
  expectedInputFields?: unknown[] | undefined;
@@ -1631,10 +2209,10 @@ declare const AuthConfigRetrieveResponseSchema: z.ZodObject<{
1631
2209
  logo: string;
1632
2210
  };
1633
2211
  id: string;
1634
- credentials: Record<string, string | number | boolean>;
1635
2212
  noOfConnections: number;
1636
2213
  uuid: string;
1637
2214
  createdAt?: string | undefined;
2215
+ credentials?: Record<string, unknown> | undefined;
1638
2216
  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;
1639
2217
  isComposioManaged?: boolean | undefined;
1640
2218
  expectedInputFields?: unknown[] | undefined;
@@ -1677,7 +2255,7 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
1677
2255
  status: z.ZodEnum<["ENABLED", "DISABLED"]>;
1678
2256
  uuid: z.ZodString;
1679
2257
  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"]>>;
1680
- credentials: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
2258
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1681
2259
  expectedInputFields: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1682
2260
  isComposioManaged: z.ZodOptional<z.ZodBoolean>;
1683
2261
  createdBy: z.ZodOptional<z.ZodString>;
@@ -1691,10 +2269,10 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
1691
2269
  logo: string;
1692
2270
  };
1693
2271
  id: string;
1694
- credentials: Record<string, string | number | boolean>;
1695
2272
  noOfConnections: number;
1696
2273
  uuid: string;
1697
2274
  createdAt?: string | undefined;
2275
+ credentials?: Record<string, unknown> | undefined;
1698
2276
  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;
1699
2277
  isComposioManaged?: boolean | undefined;
1700
2278
  expectedInputFields?: unknown[] | undefined;
@@ -1708,10 +2286,10 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
1708
2286
  logo: string;
1709
2287
  };
1710
2288
  id: string;
1711
- credentials: Record<string, string | number | boolean>;
1712
2289
  noOfConnections: number;
1713
2290
  uuid: string;
1714
2291
  createdAt?: string | undefined;
2292
+ credentials?: Record<string, unknown> | undefined;
1715
2293
  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;
1716
2294
  isComposioManaged?: boolean | undefined;
1717
2295
  expectedInputFields?: unknown[] | undefined;
@@ -1729,10 +2307,10 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
1729
2307
  logo: string;
1730
2308
  };
1731
2309
  id: string;
1732
- credentials: Record<string, string | number | boolean>;
1733
2310
  noOfConnections: number;
1734
2311
  uuid: string;
1735
2312
  createdAt?: string | undefined;
2313
+ credentials?: Record<string, unknown> | undefined;
1736
2314
  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;
1737
2315
  isComposioManaged?: boolean | undefined;
1738
2316
  expectedInputFields?: unknown[] | undefined;
@@ -1750,10 +2328,10 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
1750
2328
  logo: string;
1751
2329
  };
1752
2330
  id: string;
1753
- credentials: Record<string, string | number | boolean>;
1754
2331
  noOfConnections: number;
1755
2332
  uuid: string;
1756
2333
  createdAt?: string | undefined;
2334
+ credentials?: Record<string, unknown> | undefined;
1757
2335
  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;
1758
2336
  isComposioManaged?: boolean | undefined;
1759
2337
  expectedInputFields?: unknown[] | undefined;
@@ -1814,12 +2392,44 @@ declare class AuthConfigs {
1814
2392
  * @protected
1815
2393
  */
1816
2394
  protected getClient(): ComposioClient;
2395
+ /**
2396
+ * Transforms an auth config response from API format to SDK format.
2397
+ *
2398
+ * This method converts property names from snake_case to camelCase and reorganizes
2399
+ * the data structure to match the SDK's standardized format for auth configurations.
2400
+ *
2401
+ * @param {ComposioAuthConfigRetrieveResponse} authConfig - The raw API response to transform
2402
+ * @returns {AuthConfigRetrieveResponse} The transformed auth config data
2403
+ * @throws {ValidationError} If the response fails validation against the expected schema
2404
+ *
2405
+ * @private
2406
+ */
1817
2407
  private parseAuthConfigRetrieveResponse;
1818
2408
  /**
1819
- * List all auth configs
1820
- * @param {AuthConfigListParams} query - Query parameters for filtering auth configs
1821
- * @param {RequestOptions} options - Request options
1822
- * @returns {Promise<AuthConfigListResponse>} List of auth configs
2409
+ * Lists authentication configurations based on provided filter criteria.
2410
+ *
2411
+ * This method retrieves auth configs from the Composio API, transforms them to the SDK format,
2412
+ * and supports filtering by various parameters.
2413
+ *
2414
+ * @param {AuthConfigListParams} [query] - Optional query parameters for filtering auth configs
2415
+ * @returns {Promise<AuthConfigListResponse>} A paginated list of auth configurations
2416
+ * @throws {ValidationError} If the query parameters or response fail validation
2417
+ *
2418
+ * @example
2419
+ * ```typescript
2420
+ * // List all auth configs
2421
+ * const allConfigs = await composio.authConfigs.list();
2422
+ *
2423
+ * // List auth configs for a specific toolkit
2424
+ * const githubConfigs = await composio.authConfigs.list({
2425
+ * toolkitSlug: 'github'
2426
+ * });
2427
+ *
2428
+ * // List Composio-managed auth configs
2429
+ * const managedConfigs = await composio.authConfigs.list({
2430
+ * isComposioManaged: true
2431
+ * });
2432
+ * ```
1823
2433
  */
1824
2434
  list(query?: AuthConfigListParams): Promise<AuthConfigListResponse>;
1825
2435
  /**
@@ -1842,47 +2452,130 @@ declare class AuthConfigs {
1842
2452
  */
1843
2453
  create(toolkit: string, options?: CreateAuthConfigParams): Promise<CreateAuthConfigResponse>;
1844
2454
  /**
1845
- * Get an auth config by nanoid
1846
- * @param {string} nanoid - Unique identifier of the auth config
1847
- * @param {RequestOptions} options - Request options
1848
- * @returns {Promise<AuthConfigRetrieveResponse>} Auth config details
2455
+ * Retrieves a specific authentication configuration by its ID.
2456
+ *
2457
+ * This method fetches detailed information about a single auth config
2458
+ * and transforms the response to the SDK's standardized format.
2459
+ *
2460
+ * @param {string} nanoid - The unique identifier of the auth config to retrieve
2461
+ * @returns {Promise<AuthConfigRetrieveResponse>} The auth config details
2462
+ * @throws {Error} If the auth config cannot be found or an API error occurs
2463
+ * @throws {ValidationError} If the response fails validation
2464
+ *
2465
+ * @example
2466
+ * ```typescript
2467
+ * // Get an auth config by ID
2468
+ * const authConfig = await composio.authConfigs.get('auth_abc123');
2469
+ * console.log(authConfig.name); // e.g., 'GitHub Auth'
2470
+ * console.log(authConfig.toolkit.slug); // e.g., 'github'
2471
+ * ```
1849
2472
  */
1850
2473
  get(nanoid: string): Promise<AuthConfigRetrieveResponse>;
1851
2474
  /**
1852
- * Update an auth config
1853
- * @param {string} nanoid - Unique identifier of the auth config to update
1854
- * @param {AuthConfigUpdateParams} data - Data to update
1855
- * @param {RequestOptions} options - Request options
1856
- * @returns {Promise<AuthConfigUpdateResponse>} Updated auth config
2475
+ * Updates an existing authentication configuration.
2476
+ *
2477
+ * This method allows you to modify properties of an auth config such as credentials,
2478
+ * scopes, or tool restrictions. The update type (custom or default) determines which
2479
+ * fields can be updated.
2480
+ *
2481
+ * @param {string} nanoid - The unique identifier of the auth config to update
2482
+ * @param {AuthConfigUpdateParams} data - The data to update, which can be either custom or default type
2483
+ * @returns {Promise<AuthConfigUpdateResponse>} The updated auth config
2484
+ * @throws {ValidationError} If the update parameters are invalid
2485
+ * @throws {Error} If the auth config cannot be found or updated
2486
+ *
2487
+ * @example
2488
+ * ```typescript
2489
+ * // Update a custom auth config with new credentials
2490
+ * const updatedConfig = await composio.authConfigs.update('auth_abc123', {
2491
+ * type: 'custom',
2492
+ * credentials: {
2493
+ * apiKey: 'new-api-key-value'
2494
+ * }
2495
+ * });
2496
+ *
2497
+ * // Update a default auth config with new scopes
2498
+ * const updatedConfig = await composio.authConfigs.update('auth_abc123', {
2499
+ * type: 'default',
2500
+ * scopes: ['read:user', 'repo']
2501
+ * });
2502
+ * ```
1857
2503
  */
1858
2504
  update(nanoid: string, data: AuthConfigUpdateParams): Promise<AuthConfigUpdateResponse>;
1859
2505
  /**
1860
- * Delete an auth config
1861
- * @param {string} nanoid - Unique identifier of the auth config to delete
1862
- * @param {RequestOptions} options - Request options
1863
- * @returns {Promise<AuthConfigDeleteResponse>} Response from deletion
2506
+ * Deletes an authentication configuration.
2507
+ *
2508
+ * This method permanently removes an auth config from the Composio platform.
2509
+ * This action cannot be undone and will prevent any connected accounts that use
2510
+ * this auth config from functioning.
2511
+ *
2512
+ * @param {string} nanoid - The unique identifier of the auth config to delete
2513
+ * @returns {Promise<AuthConfigDeleteResponse>} The deletion response
2514
+ * @throws {Error} If the auth config doesn't exist or cannot be deleted
2515
+ *
2516
+ * @example
2517
+ * ```typescript
2518
+ * // Delete an auth config
2519
+ * await composio.authConfigs.delete('auth_abc123');
2520
+ * ```
1864
2521
  */
1865
2522
  delete(nanoid: string): Promise<AuthConfigDeleteResponse>;
1866
2523
  /**
1867
- * Update the status of an auth config
1868
- * @param {string} status - The status to update the auth config to
1869
- * @param {string} nanoid - Unique identifier of the auth config
1870
- * @param {RequestOptions} options - Request options
1871
- * @returns {Promise<AuthConfigUpdateStatusResponse>} Updated auth config details
2524
+ * Updates the status of an authentication configuration.
2525
+ *
2526
+ * This method allows you to enable or disable an auth config. When disabled,
2527
+ * the auth config cannot be used to create new connected accounts or authenticate
2528
+ * with third-party services.
2529
+ *
2530
+ * @param {string} status - The status to set ('ENABLED' or 'DISABLED')
2531
+ * @param {string} nanoid - The unique identifier of the auth config
2532
+ * @returns {Promise<AuthConfigUpdateStatusResponse>} The updated auth config details
2533
+ * @throws {Error} If the auth config cannot be found or the status cannot be updated
2534
+ *
2535
+ * @example
2536
+ * ```typescript
2537
+ * // Disable an auth config
2538
+ * await composio.authConfigs.updateStatus('DISABLED', 'auth_abc123');
2539
+ *
2540
+ * // Enable an auth config
2541
+ * await composio.authConfigs.updateStatus('ENABLED', 'auth_abc123');
2542
+ * ```
1872
2543
  */
1873
2544
  updateStatus(status: 'ENABLED' | 'DISABLED', nanoid: string): Promise<AuthConfigUpdateStatusResponse>;
1874
2545
  /**
1875
- * Enable an auth config
1876
- * @param {string} nanoid - Unique identifier of the auth config
1877
- * @param {RequestOptions} options - Request options
1878
- * @returns {Promise<AuthConfigUpdateStatusResponse>} Updated auth config details
2546
+ * Enables an authentication configuration.
2547
+ *
2548
+ * This is a convenience method that calls updateStatus with 'ENABLED'.
2549
+ * When enabled, the auth config can be used to create new connected accounts
2550
+ * and authenticate with third-party services.
2551
+ *
2552
+ * @param {string} nanoid - The unique identifier of the auth config to enable
2553
+ * @returns {Promise<AuthConfigUpdateStatusResponse>} The updated auth config details
2554
+ * @throws {Error} If the auth config cannot be found or enabled
2555
+ *
2556
+ * @example
2557
+ * ```typescript
2558
+ * // Enable an auth config
2559
+ * await composio.authConfigs.enable('auth_abc123');
2560
+ * ```
1879
2561
  */
1880
2562
  enable(nanoid: string): Promise<AuthConfigUpdateStatusResponse>;
1881
2563
  /**
1882
- * Disable an auth config
1883
- * @param {string} nanoid - Unique identifier of the auth config
1884
- * @param {RequestOptions} options - Request options
1885
- * @returns {Promise<AuthConfigUpdateStatusResponse>} Updated auth config details
2564
+ * Disables an authentication configuration.
2565
+ *
2566
+ * This is a convenience method that calls updateStatus with 'DISABLED'.
2567
+ * When disabled, the auth config cannot be used to create new connected accounts
2568
+ * or authenticate with third-party services, but existing connections may continue to work.
2569
+ *
2570
+ * @param {string} nanoid - The unique identifier of the auth config to disable
2571
+ * @returns {Promise<AuthConfigUpdateStatusResponse>} The updated auth config details
2572
+ * @throws {Error} If the auth config cannot be found or disabled
2573
+ *
2574
+ * @example
2575
+ * ```typescript
2576
+ * // Disable an auth config
2577
+ * await composio.authConfigs.disable('auth_abc123');
2578
+ * ```
1886
2579
  */
1887
2580
  disable(nanoid: string): Promise<AuthConfigUpdateStatusResponse>;
1888
2581
  }
@@ -1904,13 +2597,45 @@ declare class AuthConfigs {
1904
2597
  declare class ConnectedAccounts {
1905
2598
  private client;
1906
2599
  constructor(client: ComposioClient);
2600
+ transformConnectedAccountRetrieveResponse(response: ConnectedAccountRetrieveResponse$1 | ConnectedAccountListResponse$1['items'][0]): ConnectedAccountRetrieveResponse;
1907
2601
  /**
1908
- * List all connected accounts
1909
- * @param {ConnectedAccountListParams} query - Query parameters for filtering connected accounts
1910
- * @param {RequestOptions} options - Request options
1911
- * @returns {Promise<ConnectedAccountListResponse>} List of connected accounts
2602
+ * Lists all connected accounts based on provided filter criteria.
2603
+ *
2604
+ * This method retrieves connected accounts from the Composio API with optional filtering.
2605
+ *
2606
+ * @param {ConnectedAccountListParams} [query] - Optional query parameters for filtering connected accounts
2607
+ * @returns {Promise<ConnectedAccountListResponse>} A paginated list of connected accounts
2608
+ * @throws {ValidationError} If the query fails validation against the expected schema
2609
+ * @example
2610
+ * ```typescript
2611
+ * // List all connected accounts
2612
+ * const allAccounts = await composio.connectedAccounts.list();
2613
+ *
2614
+ * // List accounts for a specific user
2615
+ * const userAccounts = await composio.connectedAccounts.list({
2616
+ * userIds: ['user123']
2617
+ * });
2618
+ *
2619
+ * // List accounts for a specific toolkit
2620
+ * const githubAccounts = await composio.connectedAccounts.list({
2621
+ * toolkitSlugs: ['github']
2622
+ * });
2623
+ * ```
1912
2624
  */
1913
2625
  list(query?: ConnectedAccountListParams): Promise<ConnectedAccountListResponse>;
2626
+ /**
2627
+ * Transforms connected account data from API format to SDK format.
2628
+ *
2629
+ * This method converts property names from snake_case to camelCase and reorganizes
2630
+ * the data structure to match the SDK's standardized format for connected accounts.
2631
+ *
2632
+ * @param {ConnectedAccountRetrieveResponseRaw} response - The raw API response to transform
2633
+ * @returns {ConnectedAccountRetrieveResponse} The transformed connected account data
2634
+ * @throws {ValidationError} If the response fails validation against the expected schema
2635
+ *
2636
+ * @private
2637
+ */
2638
+ transformConnectedAccountResponse(response: ConnectedAccountRetrieveResponse$1): ConnectedAccountRetrieveResponse;
1914
2639
  /**
1915
2640
  * Compound function to create a new connected account.
1916
2641
  * This function creates a new connected account and returns a connection request.
@@ -1930,26 +2655,80 @@ declare class ConnectedAccounts {
1930
2655
  * @link https://docs.composio.dev/reference/connected-accounts/create-connected-account
1931
2656
  */
1932
2657
  initiate(userId: string, authConfigId: string, options?: CreateConnectedAccountOptions): Promise<ConnectionRequest>;
2658
+ /**
2659
+ * Waits for a connection request to complete and become active.
2660
+ *
2661
+ * This method continuously polls the Composio API to check the status of a connection
2662
+ * until it either becomes active, enters a terminal error state, or times out.
2663
+ *
2664
+ * @param {string} connectedAccountId - The ID of the connected account to wait for
2665
+ * @param {number} [timeout=60000] - Maximum time to wait in milliseconds (default: 60 seconds)
2666
+ * @returns {Promise<ConnectedAccountRetrieveResponse>} The finalized connected account data
2667
+ * @throws {ComposioConnectedAccountNotFoundError} If the connected account cannot be found
2668
+ * @throws {ConnectionRequestFailedError} If the connection enters a failed, expired, or deleted state
2669
+ * @throws {ConnectionRequestTimeoutError} If the connection does not complete within the timeout period
2670
+ *
2671
+ * @example
2672
+ * ```typescript
2673
+ * // Wait for a connection to complete with default timeout
2674
+ * const connectedAccount = await composio.connectedAccounts.waitForConnection('conn_123abc');
2675
+ *
2676
+ * // Wait with a custom timeout of 2 minutes
2677
+ * const connectedAccount = await composio.connectedAccounts.waitForConnection('conn_123abc', 120000);
2678
+ * ```
2679
+ */
1933
2680
  waitForConnection(connectedAccountId: string, timeout?: number): Promise<ConnectedAccountRetrieveResponse>;
1934
2681
  /**
1935
- * Get a connected account by nanoid
1936
- * @param {string} nanoid - Unique identifier of the connected account
1937
- * @param {RequestOptions} options - Request options
1938
- * @returns {Promise<ConnectedAccountRetrieveResponse>} Connected account details
2682
+ * Retrieves a specific connected account by its ID.
2683
+ *
2684
+ * This method fetches detailed information about a single connected account
2685
+ * and transforms the response to the SDK's standardized format.
2686
+ *
2687
+ * @param {string} nanoid - The unique identifier of the connected account
2688
+ * @returns {Promise<ConnectedAccountRetrieveResponse>} The connected account details
2689
+ * @throws {Error} If the connected account cannot be found or an API error occurs
2690
+ *
2691
+ * @example
2692
+ * ```typescript
2693
+ * // Get a connected account by ID
2694
+ * const account = await composio.connectedAccounts.get('conn_abc123');
2695
+ * console.log(account.status); // e.g., 'ACTIVE'
2696
+ * console.log(account.toolkit.slug); // e.g., 'github'
2697
+ * ```
1939
2698
  */
1940
2699
  get(nanoid: string): Promise<ConnectedAccountRetrieveResponse>;
1941
2700
  /**
1942
- * Delete a connected account
1943
- * @param {string} nanoid - Unique identifier of the connected account to delete
1944
- * @param {RequestOptions} options - Request options
1945
- * @returns {Promise<ConnectedAccountDeleteResponse>} Response from deletion
2701
+ * Deletes a connected account.
2702
+ *
2703
+ * This method permanently removes a connected account from the Composio platform.
2704
+ * This action cannot be undone and will revoke any access tokens associated with the account.
2705
+ *
2706
+ * @param {string} nanoid - The unique identifier of the connected account to delete
2707
+ * @returns {Promise<ConnectedAccountDeleteResponse>} The deletion response
2708
+ * @throws {Error} If the account doesn't exist or cannot be deleted
2709
+ *
2710
+ * @example
2711
+ * ```typescript
2712
+ * // Delete a connected account
2713
+ * await composio.connectedAccounts.delete('conn_abc123');
2714
+ * ```
1946
2715
  */
1947
2716
  delete(nanoid: string): Promise<ConnectedAccountDeleteResponse>;
1948
2717
  /**
1949
- * Refresh a connected account's credentials
1950
- * @param {string} nanoid - Unique identifier of the connected account to refresh
1951
- * @param {RequestOptions} options - Request options
1952
- * @returns {Promise<ConnectedAccountRefreshResponse>} Refreshed connected account details
2718
+ * Refreshes a connected account's authentication credentials.
2719
+ *
2720
+ * This method attempts to refresh OAuth tokens or other credentials associated with
2721
+ * the connected account. This is useful when a token has expired or is about to expire.
2722
+ *
2723
+ * @param {string} nanoid - The unique identifier of the connected account to refresh
2724
+ * @returns {Promise<ConnectedAccountRefreshResponse>} The response containing the refreshed account details
2725
+ * @throws {Error} If the account doesn't exist or credentials cannot be refreshed
2726
+ *
2727
+ * @example
2728
+ * ```typescript
2729
+ * // Refresh a connected account's credentials
2730
+ * const refreshedAccount = await composio.connectedAccounts.refresh('conn_abc123');
2731
+ * ```
1953
2732
  */
1954
2733
  refresh(nanoid: string): Promise<ConnectedAccountRefreshResponse>;
1955
2734
  /**
@@ -2092,9 +2871,6 @@ declare class Composio<TProvider extends BaseComposioProvider<unknown, unknown>
2092
2871
  provider: TProvider;
2093
2872
  authConfigs: AuthConfigs;
2094
2873
  connectedAccounts: ConnectedAccounts;
2095
- experimental: {
2096
- connectionRequest: ReturnType<typeof connectionRequest>;
2097
- };
2098
2874
  /**
2099
2875
  * @param {Object} config Configuration for the Composio SDK.
2100
2876
  * @param {string} config.apiKey The API key for the Composio SDK.