mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
350 lines
5.1 KiB
350 lines
5.1 KiB
8 years ago
|
|
||
|
|
||
|
# ENUMS
|
||
|
|
||
|
enum UserRole {
|
||
|
guest
|
||
|
user
|
||
|
admin
|
||
|
}
|
||
|
|
||
|
enum FileType {
|
||
|
binary
|
||
|
image
|
||
|
}
|
||
|
|
||
|
enum RightRole {
|
||
|
read
|
||
|
write
|
||
|
manage
|
||
|
}
|
||
|
|
||
|
# INTERFACES
|
||
|
|
||
|
interface Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
8 years ago
|
}
|
||
|
|
||
|
# TYPES
|
||
|
|
||
|
type Comment implements Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
8 years ago
|
content: String
|
||
|
document: Document!
|
||
|
author: User!
|
||
|
}
|
||
|
|
||
|
type Document implements Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
8 years ago
|
path: String!
|
||
|
title: String!
|
||
|
subtitle: String
|
||
|
parentPath: String
|
||
|
parentTitle: String
|
||
|
isDirectory: Boolean!
|
||
|
isEntry: Boolean!
|
||
|
searchContent: String
|
||
7 years ago
|
comments: [Comment]
|
||
8 years ago
|
tags: [Tag]
|
||
|
}
|
||
|
|
||
|
type File implements Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
8 years ago
|
category: FileType!
|
||
|
mime: String!
|
||
|
extra: String
|
||
|
filename: String!
|
||
|
basename: String!
|
||
|
filesize: Int!
|
||
|
folder: Folder
|
||
|
}
|
||
|
|
||
|
type Folder implements Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
8 years ago
|
name: String!
|
||
7 years ago
|
files: [File]
|
||
8 years ago
|
}
|
||
|
|
||
|
type Group implements Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
8 years ago
|
name: String!
|
||
|
users: [User]
|
||
|
rights: [Right]
|
||
|
}
|
||
|
|
||
|
type Right implements Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
8 years ago
|
path: String!
|
||
|
role: RightRole!
|
||
|
exact: Boolean!
|
||
|
allow: Boolean!
|
||
7 years ago
|
group: Group!
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
type SearchResult {
|
||
|
path: String
|
||
|
title: String
|
||
|
tags: [String]
|
||
|
}
|
||
|
|
||
8 years ago
|
type Setting implements Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
8 years ago
|
key: String!
|
||
|
config: String!
|
||
|
}
|
||
|
|
||
7 years ago
|
# Tags are attached to one or more documents
|
||
8 years ago
|
type Tag implements Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
7 years ago
|
key: String!
|
||
7 years ago
|
documents: [Document]
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
type Translation {
|
||
|
key: String!
|
||
|
value: String!
|
||
|
}
|
||
|
|
||
7 years ago
|
# A User
|
||
8 years ago
|
type User implements Base {
|
||
|
id: Int!
|
||
7 years ago
|
createdAt: Date
|
||
|
updatedAt: Date
|
||
8 years ago
|
email: String!
|
||
7 years ago
|
provider: String!
|
||
8 years ago
|
providerId: String
|
||
|
name: String
|
||
|
role: UserRole!
|
||
|
groups: [Group]
|
||
|
}
|
||
|
|
||
7 years ago
|
type OperationResult {
|
||
7 years ago
|
succeeded: Boolean!
|
||
7 years ago
|
message: String
|
||
7 years ago
|
data: String
|
||
|
}
|
||
|
|
||
|
type LoginResult {
|
||
|
succeeded: Boolean!
|
||
|
message: String
|
||
|
tfaRequired: Boolean
|
||
|
tfaLoginToken: String
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
# Query (Read)
|
||
8 years ago
|
type Query {
|
||
|
comments(id: Int): [Comment]
|
||
|
documents(id: Int, path: String): [Document]
|
||
|
files(id: Int): [File]
|
||
|
folders(id: Int, name: String): [Folder]
|
||
|
groups(id: Int, name: String): [Group]
|
||
|
rights(id: Int): [Right]
|
||
7 years ago
|
search(q: String, tags: [String]): [SearchResult]
|
||
8 years ago
|
settings(key: String): [Setting]
|
||
|
tags(key: String): [Tag]
|
||
7 years ago
|
translations(locale: String!, namespace: String!): [Translation]
|
||
8 years ago
|
users(id: Int, email: String, provider: String, providerId: String, role: UserRole): [User]
|
||
|
}
|
||
7 years ago
|
|
||
|
# Mutations (Create, Update, Delete)
|
||
|
type Mutation {
|
||
7 years ago
|
addRightToGroup(
|
||
|
groupId: Int!
|
||
|
path: String!
|
||
|
role: RightRole!
|
||
|
exact: Boolean!
|
||
|
allow: Boolean!
|
||
|
): Right
|
||
|
|
||
7 years ago
|
assignTagToDocument(
|
||
|
tagId: Int!
|
||
|
documentId: Int!
|
||
7 years ago
|
): OperationResult
|
||
|
|
||
7 years ago
|
assignUserToGroup(
|
||
|
userId: Int!
|
||
|
groupId: Int!
|
||
7 years ago
|
): OperationResult
|
||
|
|
||
7 years ago
|
createComment(
|
||
|
userId: Int!
|
||
|
documentId: Int!
|
||
|
content: String!
|
||
|
): Comment
|
||
|
|
||
7 years ago
|
createDocument(
|
||
|
path: String!
|
||
|
title: String!
|
||
|
subtitle: String
|
||
|
): Document
|
||
|
|
||
7 years ago
|
createFolder(
|
||
|
name: String!
|
||
|
): Folder
|
||
7 years ago
|
|
||
7 years ago
|
createGroup(
|
||
|
name: String!
|
||
|
): Group
|
||
7 years ago
|
|
||
7 years ago
|
createTag(
|
||
|
name: String!
|
||
|
): Tag
|
||
7 years ago
|
|
||
7 years ago
|
createUser(
|
||
|
email: String!
|
||
|
name: String
|
||
7 years ago
|
passwordRaw: String
|
||
7 years ago
|
provider: String!
|
||
|
providerId: String
|
||
|
role: UserRole!
|
||
|
): User
|
||
7 years ago
|
|
||
7 years ago
|
deleteComment(
|
||
|
id: Int!
|
||
|
): OperationResult
|
||
|
|
||
7 years ago
|
deleteDocument(
|
||
|
id: Int!
|
||
|
): OperationResult
|
||
|
|
||
7 years ago
|
deleteFile(
|
||
|
id: Int!
|
||
|
): OperationResult
|
||
|
|
||
7 years ago
|
deleteFolder(
|
||
|
id: Int!
|
||
7 years ago
|
): OperationResult
|
||
|
|
||
7 years ago
|
deleteGroup(
|
||
|
id: Int!
|
||
7 years ago
|
): OperationResult
|
||
|
|
||
7 years ago
|
deleteTag(
|
||
|
id: Int!
|
||
7 years ago
|
): OperationResult
|
||
|
|
||
7 years ago
|
deleteUser(
|
||
|
id: Int!
|
||
7 years ago
|
): OperationResult
|
||
|
|
||
7 years ago
|
login(
|
||
|
username: String!
|
||
|
password: String!
|
||
|
provider: String!
|
||
|
): LoginResult
|
||
|
|
||
|
loginTFA(
|
||
|
loginToken: String!
|
||
|
securityCode: String!
|
||
|
): OperationResult
|
||
|
|
||
7 years ago
|
modifyComment(
|
||
|
id: Int!
|
||
|
content: String!
|
||
|
): Document
|
||
|
|
||
7 years ago
|
modifyDocument(
|
||
|
id: Int!
|
||
|
title: String
|
||
|
subtitle: String
|
||
|
): Document
|
||
|
|
||
|
modifyUser(
|
||
|
id: Int!
|
||
|
email: String
|
||
|
name: String
|
||
|
provider: String
|
||
|
providerId: String
|
||
|
role: UserRole
|
||
|
): User
|
||
|
|
||
7 years ago
|
modifyRight(
|
||
|
id: Int!
|
||
|
path: String
|
||
|
role: RightRole
|
||
|
exact: Boolean
|
||
|
allow: Boolean
|
||
|
): Right
|
||
|
|
||
7 years ago
|
moveDocument(
|
||
|
id: Int!
|
||
|
path: String!
|
||
|
): OperationResult
|
||
|
|
||
7 years ago
|
moveFile(
|
||
|
id: Int!
|
||
|
folderId: Int!
|
||
|
): OperationResult
|
||
|
|
||
|
renameFile(
|
||
|
id: Int!
|
||
|
name: String!
|
||
|
): OperationResult
|
||
|
|
||
7 years ago
|
renameFolder(
|
||
|
id: Int!
|
||
|
name: String!
|
||
|
): OperationResult
|
||
|
|
||
|
renameGroup(
|
||
|
id: Int!
|
||
|
name: String!
|
||
|
): OperationResult
|
||
|
|
||
|
renameTag(
|
||
|
id: Int!
|
||
7 years ago
|
key: String!
|
||
7 years ago
|
): OperationResult
|
||
|
|
||
7 years ago
|
removeTagFromDocument(
|
||
|
tagId: Int!
|
||
|
documentId: Int!
|
||
7 years ago
|
): OperationResult
|
||
|
|
||
7 years ago
|
removeRightFromGroup(
|
||
|
rightId: Int!
|
||
|
): OperationResult
|
||
|
|
||
7 years ago
|
removeUserFromGroup(
|
||
|
userId: Int!
|
||
|
groupId: Int!
|
||
7 years ago
|
): OperationResult
|
||
|
|
||
|
resetUserPassword(
|
||
|
id: Int!
|
||
|
): OperationResult
|
||
|
|
||
7 years ago
|
setConfigEntry(
|
||
|
key: String!
|
||
|
value: String!
|
||
|
): OperationResult
|
||
|
|
||
7 years ago
|
setUserPassword(
|
||
|
id: Int!
|
||
|
passwordRaw: String!
|
||
|
): OperationResult
|
||
7 years ago
|
|
||
|
uploadFile(
|
||
|
category: FileType!
|
||
|
filename: String!
|
||
|
): File
|
||
7 years ago
|
}
|