Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): createClient doesn't copy all settings of client #1602

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ?? []),
)
Loading