From 0d4458d7dd8b0918c797db1eec597b6dc6d4fccb Mon Sep 17 00:00:00 2001 From: erik Date: Mon, 10 May 2021 12:54:17 +0000 Subject: [PATCH] Start writing GraphQL schema Co-authored-by: Elias Schriefer --- noise.graphql | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 noise.graphql diff --git a/noise.graphql b/noise.graphql new file mode 100644 index 0000000..4fcc85b --- /dev/null +++ b/noise.graphql @@ -0,0 +1,72 @@ +schema { + query: Query +} + +type Query { + users: [User!]! +} + +# Hopefully provided by juniper and chrono +scalar DateTimeUtc +# else it's probably DateTime +# scalar DateTime + +# Provided by juniper and url +scalar Url + +type User { + id: ID! + userName: String! + displayName: String + activated: Boolean! + created: DateTimeUtc! + lastOnline: DateTimeUtc + preferences: UserPreferences! +} + +# All account preferences for a single user +type UserPreferences { + privacyPreference: PrivacyPreference! + # TODO: notifications + notificationPreference: NotificationPreference! + # TODO: external servers + # TODO: security +} + +type PrivacyPreference { + # Discovery on other servers + discovery: RestrictionPolicy! + discoveryUserLimit: [String!] + discoveryServerLimit: [Url!] + + # Last seen online + lastSeen: RestrictionPolicy! + lastSeenUserLimit: [String!] + lastSeenServerLimit: [Url!] + # For enabled users/servers: Only give vague indications + # e.g. recently, a long time ago + lastSeenCourse: Boolean! + + # Describing informational text regarding the user + info: RestrictionPolicy! + infoUserLimit: [String!] + infoServerLimit: [Url!] + + # One-purpose-passwords + # TODO: move to security + accountTokens: [ID!]! +} + +type NotificationPreference { + lockDetails: Boolean! + doNotDisturb: Boolean! +} + +# Everyone = Including all = Excluding none +# None = Including none = Excluding all +enum RestrictionPolicy { + Everyone + Excluding + Including + None +} \ No newline at end of file