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.
80 lines
1.5 KiB
80 lines
1.5 KiB
# ===============================================
|
|
# ASSETS
|
|
# ===============================================
|
|
|
|
extend type Query {
|
|
assets: AssetQuery
|
|
}
|
|
|
|
extend type Mutation {
|
|
assets: AssetMutation
|
|
}
|
|
|
|
# -----------------------------------------------
|
|
# QUERIES
|
|
# -----------------------------------------------
|
|
|
|
type AssetQuery {
|
|
list(
|
|
folderId: Int!
|
|
kind: AssetKind!
|
|
): [AssetItem] @auth(requires: ["manage:system", "read:assets"])
|
|
|
|
folders(
|
|
parentFolderId: Int!
|
|
): [AssetFolder] @auth(requires: ["manage:system", "read:assets"])
|
|
}
|
|
|
|
# -----------------------------------------------
|
|
# MUTATIONS
|
|
# -----------------------------------------------
|
|
|
|
type AssetMutation {
|
|
createFolder(
|
|
parentFolderId: Int!
|
|
slug: String!
|
|
name: String
|
|
): DefaultResponse @auth(requires: ["manage:system", "write:assets"])
|
|
|
|
renameAsset(
|
|
id: Int!
|
|
filename: String!
|
|
): DefaultResponse @auth(requires: ["manage:system", "manage:assets"])
|
|
|
|
deleteAsset(
|
|
id: Int!
|
|
): DefaultResponse @auth(requires: ["manage:system", "manage:assets"])
|
|
|
|
flushTempUploads: DefaultResponse @auth(requires: ["manage:system"])
|
|
}
|
|
|
|
# -----------------------------------------------
|
|
# TYPES
|
|
# -----------------------------------------------
|
|
|
|
type AssetItem {
|
|
id: Int!
|
|
filename: String!
|
|
ext: String!
|
|
kind: AssetKind!
|
|
mime: String!
|
|
fileSize: Int!
|
|
metadata: String
|
|
createdAt: Date!
|
|
updatedAt: Date!
|
|
folder: AssetFolder
|
|
author: User
|
|
}
|
|
|
|
type AssetFolder {
|
|
id: Int!
|
|
slug: String!
|
|
name: String
|
|
}
|
|
|
|
enum AssetKind {
|
|
IMAGE
|
|
BINARY
|
|
ALL
|
|
}
|