Welcome back, ' + escapeHtml(name) + '!
'); + } else { + res.write('Hello, new visitor!
'); + } + + res.write(' values + * + * @param {string} str + * @param {object} [options] + * @return {object} + * @public + */ + +function parse(str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string'); + } + + var obj = {} + var opt = options || {}; + var pairs = str.split(pairSplitRegExp); + var dec = opt.decode || decode; + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + var eq_idx = pair.indexOf('='); + + // skip things that don't look like key=value + if (eq_idx < 0) { + continue; + } + + var key = pair.substr(0, eq_idx).trim() + var val = pair.substr(++eq_idx, pair.length).trim(); + + // quoted values + if ('"' == val[0]) { + val = val.slice(1, -1); + } + + // only assign once + if (undefined == obj[key]) { + obj[key] = tryDecode(val, dec); + } + } + + return obj; +} + +/** + * Serialize data into a cookie header. + * + * Serialize the a name value pair into a cookie string suitable for + * http headers. An optional options object specified cookie parameters. + * + * serialize('foo', 'bar', { httpOnly: true }) + * => "foo=bar; httpOnly" + * + * @param {string} name + * @param {string} val + * @param {object} [options] + * @return {string} + * @public + */ + +function serialize(name, val, options) { + var opt = options || {}; + var enc = opt.encode || encode; + + if (typeof enc !== 'function') { + throw new TypeError('option encode is invalid'); + } + + if (!fieldContentRegExp.test(name)) { + throw new TypeError('argument name is invalid'); + } + + var value = enc(val); + + if (value && !fieldContentRegExp.test(value)) { + throw new TypeError('argument val is invalid'); + } + + var str = name + '=' + value; + + if (null != opt.maxAge) { + var maxAge = opt.maxAge - 0; + if (isNaN(maxAge)) throw new Error('maxAge should be a Number'); + str += '; Max-Age=' + Math.floor(maxAge); + } + + if (opt.domain) { + if (!fieldContentRegExp.test(opt.domain)) { + throw new TypeError('option domain is invalid'); + } + + str += '; Domain=' + opt.domain; + } + + if (opt.path) { + if (!fieldContentRegExp.test(opt.path)) { + throw new TypeError('option path is invalid'); + } + + str += '; Path=' + opt.path; + } + + if (opt.expires) { + if (typeof opt.expires.toUTCString !== 'function') { + throw new TypeError('option expires is invalid'); + } + + str += '; Expires=' + opt.expires.toUTCString(); + } + + if (opt.httpOnly) { + str += '; HttpOnly'; + } + + if (opt.secure) { + str += '; Secure'; + } + + if (opt.sameSite) { + var sameSite = typeof opt.sameSite === 'string' + ? opt.sameSite.toLowerCase() : opt.sameSite; + + switch (sameSite) { + case true: + str += '; SameSite=Strict'; + break; + case 'lax': + str += '; SameSite=Lax'; + break; + case 'strict': + str += '; SameSite=Strict'; + break; + default: + throw new TypeError('option sameSite is invalid'); + } + } + + return str; +} + +/** + * Try decoding a string using a decoding function. + * + * @param {string} str + * @param {function} decode + * @private + */ + +function tryDecode(str, decode) { + try { + return decode(str); + } catch (e) { + return str; + } +} diff --git a/node_modules/cookie/package.json b/node_modules/cookie/package.json new file mode 100644 index 0000000..30c355e --- /dev/null +++ b/node_modules/cookie/package.json @@ -0,0 +1,71 @@ +{ + "_from": "cookie@0.3.1", + "_id": "cookie@0.3.1", + "_inBundle": false, + "_integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "_location": "/cookie", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "cookie@0.3.1", + "name": "cookie", + "escapedName": "cookie", + "rawSpec": "0.3.1", + "saveSpec": null, + "fetchSpec": "0.3.1" + }, + "_requiredBy": [ + "/raven" + ], + "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "_shasum": "e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb", + "_spec": "cookie@0.3.1", + "_where": "D:\\Projects\\Homey\\com.sensative\\node_modules\\raven", + "author": { + "name": "Roman Shtylman", + "email": "shtylman@gmail.com" + }, + "bugs": { + "url": "https://github.com/jshttp/cookie/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "deprecated": false, + "description": "HTTP server cookie parsing and serialization", + "devDependencies": { + "istanbul": "0.4.3", + "mocha": "1.21.5" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "homepage": "https://github.com/jshttp/cookie#readme", + "keywords": [ + "cookie", + "cookies" + ], + "license": "MIT", + "name": "cookie", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/cookie.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" + }, + "version": "0.3.1" +} diff --git a/node_modules/homey-log/.npmignore b/node_modules/homey-log/.npmignore new file mode 100644 index 0000000..bb5c8c1 --- /dev/null +++ b/node_modules/homey-log/.npmignore @@ -0,0 +1,2 @@ +/node_modules +.idea \ No newline at end of file diff --git a/node_modules/homey-log/CONTRIBUTING.md b/node_modules/homey-log/CONTRIBUTING.md new file mode 100644 index 0000000..1319dd9 --- /dev/null +++ b/node_modules/homey-log/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# Contributing to Athom and Homey + +First off all, thank you for taking the time to contribute! + +The following is a set of guidelines for contributing to Athom and its packages, which are hosted in the [Athom Organization](https://github.com/athombv) on GitHub. These are just guidelines, not rules. Use your best judgment, and feel free to contact us if you have any questions. + +Please join our [community slack](https://slack.athom.com), if you have not done so already. +We also have a [forum](https://forum.athom.com) for general discussions. + + +## Before submitting a bug or feature request + +* **Have you actually read the error message**? +* Have you searched for similar issues? +* Have you updated homey, all apps, and the development tools (if applicable)? +* Have you checked that it's not a problem with one of the apps you're using, rather than Homey itself? +* Have you looked at what's involved in fixing/implementing this? + +Capable programmers should always attempt to investigate and fix problems themselves before asking for others to help. Submit a pull request instead of an issue! + +Regular support is provided through our [support staff](support@athom.com). + +## A great bug report contains + +* Context – what were you trying to achieve? +* Detailed steps to reproduce the error from scratch. Try isolating the minimal amount of code needed to reproduce the error. +* Any applicable log files or ID's. +* Evidence you've looked into solving the problem and ideally, a theory on the cause and a possible solution. + +## A great feature request contains + +* The current situation. +* How and why the current situation is problematic. +* A detailed proposal or pull request that demonstrates how the problem could be solved. +* A use case – who needs this feature and why? +* Any caveats. + +## A great pull request contains + +* Minimal changes. Only submit code relevant to the current issue. Other changes should go in new pull requests. +* Minimal commits. Please squash to a single commit before sending your pull request. +* No conflicts. Please rebase off the latest master before submitting. +* Code conforming to the existing conventions and formats. i.e. Please don't reformat whitespace. +* Passing tests in the test folder (if applicable). Use existing tests as a reference. +* Relevant documentation. + +## Speeding up your pull request +Merging pull requests takes time. While we always try to merge your pull request as soon as possible, there are certain things you can do to speed up this process. + +* Ask developers to review your code changes and post their feedback. +* Ask users to test your changes and post their feedback. +* Keep your changes to the minimal required amount, and dedicated to one issue/feature only. +* If your PR introduces new features or more than just a small fix, please sign our [Contributor License Agreement](https://go.athom.com/cla). diff --git a/node_modules/homey-log/LICENSE b/node_modules/homey-log/LICENSE new file mode 100644 index 0000000..9cecc1d --- /dev/null +++ b/node_modules/homey-log/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc.File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
---|---|---|---|---|---|---|---|---|---|
raven-node/ | +100% | +7/7 | +100% | +0/0 | +100% | +0/0 | +100% | +7/7 | +|
raven-node/lib/ | +85.53% | +396/463 | +79.51% | +229/288 | +78.26% | +54/69 | +86.31% | +391/453 | +|
raven-node/lib/middleware/ | +50% | +5/10 | +0% | +0/4 | +0% | +0/3 | +50% | +5/10 | +