Skip to content

Commit 3c48362

Browse files
razor-xclaude
andauthored
feat!: upgrade to @seamapi/http v2 and drop @seamapi/types (#19)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent f840836 commit 3c48362

8 files changed

Lines changed: 31 additions & 71 deletions

package-lock.json

Lines changed: 14 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,14 @@
6969
"npm": ">=10.1.0"
7070
},
7171
"peerDependencies": {
72-
"@seamapi/http": "^1.45.0",
73-
"@seamapi/types": "^1.441.1",
72+
"@seamapi/http": "^2.5.0",
7473
"@tanstack/react-query": "^5.27.5",
7574
"@types/react": "^18.0.0 || ^19.0.0",
7675
"@types/react-dom": "^18.0.0 || ^19.0.0",
7776
"react": "^18.0.0 || ^19.0.0",
7877
"react-dom": "^18.0.0 || ^19.0.0"
7978
},
8079
"peerDependenciesMeta": {
81-
"@seamapi/types": {
82-
"optional": true
83-
},
8480
"@types/react": {
8581
"optional": true
8682
},
@@ -93,8 +89,7 @@
9389
},
9490
"devDependencies": {
9591
"@seamapi/fake-seam-connect": "^1.76.0",
96-
"@seamapi/http": "^1.45.0",
97-
"@seamapi/types": "^1.441.1",
92+
"@seamapi/http": "^2.5.0",
9893
"@tanstack/react-query": "^5.27.5",
9994
"@testing-library/react": "^16.3.0",
10095
"@types/node": "^22.16.1",

src/lib/SeamQueryProvider.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ interface SeamQueryProviderBaseProps extends PropsWithChildren {
7070

7171
type SeamClientOptions = SeamHttpOptionsWithClientSessionToken
7272

73-
export type SeamQueryProviderClientOptions = Pick<
74-
SeamClientOptions,
75-
'endpoint' | 'isUndocumentedApiEnabled'
76-
>
73+
export type SeamQueryProviderClientOptions = Pick<SeamClientOptions, 'endpoint'>
7774

7875
const defaultQueryClient = new QueryClient()
7976

src/lib/use-seam-client.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ export function useSeamClient(): {
5555
if (client != null)
5656
return {
5757
client,
58-
endpointClient: SeamHttpEndpoints.fromClient(
59-
client.client,
60-
clientOptions,
61-
),
58+
endpointClient: SeamHttpEndpoints.fromClient(client.client),
6259
clientWithoutWorkspace: null,
6360
endpointClientWithoutWorkspace: null,
6461
}
@@ -71,10 +68,7 @@ export function useSeamClient(): {
7168

7269
return {
7370
client: seam,
74-
endpointClient: SeamHttpEndpoints.fromClient(
75-
seam.client,
76-
clientOptions,
77-
),
71+
endpointClient: SeamHttpEndpoints.fromClient(seam.client),
7872
clientWithoutWorkspace: null,
7973
endpointClientWithoutWorkspace: null,
8074
}
@@ -89,10 +83,7 @@ export function useSeamClient(): {
8983

9084
return {
9185
client: seam,
92-
endpointClient: SeamHttpEndpoints.fromClient(
93-
seam.client,
94-
clientOptions,
95-
),
86+
endpointClient: SeamHttpEndpoints.fromClient(seam.client),
9687
clientWithoutWorkspace: null,
9788
endpointClientWithoutWorkspace: null,
9889
}
@@ -108,7 +99,6 @@ export function useSeamClient(): {
10899
const endpointClientWithoutWorkspace =
109100
SeamHttpEndpointsWithoutWorkspace.fromClient(
110101
clientWithoutWorkspace.client,
111-
clientOptions,
112102
)
113103

114104
if (workspaceId == null) {
@@ -128,10 +118,7 @@ export function useSeamClient(): {
128118

129119
return {
130120
client: seam,
131-
endpointClient: SeamHttpEndpoints.fromClient(
132-
seam.client,
133-
clientOptions,
134-
),
121+
endpointClient: SeamHttpEndpoints.fromClient(seam.client),
135122
clientWithoutWorkspace,
136123
endpointClientWithoutWorkspace,
137124
}

src/lib/use-seam-infinite-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {
2+
ActionAttempt,
23
SeamActionAttemptFailedError,
34
SeamActionAttemptTimeoutError,
45
SeamHttpApiError,
@@ -8,7 +9,6 @@ import type {
89
SeamHttpRequest,
910
SeamPageCursor,
1011
} from '@seamapi/http'
11-
import type { ActionAttempt } from '@seamapi/types/connect'
1212
import {
1313
type QueryKey,
1414
useInfiniteQuery,

src/lib/use-seam-mutation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type {
2+
ActionAttempt,
23
SeamActionAttemptFailedError,
34
SeamActionAttemptTimeoutError,
45
SeamHttpApiError,
56
SeamHttpEndpointMutationPaths,
67
SeamHttpEndpoints,
78
SeamHttpInvalidInputError,
89
} from '@seamapi/http'
9-
import type { ActionAttempt } from '@seamapi/types/connect'
1010
import {
1111
useMutation,
1212
type UseMutationOptions,

src/lib/use-seam-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type {
2+
ActionAttempt,
23
SeamActionAttemptFailedError,
34
SeamActionAttemptTimeoutError,
45
SeamHttpApiError,
56
SeamHttpEndpointQueryPaths,
67
SeamHttpEndpoints,
78
SeamHttpInvalidInputError,
89
} from '@seamapi/http'
9-
import type { ActionAttempt } from '@seamapi/types/connect'
1010
import {
1111
type QueryKey,
1212
useQuery,

vitest.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { defineConfig } from 'vitest/config'
22

33
export default defineConfig({
4+
resolve: {
5+
alias: {
6+
'@seamapi/react-query': new URL('./src/index.ts', import.meta.url)
7+
.pathname,
8+
lib: new URL('./src/lib', import.meta.url).pathname,
9+
},
10+
},
411
test: {
512
environment: 'happy-dom',
613
},

0 commit comments

Comments
 (0)