@composio/core 0.13.1 → 0.14.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/README.md +62 -247
- package/dist/BaseProvider-lCxnjFKQ.d.mts +29395 -0
- package/dist/{CustomTool-D9qwyMrv.mjs → CustomTool-C_5NvBsX.mjs} +17 -15
- package/dist/{CustomTool-DLf7JeKt.d.mts → CustomTool-CmokRT9q.d.mts} +1 -1
- package/dist/{FileModifierErrors-3fSwIWoa.mjs → SsrfErrors-BQRozkeU.mjs} +33 -1
- package/dist/{Telemetry-DhGI_J4G.mjs → Telemetry-llfvticE.mjs} +40 -8
- package/dist/{jsonSchema-CFKdONpP.mjs → cancellation-W65QRyj2.mjs} +64 -19
- package/dist/{composio-BHSQwOUz.d.mts → composio-6C8kHtqc.d.mts} +827 -808
- package/dist/{customTool.types-9yFqPjdw.d.mts → customTool.types-kFhNYuzh.d.mts} +502 -502
- package/dist/docs/reference/sdk-reference/typescript/index.mdx +1 -22
- package/dist/{errors-DSIlYfl5.mjs → errors-B165yJUQ.mjs} +74 -74
- package/dist/experimental/index.d.mts +2 -2
- package/dist/experimental/index.mjs +1 -1
- package/dist/{fileUtils.node-BiO1JQsJ.mjs → fileUtils.node-iPFi2o4i.mjs} +182 -68
- package/dist/index.d.mts +1451 -1400
- package/dist/index.mjs +1408 -1378
- package/dist/models/Files.node.mjs +2 -2
- package/dist/platform/node.d.mts +1 -1
- package/dist/platform/node.mjs +3 -0
- package/dist/platform/workerd.d.mts +1 -1
- package/dist/platform/workerd.mjs +3 -0
- package/dist/sensitiveFileUploadPaths-B1OLsd8F.mjs +114 -0
- package/dist/{types-DdoCRzLj.d.mts → types-DY1r-kN9.d.mts} +9 -0
- package/dist/{types-BJLCRj9q.d.mts → types-yCrveqAj.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/package.json +10 -10
- package/src/errors/SsrfErrors.ts +47 -0
- package/src/errors/index.ts +3 -0
- package/src/index.ts +10 -0
- package/src/models/CustomTool.ts +1 -3
- package/src/models/ToolRouterSession.ts +38 -16
- package/src/models/Tools.ts +32 -2
- package/src/models/Triggers.ts +16 -76
- package/src/platform/node.ts +4 -0
- package/src/platform/types.ts +10 -0
- package/src/platform/workerd.ts +6 -0
- package/src/provider/OpenAIProvider.ts +19 -14
- package/src/telemetry/Telemetry.ts +9 -6
- package/src/telemetry/redact.ts +40 -0
- package/src/types/tool.types.ts +36 -32
- package/src/utils/fileUtils.node.ts +27 -4
- package/src/utils/jsonSchema.ts +58 -0
- package/src/utils/modifiers/FileToolModifier.node.ts +2 -1
- package/src/utils/sdk.ts +5 -4
- package/src/utils/{sensitiveFileUploadPaths.node.ts → sensitiveFileUploadPaths.ts} +29 -13
- package/src/utils/ssrfGuard.node.ts +202 -0
- package/src/utils/toolkitVersion.ts +21 -2
- package/dist/BaseProvider-Brb3o86-.d.mts +0 -29425
- package/dist/CustomTool-NpHpqdnU.d.mts +0 -74
- package/dist/buffer-PcbMMsgm.mjs +0 -33
- package/dist/composio-DfPD7BAi.d.mts +0 -5666
- package/dist/customTool.types-D-6YqFdW.d.mts +0 -2826
- package/dist/types-CCh8qvui.d.mts +0 -12
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { A as
|
|
3
|
-
import { t as telemetry } from "./Telemetry-DhGI_J4G.mjs";
|
|
4
|
-
import { i as getRandomShortId, t as arrayBufferToBase64 } from "./buffer-PcbMMsgm.mjs";
|
|
1
|
+
import { _ as USER_DATA_FILE_NAME, a as ComposioFileUploadError, b as getEnvsWithPrefix, c as FileModifierErrorCodes, d as COMPOSIO_DIR, f as COMPOSIO_LOG_LEVEL, g as TEMP_FILES_DIRECTORY_NAME, h as IS_DEVELOPMENT_OR_CI, i as ComposioFileUploadAbortedError, l as ComposioError, m as DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID, n as SsrfErrorCodes, o as ComposioFileUploadPathNotAllowedError, p as DEFAULT_BASE_URL, r as ComposioFileNotFoundError, s as ComposioSensitiveFilePathBlockedError, t as ComposioBlockedInternalUrlError, u as logger, v as constants_exports, y as getEnvVariable } from "./SsrfErrors-BQRozkeU.mjs";
|
|
2
|
+
import { A as ToolErrorCodes, B as ComposioSharedAccessDeniedError, C as ComposioInvalidExecuteFunctionError, D as ComposioToolExecutionError, E as ComposioProviderNotDefinedError, F as ComposioAclOnlyForSharedError, H as ConnectedAccountErrorCodes, I as ComposioConnectedAccountNotFoundError, L as ComposioFailedToCreateConnectedAccountLink, M as ConnectionRequestErrorCodes, N as ConnectionRequestFailedError, O as ComposioToolNotFoundError, P as ConnectionRequestTimeoutError, R as ComposioLegacyConnectedAccountsEndpointRetiredError, S as ComposioGlobalExecuteToolFnNotSetError, T as ComposioInvalidToolArgumentsError, U as AuthConfigErrorCodes, V as ComposioSharedConnectionNotAccessibleError, W as ComposioAuthConfigNotFoundError, _ as ValidationError, a as ComposioFailedToSubscribeToPusherChannelError, b as ComposioToolkitNotFoundError, c as ComposioWebhookPayloadError, d as ComposioNoAPIKeyError, f as ComposioRequestCancelledError, g as JsonSchemaToZodError, h as JsonSchemaRefResolutionError, i as ComposioFailedToGetSDKRealtimeCredentialsError, j as handleToolExecutionError, k as ComposioToolVersionRequiredError, l as ComposioWebhookSignatureVerificationError, m as isRequestAbortError, n as RemoteFileErrorCodes, o as ComposioFailedToUnsubscribeFromPusherChannelError, p as SDKErrorCodes, r as ComposioFailedToCreatePusherClientError, s as ComposioTriggerTypeNotFoundError, t as RemoteFileDownloadError, u as TriggerErrorCodes, v as ValidationErrorCodes, w as ComposioInvalidModifierError, x as ToolkitErrorCodes, y as ComposioToolkitFetchError, z as ComposioMultipleConnectedAccountsError } from "./errors-B165yJUQ.mjs";
|
|
5
3
|
import { r as schemaHasFileUploadable, t as isPlainObject } from "./FileToolModifier.utils.neutral-B5rT711M.mjs";
|
|
6
|
-
import { i as
|
|
7
|
-
import {
|
|
4
|
+
import { a as removeNonRequiredProperties, i as jsonSchemaToZodSchema, n as deduplicateJsonSchemaRequiredArrays, r as dereferenceJsonSchema, t as withCancellation } from "./cancellation-W65QRyj2.mjs";
|
|
5
|
+
import { t as telemetry } from "./Telemetry-llfvticE.mjs";
|
|
6
|
+
import { i as arrayBufferToBase64, n as assertSafeFileUploadPath, r as isBlockedSensitiveFileUploadPath, s as getRandomShortId, t as BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS } from "./sensitiveFileUploadPaths-B1OLsd8F.mjs";
|
|
7
|
+
import { a as createCustomToolkit, c as getPreloadedCustomToolSlugs, d as CreateCustomToolBaseSchema, f as CreateCustomToolkitBaseSchema, i as createCustomTool, l as serializeCustomToolkits, n as buildCustomToolsMap, o as findCustomToolMapEntryByFinalSlug, p as CustomToolSlugSchema, r as buildCustomToolsMapFromResponse, s as findCustomToolMapEntryByToolkitAndOriginalSlug, t as assertNoCustomToolSlugsInPreload, u as serializeCustomTools } from "./CustomTool-C_5NvBsX.mjs";
|
|
8
8
|
import ComposioClient, { APIError, BadRequestError } from "@composio/client";
|
|
9
9
|
import { FileToolModifier } from "#file_tool_modifier";
|
|
10
|
-
import z
|
|
10
|
+
import z, { z as z$1 } from "zod/v3";
|
|
11
11
|
import { CONFIG_DEFAULTS } from "#config_defaults";
|
|
12
12
|
import { platform } from "#platform";
|
|
13
13
|
import { APIError as APIError$1 } from "openai";
|
|
@@ -35,12 +35,12 @@ const AuthSchemeTypes = {
|
|
|
35
35
|
DCR_OAUTH: "DCR_OAUTH",
|
|
36
36
|
S2S_OAUTH2: "S2S_OAUTH2"
|
|
37
37
|
};
|
|
38
|
-
const AuthConfigCreationToolAccessConfigSchema = z.object({ toolsForConnectedAccountCreation: z.array(z.string()).optional() });
|
|
39
|
-
const AuthConfigToolAccessConfigSchema = z.object({
|
|
40
|
-
toolsAvailableForExecution: z.array(z.string()).optional(),
|
|
41
|
-
toolsForConnectedAccountCreation: z.array(z.string()).optional()
|
|
38
|
+
const AuthConfigCreationToolAccessConfigSchema = z$1.object({ toolsForConnectedAccountCreation: z$1.array(z$1.string()).optional() });
|
|
39
|
+
const AuthConfigToolAccessConfigSchema = z$1.object({
|
|
40
|
+
toolsAvailableForExecution: z$1.array(z$1.string()).optional(),
|
|
41
|
+
toolsForConnectedAccountCreation: z$1.array(z$1.string()).optional()
|
|
42
42
|
});
|
|
43
|
-
const AuthSchemeEnum = z.enum([
|
|
43
|
+
const AuthSchemeEnum = z$1.enum([
|
|
44
44
|
"OAUTH2",
|
|
45
45
|
"OAUTH1",
|
|
46
46
|
"API_KEY",
|
|
@@ -56,102 +56,102 @@ const AuthSchemeEnum = z.enum([
|
|
|
56
56
|
"DCR_OAUTH",
|
|
57
57
|
"S2S_OAUTH2"
|
|
58
58
|
]);
|
|
59
|
-
const CreateCustomAuthConfigParamsSchema = z.object({
|
|
60
|
-
type: z.literal("use_custom_auth"),
|
|
61
|
-
name: z.string().optional(),
|
|
62
|
-
credentials: z.record(z.string(), z.union([
|
|
63
|
-
z.string(),
|
|
64
|
-
z.number(),
|
|
65
|
-
z.boolean()
|
|
59
|
+
const CreateCustomAuthConfigParamsSchema = z$1.object({
|
|
60
|
+
type: z$1.literal("use_custom_auth"),
|
|
61
|
+
name: z$1.string().optional(),
|
|
62
|
+
credentials: z$1.record(z$1.string(), z$1.union([
|
|
63
|
+
z$1.string(),
|
|
64
|
+
z$1.number(),
|
|
65
|
+
z$1.boolean()
|
|
66
66
|
])),
|
|
67
67
|
authScheme: AuthSchemeEnum,
|
|
68
|
-
proxyConfig: z.object({
|
|
69
|
-
proxyUrl: z.string(),
|
|
70
|
-
proxyAuthKey: z.string().optional()
|
|
68
|
+
proxyConfig: z$1.object({
|
|
69
|
+
proxyUrl: z$1.string(),
|
|
70
|
+
proxyAuthKey: z$1.string().optional()
|
|
71
71
|
}).optional(),
|
|
72
72
|
toolAccessConfig: AuthConfigCreationToolAccessConfigSchema.optional(),
|
|
73
|
-
isEnabledForToolRouter: z.boolean().optional()
|
|
73
|
+
isEnabledForToolRouter: z$1.boolean().optional()
|
|
74
74
|
});
|
|
75
|
-
const CreateComposioManagedAuthConfigParamsSchema = z.object({
|
|
76
|
-
type: z.literal("use_composio_managed_auth"),
|
|
77
|
-
name: z.string().optional(),
|
|
78
|
-
credentials: z.object({
|
|
79
|
-
scopes: z.union([z.string(), z.array(z.string())]).optional(),
|
|
80
|
-
user_scopes: z.union([z.string(), z.array(z.string())]).optional()
|
|
75
|
+
const CreateComposioManagedAuthConfigParamsSchema = z$1.object({
|
|
76
|
+
type: z$1.literal("use_composio_managed_auth"),
|
|
77
|
+
name: z$1.string().optional(),
|
|
78
|
+
credentials: z$1.object({
|
|
79
|
+
scopes: z$1.union([z$1.string(), z$1.array(z$1.string())]).optional(),
|
|
80
|
+
user_scopes: z$1.union([z$1.string(), z$1.array(z$1.string())]).optional()
|
|
81
81
|
}).passthrough().optional(),
|
|
82
82
|
toolAccessConfig: AuthConfigCreationToolAccessConfigSchema.optional(),
|
|
83
|
-
isEnabledForToolRouter: z.boolean().optional()
|
|
83
|
+
isEnabledForToolRouter: z$1.boolean().optional()
|
|
84
84
|
});
|
|
85
85
|
/**
|
|
86
86
|
* Discriminated union of all possible auth config types.
|
|
87
87
|
*/
|
|
88
|
-
const CreateAuthConfigParamsSchema = z.discriminatedUnion("type", [CreateCustomAuthConfigParamsSchema, CreateComposioManagedAuthConfigParamsSchema]);
|
|
89
|
-
const CreateAuthConfigResponseSchema = z.object({
|
|
90
|
-
id: z.string(),
|
|
91
|
-
authScheme: z.string(),
|
|
92
|
-
isComposioManaged: z.boolean(),
|
|
93
|
-
toolkit: z.string()
|
|
88
|
+
const CreateAuthConfigParamsSchema = z$1.discriminatedUnion("type", [CreateCustomAuthConfigParamsSchema, CreateComposioManagedAuthConfigParamsSchema]);
|
|
89
|
+
const CreateAuthConfigResponseSchema = z$1.object({
|
|
90
|
+
id: z$1.string(),
|
|
91
|
+
authScheme: z$1.string(),
|
|
92
|
+
isComposioManaged: z$1.boolean(),
|
|
93
|
+
toolkit: z$1.string()
|
|
94
94
|
});
|
|
95
|
-
const AuthConfigRetrieveResponseSchema = z.object({
|
|
96
|
-
id: z.string(),
|
|
97
|
-
name: z.string(),
|
|
98
|
-
toolkit: z.object({
|
|
99
|
-
logo: z.string(),
|
|
100
|
-
slug: z.string()
|
|
95
|
+
const AuthConfigRetrieveResponseSchema = z$1.object({
|
|
96
|
+
id: z$1.string(),
|
|
97
|
+
name: z$1.string(),
|
|
98
|
+
toolkit: z$1.object({
|
|
99
|
+
logo: z$1.string(),
|
|
100
|
+
slug: z$1.string()
|
|
101
101
|
}),
|
|
102
|
-
noOfConnections: z.number(),
|
|
103
|
-
status: z.enum(["ENABLED", "DISABLED"]),
|
|
102
|
+
noOfConnections: z$1.number(),
|
|
103
|
+
status: z$1.enum(["ENABLED", "DISABLED"]),
|
|
104
104
|
authScheme: AuthSchemeEnum.optional(),
|
|
105
|
-
credentials: z.record(z.string(), z.unknown()).optional(),
|
|
106
|
-
expectedInputFields: z.array(z.unknown()).optional(),
|
|
107
|
-
isEnabledForToolRouter: z.boolean().optional(),
|
|
105
|
+
credentials: z$1.record(z$1.string(), z$1.unknown()).optional(),
|
|
106
|
+
expectedInputFields: z$1.array(z$1.unknown()).optional(),
|
|
107
|
+
isEnabledForToolRouter: z$1.boolean().optional(),
|
|
108
108
|
/**
|
|
109
109
|
* @deprecated - use tool access config to determine the tools that the user can perform on the auth config.
|
|
110
110
|
*/
|
|
111
|
-
restrictToFollowingTools: z.array(z.string()).optional(),
|
|
112
|
-
isComposioManaged: z.boolean().optional(),
|
|
113
|
-
createdBy: z.string().optional(),
|
|
114
|
-
createdAt: z.string().optional(),
|
|
115
|
-
lastUpdatedAt: z.string().optional(),
|
|
111
|
+
restrictToFollowingTools: z$1.array(z$1.string()).optional(),
|
|
112
|
+
isComposioManaged: z$1.boolean().optional(),
|
|
113
|
+
createdBy: z$1.string().optional(),
|
|
114
|
+
createdAt: z$1.string().optional(),
|
|
115
|
+
lastUpdatedAt: z$1.string().optional(),
|
|
116
116
|
toolAccessConfig: AuthConfigToolAccessConfigSchema.optional()
|
|
117
117
|
});
|
|
118
|
-
const AuthConfigListParamsSchema = z.object({
|
|
119
|
-
cursor: z.string().optional(),
|
|
120
|
-
isComposioManaged: z.boolean().optional(),
|
|
121
|
-
limit: z.number().optional(),
|
|
122
|
-
search: z.string().optional(),
|
|
123
|
-
showDisabled: z.boolean().optional(),
|
|
124
|
-
toolkit: z.string().optional()
|
|
118
|
+
const AuthConfigListParamsSchema = z$1.object({
|
|
119
|
+
cursor: z$1.string().optional(),
|
|
120
|
+
isComposioManaged: z$1.boolean().optional(),
|
|
121
|
+
limit: z$1.number().optional(),
|
|
122
|
+
search: z$1.string().optional(),
|
|
123
|
+
showDisabled: z$1.boolean().optional(),
|
|
124
|
+
toolkit: z$1.string().optional()
|
|
125
125
|
});
|
|
126
|
-
const AuthConfigListResponseSchema = z.object({
|
|
127
|
-
items: z.array(AuthConfigRetrieveResponseSchema),
|
|
128
|
-
nextCursor: z.string().nullable(),
|
|
129
|
-
totalPages: z.number()
|
|
126
|
+
const AuthConfigListResponseSchema = z$1.object({
|
|
127
|
+
items: z$1.array(AuthConfigRetrieveResponseSchema),
|
|
128
|
+
nextCursor: z$1.string().nullable(),
|
|
129
|
+
totalPages: z$1.number()
|
|
130
130
|
});
|
|
131
|
-
const AuthCustomConfigUpdateParamsSchema = z.object({
|
|
132
|
-
type: z.literal("custom"),
|
|
133
|
-
credentials: z.object({
|
|
134
|
-
scopes: z.union([z.string(), z.array(z.string())]).optional(),
|
|
135
|
-
user_scopes: z.union([z.string(), z.array(z.string())]).optional()
|
|
131
|
+
const AuthCustomConfigUpdateParamsSchema = z$1.object({
|
|
132
|
+
type: z$1.literal("custom"),
|
|
133
|
+
credentials: z$1.object({
|
|
134
|
+
scopes: z$1.union([z$1.string(), z$1.array(z$1.string())]).optional(),
|
|
135
|
+
user_scopes: z$1.union([z$1.string(), z$1.array(z$1.string())]).optional()
|
|
136
136
|
}).passthrough().optional(),
|
|
137
|
-
isEnabledForToolRouter: z.boolean().optional(),
|
|
137
|
+
isEnabledForToolRouter: z$1.boolean().optional(),
|
|
138
138
|
/**
|
|
139
139
|
* @deprecated - use tool access config to determine the tools that the user can perform on the auth config.
|
|
140
140
|
*/
|
|
141
|
-
restrictToFollowingTools: z.array(z.string()).optional(),
|
|
141
|
+
restrictToFollowingTools: z$1.array(z$1.string()).optional(),
|
|
142
142
|
toolAccessConfig: AuthConfigToolAccessConfigSchema.optional()
|
|
143
143
|
});
|
|
144
|
-
const AuthDefaultConfigUpdateParamsSchema = z.object({
|
|
145
|
-
type: z.literal("default"),
|
|
146
|
-
scopes: z.string().optional(),
|
|
147
|
-
isEnabledForToolRouter: z.boolean().optional(),
|
|
144
|
+
const AuthDefaultConfigUpdateParamsSchema = z$1.object({
|
|
145
|
+
type: z$1.literal("default"),
|
|
146
|
+
scopes: z$1.string().optional(),
|
|
147
|
+
isEnabledForToolRouter: z$1.boolean().optional(),
|
|
148
148
|
/**
|
|
149
149
|
* @deprecated - use tool access config to determine the tools that the user can perform on the auth config.
|
|
150
150
|
*/
|
|
151
|
-
restrictToFollowingTools: z.array(z.string()).optional(),
|
|
151
|
+
restrictToFollowingTools: z$1.array(z$1.string()).optional(),
|
|
152
152
|
toolAccessConfig: AuthConfigToolAccessConfigSchema.optional()
|
|
153
153
|
});
|
|
154
|
-
const AuthConfigUpdateParamsSchema = z.discriminatedUnion("type", [AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema]);
|
|
154
|
+
const AuthConfigUpdateParamsSchema = z$1.discriminatedUnion("type", [AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema]);
|
|
155
155
|
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/types/connectedAccountAuthStates.types.ts
|
|
@@ -164,107 +164,107 @@ const ConnectionStatuses = {
|
|
|
164
164
|
INACTIVE: "INACTIVE",
|
|
165
165
|
REVOKED: "REVOKED"
|
|
166
166
|
};
|
|
167
|
-
const RedirectableAuthSchemeSchema = z.enum([AuthSchemeTypes.OAUTH1, AuthSchemeTypes.OAUTH2]);
|
|
168
|
-
const BaseSchemeRaw = z.object({
|
|
169
|
-
subdomain: z.string().optional(),
|
|
170
|
-
["your-domain"]: z.string().optional(),
|
|
171
|
-
region: z.string().optional(),
|
|
172
|
-
shop: z.string().optional(),
|
|
173
|
-
account_url: z.string().optional(),
|
|
174
|
-
COMPANYDOMAIN: z.string().optional(),
|
|
175
|
-
extension: z.string().optional(),
|
|
176
|
-
form_api_base_url: z.string().optional(),
|
|
177
|
-
instanceEndpoint: z.string().optional(),
|
|
178
|
-
api_url: z.string().optional(),
|
|
179
|
-
borneo_dashboard_url: z.string().optional(),
|
|
180
|
-
proxy_username: z.string().optional(),
|
|
181
|
-
proxy_password: z.string().optional(),
|
|
182
|
-
domain: z.string().optional(),
|
|
183
|
-
version: z.string().optional(),
|
|
184
|
-
dc: z.string().optional(),
|
|
185
|
-
site_name: z.string().optional(),
|
|
186
|
-
instanceName: z.string().optional(),
|
|
187
|
-
account_id: z.string().optional(),
|
|
188
|
-
your_server: z.string().optional(),
|
|
189
|
-
server_location: z.string().optional(),
|
|
190
|
-
base_url: z.string().optional(),
|
|
191
|
-
api_key: z.string().optional(),
|
|
192
|
-
generic_api_key: z.string().optional(),
|
|
193
|
-
bearer_token: z.string().optional(),
|
|
194
|
-
basic_encoded: z.string().optional(),
|
|
195
|
-
long_redirect_url: z.boolean().optional(),
|
|
196
|
-
state_prefix: z.string().optional(),
|
|
197
|
-
registration_access_token: z.string().optional(),
|
|
198
|
-
registration_client_uri: z.string().optional(),
|
|
199
|
-
composio_link_redirect_url: z.string().optional()
|
|
200
|
-
}).catchall(z.unknown());
|
|
201
|
-
const Oauth2InitiatingConnectionDataSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
167
|
+
const RedirectableAuthSchemeSchema = z$1.enum([AuthSchemeTypes.OAUTH1, AuthSchemeTypes.OAUTH2]);
|
|
168
|
+
const BaseSchemeRaw = z$1.object({
|
|
169
|
+
subdomain: z$1.string().optional(),
|
|
170
|
+
["your-domain"]: z$1.string().optional(),
|
|
171
|
+
region: z$1.string().optional(),
|
|
172
|
+
shop: z$1.string().optional(),
|
|
173
|
+
account_url: z$1.string().optional(),
|
|
174
|
+
COMPANYDOMAIN: z$1.string().optional(),
|
|
175
|
+
extension: z$1.string().optional(),
|
|
176
|
+
form_api_base_url: z$1.string().optional(),
|
|
177
|
+
instanceEndpoint: z$1.string().optional(),
|
|
178
|
+
api_url: z$1.string().optional(),
|
|
179
|
+
borneo_dashboard_url: z$1.string().optional(),
|
|
180
|
+
proxy_username: z$1.string().optional(),
|
|
181
|
+
proxy_password: z$1.string().optional(),
|
|
182
|
+
domain: z$1.string().optional(),
|
|
183
|
+
version: z$1.string().optional(),
|
|
184
|
+
dc: z$1.string().optional(),
|
|
185
|
+
site_name: z$1.string().optional(),
|
|
186
|
+
instanceName: z$1.string().optional(),
|
|
187
|
+
account_id: z$1.string().optional(),
|
|
188
|
+
your_server: z$1.string().optional(),
|
|
189
|
+
server_location: z$1.string().optional(),
|
|
190
|
+
base_url: z$1.string().optional(),
|
|
191
|
+
api_key: z$1.string().optional(),
|
|
192
|
+
generic_api_key: z$1.string().optional(),
|
|
193
|
+
bearer_token: z$1.string().optional(),
|
|
194
|
+
basic_encoded: z$1.string().optional(),
|
|
195
|
+
long_redirect_url: z$1.boolean().optional(),
|
|
196
|
+
state_prefix: z$1.string().optional(),
|
|
197
|
+
registration_access_token: z$1.string().optional(),
|
|
198
|
+
registration_client_uri: z$1.string().optional(),
|
|
199
|
+
composio_link_redirect_url: z$1.string().optional()
|
|
200
|
+
}).catchall(z$1.unknown());
|
|
201
|
+
const Oauth2InitiatingConnectionDataSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
202
202
|
const Oauth2InitiatedConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
203
|
-
status: z.literal(ConnectionStatuses.INITIATED),
|
|
204
|
-
code_verifier: z.string().optional(),
|
|
205
|
-
redirectUrl: z.string(),
|
|
206
|
-
callback_url: z.string().optional(),
|
|
207
|
-
finalRedirectUri: z.string().optional(),
|
|
208
|
-
webhook_signature: z.string().optional()
|
|
209
|
-
}).catchall(z.unknown());
|
|
203
|
+
status: z$1.literal(ConnectionStatuses.INITIATED),
|
|
204
|
+
code_verifier: z$1.string().optional(),
|
|
205
|
+
redirectUrl: z$1.string(),
|
|
206
|
+
callback_url: z$1.string().optional(),
|
|
207
|
+
finalRedirectUri: z$1.string().optional(),
|
|
208
|
+
webhook_signature: z$1.string().optional()
|
|
209
|
+
}).catchall(z$1.unknown());
|
|
210
210
|
const Oauth2ActiveConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
211
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
212
|
-
access_token: z.string(),
|
|
213
|
-
id_token: z.string().optional(),
|
|
214
|
-
token_type: z.string().optional(),
|
|
215
|
-
refresh_token: z.string().nullish(),
|
|
216
|
-
expires_in: z.union([
|
|
217
|
-
z.string(),
|
|
218
|
-
z.number(),
|
|
219
|
-
z.null()
|
|
211
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
212
|
+
access_token: z$1.string(),
|
|
213
|
+
id_token: z$1.string().optional(),
|
|
214
|
+
token_type: z$1.string().optional(),
|
|
215
|
+
refresh_token: z$1.string().nullish(),
|
|
216
|
+
expires_in: z$1.union([
|
|
217
|
+
z$1.string(),
|
|
218
|
+
z$1.number(),
|
|
219
|
+
z$1.null()
|
|
220
220
|
]).optional(),
|
|
221
|
-
scope: z.union([
|
|
222
|
-
z.string(),
|
|
223
|
-
z.array(z.string()),
|
|
224
|
-
z.null()
|
|
221
|
+
scope: z$1.union([
|
|
222
|
+
z$1.string(),
|
|
223
|
+
z$1.array(z$1.string()),
|
|
224
|
+
z$1.null()
|
|
225
225
|
]).optional(),
|
|
226
|
-
webhook_signature: z.string().optional(),
|
|
227
|
-
authed_user: z.object({
|
|
228
|
-
access_token: z.string().optional(),
|
|
229
|
-
scope: z.string().optional()
|
|
226
|
+
webhook_signature: z$1.string().optional(),
|
|
227
|
+
authed_user: z$1.object({
|
|
228
|
+
access_token: z$1.string().optional(),
|
|
229
|
+
scope: z$1.string().optional()
|
|
230
230
|
}).optional().describe("for slack user scopes")
|
|
231
|
-
}).catchall(z.unknown());
|
|
231
|
+
}).catchall(z$1.unknown());
|
|
232
232
|
const Oauth2FailedConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
233
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
234
|
-
error: z.string().optional(),
|
|
235
|
-
error_description: z.string().optional()
|
|
236
|
-
}).catchall(z.unknown());
|
|
233
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
234
|
+
error: z$1.string().optional(),
|
|
235
|
+
error_description: z$1.string().optional()
|
|
236
|
+
}).catchall(z$1.unknown());
|
|
237
237
|
const Oauth2ExpiredConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
238
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
239
|
-
expired_at: z.string().optional()
|
|
240
|
-
}).catchall(z.unknown());
|
|
238
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
239
|
+
expired_at: z$1.string().optional()
|
|
240
|
+
}).catchall(z$1.unknown());
|
|
241
241
|
const Oauth2InactiveConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
242
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
243
|
-
access_token: z.string(),
|
|
244
|
-
id_token: z.string().optional(),
|
|
245
|
-
token_type: z.string().optional(),
|
|
246
|
-
refresh_token: z.string().nullish(),
|
|
247
|
-
expires_in: z.union([
|
|
248
|
-
z.string(),
|
|
249
|
-
z.number(),
|
|
250
|
-
z.null()
|
|
242
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
243
|
+
access_token: z$1.string(),
|
|
244
|
+
id_token: z$1.string().optional(),
|
|
245
|
+
token_type: z$1.string().optional(),
|
|
246
|
+
refresh_token: z$1.string().nullish(),
|
|
247
|
+
expires_in: z$1.union([
|
|
248
|
+
z$1.string(),
|
|
249
|
+
z$1.number(),
|
|
250
|
+
z$1.null()
|
|
251
251
|
]).optional(),
|
|
252
|
-
scope: z.union([
|
|
253
|
-
z.string(),
|
|
254
|
-
z.array(z.string()),
|
|
255
|
-
z.null()
|
|
252
|
+
scope: z$1.union([
|
|
253
|
+
z$1.string(),
|
|
254
|
+
z$1.array(z$1.string()),
|
|
255
|
+
z$1.null()
|
|
256
256
|
]).optional(),
|
|
257
|
-
webhook_signature: z.string().optional(),
|
|
258
|
-
authed_user: z.object({
|
|
259
|
-
access_token: z.string().optional(),
|
|
260
|
-
scope: z.string().optional()
|
|
257
|
+
webhook_signature: z$1.string().optional(),
|
|
258
|
+
authed_user: z$1.object({
|
|
259
|
+
access_token: z$1.string().optional(),
|
|
260
|
+
scope: z$1.string().optional()
|
|
261
261
|
}).optional().describe("for slack user scopes")
|
|
262
|
-
}).catchall(z.unknown());
|
|
262
|
+
}).catchall(z$1.unknown());
|
|
263
263
|
const Oauth2RevokedConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
264
|
-
status: z.literal(ConnectionStatuses.REVOKED),
|
|
265
|
-
revoked_at: z.string().optional()
|
|
266
|
-
}).catchall(z.unknown());
|
|
267
|
-
const Oauth2ConnectionDataSchema = z.discriminatedUnion("status", [
|
|
264
|
+
status: z$1.literal(ConnectionStatuses.REVOKED),
|
|
265
|
+
revoked_at: z$1.string().optional()
|
|
266
|
+
}).catchall(z$1.unknown());
|
|
267
|
+
const Oauth2ConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
268
268
|
Oauth2InitiatingConnectionDataSchema,
|
|
269
269
|
Oauth2InitiatedConnectionDataSchema,
|
|
270
270
|
Oauth2ActiveConnectionDataSchema,
|
|
@@ -274,111 +274,111 @@ const Oauth2ConnectionDataSchema = z.discriminatedUnion("status", [
|
|
|
274
274
|
Oauth2RevokedConnectionDataSchema
|
|
275
275
|
]);
|
|
276
276
|
const CustomOauth2ConnectionDataSchema = Oauth2ActiveConnectionDataSchema.omit({ status: true });
|
|
277
|
-
const S2SOauth2BaseSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
278
|
-
const S2SOauth2ConnectionDataSchema = z.discriminatedUnion("status", [
|
|
277
|
+
const S2SOauth2BaseSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
278
|
+
const S2SOauth2ConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
279
279
|
S2SOauth2BaseSchema,
|
|
280
|
-
S2SOauth2BaseSchema.extend({ status: z.literal(ConnectionStatuses.INITIATED) }).catchall(z.unknown()),
|
|
280
|
+
S2SOauth2BaseSchema.extend({ status: z$1.literal(ConnectionStatuses.INITIATED) }).catchall(z$1.unknown()),
|
|
281
281
|
S2SOauth2BaseSchema.extend({
|
|
282
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
283
|
-
access_token: z.string().optional(),
|
|
284
|
-
id_token: z.string().optional(),
|
|
285
|
-
token_type: z.string().optional(),
|
|
286
|
-
refresh_token: z.string().nullish(),
|
|
287
|
-
expires_in: z.union([
|
|
288
|
-
z.string(),
|
|
289
|
-
z.number(),
|
|
290
|
-
z.null()
|
|
282
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
283
|
+
access_token: z$1.string().optional(),
|
|
284
|
+
id_token: z$1.string().optional(),
|
|
285
|
+
token_type: z$1.string().optional(),
|
|
286
|
+
refresh_token: z$1.string().nullish(),
|
|
287
|
+
expires_in: z$1.union([
|
|
288
|
+
z$1.string(),
|
|
289
|
+
z$1.number(),
|
|
290
|
+
z$1.null()
|
|
291
291
|
]).optional(),
|
|
292
|
-
scope: z.union([
|
|
293
|
-
z.string(),
|
|
294
|
-
z.array(z.string()),
|
|
295
|
-
z.null()
|
|
292
|
+
scope: z$1.union([
|
|
293
|
+
z$1.string(),
|
|
294
|
+
z$1.array(z$1.string()),
|
|
295
|
+
z$1.null()
|
|
296
296
|
]).optional()
|
|
297
|
-
}).catchall(z.unknown()),
|
|
297
|
+
}).catchall(z$1.unknown()),
|
|
298
298
|
S2SOauth2BaseSchema.extend({
|
|
299
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
300
|
-
access_token: z.string().optional(),
|
|
301
|
-
id_token: z.string().optional(),
|
|
302
|
-
token_type: z.string().optional(),
|
|
303
|
-
refresh_token: z.string().nullish(),
|
|
304
|
-
expires_in: z.union([
|
|
305
|
-
z.string(),
|
|
306
|
-
z.number(),
|
|
307
|
-
z.null()
|
|
299
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
300
|
+
access_token: z$1.string().optional(),
|
|
301
|
+
id_token: z$1.string().optional(),
|
|
302
|
+
token_type: z$1.string().optional(),
|
|
303
|
+
refresh_token: z$1.string().nullish(),
|
|
304
|
+
expires_in: z$1.union([
|
|
305
|
+
z$1.string(),
|
|
306
|
+
z$1.number(),
|
|
307
|
+
z$1.null()
|
|
308
308
|
]).optional(),
|
|
309
|
-
scope: z.union([
|
|
310
|
-
z.string(),
|
|
311
|
-
z.array(z.string()),
|
|
312
|
-
z.null()
|
|
309
|
+
scope: z$1.union([
|
|
310
|
+
z$1.string(),
|
|
311
|
+
z$1.array(z$1.string()),
|
|
312
|
+
z$1.null()
|
|
313
313
|
]).optional()
|
|
314
|
-
}).catchall(z.unknown()),
|
|
314
|
+
}).catchall(z$1.unknown()),
|
|
315
315
|
S2SOauth2BaseSchema.extend({
|
|
316
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
317
|
-
error: z.string().optional(),
|
|
318
|
-
error_description: z.string().optional()
|
|
319
|
-
}).catchall(z.unknown()),
|
|
316
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
317
|
+
error: z$1.string().optional(),
|
|
318
|
+
error_description: z$1.string().optional()
|
|
319
|
+
}).catchall(z$1.unknown()),
|
|
320
320
|
S2SOauth2BaseSchema.extend({
|
|
321
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
322
|
-
expired_at: z.string().optional()
|
|
323
|
-
}).catchall(z.unknown()),
|
|
321
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
322
|
+
expired_at: z$1.string().optional()
|
|
323
|
+
}).catchall(z$1.unknown()),
|
|
324
324
|
S2SOauth2BaseSchema.extend({
|
|
325
|
-
status: z.literal(ConnectionStatuses.REVOKED),
|
|
326
|
-
revoked_at: z.string().optional()
|
|
327
|
-
}).catchall(z.unknown())
|
|
325
|
+
status: z$1.literal(ConnectionStatuses.REVOKED),
|
|
326
|
+
revoked_at: z$1.string().optional()
|
|
327
|
+
}).catchall(z$1.unknown())
|
|
328
328
|
]);
|
|
329
329
|
const CustomS2SOauth2ConnectionDataSchema = BaseSchemeRaw.extend({
|
|
330
|
-
access_token: z.string().optional(),
|
|
331
|
-
id_token: z.string().optional(),
|
|
332
|
-
token_type: z.string().optional(),
|
|
333
|
-
refresh_token: z.string().nullish().optional(),
|
|
334
|
-
expires_in: z.union([
|
|
335
|
-
z.string(),
|
|
336
|
-
z.number(),
|
|
337
|
-
z.null()
|
|
330
|
+
access_token: z$1.string().optional(),
|
|
331
|
+
id_token: z$1.string().optional(),
|
|
332
|
+
token_type: z$1.string().optional(),
|
|
333
|
+
refresh_token: z$1.string().nullish().optional(),
|
|
334
|
+
expires_in: z$1.union([
|
|
335
|
+
z$1.string(),
|
|
336
|
+
z$1.number(),
|
|
337
|
+
z$1.null()
|
|
338
338
|
]).optional(),
|
|
339
|
-
scope: z.union([
|
|
340
|
-
z.string(),
|
|
341
|
-
z.array(z.string()),
|
|
342
|
-
z.null()
|
|
339
|
+
scope: z$1.union([
|
|
340
|
+
z$1.string(),
|
|
341
|
+
z$1.array(z$1.string()),
|
|
342
|
+
z$1.null()
|
|
343
343
|
]).optional()
|
|
344
|
-
}).catchall(z.unknown());
|
|
345
|
-
const Oauth1InitiatingConnectionDataSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
344
|
+
}).catchall(z$1.unknown());
|
|
345
|
+
const Oauth1InitiatingConnectionDataSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
346
346
|
const Oauth1InitiatedConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
347
|
-
status: z.literal(ConnectionStatuses.INITIATED),
|
|
348
|
-
authUri: z.string(),
|
|
349
|
-
oauth_token: z.string(),
|
|
350
|
-
oauth_token_secret: z.string(),
|
|
351
|
-
redirectUrl: z.string(),
|
|
352
|
-
callbackUrl: z.string().optional()
|
|
353
|
-
}).catchall(z.unknown());
|
|
347
|
+
status: z$1.literal(ConnectionStatuses.INITIATED),
|
|
348
|
+
authUri: z$1.string(),
|
|
349
|
+
oauth_token: z$1.string(),
|
|
350
|
+
oauth_token_secret: z$1.string(),
|
|
351
|
+
redirectUrl: z$1.string(),
|
|
352
|
+
callbackUrl: z$1.string().optional()
|
|
353
|
+
}).catchall(z$1.unknown());
|
|
354
354
|
const Oauth1ActiveConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
355
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
356
|
-
oauth_token: z.string(),
|
|
357
|
-
oauth_token_secret: z.string(),
|
|
358
|
-
consumer_key: z.string().optional(),
|
|
359
|
-
oauth_verifier: z.string().optional(),
|
|
360
|
-
redirectUrl: z.string().optional(),
|
|
361
|
-
callback_url: z.string().optional()
|
|
362
|
-
}).catchall(z.unknown());
|
|
355
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
356
|
+
oauth_token: z$1.string(),
|
|
357
|
+
oauth_token_secret: z$1.string(),
|
|
358
|
+
consumer_key: z$1.string().optional(),
|
|
359
|
+
oauth_verifier: z$1.string().optional(),
|
|
360
|
+
redirectUrl: z$1.string().optional(),
|
|
361
|
+
callback_url: z$1.string().optional()
|
|
362
|
+
}).catchall(z$1.unknown());
|
|
363
363
|
const Oauth1FailedConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
364
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
365
|
-
error: z.string().optional(),
|
|
366
|
-
error_description: z.string().optional()
|
|
367
|
-
}).catchall(z.unknown());
|
|
364
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
365
|
+
error: z$1.string().optional(),
|
|
366
|
+
error_description: z$1.string().optional()
|
|
367
|
+
}).catchall(z$1.unknown());
|
|
368
368
|
const Oauth1ExpiredConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
369
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
370
|
-
expired_at: z.string().optional()
|
|
371
|
-
}).catchall(z.unknown());
|
|
369
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
370
|
+
expired_at: z$1.string().optional()
|
|
371
|
+
}).catchall(z$1.unknown());
|
|
372
372
|
const Oauth1InactiveConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
373
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
374
|
-
oauth_token: z.string(),
|
|
375
|
-
oauth_token_secret: z.string(),
|
|
376
|
-
consumer_key: z.string().optional(),
|
|
377
|
-
oauth_verifier: z.string().optional(),
|
|
378
|
-
redirectUrl: z.string().optional(),
|
|
379
|
-
callback_url: z.string().optional()
|
|
380
|
-
}).catchall(z.unknown());
|
|
381
|
-
const Oauth1ConnectionDataSchema = z.discriminatedUnion("status", [
|
|
373
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
374
|
+
oauth_token: z$1.string(),
|
|
375
|
+
oauth_token_secret: z$1.string(),
|
|
376
|
+
consumer_key: z$1.string().optional(),
|
|
377
|
+
oauth_verifier: z$1.string().optional(),
|
|
378
|
+
redirectUrl: z$1.string().optional(),
|
|
379
|
+
callback_url: z$1.string().optional()
|
|
380
|
+
}).catchall(z$1.unknown());
|
|
381
|
+
const Oauth1ConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
382
382
|
Oauth1InitiatingConnectionDataSchema,
|
|
383
383
|
Oauth1InitiatedConnectionDataSchema,
|
|
384
384
|
Oauth1ActiveConnectionDataSchema,
|
|
@@ -387,461 +387,461 @@ const Oauth1ConnectionDataSchema = z.discriminatedUnion("status", [
|
|
|
387
387
|
Oauth1InactiveConnectionDataSchema
|
|
388
388
|
]);
|
|
389
389
|
const CustomOauth1ConnectionDataSchema = Oauth1ActiveConnectionDataSchema.omit({ status: true });
|
|
390
|
-
const BillcomAuthInitiatingSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
391
|
-
const BillcomAuthConnectionDataSchema = z.discriminatedUnion("status", [
|
|
390
|
+
const BillcomAuthInitiatingSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
391
|
+
const BillcomAuthConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
392
392
|
BillcomAuthInitiatingSchema,
|
|
393
393
|
BillcomAuthInitiatingSchema.extend({
|
|
394
|
-
status: z.literal(ConnectionStatuses.INITIATED),
|
|
395
|
-
redirectUrl: z.string()
|
|
396
|
-
}).catchall(z.unknown()),
|
|
394
|
+
status: z$1.literal(ConnectionStatuses.INITIATED),
|
|
395
|
+
redirectUrl: z$1.string()
|
|
396
|
+
}).catchall(z$1.unknown()),
|
|
397
397
|
BillcomAuthInitiatingSchema.extend({
|
|
398
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
399
|
-
sessionId: z.string(),
|
|
400
|
-
devKey: z.string()
|
|
401
|
-
}).catchall(z.unknown()),
|
|
398
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
399
|
+
sessionId: z$1.string(),
|
|
400
|
+
devKey: z$1.string()
|
|
401
|
+
}).catchall(z$1.unknown()),
|
|
402
402
|
BillcomAuthInitiatingSchema.extend({
|
|
403
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
404
|
-
error: z.string().optional(),
|
|
405
|
-
error_description: z.string().optional()
|
|
406
|
-
}).catchall(z.unknown()),
|
|
403
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
404
|
+
error: z$1.string().optional(),
|
|
405
|
+
error_description: z$1.string().optional()
|
|
406
|
+
}).catchall(z$1.unknown()),
|
|
407
407
|
BillcomAuthInitiatingSchema.extend({
|
|
408
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
409
|
-
expired_at: z.string().optional()
|
|
410
|
-
}).catchall(z.unknown()),
|
|
411
|
-
BillcomAuthInitiatingSchema.extend({ status: z.literal(ConnectionStatuses.INACTIVE) }).catchall(z.unknown())
|
|
408
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
409
|
+
expired_at: z$1.string().optional()
|
|
410
|
+
}).catchall(z$1.unknown()),
|
|
411
|
+
BillcomAuthInitiatingSchema.extend({ status: z$1.literal(ConnectionStatuses.INACTIVE) }).catchall(z$1.unknown())
|
|
412
412
|
]);
|
|
413
|
-
const BasicBaseSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
414
|
-
const BasicConnectionDataSchema = z.discriminatedUnion("status", [
|
|
413
|
+
const BasicBaseSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
414
|
+
const BasicConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
415
415
|
BasicBaseSchema,
|
|
416
|
-
BasicBaseSchema.extend({ status: z.literal(ConnectionStatuses.INITIATED) }).catchall(z.unknown()),
|
|
416
|
+
BasicBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.INITIATED) }).catchall(z$1.unknown()),
|
|
417
417
|
BasicBaseSchema.extend({
|
|
418
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
419
|
-
username: z.string(),
|
|
420
|
-
password: z.string()
|
|
421
|
-
}).catchall(z.unknown()),
|
|
418
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
419
|
+
username: z$1.string(),
|
|
420
|
+
password: z$1.string()
|
|
421
|
+
}).catchall(z$1.unknown()),
|
|
422
422
|
BasicBaseSchema.extend({
|
|
423
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
424
|
-
username: z.string(),
|
|
425
|
-
password: z.string()
|
|
426
|
-
}).catchall(z.unknown()),
|
|
423
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
424
|
+
username: z$1.string(),
|
|
425
|
+
password: z$1.string()
|
|
426
|
+
}).catchall(z$1.unknown()),
|
|
427
427
|
BasicBaseSchema.extend({
|
|
428
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
429
|
-
username: z.string(),
|
|
430
|
-
password: z.string(),
|
|
431
|
-
error: z.string().optional(),
|
|
432
|
-
error_description: z.string().optional()
|
|
433
|
-
}).catchall(z.unknown()),
|
|
428
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
429
|
+
username: z$1.string(),
|
|
430
|
+
password: z$1.string(),
|
|
431
|
+
error: z$1.string().optional(),
|
|
432
|
+
error_description: z$1.string().optional()
|
|
433
|
+
}).catchall(z$1.unknown()),
|
|
434
434
|
BasicBaseSchema.extend({
|
|
435
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
436
|
-
username: z.string(),
|
|
437
|
-
password: z.string(),
|
|
438
|
-
expired_at: z.string().optional()
|
|
439
|
-
}).catchall(z.unknown())
|
|
435
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
436
|
+
username: z$1.string(),
|
|
437
|
+
password: z$1.string(),
|
|
438
|
+
expired_at: z$1.string().optional()
|
|
439
|
+
}).catchall(z$1.unknown())
|
|
440
440
|
]);
|
|
441
441
|
const CustomBasicConnectionDataSchema = BaseSchemeRaw.extend({
|
|
442
|
-
username: z.string(),
|
|
443
|
-
password: z.string()
|
|
444
|
-
}).catchall(z.unknown());
|
|
445
|
-
const ApiKeyBaseSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
446
|
-
const ApiKeyConnectionDataSchema = z.discriminatedUnion("status", [
|
|
442
|
+
username: z$1.string(),
|
|
443
|
+
password: z$1.string()
|
|
444
|
+
}).catchall(z$1.unknown());
|
|
445
|
+
const ApiKeyBaseSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
446
|
+
const ApiKeyConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
447
447
|
ApiKeyBaseSchema,
|
|
448
|
-
ApiKeyBaseSchema.extend({ status: z.literal(ConnectionStatuses.INITIATED) }).catchall(z.unknown()),
|
|
448
|
+
ApiKeyBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.INITIATED) }).catchall(z$1.unknown()),
|
|
449
449
|
ApiKeyBaseSchema.extend({
|
|
450
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
451
|
-
api_key: z.string().optional(),
|
|
452
|
-
generic_api_key: z.string().optional()
|
|
453
|
-
}).catchall(z.unknown()),
|
|
450
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
451
|
+
api_key: z$1.string().optional(),
|
|
452
|
+
generic_api_key: z$1.string().optional()
|
|
453
|
+
}).catchall(z$1.unknown()),
|
|
454
454
|
ApiKeyBaseSchema.extend({
|
|
455
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
456
|
-
api_key: z.string().optional(),
|
|
457
|
-
generic_api_key: z.string().optional()
|
|
458
|
-
}).catchall(z.unknown()),
|
|
455
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
456
|
+
api_key: z$1.string().optional(),
|
|
457
|
+
generic_api_key: z$1.string().optional()
|
|
458
|
+
}).catchall(z$1.unknown()),
|
|
459
459
|
ApiKeyBaseSchema.extend({
|
|
460
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
461
|
-
error: z.string().optional(),
|
|
462
|
-
error_description: z.string().optional()
|
|
463
|
-
}).catchall(z.unknown()),
|
|
460
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
461
|
+
error: z$1.string().optional(),
|
|
462
|
+
error_description: z$1.string().optional()
|
|
463
|
+
}).catchall(z$1.unknown()),
|
|
464
464
|
ApiKeyBaseSchema.extend({
|
|
465
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
466
|
-
expired_at: z.string().optional()
|
|
467
|
-
}).catchall(z.unknown())
|
|
465
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
466
|
+
expired_at: z$1.string().optional()
|
|
467
|
+
}).catchall(z$1.unknown())
|
|
468
468
|
]);
|
|
469
469
|
const CustomApiKeyConnectionDataSchema = BaseSchemeRaw.extend({
|
|
470
|
-
api_key: z.string().optional(),
|
|
471
|
-
generic_api_key: z.string().optional()
|
|
472
|
-
}).catchall(z.unknown());
|
|
473
|
-
const BearerTokenBaseSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
474
|
-
const BearerTokenConnectionDataSchema = z.discriminatedUnion("status", [
|
|
470
|
+
api_key: z$1.string().optional(),
|
|
471
|
+
generic_api_key: z$1.string().optional()
|
|
472
|
+
}).catchall(z$1.unknown());
|
|
473
|
+
const BearerTokenBaseSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
474
|
+
const BearerTokenConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
475
475
|
BearerTokenBaseSchema,
|
|
476
|
-
BearerTokenBaseSchema.extend({ status: z.literal(ConnectionStatuses.INITIATED) }).catchall(z.unknown()),
|
|
476
|
+
BearerTokenBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.INITIATED) }).catchall(z$1.unknown()),
|
|
477
477
|
BearerTokenBaseSchema.extend({
|
|
478
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
479
|
-
token: z.string()
|
|
480
|
-
}).catchall(z.unknown()),
|
|
478
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
479
|
+
token: z$1.string()
|
|
480
|
+
}).catchall(z$1.unknown()),
|
|
481
481
|
BearerTokenBaseSchema.extend({
|
|
482
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
483
|
-
token: z.string()
|
|
484
|
-
}).catchall(z.unknown()),
|
|
482
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
483
|
+
token: z$1.string()
|
|
484
|
+
}).catchall(z$1.unknown()),
|
|
485
485
|
BearerTokenBaseSchema.extend({
|
|
486
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
487
|
-
error: z.string().optional(),
|
|
488
|
-
error_description: z.string().optional()
|
|
489
|
-
}).catchall(z.unknown()),
|
|
486
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
487
|
+
error: z$1.string().optional(),
|
|
488
|
+
error_description: z$1.string().optional()
|
|
489
|
+
}).catchall(z$1.unknown()),
|
|
490
490
|
BearerTokenBaseSchema.extend({
|
|
491
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
492
|
-
expired_at: z.string().optional()
|
|
493
|
-
}).catchall(z.unknown())
|
|
491
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
492
|
+
expired_at: z$1.string().optional()
|
|
493
|
+
}).catchall(z$1.unknown())
|
|
494
494
|
]);
|
|
495
|
-
const CustomBearerTokenConnectionDataSchema = BaseSchemeRaw.extend({ token: z.string() }).catchall(z.unknown());
|
|
496
|
-
const GoogleServiceAccountBaseSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
497
|
-
const GoogleServiceAccountConnectionDataSchema = z.discriminatedUnion("status", [
|
|
495
|
+
const CustomBearerTokenConnectionDataSchema = BaseSchemeRaw.extend({ token: z$1.string() }).catchall(z$1.unknown());
|
|
496
|
+
const GoogleServiceAccountBaseSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
497
|
+
const GoogleServiceAccountConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
498
498
|
GoogleServiceAccountBaseSchema,
|
|
499
499
|
GoogleServiceAccountBaseSchema.extend({
|
|
500
|
-
status: z.literal(ConnectionStatuses.INITIATED),
|
|
501
|
-
redirectUrl: z.string(),
|
|
502
|
-
composio_link_redirect_url: z.string().optional()
|
|
503
|
-
}).catchall(z.unknown()),
|
|
500
|
+
status: z$1.literal(ConnectionStatuses.INITIATED),
|
|
501
|
+
redirectUrl: z$1.string(),
|
|
502
|
+
composio_link_redirect_url: z$1.string().optional()
|
|
503
|
+
}).catchall(z$1.unknown()),
|
|
504
504
|
GoogleServiceAccountBaseSchema.extend({
|
|
505
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
506
|
-
credentials_json: z.string()
|
|
507
|
-
}).catchall(z.unknown()),
|
|
505
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
506
|
+
credentials_json: z$1.string()
|
|
507
|
+
}).catchall(z$1.unknown()),
|
|
508
508
|
GoogleServiceAccountBaseSchema.extend({
|
|
509
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
510
|
-
credentials_json: z.string()
|
|
511
|
-
}).catchall(z.unknown()),
|
|
509
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
510
|
+
credentials_json: z$1.string()
|
|
511
|
+
}).catchall(z$1.unknown()),
|
|
512
512
|
GoogleServiceAccountBaseSchema.extend({
|
|
513
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
514
|
-
error: z.string().optional(),
|
|
515
|
-
error_description: z.string().optional()
|
|
516
|
-
}).catchall(z.unknown()),
|
|
513
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
514
|
+
error: z$1.string().optional(),
|
|
515
|
+
error_description: z$1.string().optional()
|
|
516
|
+
}).catchall(z$1.unknown()),
|
|
517
517
|
GoogleServiceAccountBaseSchema.extend({
|
|
518
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
519
|
-
expired_at: z.string().optional()
|
|
520
|
-
}).catchall(z.unknown())
|
|
518
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
519
|
+
expired_at: z$1.string().optional()
|
|
520
|
+
}).catchall(z$1.unknown())
|
|
521
521
|
]);
|
|
522
|
-
const NoAuthBaseSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
523
|
-
const NoAuthConnectionDataSchema = z.discriminatedUnion("status", [
|
|
522
|
+
const NoAuthBaseSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
523
|
+
const NoAuthConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
524
524
|
NoAuthBaseSchema,
|
|
525
|
-
NoAuthBaseSchema.extend({ status: z.literal(ConnectionStatuses.INITIATED) }).catchall(z.unknown()),
|
|
526
|
-
NoAuthBaseSchema.extend({ status: z.literal(ConnectionStatuses.ACTIVE) }).catchall(z.unknown()),
|
|
527
|
-
NoAuthBaseSchema.extend({ status: z.literal(ConnectionStatuses.INACTIVE) }).catchall(z.unknown()),
|
|
525
|
+
NoAuthBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.INITIATED) }).catchall(z$1.unknown()),
|
|
526
|
+
NoAuthBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.ACTIVE) }).catchall(z$1.unknown()),
|
|
527
|
+
NoAuthBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.INACTIVE) }).catchall(z$1.unknown()),
|
|
528
528
|
NoAuthBaseSchema.extend({
|
|
529
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
530
|
-
error: z.string().optional(),
|
|
531
|
-
error_description: z.string().optional()
|
|
532
|
-
}).catchall(z.unknown()),
|
|
529
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
530
|
+
error: z$1.string().optional(),
|
|
531
|
+
error_description: z$1.string().optional()
|
|
532
|
+
}).catchall(z$1.unknown()),
|
|
533
533
|
NoAuthBaseSchema.extend({
|
|
534
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
535
|
-
expired_at: z.string().optional()
|
|
536
|
-
}).catchall(z.unknown())
|
|
534
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
535
|
+
expired_at: z$1.string().optional()
|
|
536
|
+
}).catchall(z$1.unknown())
|
|
537
537
|
]);
|
|
538
|
-
const CustomNoAuthConnectionDataSchema = BaseSchemeRaw.catchall(z.unknown());
|
|
539
|
-
const CalcomAuthBaseSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
540
|
-
const CalcomAuthConnectionDataSchema = z.discriminatedUnion("status", [
|
|
538
|
+
const CustomNoAuthConnectionDataSchema = BaseSchemeRaw.catchall(z$1.unknown());
|
|
539
|
+
const CalcomAuthBaseSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
540
|
+
const CalcomAuthConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
541
541
|
CalcomAuthBaseSchema,
|
|
542
|
-
CalcomAuthBaseSchema.extend({ status: z.literal(ConnectionStatuses.INITIATED) }).catchall(z.unknown()),
|
|
543
|
-
CalcomAuthBaseSchema.extend({ status: z.literal(ConnectionStatuses.ACTIVE) }).catchall(z.unknown()),
|
|
544
|
-
CalcomAuthBaseSchema.extend({ status: z.literal(ConnectionStatuses.INACTIVE) }).catchall(z.unknown()),
|
|
542
|
+
CalcomAuthBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.INITIATED) }).catchall(z$1.unknown()),
|
|
543
|
+
CalcomAuthBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.ACTIVE) }).catchall(z$1.unknown()),
|
|
544
|
+
CalcomAuthBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.INACTIVE) }).catchall(z$1.unknown()),
|
|
545
545
|
CalcomAuthBaseSchema.extend({
|
|
546
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
547
|
-
error: z.string().optional(),
|
|
548
|
-
error_description: z.string().optional()
|
|
549
|
-
}).catchall(z.unknown()),
|
|
546
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
547
|
+
error: z$1.string().optional(),
|
|
548
|
+
error_description: z$1.string().optional()
|
|
549
|
+
}).catchall(z$1.unknown()),
|
|
550
550
|
CalcomAuthBaseSchema.extend({
|
|
551
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
552
|
-
expired_at: z.string().optional()
|
|
553
|
-
}).catchall(z.unknown())
|
|
551
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
552
|
+
expired_at: z$1.string().optional()
|
|
553
|
+
}).catchall(z$1.unknown())
|
|
554
554
|
]);
|
|
555
|
-
const BasicWithJwtBaseSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
556
|
-
const BasicWithJwtConnectionDataSchema = z.discriminatedUnion("status", [
|
|
555
|
+
const BasicWithJwtBaseSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
556
|
+
const BasicWithJwtConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
557
557
|
BasicWithJwtBaseSchema,
|
|
558
|
-
BasicWithJwtBaseSchema.extend({ status: z.literal(ConnectionStatuses.INITIATED) }).catchall(z.unknown()),
|
|
558
|
+
BasicWithJwtBaseSchema.extend({ status: z$1.literal(ConnectionStatuses.INITIATED) }).catchall(z$1.unknown()),
|
|
559
559
|
BasicWithJwtBaseSchema.extend({
|
|
560
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
561
|
-
username: z.string(),
|
|
562
|
-
password: z.string()
|
|
563
|
-
}).catchall(z.unknown()),
|
|
560
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
561
|
+
username: z$1.string(),
|
|
562
|
+
password: z$1.string()
|
|
563
|
+
}).catchall(z$1.unknown()),
|
|
564
564
|
BasicWithJwtBaseSchema.extend({
|
|
565
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
566
|
-
username: z.string(),
|
|
567
|
-
password: z.string()
|
|
568
|
-
}).catchall(z.unknown()),
|
|
565
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
566
|
+
username: z$1.string(),
|
|
567
|
+
password: z$1.string()
|
|
568
|
+
}).catchall(z$1.unknown()),
|
|
569
569
|
BasicWithJwtBaseSchema.extend({
|
|
570
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
571
|
-
username: z.string(),
|
|
572
|
-
password: z.string(),
|
|
573
|
-
error: z.string().optional(),
|
|
574
|
-
error_description: z.string().optional()
|
|
575
|
-
}).catchall(z.unknown()),
|
|
570
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
571
|
+
username: z$1.string(),
|
|
572
|
+
password: z$1.string(),
|
|
573
|
+
error: z$1.string().optional(),
|
|
574
|
+
error_description: z$1.string().optional()
|
|
575
|
+
}).catchall(z$1.unknown()),
|
|
576
576
|
BasicWithJwtBaseSchema.extend({
|
|
577
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
578
|
-
username: z.string(),
|
|
579
|
-
password: z.string(),
|
|
580
|
-
expired_at: z.string().optional()
|
|
581
|
-
}).catchall(z.unknown())
|
|
577
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
578
|
+
username: z$1.string(),
|
|
579
|
+
password: z$1.string(),
|
|
580
|
+
expired_at: z$1.string().optional()
|
|
581
|
+
}).catchall(z$1.unknown())
|
|
582
582
|
]);
|
|
583
583
|
const CustomBasicWithJwtConnectionDataSchema = BaseSchemeRaw.extend({
|
|
584
|
-
username: z.string(),
|
|
585
|
-
password: z.string()
|
|
586
|
-
}).catchall(z.unknown());
|
|
587
|
-
const ServiceAccountInitiatingSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
588
|
-
const ServiceAccountConnectionDataSchema = z.discriminatedUnion("status", [
|
|
584
|
+
username: z$1.string(),
|
|
585
|
+
password: z$1.string()
|
|
586
|
+
}).catchall(z$1.unknown());
|
|
587
|
+
const ServiceAccountInitiatingSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
588
|
+
const ServiceAccountConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
589
589
|
ServiceAccountInitiatingSchema,
|
|
590
|
-
ServiceAccountInitiatingSchema.extend({ status: z.literal(ConnectionStatuses.INITIATED) }).catchall(z.unknown()),
|
|
590
|
+
ServiceAccountInitiatingSchema.extend({ status: z$1.literal(ConnectionStatuses.INITIATED) }).catchall(z$1.unknown()),
|
|
591
591
|
ServiceAccountInitiatingSchema.extend({
|
|
592
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
593
|
-
application_id: z.string(),
|
|
594
|
-
installation_id: z.string(),
|
|
595
|
-
private_key: z.string()
|
|
596
|
-
}).catchall(z.unknown()),
|
|
592
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
593
|
+
application_id: z$1.string(),
|
|
594
|
+
installation_id: z$1.string(),
|
|
595
|
+
private_key: z$1.string()
|
|
596
|
+
}).catchall(z$1.unknown()),
|
|
597
597
|
ServiceAccountInitiatingSchema.extend({
|
|
598
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
599
|
-
application_id: z.string(),
|
|
600
|
-
installation_id: z.string(),
|
|
601
|
-
private_key: z.string()
|
|
602
|
-
}).catchall(z.unknown())
|
|
598
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
599
|
+
application_id: z$1.string(),
|
|
600
|
+
installation_id: z$1.string(),
|
|
601
|
+
private_key: z$1.string()
|
|
602
|
+
}).catchall(z$1.unknown())
|
|
603
603
|
]);
|
|
604
|
-
const CustomServiceAccountConnectionDataSchema = z.object({
|
|
605
|
-
application_id: z.string(),
|
|
606
|
-
installation_id: z.string(),
|
|
607
|
-
private_key: z.string()
|
|
608
|
-
}).merge(BaseSchemeRaw).catchall(z.unknown());
|
|
609
|
-
const SamlInitiatingSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
610
|
-
const SamlConnectionDataSchema = z.discriminatedUnion("status", [
|
|
604
|
+
const CustomServiceAccountConnectionDataSchema = z$1.object({
|
|
605
|
+
application_id: z$1.string(),
|
|
606
|
+
installation_id: z$1.string(),
|
|
607
|
+
private_key: z$1.string()
|
|
608
|
+
}).merge(BaseSchemeRaw).catchall(z$1.unknown());
|
|
609
|
+
const SamlInitiatingSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
610
|
+
const SamlConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
611
611
|
SamlInitiatingSchema,
|
|
612
|
-
SamlInitiatingSchema.extend({ status: z.literal(ConnectionStatuses.INITIATED) }).catchall(z.unknown()),
|
|
613
|
-
SamlInitiatingSchema.extend({ status: z.literal(ConnectionStatuses.ACTIVE) }).catchall(z.unknown()),
|
|
614
|
-
SamlInitiatingSchema.extend({ status: z.literal(ConnectionStatuses.INACTIVE) }).catchall(z.unknown()),
|
|
612
|
+
SamlInitiatingSchema.extend({ status: z$1.literal(ConnectionStatuses.INITIATED) }).catchall(z$1.unknown()),
|
|
613
|
+
SamlInitiatingSchema.extend({ status: z$1.literal(ConnectionStatuses.ACTIVE) }).catchall(z$1.unknown()),
|
|
614
|
+
SamlInitiatingSchema.extend({ status: z$1.literal(ConnectionStatuses.INACTIVE) }).catchall(z$1.unknown()),
|
|
615
615
|
SamlInitiatingSchema.extend({
|
|
616
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
617
|
-
error: z.string().optional(),
|
|
618
|
-
error_description: z.string().optional()
|
|
619
|
-
}).catchall(z.unknown()),
|
|
616
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
617
|
+
error: z$1.string().optional(),
|
|
618
|
+
error_description: z$1.string().optional()
|
|
619
|
+
}).catchall(z$1.unknown()),
|
|
620
620
|
SamlInitiatingSchema.extend({
|
|
621
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
622
|
-
expired_at: z.string().optional()
|
|
623
|
-
}).catchall(z.unknown())
|
|
621
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
622
|
+
expired_at: z$1.string().optional()
|
|
623
|
+
}).catchall(z$1.unknown())
|
|
624
624
|
]);
|
|
625
|
-
BaseSchemeRaw.catchall(z.unknown());
|
|
626
|
-
const DcrOauthInitiatingSchema = BaseSchemeRaw.extend({ status: z.literal(ConnectionStatuses.INITIALIZING) }).catchall(z.unknown());
|
|
627
|
-
const DcrOauthConnectionDataSchema = z.discriminatedUnion("status", [
|
|
625
|
+
BaseSchemeRaw.catchall(z$1.unknown());
|
|
626
|
+
const DcrOauthInitiatingSchema = BaseSchemeRaw.extend({ status: z$1.literal(ConnectionStatuses.INITIALIZING) }).catchall(z$1.unknown());
|
|
627
|
+
const DcrOauthConnectionDataSchema = z$1.discriminatedUnion("status", [
|
|
628
628
|
DcrOauthInitiatingSchema,
|
|
629
629
|
DcrOauthInitiatingSchema.extend({
|
|
630
|
-
status: z.literal(ConnectionStatuses.INITIATED),
|
|
631
|
-
client_id: z.string(),
|
|
632
|
-
redirectUrl: z.string(),
|
|
633
|
-
client_secret: z.string().optional(),
|
|
634
|
-
callback_url: z.string().optional(),
|
|
635
|
-
client_id_issued_at: z.number().optional(),
|
|
636
|
-
client_secret_expires_at: z.number().optional(),
|
|
637
|
-
code_verifier: z.string().optional(),
|
|
638
|
-
finalRedirectUri: z.string().optional()
|
|
639
|
-
}).catchall(z.unknown()),
|
|
630
|
+
status: z$1.literal(ConnectionStatuses.INITIATED),
|
|
631
|
+
client_id: z$1.string(),
|
|
632
|
+
redirectUrl: z$1.string(),
|
|
633
|
+
client_secret: z$1.string().optional(),
|
|
634
|
+
callback_url: z$1.string().optional(),
|
|
635
|
+
client_id_issued_at: z$1.number().optional(),
|
|
636
|
+
client_secret_expires_at: z$1.number().optional(),
|
|
637
|
+
code_verifier: z$1.string().optional(),
|
|
638
|
+
finalRedirectUri: z$1.string().optional()
|
|
639
|
+
}).catchall(z$1.unknown()),
|
|
640
640
|
DcrOauthInitiatingSchema.extend({
|
|
641
|
-
status: z.literal(ConnectionStatuses.ACTIVE),
|
|
642
|
-
access_token: z.string(),
|
|
643
|
-
client_id: z.string(),
|
|
644
|
-
token_type: z.string().optional(),
|
|
645
|
-
refresh_token: z.string().nullish(),
|
|
646
|
-
expires_in: z.union([
|
|
647
|
-
z.string(),
|
|
648
|
-
z.number(),
|
|
649
|
-
z.null()
|
|
641
|
+
status: z$1.literal(ConnectionStatuses.ACTIVE),
|
|
642
|
+
access_token: z$1.string(),
|
|
643
|
+
client_id: z$1.string(),
|
|
644
|
+
token_type: z$1.string().optional(),
|
|
645
|
+
refresh_token: z$1.string().nullish(),
|
|
646
|
+
expires_in: z$1.union([
|
|
647
|
+
z$1.string(),
|
|
648
|
+
z$1.number(),
|
|
649
|
+
z$1.null()
|
|
650
650
|
]).optional(),
|
|
651
|
-
scope: z.union([
|
|
652
|
-
z.string(),
|
|
653
|
-
z.array(z.string()),
|
|
654
|
-
z.null()
|
|
651
|
+
scope: z$1.union([
|
|
652
|
+
z$1.string(),
|
|
653
|
+
z$1.array(z$1.string()),
|
|
654
|
+
z$1.null()
|
|
655
655
|
]).optional(),
|
|
656
|
-
id_token: z.string().optional(),
|
|
657
|
-
client_secret: z.string().optional(),
|
|
658
|
-
client_id_issued_at: z.number().optional(),
|
|
659
|
-
client_secret_expires_at: z.number().optional()
|
|
660
|
-
}).catchall(z.unknown()),
|
|
656
|
+
id_token: z$1.string().optional(),
|
|
657
|
+
client_secret: z$1.string().optional(),
|
|
658
|
+
client_id_issued_at: z$1.number().optional(),
|
|
659
|
+
client_secret_expires_at: z$1.number().optional()
|
|
660
|
+
}).catchall(z$1.unknown()),
|
|
661
661
|
DcrOauthInitiatingSchema.extend({
|
|
662
|
-
status: z.literal(ConnectionStatuses.INACTIVE),
|
|
663
|
-
access_token: z.string(),
|
|
664
|
-
client_id: z.string(),
|
|
665
|
-
token_type: z.string().optional(),
|
|
666
|
-
refresh_token: z.string().nullish(),
|
|
667
|
-
expires_in: z.union([
|
|
668
|
-
z.string(),
|
|
669
|
-
z.number(),
|
|
670
|
-
z.null()
|
|
662
|
+
status: z$1.literal(ConnectionStatuses.INACTIVE),
|
|
663
|
+
access_token: z$1.string(),
|
|
664
|
+
client_id: z$1.string(),
|
|
665
|
+
token_type: z$1.string().optional(),
|
|
666
|
+
refresh_token: z$1.string().nullish(),
|
|
667
|
+
expires_in: z$1.union([
|
|
668
|
+
z$1.string(),
|
|
669
|
+
z$1.number(),
|
|
670
|
+
z$1.null()
|
|
671
671
|
]).optional(),
|
|
672
|
-
scope: z.union([
|
|
673
|
-
z.string(),
|
|
674
|
-
z.array(z.string()),
|
|
675
|
-
z.null()
|
|
672
|
+
scope: z$1.union([
|
|
673
|
+
z$1.string(),
|
|
674
|
+
z$1.array(z$1.string()),
|
|
675
|
+
z$1.null()
|
|
676
676
|
]).optional(),
|
|
677
|
-
id_token: z.string().optional(),
|
|
678
|
-
client_secret: z.string().optional(),
|
|
679
|
-
client_id_issued_at: z.number().optional(),
|
|
680
|
-
client_secret_expires_at: z.number().optional()
|
|
681
|
-
}).catchall(z.unknown()),
|
|
677
|
+
id_token: z$1.string().optional(),
|
|
678
|
+
client_secret: z$1.string().optional(),
|
|
679
|
+
client_id_issued_at: z$1.number().optional(),
|
|
680
|
+
client_secret_expires_at: z$1.number().optional()
|
|
681
|
+
}).catchall(z$1.unknown()),
|
|
682
682
|
DcrOauthInitiatingSchema.extend({
|
|
683
|
-
status: z.literal(ConnectionStatuses.FAILED),
|
|
684
|
-
error: z.string().optional(),
|
|
685
|
-
error_description: z.string().optional()
|
|
686
|
-
}).catchall(z.unknown()),
|
|
683
|
+
status: z$1.literal(ConnectionStatuses.FAILED),
|
|
684
|
+
error: z$1.string().optional(),
|
|
685
|
+
error_description: z$1.string().optional()
|
|
686
|
+
}).catchall(z$1.unknown()),
|
|
687
687
|
DcrOauthInitiatingSchema.extend({
|
|
688
|
-
status: z.literal(ConnectionStatuses.EXPIRED),
|
|
689
|
-
expired_at: z.string().optional()
|
|
690
|
-
}).catchall(z.unknown())
|
|
688
|
+
status: z$1.literal(ConnectionStatuses.EXPIRED),
|
|
689
|
+
expired_at: z$1.string().optional()
|
|
690
|
+
}).catchall(z$1.unknown())
|
|
691
691
|
]);
|
|
692
|
-
const CustomDcrOauthConnectionDataSchema = z.object({
|
|
693
|
-
access_token: z.string(),
|
|
694
|
-
client_id: z.string()
|
|
695
|
-
}).merge(BaseSchemeRaw).catchall(z.unknown());
|
|
696
|
-
const ConnectionDataSchema = z.discriminatedUnion("authScheme", [
|
|
697
|
-
z.object({
|
|
698
|
-
authScheme: z.literal(AuthSchemeTypes.OAUTH1),
|
|
692
|
+
const CustomDcrOauthConnectionDataSchema = z$1.object({
|
|
693
|
+
access_token: z$1.string(),
|
|
694
|
+
client_id: z$1.string()
|
|
695
|
+
}).merge(BaseSchemeRaw).catchall(z$1.unknown());
|
|
696
|
+
const ConnectionDataSchema = z$1.discriminatedUnion("authScheme", [
|
|
697
|
+
z$1.object({
|
|
698
|
+
authScheme: z$1.literal(AuthSchemeTypes.OAUTH1),
|
|
699
699
|
/**
|
|
700
700
|
* the main connection data discriminated by auth scheme
|
|
701
701
|
*/
|
|
702
702
|
val: Oauth1ConnectionDataSchema
|
|
703
703
|
}),
|
|
704
|
-
z.object({
|
|
705
|
-
authScheme: z.literal(AuthSchemeTypes.OAUTH2),
|
|
704
|
+
z$1.object({
|
|
705
|
+
authScheme: z$1.literal(AuthSchemeTypes.OAUTH2),
|
|
706
706
|
/**
|
|
707
707
|
* the main connection data discriminated by auth scheme
|
|
708
708
|
*/
|
|
709
709
|
val: Oauth2ConnectionDataSchema
|
|
710
710
|
}),
|
|
711
|
-
z.object({
|
|
712
|
-
authScheme: z.literal(AuthSchemeTypes.S2S_OAUTH2),
|
|
711
|
+
z$1.object({
|
|
712
|
+
authScheme: z$1.literal(AuthSchemeTypes.S2S_OAUTH2),
|
|
713
713
|
/**
|
|
714
714
|
* the main connection data discriminated by auth scheme
|
|
715
715
|
*/
|
|
716
716
|
val: S2SOauth2ConnectionDataSchema
|
|
717
717
|
}),
|
|
718
|
-
z.object({
|
|
719
|
-
authScheme: z.literal(AuthSchemeTypes.API_KEY),
|
|
718
|
+
z$1.object({
|
|
719
|
+
authScheme: z$1.literal(AuthSchemeTypes.API_KEY),
|
|
720
720
|
/**
|
|
721
721
|
* the main connection data discriminated by auth scheme
|
|
722
722
|
*/
|
|
723
723
|
val: ApiKeyConnectionDataSchema
|
|
724
724
|
}),
|
|
725
|
-
z.object({
|
|
726
|
-
authScheme: z.literal(AuthSchemeTypes.BASIC),
|
|
725
|
+
z$1.object({
|
|
726
|
+
authScheme: z$1.literal(AuthSchemeTypes.BASIC),
|
|
727
727
|
/**
|
|
728
728
|
* the main connection data discriminated by auth scheme
|
|
729
729
|
*/
|
|
730
730
|
val: BasicConnectionDataSchema
|
|
731
731
|
}),
|
|
732
|
-
z.object({
|
|
733
|
-
authScheme: z.literal(AuthSchemeTypes.BEARER_TOKEN),
|
|
732
|
+
z$1.object({
|
|
733
|
+
authScheme: z$1.literal(AuthSchemeTypes.BEARER_TOKEN),
|
|
734
734
|
/**
|
|
735
735
|
* the main connection data discriminated by auth scheme
|
|
736
736
|
*/
|
|
737
737
|
val: BearerTokenConnectionDataSchema
|
|
738
738
|
}),
|
|
739
|
-
z.object({
|
|
740
|
-
authScheme: z.literal(AuthSchemeTypes.GOOGLE_SERVICE_ACCOUNT),
|
|
739
|
+
z$1.object({
|
|
740
|
+
authScheme: z$1.literal(AuthSchemeTypes.GOOGLE_SERVICE_ACCOUNT),
|
|
741
741
|
/**
|
|
742
742
|
* the main connection data discriminated by auth scheme
|
|
743
743
|
*/
|
|
744
744
|
val: GoogleServiceAccountConnectionDataSchema
|
|
745
745
|
}),
|
|
746
|
-
z.object({
|
|
747
|
-
authScheme: z.literal(AuthSchemeTypes.NO_AUTH),
|
|
746
|
+
z$1.object({
|
|
747
|
+
authScheme: z$1.literal(AuthSchemeTypes.NO_AUTH),
|
|
748
748
|
/**
|
|
749
749
|
* the main connection data discriminated by auth scheme
|
|
750
750
|
*/
|
|
751
751
|
val: NoAuthConnectionDataSchema
|
|
752
752
|
}),
|
|
753
|
-
z.object({
|
|
754
|
-
authScheme: z.literal(AuthSchemeTypes.CALCOM_AUTH),
|
|
753
|
+
z$1.object({
|
|
754
|
+
authScheme: z$1.literal(AuthSchemeTypes.CALCOM_AUTH),
|
|
755
755
|
/**
|
|
756
756
|
* the main connection data discriminated by auth scheme
|
|
757
757
|
*/
|
|
758
758
|
val: CalcomAuthConnectionDataSchema
|
|
759
759
|
}),
|
|
760
|
-
z.object({
|
|
761
|
-
authScheme: z.literal(AuthSchemeTypes.BILLCOM_AUTH),
|
|
760
|
+
z$1.object({
|
|
761
|
+
authScheme: z$1.literal(AuthSchemeTypes.BILLCOM_AUTH),
|
|
762
762
|
/**
|
|
763
763
|
* the main connection data discriminated by auth scheme
|
|
764
764
|
*/
|
|
765
765
|
val: BillcomAuthConnectionDataSchema
|
|
766
766
|
}),
|
|
767
|
-
z.object({
|
|
768
|
-
authScheme: z.literal(AuthSchemeTypes.BASIC_WITH_JWT),
|
|
767
|
+
z$1.object({
|
|
768
|
+
authScheme: z$1.literal(AuthSchemeTypes.BASIC_WITH_JWT),
|
|
769
769
|
/**
|
|
770
770
|
* the main connection data discriminated by auth scheme
|
|
771
771
|
*/
|
|
772
772
|
val: BasicWithJwtConnectionDataSchema
|
|
773
773
|
}),
|
|
774
|
-
z.object({
|
|
775
|
-
authScheme: z.literal(AuthSchemeTypes.SERVICE_ACCOUNT),
|
|
774
|
+
z$1.object({
|
|
775
|
+
authScheme: z$1.literal(AuthSchemeTypes.SERVICE_ACCOUNT),
|
|
776
776
|
/**
|
|
777
777
|
* the main connection data discriminated by auth scheme
|
|
778
778
|
*/
|
|
779
779
|
val: ServiceAccountConnectionDataSchema
|
|
780
780
|
}),
|
|
781
|
-
z.object({
|
|
782
|
-
authScheme: z.literal(AuthSchemeTypes.SAML),
|
|
781
|
+
z$1.object({
|
|
782
|
+
authScheme: z$1.literal(AuthSchemeTypes.SAML),
|
|
783
783
|
/**
|
|
784
784
|
* the main connection data discriminated by auth scheme
|
|
785
785
|
*/
|
|
786
786
|
val: SamlConnectionDataSchema
|
|
787
787
|
}),
|
|
788
|
-
z.object({
|
|
789
|
-
authScheme: z.literal(AuthSchemeTypes.DCR_OAUTH),
|
|
788
|
+
z$1.object({
|
|
789
|
+
authScheme: z$1.literal(AuthSchemeTypes.DCR_OAUTH),
|
|
790
790
|
/**
|
|
791
791
|
* the main connection data discriminated by auth scheme
|
|
792
792
|
*/
|
|
793
793
|
val: DcrOauthConnectionDataSchema
|
|
794
794
|
})
|
|
795
795
|
]);
|
|
796
|
-
const CustomConnectionDataSchema = z.discriminatedUnion("authScheme", [
|
|
797
|
-
z.object({
|
|
798
|
-
authScheme: z.literal(AuthSchemeTypes.OAUTH2),
|
|
799
|
-
toolkitSlug: z.string(),
|
|
796
|
+
const CustomConnectionDataSchema = z$1.discriminatedUnion("authScheme", [
|
|
797
|
+
z$1.object({
|
|
798
|
+
authScheme: z$1.literal(AuthSchemeTypes.OAUTH2),
|
|
799
|
+
toolkitSlug: z$1.string(),
|
|
800
800
|
val: CustomOauth2ConnectionDataSchema
|
|
801
801
|
}),
|
|
802
|
-
z.object({
|
|
803
|
-
authScheme: z.literal(AuthSchemeTypes.S2S_OAUTH2),
|
|
804
|
-
toolkitSlug: z.string(),
|
|
802
|
+
z$1.object({
|
|
803
|
+
authScheme: z$1.literal(AuthSchemeTypes.S2S_OAUTH2),
|
|
804
|
+
toolkitSlug: z$1.string(),
|
|
805
805
|
val: CustomS2SOauth2ConnectionDataSchema
|
|
806
806
|
}),
|
|
807
|
-
z.object({
|
|
808
|
-
authScheme: z.literal(AuthSchemeTypes.DCR_OAUTH),
|
|
809
|
-
toolkitSlug: z.string(),
|
|
807
|
+
z$1.object({
|
|
808
|
+
authScheme: z$1.literal(AuthSchemeTypes.DCR_OAUTH),
|
|
809
|
+
toolkitSlug: z$1.string(),
|
|
810
810
|
val: CustomDcrOauthConnectionDataSchema
|
|
811
811
|
}),
|
|
812
|
-
z.object({
|
|
813
|
-
authScheme: z.literal(AuthSchemeTypes.API_KEY),
|
|
814
|
-
toolkitSlug: z.string(),
|
|
812
|
+
z$1.object({
|
|
813
|
+
authScheme: z$1.literal(AuthSchemeTypes.API_KEY),
|
|
814
|
+
toolkitSlug: z$1.string(),
|
|
815
815
|
val: CustomApiKeyConnectionDataSchema
|
|
816
816
|
}),
|
|
817
|
-
z.object({
|
|
818
|
-
authScheme: z.literal(AuthSchemeTypes.BASIC_WITH_JWT),
|
|
819
|
-
toolkitSlug: z.string(),
|
|
817
|
+
z$1.object({
|
|
818
|
+
authScheme: z$1.literal(AuthSchemeTypes.BASIC_WITH_JWT),
|
|
819
|
+
toolkitSlug: z$1.string(),
|
|
820
820
|
val: CustomBasicWithJwtConnectionDataSchema
|
|
821
821
|
}),
|
|
822
|
-
z.object({
|
|
823
|
-
authScheme: z.literal(AuthSchemeTypes.BASIC),
|
|
824
|
-
toolkitSlug: z.string(),
|
|
822
|
+
z$1.object({
|
|
823
|
+
authScheme: z$1.literal(AuthSchemeTypes.BASIC),
|
|
824
|
+
toolkitSlug: z$1.string(),
|
|
825
825
|
val: CustomBasicConnectionDataSchema
|
|
826
826
|
}),
|
|
827
|
-
z.object({
|
|
828
|
-
authScheme: z.literal(AuthSchemeTypes.BEARER_TOKEN),
|
|
829
|
-
toolkitSlug: z.string(),
|
|
827
|
+
z$1.object({
|
|
828
|
+
authScheme: z$1.literal(AuthSchemeTypes.BEARER_TOKEN),
|
|
829
|
+
toolkitSlug: z$1.string(),
|
|
830
830
|
val: CustomBearerTokenConnectionDataSchema
|
|
831
831
|
}),
|
|
832
|
-
z.object({
|
|
833
|
-
authScheme: z.literal(AuthSchemeTypes.OAUTH1),
|
|
834
|
-
toolkitSlug: z.string(),
|
|
832
|
+
z$1.object({
|
|
833
|
+
authScheme: z$1.literal(AuthSchemeTypes.OAUTH1),
|
|
834
|
+
toolkitSlug: z$1.string(),
|
|
835
835
|
val: CustomOauth1ConnectionDataSchema
|
|
836
836
|
}),
|
|
837
|
-
z.object({
|
|
838
|
-
authScheme: z.literal(AuthSchemeTypes.NO_AUTH),
|
|
839
|
-
toolkitSlug: z.string(),
|
|
837
|
+
z$1.object({
|
|
838
|
+
authScheme: z$1.literal(AuthSchemeTypes.NO_AUTH),
|
|
839
|
+
toolkitSlug: z$1.string(),
|
|
840
840
|
val: CustomNoAuthConnectionDataSchema
|
|
841
841
|
}),
|
|
842
|
-
z.object({
|
|
843
|
-
authScheme: z.literal(AuthSchemeTypes.SERVICE_ACCOUNT),
|
|
844
|
-
toolkitSlug: z.string(),
|
|
842
|
+
z$1.object({
|
|
843
|
+
authScheme: z$1.literal(AuthSchemeTypes.SERVICE_ACCOUNT),
|
|
844
|
+
toolkitSlug: z$1.string(),
|
|
845
845
|
val: CustomServiceAccountConnectionDataSchema
|
|
846
846
|
})
|
|
847
847
|
]);
|
|
@@ -854,12 +854,12 @@ const CustomConnectionDataSchema = z.discriminatedUnion("authScheme", [
|
|
|
854
854
|
*
|
|
855
855
|
* eg. Google Toolkit, which provides tools like Google Search, Google Maps, Google Translate, etc.
|
|
856
856
|
*/
|
|
857
|
-
const ToolkitSchema = z.object({
|
|
858
|
-
slug: z.string().describe("The slug of the toolkit"),
|
|
859
|
-
name: z.string().describe("The name of the toolkit"),
|
|
860
|
-
logo: z.string().describe("The logo of the toolkit").optional()
|
|
857
|
+
const ToolkitSchema = z$1.object({
|
|
858
|
+
slug: z$1.string().describe("The slug of the toolkit"),
|
|
859
|
+
name: z$1.string().describe("The name of the toolkit"),
|
|
860
|
+
logo: z$1.string().describe("The logo of the toolkit").optional()
|
|
861
861
|
});
|
|
862
|
-
const JSONSchemaType = z.enum([
|
|
862
|
+
const JSONSchemaType = z$1.enum([
|
|
863
863
|
"string",
|
|
864
864
|
"number",
|
|
865
865
|
"integer",
|
|
@@ -868,121 +868,121 @@ const JSONSchemaType = z.enum([
|
|
|
868
868
|
"array",
|
|
869
869
|
"null"
|
|
870
870
|
]);
|
|
871
|
-
const JSONSchemaPropertySchema = z.object({
|
|
872
|
-
type: z.union([JSONSchemaType, z.array(JSONSchemaType)]).optional(),
|
|
873
|
-
description: z.string().optional(),
|
|
874
|
-
anyOf: z.lazy(() => z.array(JSONSchemaPropertySchema)).optional(),
|
|
875
|
-
oneOf: z.lazy(() => z.array(JSONSchemaPropertySchema)).optional(),
|
|
876
|
-
allOf: z.lazy(() => z.array(JSONSchemaPropertySchema)).optional(),
|
|
877
|
-
not: z.lazy(() => JSONSchemaPropertySchema).optional(),
|
|
878
|
-
title: z.string().optional(),
|
|
879
|
-
default: z.any().optional(),
|
|
880
|
-
nullable: z.boolean().optional(),
|
|
881
|
-
properties: z.lazy(() => z.record(z.string(), JSONSchemaPropertySchema)).optional(),
|
|
882
|
-
required: z.array(z.string()).optional(),
|
|
883
|
-
file_uploadable: z.boolean().optional(),
|
|
884
|
-
file_downloadable: z.boolean().optional(),
|
|
885
|
-
items: z.lazy(() => z.union([JSONSchemaPropertySchema, z.array(JSONSchemaPropertySchema)])).optional(),
|
|
886
|
-
enum: z.array(z.any()).optional(),
|
|
887
|
-
const: z.any().optional(),
|
|
888
|
-
minimum: z.number().optional(),
|
|
889
|
-
maximum: z.number().optional(),
|
|
890
|
-
exclusiveMinimum: z.number().optional(),
|
|
891
|
-
exclusiveMaximum: z.number().optional(),
|
|
892
|
-
multipleOf: z.number().optional(),
|
|
893
|
-
minLength: z.number().optional(),
|
|
894
|
-
maxLength: z.number().optional(),
|
|
895
|
-
pattern: z.string().optional(),
|
|
896
|
-
format: z.string().optional(),
|
|
897
|
-
minItems: z.number().optional(),
|
|
898
|
-
maxItems: z.number().optional(),
|
|
899
|
-
uniqueItems: z.boolean().optional(),
|
|
900
|
-
minProperties: z.number().optional(),
|
|
901
|
-
maxProperties: z.number().optional(),
|
|
902
|
-
patternProperties: z.lazy(() => z.record(z.string(), JSONSchemaPropertySchema)).optional(),
|
|
903
|
-
additionalProperties: z.union([z.boolean(), z.lazy(() => JSONSchemaPropertySchema)]).optional(),
|
|
904
|
-
examples: z.array(z.any()).optional(),
|
|
905
|
-
readOnly: z.boolean().optional(),
|
|
906
|
-
writeOnly: z.boolean().optional(),
|
|
907
|
-
if: z.lazy(() => JSONSchemaPropertySchema).optional(),
|
|
908
|
-
then: z.lazy(() => JSONSchemaPropertySchema).optional(),
|
|
909
|
-
else: z.lazy(() => JSONSchemaPropertySchema).optional(),
|
|
910
|
-
$ref: z.string().optional(),
|
|
911
|
-
definitions: z.record(z.string(), z.lazy(() => JSONSchemaPropertySchema)).optional(),
|
|
912
|
-
$defs: z.record(z.string(), z.lazy(() => JSONSchemaPropertySchema)).optional()
|
|
871
|
+
const JSONSchemaPropertySchema = z$1.object({
|
|
872
|
+
type: z$1.union([JSONSchemaType, z$1.array(JSONSchemaType)]).optional(),
|
|
873
|
+
description: z$1.string().optional(),
|
|
874
|
+
anyOf: z$1.lazy(() => z$1.array(JSONSchemaPropertySchema)).optional(),
|
|
875
|
+
oneOf: z$1.lazy(() => z$1.array(JSONSchemaPropertySchema)).optional(),
|
|
876
|
+
allOf: z$1.lazy(() => z$1.array(JSONSchemaPropertySchema)).optional(),
|
|
877
|
+
not: z$1.lazy(() => JSONSchemaPropertySchema).optional(),
|
|
878
|
+
title: z$1.string().optional(),
|
|
879
|
+
default: z$1.any().optional(),
|
|
880
|
+
nullable: z$1.boolean().optional(),
|
|
881
|
+
properties: z$1.lazy(() => z$1.record(z$1.string(), JSONSchemaPropertySchema)).optional(),
|
|
882
|
+
required: z$1.array(z$1.string()).optional(),
|
|
883
|
+
file_uploadable: z$1.boolean().optional(),
|
|
884
|
+
file_downloadable: z$1.boolean().optional(),
|
|
885
|
+
items: z$1.lazy(() => z$1.union([JSONSchemaPropertySchema, z$1.array(JSONSchemaPropertySchema)])).optional(),
|
|
886
|
+
enum: z$1.array(z$1.any()).optional(),
|
|
887
|
+
const: z$1.any().optional(),
|
|
888
|
+
minimum: z$1.number().optional(),
|
|
889
|
+
maximum: z$1.number().optional(),
|
|
890
|
+
exclusiveMinimum: z$1.number().optional(),
|
|
891
|
+
exclusiveMaximum: z$1.number().optional(),
|
|
892
|
+
multipleOf: z$1.number().optional(),
|
|
893
|
+
minLength: z$1.number().optional(),
|
|
894
|
+
maxLength: z$1.number().optional(),
|
|
895
|
+
pattern: z$1.string().optional(),
|
|
896
|
+
format: z$1.string().optional(),
|
|
897
|
+
minItems: z$1.number().optional(),
|
|
898
|
+
maxItems: z$1.number().optional(),
|
|
899
|
+
uniqueItems: z$1.boolean().optional(),
|
|
900
|
+
minProperties: z$1.number().optional(),
|
|
901
|
+
maxProperties: z$1.number().optional(),
|
|
902
|
+
patternProperties: z$1.lazy(() => z$1.record(z$1.string(), JSONSchemaPropertySchema)).optional(),
|
|
903
|
+
additionalProperties: z$1.union([z$1.boolean(), z$1.lazy(() => JSONSchemaPropertySchema)]).optional(),
|
|
904
|
+
examples: z$1.array(z$1.any()).optional(),
|
|
905
|
+
readOnly: z$1.boolean().optional(),
|
|
906
|
+
writeOnly: z$1.boolean().optional(),
|
|
907
|
+
if: z$1.lazy(() => JSONSchemaPropertySchema).optional(),
|
|
908
|
+
then: z$1.lazy(() => JSONSchemaPropertySchema).optional(),
|
|
909
|
+
else: z$1.lazy(() => JSONSchemaPropertySchema).optional(),
|
|
910
|
+
$ref: z$1.string().optional(),
|
|
911
|
+
definitions: z$1.record(z$1.string(), z$1.lazy(() => JSONSchemaPropertySchema)).optional(),
|
|
912
|
+
$defs: z$1.record(z$1.string(), z$1.lazy(() => JSONSchemaPropertySchema)).optional()
|
|
913
913
|
});
|
|
914
|
-
const ParametersSchema = z.object({
|
|
915
|
-
type: z.literal("object"),
|
|
916
|
-
anyOf: z.array(JSONSchemaPropertySchema).optional(),
|
|
917
|
-
oneOf: z.array(JSONSchemaPropertySchema).optional(),
|
|
918
|
-
allOf: z.array(JSONSchemaPropertySchema).optional(),
|
|
914
|
+
const ParametersSchema = z$1.preprocess(deduplicateJsonSchemaRequiredArrays, z$1.object({
|
|
915
|
+
type: z$1.literal("object"),
|
|
916
|
+
anyOf: z$1.array(JSONSchemaPropertySchema).optional(),
|
|
917
|
+
oneOf: z$1.array(JSONSchemaPropertySchema).optional(),
|
|
918
|
+
allOf: z$1.array(JSONSchemaPropertySchema).optional(),
|
|
919
919
|
not: JSONSchemaPropertySchema.optional(),
|
|
920
|
-
properties: z.record(z.string(), JSONSchemaPropertySchema),
|
|
921
|
-
required: z.array(z.string()).optional(),
|
|
922
|
-
title: z.string().optional(),
|
|
923
|
-
default: z.any().optional(),
|
|
924
|
-
nullable: z.boolean().optional(),
|
|
925
|
-
description: z.string().optional(),
|
|
926
|
-
additionalProperties: z.boolean().default(false).optional(),
|
|
927
|
-
$defs: z.record(z.string(), z.lazy(() => JSONSchemaPropertySchema)).optional(),
|
|
928
|
-
definitions: z.record(z.string(), z.lazy(() => JSONSchemaPropertySchema)).optional()
|
|
929
|
-
});
|
|
920
|
+
properties: z$1.record(z$1.string(), JSONSchemaPropertySchema),
|
|
921
|
+
required: z$1.array(z$1.string()).optional(),
|
|
922
|
+
title: z$1.string().optional(),
|
|
923
|
+
default: z$1.any().optional(),
|
|
924
|
+
nullable: z$1.boolean().optional(),
|
|
925
|
+
description: z$1.string().optional(),
|
|
926
|
+
additionalProperties: z$1.boolean().default(false).optional(),
|
|
927
|
+
$defs: z$1.record(z$1.string(), z$1.lazy(() => JSONSchemaPropertySchema)).optional(),
|
|
928
|
+
definitions: z$1.record(z$1.string(), z$1.lazy(() => JSONSchemaPropertySchema)).optional()
|
|
929
|
+
}));
|
|
930
930
|
/**
|
|
931
931
|
* Tool is a single action that can be performed by a toolkit.
|
|
932
932
|
* Tool is simlar to an action that an app can perform.
|
|
933
933
|
*
|
|
934
934
|
* eg. Google Search, Google Maps, Google Translate, etc.
|
|
935
935
|
*/
|
|
936
|
-
const ToolSchema = z.object({
|
|
937
|
-
slug: z.string().describe("The slug of the tool. eg. \"GOOGLE_SEARCH\""),
|
|
938
|
-
name: z.string().describe(`The name of the tool. eg. "Google Search"`),
|
|
939
|
-
description: z.string().optional().describe("The description of the tool"),
|
|
936
|
+
const ToolSchema = z$1.object({
|
|
937
|
+
slug: z$1.string().describe("The slug of the tool. eg. \"GOOGLE_SEARCH\""),
|
|
938
|
+
name: z$1.string().describe(`The name of the tool. eg. "Google Search"`),
|
|
939
|
+
description: z$1.string().optional().describe("The description of the tool"),
|
|
940
940
|
inputParameters: ParametersSchema.optional().describe("The input parameters of the tool"),
|
|
941
941
|
outputParameters: ParametersSchema.optional().describe("The output parameters of the tool"),
|
|
942
|
-
tags: z.array(z.string()).describe("The tags of the tool. eg: Important").default([]).optional(),
|
|
942
|
+
tags: z$1.array(z$1.string()).describe("The tags of the tool. eg: Important").default([]).optional(),
|
|
943
943
|
toolkit: ToolkitSchema.describe("The toolkit of the tool").optional(),
|
|
944
|
-
version: z.string().describe("The version of the tool, e.g. \"20250909_00\"").optional(),
|
|
945
|
-
isDeprecated: z.boolean().describe("Whether the tool is deprecated").optional(),
|
|
946
|
-
availableVersions: z.array(z.string()).describe("Available versions of the tool.").default([]).optional(),
|
|
947
|
-
scopes: z.array(z.string()).describe("The scopes of the tool. eg: [\"task:add\"]").optional(),
|
|
948
|
-
isNoAuth: z.boolean().describe("Do the tool support no auth?").optional()
|
|
944
|
+
version: z$1.string().describe("The version of the tool, e.g. \"20250909_00\"").optional(),
|
|
945
|
+
isDeprecated: z$1.boolean().describe("Whether the tool is deprecated").optional(),
|
|
946
|
+
availableVersions: z$1.array(z$1.string()).describe("Available versions of the tool.").default([]).optional(),
|
|
947
|
+
scopes: z$1.array(z$1.string()).describe("The scopes of the tool. eg: [\"task:add\"]").optional(),
|
|
948
|
+
isNoAuth: z$1.boolean().describe("Do the tool support no auth?").optional()
|
|
949
949
|
});
|
|
950
950
|
/**
|
|
951
951
|
* ToolListResponse Schema
|
|
952
952
|
*/
|
|
953
|
-
const ToolListResponseSchema = z.object({
|
|
954
|
-
items: z.array(ToolSchema),
|
|
955
|
-
nextCursor: z.string().nullable().optional(),
|
|
956
|
-
totalPages: z.number()
|
|
953
|
+
const ToolListResponseSchema = z$1.object({
|
|
954
|
+
items: z$1.array(ToolSchema),
|
|
955
|
+
nextCursor: z$1.string().nullable().optional(),
|
|
956
|
+
totalPages: z$1.number()
|
|
957
957
|
});
|
|
958
|
-
const ToolkitLatestVersionSchema = z.literal("latest");
|
|
959
|
-
const ToolkitVersionSchema = z.union([ToolkitLatestVersionSchema, z.string()]);
|
|
960
|
-
const ToolkitVersionsSchema = z.record(z.string(), ToolkitVersionSchema);
|
|
961
|
-
const ToolkitVersionParamSchema = z.union([
|
|
958
|
+
const ToolkitLatestVersionSchema = z$1.literal("latest");
|
|
959
|
+
const ToolkitVersionSchema = z$1.union([ToolkitLatestVersionSchema, z$1.string()]);
|
|
960
|
+
const ToolkitVersionsSchema = z$1.record(z$1.string(), ToolkitVersionSchema);
|
|
961
|
+
const ToolkitVersionParamSchema = z$1.union([
|
|
962
962
|
ToolkitVersionsSchema,
|
|
963
963
|
ToolkitLatestVersionSchema,
|
|
964
|
-
z.undefined()
|
|
964
|
+
z$1.undefined()
|
|
965
965
|
]).describe("The versioning of the toolkits. eg: { \"github\": \"latest\", \"slack\": \"20250902_00\" }");
|
|
966
|
-
const ToolListParamsSchema = z.object({
|
|
967
|
-
tools: z.array(z.string()).optional(),
|
|
968
|
-
toolkits: z.array(z.string()).optional(),
|
|
969
|
-
scopes: z.array(z.string()).optional(),
|
|
970
|
-
tags: z.array(z.string()).optional(),
|
|
971
|
-
limit: z.number().optional(),
|
|
972
|
-
search: z.string().optional(),
|
|
973
|
-
authConfigIds: z.array(z.string()).optional(),
|
|
974
|
-
important: z.boolean().optional()
|
|
966
|
+
const ToolListParamsSchema = z$1.object({
|
|
967
|
+
tools: z$1.array(z$1.string()).optional(),
|
|
968
|
+
toolkits: z$1.array(z$1.string()).optional(),
|
|
969
|
+
scopes: z$1.array(z$1.string()).optional(),
|
|
970
|
+
tags: z$1.array(z$1.string()).optional(),
|
|
971
|
+
limit: z$1.number().optional(),
|
|
972
|
+
search: z$1.string().optional(),
|
|
973
|
+
authConfigIds: z$1.array(z$1.string()).optional(),
|
|
974
|
+
important: z$1.boolean().optional()
|
|
975
975
|
});
|
|
976
976
|
/**
|
|
977
977
|
* CustomAuthParams is the parameters for the custom authentication.
|
|
978
978
|
*/
|
|
979
|
-
const CustomAuthParamsSchema = z.object({
|
|
980
|
-
baseURL: z.string().optional(),
|
|
981
|
-
body: z.record(z.string(), z.unknown()).optional(),
|
|
982
|
-
parameters: z.array(z.object({
|
|
983
|
-
in: z.enum(["query", "header"]),
|
|
984
|
-
name: z.string(),
|
|
985
|
-
value: z.union([z.string(), z.number()])
|
|
979
|
+
const CustomAuthParamsSchema = z$1.object({
|
|
980
|
+
baseURL: z$1.string().optional(),
|
|
981
|
+
body: z$1.record(z$1.string(), z$1.unknown()).optional(),
|
|
982
|
+
parameters: z$1.array(z$1.object({
|
|
983
|
+
in: z$1.enum(["query", "header"]),
|
|
984
|
+
name: z$1.string(),
|
|
985
|
+
value: z$1.union([z$1.string(), z$1.number()])
|
|
986
986
|
}))
|
|
987
987
|
});
|
|
988
988
|
/**
|
|
@@ -1021,47 +1021,47 @@ const CustomAuthParamsSchema = z.object({
|
|
|
1021
1021
|
* };
|
|
1022
1022
|
* ```
|
|
1023
1023
|
*/
|
|
1024
|
-
const ToolExecuteParamsSchema = z.object({
|
|
1025
|
-
allowTracing: z.boolean().optional(),
|
|
1026
|
-
connectedAccountId: z.string().optional(),
|
|
1024
|
+
const ToolExecuteParamsSchema = z$1.object({
|
|
1025
|
+
allowTracing: z$1.boolean().optional(),
|
|
1026
|
+
connectedAccountId: z$1.string().optional(),
|
|
1027
1027
|
customAuthParams: CustomAuthParamsSchema.optional(),
|
|
1028
1028
|
customConnectionData: CustomConnectionDataSchema.optional(),
|
|
1029
|
-
arguments: z.record(z.string(), z.unknown()).optional(),
|
|
1030
|
-
userId: z.string().optional(),
|
|
1031
|
-
version: z.union([z.literal("latest"), z.string()]).optional(),
|
|
1032
|
-
dangerouslySkipVersionCheck: z.boolean().optional(),
|
|
1033
|
-
text: z.string().optional()
|
|
1029
|
+
arguments: z$1.record(z$1.string(), z$1.unknown()).optional(),
|
|
1030
|
+
userId: z$1.string().optional(),
|
|
1031
|
+
version: z$1.union([z$1.literal("latest"), z$1.string()]).optional(),
|
|
1032
|
+
dangerouslySkipVersionCheck: z$1.boolean().optional(),
|
|
1033
|
+
text: z$1.string().optional()
|
|
1034
1034
|
});
|
|
1035
|
-
const ToolExecuteMetaParamsSchema = z.object({
|
|
1036
|
-
sessionId: z.string(),
|
|
1037
|
-
arguments: z.record(z.string(), z.unknown()).optional()
|
|
1035
|
+
const ToolExecuteMetaParamsSchema = z$1.object({
|
|
1036
|
+
sessionId: z$1.string(),
|
|
1037
|
+
arguments: z$1.record(z$1.string(), z$1.unknown()).optional()
|
|
1038
1038
|
});
|
|
1039
1039
|
/**
|
|
1040
1040
|
* ToolResponse Schema
|
|
1041
1041
|
*/
|
|
1042
|
-
const ToolExecuteResponseSchema = z.object({
|
|
1043
|
-
data: z.record(z.string(), z.unknown()),
|
|
1044
|
-
error: z.string().nullable(),
|
|
1045
|
-
successful: z.boolean(),
|
|
1046
|
-
logId: z.string().optional(),
|
|
1047
|
-
sessionInfo: z.unknown().optional()
|
|
1042
|
+
const ToolExecuteResponseSchema = z$1.object({
|
|
1043
|
+
data: z$1.record(z$1.string(), z$1.unknown()),
|
|
1044
|
+
error: z$1.string().nullable(),
|
|
1045
|
+
successful: z$1.boolean(),
|
|
1046
|
+
logId: z$1.string().optional(),
|
|
1047
|
+
sessionInfo: z$1.unknown().optional()
|
|
1048
1048
|
});
|
|
1049
|
-
const ToolProxyParamsSchema = z.object({
|
|
1050
|
-
endpoint: z.string(),
|
|
1051
|
-
method: z.enum([
|
|
1049
|
+
const ToolProxyParamsSchema = z$1.object({
|
|
1050
|
+
endpoint: z$1.string(),
|
|
1051
|
+
method: z$1.enum([
|
|
1052
1052
|
"GET",
|
|
1053
1053
|
"POST",
|
|
1054
1054
|
"PUT",
|
|
1055
1055
|
"DELETE",
|
|
1056
1056
|
"PATCH"
|
|
1057
1057
|
]),
|
|
1058
|
-
body: z.unknown().optional(),
|
|
1059
|
-
parameters: z.array(z.object({
|
|
1060
|
-
in: z.enum(["query", "header"]),
|
|
1061
|
-
name: z.string(),
|
|
1062
|
-
value: z.union([z.string(), z.number()])
|
|
1058
|
+
body: z$1.unknown().optional(),
|
|
1059
|
+
parameters: z$1.array(z$1.object({
|
|
1060
|
+
in: z$1.enum(["query", "header"]),
|
|
1061
|
+
name: z$1.string(),
|
|
1062
|
+
value: z$1.union([z$1.string(), z$1.number()])
|
|
1063
1063
|
})).optional(),
|
|
1064
|
-
connectedAccountId: z.string().optional(),
|
|
1064
|
+
connectedAccountId: z$1.string().optional(),
|
|
1065
1065
|
/**
|
|
1066
1066
|
* @deprecated
|
|
1067
1067
|
*/
|
|
@@ -1071,6 +1071,22 @@ const ToolProxyParamsSchema = z.object({
|
|
|
1071
1071
|
//#endregion
|
|
1072
1072
|
//#region src/utils/toolkitVersion.ts
|
|
1073
1073
|
/**
|
|
1074
|
+
* Canonicalizes a toolkit slug into the form used as a version-map key.
|
|
1075
|
+
*
|
|
1076
|
+
* Toolkit slugs are matched case-insensitively. This is the single source of
|
|
1077
|
+
* truth for that rule: every write into a version map (env vars, user-supplied
|
|
1078
|
+
* objects — see `getToolkitVersionsFromEnv`) and every read out of one MUST go
|
|
1079
|
+
* through this helper so the two sides can never drift apart and silently miss a
|
|
1080
|
+
* configured pin.
|
|
1081
|
+
*
|
|
1082
|
+
* Kept intentionally equivalent to the Python SDK's `normalize_toolkit_slug`
|
|
1083
|
+
* (see python/composio/utils/toolkit_version.py).
|
|
1084
|
+
*
|
|
1085
|
+
* @param toolkitSlug - The slug/name of the toolkit, in any casing
|
|
1086
|
+
* @returns The normalized (lowercase) slug used as a version-map key
|
|
1087
|
+
*/
|
|
1088
|
+
const normalizeToolkitSlug = (toolkitSlug) => toolkitSlug.toLowerCase();
|
|
1089
|
+
/**
|
|
1074
1090
|
* Gets the version for a specific toolkit based on the provided toolkit versions configuration.
|
|
1075
1091
|
*
|
|
1076
1092
|
* @param toolkitSlug - The slug/name of the toolkit to get the version for
|
|
@@ -1079,7 +1095,7 @@ const ToolProxyParamsSchema = z.object({
|
|
|
1079
1095
|
*/
|
|
1080
1096
|
const getToolkitVersion = (toolkitSlug, toolkitVersions) => {
|
|
1081
1097
|
if (typeof toolkitVersions === "string") return toolkitVersions;
|
|
1082
|
-
if (toolkitVersions && Object.keys(toolkitVersions).length > 0) return toolkitVersions[toolkitSlug] ?? "latest";
|
|
1098
|
+
if (toolkitVersions && Object.keys(toolkitVersions).length > 0) return toolkitVersions[normalizeToolkitSlug(toolkitSlug)] ?? "latest";
|
|
1083
1099
|
return "latest";
|
|
1084
1100
|
};
|
|
1085
1101
|
|
|
@@ -1194,6 +1210,10 @@ var Tools = class {
|
|
|
1194
1210
|
* Scoped per-instance so a fresh `Composio` starts with a clean slate.
|
|
1195
1211
|
*/
|
|
1196
1212
|
warnedAutoUploadDisabledForTool = /* @__PURE__ */ new Set();
|
|
1213
|
+
/**
|
|
1214
|
+
* Lazily-built sibling client with retries disabled; see `clientWithoutRetries`.
|
|
1215
|
+
*/
|
|
1216
|
+
clientWithoutRetriesCache;
|
|
1197
1217
|
constructor(client, config) {
|
|
1198
1218
|
if (!client) throw new Error("ComposioClient is required");
|
|
1199
1219
|
if (!config?.provider) throw new ComposioProviderNotDefinedError("Provider not passed into Tools instance");
|
|
@@ -1214,6 +1234,24 @@ var Tools = class {
|
|
|
1214
1234
|
telemetry.instrument(this, "Tools");
|
|
1215
1235
|
}
|
|
1216
1236
|
/**
|
|
1237
|
+
* A cached sibling client that never retries requests, mirroring Python's
|
|
1238
|
+
* `client.without_retries`.
|
|
1239
|
+
*
|
|
1240
|
+
* Used for non-idempotent writes (`tools.execute` / `tools.proxy`), where a
|
|
1241
|
+
* silent retry after a read timeout can duplicate a side effect (e.g. send an
|
|
1242
|
+
* email twice). Reads keep the default retry behaviour, and so do other writes
|
|
1243
|
+
* (`toolRouter.session.execute`, auth-config and connected-account mutations):
|
|
1244
|
+
* the durable fix there is backend-honoured idempotency keys, tracked
|
|
1245
|
+
* separately.
|
|
1246
|
+
*
|
|
1247
|
+
* Cached rather than rebuilt per call because `withOptions` constructs a fresh
|
|
1248
|
+
* client; its options never change, so one per `Tools` instance suffices.
|
|
1249
|
+
*/
|
|
1250
|
+
get clientWithoutRetries() {
|
|
1251
|
+
if (!this.clientWithoutRetriesCache) this.clientWithoutRetriesCache = this.client.withOptions({ maxRetries: 0 });
|
|
1252
|
+
return this.clientWithoutRetriesCache;
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1217
1255
|
* Transforms tool data from snake_case API format to camelCase for internal SDK use.
|
|
1218
1256
|
*
|
|
1219
1257
|
* This method standardizes the property naming convention for tools retrieved from the Composio API,
|
|
@@ -1667,7 +1705,7 @@ var Tools = class {
|
|
|
1667
1705
|
version: toolkitVersion,
|
|
1668
1706
|
text: body.text
|
|
1669
1707
|
};
|
|
1670
|
-
const result = await withCancellation(() => this.
|
|
1708
|
+
const result = await withCancellation(() => this.clientWithoutRetries.tools.execute(tool.slug, executeBody, requestOptions), requestOptions?.signal);
|
|
1671
1709
|
return this.transformToolExecuteResponse(result);
|
|
1672
1710
|
} catch (error) {
|
|
1673
1711
|
if (error instanceof ComposioRequestCancelledError) throw error;
|
|
@@ -1903,7 +1941,7 @@ var Tools = class {
|
|
|
1903
1941
|
*/
|
|
1904
1942
|
custom_connection_data: toolProxyParams.data.customConnectionData
|
|
1905
1943
|
};
|
|
1906
|
-
return withCancellation(() => this.
|
|
1944
|
+
return withCancellation(() => this.clientWithoutRetries.tools.proxy(proxyBody, requestOptions), requestOptions?.signal);
|
|
1907
1945
|
}
|
|
1908
1946
|
};
|
|
1909
1947
|
|
|
@@ -1912,96 +1950,96 @@ var Tools = class {
|
|
|
1912
1950
|
/**
|
|
1913
1951
|
* Toolkit list params
|
|
1914
1952
|
*/
|
|
1915
|
-
const ToolkitMangedByEnumSchema = z.enum([
|
|
1953
|
+
const ToolkitMangedByEnumSchema = z$1.enum([
|
|
1916
1954
|
"all",
|
|
1917
1955
|
"composio",
|
|
1918
1956
|
"project"
|
|
1919
1957
|
]);
|
|
1920
|
-
const ToolkitSortByEnumSchema = z.enum(["usage", "alphabetically"]);
|
|
1921
|
-
const ToolkitsListParamsSchema = z.object({
|
|
1922
|
-
category: z.string().optional(),
|
|
1958
|
+
const ToolkitSortByEnumSchema = z$1.enum(["usage", "alphabetically"]);
|
|
1959
|
+
const ToolkitsListParamsSchema = z$1.object({
|
|
1960
|
+
category: z$1.string().optional(),
|
|
1923
1961
|
managedBy: ToolkitMangedByEnumSchema.optional(),
|
|
1924
1962
|
sortBy: ToolkitSortByEnumSchema.optional(),
|
|
1925
|
-
cursor: z.string().optional(),
|
|
1926
|
-
limit: z.number().optional()
|
|
1963
|
+
cursor: z$1.string().optional(),
|
|
1964
|
+
limit: z$1.number().optional()
|
|
1927
1965
|
});
|
|
1928
1966
|
/**
|
|
1929
1967
|
* Toolkits response
|
|
1930
1968
|
*/
|
|
1931
|
-
const ToolKitMetaSchema = z.object({
|
|
1932
|
-
categories: z.array(z.object({
|
|
1933
|
-
slug: z.string(),
|
|
1934
|
-
name: z.string()
|
|
1969
|
+
const ToolKitMetaSchema = z$1.object({
|
|
1970
|
+
categories: z$1.array(z$1.object({
|
|
1971
|
+
slug: z$1.string(),
|
|
1972
|
+
name: z$1.string()
|
|
1935
1973
|
})).optional(),
|
|
1936
|
-
appUrl: z.string().optional(),
|
|
1937
|
-
createdAt: z.string().optional(),
|
|
1938
|
-
description: z.string().optional(),
|
|
1939
|
-
logo: z.string().optional(),
|
|
1940
|
-
toolsCount: z.number().optional(),
|
|
1941
|
-
triggersCount: z.number().optional(),
|
|
1942
|
-
updatedAt: z.string().optional(),
|
|
1943
|
-
availableVersions: z.array(z.string()).optional()
|
|
1974
|
+
appUrl: z$1.string().optional(),
|
|
1975
|
+
createdAt: z$1.string().optional(),
|
|
1976
|
+
description: z$1.string().optional(),
|
|
1977
|
+
logo: z$1.string().optional(),
|
|
1978
|
+
toolsCount: z$1.number().optional(),
|
|
1979
|
+
triggersCount: z$1.number().optional(),
|
|
1980
|
+
updatedAt: z$1.string().optional(),
|
|
1981
|
+
availableVersions: z$1.array(z$1.string()).optional()
|
|
1944
1982
|
});
|
|
1945
|
-
const ToolKitItemSchema = z.object({
|
|
1946
|
-
name: z.string(),
|
|
1947
|
-
slug: z.string(),
|
|
1983
|
+
const ToolKitItemSchema = z$1.object({
|
|
1984
|
+
name: z$1.string(),
|
|
1985
|
+
slug: z$1.string(),
|
|
1948
1986
|
meta: ToolKitMetaSchema,
|
|
1949
|
-
isLocalToolkit: z.boolean(),
|
|
1950
|
-
authSchemes: z.array(z.string()).optional(),
|
|
1951
|
-
composioManagedAuthSchemes: z.array(z.string()).optional(),
|
|
1952
|
-
noAuth: z.boolean().optional()
|
|
1987
|
+
isLocalToolkit: z$1.boolean(),
|
|
1988
|
+
authSchemes: z$1.array(z$1.string()).optional(),
|
|
1989
|
+
composioManagedAuthSchemes: z$1.array(z$1.string()).optional(),
|
|
1990
|
+
noAuth: z$1.boolean().optional()
|
|
1953
1991
|
});
|
|
1954
|
-
const ToolKitListResponseSchema = z.array(ToolKitItemSchema);
|
|
1992
|
+
const ToolKitListResponseSchema = z$1.array(ToolKitItemSchema);
|
|
1955
1993
|
/**
|
|
1956
1994
|
* Toolkit retrieve response
|
|
1957
1995
|
*/
|
|
1958
|
-
const ToolkitAuthFieldSchema = z.object({
|
|
1959
|
-
description: z.string(),
|
|
1960
|
-
displayName: z.string(),
|
|
1961
|
-
required: z.boolean(),
|
|
1962
|
-
name: z.string(),
|
|
1963
|
-
type: z.string(),
|
|
1964
|
-
default: z.string().nullable().optional()
|
|
1996
|
+
const ToolkitAuthFieldSchema = z$1.object({
|
|
1997
|
+
description: z$1.string(),
|
|
1998
|
+
displayName: z$1.string(),
|
|
1999
|
+
required: z$1.boolean(),
|
|
2000
|
+
name: z$1.string(),
|
|
2001
|
+
type: z$1.string(),
|
|
2002
|
+
default: z$1.string().nullable().optional()
|
|
1965
2003
|
});
|
|
1966
|
-
const ToolkitAuthConfigDetailsSchema = z.object({
|
|
1967
|
-
name: z.string(),
|
|
1968
|
-
mode: z.string(),
|
|
1969
|
-
fields: z.object({
|
|
1970
|
-
authConfigCreation: z.object({
|
|
1971
|
-
optional: z.array(ToolkitAuthFieldSchema),
|
|
1972
|
-
required: z.array(ToolkitAuthFieldSchema)
|
|
2004
|
+
const ToolkitAuthConfigDetailsSchema = z$1.object({
|
|
2005
|
+
name: z$1.string(),
|
|
2006
|
+
mode: z$1.string(),
|
|
2007
|
+
fields: z$1.object({
|
|
2008
|
+
authConfigCreation: z$1.object({
|
|
2009
|
+
optional: z$1.array(ToolkitAuthFieldSchema),
|
|
2010
|
+
required: z$1.array(ToolkitAuthFieldSchema)
|
|
1973
2011
|
}),
|
|
1974
|
-
connectedAccountInitiation: z.object({
|
|
1975
|
-
optional: z.array(ToolkitAuthFieldSchema),
|
|
1976
|
-
required: z.array(ToolkitAuthFieldSchema)
|
|
2012
|
+
connectedAccountInitiation: z$1.object({
|
|
2013
|
+
optional: z$1.array(ToolkitAuthFieldSchema),
|
|
2014
|
+
required: z$1.array(ToolkitAuthFieldSchema)
|
|
1977
2015
|
})
|
|
1978
2016
|
}),
|
|
1979
|
-
proxy: z.object({ baseUrl: z.string().optional() }).optional()
|
|
2017
|
+
proxy: z$1.object({ baseUrl: z$1.string().optional() }).optional()
|
|
1980
2018
|
});
|
|
1981
|
-
const ToolkitRetrieveResponseSchema = z.object({
|
|
1982
|
-
name: z.string(),
|
|
1983
|
-
slug: z.string(),
|
|
2019
|
+
const ToolkitRetrieveResponseSchema = z$1.object({
|
|
2020
|
+
name: z$1.string(),
|
|
2021
|
+
slug: z$1.string(),
|
|
1984
2022
|
meta: ToolKitMetaSchema,
|
|
1985
|
-
isLocalToolkit: z.boolean(),
|
|
1986
|
-
composioManagedAuthSchemes: z.array(z.string()).optional(),
|
|
1987
|
-
authConfigDetails: z.array(ToolkitAuthConfigDetailsSchema).optional(),
|
|
1988
|
-
baseUrl: z.string().optional(),
|
|
1989
|
-
getCurrentUserEndpoint: z.string().optional(),
|
|
1990
|
-
getCurrentUserEndpointMethod: z.string().optional()
|
|
2023
|
+
isLocalToolkit: z$1.boolean(),
|
|
2024
|
+
composioManagedAuthSchemes: z$1.array(z$1.string()).optional(),
|
|
2025
|
+
authConfigDetails: z$1.array(ToolkitAuthConfigDetailsSchema).optional(),
|
|
2026
|
+
baseUrl: z$1.string().optional(),
|
|
2027
|
+
getCurrentUserEndpoint: z$1.string().optional(),
|
|
2028
|
+
getCurrentUserEndpointMethod: z$1.string().optional()
|
|
1991
2029
|
});
|
|
1992
2030
|
/**
|
|
1993
2031
|
* Toolkit categories response
|
|
1994
2032
|
*/
|
|
1995
|
-
const ToolkitCategorySchema = z.object({
|
|
1996
|
-
id: z.string(),
|
|
1997
|
-
name: z.string()
|
|
2033
|
+
const ToolkitCategorySchema = z$1.object({
|
|
2034
|
+
id: z$1.string(),
|
|
2035
|
+
name: z$1.string()
|
|
1998
2036
|
});
|
|
1999
|
-
const ToolkitRetrieveCategoriesResponseSchema = z.object({
|
|
2000
|
-
items: z.array(ToolkitCategorySchema),
|
|
2001
|
-
nextCursor: z.string().nullable(),
|
|
2002
|
-
totalPages: z.number()
|
|
2037
|
+
const ToolkitRetrieveCategoriesResponseSchema = z$1.object({
|
|
2038
|
+
items: z$1.array(ToolkitCategorySchema),
|
|
2039
|
+
nextCursor: z$1.string().nullable(),
|
|
2040
|
+
totalPages: z$1.number()
|
|
2003
2041
|
});
|
|
2004
|
-
const ToolkitAuthFieldsResponseSchema = z.array(ToolkitAuthFieldSchema.extend({ required: z.boolean().optional() }));
|
|
2042
|
+
const ToolkitAuthFieldsResponseSchema = z$1.array(ToolkitAuthFieldSchema.extend({ required: z$1.boolean().optional() }));
|
|
2005
2043
|
|
|
2006
2044
|
//#endregion
|
|
2007
2045
|
//#region src/utils/transform.ts
|
|
@@ -2381,7 +2419,7 @@ const ConnectedAccountStatuses = {
|
|
|
2381
2419
|
INACTIVE: "INACTIVE",
|
|
2382
2420
|
REVOKED: "REVOKED"
|
|
2383
2421
|
};
|
|
2384
|
-
const ConnectedAccountStatusSchema = z.enum([
|
|
2422
|
+
const ConnectedAccountStatusSchema = z$1.enum([
|
|
2385
2423
|
ConnectedAccountStatuses.INITIALIZING,
|
|
2386
2424
|
ConnectedAccountStatuses.INITIATED,
|
|
2387
2425
|
ConnectedAccountStatuses.ACTIVE,
|
|
@@ -2403,7 +2441,7 @@ const ConnectedAccountTypes = {
|
|
|
2403
2441
|
PRIVATE: "PRIVATE",
|
|
2404
2442
|
SHARED: "SHARED"
|
|
2405
2443
|
};
|
|
2406
|
-
const ConnectedAccountTypeSchema = z.enum([ConnectedAccountTypes.PRIVATE, ConnectedAccountTypes.SHARED]);
|
|
2444
|
+
const ConnectedAccountTypeSchema = z$1.enum([ConnectedAccountTypes.PRIVATE, ConnectedAccountTypes.SHARED]);
|
|
2407
2445
|
/**
|
|
2408
2446
|
* Per-user access control for a SHARED connected account. Ignored for
|
|
2409
2447
|
* PRIVATE.
|
|
@@ -2427,21 +2465,21 @@ const ConnectedAccountTypeSchema = z.enum([ConnectedAccountTypes.PRIVATE, Connec
|
|
|
2427
2465
|
* 1..256 characters.
|
|
2428
2466
|
*/
|
|
2429
2467
|
const ACL_LIST_MAX_LENGTH = 1e3;
|
|
2430
|
-
const aclUserIdString = z.string().min(1).max(256);
|
|
2431
|
-
const ConnectedAccountAclConfigSchema = z.object({
|
|
2432
|
-
allowAllUsers: z.boolean().optional().describe("When true, any `userId` may use this SHARED connection (subject to the deny list). Default false."),
|
|
2433
|
-
allowedUserIds: z.array(aclUserIdString).max(ACL_LIST_MAX_LENGTH).optional().describe("Explicit list of `userId` strings allowed to use this SHARED connection. Default []."),
|
|
2434
|
-
notAllowedUserIds: z.array(aclUserIdString).max(ACL_LIST_MAX_LENGTH).optional().describe("Explicit list of `userId` strings denied access. Wins over allow on conflict. Default [].")
|
|
2468
|
+
const aclUserIdString = z$1.string().min(1).max(256);
|
|
2469
|
+
const ConnectedAccountAclConfigSchema = z$1.object({
|
|
2470
|
+
allowAllUsers: z$1.boolean().optional().describe("When true, any `userId` may use this SHARED connection (subject to the deny list). Default false."),
|
|
2471
|
+
allowedUserIds: z$1.array(aclUserIdString).max(ACL_LIST_MAX_LENGTH).optional().describe("Explicit list of `userId` strings allowed to use this SHARED connection. Default []."),
|
|
2472
|
+
notAllowedUserIds: z$1.array(aclUserIdString).max(ACL_LIST_MAX_LENGTH).optional().describe("Explicit list of `userId` strings denied access. Wins over allow on conflict. Default [].")
|
|
2435
2473
|
});
|
|
2436
2474
|
/**
|
|
2437
2475
|
* Resolved ACL as it appears on responses. All three fields are populated
|
|
2438
2476
|
* when the field is visible; the field itself is `undefined` for callers
|
|
2439
2477
|
* not authorised to see it.
|
|
2440
2478
|
*/
|
|
2441
|
-
const ConnectedAccountAclConfigResponseSchema = z.object({
|
|
2442
|
-
allowAllUsers: z.boolean(),
|
|
2443
|
-
allowedUserIds: z.array(z.string()),
|
|
2444
|
-
notAllowedUserIds: z.array(z.string())
|
|
2479
|
+
const ConnectedAccountAclConfigResponseSchema = z$1.object({
|
|
2480
|
+
allowAllUsers: z$1.boolean(),
|
|
2481
|
+
allowedUserIds: z$1.array(z$1.string()),
|
|
2482
|
+
notAllowedUserIds: z$1.array(z$1.string())
|
|
2445
2483
|
});
|
|
2446
2484
|
/**
|
|
2447
2485
|
* Experimental options for SHARED connections, passed at create / link time.
|
|
@@ -2450,7 +2488,7 @@ const ConnectedAccountAclConfigResponseSchema = z.object({
|
|
|
2450
2488
|
* dedicated `experimental` block on every input and response so the
|
|
2451
2489
|
* experimental status is visible at every call site.
|
|
2452
2490
|
*/
|
|
2453
|
-
const ConnectedAccountExperimentalSchema = z.object({
|
|
2491
|
+
const ConnectedAccountExperimentalSchema = z$1.object({
|
|
2454
2492
|
accountType: ConnectedAccountTypeSchema.optional(),
|
|
2455
2493
|
aclConfigForShared: ConnectedAccountAclConfigSchema.optional()
|
|
2456
2494
|
});
|
|
@@ -2459,98 +2497,98 @@ const ConnectedAccountExperimentalSchema = z.object({
|
|
|
2459
2497
|
* is always present when the block is; `aclConfigForShared` is only
|
|
2460
2498
|
* present when the caller is authorised to see the ACL.
|
|
2461
2499
|
*/
|
|
2462
|
-
const ConnectedAccountExperimentalResponseSchema = z.object({
|
|
2500
|
+
const ConnectedAccountExperimentalResponseSchema = z$1.object({
|
|
2463
2501
|
accountType: ConnectedAccountTypeSchema.optional(),
|
|
2464
2502
|
aclConfigForShared: ConnectedAccountAclConfigResponseSchema.optional()
|
|
2465
2503
|
});
|
|
2466
|
-
const CreateConnectedAccountParamsSchema = z.object({
|
|
2467
|
-
authConfig: z.object({ id: z.string() }),
|
|
2468
|
-
connection: z.object({
|
|
2469
|
-
data: z.record(z.string(), z.unknown()).optional(),
|
|
2470
|
-
callbackUrl: z.string().optional(),
|
|
2471
|
-
userId: z.string().optional()
|
|
2504
|
+
const CreateConnectedAccountParamsSchema = z$1.object({
|
|
2505
|
+
authConfig: z$1.object({ id: z$1.string() }),
|
|
2506
|
+
connection: z$1.object({
|
|
2507
|
+
data: z$1.record(z$1.string(), z$1.unknown()).optional(),
|
|
2508
|
+
callbackUrl: z$1.string().optional(),
|
|
2509
|
+
userId: z$1.string().optional()
|
|
2472
2510
|
})
|
|
2473
2511
|
});
|
|
2474
|
-
const DefaultCreateConnectedAccountParamsSchema = z.object({
|
|
2475
|
-
auth_config: z.object({ id: z.string() }),
|
|
2476
|
-
connection: z.object({
|
|
2512
|
+
const DefaultCreateConnectedAccountParamsSchema = z$1.object({
|
|
2513
|
+
auth_config: z$1.object({ id: z$1.string() }),
|
|
2514
|
+
connection: z$1.object({
|
|
2477
2515
|
state: ConnectionDataSchema.optional(),
|
|
2478
|
-
data: z.record(z.string(), z.unknown()).optional(),
|
|
2479
|
-
callback_url: z.string().optional(),
|
|
2480
|
-
user_id: z.string().optional(),
|
|
2481
|
-
alias: z.string().optional()
|
|
2516
|
+
data: z$1.record(z$1.string(), z$1.unknown()).optional(),
|
|
2517
|
+
callback_url: z$1.string().optional(),
|
|
2518
|
+
user_id: z$1.string().optional(),
|
|
2519
|
+
alias: z$1.string().optional()
|
|
2482
2520
|
})
|
|
2483
2521
|
});
|
|
2484
|
-
const CreateConnectedAccountOptionsSchema = z.object({
|
|
2485
|
-
allowMultiple: z.boolean().optional(),
|
|
2486
|
-
callbackUrl: z.string().optional(),
|
|
2522
|
+
const CreateConnectedAccountOptionsSchema = z$1.object({
|
|
2523
|
+
allowMultiple: z$1.boolean().optional(),
|
|
2524
|
+
callbackUrl: z$1.string().optional(),
|
|
2487
2525
|
config: ConnectionDataSchema.optional(),
|
|
2488
|
-
alias: z.string().optional()
|
|
2526
|
+
alias: z$1.string().optional()
|
|
2489
2527
|
});
|
|
2490
2528
|
/**
|
|
2491
2529
|
* Connected Account create response
|
|
2492
2530
|
*/
|
|
2493
|
-
const CreateConnectedAccountResponseSchema = z.object({
|
|
2494
|
-
id: z.string(),
|
|
2531
|
+
const CreateConnectedAccountResponseSchema = z$1.object({
|
|
2532
|
+
id: z$1.string(),
|
|
2495
2533
|
status: ConnectedAccountStatusSchema,
|
|
2496
|
-
redirectUrl: z.string().nullable()
|
|
2534
|
+
redirectUrl: z$1.string().nullable()
|
|
2497
2535
|
});
|
|
2498
|
-
const ConnectedAccountAuthConfigSchema = z.object({
|
|
2499
|
-
id: z.string(),
|
|
2536
|
+
const ConnectedAccountAuthConfigSchema = z$1.object({
|
|
2537
|
+
id: z$1.string(),
|
|
2500
2538
|
/** @deprecated Use `connectedAccount.state.authScheme` instead. */
|
|
2501
2539
|
authScheme: AuthSchemeEnum.optional(),
|
|
2502
|
-
isComposioManaged: z.boolean(),
|
|
2503
|
-
isDisabled: z.boolean()
|
|
2540
|
+
isComposioManaged: z$1.boolean(),
|
|
2541
|
+
isDisabled: z$1.boolean()
|
|
2504
2542
|
});
|
|
2505
|
-
const ConnectedAccountRetrieveResponseSchema = z.object({
|
|
2506
|
-
id: z.string(),
|
|
2543
|
+
const ConnectedAccountRetrieveResponseSchema = z$1.object({
|
|
2544
|
+
id: z$1.string(),
|
|
2507
2545
|
authConfig: ConnectedAccountAuthConfigSchema,
|
|
2508
|
-
wordId: z.string().nullable().optional(),
|
|
2509
|
-
alias: z.string().nullable().optional(),
|
|
2546
|
+
wordId: z$1.string().nullable().optional(),
|
|
2547
|
+
alias: z$1.string().nullable().optional(),
|
|
2510
2548
|
/**
|
|
2511
2549
|
* @deprecated Use `connectedAccount.state` instead — `data` is a legacy raw credential field.
|
|
2512
2550
|
*/
|
|
2513
|
-
data: z.record(z.string(), z.unknown()).optional(),
|
|
2551
|
+
data: z$1.record(z$1.string(), z$1.unknown()).optional(),
|
|
2514
2552
|
/**
|
|
2515
2553
|
* @deprecated Use `connectedAccount.state` instead — `params` is a legacy raw credential field.
|
|
2516
2554
|
*/
|
|
2517
|
-
params: z.record(z.string(), z.unknown()).optional(),
|
|
2555
|
+
params: z$1.record(z$1.string(), z$1.unknown()).optional(),
|
|
2518
2556
|
status: ConnectedAccountStatusSchema,
|
|
2519
|
-
statusReason: z.string().nullable(),
|
|
2520
|
-
toolkit: z.object({ slug: z.string() }),
|
|
2557
|
+
statusReason: z$1.string().nullable(),
|
|
2558
|
+
toolkit: z$1.object({ slug: z$1.string() }),
|
|
2521
2559
|
state: ConnectionDataSchema.optional(),
|
|
2522
|
-
testRequestEndpoint: z.string().optional(),
|
|
2523
|
-
isDisabled: z.boolean(),
|
|
2524
|
-
createdAt: z.string(),
|
|
2525
|
-
updatedAt: z.string(),
|
|
2560
|
+
testRequestEndpoint: z$1.string().optional(),
|
|
2561
|
+
isDisabled: z$1.boolean(),
|
|
2562
|
+
createdAt: z$1.string(),
|
|
2563
|
+
updatedAt: z$1.string(),
|
|
2526
2564
|
experimental: ConnectedAccountExperimentalResponseSchema.optional()
|
|
2527
2565
|
});
|
|
2528
|
-
const ConnectedAccountListParamsSchema = z.object({
|
|
2529
|
-
authConfigIds: z.array(z.string()).nullable().optional().describe("The auth config ids of the connected accounts"),
|
|
2530
|
-
cursor: z.string().nullish().describe("The cursor to paginate through the connected accounts"),
|
|
2531
|
-
limit: z.number().nullable().optional().describe("The limit of the connected accounts to return"),
|
|
2532
|
-
orderBy: z.enum(["created_at", "updated_at"]).optional().describe("The order by of the connected accounts"),
|
|
2533
|
-
statuses: z.array(ConnectedAccountStatusSchema).nullable().optional().describe("The statuses of the connected accounts"),
|
|
2534
|
-
toolkitSlugs: z.array(z.string()).nullable().optional().describe("The toolkit slugs of the connected accounts"),
|
|
2535
|
-
userIds: z.array(z.string()).nullable().optional().describe("The user ids of the connected accounts"),
|
|
2566
|
+
const ConnectedAccountListParamsSchema = z$1.object({
|
|
2567
|
+
authConfigIds: z$1.array(z$1.string()).nullable().optional().describe("The auth config ids of the connected accounts"),
|
|
2568
|
+
cursor: z$1.string().nullish().describe("The cursor to paginate through the connected accounts"),
|
|
2569
|
+
limit: z$1.number().nullable().optional().describe("The limit of the connected accounts to return"),
|
|
2570
|
+
orderBy: z$1.enum(["created_at", "updated_at"]).optional().describe("The order by of the connected accounts"),
|
|
2571
|
+
statuses: z$1.array(ConnectedAccountStatusSchema).nullable().optional().describe("The statuses of the connected accounts"),
|
|
2572
|
+
toolkitSlugs: z$1.array(z$1.string()).nullable().optional().describe("The toolkit slugs of the connected accounts"),
|
|
2573
|
+
userIds: z$1.array(z$1.string()).nullable().optional().describe("The user ids of the connected accounts"),
|
|
2536
2574
|
/**
|
|
2537
2575
|
* Experimental — shape may change in future releases. Filter by sharing
|
|
2538
2576
|
* model. Default (omitted) returns PRIVATE only. Pass `'SHARED'` for only
|
|
2539
2577
|
* shared accounts, or `'ALL'` for `PRIVATE` + `SHARED`. Kept flat because
|
|
2540
2578
|
* the wire is a query string and can't carry nested objects.
|
|
2541
2579
|
*/
|
|
2542
|
-
accountType: z.enum([
|
|
2580
|
+
accountType: z$1.enum([
|
|
2543
2581
|
"PRIVATE",
|
|
2544
2582
|
"SHARED",
|
|
2545
2583
|
"ALL"
|
|
2546
2584
|
]).optional()
|
|
2547
2585
|
});
|
|
2548
|
-
const ConnectedAccountListResponseSchema = z.object({
|
|
2549
|
-
items: z.array(ConnectedAccountRetrieveResponseSchema).describe("The list of connected accounts"),
|
|
2550
|
-
nextCursor: z.string().nullish().describe("The next cursor to paginate through the connected accounts"),
|
|
2551
|
-
totalPages: z.number().describe("The total number of pages of connected accounts")
|
|
2586
|
+
const ConnectedAccountListResponseSchema = z$1.object({
|
|
2587
|
+
items: z$1.array(ConnectedAccountRetrieveResponseSchema).describe("The list of connected accounts"),
|
|
2588
|
+
nextCursor: z$1.string().nullish().describe("The next cursor to paginate through the connected accounts"),
|
|
2589
|
+
totalPages: z$1.number().describe("The total number of pages of connected accounts")
|
|
2552
2590
|
});
|
|
2553
|
-
const CreateConnectedAccountLinkOptionsSchema = z.object({
|
|
2591
|
+
const CreateConnectedAccountLinkOptionsSchema = z$1.object({
|
|
2554
2592
|
/**
|
|
2555
2593
|
* The url to redirect the user to post connecting their account.
|
|
2556
2594
|
*
|
|
@@ -2560,11 +2598,11 @@ const CreateConnectedAccountLinkOptionsSchema = z.object({
|
|
|
2560
2598
|
* @example https://your-app.com/callback
|
|
2561
2599
|
*
|
|
2562
2600
|
*/
|
|
2563
|
-
callbackUrl: z.string().optional(),
|
|
2601
|
+
callbackUrl: z$1.string().optional(),
|
|
2564
2602
|
/**
|
|
2565
2603
|
* Human-readable alias for the connected account. Must be unique per userId and toolkit within the project.
|
|
2566
2604
|
*/
|
|
2567
|
-
alias: z.string().optional(),
|
|
2605
|
+
alias: z$1.string().optional(),
|
|
2568
2606
|
/**
|
|
2569
2607
|
* Whether to allow multiple connected accounts for the same user and auth config.
|
|
2570
2608
|
* When `false` (default), `link()` throws `ComposioMultipleConnectedAccountsError`
|
|
@@ -2572,7 +2610,7 @@ const CreateConnectedAccountLinkOptionsSchema = z.object({
|
|
|
2572
2610
|
* the guard on `initiate()`. Pair with `alias` and a session-level
|
|
2573
2611
|
* `multiAccount` config to disambiguate at execution time.
|
|
2574
2612
|
*/
|
|
2575
|
-
allowMultiple: z.boolean().optional(),
|
|
2613
|
+
allowMultiple: z$1.boolean().optional(),
|
|
2576
2614
|
/**
|
|
2577
2615
|
* Experimental options for SHARED connections. Pass `accountType: 'SHARED'`
|
|
2578
2616
|
* (and optionally `aclConfigForShared`) to create a connection that can
|
|
@@ -2589,12 +2627,12 @@ const CreateConnectedAccountLinkOptionsSchema = z.object({
|
|
|
2589
2627
|
*/
|
|
2590
2628
|
experimental: ConnectedAccountExperimentalSchema.optional()
|
|
2591
2629
|
});
|
|
2592
|
-
const CreateConnectedAccountLinkResponseSchema = z.object({ redirectUrl: z.string() });
|
|
2593
|
-
const ConnectedAccountRefreshOptionsSchema = z.object({
|
|
2594
|
-
redirectUrl: z.string().optional(),
|
|
2595
|
-
validateCredentials: z.boolean().optional()
|
|
2630
|
+
const CreateConnectedAccountLinkResponseSchema = z$1.object({ redirectUrl: z$1.string() });
|
|
2631
|
+
const ConnectedAccountRefreshOptionsSchema = z$1.object({
|
|
2632
|
+
redirectUrl: z$1.string().optional(),
|
|
2633
|
+
validateCredentials: z$1.boolean().optional()
|
|
2596
2634
|
});
|
|
2597
|
-
const UpdateConnectedAccountParamsSchema = z.object({ enabled: z.boolean() });
|
|
2635
|
+
const UpdateConnectedAccountParamsSchema = z$1.object({ enabled: z$1.boolean() });
|
|
2598
2636
|
/**
|
|
2599
2637
|
* Params for `composio.connectedAccounts.updateAcl()`. Mirrors the inner
|
|
2600
2638
|
* shape of the wire's `acl_config_for_shared` block — the SDK adds the
|
|
@@ -3603,148 +3641,148 @@ const TriggerStatuses = {
|
|
|
3603
3641
|
ENABLE: "enable",
|
|
3604
3642
|
DISABLE: "disable"
|
|
3605
3643
|
};
|
|
3606
|
-
const TriggerStatusEnum = z.enum(["enable", "disable"]);
|
|
3607
|
-
const TriggerSubscribeParamSchema = z.object({
|
|
3608
|
-
toolkits: z.array(z.string()).optional(),
|
|
3609
|
-
triggerId: z.string().optional(),
|
|
3610
|
-
connectedAccountId: z.string().optional(),
|
|
3611
|
-
authConfigId: z.string().optional(),
|
|
3612
|
-
triggerSlug: z.array(z.string()).optional(),
|
|
3613
|
-
triggerData: z.string().optional(),
|
|
3614
|
-
userId: z.string().optional()
|
|
3644
|
+
const TriggerStatusEnum = z$1.enum(["enable", "disable"]);
|
|
3645
|
+
const TriggerSubscribeParamSchema = z$1.object({
|
|
3646
|
+
toolkits: z$1.array(z$1.string()).optional(),
|
|
3647
|
+
triggerId: z$1.string().optional(),
|
|
3648
|
+
connectedAccountId: z$1.string().optional(),
|
|
3649
|
+
authConfigId: z$1.string().optional(),
|
|
3650
|
+
triggerSlug: z$1.array(z$1.string()).optional(),
|
|
3651
|
+
triggerData: z$1.string().optional(),
|
|
3652
|
+
userId: z$1.string().optional()
|
|
3615
3653
|
});
|
|
3616
|
-
const TriggerInstanceListActiveParamsSchema = z.object({
|
|
3617
|
-
authConfigIds: z.array(z.string()).nullable().optional(),
|
|
3618
|
-
connectedAccountIds: z.array(z.string()).nullable().optional(),
|
|
3619
|
-
limit: z.number().optional(),
|
|
3620
|
-
cursor: z.string().optional(),
|
|
3621
|
-
showDisabled: z.boolean().nullable().optional(),
|
|
3622
|
-
triggerIds: z.array(z.string()).nullable().optional(),
|
|
3623
|
-
triggerNames: z.array(z.string()).nullable().optional()
|
|
3654
|
+
const TriggerInstanceListActiveParamsSchema = z$1.object({
|
|
3655
|
+
authConfigIds: z$1.array(z$1.string()).nullable().optional(),
|
|
3656
|
+
connectedAccountIds: z$1.array(z$1.string()).nullable().optional(),
|
|
3657
|
+
limit: z$1.number().optional(),
|
|
3658
|
+
cursor: z$1.string().optional(),
|
|
3659
|
+
showDisabled: z$1.boolean().nullable().optional(),
|
|
3660
|
+
triggerIds: z$1.array(z$1.string()).nullable().optional(),
|
|
3661
|
+
triggerNames: z$1.array(z$1.string()).nullable().optional()
|
|
3624
3662
|
});
|
|
3625
|
-
const TriggerInstanceListActiveResponseItemSchema = z.object({
|
|
3626
|
-
id: z.string(),
|
|
3627
|
-
connectedAccountId: z.string(),
|
|
3628
|
-
disabledAt: z.string().nullable(),
|
|
3629
|
-
state: z.record(z.unknown()),
|
|
3630
|
-
triggerConfig: z.record(z.unknown()),
|
|
3631
|
-
triggerName: z.string(),
|
|
3632
|
-
updatedAt: z.string(),
|
|
3633
|
-
triggerData: z.string().optional(),
|
|
3634
|
-
uuid: z.string().optional()
|
|
3663
|
+
const TriggerInstanceListActiveResponseItemSchema = z$1.object({
|
|
3664
|
+
id: z$1.string(),
|
|
3665
|
+
connectedAccountId: z$1.string(),
|
|
3666
|
+
disabledAt: z$1.string().nullable(),
|
|
3667
|
+
state: z$1.record(z$1.unknown()),
|
|
3668
|
+
triggerConfig: z$1.record(z$1.unknown()),
|
|
3669
|
+
triggerName: z$1.string(),
|
|
3670
|
+
updatedAt: z$1.string(),
|
|
3671
|
+
triggerData: z$1.string().optional(),
|
|
3672
|
+
uuid: z$1.string().optional()
|
|
3635
3673
|
});
|
|
3636
|
-
const TriggerInstanceListActiveResponseSchema = z.object({
|
|
3637
|
-
items: z.array(TriggerInstanceListActiveResponseItemSchema),
|
|
3638
|
-
nextCursor: z.string().nullable(),
|
|
3639
|
-
totalPages: z.number()
|
|
3674
|
+
const TriggerInstanceListActiveResponseSchema = z$1.object({
|
|
3675
|
+
items: z$1.array(TriggerInstanceListActiveResponseItemSchema),
|
|
3676
|
+
nextCursor: z$1.string().nullable(),
|
|
3677
|
+
totalPages: z$1.number()
|
|
3640
3678
|
});
|
|
3641
|
-
const TriggerInstanceUpsertParamsSchema = z.object({
|
|
3642
|
-
connectedAccountId: z.string().optional(),
|
|
3643
|
-
triggerConfig: z.record(z.unknown()).optional()
|
|
3679
|
+
const TriggerInstanceUpsertParamsSchema = z$1.object({
|
|
3680
|
+
connectedAccountId: z$1.string().optional(),
|
|
3681
|
+
triggerConfig: z$1.record(z$1.unknown()).optional()
|
|
3644
3682
|
});
|
|
3645
|
-
const TriggerInstanceUpsertResponseSchema = z.object({ triggerId: z.string() });
|
|
3646
|
-
const TriggerInstanceManageUpdateParamsSchema = z.object({ status: z.enum(["enable", "disable"]) });
|
|
3647
|
-
const TriggerInstanceManageUpdateResponseSchema = z.object({ status: z.enum(["success"]) });
|
|
3648
|
-
const TriggerInstanceManageDeleteResponseSchema = z.object({ triggerId: z.string() });
|
|
3649
|
-
const IncomingTriggerPayloadSchema = z.object({
|
|
3650
|
-
id: z.string().describe("The ID of the trigger"),
|
|
3651
|
-
uuid: z.string().describe("The UUID of the trigger"),
|
|
3652
|
-
triggerSlug: z.string().describe("The slug of the trigger that triggered the event"),
|
|
3653
|
-
toolkitSlug: z.string().describe("The slug of the toolkit that triggered the event"),
|
|
3654
|
-
userId: z.string().describe("The ID of the user that triggered the event"),
|
|
3655
|
-
payload: z.record(z.unknown()).describe("The payload of the trigger").optional(),
|
|
3656
|
-
originalPayload: z.record(z.unknown()).describe("The original payload of the trigger").optional(),
|
|
3657
|
-
metadata: z.object({
|
|
3658
|
-
id: z.string(),
|
|
3659
|
-
uuid: z.string(),
|
|
3660
|
-
toolkitSlug: z.string(),
|
|
3661
|
-
triggerSlug: z.string(),
|
|
3662
|
-
triggerData: z.string().optional(),
|
|
3663
|
-
triggerConfig: z.record(z.unknown()),
|
|
3664
|
-
connectedAccount: z.object({
|
|
3665
|
-
id: z.string(),
|
|
3666
|
-
uuid: z.string(),
|
|
3667
|
-
authConfigId: z.string(),
|
|
3668
|
-
authConfigUUID: z.string(),
|
|
3669
|
-
userId: z.string(),
|
|
3670
|
-
status: z.enum(["ACTIVE", "INACTIVE"])
|
|
3683
|
+
const TriggerInstanceUpsertResponseSchema = z$1.object({ triggerId: z$1.string() });
|
|
3684
|
+
const TriggerInstanceManageUpdateParamsSchema = z$1.object({ status: z$1.enum(["enable", "disable"]) });
|
|
3685
|
+
const TriggerInstanceManageUpdateResponseSchema = z$1.object({ status: z$1.enum(["success"]) });
|
|
3686
|
+
const TriggerInstanceManageDeleteResponseSchema = z$1.object({ triggerId: z$1.string() });
|
|
3687
|
+
const IncomingTriggerPayloadSchema = z$1.object({
|
|
3688
|
+
id: z$1.string().describe("The ID of the trigger"),
|
|
3689
|
+
uuid: z$1.string().describe("The UUID of the trigger"),
|
|
3690
|
+
triggerSlug: z$1.string().describe("The slug of the trigger that triggered the event"),
|
|
3691
|
+
toolkitSlug: z$1.string().describe("The slug of the toolkit that triggered the event"),
|
|
3692
|
+
userId: z$1.string().describe("The ID of the user that triggered the event"),
|
|
3693
|
+
payload: z$1.record(z$1.unknown()).describe("The payload of the trigger").optional(),
|
|
3694
|
+
originalPayload: z$1.record(z$1.unknown()).describe("The original payload of the trigger").optional(),
|
|
3695
|
+
metadata: z$1.object({
|
|
3696
|
+
id: z$1.string(),
|
|
3697
|
+
uuid: z$1.string(),
|
|
3698
|
+
toolkitSlug: z$1.string(),
|
|
3699
|
+
triggerSlug: z$1.string(),
|
|
3700
|
+
triggerData: z$1.string().optional(),
|
|
3701
|
+
triggerConfig: z$1.record(z$1.unknown()),
|
|
3702
|
+
connectedAccount: z$1.object({
|
|
3703
|
+
id: z$1.string(),
|
|
3704
|
+
uuid: z$1.string(),
|
|
3705
|
+
authConfigId: z$1.string(),
|
|
3706
|
+
authConfigUUID: z$1.string(),
|
|
3707
|
+
userId: z$1.string(),
|
|
3708
|
+
status: z$1.enum(["ACTIVE", "INACTIVE"])
|
|
3671
3709
|
})
|
|
3672
3710
|
})
|
|
3673
3711
|
});
|
|
3674
|
-
const TriggersTypeListParamsSchema = z.object({
|
|
3675
|
-
cursor: z.string().optional(),
|
|
3676
|
-
limit: z.number().nullish(),
|
|
3677
|
-
toolkits: z.array(z.string()).nullish()
|
|
3712
|
+
const TriggersTypeListParamsSchema = z$1.object({
|
|
3713
|
+
cursor: z$1.string().optional(),
|
|
3714
|
+
limit: z$1.number().nullish(),
|
|
3715
|
+
toolkits: z$1.array(z$1.string()).nullish()
|
|
3678
3716
|
});
|
|
3679
|
-
const TriggerTypeSchema = z.object({
|
|
3680
|
-
slug: z.string(),
|
|
3681
|
-
name: z.string(),
|
|
3682
|
-
description: z.string(),
|
|
3683
|
-
instructions: z.string().optional(),
|
|
3684
|
-
toolkit: z.object({
|
|
3685
|
-
logo: z.string(),
|
|
3686
|
-
slug: z.string(),
|
|
3687
|
-
name: z.string()
|
|
3717
|
+
const TriggerTypeSchema = z$1.object({
|
|
3718
|
+
slug: z$1.string(),
|
|
3719
|
+
name: z$1.string(),
|
|
3720
|
+
description: z$1.string(),
|
|
3721
|
+
instructions: z$1.string().optional(),
|
|
3722
|
+
toolkit: z$1.object({
|
|
3723
|
+
logo: z$1.string(),
|
|
3724
|
+
slug: z$1.string(),
|
|
3725
|
+
name: z$1.string()
|
|
3688
3726
|
}),
|
|
3689
|
-
payload: z.record(z.unknown()),
|
|
3690
|
-
config: z.record(z.unknown()),
|
|
3691
|
-
version: z.string().optional()
|
|
3727
|
+
payload: z$1.record(z$1.unknown()),
|
|
3728
|
+
config: z$1.record(z$1.unknown()),
|
|
3729
|
+
version: z$1.string().optional()
|
|
3692
3730
|
});
|
|
3693
|
-
const TriggersTypeListResponseSchema = z.object({
|
|
3694
|
-
items: z.array(TriggerTypeSchema),
|
|
3695
|
-
nextCursor: z.string().nullish(),
|
|
3696
|
-
totalPages: z.number()
|
|
3731
|
+
const TriggersTypeListResponseSchema = z$1.object({
|
|
3732
|
+
items: z$1.array(TriggerTypeSchema),
|
|
3733
|
+
nextCursor: z$1.string().nullish(),
|
|
3734
|
+
totalPages: z$1.number()
|
|
3697
3735
|
});
|
|
3698
3736
|
/**
|
|
3699
3737
|
* Webhook payload schemas for V1, V2, V3 versions
|
|
3700
3738
|
* These schemas represent the raw payload structure sent by Composio's webhook system
|
|
3701
3739
|
*/
|
|
3702
3740
|
/** V1 webhook payload - legacy format */
|
|
3703
|
-
const WebhookPayloadV1Schema = z.object({
|
|
3704
|
-
trigger_name: z.string(),
|
|
3705
|
-
connection_id: z.string(),
|
|
3706
|
-
trigger_id: z.string(),
|
|
3707
|
-
payload: z.record(z.unknown()),
|
|
3708
|
-
log_id: z.string()
|
|
3741
|
+
const WebhookPayloadV1Schema = z$1.object({
|
|
3742
|
+
trigger_name: z$1.string(),
|
|
3743
|
+
connection_id: z$1.string(),
|
|
3744
|
+
trigger_id: z$1.string(),
|
|
3745
|
+
payload: z$1.record(z$1.unknown()),
|
|
3746
|
+
log_id: z$1.string()
|
|
3709
3747
|
});
|
|
3710
3748
|
/** V2 webhook payload - includes timestamp and nested data */
|
|
3711
|
-
const WebhookPayloadV2Schema = z.object({
|
|
3712
|
-
type: z.string(),
|
|
3713
|
-
timestamp: z.string(),
|
|
3714
|
-
log_id: z.string(),
|
|
3715
|
-
data: z.object({
|
|
3716
|
-
connection_id: z.string(),
|
|
3717
|
-
connection_nano_id: z.string(),
|
|
3718
|
-
trigger_nano_id: z.string(),
|
|
3719
|
-
trigger_id: z.string(),
|
|
3720
|
-
user_id: z.string()
|
|
3749
|
+
const WebhookPayloadV2Schema = z$1.object({
|
|
3750
|
+
type: z$1.string(),
|
|
3751
|
+
timestamp: z$1.string(),
|
|
3752
|
+
log_id: z$1.string(),
|
|
3753
|
+
data: z$1.object({
|
|
3754
|
+
connection_id: z$1.string(),
|
|
3755
|
+
connection_nano_id: z$1.string(),
|
|
3756
|
+
trigger_nano_id: z$1.string(),
|
|
3757
|
+
trigger_id: z$1.string(),
|
|
3758
|
+
user_id: z$1.string()
|
|
3721
3759
|
}).passthrough()
|
|
3722
3760
|
});
|
|
3723
3761
|
/** V3 webhook payload - generic envelope for all composio.* events */
|
|
3724
|
-
const WebhookPayloadV3Schema = z.object({
|
|
3725
|
-
id: z.string(),
|
|
3726
|
-
timestamp: z.string(),
|
|
3727
|
-
type: z.string().refine((val) => val.startsWith("composio."), { message: "V3 event type must start with 'composio.'" }),
|
|
3728
|
-
metadata: z.record(z.unknown()),
|
|
3729
|
-
data: z.record(z.unknown())
|
|
3762
|
+
const WebhookPayloadV3Schema = z$1.object({
|
|
3763
|
+
id: z$1.string(),
|
|
3764
|
+
timestamp: z$1.string(),
|
|
3765
|
+
type: z$1.string().refine((val) => val.startsWith("composio."), { message: "V3 event type must start with 'composio.'" }),
|
|
3766
|
+
metadata: z$1.record(z$1.unknown()),
|
|
3767
|
+
data: z$1.record(z$1.unknown())
|
|
3730
3768
|
});
|
|
3731
3769
|
/** V3 trigger-specific payload - has trigger metadata fields */
|
|
3732
|
-
const WebhookTriggerPayloadV3Schema = z.object({
|
|
3733
|
-
id: z.string(),
|
|
3734
|
-
timestamp: z.string(),
|
|
3735
|
-
type: z.string(),
|
|
3736
|
-
metadata: z.object({
|
|
3737
|
-
log_id: z.string(),
|
|
3738
|
-
trigger_slug: z.string(),
|
|
3739
|
-
trigger_id: z.string(),
|
|
3740
|
-
connected_account_id: z.string(),
|
|
3741
|
-
auth_config_id: z.string(),
|
|
3742
|
-
user_id: z.string()
|
|
3770
|
+
const WebhookTriggerPayloadV3Schema = z$1.object({
|
|
3771
|
+
id: z$1.string(),
|
|
3772
|
+
timestamp: z$1.string(),
|
|
3773
|
+
type: z$1.string(),
|
|
3774
|
+
metadata: z$1.object({
|
|
3775
|
+
log_id: z$1.string(),
|
|
3776
|
+
trigger_slug: z$1.string(),
|
|
3777
|
+
trigger_id: z$1.string(),
|
|
3778
|
+
connected_account_id: z$1.string(),
|
|
3779
|
+
auth_config_id: z$1.string(),
|
|
3780
|
+
user_id: z$1.string()
|
|
3743
3781
|
}).passthrough(),
|
|
3744
|
-
data: z.record(z.unknown())
|
|
3782
|
+
data: z$1.record(z$1.unknown())
|
|
3745
3783
|
});
|
|
3746
3784
|
/** Union of all webhook payload versions */
|
|
3747
|
-
const WebhookPayloadSchema = z.union([
|
|
3785
|
+
const WebhookPayloadSchema = z$1.union([
|
|
3748
3786
|
WebhookPayloadV3Schema,
|
|
3749
3787
|
WebhookPayloadV2Schema,
|
|
3750
3788
|
WebhookPayloadV1Schema
|
|
@@ -3756,13 +3794,13 @@ const WebhookVersions = {
|
|
|
3756
3794
|
V3: "V3"
|
|
3757
3795
|
};
|
|
3758
3796
|
const DefaultWebhookSubscriptionEvents = ["composio.trigger.message"];
|
|
3759
|
-
const SetWebhookSubscriptionParamsSchema = z.object({
|
|
3797
|
+
const SetWebhookSubscriptionParamsSchema = z$1.object({
|
|
3760
3798
|
/** HTTPS URL to receive webhook events. */
|
|
3761
|
-
webhookUrl: z.string().min(1),
|
|
3799
|
+
webhookUrl: z$1.string().min(1),
|
|
3762
3800
|
/** Event types to subscribe to. Defaults to trigger messages. */
|
|
3763
|
-
enabledEvents: z.array(z.string()).min(1).optional(),
|
|
3801
|
+
enabledEvents: z$1.array(z$1.string()).min(1).optional(),
|
|
3764
3802
|
/** Webhook payload version. Defaults to V3. */
|
|
3765
|
-
version: z.enum([
|
|
3803
|
+
version: z$1.enum([
|
|
3766
3804
|
"V1",
|
|
3767
3805
|
"V2",
|
|
3768
3806
|
"V3"
|
|
@@ -3771,22 +3809,22 @@ const SetWebhookSubscriptionParamsSchema = z.object({
|
|
|
3771
3809
|
/**
|
|
3772
3810
|
* Parameters for verifying a webhook signature
|
|
3773
3811
|
*/
|
|
3774
|
-
const VerifyWebhookParamsSchema = z.object({
|
|
3812
|
+
const VerifyWebhookParamsSchema = z$1.object({
|
|
3775
3813
|
/**
|
|
3776
3814
|
* The webhook message ID from the 'webhook-id' header.
|
|
3777
3815
|
* Format: 'msg_xxx'
|
|
3778
3816
|
*/
|
|
3779
|
-
id: z.string({
|
|
3817
|
+
id: z$1.string({
|
|
3780
3818
|
required_error: "Missing 'id' parameter. Pass the value of the 'webhook-id' HTTP header.",
|
|
3781
3819
|
invalid_type_error: "Invalid 'id' parameter. Expected string from 'webhook-id' HTTP header."
|
|
3782
3820
|
}),
|
|
3783
3821
|
/** The raw webhook payload as a string (request body) */
|
|
3784
|
-
payload: z.string({
|
|
3822
|
+
payload: z$1.string({
|
|
3785
3823
|
required_error: "Missing 'payload' parameter. Pass the raw request body as a string (do not parse it).",
|
|
3786
3824
|
invalid_type_error: "Invalid 'payload' parameter. Expected string (raw request body)."
|
|
3787
3825
|
}),
|
|
3788
3826
|
/** The webhook secret used to sign the payload (from Composio dashboard) */
|
|
3789
|
-
secret: z.string({
|
|
3827
|
+
secret: z$1.string({
|
|
3790
3828
|
required_error: "Missing 'secret' parameter. Get your webhook secret from the Composio dashboard.",
|
|
3791
3829
|
invalid_type_error: "Invalid 'secret' parameter. Expected string."
|
|
3792
3830
|
}),
|
|
@@ -3794,7 +3832,7 @@ const VerifyWebhookParamsSchema = z.object({
|
|
|
3794
3832
|
* The signature from the 'webhook-signature' header.
|
|
3795
3833
|
* Format: 'v1,base64EncodedSignature'
|
|
3796
3834
|
*/
|
|
3797
|
-
signature: z.string({
|
|
3835
|
+
signature: z$1.string({
|
|
3798
3836
|
required_error: "Missing 'signature' parameter. Pass the value of the 'webhook-signature' HTTP header.",
|
|
3799
3837
|
invalid_type_error: "Invalid 'signature' parameter. Expected string from 'webhook-signature' HTTP header."
|
|
3800
3838
|
}),
|
|
@@ -3802,7 +3840,7 @@ const VerifyWebhookParamsSchema = z.object({
|
|
|
3802
3840
|
* The webhook timestamp from the 'webhook-timestamp' header.
|
|
3803
3841
|
* This is the Unix timestamp in seconds when the webhook was sent.
|
|
3804
3842
|
*/
|
|
3805
|
-
timestamp: z.string({
|
|
3843
|
+
timestamp: z$1.string({
|
|
3806
3844
|
required_error: "Missing 'timestamp' parameter. Pass the value of the 'webhook-timestamp' HTTP header.",
|
|
3807
3845
|
invalid_type_error: "Invalid 'timestamp' parameter. Expected string from 'webhook-timestamp' HTTP header."
|
|
3808
3846
|
}),
|
|
@@ -3812,15 +3850,15 @@ const VerifyWebhookParamsSchema = z.object({
|
|
|
3812
3850
|
* Set to 0 to disable timestamp validation.
|
|
3813
3851
|
* @default 300 (5 minutes)
|
|
3814
3852
|
*/
|
|
3815
|
-
tolerance: z.number().optional().default(300)
|
|
3853
|
+
tolerance: z$1.number().optional().default(300)
|
|
3816
3854
|
});
|
|
3817
3855
|
|
|
3818
3856
|
//#endregion
|
|
3819
3857
|
//#region src/services/internal/InternalService.types.ts
|
|
3820
|
-
const SDKRealtimeCredentialsResponseSchema = z.object({
|
|
3821
|
-
projectId: z.string().describe("The project ID"),
|
|
3822
|
-
pusherKey: z.string().describe("The Pusher key"),
|
|
3823
|
-
pusherCluster: z.string().describe("The Pusher cluster")
|
|
3858
|
+
const SDKRealtimeCredentialsResponseSchema = z$1.object({
|
|
3859
|
+
projectId: z$1.string().describe("The project ID"),
|
|
3860
|
+
pusherKey: z$1.string().describe("The Pusher key"),
|
|
3861
|
+
pusherCluster: z$1.string().describe("The Pusher cluster")
|
|
3824
3862
|
});
|
|
3825
3863
|
|
|
3826
3864
|
//#endregion
|
|
@@ -4132,7 +4170,8 @@ const transformWebhookSubscription = (subscription) => {
|
|
|
4132
4170
|
};
|
|
4133
4171
|
};
|
|
4134
4172
|
const firstWebhookSubscriptionId = (response) => {
|
|
4135
|
-
|
|
4173
|
+
const firstItem = Array.isArray(response.items) ? response.items[0] : void 0;
|
|
4174
|
+
return firstString(asRecord(firstItem).id);
|
|
4136
4175
|
};
|
|
4137
4176
|
/**
|
|
4138
4177
|
* The signature header names Composio sends with every webhook delivery.
|
|
@@ -4212,8 +4251,10 @@ var Triggers = class {
|
|
|
4212
4251
|
enabled_events: parsedParams.data.enabledEvents ?? [...DefaultWebhookSubscriptionEvents],
|
|
4213
4252
|
version: parsedParams.data.version ?? WebhookVersions.V3
|
|
4214
4253
|
};
|
|
4215
|
-
const
|
|
4216
|
-
|
|
4254
|
+
const existing = await this.client.get(WEBHOOK_SUBSCRIPTIONS_PATH, { query: { limit: 1 } });
|
|
4255
|
+
const subscriptionId = firstWebhookSubscriptionId(existing);
|
|
4256
|
+
const subscription = subscriptionId ? await this.client.patch(`${WEBHOOK_SUBSCRIPTIONS_PATH}/${encodeURIComponent(subscriptionId)}`, { body }) : await this.client.post(WEBHOOK_SUBSCRIPTIONS_PATH, { body });
|
|
4257
|
+
return transformWebhookSubscription(subscription);
|
|
4217
4258
|
}
|
|
4218
4259
|
/**
|
|
4219
4260
|
* Fetch list of all the active triggers
|
|
@@ -4256,13 +4297,11 @@ var Triggers = class {
|
|
|
4256
4297
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
|
|
4257
4298
|
*/
|
|
4258
4299
|
async create(userId, slug, body, requestOptions) {
|
|
4300
|
+
if (!userId?.trim()) throw new ValidationError(`A non-empty userId is required to create a trigger`);
|
|
4259
4301
|
const parsedBody = TriggerInstanceUpsertParamsSchema.safeParse(body ?? {});
|
|
4260
4302
|
if (!parsedBody.success) throw new ValidationError(`Invalid parameters passed to create trigger`, { cause: parsedBody.error });
|
|
4261
|
-
let triggerType;
|
|
4262
|
-
let toolkitSlug;
|
|
4263
4303
|
try {
|
|
4264
|
-
|
|
4265
|
-
toolkitSlug = triggerType.toolkit.slug;
|
|
4304
|
+
await this.getType(slug, requestOptions);
|
|
4266
4305
|
} catch (error) {
|
|
4267
4306
|
if (error instanceof APIError && (error.status === 400 || error.status === 404)) throw new ComposioTriggerTypeNotFoundError(`Trigger type ${slug} not found`, {
|
|
4268
4307
|
cause: error,
|
|
@@ -4272,37 +4311,10 @@ var Triggers = class {
|
|
|
4272
4311
|
`Visit the toolkit page to see the available triggers`
|
|
4273
4312
|
]
|
|
4274
4313
|
});
|
|
4275
|
-
else throw error;
|
|
4276
|
-
}
|
|
4277
|
-
let connectedAccountId = body?.connectedAccountId;
|
|
4278
|
-
try {
|
|
4279
|
-
const connectedAccountListParams = {
|
|
4280
|
-
user_ids: [userId],
|
|
4281
|
-
toolkit_slugs: [toolkitSlug]
|
|
4282
|
-
};
|
|
4283
|
-
const { items: connectedAccounts } = await withCancellation(() => this.client.connectedAccounts.list(connectedAccountListParams, requestOptions), requestOptions?.signal);
|
|
4284
|
-
if (connectedAccounts.length === 0) throw new ComposioConnectedAccountNotFoundError(`No connected account found for user ${userId} for toolkit ${toolkitSlug}`, {
|
|
4285
|
-
cause: /* @__PURE__ */ new Error(`No connected account found for user ${userId}`),
|
|
4286
|
-
possibleFixes: [`Create a new connected account for user ${userId}`]
|
|
4287
|
-
});
|
|
4288
|
-
const accountExists = connectedAccounts.some((acc) => acc.id === connectedAccountId);
|
|
4289
|
-
if (connectedAccountId && !accountExists) throw new ComposioConnectedAccountNotFoundError(`Connected account ID ${connectedAccountId} not found for user ${userId}`, {
|
|
4290
|
-
cause: /* @__PURE__ */ new Error(`Connected account ID ${connectedAccountId} not found for user ${userId}`),
|
|
4291
|
-
possibleFixes: [`Create a new connected account for user ${userId}`, `Verify the connected account ID`]
|
|
4292
|
-
});
|
|
4293
|
-
if (!connectedAccountId) {
|
|
4294
|
-
connectedAccountId = connectedAccounts[0].id;
|
|
4295
|
-
logger.warn(`[Warn] Multiple connected accounts found for user ${userId}, using the first one. Pass connectedAccountId to select a specific account.`);
|
|
4296
|
-
}
|
|
4297
|
-
} catch (error) {
|
|
4298
|
-
if (error instanceof APIError && [400, 404].includes(error.status)) throw new ComposioConnectedAccountNotFoundError(`No connected account found for user ${userId} for toolkit ${toolkitSlug}`, {
|
|
4299
|
-
cause: error,
|
|
4300
|
-
possibleFixes: [`Create a new connected account for user ${userId}`]
|
|
4301
|
-
});
|
|
4302
4314
|
throw error;
|
|
4303
4315
|
}
|
|
4304
4316
|
const upsertParams = {
|
|
4305
|
-
connected_account_id: connectedAccountId,
|
|
4317
|
+
connected_account_id: parsedBody.data.connectedAccountId,
|
|
4306
4318
|
trigger_config: parsedBody.data.triggerConfig,
|
|
4307
4319
|
toolkit_versions: this.toolkitVersions,
|
|
4308
4320
|
user_id: userId
|
|
@@ -4917,105 +4929,105 @@ var Triggers = class {
|
|
|
4917
4929
|
|
|
4918
4930
|
//#endregion
|
|
4919
4931
|
//#region src/types/mcp.experimental.types.ts
|
|
4920
|
-
const MCPServerInstanceSchema = z
|
|
4921
|
-
id: z
|
|
4922
|
-
name: z
|
|
4923
|
-
type: z
|
|
4924
|
-
url: z
|
|
4925
|
-
userId: z
|
|
4926
|
-
allowedTools: z
|
|
4927
|
-
authConfigs: z
|
|
4932
|
+
const MCPServerInstanceSchema = z.object({
|
|
4933
|
+
id: z.string(),
|
|
4934
|
+
name: z.string(),
|
|
4935
|
+
type: z.literal("streamable_http"),
|
|
4936
|
+
url: z.string(),
|
|
4937
|
+
userId: z.string(),
|
|
4938
|
+
allowedTools: z.array(z.string()),
|
|
4939
|
+
authConfigs: z.array(z.string())
|
|
4928
4940
|
});
|
|
4929
4941
|
/**
|
|
4930
4942
|
* MCP Create Method Input Types
|
|
4931
4943
|
*/
|
|
4932
|
-
const MCPConfigToolkitsSchema = z
|
|
4933
|
-
toolkit: z
|
|
4934
|
-
authConfigId: z
|
|
4944
|
+
const MCPConfigToolkitsSchema = z.object({
|
|
4945
|
+
toolkit: z.string().describe("Id of the toolkit").optional(),
|
|
4946
|
+
authConfigId: z.string().describe("Id of the auth config").optional()
|
|
4935
4947
|
});
|
|
4936
|
-
const MCPConfigCreationParamsSchema = z
|
|
4937
|
-
toolkits: z
|
|
4938
|
-
allowedTools: z
|
|
4939
|
-
manuallyManageConnections: z
|
|
4948
|
+
const MCPConfigCreationParamsSchema = z.object({
|
|
4949
|
+
toolkits: z.array(z.union([MCPConfigToolkitsSchema, z.string()])),
|
|
4950
|
+
allowedTools: z.array(z.string()).optional(),
|
|
4951
|
+
manuallyManageConnections: z.boolean().default(false).optional().describe(`Whether to manually manage accounts. If true, you need to manage accounts manually connect user accounts.
|
|
4940
4952
|
If set to false, composio will inject account maangement tools into your mcp server for agents to request and authenticate accounts.
|
|
4941
4953
|
defaults to false`)
|
|
4942
4954
|
});
|
|
4943
|
-
const MCPConfigResponseSchema = z
|
|
4955
|
+
const MCPConfigResponseSchema = z.object({
|
|
4944
4956
|
/**
|
|
4945
4957
|
* Unique identifier for the newly created custom MCP server
|
|
4946
4958
|
*/
|
|
4947
|
-
id: z
|
|
4959
|
+
id: z.string(),
|
|
4948
4960
|
/**
|
|
4949
4961
|
* Human-readable name of the custom MCP server
|
|
4950
4962
|
*/
|
|
4951
|
-
name: z
|
|
4963
|
+
name: z.string(),
|
|
4952
4964
|
/**
|
|
4953
4965
|
* List of tool identifiers that are enabled for this server
|
|
4954
4966
|
*/
|
|
4955
|
-
allowedTools: z
|
|
4967
|
+
allowedTools: z.array(z.string()),
|
|
4956
4968
|
/**
|
|
4957
4969
|
* ID references to the auth configurations used by this server
|
|
4958
4970
|
*/
|
|
4959
|
-
authConfigIds: z
|
|
4971
|
+
authConfigIds: z.array(z.string()),
|
|
4960
4972
|
/**
|
|
4961
4973
|
* Set of command line instructions for connecting various clients to this MCP server
|
|
4962
4974
|
*/
|
|
4963
|
-
commands: z
|
|
4975
|
+
commands: z.object({
|
|
4964
4976
|
/**
|
|
4965
4977
|
* Command line instruction for Claude client setup
|
|
4966
4978
|
*/
|
|
4967
|
-
claude: z
|
|
4979
|
+
claude: z.string(),
|
|
4968
4980
|
/**
|
|
4969
4981
|
* Command line instruction for Cursor client setup
|
|
4970
4982
|
*/
|
|
4971
|
-
cursor: z
|
|
4983
|
+
cursor: z.string(),
|
|
4972
4984
|
/**
|
|
4973
4985
|
* Command line instruction for Windsurf client setup
|
|
4974
4986
|
*/
|
|
4975
|
-
windsurf: z
|
|
4987
|
+
windsurf: z.string()
|
|
4976
4988
|
}),
|
|
4977
4989
|
/**
|
|
4978
4990
|
* URL endpoint for establishing Server-Sent Events (SSE) connection to this MCP server
|
|
4979
4991
|
*/
|
|
4980
|
-
MCPUrl: z
|
|
4992
|
+
MCPUrl: z.string()
|
|
4981
4993
|
});
|
|
4982
|
-
const MCPGetInstanceParamsSchema = z
|
|
4994
|
+
const MCPGetInstanceParamsSchema = z.object({ manuallyManageConnections: z.boolean().default(false).optional().describe(`Whether to manually manage accounts. If true, you need to manage accounts manually connect user accounts.
|
|
4983
4995
|
If set to false, composio will inject account maangement tools into your mcp server for agents to request and authenticate accounts.
|
|
4984
4996
|
defaults to false`) });
|
|
4985
|
-
const MCPListParamsSchema = z
|
|
4986
|
-
page: z
|
|
4987
|
-
limit: z
|
|
4988
|
-
toolkits: z
|
|
4989
|
-
authConfigs: z
|
|
4990
|
-
name: z
|
|
4997
|
+
const MCPListParamsSchema = z.object({
|
|
4998
|
+
page: z.number().optional().default(1),
|
|
4999
|
+
limit: z.number().optional().default(10),
|
|
5000
|
+
toolkits: z.array(z.string()).optional().default([]),
|
|
5001
|
+
authConfigs: z.array(z.string()).optional().default([]),
|
|
5002
|
+
name: z.string().optional()
|
|
4991
5003
|
});
|
|
4992
|
-
const MCPItemSchema = MCPConfigResponseSchema.extend({ ...z
|
|
4993
|
-
toolkitIcons: z
|
|
4994
|
-
serverInstanceCount: z
|
|
4995
|
-
toolkits: z
|
|
5004
|
+
const MCPItemSchema = MCPConfigResponseSchema.extend({ ...z.object({
|
|
5005
|
+
toolkitIcons: z.record(z.string(), z.string()),
|
|
5006
|
+
serverInstanceCount: z.number(),
|
|
5007
|
+
toolkits: z.array(z.string())
|
|
4996
5008
|
}).shape });
|
|
4997
|
-
const MCPListResponseSchema = z
|
|
4998
|
-
items: z
|
|
4999
|
-
currentPage: z
|
|
5000
|
-
totalPages: z
|
|
5009
|
+
const MCPListResponseSchema = z.object({
|
|
5010
|
+
items: z.array(MCPItemSchema),
|
|
5011
|
+
currentPage: z.number(),
|
|
5012
|
+
totalPages: z.number()
|
|
5001
5013
|
});
|
|
5002
|
-
const MCPUpdateParamsSchema = z
|
|
5003
|
-
name: z
|
|
5004
|
-
toolkits: z
|
|
5005
|
-
allowedTools: z
|
|
5006
|
-
manuallyManageConnections: z
|
|
5014
|
+
const MCPUpdateParamsSchema = z.object({
|
|
5015
|
+
name: z.string().optional(),
|
|
5016
|
+
toolkits: z.array(z.union([MCPConfigToolkitsSchema, z.string()])).optional(),
|
|
5017
|
+
allowedTools: z.array(z.string()).optional(),
|
|
5018
|
+
manuallyManageConnections: z.boolean().optional().describe(`Whether to manually manage accounts. If true, you need to manage accounts manually connect user accounts.
|
|
5007
5019
|
If set to false, composio will inject account maangement tools into your mcp server for agents to request and authenticate accounts.
|
|
5008
5020
|
defaults to false`)
|
|
5009
5021
|
});
|
|
5010
|
-
const MCPServerConnectionStatus = z
|
|
5011
|
-
connected: z
|
|
5012
|
-
toolkit: z
|
|
5013
|
-
connectedAccountId: z
|
|
5022
|
+
const MCPServerConnectionStatus = z.object({
|
|
5023
|
+
connected: z.boolean(),
|
|
5024
|
+
toolkit: z.string(),
|
|
5025
|
+
connectedAccountId: z.string()
|
|
5014
5026
|
});
|
|
5015
|
-
const MCPServerConnectedAccountsSchema = z
|
|
5016
|
-
toolkit: z
|
|
5017
|
-
authConfigId: z
|
|
5018
|
-
connectedAccountId: z
|
|
5027
|
+
const MCPServerConnectedAccountsSchema = z.record(z.string(), z.array(z.object({
|
|
5028
|
+
toolkit: z.string(),
|
|
5029
|
+
authConfigId: z.string(),
|
|
5030
|
+
connectedAccountId: z.string()
|
|
5019
5031
|
})));
|
|
5020
5032
|
|
|
5021
5033
|
//#endregion
|
|
@@ -5419,11 +5431,11 @@ function getToolkitVersionsFromEnv(defaultVersions) {
|
|
|
5419
5431
|
const envPrefixedVersions = getEnvsWithPrefix(`COMPOSIO_TOOLKIT_VERSION_`);
|
|
5420
5432
|
const toolkitVersionsFromEnv = Object.entries(envPrefixedVersions).reduce((acc, [key, value]) => {
|
|
5421
5433
|
const toolkitName = key.replace("COMPOSIO_TOOLKIT_VERSION_", "");
|
|
5422
|
-
acc[toolkitName
|
|
5434
|
+
acc[normalizeToolkitSlug(toolkitName)] = value;
|
|
5423
5435
|
return acc;
|
|
5424
5436
|
}, {});
|
|
5425
5437
|
let userProvidedToolkitVersions = {};
|
|
5426
|
-
if (defaultVersions && typeof defaultVersions === "object") userProvidedToolkitVersions = Object.fromEntries(Object.entries(defaultVersions).map(([key, value]) => [key
|
|
5438
|
+
if (defaultVersions && typeof defaultVersions === "object") userProvidedToolkitVersions = Object.fromEntries(Object.entries(defaultVersions).map(([key, value]) => [normalizeToolkitSlug(key), value]));
|
|
5427
5439
|
const toolkitVersions = {
|
|
5428
5440
|
...toolkitVersionsFromEnv,
|
|
5429
5441
|
...userProvidedToolkitVersions
|
|
@@ -5634,7 +5646,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
5634
5646
|
function: {
|
|
5635
5647
|
name: tool.slug,
|
|
5636
5648
|
description: tool.description,
|
|
5637
|
-
parameters: tool.inputParameters
|
|
5649
|
+
parameters: deduplicateJsonSchemaRequiredArrays(tool.inputParameters)
|
|
5638
5650
|
}
|
|
5639
5651
|
};
|
|
5640
5652
|
};
|
|
@@ -5766,11 +5778,13 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
5766
5778
|
*/
|
|
5767
5779
|
async handleToolCalls(userId, chatCompletion, options, modifiers) {
|
|
5768
5780
|
const outputs = [];
|
|
5769
|
-
|
|
5770
|
-
|
|
5781
|
+
const [choice] = chatCompletion.choices;
|
|
5782
|
+
for (const toolCall of choice?.message.tool_calls ?? []) {
|
|
5783
|
+
if (toolCall.type !== "function") continue;
|
|
5784
|
+
const toolResult = await this.executeToolCall(userId, toolCall, options, modifiers);
|
|
5771
5785
|
outputs.push({
|
|
5772
5786
|
role: "tool",
|
|
5773
|
-
tool_call_id:
|
|
5787
|
+
tool_call_id: toolCall.id,
|
|
5774
5788
|
content: toolResult
|
|
5775
5789
|
});
|
|
5776
5790
|
}
|
|
@@ -5990,7 +6004,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
5990
6004
|
|
|
5991
6005
|
//#endregion
|
|
5992
6006
|
//#region package.json
|
|
5993
|
-
var version = "0.
|
|
6007
|
+
var version = "0.14.0";
|
|
5994
6008
|
|
|
5995
6009
|
//#endregion
|
|
5996
6010
|
//#region src/utils/session.ts
|
|
@@ -6034,7 +6048,7 @@ const getDefaultHeaders = (headers, provider) => {
|
|
|
6034
6048
|
//#endregion
|
|
6035
6049
|
//#region src/types/toolRouter.types.ts
|
|
6036
6050
|
const SessionPreset = { DIRECT_TOOLS: "direct_tools" };
|
|
6037
|
-
const MCPServerTypeSchema = z
|
|
6051
|
+
const MCPServerTypeSchema = z.enum(["http", "sse"]);
|
|
6038
6052
|
/**
|
|
6039
6053
|
* Sandbox compute tier for the session sandbox.
|
|
6040
6054
|
*
|
|
@@ -6047,41 +6061,41 @@ const MCPServerTypeSchema = z$1.enum(["http", "sse"]);
|
|
|
6047
6061
|
*
|
|
6048
6062
|
* Defaults to `standard` server-side when omitted.
|
|
6049
6063
|
*/
|
|
6050
|
-
const SandboxSizeSchema = z
|
|
6064
|
+
const SandboxSizeSchema = z.enum([
|
|
6051
6065
|
"standard",
|
|
6052
6066
|
"medium",
|
|
6053
6067
|
"large",
|
|
6054
6068
|
"xlarge"
|
|
6055
6069
|
]);
|
|
6056
|
-
const ToolRouterSandboxConfigSchema = z
|
|
6057
|
-
enable: z
|
|
6058
|
-
enableProxyExecution: z
|
|
6059
|
-
autoOffloadThreshold: z
|
|
6070
|
+
const ToolRouterSandboxConfigSchema = z.object({
|
|
6071
|
+
enable: z.boolean().default(true).describe("Whether to enable the sandbox entirely. Defaults to true. When set to false, no code execution tools (COMPOSIO_REMOTE_WORKBENCH, COMPOSIO_REMOTE_BASH_TOOL) are available in the session."),
|
|
6072
|
+
enableProxyExecution: z.boolean().optional().describe("Whether to enable proxy execution in the session sandbox"),
|
|
6073
|
+
autoOffloadThreshold: z.number().optional().describe("The auto offload threshold in characters for tool execution to move into the sandbox"),
|
|
6060
6074
|
sandboxSize: SandboxSizeSchema.optional().describe("Sandbox compute tier. One of \"standard\" (1 vCPU / 1 GB), \"medium\" (2 vCPU / 2 GB), \"large\" (4 vCPU / 4 GB), or \"xlarge\" (8 vCPU / 8 GB). Defaults to \"standard\" server-side. Changing this on an existing session recreates the session sandbox on next access; the in-memory FS is lost, but /mnt/files/ persists.")
|
|
6061
6075
|
});
|
|
6062
|
-
const ToolRouterConfigManageConnectionsSchema = z
|
|
6063
|
-
enable: z
|
|
6064
|
-
callbackUrl: z
|
|
6065
|
-
waitForConnections: z
|
|
6076
|
+
const ToolRouterConfigManageConnectionsSchema = z.object({
|
|
6077
|
+
enable: z.boolean().default(true).optional().describe("Whether to use tools to manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually"),
|
|
6078
|
+
callbackUrl: z.string().optional().describe("The callback uri to use in the tool router session"),
|
|
6079
|
+
waitForConnections: z.boolean().optional().describe("Whether to wait for users to finish authenticating connections before proceeding to the next step. Defaults to false, if set to true, a wait for connections tool call will happen and finish when the connections are ready")
|
|
6066
6080
|
}).strict();
|
|
6067
|
-
const ToolRouterToolkitsParamSchema = z
|
|
6068
|
-
const ToolRouterToolkitsDisabledConfigSchema = z
|
|
6069
|
-
const ToolRouterToolkitsEnabledConfigSchema = z
|
|
6070
|
-
const ToolRouterManageConnectionsConfigSchema = z
|
|
6071
|
-
enable: z
|
|
6072
|
-
callbackUrl: z
|
|
6081
|
+
const ToolRouterToolkitsParamSchema = z.array(z.string()).describe("List of toolkits to enable in the tool router session");
|
|
6082
|
+
const ToolRouterToolkitsDisabledConfigSchema = z.object({ disable: ToolRouterToolkitsParamSchema.describe("List of toolkits to disable in the tool router session") }).strict();
|
|
6083
|
+
const ToolRouterToolkitsEnabledConfigSchema = z.object({ enable: ToolRouterToolkitsParamSchema.describe("List of toolkits to enable in the tool router session") }).strict();
|
|
6084
|
+
const ToolRouterManageConnectionsConfigSchema = z.object({
|
|
6085
|
+
enable: z.boolean().optional().describe("Whether to use tools to manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually").default(true),
|
|
6086
|
+
callbackUrl: z.string().optional().describe("The callback url to use in the tool router session")
|
|
6073
6087
|
});
|
|
6074
|
-
const ToolRouterTagsParamSchema = z
|
|
6088
|
+
const ToolRouterTagsParamSchema = z.array(z.enum([
|
|
6075
6089
|
"readOnlyHint",
|
|
6076
6090
|
"destructiveHint",
|
|
6077
6091
|
"idempotentHint",
|
|
6078
6092
|
"openWorldHint"
|
|
6079
6093
|
])).describe("The tags to filter the tools by");
|
|
6080
|
-
const ToolRouterTagsEnableDisableSchema = z
|
|
6094
|
+
const ToolRouterTagsEnableDisableSchema = z.object({
|
|
6081
6095
|
enable: ToolRouterTagsParamSchema.optional().describe("The tags to enable in the tool router session"),
|
|
6082
6096
|
disable: ToolRouterTagsParamSchema.optional().describe("The tags to disable in the tool router session")
|
|
6083
6097
|
}).strict();
|
|
6084
|
-
const ToolRouterConfigTagsSchema = z
|
|
6098
|
+
const ToolRouterConfigTagsSchema = z.union([ToolRouterTagsParamSchema, ToolRouterTagsEnableDisableSchema]).describe("The tags to use in the tool router session");
|
|
6085
6099
|
/**
|
|
6086
6100
|
* Tools config - Configure tools per toolkit using toolkit slug as key
|
|
6087
6101
|
* @example
|
|
@@ -6104,51 +6118,51 @@ const ToolRouterConfigTagsSchema = z$1.union([ToolRouterTagsParamSchema, ToolRou
|
|
|
6104
6118
|
* }
|
|
6105
6119
|
* ```
|
|
6106
6120
|
*/
|
|
6107
|
-
const ToolRouterToolsParamSchema = z
|
|
6108
|
-
const ToolRouterConfigToolsSchema = z
|
|
6121
|
+
const ToolRouterToolsParamSchema = z.array(z.string()).describe("The tools to use in the tool router session");
|
|
6122
|
+
const ToolRouterConfigToolsSchema = z.union([
|
|
6109
6123
|
ToolRouterToolsParamSchema,
|
|
6110
|
-
z
|
|
6111
|
-
z
|
|
6112
|
-
z
|
|
6124
|
+
z.object({ enable: ToolRouterToolsParamSchema.describe("The tools to enable in the tool router session") }).strict(),
|
|
6125
|
+
z.object({ disable: ToolRouterToolsParamSchema.describe("The tools to disable in the tool router session") }).strict(),
|
|
6126
|
+
z.object({ tags: ToolRouterConfigTagsSchema.describe("The tags to filter the tools by, this will override the global tags") }).strict()
|
|
6113
6127
|
]).superRefine((val, ctx) => {
|
|
6114
6128
|
if (typeof val === "object" && !Array.isArray(val)) {
|
|
6115
6129
|
const keys = Object.keys(val);
|
|
6116
6130
|
if (keys.length > 1) ctx.addIssue({
|
|
6117
|
-
code: z
|
|
6131
|
+
code: z.ZodIssueCode.custom,
|
|
6118
6132
|
message: `Only one of 'enable', 'disable', or 'tags' can be specified, but found: ${keys.join(", ")}`,
|
|
6119
6133
|
path: keys
|
|
6120
6134
|
});
|
|
6121
6135
|
}
|
|
6122
6136
|
});
|
|
6123
|
-
const ToolRouterCreateSessionConfigBaseSchema = z
|
|
6124
|
-
sessionPreset: z
|
|
6125
|
-
mcp: z
|
|
6126
|
-
tools: z
|
|
6137
|
+
const ToolRouterCreateSessionConfigBaseSchema = z.object({
|
|
6138
|
+
sessionPreset: z.literal(SessionPreset.DIRECT_TOOLS).optional().describe("Shortcut to expose every tool allowed by the session filters directly in session.tools() and the MCP tool list. This disables meta tools by default (search, multi-execute, manage-connections, and workbench). Use when all tools are known upfront and helper/meta tools are not needed. Without this preset, ToolRouter uses its default configuration with meta tools enabled."),
|
|
6139
|
+
mcp: z.boolean().optional().describe("When true, the returned session surfaces its hosted MCP endpoint (`session.mcp.url` / `session.mcp.headers`) in the type. The endpoint exists on every session at runtime regardless of this flag, but is only typed when `mcp: true` is passed. Default native tools (`session.tools()`) are unaffected. See https://docs.composio.dev/docs/sessions-via-mcp"),
|
|
6140
|
+
tools: z.record(z.string(), z.union([ToolRouterToolsParamSchema, ToolRouterConfigToolsSchema])).optional().describe("The tools to use in the tool router session"),
|
|
6127
6141
|
tags: ToolRouterConfigTagsSchema.optional().describe("Global tags to filter the tools by"),
|
|
6128
|
-
toolkits: z
|
|
6142
|
+
toolkits: z.union([
|
|
6129
6143
|
ToolRouterToolkitsParamSchema,
|
|
6130
6144
|
ToolRouterToolkitsDisabledConfigSchema,
|
|
6131
6145
|
ToolRouterToolkitsEnabledConfigSchema
|
|
6132
6146
|
]).optional().describe("The toolkits to use in the tool router session"),
|
|
6133
|
-
authConfigs: z
|
|
6134
|
-
connectedAccounts: z
|
|
6135
|
-
manageConnections: z
|
|
6147
|
+
authConfigs: z.record(z.string(), z.string()).describe("The auth configs to use in the tool router session. The key is the toolkit slug, the value is the auth config id.").default({}),
|
|
6148
|
+
connectedAccounts: z.record(z.string(), z.union([z.string(), z.array(z.string())])).describe("The connected accounts to use in the tool router session. The key is the toolkit slug, the value is a connected account id or an array of ids. Only one account per toolkit is allowed when multi-account mode is disabled.").default({}),
|
|
6149
|
+
manageConnections: z.union([z.boolean(), ToolRouterConfigManageConnectionsSchema]).optional().default(true).describe("The config for the manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually. If set to an object, you can configure the manage connections settings."),
|
|
6136
6150
|
sandbox: ToolRouterSandboxConfigSchema.optional().describe("The sandbox config for this session. Prefer this over workbench."),
|
|
6137
6151
|
workbench: ToolRouterSandboxConfigSchema.optional().describe("Deprecated alias for sandbox. Accepted for backwards compatibility."),
|
|
6138
|
-
multiAccount: z
|
|
6139
|
-
enable: z
|
|
6140
|
-
maxAccountsPerToolkit: z
|
|
6141
|
-
requireExplicitSelection: z
|
|
6152
|
+
multiAccount: z.object({
|
|
6153
|
+
enable: z.boolean().default(false).describe("When true, enables multi-account mode for this session. Defaults to false."),
|
|
6154
|
+
maxAccountsPerToolkit: z.number().int().min(2).max(10).optional().describe("Maximum number of connected accounts allowed per toolkit. Defaults to 5 when multi-account is enabled."),
|
|
6155
|
+
requireExplicitSelection: z.boolean().optional().describe("When true, require explicit account selection when multiple accounts are connected. When false (default), use the first/default account.")
|
|
6142
6156
|
}).optional().describe("Multi-account configuration for this session"),
|
|
6143
|
-
preload: z
|
|
6144
|
-
experimental: z
|
|
6145
|
-
assistivePrompt: z
|
|
6146
|
-
customTools: z
|
|
6147
|
-
customToolkits: z
|
|
6157
|
+
preload: z.object({ tools: z.union([z.array(z.string()), z.literal("all")]).optional().describe("Tool slugs to preload into session.tools() and the MCP tool list, or \"all\" to preload every app tool allowed by the session filters. \"all\" requires a positive filter such as toolkits, tools, or tags; the backend validates and caps the final tool set.") }).strict().optional().describe("Preload configuration for tools that should be exposed without search."),
|
|
6158
|
+
experimental: z.object({
|
|
6159
|
+
assistivePrompt: z.object({ userTimezone: z.string().optional().describe("IANA timezone identifier (e.g., \"America/New_York\", \"Europe/London\") for timezone-aware assistive prompts") }).optional().describe("Configuration for assistive prompt generation"),
|
|
6160
|
+
customTools: z.array(z.custom()).optional().describe("Custom tools to include in this session. Created via createCustomTool() from @composio/core/experimental."),
|
|
6161
|
+
customToolkits: z.array(z.custom()).optional().describe("Custom toolkits to include in this session. Created via createCustomToolkit() from @composio/core/experimental.")
|
|
6148
6162
|
}).optional().describe("Experimental features configuration - not stable, may be modified or removed")
|
|
6149
6163
|
}).partial().superRefine((config, ctx) => {
|
|
6150
6164
|
if (config.sandbox !== void 0 && config.workbench !== void 0) ctx.addIssue({
|
|
6151
|
-
code: z
|
|
6165
|
+
code: z.ZodIssueCode.custom,
|
|
6152
6166
|
message: "Pass either sandbox or workbench, not both. workbench is a backwards-compatible alias for sandbox.",
|
|
6153
6167
|
path: ["sandbox"]
|
|
6154
6168
|
});
|
|
@@ -6165,115 +6179,115 @@ const applyDirectToolsPresetDefaults = (value) => {
|
|
|
6165
6179
|
preload: config.preload === void 0 ? { tools: "all" } : config.preload
|
|
6166
6180
|
};
|
|
6167
6181
|
};
|
|
6168
|
-
const ToolRouterCreateSessionConfigSchema = z
|
|
6169
|
-
const ToolkitConnectionStateSchema = z
|
|
6170
|
-
slug: z
|
|
6171
|
-
name: z
|
|
6172
|
-
logo: z
|
|
6173
|
-
isNoAuth: z
|
|
6174
|
-
connection: z
|
|
6175
|
-
isActive: z
|
|
6176
|
-
authConfig: z
|
|
6177
|
-
id: z
|
|
6178
|
-
mode: z
|
|
6179
|
-
isComposioManaged: z
|
|
6182
|
+
const ToolRouterCreateSessionConfigSchema = z.preprocess(applyDirectToolsPresetDefaults, ToolRouterCreateSessionConfigBaseSchema).describe("The config for the tool router session");
|
|
6183
|
+
const ToolkitConnectionStateSchema = z.object({
|
|
6184
|
+
slug: z.string().describe("The slug of a toolkit"),
|
|
6185
|
+
name: z.string().describe("The name of a toolkit"),
|
|
6186
|
+
logo: z.string().optional().describe("The logo of a toolkit"),
|
|
6187
|
+
isNoAuth: z.boolean().default(false).describe("Whether the toolkit is no auth or not"),
|
|
6188
|
+
connection: z.object({
|
|
6189
|
+
isActive: z.boolean().describe("Whether the connection is active or not"),
|
|
6190
|
+
authConfig: z.object({
|
|
6191
|
+
id: z.string().describe("The id of the auth config"),
|
|
6192
|
+
mode: z.string().describe("The auth scheme used by the auth config"),
|
|
6193
|
+
isComposioManaged: z.boolean().describe("Whether the auth config is managed by Composio")
|
|
6180
6194
|
}).nullish().describe("The auth config of a toolkit"),
|
|
6181
|
-
connectedAccount: z
|
|
6182
|
-
id: z
|
|
6183
|
-
status: z
|
|
6195
|
+
connectedAccount: z.object({
|
|
6196
|
+
id: z.string().describe("The id of the connected account"),
|
|
6197
|
+
status: z.string().describe("The status of the connected account")
|
|
6184
6198
|
}).optional().describe("The connected account of a toolkit")
|
|
6185
6199
|
}).optional().describe("The connection of a toolkit")
|
|
6186
6200
|
}).describe("The connection state of a toolkit");
|
|
6187
|
-
const ToolkitConnectionsDetailsSchema = z
|
|
6188
|
-
items: z
|
|
6189
|
-
cursor: z
|
|
6190
|
-
totalPages: z
|
|
6201
|
+
const ToolkitConnectionsDetailsSchema = z.object({
|
|
6202
|
+
items: z.array(ToolkitConnectionStateSchema),
|
|
6203
|
+
cursor: z.string().optional(),
|
|
6204
|
+
totalPages: z.number()
|
|
6191
6205
|
});
|
|
6192
|
-
const ToolRouterMCPServerConfigSchema = z
|
|
6206
|
+
const ToolRouterMCPServerConfigSchema = z.object({
|
|
6193
6207
|
type: MCPServerTypeSchema,
|
|
6194
|
-
url: z
|
|
6195
|
-
headers: z
|
|
6208
|
+
url: z.string(),
|
|
6209
|
+
headers: z.record(z.string(), z.string()).optional()
|
|
6196
6210
|
});
|
|
6197
|
-
const ToolRouterToolkitsOptionsSchema = z
|
|
6198
|
-
toolkits: z
|
|
6199
|
-
cursor: z
|
|
6200
|
-
limit: z
|
|
6201
|
-
isConnected: z
|
|
6202
|
-
search: z
|
|
6211
|
+
const ToolRouterToolkitsOptionsSchema = z.object({
|
|
6212
|
+
toolkits: z.array(z.string()).optional(),
|
|
6213
|
+
cursor: z.string().optional(),
|
|
6214
|
+
limit: z.number().optional(),
|
|
6215
|
+
isConnected: z.boolean().optional(),
|
|
6216
|
+
search: z.string().optional()
|
|
6203
6217
|
});
|
|
6204
|
-
const ToolRouterSessionSearchResultReferenceWorkbenchSnippetSchema = z
|
|
6205
|
-
code: z
|
|
6206
|
-
description: z
|
|
6218
|
+
const ToolRouterSessionSearchResultReferenceWorkbenchSnippetSchema = z.object({
|
|
6219
|
+
code: z.string(),
|
|
6220
|
+
description: z.string()
|
|
6207
6221
|
});
|
|
6208
|
-
const ToolRouterSessionSearchResultSchema = z
|
|
6209
|
-
index: z
|
|
6210
|
-
useCase: z
|
|
6211
|
-
primaryToolSlugs: z
|
|
6212
|
-
relatedToolSlugs: z
|
|
6213
|
-
toolkits: z
|
|
6214
|
-
difficulty: z
|
|
6215
|
-
error: z
|
|
6216
|
-
executionGuidance: z
|
|
6217
|
-
knownPitfalls: z
|
|
6218
|
-
memory: z
|
|
6219
|
-
planId: z
|
|
6220
|
-
recommendedPlanSteps: z
|
|
6221
|
-
referenceWorkbenchSnippets: z
|
|
6222
|
+
const ToolRouterSessionSearchResultSchema = z.object({
|
|
6223
|
+
index: z.number(),
|
|
6224
|
+
useCase: z.string(),
|
|
6225
|
+
primaryToolSlugs: z.array(z.string()),
|
|
6226
|
+
relatedToolSlugs: z.array(z.string()),
|
|
6227
|
+
toolkits: z.array(z.string()),
|
|
6228
|
+
difficulty: z.string().optional(),
|
|
6229
|
+
error: z.string().nullable().optional(),
|
|
6230
|
+
executionGuidance: z.string().optional(),
|
|
6231
|
+
knownPitfalls: z.array(z.string()).optional(),
|
|
6232
|
+
memory: z.record(z.string(), z.array(z.string())).optional(),
|
|
6233
|
+
planId: z.string().optional(),
|
|
6234
|
+
recommendedPlanSteps: z.array(z.string()).optional(),
|
|
6235
|
+
referenceWorkbenchSnippets: z.array(ToolRouterSessionSearchResultReferenceWorkbenchSnippetSchema).optional()
|
|
6222
6236
|
});
|
|
6223
|
-
const ToolRouterSessionSearchSessionSchema = z
|
|
6224
|
-
id: z
|
|
6225
|
-
generateId: z
|
|
6226
|
-
instructions: z
|
|
6237
|
+
const ToolRouterSessionSearchSessionSchema = z.object({
|
|
6238
|
+
id: z.string(),
|
|
6239
|
+
generateId: z.boolean(),
|
|
6240
|
+
instructions: z.string()
|
|
6227
6241
|
});
|
|
6228
|
-
const ToolRouterSessionSearchTimeInfoSchema = z
|
|
6229
|
-
currentTimeUtc: z
|
|
6230
|
-
currentTimeUtcEpochSeconds: z
|
|
6231
|
-
message: z
|
|
6242
|
+
const ToolRouterSessionSearchTimeInfoSchema = z.object({
|
|
6243
|
+
currentTimeUtc: z.string(),
|
|
6244
|
+
currentTimeUtcEpochSeconds: z.number(),
|
|
6245
|
+
message: z.string()
|
|
6232
6246
|
});
|
|
6233
|
-
const ToolRouterSessionSearchToolSchemasSchemaRefSchema = z
|
|
6234
|
-
args: z
|
|
6235
|
-
message: z
|
|
6236
|
-
tool: z
|
|
6247
|
+
const ToolRouterSessionSearchToolSchemasSchemaRefSchema = z.object({
|
|
6248
|
+
args: z.object({ toolSlugs: z.array(z.string()) }),
|
|
6249
|
+
message: z.string().optional(),
|
|
6250
|
+
tool: z.literal("COMPOSIO_GET_TOOL_SCHEMAS")
|
|
6237
6251
|
});
|
|
6238
|
-
const ToolRouterSessionSearchToolSchemaSchema = z
|
|
6239
|
-
toolSlug: z
|
|
6240
|
-
toolkit: z
|
|
6241
|
-
description: z
|
|
6242
|
-
hasFullSchema: z
|
|
6243
|
-
inputSchema: z
|
|
6244
|
-
outputSchema: z
|
|
6252
|
+
const ToolRouterSessionSearchToolSchemaSchema = z.object({
|
|
6253
|
+
toolSlug: z.string(),
|
|
6254
|
+
toolkit: z.string(),
|
|
6255
|
+
description: z.string().optional(),
|
|
6256
|
+
hasFullSchema: z.boolean().optional(),
|
|
6257
|
+
inputSchema: z.record(z.string(), z.unknown()).optional(),
|
|
6258
|
+
outputSchema: z.record(z.string(), z.unknown()).optional(),
|
|
6245
6259
|
schemaRef: ToolRouterSessionSearchToolSchemasSchemaRefSchema.optional()
|
|
6246
6260
|
});
|
|
6247
|
-
const ToolRouterSessionSearchToolkitConnectionStatusSchema = z
|
|
6248
|
-
toolkit: z
|
|
6249
|
-
description: z
|
|
6250
|
-
hasActiveConnection: z
|
|
6251
|
-
statusMessage: z
|
|
6252
|
-
connectionDetails: z
|
|
6253
|
-
currentUserInfo: z
|
|
6261
|
+
const ToolRouterSessionSearchToolkitConnectionStatusSchema = z.object({
|
|
6262
|
+
toolkit: z.string(),
|
|
6263
|
+
description: z.string(),
|
|
6264
|
+
hasActiveConnection: z.boolean(),
|
|
6265
|
+
statusMessage: z.string(),
|
|
6266
|
+
connectionDetails: z.record(z.string(), z.unknown()).optional(),
|
|
6267
|
+
currentUserInfo: z.record(z.string(), z.unknown()).optional()
|
|
6254
6268
|
});
|
|
6255
|
-
const ToolRouterSessionSearchResponseSchema = z
|
|
6256
|
-
success: z
|
|
6257
|
-
error: z
|
|
6258
|
-
results: z
|
|
6259
|
-
toolSchemas: z
|
|
6260
|
-
toolkitConnectionStatuses: z
|
|
6261
|
-
nextStepsGuidance: z
|
|
6269
|
+
const ToolRouterSessionSearchResponseSchema = z.object({
|
|
6270
|
+
success: z.boolean(),
|
|
6271
|
+
error: z.string().nullable(),
|
|
6272
|
+
results: z.array(ToolRouterSessionSearchResultSchema),
|
|
6273
|
+
toolSchemas: z.record(z.string(), ToolRouterSessionSearchToolSchemaSchema),
|
|
6274
|
+
toolkitConnectionStatuses: z.array(ToolRouterSessionSearchToolkitConnectionStatusSchema),
|
|
6275
|
+
nextStepsGuidance: z.array(z.string()),
|
|
6262
6276
|
session: ToolRouterSessionSearchSessionSchema,
|
|
6263
6277
|
timeInfo: ToolRouterSessionSearchTimeInfoSchema
|
|
6264
6278
|
});
|
|
6265
|
-
const ToolRouterSessionExecuteResponseSchema = z
|
|
6266
|
-
data: z
|
|
6267
|
-
error: z
|
|
6268
|
-
logId: z
|
|
6279
|
+
const ToolRouterSessionExecuteResponseSchema = z.object({
|
|
6280
|
+
data: z.record(z.string(), z.unknown()),
|
|
6281
|
+
error: z.string().nullable(),
|
|
6282
|
+
logId: z.string()
|
|
6269
6283
|
});
|
|
6270
|
-
const SessionProxyExecuteParamsSchema = z
|
|
6284
|
+
const SessionProxyExecuteParamsSchema = z.object({
|
|
6271
6285
|
/** The toolkit whose connected account to use for auth (e.g. 'gmail', 'github') */
|
|
6272
|
-
toolkit: z
|
|
6286
|
+
toolkit: z.string(),
|
|
6273
6287
|
/** The API endpoint URL to call */
|
|
6274
|
-
endpoint: z
|
|
6288
|
+
endpoint: z.string(),
|
|
6275
6289
|
/** HTTP method */
|
|
6276
|
-
method: z
|
|
6290
|
+
method: z.enum([
|
|
6277
6291
|
"GET",
|
|
6278
6292
|
"POST",
|
|
6279
6293
|
"PUT",
|
|
@@ -6281,47 +6295,47 @@ const SessionProxyExecuteParamsSchema = z$1.object({
|
|
|
6281
6295
|
"PATCH"
|
|
6282
6296
|
]),
|
|
6283
6297
|
/** Request body (for POST/PUT/PATCH) */
|
|
6284
|
-
body: z
|
|
6298
|
+
body: z.unknown().optional(),
|
|
6285
6299
|
/** Query params or headers to include */
|
|
6286
|
-
parameters: z
|
|
6287
|
-
in: z
|
|
6288
|
-
name: z
|
|
6289
|
-
value: z
|
|
6300
|
+
parameters: z.array(z.object({
|
|
6301
|
+
in: z.enum(["query", "header"]),
|
|
6302
|
+
name: z.string(),
|
|
6303
|
+
value: z.union([z.string(), z.number()])
|
|
6290
6304
|
})).optional()
|
|
6291
6305
|
});
|
|
6292
|
-
const ToolRouterUpdateSessionConfigSchema = z
|
|
6293
|
-
toolkits: z
|
|
6306
|
+
const ToolRouterUpdateSessionConfigSchema = z.object({
|
|
6307
|
+
toolkits: z.union([
|
|
6294
6308
|
ToolRouterToolkitsParamSchema,
|
|
6295
6309
|
ToolRouterToolkitsDisabledConfigSchema,
|
|
6296
6310
|
ToolRouterToolkitsEnabledConfigSchema
|
|
6297
6311
|
]).optional(),
|
|
6298
|
-
tools: z
|
|
6312
|
+
tools: z.record(z.string(), z.union([ToolRouterToolsParamSchema, ToolRouterConfigToolsSchema])).optional(),
|
|
6299
6313
|
tags: ToolRouterConfigTagsSchema.optional(),
|
|
6300
|
-
authConfigs: z
|
|
6301
|
-
connectedAccounts: z
|
|
6314
|
+
authConfigs: z.record(z.string(), z.string()).optional(),
|
|
6315
|
+
connectedAccounts: z.record(z.string(), z.union([z.string(), z.array(z.string())])).transform((rec) => {
|
|
6302
6316
|
const out = {};
|
|
6303
6317
|
for (const [k, v] of Object.entries(rec)) out[k] = typeof v === "string" ? [v] : v;
|
|
6304
6318
|
return out;
|
|
6305
6319
|
}).optional(),
|
|
6306
|
-
manageConnections: z
|
|
6320
|
+
manageConnections: z.union([z.boolean(), ToolRouterConfigManageConnectionsSchema]).nullable().optional(),
|
|
6307
6321
|
sandbox: ToolRouterSandboxConfigSchema.partial().nullable().optional(),
|
|
6308
6322
|
workbench: ToolRouterSandboxConfigSchema.partial().nullable().optional(),
|
|
6309
|
-
multiAccount: z
|
|
6310
|
-
enable: z
|
|
6311
|
-
maxAccountsPerToolkit: z
|
|
6312
|
-
requireExplicitSelection: z
|
|
6323
|
+
multiAccount: z.object({
|
|
6324
|
+
enable: z.boolean().optional(),
|
|
6325
|
+
maxAccountsPerToolkit: z.number().int().min(2).max(10).optional(),
|
|
6326
|
+
requireExplicitSelection: z.boolean().optional()
|
|
6313
6327
|
}).nullable().optional(),
|
|
6314
|
-
preload: z
|
|
6328
|
+
preload: z.object({ tools: z.union([z.array(z.string()), z.literal("all")]).optional() }).strict().optional()
|
|
6315
6329
|
}).partial().superRefine((config, ctx) => {
|
|
6316
6330
|
if (config.sandbox !== void 0 && config.workbench !== void 0) ctx.addIssue({
|
|
6317
|
-
code: z
|
|
6331
|
+
code: z.ZodIssueCode.custom,
|
|
6318
6332
|
message: "Pass either sandbox or workbench, not both. workbench is a backwards-compatible alias for sandbox.",
|
|
6319
6333
|
path: ["sandbox"]
|
|
6320
6334
|
});
|
|
6321
6335
|
});
|
|
6322
|
-
const ToolRouterSessionDeleteResponseSchema = z
|
|
6323
|
-
sessionId: z
|
|
6324
|
-
deleted: z
|
|
6336
|
+
const ToolRouterSessionDeleteResponseSchema = z.object({
|
|
6337
|
+
sessionId: z.string(),
|
|
6338
|
+
deleted: z.literal(true)
|
|
6325
6339
|
});
|
|
6326
6340
|
|
|
6327
6341
|
//#endregion
|
|
@@ -6531,23 +6545,23 @@ function transformExecuteResponse(raw) {
|
|
|
6531
6545
|
|
|
6532
6546
|
//#endregion
|
|
6533
6547
|
//#region src/types/ToolRouterSessionFilesMount.types.ts
|
|
6534
|
-
const ToolRouterSessionFilesMountListOptionsSchema = z
|
|
6535
|
-
path: z
|
|
6536
|
-
mountId: z
|
|
6548
|
+
const ToolRouterSessionFilesMountListOptionsSchema = z.object({
|
|
6549
|
+
path: z.string().optional(),
|
|
6550
|
+
mountId: z.string().default(DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID),
|
|
6537
6551
|
/** Pagination cursor from the previous response nextCursor field */
|
|
6538
|
-
cursor: z
|
|
6552
|
+
cursor: z.string().optional(),
|
|
6539
6553
|
/** Maximum number of files to return per page (1-500) */
|
|
6540
|
-
limit: z
|
|
6554
|
+
limit: z.number().min(1).max(500).optional()
|
|
6541
6555
|
});
|
|
6542
|
-
const FileListItemSchema = z
|
|
6543
|
-
last_modified: z
|
|
6544
|
-
mount_relative_path: z
|
|
6545
|
-
sandbox_mount_prefix: z
|
|
6546
|
-
size: z
|
|
6556
|
+
const FileListItemSchema = z.object({
|
|
6557
|
+
last_modified: z.string(),
|
|
6558
|
+
mount_relative_path: z.string(),
|
|
6559
|
+
sandbox_mount_prefix: z.string(),
|
|
6560
|
+
size: z.number()
|
|
6547
6561
|
});
|
|
6548
|
-
const FileListResponseSchema = z
|
|
6549
|
-
items: z
|
|
6550
|
-
next_cursor: z
|
|
6562
|
+
const FileListResponseSchema = z.object({
|
|
6563
|
+
items: z.array(FileListItemSchema),
|
|
6564
|
+
next_cursor: z.string().optional()
|
|
6551
6565
|
}).transform((data) => ({
|
|
6552
6566
|
items: data.items.map((item) => ({
|
|
6553
6567
|
lastModified: item.last_modified,
|
|
@@ -6557,29 +6571,29 @@ const FileListResponseSchema = z$1.object({
|
|
|
6557
6571
|
})),
|
|
6558
6572
|
nextCursor: data.next_cursor
|
|
6559
6573
|
}));
|
|
6560
|
-
const ToolRouterSessionFilesMountUploadOptionsSchema = z
|
|
6574
|
+
const ToolRouterSessionFilesMountUploadOptionsSchema = z.object({
|
|
6561
6575
|
/** Remote path/filename on the mount. When passing a buffer, either mimetype or remotePath is required. */
|
|
6562
|
-
remotePath: z
|
|
6563
|
-
mountId: z
|
|
6576
|
+
remotePath: z.string().optional(),
|
|
6577
|
+
mountId: z.string().default(DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID),
|
|
6564
6578
|
/** MIME type. When passing a buffer, either mimetype or remotePath is required. Ignored when passing File (uses file.type). */
|
|
6565
|
-
mimetype: z
|
|
6579
|
+
mimetype: z.string().optional()
|
|
6566
6580
|
});
|
|
6567
|
-
const ToolRouterSessionFilesMountDownloadOptionsSchema = z
|
|
6568
|
-
const ToolRouterSessionFilesMountDeleteOptionsSchema = z
|
|
6569
|
-
const RemoteFileDataSchema = z
|
|
6570
|
-
expires_at: z
|
|
6571
|
-
mount_relative_path: z
|
|
6572
|
-
sandbox_mount_prefix: z
|
|
6573
|
-
download_url: z
|
|
6581
|
+
const ToolRouterSessionFilesMountDownloadOptionsSchema = z.object({ mountId: z.string().default(DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID) });
|
|
6582
|
+
const ToolRouterSessionFilesMountDeleteOptionsSchema = z.object({ mountId: z.string().default(DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID) });
|
|
6583
|
+
const RemoteFileDataSchema = z.object({
|
|
6584
|
+
expires_at: z.string(),
|
|
6585
|
+
mount_relative_path: z.string(),
|
|
6586
|
+
sandbox_mount_prefix: z.string(),
|
|
6587
|
+
download_url: z.string()
|
|
6574
6588
|
}).transform((data) => ({
|
|
6575
6589
|
expiresAt: data.expires_at,
|
|
6576
6590
|
mountRelativePath: data.mount_relative_path,
|
|
6577
6591
|
sandboxMountPrefix: data.sandbox_mount_prefix,
|
|
6578
6592
|
downloadUrl: data.download_url
|
|
6579
6593
|
}));
|
|
6580
|
-
const FileDeleteResponseSchema = z
|
|
6581
|
-
mount_relative_path: z
|
|
6582
|
-
sandbox_mount_prefix: z
|
|
6594
|
+
const FileDeleteResponseSchema = z.object({
|
|
6595
|
+
mount_relative_path: z.string(),
|
|
6596
|
+
sandbox_mount_prefix: z.string()
|
|
6583
6597
|
}).transform((data) => ({
|
|
6584
6598
|
mountRelativePath: data.mount_relative_path,
|
|
6585
6599
|
sandboxMountPrefix: data.sandbox_mount_prefix
|
|
@@ -7221,9 +7235,9 @@ const DIRECT_CUSTOM_TOOL_DESCRIPTION_PREFIX = "[Direct tool - call directly, no
|
|
|
7221
7235
|
* `composio.connectedAccounts.link()` path (≤1000 entries per list, each
|
|
7222
7236
|
* `userId` 1..256 characters).
|
|
7223
7237
|
*/
|
|
7224
|
-
const AuthorizeOptionsSchema = z.object({
|
|
7225
|
-
callbackUrl: z.string().optional(),
|
|
7226
|
-
alias: z.string().optional(),
|
|
7238
|
+
const AuthorizeOptionsSchema = z$1.object({
|
|
7239
|
+
callbackUrl: z$1.string().optional(),
|
|
7240
|
+
alias: z$1.string().optional(),
|
|
7227
7241
|
experimental: ConnectedAccountExperimentalSchema.optional()
|
|
7228
7242
|
});
|
|
7229
7243
|
/**
|
|
@@ -7638,10 +7652,22 @@ var ToolRouterSession = class {
|
|
|
7638
7652
|
};
|
|
7639
7653
|
remotePromise = this.executeBackendSessionTool(ToolsModel, COMPOSIO_MULTI_EXECUTE_TOOL, remoteInput, modifiers, multiExecuteTool);
|
|
7640
7654
|
}
|
|
7641
|
-
const [localResults,
|
|
7655
|
+
const [localResults, remoteOutcome] = await Promise.all([Promise.all(localPromises), remotePromise ? remotePromise.then((result) => ({ result })).catch((error) => ({ error })) : void 0]);
|
|
7656
|
+
const remoteTransportFailed = !!remoteOutcome && "error" in remoteOutcome;
|
|
7657
|
+
const remoteTransportError = remoteTransportFailed ? remoteOutcome.error : null;
|
|
7658
|
+
const remoteErrorMessage = remoteTransportFailed ? (remoteTransportError instanceof Error ? remoteTransportError.message : String(remoteTransportError)) || "Remote tool execution failed" : null;
|
|
7659
|
+
const remoteResult = remoteOutcome && "result" in remoteOutcome ? remoteOutcome.result : void 0;
|
|
7642
7660
|
if (remoteIndices.length === 0 && localResults.length === 1) return localResults[0].result;
|
|
7643
7661
|
const remoteData = remoteResult?.data && typeof remoteResult.data === "object" && !Array.isArray(remoteResult.data) ? remoteResult.data : {};
|
|
7644
|
-
const remoteResults =
|
|
7662
|
+
const remoteResults = remoteErrorMessage ? remoteIndices.map((index) => ({
|
|
7663
|
+
response: {
|
|
7664
|
+
successful: false,
|
|
7665
|
+
data: {},
|
|
7666
|
+
error: remoteErrorMessage
|
|
7667
|
+
},
|
|
7668
|
+
tool_slug: parsed[index].tool_slug,
|
|
7669
|
+
error: remoteErrorMessage
|
|
7670
|
+
})) : Array.isArray(remoteData.results) ? remoteData.results : [];
|
|
7645
7671
|
const localEntries = localResults.map(({ index, result }) => ({
|
|
7646
7672
|
response: {
|
|
7647
7673
|
successful: result.successful,
|
|
@@ -7649,9 +7675,13 @@ var ToolRouterSession = class {
|
|
|
7649
7675
|
...result.error ? { error: result.error } : {}
|
|
7650
7676
|
},
|
|
7651
7677
|
tool_slug: parsed[index].tool_slug,
|
|
7678
|
+
index,
|
|
7652
7679
|
...result.error ? { error: result.error } : {}
|
|
7653
7680
|
}));
|
|
7654
|
-
const allResults = [...remoteResults
|
|
7681
|
+
const allResults = [...remoteResults.map((entry, remotePosition) => ({
|
|
7682
|
+
...entry,
|
|
7683
|
+
index: remoteIndices[remotePosition] ?? remotePosition
|
|
7684
|
+
})), ...localEntries].sort((a, b) => Number(a.index) - Number(b.index)).map((entry, i) => ({
|
|
7655
7685
|
...entry,
|
|
7656
7686
|
index: i
|
|
7657
7687
|
}));
|
|
@@ -7660,16 +7690,16 @@ var ToolRouterSession = class {
|
|
|
7660
7690
|
...remoteData,
|
|
7661
7691
|
results: allResults
|
|
7662
7692
|
};
|
|
7663
|
-
if (localEntries.length > 0 && [
|
|
7693
|
+
if (localEntries.length > 0 && (remoteErrorMessage || [
|
|
7664
7694
|
"total_count",
|
|
7665
7695
|
"success_count",
|
|
7666
7696
|
"error_count"
|
|
7667
|
-
].some((key) => key in remoteData)) {
|
|
7697
|
+
].some((key) => key in remoteData))) {
|
|
7668
7698
|
mergedData.total_count = allResults.length;
|
|
7669
7699
|
mergedData.success_count = allResults.length - failedCount;
|
|
7670
7700
|
mergedData.error_count = failedCount;
|
|
7671
7701
|
}
|
|
7672
|
-
const remoteError = typeof remoteResult?.error === "string" ? remoteResult.error : null;
|
|
7702
|
+
const remoteError = remoteErrorMessage ?? (typeof remoteResult?.error === "string" ? remoteResult.error : null);
|
|
7673
7703
|
const hasAnyError = localResults.some((r) => r.result.error) || !!remoteError;
|
|
7674
7704
|
return {
|
|
7675
7705
|
data: mergedData,
|
|
@@ -8596,17 +8626,17 @@ const WebhookEventTypes = {
|
|
|
8596
8626
|
*
|
|
8597
8627
|
* @see ConnectedAccountAuthConfigSchema in connectedAccounts.types.ts for the camelCase SDK version
|
|
8598
8628
|
*/
|
|
8599
|
-
const WebhookConnectedAccountAuthConfigSchema = z.object({
|
|
8629
|
+
const WebhookConnectedAccountAuthConfigSchema = z$1.object({
|
|
8600
8630
|
/** The nano ID of the auth config */
|
|
8601
|
-
id: z.string(),
|
|
8631
|
+
id: z$1.string(),
|
|
8602
8632
|
/** @deprecated - use state.authScheme instead */
|
|
8603
|
-
auth_scheme: z.nativeEnum(AuthSchemeTypes),
|
|
8633
|
+
auth_scheme: z$1.nativeEnum(AuthSchemeTypes),
|
|
8604
8634
|
/** Whether this auth config is managed by Composio */
|
|
8605
|
-
is_composio_managed: z.boolean(),
|
|
8635
|
+
is_composio_managed: z$1.boolean(),
|
|
8606
8636
|
/** Whether the auth config is disabled */
|
|
8607
|
-
is_disabled: z.boolean(),
|
|
8637
|
+
is_disabled: z$1.boolean(),
|
|
8608
8638
|
/** @deprecated */
|
|
8609
|
-
deprecated: z.object({ uuid: z.string() }).optional()
|
|
8639
|
+
deprecated: z$1.object({ uuid: z$1.string() }).optional()
|
|
8610
8640
|
}).passthrough();
|
|
8611
8641
|
/**
|
|
8612
8642
|
* Simplified connection state schema for webhook payloads (raw API format).
|
|
@@ -8622,11 +8652,11 @@ const WebhookConnectedAccountAuthConfigSchema = z.object({
|
|
|
8622
8652
|
*
|
|
8623
8653
|
* @see ConnectionDataSchema in connectedAccountAuthStates.types.ts for the full typed version
|
|
8624
8654
|
*/
|
|
8625
|
-
const WebhookConnectionStateSchema = z.object({
|
|
8655
|
+
const WebhookConnectionStateSchema = z$1.object({
|
|
8626
8656
|
/** The auth scheme type (e.g., 'OAUTH2', 'API_KEY') */
|
|
8627
|
-
authScheme: z.nativeEnum(AuthSchemeTypes),
|
|
8657
|
+
authScheme: z$1.nativeEnum(AuthSchemeTypes),
|
|
8628
8658
|
/** Connection state values - varies by auth scheme */
|
|
8629
|
-
val: z.record(z.unknown())
|
|
8659
|
+
val: z$1.record(z$1.unknown())
|
|
8630
8660
|
}).passthrough();
|
|
8631
8661
|
/**
|
|
8632
8662
|
* Connected account data schema for webhook payloads (raw API format, snake_case).
|
|
@@ -8644,37 +8674,37 @@ const WebhookConnectionStateSchema = z.object({
|
|
|
8644
8674
|
* @see ConnectedAccountRetrieveResponseSchema in connectedAccounts.types.ts for the camelCase SDK version
|
|
8645
8675
|
* @see utils/transformers/connectedAccounts.ts for the snake-to-camel transformation
|
|
8646
8676
|
*/
|
|
8647
|
-
const SingleConnectedAccountDetailedResponseSchema = z.object({
|
|
8677
|
+
const SingleConnectedAccountDetailedResponseSchema = z$1.object({
|
|
8648
8678
|
/** Toolkit information */
|
|
8649
|
-
toolkit: z.object({ slug: z.string().describe("The slug of the toolkit") }).passthrough(),
|
|
8679
|
+
toolkit: z$1.object({ slug: z$1.string().describe("The slug of the toolkit") }).passthrough(),
|
|
8650
8680
|
/** Auth config details */
|
|
8651
8681
|
auth_config: WebhookConnectedAccountAuthConfigSchema,
|
|
8652
8682
|
/** The nano ID of the connected account */
|
|
8653
|
-
id: z.string(),
|
|
8683
|
+
id: z$1.string(),
|
|
8654
8684
|
/** @deprecated - user ID of the connection owner */
|
|
8655
|
-
user_id: z.string(),
|
|
8685
|
+
user_id: z$1.string(),
|
|
8656
8686
|
/** Connection status */
|
|
8657
|
-
status: z.nativeEnum(ConnectionStatuses),
|
|
8687
|
+
status: z$1.nativeEnum(ConnectionStatuses),
|
|
8658
8688
|
/** ISO-8601 timestamp of creation */
|
|
8659
|
-
created_at: z.string(),
|
|
8689
|
+
created_at: z$1.string(),
|
|
8660
8690
|
/** ISO-8601 timestamp of last update */
|
|
8661
|
-
updated_at: z.string(),
|
|
8691
|
+
updated_at: z$1.string(),
|
|
8662
8692
|
/** Connection state data (auth scheme + state values) */
|
|
8663
8693
|
state: WebhookConnectionStateSchema,
|
|
8664
8694
|
/** @deprecated - use state instead */
|
|
8665
|
-
data: z.record(z.unknown()),
|
|
8695
|
+
data: z$1.record(z$1.unknown()),
|
|
8666
8696
|
/** @deprecated - use state instead */
|
|
8667
|
-
params: z.record(z.unknown()),
|
|
8697
|
+
params: z$1.record(z$1.unknown()),
|
|
8668
8698
|
/** Reason for the current status (e.g., expiration reason) */
|
|
8669
|
-
status_reason: z.string().nullable(),
|
|
8699
|
+
status_reason: z$1.string().nullable(),
|
|
8670
8700
|
/** Whether the connection is disabled */
|
|
8671
|
-
is_disabled: z.boolean(),
|
|
8701
|
+
is_disabled: z$1.boolean(),
|
|
8672
8702
|
/** Endpoint for making test requests */
|
|
8673
|
-
test_request_endpoint: z.string().optional(),
|
|
8703
|
+
test_request_endpoint: z$1.string().optional(),
|
|
8674
8704
|
/** @deprecated */
|
|
8675
|
-
deprecated: z.object({
|
|
8676
|
-
labels: z.array(z.string()),
|
|
8677
|
-
uuid: z.string()
|
|
8705
|
+
deprecated: z$1.object({
|
|
8706
|
+
labels: z$1.array(z$1.string()),
|
|
8707
|
+
uuid: z$1.string()
|
|
8678
8708
|
}).optional()
|
|
8679
8709
|
}).passthrough();
|
|
8680
8710
|
/**
|
|
@@ -8683,11 +8713,11 @@ const SingleConnectedAccountDetailedResponseSchema = z.object({
|
|
|
8683
8713
|
*
|
|
8684
8714
|
* Uses .passthrough() to accept unknown fields the API may add in the future.
|
|
8685
8715
|
*/
|
|
8686
|
-
const WebhookConnectionMetadataSchema = z.object({
|
|
8716
|
+
const WebhookConnectionMetadataSchema = z$1.object({
|
|
8687
8717
|
/** Project nano ID */
|
|
8688
|
-
project_id: z.string(),
|
|
8718
|
+
project_id: z$1.string(),
|
|
8689
8719
|
/** Organization UUID */
|
|
8690
|
-
org_id: z.string()
|
|
8720
|
+
org_id: z$1.string()
|
|
8691
8721
|
}).passthrough();
|
|
8692
8722
|
/**
|
|
8693
8723
|
* Connection expired webhook event payload.
|
|
@@ -8709,13 +8739,13 @@ const WebhookConnectionMetadataSchema = z.object({
|
|
|
8709
8739
|
* }
|
|
8710
8740
|
* ```
|
|
8711
8741
|
*/
|
|
8712
|
-
const ConnectionExpiredEventSchema = z.object({
|
|
8742
|
+
const ConnectionExpiredEventSchema = z$1.object({
|
|
8713
8743
|
/** Unique message ID (e.g., "msg_847cdfcd-d219-4f18-a6dd-91acd42ca94a") */
|
|
8714
|
-
id: z.string(),
|
|
8744
|
+
id: z$1.string(),
|
|
8715
8745
|
/** ISO-8601 timestamp of when the event was emitted */
|
|
8716
|
-
timestamp: z.string(),
|
|
8746
|
+
timestamp: z$1.string(),
|
|
8717
8747
|
/** Event type identifier */
|
|
8718
|
-
type: z.literal(WebhookEventTypes.CONNECTION_EXPIRED),
|
|
8748
|
+
type: z$1.literal(WebhookEventTypes.CONNECTION_EXPIRED),
|
|
8719
8749
|
/** Connected account data (same as GET /api/v3/connected_accounts/{id}) */
|
|
8720
8750
|
data: SingleConnectedAccountDetailedResponseSchema,
|
|
8721
8751
|
/** Event metadata */
|
|
@@ -8732,109 +8762,109 @@ const ConnectionExpiredEventSchema = z.object({
|
|
|
8732
8762
|
* Trigger events (composio.trigger.message) are handled through the
|
|
8733
8763
|
* WebhookTriggerPayloadV3Schema in triggers.types.ts and the TriggerEvent type.
|
|
8734
8764
|
*/
|
|
8735
|
-
const WebhookEventSchema = z.discriminatedUnion("type", [ConnectionExpiredEventSchema]);
|
|
8765
|
+
const WebhookEventSchema = z$1.discriminatedUnion("type", [ConnectionExpiredEventSchema]);
|
|
8736
8766
|
|
|
8737
8767
|
//#endregion
|
|
8738
8768
|
//#region src/types/mcp.types.ts
|
|
8739
8769
|
/**
|
|
8740
8770
|
* @deprecated
|
|
8741
8771
|
*/
|
|
8742
|
-
const MCPToolkitConfigSchema = z.object({
|
|
8743
|
-
toolkit: z.string().min(1, "Toolkit name cannot be empty"),
|
|
8744
|
-
authConfigId: z.string().min(1, "Auth config ID cannot be empty"),
|
|
8745
|
-
allowedTools: z.array(z.string().min(1, "Tool name cannot be empty")).min(1, "At least one tool must be specified")
|
|
8772
|
+
const MCPToolkitConfigSchema = z$1.object({
|
|
8773
|
+
toolkit: z$1.string().min(1, "Toolkit name cannot be empty"),
|
|
8774
|
+
authConfigId: z$1.string().min(1, "Auth config ID cannot be empty"),
|
|
8775
|
+
allowedTools: z$1.array(z$1.string().min(1, "Tool name cannot be empty")).min(1, "At least one tool must be specified")
|
|
8746
8776
|
});
|
|
8747
8777
|
/**
|
|
8748
8778
|
* @deprecated
|
|
8749
8779
|
*/
|
|
8750
|
-
const MCPToolkitConfigsArraySchema = z.array(MCPToolkitConfigSchema).min(1, "At least one toolkit configuration is required").refine((configs) => {
|
|
8780
|
+
const MCPToolkitConfigsArraySchema = z$1.array(MCPToolkitConfigSchema).min(1, "At least one toolkit configuration is required").refine((configs) => {
|
|
8751
8781
|
const toolkits = configs.map((config) => config.toolkit);
|
|
8752
8782
|
return new Set(toolkits).size === toolkits.length;
|
|
8753
8783
|
}, "Duplicate toolkits are not allowed. Each toolkit must be unique.");
|
|
8754
8784
|
/**
|
|
8755
8785
|
* @deprecated
|
|
8756
8786
|
*/
|
|
8757
|
-
const MCPAuthOptionsSchema = z.object({ isChatAuth: z.boolean().optional() });
|
|
8758
|
-
const MCPGetServerParamsSchema = z.object({
|
|
8759
|
-
userId: z.string().min(1, "User ID cannot be empty").optional(),
|
|
8760
|
-
connectedAccountIds: z.record(z.string(), z.string().min(1, "Account ID cannot be empty")).optional()
|
|
8787
|
+
const MCPAuthOptionsSchema = z$1.object({ isChatAuth: z$1.boolean().optional() });
|
|
8788
|
+
const MCPGetServerParamsSchema = z$1.object({
|
|
8789
|
+
userId: z$1.string().min(1, "User ID cannot be empty").optional(),
|
|
8790
|
+
connectedAccountIds: z$1.record(z$1.string(), z$1.string().min(1, "Account ID cannot be empty")).optional()
|
|
8761
8791
|
}).refine((data) => {
|
|
8762
8792
|
return !!data.userId !== (!!data.connectedAccountIds && Object.keys(data.connectedAccountIds).length > 0);
|
|
8763
8793
|
}, { message: "Must provide either userId or connectedAccountIds, but not both" });
|
|
8764
|
-
const MCPGenerateURLParamsSchema = z.object({
|
|
8765
|
-
userIds: z.array(z.string()).optional(),
|
|
8766
|
-
connectedAccountIds: z.array(z.string()).optional(),
|
|
8767
|
-
isChatAuth: z.boolean().optional()
|
|
8794
|
+
const MCPGenerateURLParamsSchema = z$1.object({
|
|
8795
|
+
userIds: z$1.array(z$1.string()).optional(),
|
|
8796
|
+
connectedAccountIds: z$1.array(z$1.string()).optional(),
|
|
8797
|
+
isChatAuth: z$1.boolean().optional()
|
|
8768
8798
|
});
|
|
8769
|
-
const ComposioGenerateURLParamsSchema = z.object({
|
|
8770
|
-
user_ids: z.array(z.string()).optional(),
|
|
8771
|
-
connected_account_ids: z.array(z.string()).optional(),
|
|
8772
|
-
mcp_server_id: z.string(),
|
|
8773
|
-
managed_auth_by_composio: z.boolean().optional()
|
|
8799
|
+
const ComposioGenerateURLParamsSchema = z$1.object({
|
|
8800
|
+
user_ids: z$1.array(z$1.string()).optional(),
|
|
8801
|
+
connected_account_ids: z$1.array(z$1.string()).optional(),
|
|
8802
|
+
mcp_server_id: z$1.string(),
|
|
8803
|
+
managed_auth_by_composio: z$1.boolean().optional()
|
|
8774
8804
|
});
|
|
8775
|
-
const GenerateURLParamsSchema = z.object({
|
|
8776
|
-
userIds: z.array(z.string()).optional(),
|
|
8777
|
-
connectedAccountIds: z.array(z.string()).optional(),
|
|
8778
|
-
mcpServerId: z.string(),
|
|
8779
|
-
composioManagedAuth: z.boolean().optional()
|
|
8805
|
+
const GenerateURLParamsSchema = z$1.object({
|
|
8806
|
+
userIds: z$1.array(z$1.string()).optional(),
|
|
8807
|
+
connectedAccountIds: z$1.array(z$1.string()).optional(),
|
|
8808
|
+
mcpServerId: z$1.string(),
|
|
8809
|
+
composioManagedAuth: z$1.boolean().optional()
|
|
8780
8810
|
});
|
|
8781
|
-
const GenerateURLResponseSchema = z.object({
|
|
8782
|
-
connectedAccountUrls: z.array(z.string()).optional(),
|
|
8783
|
-
userIdsUrl: z.array(z.string()).optional(),
|
|
8784
|
-
mcpUrl: z.string().min(1, "MCP URL cannot be empty")
|
|
8811
|
+
const GenerateURLResponseSchema = z$1.object({
|
|
8812
|
+
connectedAccountUrls: z$1.array(z$1.string()).optional(),
|
|
8813
|
+
userIdsUrl: z$1.array(z$1.string()).optional(),
|
|
8814
|
+
mcpUrl: z$1.string().min(1, "MCP URL cannot be empty")
|
|
8785
8815
|
});
|
|
8786
|
-
const ComposioGenerateURLResponseSchema = z.object({
|
|
8787
|
-
connected_account_urls: z.array(z.string()).optional(),
|
|
8788
|
-
user_ids_url: z.array(z.string()).optional(),
|
|
8789
|
-
mcp_url: z.string().min(1, "MCP URL cannot be empty")
|
|
8816
|
+
const ComposioGenerateURLResponseSchema = z$1.object({
|
|
8817
|
+
connected_account_urls: z$1.array(z$1.string()).optional(),
|
|
8818
|
+
user_ids_url: z$1.array(z$1.string()).optional(),
|
|
8819
|
+
mcp_url: z$1.string().min(1, "MCP URL cannot be empty")
|
|
8790
8820
|
});
|
|
8791
8821
|
/**
|
|
8792
8822
|
* MCP Server Type (Single App)
|
|
8793
8823
|
*/
|
|
8794
|
-
const MCPSingleAppServerSchema = z.object({
|
|
8795
|
-
name: z.string().describe("Name of the MCP server"),
|
|
8796
|
-
tools: z.array(z.string()).describe("List of allowed tools"),
|
|
8797
|
-
authConfigId: z.string().optional().describe("Auth config ID for the server")
|
|
8824
|
+
const MCPSingleAppServerSchema = z$1.object({
|
|
8825
|
+
name: z$1.string().describe("Name of the MCP server"),
|
|
8826
|
+
tools: z$1.array(z$1.string()).describe("List of allowed tools"),
|
|
8827
|
+
authConfigId: z$1.string().optional().describe("Auth config ID for the server")
|
|
8798
8828
|
});
|
|
8799
8829
|
/**
|
|
8800
8830
|
* MCP Server Type (Multi App)
|
|
8801
8831
|
*/
|
|
8802
|
-
const MCPMultiAppServerSchema = z.object({
|
|
8803
|
-
name: z.string().describe("Name of the MCP server"),
|
|
8804
|
-
tools: z.array(z.string()).describe("List of allowed tools across toolkits"),
|
|
8805
|
-
toolkits: z.array(z.string()).describe("List of allowed toolkits")
|
|
8832
|
+
const MCPMultiAppServerSchema = z$1.object({
|
|
8833
|
+
name: z$1.string().describe("Name of the MCP server"),
|
|
8834
|
+
tools: z$1.array(z$1.string()).describe("List of allowed tools across toolkits"),
|
|
8835
|
+
toolkits: z$1.array(z$1.string()).describe("List of allowed toolkits")
|
|
8806
8836
|
});
|
|
8807
8837
|
/**
|
|
8808
8838
|
* MCP Server Type (Combined)
|
|
8809
8839
|
*/
|
|
8810
|
-
const MCPServerSchema = z.object({
|
|
8811
|
-
id: z.string().describe("Unique identifier for the MCP server"),
|
|
8812
|
-
type: z.enum(["single", "multi"]).describe("Type of MCP server"),
|
|
8813
|
-
createdAt: z.string().describe("Creation timestamp"),
|
|
8814
|
-
updatedAt: z.string().describe("Last update timestamp"),
|
|
8815
|
-
status: z.enum([
|
|
8840
|
+
const MCPServerSchema = z$1.object({
|
|
8841
|
+
id: z$1.string().describe("Unique identifier for the MCP server"),
|
|
8842
|
+
type: z$1.enum(["single", "multi"]).describe("Type of MCP server"),
|
|
8843
|
+
createdAt: z$1.string().describe("Creation timestamp"),
|
|
8844
|
+
updatedAt: z$1.string().describe("Last update timestamp"),
|
|
8845
|
+
status: z$1.enum([
|
|
8816
8846
|
"active",
|
|
8817
8847
|
"inactive",
|
|
8818
8848
|
"error"
|
|
8819
8849
|
]).default("active"),
|
|
8820
|
-
config: z.union([MCPSingleAppServerSchema, MCPMultiAppServerSchema])
|
|
8850
|
+
config: z$1.union([MCPSingleAppServerSchema, MCPMultiAppServerSchema])
|
|
8821
8851
|
});
|
|
8822
8852
|
/**
|
|
8823
8853
|
* MCP Server List Response
|
|
8824
8854
|
*/
|
|
8825
|
-
const MCPServerListResponseSchema = z.object({
|
|
8826
|
-
items: z.array(MCPServerSchema),
|
|
8827
|
-
total: z.number(),
|
|
8828
|
-
page: z.number(),
|
|
8829
|
-
pageSize: z.number()
|
|
8855
|
+
const MCPServerListResponseSchema = z$1.object({
|
|
8856
|
+
items: z$1.array(MCPServerSchema),
|
|
8857
|
+
total: z$1.number(),
|
|
8858
|
+
page: z$1.number(),
|
|
8859
|
+
pageSize: z$1.number()
|
|
8830
8860
|
});
|
|
8831
8861
|
/**
|
|
8832
8862
|
* MCP Server Update Parameters
|
|
8833
8863
|
*/
|
|
8834
|
-
const MCPServerUpdateParamsSchema = z.object({
|
|
8835
|
-
name: z.string().optional().describe("New name for the server"),
|
|
8836
|
-
toolkits: z.array(z.string()).optional().describe("Updated list of toolkits"),
|
|
8837
|
-
allowedTools: z.array(z.string()).optional().describe("Updated list of allowed tools")
|
|
8864
|
+
const MCPServerUpdateParamsSchema = z$1.object({
|
|
8865
|
+
name: z$1.string().optional().describe("New name for the server"),
|
|
8866
|
+
toolkits: z$1.array(z$1.string()).optional().describe("Updated list of toolkits"),
|
|
8867
|
+
allowedTools: z$1.array(z$1.string()).optional().describe("Updated list of allowed tools")
|
|
8838
8868
|
});
|
|
8839
8869
|
/**
|
|
8840
8870
|
* MCP Server Create Response
|
|
@@ -8845,89 +8875,89 @@ let ConnectionStatus = /* @__PURE__ */ function(ConnectionStatus) {
|
|
|
8845
8875
|
ConnectionStatus["DISCONNECTED"] = "DISCONNECTED";
|
|
8846
8876
|
return ConnectionStatus;
|
|
8847
8877
|
}({});
|
|
8848
|
-
const CustomCreateResponseSchema = z.object({
|
|
8849
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8850
|
-
name: z.string().min(1, "Server name cannot be empty"),
|
|
8851
|
-
createdAt: z.string().nullish(),
|
|
8852
|
-
updatedAt: z.string().nullish(),
|
|
8853
|
-
status: z.string().nullish()
|
|
8878
|
+
const CustomCreateResponseSchema = z$1.object({
|
|
8879
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8880
|
+
name: z$1.string().min(1, "Server name cannot be empty"),
|
|
8881
|
+
createdAt: z$1.string().nullish(),
|
|
8882
|
+
updatedAt: z$1.string().nullish(),
|
|
8883
|
+
status: z$1.string().nullish()
|
|
8854
8884
|
});
|
|
8855
|
-
const ComposioCustomCreateResponseSchema = z.object({
|
|
8856
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8857
|
-
name: z.string().min(1, "Server name cannot be empty"),
|
|
8858
|
-
created_at: z.string().nullish(),
|
|
8859
|
-
updated_at: z.string().nullish(),
|
|
8860
|
-
status: z.string().nullish()
|
|
8885
|
+
const ComposioCustomCreateResponseSchema = z$1.object({
|
|
8886
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8887
|
+
name: z$1.string().min(1, "Server name cannot be empty"),
|
|
8888
|
+
created_at: z$1.string().nullish(),
|
|
8889
|
+
updated_at: z$1.string().nullish(),
|
|
8890
|
+
status: z$1.string().nullish()
|
|
8861
8891
|
});
|
|
8862
|
-
const McpListResponseSchema = z.object({ items: z.array(z.object({
|
|
8863
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8864
|
-
name: z.string().min(1, "Server name cannot be empty"),
|
|
8865
|
-
createdAt: z.string().optional(),
|
|
8866
|
-
updatedAt: z.string().optional(),
|
|
8867
|
-
status: z.string().optional()
|
|
8892
|
+
const McpListResponseSchema = z$1.object({ items: z$1.array(z$1.object({
|
|
8893
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8894
|
+
name: z$1.string().min(1, "Server name cannot be empty"),
|
|
8895
|
+
createdAt: z$1.string().optional(),
|
|
8896
|
+
updatedAt: z$1.string().optional(),
|
|
8897
|
+
status: z$1.string().optional()
|
|
8868
8898
|
})).optional() });
|
|
8869
|
-
const ComposioMcpListResponseSchema = z.object({ items: z.array(z.object({
|
|
8870
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8871
|
-
name: z.string().min(1, "Server name cannot be empty"),
|
|
8872
|
-
created_at: z.string().optional(),
|
|
8873
|
-
updated_at: z.string().optional(),
|
|
8874
|
-
status: z.string().optional()
|
|
8899
|
+
const ComposioMcpListResponseSchema = z$1.object({ items: z$1.array(z$1.object({
|
|
8900
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8901
|
+
name: z$1.string().min(1, "Server name cannot be empty"),
|
|
8902
|
+
created_at: z$1.string().optional(),
|
|
8903
|
+
updated_at: z$1.string().optional(),
|
|
8904
|
+
status: z$1.string().optional()
|
|
8875
8905
|
})).optional() });
|
|
8876
|
-
const McpRetrieveResponseSchema = z.object({
|
|
8877
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8878
|
-
name: z.string().min(1, "Server name cannot be empty"),
|
|
8879
|
-
createdAt: z.string().optional(),
|
|
8880
|
-
updatedAt: z.string().optional(),
|
|
8881
|
-
status: z.string().optional(),
|
|
8882
|
-
toolkits: z.array(z.string()).optional(),
|
|
8883
|
-
tools: z.array(z.string()).optional(),
|
|
8884
|
-
managedAuthViaComposio: z.boolean().optional(),
|
|
8885
|
-
authConfigIds: z.array(z.string()).optional(),
|
|
8886
|
-
mcpUrl: z.string(),
|
|
8887
|
-
commands: z.object({
|
|
8888
|
-
claude: z.string(),
|
|
8889
|
-
cursor: z.string(),
|
|
8890
|
-
windsurf: z.string()
|
|
8906
|
+
const McpRetrieveResponseSchema = z$1.object({
|
|
8907
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8908
|
+
name: z$1.string().min(1, "Server name cannot be empty"),
|
|
8909
|
+
createdAt: z$1.string().optional(),
|
|
8910
|
+
updatedAt: z$1.string().optional(),
|
|
8911
|
+
status: z$1.string().optional(),
|
|
8912
|
+
toolkits: z$1.array(z$1.string()).optional(),
|
|
8913
|
+
tools: z$1.array(z$1.string()).optional(),
|
|
8914
|
+
managedAuthViaComposio: z$1.boolean().optional(),
|
|
8915
|
+
authConfigIds: z$1.array(z$1.string()).optional(),
|
|
8916
|
+
mcpUrl: z$1.string(),
|
|
8917
|
+
commands: z$1.object({
|
|
8918
|
+
claude: z$1.string(),
|
|
8919
|
+
cursor: z$1.string(),
|
|
8920
|
+
windsurf: z$1.string()
|
|
8891
8921
|
})
|
|
8892
8922
|
});
|
|
8893
|
-
const ComposioMcpRetrieveResponseSchema = z.object({
|
|
8894
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8895
|
-
name: z.string().min(1, "Server name cannot be empty"),
|
|
8896
|
-
created_at: z.string().optional(),
|
|
8897
|
-
updated_at: z.string().optional(),
|
|
8898
|
-
status: z.string().optional(),
|
|
8899
|
-
toolkits: z.array(z.string()).optional(),
|
|
8900
|
-
tools: z.array(z.string()).optional(),
|
|
8901
|
-
managed_auth_via_composio: z.boolean().optional()
|
|
8923
|
+
const ComposioMcpRetrieveResponseSchema = z$1.object({
|
|
8924
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8925
|
+
name: z$1.string().min(1, "Server name cannot be empty"),
|
|
8926
|
+
created_at: z$1.string().optional(),
|
|
8927
|
+
updated_at: z$1.string().optional(),
|
|
8928
|
+
status: z$1.string().optional(),
|
|
8929
|
+
toolkits: z$1.array(z$1.string()).optional(),
|
|
8930
|
+
tools: z$1.array(z$1.string()).optional(),
|
|
8931
|
+
managed_auth_via_composio: z$1.boolean().optional()
|
|
8902
8932
|
});
|
|
8903
|
-
const McpDeleteResponseSchema = z.object({
|
|
8904
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8905
|
-
deleted: z.boolean().optional(),
|
|
8906
|
-
message: z.string().optional()
|
|
8933
|
+
const McpDeleteResponseSchema = z$1.object({
|
|
8934
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8935
|
+
deleted: z$1.boolean().optional(),
|
|
8936
|
+
message: z$1.string().optional()
|
|
8907
8937
|
});
|
|
8908
|
-
const ComposioMcpDeleteResponseSchema = z.object({
|
|
8909
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8910
|
-
deleted: z.boolean().optional(),
|
|
8911
|
-
message: z.string().optional()
|
|
8938
|
+
const ComposioMcpDeleteResponseSchema = z$1.object({
|
|
8939
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8940
|
+
deleted: z$1.boolean().optional(),
|
|
8941
|
+
message: z$1.string().optional()
|
|
8912
8942
|
});
|
|
8913
|
-
const McpUpdateResponseSchema = z.object({
|
|
8914
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8915
|
-
name: z.string().min(1, "Server name cannot be empty"),
|
|
8916
|
-
createdAt: z.string().optional(),
|
|
8917
|
-
updatedAt: z.string().optional(),
|
|
8918
|
-
status: z.string().optional(),
|
|
8919
|
-
toolkits: z.array(z.string()).optional(),
|
|
8920
|
-
tools: z.array(z.string()).optional()
|
|
8943
|
+
const McpUpdateResponseSchema = z$1.object({
|
|
8944
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8945
|
+
name: z$1.string().min(1, "Server name cannot be empty"),
|
|
8946
|
+
createdAt: z$1.string().optional(),
|
|
8947
|
+
updatedAt: z$1.string().optional(),
|
|
8948
|
+
status: z$1.string().optional(),
|
|
8949
|
+
toolkits: z$1.array(z$1.string()).optional(),
|
|
8950
|
+
tools: z$1.array(z$1.string()).optional()
|
|
8921
8951
|
});
|
|
8922
|
-
const ComposioMcpUpdateResponseSchema = z.object({
|
|
8923
|
-
id: z.string().min(1, "Server ID cannot be empty"),
|
|
8924
|
-
name: z.string().min(1, "Server name cannot be empty"),
|
|
8925
|
-
created_at: z.string().optional(),
|
|
8926
|
-
updated_at: z.string().optional(),
|
|
8927
|
-
status: z.string().optional(),
|
|
8928
|
-
toolkits: z.array(z.string()).optional(),
|
|
8929
|
-
tools: z.array(z.string()).optional()
|
|
8952
|
+
const ComposioMcpUpdateResponseSchema = z$1.object({
|
|
8953
|
+
id: z$1.string().min(1, "Server ID cannot be empty"),
|
|
8954
|
+
name: z$1.string().min(1, "Server name cannot be empty"),
|
|
8955
|
+
created_at: z$1.string().optional(),
|
|
8956
|
+
updated_at: z$1.string().optional(),
|
|
8957
|
+
status: z$1.string().optional(),
|
|
8958
|
+
toolkits: z$1.array(z$1.string()).optional(),
|
|
8959
|
+
tools: z$1.array(z$1.string()).optional()
|
|
8930
8960
|
});
|
|
8931
8961
|
|
|
8932
8962
|
//#endregion
|
|
8933
|
-
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioSensitiveFilePathBlockedError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitLatestVersionSchema, ToolkitMangedByEnumSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookTriggerPayloadV3Schema, WebhookVersions, constants_exports as constants, createConnectionRequest, dereferenceJsonSchema, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry };
|
|
8963
|
+
export { AuthConfigCreationToolAccessConfigSchema, AuthConfigErrorCodes, AuthConfigListParamsSchema, AuthConfigListResponseSchema, AuthConfigRetrieveResponseSchema, AuthConfigToolAccessConfigSchema, AuthConfigTypes, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, AuthSchemeTypes, BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTS, BaseAgenticProvider, BaseNonAgenticProvider, BillcomAuthConnectionDataSchema, Composio, ComposioAclOnlyForSharedError, ComposioAuthConfigNotFoundError, ComposioBlockedInternalUrlError, ComposioConnectedAccountNotFoundError, ComposioCustomCreateResponseSchema, ComposioError, ComposioFailedToCreateConnectedAccountLink, ComposioFailedToCreatePusherClientError, ComposioFailedToGetSDKRealtimeCredentialsError, ComposioFailedToSubscribeToPusherChannelError, ComposioFailedToUnsubscribeFromPusherChannelError, ComposioFileNotFoundError, ComposioFileUploadAbortedError, ComposioFileUploadError, ComposioFileUploadPathNotAllowedError, ComposioGenerateURLParamsSchema, ComposioGenerateURLResponseSchema, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioInvalidToolArgumentsError, ComposioLegacyConnectedAccountsEndpointRetiredError, ComposioMcpDeleteResponseSchema, ComposioMcpListResponseSchema, ComposioMcpRetrieveResponseSchema, ComposioMcpUpdateResponseSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioRequestCancelledError, ComposioSensitiveFilePathBlockedError, ComposioSharedAccessDeniedError, ComposioSharedConnectionNotAccessibleError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolVersionRequiredError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ComposioTriggerTypeNotFoundError, ComposioWebhookPayloadError, ComposioWebhookSignatureVerificationError, ConnectedAccountAclConfigResponseSchema, ConnectedAccountAclConfigSchema, ConnectedAccountAuthConfigSchema, ConnectedAccountErrorCodes, ConnectedAccountExperimentalResponseSchema, ConnectedAccountExperimentalSchema, ConnectedAccountListParamsSchema, ConnectedAccountListResponseSchema, ConnectedAccountRefreshOptionsSchema, ConnectedAccountRetrieveResponseSchema, ConnectedAccountStatusSchema, ConnectedAccountStatuses, ConnectedAccountTypeSchema, ConnectedAccountTypes, ConnectionDataSchema, ConnectionExpiredEventSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConnectionStatus, ConnectionStatuses, CreateAuthConfigParamsSchema, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateConnectedAccountLinkOptionsSchema, CreateConnectedAccountLinkResponseSchema, CreateConnectedAccountOptionsSchema, CreateConnectedAccountParamsSchema, CreateConnectedAccountResponseSchema, CreateCustomAuthConfigParamsSchema, CreateCustomToolBaseSchema, CreateCustomToolkitBaseSchema, CustomAuthParamsSchema, CustomConnectionDataSchema, CustomCreateResponseSchema, CustomOauth1ConnectionDataSchema, CustomOauth2ConnectionDataSchema, CustomToolSlugSchema, DefaultCreateConnectedAccountParamsSchema, DefaultWebhookSubscriptionEvents, Experimental, FileDeleteResponseSchema, FileListResponseSchema, FileModifierErrorCodes, GenerateURLParamsSchema, GenerateURLResponseSchema, IncomingTriggerPayloadSchema, JSONSchemaPropertySchema, JsonSchemaRefResolutionError, JsonSchemaToZodError, MCP, MCPAuthOptionsSchema, MCPGenerateURLParamsSchema, MCPGetServerParamsSchema, MCPMultiAppServerSchema, MCPServerCreateResponseSchema, MCPServerListResponseSchema, MCPServerSchema, MCPServerTypeSchema, MCPServerUpdateParamsSchema, MCPSingleAppServerSchema, MCPToolkitConfigSchema, MCPToolkitConfigsArraySchema, McpDeleteResponseSchema, McpListResponseSchema, McpRetrieveResponseSchema, McpUpdateResponseSchema, Oauth1ActiveConnectionDataSchema, Oauth1ConnectionDataSchema, Oauth1ExpiredConnectionDataSchema, Oauth1FailedConnectionDataSchema, Oauth1InactiveConnectionDataSchema, Oauth1InitiatedConnectionDataSchema, Oauth1InitiatingConnectionDataSchema, Oauth2ActiveConnectionDataSchema, Oauth2ConnectionDataSchema, Oauth2ExpiredConnectionDataSchema, Oauth2FailedConnectionDataSchema, Oauth2InactiveConnectionDataSchema, Oauth2InitiatedConnectionDataSchema, Oauth2InitiatingConnectionDataSchema, Oauth2RevokedConnectionDataSchema, OpenAIProvider, RedirectableAuthSchemeSchema, RemoteFile, RemoteFileDataSchema, RemoteFileDownloadError, RemoteFileErrorCodes, SDKErrorCodes, SandboxSizeSchema, SessionPreset, SessionProxyExecuteParamsSchema, Sessions, SetWebhookSubscriptionParamsSchema, SingleConnectedAccountDetailedResponseSchema, SsrfErrorCodes, ToolErrorCodes, ToolExecuteMetaParamsSchema, ToolExecuteParamsSchema, ToolExecuteResponseSchema, ToolKitItemSchema, ToolKitListResponseSchema, ToolKitMetaSchema, ToolListParamsSchema, ToolListResponseSchema, ToolProxyParamsSchema, ToolRouterConfigManageConnectionsSchema, ToolRouterConfigTagsSchema, ToolRouterConfigToolsSchema, ToolRouterCreateSessionConfigSchema, ToolRouterMCPServerConfigSchema, ToolRouterManageConnectionsConfigSchema, ToolRouterSandboxConfigSchema, ToolRouterSession, ToolRouterSessionDeleteResponseSchema, ToolRouterSessionExecuteResponseSchema, ToolRouterSessionFilesMountDeleteOptionsSchema, ToolRouterSessionFilesMountDownloadOptionsSchema, ToolRouterSessionFilesMountListOptionsSchema, ToolRouterSessionFilesMountUploadOptionsSchema, ToolRouterSessionSearchResponseSchema, ToolRouterTagsEnableDisableSchema, ToolRouterTagsParamSchema, ToolRouterToolkitsDisabledConfigSchema, ToolRouterToolkitsEnabledConfigSchema, ToolRouterToolkitsOptionsSchema, ToolRouterToolkitsParamSchema, ToolRouterToolsParamSchema, ToolRouterUpdateSessionConfigSchema, ToolSchema, ToolkitAuthConfigDetailsSchema, ToolkitAuthFieldSchema, ToolkitAuthFieldsResponseSchema, ToolkitCategorySchema, ToolkitConnectionStateSchema, ToolkitConnectionsDetailsSchema, ToolkitErrorCodes, ToolkitLatestVersionSchema, ToolkitMangedByEnumSchema, ToolkitRetrieveCategoriesResponseSchema, ToolkitRetrieveResponseSchema, ToolkitSchema, ToolkitSortByEnumSchema, ToolkitVersionParamSchema, ToolkitVersionSchema, ToolkitVersionsSchema, ToolkitsListParamsSchema, TriggerErrorCodes, TriggerInstanceListActiveParamsSchema, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, TriggerInstanceManageDeleteResponseSchema, TriggerInstanceManageUpdateParamsSchema, TriggerInstanceManageUpdateResponseSchema, TriggerInstanceUpsertParamsSchema, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, TriggerStatuses, TriggerSubscribeParamSchema, TriggerTypeSchema, TriggersTypeListParamsSchema, TriggersTypeListResponseSchema, UpdateConnectedAccountAclParamsSchema, UpdateConnectedAccountParamsSchema, ValidationError, ValidationErrorCodes, VerifyWebhookParamsSchema, WebhookConnectedAccountAuthConfigSchema, WebhookConnectionMetadataSchema, WebhookConnectionStateSchema, WebhookEventSchema, WebhookEventTypes, WebhookPayloadSchema, WebhookPayloadV1Schema, WebhookPayloadV2Schema, WebhookPayloadV3Schema, WebhookTriggerPayloadV3Schema, WebhookVersions, assertSafeFileUploadPath, constants_exports as constants, createConnectionRequest, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, createCustomTool as experimental_createTool, createCustomToolkit as experimental_createToolkit, getExtensionFromMimeType, handleToolExecutionError, isBlockedSensitiveFileUploadPath, isRequestAbortError, jsonSchemaToZodSchema, logger, mappingHasRenames, normalizeToolArguments, removeNonRequiredProperties, restoreOriginalKeys, sanitizeSchemaPropertyKeys, telemetry };
|