19 lines
763 B
JavaScript
19 lines
763 B
JavaScript
const { parseAsync } = require('json2csv')
|
|
|
|
const logs = require('../../../logs')
|
|
const serverLogs = require('../../modules/server-logs')
|
|
|
|
const resolvers = {
|
|
Query: {
|
|
machineLogs: (...[, { deviceId, from, until, limit, offset }]) =>
|
|
logs.simpleGetMachineLogs(deviceId, from, until, limit, offset),
|
|
machineLogsCsv: (...[, { deviceId, from, until, limit, offset }]) =>
|
|
logs.simpleGetMachineLogs(deviceId, from, until, limit, offset).then(parseAsync),
|
|
serverLogs: (...[, { from, until, limit, offset }]) =>
|
|
serverLogs.getServerLogs(from, until, limit, offset),
|
|
serverLogsCsv: (...[, { from, until, limit, offset }]) =>
|
|
serverLogs.getServerLogs(from, until, limit, offset).then(parseAsync)
|
|
}
|
|
}
|
|
|
|
module.exports = resolvers
|