v12.0.0 - initial commit
This commit is contained in:
commit
e2c49ea43c
1145 changed files with 97211 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
const { parseAsync } = require('json2csv')
|
||||
|
||||
const logs = require('../../../logs')
|
||||
const serverLogs = require('../../services/server-logs')
|
||||
|
||||
const resolvers = {
|
||||
Query: {
|
||||
machineLogs: (...[, { deviceId, from, until, limit, offset }]) =>
|
||||
logs.simpleGetMachineLogs(deviceId, from, until, limit, offset),
|
||||
machineLogsCsv: (
|
||||
...[, { deviceId, from, until, limit, offset, timezone }]
|
||||
) =>
|
||||
logs
|
||||
.simpleGetMachineLogs(deviceId, from, until, limit, offset)
|
||||
.then(res =>
|
||||
parseAsync(logs.logDateFormat(timezone, res, ['timestamp'])),
|
||||
),
|
||||
serverLogs: (...[, { from, until, limit, offset }]) =>
|
||||
serverLogs.getServerLogs(from, until, limit, offset),
|
||||
serverLogsCsv: (...[, { from, until, limit, offset, timezone }]) =>
|
||||
serverLogs
|
||||
.getServerLogs(from, until, limit, offset)
|
||||
.then(res =>
|
||||
parseAsync(logs.logDateFormat(timezone, res, ['timestamp'])),
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = resolvers
|
||||
Loading…
Add table
Add a link
Reference in a new issue