Skip to content

Commit

Permalink
Documented missing GraphQL types
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekwegr committed Sep 23, 2022
1 parent 6c3819f commit d154112
Show file tree
Hide file tree
Showing 11 changed files with 271 additions and 13 deletions.
6 changes: 3 additions & 3 deletions priv/graphql/schemas/admin/admin_auth_status.gql
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ type AdminAuthInfo{
}

enum AuthType{
""
"Administrator of the specific domain"
DOMAIN_ADMIN
""
"Global administrator"
ADMIN
""
"Unauthorized user"
UNAUTHORIZED
}
14 changes: 13 additions & 1 deletion priv/graphql/schemas/admin/metric.gql
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
"""
Result of a metric
"""

enum MetricType {
"Collects values over a sliding window of 60s and returns apropriate statistical values"
histogram
"Returns a number"
counter
"""
Provides 2 values: total event count and a value in 60s window.
Dividing one value by 60 provides an average per-second value over last minute.
"""
spiral
"Consists of value and time in milliseconds elapsed from the last metric update"
gauge
"Informations about the inet"
merged_inet_stats
"Metrics of the relational database management sytem"
rdbms_stats
"Metrics of the virual machine memory"
vm_stats_memory
"Information about virual machine"
vm_system_info
"Information about process queue length"
probe_queues
}

