-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |