meta-database
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -112,3 +112,5 @@ "use strict"; | ||
}).then(function (result) { | ||
return result.recordset; | ||
return result.recordset.map(function (result) { | ||
return JSON.parse(result.json); | ||
}); | ||
}); | ||
@@ -115,0 +117,0 @@ } |
@@ -76,11 +76,15 @@ "use strict"; | ||
value: function addPane(pane) { | ||
var _pane$edm = pane.edm, | ||
name = _pane$edm.name, | ||
version = _pane$edm.version; | ||
var router = new _GlassExpressDataRouter2.default(this.dataApp, pane); | ||
this.entityRouters[edm.name + edm.version] = router; | ||
this.entityRouters[name + version] = router; | ||
router.attach(); | ||
var edmRouter = new GlassExpressEdmRouter(this.edmApp, pane); | ||
this.edmRouters[edm.name + edm.version] = edmRouter; | ||
this.edmRouters[name + ersion] = edmRouter; | ||
edmRouter.attach(); | ||
this.panes[pane.edm.name + pane.edm.version] = pane; | ||
this.panes[name + version] = pane; | ||
} | ||
@@ -90,5 +94,5 @@ }, { | ||
value: function removePane(pane) { | ||
var _pane$edm = pane.edm, | ||
name = _pane$edm.name, | ||
version = _pane$edm.version; | ||
var _pane$edm2 = pane.edm, | ||
name = _pane$edm2.name, | ||
version = _pane$edm2.version; | ||
@@ -116,16 +120,18 @@ var myPane = this.panes[name + version]; | ||
name = _req$body.name, | ||
version = _req$body.version; | ||
version = _req$body.version, | ||
label = _req$body.label; | ||
if (!name || !version) { | ||
res.status(500).send("Name and version required"); | ||
} else { | ||
_this2.glass.getEdmAsync(name, version, label).then(function (edm) { | ||
if (edm) { | ||
res.status(500).send("EDM with that name and version already exists"); | ||
} else { | ||
_this2.glass.addEdmAsync(name, version).then(function () { | ||
res.status(200).end(); | ||
}); | ||
} | ||
}); | ||
} | ||
_this2.glass.getEdmAsync(name, version).then(function (edm) { | ||
if (edm) { | ||
res.status(500).send("EDM with that name and version already exists"); | ||
} else { | ||
_this2.glass.addEdmAsync(name, version).then(function () { | ||
res.status(200).end(); | ||
}); | ||
} | ||
}); | ||
}); | ||
@@ -132,0 +138,0 @@ |
{ | ||
"name": "meta-database", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "Decorate data types with functionality.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -83,3 +83,5 @@ // SqlServerDriver.js | ||
}).then((result) => { | ||
return result.recordset; | ||
return result.recordset.map((result) => { | ||
return JSON.parse(result.json); | ||
}); | ||
}); | ||
@@ -86,0 +88,0 @@ } |
@@ -46,11 +46,12 @@ // GlassExpress | ||
addPane(pane) { | ||
let {name, version} = pane.edm; | ||
let router = new DataRouter(this.dataApp, pane); | ||
this.entityRouters[edm.name + edm.version] = router; | ||
this.entityRouters[name + version] = router; | ||
router.attach(); | ||
let edmRouter = new GlassExpressEdmRouter(this.edmApp, pane); | ||
this.edmRouters[edm.name + edm.version] = edmRouter; | ||
this.edmRouters[name + ersion] = edmRouter; | ||
edmRouter.attach(); | ||
this.panes[pane.edm.name + pane.edm.version] = pane; | ||
this.panes[name + version] = pane; | ||
} | ||
@@ -77,15 +78,16 @@ | ||
this.edmApp.post("/", (req, res, next) => { | ||
let {name, version} = req.body; | ||
let {name, version, label} = req.body; | ||
if(!name || !version) { | ||
res.status(500).send("Name and version required"); | ||
} else { | ||
this.glass.getEdmAsync(name, version, label).then((edm) => { | ||
if (edm) { | ||
res.status(500).send("EDM with that name and version already exists"); | ||
} else { | ||
this.glass.addEdmAsync(name, version).then(()=> { | ||
res.status(200).end(); | ||
}); | ||
} | ||
}); | ||
} | ||
this.glass.getEdmAsync(name, version).then((edm) => { | ||
if (edm) { | ||
res.status(500).send("EDM with that name and version already exists"); | ||
} else { | ||
this.glass.addEdmAsync(name, version).then(()=> { | ||
res.status(200).end(); | ||
}); | ||
} | ||
}); | ||
}); | ||
@@ -92,0 +94,0 @@ |
@@ -77,2 +77,2 @@ import assert from "assert"; | ||
}); | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27
6781025
240
67152