Skip to content

Commit 1dcd7f3

Browse files
committed
Remove legacy options
1 parent 0b80dfe commit 1dcd7f3

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

src/lib/seam/connect/options.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ interface SeamHttpCommonOptions {
1111
endpoint?: string
1212
axiosOptions?: AxiosRequestConfig
1313
axiosRetryOptions?: AxiosRetryConfig
14-
enableLegacyMethodBehaivor?: boolean
1514
}
1615

1716
type AxiosRetryConfig = Parameters<AxiosRetry>[1]
1817

1918
export type SeamHttpOptionsFromEnv = SeamHttpCommonOptions
2019

21-
export interface SeamHttpOptionsWithClient
22-
extends Pick<SeamHttpCommonOptions, 'enableLegacyMethodBehaivor'> {
20+
export interface SeamHttpOptionsWithClient {
2321
client: Axios
2422
}
2523

@@ -29,12 +27,10 @@ export const isSeamHttpOptionsWithClient = (
2927
if (!('client' in options)) return false
3028
if (options.client == null) return false
3129

32-
const keys = Object.keys(options).filter(
33-
(k) => !['client', 'enableLegacyMethodBehaivor'].includes(k),
34-
)
30+
const keys = Object.keys(options)
3531
if (keys.length > 0) {
3632
throw new SeamHttpInvalidOptionsError(
37-
`The client option cannot be used with any other option except enableLegacyMethodBehaivor, but received: ${keys.join(
33+
`The client option cannot be used with any other option, but received: ${keys.join(
3834
', ',
3935
)}`,
4036
)

src/lib/seam/connect/parse-options.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { isSeamHttpOptionsWithClient, type SeamHttpOptions } from './options.js'
22

3-
const enableLegacyMethodBehaivorDefault = true
4-
53
export const parseOptions = (
64
apiKeyOrOptions: string | SeamHttpOptions,
75
): Required<SeamHttpOptions> => {
@@ -10,12 +8,7 @@ export const parseOptions = (
108
? { apiKey: apiKeyOrOptions }
119
: apiKeyOrOptions
1210

13-
if (isSeamHttpOptionsWithClient(options))
14-
return {
15-
...options,
16-
enableLegacyMethodBehaivor:
17-
options.enableLegacyMethodBehaivor ?? enableLegacyMethodBehaivorDefault,
18-
}
11+
if (isSeamHttpOptionsWithClient(options)) return options
1912

2013
const endpoint =
2114
options.endpoint ??
@@ -32,7 +25,5 @@ export const parseOptions = (
3225
endpoint,
3326
axiosOptions: options.axiosOptions ?? {},
3427
axiosRetryOptions: options.axiosRetryOptions ?? {},
35-
enableLegacyMethodBehaivor:
36-
options.enableLegacyMethodBehaivor ?? enableLegacyMethodBehaivorDefault,
3728
}
3829
}

0 commit comments

Comments
 (0)