nectar/kinode/packages/contacts/api/contacts:sys-v0.wit
2024-12-16 11:51:08 -08:00

56 lines
1.6 KiB
Plaintext

interface contacts {
enum capability {
read-name-only,
read,
add,
remove,
}
variant request {
/// lazy-load-blob: none.
get-names, // requires read-names-only
/// lazy-load-blob: none.
get-all-contacts, // requires read
/// lazy-load-blob: none.
get-contact(string), // requires read
/// lazy-load-blob: none.
add-contact(string), // requires add
/// tuple<node, field, value>
///
/// lazy-load-blob: none.
add-field(tuple<string, string, string>), // requires add
/// lazy-load-blob: none.
remove-contact(string), // requires remove
/// tuple<node, field>
///
/// lazy-load-blob: none.
remove-field(tuple<string, string>), // requires remove
}
variant response {
/// lazy-load-blob: none.
get-names(list<string>),
/// lazy-load-blob: required; JSON all-contacts dict in blob.
get-all-contacts,
/// lazy-load-blob: required; JSON contact dict in blob.
get-contact,
/// lazy-load-blob: none.
add-contact,
/// lazy-load-blob: none.
add-field,
/// lazy-load-blob: none.
remove-contact,
/// lazy-load-blob: none.
remove-field,
/// any failed request will receive this response
///
/// lazy-load-blob: none.
err(string),
}
}
world contacts-sys-v0 {
import contacts;
include process-v1;
}