@comapeo/core-react 7.2.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +38 -0
  2. package/dist/commonjs/contexts/ClientApi.d.ts +8 -6
  3. package/dist/commonjs/contexts/ClientApi.js +15 -0
  4. package/dist/commonjs/contexts/ComapeoCore.d.ts +8 -0
  5. package/dist/commonjs/contexts/ComapeoCore.js +9 -0
  6. package/dist/commonjs/contexts/MapServer.d.ts +69 -0
  7. package/dist/commonjs/contexts/MapServer.js +92 -0
  8. package/dist/commonjs/contexts/MapShares.d.ts +52 -0
  9. package/dist/commonjs/contexts/MapShares.js +74 -0
  10. package/dist/commonjs/hooks/client.d.ts +3 -1
  11. package/dist/commonjs/hooks/documents.d.ts +3 -1
  12. package/dist/commonjs/hooks/invites.d.ts +0 -16
  13. package/dist/commonjs/hooks/invites.js +0 -32
  14. package/dist/commonjs/hooks/maps.d.ts +460 -3
  15. package/dist/commonjs/hooks/maps.js +261 -4
  16. package/dist/commonjs/hooks/projects.d.ts +17 -3
  17. package/dist/commonjs/index.d.ts +6 -3
  18. package/dist/commonjs/index.js +20 -6
  19. package/dist/commonjs/lib/http.d.ts +45 -0
  20. package/dist/commonjs/lib/http.js +103 -0
  21. package/dist/commonjs/lib/map-shares-stores.d.ts +80 -0
  22. package/dist/commonjs/lib/map-shares-stores.js +299 -0
  23. package/dist/commonjs/lib/presets.d.ts +3 -1
  24. package/dist/commonjs/lib/react-query/client.d.ts +6 -2
  25. package/dist/commonjs/lib/react-query/documents.d.ts +7 -3
  26. package/dist/commonjs/lib/react-query/invites.d.ts +6 -2
  27. package/dist/commonjs/lib/react-query/maps.d.ts +67 -19
  28. package/dist/commonjs/lib/react-query/maps.js +113 -11
  29. package/dist/commonjs/lib/react-query/mutation-result.d.ts +8 -0
  30. package/dist/commonjs/lib/react-query/mutation-result.js +22 -0
  31. package/dist/commonjs/lib/react-query/projects.d.ts +5 -1
  32. package/dist/commonjs/lib/react-query/projects.js +1 -6
  33. package/dist/commonjs/lib/sync.d.ts +3 -1
  34. package/dist/commonjs/lib/types.d.ts +3 -1
  35. package/dist/esm/contexts/ClientApi.d.ts +8 -6
  36. package/dist/esm/contexts/ClientApi.js +16 -1
  37. package/dist/esm/contexts/ComapeoCore.d.ts +8 -0
  38. package/dist/esm/contexts/ComapeoCore.js +6 -0
  39. package/dist/esm/contexts/MapServer.d.ts +69 -0
  40. package/dist/esm/contexts/MapServer.js +86 -0
  41. package/dist/esm/contexts/MapShares.d.ts +52 -0
  42. package/dist/esm/contexts/MapShares.js +65 -0
  43. package/dist/esm/hooks/client.d.ts +3 -1
  44. package/dist/esm/hooks/documents.d.ts +3 -1
  45. package/dist/esm/hooks/invites.d.ts +0 -16
  46. package/dist/esm/hooks/invites.js +1 -32
  47. package/dist/esm/hooks/maps.d.ts +460 -3
  48. package/dist/esm/hooks/maps.js +252 -6
  49. package/dist/esm/hooks/projects.d.ts +17 -3
  50. package/dist/esm/index.d.ts +6 -3
  51. package/dist/esm/index.js +5 -3
  52. package/dist/esm/lib/http.d.ts +45 -0
  53. package/dist/esm/lib/http.js +98 -0
  54. package/dist/esm/lib/map-shares-stores.d.ts +80 -0
  55. package/dist/esm/lib/map-shares-stores.js +291 -0
  56. package/dist/esm/lib/presets.d.ts +3 -1
  57. package/dist/esm/lib/react-query/client.d.ts +6 -2
  58. package/dist/esm/lib/react-query/documents.d.ts +7 -3
  59. package/dist/esm/lib/react-query/invites.d.ts +6 -2
  60. package/dist/esm/lib/react-query/maps.d.ts +67 -19
  61. package/dist/esm/lib/react-query/maps.js +109 -12
  62. package/dist/esm/lib/react-query/mutation-result.d.ts +8 -0
  63. package/dist/esm/lib/react-query/mutation-result.js +19 -0
  64. package/dist/esm/lib/react-query/projects.d.ts +5 -1
  65. package/dist/esm/lib/react-query/projects.js +1 -6
  66. package/dist/esm/lib/sync.d.ts +3 -1
  67. package/dist/esm/lib/types.d.ts +3 -1
  68. package/docs/API.md +567 -60
  69. package/package.json +40 -29
