From bab6f0a48d69ef9fc96f870850742803e9d443de Mon Sep 17 00:00:00 2001 From: Tal Aharoni Date: Mon, 22 Jun 2026 10:14:53 +0300 Subject: [PATCH] fix(outbound): add useDcr/dcrUrl to OutboundApplication type These fields were added to OutboundAppTemplateOverrides in #744 but not to OutboundApplication, forcing a cast when creating DCR-based outbound apps via createApplication. The REST create endpoint already accepts them, so this types create/update/load correctly with no cast. --- README.md | 2 ++ lib/management/outboundapplication.test.ts | 38 ++++++++++++++++++++++ lib/management/types.ts | 2 ++ 3 files changed, 42 insertions(+) diff --git a/README.md b/README.md index 9106fab48..5309f9537 100644 --- a/README.md +++ b/README.md @@ -1468,6 +1468,8 @@ You can create, update, delete or load outbound applications: ```typescript // Create an outbound application. +// For DCR-based apps (e.g. custom MCP servers that support RFC 7591 dynamic +// client registration), pass `useDcr: true` and `dcrUrl`. const { id } = await descopeClient.management.outboundApplication.createApplication({ name: 'my new app', diff --git a/lib/management/outboundapplication.test.ts b/lib/management/outboundapplication.test.ts index 844d90380..c71079e63 100644 --- a/lib/management/outboundapplication.test.ts +++ b/lib/management/outboundapplication.test.ts @@ -87,6 +87,44 @@ describe('Management OutboundApplication', () => { response: httpResponse, }); }); + + it('should pass through DCR fields (useDcr/dcrUrl) without a cast', async () => { + const httpResponse = { + ok: true, + json: () => mockOutboundApplicationResponse, + clone: () => ({ + json: () => Promise.resolve(mockOutboundApplicationResponse), + }), + status: 200, + }; + mockHttpClient.post.mockResolvedValue(httpResponse); + + const resp: SdkResponse = + await management.outboundApplication.createApplication({ + name: 'dcr app', + description: 'custom MCP server with dynamic client registration', + useDcr: true, + dcrUrl: 'https://mcp.example.com/register', + pkce: true, + defaultRedirectUrl: 'https://api.descope.com/v1/outbound/oauth/callback', + }); + + expect(mockHttpClient.post).toHaveBeenCalledWith(apiPaths.outboundApplication.create, { + name: 'dcr app', + description: 'custom MCP server with dynamic client registration', + useDcr: true, + dcrUrl: 'https://mcp.example.com/register', + pkce: true, + defaultRedirectUrl: 'https://api.descope.com/v1/outbound/oauth/callback', + }); + + expect(resp).toEqual({ + code: 200, + data: mockOutboundApplicationResponse.app, + ok: true, + response: httpResponse, + }); + }); }); describe('createOutboundApplicationByTemplate', () => { diff --git a/lib/management/types.ts b/lib/management/types.ts index 5e34d58da..16a0ce770 100644 --- a/lib/management/types.ts +++ b/lib/management/types.ts @@ -1067,6 +1067,8 @@ export type OutboundApplication = { pkce?: boolean; accessType?: AccessType; prompt?: Array; + useDcr?: boolean; + dcrUrl?: string; }; // Fields of an outbound application that can override a template's