nectar/kinode/packages/contacts/api/contacts:sys-v0.wit

37 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-10-15 23:46:21 +03:00
interface contacts {
2024-10-22 20:20:10 +03:00
enum capability {
2024-10-15 23:46:21 +03:00
read-name-only,
read,
add,
remove,
}
2024-10-17 22:14:34 +03:00
variant request {
2024-10-15 23:46:21 +03:00
get-names, // requires read-names-only
get-all-contacts, // requires read
get-contact(string), // requires read
add-contact(string), // requires add
// tuple<node, field, value>
add-field(tuple<string, string, string>), // requires add
remove-contact(string), // requires remove
// tuple<node, field>
remove-field(tuple<string, string>), // requires remove
}
2024-10-17 22:14:34 +03:00
variant response {
2024-10-15 23:46:21 +03:00
get-names(list<string>),
get-all-contacts, // JSON all-contacts dict in blob
2024-10-17 22:14:34 +03:00
get-contact, // JSON contact dict in blob
2024-10-15 23:46:21 +03:00
add-contact,
add-field,
remove-contact,
remove-field,
2024-10-22 20:43:01 +03:00
err(string), // any failed request will receive this response
2024-10-15 23:46:21 +03:00
}
}
world contacts-sys-v0 {
import contacts;
include process-v0;
}