noise-server/noise.graphql
EliasSchriefer 80668964c1 Remove unnecessary scalar definitions
`DateTimeUtc` and `Url` are provided by juniper and chrono/url with
  their respective (default) features.
  No need to define them manually. (I've skimmed the docs and code)
2021-06-04 14:40:19 +02:00

74 lines
1.6 KiB
GraphQL

schema {
query: Query
}
type Query {
users: [User!]!
}
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!
notificationPreference: NotificationPreference!
securityPreference: SecurityPreference!
# TODO: external servers
externalServersPreference: ExternalServersPreference!
}
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!]
}
type NotificationPreference {
lockDetails: Boolean!
doNotDisturb: Boolean!
}
type SecurityPreference {
# One-purpose-passwords
accountTokens: [ID!]!
# The account's password hash
passwordHash: String!
}
type ExternalServersPreference {
privacyPreference: PrivacyPreference
externalServers: RestrictionPolicy!
externalServersLimit: [Url!]
}
# Everyone = Including all = Excluding none
# None = Including none = Excluding all
enum RestrictionPolicy {
Everyone
Excluding
Including
None
}