@devries-cameron20 / composio Mirror · read-only / commits / 9a10986d8
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 22:00 UTC

Fix: Issues with reponse parsing related to zod schema (#1748)

Musthaq Ahamad committed Jul 11, 2025 at 23:50 UTC 9a10986d86c5240bcf951b3cb064129a437819df
41 files changed +699 -519
.changeset/loud-peaches-brush.md new
+13
@@ -0,0 +1,13 @@
1 +---
2 +'@composio/core': patch
3 +'@composio/anthropic': patch
4 +'@composio/cloudflare': patch
5 +'@composio/google': patch
6 +'@composio/langchain': patch
7 +'@composio/mastra': patch
8 +'@composio/openai': patch
9 +'@composio/openai-agents': patch
10 +'@composio/vercel': patch
11 +---
12 +
13 +Fix: Relax strict type/schema validations on API responses
.changeset/pre.json
+1
@@ -18,6 +18,7 @@
18 "cold-badgers-drop",
19 "cuddly-dragons-knock",
20 "eighty-actors-smile",
21 + "loud-peaches-brush",
22 "modern-parents-bake",
23 "modern-webs-admire",
24 "polite-suits-accept",
.github/workflows/ts.build.yml renamed
.github/workflows/ts.release.yml renamed
.github/workflows/ts.test.yml renamed
.github/workflows/ts.typecheck.yml new
+33
@@ -0,0 +1,33 @@
1 +name: Typecheck Typescript SDK
2 +
3 +on:
4 + push:
5 + branches: [main, next]
6 + pull_request:
7 + branches: [main, next]
8 +
9 +jobs:
10 + typecheck:
11 + name: Typecheck Typescript SDK
12 + runs-on: ubuntu-latest
13 +
14 + steps:
15 + - name: Checkout Code
16 + uses: actions/checkout@v3
17 +
18 + - name: Setup PNPM
19 + uses: pnpm/action-setup@v2
20 + with:
21 + version: 10.8.0 # Match the version in package.json
22 +
23 + - name: Set up Node.js
24 + uses: actions/setup-node@v3
25 + with:
26 + node-version: "20"
27 + cache: "pnpm"
28 +
29 + - name: Install Dependencies
30 + run: pnpm install --frozen-lockfile
31 +
32 + - name: Run Typecheck
33 + run: pnpm run typecheck
package.json
+1
@@ -14,6 +14,7 @@
14 "build:packages": "turbo build --filter=./ts/packages/**",
15 "test": "turbo test --filter=./ts/packages/**",
16 "test:ui": "vitest --ui",
17 + "typecheck": "turbo typecheck --filter=./ts/packages/**",
18 "lint": "eslint ts/packages --ext .ts,.tsx",
19 "lint:packages": "eslint ts/packages --ext .ts,.tsx",
20 "lint:fix": "eslint . --ext .ts,.tsx --fix",
ts/examples/toolkits/src/example.json
ts/examples/toolkits/src/toolkits.ts new
+7
@@ -0,0 +1,7 @@
1 +import { Composio } from '@composio/core';
2 +
3 +const composio = new Composio();
4 +
5 +const toolkits = await composio.toolkits.get({});
6 +
7 +console.log(JSON.stringify(toolkits, null, 2));
ts/packages/core/CHANGELOG.md
+6
@@ -1,5 +1,11 @@
1 # @composio/core
2
3 +## 0.1.36-next.10
4 +
5 +### Patch Changes
6 +
7 +- Fix: Relax strict type/schema validations on API responses
8 +
9 ## 0.1.36-next.9
10
11 ### Patch Changes
ts/packages/core/package.json
+3 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/core",
3 - "version": "0.1.36-next.9",
3 + "version": "0.1.36-next.10",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
@@ -28,7 +28,8 @@
28 "scripts": {
29 "clean": "git clean -xdf node_modules",
30 "build": "tsup",
31 - "test": "vitest run"
31 + "test": "vitest run",
32 + "typecheck": "tsc --noEmit --skipLibCheck"
33 },
34 "keywords": [],
35 "author": "",
ts/packages/core/src/models/AuthConfigs.ts
+8 -68
@@ -29,6 +29,11 @@ import {
29 import { ValidationError } from '../errors/ValidationErrors';
30 import { telemetry } from '../telemetry/Telemetry';
31 import logger from '../utils/logger';
32 +import {
33 + transformAuthConfigListResponse,
34 + transformAuthConfigRetrieveResponse,
35 + transformCreateAuthConfigResponse,
36 +} from '../utils/transformers/authConfigs';
37 /**
38 * AuthConfigs class
39 *
@@ -52,50 +57,6 @@ export class AuthConfigs {
57 return this.client;
58 }
59
55 - /**
56 - * Transforms an auth config response from API format to SDK format.
57 - *
58 - * This method converts property names from snake_case to camelCase and reorganizes
59 - * the data structure to match the SDK's standardized format for auth configurations.
60 - *
61 - * @param {ComposioAuthConfigRetrieveResponse} authConfig - The raw API response to transform
62 - * @returns {AuthConfigRetrieveResponse} The transformed auth config data
63 - * @throws {ValidationError} If the response fails validation against the expected schema
64 - *
65 - * @private
66 - */
67 - private parseAuthConfigRetrieveResponse(
68 - authConfig: ComposioAuthConfigRetrieveResponse
69 - ): AuthConfigRetrieveResponse {
70 - const responseToParse = {
71 - id: authConfig.id,
72 - name: authConfig.name,
73 - noOfConnections: authConfig.no_of_connections,
74 - status: authConfig.status,
75 - toolkit: {
76 - logo: authConfig.toolkit.logo,
77 - slug: authConfig.toolkit.slug,
78 - },
79 - uuid: authConfig.uuid,
80 - authScheme: authConfig.auth_scheme,
81 - credentials: authConfig.credentials,
82 - expectedInputFields: authConfig.expected_input_fields,
83 - isComposioManaged: authConfig.is_composio_managed,
84 - createdBy: authConfig.created_by,
85 - createdAt: authConfig.created_at,
86 - lastUpdatedAt: authConfig.last_updated_at,
87 - restrictToFollowingTools: authConfig.restrict_to_following_tools,
88 - };
89 - const result = AuthConfigRetrieveResponseSchema.safeParse(responseToParse);
90 - if (result.error) {
91 - logger.error('Failed to parse auth config response', {
92 - cause: result.error,
93 - });
94 - return responseToParse as AuthConfigRetrieveResponse;
95 - }
96 - return result.data;
97 - }
98 -
60 /**
61 * Lists authentication configurations based on provided filter criteria.
62 *
@@ -130,17 +91,7 @@ export class AuthConfigs {
91 limit: parsedQuery?.limit,
92 toolkit_slug: parsedQuery?.toolkit,
93 });
133 - const parsedResult = AuthConfigListResponseSchema.safeParse({
134 - items: result.items.map(item => this.parseAuthConfigRetrieveResponse(item)),
135 - nextCursor: result.next_cursor,
136 - totalPages: result.total_pages,
137 - });
138 - if (parsedResult.error) {
139 - throw new ValidationError('Failed to parse auth config list response', {
140 - cause: parsedResult.error,
141 - });
142 - }
143 - return parsedResult.data;
94 + return transformAuthConfigListResponse(result);
95 }
96
97 /**
@@ -191,18 +142,7 @@ export class AuthConfigs {
142 restrict_to_following_tools: parsedOptions.data.restrictToFollowingTools,
143 },
144 });
194 - const parsedResult = CreateAuthConfigResponseSchema.safeParse({
195 - id: result.auth_config.id,
196 - authScheme: result.auth_config.auth_scheme,
197 - isComposioManaged: result.auth_config.is_composio_managed,
198 - toolkit: result.toolkit.slug,
199 - });
200 - if (parsedResult.error) {
201 - throw new ValidationError('Failed to parse auth config create response', {
202 - cause: parsedResult.error,
203 - });
204 - }
205 - return parsedResult.data;
145 + return transformCreateAuthConfigResponse(result);
146 }
147
148 /**
@@ -226,7 +166,7 @@ export class AuthConfigs {
166 */
167 async get(nanoid: string): Promise<AuthConfigRetrieveResponse> {
168 const result = await this.client.authConfigs.retrieve(nanoid);
229 - return this.parseAuthConfigRetrieveResponse(result);
169 + return transformAuthConfigRetrieveResponse(result);
170 }
171
172 /**
ts/packages/core/src/models/ConnectedAccounts.ts
+6 -20
@@ -26,16 +26,13 @@ import { ConnectionRequest } from '../types/connectionRequest.types';
26 import { createConnectionRequest } from './ConnectionRequest';
27 import { ValidationError } from '../errors/ValidationErrors';
28 import { telemetry } from '../telemetry/Telemetry';
29 -import { transformConnectedAccountResponse } from '../utils/transformers/connectedAccounts';
29 +import {
30 + transformConnectedAccountListResponse,
31 + transformConnectedAccountResponse,
32 +} from '../utils/transformers/connectedAccounts';
33 import { ComposioMultipleConnectedAccountsError } from '../errors';
34 import logger from '../utils/logger';
32 -import { AuthSchemeType } from '../types/authConfigs.types';
33 -import { AuthScheme } from './AuthScheme';
34 -import {
35 - ConnectionData,
36 - ConnectionDataSchema,
37 - ConnectionStatuses,
38 -} from '../types/connectedAccountAuthStates.types';
35 +import { ConnectionData } from '../types/connectedAccountAuthStates.types';
36 /**
37 * ConnectedAccounts class
38 *
@@ -97,18 +94,7 @@ export class ConnectedAccounts {
94 }
95
96 const result = await this.client.connectedAccounts.list(rawQuery);
100 -
101 - const parsedResponse = ConnectedAccountListResponseSchema.safeParse({
102 - items: result.items.map(transformConnectedAccountResponse),
103 - nextCursor: result.next_cursor,
104 - totalPages: result.total_pages,
105 - });
106 - if (!parsedResponse.success) {
107 - throw new ValidationError('Failed to parse connected account list response', {
108 - cause: parsedResponse.error,
109 - });
110 - }
111 - return parsedResponse.data;
97 + return transformConnectedAccountListResponse(result);
98 }
99
100 /**
ts/packages/core/src/models/Toolkits.ts
+11 -92
@@ -1,15 +1,10 @@
1 import ComposioClient from '@composio/client';
2 import {
3 - ToolKitItemSchema,
3 ToolkitListParams,
4 ToolKitListResponse,
6 - ToolKitListResponseSchema,
5 ToolkitRetrieveResponse,
8 - ToolkitRetrieveResponseSchema,
6 ToolkitsListParamsSchema,
7 ToolkitRetrieveCategoriesResponse,
11 - ToolkitRetrieveCategoriesResponseSchema,
12 - ToolkitCategorySchema,
8 ToolkitAuthFieldsResponse,
9 } from '../types/toolkit.types';
10 import { ComposioToolkitFetchError, ComposioToolkitNotFoundError } from '../errors';
@@ -22,6 +17,11 @@ import { telemetry } from '../telemetry/Telemetry';
17 import { AuthSchemeType } from '../types/authConfigs.types';
18 import logger from '../utils/logger';
19 import { APIError } from 'openai';
20 +import {
21 + transformToolkitListResponse,
22 + transformToolkitRetrieveCategoriesResponse,
23 + transformToolkitRetrieveResponse,
24 +} from '../utils/transformers/toolkits';
25 /**
26 * Toolkits class
27 *
@@ -62,42 +62,7 @@ export class Toolkits {
62 sort_by: parsedQuery.data.sortBy,
63 });
64
65 - const parsedResult = ToolKitListResponseSchema.safeParse(
66 - result.items.map(item => {
67 - const parsedItem = ToolKitItemSchema.safeParse({
68 - name: item.name,
69 - slug: item.slug,
70 - meta: {
71 - ...item.meta,
72 - createdAt: item.meta.created_at,
73 - updatedAt: item.meta.updated_at,
74 - toolsCount: item.meta.tools_count,
75 - triggersCount: item.meta.triggers_count,
76 - categories: item.meta.categories,
77 - appUrl: item.meta.app_url,
78 - logo: item.meta.logo,
79 - },
80 - isLocalToolkit: item.is_local_toolkit,
81 - authSchemes: item.auth_schemes,
82 - composioManagedAuthSchemes: item.composio_managed_auth_schemes,
83 - noAuth: item.no_auth,
84 - });
85 - if (!parsedItem.success) {
86 - throw new ValidationError('Failed to parse toolkit response', {
87 - cause: parsedItem.error,
88 - });
89 - }
90 - return parsedItem.data;
91 - })
92 - );
93 -
94 - if (!parsedResult.success) {
95 - throw new ValidationError('Failed to parse toolkit list response', {
96 - cause: parsedResult.error,
97 - });
98 - }
99 -
100 - return parsedResult.data;
65 + return transformToolkitListResponse(result);
66 } catch (error) {
67 throw new ComposioToolkitFetchError('Failed to fetch toolkits', {
68 cause: error,
@@ -120,37 +85,7 @@ export class Toolkits {
85 protected async getToolkitBySlug(slug: string): Promise<ToolkitRetrieveResponse> {
86 try {
87 const result = await this.client.toolkits.retrieve(slug);
123 - const parsedResult = ToolkitRetrieveResponseSchema.safeParse({
124 - name: result.name,
125 - slug: result.slug,
126 - meta: {
127 - ...result.meta,
128 - createdAt: result.meta.created_at,
129 - updatedAt: result.meta.updated_at,
130 - toolsCount: result.meta.tools_count,
131 - triggersCount: result.meta.triggers_count,
132 - // appUrl: result.meta.app_url, @TODO Update the client type to include this
133 - },
134 - isLocalToolkit: result.is_local_toolkit,
135 - composioManagedAuthSchemes: result.composio_managed_auth_schemes,
136 - authConfigDetails: result.auth_config_details?.map(authConfig => ({
137 - name: authConfig.name,
138 - mode: authConfig.mode,
139 - fields: {
140 - authConfigCreation: authConfig.fields.auth_config_creation,
141 - connectedAccountInitiation: authConfig.fields.connected_account_initiation,
142 - },
143 - proxy: {
144 - baseUrl: authConfig.proxy?.base_url,
145 - },
146 - })),
147 - });
148 - if (!parsedResult.success) {
149 - throw new ValidationError('Failed to parse toolkit response', {
150 - cause: parsedResult.error,
151 - });
152 - }
153 - return parsedResult.data;
88 + return transformToolkitRetrieveResponse(result);
89 } catch (error) {
90 if (error instanceof APIError && (error.status === 404 || error.status === 400)) {
91 throw new ComposioToolkitNotFoundError(`Toolkit with slug ${slug} not found`, {
@@ -208,7 +143,7 @@ export class Toolkits {
143 * });
144 * ```
145 */
211 - async get(query: ToolkitListParams): Promise<ToolKitListResponse>;
146 + async get(query?: ToolkitListParams): Promise<ToolKitListResponse>;
147
148 /**
149 * Implementation method that handles both overloads for retrieving toolkits.
@@ -217,12 +152,12 @@ export class Toolkits {
152 * @returns {Promise<ToolkitRetrieveResponse | ToolKitListResponse>} The toolkit or list of toolkits
153 */
154 async get(
220 - arg: string | ToolkitListParams
155 + arg?: string | ToolkitListParams
156 ): Promise<ToolkitRetrieveResponse | ToolKitListResponse> {
157 if (typeof arg === 'string') {
158 return this.getToolkitBySlug(arg);
159 }
225 - return this.getToolkits(arg);
160 + return this.getToolkits(arg ?? {});
161 }
162
163 private async getAuthConfigFields(
@@ -343,23 +278,7 @@ export class Toolkits {
278 */
279 async listCategories(): Promise<ToolkitRetrieveCategoriesResponse> {
280 const result = await this.client.toolkits.retrieveCategories();
346 - const parsedResult = ToolkitRetrieveCategoriesResponseSchema.safeParse({
347 - items: result.items.map(item => {
348 - const parsedItem = ToolkitCategorySchema.parse({
349 - id: item.id,
350 - name: item.name,
351 - });
352 - return parsedItem;
353 - }),
354 - nextCursor: result.next_cursor,
355 - totalPages: result.total_pages,
356 - });
357 - if (!parsedResult.success) {
358 - throw new ValidationError('Failed to parse toolkit categories response', {
359 - cause: parsedResult.error,
360 - });
361 - }
362 - return parsedResult.data;
281 + return transformToolkitRetrieveCategoriesResponse(result);
282 }
283
284 /**
ts/packages/core/src/models/Triggers.ts
+17 -136
@@ -1,36 +1,23 @@
1 import ComposioClient, { APIError } from '@composio/client';
2 +import { TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
3 import {
3 - TriggerInstanceListActiveResponse as TriggerInstanceListActiveResponseComposio,
4 - TriggersTypeListParams as TriggersTypeListParamsRaw,
5 - TriggersTypeListResponse as TriggersTypeListResponseRaw,
6 - TriggersTypeRetrieveEnumResponse,
7 - TriggersTypeRetrieveResponse as TriggersTypeRetrieveResponseRaw,
8 -} from '@composio/client/resources/index';
9 -import {
10 - TriggerInstanceUpsertResponseSchema,
4 TriggerInstanceUpsertResponse,
5 TriggerInstanceUpsertParamsSchema,
6 TriggerInstanceUpsertParams,
7 TriggerInstanceListActiveParams,
8 TriggerInstanceListActiveParamsSchema,
9 TriggerInstanceListActiveResponse,
17 - TriggerInstanceListActiveResponseItemSchema,
18 - TriggerInstanceListActiveResponseSchema,
10 TriggerSubscribeParams,
11 TriggerInstanceManageUpdateParams,
12 TriggerInstanceManageUpdateResponse,
13 TriggerInstanceManageDeleteResponse,
23 - TriggerInstanceManageDeleteResponseSchema,
14 TriggerSubscribeParamSchema,
25 - IncomingTriggerPayloadSchema,
15 IncomingTriggerPayload,
16 TriggerData,
17 TriggersTypeListParams,
18 TriggersTypeListResponse,
30 - TriggersTypeListResponseSchema,
19 TriggersTypeListParamsSchema,
20 TriggersTypeRetrieveResponse,
33 - TriggerTypeSchema,
21 } from '../types/triggers.types';
22 import logger from '../utils/logger';
23 import { telemetry } from '../telemetry/Telemetry';
@@ -38,6 +25,12 @@ import { ComposioConnectedAccountNotFoundError, ValidationError } from '../error
25 import { PusherService } from '../services/pusher/Pusher';
26 import { ComposioTriggerTypeNotFoundError } from '../errors/TriggerErrors';
27 import { transform } from '../utils/transform';
28 +import {
29 + transformIncomingTriggerPayload,
30 + transformTriggerInstanceListActiveResponse,
31 + transformTriggerTypeListResponse,
32 + transformTriggerTypeRetrieveResponse,
33 +} from '../utils/transformers/triggers';
34 /**
35 * Trigger (Instance) class
36 * /api/v3/trigger_instances
@@ -53,34 +46,6 @@ export class Triggers {
46 telemetry.instrument(this);
47 }
48
56 - /**
57 - * Parse the trigger instance list active item
58 - *
59 - * @param response - The response from the composio client
60 - * @returns The parsed trigger instance list active item
61 - */
62 - private parseTriggerInstanceListActiveItem(
63 - response: TriggerInstanceListActiveResponseComposio['items'][0]
64 - ) {
65 - const parsed = TriggerInstanceListActiveResponseItemSchema.safeParse({
66 - id: response.id,
67 - connectedAccountId: response.connected_account_id,
68 - disabledAt: response.disabled_at,
69 - state: response.state,
70 - triggerConfig: response.trigger_config,
71 - triggerName: response.trigger_name,
72 - updatedAt: response.updated_at,
73 - triggerData: response.trigger_data,
74 - uuid: response.uuid,
75 - });
76 - if (!parsed.success) {
77 - throw new ValidationError(`Invalid trigger instance list active item`, {
78 - cause: parsed.error,
79 - });
80 - }
81 - return parsed.data;
82 - }
83 -
49 /**
50 * Fetch list of all the active triggers
51 *
@@ -124,20 +89,7 @@ export class Triggers {
89 }
90 : undefined
91 );
127 -
128 - const parsedResult = TriggerInstanceListActiveResponseSchema.safeParse({
129 - items: result.items.map(item => this.parseTriggerInstanceListActiveItem(item)),
130 - nextCursor: result.next_cursor,
131 - totalPages: result.total_pages,
132 - } as TriggerInstanceListActiveResponse);
133 -
134 - if (!parsedResult.success) {
135 - throw new ValidationError(`Invalid trigger instance list active response`, {
136 - cause: parsedResult.error,
137 - });
138 - }
139 -
140 - return parsedResult.data;
92 + return transformTriggerInstanceListActiveResponse(result);
93 }
94
95 /**
@@ -244,17 +196,9 @@ export class Triggers {
196 trigger_config: parsedBody.data.triggerConfig,
197 });
198
247 - const parsedResult = TriggerInstanceUpsertResponseSchema.safeParse({
199 + return {
200 triggerId: result.trigger_id,
249 - } as TriggerInstanceUpsertResponse);
250 -
251 - if (!parsedResult.success) {
252 - throw new ValidationError(`Invalid trigger instance upsert response`, {
253 - cause: parsedResult.error,
254 - });
255 - }
256 -
257 - return parsedResult.data;
201 + };
202 }
203
204 /**
@@ -279,17 +223,9 @@ export class Triggers {
223 */
224 async delete(triggerId: string): Promise<TriggerInstanceManageDeleteResponse> {
225 const result = await this.client.triggerInstances.manage.delete(triggerId);
282 - const parsedResult = TriggerInstanceManageDeleteResponseSchema.safeParse({
226 + return {
227 triggerId: result.trigger_id,
284 - });
285 -
286 - if (!parsedResult.success) {
287 - throw new ValidationError(`Invalid trigger instance manage delete response`, {
288 - cause: parsedResult.error,
289 - });
290 - }
291 -
292 - return parsedResult.data;
228 + };
229 }
230
231 /**
@@ -337,15 +273,7 @@ export class Triggers {
273 toolkit_slugs: parsedQuery.toolkits,
274 });
275
340 - const parsedResult = transform(result)
341 - .with(TriggersTypeListResponseSchema)
342 - .using(raw => ({
343 - items: raw.items,
344 - nextCursor: raw.next_cursor ?? null,
345 - totalPages: raw.total_pages,
346 - }));
347 -
348 - return parsedResult;
276 + return transformTriggerTypeListResponse(result);
277 }
278
279 /**
@@ -357,23 +285,7 @@ export class Triggers {
285 */
286 async getType(slug: string): Promise<TriggersTypeRetrieveResponse> {
287 const result = await this.client.triggersTypes.retrieve(slug);
360 - const parsedResult = transform(result)
361 - .with(TriggerTypeSchema)
362 - .using(raw => ({
363 - slug: raw.slug,
364 - name: raw.name,
365 - description: raw.description,
366 - instructions: raw.instructions,
367 - toolkit: {
368 - logo: raw.toolkit.logo,
369 - slug: raw.toolkit.slug,
370 - name: raw.toolkit.name,
371 - },
372 - payload: raw.payload,
373 - config: raw.config,
374 - }));
375 -
376 - return parsedResult;
288 + return transformTriggerTypeRetrieveResponse(result);
289 }
290
291 /**
@@ -499,42 +411,11 @@ export class Triggers {
411 // @TODO: This is a temporary fix to get the trigger data
412 // ideally we should have a type for the trigger data
413 const data = _data as TriggerData;
502 - const parsedData = IncomingTriggerPayloadSchema.safeParse({
503 - id: data.metadata.nanoId,
504 - uuid: data.metadata.id,
505 - triggerSlug: data.metadata.triggerName,
506 - toolkitSlug: data.appName,
507 - userId: data.metadata.connection?.clientUniqueUserId,
508 - payload: data.payload,
509 - originalPayload: data.originalPayload,
510 - metadata: {
511 - id: data.metadata.nanoId,
512 - uuid: data.metadata.id,
513 - triggerConfig: data.metadata.triggerConfig,
514 - triggerSlug: data.metadata.triggerName,
515 - toolkitSlug: data.appName,
516 - triggerData: data.metadata.triggerData,
517 - connectedAccount: {
518 - id: data.metadata.connection?.connectedAccountNanoId,
519 - uuid: data.metadata.connection?.id,
520 - authConfigId: data.metadata.connection?.authConfigNanoId,
521 - authConfigUUID: data.metadata.connection?.integrationId,
522 - userId: data.metadata.connection?.clientUniqueUserId,
523 - status: data.metadata.connection?.status,
524 - },
525 - },
526 - });
414 + const parsedData = transformIncomingTriggerPayload(data);
415
528 - logger.debug('Parsed trigger data', JSON.stringify(parsedData.data, null, 2));
529 -
530 - if (parsedData.error) {
531 - throw new ValidationError(`Invalid trigger payload`, {
532 - cause: parsedData.error,
533 - });
534 - }
535 - if (this.shouldSendTriggerAfterFilters(parsedFilters.data, parsedData.data)) {
416 + if (this.shouldSendTriggerAfterFilters(parsedFilters.data, parsedData)) {
417 try {
537 - fn(parsedData.data);
418 + fn(parsedData);
419 } catch (error) {
420 logger.error('❌ Error in trigger callback:', error);
421 }
ts/packages/core/src/types/connectedAccountAuthStates.types.ts
+133 -16
@@ -7,6 +7,7 @@ export const ConnectionStatuses = {
7 ACTIVE: 'ACTIVE',
8 FAILED: 'FAILED',
9 EXPIRED: 'EXPIRED',
10 + INACTIVE: 'INACTIVE',
11 } as const;
12 export type ConnectionStatusEnum = (typeof ConnectionStatuses)[keyof typeof ConnectionStatuses];
13
@@ -87,12 +88,12 @@ export const Oauth2InitiatedConnectionDataSchema = Oauth2InitiatingConnectionDat
88
89 export const Oauth2ActiveConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
90 status: z.literal(ConnectionStatuses.ACTIVE),
90 - access_token: z.string(),
91 + access_token: z.string().optional(),
92 id_token: z.string().optional(),
92 - token_type: z.string(),
93 + token_type: z.string().optional(),
94 refresh_token: z.string().optional(),
94 - expires_in: z.number().optional(),
95 - scope: z.string().optional(),
95 + expires_in: z.union([z.string(), z.number(), z.null()]).optional(),
96 + scope: z.union([z.string(), z.array(z.string())]).optional(),
97 // previously verification_token, will be sent as verification_token to slack
98 webhook_signature: z.string().optional(),
99 authed_user: z
@@ -115,12 +116,17 @@ export const Oauth2ExpiredConnectionDataSchema = Oauth2InitiatingConnectionDataS
116 expired_at: z.string().optional(),
117 }).catchall(z.unknown());
118
119 +export const Oauth2InactiveConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
120 + status: z.literal(ConnectionStatuses.INACTIVE),
121 +}).catchall(z.unknown());
122 +
123 export const Oauth2ConnectionDataSchema = z.discriminatedUnion('status', [
124 Oauth2InitiatingConnectionDataSchema,
125 Oauth2InitiatedConnectionDataSchema,
126 Oauth2ActiveConnectionDataSchema,
127 Oauth2FailedConnectionDataSchema,
128 Oauth2ExpiredConnectionDataSchema,
129 + Oauth2InactiveConnectionDataSchema,
130 ]);
131
132 export type Oauth2InitiatingConnectionData = z.infer<typeof Oauth2InitiatingConnectionDataSchema>;
@@ -128,6 +134,7 @@ export type Oauth2InitiatedConnectionData = z.infer<typeof Oauth2InitiatedConnec
134 export type Oauth2ActiveConnectionData = z.infer<typeof Oauth2ActiveConnectionDataSchema>;
135 export type Oauth2FailedConnectionData = z.infer<typeof Oauth2FailedConnectionDataSchema>;
136 export type Oauth2ExpiredConnectionData = z.infer<typeof Oauth2ExpiredConnectionDataSchema>;
137 +export type Oauth2InactiveConnectionData = z.infer<typeof Oauth2InactiveConnectionDataSchema>;
138 export type Oauth2ConnectionData = z.infer<typeof Oauth2ConnectionDataSchema>;
139
140 // OAUTH1
@@ -137,16 +144,16 @@ export const Oauth1InitiatingConnectionDataSchema = BaseSchemeRaw.extend({
144
145 export const Oauth1InitiatedConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
146 status: z.literal(ConnectionStatuses.INITIATED),
140 - oauth_token: z.string(),
141 - authUri: z.string(),
142 - oauth_token_secret: z.string(),
143 - redirectUrl: z.string(),
147 + oauth_token: z.string().optional(),
148 + authUri: z.string().optional(),
149 + oauth_token_secret: z.string().optional(),
150 + redirectUrl: z.string().optional(),
151 callbackUrl: z.string().optional(),
152 }).catchall(z.unknown());
153
154 export const Oauth1ActiveConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
155 status: z.literal(ConnectionStatuses.ACTIVE),
149 - oauth_token: z.string(),
156 + oauth_token: z.string().optional(),
157 consumer_key: z.string().optional(),
158 redirectUrl: z.string().optional(),
159 callback_url: z.string().optional(),
@@ -163,12 +170,17 @@ export const Oauth1ExpiredConnectionDataSchema = Oauth1InitiatingConnectionDataS
170 expired_at: z.string().optional(),
171 }).catchall(z.unknown());
172
173 +export const Oauth1InactiveConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
174 + status: z.literal(ConnectionStatuses.INACTIVE),
175 +}).catchall(z.unknown());
176 +
177 export const Oauth1ConnectionDataSchema = z.discriminatedUnion('status', [
178 Oauth1InitiatingConnectionDataSchema,
179 Oauth1InitiatedConnectionDataSchema,
180 Oauth1ActiveConnectionDataSchema,
181 Oauth1FailedConnectionDataSchema,
182 Oauth1ExpiredConnectionDataSchema,
183 + Oauth1InactiveConnectionDataSchema,
184 ]);
185
186 export type Oauth1InitiatingConnectionData = z.infer<typeof Oauth1InitiatingConnectionDataSchema>;
@@ -176,6 +188,7 @@ export type Oauth1InitiatedConnectionData = z.infer<typeof Oauth1InitiatedConnec
188 export type Oauth1ActiveConnectionData = z.infer<typeof Oauth1ActiveConnectionDataSchema>;
189 export type Oauth1FailedConnectionData = z.infer<typeof Oauth1FailedConnectionDataSchema>;
190 export type Oauth1ExpiredConnectionData = z.infer<typeof Oauth1ExpiredConnectionDataSchema>;
191 +export type Oauth1InactiveConnectionData = z.infer<typeof Oauth1InactiveConnectionDataSchema>;
192 export type Oauth1ConnectionData = z.infer<typeof Oauth1ConnectionDataSchema>;
193
194 // COMPOSIO_LINK_AUTH
@@ -200,6 +213,9 @@ export const ComposioLinkConnectionDataSchema = z.discriminatedUnion('status', [
213 status: z.literal(ConnectionStatuses.EXPIRED),
214 expired_at: z.string().optional(),
215 }).catchall(z.unknown()),
216 + ComposioLinkInitiatingSchema.extend({
217 + status: z.literal(ConnectionStatuses.INACTIVE),
218 + }).catchall(z.unknown()),
219 ]);
220
221 // BILLCOM_AUTH
@@ -226,6 +242,9 @@ export const BillcomAuthConnectionDataSchema = z.discriminatedUnion('status', [
242 status: z.literal(ConnectionStatuses.EXPIRED),
243 expired_at: z.string().optional(),
244 }).catchall(z.unknown()),
245 + BillcomAuthInitiatingSchema.extend({
246 + status: z.literal(ConnectionStatuses.INACTIVE),
247 + }).catchall(z.unknown()),
248 ]);
249
250 // BASIC
@@ -234,7 +253,21 @@ const BasicInitiatingSchema = BaseSchemeRaw.extend({
253 username: z.string(),
254 password: z.string(),
255 }).catchall(z.unknown());
237 -const BasicConnectionDataSchema = BasicInitiatingSchema;
256 +const BasicConnectionDataSchema = z.discriminatedUnion('status', [
257 + BasicInitiatingSchema,
258 + BasicInitiatingSchema.extend({
259 + status: z.literal(ConnectionStatuses.INACTIVE),
260 + }).catchall(z.unknown()),
261 + BasicInitiatingSchema.extend({
262 + status: z.literal(ConnectionStatuses.FAILED),
263 + error: z.string().optional(),
264 + error_description: z.string().optional(),
265 + }).catchall(z.unknown()),
266 + BasicInitiatingSchema.extend({
267 + status: z.literal(ConnectionStatuses.EXPIRED),
268 + expired_at: z.string().optional(),
269 + }).catchall(z.unknown()),
270 +]);
271
272 // API_KEY
273 const ApiKeyInitiatingSchema = BaseSchemeRaw.extend({
@@ -242,33 +275,103 @@ const ApiKeyInitiatingSchema = BaseSchemeRaw.extend({
275 api_key: z.string().optional(),
276 generic_api_key: z.string().optional(),
277 }).catchall(z.unknown());
245 -const ApiKeyConnectionDataSchema = ApiKeyInitiatingSchema;
278 +const ApiKeyConnectionDataSchema = z.discriminatedUnion('status', [
279 + ApiKeyInitiatingSchema,
280 + ApiKeyInitiatingSchema.extend({
281 + status: z.literal(ConnectionStatuses.INACTIVE),
282 + }).catchall(z.unknown()),
283 + ApiKeyInitiatingSchema.extend({
284 + status: z.literal(ConnectionStatuses.FAILED),
285 + error: z.string().optional(),
286 + error_description: z.string().optional(),
287 + }).catchall(z.unknown()),
288 + ApiKeyInitiatingSchema.extend({
289 + status: z.literal(ConnectionStatuses.EXPIRED),
290 + expired_at: z.string().optional(),
291 + }).catchall(z.unknown()),
292 +]);
293
294 // BEARER_TOKEN
295 const BearerTokenInitiatingSchema = BaseSchemeRaw.extend({
296 status: z.literal(ConnectionStatuses.ACTIVE),
297 token: z.string(),
298 }).catchall(z.unknown());
252 -const BearerTokenConnectionDataSchema = BearerTokenInitiatingSchema;
299 +const BearerTokenConnectionDataSchema = z.discriminatedUnion('status', [
300 + BearerTokenInitiatingSchema,
301 + BearerTokenInitiatingSchema.extend({
302 + status: z.literal(ConnectionStatuses.INACTIVE),
303 + }).catchall(z.unknown()),
304 + BearerTokenInitiatingSchema.extend({
305 + status: z.literal(ConnectionStatuses.FAILED),
306 + error: z.string().optional(),
307 + error_description: z.string().optional(),
308 + }).catchall(z.unknown()),
309 + BearerTokenInitiatingSchema.extend({
310 + status: z.literal(ConnectionStatuses.EXPIRED),
311 + expired_at: z.string().optional(),
312 + }).catchall(z.unknown()),
313 +]);
314
315 // GOOGLE_SERVICE_ACCOUNT
316 const GoogleServiceAccountInitiatingSchema = BaseSchemeRaw.extend({
317 status: z.literal(ConnectionStatuses.ACTIVE),
318 credentials_json: z.string(),
319 }).catchall(z.unknown());
259 -const GoogleServiceAccountConnectionDataSchema = GoogleServiceAccountInitiatingSchema;
320 +const GoogleServiceAccountConnectionDataSchema = z.discriminatedUnion('status', [
321 + GoogleServiceAccountInitiatingSchema,
322 + GoogleServiceAccountInitiatingSchema.extend({
323 + status: z.literal(ConnectionStatuses.INACTIVE),
324 + }).catchall(z.unknown()),
325 + GoogleServiceAccountInitiatingSchema.extend({
326 + status: z.literal(ConnectionStatuses.FAILED),
327 + error: z.string().optional(),
328 + error_description: z.string().optional(),
329 + }).catchall(z.unknown()),
330 + GoogleServiceAccountInitiatingSchema.extend({
331 + status: z.literal(ConnectionStatuses.EXPIRED),
332 + expired_at: z.string().optional(),
333 + }).catchall(z.unknown()),
334 +]);
335
336 // NO_AUTH
337 const NoAuthInitiatingSchema = BaseSchemeRaw.extend({
338 status: z.literal(ConnectionStatuses.ACTIVE),
339 }).catchall(z.unknown());
265 -const NoAuthConnectionDataSchema = NoAuthInitiatingSchema;
340 +const NoAuthConnectionDataSchema = z.discriminatedUnion('status', [
341 + NoAuthInitiatingSchema,
342 + NoAuthInitiatingSchema.extend({
343 + status: z.literal(ConnectionStatuses.INACTIVE),
344 + }).catchall(z.unknown()),
345 + NoAuthInitiatingSchema.extend({
346 + status: z.literal(ConnectionStatuses.FAILED),
347 + error: z.string().optional(),
348 + error_description: z.string().optional(),
349 + }).catchall(z.unknown()),
350 + NoAuthInitiatingSchema.extend({
351 + status: z.literal(ConnectionStatuses.EXPIRED),
352 + expired_at: z.string().optional(),
353 + }).catchall(z.unknown()),
354 +]);
355
356 // CALCOM_AUTH
357 const CalcomAuthInitiatingSchema = BaseSchemeRaw.extend({
358 status: z.literal(ConnectionStatuses.ACTIVE),
359 }).catchall(z.unknown());
271 -const CalcomAuthConnectionDataSchema = CalcomAuthInitiatingSchema;
360 +const CalcomAuthConnectionDataSchema = z.discriminatedUnion('status', [
361 + CalcomAuthInitiatingSchema,
362 + CalcomAuthInitiatingSchema.extend({
363 + status: z.literal(ConnectionStatuses.INACTIVE),
364 + }).catchall(z.unknown()),
365 + CalcomAuthInitiatingSchema.extend({
366 + status: z.literal(ConnectionStatuses.FAILED),
367 + error: z.string().optional(),
368 + error_description: z.string().optional(),
369 + }).catchall(z.unknown()),
370 + CalcomAuthInitiatingSchema.extend({
371 + status: z.literal(ConnectionStatuses.EXPIRED),
372 + expired_at: z.string().optional(),
373 + }).catchall(z.unknown()),
374 +]);
375
376 // SNOWFLAKE
377 // const SnowflakeInitiatingSchema = BaseSchemeRaw.extend({
@@ -293,7 +396,21 @@ const BasicWithJwtInitiatingSchema = BaseSchemeRaw.extend({
396 username: z.string(),
397 password: z.string(),
398 }).catchall(z.unknown());
296 -const BasicWithJwtConnectionDataSchema = BasicWithJwtInitiatingSchema;
399 +const BasicWithJwtConnectionDataSchema = z.discriminatedUnion('status', [
400 + BasicWithJwtInitiatingSchema,
401 + BasicWithJwtInitiatingSchema.extend({
402 + status: z.literal(ConnectionStatuses.INACTIVE),
403 + }).catchall(z.unknown()),
404 + BasicWithJwtInitiatingSchema.extend({
405 + status: z.literal(ConnectionStatuses.FAILED),
406 + error: z.string().optional(),
407 + error_description: z.string().optional(),
408 + }).catchall(z.unknown()),
409 + BasicWithJwtInitiatingSchema.extend({
410 + status: z.literal(ConnectionStatuses.EXPIRED),
411 + expired_at: z.string().optional(),
412 + }).catchall(z.unknown()),
413 +]);
414
415 export const ConnectionDataSchema = z.discriminatedUnion('authScheme', [
416 z.object({
ts/packages/core/src/types/connectedAccounts.types.ts
+2 -1
@@ -18,6 +18,7 @@ export const ConnectedAccountStatusSchema = z.enum([
18 ConnectedAccountStatuses.ACTIVE,
19 ConnectedAccountStatuses.FAILED,
20 ConnectedAccountStatuses.EXPIRED,
21 + ConnectedAccountStatuses.INACTIVE,
22 ]);
23 export type ConnectedAccountStatus =
24 (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
@@ -72,7 +73,7 @@ export type ConnectedAccountAuthConfig = z.infer<typeof ConnectedAccountAuthConf
73 export const ConnectedAccountRetrieveResponseSchema = z.object({
74 id: z.string(),
75 authConfig: ConnectedAccountAuthConfigSchema,
75 - data: z.record(z.string(), z.unknown()),
76 + data: z.record(z.string(), z.unknown()).optional(),
77 params: z.record(z.string(), z.unknown()).optional(),
78 status: ConnectedAccountStatusSchema,
79 statusReason: z.string().nullable(),
ts/packages/core/src/utils/transform.ts
+11 -7
@@ -11,8 +11,9 @@
11 * .using((raw) => ({ ... }))
12 * ```
13 */
14 -import { ZodType, ZodTypeAny, z } from 'zod';
14 +import { ZodTypeAny, z } from 'zod';
15 import { ValidationError } from '../errors';
16 +import { logger } from '..';
17
18 export function transform<RawInput>(raw: RawInput) {
19 return {
@@ -26,12 +27,15 @@ export function transform<RawInput>(raw: RawInput) {
27 const result = schema.safeParse(transformed);
28
29 if (!result.success) {
29 - throw new ValidationError(
30 - `Failed to transform${options?.label ? ` ${options.label}` : ''}`,
31 - {
32 - cause: result.error,
33 - }
34 - );
30 + // @TODO:send telemetry here
31 + // throw new ValidationError(
32 + // `Failed to transform${options?.label ? ` ${options.label}` : ''}`,
33 + // {
34 + // cause: result.error,
35 + // }
36 + // );
37 + logger.error(result.error);
38 + return transformed;
39 }
40
41 return result.data;
ts/packages/core/src/utils/transformers/authConfigs.ts new
+100
@@ -0,0 +1,100 @@
1 +import { logger } from '../..';
2 +import {
3 + AuthConfigRetrieveResponse,
4 + AuthConfigRetrieveResponseSchema,
5 + AuthConfigListResponse,
6 + AuthConfigListResponseSchema,
7 + CreateAuthConfigResponse,
8 + CreateAuthConfigResponseSchema,
9 +} from '../../types/authConfigs.types';
10 +
11 +import {
12 + AuthConfigListResponse as RawAuthConfigListResponse,
13 + AuthConfigRetrieveResponse as RawAuthConfigRetrieveResponse,
14 + AuthConfigCreateResponse as RawCreateAuthConfigResponse,
15 +} from '@composio/client/resources/auth-configs';
16 +import { transform } from '../transform';
17 +
18 +/**
19 + * Transforms an auth config response from API format to SDK format.
20 + *
21 + * This method converts property names from snake_case to camelCase and reorganizes
22 + * the data structure to match the SDK's standardized format for auth configurations.
23 + *
24 + * @param {RawAuthConfigRetrieveResponse} authConfig - The raw API response to transform
25 + * @returns {AuthConfigRetrieveResponse} The transformed auth config data
26 + *
27 + * @private
28 + */
29 +export function transformAuthConfigRetrieveResponse(
30 + authConfig: RawAuthConfigRetrieveResponse
31 +): AuthConfigRetrieveResponse {
32 + return transform(authConfig)
33 + .with(AuthConfigRetrieveResponseSchema)
34 + .using(authConfig => ({
35 + id: authConfig.id,
36 + name: authConfig.name,
37 + noOfConnections: authConfig.no_of_connections,
38 + status: authConfig.status,
39 + toolkit: {
40 + logo: authConfig.toolkit.logo,
41 + slug: authConfig.toolkit.slug,
42 + },
43 + uuid: authConfig.uuid,
44 + authScheme: authConfig.auth_scheme,
45 + credentials: authConfig.credentials,
46 + expectedInputFields: authConfig.expected_input_fields,
47 + isComposioManaged: authConfig.is_composio_managed,
48 + createdBy: authConfig.created_by,
49 + createdAt: authConfig.created_at,
50 + lastUpdatedAt: authConfig.last_updated_at,
51 + restrictToFollowingTools: authConfig.restrict_to_following_tools,
52 + }));
53 +}
54 +
55 +/**
56 + * Transforms the raw auth config list response from the Composio API to the SDK format.
57 + *
58 + * This method converts property names from snake_case to camelCase and reorganizes
59 + * the data structure to match the SDK's standardized format for auth configurations.
60 + *
61 + * @param {RawAuthConfigListResponse} response - The raw API response to transform
62 + * @returns {AuthConfigListResponse} The transformed response
63 + *
64 + * @private
65 + */
66 +export function transformAuthConfigListResponse(
67 + response: RawAuthConfigListResponse
68 +): AuthConfigListResponse {
69 + return transform(response)
70 + .with(AuthConfigListResponseSchema)
71 + .using(response => ({
72 + items: response.items.map(transformAuthConfigRetrieveResponse),
73 + nextCursor: response.next_cursor ?? null,
74 + totalPages: response.total_pages,
75 + }));
76 +}
77 +
78 +/**
79 + * Transforms the raw create auth config response from the Composio API to the SDK format.
80 + *
81 + * This method converts property names from snake_case to camelCase and reorganizes
82 + * the data structure to match the SDK's standardized format for auth configurations.
83 + *
84 + * @param {RawCreateAuthConfigResponse} response - The raw API response to transform
85 + * @returns {CreateAuthConfigResponse} The transformed response
86 + *
87 + * @private
88 + */
89 +export function transformCreateAuthConfigResponse(
90 + response: RawCreateAuthConfigResponse
91 +): CreateAuthConfigResponse {
92 + return transform(response)
93 + .with(CreateAuthConfigResponseSchema)
94 + .using(response => ({
95 + id: response.auth_config.id,
96 + authScheme: response.auth_config.auth_scheme,
97 + isComposioManaged: response.auth_config.is_composio_managed,
98 + toolkit: response.toolkit.slug,
99 + }));
100 +}
ts/packages/core/src/utils/transformers/connectedAccounts.ts
+46 -26
@@ -3,11 +3,14 @@ import {
3 ConnectedAccountRetrieveResponse as RawConnectedAccountRetrieveResponse,
4 } from '@composio/client/resources/connected-accounts';
5 import {
6 + ConnectedAccountListResponse,
7 + ConnectedAccountListResponseSchema,
8 ConnectedAccountRetrieveResponse,
9 ConnectedAccountRetrieveResponseSchema,
10 } from '../../types/connectedAccounts.types';
11 import { ValidationError } from '../../errors';
12 import logger from '../logger';
13 +import { transform } from '../transform';
14
15 /**
16 * Transforms the raw connected account response from the Composio API to the SDK format.
@@ -24,30 +27,47 @@ import logger from '../logger';
27 export function transformConnectedAccountResponse(
28 response: RawConnectedAccountRetrieveResponse | RawConnectedAccountListResponse['items'][0]
29 ): ConnectedAccountRetrieveResponse {
27 - const responseToParse = {
28 - ...response,
29 - authConfig: {
30 - ...response.auth_config,
31 - id: response.auth_config.id,
32 - isComposioManaged: response.auth_config.is_composio_managed,
33 - isDisabled: response.auth_config.is_disabled,
34 - },
35 - state: response.state,
36 - status: response.status,
37 - statusReason: response.status_reason,
38 - isDisabled: response.is_disabled,
39 - createdAt: response.created_at,
40 - updatedAt: response.updated_at,
41 - testRequestEndpoint: response.test_request_endpoint,
42 - };
43 - const result = ConnectedAccountRetrieveResponseSchema.safeParse(responseToParse);
44 - if (!result.success) {
45 - logger.error('Failed to parse connected account retrieve response', {
46 - cause: result.error,
47 - });
48 - // this is a fallback for when the response is not valid, it will return the response as is
49 - // ideally to not break the app if there are some issues with the response, fields missing etc
50 - return responseToParse as unknown as ConnectedAccountRetrieveResponse;
51 - }
52 - return result.data;
30 + return transform(response)
31 + .with(ConnectedAccountRetrieveResponseSchema)
32 + .using(response => ({
33 + ...response,
34 + authConfig: {
35 + ...response.auth_config,
36 + id: response.auth_config.id,
37 + isComposioManaged: response.auth_config.is_composio_managed,
38 + isDisabled: response.auth_config.is_disabled,
39 + },
40 + data: (response as unknown as ConnectedAccountRetrieveResponse).data ?? undefined,
41 + state: response.state,
42 + status: response.status,
43 + statusReason: response.status_reason,
44 + isDisabled: response.is_disabled,
45 + createdAt: response.created_at,
46 + updatedAt: response.updated_at,
47 + testRequestEndpoint: response.test_request_endpoint,
48 + }));
49 +}
50 +
51 +/**
52 + * Transforms the raw connected account list response from the Composio API to the SDK format.
53 + *
54 + * This method converts property names from snake_case to camelCase and reorganizes
55 + * the data structure to match the SDK's standardized format.
56 + *
57 + * @param {RawConnectedAccountListResponse} response - The raw API response to transform
58 + * @returns {ConnectedAccountListResponse} The transformed response
59 + * @throws {ZodError} If the response fails validation against the expected schema
60 + *
61 + * @private
62 + */
63 +export function transformConnectedAccountListResponse(
64 + response: RawConnectedAccountListResponse
65 +): ConnectedAccountListResponse {
66 + return transform(response)
67 + .with(ConnectedAccountListResponseSchema)
68 + .using(response => ({
69 + items: response.items.map(transformConnectedAccountResponse),
70 + nextCursor: response.next_cursor ?? null,
71 + totalPages: response.total_pages,
72 + }));
73 }
ts/packages/core/src/utils/transformers/toolkits.ts new
+96
@@ -0,0 +1,96 @@
1 +import {
2 + ToolkitRetrieveResponse as RawToolkitRetrieveResponse,
3 + ToolkitListResponse as RawToolkitListResponse,
4 + ToolkitRetrieveCategoriesResponse as RawToolkitRetrieveCategoriesResponse,
5 +} from '@composio/client/resources/toolkits';
6 +import {
7 + ToolKitListResponse,
8 + ToolKitListResponseSchema,
9 + ToolkitRetrieveResponse,
10 + ToolkitRetrieveResponseSchema,
11 + ToolkitRetrieveCategoriesResponse,
12 + ToolkitRetrieveCategoriesResponseSchema,
13 +} from '../../types/toolkit.types';
14 +import { transform } from '../transform';
15 +
16 +export const transformToolkitListResponse = (
17 + response: RawToolkitListResponse
18 +): ToolKitListResponse => {
19 + return transform(response)
20 + .with(ToolKitListResponseSchema)
21 + .using(response =>
22 + response.items.map(item => ({
23 + name: item.name,
24 + slug: item.slug,
25 + meta: {
26 + ...item.meta,
27 + categories: item.meta.categories?.map(category => ({
28 + slug: category.id,
29 + name: category.name,
30 + })),
31 + createdAt: item.meta.created_at,
32 + description: item.meta.description,
33 + logo: item.meta.logo,
34 + toolsCount: item.meta.tools_count,
35 + triggersCount: item.meta.triggers_count,
36 + updatedAt: item.meta.updated_at,
37 + appUrl: item.meta.app_url ?? undefined,
38 + },
39 + isLocalToolkit: item.is_local_toolkit,
40 + authSchemes: item.auth_schemes,
41 + composioManagedAuthSchemes: item.composio_managed_auth_schemes,
42 + noAuth: item.no_auth,
43 + }))
44 + );
45 +};
46 +
47 +export const transformToolkitRetrieveResponse = (
48 + response: RawToolkitRetrieveResponse
49 +): ToolkitRetrieveResponse => {
50 + return transform(response)
51 + .with(ToolkitRetrieveResponseSchema)
52 + .using(response => ({
53 + name: response.name,
54 + slug: response.slug,
55 + meta: {
56 + ...response.meta,
57 + createdAt: response.meta.created_at,
58 + updatedAt: response.meta.updated_at,
59 + toolsCount: response.meta.tools_count,
60 + triggersCount: response.meta.triggers_count,
61 + categories: response.meta.categories?.map(category => ({
62 + slug: category.slug,
63 + name: category.name,
64 + })),
65 + // appUrl: response.meta.app_url, @TODO Update the client type to include this
66 + },
67 + isLocalToolkit: response.is_local_toolkit,
68 + composioManagedAuthSchemes: response.composio_managed_auth_schemes,
69 + authConfigDetails: response.auth_config_details?.map(authConfig => ({
70 + name: authConfig.name,
71 + mode: authConfig.mode,
72 + fields: {
73 + authConfigCreation: authConfig.fields.auth_config_creation,
74 + connectedAccountInitiation: authConfig.fields.connected_account_initiation,
75 + },
76 + proxy: {
77 + baseUrl: authConfig.proxy?.base_url,
78 + },
79 + })),
80 + }));
81 +};
82 +
83 +export const transformToolkitRetrieveCategoriesResponse = (
84 + response: RawToolkitRetrieveCategoriesResponse
85 +): ToolkitRetrieveCategoriesResponse => {
86 + return transform(response)
87 + .with(ToolkitRetrieveCategoriesResponseSchema)
88 + .using(response => ({
89 + items: response.items.map(item => ({
90 + id: item.id,
91 + name: item.name,
92 + })),
93 + nextCursor: response.next_cursor ?? null,
94 + totalPages: response.total_pages,
95 + }));
96 +};
ts/packages/core/src/utils/transformers/triggers.ts new
+117
@@ -0,0 +1,117 @@
1 +import {
2 + TriggersTypeRetrieveResponse as RawTriggersTypeRetrieveResponse,
3 + TriggersTypeListResponse as RawTriggersTypeListResponse,
4 +} from '@composio/client/resources/triggers-types';
5 +import { TriggerInstanceListActiveResponse as RawTriggerInstanceListActiveResponse } from '@composio/client/resources/index';
6 +import {
7 + IncomingTriggerPayload,
8 + IncomingTriggerPayloadSchema,
9 + TriggerData,
10 + TriggersTypeRetrieveResponse,
11 + TriggerTypeSchema,
12 + TriggersTypeListResponse,
13 + TriggersTypeListResponseSchema,
14 + TriggerInstanceListActiveResponse,
15 + TriggerInstanceListActiveResponseSchema,
16 + TriggerInstanceListActiveResponseItem,
17 + TriggerInstanceListActiveResponseItemSchema,
18 +} from '../../types/triggers.types';
19 +import { transform } from '../transform';
20 +
21 +export function transformIncomingTriggerPayload(response: TriggerData): IncomingTriggerPayload {
22 + return transform(response)
23 + .with(IncomingTriggerPayloadSchema)
24 + .using(response => ({
25 + id: response.metadata.nanoId,
26 + uuid: response.metadata.id,
27 + triggerSlug: response.metadata.triggerName,
28 + toolkitSlug: response.appName,
29 + userId: response.metadata.connection?.clientUniqueUserId,
30 + payload: response.payload,
31 + originalPayload: response.originalPayload,
32 + metadata: {
33 + id: response.metadata.nanoId,
34 + uuid: response.metadata.id,
35 + triggerConfig: response.metadata.triggerConfig,
36 + triggerSlug: response.metadata.triggerName,
37 + toolkitSlug: response.appName,
38 + triggerData: response.metadata.triggerData,
39 + connectedAccount: {
40 + id: response.metadata.connection?.connectedAccountNanoId,
41 + uuid: response.metadata.connection?.id,
42 + authConfigId: response.metadata.connection?.authConfigNanoId,
43 + authConfigUUID: response.metadata.connection?.integrationId,
44 + userId: response.metadata.connection?.clientUniqueUserId,
45 + status: response.metadata.connection?.status as 'ACTIVE' | 'INACTIVE',
46 + },
47 + },
48 + }));
49 +}
50 +
51 +export function transformTriggerTypeRetrieveResponse(
52 + response: RawTriggersTypeRetrieveResponse
53 +): TriggersTypeRetrieveResponse {
54 + return transform(response)
55 + .with(TriggerTypeSchema)
56 + .using(response => ({
57 + slug: response.slug,
58 + name: response.name,
59 + description: response.description,
60 + instructions: response.instructions,
61 + toolkit: {
62 + logo: response.toolkit.logo,
63 + slug: response.toolkit.slug,
64 + name: response.toolkit.name,
65 + },
66 + payload: response.payload,
67 + config: response.config,
68 + }));
69 +}
70 +
71 +export function transformTriggerTypeListResponse(
72 + response: RawTriggersTypeListResponse
73 +): TriggersTypeListResponse {
74 + return transform(response)
75 + .with(TriggersTypeListResponseSchema)
76 + .using(response => ({
77 + items: response.items,
78 + nextCursor: response.next_cursor ?? null,
79 + totalPages: response.total_pages,
80 + }));
81 +}
82 +
83 +/**
84 + * Parse the trigger instance list active item
85 + *
86 + * @param response - The response from the composio client
87 + * @returns The parsed trigger instance list active item
88 + */
89 +export function transformTriggerInstanceListActiveItem(
90 + response: RawTriggerInstanceListActiveResponse['items'][0]
91 +): TriggerInstanceListActiveResponseItem {
92 + return transform(response)
93 + .with(TriggerInstanceListActiveResponseItemSchema)
94 + .using(response => ({
95 + id: response.id,
96 + connectedAccountId: response.connected_account_id,
97 + disabledAt: response.disabled_at,
98 + state: response.state,
99 + triggerConfig: response.trigger_config,
100 + triggerName: response.trigger_name,
101 + updatedAt: response.updated_at,
102 + triggerData: response.trigger_data,
103 + uuid: response.uuid,
104 + }));
105 +}
106 +
107 +export function transformTriggerInstanceListActiveResponse(
108 + response: RawTriggerInstanceListActiveResponse
109 +): TriggerInstanceListActiveResponse {
110 + return transform(response)
111 + .with(TriggerInstanceListActiveResponseSchema)
112 + .using(response => ({
113 + items: response.items.map(item => transformTriggerInstanceListActiveItem(item)),
114 + nextCursor: response.next_cursor ?? null,
115 + totalPages: response.total_pages,
116 + }));
117 +}
ts/packages/core/test/AuthConfigs/authConfigs.test.ts
+4 -69
@@ -9,6 +9,7 @@ import {
9 AuthConfigUpdateResponse,
10 AuthConfigUpdateStatusResponse,
11 } from '@composio/client/resources/auth-configs';
12 +import { transformAuthConfigRetrieveResponse } from '../../src/utils/transformers/authConfigs';
13
14 // Mock data for testing
15 const mockComposioAuthConfigResponse: ComposioAuthConfigRetrieveResponse = {
@@ -101,8 +102,7 @@ describe('AuthConfigs', () => {
102
103 describe('parseAuthConfigRetrieveResponse', () => {
104 it('should transform API response to SDK format correctly', () => {
104 - // @ts-expect-error - Accessing private method for testing
105 - const result = authConfigs.parseAuthConfigRetrieveResponse(mockComposioAuthConfigResponse);
105 + const result = transformAuthConfigRetrieveResponse(mockComposioAuthConfigResponse);
106 expect(result).toEqual(mockTransformedAuthConfigResponse);
107 });
108
@@ -137,8 +137,7 @@ describe('AuthConfigs', () => {
137 // Optional fields omitted
138 } as ComposioAuthConfigRetrieveResponse;
139
140 - // @ts-expect-error - Accessing private method for testing
141 - const result = authConfigs.parseAuthConfigRetrieveResponse(responseWithOptionalFields);
140 + const result = transformAuthConfigRetrieveResponse(responseWithOptionalFields);
141 expect(result).toMatchObject({
142 id: 'auth_12345',
143 name: 'Test Auth Config',
@@ -216,23 +215,6 @@ describe('AuthConfigs', () => {
215 ).rejects.toThrow(); // Just expect any error since Zod throws ZodError directly
216 });
217
219 - it('should throw ValidationError when API response is invalid', async () => {
220 - const invalidResponse = {
221 - items: [
222 - {
223 - ...mockComposioAuthConfigResponse,
224 - id: null, // Invalid response structure
225 - },
226 - ],
227 - next_cursor: 'next_cursor_123',
228 - total_pages: 1,
229 - };
230 -
231 - mockClient.authConfigs.list.mockResolvedValueOnce(invalidResponse);
232 -
233 - await expect(authConfigs.list()).rejects.toThrow(ValidationError);
234 - });
235 -
218 it('should handle empty list response', async () => {
219 const emptyResponse = {
220 items: [],
@@ -364,23 +346,6 @@ describe('AuthConfigs', () => {
346 authConfigs.create('github', invalidOptions)
347 ).rejects.toThrow(ValidationError);
348 });
367 -
368 - it('should throw ValidationError when API response is invalid', async () => {
369 - const invalidResponse = {
370 - auth_config: {
371 - id: null, // Invalid response structure
372 - auth_scheme: 'OAUTH2',
373 - is_composio_managed: true,
374 - },
375 - toolkit: {
376 - slug: 'github',
377 - },
378 - };
379 -
380 - mockClient.authConfigs.create.mockResolvedValueOnce(invalidResponse);
381 -
382 - await expect(authConfigs.create('github')).rejects.toThrow(ValidationError);
383 - });
349 });
350
351 describe('get', () => {
@@ -660,35 +625,6 @@ describe('AuthConfigs', () => {
625
626 await expect(authConfigs.list()).rejects.toThrow('Network error');
627 });
663 -
664 - it('should handle malformed API responses', async () => {
665 - // Response missing required fields
666 - const malformedResponse = {
667 - items: [
668 - {
669 - id: 'test_id',
670 - name: null, // Invalid: name should be string
671 - no_of_connections: 5,
672 - status: 'ENABLED',
673 - deprecated_params: {
674 - default_connector_id: null,
675 - },
676 - type: 'custom',
677 - toolkit: {
678 - logo: 'logo',
679 - slug: 'slug',
680 - },
681 - uuid: 'uuid-123',
682 - },
683 - ],
684 - next_cursor: 'cursor',
685 - total_pages: 1,
686 - };
687 -
688 - mockClient.authConfigs.list.mockResolvedValueOnce(malformedResponse);
689 -
690 - await expect(authConfigs.list()).rejects.toThrow(ValidationError);
691 - });
628 });
629
630 describe('edge cases', () => {
@@ -709,8 +645,7 @@ describe('AuthConfigs', () => {
645 uuid: 'uuid-minimal',
646 } as ComposioAuthConfigRetrieveResponse;
647
712 - // @ts-expect-error - Accessing private method for testing
713 - const result = authConfigs.parseAuthConfigRetrieveResponse(minimalResponse);
648 + const result = transformAuthConfigRetrieveResponse(minimalResponse);
649
650 expect(result).toMatchObject({
651 id: 'auth_minimal',
ts/packages/core/test/models/triggers.test.ts
-66
@@ -260,14 +260,6 @@ describe('Triggers', () => {
260 });
261 });
262
263 - it('should throw validation error for invalid response', async () => {
264 - mockClient.triggerInstances.listActive.mockResolvedValue({
265 - items: [{ invalid: 'data' }],
266 - });
267 -
268 - await expect(triggers.listActive()).rejects.toThrow(ValidationError);
269 - });
270 -
263 it('should list active trigger instances with query parameters', async () => {
264 const query = {
265 authConfigIds: ['auth-1'],
@@ -402,17 +394,6 @@ describe('Triggers', () => {
394 );
395 expect(mockClient.triggerInstances.upsert).not.toHaveBeenCalled();
396 });
405 -
406 - it('should throw validation error for invalid upsert response', async () => {
407 - mockClient.connectedAccounts.list.mockResolvedValue({
408 - items: [{ id: 'conn-123' }],
409 - });
410 - mockClient.triggerInstances.upsert.mockResolvedValue({
411 - invalid_field: 'value',
412 - });
413 -
414 - await expect(triggers.create(userId, slug, body)).rejects.toThrow(ValidationError);
415 - });
397 });
398
399 describe('update', () => {
@@ -438,13 +419,6 @@ describe('Triggers', () => {
419 expect(mockClient.triggerInstances.manage.delete).toHaveBeenCalledWith(triggerId);
420 expect(result).toEqual({ triggerId: mockTriggerDeleteResponse.trigger_id });
421 });
441 -
442 - it('should throw validation error for invalid response', async () => {
443 - const triggerId = 'trigger-123';
444 - mockClient.triggerInstances.manage.delete.mockResolvedValue({ invalid: 'response' });
445 -
446 - await expect(triggers.delete(triggerId)).rejects.toThrow(ValidationError);
447 - });
422 });
423
424 describe('disable', () => {
@@ -702,26 +676,6 @@ describe('Triggers', () => {
676 );
677 });
678
705 - it('should handle invalid trigger data format', async () => {
706 - const invalidTriggerData = {
707 - appName: 'github',
708 - clientId: 123,
709 - payload: { action: 'push' },
710 - originalPayload: { action: 'push' },
711 - metadata: {
712 - triggerName: 'github_webhook',
713 - },
714 - };
715 -
716 - await triggers.subscribe(mockCallback);
717 -
718 - const subscribeCall = vi.mocked(mockPusherService.subscribe).mock.calls[0];
719 - const filterCallback = subscribeCall[0];
720 -
721 - expect(() => filterCallback(invalidTriggerData)).toThrow(ValidationError);
722 - expect(mockCallback).not.toHaveBeenCalled();
723 - });
724 -
679 it('should handle partial trigger data with missing optional fields', async () => {
680 const partialTriggerData = {
681 appName: 'github',
@@ -943,26 +897,6 @@ describe('Triggers', () => {
897 );
898 });
899
946 - it('should handle invalid trigger data format', async () => {
947 - const invalidTriggerData = {
948 - appName: 'github',
949 - clientId: 123,
950 - payload: { action: 'push' },
951 - originalPayload: { action: 'push' },
952 - metadata: {
953 - triggerName: 'github_webhook',
954 - },
955 - };
956 -
957 - await triggers.subscribe(mockCallback);
958 -
959 - const subscribeCall = vi.mocked(mockPusherService.subscribe).mock.calls[0];
960 - const filterCallback = subscribeCall[0];
961 -
962 - expect(() => filterCallback(invalidTriggerData)).toThrow(ValidationError);
963 - expect(mockCallback).not.toHaveBeenCalled();
964 - });
965 -
900 it('should handle multiple callbacks with different filters', async () => {
901 const callback1 = vi.fn();
902 const callback2 = vi.fn();
ts/packages/providers/anthropic/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/anthropic
2
3 +## 0.1.36-next.10
4 +
5 +### Patch Changes
6 +
7 +- Fix: Relax strict type/schema validations on API responses
8 +- Updated dependencies
9 + - @composio/core@0.1.36-next.10
10 +
11 ## 0.1.36-next.9
12
13 ### Patch Changes
ts/packages/providers/anthropic/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/anthropic",
3 - "version": "0.1.36-next.9",
3 + "version": "0.1.36-next.10",
4 "description": "Non-Agentic Provider for Anthropic in Composio SDK",
5 "main": "src/index.ts",
6 "type": "module",
@@ -35,7 +35,7 @@
35 "packageManager": "pnpm@10.8.0",
36 "peerDependencies": {
37 "@anthropic-ai/sdk": "^0.52.0",
38 - "@composio/core": "0.1.36-next.9"
38 + "@composio/core": "0.1.36-next.10"
39 },
40 "devDependencies": {
41 "@composio/core": "workspace:*",
ts/packages/providers/cloudflare/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/cloudflare
2
3 +## 0.1.36-next.10
4 +
5 +### Patch Changes
6 +
7 +- Fix: Relax strict type/schema validations on API responses
8 +- Updated dependencies
9 + - @composio/core@0.1.36-next.10
10 +
11 ## 0.1.36-next.9
12
13 ### Patch Changes
ts/packages/providers/cloudflare/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/cloudflare",
3 - "version": "0.1.36-next.9",
3 + "version": "0.1.36-next.10",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
@@ -31,7 +31,7 @@
31 "packageManager": "pnpm@10.8.0",
32 "peerDependencies": {
33 "@cloudflare/workers-types": "^4.20250416.0",
34 - "@composio/core": "0.1.36-next.9"
34 + "@composio/core": "0.1.36-next.10"
35 },
36 "devDependencies": {
37 "@composio/core": "workspace:*",
ts/packages/providers/google/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/google
2
3 +## 0.1.36-next.10
4 +
5 +### Patch Changes
6 +
7 +- Fix: Relax strict type/schema validations on API responses
8 +- Updated dependencies
9 + - @composio/core@0.1.36-next.10
10 +
11 ## 0.1.36-next.9
12
13 ### Patch Changes
ts/packages/providers/google/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/google",
3 - "version": "0.1.36-next.9",
3 + "version": "0.1.36-next.10",
4 "description": "Google GenAI Provider for Composio SDK",
5 "main": "src/index.ts",
6 "type": "module",
@@ -36,7 +36,7 @@
36 "license": "ISC",
37 "packageManager": "pnpm@10.8.0",
38 "peerDependencies": {
39 - "@composio/core": "0.1.36-next.9",
39 + "@composio/core": "0.1.36-next.10",
40 "@google/genai": "^1.1.0"
41 },
42 "devDependencies": {
ts/packages/providers/langchain/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/langchain
2
3 +## 0.1.36-next.10
4 +
5 +### Patch Changes
6 +
7 +- Fix: Relax strict type/schema validations on API responses
8 +- Updated dependencies
9 + - @composio/core@0.1.36-next.10
10 +
11 ## 0.1.36-next.9
12
13 ### Patch Changes
ts/packages/providers/langchain/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/langchain",
3 - "version": "0.1.36-next.9",
3 + "version": "0.1.36-next.10",
4 "description": "",
5 "main": "dist/index.js",
6 "type": "module",
@@ -30,7 +30,7 @@
30 "license": "ISC",
31 "packageManager": "pnpm@10.8.0",
32 "peerDependencies": {
33 - "@composio/core": "0.1.36-next.9",
33 + "@composio/core": "0.1.36-next.10",
34 "@langchain/core": "^0.3.44"
35 },
36 "devDependencies": {
ts/packages/providers/mastra/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/mastra
2
3 +## 0.1.36-next.10
4 +
5 +### Patch Changes
6 +
7 +- Fix: Relax strict type/schema validations on API responses
8 +- Updated dependencies
9 + - @composio/core@0.1.36-next.10
10 +
11 ## 0.1.36-next.9
12
13 ### Patch Changes
ts/packages/providers/mastra/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/mastra",
3 - "version": "0.1.36-next.9",
3 + "version": "0.1.36-next.10",
4 "description": "Agentic Provider for mastra in Composio SDK",
5 "main": "src/index.ts",
6 "type": "module",
@@ -34,7 +34,7 @@
34 "license": "ISC",
35 "packageManager": "pnpm@10.8.0",
36 "peerDependencies": {
37 - "@composio/core": "0.1.36-next.9",
37 + "@composio/core": "0.1.36-next.10",
38 "@mastra/core": "^0.10.0"
39 },
40 "devDependencies": {
ts/packages/providers/openai-agents/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/vercel
2
3 +## 0.1.36-next.10
4 +
5 +### Patch Changes
6 +
7 +- Fix: Relax strict type/schema validations on API responses
8 +- Updated dependencies
9 + - @composio/core@0.1.36-next.10
10 +
11 ## 0.1.36-next.9
12
13 ### Patch Changes
ts/packages/providers/openai-agents/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/openai-agents",
3 - "version": "0.1.36-next.9",
3 + "version": "0.1.36-next.10",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
@@ -30,7 +30,7 @@
30 "license": "ISC",
31 "packageManager": "pnpm@10.8.0",
32 "peerDependencies": {
33 - "@composio/core": "0.1.36-next.9",
33 + "@composio/core": "0.1.36-next.10",
34 "@openai/agents": "^0.0.7"
35 },
36 "devDependencies": {
ts/packages/providers/openai/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/openai
2
3 +## 0.1.36-next.10
4 +
5 +### Patch Changes
6 +
7 +- Fix: Relax strict type/schema validations on API responses
8 +- Updated dependencies
9 + - @composio/core@0.1.36-next.10
10 +
11 ## 0.1.36-next.9
12
13 ### Patch Changes
ts/packages/providers/openai/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/openai",
3 - "version": "0.1.36-next.9",
3 + "version": "0.1.36-next.10",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
@@ -30,7 +30,7 @@
30 "license": "ISC",
31 "packageManager": "pnpm@10.8.0",
32 "peerDependencies": {
33 - "@composio/core": "0.1.36-next.9",
33 + "@composio/core": "0.1.36-next.10",
34 "openai": "^4.3.8"
35 },
36 "devDependencies": {
ts/packages/providers/vercel/CHANGELOG.md
+8
@@ -1,5 +1,13 @@
1 # @composio/vercel
2
3 +## 0.1.36-next.10
4 +
5 +### Patch Changes
6 +
7 +- Fix: Relax strict type/schema validations on API responses
8 +- Updated dependencies
9 + - @composio/core@0.1.36-next.10
10 +
11 ## 0.1.36-next.9
12
13 ### Patch Changes
ts/packages/providers/vercel/package.json
+2 -2
@@ -1,6 +1,6 @@
1 {
2 "name": "@composio/vercel",
3 - "version": "0.1.36-next.9",
3 + "version": "0.1.36-next.10",
4 "description": "",
5 "main": "src/index.ts",
6 "type": "module",
@@ -30,7 +30,7 @@
30 "license": "ISC",
31 "packageManager": "pnpm@10.8.0",
32 "peerDependencies": {
33 - "@composio/core": "0.1.36-next.9",
33 + "@composio/core": "0.1.36-next.10",
34 "ai": "^4.3.8"
35 },
36 "devDependencies": {
turbo.json
+4
@@ -12,6 +12,10 @@
12 "clean": {
13 "cache": false
14 },
15 + "typecheck": {
16 + "dependsOn": ["^build"],
17 + "cache": false
18 + },
19 "//#clean": {
20 "cache": false
21 }