Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getDocTemplates = async(userName) => {
let user = getUser(userName);
let docsAPI = new DocumentsAPI(new InfluxDB({url: __config.influx_url, token: user.token, timeout: 20000, }));
return await docsAPI.getDocumentsTemplates({orgID: user.orgid});
};
const createTemplateFromFile = async(userName, filepath) => {
let user = getUser(userName);
let docsAPI = new DocumentsAPI(new InfluxDB({url: __config.influx_url, token: user.token, timeout: 20000}));
let content = await readFileToBuffer(process.cwd() + '/' + filepath);
let newTemplate = JSON.parse(content);
newTemplate.orgID = user.orgid;
docsAPI.postDocumentsTemplates({ body: newTemplate});
};