From c5b8026a58c77bb93f0b7cfde9ebc46ca3e8bd04 Mon Sep 17 00:00:00 2001 From: Alexandre Philibeaux Date: Fri, 22 Nov 2024 15:38:42 +0000 Subject: [PATCH] fix(client): createClient doesn't copy all settings of client Signed-off-by: Alexandre Philibeaux --- packages/clients/src/scw/client.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/clients/src/scw/client.ts b/packages/clients/src/scw/client.ts index ad84e961a..1e1640217 100644 --- a/packages/clients/src/scw/client.ts +++ b/packages/clients/src/scw/client.ts @@ -1,7 +1,10 @@ import { getLogger } from '../internal/logger' import type { ClientConfig } from './client-ini-factory' -import { withLegacyInterceptors, withProfile } from './client-ini-factory' -import type { Profile } from './client-ini-profile' +import { + withAdditionalInterceptors, + withLegacyInterceptors, + withProfile, +} from './client-ini-factory' import type { Settings } from './client-settings' import { assertValidSettings } from './client-settings' import { userAgent, version } from './constants' @@ -99,5 +102,8 @@ export const createAdvancedClient = (...configs: ClientConfig[]): Client => { * * @public */ -export const createClient = (profile: Profile = {}): Client => - createAdvancedClient(withProfile(profile)) +export const createClient = (settings: Partial = {}): Client => + createAdvancedClient( + withProfile(settings), + withAdditionalInterceptors(settings.interceptors ?? []), + )