"Type of metric result"
union MetricResult = HistogramMetric | CounterMetric | SpiralMetric
| GaugeMetric | MergedInetStatsMetric | RDBMSStatsMetric
| VMStatsMemoryMetric | VMSystemInfoMetric
Expand Down
9 changes: 9 additions & 0 deletions priv/graphql/schemas/admin/mnesia.gql
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,26 @@ type MnesiaAdminMutation @protected{

union MnesiaInfo = MnesiaStringResponse | MnesiaListResponse | MnesiaIntResponse

"Mnesia response in the form of a string"
type MnesiaStringResponse {
"Result as a string"
result: String
"Result's key"
key: String
}

"Mnesia response in the form of a list"
type MnesiaListResponse {
"Result as a list"
result: [String]
"Result's key"
key: String
}

"Mnesia response in the form of a integer"
type MnesiaIntResponse {
"Result as an integer"
result: Int
"Result's key"
key: String
}
17 changes: 17 additions & 0 deletions priv/graphql/schemas/admin/server.gql
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,42 @@ type ServerAdminMutation @protected{
@protected(type: GLOBAL)
}

"Status of the server"
type Status {
"Code of the status"
statusCode: StatusCode
"Message about the status"
message: String
}

"Specifies status of the server"
enum StatusCode {
"Server is running"
RUNNING
"Server is not running"
NOT_RUNNING
}

"Logs events that equally or more severe than the configured level"
enum LogLevel {
"Do not log any events"
NONE
"Log when system is unusable"
EMERGENCY
"Log when action must be taken immediately"
ALERT
"Log critical conditions"
CRITICAL
"Log error conditions"
ERROR
"Log warning conditions"
WARNING
"Log normal but significant conditions"
NOTICE
"Long informational messages"
INFO
"Log debug messages"
DEBUG
"Log everything"
ALL
}
72 changes: 72 additions & 0 deletions priv/graphql/schemas/global/muc.gql
Original file line number Diff line number Diff line change
@@ -1,87 +1,159 @@
"User affilation to a specific room"
enum MUCAffiliation{
"The user is the owner of the room"
OWNER
"The user has administrative role"
ADMIN
"The user is a member of the rooom"
MEMBER
"The user isn't a member of the room"
OUTCAST
"The user doesn't have any affiliation"
NONE
}

"MUC role types"
enum MUCRole{
"User is a visiting"
VISITOR
"User can participate in the room"
PARTICIPANT
"User has ability to moderate room"
MODERATOR
}

"MUC room user data"
type MUCRoomUser{
"User's JID"
jid: JID
"User's nickname"
nick: String!
"User's role"
role: MUCRole!
}

"MUC room affiliation data"
type MUCRoomAffiliation{
"Room's JID"
jid: JID!
"Affiliation type"
affiliation: MUCAffiliation!
}

"MUC room description"
type MUCRoomDesc{
"Room's JID"
jid: JID!
"Room's title"
title: String!
"Is room private?"
private: Boolean
"Number of the users"
usersNumber: Int
}

"MUC room configuration"
type MUCRoomConfig{
"Room's title"
title: String!,
"Room's description"
description: String!,
"Allow to change room's subject?"
allowChangeSubject: Boolean!,
"Allow to query users?"
allowQueryUsers: Boolean!,
"Allow private messages?"
allowPrivateMessages: Boolean!,
"Allow visitor staus?"
allowVisitorStatus: Boolean!,
"Allow visitors to change their nicks?"
allowVisitorNickchange: Boolean!,
"Is the room public?"
public: Boolean!,
"Is the room on the public list?"
publicList: Boolean!,
"Is the room persistent"
persistent: Boolean!,
"Is the room moderated?"
moderated: Boolean!,
"Should all new occupants be members by default?"
membersByDefault: Boolean!,
"Should only users with member affiliation be allowed to join the room?"
membersOnly: Boolean!,
"Can users invite others to join the room?"
allowUserInvites: Boolean!,
"Allow multiple sessions of the room?"
allowMultipleSession: Boolean!,
"Is the room password protected?"
passwordProtected: Boolean!,
"Password to the room"
password: String!,
"Are occupants, except from moderators, able see each others real JIDs?"
anonymous: Boolean!,
"Array of roles and/or privileges that enable retrieving the room's member list"
mayGetMemberList: [String!]!
"Maximum number of users in the room"
maxUsers: Int,
"Does the room enabled logging events to a file on the disk?"
logging: Boolean!,
}

"MUC rooom configuration input"
input MUCRoomConfigInput{
"Room's title"
title: String,
"Room's description"
description: String,
"Allow to change room's subject?"
allowChangeSubject: Boolean,
"Allow to query users?"
allowQueryUsers: Boolean,
"Allow private messages?"
allowPrivateMessages: Boolean,
"Allow visitor staus?"
allowVisitorStatus: Boolean,
"Allow visitors to change their nicks?"
allowVisitorNickchange: Boolean,
"Is the room public?"
public: Boolean,
"Is the room on the public list?"
publicList: Boolean,
"Is the room persistent"
persistent: Boolean,
"Is the room moderated?"
moderated: Boolean,
"Should all new occupants be members by default?"
membersByDefault: Boolean,
"Should only users with member affiliation be allowed to join the room?"
membersOnly: Boolean,
"Can users invite others to join the room?"
allowUserInvites: Boolean,
"Allow multiple sessions of the room?"
allowMultipleSession: Boolean,
"Is the room password protected?"
passwordProtected: Boolean,
"Password to the room"
password: String,
"Are occupants, except from moderators, able see each others real JIDs?"
anonymous: Boolean,
"Array of roles and/or privileges that enable retrieving the room's member list"
mayGetMemberList: [String!],
"Maximum number of users in the room"
maxUsers: Int
"Does the room enabled logging events to a file on the disk?"
logging: Boolean,
}

"MUC rooms payload"
type MUCRoomsPayload{
"List of rooms descriptions"
rooms: [MUCRoomDesc!]
"Number of the rooms"
count: Int
"Index of the room"
index: Int
"First room title"
first: String
"Last room title"
last: String
}
27 changes: 27 additions & 0 deletions priv/graphql/schemas/global/muc_light.gql
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
"User's affiliation"
enum Affiliation{
"Owner of the room"
OWNER
"Member of the room"
MEMBER
"User doesn't have any affiliation"
NONE
}

"Specifies blocking data"
input BlockingInput{
"Type of entity to block"
entityType: BlockedEntityType!
"Type of blocking action"
action: BlockingAction!
"Entity's JID"
entity: JID!
}

"Blocking item data"
type BlockingItem{
"Type of the entity"
entityType: BlockedEntityType!
"Action to be taken"
action: BlockingAction!
"Entity's JID"
entity: JID!
}

"Type of blocking action"
enum BlockingAction{
"Unblock user/room"
ALLOW,
"Block user/room"
DENY
}

"Type of blocked entity"
enum BlockedEntityType{
"Individual user"
USER,
"MUC Light room"
ROOM
}

Expand All @@ -40,15 +58,24 @@ type RoomConfigDictEntry{
value: String!
}

"Room data"
type Room{
"Room's JId"
jid: JID!
"Name of the room"
name: String!
"Subject of the room"
subject: String!
"List of participants"
participants: [RoomUser!]!
"Configuration options"
options: [RoomConfigDictEntry!]!
}

"Room user data"
type RoomUser{
"User's JID"
jid: JID!
"User's affiliation"
affiliation: Affiliation!
}
8 changes: 7 additions & 1 deletion priv/graphql/schemas/global/roster.gql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Contact{
"The list of the groups the contact belongs to"
groups: [String!]
"The type of the subscription"
subscription: ContactSub
subscription: ContactSub
"The type of the ask"
ask: ContactAsk
}
Expand Down Expand Up @@ -45,11 +45,17 @@ enum ContactSub{

"The contact ask types"
enum ContactAsk{
"Ask to subscribe"
SUBSCRIBE
"Ask to unsubscribe"
UNSUBSCRIBE
"Invitation came in"
IN
"Invitation came out"
OUT
"Ask for mutual subscription"
BOTH
"No invitation"
NONE
}

Expand Down
17 changes: 11 additions & 6 deletions priv/graphql/schemas/global/scalar_types.gql
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
"Date and time represented using **YYYY-MM-DDTHH:mm:ssZ** format"
scalar DateTime
scalar Stanza
scalar JID
"The JID with resource e.g. alice@localhost/res1"
scalar FullJID
scalar NonEmptyString
scalar PosInt
"Body of a data structure exchanged by XMPP entities in XML streams"
scalar Stanza @spectaql(options: [{ key: "example", value: "Hi!" }])
"Unique indetifier in the form of **node@domain**"
scalar JID @spectaql(options: [{ key: "example", value: "alice@localhost" }])
"The JID with resource"
scalar FullJID @spectaql(options: [{ key: "example", value: "alice@localhost/res1" }])
"String that contains at least one character"
scalar NonEmptyString @spectaql(options: [{ key: "example", value: "xyz789" }])
"Integer that has a value above zero"
scalar PosInt @spectaql(options: [{ key: "example", value: "2" }])
Loading

0 comments on commit d154112

Please sign in to comment.