init notify

This commit is contained in:
ranfdev
2023-10-08 15:57:09 +02:00
parent c3de2224a8
commit 52ea57057e
40 changed files with 13845 additions and 552 deletions

View File

@ -0,0 +1,47 @@
@0x9663f4dd604afa35;
enum Status {
down @0;
degraded @1;
up @2;
}
interface WatchHandle {}
interface OutputChannel {
sendMessage @0 (message: Text);
sendStatus @1 (status: Status);
done @2 ();
}
interface NtfyProxy {
getServer @0 () -> (server: Text);
watch @1 (topic: Text, watcher: OutputChannel, since: UInt64) -> (handle: WatchHandle);
publish @2 (message: Text);
}
struct SubscriptionInfo {
server @0 :Text;
topic @1 :Text;
displayName @2 :Text;
muted @3 :Bool;
readUntil @4 :UInt64;
}
interface Subscription {
watch @0 (watcher: OutputChannel, since: UInt64) -> (handle: WatchHandle);
publish @1 (message: Text);
getInfo @2 () -> SubscriptionInfo;
updateInfo @3 (value: SubscriptionInfo);
updateReadUntil @4 (value: UInt64);
clearNotifications @5 ();
}
interface SystemNotifier {
subscribe @0 (server: Text, topic: Text) -> (subscription: Subscription);
unsubscribe @1 (server: Text, topic: Text);
listSubscriptions @2 () -> (list: List(Subscription));
}