From fed9dcb5bf8d9425dd2f00d247471b5f1f5faa18 Mon Sep 17 00:00:00 2001 From: jacekwegr Date: Fri, 23 Sep 2022 16:48:17 +0200 Subject: [PATCH 1/2] Documented missing GraphQL types --- .../schemas/admin/admin_auth_status.gql | 6 +- priv/graphql/schemas/admin/metric.gql | 14 ++- priv/graphql/schemas/admin/mnesia.gql | 9 ++ priv/graphql/schemas/admin/server.gql | 17 +++ priv/graphql/schemas/global/muc.gql | 72 +++++++++++++ priv/graphql/schemas/global/muc_light.gql | 27 +++++ priv/graphql/schemas/global/roster.gql | 8 +- priv/graphql/schemas/global/scalar_types.gql | 17 +-- priv/graphql/schemas/global/spectaql_dir.gql | 2 + priv/graphql/schemas/global/stanza.gql | 10 ++ priv/graphql/schemas/global/token.gql | 3 + priv/graphql/schemas/global/vcard.gql | 101 +++++++++++++++++- 12 files changed, 273 insertions(+), 13 deletions(-) create mode 100644 priv/graphql/schemas/global/spectaql_dir.gql diff --git a/priv/graphql/schemas/admin/admin_auth_status.gql b/priv/graphql/schemas/admin/admin_auth_status.gql index d59db22647..799ab3aa0a 100644 --- a/priv/graphql/schemas/admin/admin_auth_status.gql +++ b/priv/graphql/schemas/admin/admin_auth_status.gql @@ -9,10 +9,10 @@ type AdminAuthInfo{ } enum AuthType{ - "" + "Administrator of the specific domain" DOMAIN_ADMIN - "" + "Global administrator" ADMIN - "" + "Unauthorized user" UNAUTHORIZED } diff --git a/priv/graphql/schemas/admin/metric.gql b/priv/graphql/schemas/admin/metric.gql index 27b8a20673..6c49e7fad6 100644 --- a/priv/graphql/schemas/admin/metric.gql +++ b/priv/graphql/schemas/admin/metric.gql @@ -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 diff --git a/priv/graphql/schemas/admin/mnesia.gql b/priv/graphql/schemas/admin/mnesia.gql index e08b17ad10..85afbac760 100644 --- a/priv/graphql/schemas/admin/mnesia.gql +++ b/priv/graphql/schemas/admin/mnesia.gql @@ -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 } diff --git a/priv/graphql/schemas/admin/server.gql b/priv/graphql/schemas/admin/server.gql index c3c430a5b4..353ca248c2 100644 --- a/priv/graphql/schemas/admin/server.gql +++ b/priv/graphql/schemas/admin/server.gql @@ -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 } diff --git a/priv/graphql/schemas/global/muc.gql b/priv/graphql/schemas/global/muc.gql index 16de7c3e35..d14a32ac34 100644 --- a/priv/graphql/schemas/global/muc.gql +++ b/priv/graphql/schemas/global/muc.gql @@ -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 } diff --git a/priv/graphql/schemas/global/muc_light.gql b/priv/graphql/schemas/global/muc_light.gql index a89fe1f539..8c03627f31 100644 --- a/priv/graphql/schemas/global/muc_light.gql +++ b/priv/graphql/schemas/global/muc_light.gql @@ -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 } @@ -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! } diff --git a/priv/graphql/schemas/global/roster.gql b/priv/graphql/schemas/global/roster.gql index b39f4c2fae..9dc922c60e 100644 --- a/priv/graphql/schemas/global/roster.gql +++ b/priv/graphql/schemas/global/roster.gql @@ -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 } @@ -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 } diff --git a/priv/graphql/schemas/global/scalar_types.gql b/priv/graphql/schemas/global/scalar_types.gql index 4ee27eb651..6b8d81bad4 100644 --- a/priv/graphql/schemas/global/scalar_types.gql +++ b/priv/graphql/schemas/global/scalar_types.gql @@ -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" }]) diff --git a/priv/graphql/schemas/global/spectaql_dir.gql b/priv/graphql/schemas/global/spectaql_dir.gql new file mode 100644 index 0000000000..d782ce3493 --- /dev/null +++ b/priv/graphql/schemas/global/spectaql_dir.gql @@ -0,0 +1,2 @@ +"Used to provide examples for non-standard types" +directive @spectaql(options: [SpectaQLOption]) on OBJECT | FIELD_DEFINITION | SCALAR diff --git a/priv/graphql/schemas/global/stanza.gql b/priv/graphql/schemas/global/stanza.gql index 1df83ce3d1..d015d1aa46 100644 --- a/priv/graphql/schemas/global/stanza.gql +++ b/priv/graphql/schemas/global/stanza.gql @@ -1,15 +1,25 @@ +"Stanza payload data" type StanzasPayload{ + "List of stanza's maps" stanzas: [StanzaMap] + "Max number of stanzas" limit: Int } +"Stanza map data" type StanzaMap{ + "Sender's JID" sender: JID + "Stanza's timestamp" timestamp: DateTime + "ID of the stanza" stanza_id: String + "Stanza's data" stanza: Stanza } +"Send stanza payload" type SendStanzaPayload{ + "Send stanza id" id: ID } diff --git a/priv/graphql/schemas/global/token.gql b/priv/graphql/schemas/global/token.gql index b2af0f7f7a..3b9ef7b3ab 100644 --- a/priv/graphql/schemas/global/token.gql +++ b/priv/graphql/schemas/global/token.gql @@ -1,4 +1,7 @@ +"Token data" type Token { + "Access token data" access: String + "Refresh token data" refresh: String } diff --git a/priv/graphql/schemas/global/vcard.gql b/priv/graphql/schemas/global/vcard.gql index 30810d747b..b6a5497989 100644 --- a/priv/graphql/schemas/global/vcard.gql +++ b/priv/graphql/schemas/global/vcard.gql @@ -9,22 +9,35 @@ type Vcard{ photo: [Image] "Birthday date" birthday: [String] + "User's addresses" address: [Address] + "Formatted text corresponding to delivery address" label: [Label] + "User's telephone number" telephone: [Telephone] + "User's email" email: [Email] + "User's JID" jabberId: [String] + "User's mail agent type" mailer: [String] + "User's timezone" timeZone: [String] "Geographical position" geo: [GeographicalPosition] + "Job title, functional position or function" title: [String] + "User's role, occupation, or business category" role: [String] + "Logo image" logo: [Image] + "Person who will act on behalf of the user or resource associated with the vCard" agent: [Agent] - "Organization" + "Organizational name and units associated" org: [Organization] + "Application specific category information" categories: [Keyword] + "Note about user" note: [String] "Identifier of product that generated the vCard property" prodId: [String] @@ -47,14 +60,20 @@ type Vcard{ } type Keyword{ + "Keywords list" keyword: [String] } type NameComponents{ + "User's family name" family: String + "User's name" givenName: String + "User's middle name" middleName: String + "Prefix to the name" prefix: String + "Suffix to the name" suffix: String } @@ -65,23 +84,29 @@ type Address{ pobox: String "Extra address data" extadd: String + "Street name" street: String + "Locality (e.g. city)" locality: String + "Region name" region: String "Postal code" pcode: String + "Country name" country: String } type Label{ "Label tags" tags: [AddressTags] + "Individual label lines" line: [String] } type Telephone{ "Telephone tags" tags: [TelephoneTags] + "Telephone's number" number: String } @@ -93,30 +118,40 @@ type Email{ } type ImageData{ + "Format type parameter" type: String + "Base64 encoded binary image" binValue: String } type External{ + "URI to an external value" extValue: String } type Phonetic { + "Textual phonetic pronunciation" phonetic: String } type BinValue{ + "Value in binary form" binValue: String } +"Agent vCard" type AgentVcard{ + "vCard data" vcard: Vcard } +"Specifies how image is stored" union Image = ImageData | External +"Specifies how sound is stored" union Sound = Phonetic | BinValue | External +"Specifies how agent is stored" union Agent = AgentVcard | External type GeographicalPosition{ @@ -134,11 +169,14 @@ type Organization{ } type Privacy{ + "List of privacy classification tags" tags: [PrivacyClassificationTags] } type Key{ + "Type of a key" type: String + "Key credential" credential: String } @@ -153,22 +191,35 @@ input VcardInput{ photo: [ImageInput!] "Birthday date" birthday: [String!] + "User's address" address: [AddressInput!] + "Formatted text corresponding to delivery address" label: [LabelInput!] + "User's telephone number" telephone: [TelephoneInput!] + "User's email" email: [EmailInput!] + "User's JID" jabberId: [String!] + "User's mail agent type" mailer: [String!] + "User's timezone" timeZone: [String!] "Geographical position" geo: [GeographicalPositionInput!] + "Job title, functional position or function" title: [String!] + "User's role, occupation, or business category" role: [String!] + "Logo image" logo: [ImageInput!] + "Person who will act on behalf of the user or resource associated with the vCard" agent: [AgentInput!] - "Organization" + "Organizational name and units associated" org: [OrganizationInput!] + "Application specific category information" categories: [KeywordInput!] + "Note about user" note: [String!] "Identifier of product that generated the vCard property" prodId: [String!] @@ -191,14 +242,20 @@ input VcardInput{ } input KeywordInput{ + "Keywords list" keyword: [String!] } input NameComponentsInput{ + "User's family name" family: String + "User's name" givenName: String + "User's middle name" middleName: String + "Prefix to the name" prefix: String + "Suffix to the name" suffix: String } @@ -209,23 +266,29 @@ input AddressInput{ pobox: String "Extra address data" extadd: String + "Street name" street: String + "Locality (e.g. city)" locality: String + "Region name" region: String "Postal code" pcode: String + "Country name" country: String } input LabelInput{ "Label tags" tags: [AddressTags!] + "Individual label lines" line: [String!]! } input TelephoneInput{ "Telephone tags" tags: [TelephoneTags!] + "Telephone's number" number: String! } @@ -251,6 +314,7 @@ input OrganizationInput{ } input PrivacyInput{ + "Privacy classification tag list" tags: [PrivacyClassificationTags!] } @@ -280,46 +344,79 @@ input AgentInput{ } input KeyInput{ + "Type of input" type: String + "Credential or encryption key" credential: String! } enum PrivacyClassificationTags{ + "vCard may be shared with everyone" PUBLIC + "vCard will not be shared" PRIVATE + "vCard may be shared with allowed users" CONFIDENTIAL } +"Specifies type of an address" enum AddressTags{ + "Place of residence address" HOME + "Workplace adress" WORK + "Postal code" POSTAL + "Parcel delivery address" PARCEL + "Domestic delivery address" DOM + "Preferred delivery address when more than one address is specified" PREF + "International delivery address" INTL } +"Specifies intended use of a telphone number" enum TelephoneTags{ + "Number associated with a residence" HOME + "Number associated with a workplace" WORK + "Voice telephone number" VOICE + "Facsimile telephone number" FAX + "Paging device telephone number" PAGER + "Number has voice messaging support" MSG + "Cellular telephone number" CELL + "Video conferencing telephone number" VIDEO + "Bulletin board system telephone number" BBS + "Modem connected telephone number" MODEM + "ISDN service telephone number" ISDN + "Personal communication services telephone number" PCS + "Preferred use of a telephone number" PREF } +"Format or preference of an email" enum EmailTags{ + "Address associated with a residence" HOME + "Address associated with a place of work" WORK + "Internet addressing type" INTERNET + "Preferred use of an email address when more than one is specified" PREF + "X.400 addressing type" X400 } From 86bd66917dc70f7642028b1e05c4135a6f171a08 Mon Sep 17 00:00:00 2001 From: jacekwegr Date: Mon, 3 Oct 2022 16:22:37 +0200 Subject: [PATCH 2/2] More specific CLI help --- priv/graphql/schemas/admin/account.gql | 6 +-- priv/graphql/schemas/admin/admin_schema.gql | 42 ++++++++++---------- priv/graphql/schemas/admin/last.gql | 4 +- priv/graphql/schemas/admin/metric.gql | 10 ++--- priv/graphql/schemas/admin/mnesia.gql | 7 +++- priv/graphql/schemas/admin/muc_light.gql | 4 +- priv/graphql/schemas/admin/offline.gql | 4 +- priv/graphql/schemas/admin/private.gql | 8 ++-- priv/graphql/schemas/admin/roster.gql | 4 +- priv/graphql/schemas/admin/server.gql | 4 +- priv/graphql/schemas/admin/stanza.gql | 9 +++-- priv/graphql/schemas/admin/stats.gql | 20 +++++----- priv/graphql/schemas/admin/token.gql | 4 +- priv/graphql/schemas/admin/vcard.gql | 4 +- priv/graphql/schemas/global/muc.gql | 16 ++++---- priv/graphql/schemas/global/scalar_types.gql | 2 +- priv/graphql/schemas/global/stanza.gql | 2 +- src/ejabberd_ctl.erl | 4 +- 18 files changed, 80 insertions(+), 74 deletions(-) diff --git a/priv/graphql/schemas/admin/account.gql b/priv/graphql/schemas/admin/account.gql index 6856001d00..bb2bdeeec7 100644 --- a/priv/graphql/schemas/admin/account.gql +++ b/priv/graphql/schemas/admin/account.gql @@ -26,14 +26,14 @@ type AccountAdminMutation @protected{ "Register a user. Username will be generated when skipped" registerUser(domain: String!, username: String, password: String!): UserPayload @protected(type: DOMAIN, args: ["domain"]) - "Remove a user" + "Remove the user's account along with all the associated personal data" removeUser(user: JID!): UserPayload @protected(type: DOMAIN, args: ["user"]) "Ban an account: kick sessions and set a random password" - banUser(user: JID!, reason: String!): UserPayload + banUser(user: JID!, reason: String!): UserPayload @protected(type: DOMAIN, args: ["user"]) "Change the password of a user" - changeUserPassword(user: JID!, newPassword: String!): UserPayload + changeUserPassword(user: JID!, newPassword: String!): UserPayload @protected(type: DOMAIN, args: ["user"]) } diff --git a/priv/graphql/schemas/admin/admin_schema.gql b/priv/graphql/schemas/admin/admin_schema.gql index fd7bf8b9dc..6209c281d0 100644 --- a/priv/graphql/schemas/admin/admin_schema.gql +++ b/priv/graphql/schemas/admin/admin_schema.gql @@ -12,7 +12,7 @@ type AdminQuery{ checkAuth: AdminAuthInfo "Account management" account: AccountAdminQuery - "Domain management" + "Dynamic domain management" domain: DomainAdminQuery "Last activity management" last: LastAdminQuery @@ -20,25 +20,25 @@ type AdminQuery{ muc: MUCAdminQuery "MUC Light room management" muc_light: MUCLightAdminQuery - "Session management" + "User session management" session: SessionAdminQuery - "Stanza management" + "Sending stanzas and querying MAM" stanza: StanzaAdminQuery - "Roster/Contacts management" + "User roster/contacts management" roster: RosterAdminQuery - "Vcard management" + "vCard management" vcard: VcardAdminQuery - "Private storage management" + "User private storage management" private: PrivateAdminQuery - "Metrics management" + "Browse metrics" metric: MetricAdminQuery - "Statistics" + "Server statistics" stat: StatsAdminQuery "Personal data management according to GDPR" gdpr: GdprAdminQuery "Mnesia internal database management" mnesia: MnesiaAdminQuery - "Server management" + "Server info and management" server: ServerAdminQuery } @@ -49,34 +49,34 @@ Only an authenticated admin can execute these mutations. type AdminMutation @protected{ "Account management" account: AccountAdminMutation - "Domain management" + "Dynamic domain management" domain: DomainAdminMutation - "Inbox bin management" + "Inbox bin flushing" inbox: InboxAdminMutation - "Last activity management" + "Last user activity management" last: LastAdminMutation "MUC room management" muc: MUCAdminMutation "MUC Light room management" muc_light: MUCLightAdminMutation - "Session management" + "User session management" session: SessionAdminMutation - "Stanza management" + "Sending stanzas and querying MAM" stanza: StanzaAdminMutation - "Roster/Contacts management" + "User roster/contacts management" roster: RosterAdminMutation - "Vcard management" + "vCard management" vcard: VcardAdminMutation - "Private storage management" + "User private storage management" private: PrivateAdminMutation - "Http upload" + "Generating upload/download URLs for the files" httpUpload: HttpUploadAdminMutation - "Offline deleting old messages" + "Deleting old Offline messages" offline: OfflineAdminMutation - "OAUTH token management" + "OAUTH user token management" token: TokenAdminMutation "Mnesia internal database management" mnesia: MnesiaAdminMutation - "Server management" + "Server info and management" server: ServerAdminMutation } diff --git a/priv/graphql/schemas/admin/last.gql b/priv/graphql/schemas/admin/last.gql index 30e6c0a376..ac003c1709 100644 --- a/priv/graphql/schemas/admin/last.gql +++ b/priv/graphql/schemas/admin/last.gql @@ -2,7 +2,7 @@ Allow admin to manage last activity. """ type LastAdminQuery @use(modules: ["mod_last"]) @protected{ - "Get the user's last activity information" + "Get the user's last status and timestamp" getLast(user: JID!): LastActivity @use(arg: "user") @protected(type: DOMAIN, args: ["user"]) "Get the number of users active from the given timestamp" @@ -20,7 +20,7 @@ type LastAdminQuery @use(modules: ["mod_last"]) @protected{ Allow admin to get information about last activity. """ type LastAdminMutation @use(modules: ["mod_last"]) @protected{ - "Set user's last activity information" + "Set user's last status and timestamp" setLast(user: JID!, timestamp: DateTime, status: String!): LastActivity @use(arg: "user") @protected(type: DOMAIN, args: ["user"]) """ diff --git a/priv/graphql/schemas/admin/metric.gql b/priv/graphql/schemas/admin/metric.gql index 6c49e7fad6..db2772d1b7 100644 --- a/priv/graphql/schemas/admin/metric.gql +++ b/priv/graphql/schemas/admin/metric.gql @@ -2,7 +2,7 @@ Result of a metric """ enum MetricType { - "Collects values over a sliding window of 60s and returns apropriate statistical values" + "Collects values over a sliding window of 60s and returns appropriate statistical values" histogram "Returns a number" counter @@ -13,13 +13,13 @@ enum MetricType { spiral "Consists of value and time in milliseconds elapsed from the last metric update" gauge - "Informations about the inet" + "TCP/IP connection statistics from the 'inet' module" merged_inet_stats - "Metrics of the relational database management sytem" + "Metrics of the relational database management system" rdbms_stats - "Metrics of the virual machine memory" + "Metrics of the virtual machine memory" vm_stats_memory - "Information about virual machine" + "Information about virtual machine" vm_system_info "Information about process queue length" probe_queues diff --git a/priv/graphql/schemas/admin/mnesia.gql b/priv/graphql/schemas/admin/mnesia.gql index 85afbac760..1a859a2353 100644 --- a/priv/graphql/schemas/admin/mnesia.gql +++ b/priv/graphql/schemas/admin/mnesia.gql @@ -2,7 +2,10 @@ Allow admin to acquire information about mnesia database """ type MnesiaAdminQuery @protected{ - "Allow to acquire information about mnesia database" + """ + Get the information about appropriate mnesia property for a specified key, + if no keys are provided all the available properties will be returned + """ systemInfo(keys: [String!]): [MnesiaInfo] @protected(type: GLOBAL) } @@ -56,7 +59,7 @@ type MnesiaListResponse { key: String } -"Mnesia response in the form of a integer" +"Mnesia response in the form of an integer" type MnesiaIntResponse { "Result as an integer" result: Int diff --git a/priv/graphql/schemas/admin/muc_light.gql b/priv/graphql/schemas/admin/muc_light.gql index 37b5cd8fa2..26f0bbda88 100644 --- a/priv/graphql/schemas/admin/muc_light.gql +++ b/priv/graphql/schemas/admin/muc_light.gql @@ -20,7 +20,7 @@ type MUCLightAdminMutation @protected{ "Send a message to a MUC Light room" sendMessageToRoom(room: JID!, from: JID!, body: String!): String @protected(type: DOMAIN, args: ["from"]) - "Set the user blocking list" + "Set the user's list of blocked entities" setBlockingList(user: JID!, items: [BlockingInput!]!): String @protected(type: DOMAIN, args: ["user"]) } @@ -41,7 +41,7 @@ type MUCLightAdminQuery @protected{ "Get the list of MUC Light rooms that the user participates in" listUserRooms(user: JID!): [JID!] @protected(type: DOMAIN, args: ["user"]) - "Get the user blocking list" + "Get the user's list of blocked entities" getBlockingList(user: JID!): [BlockingItem!] @protected(type: DOMAIN, args: ["user"]) } diff --git a/priv/graphql/schemas/admin/offline.gql b/priv/graphql/schemas/admin/offline.gql index 9e1b15a184..fc4c723862 100644 --- a/priv/graphql/schemas/admin/offline.gql +++ b/priv/graphql/schemas/admin/offline.gql @@ -2,10 +2,10 @@ Allow admin to delete offline messages from specified domain """ type OfflineAdminMutation @protected{ - "Allow admin to delete offline messages whose date has expired" + "Delete offline messages whose date has expired" deleteExpiredMessages(domain: String!): String @protected(type: DOMAIN, args: ["domain"]) - "Allow the admin to delete messages at least as old as the number of days specified in the parameter" + "Delete messages at least as old as the number of days specified in the parameter" deleteOldMessages(domain: String!, days: Int!): String @protected(type: DOMAIN, args: ["domain"]) } diff --git a/priv/graphql/schemas/admin/private.gql b/priv/graphql/schemas/admin/private.gql index ec5ce5857d..01d3d83f3a 100644 --- a/priv/graphql/schemas/admin/private.gql +++ b/priv/graphql/schemas/admin/private.gql @@ -1,17 +1,17 @@ """ -Allow admin to set user's private +Allow admin to set the user's private data """ type PrivateAdminMutation @protected { - "Set user's private" + "Set the user's private data" setPrivate(user: JID!, elementString: String!): String @protected(type: DOMAIN, args: ["user"]) } """ -Allow admin to get user's private +Allow admin to get the user's private data """ type PrivateAdminQuery @protected { - "Get user's private" + "Get the user's private data" getPrivate(user: JID!, element: String!, nameSpace: String!): String @protected(type: DOMAIN, args: ["user"]) } diff --git a/priv/graphql/schemas/admin/roster.gql b/priv/graphql/schemas/admin/roster.gql index e992774684..5b68d2c7bb 100644 --- a/priv/graphql/schemas/admin/roster.gql +++ b/priv/graphql/schemas/admin/roster.gql @@ -1,5 +1,5 @@ """ -Allow admin to manage user rester/contacts. +Allow admin to manage user roster/contacts. """ type RosterAdminMutation @protected{ "Add a new contact to a user's roster without subscription" @@ -35,7 +35,7 @@ type RosterAdminQuery @protected{ "Get the user's roster/contacts" listContacts(user: JID!): [Contact!] @protected(type: DOMAIN, args: ["user"]) - "Get the user's contact" + "Get the information about the user's specific contact" getContact(user: JID!, contact: JID!): Contact @protected(type: DOMAIN, args: ["user"]) } diff --git a/priv/graphql/schemas/admin/server.gql b/priv/graphql/schemas/admin/server.gql index 353ca248c2..245a0f32a5 100644 --- a/priv/graphql/schemas/admin/server.gql +++ b/priv/graphql/schemas/admin/server.gql @@ -5,7 +5,7 @@ type ServerAdminQuery @protected{ "Get the status of the server" status: Status @protected(type: GLOBAL) - "Get the loglevel of the server" + "Get MongooseIM node's current LogLevel" getLoglevel: LogLevel @protected(type: GLOBAL) "Get the Erlang cookie of this node" @@ -35,7 +35,7 @@ type ServerAdminMutation @protected{ "Remove a MongooseIM node from Mnesia clustering config" removeNode(node: String!): String @protected(type: GLOBAL) - "Set MongooseIM Node's loglevel" + "Set MongooseIM node's LogLevel" setLoglevel(level: LogLevel!): String @protected(type: GLOBAL) } diff --git a/priv/graphql/schemas/admin/stanza.gql b/priv/graphql/schemas/admin/stanza.gql index 9a562ed375..151c1629b8 100644 --- a/priv/graphql/schemas/admin/stanza.gql +++ b/priv/graphql/schemas/admin/stanza.gql @@ -1,14 +1,17 @@ type StanzaAdminQuery @protected{ - "Get n last messages to/from a given contact (optional) with limit and optional date" + """ + Get last 50 messages to/from a given contact, optionally you can change the limit, + specify a date or select only messages exchanged with a specific contact + """ getLastMessages(caller: JID!, with: JID, limit: Int = 50, before: DateTime): StanzasPayload @protected(type: DOMAIN, args: ["caller"]) } type StanzaAdminMutation @protected{ - "Send a chat message to a local or remote bare or full JID" + "Send a chat message from a given contact to a local or remote bare or full JID" sendMessage(from: JID!, to: JID!, body: String!): SendStanzaPayload @protected(type: DOMAIN, args: ["from"]) - "Send a headline message to a local or remote bare or full JID" + "Send a headline message from a given contact to a local or remote bare or full JID" sendMessageHeadLine(from: JID!, to: JID!, subject: String, body: String): SendStanzaPayload @protected(type: DOMAIN, args: ["from"]) "Send an arbitrary stanza. Only for global admin" diff --git a/priv/graphql/schemas/admin/stats.gql b/priv/graphql/schemas/admin/stats.gql index c0658f09d5..a0dfecd78b 100644 --- a/priv/graphql/schemas/admin/stats.gql +++ b/priv/graphql/schemas/admin/stats.gql @@ -1,31 +1,31 @@ "Allow admin to get statistics" type StatsAdminQuery @protected{ - "allow admin to acquire all nodes' statistics" + "Get statistics from all of the nodes. Only for global admin" globalStats: GlobalStats @protected(type: GLOBAL) - "allow admin to acquire domain's statistics" + "Get statistics from a specific domain" domainStats(domain: String!): DomainStats @protected(type: DOMAIN, args: ["domain"]) } type GlobalStats { - "uptime of the node" + "Uptime of the node" uptimeSeconds: Int - "number of registered users" + "Number of registered users" registeredUsers: Int - "number of online users on the node" + "Number of online users on the node" onlineUsersNode: Int - "number of online users" + "Number of online users" onlineUsers: Int - "number of all incoming s2s connections" + "Number of all incoming s2s connections" incomingS2S: Int - "number of all outgoing s2s connections" + "Number of all outgoing s2s connections" outgoingS2S: Int } type DomainStats { - "number of registered users on a given domain" + "Number of registered users on a given domain" registeredUsers: Int - "number of online users on a given domain" + "Number of online users on a given domain" onlineUsers: Int } diff --git a/priv/graphql/schemas/admin/token.gql b/priv/graphql/schemas/admin/token.gql index 366d4623c7..0f94b9a0cb 100644 --- a/priv/graphql/schemas/admin/token.gql +++ b/priv/graphql/schemas/admin/token.gql @@ -2,10 +2,10 @@ Allow admin to get and revoke user's auth tokens """ type TokenAdminMutation @protected { - "Request auth token for an user" + "Request auth token for a user" requestToken(user: JID!): Token @protected(type: DOMAIN, args: ["user"]) - "Revoke any tokens for an user" + "Revoke any tokens for a user" revokeToken(user: JID!): String @protected(type: DOMAIN, args: ["user"]) } diff --git a/priv/graphql/schemas/admin/vcard.gql b/priv/graphql/schemas/admin/vcard.gql index 1eb788a925..b7eb69319f 100644 --- a/priv/graphql/schemas/admin/vcard.gql +++ b/priv/graphql/schemas/admin/vcard.gql @@ -8,10 +8,10 @@ type VcardAdminMutation @protected{ } """ -Allow admin to get user's vcard +Allow admin to get the user's vcard """ type VcardAdminQuery @protected{ - "Get user's vcard" + "Get the user's vcard" getVcard(user: JID!): Vcard @protected(type: DOMAIN, args: ["user"]) } diff --git a/priv/graphql/schemas/global/muc.gql b/priv/graphql/schemas/global/muc.gql index d14a32ac34..6448258c6d 100644 --- a/priv/graphql/schemas/global/muc.gql +++ b/priv/graphql/schemas/global/muc.gql @@ -1,10 +1,10 @@ -"User affilation to a specific room" +"User affiliation to a specific room" enum MUCAffiliation{ "The user is the owner of the room" OWNER - "The user has administrative role" + "The user has an administrative role" ADMIN - "The user is a member of the rooom" + "The user is a member of the room" MEMBER "The user isn't a member of the room" OUTCAST @@ -14,7 +14,7 @@ enum MUCAffiliation{ "MUC role types" enum MUCRole{ - "User is a visiting" + "User is a visitor" VISITOR "User can participate in the room" PARTICIPANT @@ -46,7 +46,7 @@ type MUCRoomDesc{ jid: JID! "Room's title" title: String! - "Is room private?" + "Is the room private?" private: Boolean "Number of the users" usersNumber: Int @@ -58,13 +58,13 @@ type MUCRoomConfig{ title: String!, "Room's description" description: String!, - "Allow to change room's subject?" + "Allow to change the room's subject?" allowChangeSubject: Boolean!, "Allow to query users?" allowQueryUsers: Boolean!, "Allow private messages?" allowPrivateMessages: Boolean!, - "Allow visitor staus?" + "Allow visitor status?" allowVisitorStatus: Boolean!, "Allow visitors to change their nicks?" allowVisitorNickchange: Boolean!, @@ -110,7 +110,7 @@ input MUCRoomConfigInput{ allowQueryUsers: Boolean, "Allow private messages?" allowPrivateMessages: Boolean, - "Allow visitor staus?" + "Allow visitor status?" allowVisitorStatus: Boolean, "Allow visitors to change their nicks?" allowVisitorNickchange: Boolean, diff --git a/priv/graphql/schemas/global/scalar_types.gql b/priv/graphql/schemas/global/scalar_types.gql index 6b8d81bad4..0c06fdfc9d 100644 --- a/priv/graphql/schemas/global/scalar_types.gql +++ b/priv/graphql/schemas/global/scalar_types.gql @@ -2,7 +2,7 @@ scalar DateTime "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**" +"Unique identifier 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" }]) diff --git a/priv/graphql/schemas/global/stanza.gql b/priv/graphql/schemas/global/stanza.gql index d015d1aa46..22eb60c9c0 100644 --- a/priv/graphql/schemas/global/stanza.gql +++ b/priv/graphql/schemas/global/stanza.gql @@ -20,6 +20,6 @@ type StanzaMap{ "Send stanza payload" type SendStanzaPayload{ - "Send stanza id" + "Stanza id" id: ID } diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl index 67427231f8..da9b62c9bf 100644 --- a/src/ejabberd_ctl.erl +++ b/src/ejabberd_ctl.erl @@ -567,8 +567,8 @@ basic_commands() -> {"stop", [], "Stop MongooseIM"}, {"restart", [], "Restart MongooseIM"}, {"help", ["[--tags [tag] | com?*]"], "Show help for the deprecated commands"}, - {"mnesia", ["[info]"], "show information of Mnesia system"}, - {"graphql", ["query"], "Execute graphql query or mutation"}]. + {"mnesia", ["[info]"], "Show information about Mnesia database management system"}, + {"graphql", ["query"], "Execute GraphQL query or mutation"}]. -spec print_categories(dual | long, MaxC :: integer(), ShCode :: boolean()) -> ok. print_categories(HelpMode, MaxC, ShCode) ->