tabs editor config
This commit is contained in:
parent
b02f23e82b
commit
cacb6f6642
9
.editorconfig
Normal file
9
.editorconfig
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = tabs
|
||||||
|
indent_size = 1
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace=true
|
||||||
|
insert_final_newline = true
|
388
schema.graphql
388
schema.graphql
|
@ -3,286 +3,286 @@ scalar DateTime
|
||||||
################################### Payload
|
################################### Payload
|
||||||
|
|
||||||
type Result {
|
type Result {
|
||||||
error: String
|
error: String
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuthResult {
|
type AuthResult {
|
||||||
error: String
|
error: String
|
||||||
token: String
|
token: String
|
||||||
user: User
|
user: User
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserResult {
|
type UserResult {
|
||||||
error: String
|
error: String
|
||||||
user: User
|
user: User
|
||||||
}
|
}
|
||||||
|
|
||||||
type MessageResult {
|
type MessageResult {
|
||||||
error: String
|
error: String
|
||||||
message: Message
|
message: Message
|
||||||
}
|
}
|
||||||
|
|
||||||
input ShoutInput {
|
input ShoutInput {
|
||||||
slug: String!
|
slug: String!
|
||||||
body: String!
|
body: String!
|
||||||
replyTo: String # another shout
|
replyTo: String # another shout
|
||||||
tags: [String] # actual values
|
tags: [String] # actual values
|
||||||
topics: [Int]
|
topics: [Int]
|
||||||
title: String
|
title: String
|
||||||
subtitle: String
|
subtitle: String
|
||||||
versionOf: String
|
versionOf: String
|
||||||
visibleForRoles: [String] # role ids are strings
|
visibleForRoles: [String] # role ids are strings
|
||||||
visibleForUsers: [Int]
|
visibleForUsers: [Int]
|
||||||
}
|
}
|
||||||
|
|
||||||
input ProfileInput {
|
input ProfileInput {
|
||||||
email: String
|
email: String
|
||||||
username: String
|
username: String
|
||||||
userpic: String
|
userpic: String
|
||||||
}
|
}
|
||||||
|
|
||||||
type ShoutResult {
|
type ShoutResult {
|
||||||
error: String
|
error: String
|
||||||
shout: Shout
|
shout: Shout
|
||||||
}
|
}
|
||||||
|
|
||||||
################################### Mutation
|
################################### Mutation
|
||||||
|
|
||||||
type Mutation {
|
type Mutation {
|
||||||
# message
|
# message
|
||||||
createMessage(body: String!, replyTo: Int): MessageResult!
|
createMessage(body: String!, replyTo: Int): MessageResult!
|
||||||
updateMessage(id: Int!, body: String!): MessageResult!
|
updateMessage(id: Int!, body: String!): MessageResult!
|
||||||
deleteMessage(messageId: Int!): Result!
|
deleteMessage(messageId: Int!): Result!
|
||||||
|
|
||||||
# auth
|
# auth
|
||||||
confirmEmail(token: String!): AuthResult!
|
confirmEmail(token: String!): AuthResult!
|
||||||
requestPasswordReset(email: String!): Boolean!
|
requestPasswordReset(email: String!): Boolean!
|
||||||
confirmPasswordReset(token: String!): Boolean!
|
confirmPasswordReset(token: String!): Boolean!
|
||||||
registerUser(email: String!, password: String): AuthResult!
|
registerUser(email: String!, password: String): AuthResult!
|
||||||
# updatePassword(password: String!, token: String!): Token!
|
# updatePassword(password: String!, token: String!): Token!
|
||||||
# invalidateAllTokens: Boolean!
|
# invalidateAllTokens: Boolean!
|
||||||
# invalidateTokenById(id: Int!): Boolean!
|
# invalidateTokenById(id: Int!): Boolean!
|
||||||
# requestEmailConfirmation: User!
|
# requestEmailConfirmation: User!
|
||||||
|
|
||||||
# shout
|
# shout
|
||||||
createShout(input: ShoutInput!): ShoutResult!
|
createShout(input: ShoutInput!): ShoutResult!
|
||||||
updateShout(id: Int!, input: ShoutInput!): ShoutResult!
|
updateShout(id: Int!, input: ShoutInput!): ShoutResult!
|
||||||
deleteShout(id: Int!): Result!
|
deleteShout(id: Int!): Result!
|
||||||
rateShout(shout_id: Int!, value: Int!): Result!
|
rateShout(shout_id: Int!, value: Int!): Result!
|
||||||
viewShout(shout_id: Int!): Result!
|
viewShout(shout_id: Int!): Result!
|
||||||
|
|
||||||
# user profile
|
# user profile
|
||||||
# rateUser(value: Int!): Result!
|
# rateUser(value: Int!): Result!
|
||||||
# updateOnlineStatus: Result!
|
# updateOnlineStatus: Result!
|
||||||
updateProfile(profile: ProfileInput!): Result!
|
updateProfile(profile: ProfileInput!): Result!
|
||||||
|
|
||||||
# topics
|
# topics
|
||||||
topicSubscribe(slug: String!): Result!
|
topicSubscribe(slug: String!): Result!
|
||||||
topicUnsubscribe(slug: String!): Result!
|
topicUnsubscribe(slug: String!): Result!
|
||||||
}
|
}
|
||||||
|
|
||||||
################################### Query
|
################################### Query
|
||||||
|
|
||||||
type Query {
|
type Query {
|
||||||
# auth
|
# auth
|
||||||
isEmailFree(email: String!): Result!
|
isEmailFree(email: String!): Result!
|
||||||
signIn(email: String!, password: String): AuthResult!
|
signIn(email: String!, password: String): AuthResult!
|
||||||
signOut: Result!
|
signOut: Result!
|
||||||
|
|
||||||
# profile
|
# profile
|
||||||
getCurrentUser: UserResult!
|
getCurrentUser: UserResult!
|
||||||
getUserBySlug(slug: String!): UserResult!
|
getUserBySlug(slug: String!): UserResult!
|
||||||
# rateUser(shout: Int): Int!
|
# rateUser(shout: Int): Int!
|
||||||
|
|
||||||
# messages
|
# messages
|
||||||
getMessages(count: Int = 100, page: Int = 1): [Message!]!
|
getMessages(count: Int = 100, page: Int = 1): [Message!]!
|
||||||
|
|
||||||
# shouts
|
# shouts
|
||||||
getShoutBySlug(slug: String!): Shout!
|
getShoutBySlug(slug: String!): Shout!
|
||||||
# NOTE: with .comments: Comments[]
|
# NOTE: with .comments: Comments[]
|
||||||
shoutsByTopic(topic: String!, limit: Int!): [Shout]!
|
shoutsByTopic(topic: String!, limit: Int!): [Shout]!
|
||||||
shoutsByAuthor(author: String!, limit: Int!): [Shout]!
|
shoutsByAuthor(author: String!, limit: Int!): [Shout]!
|
||||||
shoutsByCommunity(community: String!, limit: Int!): [Shout]!
|
shoutsByCommunity(community: String!, limit: Int!): [Shout]!
|
||||||
|
|
||||||
# mainpage
|
# mainpage
|
||||||
topShoutsByView(limit: Int): [Shout]!
|
topShoutsByView(limit: Int): [Shout]!
|
||||||
topShoutsByRating(limit: Int): [Shout]!
|
topShoutsByRating(limit: Int): [Shout]!
|
||||||
favoriteShouts(limit: Int): [Shout]!
|
favoriteShouts(limit: Int): [Shout]!
|
||||||
recentShouts(limit: Int): [Shout]!
|
recentShouts(limit: Int): [Shout]!
|
||||||
topAuthors(limit: Int): [User]!
|
topAuthors(limit: Int): [User]!
|
||||||
|
|
||||||
# topics
|
# topics
|
||||||
topicsBySlugs(slugs: [String]!): [Topic]!
|
topicsBySlugs(slugs: [String]!): [Topic]!
|
||||||
topicsByCommunity(community: String!): [Topic]!
|
topicsByCommunity(community: String!): [Topic]!
|
||||||
topicsByAuthor(author: String!): [Topic]!
|
topicsByAuthor(author: String!): [Topic]!
|
||||||
|
|
||||||
# getOnlineUsers: [User!]!
|
# getOnlineUsers: [User!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
############################################ Subscription
|
############################################ Subscription
|
||||||
|
|
||||||
type Subscription {
|
type Subscription {
|
||||||
messageCreated: Message!
|
messageCreated: Message!
|
||||||
messageUpdated: Message!
|
messageUpdated: Message!
|
||||||
messageDeleted: Message!
|
messageDeleted: Message!
|
||||||
|
|
||||||
onlineUpdated: [User!]!
|
onlineUpdated: [User!]!
|
||||||
shoutUpdated: Shout!
|
shoutUpdated: Shout!
|
||||||
userUpdated: User!
|
userUpdated: User!
|
||||||
topicUpdated: Shout!
|
topicUpdated: Shout!
|
||||||
}
|
}
|
||||||
|
|
||||||
############################################ Entities
|
############################################ Entities
|
||||||
|
|
||||||
type Role {
|
type Role {
|
||||||
id: Int!
|
id: Int!
|
||||||
name: String!
|
name: String!
|
||||||
community: Int!
|
community: Int!
|
||||||
desc: String
|
desc: String
|
||||||
permissions: [Int!]!
|
permissions: [Int!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Rating {
|
type Rating {
|
||||||
createdBy: Int!
|
createdBy: Int!
|
||||||
value: Int!
|
value: Int!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Notification {
|
type Notification {
|
||||||
kind: String! # unique primary key
|
kind: String! # unique primary key
|
||||||
template: String!
|
template: String!
|
||||||
variables: [String]
|
variables: [String]
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserNotification {
|
type UserNotification {
|
||||||
id: Int! # primary key
|
id: Int! # primary key
|
||||||
user: Int!
|
user: Int!
|
||||||
kind: String! # NotificationTemplate.name
|
kind: String! # NotificationTemplate.name
|
||||||
values: [String]
|
values: [String]
|
||||||
}
|
}
|
||||||
|
|
||||||
type User {
|
type User {
|
||||||
id: Int!
|
id: Int!
|
||||||
username: String! # to login, ex. email
|
username: String! # to login, ex. email
|
||||||
createdAt: DateTime!
|
createdAt: DateTime!
|
||||||
slug: String!
|
slug: String!
|
||||||
name: String # to display
|
name: String # to display
|
||||||
email: String
|
email: String
|
||||||
password: String
|
password: String
|
||||||
oauth: String # provider:token
|
oauth: String # provider:token
|
||||||
userpic: String
|
userpic: String
|
||||||
links: [String]
|
links: [String]
|
||||||
emailConfirmed: Boolean # should contain all emails too
|
emailConfirmed: Boolean # should contain all emails too
|
||||||
muted: Boolean
|
muted: Boolean
|
||||||
roles: [Role]
|
roles: [Role]
|
||||||
updatedAt: DateTime
|
updatedAt: DateTime
|
||||||
wasOnlineAt: DateTime
|
wasOnlineAt: DateTime
|
||||||
rating: Int
|
rating: Int
|
||||||
ratings: [Rating]
|
ratings: [Rating]
|
||||||
bio: String
|
bio: String
|
||||||
notifications: [Int]
|
notifications: [Int]
|
||||||
topics: [String] # user subscribed topics
|
topics: [String] # user subscribed topics
|
||||||
communities: [Int] # user participating communities
|
communities: [Int] # user participating communities
|
||||||
old_id: String
|
old_id: String
|
||||||
}
|
}
|
||||||
|
|
||||||
type Message {
|
type Message {
|
||||||
author: Int!
|
author: Int!
|
||||||
body: String!
|
body: String!
|
||||||
createdAt: DateTime!
|
createdAt: DateTime!
|
||||||
id: Int!
|
id: Int!
|
||||||
replyTo: Int
|
replyTo: Int
|
||||||
updatedAt: DateTime!
|
updatedAt: DateTime!
|
||||||
visibleForUsers: [Int]!
|
visibleForUsers: [Int]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Comment {
|
type Comment {
|
||||||
id: Int!
|
id: Int!
|
||||||
author: Int!
|
author: Int!
|
||||||
body: String!
|
body: String!
|
||||||
replyTo: Int!
|
replyTo: Int!
|
||||||
createdAt: DateTime!
|
createdAt: DateTime!
|
||||||
updatedAt: DateTime
|
updatedAt: DateTime
|
||||||
updatedBy: Int
|
updatedBy: Int
|
||||||
shout: Int!
|
shout: Int!
|
||||||
deletedAt: DateTime
|
deletedAt: DateTime
|
||||||
deletedBy: Int
|
deletedBy: Int
|
||||||
rating: Int
|
rating: Int
|
||||||
ratigns: [CommentRating]
|
ratigns: [CommentRating]
|
||||||
views: Int
|
views: Int
|
||||||
old_id: String
|
old_id: String
|
||||||
old_thread: String
|
old_thread: String
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommentRating {
|
type CommentRating {
|
||||||
id: Int!
|
id: Int!
|
||||||
comment_id: Int!
|
comment_id: Int!
|
||||||
createdBy: Int!
|
createdBy: Int!
|
||||||
createdAt: DateTime!
|
createdAt: DateTime!
|
||||||
value: Int!
|
value: Int!
|
||||||
}
|
}
|
||||||
|
|
||||||
# is publication
|
# is publication
|
||||||
type Shout {
|
type Shout {
|
||||||
id: Int!
|
id: Int!
|
||||||
slug: String!
|
slug: String!
|
||||||
body: String!
|
body: String!
|
||||||
createdAt: DateTime!
|
createdAt: DateTime!
|
||||||
authors: [User!]!
|
authors: [User!]!
|
||||||
comments: [Comment]
|
comments: [Comment]
|
||||||
ratigns: [Rating]
|
ratigns: [Rating]
|
||||||
visibleFor: [User]
|
visibleFor: [User]
|
||||||
community: Int
|
community: Int
|
||||||
cover: String
|
cover: String
|
||||||
layout: String
|
layout: String
|
||||||
rating: Int
|
rating: Int
|
||||||
views: Int
|
views: Int
|
||||||
replyTo: Shout
|
replyTo: Shout
|
||||||
versionOf: Shout
|
versionOf: Shout
|
||||||
tags: [String] # actual values
|
tags: [String] # actual values
|
||||||
topics: [String] # topic-slugs, order has matter
|
topics: [String] # topic-slugs, order has matter
|
||||||
title: String
|
title: String
|
||||||
subtitle: String
|
subtitle: String
|
||||||
updatedAt: DateTime
|
updatedAt: DateTime
|
||||||
updatedBy: Int # can be user id?
|
updatedBy: Int # can be user id?
|
||||||
deletedAt: DateTime
|
deletedAt: DateTime
|
||||||
deletedBy: Int
|
deletedBy: Int
|
||||||
publishedBy: Int # if there is no published field - it is not published
|
publishedBy: Int # if there is no published field - it is not published
|
||||||
publishedAt: DateTime
|
publishedAt: DateTime
|
||||||
old_id: String
|
old_id: String
|
||||||
}
|
}
|
||||||
|
|
||||||
type Community {
|
type Community {
|
||||||
slug: String!
|
slug: String!
|
||||||
name: String!
|
name: String!
|
||||||
desc: String
|
desc: String
|
||||||
pic: String!
|
pic: String!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Topic {
|
type Topic {
|
||||||
slug: String! # ID
|
slug: String! # ID
|
||||||
title: String
|
title: String
|
||||||
body: String
|
body: String
|
||||||
pic: String
|
pic: String
|
||||||
parents: [String] # NOTE: topic can have parent topics
|
parents: [String] # NOTE: topic can have parent topics
|
||||||
children: [String] # and children
|
children: [String] # and children
|
||||||
cat_id: String
|
cat_id: String
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO: resolvers to add/remove topics from publication
|
# TODO: resolvers to add/remove topics from publication
|
||||||
|
|
||||||
type Proposal {
|
type Proposal {
|
||||||
body: String!
|
body: String!
|
||||||
shout: Int!
|
shout: Int!
|
||||||
range: String # full / 0:2340
|
range: String # full / 0:2340
|
||||||
author: Int!
|
author: Int!
|
||||||
createdAt: DateTime!
|
createdAt: DateTime!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Token {
|
type Token {
|
||||||
createdAt: DateTime!
|
createdAt: DateTime!
|
||||||
expiresAt: DateTime
|
expiresAt: DateTime
|
||||||
id: Int!
|
id: Int!
|
||||||
ownerId: Int!
|
ownerId: Int!
|
||||||
usedAt: DateTime
|
usedAt: DateTime
|
||||||
value: String!
|
value: String!
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user