@@ -1,6 +1,11 @@
1
- import type { MapeoClientApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
2
- import { type Context, type JSX, type ReactNode } from 'react';
1
+ import type { MapeoClientApi } from '@comapeo/ipc' with {
2
+ 'resolution-mode': 'import'
3
+ };
4
+ import { type Context, type JSX, type PropsWithChildren } from 'react';
3
5
  export declare const ClientApiContext: Context<MapeoClientApi | null>;
6
+ export type ClientApiProviderProps = PropsWithChildren<{
7
+ clientApi: MapeoClientApi;
8
+ }>;
4
9
  /**
5
10
  * Create a context provider that holds a CoMapeo API client instance.
6
11
  *
@@ -8,7 +13,4 @@ export declare const ClientApiContext: Context<MapeoClientApi | null>;
8
13
  * @param opts.clientApi Client API instance
9
14
  *
10
15
  */
11
- export declare function ClientApiProvider({ children, clientApi, }: {
12
- children: ReactNode;
13
- clientApi: MapeoClientApi;
14
- }): JSX.Element;
16
+ export declare function ClientApiProvider({ children, clientApi, }: ClientApiProviderProps): JSX.Element;
@@ -1,4 +1,6 @@
1
- import { createContext, createElement, } from 'react';
1
+ import { useQueryClient } from '@tanstack/react-query';
2
+ import { createContext, createElement, useEffect, } from 'react';
3
+ import { getInvitesQueryKey } from '../lib/react-query/invites.js';
2
4
  export const ClientApiContext = createContext(null);
3
5
  /**
4
6
  * Create a context provider that holds a CoMapeo API client instance.
@@ -8,5 +10,18 @@ export const ClientApiContext = createContext(null);
8
10
  *
9
11
  */
10
12
  export function ClientApiProvider({ children, clientApi, }) {
13
+ const queryClient = useQueryClient();
14
+ useEffect(() => {
15
+ function invalidateInviteCache() {
16
+ queryClient.invalidateQueries({ queryKey: getInvitesQueryKey() });
17
+ }
18
+ // Invite listeners
19
+ clientApi.invite.addListener('invite-received', invalidateInviteCache);
20
+ clientApi.invite.addListener('invite-updated', invalidateInviteCache);
21
+ return () => {
22
+ clientApi.invite.removeListener('invite-received', invalidateInviteCache);
23
+ clientApi.invite.removeListener('invite-updated', invalidateInviteCache);
24
+ };
25
+ }, [clientApi, queryClient]);
11
26
  return createElement(ClientApiContext.Provider, { value: clientApi }, children);
12
27
  }
@@ -0,0 +1,8 @@
1
+ import { type JSX } from 'react';
2
+ import { type ClientApiProviderProps } from './ClientApi.js';
3
+ import { type MapServerProviderProps } from './MapServer.js';
4
+ type ComapeoCoreProviderProps = ClientApiProviderProps & Omit<MapServerProviderProps, 'getBaseUrl'> & {
5
+ getMapServerBaseUrl(): Promise<URL>;
6
+ };
7
+ export declare function ComapeoCoreProvider({ children, clientApi, getMapServerBaseUrl, fetch, queryClient, }: ComapeoCoreProviderProps): JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { createElement } from 'react';
2
+ import { ClientApiProvider } from './ClientApi.js';
3
+ import { MapServerProvider } from './MapServer.js';
4
+ export function ComapeoCoreProvider({ children, clientApi, getMapServerBaseUrl, fetch, queryClient, }) {
5
+ return createElement(ClientApiProvider, { clientApi }, createElement(MapServerProvider, { getBaseUrl: getMapServerBaseUrl, fetch, queryClient }, children));
6
+ }
@@ -0,0 +1,69 @@
1
+ import { type QueryClient } from '@tanstack/react-query';
2
+ import { type EventSourceClient, type EventSourceOptions } from 'eventsource-client';
3
+ import { type Context, type JSX, type PropsWithChildren } from 'react';
4
+ import { createHttp } from '../lib/http.js';
5
+ export type MapServerApiOptions = {
6
+ getBaseUrl(): Promise<URL>;
7
+ /**
8
+ * We assume the passed fetch implementation will only accept a `string` as
9
+ * input, not a `URL` or `Request`, because right now the expo/fetch
10
+ * implementation will only accept a `string`. Adding this restriction will
11
+ * catch potential issues if we try to pass a URL in our code. Can be relaxed
12
+ * when https://github.com/expo/expo/issues/43193 is fixed upstream.
13
+ */
14
+ fetch?(input: string, options?: RequestInit): Promise<Response>;
15
+ };
16
+ export type MapServerApi = ReturnType<typeof createHttp> & {
17
+ createEventSource(options: EventSourceOptions): EventSourceClient;
18
+ getMapStyleJsonUrl(mapId: string): Promise<string>;
19
+ };
20
+ /**
21
+ * Utility function to create a MapServerApi instance.
22
+ * Only exported for unit testing purposes.
23
+ * @private
24
+ *
25
+ * @param opts.getBaseUrl A function that returns a promise that resolves to the base URL of the map server.
26
+ * @param opts.fetch An optional custom fetch function to use for making requests to the map server. If not provided, the global `fetch` will be used.
27
+ */
28
+ export declare function createMapServerApi({ getBaseUrl, fetch, }: MapServerApiOptions): MapServerApi;
29
+ export declare const MapServerContext: Context<MapServerApi | null>;
30
+ export type MapServerProviderProps = PropsWithChildren<MapServerApiOptions & {
31
+ queryClient: QueryClient;
32
+ }>;
33
+ /**
34
+ * Create a context provider that holds a `MapServerFetch` function, which waits
35
+ * for the map server to be ready before making requests.
36
+ *
37
+ * @param opts.children React children node
38
+ * @param opts.getBaseUrl A function that returns a promise that resolves to the base URL of the map server.
39
+ * @param opts.fetch An optional custom fetch function to use for making requests to the map server. If not provided, the global `fetch` will be used.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * import { createServer } from '@comapeo/map-server'
44
+ *
45
+ * const server = createServer()
46
+ * const listenPromise = server.listen()
47
+ *
48
+ * const getBaseUrl = async () => {
49
+ * const { localPort } = await listenPromise
50
+ * return new URL(`http://localhost:${localPort}/`)
51
+ * }
52
+ *
53
+ * const mapServerApi = createMapServerApi({ getBaseUrl })
54
+ *
55
+ * function App() {
56
+ * return (
57
+ * <MapServerProvider mapServerApi={mapServerApi}>
58
+ * <MyApp />
59
+ * </MapServerProvider>
60
+ * )
61
+ * }
62
+ * ```
63
+ */
64
+ export declare function MapServerProvider({ children, getBaseUrl, fetch, queryClient, }: MapServerProviderProps): JSX.Element;
65
+ /**
66
+ * Internal hook to get the MapServerApi (instance of ky) from context.
67
+ * Throws if used outside of MapServerProvider.
68
+ */
69
+ export declare function useMapServerApi(): MapServerApi;
@@ -0,0 +1,86 @@
1
+ import { createEventSource, } from 'eventsource-client';
2
+ import { createContext, createElement, useContext, useMemo, } from 'react';
3
+ import { useClientApi } from '../hooks/client.js';
4
+ import { createHttp } from '../lib/http.js';
5
+ import { ReceivedMapSharesProvider, SentMapSharesProvider, } from './MapShares.js';
6
+ /**
7
+ * Utility function to create a MapServerApi instance.
8
+ * Only exported for unit testing purposes.
9
+ * @private
10
+ *
11
+ * @param opts.getBaseUrl A function that returns a promise that resolves to the base URL of the map server.
12
+ * @param opts.fetch An optional custom fetch function to use for making requests to the map server. If not provided, the global `fetch` will be used.
13
+ */
14
+ export function createMapServerApi({ getBaseUrl, fetch = globalThis.fetch, }) {
15
+ const wrappedFetch = async (input, init) => {
16
+ const baseUrl = await getBaseUrl();
17
+ return fetch(new URL(input, baseUrl).href, init);
18
+ };
19
+ const api = createHttp(wrappedFetch);
20
+ Object.defineProperty(api, 'createEventSource', {
21
+ value: (options) => {
22
+ return createEventSource({
23
+ ...options,
24
+ fetch: async (input, init) => {
25
+ const baseUrl = await getBaseUrl();
26
+ return fetch(new URL(input, baseUrl).href, init);
27
+ },
28
+ });
29
+ },
30
+ });
31
+ Object.defineProperty(api, 'getMapStyleJsonUrl', {
32
+ value: async (mapId) => {
33
+ const baseUrl = await getBaseUrl();
34
+ return new URL(`/maps/${mapId}/style.json`, baseUrl).href;
35
+ },
36
+ });
37
+ return api;
38
+ }
39
+ export const MapServerContext = createContext(null);
40
+ /**
41
+ * Create a context provider that holds a `MapServerFetch` function, which waits
42
+ * for the map server to be ready before making requests.
43
+ *
44
+ * @param opts.children React children node
45
+ * @param opts.getBaseUrl A function that returns a promise that resolves to the base URL of the map server.
46
+ * @param opts.fetch An optional custom fetch function to use for making requests to the map server. If not provided, the global `fetch` will be used.
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * import { createServer } from '@comapeo/map-server'
51
+ *
52
+ * const server = createServer()
53
+ * const listenPromise = server.listen()
54
+ *
55
+ * const getBaseUrl = async () => {
56
+ * const { localPort } = await listenPromise
57
+ * return new URL(`http://localhost:${localPort}/`)
58
+ * }
59
+ *
60
+ * const mapServerApi = createMapServerApi({ getBaseUrl })
61
+ *
62
+ * function App() {
63
+ * return (
64
+ * <MapServerProvider mapServerApi={mapServerApi}>
65
+ * <MyApp />
66
+ * </MapServerProvider>
67
+ * )
68
+ * }
69
+ * ```
70
+ */
71
+ export function MapServerProvider({ children, getBaseUrl, fetch, queryClient, }) {
72
+ const clientApi = useClientApi();
73
+ const mapServerApi = useMemo(() => createMapServerApi({ getBaseUrl, fetch }), [getBaseUrl, fetch]);
74
+ return createElement(MapServerContext.Provider, { value: mapServerApi }, createElement(SentMapSharesProvider, { clientApi, mapServerApi }, createElement(ReceivedMapSharesProvider, { clientApi, mapServerApi, queryClient }, children)));
75
+ }
76
+ /**
77
+ * Internal hook to get the MapServerApi (instance of ky) from context.
78
+ * Throws if used outside of MapServerProvider.
79
+ */
80
+ export function useMapServerApi() {
81
+ const api = useContext(MapServerContext);
82
+ if (!api) {
83
+ throw new Error('useMapServerApi must be used within a MapServerProvider');
84
+ }
85
+ return api;
86
+ }
@@ -0,0 +1,52 @@
1
+ import type { MapeoClientApi } from '@comapeo/ipc';
2
+ import type { QueryClient } from '@tanstack/react-query';
3
+ import { type Context, type JSX, type PropsWithChildren } from 'react';
4
+ import { type ReceivedMapSharesStore, type ReceivedMapShareState, type SentMapSharesStore, type SentMapShareState } from '../lib/map-shares-stores.js';
5
+ import type { MapServerApi } from './MapServer.js';
6
+ /**
7
+ * @internal
8
+ */
9
+ export declare const ReceivedMapSharesContext: Context<ReceivedMapSharesStore | null>;
10
+ /**
11
+ * @internal
12
+ */
13
+ export declare const SentMapSharesContext: Context<SentMapSharesStore | null>;
14
+ type MapSharesProviderProps = PropsWithChildren<{
15
+ clientApi: MapeoClientApi;
16
+ mapServerApi: MapServerApi;
17
+ }>;
18
+ /**
19
+ * @internal
20
+ */
21
+ export declare function ReceivedMapSharesProvider({ children, clientApi, mapServerApi, queryClient, }: MapSharesProviderProps & {
22
+ queryClient: QueryClient;
23
+ }): JSX.Element;
24
+ /**
25
+ * @internal
26
+ */
27
+ export declare function SentMapSharesProvider({ children, clientApi, mapServerApi, }: MapSharesProviderProps): JSX.Element;
28
+ /**
29
+ * @internal
30
+ */
31
+ export declare function useReceivedMapSharesActions(): {
32
+ download({ shareId }: import("../lib/map-shares-stores.js").DownloadMapShareOptions): Promise<void>;
33
+ decline({ shareId, reason }: import("../lib/map-shares-stores.js").DeclineMapShareOptions): Promise<void>;
34
+ abort({ shareId }: import("../lib/map-shares-stores.js").AbortMapShareOptions): Promise<void>;
35
+ };
36
+ /**
37
+ * @internal
38
+ */
39
+ export declare function useReceivedMapSharesState(): Array<ReceivedMapShareState>;
40
+ export declare function useReceivedMapSharesState<T>(selector: (state: Array<ReceivedMapShareState>) => T): T;
41
+ /**
42
+ * @internal
43
+ */
44
+ export declare function useSentMapSharesActions(): {
45
+ createAndSend({ projectId, receiverDeviceId, mapId, }: import("../lib/map-shares-stores.js").CreateAndSendMapShareOptions): Promise<import("@comapeo/map-server").MapShareState>;
46
+ cancel({ shareId }: import("../lib/map-shares-stores.js").CancelMapShareOptions): Promise<void>;
47
+ };
48
+ /**
49
+ * @internal
50
+ */
51
+ export declare function useSentMapSharesState<T>(selector?: (state: Array<SentMapShareState>) => T): T;
52
+ export {};
@@ -0,0 +1,65 @@
1
+ import { createContext, createElement, useCallback, useContext, useMemo, useSyncExternalStore, } from 'react';
2
+ import { createReceivedMapSharesStore, createSentMapSharesStore, } from '../lib/map-shares-stores.js';
3
+ /**
4
+ * @internal
5
+ */
6
+ export const ReceivedMapSharesContext = createContext(null);
7
+ /**
8
+ * @internal
9
+ */
10
+ export const SentMapSharesContext = createContext(null);
11
+ /**
12
+ * @internal
13
+ */
14
+ export function ReceivedMapSharesProvider({ children, clientApi, mapServerApi, queryClient, }) {
15
+ const mapSharesStore = useMemo(() => createReceivedMapSharesStore({ clientApi, mapServerApi, queryClient }), [clientApi, mapServerApi, queryClient]);
16
+ return createElement(ReceivedMapSharesContext.Provider, { value: mapSharesStore }, children);
17
+ }
18
+ /**
19
+ * @internal
20
+ */
21
+ export function SentMapSharesProvider({ children, clientApi, mapServerApi, }) {
22
+ const mapSharesStore = useMemo(() => createSentMapSharesStore({ clientApi, mapServerApi }), [clientApi, mapServerApi]);
23
+ return createElement(SentMapSharesContext.Provider, { value: mapSharesStore }, children);
24
+ }
25
+ const identity = (arg) => arg;
26
+ /**
27
+ * Internal hook to get the MapSharesStore from context.
28
+ */
29
+ function useMapSharesActions(context) {
30
+ const store = useContext(context);
31
+ if (!store) {
32
+ throw new Error('useMapSharesActions must be used within MapSharesProvider');
33
+ }
34
+ return store.actions;
35
+ }
36
+ function useMapSharesState(context, selector = identity) {
37
+ const store = useContext(context);
38
+ if (!store) {
39
+ throw new Error('useMapSharesState must be used within MapSharesProvider');
40
+ }
41
+ return useSyncExternalStore(store.subscribe, useCallback(
42
+ // Casting here because of TS not resolving generic conditional types correctly
43
+ () => selector(store.getSnapshot()), [selector, store]));
44
+ }
45
+ /**
46
+ * @internal
47
+ */
48
+ export function useReceivedMapSharesActions() {
49
+ return useMapSharesActions(ReceivedMapSharesContext);
50
+ }
51
+ export function useReceivedMapSharesState(selector) {
52
+ return useMapSharesState(ReceivedMapSharesContext, selector);
53
+ }
54
+ /**
55
+ * @internal
56
+ */
57
+ export function useSentMapSharesActions() {
58
+ return useMapSharesActions(SentMapSharesContext);
59
+ }
60
+ /**
61
+ * @internal
62
+ */
63
+ export function useSentMapSharesState(selector) {
64
+ return useMapSharesState(SentMapSharesContext, selector);
65
+ }
@@ -1,4 +1,6 @@
1
- import type { MapeoClientApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
1
+ import type { MapeoClientApi } from '@comapeo/ipc' with {
2
+ 'resolution-mode': 'import'
3
+ };
2
4
  /**
3
5
  * Access a client API instance. If a ClientApiContext provider is not
4
6
  * set up, it will throw an error.
@@ -1,4 +1,6 @@
1
- import type { Preset } from '@comapeo/schema' with { 'resolution-mode': 'import' };
1
+ import type { Preset } from '@comapeo/schema' with {
2
+ 'resolution-mode': 'import'
3
+ };
2
4
  import type { WriteableDocumentType } from '../lib/types.js';
3
5
  /**
4
6
  * Retrieve a single document from the database based on the document's document ID.
@@ -1,19 +1,3 @@
1
- /**
2
- * Set up listeners for received and updated invites.
3
- * It is necessary to use this if you want the invites-related read hooks to update
4
- * based on invites that are received or changed in the background.
5
- *
6
- * @example
7
- * ```tsx
8
- * function App() {
9
- * // Use this somewhere near the root of the application
10
- * useSetUpInvitesListeners()
11
- *
12
- * return <RestOfApp />
13
- * }
14
- * ```
15
- */
16
- export declare function useSetUpInvitesListeners(): void;
17
1
  /**
18
2
  * Get all invites that the device has received.
19
3
  *
@@ -1,38 +1,7 @@
1
1
  import { useMutation, useQueryClient, useSuspenseQuery, } from '@tanstack/react-query';
2
- import { useEffect } from 'react';
3
- import { acceptInviteMutationOptions, getInviteByIdQueryOptions, getInvitesQueryKey, getInvitesQueryOptions, rejectInviteMutationOptions, requestCancelInviteMutationOptions, sendInviteMutationOptions, } from '../lib/react-query/invites.js';
2
+ import { acceptInviteMutationOptions, getInviteByIdQueryOptions, getInvitesQueryOptions, rejectInviteMutationOptions, requestCancelInviteMutationOptions, sendInviteMutationOptions, } from '../lib/react-query/invites.js';
4
3
  import { useClientApi } from './client.js';
5
4
  import { useSingleProject } from './projects.js';
6
- /**
7
- * Set up listeners for received and updated invites.
8
- * It is necessary to use this if you want the invites-related read hooks to update
9
- * based on invites that are received or changed in the background.
10
- *
11
- * @example
12
- * ```tsx
13
- * function App() {
14
- * // Use this somewhere near the root of the application
15
- * useSetUpInvitesListeners()
16
- *
17
- * return <RestOfApp />
18
- * }
19
- * ```
20
- */
21
- export function useSetUpInvitesListeners() {
22
- const queryClient = useQueryClient();
23
- const clientApi = useClientApi();
24
- useEffect(() => {
25
- function invalidateCache() {
26
- queryClient.invalidateQueries({ queryKey: getInvitesQueryKey() });
27
- }
28
- clientApi.invite.addListener('invite-received', invalidateCache);
29
- clientApi.invite.addListener('invite-updated', invalidateCache);
30
- return () => {
31
- clientApi.invite.removeListener('invite-received', invalidateCache);
32
- clientApi.invite.removeListener('invite-updated', invalidateCache);
33
- };
34
- }, [clientApi, queryClient]);
35
- }
36
5
  /**
37
6
  * Get all invites that the device has received.
38
7
  *