Long overdue initial commit

This commit is contained in:
2018-06-10 14:50:06 +02:00
commit 18cb6f14aa
49 changed files with 3874 additions and 0 deletions
+80
View File
@@ -0,0 +1,80 @@
# The Query type represents the read entry points into the API.
type Query {
# Find character by either an ID or a nick.
character(id: String, nick: String): Character
# Find characters by either a list of ids, nicks or an author. Only one parameter at a time
characters(ids: [String!], nicks: [String!], author: String): [Character!]!
# Find log by ID
log(id: String): Log
# Find logs by a list of IDs
logs(input: LogQueryInput): [LogHeader!]!
# Find post by ID
post(id: String!): Post
# Find posts by IDs. It's meant to allow other parts of the UI to link to a cluster of posts, e.g. for a room description for the
# Mapp should it ever become a thing.
posts(ids: [String!]!): [Post!]!
# Find current session
session: Session!
}
# The Mutation type represents write entry points into the API.
type Mutation {
# Add a new character
addCharacter(input: CharacterAddInput!): Character!
# Add nick to character
addCharacterNick(input: CharacterNickInput!): Character!
# Remove nick from character
removeCharacterNick(input: CharacterNickInput!): Character!
# Edit character
editCharacter(input: CharacterEditInput!): Character!
# Remove a character
removeCharacter(id: String!): Character!
# Add a new log
addLog(input: LogAddInput!): Log!
# Edit a log
editLog(input: LogEditInput!): Log!
# Remove a log
removeLog(id: String!): Log!
# Add a post
addPost(input: AddPostInput!): Post!
# Edit a post
editPost(input: EditPostInput!): Post!
# Move a post
movePost(input: MovePostInput!): Post!
# Remove a post
removePost(id: String!): Post!
# Log in
login(username: String!, password: String!): Session!
# Log out
logout(): Session!
}
schema {
query: Query
mutation: Mutation
}
+21
View File
@@ -0,0 +1,21 @@
package schema
//go:generate go-bindata -ignore=\.go -pkg=schema -o=bindata.go ./...
import "bytes"
// String gets the schema
func String() string {
buf := bytes.Buffer{}
for _, name := range AssetNames() {
b := MustAsset(name)
buf.Write(b)
// Add a newline if the file does not end in a newline.
if len(b) > 0 && b[len(b)-1] != '\n' {
buf.WriteByte('\n')
}
}
return buf.String()
}
+4
View File
@@ -0,0 +1,4 @@
# A Change is a part of the history that can be used to keep clients up to date.
type Change {
id: Int!
}
+65
View File
@@ -0,0 +1,65 @@
# A Character represents an RP character
type Character {
# A unique identifier for the character
id: String!
# The primary IRC nick belonging to the character
nick: String
# All IRC nicks associated with this character
nicks: [String!]!
# The character's author
author: String!
# The character's name
name: String!
# The name to display when space is scarce, usually the first/given name
shortName: String!
# A short description of the character
description: String!
}
# Input for adding characters
input CharacterAddInput {
# The primary IRC nick name to recognize this character by
nick: String!
# The character's name
name: String!
# Optioanl shortened name. By default, it uses the first token in the name
shortName: String
# Description for a character.
description: String
# Optioanlly, specify another author. This needs special permissions if it's not
# your own username
author: String
}
# Input for addNick and removeNick mutation
input CharacterNickInput {
# The ID of the character
id: String!
# The nick to add or remove
nick: String!
}
input CharacterEditInput {
# The id for the character to edit
id: String!
# The full name of the character -- not the salarian full name!
name: String
# The character's short name that is used in compact lists
shortName: String
# A short description for the character
description: String
}
+126
View File
@@ -0,0 +1,126 @@
# A Log is the "file" of an RP session
type Log {
# A unique identifier for the log.
id: String!
# A secondary unique identifier for the log. This is a lot shorter and more suitable for storage when
# the link doesn't need to be as expressive.
shortId: String!
# The date for a log.
date: String!
# The channel of a log.
channel: String!
# The session's title.
title: String!
# The log's event, which is the same as the tags in the previous logbot site.
# Empty string means that it's no event.
event: String!
# The description of a session, which is empty if unset.
description: String!
# Whether the log session is open.
open: Boolean!
# The characters involved in the log file.
characters: [Character!]!
# The posts of the logfile, which can be filtered by kinds.
posts(kinds:[String!]): [Post!]!
}
# Input for logs query
input LogQueryInput {
# Channels to limit results to (inclusive)
channels: [String!]
# Events to limit results to (inclusive)
events: [String!]
# Characters to limit results to (exclusive)
characters: [String!]
# Search post content
search: String
# Limit to only open logs
open: Boolean
# Limit the amount of posts
limit: Int
}
# Input for addLog mutation
input LogAddInput {
# The date of the log, in RFC3339 format with up to nanosecond precision
date: String!
# The channel where the log is set
channel: String!
# Optional: The log title
title: String
# Optional: Whether the log is open
open: Boolean
# Optional: The log event name
event: String
# Optional: A short description of the log
description: String
}
# Input for addLog mutation
input LogEditInput {
# The id of the log
id: String!
# The log title
title: String
# The log event name
event: String
# A short description of the log
description: String
# Open/close the log
open: Boolean
}
# A LogHeader is a cut-down version of Log that does not allow getting the actual posts.
type LogHeader {
# A unique identifier for the log.
id: String!
# A secondary unique identifier for the log. This is a lot shorter and more suitable for storage when
# the link doesn't need to be as expressive.
shortId: String!
# The date for a log.
date: String!
# The channel of a log.
channel: String!
# The session's title.
title: String!
# The log's event, which is the same as the tags in the previous logbot site.
# Empty string means that it's no event.
event: String!
# The description of a session, which is empty if unset.
description: String!
# Whether the log session is open.
open: Boolean!
# The characters involved in the log file.
characters: [Character!]!
}
+68
View File
@@ -0,0 +1,68 @@
# A Post is a part of a log
type Post {
# The post's ID
id: String!
# The post's Log ID. This is the closest thing to a link back since this API graph doesn't have any cycles.
logId: String!
# The date and time of posting
time: String!
# The kind of post this is. Only "text", "scene" and "action" are RP, while others are annotations and 'commands'.
kind: String!
# The character nick
nick: String!
# The post's text, which purpose depends on the kind
text: String!
# The post's index, which is used to sort posts
index: Int!
}
# Input for the addPost mutation
input AddPostInput {
# The log's ID that this post should be a part of
logId: String!
# The date and time of posting, in a RFC3339 format with up to a nanosecond's precision
time: String!
# The kind of post this is. Only "text", "scene" and "action" are RP, while others are annotations and 'commands'.
kind: String!
# The character nick, or command invoker for non-RP stuff
nick: String!
# The post's text, which purpose depends on the kind
text: String!
}
# Input for the editPost mutation
input EditPostInput {
# The Post ID
id: String!
# The date and time of posting, in a RFC3339 format with up to a nanosecond's precision
time: String
# The kind of post this is. Only "text", "scene" and "action" are RP, while others are annotations and 'commands'.
kind: String
# The character nick, or command invoker for non-RP stuff
nick: String
# The post's text, which purpose depends on the kind
text: String
}
# Input for the movePost mutation
input MovePostInput {
# The Post ID
id: String!
# Target index
targetIndex: Int!
}
+5
View File
@@ -0,0 +1,5 @@
# The session represents the current login state
type Session {
# The user that is logged in, null if not logged in
user: User
}
+8
View File
@@ -0,0 +1,8 @@
# The User type is for interacting with user options and settings
type User {
# Their username
id: String!
# Their permission
permissions: [String!]!
}