@composio/core 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CustomTool-CnJxXr07.mjs → CustomTool-BYHB7sPs.mjs} +1 -1
- package/dist/{CustomTool-CNJysHMK.d.mts → CustomTool-DZY1yLHN.d.mts} +1 -1
- package/dist/{cancellation-BQibgpRG.mjs → cancellation-D-tMPk48.mjs} +1 -1
- package/dist/{composio-BFTtZj82.d.mts → composio-B8AENilE.d.mts} +22 -10
- package/dist/{customTool.types-D57QrTns.d.mts → customTool.types-Bi6-keZC.d.mts} +326 -3
- package/dist/docs/reference/sdk-reference/typescript/auth-configs.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/connected-accounts.mdx +22 -22
- package/dist/docs/reference/sdk-reference/typescript/custom-toolkits.mdx +8 -8
- package/dist/docs/reference/sdk-reference/typescript/experimental.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +1 -1
- package/dist/docs/reference/sdk-reference/typescript/keyring.mdx +2 -2
- package/dist/docs/reference/sdk-reference/typescript/logs.mdx +5 -5
- package/dist/docs/reference/sdk-reference/typescript/mcp.mdx +15 -15
- package/dist/docs/reference/sdk-reference/typescript/meta.json +1 -1
- package/dist/docs/reference/sdk-reference/typescript/session-configs.mdx +5 -5
- package/dist/docs/reference/sdk-reference/typescript/session-files.mdx +10 -10
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +56 -21
- package/dist/docs/reference/sdk-reference/typescript/sessions.mdx +6 -6
- package/dist/docs/reference/sdk-reference/typescript/toolkits.mdx +22 -22
- package/dist/docs/reference/sdk-reference/typescript/tools.mdx +18 -18
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +25 -25
- package/dist/docs/reference/sdk-reference/typescript/usage.mdx +6 -6
- package/dist/docs/reference/sdk-reference/typescript/webhook-endpoints.mdx +14 -14
- package/dist/docs/reference/sdk-reference/typescript/webhook-subscriptions.mdx +13 -13
- package/dist/{errors-BN15NcCW.mjs → errors-Cly0vXFh.mjs} +5 -5
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/index.d.mts +11 -8
- package/dist/index.mjs +301 -143
- package/dist/{types-q8TwAngA.d.mts → types-BGDMkEUl.d.mts} +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +1 -1
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.mjs +2 -2
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/package.json +4 -4
- package/src/composio.ts +19 -16
- package/src/errors/ToolRouterErrors.ts +5 -5
- package/src/lib/toolRouterParams.ts +28 -16
- package/src/models/ToolRouter.ts +5 -0
- package/src/models/ToolRouterSession.ts +17 -0
- package/src/models/Triggers.ts +8 -6
- package/src/services/pusher/Pusher.ts +159 -88
- package/src/types/pusher.types.ts +2 -0
- package/src/types/toolRouter.types.ts +103 -17
- package/src/utils/session.ts +25 -47
- package/src/utils/userCallback.ts +41 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CreateCustomToolkitParams, f as CustomToolkit, o as CustomTool, r as CreateCustomToolParams, t as AnyZodSchema } from "./customTool.types-
|
|
1
|
+
import { a as CreateCustomToolkitParams, f as CustomToolkit, o as CustomTool, r as CreateCustomToolParams, t as AnyZodSchema } from "./customTool.types-Bi6-keZC.mjs";
|
|
2
2
|
import { SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
|
|
3
3
|
//#region src/models/CustomTool.d.ts
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as logger } from "./SsrfErrors-DiQldIdC.mjs";
|
|
2
|
-
import { S as JsonSchemaToZodError, _ as ComposioRequestCancelledError, b as isRequestAbortError, x as JsonSchemaRefResolutionError } from "./errors-
|
|
2
|
+
import { S as JsonSchemaToZodError, _ as ComposioRequestCancelledError, b as isRequestAbortError, x as JsonSchemaRefResolutionError } from "./errors-Cly0vXFh.mjs";
|
|
3
3
|
import { o as isPlainObject } from "./FileToolModifier.utils.neutral-DWFpnsj2.mjs";
|
|
4
4
|
import { jsonSchemaToZod } from "@composio/json-schema-to-zod";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Aa as
|
|
1
|
+
import { $n as CreateConnectedAccountOptions, Aa as ToolExecuteParams, Cn as ConnectedAccountCompleteAuthResponse, D as Session, Da as Tool, Ea as SchemaModifierOptions, Fa as ToolListParams, In as ConnectedAccountRetrieveResponse, Ja as ToolkitVersionParam, M as SessionWithoutMcp, Ma as ToolExecuteResponse, Oa as ToolExecuteMetaParams, Pa as ToolList, Pn as ConnectedAccountRefreshOptions, Rn as ConnectedAccountRevokeResponse, Va as ToolRetrievalOptions, Yn as CreateConnectedAccountLinkOptions, ai as McpServerGetResponse, cr as UpdateConnectedAccountParams, dr as BaseComposioProvider, f as CustomToolkit, fa as ProviderOptions, fn as ComposioRequestOptions, fr as BaseNonAgenticProvider, jn as ConnectedAccountListResponse, kn as ConnectedAccountListParams, mi as ExecuteToolFnOptions, o as CustomTool, or as UpdateConnectedAccountAclParams, pa as SessionExecuteMetaModifiers, pn as ConnectionRequest, rt as ToolRouterSessionDeleteResponse, ua as ExecuteToolModifiers, ui as McpUrlResponse, vi as ToolCallSession, xn as ConnectedAccountCompleteAuthParams, z as ToolRouterCreateSessionConfig, za as ToolProxyParams } from "./customTool.types-Bi6-keZC.mjs";
|
|
2
2
|
import ComposioClient, { Composio } from "@composio/client";
|
|
3
3
|
import z, { z as z$1 } from "zod/v3";
|
|
4
4
|
import { Files } from "#files";
|
|
@@ -4223,16 +4223,16 @@ declare const VerifyWebhookParamsSchema: z$1.ZodObject<{
|
|
|
4223
4223
|
tolerance: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
4224
4224
|
}, "strip", z$1.ZodTypeAny, {
|
|
4225
4225
|
id: string;
|
|
4226
|
-
secret: string;
|
|
4227
4226
|
payload: string;
|
|
4228
4227
|
timestamp: string;
|
|
4228
|
+
secret: string;
|
|
4229
4229
|
signature: string;
|
|
4230
4230
|
tolerance: number;
|
|
4231
4231
|
}, {
|
|
4232
4232
|
id: string;
|
|
4233
|
-
secret: string;
|
|
4234
4233
|
payload: string;
|
|
4235
4234
|
timestamp: string;
|
|
4235
|
+
secret: string;
|
|
4236
4236
|
signature: string;
|
|
4237
4237
|
tolerance?: number | undefined;
|
|
4238
4238
|
}>;
|
|
@@ -4398,7 +4398,8 @@ declare class Triggers<TProvider extends BaseComposioProvider<unknown, unknown,
|
|
|
4398
4398
|
/**
|
|
4399
4399
|
* Subscribe to all the triggers
|
|
4400
4400
|
*
|
|
4401
|
-
* @param fn - The function to call when a trigger is received
|
|
4401
|
+
* @param fn - The function to call when a trigger is received. It may be `async`. Errors
|
|
4402
|
+
* thrown from — or promises rejected by — the function are contained and logged.
|
|
4402
4403
|
* @param filters - The filters to apply to the triggers
|
|
4403
4404
|
* @param onSubscriptionError - Optional callback invoked with the raw Pusher payload when
|
|
4404
4405
|
* the underlying subscription fails (for example on auth or permission rejection). The
|
|
@@ -4429,6 +4430,10 @@ declare class Triggers<TProvider extends BaseComposioProvider<unknown, unknown,
|
|
|
4429
4430
|
/**
|
|
4430
4431
|
* Unsubscribe from all the triggers
|
|
4431
4432
|
*
|
|
4433
|
+
* Ends every subscription made with {@link subscribe} on this instance, including one that is
|
|
4434
|
+
* still connecting, and closes the realtime connection so that a script can exit. A later
|
|
4435
|
+
* `subscribe()` opens a new connection.
|
|
4436
|
+
*
|
|
4432
4437
|
* @returns {Promise<void>}
|
|
4433
4438
|
*
|
|
4434
4439
|
* @example
|
|
@@ -5249,24 +5254,24 @@ declare const UsageBreakdownParamsSchema: z$1.ZodObject<{
|
|
|
5249
5254
|
}>>;
|
|
5250
5255
|
}, "strip", z$1.ZodTypeAny, {
|
|
5251
5256
|
limit?: number | undefined;
|
|
5257
|
+
orderBy?: "key" | "total_quantity" | "event_count" | undefined;
|
|
5252
5258
|
from?: number | undefined;
|
|
5253
5259
|
to?: number | undefined;
|
|
5254
5260
|
filters?: {
|
|
5255
5261
|
userId?: string[] | null | undefined;
|
|
5256
5262
|
sessionId?: string[] | null | undefined;
|
|
5257
5263
|
} | undefined;
|
|
5258
|
-
orderBy?: "key" | "total_quantity" | "event_count" | undefined;
|
|
5259
5264
|
groupBy?: string | undefined;
|
|
5260
5265
|
orderDirection?: "asc" | "desc" | undefined;
|
|
5261
5266
|
}, {
|
|
5262
5267
|
limit?: number | undefined;
|
|
5268
|
+
orderBy?: "key" | "total_quantity" | "event_count" | undefined;
|
|
5263
5269
|
from?: number | undefined;
|
|
5264
5270
|
to?: number | undefined;
|
|
5265
5271
|
filters?: {
|
|
5266
5272
|
userId?: string[] | null | undefined;
|
|
5267
5273
|
sessionId?: string[] | null | undefined;
|
|
5268
5274
|
} | undefined;
|
|
5269
|
-
orderBy?: "key" | "total_quantity" | "event_count" | undefined;
|
|
5270
5275
|
groupBy?: string | undefined;
|
|
5271
5276
|
orderDirection?: "asc" | "desc" | undefined;
|
|
5272
5277
|
}>;
|
|
@@ -8590,8 +8595,15 @@ type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown, unk
|
|
|
8590
8595
|
* `x-user-api-key` is the one header the SDK treats as a credential: together
|
|
8591
8596
|
* with `apiKey: null` it authenticates requests with a Composio user API key
|
|
8592
8597
|
* instead of a project key. The project key is only ever set from `apiKey`:
|
|
8593
|
-
* an `x-api-key` entry is rejected when `apiKey` is `null`.
|
|
8594
|
-
*
|
|
8598
|
+
* an `x-api-key` entry is rejected when `apiKey` is `null`.
|
|
8599
|
+
*
|
|
8600
|
+
* The SDK reports itself through the API client's identity headers
|
|
8601
|
+
* (`x-client-provenance`, `x-client-version`, `x-client-library`,
|
|
8602
|
+
* `x-client-library-version`, `x-client-language`, `x-client-runtime`,
|
|
8603
|
+
* `x-sdk-version`, `x-source`, `x-framework`, `x-runtime` and
|
|
8604
|
+
* `x-runtime-version`); an entry naming one of them is rejected with a
|
|
8605
|
+
* `ComposioError` from `@composio/client`. Every other header is passed
|
|
8606
|
+
* through untouched.
|
|
8595
8607
|
* @example
|
|
8596
8608
|
* ```typescript
|
|
8597
8609
|
* const composio = new Composio({
|
|
@@ -8869,8 +8881,8 @@ declare class Composio$1<TProvider extends BaseComposioProvider<unknown, unknown
|
|
|
8869
8881
|
* instance directly with the headers you need: `new Composio({ ...existingConfig, defaultHeaders })`.
|
|
8870
8882
|
* For one-off overrides, pass per-call `requestOptions` where supported.
|
|
8871
8883
|
*
|
|
8872
|
-
* @param {
|
|
8873
|
-
*
|
|
8884
|
+
* @param {object} [options] - Options for the new instance.
|
|
8885
|
+
* @param {ComposioRequestHeaders} [options.headers] - Headers sent with every API call the new instance makes.
|
|
8874
8886
|
* @returns {Composio<TProvider>} A new Composio instance with the custom request options applied.
|
|
8875
8887
|
*
|
|
8876
8888
|
* @example
|