11import {
22 SeamHttp ,
33 SeamHttpEndpoints ,
4- SeamHttpMultiWorkspace ,
4+ SeamHttpEndpointsWithoutWorkspace ,
5+ SeamHttpWithoutWorkspace ,
56} from '@seamapi/http/connect'
67import { useQuery } from '@tanstack/react-query'
78import { useEffect } from 'react'
@@ -12,7 +13,8 @@ import { useSeamQueryContext } from './SeamQueryProvider.js'
1213export function useSeamClient ( ) : {
1314 client : SeamHttp | null
1415 endpointClient : SeamHttpEndpoints | null
15- clientWithoutWorkspace : SeamHttpMultiWorkspace | null
16+ clientWithoutWorkspace : SeamHttpWithoutWorkspace | null
17+ endpointClientWithoutWorkspace : SeamHttpEndpointsWithoutWorkspace | null
1618 queryKeyPrefixes : string [ ]
1719 isPending : boolean
1820 isError : boolean
@@ -35,7 +37,8 @@ export function useSeamClient(): {
3537 const { isPending, isError, error, data } = useQuery < {
3638 client : SeamHttp | null
3739 endpointClient : SeamHttpEndpoints | null
38- clientWithoutWorkspace : SeamHttpMultiWorkspace | null
40+ clientWithoutWorkspace : SeamHttpWithoutWorkspace | null
41+ endpointClientWithoutWorkspace : SeamHttpEndpointsWithoutWorkspace | null
3942 } > ( {
4043 queryKey : [
4144 ...getQueryKeyPrefixes ( { queryKeyPrefix } ) ,
@@ -54,6 +57,7 @@ export function useSeamClient(): {
5457 client,
5558 endpointClient : SeamHttpEndpoints . fromClient ( client . client ) ,
5659 clientWithoutWorkspace : null ,
60+ endpointClientWithoutWorkspace : null ,
5761 }
5862
5963 if ( clientSessionToken != null ) {
@@ -66,6 +70,7 @@ export function useSeamClient(): {
6670 client : seam ,
6771 endpointClient : SeamHttpEndpoints . fromClient ( seam . client ) ,
6872 clientWithoutWorkspace : null ,
73+ endpointClientWithoutWorkspace : null ,
6974 }
7075 }
7176
@@ -80,18 +85,25 @@ export function useSeamClient(): {
8085 client : seam ,
8186 endpointClient : SeamHttpEndpoints . fromClient ( seam . client ) ,
8287 clientWithoutWorkspace : null ,
88+ endpointClientWithoutWorkspace : null ,
8389 }
8490 }
8591
8692 if ( consoleSessionToken != null ) {
8793 const clientWithoutWorkspace =
88- SeamHttpMultiWorkspace . fromConsoleSessionToken ( consoleSessionToken )
94+ SeamHttpWithoutWorkspace . fromConsoleSessionToken ( consoleSessionToken )
95+
96+ const endpointClientWithoutWorkspace =
97+ SeamHttpEndpointsWithoutWorkspace . fromClient (
98+ clientWithoutWorkspace . client
99+ )
89100
90101 if ( workspaceId == null ) {
91102 return {
92103 client : null ,
93104 endpointClient : null ,
94105 clientWithoutWorkspace,
106+ endpointClientWithoutWorkspace,
95107 }
96108 }
97109
@@ -105,6 +117,7 @@ export function useSeamClient(): {
105117 client : seam ,
106118 endpointClient : SeamHttpEndpoints . fromClient ( seam . client ) ,
107119 clientWithoutWorkspace,
120+ endpointClientWithoutWorkspace,
108121 }
109122 }
110123
@@ -118,6 +131,8 @@ export function useSeamClient(): {
118131 client : data ?. client ?? null ,
119132 endpointClient : data ?. endpointClient ?? null ,
120133 clientWithoutWorkspace : data ?. clientWithoutWorkspace ?? null ,
134+ endpointClientWithoutWorkspace :
135+ data ?. endpointClientWithoutWorkspace ?? null ,
121136 queryKeyPrefixes : getQueryKeyPrefixes ( {
122137 queryKeyPrefix,
123138 userIdentifierKey,
0 commit comments