Adding password salting

This commit is contained in:
Fabian Stamm 2020-02-07 19:30:52 +01:00
parent 7d10fdae30
commit f2e9de9423
13 changed files with 1041 additions and 904 deletions

View File

@ -6,3 +6,6 @@ indent_size = 3
charset = utf-8 charset = utf-8
trim_trailing_whitespace = false trim_trailing_whitespace = false
insert_final_newline = false insert_final_newline = false
[*.svelte]
indent_size = 2

View File

@ -44,6 +44,7 @@ let configs = pages.map(page => {
name: "app", name: "app",
file: `build/${page.toLowerCase()}/bundle.js` file: `build/${page.toLowerCase()}/bundle.js`
}, },
watch: { watch: {
clearScreen: false clearScreen: false
}, },
@ -111,8 +112,8 @@ if (process.argv.indexOf("-w") >= 0) {
} else if (event.code === "ERROR") { } else if (event.code === "ERROR") {
// console.error(event.error); // console.error(event.error);
handleError(event.error, true); handleError(event.error, true);
} else if (event.code === "FATAL") { // } else if (event.code === "FATAL") {
handleError(event.error, true); // handleError(event.error, true);
} else { } else {
console.log(event); console.log(event);
} }
@ -120,8 +121,9 @@ if (process.argv.indexOf("-w") >= 0) {
} else { } else {
start = process.hrtime(); start = process.hrtime();
Promise.all(configs.map(config => { Promise.all(configs.map(config => {
config.treeshake = true;
return rollup.rollup(config).then((value) => { return rollup.rollup(config).then((value) => {
return value.write(config.output) return value.write(Array.isArray(config.output) ? config.output[0] : config.output);
}).catch(err => { }).catch(err => {
handleError(err, true); handleError(err, true);
// console.error(err); // console.error(err);

492
package-lock.json generated
View File

@ -5,18 +5,18 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@babel/code-frame": { "@babel/code-frame": {
"version": "7.5.5", "version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz",
"integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/highlight": "^7.0.0" "@babel/highlight": "^7.8.3"
} }
}, },
"@babel/highlight": { "@babel/highlight": {
"version": "7.5.0", "version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz",
"integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^2.0.0", "chalk": "^2.0.0",
@ -25,9 +25,9 @@
} }
}, },
"@hibas123/utils": { "@hibas123/utils": {
"version": "2.1.0", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/@hibas123/utils/-/utils-2.1.0.tgz", "resolved": "https://registry.npmjs.org/@hibas123/utils/-/utils-2.2.3.tgz",
"integrity": "sha512-rS0SMENN7ta6pv9bNmIls8lvEOHbbDQXpiDI3u3z0Vx8B43ngEmEXbu5vKBA58ekYLr1WdHH6iIiySDChoi/RQ==" "integrity": "sha512-yAywWMDbt5fmid9E7IRXeCazdbwfC339LhRFIryXab0FqlQzUrm8ggdJaSzWXYC7m3ijdekSezlBno/vOL/L2Q=="
}, },
"@polka/url": { "@polka/url": {
"version": "0.5.0", "version": "0.5.0",
@ -36,9 +36,9 @@
"dev": true "dev": true
}, },
"@types/estree": { "@types/estree": {
"version": "0.0.39", "version": "0.0.42",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.42.tgz",
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "integrity": "sha512-K1DPVvnBCPxzD+G51/cxVIoc2X8uUVl1zpJeE6iKcgHMj4+tbat5Xu4TjV7v2QSDbIeAfLi2hIk+u2+s0MlpUQ==",
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
@ -63,18 +63,18 @@
"dev": true "dev": true
}, },
"acorn": { "acorn": {
"version": "6.2.1", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.1.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
"integrity": "sha512-JD0xT5FCRDNyjDda3Lrg/IxFscp9q4tiYtxE1/nOzlKCk7hIRuYjhq1kCNkbPjMRMZuFq20HNQn1I9k8Oj0E+Q==", "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==",
"dev": true "dev": true
}, },
"ajv": { "ajv": {
"version": "6.10.0", "version": "6.11.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz",
"integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==",
"dev": true, "dev": true,
"requires": { "requires": {
"fast-deep-equal": "^2.0.1", "fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0", "fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1", "json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2" "uri-js": "^4.2.2"
@ -118,9 +118,9 @@
} }
}, },
"arg": { "arg": {
"version": "4.1.1", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true "dev": true
}, },
"array-filter": { "array-filter": {
@ -181,9 +181,9 @@
"dev": true "dev": true
}, },
"aws4": { "aws4": {
"version": "1.8.0", "version": "1.9.1",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz",
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==",
"dev": true "dev": true
}, },
"balanced-match": { "balanced-match": {
@ -312,20 +312,25 @@
"dev": true "dev": true
}, },
"combined-stream": { "combined-stream": {
"version": "1.0.7", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true, "dev": true,
"requires": { "requires": {
"delayed-stream": "~1.0.0" "delayed-stream": "~1.0.0"
} }
}, },
"commander": { "commander": {
"version": "2.20.0", "version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true "dev": true
}, },
"commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs="
},
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@ -409,9 +414,9 @@
"dev": true "dev": true
}, },
"diff": { "diff": {
"version": "4.0.1", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true "dev": true
}, },
"ecc-jsbn": { "ecc-jsbn": {
@ -467,8 +472,7 @@
"estree-walker": { "estree-walker": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz",
"integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w=="
"dev": true
}, },
"esutils": { "esutils": {
"version": "2.0.3", "version": "2.0.3",
@ -489,17 +493,27 @@
"dev": true "dev": true
}, },
"fast-deep-equal": { "fast-deep-equal": {
"version": "2.0.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
"dev": true "dev": true
}, },
"fast-json-stable-stringify": { "fast-json-stable-stringify": {
"version": "2.0.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true "dev": true
}, },
"find-cache-dir": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz",
"integrity": "sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==",
"requires": {
"commondir": "^1.0.1",
"make-dir": "^3.0.0",
"pkg-dir": "^4.1.0"
}
},
"find-up": { "find-up": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
@ -545,9 +559,9 @@
"dev": true "dev": true
}, },
"fstream": { "fstream": {
"version": "1.0.11", "version": "1.0.12",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
"integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
"dev": true, "dev": true,
"requires": { "requires": {
"graceful-fs": "^4.1.2", "graceful-fs": "^4.1.2",
@ -615,9 +629,9 @@
} }
}, },
"glob": { "glob": {
"version": "7.1.3", "version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"dev": true, "dev": true,
"requires": { "requires": {
"fs.realpath": "^1.0.0", "fs.realpath": "^1.0.0",
@ -629,9 +643,9 @@
} }
}, },
"globule": { "globule": {
"version": "1.2.1", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.0.tgz",
"integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", "integrity": "sha512-YlD4kdMqRCQHrhVdonet4TdRtv1/sZKepvoxNT4Nrhrp5HI8XFfc8kFlGlBn2myBo80aGp8Eft259mbcUJhgSg==",
"dev": true, "dev": true,
"requires": { "requires": {
"glob": "~7.1.1", "glob": "~7.1.1",
@ -744,9 +758,9 @@
} }
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true "dev": true
}, },
"invert-kv": { "invert-kv": {
@ -774,13 +788,10 @@
"dev": true "dev": true
}, },
"is-finite": { "is-finite": {
"version": "1.0.2", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz",
"integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==",
"dev": true, "dev": true
"requires": {
"number-is-nan": "^1.0.0"
}
}, },
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
@ -798,12 +809,20 @@
"dev": true "dev": true
}, },
"is-reference": { "is-reference": {
"version": "1.1.3", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.3.tgz", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz",
"integrity": "sha512-W1iHHv/oyBb2pPxkBxtaewxa1BC58Pn5J0hogyCdefwUIvb6R+TGbAcIa4qPNYLqLhb3EnOgUf2MQkkF76BcKw==", "integrity": "sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/estree": "0.0.39" "@types/estree": "0.0.39"
},
"dependencies": {
"@types/estree": {
"version": "0.0.39",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
"dev": true
}
} }
}, },
"is-regex": { "is-regex": {
@ -855,12 +874,12 @@
"dev": true "dev": true
}, },
"jest-worker": { "jest-worker": {
"version": "24.6.0", "version": "24.9.0",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz",
"integrity": "sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==", "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==",
"dev": true, "dev": true,
"requires": { "requires": {
"merge-stream": "^1.0.1", "merge-stream": "^2.0.0",
"supports-color": "^6.1.0" "supports-color": "^6.1.0"
}, },
"dependencies": { "dependencies": {
@ -976,10 +995,18 @@
"integrity": "sha512-ykt2pgN0aqIy6KQC1CqdWTWkmUwNgaOS6dcpHVjyBJONA+Xi7AtSB1vuxC/U/0tjIP3wcRudwQk1YYzUvzk2bA==", "integrity": "sha512-ykt2pgN0aqIy6KQC1CqdWTWkmUwNgaOS6dcpHVjyBJONA+Xi7AtSB1vuxC/U/0tjIP3wcRudwQk1YYzUvzk2bA==",
"dev": true "dev": true
}, },
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"requires": {
"p-locate": "^4.1.0"
}
},
"lodash": { "lodash": {
"version": "4.17.11", "version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"dev": true "dev": true
}, },
"loud-rejection": { "loud-rejection": {
@ -1003,14 +1030,29 @@
} }
}, },
"magic-string": { "magic-string": {
"version": "0.25.3", "version": "0.25.6",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.3.tgz", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.6.tgz",
"integrity": "sha512-6QK0OpF/phMz0Q2AxILkX2mFhi7m+WMwTRg0LQKq/WBB0cDP4rYH3Wp4/d3OTXlrPLVJT/RFqj8tFeAR4nk8AA==", "integrity": "sha512-3a5LOMSGoCTH5rbqobC2HuDNRtE2glHZ8J7pK+QZYppyWA36yuNpsX994rIY2nCuyP7CZYy7lQq/X2jygiZ89g==",
"dev": true, "dev": true,
"requires": { "requires": {
"sourcemap-codec": "^1.4.4" "sourcemap-codec": "^1.4.4"
} }
}, },
"make-dir": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz",
"integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==",
"requires": {
"semver": "^6.0.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
}
}
},
"make-error": { "make-error": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz",
@ -1048,13 +1090,10 @@
} }
}, },
"merge-stream": { "merge-stream": {
"version": "1.0.1", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
"dev": true, "dev": true
"requires": {
"readable-stream": "^2.0.1"
}
}, },
"mime": { "mime": {
"version": "2.4.4", "version": "2.4.4",
@ -1063,18 +1102,18 @@
"dev": true "dev": true
}, },
"mime-db": { "mime-db": {
"version": "1.40.0", "version": "1.43.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz",
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==",
"dev": true "dev": true
}, },
"mime-types": { "mime-types": {
"version": "2.1.24", "version": "2.1.26",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz",
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"mime-db": "1.40.0" "mime-db": "1.43.0"
} }
}, },
"minimatch": { "minimatch": {
@ -1116,9 +1155,9 @@
"dev": true "dev": true
}, },
"nan": { "nan": {
"version": "2.13.2", "version": "2.14.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
"integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
"dev": true "dev": true
}, },
"nice-try": { "nice-try": {
@ -1156,9 +1195,9 @@
} }
}, },
"node-sass": { "node-sass": {
"version": "4.12.0", "version": "4.13.1",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.1.tgz",
"integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==", "integrity": "sha512-TTWFx+ZhyDx1Biiez2nB0L3YrCZ/8oHagaDalbuBSlqXgUPsdkUSzJsVxeDO9LtPB49+Fh3WQl3slABo6AotNw==",
"dev": true, "dev": true,
"requires": { "requires": {
"async-foreach": "^0.1.3", "async-foreach": "^0.1.3",
@ -1168,7 +1207,7 @@
"get-stdin": "^4.0.1", "get-stdin": "^4.0.1",
"glob": "^7.0.3", "glob": "^7.0.3",
"in-publish": "^2.0.0", "in-publish": "^2.0.0",
"lodash": "^4.17.11", "lodash": "^4.17.15",
"meow": "^3.7.0", "meow": "^3.7.0",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"nan": "^2.13.2", "nan": "^2.13.2",
@ -1331,6 +1370,27 @@
"os-tmpdir": "^1.0.0" "os-tmpdir": "^1.0.0"
} }
}, },
"p-limit": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz",
"integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==",
"requires": {
"p-try": "^2.0.0"
}
},
"p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"requires": {
"p-limit": "^2.2.0"
}
},
"p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
},
"parse-json": { "parse-json": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
@ -1409,15 +1469,39 @@
"pinkie": "^2.0.0" "pinkie": "^2.0.0"
} }
}, },
"pkg-dir": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
"requires": {
"find-up": "^4.0.0"
},
"dependencies": {
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
}
},
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="
}
}
},
"pretty-bytes": { "pretty-bytes": {
"version": "5.2.0", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.2.0.tgz", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.2.0.tgz",
"integrity": "sha512-ujANBhiUsl9AhREUDUEY1GPOharMGm8x8juS7qOHybcLi7XsKfrYQ88hSly1l2i0klXHTDYrlL8ihMCG55Dc3w==" "integrity": "sha512-ujANBhiUsl9AhREUDUEY1GPOharMGm8x8juS7qOHybcLi7XsKfrYQ88hSly1l2i0klXHTDYrlL8ihMCG55Dc3w=="
}, },
"process-nextick-args": { "process-nextick-args": {
"version": "2.0.0", "version": "2.0.1",
"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.1.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"dev": true "dev": true
}, },
"pseudomap": { "pseudomap": {
@ -1427,9 +1511,9 @@
"dev": true "dev": true
}, },
"psl": { "psl": {
"version": "1.1.31", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz",
"integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==",
"dev": true "dev": true
}, },
"punycode": { "punycode": {
@ -1527,9 +1611,9 @@
} }
}, },
"readable-stream": { "readable-stream": {
"version": "2.3.6", "version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"dev": true, "dev": true,
"requires": { "requires": {
"core-util-is": "~1.0.0", "core-util-is": "~1.0.0",
@ -1616,29 +1700,29 @@
} }
}, },
"rimraf": { "rimraf": {
"version": "2.6.3", "version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
"dev": true, "dev": true,
"requires": { "requires": {
"glob": "^7.1.3" "glob": "^7.1.3"
} }
}, },
"rollup": { "rollup": {
"version": "1.19.4", "version": "1.31.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.19.4.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.31.0.tgz",
"integrity": "sha512-G24w409GNj7i/Yam2cQla6qV2k6Nug8bD2DZg9v63QX/cH/dEdbNJg8H4lUm5M1bRpPKRUC465Rm9H51JTKOfQ==", "integrity": "sha512-9C6ovSyNeEwvuRuUUmsTpJcXac1AwSL1a3x+O5lpmQKZqi5mmrjauLeqIjvREC+yNRR8fPdzByojDng+af3nVw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/estree": "0.0.39", "@types/estree": "*",
"@types/node": "^12.6.9", "@types/node": "*",
"acorn": "^6.2.1" "acorn": "^7.1.0"
} }
}, },
"rollup-plugin-commonjs": { "rollup-plugin-commonjs": {
"version": "10.0.2", "version": "10.1.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-10.0.2.tgz", "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-10.1.0.tgz",
"integrity": "sha512-DxeR4QXTgTOFseYls1V7vgKbrSJmPYNdEMOs0OvH+7+89C3GiIonU9gFrE0u39Vv1KWm3wepq8KAvKugtoM2Zw==", "integrity": "sha512-jlXbjZSQg8EIeAAvepNwhJj++qJWNJw1Cl0YnOqKtP5Djx+fFGkp3WRh+W0ASCaFG5w1jhmzDxgu3SJuVxPF4Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"estree-walker": "^0.6.1", "estree-walker": "^0.6.1",
@ -1649,9 +1733,9 @@
}, },
"dependencies": { "dependencies": {
"resolve": { "resolve": {
"version": "1.12.0", "version": "1.15.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz",
"integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==",
"dev": true, "dev": true,
"requires": { "requires": {
"path-parse": "^1.0.6" "path-parse": "^1.0.6"
@ -1693,9 +1777,9 @@
} }
}, },
"rollup-plugin-svelte": { "rollup-plugin-svelte": {
"version": "5.1.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-5.1.0.tgz", "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-5.1.1.tgz",
"integrity": "sha512-4MRZG29dAWDpoxEs5uIHzDnYafQEOLaKIJAuDYUtFIzEm1F1IGSTlFyjd8/qk4wltlHdu6V7YfZY53+CKryhMg==", "integrity": "sha512-wP3CnKHjR4fZUgNm5Iey7eItnxwnH/nAw568WJ8dpMSchBxxZ/DmKSx8e6h8k/B6SwG1wfGvWehadFJHcuFFSw==",
"dev": true, "dev": true,
"requires": { "requires": {
"require-relative": "^0.8.7", "require-relative": "^0.8.7",
@ -1704,34 +1788,41 @@
} }
}, },
"rollup-plugin-terser": { "rollup-plugin-terser": {
"version": "5.1.1", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.1.1.tgz", "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.2.0.tgz",
"integrity": "sha512-McIMCDEY8EU6Y839C09UopeRR56wXHGdvKKjlfiZG/GrP6wvZQ62u2ko/Xh1MNH2M9WDL+obAAHySljIZYCuPQ==", "integrity": "sha512-jQI+nYhtDBc9HFRBz8iGttQg7li9klmzR62RG2W2nN6hJ/FI2K2ItYQ7kJ7/zn+vs+BP1AEccmVRjRN989I+Nw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.0.0", "@babel/code-frame": "^7.5.5",
"jest-worker": "^24.6.0", "jest-worker": "^24.9.0",
"rollup-pluginutils": "^2.8.1", "rollup-pluginutils": "^2.8.2",
"serialize-javascript": "^1.7.0", "serialize-javascript": "^2.1.2",
"terser": "^4.1.0" "terser": "^4.6.2"
},
"dependencies": {
"rollup-pluginutils": {
"version": "2.8.2",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
"integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==",
"dev": true,
"requires": {
"estree-walker": "^0.6.1"
}
}
} }
}, },
"rollup-plugin-typescript2": { "rollup-plugin-typescript2": {
"version": "0.22.1", "version": "0.25.3",
"resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.22.1.tgz", "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.25.3.tgz",
"integrity": "sha512-SQEHr1s0kDWrNV3UKySZtYKFIcWCJh2PQ4ZtLNj18pf50SrxeRDlUksOOeLPyodJ7bVLaKwWDbiobF2a6gfKyg==", "integrity": "sha512-ADkSaidKBovJmf5VBnZBZe+WzaZwofuvYdzGAKTN/J4hN7QJCFYAq7IrH9caxlru6T5qhX41PNFS1S4HqhsGQg==",
"requires": { "requires": {
"find-cache-dir": "^3.0.0",
"fs-extra": "8.1.0", "fs-extra": "8.1.0",
"resolve": "1.11.1", "resolve": "1.12.0",
"rollup-pluginutils": "2.8.1", "rollup-pluginutils": "2.8.1",
"tslib": "1.10.0" "tslib": "1.10.0"
}, },
"dependencies": { "dependencies": {
"estree-walker": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz",
"integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w=="
},
"fs-extra": { "fs-extra": {
"version": "8.1.0", "version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
@ -1743,25 +1834,17 @@
} }
}, },
"graceful-fs": { "graceful-fs": {
"version": "4.2.1", "version": "4.2.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.1.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
"integrity": "sha512-b9usnbDGnD928gJB3LrCmxoibr3VE4U2SMo5PBuBnokWyDADTqDPXg4YpwKF1trpH+UbGp7QLicO3+aWEy0+mw==" "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ=="
}, },
"resolve": { "resolve": {
"version": "1.11.1", "version": "1.12.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz",
"integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==",
"requires": { "requires": {
"path-parse": "^1.0.6" "path-parse": "^1.0.6"
} }
},
"rollup-pluginutils": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz",
"integrity": "sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==",
"requires": {
"estree-walker": "^0.6.1"
}
} }
} }
}, },
@ -1769,15 +1852,14 @@
"version": "2.8.1", "version": "2.8.1",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz",
"integrity": "sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==", "integrity": "sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==",
"dev": true,
"requires": { "requires": {
"estree-walker": "^0.6.1" "estree-walker": "^0.6.1"
} }
}, },
"sade": { "sade": {
"version": "1.6.1", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/sade/-/sade-1.6.1.tgz", "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.0.tgz",
"integrity": "sha512-USHm9quYNmJwFwhOnEuJohdnBhUOKV1mhL0koHSJMLJaesRX0nuDuzbWmtUBbUmXkwTalLtUBzDlEnU940BiQA==", "integrity": "sha512-HSkPpZzN7q4EFN5PVW8nTfDn1rJZh4sKbPQqz33AXokIo6SMDeVJ3RA4e0ZASlnMK6PywEMZxKXudEn5dxSWew==",
"dev": true, "dev": true,
"requires": { "requires": {
"mri": "^1.1.0" "mri": "^1.1.0"
@ -1815,17 +1897,6 @@
"requires": { "requires": {
"js-base64": "^2.1.8", "js-base64": "^2.1.8",
"source-map": "^0.4.2" "source-map": "^0.4.2"
},
"dependencies": {
"source-map": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
"dev": true,
"requires": {
"amdefine": ">=0.0.4"
}
}
} }
}, },
"semver": { "semver": {
@ -1835,9 +1906,9 @@
"dev": true "dev": true
}, },
"serialize-javascript": { "serialize-javascript": {
"version": "1.7.0", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz",
"integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==", "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==",
"dev": true "dev": true
}, },
"set-blocking": { "set-blocking": {
@ -1890,9 +1961,9 @@
} }
}, },
"sirv-cli": { "sirv-cli": {
"version": "0.4.4", "version": "0.4.5",
"resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-0.4.4.tgz", "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-0.4.5.tgz",
"integrity": "sha512-7SsPrYWptRcOvS7/8VIxYDibLDRB4apZaU+y8lfuSnyjYFg0AVVU3J0qcQjWPxT9Ti/DtHnmbivJ+ZTh8L0ykg==", "integrity": "sha512-Fl6icSm0EwPrXSGid2xphMp//WNTSX2yENRAGnJuuZNmdc8LvE/BtdZD3MPn28ifAfDqTMwbB3dpcZojAIOiBg==",
"dev": true, "dev": true,
"requires": { "requires": {
"console-clear": "^1.1.0", "console-clear": "^1.1.0",
@ -1905,15 +1976,18 @@
} }
}, },
"source-map": { "source-map": {
"version": "0.6.1", "version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
"dev": true "dev": true,
"requires": {
"amdefine": ">=0.0.4"
}
}, },
"source-map-support": { "source-map-support": {
"version": "0.5.12", "version": "0.5.16",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz",
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"buffer-from": "^1.0.0", "buffer-from": "^1.0.0",
@ -1929,9 +2003,9 @@
} }
}, },
"sourcemap-codec": { "sourcemap-codec": {
"version": "1.4.6", "version": "1.4.8",
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.6.tgz", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
"integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==", "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
"dev": true "dev": true
}, },
"spdx-correct": { "spdx-correct": {
@ -2057,9 +2131,9 @@
} }
}, },
"svelte": { "svelte": {
"version": "3.7.1", "version": "3.18.1",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.7.1.tgz", "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.18.1.tgz",
"integrity": "sha512-MKjFy3YZ2pNUVPTwLNQ9JAVx6KVwfYnm/vbUF/pKLrfDDZiCBKfWPwnffpwGlnIAn7aS+aJoKV0soj464DOs4Q==", "integrity": "sha512-jl6VLGTytOjHu700LuXSX6LvwRKFLAxqT8McUD2f3NjMI6qakWXgXoVjT+/ZmXmr8DiwrN/074pA1o3Aye4bIA==",
"dev": true "dev": true
}, },
"svelte-preprocess-filter": { "svelte-preprocess-filter": {
@ -2078,25 +2152,33 @@
} }
}, },
"tar": { "tar": {
"version": "2.2.1", "version": "2.2.2",
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz",
"integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==",
"dev": true, "dev": true,
"requires": { "requires": {
"block-stream": "*", "block-stream": "*",
"fstream": "^1.0.2", "fstream": "^1.0.12",
"inherits": "2" "inherits": "2"
} }
}, },
"terser": { "terser": {
"version": "4.1.3", "version": "4.6.3",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.1.3.tgz", "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz",
"integrity": "sha512-on13d+cnpn5bMouZu+J8tPYQecsdRJCJuxFJ+FVoPBoLJgk5bCBkp+Uen2hWyi0KIUm6eDarnlAlH+KgIx/PuQ==", "integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"commander": "^2.20.0", "commander": "^2.20.0",
"source-map": "~0.6.1", "source-map": "~0.6.1",
"source-map-support": "~0.5.12" "source-map-support": "~0.5.12"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
}
} }
}, },
"tinydate": { "tinydate": {
@ -2139,16 +2221,16 @@
} }
}, },
"ts-node": { "ts-node": {
"version": "8.3.0", "version": "8.6.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz",
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==", "integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==",
"dev": true, "dev": true,
"requires": { "requires": {
"arg": "^4.1.0", "arg": "^4.1.0",
"diff": "^4.0.1", "diff": "^4.0.1",
"make-error": "^1.1.1", "make-error": "^1.1.1",
"source-map-support": "^0.5.6", "source-map-support": "^0.5.6",
"yn": "^3.0.0" "yn": "3.1.1"
} }
}, },
"tslib": { "tslib": {
@ -2172,9 +2254,9 @@
"dev": true "dev": true
}, },
"typescript": { "typescript": {
"version": "3.5.3", "version": "3.7.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz",
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==",
"dev": true "dev": true
}, },
"universalify": { "universalify": {
@ -2198,9 +2280,9 @@
"dev": true "dev": true
}, },
"uuid": { "uuid": {
"version": "3.3.2", "version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"dev": true "dev": true
}, },
"validate-npm-package-license": { "validate-npm-package-license": {

View File

@ -2,19 +2,19 @@
"name": "@hibas123/openauth-views", "name": "@hibas123/openauth-views",
"version": "1.0.0", "version": "1.0.0",
"devDependencies": { "devDependencies": {
"node-sass": "^4.12.0", "node-sass": "^4.13.1",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"rollup": "^1.19.4", "rollup": "^1.31.0",
"rollup-plugin-commonjs": "^10.0.2", "rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-copy-assets": "^2.0.1", "rollup-plugin-copy-assets": "^2.0.1",
"rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-svelte": "^5.1.0", "rollup-plugin-svelte": "^5.1.1",
"rollup-plugin-terser": "^5.1.1", "rollup-plugin-terser": "^5.2.0",
"sirv-cli": "^0.4.4", "sirv-cli": "^0.4.5",
"svelte": "^3.7.1", "svelte": "^3.18.1",
"svelte-preprocess-sass": "^0.2.0", "svelte-preprocess-sass": "^0.2.0",
"ts-node": "^8.3.0", "ts-node": "^8.6.2",
"typescript": "^3.5.3" "typescript": "^3.7.5"
}, },
"scripts": { "scripts": {
"prepublishOnly": "npm run build", "prepublishOnly": "npm run build",
@ -25,8 +25,8 @@
"start:dev": "sirv build --dev" "start:dev": "sirv build --dev"
}, },
"dependencies": { "dependencies": {
"@hibas123/utils": "^2.1.0", "@hibas123/utils": "^2.2.3",
"rollup-plugin-typescript2": "^0.22.1", "rollup-plugin-typescript2": "^0.25.3",
"what-the-pack": "^2.0.3" "what-the-pack": "^2.0.3"
} }
} }

