From 75ad465bbfcfd3506842d4c0100a06c92aa8d136 Mon Sep 17 00:00:00 2001 From: Kayh Date: Sun, 22 Sep 2024 00:00:55 -0400 Subject: [PATCH] add wired-dwn --- spatial/wit/wired-dwn/world.wit | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 spatial/wit/wired-dwn/world.wit diff --git a/spatial/wit/wired-dwn/world.wit b/spatial/wit/wired-dwn/world.wit new file mode 100644 index 0000000..aedd449 --- /dev/null +++ b/spatial/wit/wired-dwn/world.wit @@ -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, + tag: string, + } + + variant data { + base64(string), + encrypted(encrypted-data), + } + + record message { + record-id: string, + data: option + } + + record status { + code: u16, + detail: option, + } + + record query-reply { + entries: list, + status: status, + } + + resource query { + poll: func() -> option; + finished: func() -> bool; + } + + resource query-builder { + protocol: func() -> option; + set-protocol: func(value: option); + + record-id: func() -> option; + set-record-id: func(value: option); + + schema: func() -> option; + set-schema: func(value: option); + + run: func() -> query; + } + + resource dwn { + query: func() -> query-builder; + } +}