@composio/core 0.6.3 → 0.6.4
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/{BaseProvider-C7yGAyLz.d.mts → BaseProvider-B_7Qy99Q.d.mts} +1950 -40
- package/dist/{BaseProvider-X7JCCvcK.d.cts → BaseProvider-DF03HAz3.d.cts} +1950 -40
- package/dist/{Telemetry-Bn5VseVi.mjs → Telemetry-B3HlLpMT.mjs} +4 -7
- package/dist/{Telemetry-DErMJqj0.cjs → Telemetry-DBe2oppA.cjs} +4 -7
- package/dist/{composio-uGEfnO6v.d.cts → composio-COyITeJf.d.cts} +109 -114
- package/dist/{composio-Ds1Z80p8.d.mts → composio-ClplAPbl.d.mts} +109 -114
- package/dist/index.cjs +275 -25
- package/dist/index.d.cts +4777 -3
- package/dist/index.d.mts +4777 -3
- package/dist/index.mjs +268 -26
- package/dist/models/Files.node.cjs +1 -1
- package/dist/models/Files.node.mjs +1 -1
- package/dist/{types-CMQAtpc_.d.mts → types-BO1Bf2Xz.d.mts} +2 -2
- package/dist/{types-CTXCkF_v.d.cts → types-Bib0jIbg.d.cts} +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.cts +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.node.d.mts +3 -3
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.cts +2 -2
- package/dist/utils/config-defaults/ConfigDefaults.workerd.d.mts +3 -3
- package/dist/utils/modifiers/FileToolModifier.node.d.cts +1 -1
- package/dist/utils/modifiers/FileToolModifier.node.d.mts +1 -1
- package/dist/utils/modifiers/FileToolModifier.workerd.d.cts +1 -1
- package/dist/utils/modifiers/FileToolModifier.workerd.d.mts +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CQwRTUmo.cjs');
|
|
2
2
|
const require_buffer = require('./buffer-CYf1Z6Sd.cjs');
|
|
3
|
-
const require_Telemetry = require('./Telemetry-
|
|
3
|
+
const require_Telemetry = require('./Telemetry-DBe2oppA.cjs');
|
|
4
4
|
let _composio_client = require("@composio/client");
|
|
5
5
|
_composio_client = require_chunk.__toESM(_composio_client);
|
|
6
6
|
let _file_tool_modifier = require("#file_tool_modifier");
|
|
@@ -34,7 +34,8 @@ const AuthSchemeTypes = {
|
|
|
34
34
|
CALCOM_AUTH: "CALCOM_AUTH",
|
|
35
35
|
SERVICE_ACCOUNT: "SERVICE_ACCOUNT",
|
|
36
36
|
SAML: "SAML",
|
|
37
|
-
DCR_OAUTH: "DCR_OAUTH"
|
|
37
|
+
DCR_OAUTH: "DCR_OAUTH",
|
|
38
|
+
S2S_OAUTH2: "S2S_OAUTH2"
|
|
38
39
|
};
|
|
39
40
|
const AuthConfigCreationToolAccessConfigSchema = zod_v3.z.object({ toolsForConnectedAccountCreation: zod_v3.z.array(zod_v3.z.string()).optional() });
|
|
40
41
|
const AuthConfigToolAccessConfigSchema = zod_v3.z.object({
|
|
@@ -54,7 +55,8 @@ const AuthSchemeEnum = zod_v3.z.enum([
|
|
|
54
55
|
"CALCOM_AUTH",
|
|
55
56
|
"SERVICE_ACCOUNT",
|
|
56
57
|
"SAML",
|
|
57
|
-
"DCR_OAUTH"
|
|
58
|
+
"DCR_OAUTH",
|
|
59
|
+
"S2S_OAUTH2"
|
|
58
60
|
]);
|
|
59
61
|
const CreateCustomAuthConfigParamsSchema = zod_v3.z.object({
|
|
60
62
|
type: zod_v3.z.literal("use_custom_auth"),
|
|
@@ -258,6 +260,70 @@ const Oauth2ConnectionDataSchema = zod_v3.z.discriminatedUnion("status", [
|
|
|
258
260
|
Oauth2InactiveConnectionDataSchema
|
|
259
261
|
]);
|
|
260
262
|
const CustomOauth2ConnectionDataSchema = Oauth2ActiveConnectionDataSchema.omit({ status: true });
|
|
263
|
+
const S2SOauth2BaseSchema = BaseSchemeRaw.extend({ status: zod_v3.z.literal(ConnectionStatuses.INITIALIZING) }).catchall(zod_v3.z.unknown());
|
|
264
|
+
const S2SOauth2ConnectionDataSchema = zod_v3.z.discriminatedUnion("status", [
|
|
265
|
+
S2SOauth2BaseSchema,
|
|
266
|
+
S2SOauth2BaseSchema.extend({ status: zod_v3.z.literal(ConnectionStatuses.INITIATED) }).catchall(zod_v3.z.unknown()),
|
|
267
|
+
S2SOauth2BaseSchema.extend({
|
|
268
|
+
status: zod_v3.z.literal(ConnectionStatuses.ACTIVE),
|
|
269
|
+
access_token: zod_v3.z.string().optional(),
|
|
270
|
+
id_token: zod_v3.z.string().optional(),
|
|
271
|
+
token_type: zod_v3.z.string().optional(),
|
|
272
|
+
refresh_token: zod_v3.z.string().nullish(),
|
|
273
|
+
expires_in: zod_v3.z.union([
|
|
274
|
+
zod_v3.z.string(),
|
|
275
|
+
zod_v3.z.number(),
|
|
276
|
+
zod_v3.z.null()
|
|
277
|
+
]).optional(),
|
|
278
|
+
scope: zod_v3.z.union([
|
|
279
|
+
zod_v3.z.string(),
|
|
280
|
+
zod_v3.z.array(zod_v3.z.string()),
|
|
281
|
+
zod_v3.z.null()
|
|
282
|
+
]).optional()
|
|
283
|
+
}).catchall(zod_v3.z.unknown()),
|
|
284
|
+
S2SOauth2BaseSchema.extend({
|
|
285
|
+
status: zod_v3.z.literal(ConnectionStatuses.INACTIVE),
|
|
286
|
+
access_token: zod_v3.z.string().optional(),
|
|
287
|
+
id_token: zod_v3.z.string().optional(),
|
|
288
|
+
token_type: zod_v3.z.string().optional(),
|
|
289
|
+
refresh_token: zod_v3.z.string().nullish(),
|
|
290
|
+
expires_in: zod_v3.z.union([
|
|
291
|
+
zod_v3.z.string(),
|
|
292
|
+
zod_v3.z.number(),
|
|
293
|
+
zod_v3.z.null()
|
|
294
|
+
]).optional(),
|
|
295
|
+
scope: zod_v3.z.union([
|
|
296
|
+
zod_v3.z.string(),
|
|
297
|
+
zod_v3.z.array(zod_v3.z.string()),
|
|
298
|
+
zod_v3.z.null()
|
|
299
|
+
]).optional()
|
|
300
|
+
}).catchall(zod_v3.z.unknown()),
|
|
301
|
+
S2SOauth2BaseSchema.extend({
|
|
302
|
+
status: zod_v3.z.literal(ConnectionStatuses.FAILED),
|
|
303
|
+
error: zod_v3.z.string().optional(),
|
|
304
|
+
error_description: zod_v3.z.string().optional()
|
|
305
|
+
}).catchall(zod_v3.z.unknown()),
|
|
306
|
+
S2SOauth2BaseSchema.extend({
|
|
307
|
+
status: zod_v3.z.literal(ConnectionStatuses.EXPIRED),
|
|
308
|
+
expired_at: zod_v3.z.string().optional()
|
|
309
|
+
}).catchall(zod_v3.z.unknown())
|
|
310
|
+
]);
|
|
311
|
+
const CustomS2SOauth2ConnectionDataSchema = BaseSchemeRaw.extend({
|
|
312
|
+
access_token: zod_v3.z.string().optional(),
|
|
313
|
+
id_token: zod_v3.z.string().optional(),
|
|
314
|
+
token_type: zod_v3.z.string().optional(),
|
|
315
|
+
refresh_token: zod_v3.z.string().nullish().optional(),
|
|
316
|
+
expires_in: zod_v3.z.union([
|
|
317
|
+
zod_v3.z.string(),
|
|
318
|
+
zod_v3.z.number(),
|
|
319
|
+
zod_v3.z.null()
|
|
320
|
+
]).optional(),
|
|
321
|
+
scope: zod_v3.z.union([
|
|
322
|
+
zod_v3.z.string(),
|
|
323
|
+
zod_v3.z.array(zod_v3.z.string()),
|
|
324
|
+
zod_v3.z.null()
|
|
325
|
+
]).optional()
|
|
326
|
+
}).catchall(zod_v3.z.unknown());
|
|
261
327
|
const Oauth1InitiatingConnectionDataSchema = BaseSchemeRaw.extend({ status: zod_v3.z.literal(ConnectionStatuses.INITIALIZING) }).catchall(zod_v3.z.unknown());
|
|
262
328
|
const Oauth1InitiatedConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
263
329
|
status: zod_v3.z.literal(ConnectionStatuses.INITIATED),
|
|
@@ -618,6 +684,10 @@ const ConnectionDataSchema = zod_v3.z.discriminatedUnion("authScheme", [
|
|
|
618
684
|
authScheme: zod_v3.z.literal(AuthSchemeTypes.OAUTH2),
|
|
619
685
|
val: Oauth2ConnectionDataSchema
|
|
620
686
|
}),
|
|
687
|
+
zod_v3.z.object({
|
|
688
|
+
authScheme: zod_v3.z.literal(AuthSchemeTypes.S2S_OAUTH2),
|
|
689
|
+
val: S2SOauth2ConnectionDataSchema
|
|
690
|
+
}),
|
|
621
691
|
zod_v3.z.object({
|
|
622
692
|
authScheme: zod_v3.z.literal(AuthSchemeTypes.API_KEY),
|
|
623
693
|
val: ApiKeyConnectionDataSchema
|
|
@@ -669,6 +739,11 @@ const CustomConnectionDataSchema = zod_v3.z.discriminatedUnion("authScheme", [
|
|
|
669
739
|
toolkitSlug: zod_v3.z.string(),
|
|
670
740
|
val: CustomOauth2ConnectionDataSchema
|
|
671
741
|
}),
|
|
742
|
+
zod_v3.z.object({
|
|
743
|
+
authScheme: zod_v3.z.literal(AuthSchemeTypes.S2S_OAUTH2),
|
|
744
|
+
toolkitSlug: zod_v3.z.string(),
|
|
745
|
+
val: CustomS2SOauth2ConnectionDataSchema
|
|
746
|
+
}),
|
|
672
747
|
zod_v3.z.object({
|
|
673
748
|
authScheme: zod_v3.z.literal(AuthSchemeTypes.DCR_OAUTH),
|
|
674
749
|
toolkitSlug: zod_v3.z.string(),
|
|
@@ -1422,6 +1497,7 @@ const CreateConnectedAccountResponseSchema = zod_v3.z.object({
|
|
|
1422
1497
|
});
|
|
1423
1498
|
const ConnectedAccountAuthConfigSchema = zod_v3.z.object({
|
|
1424
1499
|
id: zod_v3.z.string(),
|
|
1500
|
+
authScheme: AuthSchemeEnum.optional(),
|
|
1425
1501
|
isComposioManaged: zod_v3.z.boolean(),
|
|
1426
1502
|
isDisabled: zod_v3.z.boolean()
|
|
1427
1503
|
});
|
|
@@ -1504,6 +1580,7 @@ function transformConnectedAccountResponse(response) {
|
|
|
1504
1580
|
authConfig: {
|
|
1505
1581
|
...response$1.auth_config,
|
|
1506
1582
|
id: response$1.auth_config.id,
|
|
1583
|
+
authScheme: response$1.auth_config.auth_scheme,
|
|
1507
1584
|
isComposioManaged: response$1.auth_config.is_composio_managed,
|
|
1508
1585
|
isDisabled: response$1.auth_config.is_disabled
|
|
1509
1586
|
},
|
|
@@ -3246,7 +3323,7 @@ var ConnectedAccounts = class {
|
|
|
3246
3323
|
const parsedOptions = ConnectedAccountRefreshOptionsSchema.safeParse(options);
|
|
3247
3324
|
if (!parsedOptions.success) throw new ValidationError("Failed to parse connected account refresh options", { cause: parsedOptions.error });
|
|
3248
3325
|
params = {
|
|
3249
|
-
|
|
3326
|
+
query_redirect_url: parsedOptions.data.redirectUrl,
|
|
3250
3327
|
validate_credentials: parsedOptions.data.validateCredentials
|
|
3251
3328
|
};
|
|
3252
3329
|
}
|
|
@@ -3677,11 +3754,19 @@ const WebhookPayloadV2Schema = zod_v3.z.object({
|
|
|
3677
3754
|
user_id: zod_v3.z.string()
|
|
3678
3755
|
}).passthrough()
|
|
3679
3756
|
});
|
|
3680
|
-
/** V3 webhook payload -
|
|
3757
|
+
/** V3 webhook payload - generic envelope for all composio.* events */
|
|
3681
3758
|
const WebhookPayloadV3Schema = zod_v3.z.object({
|
|
3682
3759
|
id: zod_v3.z.string(),
|
|
3683
3760
|
timestamp: zod_v3.z.string(),
|
|
3684
|
-
type: zod_v3.z.
|
|
3761
|
+
type: zod_v3.z.string().refine((val) => val.startsWith("composio."), { message: "V3 event type must start with 'composio.'" }),
|
|
3762
|
+
metadata: zod_v3.z.record(zod_v3.z.unknown()),
|
|
3763
|
+
data: zod_v3.z.record(zod_v3.z.unknown())
|
|
3764
|
+
});
|
|
3765
|
+
/** V3 trigger-specific payload - has trigger metadata fields */
|
|
3766
|
+
const WebhookTriggerPayloadV3Schema = zod_v3.z.object({
|
|
3767
|
+
id: zod_v3.z.string(),
|
|
3768
|
+
timestamp: zod_v3.z.string(),
|
|
3769
|
+
type: zod_v3.z.string(),
|
|
3685
3770
|
metadata: zod_v3.z.object({
|
|
3686
3771
|
log_id: zod_v3.z.string(),
|
|
3687
3772
|
trigger_slug: zod_v3.z.string(),
|
|
@@ -3689,7 +3774,7 @@ const WebhookPayloadV3Schema = zod_v3.z.object({
|
|
|
3689
3774
|
connected_account_id: zod_v3.z.string(),
|
|
3690
3775
|
auth_config_id: zod_v3.z.string(),
|
|
3691
3776
|
user_id: zod_v3.z.string()
|
|
3692
|
-
}),
|
|
3777
|
+
}).passthrough(),
|
|
3693
3778
|
data: zod_v3.z.record(zod_v3.z.unknown())
|
|
3694
3779
|
});
|
|
3695
3780
|
/** Union of all webhook payload versions */
|
|
@@ -4535,28 +4620,55 @@ var Triggers = class {
|
|
|
4535
4620
|
* @private
|
|
4536
4621
|
*/
|
|
4537
4622
|
normalizeV3Payload(payload) {
|
|
4538
|
-
const
|
|
4539
|
-
|
|
4623
|
+
const triggerResult = WebhookTriggerPayloadV3Schema.safeParse(payload);
|
|
4624
|
+
if (triggerResult.success) {
|
|
4625
|
+
const triggerSlug = triggerResult.data.metadata.trigger_slug;
|
|
4626
|
+
const toolkitSlug = triggerSlug.split("_")[0]?.toUpperCase() || "UNKNOWN";
|
|
4627
|
+
return {
|
|
4628
|
+
id: triggerResult.data.metadata.trigger_id,
|
|
4629
|
+
uuid: triggerResult.data.metadata.trigger_id,
|
|
4630
|
+
triggerSlug,
|
|
4631
|
+
toolkitSlug,
|
|
4632
|
+
userId: triggerResult.data.metadata.user_id,
|
|
4633
|
+
payload: payload.data,
|
|
4634
|
+
originalPayload: payload.data,
|
|
4635
|
+
metadata: {
|
|
4636
|
+
id: triggerResult.data.metadata.trigger_id,
|
|
4637
|
+
uuid: triggerResult.data.metadata.trigger_id,
|
|
4638
|
+
toolkitSlug,
|
|
4639
|
+
triggerSlug,
|
|
4640
|
+
triggerConfig: {},
|
|
4641
|
+
connectedAccount: {
|
|
4642
|
+
id: triggerResult.data.metadata.connected_account_id,
|
|
4643
|
+
uuid: triggerResult.data.metadata.connected_account_id,
|
|
4644
|
+
authConfigId: triggerResult.data.metadata.auth_config_id,
|
|
4645
|
+
authConfigUUID: triggerResult.data.metadata.auth_config_id,
|
|
4646
|
+
userId: triggerResult.data.metadata.user_id,
|
|
4647
|
+
status: "ACTIVE"
|
|
4648
|
+
}
|
|
4649
|
+
}
|
|
4650
|
+
};
|
|
4651
|
+
}
|
|
4540
4652
|
return {
|
|
4541
|
-
id: payload.
|
|
4542
|
-
uuid: payload.
|
|
4543
|
-
triggerSlug,
|
|
4544
|
-
toolkitSlug,
|
|
4545
|
-
userId:
|
|
4653
|
+
id: payload.id,
|
|
4654
|
+
uuid: payload.id,
|
|
4655
|
+
triggerSlug: payload.type,
|
|
4656
|
+
toolkitSlug: "COMPOSIO",
|
|
4657
|
+
userId: "",
|
|
4546
4658
|
payload: payload.data,
|
|
4547
|
-
originalPayload: payload
|
|
4659
|
+
originalPayload: payload,
|
|
4548
4660
|
metadata: {
|
|
4549
|
-
id: payload.
|
|
4550
|
-
uuid: payload.
|
|
4551
|
-
toolkitSlug,
|
|
4552
|
-
triggerSlug,
|
|
4661
|
+
id: payload.id,
|
|
4662
|
+
uuid: payload.id,
|
|
4663
|
+
toolkitSlug: "COMPOSIO",
|
|
4664
|
+
triggerSlug: payload.type,
|
|
4553
4665
|
triggerConfig: {},
|
|
4554
4666
|
connectedAccount: {
|
|
4555
|
-
id:
|
|
4556
|
-
uuid:
|
|
4557
|
-
authConfigId:
|
|
4558
|
-
authConfigUUID:
|
|
4559
|
-
userId:
|
|
4667
|
+
id: "",
|
|
4668
|
+
uuid: "",
|
|
4669
|
+
authConfigId: "",
|
|
4670
|
+
authConfigUUID: "",
|
|
4671
|
+
userId: "",
|
|
4560
4672
|
status: "ACTIVE"
|
|
4561
4673
|
}
|
|
4562
4674
|
}
|
|
@@ -5584,7 +5696,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
5584
5696
|
|
|
5585
5697
|
//#endregion
|
|
5586
5698
|
//#region package.json
|
|
5587
|
-
var version = "0.6.
|
|
5699
|
+
var version = "0.6.4";
|
|
5588
5700
|
|
|
5589
5701
|
//#endregion
|
|
5590
5702
|
//#region src/utils/session.ts
|
|
@@ -6464,6 +6576,136 @@ var AuthScheme = class {
|
|
|
6464
6576
|
}
|
|
6465
6577
|
};
|
|
6466
6578
|
|
|
6579
|
+
//#endregion
|
|
6580
|
+
//#region src/types/webhookEvents.types.ts
|
|
6581
|
+
const WebhookEventTypes = {
|
|
6582
|
+
CONNECTION_EXPIRED: "composio.connected_account.expired",
|
|
6583
|
+
TRIGGER_MESSAGE: "composio.trigger.message"
|
|
6584
|
+
};
|
|
6585
|
+
/**
|
|
6586
|
+
* Auth config schema for webhook payloads (raw API format, snake_case).
|
|
6587
|
+
*
|
|
6588
|
+
* This intentionally does NOT reuse ConnectedAccountAuthConfigSchema from
|
|
6589
|
+
* connectedAccounts.types.ts because:
|
|
6590
|
+
* - Webhook payloads arrive in raw snake_case (is_composio_managed, is_disabled)
|
|
6591
|
+
* while the SDK schema uses camelCase (isComposioManaged, isDisabled)
|
|
6592
|
+
* - Webhook payloads include additional fields (auth_scheme, deprecated)
|
|
6593
|
+
* not present in the SDK schema
|
|
6594
|
+
*
|
|
6595
|
+
* Uses .passthrough() to accept unknown fields the API may add in the future.
|
|
6596
|
+
*
|
|
6597
|
+
* @see ConnectedAccountAuthConfigSchema in connectedAccounts.types.ts for the camelCase SDK version
|
|
6598
|
+
*/
|
|
6599
|
+
const WebhookConnectedAccountAuthConfigSchema = zod_v3.z.object({
|
|
6600
|
+
id: zod_v3.z.string(),
|
|
6601
|
+
auth_scheme: zod_v3.z.nativeEnum(AuthSchemeTypes),
|
|
6602
|
+
is_composio_managed: zod_v3.z.boolean(),
|
|
6603
|
+
is_disabled: zod_v3.z.boolean(),
|
|
6604
|
+
deprecated: zod_v3.z.object({ uuid: zod_v3.z.string() }).optional()
|
|
6605
|
+
}).passthrough();
|
|
6606
|
+
/**
|
|
6607
|
+
* Simplified connection state schema for webhook payloads (raw API format).
|
|
6608
|
+
*
|
|
6609
|
+
* This intentionally does NOT reuse ConnectionDataSchema from
|
|
6610
|
+
* connectedAccountAuthStates.types.ts because:
|
|
6611
|
+
* - ConnectionDataSchema is a discriminated union requiring typed `val`
|
|
6612
|
+
* per auth scheme (e.g., Oauth2ConnectionDataSchema)
|
|
6613
|
+
* - Webhook payloads need loose validation (z.record(z.unknown()))
|
|
6614
|
+
* since the connection state varies and isn't the focus of event handling
|
|
6615
|
+
*
|
|
6616
|
+
* Uses .passthrough() to accept unknown fields the API may add in the future.
|
|
6617
|
+
*
|
|
6618
|
+
* @see ConnectionDataSchema in connectedAccountAuthStates.types.ts for the full typed version
|
|
6619
|
+
*/
|
|
6620
|
+
const WebhookConnectionStateSchema = zod_v3.z.object({
|
|
6621
|
+
authScheme: zod_v3.z.nativeEnum(AuthSchemeTypes),
|
|
6622
|
+
val: zod_v3.z.record(zod_v3.z.unknown())
|
|
6623
|
+
}).passthrough();
|
|
6624
|
+
/**
|
|
6625
|
+
* Connected account data schema for webhook payloads (raw API format, snake_case).
|
|
6626
|
+
*
|
|
6627
|
+
* This is the snake_case equivalent of ConnectedAccountRetrieveResponseSchema
|
|
6628
|
+
* from connectedAccounts.types.ts. It intentionally does NOT reuse that schema because:
|
|
6629
|
+
* - Webhook payloads arrive in raw snake_case (auth_config, user_id, created_at, etc.)
|
|
6630
|
+
* while the SDK schema uses camelCase (authConfig, createdAt, etc.)
|
|
6631
|
+
* - The SDK applies a transformation layer (utils/transformers/connectedAccounts.ts)
|
|
6632
|
+
* before validation; webhooks are validated directly by the user
|
|
6633
|
+
* - Webhook payloads include user_id, which the SDK schema omits
|
|
6634
|
+
*
|
|
6635
|
+
* Uses .passthrough() to accept unknown fields the API may add in the future.
|
|
6636
|
+
*
|
|
6637
|
+
* @see ConnectedAccountRetrieveResponseSchema in connectedAccounts.types.ts for the camelCase SDK version
|
|
6638
|
+
* @see utils/transformers/connectedAccounts.ts for the snake-to-camel transformation
|
|
6639
|
+
*/
|
|
6640
|
+
const SingleConnectedAccountDetailedResponseSchema = zod_v3.z.object({
|
|
6641
|
+
toolkit: zod_v3.z.object({ slug: zod_v3.z.string().describe("The slug of the toolkit") }).passthrough(),
|
|
6642
|
+
auth_config: WebhookConnectedAccountAuthConfigSchema,
|
|
6643
|
+
id: zod_v3.z.string(),
|
|
6644
|
+
user_id: zod_v3.z.string(),
|
|
6645
|
+
status: zod_v3.z.nativeEnum(ConnectionStatuses),
|
|
6646
|
+
created_at: zod_v3.z.string(),
|
|
6647
|
+
updated_at: zod_v3.z.string(),
|
|
6648
|
+
state: WebhookConnectionStateSchema,
|
|
6649
|
+
data: zod_v3.z.record(zod_v3.z.unknown()),
|
|
6650
|
+
params: zod_v3.z.record(zod_v3.z.unknown()),
|
|
6651
|
+
status_reason: zod_v3.z.string().nullable(),
|
|
6652
|
+
is_disabled: zod_v3.z.boolean(),
|
|
6653
|
+
test_request_endpoint: zod_v3.z.string().optional(),
|
|
6654
|
+
deprecated: zod_v3.z.object({
|
|
6655
|
+
labels: zod_v3.z.array(zod_v3.z.string()),
|
|
6656
|
+
uuid: zod_v3.z.string()
|
|
6657
|
+
}).optional()
|
|
6658
|
+
}).passthrough();
|
|
6659
|
+
/**
|
|
6660
|
+
* Webhook metadata for connection events.
|
|
6661
|
+
* Note: This differs from the trigger webhook metadata in WebhookTriggerPayloadV3Schema.
|
|
6662
|
+
*
|
|
6663
|
+
* Uses .passthrough() to accept unknown fields the API may add in the future.
|
|
6664
|
+
*/
|
|
6665
|
+
const WebhookConnectionMetadataSchema = zod_v3.z.object({
|
|
6666
|
+
project_id: zod_v3.z.string(),
|
|
6667
|
+
org_id: zod_v3.z.string()
|
|
6668
|
+
}).passthrough();
|
|
6669
|
+
/**
|
|
6670
|
+
* Connection expired webhook event payload.
|
|
6671
|
+
* Emitted when a connected account expires due to authentication refresh failure.
|
|
6672
|
+
*
|
|
6673
|
+
* Uses .passthrough() to accept unknown fields the API may add in the future.
|
|
6674
|
+
*
|
|
6675
|
+
* @example
|
|
6676
|
+
* ```typescript
|
|
6677
|
+
* import { ConnectionExpiredEventSchema } from '@composio/core';
|
|
6678
|
+
*
|
|
6679
|
+
* // In your webhook handler
|
|
6680
|
+
* const result = ConnectionExpiredEventSchema.safeParse(webhookPayload);
|
|
6681
|
+
* if (result.success) {
|
|
6682
|
+
* const { data, metadata } = result.data;
|
|
6683
|
+
* console.log(`Connection ${data.id} expired for user ${data.user_id}`);
|
|
6684
|
+
* console.log(`Toolkit: ${data.toolkit.slug}`);
|
|
6685
|
+
* console.log(`Project: ${metadata.project_id}`);
|
|
6686
|
+
* }
|
|
6687
|
+
* ```
|
|
6688
|
+
*/
|
|
6689
|
+
const ConnectionExpiredEventSchema = zod_v3.z.object({
|
|
6690
|
+
id: zod_v3.z.string(),
|
|
6691
|
+
timestamp: zod_v3.z.string(),
|
|
6692
|
+
type: zod_v3.z.literal(WebhookEventTypes.CONNECTION_EXPIRED),
|
|
6693
|
+
data: SingleConnectedAccountDetailedResponseSchema,
|
|
6694
|
+
metadata: WebhookConnectionMetadataSchema
|
|
6695
|
+
}).passthrough();
|
|
6696
|
+
/**
|
|
6697
|
+
* Union of all typed webhook event schemas.
|
|
6698
|
+
* Extend this as new event types are added.
|
|
6699
|
+
*
|
|
6700
|
+
* Note: This covers specific known event types with strict validation.
|
|
6701
|
+
* For unknown or new event types, use WebhookPayloadV3Schema from
|
|
6702
|
+
* triggers.types.ts which accepts any composio.* event with loose validation.
|
|
6703
|
+
*
|
|
6704
|
+
* Trigger events (composio.trigger.message) are handled through the
|
|
6705
|
+
* WebhookTriggerPayloadV3Schema in triggers.types.ts and the TriggerEvent type.
|
|
6706
|
+
*/
|
|
6707
|
+
const WebhookEventSchema = zod_v3.z.discriminatedUnion("type", [ConnectionExpiredEventSchema]);
|
|
6708
|
+
|
|
6467
6709
|
//#endregion
|
|
6468
6710
|
//#region src/types/mcp.types.ts
|
|
6469
6711
|
/**
|
|
@@ -6717,6 +6959,7 @@ exports.ConnectedAccountRetrieveResponseSchema = ConnectedAccountRetrieveRespons
|
|
|
6717
6959
|
exports.ConnectedAccountStatusSchema = ConnectedAccountStatusSchema;
|
|
6718
6960
|
exports.ConnectedAccountStatuses = ConnectedAccountStatuses;
|
|
6719
6961
|
exports.ConnectionDataSchema = ConnectionDataSchema;
|
|
6962
|
+
exports.ConnectionExpiredEventSchema = ConnectionExpiredEventSchema;
|
|
6720
6963
|
exports.ConnectionRequestErrorCodes = ConnectionRequestErrorCodes;
|
|
6721
6964
|
exports.ConnectionRequestFailedError = ConnectionRequestFailedError;
|
|
6722
6965
|
exports.ConnectionRequestTimeoutError = ConnectionRequestTimeoutError;
|
|
@@ -6776,6 +7019,7 @@ exports.Oauth2InitiatingConnectionDataSchema = Oauth2InitiatingConnectionDataSch
|
|
|
6776
7019
|
exports.OpenAIProvider = OpenAIProvider;
|
|
6777
7020
|
exports.RedirectableAuthSchemeSchema = RedirectableAuthSchemeSchema;
|
|
6778
7021
|
exports.SDKErrorCodes = SDKErrorCodes;
|
|
7022
|
+
exports.SingleConnectedAccountDetailedResponseSchema = SingleConnectedAccountDetailedResponseSchema;
|
|
6779
7023
|
exports.ToolErrorCodes = ToolErrorCodes;
|
|
6780
7024
|
exports.ToolExecuteMetaParamsSchema = ToolExecuteMetaParamsSchema;
|
|
6781
7025
|
exports.ToolExecuteParamsSchema = ToolExecuteParamsSchema;
|
|
@@ -6835,10 +7079,16 @@ exports.TriggersTypeListResponseSchema = TriggersTypeListResponseSchema;
|
|
|
6835
7079
|
exports.ValidationError = ValidationError;
|
|
6836
7080
|
exports.ValidationErrorCodes = ValidationErrorCodes;
|
|
6837
7081
|
exports.VerifyWebhookParamsSchema = VerifyWebhookParamsSchema;
|
|
7082
|
+
exports.WebhookConnectedAccountAuthConfigSchema = WebhookConnectedAccountAuthConfigSchema;
|
|
7083
|
+
exports.WebhookConnectionMetadataSchema = WebhookConnectionMetadataSchema;
|
|
7084
|
+
exports.WebhookConnectionStateSchema = WebhookConnectionStateSchema;
|
|
7085
|
+
exports.WebhookEventSchema = WebhookEventSchema;
|
|
7086
|
+
exports.WebhookEventTypes = WebhookEventTypes;
|
|
6838
7087
|
exports.WebhookPayloadSchema = WebhookPayloadSchema;
|
|
6839
7088
|
exports.WebhookPayloadV1Schema = WebhookPayloadV1Schema;
|
|
6840
7089
|
exports.WebhookPayloadV2Schema = WebhookPayloadV2Schema;
|
|
6841
7090
|
exports.WebhookPayloadV3Schema = WebhookPayloadV3Schema;
|
|
7091
|
+
exports.WebhookTriggerPayloadV3Schema = WebhookTriggerPayloadV3Schema;
|
|
6842
7092
|
exports.WebhookVersions = WebhookVersions;
|
|
6843
7093
|
Object.defineProperty(exports, 'constants', {
|
|
6844
7094
|
enumerable: true,
|