@composio/core 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CustomTool-BMlZfJVz.mjs → CustomTool-B-_VjWpy.mjs} +1 -1
- package/dist/{CustomTool-CB5vm1Jc.d.mts → CustomTool-BHOYxLZX.d.mts} +1 -1
- package/dist/{FileModifierErrors-BqFmpRsm.mjs → FileModifierErrors-CdGSABoq.mjs} +1 -1
- package/dist/{SsrfErrors-C91YhASE.mjs → SsrfErrors-DiQldIdC.mjs} +18 -7
- package/dist/{Telemetry-HlftxMx6.mjs → Telemetry-JRJJYS4I.mjs} +2 -2
- package/dist/{cancellation-CXpfmiVo.mjs → cancellation-DV8CIi52.mjs} +2 -2
- package/dist/{composio-DLGaeN70.d.mts → composio-BTZsFajb.d.mts} +3149 -117
- package/dist/{customTool.types-BAmEh3MB.d.mts → customTool.types-D_w21L56.d.mts} +784 -56
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +7 -3
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +101 -18
- package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +123 -0
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +9 -2
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +8 -0
- package/dist/docs/reference/sdk-reference/typescript/keyring.mdx +56 -0
- package/dist/docs/reference/sdk-reference/typescript/logs.mdx +78 -0
- package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +15 -15
- package/dist/docs/reference/sdk-reference/typescript/meta.json +9 -1
- package/dist/docs/reference/sdk-reference/typescript/session-configs.mdx +83 -0
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +86 -27
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +26 -6
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +149 -12
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +18 -18
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +25 -25
- package/dist/docs/reference/sdk-reference/typescript/usage.mdx +78 -0
- package/dist/docs/reference/sdk-reference/typescript/webhook-endpoints.mdx +162 -0
- package/dist/docs/reference/sdk-reference/typescript/webhook-subscriptions.mdx +218 -0
- package/dist/docs/reference/sdk-reference/typescript/webhooks.mdx +20 -0
- package/dist/{errors-BuEKehbI.mjs → errors-Dyiu3ifQ.mjs} +127 -4
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/{fileUtils.node-L7XD8UPr.mjs → fileUtils.node-DNLhLg0W.mjs} +4 -4
- package/dist/index.d.mts +281 -55
- package/dist/index.mjs +3552 -949
- package/dist/models/Files.node.mjs +2 -2
- package/dist/{sensitiveFileUploadPaths-B6pBt9lO.mjs → sensitiveFileUploadPaths-BlLp-Yo2.mjs} +1 -1
- package/dist/{ssrfGuard.node-B9xQB4za.mjs → ssrfGuard.node-BZ270bcu.mjs} +1 -1
- package/dist/{types-CxLPO0Xq.d.mts → types-CgRsUGqm.d.mts} +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.mjs +5 -5
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/dist/utils/ssrfGuard.node.mjs +1 -1
- package/dist/utils/ssrfGuard.workerd.mjs +1 -1
- package/package.json +4 -2
- package/src/composio.ts +215 -10
- package/src/errors/ConnectedAccountsErrors.ts +47 -0
- package/src/errors/SDKErrors.ts +52 -0
- package/src/errors/ToolRouterErrors.ts +61 -0
- package/src/errors/index.ts +3 -0
- package/src/index.ts +13 -0
- package/src/lib/sessionConfigConflict.ts +43 -0
- package/src/lib/toolRouterMcp.ts +132 -0
- package/src/lib/toolRouterParams.ts +149 -37
- package/src/lib/toolRouterSourceSessionConfig.ts +12 -0
- package/src/models/ConnectedAccounts.ts +118 -2
- package/src/models/CustomToolkits.ts +169 -0
- package/src/models/Experimental.ts +27 -0
- package/src/models/Keyring.ts +65 -0
- package/src/models/Logs.ts +101 -0
- package/src/models/RemoteFile.ts +25 -8
- package/src/models/SessionConfigs.ts +117 -0
- package/src/models/ToolRouter.ts +61 -17
- package/src/models/ToolRouterSession.ts +149 -14
- package/src/models/Toolkits.ts +180 -0
- package/src/models/Tools.ts +10 -6
- package/src/models/Triggers.ts +3 -88
- package/src/models/Usage.ts +119 -0
- package/src/models/Webhooks.ts +520 -0
- package/src/services/pusher/Pusher.ts +17 -6
- package/src/types/authConfigs.types.ts +2 -0
- package/src/types/connectedAccounts.types.ts +54 -0
- package/src/types/customToolkits.types.ts +102 -0
- package/src/types/keyring.types.ts +32 -0
- package/src/types/logs.types.ts +108 -0
- package/src/types/sessionConfigs.types.ts +81 -0
- package/src/types/tool.types.ts +2 -0
- package/src/types/toolRouter.types.ts +352 -16
- package/src/types/toolkit.types.ts +144 -0
- package/src/types/usage.types.ts +81 -0
- package/src/types/webhooks.types.ts +143 -0
- package/src/utils/constants.ts +1 -5
- package/src/utils/logger.ts +39 -7
- package/src/utils/safePath.ts +172 -0
- package/src/utils/sdk.ts +385 -22
- package/src/utils/transformers/connectedAccounts.ts +37 -2
- package/src/utils/transformers/customToolkits.ts +98 -0
- package/src/utils/transformers/keyring.ts +24 -0
- package/src/utils/transformers/logs.ts +85 -0
- package/src/utils/transformers/sessionConfigs.ts +54 -0
- package/src/utils/transformers/toolRouterResponseTransform.ts +6 -0
- package/src/utils/transformers/toolkits.ts +106 -3
- package/src/utils/transformers/triggers.ts +2 -2
- package/src/utils/transformers/usage.ts +77 -0
- package/src/utils/transformers/webhooks.ts +139 -0
|
@@ -26,7 +26,7 @@ the execution will throw a `ComposioToolVersionRequiredError` unless `dangerousl
|
|
|
26
26
|
This helps prevent unexpected behavior when new toolkit versions are released.
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
|
-
async execute(slug: string, body:
|
|
29
|
+
async execute(slug: string, body: { allowTracing?: boolean; arguments?: Record<string, unknown>; connectedAccountId?: string; customAuthParams?: { baseURL?: string; body?: Record<string, unknown>; parameters: { in: 'query' | 'header'; name: string; value: string | number }[] }; customConnectionData?: { authScheme: 'OAUTH2'; toolkitSlug: string; val: { access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; authed_user?: { access_token?: ...; scope?: ... }; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... | ... | ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... | ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... | ... | ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; webhook_signature?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'S2S_OAUTH2'; toolkitSlug: string; val: { access_token?: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... | ... | ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... | ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... | ... | ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'DCR_OAUTH'; toolkitSlug: string; val: { access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; client_id: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'API_KEY'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BASIC_WITH_JWT'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BASIC'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BEARER_TOKEN'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'OAUTH1'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; callback_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; consumer_key?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; oauth_token: string; oauth_token_secret: string; oauth_verifier?: string; proxy_password?: string; proxy_username?: string; redirectUrl?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'NO_AUTH'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'SERVICE_ACCOUNT'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; application_id: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; installation_id: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; private_key: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object }; dangerouslySkipVersionCheck?: boolean; text?: string; userId?: string; version?: string }, options?: { afterExecute?: afterExecuteModifier; beforeExecute?: beforeExecuteModifier } & BeforeFileUploadHook & ComposioRequestOptions): Promise<...>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
**Parameters**
|
|
@@ -34,12 +34,12 @@ async execute(slug: string, body: ToolExecuteParams, options?: ExecuteToolModifi
|
|
|
34
34
|
| Name | Type | Description |
|
|
35
35
|
|------|------|-------------|
|
|
36
36
|
| `slug` | `string` | The slug/ID of the tool to be executed |
|
|
37
|
-
| `body` | `
|
|
38
|
-
| `options?` |
|
|
37
|
+
| `body` | `\{ allowTracing?: boolean; arguments?: Record<string, unknown>; connectedAccountId?: string; customAuthParams?: \{ baseURL?: string; body?: Record<string, unknown>; parameters: \{ in: 'query' \| 'header'; name: string; value: string \| number \}[] \}; customConnectionData?: \{ authScheme: 'OAUTH2'; toolkitSlug: string; val: \{ access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; authed_user?: \{ access_token?: ...; scope?: ... \}; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... \| ... \| ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... \| ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... \| ... \| ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; webhook_signature?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'S2S_OAUTH2'; toolkitSlug: string; val: \{ access_token?: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... \| ... \| ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... \| ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... \| ... \| ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'DCR_OAUTH'; toolkitSlug: string; val: \{ access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; client_id: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'API_KEY'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BASIC_WITH_JWT'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BASIC'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BEARER_TOKEN'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'OAUTH1'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; callback_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; consumer_key?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; oauth_token: string; oauth_token_secret: string; oauth_verifier?: string; proxy_password?: string; proxy_username?: string; redirectUrl?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'NO_AUTH'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'SERVICE_ACCOUNT'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; application_id: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; installation_id: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; private_key: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \}; dangerouslySkipVersionCheck?: boolean; text?: string; userId?: string; version?: string \}` | The parameters to be passed to the tool |
|
|
38
|
+
| `options?` | `\{ afterExecute?: afterExecuteModifier; beforeExecute?: beforeExecuteModifier \} & BeforeFileUploadHook & ComposioRequestOptions` | Optional modifiers and request options |
|
|
39
39
|
|
|
40
40
|
**Returns**
|
|
41
41
|
|
|
42
|
-
`Promise
|
|
42
|
+
`Promise<...>` — The response from the tool execution
|
|
43
43
|
|
|
44
44
|
**Example**
|
|
45
45
|
|
|
@@ -104,7 +104,7 @@ const result = await composio.tools.execute('HACKERNEWS_GET_FRONTPAGE', {
|
|
|
104
104
|
Executes a tool based on a tool router session.
|
|
105
105
|
|
|
106
106
|
```typescript
|
|
107
|
-
async executeSessionTool(toolSlug: string, body:
|
|
107
|
+
async executeSessionTool(toolSlug: string, body: { arguments?: Record<string, unknown>; sessionId: string }, modifiers?: SessionExecuteMetaModifiers, tool?: { availableVersions?: string[]; description?: string; inputParameters?: { $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean | JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' }; isDeprecated?: boolean; isNoAuth?: boolean; name: string; outputParameters?: { $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean | JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' }; scopes?: string[]; slug: string; tags?: string[]; toolkit?: { logo?: string; name: string; slug: string }; version?: string }, options?: ToolRouterSessionExecuteOptions, requestOptions?: ComposioRequestOptions): Promise<...>
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
**Parameters**
|
|
@@ -112,15 +112,15 @@ async executeSessionTool(toolSlug: string, body: ToolExecuteMetaParams, modifier
|
|
|
112
112
|
| Name | Type | Description |
|
|
113
113
|
|------|------|-------------|
|
|
114
114
|
| `toolSlug` | `string` | The slug of the tool to execute |
|
|
115
|
-
| `body` | `
|
|
115
|
+
| `body` | `\{ arguments?: Record<string, unknown>; sessionId: string \}` | The execution parameters |
|
|
116
116
|
| `modifiers?` | `SessionExecuteMetaModifiers` | The modifiers to apply to the tool |
|
|
117
|
-
| `tool?` | `
|
|
117
|
+
| `tool?` | `\{ availableVersions?: string[]; description?: string; inputParameters?: \{ $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean \| JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' \}; isDeprecated?: boolean; isNoAuth?: boolean; name: string; outputParameters?: \{ $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean \| JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' \}; scopes?: string[]; slug: string; tags?: string[]; toolkit?: \{ logo?: string; name: string; slug: string \}; version?: string \}` | Optional tool schema used to resolve toolkit metadata for modifiers |
|
|
118
118
|
| `options?` | `ToolRouterSessionExecuteOptions` | |
|
|
119
119
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
120
120
|
|
|
121
121
|
**Returns**
|
|
122
122
|
|
|
123
|
-
`Promise
|
|
123
|
+
`Promise<...>` — The response from the tool execution
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
@@ -132,7 +132,7 @@ This method fetches the tools from the Composio API and wraps them using the pro
|
|
|
132
132
|
**Overload 1**
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
|
-
async get(userId: string, filters: ToolListParams, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType
|
|
135
|
+
async get(userId: string, filters: ToolListParams, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType>
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
**Parameters**
|
|
@@ -145,12 +145,12 @@ async get(userId: string, filters: ToolListParams, options?: ProviderOptions & C
|
|
|
145
145
|
|
|
146
146
|
**Returns**
|
|
147
147
|
|
|
148
|
-
`Promise<ReturnType
|
|
148
|
+
`Promise<ReturnType>` — The wrapped tools collection
|
|
149
149
|
|
|
150
150
|
**Overload 2**
|
|
151
151
|
|
|
152
152
|
```typescript
|
|
153
|
-
async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType
|
|
153
|
+
async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType>
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
**Parameters**
|
|
@@ -163,7 +163,7 @@ async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequ
|
|
|
163
163
|
|
|
164
164
|
**Returns**
|
|
165
165
|
|
|
166
|
-
`Promise<ReturnType
|
|
166
|
+
`Promise<ReturnType>` — The wrapped tool
|
|
167
167
|
|
|
168
168
|
**Example**
|
|
169
169
|
|
|
@@ -230,7 +230,7 @@ Tool Router session, then use `session.tools()`, `session.customTools()`, or
|
|
|
230
230
|
`session.execute()`.
|
|
231
231
|
|
|
232
232
|
```typescript
|
|
233
|
-
async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, requestOptions?: ComposioRequestOptions): Promise<
|
|
233
|
+
async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, requestOptions?: ComposioRequestOptions): Promise<{ availableVersions?: string[]; description?: string; inputParameters?: { $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean | JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' }; isDeprecated?: boolean; isNoAuth?: boolean; name: string; outputParameters?: { $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean | JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' }; scopes?: string[]; slug: string; tags?: string[]; toolkit?: { logo?: string; name: string; slug: string }; version?: string }>
|
|
234
234
|
```
|
|
235
235
|
|
|
236
236
|
**Parameters**
|
|
@@ -243,7 +243,7 @@ async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, req
|
|
|
243
243
|
|
|
244
244
|
**Returns**
|
|
245
245
|
|
|
246
|
-
`Promise<
|
|
246
|
+
`Promise<\{ availableVersions?: string[]; description?: string; inputParameters?: \{ $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean \| JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' \}; isDeprecated?: boolean; isNoAuth?: boolean; name: string; outputParameters?: \{ $defs?: Record<string, JSONSchemaProperty>; additionalProperties?: boolean \| JSONSchemaProperty; allOf?: JSONSchemaProperty[]; anyOf?: JSONSchemaProperty[]; default?: unknown; definitions?: Record<string, JSONSchemaProperty>; description?: string; not?: JSONSchemaProperty; nullable?: boolean; oneOf?: JSONSchemaProperty[]; patternProperties?: Record<string, JSONSchemaProperty>; properties?: Record<string, JSONSchemaProperty>; required?: string[]; title?: string; type: 'object' \}; scopes?: string[]; slug: string; tags?: string[]; toolkit?: \{ logo?: string; name: string; slug: string \}; version?: string \}>` — The requested tool with its complete schema and metadata
|
|
247
247
|
|
|
248
248
|
**Example**
|
|
249
249
|
|
|
@@ -396,7 +396,7 @@ This method is mostly used by the CLI to get the list of tools.
|
|
|
396
396
|
No filtering is done on the tools, the list is cached in the backend, no further optimization is required.
|
|
397
397
|
|
|
398
398
|
```typescript
|
|
399
|
-
async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<
|
|
399
|
+
async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<string[]>
|
|
400
400
|
```
|
|
401
401
|
|
|
402
402
|
**Parameters**
|
|
@@ -407,7 +407,7 @@ async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<ToolRetriev
|
|
|
407
407
|
|
|
408
408
|
**Returns**
|
|
409
409
|
|
|
410
|
-
`Promise<
|
|
410
|
+
`Promise<string[]>` — The complete list of all available tools with their metadata
|
|
411
411
|
|
|
412
412
|
**Example**
|
|
413
413
|
|
|
@@ -433,14 +433,14 @@ already include a path. Google Calendar's base URL is
|
|
|
433
433
|
and returns a 404 from Google). An absolute URL on the same domain is sent as-is.
|
|
434
434
|
|
|
435
435
|
```typescript
|
|
436
|
-
async proxyExecute(body:
|
|
436
|
+
async proxyExecute(body: { body?: unknown; connectedAccountId?: string; customConnectionData?: { authScheme: 'OAUTH2'; toolkitSlug: string; val: { access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; authed_user?: { access_token?: ...; scope?: ... }; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... | ... | ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... | ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... | ... | ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; webhook_signature?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'S2S_OAUTH2'; toolkitSlug: string; val: { access_token?: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... | ... | ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... | ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... | ... | ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'DCR_OAUTH'; toolkitSlug: string; val: { access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; client_id: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'API_KEY'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BASIC_WITH_JWT'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BASIC'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'BEARER_TOKEN'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'OAUTH1'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; callback_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; consumer_key?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; oauth_token: string; oauth_token_secret: string; oauth_verifier?: string; proxy_password?: string; proxy_username?: string; redirectUrl?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'NO_AUTH'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object } | { authScheme: 'SERVICE_ACCOUNT'; toolkitSlug: string; val: { account_id?: string; account_url?: string; api_key?: string; api_url?: string; application_id: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; installation_id: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; private_key: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string } & object }; endpoint: string; method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; parameters?: { in: 'query' | 'header'; name: string; value: string | number }[] }, requestOptions?: ComposioRequestOptions): Promise<ToolProxyResponse>
|
|
437
437
|
```
|
|
438
438
|
|
|
439
439
|
**Parameters**
|
|
440
440
|
|
|
441
441
|
| Name | Type | Description |
|
|
442
442
|
|------|------|-------------|
|
|
443
|
-
| `body` | `
|
|
443
|
+
| `body` | `\{ body?: unknown; connectedAccountId?: string; customConnectionData?: \{ authScheme: 'OAUTH2'; toolkitSlug: string; val: \{ access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; authed_user?: \{ access_token?: ...; scope?: ... \}; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... \| ... \| ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... \| ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... \| ... \| ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; webhook_signature?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'S2S_OAUTH2'; toolkitSlug: string; val: \{ access_token?: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; expires_in?: ... \| ... \| ...; extension?: string; form_api_base_url?: string; generic_api_key?: string; id_token?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; refresh_token?: ... \| ...; region?: string; registration_access_token?: string; registration_client_uri?: string; scope?: ... \| ... \| ...; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token_type?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'DCR_OAUTH'; toolkitSlug: string; val: \{ access_token: string; account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; client_id: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'API_KEY'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BASIC_WITH_JWT'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BASIC'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; password: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; username: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'BEARER_TOKEN'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; token: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'OAUTH1'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; callback_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; consumer_key?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; oauth_token: string; oauth_token_secret: string; oauth_verifier?: string; proxy_password?: string; proxy_username?: string; redirectUrl?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'NO_AUTH'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \} \| \{ authScheme: 'SERVICE_ACCOUNT'; toolkitSlug: string; val: \{ account_id?: string; account_url?: string; api_key?: string; api_url?: string; application_id: string; base_url?: string; basic_encoded?: string; bearer_token?: string; borneo_dashboard_url?: string; COMPANYDOMAIN?: string; composio_link_redirect_url?: string; dc?: string; domain?: string; extension?: string; form_api_base_url?: string; generic_api_key?: string; installation_id: string; instanceEndpoint?: string; instanceName?: string; long_redirect_url?: boolean; private_key: string; proxy_password?: string; proxy_username?: string; region?: string; registration_access_token?: string; registration_client_uri?: string; server_location?: string; shop?: string; site_name?: string; state_prefix?: string; subdomain?: string; version?: string; your_server?: string; your-domain?: string \} & object \}; endpoint: string; method: 'GET' \| 'POST' \| 'PUT' \| 'DELETE' \| 'PATCH'; parameters?: \{ in: 'query' \| 'header'; name: string; value: string \| number \}[] \}` | The proxy request |
|
|
444
444
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
445
445
|
|
|
446
446
|
**Returns**
|
|
@@ -20,7 +20,7 @@ Create a new trigger instance for a user
|
|
|
20
20
|
If the connected account id is not provided, the first connected account for the user and toolkit will be used
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
|
-
async create(userId: string, slug: string, body?:
|
|
23
|
+
async create(userId: string, slug: string, body?: { connectedAccountId?: string; triggerConfig?: Record<string, unknown> }, requestOptions?: ComposioRequestOptions): Promise<{ triggerId: string }>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
**Parameters**
|
|
@@ -29,12 +29,12 @@ async create(userId: string, slug: string, body?: TriggerInstanceUpsertParams, r
|
|
|
29
29
|
|------|------|-------------|
|
|
30
30
|
| `userId` | `string` | The user id of the trigger instance |
|
|
31
31
|
| `slug` | `string` | The slug of the trigger instance |
|
|
32
|
-
| `body?` | `
|
|
32
|
+
| `body?` | `\{ connectedAccountId?: string; triggerConfig?: Record<string, unknown> \}` | The parameters to create the trigger instance |
|
|
33
33
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
34
34
|
|
|
35
35
|
**Returns**
|
|
36
36
|
|
|
37
|
-
`Promise
|
|
37
|
+
`Promise<\{ triggerId: string \}>` — The created trigger instance
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
@@ -43,7 +43,7 @@ async create(userId: string, slug: string, body?: TriggerInstanceUpsertParams, r
|
|
|
43
43
|
Delete a trigger instance
|
|
44
44
|
|
|
45
45
|
```typescript
|
|
46
|
-
async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
46
|
+
async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promise<{ triggerId: string }>
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
**Parameters**
|
|
@@ -55,7 +55,7 @@ async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promis
|
|
|
55
55
|
|
|
56
56
|
**Returns**
|
|
57
57
|
|
|
58
|
-
`Promise
|
|
58
|
+
`Promise<\{ triggerId: string \}>`
|
|
59
59
|
|
|
60
60
|
---
|
|
61
61
|
|
|
@@ -107,7 +107,7 @@ Retrieve a trigger type by its slug for the provided version of the app
|
|
|
107
107
|
Use the global toolkit versions param when initializing composio to pass a toolkitversion
|
|
108
108
|
|
|
109
109
|
```typescript
|
|
110
|
-
async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<
|
|
110
|
+
async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<{ config: Record<string, unknown>; description: string; instructions?: string; name: string; payload: Record<string, unknown>; slug: string; toolkit: { logo: string; name: string; slug: string }; version?: string }>
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
**Parameters**
|
|
@@ -119,7 +119,7 @@ async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<Tr
|
|
|
119
119
|
|
|
120
120
|
**Returns**
|
|
121
121
|
|
|
122
|
-
`Promise<
|
|
122
|
+
`Promise<\{ config: Record<string, unknown>; description: string; instructions?: string; name: string; payload: Record<string, unknown>; slug: string; toolkit: \{ logo: string; name: string; slug: string \}; version?: string \}>` — The trigger type object
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
@@ -128,19 +128,19 @@ async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<Tr
|
|
|
128
128
|
Fetch list of all the active triggers
|
|
129
129
|
|
|
130
130
|
```typescript
|
|
131
|
-
async listActive(query?:
|
|
131
|
+
async listActive(query?: { authConfigIds?: string[] | null; connectedAccountIds?: string[] | null; cursor?: string; limit?: number; showDisabled?: boolean | null; triggerIds?: string[] | null; triggerNames?: string[] | null }, requestOptions?: ComposioRequestOptions): Promise<{ items: { connectedAccountId: string; disabledAt: string | null; id: string; state: Record<string, unknown>; triggerConfig: Record<string, unknown>; triggerData?: string; triggerName: string; updatedAt: string; uuid?: string }[]; nextCursor: string | null; totalPages: number }>
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
**Parameters**
|
|
135
135
|
|
|
136
136
|
| Name | Type | Description |
|
|
137
137
|
|------|------|-------------|
|
|
138
|
-
| `query?` | `
|
|
138
|
+
| `query?` | `\{ authConfigIds?: string[] \| null; connectedAccountIds?: string[] \| null; cursor?: string; limit?: number; showDisabled?: boolean \| null; triggerIds?: string[] \| null; triggerNames?: string[] \| null \}` | The query parameters to filter the trigger instances |
|
|
139
139
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
140
140
|
|
|
141
141
|
**Returns**
|
|
142
142
|
|
|
143
|
-
`Promise<
|
|
143
|
+
`Promise<\{ items: \{ connectedAccountId: string; disabledAt: string \| null; id: string; state: Record<string, unknown>; triggerConfig: Record<string, unknown>; triggerData?: string; triggerName: string; updatedAt: string; uuid?: string \}[]; nextCursor: string \| null; totalPages: number \}>` — List of trigger instances
|
|
144
144
|
|
|
145
145
|
**Example**
|
|
146
146
|
|
|
@@ -160,7 +160,7 @@ Fetches the list of all the available trigger enums
|
|
|
160
160
|
This method is used by the CLI where filters are not required.
|
|
161
161
|
|
|
162
162
|
```typescript
|
|
163
|
-
async listEnum(requestOptions?: ComposioRequestOptions): Promise<
|
|
163
|
+
async listEnum(requestOptions?: ComposioRequestOptions): Promise<string[]>
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
**Parameters**
|
|
@@ -171,7 +171,7 @@ async listEnum(requestOptions?: ComposioRequestOptions): Promise<TriggersTypeRet
|
|
|
171
171
|
|
|
172
172
|
**Returns**
|
|
173
173
|
|
|
174
|
-
`Promise<
|
|
174
|
+
`Promise<string[]>`
|
|
175
175
|
|
|
176
176
|
---
|
|
177
177
|
|
|
@@ -180,19 +180,19 @@ async listEnum(requestOptions?: ComposioRequestOptions): Promise<TriggersTypeRet
|
|
|
180
180
|
List all the trigger types
|
|
181
181
|
|
|
182
182
|
```typescript
|
|
183
|
-
async listTypes(query?:
|
|
183
|
+
async listTypes(query?: { cursor?: string; limit?: number | null; toolkits?: string[] | null }, requestOptions?: ComposioRequestOptions): Promise<{ items: { config: Record<string, unknown>; description: string; instructions?: string; name: string; payload: Record<string, unknown>; slug: string; toolkit: { logo: string; name: string; slug: string }; version?: string }[]; nextCursor?: string | null; totalPages: number }>
|
|
184
184
|
```
|
|
185
185
|
|
|
186
186
|
**Parameters**
|
|
187
187
|
|
|
188
188
|
| Name | Type | Description |
|
|
189
189
|
|------|------|-------------|
|
|
190
|
-
| `query?` | `
|
|
190
|
+
| `query?` | `\{ cursor?: string; limit?: number \| null; toolkits?: string[] \| null \}` | The query parameters to filter the trigger types |
|
|
191
191
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
192
192
|
|
|
193
193
|
**Returns**
|
|
194
194
|
|
|
195
|
-
`Promise<
|
|
195
|
+
`Promise<\{ items: \{ config: Record<string, unknown>; description: string; instructions?: string; name: string; payload: Record<string, unknown>; slug: string; toolkit: \{ logo: string; name: string; slug: string \}; version?: string \}[]; nextCursor?: string \| null; totalPages: number \}>` — The list of trigger types
|
|
196
196
|
|
|
197
197
|
---
|
|
198
198
|
|
|
@@ -283,14 +283,14 @@ If a subscription already exists, the first subscription is updated. Otherwise a
|
|
|
283
283
|
subscription is created. By default this subscribes to V3 trigger message events.
|
|
284
284
|
|
|
285
285
|
```typescript
|
|
286
|
-
async setWebhookSubscription(params:
|
|
286
|
+
async setWebhookSubscription(params: { enabledEvents?: string[]; version?: 'V1' | 'V2' | 'V3'; webhookUrl: string }): Promise<WebhookSubscription>
|
|
287
287
|
```
|
|
288
288
|
|
|
289
289
|
**Parameters**
|
|
290
290
|
|
|
291
291
|
| Name | Type |
|
|
292
292
|
|------|------|
|
|
293
|
-
| `params` | `
|
|
293
|
+
| `params` | `\{ enabledEvents?: string[]; version?: 'V1' \| 'V2' \| 'V3'; webhookUrl: string \}` |
|
|
294
294
|
|
|
295
295
|
**Returns**
|
|
296
296
|
|
|
@@ -311,15 +311,15 @@ await composio.triggers.setWebhookSubscription({
|
|
|
311
311
|
Subscribe to all the triggers
|
|
312
312
|
|
|
313
313
|
```typescript
|
|
314
|
-
async subscribe(fn: (_data:
|
|
314
|
+
async subscribe(fn: (_data: { id: string; metadata: { connectedAccount: { authConfigId: string; authConfigUUID: string; id: string; status: 'ACTIVE' | 'INACTIVE'; userId: string; uuid: string }; id: string; toolkitSlug: string; triggerConfig: Record<string, unknown>; triggerData?: string; triggerSlug: string; uuid: string }; originalPayload?: Record<string, unknown>; payload?: Record<string, unknown>; toolkitSlug: string; triggerSlug: string; userId: string; uuid: string }) => void, filters?: { authConfigId?: string; connectedAccountId?: string; toolkits?: string[]; triggerData?: string; triggerId?: string; triggerSlug?: string[]; userId?: string }, onSubscriptionError?: (data: Record<string, unknown>) => void): Promise<void>
|
|
315
315
|
```
|
|
316
316
|
|
|
317
317
|
**Parameters**
|
|
318
318
|
|
|
319
319
|
| Name | Type | Description |
|
|
320
320
|
|------|------|-------------|
|
|
321
|
-
| `fn` | `(_data:
|
|
322
|
-
| `filters?` | `
|
|
321
|
+
| `fn` | `(_data: \{ id: string; metadata: \{ connectedAccount: \{ authConfigId: string; authConfigUUID: string; id: string; status: 'ACTIVE' \| 'INACTIVE'; userId: string; uuid: string \}; id: string; toolkitSlug: string; triggerConfig: Record<string, unknown>; triggerData?: string; triggerSlug: string; uuid: string \}; originalPayload?: Record<string, unknown>; payload?: Record<string, unknown>; toolkitSlug: string; triggerSlug: string; userId: string; uuid: string \}) => void` | The function to call when a trigger is received |
|
|
322
|
+
| `filters?` | `\{ authConfigId?: string; connectedAccountId?: string; toolkits?: string[]; triggerData?: string; triggerId?: string; triggerSlug?: string[]; userId?: string \}` | The filters to apply to the triggers |
|
|
323
323
|
| `onSubscriptionError?` | `(data: Record<string, unknown>) => void` | Optional callback invoked with the raw Pusher payload when the underlying subscription fails (for example on auth or permission rejection). The subscribe promise still resolves; this is the only programmatic signal of the failure. Errors thrown from — or promises rejected by — the callback are contained and logged. |
|
|
324
324
|
|
|
325
325
|
**Returns**
|
|
@@ -365,7 +365,7 @@ await triggers.unsubscribe();
|
|
|
365
365
|
Update an existing trigger instance
|
|
366
366
|
|
|
367
367
|
```typescript
|
|
368
|
-
async update(triggerId: string, body:
|
|
368
|
+
async update(triggerId: string, body: { status: 'enable' | 'disable' }, requestOptions?: ComposioRequestOptions): Promise<{ status: 'success' }>
|
|
369
369
|
```
|
|
370
370
|
|
|
371
371
|
**Parameters**
|
|
@@ -373,12 +373,12 @@ async update(triggerId: string, body: TriggerInstanceManageUpdateParams, request
|
|
|
373
373
|
| Name | Type | Description |
|
|
374
374
|
|------|------|-------------|
|
|
375
375
|
| `triggerId` | `string` | The Id of the trigger instance |
|
|
376
|
-
| `body` | `
|
|
376
|
+
| `body` | `\{ status: 'enable' \| 'disable' \}` | The parameters to update the trigger instance |
|
|
377
377
|
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
378
378
|
|
|
379
379
|
**Returns**
|
|
380
380
|
|
|
381
|
-
`Promise
|
|
381
|
+
`Promise<\{ status: 'success' \}>` — The updated trigger instance response
|
|
382
382
|
|
|
383
383
|
---
|
|
384
384
|
|
|
@@ -394,14 +394,14 @@ The signature is computed as: `HMAC-SHA256(${webhookId}.${webhookTimestamp}.${pa
|
|
|
394
394
|
and is expected in the format: `v1,base64EncodedSignature`
|
|
395
395
|
|
|
396
396
|
```typescript
|
|
397
|
-
async verifyWebhook(params:
|
|
397
|
+
async verifyWebhook(params: { id: string; payload: string; secret: string; signature: string; timestamp: string; tolerance?: number }): Promise<VerifyWebhookResult>
|
|
398
398
|
```
|
|
399
399
|
|
|
400
400
|
**Parameters**
|
|
401
401
|
|
|
402
402
|
| Name | Type | Description |
|
|
403
403
|
|------|------|-------------|
|
|
404
|
-
| `params` | `
|
|
404
|
+
| `params` | `\{ id: string; payload: string; secret: string; signature: string; timestamp: string; tolerance?: number \}` | The verification parameters |
|
|
405
405
|
|
|
406
406
|
**Returns**
|
|
407
407
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Usage"
|
|
3
|
+
description: "`composio.experimental.usage` — metering for the project the API key belongs to. **Experimental — shape may change in future releases.**"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
Access this class through the `composio.usage` property:
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const composio = new Composio({ apiKey: 'your-api-key' });
|
|
12
|
+
const result = await composio.usage.list();
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### breakdown()
|
|
18
|
+
|
|
19
|
+
Usage for one metering entity type, grouped by a dimension.
|
|
20
|
+
**Experimental — shape may change in future releases.**
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
async breakdown(entityType: string, params?: { filters?: { sessionId?: string[] | null; userId?: string[] | null }; from?: number; groupBy?: string; limit?: number; orderBy?: 'key' | 'total_quantity' | 'event_count'; orderDirection?: 'asc' | 'desc'; to?: number }, requestOptions?: ComposioRequestOptions): Promise<{ entityType: string; eventCount: number; groups: { eventCount: number; key: string; totalQuantity: string }[]; totalQuantity: string; unit: string }>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Parameters**
|
|
27
|
+
|
|
28
|
+
| Name | Type | Description |
|
|
29
|
+
|------|------|-------------|
|
|
30
|
+
| `entityType` | `string` | Entity type to break down (e.g. `tool_calls`, `sessions`) |
|
|
31
|
+
| `params?` | `\{ filters?: \{ sessionId?: string[] \| null; userId?: string[] \| null \}; from?: number; groupBy?: string; limit?: number; orderBy?: 'key' \| 'total_quantity' \| 'event_count'; orderDirection?: 'asc' \| 'desc'; to?: number \}` | Optional range, `groupBy`, ordering, `limit` and filters |
|
|
32
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
33
|
+
|
|
34
|
+
**Returns**
|
|
35
|
+
|
|
36
|
+
`Promise<\{ entityType: string; eventCount: number; groups: \{ eventCount: number; key: string; totalQuantity: string \}[]; totalQuantity: string; unit: string \}>` — Totals plus per-group rows
|
|
37
|
+
|
|
38
|
+
**Example**
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
const byUser = await composio.experimental.usage.breakdown('sessions', {
|
|
42
|
+
groupBy: 'user_id',
|
|
43
|
+
orderBy: 'event_count',
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### summary()
|
|
50
|
+
|
|
51
|
+
Usage totals per metering entity type for a time range.
|
|
52
|
+
**Experimental — shape may change in future releases.**
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
async summary(params?: { entityTypes?: string[]; filters?: { sessionId?: string[] | null; userId?: string[] | null }; from?: number; to?: number }, requestOptions?: ComposioRequestOptions): Promise<{ entities: Record<string, { eventCount: number; totalQuantity: string; unit: string }> }>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Parameters**
|
|
59
|
+
|
|
60
|
+
| Name | Type | Description |
|
|
61
|
+
|------|------|-------------|
|
|
62
|
+
| `params?` | `\{ entityTypes?: string[]; filters?: \{ sessionId?: string[] \| null; userId?: string[] \| null \}; from?: number; to?: number \}` | Optional range, `entityTypes` and filters |
|
|
63
|
+
| `requestOptions?` | `ComposioRequestOptions` | |
|
|
64
|
+
|
|
65
|
+
**Returns**
|
|
66
|
+
|
|
67
|
+
`Promise<...>` — Totals keyed by entity type
|
|
68
|
+
|
|
69
|
+
**Example**
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
const summary = await composio.experimental.usage.summary({
|
|
73
|
+
from: Date.now() - 7 * 24 * 60 * 60 * 1000,
|
|
74
|
+
filters: { userId: ['user_123'] },
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|