2017-08-07 01:05:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ENUMS
|
|
|
|
|
|
|
|
enum UserRole {
|
|
|
|
guest
|
|
|
|
user
|
|
|
|
admin
|
|
|
|
}
|
|
|
|
|
|
|
|
enum FileType {
|
|
|
|
binary
|
|
|
|
image
|
|
|
|
}
|
|
|
|
|
|
|
|
enum RightRole {
|
|
|
|
read
|
|
|
|
write
|
|
|
|
manage
|
|
|
|
}
|
|
|
|
|
|
|
|
# INTERFACES
|
|
|
|
|
|
|
|
interface Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-07 01:05:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# TYPES
|
|
|
|
|
2018-03-06 01:53:24 +00:00
|
|
|
type KeyValuePair {
|
|
|
|
key: String!
|
|
|
|
value: String!
|
|
|
|
}
|
|
|
|
input KeyValuePairInput {
|
|
|
|
key: String!
|
|
|
|
value: String!
|
|
|
|
}
|
|
|
|
|
|
|
|
type DefaultResponse {
|
|
|
|
operation: ResponseStatus
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResponseStatus {
|
|
|
|
succeeded: Boolean!
|
|
|
|
code: Int!
|
|
|
|
slug: String!
|
|
|
|
message: String
|
|
|
|
}
|
|
|
|
|
2017-08-07 01:05:10 +00:00
|
|
|
type Comment implements Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-07 01:05:10 +00:00
|
|
|
content: String
|
|
|
|
document: Document!
|
|
|
|
author: User!
|
|
|
|
}
|
|
|
|
|
|
|
|
type Document implements Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-07 01:05:10 +00:00
|
|
|
path: String!
|
|
|
|
title: String!
|
|
|
|
subtitle: String
|
|
|
|
parentPath: String
|
|
|
|
parentTitle: String
|
|
|
|
isDirectory: Boolean!
|
|
|
|
isEntry: Boolean!
|
|
|
|
searchContent: String
|
2017-08-20 02:51:25 +00:00
|
|
|
comments: [Comment]
|
2017-08-07 01:05:10 +00:00
|
|
|
tags: [Tag]
|
|
|
|
}
|
|
|
|
|
|
|
|
type File implements Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-07 01:05:10 +00:00
|
|
|
category: FileType!
|
|
|
|
mime: String!
|
|
|
|
extra: String
|
|
|
|
filename: String!
|
|
|
|
basename: String!
|
|
|
|
filesize: Int!
|
|
|
|
folder: Folder
|
|
|
|
}
|
|
|
|
|
|
|
|
type Folder implements Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-07 01:05:10 +00:00
|
|
|
name: String!
|
2017-08-14 00:33:06 +00:00
|
|
|
files: [File]
|
2017-08-07 01:05:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Group implements Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-07 01:05:10 +00:00
|
|
|
name: String!
|
|
|
|
users: [User]
|
|
|
|
rights: [Right]
|
|
|
|
}
|
|
|
|
|
|
|
|
type Right implements Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-07 01:05:10 +00:00
|
|
|
path: String!
|
|
|
|
role: RightRole!
|
|
|
|
exact: Boolean!
|
|
|
|
allow: Boolean!
|
2017-08-20 02:51:25 +00:00
|
|
|
group: Group!
|
2017-08-07 01:05:10 +00:00
|
|
|
}
|
|
|
|
|
2017-09-30 02:32:43 +00:00
|
|
|
type SearchResult {
|
|
|
|
path: String
|
|
|
|
title: String
|
|
|
|
tags: [String]
|
|
|
|
}
|
|
|
|
|
2017-08-07 01:05:10 +00:00
|
|
|
type Setting implements Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-07 01:05:10 +00:00
|
|
|
key: String!
|
|
|
|
config: String!
|
|
|
|
}
|
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
# Tags are attached to one or more documents
|
2017-08-07 01:05:10 +00:00
|
|
|
type Tag implements Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-19 01:21:29 +00:00
|
|
|
key: String!
|
2017-08-14 00:33:06 +00:00
|
|
|
documents: [Document]
|
2017-08-07 01:05:10 +00:00
|
|
|
}
|
|
|
|
|
2017-09-25 03:22:33 +00:00
|
|
|
type Translation {
|
|
|
|
key: String!
|
|
|
|
value: String!
|
|
|
|
}
|
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
# A User
|
2017-08-07 01:05:10 +00:00
|
|
|
type User implements Base {
|
|
|
|
id: Int!
|
2017-08-13 18:39:07 +00:00
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-08-07 01:05:10 +00:00
|
|
|
email: String!
|
2017-08-09 02:36:29 +00:00
|
|
|
provider: String!
|
2017-08-07 01:05:10 +00:00
|
|
|
providerId: String
|
|
|
|
name: String
|
|
|
|
role: UserRole!
|
|
|
|
groups: [Group]
|
|
|
|
}
|
|
|
|
|
2017-08-19 01:21:29 +00:00
|
|
|
type OperationResult {
|
2018-01-10 01:41:53 +00:00
|
|
|
succeeded: Boolean!
|
2017-08-19 01:21:29 +00:00
|
|
|
message: String
|
2018-01-10 01:41:53 +00:00
|
|
|
data: String
|
|
|
|
}
|
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
# Query (Read)
|
2017-08-07 01:05:10 +00:00
|
|
|
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]
|
2017-09-30 02:32:43 +00:00
|
|
|
search(q: String, tags: [String]): [SearchResult]
|
2017-08-07 01:05:10 +00:00
|
|
|
settings(key: String): [Setting]
|
|
|
|
tags(key: String): [Tag]
|
2017-09-25 03:22:33 +00:00
|
|
|
translations(locale: String!, namespace: String!): [Translation]
|
2017-08-07 01:05:10 +00:00
|
|
|
users(id: Int, email: String, provider: String, providerId: String, role: UserRole): [User]
|
|
|
|
}
|
2017-08-09 02:36:29 +00:00
|
|
|
|
|
|
|
# Mutations (Create, Update, Delete)
|
|
|
|
type Mutation {
|
2017-08-20 02:51:25 +00:00
|
|
|
addRightToGroup(
|
|
|
|
groupId: Int!
|
|
|
|
path: String!
|
|
|
|
role: RightRole!
|
|
|
|
exact: Boolean!
|
|
|
|
allow: Boolean!
|
|
|
|
): Right
|
|
|
|
|
2017-08-14 00:33:06 +00:00
|
|
|
assignTagToDocument(
|
|
|
|
tagId: Int!
|
|
|
|
documentId: Int!
|
2017-08-19 01:21:29 +00:00
|
|
|
): OperationResult
|
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
assignUserToGroup(
|
|
|
|
userId: Int!
|
|
|
|
groupId: Int!
|
2017-08-19 01:21:29 +00:00
|
|
|
): OperationResult
|
|
|
|
|
2017-08-20 02:51:25 +00:00
|
|
|
createComment(
|
|
|
|
userId: Int!
|
|
|
|
documentId: Int!
|
|
|
|
content: String!
|
|
|
|
): Comment
|
|
|
|
|
2017-08-19 01:21:29 +00:00
|
|
|
createDocument(
|
|
|
|
path: String!
|
|
|
|
title: String!
|
|
|
|
subtitle: String
|
|
|
|
): Document
|
|
|
|
|
2017-08-14 00:33:06 +00:00
|
|
|
createFolder(
|
|
|
|
name: String!
|
|
|
|
): Folder
|
2017-08-19 01:21:29 +00:00
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
createGroup(
|
|
|
|
name: String!
|
|
|
|
): Group
|
2017-08-19 01:21:29 +00:00
|
|
|
|
2017-08-14 00:33:06 +00:00
|
|
|
createTag(
|
|
|
|
name: String!
|
|
|
|
): Tag
|
2017-08-19 01:21:29 +00:00
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
createUser(
|
|
|
|
email: String!
|
|
|
|
name: String
|
2017-08-19 01:21:29 +00:00
|
|
|
passwordRaw: String
|
2017-08-09 02:36:29 +00:00
|
|
|
provider: String!
|
|
|
|
providerId: String
|
|
|
|
role: UserRole!
|
|
|
|
): User
|
2017-08-19 01:21:29 +00:00
|
|
|
|
2017-08-20 02:51:25 +00:00
|
|
|
deleteComment(
|
|
|
|
id: Int!
|
|
|
|
): OperationResult
|
|
|
|
|
2017-08-19 01:21:29 +00:00
|
|
|
deleteDocument(
|
|
|
|
id: Int!
|
|
|
|
): OperationResult
|
|
|
|
|
2017-09-04 17:03:15 +00:00
|
|
|
deleteFile(
|
|
|
|
id: Int!
|
|
|
|
): OperationResult
|
|
|
|
|
2017-08-14 00:33:06 +00:00
|
|
|
deleteFolder(
|
|
|
|
id: Int!
|
2017-08-19 01:21:29 +00:00
|
|
|
): OperationResult
|
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
deleteGroup(
|
|
|
|
id: Int!
|
2017-08-19 01:21:29 +00:00
|
|
|
): OperationResult
|
|
|
|
|
2017-08-14 00:33:06 +00:00
|
|
|
deleteTag(
|
|
|
|
id: Int!
|
2017-08-19 01:21:29 +00:00
|
|
|
): OperationResult
|
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
deleteUser(
|
|
|
|
id: Int!
|
2017-08-19 01:21:29 +00:00
|
|
|
): OperationResult
|
|
|
|
|
2017-08-20 02:51:25 +00:00
|
|
|
modifyComment(
|
|
|
|
id: Int!
|
|
|
|
content: String!
|
|
|
|
): Document
|
|
|
|
|
2017-08-19 01:21:29 +00:00
|
|
|
modifyDocument(
|
|
|
|
id: Int!
|
|
|
|
title: String
|
|
|
|
subtitle: String
|
|
|
|
): Document
|
|
|
|
|
|
|
|
modifyUser(
|
|
|
|
id: Int!
|
|
|
|
email: String
|
|
|
|
name: String
|
|
|
|
provider: String
|
|
|
|
providerId: String
|
|
|
|
role: UserRole
|
|
|
|
): User
|
|
|
|
|
2017-08-20 02:51:25 +00:00
|
|
|
modifyRight(
|
|
|
|
id: Int!
|
|
|
|
path: String
|
|
|
|
role: RightRole
|
|
|
|
exact: Boolean
|
|
|
|
allow: Boolean
|
|
|
|
): Right
|
|
|
|
|
2017-08-19 01:21:29 +00:00
|
|
|
moveDocument(
|
|
|
|
id: Int!
|
|
|
|
path: String!
|
|
|
|
): OperationResult
|
|
|
|
|
2017-09-04 17:03:15 +00:00
|
|
|
moveFile(
|
|
|
|
id: Int!
|
|
|
|
folderId: Int!
|
|
|
|
): OperationResult
|
|
|
|
|
|
|
|
renameFile(
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
): OperationResult
|
|
|
|
|
2017-08-19 01:21:29 +00:00
|
|
|
renameFolder(
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
): OperationResult
|
|
|
|
|
|
|
|
renameGroup(
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
): OperationResult
|
|
|
|
|
|
|
|
renameTag(
|
|
|
|
id: Int!
|
2017-08-20 02:51:25 +00:00
|
|
|
key: String!
|
2017-08-19 01:21:29 +00:00
|
|
|
): OperationResult
|
|
|
|
|
2017-08-14 00:33:06 +00:00
|
|
|
removeTagFromDocument(
|
|
|
|
tagId: Int!
|
|
|
|
documentId: Int!
|
2017-08-19 01:21:29 +00:00
|
|
|
): OperationResult
|
|
|
|
|
2017-08-20 02:51:25 +00:00
|
|
|
removeRightFromGroup(
|
|
|
|
rightId: Int!
|
|
|
|
): OperationResult
|
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
removeUserFromGroup(
|
|
|
|
userId: Int!
|
|
|
|
groupId: Int!
|
2017-08-19 01:21:29 +00:00
|
|
|
): OperationResult
|
|
|
|
|
|
|
|
resetUserPassword(
|
|
|
|
id: Int!
|
|
|
|
): OperationResult
|
|
|
|
|
2017-08-20 02:51:25 +00:00
|
|
|
setConfigEntry(
|
|
|
|
key: String!
|
|
|
|
value: String!
|
|
|
|
): OperationResult
|
|
|
|
|
2017-08-19 01:21:29 +00:00
|
|
|
setUserPassword(
|
|
|
|
id: Int!
|
|
|
|
passwordRaw: String!
|
|
|
|
): OperationResult
|
2017-09-04 17:03:15 +00:00
|
|
|
|
|
|
|
uploadFile(
|
|
|
|
category: FileType!
|
|
|
|
filename: String!
|
|
|
|
): File
|
2017-08-09 02:36:29 +00:00
|
|
|
}
|