@capriza/connector-controller
Advanced tools
Comparing version 1.0.49 to 1.0.50
{ | ||
"name": "@capriza/connector-controller", | ||
"version": "1.0.49", | ||
"version": "1.0.50", | ||
"description": "Capriza connectors controller", | ||
@@ -31,7 +31,7 @@ "main": "index.js", | ||
"chai-as-promised": "^7.1.1", | ||
"fs-extra": "^4.0.3", | ||
"mocha": "^4.0.1", | ||
"mock-require": "^2.0.2", | ||
"opn": "^5.1.0" | ||
"opn": "^5.1.0", | ||
"chokidar": "1.7.0" | ||
} | ||
} |
@@ -1,15 +0,26 @@ | ||
var fse = require ("fs-extra"); | ||
var argv = require('minimist')(process.argv.slice(2)); | ||
var log = msg => console.log(`[Business-Logic-Tester] ${msg}`); | ||
const chokidar = require('chokidar'); | ||
const server = require("./server.js"); | ||
//var blPath = `../../../business-logic/${argv.bl}`; | ||
//fse.copySync(`${blPath}/resources.json`, "../../resources.json"); | ||
var bl = require (`${process.cwd()}`); | ||
function init() { | ||
var bl = require (`${process.cwd()}`); | ||
server.registerActions(bl); | ||
server.initBL(); | ||
try{ | ||
var schema = require (`${process.cwd()}/resources/schema.json`); | ||
server.registerSchema(schema); | ||
} catch(ex) { } | ||
var server = require("./server.js"); | ||
server.registerActions(bl); | ||
server.initBL(); | ||
try{ | ||
var schema = require (`${process.cwd()}/resources/schema.json`); | ||
server.registerSchema(schema); | ||
} catch(ex) { } | ||
} | ||
init(); | ||
console.log(`Start watching files`); | ||
const watcher = chokidar.watch(`${process.cwd()}/**`, { | ||
ignoreInitial: true, | ||
}); | ||
watcher.on('change', (event, filename) => { | ||
console.log(`File ${filename} reloading connector`); | ||
Object.keys(require.cache).forEach(key=>delete require.cache[key]); | ||
init(); | ||
}); |
@@ -280,4 +280,8 @@ var validate = require('@capriza/schemas').validate; | ||
async initBL(){ | ||
config = require ("../../lib/config").getConfiguration({logger}); | ||
template = config.controllerConfig.schemaTransformer; | ||
jslt = new (require ("@capriza/jslt"))(template); | ||
jslt.setTemplate(template); | ||
await bl.init({config: config.blConfig, logger}); | ||
} | ||
}; |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
131026
1516
25