Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented missing GraphQL types #3773

Merged
merged 2 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
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"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
merged_inet_stats
"Metrics of the relational database management sytem"
rdbms_stats
"Metrics of the virual machine memory"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
vm_stats_memory
"Information about virual machine"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
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"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
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"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
enum MUCAffiliation{
"The user is the owner of the room"
OWNER
"The user has administrative role"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
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"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
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?"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
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?"
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
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" }])
chrzaszcz marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions priv/graphql/schemas/global/spectaql_dir.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"Used to provide examples for non-standard types"
directive @spectaql(options: [SpectaQLOption]) on OBJECT | FIELD_DEFINITION | SCALAR
Loading