Skip to content

Commit

Permalink
add wired-dwn
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhhh committed Sep 22, 2024
1 parent e6af4d0 commit 75ad465
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions spatial/wit/wired-dwn/world.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package wired:dwn;

world host {
import api;
import dwn;
}

interface api {
use dwn.{dwn};

/// Get the local user's DWN.
local-dwn: func() -> dwn;

/// Get the local user's default world host DWN.
world-host-dwn: func() -> dwn;
}

interface dwn {
record encrypted-data {
alg: string,
ciphertext: string,
iv: string,
recipients: list<string>,
tag: string,
}

variant data {
base64(string),
encrypted(encrypted-data),
}

record message {
record-id: string,
data: option<data>
}

record status {
code: u16,
detail: option<string>,
}

record query-reply {
entries: list<message>,
status: status,
}

resource query {
poll: func() -> option<query-reply>;
finished: func() -> bool;
}

resource query-builder {
protocol: func() -> option<string>;
set-protocol: func(value: option<string>);

record-id: func() -> option<string>;
set-record-id: func(value: option<string>);

schema: func() -> option<string>;
set-schema: func(value: option<string>);

run: func() -> query;
}

resource dwn {
query: func() -> query-builder;
}
}

0 comments on commit 75ad465

Please sign in to comment.