Add admin dashboard, event reporting, moderation report screens, moderation log
Close #156 and #158 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# source: http://localhost:4000/api
|
||||
# timestamp: Mon Sep 09 2019 11:37:31 GMT+0200 (heure d’été d’Europe centrale)
|
||||
# timestamp: Mon Sep 09 2019 20:33:17 GMT+0200 (GMT+02:00)
|
||||
|
||||
schema {
|
||||
query: RootQueryType
|
||||
@@ -9,7 +9,7 @@ schema {
|
||||
"""An action log"""
|
||||
type ActionLog {
|
||||
"""The action that was done"""
|
||||
action: String
|
||||
action: ActionLogAction
|
||||
|
||||
"""The actor that acted"""
|
||||
actor: Actor
|
||||
@@ -17,10 +17,23 @@ type ActionLog {
|
||||
"""Internal ID for this comment"""
|
||||
id: ID
|
||||
|
||||
"""The time when the action was performed"""
|
||||
insertedAt: DateTime
|
||||
|
||||
"""The object that was acted upon"""
|
||||
object: ActionLogObject
|
||||
}
|
||||
|
||||
enum ActionLogAction {
|
||||
EVENT_DELETION
|
||||
EVENT_UPDATE
|
||||
NOTE_CREATION
|
||||
NOTE_DELETION
|
||||
REPORT_UPDATE_CLOSED
|
||||
REPORT_UPDATE_OPENED
|
||||
REPORT_UPDATE_RESOLVED
|
||||
}
|
||||
|
||||
"""The objects that can be in an action log"""
|
||||
interface ActionLogObject {
|
||||
"""Internal ID for this object"""
|
||||
@@ -51,7 +64,7 @@ interface Actor {
|
||||
followingCount: Int
|
||||
|
||||
"""Internal ID for this actor"""
|
||||
id: Int
|
||||
id: ID
|
||||
|
||||
"""The actors RSA Keys"""
|
||||
keys: String
|
||||
@@ -111,7 +124,7 @@ type Address {
|
||||
|
||||
"""The geocoordinates for the point where this address is"""
|
||||
geom: Point
|
||||
id: Int
|
||||
id: ID
|
||||
|
||||
"""The address's locality"""
|
||||
locality: String
|
||||
@@ -133,7 +146,7 @@ input AddressInput {
|
||||
|
||||
"""The geocoordinates for the point where this address is"""
|
||||
geom: Point
|
||||
id: Int
|
||||
id: ID
|
||||
|
||||
"""The address's locality"""
|
||||
locality: String
|
||||
@@ -185,6 +198,23 @@ type Config {
|
||||
registrationsOpen: Boolean
|
||||
}
|
||||
|
||||
type Dashboard {
|
||||
"""Last public event publish"""
|
||||
lastPublicEventPublished: Event
|
||||
|
||||
"""The number of local comments"""
|
||||
numberOfComments: Int
|
||||
|
||||
"""The number of local events"""
|
||||
numberOfEvents: Int
|
||||
|
||||
"""The number of current opened reports"""
|
||||
numberOfReports: Int
|
||||
|
||||
"""The number of local users"""
|
||||
numberOfUsers: Int
|
||||
}
|
||||
|
||||
"""
|
||||
The `DateTime` scalar type represents a date and time in the UTC
|
||||
timezone. The DateTime appears in a JSON response as an ISO8601 formatted
|
||||
@@ -207,7 +237,7 @@ type DeletedMember {
|
||||
|
||||
"""A struct containing the id of the deleted object"""
|
||||
type DeletedObject {
|
||||
id: Int
|
||||
id: ID
|
||||
}
|
||||
|
||||
"""Represents a deleted participant"""
|
||||
@@ -217,7 +247,7 @@ type DeletedParticipant {
|
||||
}
|
||||
|
||||
"""An event"""
|
||||
type Event {
|
||||
type Event implements ActionLogObject {
|
||||
"""Who the event is attributed to (often a group)"""
|
||||
attributedTo: Actor
|
||||
|
||||
@@ -237,7 +267,7 @@ type Event {
|
||||
endsOn: DateTime
|
||||
|
||||
"""Internal ID for this event"""
|
||||
id: Int
|
||||
id: ID
|
||||
|
||||
"""Whether the event is local or not"""
|
||||
local: Boolean
|
||||
@@ -501,7 +531,7 @@ type Group implements Actor {
|
||||
followingCount: Int
|
||||
|
||||
"""Internal ID for this group"""
|
||||
id: Int
|
||||
id: ID
|
||||
|
||||
"""The actors RSA Keys"""
|
||||
keys: String
|
||||
@@ -651,7 +681,7 @@ type Person implements Actor {
|
||||
goingToEvents: [Event]
|
||||
|
||||
"""Internal ID for this person"""
|
||||
id: Int
|
||||
id: ID
|
||||
|
||||
"""The actors RSA Keys"""
|
||||
keys: String
|
||||
@@ -763,6 +793,12 @@ type Report implements ActionLogObject {
|
||||
"""The internal ID of the report"""
|
||||
id: ID
|
||||
|
||||
"""When the report was created"""
|
||||
insertedAt: DateTime
|
||||
|
||||
"""The notes made on the event"""
|
||||
notes: [ReportNote]
|
||||
|
||||
"""The actor that is being reported"""
|
||||
reported: Actor
|
||||
|
||||
@@ -772,6 +808,9 @@ type Report implements ActionLogObject {
|
||||
"""Whether the report is still active"""
|
||||
status: ReportStatus
|
||||
|
||||
"""When the report was updated"""
|
||||
updatedAt: DateTime
|
||||
|
||||
"""The URI of the report"""
|
||||
uri: String
|
||||
}
|
||||
@@ -784,6 +823,9 @@ type ReportNote implements ActionLogObject {
|
||||
"""The internal ID of the report note"""
|
||||
id: ID
|
||||
|
||||
"""When the report note was created"""
|
||||
insertedAt: DateTime
|
||||
|
||||
"""The moderator who added the note"""
|
||||
moderator: Actor
|
||||
|
||||
@@ -827,7 +869,7 @@ type RootMutationType {
|
||||
"""
|
||||
picture: PictureInput
|
||||
publishAt: DateTime
|
||||
status: Int
|
||||
status: EventStatus
|
||||
|
||||
"""The list of tags associated to the event"""
|
||||
tags: [String] = [""]
|
||||
@@ -836,7 +878,7 @@ type RootMutationType {
|
||||
): Event
|
||||
|
||||
"""Create a Feed Token"""
|
||||
createFeedToken(actorId: Int): FeedToken
|
||||
createFeedToken(actorId: ID): FeedToken
|
||||
|
||||
"""Create a group"""
|
||||
createGroup(
|
||||
@@ -851,7 +893,7 @@ type RootMutationType {
|
||||
banner: PictureInput
|
||||
|
||||
"""The identity that creates the group"""
|
||||
creatorActorId: Int!
|
||||
creatorActorId: ID!
|
||||
|
||||
"""The displayed name for the group"""
|
||||
name: String
|
||||
@@ -884,7 +926,7 @@ type RootMutationType {
|
||||
): Person
|
||||
|
||||
"""Create a report"""
|
||||
createReport(commentsIds: [ID] = [""], eventId: ID, reportContent: String, reportedActorId: ID!, reporterActorId: ID!): Report
|
||||
createReport(commentsIds: [ID] = [""], content: String, eventId: ID, reportedActorId: ID!, reporterActorId: ID!): Report
|
||||
|
||||
"""Create a note on a report"""
|
||||
createReportNote(content: String, moderatorId: ID!, reportId: ID!): ReportNote
|
||||
@@ -893,29 +935,29 @@ type RootMutationType {
|
||||
createUser(email: String!, password: String!): User
|
||||
|
||||
"""Delete an event"""
|
||||
deleteEvent(actorId: Int!, eventId: Int!): DeletedObject
|
||||
deleteEvent(actorId: ID!, eventId: ID!): DeletedObject
|
||||
|
||||
"""Delete a feed token"""
|
||||
deleteFeedToken(token: String!): DeletedFeedToken
|
||||
|
||||
"""Delete a group"""
|
||||
deleteGroup(actorId: Int!, groupId: Int!): DeletedObject
|
||||
deleteGroup(actorId: ID!, groupId: ID!): DeletedObject
|
||||
|
||||
"""Delete an identity"""
|
||||
deletePerson(preferredUsername: String!): Person
|
||||
deleteReportNote(moderatorId: ID!, noteId: ID!): DeletedObject
|
||||
|
||||
"""Join an event"""
|
||||
joinEvent(actorId: Int!, eventId: Int!): Participant
|
||||
joinEvent(actorId: ID!, eventId: ID!): Participant
|
||||
|
||||
"""Join a group"""
|
||||
joinGroup(actorId: Int!, groupId: Int!): Member
|
||||
joinGroup(actorId: ID!, groupId: ID!): Member
|
||||
|
||||
"""Leave an event"""
|
||||
leaveEvent(actorId: Int!, eventId: Int!): DeletedParticipant
|
||||
leaveEvent(actorId: ID!, eventId: ID!): DeletedParticipant
|
||||
|
||||
"""Leave an event"""
|
||||
leaveGroup(actorId: Int!, groupId: Int!): DeletedMember
|
||||
leaveGroup(actorId: ID!, groupId: ID!): DeletedMember
|
||||
|
||||
"""Login an user"""
|
||||
login(email: String!, password: String!): Login
|
||||
@@ -1019,6 +1061,7 @@ type RootQueryType {
|
||||
|
||||
"""Get the instance config"""
|
||||
config: Config
|
||||
dashboard: Dashboard
|
||||
|
||||
"""Get an event by uuid"""
|
||||
event(uuid: UUID!): Event
|
||||
@@ -1054,7 +1097,7 @@ type RootQueryType {
|
||||
report(id: ID!): Report
|
||||
|
||||
"""Get all reports"""
|
||||
reports(limit: Int = 10, page: Int = 1): [Report]
|
||||
reports(limit: Int = 10, page: Int = 1, status: ReportStatus = OPEN): [Report]
|
||||
|
||||
"""Reverse geocode coordinates"""
|
||||
reverseGeocode(latitude: Float!, longitude: Float!): [Address]
|
||||
@@ -1144,6 +1187,15 @@ type User {
|
||||
|
||||
"""The token sent when requesting password token"""
|
||||
resetPasswordToken: String
|
||||
|
||||
"""The role for the user"""
|
||||
role: UserRole
|
||||
}
|
||||
|
||||
enum UserRole {
|
||||
ADMINISTRATOR
|
||||
MODERATOR
|
||||
USER
|
||||
}
|
||||
|
||||
"""Users list"""
|
||||
|
||||
Reference in New Issue
Block a user