Skip to content

Commit 780d9fc

Browse files
committed
fix: Include SeamHttpInvalidInputError in hook type
1 parent 522fa6b commit 780d9fc

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type {
44
SeamHttpApiError,
55
SeamHttpEndpointPaginatedQueryPaths,
66
SeamHttpEndpoints,
7+
SeamHttpInvalidInputError,
78
SeamHttpRequest,
89
SeamPageCursor,
910
} from '@seamapi/http/connect'
@@ -80,6 +81,7 @@ interface QueryData<T extends SeamHttpEndpointPaginatedQueryPaths> {
8081

8182
type QueryError<T extends SeamHttpEndpointPaginatedQueryPaths> =
8283
| SeamHttpApiError
84+
| SeamHttpInvalidInputError
8385
| (QueryData<T>['data'] extends ActionAttempt
8486
?
8587
| SeamActionAttemptFailedError<QueryData<T>['data']>

src/lib/seam/use-seam-mutation-without-workspace.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {
22
SeamHttpApiError,
33
SeamHttpEndpointsWithoutWorkspace,
44
SeamHttpEndpointWithoutWorkspaceMutationPaths,
5+
SeamHttpInvalidInputError,
56
} from '@seamapi/http/connect'
67
import {
78
useMutation,
@@ -19,7 +20,7 @@ export type UseSeamMutationWithoutWorkspaceResult<
1920
T extends SeamHttpEndpointWithoutWorkspaceMutationPaths,
2021
> = UseMutationResult<
2122
MutationData<T>,
22-
SeamHttpApiError,
23+
MutationError,
2324
UseSeamMutationWithoutWorkspaceVariables<T>
2425
>
2526

@@ -30,7 +31,7 @@ export function useSeamMutationWithoutWorkspace<
3031
options: Parameters<SeamHttpEndpointsWithoutWorkspace[T]>[1] &
3132
MutationOptions<
3233
MutationData<T>,
33-
SeamHttpApiError,
34+
MutationError,
3435
UseSeamMutationWithoutWorkspaceVariables<T>
3536
> = {}
3637
): UseSeamMutationWithoutWorkspaceResult<T> {
@@ -50,4 +51,6 @@ export function useSeamMutationWithoutWorkspace<
5051
type MutationData<T extends SeamHttpEndpointWithoutWorkspaceMutationPaths> =
5152
Awaited<ReturnType<SeamHttpEndpointsWithoutWorkspace[T]>>
5253

54+
type MutationError = SeamHttpApiError | SeamHttpInvalidInputError
55+
5356
type MutationOptions<X, Y, Z> = Omit<UseMutationOptions<X, Y, Z>, 'mutationFn'>

src/lib/seam/use-seam-mutation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type {
44
SeamHttpApiError,
55
SeamHttpEndpointMutationPaths,
66
SeamHttpEndpoints,
7+
SeamHttpInvalidInputError,
78
} from '@seamapi/http/connect'
89
import type { ActionAttempt } from '@seamapi/types/connect'
910
import {
@@ -52,6 +53,7 @@ type MutationData<T extends SeamHttpEndpointMutationPaths> = Awaited<
5253

5354
type MutationError<T extends SeamHttpEndpointMutationPaths> =
5455
| SeamHttpApiError
56+
| SeamHttpInvalidInputError
5557
| (MutationData<T> extends ActionAttempt
5658
?
5759
| SeamActionAttemptFailedError<MutationData<T>>

src/lib/seam/use-seam-query-without-workspace.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {
22
SeamHttpApiError,
33
SeamHttpEndpointsWithoutWorkspace,
44
SeamHttpEndpointWithoutWorkspaceQueryPaths,
5+
SeamHttpInvalidInputError,
56
} from '@seamapi/http/connect'
67
import {
78
useQuery,
@@ -17,15 +18,15 @@ export type UseSeamQueryWithoutWorkspaceParameters<
1718

1819
export type UseSeamQueryWithoutWorkspaceResult<
1920
T extends SeamHttpEndpointWithoutWorkspaceQueryPaths,
20-
> = UseQueryResult<QueryData<T>, SeamHttpApiError>
21+
> = UseQueryResult<QueryData<T>, QueryError>
2122

2223
export function useSeamQueryWithoutWorkspace<
2324
T extends SeamHttpEndpointWithoutWorkspaceQueryPaths,
2425
>(
2526
endpointPath: T,
2627
parameters?: UseSeamQueryWithoutWorkspaceParameters<T>,
2728
options: Parameters<SeamHttpEndpointsWithoutWorkspace[T]>[1] &
28-
QueryOptions<QueryData<T>, SeamHttpApiError> = {}
29+
QueryOptions<QueryData<T>, QueryError> = {}
2930
): UseSeamQueryWithoutWorkspaceResult<T> {
3031
const { endpointClient: client, queryKeyPrefixes } = useSeamClient()
3132
return useQuery({
@@ -50,4 +51,6 @@ type QueryData<T extends SeamHttpEndpointWithoutWorkspaceQueryPaths> = Awaited<
5051
ReturnType<SeamHttpEndpointsWithoutWorkspace[T]>
5152
>
5253

54+
type QueryError = SeamHttpApiError | SeamHttpInvalidInputError
55+
5356
type QueryOptions<X, Y> = Omit<UseQueryOptions<X, Y>, 'queryKey' | 'queryFn'>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type {
44
SeamHttpApiError,
55
SeamHttpEndpointQueryPaths,
66
SeamHttpEndpoints,
7+
SeamHttpInvalidInputError,
78
} from '@seamapi/http/connect'
89
import type { ActionAttempt } from '@seamapi/types/connect'
910
import {
@@ -51,6 +52,7 @@ type QueryData<T extends SeamHttpEndpointQueryPaths> = Awaited<
5152

5253
type QueryError<T extends SeamHttpEndpointQueryPaths> =
5354
| SeamHttpApiError
55+
| SeamHttpInvalidInputError
5456
| (QueryData<T> extends ActionAttempt
5557
?
5658
| SeamActionAttemptFailedError<QueryData<T>>

0 commit comments

Comments
 (0)