Skip to content

Commit

Permalink
fix(client): createClient doesn't copy all settings of client (#1602)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Philibeaux <aphilibeaux@scaleway.com>
  • Loading branch information
philibea authored Nov 25, 2024
1 parent 2e2d4fb commit 35cdb3a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/clients/src/scw/client.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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<Settings> = {}): Client =>
createAdvancedClient(
withProfile(settings),
withAdditionalInterceptors(settings.interceptors ?? []),
)

0 comments on commit 35cdb3a

Please sign in to comment.