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; + } +}