Interface: NodeSpaces
Defined in: packages/core/src/node/types.ts:481
Methods
access()
access(spaceId): Promise<SpaceAccess>;Defined in: packages/core/src/node/types.ts:494
Roles, members and invites, as the space's access history says now
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
Returns
Promise<SpaceAccess>
assign()
assign(
spaceId,
did,
role
): Promise<void>;Defined in: packages/core/src/node/types.ts:507
Assigns a role to an account. Needs /role/assign
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
did | string |
role | string |
Returns
Promise<void>
authenticator()
authenticator(spaceId): Promise<ServerAuth | null>;Defined in: packages/core/src/node/types.ts:547
How a node serving this space checks connecting peers and signs its welcome; null for a space it does not hold
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
Returns
Promise<ServerAuth | null>
carried()
carried(spaceId, options?): Promise<boolean>;Defined in: packages/core/src/node/types.ts:535
Waits up to waitMs (default 3 s) for a connected carrier to hold all this node does of a space
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
options? | { waitMs?: number; } |
options.waitMs? | number |
Returns
Promise<boolean>
changeKey()
changeKey(spaceId): Promise<void>;Defined in: packages/core/src/node/types.ts:519
Gives a private space a new key, for a lost device. Needs /key/change
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
Returns
Promise<void>
closeInvite()
closeInvite(spaceId, keyOrLink): Promise<void>;Defined in: packages/core/src/node/types.ts:517
Closes an invite, by link or by its key from access().invites. Who joined with it stays.
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
keyOrLink | string |
Returns
Promise<void>
create()
create(params): Promise<SpaceSummary>;Defined in: packages/core/src/node/types.ts:484
Parameters
| Parameter | Type |
|---|---|
params | NewSpace |
Returns
Promise<SpaceSummary>
defineRole()
defineRole(spaceId, role): Promise<void>;Defined in: packages/core/src/node/types.ts:505
Writes a role's definition, replacing the ones held. Needs /role/define
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
role | SpaceRole |
Returns
Promise<void>
get()
get(spaceId): Promise<SpaceSummary | null>;Defined in: packages/core/src/node/types.ts:483
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
Returns
Promise<SpaceSummary | null>
hold()
hold(spaceId): Promise<() => Promise<void>>;Defined in: packages/core/src/node/types.ts:530
Keeps a space syncing until the function it returns is called; it stops once nothing holds it
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
Returns
Promise<() => Promise<void>>
holdsRole()
holdsRole(
spaceId,
role,
account?
): Promise<boolean>;Defined in: packages/core/src/node/types.ts:503
Whether this account, or account, holds every grant of a role at least as wide; may say no wrongly, never yes
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
role | string |
account? | string |
Returns
Promise<boolean>
invite()
invite(spaceId, options?): Promise<string>;Defined in: packages/core/src/node/types.ts:486
An invite string. For a private space it carries the key: treat it as a secret
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
options? | InviteOptions |
Returns
Promise<string>
join()
join(invite, options?): Promise<SpaceSummary>;Defined in: packages/core/src/node/types.ts:490
Joins a space from an invite. memberKey lets a node without the account key receive new space keys
Parameters
| Parameter | Type |
|---|---|
invite | string |
options? | { memberKey?: Uint8Array<ArrayBufferLike>; } |
options.memberKey? | Uint8Array<ArrayBufferLike> |
Returns
Promise<SpaceSummary>
kept()
kept(
spaceId,
waitMs,
since?
): Promise<"keepers" | "peer" | null>;Defined in: packages/core/src/node/types.ts:545
Waits up to waitMs (at most a minute) for this node's writes in a space
to be kept elsewhere: by the space's keepers, every write from since
(ms) on, all by default ('keepers'); or, in a space that names none,
where every member's node is a copy, by a peer connected now that holds
all this node does ('peer'). Null when nobody had, in time.
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
waitMs | number |
since? | number |
Returns
Promise<"keepers" | "peer" | null>
leave()
leave(spaceId): Promise<void>;Defined in: packages/core/src/node/types.ts:492
Gives up the account's place in a space, then forgets it and its key here
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
Returns
Promise<void>
list()
list(): Promise<readonly SpaceSummary[]>;Defined in: packages/core/src/node/types.ts:482
Returns
Promise<readonly SpaceSummary[]>
may()
may(
spaceId,
cmd,
args?,
account?
): Promise<boolean>;Defined in: packages/core/src/node/types.ts:496
Whether this account, or account, may invoke a command with these arguments in a space now (spec 03 §2)
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
cmd | string |
args? | Readonly<Record<string, unknown>> |
account? | string |
Returns
Promise<boolean>
preview()
preview(invite): Promise<InvitePreview>;Defined in: packages/core/src/node/types.ts:488
What an invite or link is for; a short link is fetched from its mailboxes first
Parameters
| Parameter | Type |
|---|---|
invite | string |
Returns
Promise<InvitePreview>
profiles()
profiles(spaceId): Promise<readonly SpaceProfile[]>;Defined in: packages/core/src/node/types.ts:549
The name each person gave in this space; yours is published from the account's name
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
Returns
Promise<readonly SpaceProfile[]>
reached()
reached(
spaceId,
peer,
waitMs
): Promise<boolean>;Defined in: packages/core/src/node/types.ts:537
Waits up to waitMs (at most a minute) for one peer, by its key, to hold all this node does of a space; for a node about to close
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
peer | string |
waitMs | number |
Returns
Promise<boolean>
removeMember()
removeMember(spaceId, did): Promise<void>;Defined in: packages/core/src/node/types.ts:511
Removes an account and its roles. Needs /member/remove, unless it is you
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
did | string |
Returns
Promise<void>
revoke()
revoke(
spaceId,
key,
options?
): Promise<boolean>;Defined in: packages/core/src/node/types.ts:528
Revokes one of this account's keys, by DID: nothing it writes counts from then on.
With waitMs, waits that long for a peer to take it in: true when one did, or with no wait.
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
key | string |
options? | RevokeOptions |
Returns
Promise<boolean>
send()
send(
spaceId,
message,
to?
): Promise<void>;Defined in: packages/core/src/node/types.ts:532
A live message (at most 64 KB) to peers connected now, to an account or a session DID; kept nowhere
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
message | unknown |
to? | string |
Returns
Promise<void>
setKeepers()
setKeepers(
spaceId,
keepers,
copies?
): Promise<void>;Defined in: packages/core/src/node/types.ts:523
Names the nodes that keep the space whole (at most 16), and how many a write should reach. Needs /space/keepers
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
keepers | readonly Keeper[] |
copies? | number | null |
Returns
Promise<void>
setRelays()
setRelays(spaceId, relays): Promise<void>;Defined in: packages/core/src/node/types.ts:521
Names the relays (wss://, at most 8) the space's members meet on. Needs /space/relays
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
relays | readonly string[] |
Returns
Promise<void>
status()
status(spaceId): Promise<SpaceStatus>;Defined in: packages/core/src/node/types.ts:533
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
Returns
Promise<SpaceStatus>
stepDown()
stepDown(spaceId, options?): Promise<void>;Defined in: packages/core/src/node/types.ts:513
Stops being a founder but stays, taking role keep first when given
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
options? | { keep?: string; } |
options.keep? | string |
Returns
Promise<void>
succeed()
succeed(spaceId, successor): Promise<void>;Defined in: packages/core/src/node/types.ts:515
Names a space that succeeds this one. Needs /space/succeed, or a place here when no one holds it
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
successor | string |
Returns
Promise<void>
unassign()
unassign(
spaceId,
did,
role
): Promise<void>;Defined in: packages/core/src/node/types.ts:509
Takes a role from an account. Needs /role/unassign, unless it is your own
Parameters
| Parameter | Type |
|---|---|
spaceId | string |
did | string |
role | string |
Returns
Promise<void>