@devries-cameron20 / composio Mirror · read-only / commits / 3502260a5
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 21, 03:37 UTC

fix(sdk): align auth config consumers with their input types (#5452)

- Accept both retrieve responses and list items in the SDK auth-config transformer. Client 2.1.35 adds the required `keyring_routed` field to retrieve only. - Type the CLI formatter and repository stubs from the decoded create response. The CLI already filters the wire response before rendering it. - Unblocks the downstream TypeScript release check for https://github.com/ComposioHQ/composio-client/pull/252. ## Verification Reproduced the SDK and CLI type errors with the packed client candidate at `b1ef34e`. With the fix, the same tarball passed workspace and example typechecks, example lint, CLI Effect diagnostics, and the Core and CLI unit suites. <!-- sdk-release-note-exempt: This changes internal response type annotations only and preserves SDK behavior and CLI output. -->

Alberto Schiabel committed Nov 18, 2026 at 18:28 UTC 3502260a589b5d06ee2e59edfdbc11bd2efccccb
3 files changed +8 -9
ts/packages/cli/src/commands/auth-configs/create/auth-configs.create.format.ts
+1 -1
@@ -1,4 +1,4 @@
1 -import type { AuthConfigCreateResponse } from '@composio/client/resources/auth-configs';
1 +import type { AuthConfigCreateResponse } from 'src/models/auth-configs';
2 import { bold } from 'src/ui/colors';
3 import { redact } from 'src/ui/redact';
4
ts/packages/cli/test/__utils__/layers/connected-accounts.ts
+3 -6
@@ -1,10 +1,7 @@
1 -import type {
2 - AuthConfigCreateParams,
3 - AuthConfigCreateResponse,
4 -} from '@composio/client/resources/auth-configs';
1 +import type { AuthConfigCreateParams } from '@composio/client/resources/auth-configs';
2 import type { LinkCreateResponse } from '@composio/client/resources/link';
3 import { Array as Arr, Effect, Layer, Stream } from 'effect';
7 -import type { AuthConfigItem } from 'src/models/auth-configs';
4 +import type { AuthConfigCreateResponse, AuthConfigItem } from 'src/models/auth-configs';
5 import type { ConnectedAccountItem } from 'src/models/connected-accounts';
6 import {
7 ComposioToolkitsRepository,
@@ -15,7 +12,7 @@ import { notFoundError } from './not-found';
12 import { DEFAULT_PAGE_LIMIT } from './page';
13
14 /**
18 - * The auth configs a test repository serves, and what creating one answers.
15 + * The decoded auth config responses a test repository returns.
16 */
17 export interface AuthConfigsTestData {
18 items?: AuthConfigItem[];
ts/packages/core/src/utils/transformers/authConfigs.ts
+4 -2
@@ -15,19 +15,21 @@ import {
15 } from '@composio/client/resources/auth-configs';
16 import { transform } from '../transform';
17
18 +type RawAuthConfig = RawAuthConfigRetrieveResponse | RawAuthConfigListResponse['items'][number];
19 +
20 /**
21 * Transforms an auth config response from API format to SDK format.
22 *
23 * This method converts property names from snake_case to camelCase and reorganizes
24 * the data structure to match the SDK's standardized format for auth configurations.
25 *
24 - * @param {RawAuthConfigRetrieveResponse} authConfig - The raw API response to transform
26 + * @param {RawAuthConfig} authConfig - The raw retrieve response or list item to transform
27 * @returns {AuthConfigRetrieveResponse} The transformed auth config data
28 *
29 * @private
30 */
31 export function transformAuthConfigRetrieveResponse(
30 - authConfig: RawAuthConfigRetrieveResponse
32 + authConfig: RawAuthConfig
33 ): AuthConfigRetrieveResponse {
34 return transform(authConfig)
35 .with(AuthConfigRetrieveResponseSchema)