View File

@ -1,5 +1,5 @@
<script> <script>
import Api from "./api"; import Api from "./api.ts";
import Credentials from "./Credentials.svelte"; import Credentials from "./Credentials.svelte";
import Redirect from "./Redirect.svelte"; import Redirect from "./Redirect.svelte";
import Twofactor from "./Twofactor.svelte"; import Twofactor from "./Twofactor.svelte";
@ -10,7 +10,7 @@
credentials: 1, credentials: 1,
twofactor: 3, twofactor: 3,
redirect: 4 redirect: 4
} };
let username = Api.getUsername(); let username = Api.getUsername();
let password = ""; let password = "";
@ -37,7 +37,6 @@
// state = history.state; // state = history.state;
// }) // })
function LoadRedirect() { function LoadRedirect() {
state = states.redirect; state = states.redirect;
} }
@ -46,11 +45,10 @@
state = states.loading; state = states.loading;
} }
let salt; let salt;
async function buttonClick() { async function buttonClick() {
if (state === states.username) { if (state === states.username) {
Loading() Loading();
let res = await Api.setUsername(username); let res = await Api.setUsername(username);
if (res.error) { if (res.error) {
error = res.error; error = res.error;
@ -58,7 +56,6 @@
} else { } else {
LoadPassword(); LoadPassword();
} }
} else if (state === states.password) { } else if (state === states.password) {
Loading(); Loading();
let res = await Api.setPassword(password); let res = await Api.setPassword(password);
@ -97,33 +94,6 @@
} }
</script> </script>
<div class="form-container">
<form action="JavaScript:void(0)" class="card">
<div class="card title-container">
<h1>Login</h1>
</div>
{#if loading}
<div class="loader_container">
<div class="loader_box">
<div class="loader"></div>
</div>
</div>
{/if}
<div class="container" class:loading_container={loading}>
{#if state === states.redirect}
<Redirect/>
{:else if state === states.credentials}
<Credentials next={afterCredentials} setLoading={s => loading = s} />
{:else if state === states.twofactor}
<Twofactor finish={afterTwoFactor} setLoading={s => loading = s} />
{/if}
</div>
</form>
</div>
<footer>
<p>Powered by {appname}</p>
</footer>
<style> <style>
.card { .card {
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
@ -144,14 +114,13 @@
width: 100%; width: 100%;
max-width: 380px; max-width: 380px;
margin: 0 auto; margin: 0 auto;
box-shadow: 0 19px 38px rgba(0, 0, 0, 0.30), 0 15px 12px rgba(0, 0, 0, 0.22); box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
position: relative; position: relative;
padding: 1px; padding: 1px;
background-color: white !important; background-color: white !important;
margin-bottom: 40px; margin-bottom: 40px;
} }
.container { .container {
overflow: hidden; overflow: hidden;
padding: 2em; padding: 2em;
@ -173,8 +142,6 @@
margin-top: 8px; margin-top: 8px;
} }
h3 { h3 {
font-weight: 200; font-weight: 200;
} }
@ -189,7 +156,6 @@
.loading_container { .loading_container {
filter: blur(1px) opacity(50%); filter: blur(1px) opacity(50%);
} }
.loader_container { .loader_container {
@ -203,4 +169,31 @@
right: 0; right: 0;
z-index: 2; z-index: 2;
} }
</style> </style>
<div class="form-container">
<form action="JavaScript:void(0)" class="card">
<div class="card title-container">
<h1>Login</h1>
</div>
{#if loading}
<div class="loader_container">
<div class="loader_box">
<div class="loader" />
</div>
</div>
{/if}
<div class="container" class:loading_container={loading}>
{#if state === states.redirect}
<Redirect />
{:else if state === states.credentials}
<Credentials next={afterCredentials} setLoading={s => (loading = s)} />
{:else if state === states.twofactor}
<Twofactor finish={afterTwoFactor} setLoading={s => (loading = s)} />
{/if}
</div>
</form>
</div>
<footer>
<p>Powered by {appname}</p>
</footer>

View File

@ -1,5 +1,5 @@
<script> <script>
import Api from "./api"; import Api from "./api.ts";
let error; let error;
let password = ""; let password = "";
@ -55,25 +55,31 @@
</style> </style>
{#if state === states.username} {#if state === states.username}
<h3>Enter your Username or your E-Mail Address</h3> <h3>Enter your Username or your E-Mail Address</h3>
<div class="floating group"> <div class="floating group">
<input type="text" autocomplete="username" autofocus bind:value={username}> <input
<span class="highlight"></span> type="text"
<span class="bar"></span> autocomplete="username"
autofocus
bind:value={username} />
<span class="highlight" />
<span class="bar" />
<label>Username or E-Mail</label> <label>Username or E-Mail</label>
<div class="error" style={!error ? "display: none;" : "" }>{error}</div> <div class="error" style={!error ? 'display: none;' : ''}>{error}</div>
</div> </div>
{:else} {:else}
<h3>Enter password for {username}</h3> <h3>Enter password for {username}</h3>
<div class="floating group"> <div class="floating group">
<input type="password" autocomplete="password" autofocus bind:value={password}> <input
<span class="highlight"></span> type="password"
<span class="bar"></span> autocomplete="password"
autofocus
bind:value={password} />
<span class="highlight" />
<span class="bar" />
<label>Password</label> <label>Password</label>
<div class="error" style={!error ? "display: none;" : "" }>{error}</div> <div class="error" style={!error ? 'display: none;' : ''}>{error}</div>
</div> </div>
{/if} {/if}
<button class="btn" on:click={buttonClick}> <button class="btn" on:click={buttonClick}>Next</button>
Next
</button>

View File

@ -1,7 +1,5 @@
<script> <script>
import Api, { import Api, { TFATypes } from "./api.ts";
TFATypes
} from "./api";
import Icon from "./icons/Icon.svelte"; import Icon from "./icons/Icon.svelte";
import OTCTwoFactor from "./twofactors/otc.svelte"; import OTCTwoFactor from "./twofactors/otc.svelte";
@ -11,18 +9,18 @@
const states = { const states = {
list: 1, list: 1,
twofactor: 2 twofactor: 2
} };
function getIcon(tf) { function getIcon(tf) {
switch (tf.type) { switch (tf.type) {
case TFATypes.OTC: case TFATypes.OTC:
return "Authenticator" return "Authenticator";
case TFATypes.BACKUP_CODE: case TFATypes.BACKUP_CODE:
return "BackupCode" return "BackupCode";
case TFATypes.U2F: case TFATypes.U2F:
return "SecurityKey" return "SecurityKey";
case TFATypes.APP_ALLOW: case TFATypes.APP_ALLOW:
return "AppPush" return "AppPush";
} }
} }
@ -30,20 +28,18 @@
return { return {
...tf, ...tf,
icon: getIcon(tf) icon: getIcon(tf)
} };
}); });
let state = states.list; let state = states.list;
let twofactor = undefined; let twofactor = undefined;
twofactor = twofactors[0]; twofactor = twofactors[0];
$: console.log(twofactor) $: console.log(twofactor);
function onFinish(res) { function onFinish(res) {
if (res) if (res) finish();
finish() else twofactor = undefined;
else
twofactor = undefined;
} }
export let finish; export let finish;
@ -84,29 +80,25 @@
<h3>Select your Authentication method:</h3> <h3>Select your Authentication method:</h3>
<ul> <ul>
{#each twofactors as tf} {#each twofactors as tf}
<li on:click={()=>twofactor = tf}> <li on:click={() => (twofactor = tf)}>
<div class="icon"> <div class="icon">
<Icon icon_name={tf.icon}/> <Icon icon_name={tf.icon} />
</div> </div>
<div class="name"> <div class="name">{tf.name}</div>
{tf.name}
</div>
</li> </li>
{/each} {/each}
</ul> </ul>
{:else} {:else if twofactor.type === TFATypes.OTC}
{#if twofactor.type === TFATypes.OTC} <OTCTwoFactor id={twofactor.id} finish={onFinish} otc={true} />
<OTCTwoFactor id={twofactor.id} finish={onFinish} otc={true}/>
{:else if twofactor.type === TFATypes.BACKUP_CODE} {:else if twofactor.type === TFATypes.BACKUP_CODE}
<OTCTwoFactor id={twofactor.id} finish={onFinish} otc={false}/> <OTCTwoFactor id={twofactor.id} finish={onFinish} otc={false} />
{:else if twofactor.type === TFATypes.U2F} {:else if twofactor.type === TFATypes.U2F}
<U2FTwoFactor id={twofactor.id} finish={onFinish}/> <U2FTwoFactor id={twofactor.id} finish={onFinish} />
{:else if twofactor.type === TFATypes.APP_ALLOW} {:else if twofactor.type === TFATypes.APP_ALLOW}
<PushTwoFactor id={twofactor.id} finish={onFinish}/> <PushTwoFactor id={twofactor.id} finish={onFinish} />
{:else} {:else}
<div>Invalid TwoFactor Method!</div> <div>Invalid TwoFactor Method!</div>
{/if} {/if}
{/if}
</div> </div>

View File

@ -18,24 +18,51 @@ export enum TFATypes {
APP_ALLOW APP_ALLOW
} }
const Api = { // const Api = {
// twofactor: [{ // // twofactor: [{
// id: "1", // // id: "1",
// name: "Backup Codes", // // name: "Backup Codes",
// type: TFATypes.BACKUP_CODE // // type: TFATypes.BACKUP_CODE
// }, { // // }, {
// id: "2", // // id: "2",
// name: "YubiKey", // // name: "YubiKey",
// type: TFATypes.U2F // // type: TFATypes.U2F
// }, { // // }, {
// id: "3", // // id: "3",
// name: "Authenticator", // // name: "Authenticator",
// type: TFATypes.OTC // // type: TFATypes.OTC
// }] as TwoFactor[], // // }] as TwoFactor[],
getUsername() {
// }
export interface IToken {
token: string;
expires: string;
}
function makeid(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
export default class Api {
static salt: string;
static login: IToken;
static special: IToken;
static username: string;
static twofactor: any[];
static getUsername() {
return this.username || getCookie("username"); return this.username || getCookie("username");
}, }
async setUsername(username: string): Promise<{ error: string | undefined }> {
static async setUsername(username: string): Promise<{ error: string | undefined }> {
return request("/api/user/login", { return request("/api/user/login", {
type: "username", type: "username",
username username
@ -49,14 +76,17 @@ const Api = {
let error = err.message; let error = err.message;
return { error } return { error }
}) })
}, }
async setPassword(password: string): Promise<{ error: string | undefined, twofactor?: any }> {
let pw = sha(this.salt + password); static async setPassword(password: string): Promise<{ error: string | undefined, twofactor?: any }> {
const date = new Date().valueOf();
let pw = sha(sha(this.salt + password) + date.toString());
return request("/api/user/login", { return request("/api/user/login", {
type: "password" type: "password"
}, "POST", { }, "POST", {
username: this.username, username: this.username,
password: pw password: pw,
date
} }
).then(({ ).then(({
login, login,
@ -80,28 +110,32 @@ const Api = {
let error = err.message; let error = err.message;
return { error } return { error }
}) })
}, }
gettok() {
static gettok() {
return { return {
login: this.login.token, login: this.login.token,
special: this.special.token special: this.special.token
} }
}, }
async sendBackup(id: string, code: string) {
static async sendBackup(id: string, code: string) {
return request("/api/user/twofactor/backup", this.gettok(), "PUT", { code, id }).then(({ login_exp, special_exp }) => { return request("/api/user/twofactor/backup", this.gettok(), "PUT", { code, id }).then(({ login_exp, special_exp }) => {
this.login.expires = login_exp; this.login.expires = login_exp;
this.special.expires = special_exp; this.special.expires = special_exp;
return {}; return {};
}).catch(err => ({ error: err.message })); }).catch(err => ({ error: err.message }));
}, }
async sendOTC(id: string, code: string) {
static async sendOTC(id: string, code: string) {
return request("/api/user/twofactor/otc", this.gettok(), "PUT", { code, id }).then(({ login_exp, special_exp }) => { return request("/api/user/twofactor/otc", this.gettok(), "PUT", { code, id }).then(({ login_exp, special_exp }) => {
this.login.expires = login_exp; this.login.expires = login_exp;
this.special.expires = special_exp; this.special.expires = special_exp;
return {}; return {};
}).catch(error => ({ error: error.message })) }).catch(error => ({ error: error.message }))
}, }
finish() {
static finish() {
let d = new Date() let d = new Date()
d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000)); //Keep the username 30 days d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000)); //Keep the username 30 days
setCookie("username", this.username, d.toUTCString()); setCookie("username", this.username, d.toUTCString());
@ -123,5 +157,3 @@ const Api = {
setTimeout(() => window.location.href = red, 200); setTimeout(() => window.location.href = red, 200);
} }
} }
export default Api;

View File

@ -1,7 +1,7 @@
<script> <script>
import ToList from "./toList.svelte"; import ToList from "./toList.svelte";
import Api from "../api"; import Api from "../api.ts";
import CodeInput from "./codeInput.svelte" import CodeInput from "./codeInput.svelte";
let error = ""; let error = "";
let code = ""; let code = "";
@ -9,7 +9,7 @@
export let id; export let id;
export let otc = false; export let otc = false;
let title = otc ? "One Time Code (OTC)" : "Backup Code" let title = otc ? "One Time Code (OTC)" : "Backup Code";
let length = otc ? 6 : 8; let length = otc ? 6 : 8;
async function sendCode() { async function sendCode() {
@ -19,19 +19,14 @@
} else { } else {
error = ""; error = "";
let res; let res;
if (otc) if (otc) res = await Api.sendOTC(id, c);
res = await Api.sendOTC(id, c); else res = await Api.sendBackup(id, c);
else if (res.error) error = res.error;
res = await Api.sendBackup(id, c); else finish(true);
if (res.error)
error = res.error;
else
finish(true)
} }
} }
</script> </script>
<style> <style>
.actions { .actions {
display: flex; display: flex;
@ -48,9 +43,11 @@
<h3>{title}</h3> <h3>{title}</h3>
<CodeInput bind:value={code} label="Code" error={error} length={length} /> <CodeInput bind:value={code} label="Code" {error} {length} />
<div class="actions"> <div class="actions">
<ToList {finish} /> <ToList {finish} />
<button class="btn" style="margin-left: auto" on:click={sendCode}>Send</button> <button class="btn" style="margin-left: auto" on:click={sendCode}>
Send
</button>
</div> </div>

View File

@ -1,6 +1,6 @@
<script> <script>
export let open; export let open;
export let pages = [] export let pages = [];
</script> </script>
<style> <style>
@ -8,7 +8,6 @@
--rel-size: 0.75rem; --rel-size: 0.75rem;
} }
.container { .container {
height: calc(var(--rel-size) * 3); height: calc(var(--rel-size) * 3);
padding: var(--rel-size); padding: var(--rel-size);
@ -24,7 +23,7 @@
height: calc(var(--rel-size) * 3); height: calc(var(--rel-size) * 3);
} }
.icon>img { .icon > img {
width: calc(var(--rel-size) * 3); width: calc(var(--rel-size) * 3);
height: calc(var(--rel-size) * 3); height: calc(var(--rel-size) * 3);
} }
@ -38,9 +37,9 @@
{#each pages as page} {#each pages as page}
<div class="container" on:click={() => open(page.id)}> <div class="container" on:click={() => open(page.id)}>
<div class="icon"><img src={page.icon} /></div> <div class="icon">
<h3 class="title"> <img src={page.icon} />
{page.title} </div>
</h3> <h3 class="title">{page.title}</h3>
</div> </div>
{/each} {/each}

View File

@ -3,12 +3,11 @@
import BoxItem from "./BoxItem.svelte"; import BoxItem from "./BoxItem.svelte";
import NextIcon from "./NextIcon.svelte"; import NextIcon from "./NextIcon.svelte";
import request from "../../request" import request from "../../request.ts";
export let loading = false; export let loading = false;
let error = undefined; let error = undefined;
const genderMap = new Map(); const genderMap = new Map();
genderMap.set(0, "None"); genderMap.set(0, "None");
genderMap.set(1, "Male"); genderMap.set(1, "Male");
@ -32,34 +31,34 @@
async function loadProfile() { async function loadProfile() {
try { try {
let { let { user } = await request(
user "/api/user/account",
} = await request("/api/user/account", {}, "GET", undefined, true) {},
"GET",
undefined,
true
);
name = user.name; name = user.name;
// username = user.username; // username = user.username;
gender = user.gender; gender = user.gender;
birthday = user.birthday ? new Date(user.birthday).toLocaleDateString() : undefined; birthday = user.birthday
? new Date(user.birthday).toLocaleDateString()
: undefined;
} catch (err) { } catch (err) {
console.error(err); console.error(err);
error = err.message; error = err.message;
} }
} }
let email = ["mail@fabianstamm.de", "fabian.stamm.koe@gmail.com"]; let email = ["mail@fabianstamm.de", "fabian.stamm.koe@gmail.com"];
let phone = ["+1 1233 123123123", "+21 1233 123 123 1"]; let phone = ["+1 1233 123123123", "+21 1233 123 123 1"];
async function loadContact() { async function loadContact() {}
}
async function load() { async function load() {
loading = true; loading = true;
await Promise.all([ await Promise.all([loadProfile(), loadContact()]);
loadProfile(),
loadContact()
])
loading = false; loading = false;
} }
@ -83,7 +82,7 @@
display: flex; display: flex;
} }
.input-container>*:first-child { .input-container > *:first-child {
flex-grow: 1; flex-grow: 1;
} }
@ -103,7 +102,7 @@
width: 100%; width: 100%;
} }
select>option { select > option {
background-color: unset; background-color: unset;
} }
@ -135,9 +134,9 @@
<BoxItem name="Name" value={name}> <BoxItem name="Name" value={name}>
<div class="input-container"> <div class="input-container">
<div class="floating group"> <div class="floating group">
<input type="text" autocomplete="username" bind:value={name}> <input type="text" autocomplete="username" bind:value={name} />
<span class="highlight"></span> <span class="highlight" />
<span class="bar"></span> <span class="bar" />
<label>Name</label> <label>Name</label>
</div> </div>
<button class="btn" on:click={saveName}>Save</button> <button class="btn" on:click={saveName}>Save</button>

View File

@ -1,42 +1,65 @@
<script context="module"> <script context="module">
const TFATypes = new Map() const TFATypes = new Map();
TFATypes.set(0, "Authenticator") TFATypes.set(0, "Authenticator");
TFATypes.set(1, "Backup Codes") TFATypes.set(1, "Backup Codes");
TFATypes.set(2, "YubiKey") TFATypes.set(2, "YubiKey");
TFATypes.set(3, "Push Notification") TFATypes.set(3, "Push Notification");
</script> </script>
<script> <script>
import Box from "./Box.svelte"; import Box from "./Box.svelte";
import BoxItem from "./BoxItem.svelte"; import BoxItem from "./BoxItem.svelte";
import NextIcon from "./NextIcon.svelte"; import NextIcon from "./NextIcon.svelte";
import request from "../../request"; import request from "../../request.ts";
export let loading = false; export let loading = false;
let twofactor = []; let twofactor = [];
async function deleteTFA(id) { async function deleteTFA(id) {
let res = await request("/api/user/twofactor/" + id, undefined, "DELETE", undefined, true); let res = await request(
"/api/user/twofactor/" + id,
undefined,
"DELETE",
undefined,
true
);
loadTwoFactor(); loadTwoFactor();
} }
async function loadTwoFactor() { async function loadTwoFactor() {
let res = await request("/api/user/twofactor", undefined, undefined, undefined, true); let res = await request(
"/api/user/twofactor",
undefined,
undefined,
undefined,
true
);
twofactor = res.methods; twofactor = res.methods;
} }
let token = []; let token = [];
async function revoke(id) { async function revoke(id) {
let res = await request("/api/user/token/" + id, undefined, "DELETE", undefined, true); let res = await request(
"/api/user/token/" + id,
undefined,
"DELETE",
undefined,
true
);
loadToken(); loadToken();
} }
async function loadToken() { async function loadToken() {
loading = true; loading = true;
let res = await request("/api/user/token", undefined, undefined, undefined, true); let res = await request(
"/api/user/token",
undefined,
undefined,
undefined,
true
);
token = res.token; token = res.token;
loading = false; loading = false;
} }
@ -45,13 +68,74 @@
loadTwoFactor(); loadTwoFactor();
</script> </script>
<style>
.btn {
background-color: var(--primary);
margin: auto 0;
margin-left: 1rem;
font-size: 1rem;
padding: 0 0.5rem;
}
.floating {
margin-bottom: 0;
}
.input-container {
display: flex;
}
.input-container > *:first-child {
flex-grow: 1;
}
select {
background-color: unset;
border: 0;
border-radius: 0;
color: unset;
font-size: unset;
border-bottom: 1px solid #757575;
/* Firefox */
-moz-appearance: none;
/* Safari and Chrome */
-webkit-appearance: none;
appearance: none;
height: 100%;
width: 100%;
}
select > option {
background-color: unset;
}
.select-wrapper {
position: relative;
}
.select-wrapper::after {
content: ">";
display: block;
position: absolute;
right: 2rem;
top: 0;
bottom: 0;
width: 1rem;
transform: rotate(90deg) scaleY(2);
}
</style>
<Box> <Box>
<h1>Two Factor</h1> <h1>Two Factor</h1>
<BoxItem name="Add new" open={false}></BoxItem> <BoxItem name="Add new" open={false} />
{#each twofactor as t} {#each twofactor as t}
<BoxItem name={TFATypes.get(t.type)} value={t.name} highlight={t.isthis}> <BoxItem name={TFATypes.get(t.type)} value={t.name} highlight={t.isthis}>
<button class="btn" style="background: var(--error)" on:click={()=>deleteTFA(t.id)}>Delete</button> <button
class="btn"
style="background: var(--error)"
on:click={() => deleteTFA(t.id)}>
Delete
</button>
</BoxItem> </BoxItem>
{/each} {/each}
<!-- <BoxItem name="Name" value={name} open={false}> <!-- <BoxItem name="Name" value={name} open={false}>
@ -86,7 +170,12 @@
{#each token as t} {#each token as t}
<BoxItem name={t.browser} value={t.ip} highlight={t.isthis}> <BoxItem name={t.browser} value={t.ip} highlight={t.isthis}>
<button class="btn" style="background: var(--error)" on:click={()=>revoke(t.id)}>Revoke</button> <button
class="btn"
style="background: var(--error)"
on:click={() => revoke(t.id)}>
Revoke
</button>
</BoxItem> </BoxItem>
{:else} {:else}
<span>No Tokens</span> <span>No Tokens</span>
@ -95,61 +184,3 @@
<!-- <BoxItem name="E-Mail" value={email} /> <!-- <BoxItem name="E-Mail" value={email} />
<BoxItem name="Phone" value={phone} /> --> <BoxItem name="Phone" value={phone} /> -->
</Box> </Box>
<style>
.btn {
background-color: var(--primary);
margin: auto 0;
margin-left: 1rem;
font-size: 1rem;
padding: 0 0.5rem;
}
.floating {
margin-bottom: 0;
}
.input-container {
display: flex;
}
.input-container>*:first-child {
flex-grow: 1;
}
select {
background-color: unset;
border: 0;
border-radius: 0;
color: unset;
font-size: unset;
border-bottom: 1px solid #757575;
/* Firefox */
-moz-appearance: none;
/* Safari and Chrome */
-webkit-appearance: none;
appearance: none;
height: 100%;
width: 100%;
}
select>option {
background-color: unset;
}
.select-wrapper {
position: relative;
}
.select-wrapper::after {
content: ">";
display: block;
position: absolute;
right: 2rem;
top: 0;
bottom: 0;
width: 1rem;
transform: rotate(90deg) scaleY(2);
}
</style>

View File

@ -1,6 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"allowSyntheticDefaultImports": true
// "noImplicitAny": true, // "noImplicitAny": true,
// "removeComments": true, // "removeComments": true,
// "preserveConstEnums": true, // "preserveConstEnums": true,