@composio/core 0.25.0 → 0.27.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-DZY1yLHN.d.mts → CustomTool-CqPoLUD6.d.mts} +1 -1
- package/dist/{cancellation-D-tMPk48.mjs → cancellation-ZoRh6EJQ.mjs} +54 -2
- package/dist/{composio-B8AENilE.d.mts → composio-BUa10iB3.d.mts} +65 -57
- package/dist/{customTool.types-Bi6-keZC.d.mts → customTool.types-gX421uPT.d.mts} +789 -33
- package/dist/docs/reference/sdk-reference/typescript/composio.mdx +3 -3
- package/dist/docs/reference/sdk-reference/typescript/session.mdx +2 -1
- package/dist/docs/reference/sdk-reference/typescript/triggers.mdx +5 -1
- package/dist/experimental/index.d.mts +2 -2
- package/dist/index.d.mts +18 -13
- package/dist/index.mjs +6787 -6316
- package/dist/{types-BGDMkEUl.d.mts → types-DXxfzBX3.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 +1 -1
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/package.json +3 -3
- package/src/composio.ts +68 -57
- package/src/lib/toolRouterMcp.ts +2 -0
- package/src/lib/toolRouterParams.ts +26 -3
- package/src/models/ConnectedAccounts.ts +7 -16
- package/src/models/SessionContext.ts +2 -17
- package/src/models/ToolRouter.ts +9 -2
- package/src/models/ToolRouterSession.ts +4 -19
- package/src/models/Tools.ts +1 -4
- package/src/models/Triggers.ts +6 -1
- package/src/services/internal/InternalService.ts +3 -4
- package/src/services/pusher/Pusher.ts +11 -4
- package/src/types/connectedAccountAuthStates.types.ts +2 -1
- package/src/types/requestOptions.types.ts +1 -10
- package/src/types/toolRouter.types.ts +156 -11
- package/src/utils/jsonSchema.ts +76 -4
- package/src/utils/sdk.ts +172 -11
- package/src/utils/toolkitDeprecation.ts +271 -0
- package/src/utils/transformers/connectedAccounts.ts +9 -20
- package/src/utils/transformers/mcp.ts +3 -10
- package/src/utils/transformers/toolRouterResponseTransform.ts +123 -5
|
@@ -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-gX421uPT.mjs";
|
|
2
2
|
import { SessionCreateResponse } from "@composio/client/resources/tool-router/session/session.mjs";
|
|
3
3
|
//#region src/models/CustomTool.d.ts
|
|
4
4
|
/**
|
|
@@ -354,6 +354,24 @@ function jsonSchemaToZodSchema(jsonSchema, { strict } = { strict: false }) {
|
|
|
354
354
|
const MAX_STRICT_CHANGES = 50;
|
|
355
355
|
/** Annotation-only keywords OpenAI structured outputs rejects; safe to strip. */
|
|
356
356
|
const STRICT_STRIP_KEYWORDS = /* @__PURE__ */ new Set(["examples", "default"]);
|
|
357
|
+
/**
|
|
358
|
+
* The `format` values OpenAI structured outputs accepts on a string schema,
|
|
359
|
+
* matched case-sensitively; any other value there is rejected with a 400.
|
|
360
|
+
* Formats on number and integer schemas are not checked.
|
|
361
|
+
*/
|
|
362
|
+
const STRICT_STRING_FORMATS = /* @__PURE__ */ new Set([
|
|
363
|
+
"date-time",
|
|
364
|
+
"time",
|
|
365
|
+
"date",
|
|
366
|
+
"duration",
|
|
367
|
+
"email",
|
|
368
|
+
"hostname",
|
|
369
|
+
"ipv4",
|
|
370
|
+
"ipv6",
|
|
371
|
+
"uuid"
|
|
372
|
+
]);
|
|
373
|
+
/** Whether a `type` value admits strings; an absent `type` admits every type. */
|
|
374
|
+
const admitsString = (type) => type === void 0 || type === "string" || Array.isArray(type) && type.includes("string");
|
|
357
375
|
/** Keywords OpenAI structured outputs reject and that have no lossless rewrite. */
|
|
358
376
|
const STRICT_UNSUPPORTED_KEYWORDS = [
|
|
359
377
|
"allOf",
|
|
@@ -454,6 +472,11 @@ function resolveLocalRefs(node, root) {
|
|
|
454
472
|
* the one it was given: the rewrite types every node that declares
|
|
455
473
|
* `properties` as an object, so such a node stops accepting null.
|
|
456
474
|
*
|
|
475
|
+
* `followRefs: false` makes every `$ref` reject null without resolving it.
|
|
476
|
+
* Folding `nullable` needs that, because a `$ref` can lead back to the node
|
|
477
|
+
* being folded, whose source still accepts null. It costs at most a
|
|
478
|
+
* redundant null branch.
|
|
479
|
+
*
|
|
457
480
|
* One check serves a whole document, and an answer is computed once per node.
|
|
458
481
|
* A reference cycle never yields a null by itself, so a node met again while
|
|
459
482
|
* it is being evaluated counts as rejecting. An answer that leans on that is
|
|
@@ -466,7 +489,7 @@ function resolveLocalRefs(node, root) {
|
|
|
466
489
|
* went through stay marked as unproven, so a later check that reaches one of
|
|
467
490
|
* them neither repeats the work nor trusts the answer.
|
|
468
491
|
*/
|
|
469
|
-
function createNullCheck(root, strictOutput = false) {
|
|
492
|
+
function createNullCheck(root, strictOutput = false, followRefs = true) {
|
|
470
493
|
const NOTHING = 65;
|
|
471
494
|
const A_BOUND = -1;
|
|
472
495
|
const answers = /* @__PURE__ */ new Map();
|
|
@@ -531,12 +554,14 @@ function createNullCheck(root, strictOutput = false) {
|
|
|
531
554
|
return answer;
|
|
532
555
|
};
|
|
533
556
|
const keywordsAccept = (node) => {
|
|
557
|
+
if (node.nullable === true) return true;
|
|
534
558
|
if (typeof node.type === "string" && node.type !== "null") return false;
|
|
535
559
|
if (Array.isArray(node.type) && !node.type.includes("null")) return false;
|
|
536
560
|
if (strictOutput && !("type" in node) && isPlainObject(node.properties)) return false;
|
|
537
561
|
if (Array.isArray(node.enum) && !node.enum.includes(null)) return false;
|
|
538
562
|
if ("const" in node && node.const !== null) return false;
|
|
539
563
|
if ("$ref" in node) {
|
|
564
|
+
if (!followRefs) return false;
|
|
540
565
|
const resolution = typeof node.$ref === "string" ? tryResolvePointer(root, node.$ref) : void 0;
|
|
541
566
|
if (resolution === void 0 || resolution.kind === "unresolved") return false;
|
|
542
567
|
if (!accepts(resolution.value)) return false;
|
|
@@ -569,7 +594,9 @@ function createNullCheck(root, strictOutput = false) {
|
|
|
569
594
|
* sends for such a property means "omitted"; the strict providers drop it
|
|
570
595
|
* before executing the tool (see {@link omitNullToolArguments});
|
|
571
596
|
* - `type` arrays are kept as-is (the API accepts them); `oneOf` becomes
|
|
572
|
-
* `anyOf`; `default` and `
|
|
597
|
+
* `anyOf`; `default`, `examples`, and a string `format` the API does
|
|
598
|
+
* not accept are stripped; OpenAPI `nullable` is stripped too, and a
|
|
599
|
+
* node that set it to `true` is widened to accept `null`;
|
|
573
600
|
* - local `$ref`s into `$defs`/`definitions` are kept (the API supports
|
|
574
601
|
* them, including recursion) and the definitions themselves are
|
|
575
602
|
* normalized; an optional `$ref` property is widened with an `anyOf`
|
|
@@ -597,6 +624,7 @@ function toStrictJsonSchema(schema) {
|
|
|
597
624
|
};
|
|
598
625
|
const root = isPlainObject(schema) ? schema : {};
|
|
599
626
|
const acceptsNullInOutput = createNullCheck(root, true);
|
|
627
|
+
const acceptsNullWithoutRefs = createNullCheck(root, true, false);
|
|
600
628
|
function walkChildren(node, mode, depth, path) {
|
|
601
629
|
const clone = {};
|
|
602
630
|
for (const [key, child] of Object.entries(node)) {
|
|
@@ -626,6 +654,7 @@ function toStrictJsonSchema(schema) {
|
|
|
626
654
|
if (!isPlainObject(value) || mode === "value") return value;
|
|
627
655
|
const node = {};
|
|
628
656
|
for (const [key, child] of Object.entries(value)) {
|
|
657
|
+
if (key === "nullable") continue;
|
|
629
658
|
if (STRICT_STRIP_KEYWORDS.has(key)) {
|
|
630
659
|
recordChange({
|
|
631
660
|
path,
|
|
@@ -634,6 +663,14 @@ function toStrictJsonSchema(schema) {
|
|
|
634
663
|
});
|
|
635
664
|
continue;
|
|
636
665
|
}
|
|
666
|
+
if (key === "format" && typeof child === "string" && !STRICT_STRING_FORMATS.has(child) && admitsString(value.type)) {
|
|
667
|
+
recordChange({
|
|
668
|
+
path,
|
|
669
|
+
reason: "unsupported-keyword-stripped",
|
|
670
|
+
detail: `format "${child}" removed`
|
|
671
|
+
});
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
637
674
|
setOwn(node, key, child);
|
|
638
675
|
}
|
|
639
676
|
if (Array.isArray(node.oneOf) && node.anyOf === void 0) {
|
|
@@ -670,6 +707,21 @@ function toStrictJsonSchema(schema) {
|
|
|
670
707
|
keyword: "properties",
|
|
671
708
|
detail: "properties is not an object"
|
|
672
709
|
});
|
|
710
|
+
const normalized = normalizeNode(node, mode, depth, path);
|
|
711
|
+
if (!("nullable" in value)) return normalized;
|
|
712
|
+
const widened = value.nullable === true ? widenToNullable(normalized, acceptsNullWithoutRefs) : normalized;
|
|
713
|
+
recordChange(widened === normalized ? {
|
|
714
|
+
path,
|
|
715
|
+
reason: "unsupported-keyword-stripped",
|
|
716
|
+
detail: "keyword \"nullable\" removed"
|
|
717
|
+
} : {
|
|
718
|
+
path,
|
|
719
|
+
reason: "nullable-converted",
|
|
720
|
+
detail: "nullable became a null type"
|
|
721
|
+
});
|
|
722
|
+
return widened;
|
|
723
|
+
}
|
|
724
|
+
function normalizeNode(node, mode, depth, path) {
|
|
673
725
|
const out = walkChildren(node, mode, depth, path);
|
|
674
726
|
if (typeof node.$ref === "string") {
|
|
675
727
|
if ((node.$ref === "#" || node.$ref.startsWith("#/") ? tryResolvePointer(root, node.$ref) : {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $a as ToolProxyParams, Ba as SchemaModifierOptions, D as Session, Da as SessionExecuteMetaModifiers, Dn as ConnectionRequest, Ea as ProviderOptions, En as ComposioRequestOptions, Er as BaseNonAgenticProvider, Fn as ConnectedAccountCompleteAuthParams, Gn as ConnectedAccountListResponse, Ha as ToolExecuteMetaParams, Ja as ToolList, Jn as ConnectedAccountRefreshOptions, Ka as ToolExecuteResponse, Ln as ConnectedAccountCompleteAuthResponse, M as SessionWithoutMcp, Mi as ToolCallSession, Oi as ExecuteToolFnOptions, Qn as ConnectedAccountRevokeResponse, Sr as UpdateConnectedAccountParams, Tr as BaseComposioProvider, Un as ConnectedAccountListParams, V as ToolRouterCreateSessionConfig, Va as Tool, Wa as ToolExecuteParams, Xn as ConnectedAccountRetrieveResponse, Ya as ToolListParams, br as UpdateConnectedAccountAclParams, co as ToolkitVersionParam, f as CustomToolkit, ht as ToolRouterSessionDeleteResponse, lr as CreateConnectedAccountLinkOptions, o as CustomTool, pr as CreateConnectedAccountOptions, to as ToolRetrievalOptions, wa as ExecuteToolModifiers, wi as McpUrlResponse, yi as McpServerGetResponse } from "./customTool.types-gX421uPT.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";
|
|
@@ -3676,7 +3676,6 @@ declare const IncomingTriggerPayloadSchema: z$1.ZodObject<{
|
|
|
3676
3676
|
userId: string;
|
|
3677
3677
|
uuid: string;
|
|
3678
3678
|
id: string;
|
|
3679
|
-
triggerSlug: string;
|
|
3680
3679
|
metadata: {
|
|
3681
3680
|
toolkitSlug: string;
|
|
3682
3681
|
uuid: string;
|
|
@@ -3693,6 +3692,7 @@ declare const IncomingTriggerPayloadSchema: z$1.ZodObject<{
|
|
|
3693
3692
|
triggerConfig: Record<string, unknown>;
|
|
3694
3693
|
triggerData?: string | undefined;
|
|
3695
3694
|
};
|
|
3695
|
+
triggerSlug: string;
|
|
3696
3696
|
payload?: Record<string, unknown> | undefined;
|
|
3697
3697
|
originalPayload?: Record<string, unknown> | undefined;
|
|
3698
3698
|
}, {
|
|
@@ -3700,7 +3700,6 @@ declare const IncomingTriggerPayloadSchema: z$1.ZodObject<{
|
|
|
3700
3700
|
userId: string;
|
|
3701
3701
|
uuid: string;
|
|
3702
3702
|
id: string;
|
|
3703
|
-
triggerSlug: string;
|
|
3704
3703
|
metadata: {
|
|
3705
3704
|
toolkitSlug: string;
|
|
3706
3705
|
uuid: string;
|
|
@@ -3717,6 +3716,7 @@ declare const IncomingTriggerPayloadSchema: z$1.ZodObject<{
|
|
|
3717
3716
|
triggerConfig: Record<string, unknown>;
|
|
3718
3717
|
triggerData?: string | undefined;
|
|
3719
3718
|
};
|
|
3719
|
+
triggerSlug: string;
|
|
3720
3720
|
payload?: Record<string, unknown> | undefined;
|
|
3721
3721
|
originalPayload?: Record<string, unknown> | undefined;
|
|
3722
3722
|
}>;
|
|
@@ -3923,17 +3923,17 @@ declare const WebhookPayloadV1Schema: z$1.ZodObject<{
|
|
|
3923
3923
|
payload: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
3924
3924
|
log_id: z$1.ZodString;
|
|
3925
3925
|
}, "strip", z$1.ZodTypeAny, {
|
|
3926
|
+
log_id: string;
|
|
3926
3927
|
payload: Record<string, unknown>;
|
|
3927
3928
|
trigger_name: string;
|
|
3928
3929
|
connection_id: string;
|
|
3929
3930
|
trigger_id: string;
|
|
3930
|
-
log_id: string;
|
|
3931
3931
|
}, {
|
|
3932
|
+
log_id: string;
|
|
3932
3933
|
payload: Record<string, unknown>;
|
|
3933
3934
|
trigger_name: string;
|
|
3934
3935
|
connection_id: string;
|
|
3935
3936
|
trigger_id: string;
|
|
3936
|
-
log_id: string;
|
|
3937
3937
|
}>;
|
|
3938
3938
|
type WebhookPayloadV1 = z$1.infer<typeof WebhookPayloadV1Schema>;
|
|
3939
3939
|
/** V2 webhook payload - includes timestamp and nested data */
|
|
@@ -3963,11 +3963,11 @@ declare const WebhookPayloadV2Schema: z$1.ZodObject<{
|
|
|
3963
3963
|
}, "strip", z$1.ZodTypeAny, {
|
|
3964
3964
|
type: string;
|
|
3965
3965
|
data: {
|
|
3966
|
+
user_id: string;
|
|
3966
3967
|
connection_id: string;
|
|
3967
3968
|
trigger_id: string;
|
|
3968
3969
|
connection_nano_id: string;
|
|
3969
3970
|
trigger_nano_id: string;
|
|
3970
|
-
user_id: string;
|
|
3971
3971
|
} & {
|
|
3972
3972
|
[k: string]: unknown;
|
|
3973
3973
|
};
|
|
@@ -3976,11 +3976,11 @@ declare const WebhookPayloadV2Schema: z$1.ZodObject<{
|
|
|
3976
3976
|
}, {
|
|
3977
3977
|
type: string;
|
|
3978
3978
|
data: {
|
|
3979
|
+
user_id: string;
|
|
3979
3980
|
connection_id: string;
|
|
3980
3981
|
trigger_id: string;
|
|
3981
3982
|
connection_nano_id: string;
|
|
3982
3983
|
trigger_nano_id: string;
|
|
3983
|
-
user_id: string;
|
|
3984
3984
|
} & {
|
|
3985
3985
|
[k: string]: unknown;
|
|
3986
3986
|
};
|
|
@@ -3999,14 +3999,14 @@ declare const WebhookPayloadV3Schema: z$1.ZodObject<{
|
|
|
3999
3999
|
type: string;
|
|
4000
4000
|
data: Record<string, unknown>;
|
|
4001
4001
|
id: string;
|
|
4002
|
-
metadata: Record<string, unknown>;
|
|
4003
4002
|
timestamp: string;
|
|
4003
|
+
metadata: Record<string, unknown>;
|
|
4004
4004
|
}, {
|
|
4005
4005
|
type: string;
|
|
4006
4006
|
data: Record<string, unknown>;
|
|
4007
4007
|
id: string;
|
|
4008
|
-
metadata: Record<string, unknown>;
|
|
4009
4008
|
timestamp: string;
|
|
4009
|
+
metadata: Record<string, unknown>;
|
|
4010
4010
|
}>;
|
|
4011
4011
|
type WebhookPayloadV3 = z$1.infer<typeof WebhookPayloadV3Schema>;
|
|
4012
4012
|
/** V3 trigger-specific payload - has trigger metadata fields */
|
|
@@ -4041,32 +4041,32 @@ declare const WebhookTriggerPayloadV3Schema: z$1.ZodObject<{
|
|
|
4041
4041
|
type: string;
|
|
4042
4042
|
data: Record<string, unknown>;
|
|
4043
4043
|
id: string;
|
|
4044
|
+
timestamp: string;
|
|
4044
4045
|
metadata: {
|
|
4045
|
-
trigger_id: string;
|
|
4046
|
-
log_id: string;
|
|
4047
|
-
user_id: string;
|
|
4048
|
-
trigger_slug: string;
|
|
4049
4046
|
connected_account_id: string;
|
|
4050
4047
|
auth_config_id: string;
|
|
4048
|
+
user_id: string;
|
|
4049
|
+
log_id: string;
|
|
4050
|
+
trigger_id: string;
|
|
4051
|
+
trigger_slug: string;
|
|
4051
4052
|
} & {
|
|
4052
4053
|
[k: string]: unknown;
|
|
4053
4054
|
};
|
|
4054
|
-
timestamp: string;
|
|
4055
4055
|
}, {
|
|
4056
4056
|
type: string;
|
|
4057
4057
|
data: Record<string, unknown>;
|
|
4058
4058
|
id: string;
|
|
4059
|
+
timestamp: string;
|
|
4059
4060
|
metadata: {
|
|
4060
|
-
trigger_id: string;
|
|
4061
|
-
log_id: string;
|
|
4062
|
-
user_id: string;
|
|
4063
|
-
trigger_slug: string;
|
|
4064
4061
|
connected_account_id: string;
|
|
4065
4062
|
auth_config_id: string;
|
|
4063
|
+
user_id: string;
|
|
4064
|
+
log_id: string;
|
|
4065
|
+
trigger_id: string;
|
|
4066
|
+
trigger_slug: string;
|
|
4066
4067
|
} & {
|
|
4067
4068
|
[k: string]: unknown;
|
|
4068
4069
|
};
|
|
4069
|
-
timestamp: string;
|
|
4070
4070
|
}>;
|
|
4071
4071
|
type WebhookTriggerPayloadV3 = z$1.infer<typeof WebhookTriggerPayloadV3Schema>;
|
|
4072
4072
|
/** Union of all webhook payload versions */
|
|
@@ -4080,14 +4080,14 @@ declare const WebhookPayloadSchema: z$1.ZodUnion<[z$1.ZodObject<{
|
|
|
4080
4080
|
type: string;
|
|
4081
4081
|
data: Record<string, unknown>;
|
|
4082
4082
|
id: string;
|
|
4083
|
-
metadata: Record<string, unknown>;
|
|
4084
4083
|
timestamp: string;
|
|
4084
|
+
metadata: Record<string, unknown>;
|
|
4085
4085
|
}, {
|
|
4086
4086
|
type: string;
|
|
4087
4087
|
data: Record<string, unknown>;
|
|
4088
4088
|
id: string;
|
|
4089
|
-
metadata: Record<string, unknown>;
|
|
4090
4089
|
timestamp: string;
|
|
4090
|
+
metadata: Record<string, unknown>;
|
|
4091
4091
|
}>, z$1.ZodObject<{
|
|
4092
4092
|
type: z$1.ZodString;
|
|
4093
4093
|
timestamp: z$1.ZodString;
|
|
@@ -4114,11 +4114,11 @@ declare const WebhookPayloadSchema: z$1.ZodUnion<[z$1.ZodObject<{
|
|
|
4114
4114
|
}, "strip", z$1.ZodTypeAny, {
|
|
4115
4115
|
type: string;
|
|
4116
4116
|
data: {
|
|
4117
|
+
user_id: string;
|
|
4117
4118
|
connection_id: string;
|
|
4118
4119
|
trigger_id: string;
|
|
4119
4120
|
connection_nano_id: string;
|
|
4120
4121
|
trigger_nano_id: string;
|
|
4121
|
-
user_id: string;
|
|
4122
4122
|
} & {
|
|
4123
4123
|
[k: string]: unknown;
|
|
4124
4124
|
};
|
|
@@ -4127,11 +4127,11 @@ declare const WebhookPayloadSchema: z$1.ZodUnion<[z$1.ZodObject<{
|
|
|
4127
4127
|
}, {
|
|
4128
4128
|
type: string;
|
|
4129
4129
|
data: {
|
|
4130
|
+
user_id: string;
|
|
4130
4131
|
connection_id: string;
|
|
4131
4132
|
trigger_id: string;
|
|
4132
4133
|
connection_nano_id: string;
|
|
4133
4134
|
trigger_nano_id: string;
|
|
4134
|
-
user_id: string;
|
|
4135
4135
|
} & {
|
|
4136
4136
|
[k: string]: unknown;
|
|
4137
4137
|
};
|
|
@@ -4144,17 +4144,17 @@ declare const WebhookPayloadSchema: z$1.ZodUnion<[z$1.ZodObject<{
|
|
|
4144
4144
|
payload: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
4145
4145
|
log_id: z$1.ZodString;
|
|
4146
4146
|
}, "strip", z$1.ZodTypeAny, {
|
|
4147
|
+
log_id: string;
|
|
4147
4148
|
payload: Record<string, unknown>;
|
|
4148
4149
|
trigger_name: string;
|
|
4149
4150
|
connection_id: string;
|
|
4150
4151
|
trigger_id: string;
|
|
4151
|
-
log_id: string;
|
|
4152
4152
|
}, {
|
|
4153
|
+
log_id: string;
|
|
4153
4154
|
payload: Record<string, unknown>;
|
|
4154
4155
|
trigger_name: string;
|
|
4155
4156
|
connection_id: string;
|
|
4156
4157
|
trigger_id: string;
|
|
4157
|
-
log_id: string;
|
|
4158
4158
|
}>]>;
|
|
4159
4159
|
type WebhookPayload = z$1.infer<typeof WebhookPayloadSchema>;
|
|
4160
4160
|
/** Webhook version enum */
|
|
@@ -4223,15 +4223,15 @@ 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
|
-
payload: string;
|
|
4227
4226
|
timestamp: string;
|
|
4227
|
+
payload: string;
|
|
4228
4228
|
secret: string;
|
|
4229
4229
|
signature: string;
|
|
4230
4230
|
tolerance: number;
|
|
4231
4231
|
}, {
|
|
4232
4232
|
id: string;
|
|
4233
|
-
payload: string;
|
|
4234
4233
|
timestamp: string;
|
|
4234
|
+
payload: string;
|
|
4235
4235
|
secret: string;
|
|
4236
4236
|
signature: string;
|
|
4237
4237
|
tolerance?: number | undefined;
|
|
@@ -7071,11 +7071,11 @@ declare const LogSearchFilterSchema: z$1.ZodObject<{
|
|
|
7071
7071
|
value: z$1.ZodString;
|
|
7072
7072
|
}, "strip", z$1.ZodTypeAny, {
|
|
7073
7073
|
value: string;
|
|
7074
|
-
field: "status" | "
|
|
7074
|
+
field: "status" | "tool_slug" | "toolkit_slug" | "connected_account_id" | "auth_config_id" | "user_id" | "session_id" | "sandbox_id" | "request_id" | "log_id";
|
|
7075
7075
|
operator: "==" | "!=" | "contains" | "not_contains";
|
|
7076
7076
|
}, {
|
|
7077
7077
|
value: string;
|
|
7078
|
-
field: "status" | "
|
|
7078
|
+
field: "status" | "tool_slug" | "toolkit_slug" | "connected_account_id" | "auth_config_id" | "user_id" | "session_id" | "sandbox_id" | "request_id" | "log_id";
|
|
7079
7079
|
operator: "==" | "!=" | "contains" | "not_contains";
|
|
7080
7080
|
}>;
|
|
7081
7081
|
type LogSearchFilter = z$1.infer<typeof LogSearchFilterSchema>;
|
|
@@ -7104,11 +7104,11 @@ declare const LogSearchParamsSchema: z$1.ZodObject<{
|
|
|
7104
7104
|
value: z$1.ZodString;
|
|
7105
7105
|
}, "strip", z$1.ZodTypeAny, {
|
|
7106
7106
|
value: string;
|
|
7107
|
-
field: "status" | "
|
|
7107
|
+
field: "status" | "tool_slug" | "toolkit_slug" | "connected_account_id" | "auth_config_id" | "user_id" | "session_id" | "sandbox_id" | "request_id" | "log_id";
|
|
7108
7108
|
operator: "==" | "!=" | "contains" | "not_contains";
|
|
7109
7109
|
}, {
|
|
7110
7110
|
value: string;
|
|
7111
|
-
field: "status" | "
|
|
7111
|
+
field: "status" | "tool_slug" | "toolkit_slug" | "connected_account_id" | "auth_config_id" | "user_id" | "session_id" | "sandbox_id" | "request_id" | "log_id";
|
|
7112
7112
|
operator: "==" | "!=" | "contains" | "not_contains";
|
|
7113
7113
|
}>, "many">>;
|
|
7114
7114
|
timeRange: z$1.ZodOptional<z$1.ZodObject<{
|
|
@@ -7128,7 +7128,7 @@ declare const LogSearchParamsSchema: z$1.ZodObject<{
|
|
|
7128
7128
|
cursor?: string | null | undefined;
|
|
7129
7129
|
filters?: {
|
|
7130
7130
|
value: string;
|
|
7131
|
-
field: "status" | "
|
|
7131
|
+
field: "status" | "tool_slug" | "toolkit_slug" | "connected_account_id" | "auth_config_id" | "user_id" | "session_id" | "sandbox_id" | "request_id" | "log_id";
|
|
7132
7132
|
operator: "==" | "!=" | "contains" | "not_contains";
|
|
7133
7133
|
}[] | undefined;
|
|
7134
7134
|
timeRange?: {
|
|
@@ -7140,7 +7140,7 @@ declare const LogSearchParamsSchema: z$1.ZodObject<{
|
|
|
7140
7140
|
cursor?: string | null | undefined;
|
|
7141
7141
|
filters?: {
|
|
7142
7142
|
value: string;
|
|
7143
|
-
field: "status" | "
|
|
7143
|
+
field: "status" | "tool_slug" | "toolkit_slug" | "connected_account_id" | "auth_config_id" | "user_id" | "session_id" | "sandbox_id" | "request_id" | "log_id";
|
|
7144
7144
|
operator: "==" | "!=" | "contains" | "not_contains";
|
|
7145
7145
|
}[] | undefined;
|
|
7146
7146
|
timeRange?: {
|
|
@@ -7204,13 +7204,13 @@ declare const ToolExecutionLogSchema: z$1.ZodObject<{
|
|
|
7204
7204
|
type: string;
|
|
7205
7205
|
status: "success" | "failed";
|
|
7206
7206
|
id: string;
|
|
7207
|
+
timestamp: string;
|
|
7208
|
+
level: "error" | "warn" | "info";
|
|
7207
7209
|
metadata: {
|
|
7208
7210
|
instant_charge?: string | undefined;
|
|
7209
7211
|
} & {
|
|
7210
7212
|
[k: string]: unknown;
|
|
7211
7213
|
};
|
|
7212
|
-
timestamp: string;
|
|
7213
|
-
level: "error" | "warn" | "info";
|
|
7214
7214
|
metrics: Record<string, unknown>;
|
|
7215
7215
|
parent: {
|
|
7216
7216
|
logId: string;
|
|
@@ -7221,13 +7221,13 @@ declare const ToolExecutionLogSchema: z$1.ZodObject<{
|
|
|
7221
7221
|
type: string;
|
|
7222
7222
|
status: "success" | "failed";
|
|
7223
7223
|
id: string;
|
|
7224
|
+
timestamp: string;
|
|
7225
|
+
level: "error" | "warn" | "info";
|
|
7224
7226
|
metadata: {
|
|
7225
7227
|
instant_charge?: string | undefined;
|
|
7226
7228
|
} & {
|
|
7227
7229
|
[k: string]: unknown;
|
|
7228
7230
|
};
|
|
7229
|
-
timestamp: string;
|
|
7230
|
-
level: "error" | "warn" | "info";
|
|
7231
7231
|
metrics: Record<string, unknown>;
|
|
7232
7232
|
parent: {
|
|
7233
7233
|
logId: string;
|
|
@@ -7268,13 +7268,13 @@ declare const LogSearchResponseSchema: z$1.ZodObject<{
|
|
|
7268
7268
|
type: string;
|
|
7269
7269
|
status: "success" | "failed";
|
|
7270
7270
|
id: string;
|
|
7271
|
+
timestamp: string;
|
|
7272
|
+
level: "error" | "warn" | "info";
|
|
7271
7273
|
metadata: {
|
|
7272
7274
|
instant_charge?: string | undefined;
|
|
7273
7275
|
} & {
|
|
7274
7276
|
[k: string]: unknown;
|
|
7275
7277
|
};
|
|
7276
|
-
timestamp: string;
|
|
7277
|
-
level: "error" | "warn" | "info";
|
|
7278
7278
|
metrics: Record<string, unknown>;
|
|
7279
7279
|
parent: {
|
|
7280
7280
|
logId: string;
|
|
@@ -7285,13 +7285,13 @@ declare const LogSearchResponseSchema: z$1.ZodObject<{
|
|
|
7285
7285
|
type: string;
|
|
7286
7286
|
status: "success" | "failed";
|
|
7287
7287
|
id: string;
|
|
7288
|
+
timestamp: string;
|
|
7289
|
+
level: "error" | "warn" | "info";
|
|
7288
7290
|
metadata: {
|
|
7289
7291
|
instant_charge?: string | undefined;
|
|
7290
7292
|
} & {
|
|
7291
7293
|
[k: string]: unknown;
|
|
7292
7294
|
};
|
|
7293
|
-
timestamp: string;
|
|
7294
|
-
level: "error" | "warn" | "info";
|
|
7295
7295
|
metrics: Record<string, unknown>;
|
|
7296
7296
|
parent: {
|
|
7297
7297
|
logId: string;
|
|
@@ -7306,13 +7306,13 @@ declare const LogSearchResponseSchema: z$1.ZodObject<{
|
|
|
7306
7306
|
type: string;
|
|
7307
7307
|
status: "success" | "failed";
|
|
7308
7308
|
id: string;
|
|
7309
|
+
timestamp: string;
|
|
7310
|
+
level: "error" | "warn" | "info";
|
|
7309
7311
|
metadata: {
|
|
7310
7312
|
instant_charge?: string | undefined;
|
|
7311
7313
|
} & {
|
|
7312
7314
|
[k: string]: unknown;
|
|
7313
7315
|
};
|
|
7314
|
-
timestamp: string;
|
|
7315
|
-
level: "error" | "warn" | "info";
|
|
7316
7316
|
metrics: Record<string, unknown>;
|
|
7317
7317
|
parent: {
|
|
7318
7318
|
logId: string;
|
|
@@ -7326,13 +7326,13 @@ declare const LogSearchResponseSchema: z$1.ZodObject<{
|
|
|
7326
7326
|
type: string;
|
|
7327
7327
|
status: "success" | "failed";
|
|
7328
7328
|
id: string;
|
|
7329
|
+
timestamp: string;
|
|
7330
|
+
level: "error" | "warn" | "info";
|
|
7329
7331
|
metadata: {
|
|
7330
7332
|
instant_charge?: string | undefined;
|
|
7331
7333
|
} & {
|
|
7332
7334
|
[k: string]: unknown;
|
|
7333
7335
|
};
|
|
7334
|
-
timestamp: string;
|
|
7335
|
-
level: "error" | "warn" | "info";
|
|
7336
7336
|
metrics: Record<string, unknown>;
|
|
7337
7337
|
parent: {
|
|
7338
7338
|
logId: string;
|
|
@@ -7418,13 +7418,13 @@ declare const ToolExecutionLogDetailSchema: z$1.ZodObject<{
|
|
|
7418
7418
|
status: "success" | "failed";
|
|
7419
7419
|
data: Record<string, unknown>;
|
|
7420
7420
|
id: string;
|
|
7421
|
+
timestamp: string;
|
|
7422
|
+
level: "error" | "warn" | "info";
|
|
7421
7423
|
metadata: {
|
|
7422
7424
|
instant_charge?: string | undefined;
|
|
7423
7425
|
} & {
|
|
7424
7426
|
[k: string]: unknown;
|
|
7425
7427
|
};
|
|
7426
|
-
timestamp: string;
|
|
7427
|
-
level: "error" | "warn" | "info";
|
|
7428
7428
|
metrics: Record<string, unknown>;
|
|
7429
7429
|
parent: {
|
|
7430
7430
|
logId: string;
|
|
@@ -7450,13 +7450,13 @@ declare const ToolExecutionLogDetailSchema: z$1.ZodObject<{
|
|
|
7450
7450
|
status: "success" | "failed";
|
|
7451
7451
|
data: Record<string, unknown>;
|
|
7452
7452
|
id: string;
|
|
7453
|
+
timestamp: string;
|
|
7454
|
+
level: "error" | "warn" | "info";
|
|
7453
7455
|
metadata: {
|
|
7454
7456
|
instant_charge?: string | undefined;
|
|
7455
7457
|
} & {
|
|
7456
7458
|
[k: string]: unknown;
|
|
7457
7459
|
};
|
|
7458
|
-
timestamp: string;
|
|
7459
|
-
level: "error" | "warn" | "info";
|
|
7460
7460
|
metrics: Record<string, unknown>;
|
|
7461
7461
|
parent: {
|
|
7462
7462
|
logId: string;
|
|
@@ -8355,7 +8355,8 @@ declare class ToolRouter<TToolCollection, TTool, TProvider extends BaseComposioP
|
|
|
8355
8355
|
/**
|
|
8356
8356
|
* Derives the MCP config for a session from the auth context the session
|
|
8357
8357
|
* request was made with: the project key when one is configured, otherwise
|
|
8358
|
-
* the resolved user API key,
|
|
8358
|
+
* the resolved user API key, otherwise the organization API key, plus the
|
|
8359
|
+
* org/project scope when configured.
|
|
8359
8360
|
* Headers are only attached when the MCP URL shares the client's API
|
|
8360
8361
|
* origin. Any other destination throws when the caller passed `mcp: true`
|
|
8361
8362
|
* and otherwise yields empty headers plus a warning; see
|
|
@@ -8473,8 +8474,10 @@ type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown, unk
|
|
|
8473
8474
|
* project key; the SDK throws instead of sending it.
|
|
8474
8475
|
* - `null`: disables project-key authentication entirely, including both fallbacks. The SDK
|
|
8475
8476
|
* then requires another credential (`userApiKey`, `orgApiKey`, or an `x-user-api-key`
|
|
8476
|
-
* entry in `defaultHeaders`) and sends no `x-api-key`; an `x-api-key` entry in
|
|
8477
|
-
* `defaultHeaders` is rejected, also on `createSession()` clones.
|
|
8477
|
+
* or `x-org-api-key` entry in `defaultHeaders`) and sends no `x-api-key`; an `x-api-key` entry in
|
|
8478
|
+
* `defaultHeaders` is rejected, also on `createSession()` clones. The user API key
|
|
8479
|
+
* then authenticates every request; the organization API key does when it is the
|
|
8480
|
+
* only credential held.
|
|
8478
8481
|
*
|
|
8479
8482
|
* @example 'ak_1234567890'
|
|
8480
8483
|
*/
|
|
@@ -8495,7 +8498,8 @@ type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown, unk
|
|
|
8495
8498
|
* Sent as `x-org-api-key` only on operations whose security scheme accepts
|
|
8496
8499
|
* it, never alongside the project key. Falls back to
|
|
8497
8500
|
* `process.env['COMPOSIO_ORG_API_KEY']`; `null` disables that fallback.
|
|
8498
|
-
* Combine with `apiKey: null`
|
|
8501
|
+
* Combine with `apiKey: null` (and no user API key) to authenticate every
|
|
8502
|
+
* request with the organization key alone.
|
|
8499
8503
|
* @example 'oak_1234567890'
|
|
8500
8504
|
*/
|
|
8501
8505
|
orgApiKey?: string | null;
|
|
@@ -8592,10 +8596,14 @@ type ComposioConfig<TProvider extends BaseComposioProvider<unknown, unknown, unk
|
|
|
8592
8596
|
/**
|
|
8593
8597
|
* Default headers attached to every request made through this instance.
|
|
8594
8598
|
*
|
|
8595
|
-
*
|
|
8596
|
-
*
|
|
8597
|
-
*
|
|
8598
|
-
*
|
|
8599
|
+
* Credential and scope headers are not forwarded as headers: the SDK folds
|
|
8600
|
+
* them into its own options, which `getConfig()` then reports.
|
|
8601
|
+
* A non-empty `x-user-api-key` (or `x-org-api-key`) entry becomes the
|
|
8602
|
+
* credential every request carries, in place of the configured keys; together
|
|
8603
|
+
* with `apiKey: null` it authenticates with that key instead of a project key.
|
|
8604
|
+
* An `x-api-key` entry replaces the project key, and is rejected when `apiKey`
|
|
8605
|
+
* is `null`. At most one of the three may be set. `x-org-id` / `x-project-id`
|
|
8606
|
+
* entries supply `orgId` / `projectId`.
|
|
8599
8607
|
*
|
|
8600
8608
|
* The SDK reports itself through the API client's identity headers
|
|
8601
8609
|
* (`x-client-provenance`, `x-client-version`, `x-client-library`,
|