List, export, recommendations done
This commit is contained in:
24
.idea/codeStyles/Project.xml
generated
24
.idea/codeStyles/Project.xml
generated
@@ -1,5 +1,29 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<code_scheme name="Project" version="173">
|
<code_scheme name="Project" version="173">
|
||||||
|
<DBN-PSQL>
|
||||||
|
<case-options enabled="false">
|
||||||
|
<option name="KEYWORD_CASE" value="lower" />
|
||||||
|
<option name="FUNCTION_CASE" value="lower" />
|
||||||
|
<option name="PARAMETER_CASE" value="lower" />
|
||||||
|
<option name="DATATYPE_CASE" value="lower" />
|
||||||
|
<option name="OBJECT_CASE" value="preserve" />
|
||||||
|
</case-options>
|
||||||
|
<formatting-settings enabled="false" />
|
||||||
|
</DBN-PSQL>
|
||||||
|
<DBN-SQL>
|
||||||
|
<case-options enabled="false">
|
||||||
|
<option name="KEYWORD_CASE" value="lower" />
|
||||||
|
<option name="FUNCTION_CASE" value="lower" />
|
||||||
|
<option name="PARAMETER_CASE" value="lower" />
|
||||||
|
<option name="DATATYPE_CASE" value="lower" />
|
||||||
|
<option name="OBJECT_CASE" value="preserve" />
|
||||||
|
</case-options>
|
||||||
|
<formatting-settings enabled="false">
|
||||||
|
<option name="STATEMENT_SPACING" value="one_line" />
|
||||||
|
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
|
||||||
|
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
|
||||||
|
</formatting-settings>
|
||||||
|
</DBN-SQL>
|
||||||
<DBN-PSQL>
|
<DBN-PSQL>
|
||||||
<case-options enabled="false">
|
<case-options enabled="false">
|
||||||
<option name="KEYWORD_CASE" value="lower" />
|
<option name="KEYWORD_CASE" value="lower" />
|
||||||
|
|||||||
3
.idea/jsLibraryMappings.xml
generated
3
.idea/jsLibraryMappings.xml
generated
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="JavaScriptLibraryMappings">
|
<component name="JavaScriptLibraryMappings">
|
||||||
<file url="PROJECT" libraries="{tf}" />
|
<file url="PROJECT" libraries="{Chart, tf}" />
|
||||||
<includedPredefinedLibrary name="Node.js Core" />
|
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
1
.idea/kuerbiskern.iml
generated
1
.idea/kuerbiskern.iml
generated
@@ -10,5 +10,6 @@
|
|||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="tf" level="application" />
|
<orderEntry type="library" name="tf" level="application" />
|
||||||
|
<orderEntry type="library" name="Chart" level="application" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
8
app.js
8
app.js
@@ -9,9 +9,10 @@ var logger = require("morgan");
|
|||||||
var path = require("path");
|
var path = require("path");
|
||||||
var read = require("read-file");
|
var read = require("read-file");
|
||||||
var uuidv4 = require("uuid/v4");
|
var uuidv4 = require("uuid/v4");
|
||||||
|
var exportRouter = require("./routes/export");
|
||||||
var indexRouter = require("./routes/index");
|
var indexRouter = require("./routes/index");
|
||||||
|
var recommendsRouter = require("./routes/recommends");
|
||||||
var updateRouter = require("./routes/update");
|
var updateRouter = require("./routes/update");
|
||||||
var usersRouter = require("./routes/users");
|
|
||||||
var app = express();
|
var app = express();
|
||||||
var adapter = new FileSync("db.json");
|
var adapter = new FileSync("db.json");
|
||||||
var db = low(adapter);
|
var db = low(adapter);
|
||||||
@@ -53,7 +54,7 @@ app.use(function (req, res, next) {
|
|||||||
db.get("users")
|
db.get("users")
|
||||||
.push({ id: id, age: -1, sex: "na", cocktails: [], lastused: Date.now() })
|
.push({ id: id, age: -1, sex: "na", cocktails: [], lastused: Date.now() })
|
||||||
.write();
|
.write();
|
||||||
res.cookie("uid", id, { maxAge: 21474836470000, httpOnly: true });
|
res.cookie("uid", id, { maxAge: 21474836470000 /*, httpOnly: true*/ });
|
||||||
if (!req.cookies) {
|
if (!req.cookies) {
|
||||||
req.cookies = {};
|
req.cookies = {};
|
||||||
}
|
}
|
||||||
@@ -69,8 +70,9 @@ app.use(function (req, res, next) {
|
|||||||
});
|
});
|
||||||
app.use(express.static(path.join(__dirname, "public")));
|
app.use(express.static(path.join(__dirname, "public")));
|
||||||
app.use("/", indexRouter);
|
app.use("/", indexRouter);
|
||||||
app.use("/users", usersRouter);
|
app.use("/export", exportRouter);
|
||||||
app.use("/update", updateRouter);
|
app.use("/update", updateRouter);
|
||||||
|
app.use("/recommends", recommendsRouter);
|
||||||
// catch 404 and forward to error handler
|
// catch 404 and forward to error handler
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
next(createError(404));
|
next(createError(404));
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":";;AAAA,4CAA8C;AAC9C,iCAAmC;AACnC,yCAA2C;AAC3C,2BAA6B;AAC7B,kDAAoD;AACpD,+BAAiC;AACjC,2BAA6B;AAC7B,gCAAkC;AAClC,gCAAkC;AAElC,4CAA8C;AAC9C,8CAAgD;AAChD,4CAA8C;AAE9C,IAAM,GAAG,GAAG,OAAO,EAAE,CAAC;AACtB,IAAM,OAAO,GAAG,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAA;AACvC,IAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;AACxB,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;AACZ,EAAE,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,EAAE,EAAC,CAAC;KACrB,KAAK,EAAE,CAAC;AAKX,GAAG,CAAC,SAAS,GAAG,EAAE,CAAC;AAEnB,IAAI,CAAC,iBAAiB,EAAE,MAAM,EAAE,UAAC,GAAG,EAAE,MA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AC;AACT,CAAC,CAAC,CAAC;AACH,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AAExD,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;AAC1B,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACjC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACjC,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AAEzC,yCAAyC;AACzC,GAAG,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,GAAG,EAAE,IAAI;IACrB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,gBAAgB;AAChB,GAAG,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI;IAC1B,kDAAkD;IAClD,GAAG,CAAC,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;IACjC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnE,wBAAwB;IACxB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC;IAC9B,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC"}
|
||||||
16
app.ts
16
app.ts
@@ -8,21 +8,22 @@ import * as path from "path";
|
|||||||
import * as read from "read-file";
|
import * as read from "read-file";
|
||||||
import * as uuidv4 from "uuid/v4";
|
import * as uuidv4 from "uuid/v4";
|
||||||
|
|
||||||
|
import * as exportRouter from "./routes/export";
|
||||||
import * as indexRouter from "./routes/index";
|
import * as indexRouter from "./routes/index";
|
||||||
|
import * as recommendsRouter from "./routes/recommends";
|
||||||
import * as updateRouter from "./routes/update";
|
import * as updateRouter from "./routes/update";
|
||||||
import * as usersRouter from "./routes/users";
|
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const adapter = new FileSync("db.json")
|
const adapter = new FileSync("db.json")
|
||||||
const db = low(adapter);
|
const db = low(adapter);
|
||||||
app.db = db;
|
(app as any).db = db;
|
||||||
db.defaults({users: []})
|
db.defaults({users: []})
|
||||||
.write();
|
.write();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app.cocktails = [];
|
(app as any).cocktails = [];
|
||||||
|
|
||||||
read("data/output.csv", "utf8", (err, buffer) => {
|
read("data/output.csv", "utf8", (err, buffer) => {
|
||||||
// console.log(buffer);
|
// console.log(buffer);
|
||||||
@@ -41,8 +42,8 @@ read("data/output.csv", "utf8", (err, buffer) => {
|
|||||||
return line;
|
return line;
|
||||||
});
|
});
|
||||||
result = result.filter((f) => !!f);
|
result = result.filter((f) => !!f);
|
||||||
app.cocktails = result;
|
(app as any).cocktails = result;
|
||||||
app.cocktailList = cocktailList;
|
(app as any).cocktailList = cocktailList;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +64,7 @@ app.use((req, res, next) => {
|
|||||||
db.get("users")
|
db.get("users")
|
||||||
.push({id, age: -1, sex: "na", cocktails: [], lastused: Date.now()})
|
.push({id, age: -1, sex: "na", cocktails: [], lastused: Date.now()})
|
||||||
.write();
|
.write();
|
||||||
res.cookie("uid", id, { maxAge: 21474836470000, httpOnly: true });
|
res.cookie("uid", id, { maxAge: 21474836470000/*, httpOnly: true*/ });
|
||||||
if (!req.cookies) {
|
if (!req.cookies) {
|
||||||
req.cookies = {};
|
req.cookies = {};
|
||||||
}
|
}
|
||||||
@@ -79,8 +80,9 @@ app.use((req, res, next) => {
|
|||||||
app.use(express.static(path.join(__dirname, "public")));
|
app.use(express.static(path.join(__dirname, "public")));
|
||||||
|
|
||||||
app.use("/", indexRouter);
|
app.use("/", indexRouter);
|
||||||
app.use("/users", usersRouter);
|
app.use("/export", exportRouter);
|
||||||
app.use("/update", updateRouter);
|
app.use("/update", updateRouter);
|
||||||
|
app.use("/recommends", recommendsRouter);
|
||||||
|
|
||||||
// catch 404 and forward to error handler
|
// catch 404 and forward to error handler
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
|
|||||||
57
db.json
57
db.json
@@ -1,12 +1,5 @@
|
|||||||
{
|
{
|
||||||
"users": [
|
"users": [
|
||||||
{
|
|
||||||
"id": "262d02e6-ee1f-4321-b119-24c7796cf2e0",
|
|
||||||
"age": 20,
|
|
||||||
"sex": "m",
|
|
||||||
"cocktails": [],
|
|
||||||
"lastused": 1547169564875
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "fcd183e6-90cf-4f9c-b6d1-1546882d0b1b",
|
"id": "fcd183e6-90cf-4f9c-b6d1-1546882d0b1b",
|
||||||
"age": 22,
|
"age": 22,
|
||||||
@@ -55,9 +48,57 @@
|
|||||||
{
|
{
|
||||||
"level": 5,
|
"level": 5,
|
||||||
"cocktail": "Kitzler"
|
"cocktail": "Kitzler"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 4,
|
||||||
|
"cocktail": "Sex in the Snow"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 2,
|
||||||
|
"cocktail": "Ireen Sonne"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 6,
|
||||||
|
"cocktail": "Caipiroschka"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 3,
|
||||||
|
"cocktail": "Bine"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 5,
|
||||||
|
"cocktail": "Melody"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 5,
|
||||||
|
"cocktail": "Sexy Lina"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 6,
|
||||||
|
"cocktail": "Orgasmus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 3,
|
||||||
|
"cocktail": "Ich überlege noch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 4,
|
||||||
|
"cocktail": "Swimming Pool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 2,
|
||||||
|
"cocktail": "Ich guck noch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 7,
|
||||||
|
"cocktail": "Vanilla Sky"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": 4,
|
||||||
|
"cocktail": "Simone"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lastused": 1547221929512
|
"lastused": 1547290476929
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
492
package-lock.json
generated
492
package-lock.json
generated
@@ -356,8 +356,7 @@
|
|||||||
"builtin-modules": {
|
"builtin-modules": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
|
||||||
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
|
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"bytes": {
|
"bytes": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
@@ -369,6 +368,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
|
||||||
"integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk="
|
"integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk="
|
||||||
},
|
},
|
||||||
|
"can-promise": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/can-promise/-/can-promise-0.0.1.tgz",
|
||||||
|
"integrity": "sha512-gzVrHyyrvgt0YpDm7pn04MQt8gjh0ZAhN4ZDyCRtGl6YnuuK6b4aiUTD7G52r9l4YNmxfTtEscb92vxtAlL6XQ==",
|
||||||
|
"requires": {
|
||||||
|
"window-or-global": "^1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"caseless": {
|
"caseless": {
|
||||||
"version": "0.12.0",
|
"version": "0.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
|
||||||
@@ -542,6 +549,16 @@
|
|||||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
|
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
|
||||||
},
|
},
|
||||||
|
"cross-spawn": {
|
||||||
|
"version": "5.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
|
||||||
|
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
|
||||||
|
"requires": {
|
||||||
|
"lru-cache": "^4.0.1",
|
||||||
|
"shebang-command": "^1.2.0",
|
||||||
|
"which": "^1.2.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
"dashdash": {
|
"dashdash": {
|
||||||
"version": "1.14.1",
|
"version": "1.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
|
||||||
@@ -599,6 +616,11 @@
|
|||||||
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"dijkstrajs": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs="
|
||||||
|
},
|
||||||
"doctypes": {
|
"doctypes": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz",
|
||||||
@@ -623,6 +645,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
||||||
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
||||||
},
|
},
|
||||||
|
"error-ex": {
|
||||||
|
"version": "1.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
|
||||||
|
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
|
||||||
|
"requires": {
|
||||||
|
"is-arrayish": "^0.2.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"escape-html": {
|
"escape-html": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||||
@@ -650,6 +680,20 @@
|
|||||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||||
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
|
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
|
||||||
},
|
},
|
||||||
|
"execa": {
|
||||||
|
"version": "0.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
|
||||||
|
"integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
|
||||||
|
"requires": {
|
||||||
|
"cross-spawn": "^5.0.1",
|
||||||
|
"get-stream": "^3.0.0",
|
||||||
|
"is-stream": "^1.1.0",
|
||||||
|
"npm-run-path": "^2.0.0",
|
||||||
|
"p-finally": "^1.0.0",
|
||||||
|
"signal-exit": "^3.0.0",
|
||||||
|
"strip-eof": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"express": {
|
"express": {
|
||||||
"version": "4.16.4",
|
"version": "4.16.4",
|
||||||
"resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz",
|
"resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz",
|
||||||
@@ -721,6 +765,14 @@
|
|||||||
"unpipe": "~1.0.0"
|
"unpipe": "~1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"find-up": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
|
||||||
|
"requires": {
|
||||||
|
"locate-path": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"forever-agent": {
|
"forever-agent": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
|
||||||
@@ -779,6 +831,16 @@
|
|||||||
"wide-align": "^1.1.0"
|
"wide-align": "^1.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"get-caller-file": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
|
||||||
|
},
|
||||||
|
"get-stream": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
|
||||||
|
},
|
||||||
"getpass": {
|
"getpass": {
|
||||||
"version": "0.1.7",
|
"version": "0.1.7",
|
||||||
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
|
||||||
@@ -852,6 +914,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||||
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
|
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
|
||||||
},
|
},
|
||||||
|
"hosted-git-info": {
|
||||||
|
"version": "2.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
|
||||||
|
"integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w=="
|
||||||
|
},
|
||||||
"http-errors": {
|
"http-errors": {
|
||||||
"version": "1.6.3",
|
"version": "1.6.3",
|
||||||
"resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
|
"resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
|
||||||
@@ -908,16 +975,34 @@
|
|||||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
||||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
|
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
|
||||||
},
|
},
|
||||||
|
"invert-kv": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
|
||||||
|
},
|
||||||
"ipaddr.js": {
|
"ipaddr.js": {
|
||||||
"version": "1.8.0",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
|
||||||
"integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4="
|
"integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4="
|
||||||
},
|
},
|
||||||
|
"is-arrayish": {
|
||||||
|
"version": "0.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
|
||||||
|
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0="
|
||||||
|
},
|
||||||
"is-buffer": {
|
"is-buffer": {
|
||||||
"version": "1.1.6",
|
"version": "1.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
|
||||||
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
|
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
|
||||||
},
|
},
|
||||||
|
"is-builtin-module": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
|
||||||
|
"requires": {
|
||||||
|
"builtin-modules": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"is-expression": {
|
"is-expression": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz",
|
||||||
@@ -955,6 +1040,11 @@
|
|||||||
"has": "^1.0.1"
|
"has": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"is-stream": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
||||||
|
},
|
||||||
"is-typedarray": {
|
"is-typedarray": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||||
@@ -965,6 +1055,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||||
},
|
},
|
||||||
|
"isexe": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||||
|
},
|
||||||
"isstream": {
|
"isstream": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
|
||||||
@@ -1044,6 +1139,41 @@
|
|||||||
"resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
|
||||||
"integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4="
|
"integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4="
|
||||||
},
|
},
|
||||||
|
"lcid": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
|
||||||
|
"requires": {
|
||||||
|
"invert-kv": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"load-json-file": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "^4.1.2",
|
||||||
|
"parse-json": "^2.2.0",
|
||||||
|
"pify": "^2.0.0",
|
||||||
|
"strip-bom": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"pify": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||||
|
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"locate-path": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
|
||||||
|
"requires": {
|
||||||
|
"p-locate": "^2.0.0",
|
||||||
|
"path-exists": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"lodash": {
|
"lodash": {
|
||||||
"version": "4.17.11",
|
"version": "4.17.11",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
||||||
@@ -1066,11 +1196,35 @@
|
|||||||
"steno": "^0.4.1"
|
"steno": "^0.4.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"lru-cache": {
|
||||||
|
"version": "4.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
|
||||||
|
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
|
||||||
|
"requires": {
|
||||||
|
"pseudomap": "^1.0.2",
|
||||||
|
"yallist": "^2.1.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"yallist": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
||||||
|
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"media-typer": {
|
"media-typer": {
|
||||||
"version": "0.3.0",
|
"version": "0.3.0",
|
||||||
"resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
"resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||||
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
|
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
|
||||||
},
|
},
|
||||||
|
"mem": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=",
|
||||||
|
"requires": {
|
||||||
|
"mimic-fn": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"merge-descriptors": {
|
"merge-descriptors": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
||||||
@@ -1099,6 +1253,11 @@
|
|||||||
"mime-db": "~1.37.0"
|
"mime-db": "~1.37.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mimic-fn": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
|
||||||
|
},
|
||||||
"minimatch": {
|
"minimatch": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
@@ -1200,6 +1359,17 @@
|
|||||||
"osenv": "^0.1.4"
|
"osenv": "^0.1.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"normalize-package-data": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
|
||||||
|
"requires": {
|
||||||
|
"hosted-git-info": "^2.1.4",
|
||||||
|
"is-builtin-module": "^1.0.0",
|
||||||
|
"semver": "2 || 3 || 4 || 5",
|
||||||
|
"validate-npm-package-license": "^3.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"npm-bundled": {
|
"npm-bundled": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz",
|
||||||
@@ -1214,6 +1384,14 @@
|
|||||||
"npm-bundled": "^1.0.1"
|
"npm-bundled": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"npm-run-path": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
|
||||||
|
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
|
||||||
|
"requires": {
|
||||||
|
"path-key": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"npmlog": {
|
"npmlog": {
|
||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
|
||||||
@@ -1266,6 +1444,16 @@
|
|||||||
"resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
"resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||||
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
|
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
|
||||||
},
|
},
|
||||||
|
"os-locale": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==",
|
||||||
|
"requires": {
|
||||||
|
"execa": "^0.7.0",
|
||||||
|
"lcid": "^1.0.0",
|
||||||
|
"mem": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"os-tmpdir": {
|
"os-tmpdir": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
"resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||||
@@ -1280,16 +1468,60 @@
|
|||||||
"os-tmpdir": "^1.0.0"
|
"os-tmpdir": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"p-finally": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4="
|
||||||
|
},
|
||||||
|
"p-limit": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
|
||||||
|
"requires": {
|
||||||
|
"p-try": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"p-locate": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
|
||||||
|
"requires": {
|
||||||
|
"p-limit": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"p-try": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M="
|
||||||
|
},
|
||||||
|
"parse-json": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
|
||||||
|
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
|
||||||
|
"requires": {
|
||||||
|
"error-ex": "^1.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"parseurl": {
|
"parseurl": {
|
||||||
"version": "1.3.2",
|
"version": "1.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
|
||||||
"integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M="
|
"integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M="
|
||||||
},
|
},
|
||||||
|
"path-exists": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
|
||||||
|
},
|
||||||
"path-is-absolute": {
|
"path-is-absolute": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
"resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||||
},
|
},
|
||||||
|
"path-key": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||||
|
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
|
||||||
|
},
|
||||||
"path-parse": {
|
"path-parse": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
|
||||||
@@ -1300,6 +1532,21 @@
|
|||||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
||||||
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
|
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
|
||||||
},
|
},
|
||||||
|
"path-type": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
|
||||||
|
"requires": {
|
||||||
|
"pify": "^2.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"pify": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||||
|
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"performance-now": {
|
"performance-now": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
|
||||||
@@ -1310,6 +1557,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||||
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
|
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
|
||||||
},
|
},
|
||||||
|
"pngjs": {
|
||||||
|
"version": "3.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.3.3.tgz",
|
||||||
|
"integrity": "sha512-1n3Z4p3IOxArEs1VRXnZ/RXdfEniAUS9jb68g58FIXMNkPJeZd+Qh4Uq7/e0LVxAQGos1eIUrqrt4FpjdnEd+Q=="
|
||||||
|
},
|
||||||
"process-nextick-args": {
|
"process-nextick-args": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
||||||
@@ -1332,6 +1584,11 @@
|
|||||||
"ipaddr.js": "1.8.0"
|
"ipaddr.js": "1.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pseudomap": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
|
||||||
|
},
|
||||||
"psl": {
|
"psl": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.29",
|
||||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz",
|
||||||
@@ -1456,6 +1713,101 @@
|
|||||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
||||||
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
|
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
|
||||||
},
|
},
|
||||||
|
"qrcode": {
|
||||||
|
"version": "1.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.3.2.tgz",
|
||||||
|
"integrity": "sha512-sYo+Tf7nx14YZSNPqnyEWefVrjUEpM4/NxOrxOk+jcQ9NhM2LCNuzGmQctDhGTQdO2YJorKY55dypx+hvVo5jw==",
|
||||||
|
"requires": {
|
||||||
|
"can-promise": "0.0.1",
|
||||||
|
"dijkstrajs": "^1.0.1",
|
||||||
|
"isarray": "^2.0.1",
|
||||||
|
"pngjs": "^3.3.0",
|
||||||
|
"yargs": "^8.0.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
|
||||||
|
},
|
||||||
|
"camelcase": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
|
||||||
|
"integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0="
|
||||||
|
},
|
||||||
|
"cliui": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
|
||||||
|
"integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
|
||||||
|
"requires": {
|
||||||
|
"string-width": "^1.0.1",
|
||||||
|
"strip-ansi": "^3.0.1",
|
||||||
|
"wrap-ansi": "^2.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"string-width": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||||
|
"requires": {
|
||||||
|
"code-point-at": "^1.0.0",
|
||||||
|
"is-fullwidth-code-point": "^1.0.0",
|
||||||
|
"strip-ansi": "^3.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"isarray": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA=="
|
||||||
|
},
|
||||||
|
"string-width": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
|
||||||
|
"requires": {
|
||||||
|
"is-fullwidth-code-point": "^2.0.0",
|
||||||
|
"strip-ansi": "^4.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"is-fullwidth-code-point": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
|
||||||
|
},
|
||||||
|
"strip-ansi": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^3.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"yargs": {
|
||||||
|
"version": "8.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz",
|
||||||
|
"integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=",
|
||||||
|
"requires": {
|
||||||
|
"camelcase": "^4.1.0",
|
||||||
|
"cliui": "^3.2.0",
|
||||||
|
"decamelize": "^1.1.1",
|
||||||
|
"get-caller-file": "^1.0.1",
|
||||||
|
"os-locale": "^2.0.0",
|
||||||
|
"read-pkg-up": "^2.0.0",
|
||||||
|
"require-directory": "^2.1.1",
|
||||||
|
"require-main-filename": "^1.0.1",
|
||||||
|
"set-blocking": "^2.0.0",
|
||||||
|
"string-width": "^2.0.0",
|
||||||
|
"which-module": "^2.0.0",
|
||||||
|
"y18n": "^3.2.1",
|
||||||
|
"yargs-parser": "^7.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"qs": {
|
"qs": {
|
||||||
"version": "6.5.2",
|
"version": "6.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
||||||
@@ -1500,6 +1852,25 @@
|
|||||||
"resolved": "https://registry.npmjs.org/read-file/-/read-file-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/read-file/-/read-file-0.2.0.tgz",
|
||||||
"integrity": "sha1-cMa6+IQux9FUD5gf0Oau1Mgb1UU="
|
"integrity": "sha1-cMa6+IQux9FUD5gf0Oau1Mgb1UU="
|
||||||
},
|
},
|
||||||
|
"read-pkg": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
|
||||||
|
"requires": {
|
||||||
|
"load-json-file": "^2.0.0",
|
||||||
|
"normalize-package-data": "^2.3.2",
|
||||||
|
"path-type": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"read-pkg-up": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
|
||||||
|
"requires": {
|
||||||
|
"find-up": "^2.0.0",
|
||||||
|
"read-pkg": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"readable-stream": {
|
"readable-stream": {
|
||||||
"version": "2.3.6",
|
"version": "2.3.6",
|
||||||
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
||||||
@@ -1551,6 +1922,16 @@
|
|||||||
"uuid": "^3.3.2"
|
"uuid": "^3.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"require-directory": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||||
|
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
|
||||||
|
},
|
||||||
|
"require-main-filename": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
|
||||||
|
},
|
||||||
"resolve": {
|
"resolve": {
|
||||||
"version": "1.8.1",
|
"version": "1.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
|
||||||
@@ -1636,6 +2017,19 @@
|
|||||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
|
||||||
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ=="
|
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ=="
|
||||||
},
|
},
|
||||||
|
"shebang-command": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||||
|
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
|
||||||
|
"requires": {
|
||||||
|
"shebang-regex": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"shebang-regex": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
|
||||||
|
},
|
||||||
"signal-exit": {
|
"signal-exit": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||||
@@ -1667,6 +2061,34 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"spdx-correct": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==",
|
||||||
|
"requires": {
|
||||||
|
"spdx-expression-parse": "^3.0.0",
|
||||||
|
"spdx-license-ids": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spdx-exceptions": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA=="
|
||||||
|
},
|
||||||
|
"spdx-expression-parse": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
|
||||||
|
"requires": {
|
||||||
|
"spdx-exceptions": "^2.1.0",
|
||||||
|
"spdx-license-ids": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spdx-license-ids": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g=="
|
||||||
|
},
|
||||||
"sprintf-js": {
|
"sprintf-js": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||||
@@ -1738,6 +2160,16 @@
|
|||||||
"ansi-regex": "^2.0.0"
|
"ansi-regex": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"strip-bom": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM="
|
||||||
|
},
|
||||||
|
"strip-eof": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
|
||||||
|
},
|
||||||
"strip-json-comments": {
|
"strip-json-comments": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
||||||
@@ -1911,6 +2343,15 @@
|
|||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||||
},
|
},
|
||||||
|
"validate-npm-package-license": {
|
||||||
|
"version": "3.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||||
|
"integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
|
||||||
|
"requires": {
|
||||||
|
"spdx-correct": "^3.0.0",
|
||||||
|
"spdx-expression-parse": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"vary": {
|
"vary": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
@@ -1931,6 +2372,19 @@
|
|||||||
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz",
|
||||||
"integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w="
|
"integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w="
|
||||||
},
|
},
|
||||||
|
"which": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||||
|
"requires": {
|
||||||
|
"isexe": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"which-module": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
|
||||||
|
},
|
||||||
"wide-align": {
|
"wide-align": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
|
||||||
@@ -1939,6 +2393,11 @@
|
|||||||
"string-width": "^1.0.2 || 2"
|
"string-width": "^1.0.2 || 2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"window-or-global": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/window-or-global/-/window-or-global-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-2+RboqKRqrxW1iz2bEW3+jIpRt4="
|
||||||
|
},
|
||||||
"window-size": {
|
"window-size": {
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz",
|
||||||
@@ -1958,11 +2417,25 @@
|
|||||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
|
||||||
"integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8="
|
"integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8="
|
||||||
},
|
},
|
||||||
|
"wrap-ansi": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
|
||||||
|
"requires": {
|
||||||
|
"string-width": "^1.0.1",
|
||||||
|
"strip-ansi": "^3.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
},
|
},
|
||||||
|
"y18n": {
|
||||||
|
"version": "3.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
||||||
|
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
|
||||||
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
|
||||||
@@ -1978,6 +2451,21 @@
|
|||||||
"decamelize": "^1.0.0",
|
"decamelize": "^1.0.0",
|
||||||
"window-size": "0.1.0"
|
"window-size": "0.1.0"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"yargs-parser": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz",
|
||||||
|
"integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=",
|
||||||
|
"requires": {
|
||||||
|
"camelcase": "^4.1.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"camelcase": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
|
||||||
|
"integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0="
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
"pug": "2.0.0-beta11",
|
"pug": "2.0.0-beta11",
|
||||||
"sqlite3": "^4.0.4",
|
"sqlite3": "^4.0.4",
|
||||||
"uuid": "^3.3.2",
|
"uuid": "^3.3.2",
|
||||||
"read-file": "latest"
|
"read-file": "latest",
|
||||||
|
"qrcode": "latest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/express": "^4.16.0",
|
"@types/express": "^4.16.0",
|
||||||
|
|||||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
16
public/js/Chart.bundle.min.js
vendored
Normal file
16
public/js/Chart.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -1,8 +1,18 @@
|
|||||||
|
//const HTTP_BASE = "http://localhost:3000";
|
||||||
|
const HTTP_BASE = "";
|
||||||
const HTTP_BASE = "http://127.0.0.1:3000";
|
|
||||||
const tokens = {};
|
const tokens = {};
|
||||||
|
|
||||||
|
declare var componentHandler;
|
||||||
|
|
||||||
|
function escapeHtml(unsafe) {
|
||||||
|
return unsafe
|
||||||
|
.replace(/&/g, "&")
|
||||||
|
.replace(/</g, "<")
|
||||||
|
.replace(/>/g, ">")
|
||||||
|
.replace(/"/g, """)
|
||||||
|
.replace(/'/g, "'");
|
||||||
|
}
|
||||||
|
|
||||||
function httpGetAsync(token: string, theUrl, callback = null) {
|
function httpGetAsync(token: string, theUrl, callback = null) {
|
||||||
if (!!token && tokens[token]) {
|
if (!!token && tokens[token]) {
|
||||||
clearTimeout(tokens[token]);
|
clearTimeout(tokens[token]);
|
||||||
@@ -26,6 +36,9 @@ function httpGetAsync(token: string, theUrl, callback = null) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function addProgressBarFunctionality(id: string) {
|
function addProgressBarFunctionality(id: string) {
|
||||||
const rangediv = document.getElementById(id);
|
const rangediv = document.getElementById(id);
|
||||||
rangediv.getElementsByClassName("mdl-progress")[0].addEventListener("mdl-componentupgraded", () => {
|
rangediv.getElementsByClassName("mdl-progress")[0].addEventListener("mdl-componentupgraded", () => {
|
||||||
@@ -64,7 +77,7 @@ function sendSex(elem) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sendNewCocktail() {
|
function sendNewCocktail() {
|
||||||
const cocktail = document.getElementById("cocktails").value;
|
const cocktail = (document.getElementById("cocktails") as any).value;
|
||||||
if (cocktail === "") {
|
if (cocktail === "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -75,17 +88,21 @@ function sendNewCocktail() {
|
|||||||
setProgress(elem, level);
|
setProgress(elem, level);
|
||||||
} else {
|
} else {
|
||||||
const list = document.getElementById("cocktaillist");
|
const list = document.getElementById("cocktaillist");
|
||||||
let NAME = cocktail;
|
let NAME = escapeHtml(cocktail);
|
||||||
let LEVEL = level;
|
let LEVEL = escapeHtml(level);
|
||||||
|
httpGetAsync(null, `${HTTP_BASE}/update/getingredients?cocktail=${encodeURI(cocktail)}`, (data) => {
|
||||||
|
document.getElementById(cocktail).parentElement.parentElement.getElementsByClassName("mdl-list__item-sub-title")[0].innerHTML = escapeHtml(data);
|
||||||
|
});
|
||||||
list.innerHTML += (`<li class="mdl-list__item mdl-list__item--two-line"><span class="mdl-list__item-primary-content"><i class="material-icons mdl-list__item-avatar">local_bar</i><span>${NAME}</span><span class="mdl-list__item-sub-title"> </span></span><span class="mdl-list__item-secondary-content">
|
list.innerHTML += (`<li class="mdl-list__item mdl-list__item--two-line"><span class="mdl-list__item-primary-content"><i class="material-icons mdl-list__item-avatar">local_bar</i><span>${NAME}</span><span class="mdl-list__item-sub-title"> </span></span><span class="mdl-list__item-secondary-content">
|
||||||
<div id="${NAME}" class="mdl-grid" style="width:100px;text-align:center;padding:0;margin:0" data-value=""+LEVEL+"">
|
<div id="${NAME}" class="mdl-grid" style="width:100px;text-align:center;padding:0;margin:0" data-value="${LEVEL}">
|
||||||
<div class="mdl-cell" style="width:33.33333333%;margin-right:0px;margin-left:0px"><a class="minus-arrow mdl-list__item-secondary-action" href="#"><i class="material-icons">remove</i></a></div>
|
<div class="mdl-cell" style="width:33.33333333%;margin-right:0px;margin-left:0px"><a class="minus-arrow mdl-list__item-secondary-action" href="#"><i class="material-icons">remove</i></a></div>
|
||||||
<div class="mdl-cell" style="width:33.33333333%;margin-right:0px;margin-left:0px">
|
<div class="mdl-cell" style="width:33.33333333%;margin-right:0px;margin-left:0px">
|
||||||
<div class="mdl-progress mdl-js-progress" style="text-align:center"><span class="mdl-list__item-secondary-info"></span></div>
|
<div class="mdl-progress mdl-js-progress" style="text-align:center"><span class="mdl-list__item-secondary-info"></span></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-cell" style="width:33.33333333%;margin-right:0px;margin-left:0px"><a class="plus-arrow mdl-list__item-secondary-action" href="#"><i class="material-icons">add</i></a></div>
|
<div class="mdl-cell" style="width:33.33333333%;margin-right:0px;margin-left:0px"><a class="plus-arrow mdl-list__item-secondary-action" href="#"><i class="material-icons">add</i></a></div>
|
||||||
</div></span></li>`);
|
</div></span></li>`);
|
||||||
addProgressBarFunctionality(NAME);
|
addProgressBarFunctionality(cocktail);
|
||||||
|
componentHandler.upgradeElement(document.getElementById(cocktail).getElementsByClassName("mdl-progress")[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,3 +111,28 @@ function sendCocktail(id, value) {
|
|||||||
const level = value;
|
const level = value;
|
||||||
httpGetAsync("updatetoken" + id, `${HTTP_BASE}/update/newcocktail?cocktail=${encodeURI(cocktail)}&level=${encodeURI(level)}`);
|
httpGetAsync("updatetoken" + id, `${HTTP_BASE}/update/newcocktail?cocktail=${encodeURI(cocktail)}&level=${encodeURI(level)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function createCookie(name, value) {
|
||||||
|
const maxAge = "; max-age=21474836470";
|
||||||
|
console.log(name + "=" + value + maxAge + "; path=/");
|
||||||
|
document.cookie = name + "=" + value + maxAge + "; path=/";
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadUID(elem) {
|
||||||
|
const uid = elem.getElementsByClassName("mdl-textfield__input")[0].value;
|
||||||
|
httpGetAsync(null, `${HTTP_BASE}/update/isvaliduid?uid=${encodeURI(uid)}`, (data) => {
|
||||||
|
if (data === "valid") {
|
||||||
|
console.log("cookie", document.cookie);
|
||||||
|
createCookie("uid", uid);
|
||||||
|
location.href = "/";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
7
public/js/plotly.min.js
vendored
Normal file
7
public/js/plotly.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
21
routes/export.ts
Normal file
21
routes/export.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import * as express from "express";
|
||||||
|
import * as QRCode from "qrcode";
|
||||||
|
|
||||||
|
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
|
router.use((req, res, next) => {
|
||||||
|
if (!req.cookies || !req.cookies.uid) {
|
||||||
|
res.status(404);
|
||||||
|
res.send();
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get("/", (req, res, next) => {
|
||||||
|
QRCode.toDataURL(req.cookies.uid, (err, url) => {
|
||||||
|
res.render("export", {title: "Export", uid: req.cookies.uid, dataurl: url});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
export = router;
|
||||||
@@ -11,9 +11,8 @@ router.use((req, res, next) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.get("/", (req, res, next) => {
|
router.get("/", (req, res, next) => {
|
||||||
const user = req.app.db.get("users").find({id: req.cookies.uid}).value();
|
const user = (req.app as any).db.get("users").find({id: req.cookies.uid}).value();
|
||||||
console.log(user);
|
res.render("index", {title: "Liebingscocktails", user, cocktails: (req.app as any).cocktails, cocktailList: (req.app as any).cocktailList});
|
||||||
res.render("index", {title: "Liebingscocktails", user, cocktails: req.app.cocktails, cocktailList: req.app.cocktailList});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export = router;
|
export = router;
|
||||||
|
|||||||
89
routes/recommends.ts
Normal file
89
routes/recommends.ts
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
import * as express from "express";
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
|
router.use((req, res, next) => {
|
||||||
|
if (!req.cookies || !req.cookies.uid) {
|
||||||
|
res.status(404);
|
||||||
|
res.send();
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get("/", (req, res, next) => {
|
||||||
|
const user = (req.app as any).db.get("users").find({id: req.cookies.uid}).value();
|
||||||
|
const data = [{
|
||||||
|
backgroundColor: "rgba(200, 200, 200, 1)",
|
||||||
|
data: [],
|
||||||
|
label: "Noch nicht probiert",
|
||||||
|
}, {
|
||||||
|
backgroundColor: "#8b0000",
|
||||||
|
data: [],
|
||||||
|
label: "1",
|
||||||
|
}, {
|
||||||
|
backgroundColor: "#b24502",
|
||||||
|
data: [],
|
||||||
|
label: "2",
|
||||||
|
}, {
|
||||||
|
backgroundColor: "#d87501",
|
||||||
|
data: [],
|
||||||
|
label: "3",
|
||||||
|
}, {
|
||||||
|
backgroundColor: "#ffa500",
|
||||||
|
data: [],
|
||||||
|
label: "4",
|
||||||
|
}, {
|
||||||
|
backgroundColor: "#b59200",
|
||||||
|
data: [],
|
||||||
|
label: "5",
|
||||||
|
}, {
|
||||||
|
backgroundColor: "#6b7d00",
|
||||||
|
data: [],
|
||||||
|
label: "6",
|
||||||
|
}, {
|
||||||
|
backgroundColor: "#006400",
|
||||||
|
data: [],
|
||||||
|
label: "7",
|
||||||
|
}];
|
||||||
|
const recommends = [];
|
||||||
|
(req.app as any).cocktails.forEach((value) => {
|
||||||
|
let found = false;
|
||||||
|
const triedCocktails = [];
|
||||||
|
for (const cocktail of user.cocktails) {
|
||||||
|
if (cocktail.cocktail === value[3]) {
|
||||||
|
data[cocktail.level].data.push({x: value[0], y: value[1], r: 4, val: value});
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
triedCocktails.push(cocktail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
|
let dist = 0;
|
||||||
|
let distsum = 0;
|
||||||
|
for (const tried of triedCocktails) {
|
||||||
|
const idx = (req.app as any).cocktailList.indexOf(tried.cocktail);
|
||||||
|
if (idx > -1) {
|
||||||
|
const c = (req.app as any).cocktails[idx];
|
||||||
|
const d = Math.abs(c[0] - value[0]) + Math.abs(c[1] - value[1]);
|
||||||
|
if (d > 0.001) {
|
||||||
|
dist += (tried.level) / d;
|
||||||
|
distsum += 1 / d;
|
||||||
|
} else {
|
||||||
|
dist = tried.level;
|
||||||
|
distsum = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
recommends.push([dist / distsum, value]);
|
||||||
|
data[0].data.push({x: value[0], y: value[1], r: 3, val: value});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
recommends.sort((a, b) => {
|
||||||
|
return a[0] < b[0] ? 1 : (a[0] === b[0] ? 0 : -1);
|
||||||
|
});
|
||||||
|
res.render("recommends", {data, title: "Ähnliche Cocktails", user, cocktails: (req.app as any).cocktails, cocktailList: (req.app as any).cocktailList, recommends});
|
||||||
|
});
|
||||||
|
|
||||||
|
export = router;
|
||||||
@@ -27,7 +27,7 @@ router.get("/personal", (req, res) => {
|
|||||||
}
|
}
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (!!result.age || !!result.sex) {
|
if (!!result.age || !!result.sex) {
|
||||||
req.app.db.get("users")
|
(req.app as any).db.get("users")
|
||||||
.find({id: req.cookies.uid})
|
.find({id: req.cookies.uid})
|
||||||
.assign(result)
|
.assign(result)
|
||||||
.write();
|
.write();
|
||||||
@@ -46,7 +46,7 @@ router.get("/newcocktail", (req, res) => {
|
|||||||
if (level > 0 && level < 8) {
|
if (level > 0 && level < 8) {
|
||||||
result.level = level;
|
result.level = level;
|
||||||
}
|
}
|
||||||
if (req.app.cocktailList.indexOf(cocktail) > -1) {
|
if ((req.app as any).cocktailList.indexOf(cocktail) > -1) {
|
||||||
result.cocktail = cocktail;
|
result.cocktail = cocktail;
|
||||||
}
|
}
|
||||||
if (!!result.level && !!result.cocktail) {
|
if (!!result.level && !!result.cocktail) {
|
||||||
@@ -67,4 +67,35 @@ router.get("/newcocktail", (req, res) => {
|
|||||||
res.send();
|
res.send();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
router.get("/getingredients", (req, res) => {
|
||||||
|
const cocktail = req.query.cocktail || null;
|
||||||
|
if ((req.app as any).cocktailList.indexOf(cocktail) > -1) {
|
||||||
|
const index = (req.app as any).cocktailList.indexOf(cocktail);
|
||||||
|
const cdetails = (req.app as any).cocktails[index][7].replace(/;/g, ", ");
|
||||||
|
res.status(200);
|
||||||
|
res.send(cdetails);
|
||||||
|
} else {
|
||||||
|
res.status(200);
|
||||||
|
res.send("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
router.get("/isvaliduid", (req, res) => {
|
||||||
|
const uid = req.query.uid || null;
|
||||||
|
const newuser = (req.app as any).db.get("users")
|
||||||
|
.find({id: uid})
|
||||||
|
.value();
|
||||||
|
if (!!newuser) {
|
||||||
|
res.status(200);
|
||||||
|
res.send("valid");
|
||||||
|
} else {
|
||||||
|
res.status(200);
|
||||||
|
res.send("invalid");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export = router;
|
export = router;
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import * as express from "express";
|
|
||||||
const router = express.Router();
|
|
||||||
|
|
||||||
/* GET users listing. */
|
|
||||||
router.get("/", (req, res, next) => {
|
|
||||||
res.send("respond with a resource");
|
|
||||||
});
|
|
||||||
|
|
||||||
export = router;
|
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "tslint:recommended",
|
"extends": "tslint:recommended",
|
||||||
"rules": {
|
"rules": {
|
||||||
"max-line-length": {
|
|
||||||
"options": [120]
|
|
||||||
},
|
|
||||||
"new-parens": true,
|
"new-parens": true,
|
||||||
"no-arg": true,
|
"no-arg": true,
|
||||||
"no-bitwise": true,
|
"no-bitwise": true,
|
||||||
|
|||||||
34
views/export.pug
Normal file
34
views/export.pug
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
extends layout
|
||||||
|
|
||||||
|
block content
|
||||||
|
.mdl-grid
|
||||||
|
.mdl-cell--3-offset-desktop
|
||||||
|
.mdl-cell.mdl-cell--6-col.mdl-cell--12-col-tablet
|
||||||
|
.demo-card-square.mdl-card.mdl-shadow--2dp
|
||||||
|
.mdl-card__title.mdl-card--expand
|
||||||
|
h2.mdl-card__title-text Exportieren
|
||||||
|
.mdl-card__supporting-text
|
||||||
|
| Hier kannst Du Deine Daten auf ein anderes Gerät oder in deine Notizen zu speichern!
|
||||||
|
h4 Eigene UID
|
||||||
|
pre= uid
|
||||||
|
h4 QR-Code
|
||||||
|
.mdl-grid
|
||||||
|
.mdl-cell--3-offset-desktop
|
||||||
|
.mdl-cell.mdl-cell--6-col.mdl-cell--12-col-tablet
|
||||||
|
img(src=dataurl, style="width: 100%")
|
||||||
|
|
||||||
|
.mdl-grid
|
||||||
|
.mdl-cell--3-offset-desktop
|
||||||
|
.mdl-cell.mdl-cell--6-col.mdl-cell--12-col-tablet
|
||||||
|
.demo-card-square.mdl-card.mdl-shadow--2dp
|
||||||
|
.mdl-card__title.mdl-card--expand
|
||||||
|
h2.mdl-card__title-text Importieren
|
||||||
|
.mdl-card__supporting-text
|
||||||
|
| Hier kannst Du Deine Daten auf ein anderes Gerät oder in deine Notizen zu speichern!
|
||||||
|
h4 Eigene UID
|
||||||
|
form(action='#', onsubmit="loadUID(this)")
|
||||||
|
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label
|
||||||
|
input#import.mdl-textfield__input(type='text')
|
||||||
|
label.mdl-textfield__label(for='import') UID
|
||||||
|
button.mdl-button.mdl-js-button.mdl-button--raised.mdl-js-ripple-effect.mdl-button--colored(type="submit")
|
||||||
|
| Laden
|
||||||
@@ -40,7 +40,7 @@ block content
|
|||||||
span.mdl-selectfield__error Select a value
|
span.mdl-selectfield__error Select a value
|
||||||
br
|
br
|
||||||
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label
|
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label
|
||||||
input.mdl-textfield__input(type="number", id="age_input", onchange="sendAge(this)", value=(user.age !== -1 ? user.age : ""))
|
input.mdl-textfield__input(type="number", id="age_input", pattern="[0-9]{0,2}", onchange="sendAge(this)", value=(user.age !== -1 ? user.age : ""))
|
||||||
label.mdl-textfield__label(for="age_input") Alter
|
label.mdl-textfield__label(for="age_input") Alter
|
||||||
//.mdl-card__actions.mdl-card--border
|
//.mdl-card__actions.mdl-card--border
|
||||||
// a.mdl-button.mdl-button--colored.mdl-js-button.mdl-js-ripple-effect
|
// a.mdl-button.mdl-button--colored.mdl-js-button.mdl-js-ripple-effect
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ html
|
|||||||
nav.mdl-navigation
|
nav.mdl-navigation
|
||||||
a.mdl-navigation__link(href='/') Liste
|
a.mdl-navigation__link(href='/') Liste
|
||||||
a.mdl-navigation__link(href='/recommends') Empfohlene Cocktails
|
a.mdl-navigation__link(href='/recommends') Empfohlene Cocktails
|
||||||
a.mdl-navigation__link(href='/similar') Ähnliche Cocktails
|
a.mdl-navigation__link(href='/export') Export
|
||||||
a.mdl-navigation__link(href='/admin') Admin
|
a.mdl-navigation__link(href='/admin') Admin
|
||||||
a.mdl-navigation__link(href='/impressum') Impressum & Datenschutz
|
a.mdl-navigation__link(href='/impressum') Impressum & Datenschutz
|
||||||
main.mdl-layout__content
|
main.mdl-layout__content
|
||||||
|
|||||||
62
views/recommends.pug
Normal file
62
views/recommends.pug
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
extends layout
|
||||||
|
|
||||||
|
block content
|
||||||
|
.mdl-grid
|
||||||
|
.mdl-cell--3-offset-desktop
|
||||||
|
.mdl-cell.mdl-cell--6-col.mdl-cell--12-col-tablet
|
||||||
|
.demo-card-square.mdl-card.mdl-shadow--2dp
|
||||||
|
.mdl-card__title.mdl-card--expand
|
||||||
|
h2.mdl-card__title-text Ähnliche Cocktails
|
||||||
|
.mdl-card__supporting-text
|
||||||
|
canvas#myChart
|
||||||
|
script(src="/js/Chart.bundle.min.js")
|
||||||
|
script.
|
||||||
|
var ctx = document.getElementById("myChart");
|
||||||
|
console.log(ctx);
|
||||||
|
var myChart = new Chart(ctx, {
|
||||||
|
type: 'bubble',
|
||||||
|
data: {
|
||||||
|
datasets: !{JSON.stringify(data).replace(/<\//g, "<\\/")}
|
||||||
|
}, options: {
|
||||||
|
legend: {
|
||||||
|
display: false
|
||||||
|
},
|
||||||
|
tooltips: {
|
||||||
|
callbacks: {
|
||||||
|
title: function (tooltipItem, data) {
|
||||||
|
let dsIdx = tooltipItem[0].datasetIndex;
|
||||||
|
let idx = tooltipItem[0].index;
|
||||||
|
let val = data.datasets[dsIdx].data[idx].val;
|
||||||
|
return val[2] + " - " + val[3];
|
||||||
|
},
|
||||||
|
label: function (tooltipItem, data) {
|
||||||
|
let dsIdx = tooltipItem.datasetIndex;
|
||||||
|
let idx = tooltipItem.index;
|
||||||
|
let val = data.datasets[dsIdx].data[idx].val;
|
||||||
|
return val[7];
|
||||||
|
},
|
||||||
|
afterLabel: function (tooltipItem, data) {
|
||||||
|
let dsIdx = tooltipItem.datasetIndex;
|
||||||
|
let idx = tooltipItem.index;
|
||||||
|
let val = data.datasets[dsIdx].data[idx].val;
|
||||||
|
return val[4] + " - Happy Hour: " + val[5];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
.mdl-grid
|
||||||
|
.mdl-cell--3-offset-desktop
|
||||||
|
.mdl-cell.mdl-cell--6-col.mdl-cell--12-col-tablet
|
||||||
|
.demo-card-square.mdl-card.mdl-shadow--2dp
|
||||||
|
.mdl-card__title.mdl-card--expand
|
||||||
|
h2.mdl-card__title-text Persönliche Empfehlungen
|
||||||
|
.mdl-card__supporting-text
|
||||||
|
each recommend in recommends
|
||||||
|
li.mdl-list__item.mdl-list__item--two-line
|
||||||
|
span.mdl-list__item-primary-content
|
||||||
|
i.material-icons.mdl-list__item-avatar local_bar
|
||||||
|
span= recommend[1][3]
|
||||||
|
span.mdl-list__item-sub-title= recommend[1][7].replace(/;/g, ', ')
|
||||||
|
span.mdl-list__item-secondary-content= Math.round(recommend[0]*10)/10
|
||||||
Reference in New Issue
Block a user