Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f57e624
update @comapeo/core
achou11 Sep 28, 2026
7fb032b
update minimum react query version
achou11 Sep 28, 2026
86d4fac
initial implementation
achou11 Sep 28, 2026
1c37ad2
update useSendInvite to address bundling complaint
achou11 Sep 28, 2026
25b777a
minor import cleanup
achou11 Sep 28, 2026
a57bb81
add comment
achou11 Sep 28, 2026
fc9a7fa
raise react query version floor
achou11 Sep 28, 2026
69ab550
update core dep
achou11 Oct 5, 2026
b3184e2
implementation cleanup
achou11 Oct 6, 2026
924ab34
remove unnecessary query key helper
achou11 Oct 6, 2026
1b47bcf
Merge branch 'main' into experiments/invite-over-internet
achou11 Oct 6, 2026
232bbb6
update tsconfig lib to reflect runtime versions more closely
achou11 Oct 7, 2026
e331e12
wip: basic test for invite-over-internet
achou11 Oct 7, 2026
2f3c54f
remove local peers setup in test
achou11 Oct 7, 2026
2f647f3
better assertion messages
achou11 Oct 7, 2026
5f615b3
remove unnecessary swarm opt
achou11 Oct 7, 2026
c7ca61f
test cleanup
achou11 Oct 7, 2026
910a7c5
update test
achou11 Oct 7, 2026
ea2eafa
update useCancelInviteLink to accept invite ID instead of URL
achou11 Oct 7, 2026
44edb65
add tests for invite link cancellation
achou11 Oct 7, 2026
b71514c
install hyperdht as dev dep
achou11 Oct 7, 2026
273af07
add test for invitor denying join request
achou11 Oct 7, 2026
deed238
update test name
achou11 Oct 7, 2026
3299792
update useCancelJoinRequest to use invite ID instead of URL
achou11 Oct 7, 2026
02eaa1a
add test for invitee canceling join request
achou11 Oct 7, 2026
bd80ba7
test cleanup
achou11 Oct 7, 2026
6d982cd
more test fixes
achou11 Oct 7, 2026
b7d3068
more reliable read hook assertions after write hook calls
achou11 Oct 8, 2026
ae43b63
add some docs
achou11 Oct 8, 2026
8508446
Merge branch 'main' into experiments/invite-over-internet
achou11 Oct 22, 2026
faa3b60
Merge branch 'main' into experiments/invite-over-internet
achou11 Oct 22, 2026
36c7b12
update core
achou11 Oct 26, 2026
23b444a
clean up test
achou11 Oct 26, 2026
3c3a152
fix docs for useSingleJoinRequest
achou11 Oct 26, 2026
fce8762
fix tests
achou11 Oct 26, 2026
483bd37
wip: alternative implementation of useSingleJoinRequest
achou11 Oct 26, 2026
b5bf136
Merge branch 'main' into experiments/invite-over-internet
achou11 Nov 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 125 additions & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
- [useSetAutostopDataSyncTimeout](#usesetautostopdatasynctimeout)
- [useExportGeoJSON](#useexportgeojson)
- [useExportZipFile](#useexportzipfile)
- [useManyInviteLinks](#usemanyinvitelinks)
- [useCreateInviteLink](#usecreateinvitelink)
- [useCancelInviteLink](#usecancelinvitelink)
- [useAcceptInviteLinkRequest](#useacceptinvitelinkrequest)
- [useDenyInviteLinkRequest](#usedenyinvitelinkrequest)
- [useSingleDocByDocId](#usesingledocbydocid)
- [useSingleDocByVersionId](#usesingledocbyversionid)
- [useManyDocs](#usemanydocs)
Expand All @@ -60,6 +65,10 @@
- [useRejectInvite](#userejectinvite)
- [useSendInvite](#usesendinvite)
- [useRequestCancelInvite](#userequestcancelinvite)
- [useManyJoinRequests](#usemanyjoinrequests)
- [useSingleJoinRequest](#usesinglejoinrequest)
- [useCreateJoinRequest](#usecreatejoinrequest)
- [useCancelJoinRequest](#usecanceljoinrequest)
- [useMapStyleUrl](#usemapstyleurl)
- [useImportCustomMapFile](#useimportcustommapfile)
- [useRemoveCustomMapFile](#useremovecustommapfile)
Expand Down Expand Up @@ -833,6 +842,62 @@ Parameters:
* `opts.projectId`: Public ID of the project to apply changes to.


### useManyInviteLinks

Get all active invite links.

| Function | Type |
| ---------- | ---------- |
| `useManyInviteLinks` | `({ projectId, }: { projectId: string; }) => Pick<UseSuspenseQueryResult<InviteLink[]>, "data" or "error" or "isRefetching">` |

### useCreateInviteLink

Create an invite link for a project.

| Function | Type |
| ---------- | ---------- |
| `useCreateInviteLink` | `() => FilteredMutationResult<UseMutationResult<string, Error, { projectId: string; } and Omit<InviteOptions, "__testOnlyInviteId">>>` |

### useCancelInviteLink

Cancel a created invite link or all invite links for a project. If `inviteId` is not specified,
all invite links are cancelled.

| Function | Type |
| ---------- | ---------- |
| `useCancelInviteLink` | `() => Pick<Override<MutationObserverIdleResult<void, Error, { projectId: string; inviteId?: string or undefined; }, unknown>, { mutate: UseMutateFunction<void, Error, { ...; }, unknown>; }> and { ...; }, "error" or ... 3 more ... or "mutateAsync"> or Pick<...> or Pick<...> or Pick<...>` |

Examples:

ts```
function Example() {
const cancelInviteLink = useCancelInviteLink()

// Cancel a specific invite link
cancelInviteLink.mutate({ projectId: '...', inviteId: '...' })

// Cancel all invite links
cancelInviteLink.mutate({ projectId: '...' })
}
```


### useAcceptInviteLinkRequest

Accept an invite link join request for a project.

| Function | Type |
| ---------- | ---------- |
| `useAcceptInviteLinkRequest` | `() => FilteredMutationResult<UseMutationResult<InviteDecision, Error, { projectId: string; inviteId: string; deviceId: string; }>>` |

### useDenyInviteLinkRequest

Deny an invite link join request for a project.

| Function | Type |
| ---------- | ---------- |
| `useDenyInviteLinkRequest` | `() => FilteredMutationResult<UseMutationResult<void, Error, { projectId: string; inviteId: string; deviceId: string; }>>` |

### useSingleDocByDocId

Retrieve a single document from the database based on the document's document ID.
Expand Down Expand Up @@ -1087,7 +1152,7 @@ Send an invite for a project.

| Function | Type |
| ---------- | ---------- |
| `useSendInvite` | `({ projectId }: { projectId: string; }) => Pick<Override<MutationObserverIdleResult<"ACCEPT" or "REJECT" or "ALREADY", Error, { deviceId: string; roleDescription?: string or undefined; roleId: "f7c150f5a3a9a855" or "012fd2d431c0bf60" or "9e6d29263cba36c9"; roleName?: string or undefined; }, unknown>, { ...; }> and { ...; },...` |
| `useSendInvite` | `({ projectId, }: { projectId: string; }) => FilteredMutationResult<UseMutationResult<InviteDecision, Error, { deviceId: string; roleDescription?: string or undefined; roleId: "f7c150f5a3a9a855" or "012fd2d431c0bf60" or "9e6d29263cba36c9"; roleName?: string or undefined; }>>` |

Parameters:

Expand All @@ -1107,6 +1172,65 @@ Parameters:
* `opts.projectId`: Public ID of project to request the invite cancellation for.


### useManyJoinRequests

Get all active join requests.

| Function | Type |
| ---------- | ---------- |
| `useManyJoinRequests` | `() => Pick<UseSuspenseQueryResult<JoinRequest[]>, "data" or "error" or "isRefetching">` |

### useSingleJoinRequest

Get a specific join request.

If the join request is not available when the consuming component mounts, it will trigger the closest error boundary.
If the join request is cancelled while this hook is active, the `error` field will be populated with the relevant error from core.
Updates from the '`join-request-update`' event are reflected in the `data` field. Updates that indicate failure are represented by
`data.status` and `data.error`, not the top-level error field from the hook's return value.

| Function | Type |
| ---------- | ---------- |
| `useSingleJoinRequest` | `({ inviteId, }: { inviteId: string; }) => Pick<UseSuspenseQueryResult<JoinRequest>, "data" or "error" or "isRefetching">` |

Parameters:

* `opts.inviteId`: ID of relevant invite.


Examples:

```ts
function ErrorExample({ inviteId }) {
const joinRequestQuery = useSingleJoinRequest({ inviteId })

if (joinRequestQuery.error) {
// Handle error from refetch due to write hook call (e.g. cancelling the join request)
}

if (joinRequestQuery.data.status === 'failed') {
// Handle failure state based on updates happening in the background.
}
}
```


### useCreateJoinRequest

Create a join request for a received invite.

| Function | Type |
| ---------- | ---------- |
| `useCreateJoinRequest` | `() => FilteredMutationResult<UseMutationResult<JoinRequest, Error, { url: string; timeout?: number or undefined; }>>` |

### useCancelJoinRequest

Cancel a join request that has been created for a received invite.

| Function | Type |
| ---------- | ---------- |
| `useCancelJoinRequest` | `() => FilteredMutationResult<UseMutationResult<void, Error, { inviteId: string; }>>` |

### useMapStyleUrl

Get a URL that points to a StyleJSON resource served by the embedded HTTP server.
Expand Down
Loading
Loading