diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..db01ad9e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# editorconfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +max_line_length = 250 +trim_trailing_whitespace = true + +[*.{js,json}] +indent_size = 4 +indent_style = tab diff --git a/.eslintrc.json b/.eslintrc.json index 00fae289..f24799a5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,6 @@ { - "extends": "eslint:recommended", + "extends": ["eslint:recommended", "plugin:prettier/recommended", "plugin:jsdoc/recommended"], + "plugins": ["prettier", "jsdoc"], "env": { "browser": true, "es6": true, @@ -19,8 +20,9 @@ "ecmaFeatures": { "globalReturn": true } - }, + }, "rules": { + "prettier/prettier": "error", "eqeqeq": "error", "no-prototype-builtins": "off", "no-unused-vars": "off" diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 04cc305d..92423b0b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,5 +1,4 @@ -Contribution Policy for MagicMirror² -==================================== +# Contribution Policy for MagicMirror² Thanks for contributing to MagicMirror²! @@ -30,7 +29,7 @@ Problems installing or configuring your MagicMirror? Check out: [https://forum.m When submitting a new issue, please supply the following information: -**Platform**: Place your platform here... give us your web browser/Electron version *and* your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). +**Platform**: Place your platform here... give us your web browser/Electron version _and_ your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). **Node Version**: Make sure it's version 0.12.13 or later. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 43d92597..e3ececd6 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,28 +1,33 @@ ## I'm not sure if this is a bug + If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: [https://forum.magicmirror.builders/category/15/bug-hunt](https://forum.magicmirror.builders/category/15/bug-hunt) ## I'm having troubles installing or configuring MagicMirror + Problems installing or configuring your MagicMirror? Check out: [https://forum.magicmirror.builders/category/10/troubleshooting](https://forum.magicmirror.builders/category/10/troubleshooting) ## I found a bug in the MagicMirror installer + If you are facing an issue or found a bug while trying to install MagicMirror via the installer please report it in the respective GitHub repository: [https://github.com/sdetweil/MagicMirror_scripts](https://github.com/sdetweil/MagicMirror_scripts) ## I found a bug in the MagicMirror Docker image + If you are facing an issue or found a bug while running MagicMirror inside a Docker container please create an issue in the GitHub repository of the MagicMirror Docker image: [https://github.com/bastilimbach/docker-MagicMirror](https://github.com/bastilimbach/docker-MagicMirror) --- ## I found a bug in MagicMirror -Please make sure to only submit reproducible issues. You can safely remove everything above the dividing line. + +Please make sure to only submit reproducible issues. You can safely remove everything above the dividing line. When submitting a new issue, please supply the following information: -**Platform**: Place your platform here... give us your web browser/Electron version *and* your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). +**Platform**: Place your platform here... give us your web browser/Electron version _and_ your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). **Node Version**: Make sure it's version 8 or later. -**MagicMirror Version**: Please let us now which version of MagicMirror you are running. It can be found in the `package.log` file. +**MagicMirror Version**: Please let us now which version of MagicMirror you are running. It can be found in the `package.log` file. **Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1462d111..28b71616 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,8 +7,7 @@ pull request to send us your changes. This makes everyone's lives easier (including yours) and helps us out on the development team. Thanks! - -* Does the pull request solve a **related** issue? -* If so, can you reference the issue? -* What does the pull request accomplish? Use a list if needed. -* If it includes major visual changes please add screenshots. +- Does the pull request solve a **related** issue? +- If so, can you reference the issue? +- What does the pull request accomplish? Use a list if needed. +- If it includes major visual changes please add screenshots. diff --git a/.gitignore b/.gitignore index c3cf9bdb..08c2df0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # Various Node ignoramuses. - logs *.log npm-debug.log* @@ -13,9 +12,11 @@ build/Release /node_modules/**/* fonts/node_modules/**/* vendor/node_modules/**/* +!/tests/node_modules/**/* jspm_modules .npm .node_repl_history +.nyc_output/ # Visual Studio Code ignoramuses. .vscode/ @@ -53,7 +54,6 @@ Temporary Items .apdisk # Various Linux ignoramuses. - .fuse_hidden* .directory .Trash-* @@ -76,5 +76,3 @@ Temporary Items *.orig *.rej *.bak - -!/tests/node_modules/**/* diff --git a/.markdownlintignore b/.markdownlintignore deleted file mode 100644 index fa766882..00000000 --- a/.markdownlintignore +++ /dev/null @@ -1 +0,0 @@ -modules/default/calendar/vendor/* diff --git a/.markdownlintrc.json b/.markdownlintrc.json deleted file mode 100644 index 6c4443d4..00000000 --- a/.markdownlintrc.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "default": true, - "line-length": false, - "blanks-around-headers": false, - "no-duplicate-header": false, - "no-inline-html": false, - "MD010": false, - "MD001": false, - "MD031": false, - "MD040": false, - "MD002": false, - "MD029": false, - "MD041": false, - "MD032": false, - "MD036": false, - "MD037": false, - "MD009": false, - "MD018": false, - "MD012": false, - "MD026": false, - "MD038": false, - "MD047": false -} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..3b87fcd2 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +package-lock.json +/config/**/* +/vendor/**/* +!/vendor/vendor.js diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..1518304d --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "trailingComma": "none" +} diff --git a/.stylelintrc.json b/.stylelintrc.json index 12500818..d450c732 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,6 +1,7 @@ { - "extends": "stylelint-config-standard", - "font-family-name-quotes": "double-where-recommended", - "block-no-empty": false, - "ignoreFiles": ["./modules/default/alert/ns-default.css"] + "extends": ["stylelint-prettier/recommended"], + "plugins": ["stylelint-prettier"], + "rules": { + "prettier/prettier": true + } } diff --git a/.travis.yml b/.travis.yml index d156ac1b..b2c4ae0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,9 @@ before_script: - "sh -e /etc/init.d/xvfb start" - sleep 5 script: - - npm run test:lint + - npm run test:prettier + - npm run test:js + - npm run test:css - npm run test:e2e - npm run test:unit after_script: diff --git a/CHANGELOG.md b/CHANGELOG.md index fa616f9d..1940fece 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,26 +5,84 @@ This project adheres to [Semantic Versioning](https://semver.org/). ❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² -## [2.12.0] - Unreleased (Develop Branch) +### fixed -*This release is scheduled to be released on 2020-07-01.* +- 2110, 2111, 2118 recurring full day events should not use timezone adjustment. just compare month/day + +## [2.13.0] - Unreleased (Develop Branch - Please add your contributions to this release.) + +_This release is scheduled to be released on 2020-10-01._ ### Added +- `--dry-run` option adde in fetch call within updatenotification node_helper. This is to prevent + MagicMirror from consuming any fetch result. Causes conflict with MMPM when attempting to check + for updates to MagicMirror and/or MagicMirror modules. +- Test coverage with Istanbul, run it with `npm run test:coverage`. +- Add lithuanian language. +- Added support in weatherforecast for OpenWeather onecall API. +- Added config option to calendar-icons for recurring- and fullday-events +- Added current, hourly (max 48), and daily (max 7) weather forecasts to weather module via OpenWeatherMap One Call API +- Added eslint-plugin for jsdoc comments + ### Updated -- Cleaned up alert module code -- Cleaned up check_config code -- Replaced grunt-based linters with their non-grunt equivalents -- Switch to most of the eslint:recommended rules and fix warnings -- Replaced insecure links with https ones -- Cleaned up all "no-undef" warnings from eslint + +- Change incorrect weather.js default properties. +- Cleaned up newsfeed module. +- Cleaned up jsdoc comments. +- Cleaned up clock tests. ### Deleted -- Removed truetype (ttf) fonts ### Fixed -- The broken modules due to Socket.io change from last release [#1973](https://github.com/MichMich/MagicMirror/issues/1973) -- Add backward compatibility for old module code in socketclient.js [#1973](https://github.com/MichMich/MagicMirror/issues/1973) + +- Fix backward compatibility issues for Safari < 11. +- Fix the use of "maxNumberOfDays" in the module "weatherforecast depending on the endpoint (forecast/daily or forecast)". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) +- Fix calendar display. Account for current timezone. [#2068](https://github.com/MichMich/MagicMirror/issues/2068) +- Fix logLevel being set before loading config. +- Fix incorrect namespace links in svg clockfaces. [#2072](https://github.com/MichMich/MagicMirror/issues/2072) +- Fix weather/providers/weathergov for API guidelines. [#2045](https://github.com/MichMich/MagicMirror/issues/2045) +- Fix "undefined" in weather modules header. [#1985](https://github.com/MichMich/MagicMirror/issues/1985) + +## [2.12.0] - 2020-07-01 + +Special thanks to the following contributors: @AndreKoepke, @andrezibaia, @bryanzzhu, @chamakura, @DarthBrento, @Ekristoffe, @khassel, @Legion2, @ndom91, @radokristof, @rejas, @XBCreepinJesus & @ZoneMR. + +ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. + +### Added + +- Added option to config the level of logging. +- Added prettier for an even cleaner codebase. +- Hide Sunrise/Sunset in Weather module. +- Hide Sunrise/Sunset in Current Weather module. +- Added Met Office DataHub (UK) provider. + +### Updated + +- Cleaned up alert module code. +- Cleaned up check_config code. +- Replaced grunt-based linters with their non-grunt equivalents. +- Switch to most of the eslint:recommended rules and fix warnings. +- Replaced insecure links with https ones. +- Cleaned up all "no-undef" warnings from eslint. +- Added location title wrapping for calendar module. +- Updated the BG translation. + +### Deleted + +- Removed truetype (ttf) fonts. + +### Fixed + +- The broken modules due to Socket.io change from last release. [#1973](https://github.com/MichMich/MagicMirror/issues/1973) +- Add backward compatibility for old module code in socketclient.js. [#1973](https://github.com/MichMich/MagicMirror/issues/1973) +- Support multiple instances of calendar module with different config. [#1109](https://github.com/MichMich/MagicMirror/issues/1109) +- Fix the use of "maxNumberOfDays" in the module "weatherforecast". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) +- Throw error when check_config fails. [#1928](https://github.com/MichMich/MagicMirror/issues/1928) +- Bug fix related to 'maxEntries' not displaying Calendar events. [#2050](https://github.com/MichMich/MagicMirror/issues/2050) +- Updated ical library to latest version. [#1926](https://github.com/MichMich/MagicMirror/issues/1926) +- Fix config check after merge of prettier [#2109](https://github.com/MichMich/MagicMirror/issues/2109) ## [2.11.0] - 2020-04-01 @@ -35,11 +93,13 @@ In the past years the project has grown a lot. This came with a huge downside: p For more information regarding this major change, please check issue [#1860](https://github.com/MichMich/MagicMirror/issues/1860). ### Deleted + - Remove installers. - Remove externalized scripts. - Remove jshint dependency, instead eslint checks your config file now ### Added + - Brazilian translation for "FEELS". - Ukrainian translation. - Finnish translation for "PRECIP", "UPDATE_INFO_MULTIPLE" and "UPDATE_INFO_SINGLE". @@ -54,6 +114,7 @@ For more information regarding this major change, please check issue [#1860](htt - Add HTTPS support for clientonly-mode. ### Fixed + - Force declaration of public ip address in config file (ISSUE #1852) - Fixes `run-start.sh`: If running in docker-container, don't check the environment, just start electron (ISSUE #1859) - Fix calendar time offset for recurring events crossing Daylight Savings Time (ISSUE #1798) @@ -64,6 +125,7 @@ For more information regarding this major change, please check issue [#1860](htt - Fix update checking skipping 3rd party modules the first time ### Changed + - Remove documentation from core repository and link to new dedicated docs site: [docs.magicmirror.builders](https://docs.magicmirror.builders). - Updated config.js.sample: Corrected some grammar on `config.js.sample` comment section. - Removed `run-start.sh` script and update start commands: @@ -78,6 +140,7 @@ For more information regarding this major change, please check issue [#1860](htt ## [2.10.1] - 2020-01-10 ### Changed + - Updated README.md: Added links to the official documentation website and remove links to broken installer. ## [2.10.0] - 2020-01-01 @@ -87,12 +150,14 @@ Special thanks to @sdetweil for all his great contributions! ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. ### Added + - Timestamps in log output. - Padding in dateheader mode of the calendar module. - New upgrade script to help users consume regular updates installers/upgrade-script.sh. - New script to help setup pm2, without install installers/fixuppm2.sh. ### Updated + - Updated lower bound of `lodash` and `helmet` dependencies for security patches. - Updated compliments.js to handle newline in text, as textfields to not interpolate contents. - Updated raspberry.sh installer script to handle new platform issues, split node/npm, pm2, and screen saver changes. @@ -101,6 +166,7 @@ Special thanks to @sdetweil for all his great contributions! - Only check for xwindows running if not on macOS. ### Fixed + - Fixed issue in weatherforecast module where predicted amount of rain was not using the decimal symbol specified in config.js. - Module header now updates correctly, if a module need to dynamically show/hide its header based on a condition. - Fix handling of config.js for serverOnly mode commented out. @@ -113,18 +179,21 @@ Special thanks to @sdetweil for all his great contributions! ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). ### Added + - Spanish translation for "PRECIP". - Adding a Malay (Malaysian) translation for MagicMirror². - Add test check URLs of vendors 200 and 404 HTTP CODE. - Add tests for new weather module and helper to stub ajax requests. ### Updated + - Updatenotification module: Display update notification for a limited (configurable) time. - Enabled e2e/vendor_spec.js tests. - The css/custom.css will be renamed after the next release. We've added into `run-start.sh` an instruction by GIT to ignore with `--skip-worktree` and `rm --cached`. [#1540](https://github.com/MichMich/MagicMirror/issues/1540) - Disable sending of notification CLOCK_SECOND when displaySeconds is false. ### Fixed + - Updatenotification module: Properly handle race conditions, prevent crash. - Send `NEWS_FEED` notification also for the first news messages which are shown. - Fixed issue where weather module would not refresh data after a network or API outage. [#1722](https://github.com/MichMich/MagicMirror/issues/1722) @@ -136,6 +205,7 @@ Special thanks to @sdetweil for all his great contributions! ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). ### Added + - Option to show event location in calendar - Finnish translation for "Feels" and "Weeks" - Russian translation for “Feels” @@ -155,6 +225,7 @@ Special thanks to @sdetweil for all his great contributions! - Added to `newsfeed.js`: in order to design the news article better with css, three more class-names were introduced: newsfeed-desc, newsfeed-desc, newsfeed-desc ### Updated + - English translation for "Feels" to "Feels like" - Fixed the example calendar url in `config.js.sample` - Update `ical.js` to solve various calendar issues. @@ -162,6 +233,7 @@ Special thanks to @sdetweil for all his great contributions! - Only update clock once per minute when seconds aren't shown ### Fixed + - Fixed uncaught exception, race condition on module update - Fixed issue [#1696](https://github.com/MichMich/MagicMirror/issues/1696), some ical files start date to not parse to date type - Allowance HTML5 autoplay-policy (policy is changed from Chrome 66 updates) @@ -173,6 +245,7 @@ Special thanks to @sdetweil for all his great contributions! - Updated the fetchedLocationName variable in currentweather.js so that city shows up in the header ### Updated installer + - give non-pi2+ users (pi0, odroid, jetson nano, mac, windows, ...) option to continue install - use current username vs hardcoded 'pi' to support non-pi install - check for npm installed. node install doesn't do npm anymore @@ -189,6 +262,7 @@ Fixed `package.json` version number. ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). ### Added + - Italian translation for "Feels" - Basic Klingon (tlhIngan Hol) translations - Disabled the screensaver on raspbian with installation script @@ -202,12 +276,14 @@ Fixed `package.json` version number. - Add `name` config option for calendars to be sent along with event broadcasts ### Updated + - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) - Updated modernizr code in alert module, fixed a small typo there too - More verbose error message on console if the config is malformed - Updated installer script to install Node.js version 10.x ### Fixed + - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503), [#1511](https://github.com/MichMich/MagicMirror/issues/1511). - Fixed unhandled error on bad git data in updatenotification module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). @@ -216,7 +292,7 @@ Fixed `package.json` version number. - Installation script problems with raspbian - Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) - Calendar: Fix exdate handling when multiple values are specified (comma separated) -- Calendar: Fix relative date handling for fulldate events, calculate difference always from start of day [#1572](https://github.com/MichMich/MagicMirror/issues/1572) +- Calendar: Fix relative date handling for fulldate events, calculate difference always from start of day [#1572](https://github.com/MichMich/MagicMirror/issues/1572) - Fix null dereference in moduleNeedsUpdate when the module isn't visible - Calendar: Fixed event end times by setting default calendarEndTime to "LT" (Local time format). [#1479] - Calendar: Fixed missing calendar fetchers after server process restarts [#1589](https://github.com/MichMich/MagicMirror/issues/1589) @@ -225,6 +301,7 @@ Fixed `package.json` version number. - Fix documentation of `useKMPHwind` option in currentweather ### New weather module + - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Dimmed loading indicator for weather forecast. - Implemented config option `decimalSymbol` [#1499](https://github.com/MichMich/MagicMirror/issues/1499). @@ -242,11 +319,13 @@ Fixed `package.json` version number. ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues updating, make sure you are running the latest version of Node. ### ✨ Experimental ✨ + - New default [module weather](modules/default/weather). This module will eventually replace the current `currentweather` and `weatherforecast` modules. The new module is still pretty experimental, but it's included so you can give it a try and help us improve this module. Please give us you feedback using [this forum post](https://forum.magicmirror.builders/topic/9335/default-weather-module-refactoring). A huge, huge, huge thanks to user @fewieden for all his hard work on the new `weather` module! ### Added + - Possibility to add classes to the cell of symbol, title and time of the events of calendar. - Font-awesome 5, still has 4 for backwards compatibility. - Missing `showEnd` in calendar documentation @@ -261,6 +340,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Documentation for the existing `scale` option in the Weather Forecast module. ### Fixed + - Allow parsing recurring calendar events where the start date is before 1900 - Fixed Polish translation for Single Update Info - Ignore entries with unparseable details in the calendar module @@ -268,15 +348,17 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Bug in newsfeed when `removeStartTags` is used on the description [#1478](https://github.com/MichMich/MagicMirror/issues/1478) ### Updated + - The default calendar setting `showEnd` is changed to `false`. ### Changed -- The Weather Forecast module by default displays the ° symbol after every numeric value to be consistent with the Current Weather module. +- The Weather Forecast module by default displays the ° symbol after every numeric value to be consistent with the Current Weather module. ## [2.5.0] - 2018-10-01 ### Added + - Romanian translation for "Feels" - Support multi-line compliments - Simplified Chinese translation for "Feels" @@ -291,6 +373,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Support for showing end of events through config parameters showEnd and dateEndFormat ### Fixed + - Fixed gzip encoded calendar loading issue #1400. - Mixup between german and spanish translation for newsfeed. - Fixed close dates to be absolute, if no configured in the config.js - module Calendar @@ -336,11 +419,13 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Add update translations for Português Brasileiro ### Changed + - Upgrade to Electron 2.0.0. - Remove yarn-or-npm which breaks production builds. - Invoke module suspend even if no dom content. [#1308](https://github.com/MichMich/MagicMirror/issues/1308) ### Fixed + - Fixed issue where wind chill could not be displayed in Fahrenheit. [#1247](https://github.com/MichMich/MagicMirror/issues/1247) - Fixed issues where a module crashes when it tries to dismiss a non existing alert. [#1240](https://github.com/MichMich/MagicMirror/issues/1240) - In default module currentWeather/currentWeather.js line 296, 300, self.config.animationSpeed can not be found because the notificationReceived function does not have "self" variable. @@ -353,6 +438,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Fixed issue where heat index and wind chill were reporting incorrect values in Kelvin. [#1263](https://github.com/MichMich/MagicMirror/issues/1263) ### Updated + - Updated Italian translation - Updated German translation - Updated Dutch translation @@ -360,6 +446,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we ## [2.3.1] - 2018-04-01 ### Fixed + - Downgrade electron to 1.4.15 to solve the black screen issue.[#1243](https://github.com/MichMich/MagicMirror/issues/1243) ## [2.3.0] - 2018-04-01 @@ -380,6 +467,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Add dc:date to parsing in newsfeed module, which allows parsing of more rss feeds. ### Changed + - Add link to GitHub repository which contains the respective Dockerfile. - Optimized automated unit tests cloneObject, cmpVersions - Update notifications use now translation templates instead of normal strings. @@ -387,6 +475,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Changed Electron dependency to v1.7.13. ### Fixed + - News article in fullscreen (iframe) is now shown in front of modules. - Forecast respects maxNumberOfDays regardless of endpoint. - Fix exception on translation of objects. @@ -404,6 +493,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we ## [2.2.1] - 2018-01-01 ### Fixed + - Fixed linting errors. ## [2.2.0] - 2018-01-01 @@ -411,10 +501,12 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install` ### Changed + - Calendar week is now handled with a variable translation in order to move number language specific. - Reverted the Electron dependency back to 1.4.15 since newer version don't seem to work on the Raspberry Pi very well. ### Added + - Add option to use [Nunjucks](https://mozilla.github.io/nunjucks/) templates in modules. (See `helloworld` module as an example.) - Add Bulgarian translations for MagicMirror² and Alert module. - Add graceful shutdown of modules by calling `stop` function of each `node_helper` on SIGINT before exiting. @@ -428,6 +520,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Add option for decimal symbols other than the decimal point for temperature values in both default weather modules: WeatherForecast and CurrentWeather. ### Fixed + - Fixed issue with calendar module showing more than `maximumEntries` allows - WeatherForecast and CurrentWeather are now using HTTPS instead of HTTP - Correcting translation for Indonesian language @@ -438,9 +531,11 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install` ### Changed + - Remove Roboto fonts files inside `fonts` and these are installed by npm install command. ### Added + - Add `clientonly` script to start only the electron client for a remote server. - Add symbol and color properties of event when `CALENDAR_EVENTS` notification is broadcasted from `default/calendar` module. - Add `.vscode/` folder to `.gitignore` to keep custom Visual Studio Code config out of git. @@ -457,6 +552,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Add Slack badge to Readme. ### Updated + - Changed 'default.js' - listen on all attached interfaces by default. - Add execution of `npm list` after the test are ran in Travis CI. - Change hooks for the vendors e2e tests. @@ -465,6 +561,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Set version of the `express-ipfilter` on 0.3.1. ### Fixed + - Fixed issue with incorrect alignment of analog clock when displayed in the center column of the MM. - Fixed ipWhitelist behaviour to make empty whitelist ([]) allow any and all hosts access to the MM. - Fixed issue with calendar module where 'excludedEvents' count towards 'maximumEntries'. @@ -475,11 +572,13 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we ## [2.1.2] - 2017-07-01 ### Changed + - Revert Docker related changes in favor of [docker-MagicMirror](https://github.com/bastilimbach/docker-MagicMirror). All Docker images are outsourced. ([#856](https://github.com/MichMich/MagicMirror/pull/856)) - Change Docker base image (Debian + Node) to an arm based distro (AlpineARM + Node) ([#846](https://github.com/MichMich/MagicMirror/pull/846)) - Fix the dockerfile to have it running from the first time. ### Added + - Add in option to wrap long calendar events to multiple lines using `wrapEvents` configuration option. - Add test e2e `show title newsfeed` for newsfeed module. - Add task to check configuration file. @@ -498,11 +597,13 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Added Romanian translation. ### Updated + - Added missing keys to Polish translation. - Added missing key to German translation. - Added better translation with flexible word order to Finnish translation. ### Fixed + - Fix instruction in README for using automatically installer script. - Bug of duplicated compliments as described in [here](https://forum.magicmirror.builders/topic/2381/compliments-module-stops-cycling-compliments). - Fix double message about port when server is starting @@ -516,6 +617,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install` ### Changed + - Add `anytime` group for Compliments module. - Compliments module can use remoteFile without default daytime arrays defined. - Installer: Use init config.js from config.js.sample. @@ -531,8 +633,9 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Restructured Test Suite. ### Added + - Added Docker support (Pull Request [#673](https://github.com/MichMich/MagicMirror/pull/673)). -- Calendar-specific support for `maximumEntries`, and ` maximumNumberOfDays`. +- Calendar-specific support for `maximumEntries`, and `maximumNumberOfDays`. - Add loaded function to modules, providing an async callback. - Made default newsfeed module aware of gesture events from [MMM-Gestures](https://github.com/thobach/MMM-Gestures) - Add use pm2 for manager process into Installer RaspberryPi script. @@ -573,6 +676,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Added a configurable Week section to the clock module. ### Fixed + - Update .gitignore to not ignore default modules folder. - Remove white flash on boot up. - Added `update` in Raspberry Pi installation script. @@ -589,6 +693,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install` ### Added + - Finnish translation. - Danish translation. - Turkish translation. @@ -619,6 +724,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Add root_path for global vars ### Updated + - Modified translations for Frysk. - Modified core English translations. - Updated package.json as a result of Snyk security update. @@ -629,6 +735,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Modules are now secure, and Helmet is now used to prevent abuse of the Mirror's API. ### Fixed + - Solve an issue where module margins would appear when the first module of a section was hidden. - Solved visual display errors on chrome, if all modules in one of the right sections are hidden. - Global and Module default config values are no longer modified when setting config values. @@ -639,6 +746,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we ## [2.0.5] - 2016-09-20 ### Added + - Added ability to remove tags from the beginning or end of newsfeed items in 'newsfeed.js'. - Added ability to define "the day after tomorrow" for calendar events (Definition for German and Dutch already included). - Added CII Badge (we are compliant with the CII Best Practices) @@ -646,11 +754,13 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Add the ability to turn off and on the date display in the Clock Module ### Fixed + - Fix typo in installer. - Add message to unsupported Pi error to mention that Pi Zeros must use server only mode, as ARMv6 is unsupported. Closes #374. - Fix API url for weather API. ### Updated + - Force fullscreen when kioskmode is active. - Update the .github templates and information with more modern information. - Update the Gruntfile with a more functional StyleLint implementation. @@ -658,6 +768,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we ## [2.0.4] - 2016-08-07 ### Added + - Brazilian Portuguese Translation. - Option to enable Kiosk mode. - Added ability to start the app with Dev Tools. @@ -665,6 +776,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Greek Translation ### Fixed + - Prevent `getModules()` selectors from returning duplicate entries. - Append endpoints of weather modules with `/` to retrieve the correct data. (Issue [#337](https://github.com/MichMich/MagicMirror/issues/337)) - Corrected grammar in `module.js` from 'suspend' to 'suspended'. @@ -673,55 +785,72 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Fix issue where translation loading prevented the UI start-up when the language was set to 'en'. (Issue [#388](https://github.com/MichMich/MagicMirror/issues/388)) ### Updated + - Updated package.json to fix possible vulnerabilities. (Using Snyk) - Updated weathericons - Updated default weatherforecast to work with the new icons. - More detailed error message in case config file couldn't be loaded. ## [2.0.3] - 2016-07-12 + ### Added + - Add max newsitems parameter to the newsfeed module. - Translations for Simplified Chinese, Traditional Chinese and Japanese. - Polish Translation - Add an analog clock in addition to the digital one. ### Fixed + - Edit Alert Module to display title & message if they are provided in the notification (Issue [#300](https://github.com/MichMich/MagicMirror/issues/300)) - Removed 'null' reference from updateModuleContent(). This fixes recent Edge and Internet Explorer browser displays (Issue [#319](https://github.com/MichMich/MagicMirror/issues/319)) ### Changed + - Added default string to calendar titleReplace. ## [2.0.2] - 2016-06-05 + ### Added + - Norwegian Translations (nb and nn) - Portuguese Translation - Swedish Translation ### Fixed + - Added reference to Italian Translation. - Added the missing NE translation to all languages. [#344](https://github.com/MichMich/MagicMirror/issues/344) - Added proper User-Agent string to calendar call. ### Changed + - Add option to use locationID in weather modules. ## [2.0.1] - 2016-05-18 + ### Added + - Changelog - Italian Translation ### Changed + - Improve the installer by fetching the latest Node.js without any 3rd party interferences. ## [2.0.0] - 2016-05-03 + ### Initial release of MagicMirror² + It includes (but is not limited to) the following features: + - Modular system allowing 3rd party plugins. - An Node/Electron based application taking away the need for external servers or browsers. - A complete development API documentation. - Small cute fairies that kiss you while you sleep. ## [1.0.0] - 2014-02-16 + ### Initial release of MagicMirror. + This was part of the blogpost: [https://michaelteeuw.nl/post/83916869600/magic-mirror-part-vi-production-of-the](https://michaelteeuw.nl/post/83916869600/magic-mirror-part-vi-production-of-the) diff --git a/LICENSE.md b/LICENSE.md index 07c1fb07..ec13937f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,5 +1,4 @@ -The MIT License (MIT) -===================== +# The MIT License (MIT) Copyright © 2016-2019 Michael Teeuw diff --git a/README.md b/README.md index 942f98bf..e09e2e34 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,11 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](https://www.electronjs.org/) as an application wrapper. So no more web server or browser installs necessary! ## Documentation + For the full documentation including **[installation instructions](https://docs.magicmirror.builders/getting-started/installation.html)**, please visit our dedicated documentation website: [https://docs.magicmirror.builders](https://docs.magicmirror.builders). ## Links + - Website: [https://magicmirror.builders](https://magicmirror.builders) - Documentation: [https://docs.magicmirror.builders](https://docs.magicmirror.builders) - Forum: [https://forum.magicmirror.builders](https://forum.magicmirror.builders) @@ -28,7 +30,6 @@ For the full documentation including **[installation instructions](https://docs. Contributions of all kinds are welcome, not only in the form of code but also with regards bug reports and documentation. For the full contribution guidelines, check out: [https://docs.magicmirror.builders/getting-started/contributing.html](https://docs.magicmirror.builders/getting-started/contributing.html) - ## Enjoying MagicMirror? Consider a donation! MagicMirror² is opensource and free. That doesn't mean we don't need any money. diff --git a/clientonly/index.js b/clientonly/index.js index 4b79751f..88454d93 100644 --- a/clientonly/index.js +++ b/clientonly/index.js @@ -4,10 +4,19 @@ (function () { var config = {}; - // Helper function to get server address/hostname from either the commandline or env + /** + * Helper function to get server address/hostname from either the commandline or env + */ function getServerAddress() { - // Helper function to get command line parameters - // Assumes that a cmdline parameter is defined with `--key [value]` + /** + * Get command line parameters + * Assumes that a cmdline parameter is defined with `--key [value]` + * + * @param {string} key key to look for at the command line + * @param {string} defaultValue value if no key is given at the command line + * + * @returns {string} the value of the parameter + */ function getCommandLineParameter(key, defaultValue = undefined) { var index = process.argv.indexOf(`--${key}`); var value = index > -1 ? process.argv[index + 1] : undefined; @@ -23,30 +32,43 @@ config["tls"] = process.argv.indexOf("--use-tls") > 0; } + /** + * Gets the config from the specified server url + * + * @param {string} url location where the server is running. + * + * @returns {Promise} the config + */ function getServerConfig(url) { // Return new pending promise return new Promise((resolve, reject) => { - // Select http or https module, depending on reqested url + // Select http or https module, depending on requested url const lib = url.startsWith("https") ? require("https") : require("http"); const request = lib.get(url, (response) => { var configData = ""; // Gather incoming data - response.on("data", function(chunk) { + response.on("data", function (chunk) { configData += chunk; }); // Resolve promise at the end of the HTTP/HTTPS stream - response.on("end", function() { + response.on("end", function () { resolve(JSON.parse(configData)); }); }); - request.on("error", function(error) { + request.on("error", function (error) { reject(new Error(`Unable to read config from server (${url} (${error.message}`)); }); }); } + /** + * Print a message to the console in case of errors + * + * @param {string} [message] error message to print + * @param {number} code error code for the exit call + */ function fail(message, code = 1) { if (message !== undefined && typeof message === "string") { console.log(message); @@ -96,7 +118,6 @@ console.log(`There something wrong. The clientonly is not running code ${code}`); } }); - }) .catch(function (reason) { fail(`Unable to connect to server: (${reason})`); @@ -104,4 +125,4 @@ } else { fail(); } -}()); +})(); diff --git a/config/config.js.sample b/config/config.js.sample index 40737039..a0164198 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -28,6 +28,7 @@ var config = { httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true language: "en", + logLevel: ["INFO", "LOG", "WARN", "ERROR"], timeFormat: 24, units: "metric", // serverOnly: true/false/"local" , diff --git a/fonts/package.json b/fonts/package.json index 604a492e..7cea509b 100644 --- a/fonts/package.json +++ b/fonts/package.json @@ -1,15 +1,15 @@ { - "name": "magicmirror-fonts", - "description": "Package for fonts use by MagicMirror Core.", - "repository": { - "type": "git", - "url": "git+https://github.com/MichMich/MagicMirror.git" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/MichMich/MagicMirror/issues" - }, - "dependencies": { - "roboto-fontface": "^0.10.0" - } + "name": "magicmirror-fonts", + "description": "Package for fonts use by MagicMirror Core.", + "repository": { + "type": "git", + "url": "git+https://github.com/MichMich/MagicMirror.git" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/MichMich/MagicMirror/issues" + }, + "dependencies": { + "roboto-fontface": "^0.10.0" + } } diff --git a/fonts/roboto.css b/fonts/roboto.css index 853293b8..9bf4fbc9 100644 --- a/fonts/roboto.css +++ b/fonts/roboto.css @@ -2,21 +2,14 @@ font-family: Roboto; font-style: normal; font-weight: 100; - src: - local("Roboto Thin"), - local("Roboto-Thin"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Thin.woff2") format("woff2"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Thin.woff") format("woff"); + src: local("Roboto Thin"), local("Roboto-Thin"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Thin.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Thin.woff") format("woff"); } @font-face { font-family: "Roboto Condensed"; font-style: normal; font-weight: 300; - src: - local("Roboto Condensed Light"), - local("RobotoCondensed-Light"), - url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Light.woff2") format("woff2"), + src: local("Roboto Condensed Light"), local("RobotoCondensed-Light"), url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Light.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Light.woff") format("woff"); } @@ -24,10 +17,7 @@ font-family: "Roboto Condensed"; font-style: normal; font-weight: 400; - src: - local("Roboto Condensed"), - local("RobotoCondensed-Regular"), - url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Regular.woff2") format("woff2"), + src: local("Roboto Condensed"), local("RobotoCondensed-Regular"), url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Regular.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Regular.woff") format("woff"); } @@ -35,10 +25,7 @@ font-family: "Roboto Condensed"; font-style: normal; font-weight: 700; - src: - local("Roboto Condensed Bold"), - local("RobotoCondensed-Bold"), - url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Bold.woff2") format("woff2"), + src: local("Roboto Condensed Bold"), local("RobotoCondensed-Bold"), url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Bold.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Bold.woff") format("woff"); } @@ -46,42 +33,26 @@ font-family: Roboto; font-style: normal; font-weight: 400; - src: - local("Roboto"), - local("Roboto-Regular"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Regular.woff2") format("woff2"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Regular.woff") format("woff"); + src: local("Roboto"), local("Roboto-Regular"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Regular.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Regular.woff") format("woff"); } @font-face { font-family: Roboto; font-style: normal; font-weight: 500; - src: - local("Roboto Medium"), - local("Roboto-Medium"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff2") format("woff2"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff") format("woff"); + src: local("Roboto Medium"), local("Roboto-Medium"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff") format("woff"); } @font-face { font-family: Roboto; font-style: normal; font-weight: 700; - src: - local("Roboto Bold"), - local("Roboto-Bold"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff2") format("woff2"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff") format("woff"); + src: local("Roboto Bold"), local("Roboto-Bold"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff") format("woff"); } @font-face { font-family: Roboto; font-style: normal; font-weight: 300; - src: - local("Roboto Light"), - local("Roboto-Light"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Light.woff2") format("woff2"), - url("node_modules/roboto-fontface/fonts/roboto/Roboto-Light.woff") format("woff"); + src: local("Roboto Light"), local("Roboto-Light"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Light.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Light.woff") format("woff"); } diff --git a/js/app.js b/js/app.js index 852e0d13..64844269 100644 --- a/js/app.js +++ b/js/app.js @@ -5,20 +5,18 @@ * MIT Licensed. */ var fs = require("fs"); +var path = require("path"); +var Log = require(__dirname + "/logger.js"); var Server = require(__dirname + "/server.js"); var Utils = require(__dirname + "/utils.js"); var defaultModules = require(__dirname + "/../modules/default/defaultmodules.js"); -var path = require("path"); // Alias modules mentioned in package.js under _moduleAliases. require("module-alias/register"); -// add timestamps in front of log messages -require("console-stamp")(console, "yyyy-mm-dd HH:MM:ss.l"); - // Get version number. global.version = JSON.parse(fs.readFileSync("package.json", "utf8")).version; -console.log("Starting MagicMirror: v" + global.version); +Log.log("Starting MagicMirror: v" + global.version); // global absolute root path global.root_path = path.resolve(__dirname + "/../"); @@ -36,31 +34,34 @@ if (process.env.MM_PORT) { // The next part is here to prevent a major exception when there // is no internet connection. This could probable be solved better. process.on("uncaughtException", function (err) { - console.log("Whoops! There was an uncaught exception..."); - console.error(err); - console.log("MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?"); - console.log("If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues"); + Log.error("Whoops! There was an uncaught exception..."); + Log.error(err); + Log.error("MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?"); + Log.error("If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues"); }); -/* App - The core app. +/** + * The core app. + * + * @class */ -var App = function() { +var App = function () { var nodeHelpers = []; - /* loadConfig(callback) - * Loads the config file. combines it with the defaults, - * and runs the callback with the found config as argument. + /** + * Loads the config file. Combines it with the defaults, and runs the + * callback with the found config as argument. * - * argument callback function - The callback function. + * @param {Function} callback Function to be called after loading the config */ - var loadConfig = function(callback) { - console.log("Loading config ..."); + var loadConfig = function (callback) { + Log.log("Loading config ..."); var defaults = require(__dirname + "/defaults.js"); // For this check proposed to TestSuite // https://forum.magicmirror.builders/topic/1456/test-suite-for-magicmirror/8 var configFilename = path.resolve(global.root_path + "/config/config.js"); - if (typeof(global.configuration_file) !== "undefined") { + if (typeof global.configuration_file !== "undefined") { configFilename = path.resolve(global.configuration_file); } @@ -72,43 +73,45 @@ var App = function() { callback(config); } catch (e) { if (e.code === "ENOENT") { - console.error(Utils.colors.error("WARNING! Could not find config file. Please create one. Starting with default configuration.")); + Log.error(Utils.colors.error("WARNING! Could not find config file. Please create one. Starting with default configuration.")); } else if (e instanceof ReferenceError || e instanceof SyntaxError) { - console.error(Utils.colors.error("WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: " + e.stack)); + Log.error(Utils.colors.error("WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: " + e.stack)); } else { - console.error(Utils.colors.error("WARNING! Could not load config file. Starting with default configuration. Error found: " + e)); + Log.error(Utils.colors.error("WARNING! Could not load config file. Starting with default configuration. Error found: " + e)); } callback(defaults); } }; - var checkDeprecatedOptions = function(userConfig) { + /** + * Checks the config for deprecated options and throws a warning in the logs + * if it encounters one option from the deprecated.js list + * + * @param {object} userConfig The user config + */ + var checkDeprecatedOptions = function (userConfig) { var deprecated = require(global.root_path + "/js/deprecated.js"); var deprecatedOptions = deprecated.configs; var usedDeprecated = []; - deprecatedOptions.forEach(function(option) { + deprecatedOptions.forEach(function (option) { if (userConfig.hasOwnProperty(option)) { usedDeprecated.push(option); } }); if (usedDeprecated.length > 0) { - console.warn(Utils.colors.warn( - "WARNING! Your config is using deprecated options: " + - usedDeprecated.join(", ") + - ". Check README and CHANGELOG for more up-to-date ways of getting the same functionality.") - ); + Log.warn(Utils.colors.warn("WARNING! Your config is using deprecated options: " + usedDeprecated.join(", ") + ". Check README and CHANGELOG for more up-to-date ways of getting the same functionality.")); } }; - /* loadModule(module) + /** * Loads a specific module. * - * argument module string - The name of the module (including subpath). + * @param {string} module The name of the module (including subpath). + * @param {Function} callback Function to be called after loading */ - var loadModule = function(module, callback) { - + var loadModule = function (module, callback) { var elements = module.split("/"); var moduleName = elements[elements.length - 1]; var moduleFolder = __dirname + "/../modules/" + module; @@ -124,7 +127,7 @@ var App = function() { fs.accessSync(helperPath, fs.R_OK); } catch (e) { loadModule = false; - console.log("No helper found for module: " + moduleName + "."); + Log.log("No helper found for module: " + moduleName + "."); } if (loadModule) { @@ -132,11 +135,11 @@ var App = function() { var m = new Module(); if (m.requiresVersion) { - console.log("Check MagicMirror version for node helper '" + moduleName + "' - Minimum version: " + m.requiresVersion + " - Current version: " + global.version); + Log.log("Check MagicMirror version for node helper '" + moduleName + "' - Minimum version: " + m.requiresVersion + " - Current version: " + global.version); if (cmpVersions(global.version, m.requiresVersion) >= 0) { - console.log("Version is ok!"); + Log.log("Version is ok!"); } else { - console.log("Version is incorrect. Skip module: '" + moduleName + "'"); + Log.log("Version is incorrect. Skip module: '" + moduleName + "'"); return; } } @@ -151,24 +154,25 @@ var App = function() { } }; - /* loadModules(modules) + /** * Loads all modules. * - * argument module string - The name of the module (including subpath). + * @param {Module[]} modules All modules to be loaded + * @param {Function} callback Function to be called after loading */ - var loadModules = function(modules, callback) { - console.log("Loading module helpers ..."); + var loadModules = function (modules, callback) { + Log.log("Loading module helpers ..."); - var loadNextModule = function() { + var loadNextModule = function () { if (modules.length > 0) { var nextModule = modules[0]; - loadModule(nextModule, function() { + loadModule(nextModule, function () { modules = modules.slice(1); loadNextModule(); }); } else { // All modules are loaded - console.log("All module helpers loaded."); + Log.log("All module helpers loaded."); callback(); } }; @@ -176,11 +180,14 @@ var App = function() { loadNextModule(); }; - /* cmpVersions(a,b) + /** * Compare two semantic version numbers and return the difference. * - * argument a string - Version number a. - * argument a string - Version number b. + * @param {string} a Version number a. + * @param {string} b Version number b. + * + * @returns {number} A positive number if a is larger than b, a negative + * number if a is smaller and 0 if they are the same */ function cmpVersions(a, b) { var i, diff; @@ -198,18 +205,20 @@ var App = function() { return segmentsA.length - segmentsB.length; } - /* start(callback) - * This methods starts the core app. - * It loads the config, then it loads all modules. - * When it's done it executes the callback with the config as argument. + /** + * Start the core app. * - * argument callback function - The callback function. + * It loads the config, then it loads all modules. When it's done it + * executes the callback with the config as argument. + * + * @param {Function} callback Function to be called after start */ - this.start = function(callback) { - - loadConfig(function(c) { + this.start = function (callback) { + loadConfig(function (c) { config = c; + Log.setLogLevel(config.logLevel); + var modules = []; for (var m in config.modules) { @@ -219,9 +228,9 @@ var App = function() { } } - loadModules(modules, function() { - var server = new Server(config, function(app, io) { - console.log("Server started ..."); + loadModules(modules, function () { + var server = new Server(config, function (app, io) { + Log.log("Server started ..."); for (var h in nodeHelpers) { var nodeHelper = nodeHelpers[h]; @@ -230,7 +239,7 @@ var App = function() { nodeHelper.start(); } - console.log("Sockets connected & modules started ..."); + Log.log("Sockets connected & modules started ..."); if (typeof callback === "function") { callback(config); @@ -240,12 +249,13 @@ var App = function() { }); }; - /* stop() - * This methods stops the core app. - * This calls each node_helper's STOP() function, if it exists. + /** + * Stops the core app. This calls each node_helper's STOP() function, if it + * exists. + * * Added to fix #1056 */ - this.stop = function() { + this.stop = function () { for (var h in nodeHelpers) { var nodeHelper = nodeHelpers[h]; if (typeof nodeHelper.stop === "function") { @@ -254,24 +264,31 @@ var App = function() { } }; - /* Listen for SIGINT signal and call stop() function. + /** + * Listen for SIGINT signal and call stop() function. * * Added to fix #1056 * Note: this is only used if running `server-only`. Otherwise * this.stop() is called by app.on("before-quit"... in `electron.js` */ process.on("SIGINT", () => { - console.log("[SIGINT] Received. Shutting down server..."); - setTimeout(() => { process.exit(0); }, 3000); // Force quit after 3 seconds + Log.log("[SIGINT] Received. Shutting down server..."); + setTimeout(() => { + process.exit(0); + }, 3000); // Force quit after 3 seconds this.stop(); process.exit(0); }); - /* We also need to listen to SIGTERM signals so we stop everything when we are asked to stop by the OS. + /** + * Listen to SIGTERM signals so we can stop everything when we + * are asked to stop by the OS. */ process.on("SIGTERM", () => { - console.log("[SIGTERM] Received. Shutting down server..."); - setTimeout(() => { process.exit(0); }, 3000); // Force quit after 3 seconds + Log.log("[SIGTERM] Received. Shutting down server..."); + setTimeout(() => { + process.exit(0); + }, 3000); // Force quit after 3 seconds this.stop(); process.exit(0); }); diff --git a/js/check_config.js b/js/check_config.js index f73e4bf9..2bab5220 100644 --- a/js/check_config.js +++ b/js/check_config.js @@ -1,14 +1,10 @@ /* Magic Mirror * - * Checker configuration file - * - * By Rodrigo Ramírez Norambuena - * https://rodrigoramirez.com + * Check the configuration file for errors * + * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * MIT Licensed. - * */ - const Linter = require("eslint").Linter; const linter = new Linter(); @@ -16,12 +12,14 @@ const path = require("path"); const fs = require("fs"); const rootPath = path.resolve(__dirname + "/../"); -const config = require(rootPath + "/.eslintrc.json"); +const Log = require(rootPath + "/js/logger.js"); const Utils = require(rootPath + "/js/utils.js"); -/* getConfigFile() - * Return string with path of configuration file +/** + * Returns a string with path of configuration file. * Check if set by environment variable MM_CONFIG_FILE + * + * @returns {string} path and filename of the config file */ function getConfigFile() { // FIXME: This function should be in core. Do you want refactor me ;) ?, be good! @@ -32,35 +30,42 @@ function getConfigFile() { return configFileName; } +/** + * Checks the config file using eslint. + */ function checkConfigFile() { const configFileName = getConfigFile(); + // Check if file is present if (fs.existsSync(configFileName) === false) { - console.error(Utils.colors.error("File not found: "), configFileName); - return; + Log.error(Utils.colors.error("File not found: "), configFileName); + throw new Error("No config file present!"); } - // check permission + + // Check permission try { fs.accessSync(configFileName, fs.F_OK); } catch (e) { - console.log(Utils.colors.error(e)); - return; + Log.log(Utils.colors.error(e)); + throw new Error("No permission to access config file!"); } // Validate syntax of the configuration file. - // In case the there errors show messages and - // return - console.info(Utils.colors.info("Checking file... "), configFileName); + Log.info(Utils.colors.info("Checking file... "), configFileName); + // I'm not sure if all ever is utf-8 fs.readFile(configFileName, "utf-8", function (err, data) { - if (err) { throw err; } - const messages = linter.verify(data, config); + if (err) { + throw err; + } + const messages = linter.verify(data); if (messages.length === 0) { - console.log("Your configuration file doesn't contain syntax errors :)"); - return true; + Log.info(Utils.colors.pass("Your configuration file doesn't contain syntax errors :)")); } else { - messages.forEach(error => { - console.log("Line", error.line, "col", error.column, error.message); + Log.error(Utils.colors.error("Your configuration file contains syntax errors :(")); + // In case the there errors show messages and return + messages.forEach((error) => { + Log.error("Line", error.line, "col", error.column, error.message); }); } }); diff --git a/js/class.js b/js/class.js index aab1799e..9c46a894 100644 --- a/js/class.js +++ b/js/class.js @@ -9,10 +9,14 @@ */ (function () { var initializing = false; - var fnTest = /xyz/.test(function () { xyz; }) ? /\b_super\b/ : /.*/; + var fnTest = /xyz/.test(function () { + xyz; + }) + ? /\b_super\b/ + : /.*/; // The base Class implementation (does nothing) - this.Class = function () { }; + this.Class = function () {}; // Create a new Class that inherits from this class Class.extend = function (prop) { @@ -32,26 +36,30 @@ // Copy the properties over onto the new prototype for (var name in prop) { // Check if we're overwriting an existing function - prototype[name] = typeof prop[name] === "function" && - typeof _super[name] === "function" && fnTest.test(prop[name]) ? (function (name, fn) { - return function () { - var tmp = this._super; + prototype[name] = + typeof prop[name] === "function" && typeof _super[name] === "function" && fnTest.test(prop[name]) + ? (function (name, fn) { + return function () { + var tmp = this._super; - // Add a new ._super() method that is the same method - // but on the super-class - this._super = _super[name]; + // Add a new ._super() method that is the same method + // but on the super-class + this._super = _super[name]; - // The method only need to be bound temporarily, so we - // remove it when we're done executing - var ret = fn.apply(this, arguments); - this._super = tmp; + // The method only need to be bound temporarily, so we + // remove it when we're done executing + var ret = fn.apply(this, arguments); + this._super = tmp; - return ret; - }; - })(name, prop[name]) : prop[name]; + return ret; + }; + })(name, prop[name]) + : prop[name]; } - // The dummy class constructor + /** + * The dummy class constructor + */ function Class() { // All construction is actually done in the init method if (!initializing && this.init) { @@ -72,8 +80,13 @@ }; })(); -//Define the clone method for later use. -//Helper Method +/** + * Define the clone method for later use. Helper Method. + * + * @param {object} obj Object to be cloned + * + * @returns {object} the cloned object + */ function cloneObject(obj) { if (obj === null || typeof obj !== "object") { return obj; diff --git a/js/defaults.js b/js/defaults.js index 36275e6c..c1a53396 100644 --- a/js/defaults.js +++ b/js/defaults.js @@ -8,7 +8,7 @@ */ var address = "localhost"; var port = 8080; -if (typeof(mmPort) !== "undefined") { +if (typeof mmPort !== "undefined") { port = mmPort; } var defaults = { @@ -68,14 +68,16 @@ var defaults = { config: { text: "www.michaelteeuw.nl" } - }, + } ], paths: { modules: "modules", vendor: "vendor" - }, + } }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = defaults;} +if (typeof module !== "undefined") { + module.exports = defaults; +} diff --git a/js/deprecated.js b/js/deprecated.js index 1f832e81..4f56b41d 100644 --- a/js/deprecated.js +++ b/js/deprecated.js @@ -7,8 +7,10 @@ */ var deprecated = { - configs: ["kioskmode"], + configs: ["kioskmode"] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = deprecated;} +if (typeof module !== "undefined") { + module.exports = deprecated; +} diff --git a/js/electron.js b/js/electron.js index e5406de6..216dee48 100644 --- a/js/electron.js +++ b/js/electron.js @@ -1,7 +1,8 @@ "use strict"; const electron = require("electron"); -const core = require(__dirname + "/app.js"); +const core = require("./app.js"); +const Log = require("./logger.js"); // Config var config = process.env.config ? JSON.parse(process.env.config) : {}; @@ -14,6 +15,9 @@ const BrowserWindow = electron.BrowserWindow; // be closed automatically when the JavaScript object is garbage collected. let mainWindow; +/** + * + */ function createWindow() { app.commandLine.appendSwitch("autoplay-policy", "no-user-gesture-required"); var electronOptionsDefaults = { @@ -62,21 +66,21 @@ function createWindow() { } // Set responders for window events. - mainWindow.on("closed", function() { + mainWindow.on("closed", function () { mainWindow = null; }); if (config.kioskmode) { - mainWindow.on("blur", function() { + mainWindow.on("blur", function () { mainWindow.focus(); }); - mainWindow.on("leave-full-screen", function() { + mainWindow.on("leave-full-screen", function () { mainWindow.setFullScreen(true); }); - mainWindow.on("resize", function() { - setTimeout(function() { + mainWindow.on("resize", function () { + setTimeout(function () { mainWindow.reload(); }, 1000); }); @@ -85,17 +89,17 @@ function createWindow() { // This method will be called when Electron has finished // initialization and is ready to create browser windows. -app.on("ready", function() { - console.log("Launching application."); +app.on("ready", function () { + Log.log("Launching application."); createWindow(); }); // Quit when all windows are closed. -app.on("window-all-closed", function() { +app.on("window-all-closed", function () { createWindow(); }); -app.on("activate", function() { +app.on("activate", function () { // On OS X it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (mainWindow === null) { @@ -110,9 +114,11 @@ app.on("activate", function() { * core.stop() is called by process.on("SIGINT"... in `app.js` */ app.on("before-quit", (event) => { - console.log("Shutting down server..."); + Log.log("Shutting down server..."); event.preventDefault(); - setTimeout(() => { process.exit(0); }, 3000); // Force-quit after 3 seconds. + setTimeout(() => { + process.exit(0); + }, 3000); // Force-quit after 3 seconds. core.stop(); process.exit(0); }); @@ -120,7 +126,7 @@ app.on("before-quit", (event) => { // Start the core application if server is run on localhost // This starts all node helpers and starts the webserver. if (["localhost", "127.0.0.1", "::1", "::ffff:127.0.0.1", undefined].indexOf(config.address) > -1) { - core.start(function(c) { + core.start(function (c) { config = c; }); } diff --git a/js/loader.js b/js/loader.js index c69f92ae..4ba75578 100644 --- a/js/loader.js +++ b/js/loader.js @@ -6,8 +6,7 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -var Loader = (function() { - +var Loader = (function () { /* Create helper variables */ var loadedModuleFiles = []; @@ -16,17 +15,16 @@ var Loader = (function() { /* Private Methods */ - /* loadModules() + /** * Loops thru all modules and requests load for every module. */ - var loadModules = function() { - + var loadModules = function () { var moduleData = getModuleData(); - var loadNextModule = function() { + var loadNextModule = function () { if (moduleData.length > 0) { var nextModule = moduleData[0]; - loadModule(nextModule, function() { + loadModule(nextModule, function () { moduleData = moduleData.slice(1); loadNextModule(); }); @@ -35,21 +33,20 @@ var Loader = (function() { // This is done after all the modules so we can // overwrite all the defined styles. - loadFile(config.customCss, function() { + loadFile(config.customCss, function () { // custom.css loaded. Start all modules. startModules(); }); - } }; loadNextModule(); }; - /* startModules() + /** * Loops thru all modules and requests start for every module. */ - var startModules = function() { + var startModules = function () { for (var m in moduleObjects) { var module = moduleObjects[m]; module.start(); @@ -59,21 +56,21 @@ var Loader = (function() { MM.modulesStarted(moduleObjects); }; - /* getAllModules() + /** * Retrieve list of all modules. * - * return array - module data as configured in config + * @returns {object[]} module data as configured in config */ - var getAllModules = function() { + var getAllModules = function () { return config.modules; }; - /* getModuleData() + /** * Generate array with module information including module paths. * - * return array - Module information. + * @returns {object[]} Module information. */ - var getModuleData = function() { + var getModuleData = function () { var modules = getAllModules(); var moduleFiles = []; @@ -97,31 +94,31 @@ var Loader = (function() { index: m, identifier: "module_" + m + "_" + module, name: moduleName, - path: moduleFolder + "/" , + path: moduleFolder + "/", file: moduleName + ".js", position: moduleData.position, header: moduleData.header, config: moduleData.config, - classes: (typeof moduleData.classes !== "undefined") ? moduleData.classes + " " + module : module + classes: typeof moduleData.classes !== "undefined" ? moduleData.classes + " " + module : module }); } return moduleFiles; }; - /* loadModule(module) - * Load modules via ajax request and create module objects. + /** + * Load modules via ajax request and create module objects.s * - * argument callback function - Function called when done. - * argument module object - Information about the module we want to load. + * @param {object} module Information about the module we want to load. + * @param {Function} callback Function called when done. */ - var loadModule = function(module, callback) { + var loadModule = function (module, callback) { var url = module.path + "/" + module.file; - var afterLoad = function() { + var afterLoad = function () { var moduleObject = Module.create(module.name); if (moduleObject) { - bootstrapModule(module, moduleObject, function() { + bootstrapModule(module, moduleObject, function () { callback(); }); } else { @@ -132,30 +129,30 @@ var Loader = (function() { if (loadedModuleFiles.indexOf(url) !== -1) { afterLoad(); } else { - loadFile(url, function() { + loadFile(url, function () { loadedModuleFiles.push(url); afterLoad(); }); } }; - /* bootstrapModule(module, mObj) + /** * Bootstrap modules by setting the module data and loading the scripts & styles. * - * argument module object - Information about the module we want to load. - * argument mObj object - Modules instance. - * argument callback function - Function called when done. + * @param {object} module Information about the module we want to load. + * @param {Module} mObj Modules instance. + * @param {Function} callback Function called when done. */ - var bootstrapModule = function(module, mObj, callback) { + var bootstrapModule = function (module, mObj, callback) { Log.info("Bootstrapping module: " + module.name); mObj.setData(module); - mObj.loadScripts(function() { + mObj.loadScripts(function () { Log.log("Scripts loaded for: " + module.name); - mObj.loadStyles(function() { + mObj.loadStyles(function () { Log.log("Styles loaded for: " + module.name); - mObj.loadTranslations(function() { + mObj.loadTranslations(function () { Log.log("Translations loaded for: " + module.name); moduleObjects.push(mObj); callback(); @@ -164,71 +161,76 @@ var Loader = (function() { }); }; - /* loadFile(fileName) + /** * Load a script or stylesheet by adding it to the dom. * - * argument fileName string - Path of the file we want to load. - * argument callback function - Function called when done. + * @param {string} fileName Path of the file we want to load. + * @param {Function} callback Function called when done. */ - var loadFile = function(fileName, callback) { - + var loadFile = function (fileName, callback) { var extension = fileName.slice((Math.max(0, fileName.lastIndexOf(".")) || Infinity) + 1); switch (extension.toLowerCase()) { - case "js": - Log.log("Load script: " + fileName); - var script = document.createElement("script"); - script.type = "text/javascript"; - script.src = fileName; - script.onload = function() { - if (typeof callback === "function") {callback();} - }; - script.onerror = function() { - console.error("Error on loading script:", fileName); - if (typeof callback === "function") {callback();} - }; + case "js": + Log.log("Load script: " + fileName); + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = fileName; + script.onload = function () { + if (typeof callback === "function") { + callback(); + } + }; + script.onerror = function () { + Log.error("Error on loading script:", fileName); + if (typeof callback === "function") { + callback(); + } + }; - document.getElementsByTagName("body")[0].appendChild(script); - break; - case "css": - Log.log("Load stylesheet: " + fileName); - var stylesheet = document.createElement("link"); - stylesheet.rel = "stylesheet"; - stylesheet.type = "text/css"; - stylesheet.href = fileName; - stylesheet.onload = function() { - if (typeof callback === "function") {callback();} - }; - stylesheet.onerror = function() { - console.error("Error on loading stylesheet:", fileName); - if (typeof callback === "function") {callback();} - }; + document.getElementsByTagName("body")[0].appendChild(script); + break; + case "css": + Log.log("Load stylesheet: " + fileName); + var stylesheet = document.createElement("link"); + stylesheet.rel = "stylesheet"; + stylesheet.type = "text/css"; + stylesheet.href = fileName; + stylesheet.onload = function () { + if (typeof callback === "function") { + callback(); + } + }; + stylesheet.onerror = function () { + Log.error("Error on loading stylesheet:", fileName); + if (typeof callback === "function") { + callback(); + } + }; - document.getElementsByTagName("head")[0].appendChild(stylesheet); - break; + document.getElementsByTagName("head")[0].appendChild(stylesheet); + break; } }; /* Public Methods */ return { - - /* loadModules() + /** * Load all modules as defined in the config. */ - loadModules: function() { + loadModules: function () { loadModules(); }, - /* loadFile() + /** * Load a file (script or stylesheet). * Prevent double loading and search for files in the vendor folder. * - * argument fileName string - Path of the file we want to load. - * argument module Module Object - the module that calls the loadFile function. - * argument callback function - Function called when done. + * @param {string} fileName Path of the file we want to load. + * @param {Module} module The module that calls the loadFile function. + * @param {Function} callback Function called when done. */ - loadFile: function(fileName, module, callback) { - + loadFile: function (fileName, module, callback) { if (loadedFiles.indexOf(fileName.toLowerCase()) !== -1) { Log.log("File already loaded: " + fileName); callback(); diff --git a/js/logger.js b/js/logger.js index 60d91b2f..0f33b473 100644 --- a/js/logger.js +++ b/js/logger.js @@ -1,15 +1,27 @@ /* Magic Mirror - * Logger + * Log + * * This logger is very simple, but needs to be extended. * This system can eventually be used to push the log messages to an external target. * * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -const Log = (function() { - return { +(function (root, factory) { + if (typeof exports === "object") { + // add timestamps in front of log messages + require("console-stamp")(console, "yyyy-mm-dd HH:MM:ss.l"); + + // Node, CommonJS-like + module.exports = factory(root.config); + } else { + // Browser globals (root is window) + root.Log = factory(root.config); + } +})(this, function (config) { + const logLevel = { info: Function.prototype.bind.call(console.info, console), - log: Function.prototype.bind.call(console.log, console), + log: Function.prototype.bind.call(console.log, console), error: Function.prototype.bind.call(console.error, console), warn: Function.prototype.bind.call(console.warn, console), group: Function.prototype.bind.call(console.group, console), @@ -19,4 +31,16 @@ const Log = (function() { timeEnd: Function.prototype.bind.call(console.timeEnd, console), timeStamp: Function.prototype.bind.call(console.timeStamp, console) }; -})(); + + logLevel.setLogLevel = function (newLevel) { + if (newLevel) { + Object.keys(logLevel).forEach(function (key, index) { + if (!newLevel.includes(key.toLocaleUpperCase())) { + logLevel[key] = function () {}; + } + }); + } + }; + + return logLevel; +}); diff --git a/js/main.js b/js/main.js index 117aed10..9d241a07 100644 --- a/js/main.js +++ b/js/main.js @@ -6,20 +6,18 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -var MM = (function() { - +var MM = (function () { var modules = []; /* Private Methods */ - /* createDomObjects() - * Create dom objects for all modules that - * are configured for a specific position. + /** + * Create dom objects for all modules that are configured for a specific position. */ - var createDomObjects = function() { + var createDomObjects = function () { var domCreationPromises = []; - modules.forEach(function(module) { + modules.forEach(function (module) { if (typeof module.data.position !== "string") { return; } @@ -43,7 +41,9 @@ var MM = (function() { dom.appendChild(moduleHeader); if (typeof module.getHeader() === "undefined" || module.getHeader() !== "") { - moduleHeader.style = "display: none;"; + moduleHeader.style.display = "none;"; + } else { + moduleHeader.style.display = "block;"; } var moduleContent = document.createElement("div"); @@ -52,25 +52,29 @@ var MM = (function() { var domCreationPromise = updateDom(module, 0); domCreationPromises.push(domCreationPromise); - domCreationPromise.then(function() { - sendNotification("MODULE_DOM_CREATED", null, null, module); - }).catch(Log.error); + domCreationPromise + .then(function () { + sendNotification("MODULE_DOM_CREATED", null, null, module); + }) + .catch(Log.error); }); updateWrapperStates(); - Promise.all(domCreationPromises).then(function() { + Promise.all(domCreationPromises).then(function () { sendNotification("DOM_OBJECTS_CREATED"); }); }; - /* selectWrapper(position) + /** * Select the wrapper dom object for a specific position. * - * argument position string - The name of the position. + * @param {string} position The name of the position. + * + * @returns {HTMLElement} the wrapper element */ - var selectWrapper = function(position) { - var classes = position.replace("_"," "); + var selectWrapper = function (position) { + var classes = position.replace("_", " "); var parentWrapper = document.getElementsByClassName(classes); if (parentWrapper.length > 0) { var wrapper = parentWrapper[0].getElementsByClassName("container"); @@ -80,15 +84,15 @@ var MM = (function() { } }; - /* sendNotification(notification, payload, sender) + /** * Send a notification to all modules. * - * argument notification string - The identifier of the notification. - * argument payload mixed - The payload of the notification. - * argument sender Module - The module that sent the notification. - * argument sendTo Module - The module to send the notification to. (optional) + * @param {string} notification The identifier of the notification. + * @param {*} payload The payload of the notification. + * @param {Module} sender The module that sent the notification. + * @param {Module} [sendTo] The (optional) module to send the notification to. */ - var sendNotification = function(notification, payload, sender, sendTo) { + var sendNotification = function (notification, payload, sender, sendTo) { for (var m in modules) { var module = modules[m]; if (module !== sender && (!sendTo || module === sendTo)) { @@ -97,16 +101,16 @@ var MM = (function() { } }; - /* updateDom(module, speed) + /** * Update the dom for a specific module. * - * argument module Module - The module that needs an update. - * argument speed Number - The number of microseconds for the animation. (optional) + * @param {Module} module The module that needs an update. + * @param {number} [speed] The (optional) number of microseconds for the animation. * - * return Promise - Resolved when the dom is fully updated. + * @returns {Promise} Resolved when the dom is fully updated. */ - var updateDom = function(module, speed) { - return new Promise(function(resolve) { + var updateDom = function (module, speed) { + return new Promise(function (resolve) { var newContentPromise = module.getDom(); var newHeader = module.getHeader(); @@ -115,26 +119,28 @@ var MM = (function() { newContentPromise = Promise.resolve(newContentPromise); } - newContentPromise.then(function(newContent) { - var updatePromise = updateDomWithContent(module, speed, newHeader, newContent); + newContentPromise + .then(function (newContent) { + var updatePromise = updateDomWithContent(module, speed, newHeader, newContent); - updatePromise.then(resolve).catch(Log.error); - }).catch(Log.error); + updatePromise.then(resolve).catch(Log.error); + }) + .catch(Log.error); }); }; - /* updateDomWithContent(module, speed, newHeader, newContent) + /** * Update the dom with the specified content * - * argument module Module - The module that needs an update. - * argument speed Number - The number of microseconds for the animation. (optional) - * argument newHeader String - The new header that is generated. - * argument newContent Domobject - The new content that is generated. + * @param {Module} module The module that needs an update. + * @param {number} [speed] The (optional) number of microseconds for the animation. + * @param {string} newHeader The new header that is generated. + * @param {HTMLElement} newContent The new content that is generated. * - * return Promise - Resolved when the module dom has been updated. + * @returns {Promise} Resolved when the module dom has been updated. */ - var updateDomWithContent = function(module, speed, newHeader, newContent) { - return new Promise(function(resolve) { + var updateDomWithContent = function (module, speed, newHeader, newContent) { + return new Promise(function (resolve) { if (module.hidden || !speed) { updateModuleContent(module, newHeader, newContent); resolve(); @@ -152,7 +158,7 @@ var MM = (function() { return; } - hideModule(module, speed / 2, function() { + hideModule(module, speed / 2, function () { updateModuleContent(module, newHeader, newContent); if (!module.hidden) { showModule(module, speed / 2); @@ -162,16 +168,16 @@ var MM = (function() { }); }; - /* moduleNeedsUpdate(module, newContent) + /** * Check if the content has changed. * - * argument module Module - The module to check. - * argument newHeader String - The new header that is generated. - * argument newContent Domobject - The new content that is generated. + * @param {Module} module The module to check. + * @param {string} newHeader The new header that is generated. + * @param {HTMLElement} newContent The new content that is generated. * - * return bool - Does the module need an update? + * @returns {boolean} True if the module need an update, false otherwise */ - var moduleNeedsUpdate = function(module, newHeader, newContent) { + var moduleNeedsUpdate = function (module, newHeader, newContent) { var moduleWrapper = document.getElementById(module.identifier); if (moduleWrapper === null) { return false; @@ -194,16 +200,18 @@ var MM = (function() { return headerNeedsUpdate || contentNeedsUpdate; }; - /* moduleNeedsUpdate(module, newContent) + /** * Update the content of a module on screen. * - * argument module Module - The module to check. - * argument newHeader String - The new header that is generated. - * argument newContent Domobject - The new content that is generated. + * @param {Module} module The module to check. + * @param {string} newHeader The new header that is generated. + * @param {HTMLElement} newContent The new content that is generated. */ - var updateModuleContent = function(module, newHeader, newContent) { + var updateModuleContent = function (module, newHeader, newContent) { var moduleWrapper = document.getElementById(module.identifier); - if (moduleWrapper === null) {return;} + if (moduleWrapper === null) { + return; + } var headerWrapper = moduleWrapper.getElementsByClassName("module-header"); var contentWrapper = moduleWrapper.getElementsByClassName("module-content"); @@ -211,17 +219,22 @@ var MM = (function() { contentWrapper[0].appendChild(newContent); headerWrapper[0].innerHTML = newHeader; - headerWrapper[0].style = headerWrapper.length > 0 && newHeader ? undefined : "display: none;"; + if (headerWrapper.length > 0 && newHeader) { + headerWrapper[0].style.display = "block"; + } else { + headerWrapper[0].style.display = "none"; + } }; - /* hideModule(module, speed, callback) + /** * Hide the module. * - * argument module Module - The module to hide. - * argument speed Number - The speed of the hide animation. - * argument callback function - Called when the animation is done. + * @param {Module} module The module to hide. + * @param {number} speed The speed of the hide animation. + * @param {Function} callback Called when the animation is done. + * @param {object} [options] Optional settings for the hide method. */ - var hideModule = function(module, speed, callback, options) { + var hideModule = function (module, speed, callback, options) { options = options || {}; // set lockString if set in options. @@ -238,7 +251,7 @@ var MM = (function() { moduleWrapper.style.opacity = 0; clearTimeout(module.showHideTimer); - module.showHideTimer = setTimeout(function() { + module.showHideTimer = setTimeout(function () { // To not take up any space, we just make the position absolute. // since it's fade out anyway, we can see it lay above or // below other modules. This works way better than adjusting @@ -247,28 +260,33 @@ var MM = (function() { updateWrapperStates(); - if (typeof callback === "function") { callback(); } + if (typeof callback === "function") { + callback(); + } }, speed); } else { // invoke callback even if no content, issue 1308 - if (typeof callback === "function") { callback(); } + if (typeof callback === "function") { + callback(); + } } }; - /* showModule(module, speed, callback) + /** * Show the module. * - * argument module Module - The module to show. - * argument speed Number - The speed of the show animation. - * argument callback function - Called when the animation is done. + * @param {Module} module The module to show. + * @param {number} speed The speed of the show animation. + * @param {Function} callback Called when the animation is done. + * @param {object} [options] Optional settings for the show method. */ - var showModule = function(module, speed, callback, options) { + var showModule = function (module, speed, callback, options) { options = options || {}; // remove lockString if set in options. if (options.lockString) { var index = module.lockStrings.indexOf(options.lockString); - if ( index !== -1) { + if (index !== -1) { module.lockStrings.splice(index, 1); } } @@ -301,16 +319,20 @@ var MM = (function() { moduleWrapper.style.opacity = 1; clearTimeout(module.showHideTimer); - module.showHideTimer = setTimeout(function() { - if (typeof callback === "function") { callback(); } + module.showHideTimer = setTimeout(function () { + if (typeof callback === "function") { + callback(); + } }, speed); } else { // invoke callback - if (typeof callback === "function") { callback(); } + if (typeof callback === "function") { + callback(); + } } }; - /* updateWrapperStates() + /** * Checks for all positions if it has visible content. * If not, if will hide the position to prevent unwanted margins. * This method should be called by the show and hide methods. @@ -321,15 +343,15 @@ var MM = (function() { * an ugly top margin. By using this function, the top bar will be hidden if the * update notification is not visible. */ - var updateWrapperStates = function() { + var updateWrapperStates = function () { var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", "bottom_bar", "fullscreen_above", "fullscreen_below"]; - positions.forEach(function(position) { + positions.forEach(function (position) { var wrapper = selectWrapper(position); var moduleWrappers = wrapper.getElementsByClassName("module"); var showWrapper = false; - Array.prototype.forEach.call(moduleWrappers, function(moduleWrapper) { + Array.prototype.forEach.call(moduleWrappers, function (moduleWrapper) { if (moduleWrapper.style.position === "" || moduleWrapper.style.position === "static") { showWrapper = true; } @@ -339,10 +361,10 @@ var MM = (function() { }); }; - /* loadConfig() - * Loads the core config and combines it with de system defaults. + /** + * Loads the core config and combines it with the system defaults. */ - var loadConfig = function() { + var loadConfig = function () { // FIXME: Think about how to pass config around without breaking tests /* eslint-disable */ if (typeof config === "undefined") { @@ -355,50 +377,49 @@ var MM = (function() { /* eslint-enable */ }; - /* setSelectionMethodsForModules() + /** * Adds special selectors on a collection of modules. * - * argument modules array - Array of modules. + * @param {Module[]} modules Array of modules. */ - var setSelectionMethodsForModules = function(modules) { - - /* withClass(className) - * calls modulesByClass to filter modules with the specified classes. + var setSelectionMethodsForModules = function (modules) { + /** + * Filter modules with the specified classes. * - * argument className string/array - one or multiple classnames. (array or space divided) + * @param {string|string[]} className one or multiple classnames (array or space divided). * - * return array - Filtered collection of modules. + * @returns {Module[]} Filtered collection of modules. */ - var withClass = function(className) { + var withClass = function (className) { return modulesByClass(className, true); }; - /* exceptWithClass(className) - * calls modulesByClass to filter modules without the specified classes. + /** + * Filter modules without the specified classes. * - * argument className string/array - one or multiple classnames. (array or space divided) + * @param {string|string[]} className one or multiple classnames (array or space divided). * - * return array - Filtered collection of modules. + * @returns {Module[]} Filtered collection of modules. */ - var exceptWithClass = function(className) { + var exceptWithClass = function (className) { return modulesByClass(className, false); }; - /* modulesByClass(className, include) - * filters a collection of modules based on classname(s). + /** + * Filters a collection of modules based on classname(s). * - * argument className string/array - one or multiple classnames. (array or space divided) - * argument include boolean - if the filter should include or exclude the modules with the specific classes. + * @param {string|string[]} className one or multiple classnames (array or space divided). + * @param {boolean} include if the filter should include or exclude the modules with the specific classes. * - * return array - Filtered collection of modules. + * @returns {Module[]} Filtered collection of modules. */ - var modulesByClass = function(className, include) { + var modulesByClass = function (className, include) { var searchClasses = className; if (typeof className === "string") { searchClasses = className.split(" "); } - var newModules = modules.filter(function(module) { + var newModules = modules.filter(function (module) { var classes = module.data.classes.toLowerCase().split(" "); for (var c in searchClasses) { @@ -415,15 +436,15 @@ var MM = (function() { return newModules; }; - /* exceptModule(module) + /** * Removes a module instance from the collection. * - * argument module Module object - The module instance to remove from the collection. + * @param {object} module The module instance to remove from the collection. * - * return array - Filtered collection of modules. + * @returns {Module[]} Filtered collection of modules. */ - var exceptModule = function(module) { - var newModules = modules.filter(function(mod) { + var exceptModule = function (module) { + var newModules = modules.filter(function (mod) { return mod.identifier !== module.identifier; }); @@ -431,42 +452,53 @@ var MM = (function() { return newModules; }; - /* enumerate(callback) + /** * Walks thru a collection of modules and executes the callback with the module as an argument. * - * argument callback function - The function to execute with the module as an argument. + * @param {Function} callback The function to execute with the module as an argument. */ - var enumerate = function(callback) { - modules.map(function(module) { + var enumerate = function (callback) { + modules.map(function (module) { callback(module); }); }; - if (typeof modules.withClass === "undefined") { Object.defineProperty(modules, "withClass", {value: withClass, enumerable: false}); } - if (typeof modules.exceptWithClass === "undefined") { Object.defineProperty(modules, "exceptWithClass", {value: exceptWithClass, enumerable: false}); } - if (typeof modules.exceptModule === "undefined") { Object.defineProperty(modules, "exceptModule", {value: exceptModule, enumerable: false}); } - if (typeof modules.enumerate === "undefined") { Object.defineProperty(modules, "enumerate", {value: enumerate, enumerable: false}); } + if (typeof modules.withClass === "undefined") { + Object.defineProperty(modules, "withClass", { value: withClass, enumerable: false }); + } + if (typeof modules.exceptWithClass === "undefined") { + Object.defineProperty(modules, "exceptWithClass", { value: exceptWithClass, enumerable: false }); + } + if (typeof modules.exceptModule === "undefined") { + Object.defineProperty(modules, "exceptModule", { value: exceptModule, enumerable: false }); + } + if (typeof modules.enumerate === "undefined") { + Object.defineProperty(modules, "enumerate", { value: enumerate, enumerable: false }); + } }; return { /* Public Methods */ - /* init() + /** * Main init method. */ - init: function() { + init: function () { Log.info("Initializing MagicMirror."); loadConfig(); + + Log.setLogLevel(config.logLevel); + Translator.loadCoreTranslations(config.language); Loader.loadModules(); }, - /* modulesStarted(moduleObjects) + /** * Gets called when all modules are started. * - * argument moduleObjects array - All module instances. + * @param {Module[]} moduleObjects All module instances. */ - modulesStarted: function(moduleObjects) { + modulesStarted: function (moduleObjects) { modules = []; for (var m in moduleObjects) { var module = moduleObjects[m]; @@ -479,14 +511,14 @@ var MM = (function() { createDomObjects(); }, - /* sendNotification(notification, payload, sender) + /** * Send a notification to all modules. * - * argument notification string - The identifier of the notification. - * argument payload mixed - The payload of the notification. - * argument sender Module - The module that sent the notification. + * @param {string} notification The identifier of the notification. + * @param {*} payload The payload of the notification. + * @param {Module} sender The module that sent the notification. */ - sendNotification: function(notification, payload, sender) { + sendNotification: function (notification, payload, sender) { if (arguments.length < 3) { Log.error("sendNotification: Missing arguments."); return; @@ -506,13 +538,13 @@ var MM = (function() { sendNotification(notification, payload, sender); }, - /* updateDom(module, speed) + /** * Update the dom for a specific module. * - * argument module Module - The module that needs an update. - * argument speed Number - The number of microseconds for the animation. (optional) + * @param {Module} module The module that needs an update. + * @param {number} [speed] The number of microseconds for the animation. */ - updateDom: function(module, speed) { + updateDom: function (module, speed) { if (!(module instanceof Module)) { Log.error("updateDom: Sender should be a module."); return; @@ -522,49 +554,48 @@ var MM = (function() { updateDom(module, speed); }, - /* getModules(module, speed) + /** * Returns a collection of all modules currently active. * - * return array - A collection of all modules currently active. + * @returns {Module[]} A collection of all modules currently active. */ - getModules: function() { + getModules: function () { setSelectionMethodsForModules(modules); return modules; }, - /* hideModule(module, speed, callback) + /** * Hide the module. * - * argument module Module - The module hide. - * argument speed Number - The speed of the hide animation. - * argument callback function - Called when the animation is done. - * argument options object - Optional settings for the hide method. + * @param {Module} module The module to hide. + * @param {number} speed The speed of the hide animation. + * @param {Function} callback Called when the animation is done. + * @param {object} [options] Optional settings for the hide method. */ - hideModule: function(module, speed, callback, options) { + hideModule: function (module, speed, callback, options) { module.hidden = true; hideModule(module, speed, callback, options); }, - /* showModule(module, speed, callback) + /** * Show the module. * - * argument module Module - The module show. - * argument speed Number - The speed of the show animation. - * argument callback function - Called when the animation is done. - * argument options object - Optional settings for the hide method. + * @param {Module} module The module to show. + * @param {number} speed The speed of the show animation. + * @param {Function} callback Called when the animation is done. + * @param {object} [options] Optional settings for the show method. */ - showModule: function(module, speed, callback, options) { + showModule: function (module, speed, callback, options) { // do not change module.hidden yet, only if we really show it later showModule(module, speed, callback, options); } }; - })(); // Add polyfill for Object.assign. if (typeof Object.assign !== "function") { - (function() { - Object.assign = function(target) { + (function () { + Object.assign = function (target) { "use strict"; if (target === undefined || target === null) { throw new TypeError("Cannot convert undefined or null to object"); diff --git a/js/module.js b/js/module.js index 1a38c54f..8bb5990e 100644 --- a/js/module.js +++ b/js/module.js @@ -2,12 +2,13 @@ /* Magic Mirror * Module Blueprint. + * @typedef {Object} Module * * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. + * */ var Module = Class.extend({ - /********************************************************* * All methods (and properties) below can be subclassed. * *********************************************************/ @@ -30,57 +31,59 @@ var Module = Class.extend({ // Use the nunjucksEnvironment() to get it. _nunjucksEnvironment: null, - /* init() - * Is called when the module is instantiated. + /** + * Called when the module is instantiated. */ init: function () { //Log.log(this.defaults); }, - /* start() - * Is called when the module is started. + /** + * Called when the module is started. */ start: function () { Log.info("Starting module: " + this.name); }, - /* getScripts() + /** * Returns a list of scripts the module requires to be loaded. * - * return Array - An array with filenames. + * @returns {string[]} An array with filenames. */ getScripts: function () { return []; }, - /* getStyles() + /** * Returns a list of stylesheets the module requires to be loaded. * - * return Array - An array with filenames. + * @returns {string[]} An array with filenames. */ getStyles: function () { return []; }, - /* getTranslations() + /** * Returns a map of translation files the module requires to be loaded. * - * return Map - A map with langKeys and filenames. + * return Map - + * + * @returns {*} A map with langKeys and filenames. */ getTranslations: function () { return false; }, - /* getDom() - * This method generates the dom which needs to be displayed. This method is called by the Magic Mirror core. + /** + * Generates the dom which needs to be displayed. This method is called by the Magic Mirror core. * This method can to be subclassed if the module wants to display info on the mirror. * Alternatively, the getTemplate method could be subclassed. * - * return DomObject | Promise - The dom or a promise with the dom to display. + * @returns {HTMLElement|Promise} The dom or a promise with the dom to display. */ getDom: function () { var self = this; - return new Promise(function(resolve) { + return new Promise(function (resolve) { var div = document.createElement("div"); var template = self.getTemplate(); var templateData = self.getTemplateData(); @@ -106,46 +109,45 @@ var Module = Class.extend({ }); }, - /* getHeader() - * This method generates the header string which needs to be displayed if a user has a header configured for this module. + /** + * Generates the header string which needs to be displayed if a user has a header configured for this module. * This method is called by the Magic Mirror core, but only if the user has configured a default header for the module. * This method needs to be subclassed if the module wants to display modified headers on the mirror. * - * return string - The header to display above the header. + * @returns {string} The header to display above the header. */ getHeader: function () { return this.data.header; }, - /* getTemplate() - * This method returns the template for the module which is used by the default getDom implementation. + /** + * Returns the template for the module which is used by the default getDom implementation. * This method needs to be subclassed if the module wants to use a template. * It can either return a template sting, or a template filename. * If the string ends with '.html' it's considered a file from within the module's folder. * - * return string - The template string of filename. + * @returns {string} The template string of filename. */ getTemplate: function () { - return "
" + this.name + "
" + this.identifier + "
"; + return '
' + this.name + '
' + this.identifier + "
"; }, - /* getTemplateData() - * This method returns the data to be used in the template. + /** + * Returns the data to be used in the template. * This method needs to be subclassed if the module wants to use a custom data. * - * return Object + * @returns {object} The data for the template */ getTemplateData: function () { return {}; }, - /* notificationReceived(notification, payload, sender) - * This method is called when a notification arrives. - * This method is called by the Magic Mirror core. + /** + * Called by the Magic Mirror core when a notification arrives. * - * argument notification string - The identifier of the notification. - * argument payload mixed - The payload of the notification. - * argument sender Module - The module that sent the notification. + * @param {string} notification The identifier of the notification. + * @param {*} payload The payload of the notification. + * @param {Module} sender The module that sent the notification. */ notificationReceived: function (notification, payload, sender) { if (sender) { @@ -155,49 +157,50 @@ var Module = Class.extend({ } }, - /** nunjucksEnvironment() + /** * Returns the nunjucks environment for the current module. * The environment is checked in the _nunjucksEnvironment instance variable. - - * @returns Nunjucks Environment + * + * @returns {object} The Nunjucks Environment */ - nunjucksEnvironment: function() { + nunjucksEnvironment: function () { if (this._nunjucksEnvironment !== null) { return this._nunjucksEnvironment; } var self = this; - this._nunjucksEnvironment = new nunjucks.Environment(new nunjucks.WebLoader(this.file(""), {async: true}), { + this._nunjucksEnvironment = new nunjucks.Environment(new nunjucks.WebLoader(this.file(""), { async: true }), { trimBlocks: true, lstripBlocks: true }); - this._nunjucksEnvironment.addFilter("translate", function(str) { + + this._nunjucksEnvironment.addFilter("translate", function (str) { return self.translate(str); }); return this._nunjucksEnvironment; }, - /* socketNotificationReceived(notification, payload) - * This method is called when a socket notification arrives. + /** + * Called when a socket notification arrives. * - * argument notification string - The identifier of the notification. - * argument payload mixed - The payload of the notification. + * @param {string} notification The identifier of the notification. + * @param {*} payload The payload of the notification. */ socketNotificationReceived: function (notification, payload) { Log.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload); }, - /* suspend() - * This method is called when a module is hidden. + /* + * Called when the module is hidden. */ suspend: function () { Log.log(this.name + " is suspended."); }, - /* resume() - * This method is called when a module is shown. + /* + * Called when the module is shown. */ resume: function () { Log.log(this.name + " is resumed."); @@ -207,10 +210,10 @@ var Module = Class.extend({ * The methods below don"t need subclassing. * *********************************************/ - /* setData(data) + /** * Set the module data. * - * argument data object - Module data. + * @param {Module} data The module data */ setData: function (data) { this.data = data; @@ -221,18 +224,20 @@ var Module = Class.extend({ this.setConfig(data.config); }, - /* setConfig(config) + /** * Set the module config and combine it with the module defaults. * - * argument config object - Module config. + * @param {object} config The combined module config. */ setConfig: function (config) { this.config = Object.assign({}, this.defaults, config); }, - /* socket() - * Returns a socket object. If it doesn't exist, it"s created. + /** + * Returns a socket object. If it doesn't exist, it's created. * It also registers the notification callback. + * + * @returns {MMSocket} a socket object */ socket: function () { if (typeof this._socket === "undefined") { @@ -247,40 +252,39 @@ var Module = Class.extend({ return this._socket; }, - /* file(file) + /** * Retrieve the path to a module file. * - * argument file string - Filename. - * - * return string - File path. + * @param {string} file Filename + * @returns {string} the file path */ file: function (file) { return (this.data.path + "/" + file).replace("//", "/"); }, - /* loadStyles() + /** * Load all required stylesheets by requesting the MM object to load the files. * - * argument callback function - Function called when done. + * @param {Function} callback Function called when done. */ loadStyles: function (callback) { this.loadDependencies("getStyles", callback); }, - /* loadScripts() + /** * Load all required scripts by requesting the MM object to load the files. * - * argument callback function - Function called when done. + * @param {Function} callback Function called when done. */ loadScripts: function (callback) { this.loadDependencies("getScripts", callback); }, - /* loadDependencies(funcName, callback) + /** * Helper method to load all dependencies. * - * argument funcName string - Function name to call to get scripts or styles. - * argument callback function - Function called when done. + * @param {string} funcName Function name to call to get scripts or styles. + * @param {Function} callback Function called when done. */ loadDependencies: function (funcName, callback) { var self = this; @@ -301,10 +305,10 @@ var Module = Class.extend({ loadNextDependency(); }, - /* loadScripts() - * Load all required scripts by requesting the MM object to load the files. + /** + * Load all translations. * - * argument callback function - Function called when done. + * @param {Function} callback Function called when done. */ loadTranslations: function (callback) { var self = this; @@ -313,7 +317,9 @@ var Module = Class.extend({ // The variable `first` will contain the first // defined translation after the following line. - for (var first in translations) { break; } + for (var first in translations) { + break; + } if (translations) { var translationFile = translations[lang] || undefined; @@ -333,100 +339,110 @@ var Module = Class.extend({ } }, - /* translate(key, defaultValueOrVariables, defaultValue) + /** * Request the translation for a given key with optional variables and default value. * - * argument key string - The key of the string to translate - * argument defaultValueOrVariables string/object - The default value or variables for translating. (Optional) - * argument defaultValue string - The default value with variables. (Optional) + * @param {string} key The key of the string to translate + * @param {string|object} [defaultValueOrVariables] The default value or variables for translating. + * @param {string} [defaultValue] The default value with variables. + * @returns {string} the translated key */ translate: function (key, defaultValueOrVariables, defaultValue) { - if(typeof defaultValueOrVariables === "object") { + if (typeof defaultValueOrVariables === "object") { return Translator.translate(this, key, defaultValueOrVariables) || defaultValue || ""; } return Translator.translate(this, key) || defaultValueOrVariables || ""; }, - /* updateDom(speed) + /** * Request an (animated) update of the module. * - * argument speed Number - The speed of the animation. (Optional) + * @param {number} [speed] The speed of the animation. */ updateDom: function (speed) { MM.updateDom(this, speed); }, - /* sendNotification(notification, payload) + /** * Send a notification to all modules. * - * argument notification string - The identifier of the notification. - * argument payload mixed - The payload of the notification. + * @param {string} notification The identifier of the notification. + * @param {*} payload The payload of the notification. */ sendNotification: function (notification, payload) { MM.sendNotification(notification, payload, this); }, - /* sendSocketNotification(notification, payload) + /** * Send a socket notification to the node helper. * - * argument notification string - The identifier of the notification. - * argument payload mixed - The payload of the notification. + * @param {string} notification The identifier of the notification. + * @param {*} payload The payload of the notification. */ sendSocketNotification: function (notification, payload) { this.socket().sendNotification(notification, payload); }, - /* hideModule(module, speed, callback) + /** * Hide this module. * - * argument speed Number - The speed of the hide animation. - * argument callback function - Called when the animation is done. - * argument options object - Optional settings for the hide method. + * @param {number} speed The speed of the hide animation. + * @param {Function} callback Called when the animation is done. + * @param {object} [options] Optional settings for the hide method. */ hide: function (speed, callback, options) { if (typeof callback === "object") { options = callback; - callback = function () { }; + callback = function () {}; } - callback = callback || function () { }; + callback = callback || function () {}; options = options || {}; var self = this; - MM.hideModule(self, speed, function () { - self.suspend(); - callback(); - }, options); + MM.hideModule( + self, + speed, + function () { + self.suspend(); + callback(); + }, + options + ); }, - /* showModule(module, speed, callback) + /** * Show this module. * - * argument speed Number - The speed of the show animation. - * argument callback function - Called when the animation is done. - * argument options object - Optional settings for the hide method. + * @param {number} speed The speed of the show animation. + * @param {Function} callback Called when the animation is done. + * @param {object} [options] Optional settings for the show method. */ show: function (speed, callback, options) { if (typeof callback === "object") { options = callback; - callback = function () { }; + callback = function () {}; } - callback = callback || function () { }; + callback = callback || function () {}; options = options || {}; var self = this; - MM.showModule(this, speed, function () { - self.resume(); - callback; - }, options); + MM.showModule( + this, + speed, + function () { + self.resume(); + callback; + }, + options + ); } }); Module.definitions = {}; Module.create = function (name) { - // Make sure module definition is available. if (!Module.definitions[name]) { return; @@ -441,12 +457,28 @@ Module.create = function (name) { return new ModuleClass(); }; -/* cmpVersions(a,b) -* Compare two semantic version numbers and return the difference. -* -* argument a string - Version number a. -* argument a string - Version number b. -*/ +Module.register = function (name, moduleDefinition) { + if (moduleDefinition.requiresVersion) { + Log.log("Check MagicMirror version for module '" + name + "' - Minimum version: " + moduleDefinition.requiresVersion + " - Current version: " + window.version); + if (cmpVersions(window.version, moduleDefinition.requiresVersion) >= 0) { + Log.log("Version is ok!"); + } else { + Log.log("Version is incorrect. Skip module: '" + name + "'"); + return; + } + } + Log.log("Module registered: " + name); + Module.definitions[name] = moduleDefinition; +}; + +/** + * Compare two semantic version numbers and return the difference. + * + * @param {string} a Version number a. + * @param {string} b Version number b. + * @returns {number} A positive number if a is larger than b, a negative + * number if a is smaller and 0 if they are the same + */ function cmpVersions(a, b) { var i, diff; var regExStrip0 = /(\.0+)+$/; @@ -462,18 +494,3 @@ function cmpVersions(a, b) { } return segmentsA.length - segmentsB.length; } - -Module.register = function (name, moduleDefinition) { - - if (moduleDefinition.requiresVersion) { - Log.log("Check MagicMirror version for module '" + name + "' - Minimum version: " + moduleDefinition.requiresVersion + " - Current version: " + window.version); - if (cmpVersions(window.version, moduleDefinition.requiresVersion) >= 0) { - Log.log("Version is ok!"); - } else { - Log.log("Version is incorrect. Skip module: '" + name + "'"); - return; - } - } - Log.log("Module registered: " + name); - Module.definitions[name] = moduleDefinition; -}; diff --git a/js/node_helper.js b/js/node_helper.js index 89c6e23e..4a31fdee 100644 --- a/js/node_helper.js +++ b/js/node_helper.js @@ -5,20 +5,21 @@ * MIT Licensed. */ const Class = require("./class.js"); +const Log = require("./logger.js"); const express = require("express"); var NodeHelper = Class.extend({ - init: function() { - console.log("Initializing new module helper ..."); + init: function () { + Log.log("Initializing new module helper ..."); }, - loaded: function(callback) { - console.log("Module helper loaded: " + this.name); + loaded: function (callback) { + Log.log("Module helper loaded: " + this.name); callback(); }, - start: function() { - console.log("Starting module helper: " + this.name); + start: function () { + Log.log("Starting module helper: " + this.name); }, /* stop() @@ -27,8 +28,8 @@ var NodeHelper = Class.extend({ * gracefully exit the module. * */ - stop: function() { - console.log("Stopping module helper: " + this.name); + stop: function () { + Log.log("Stopping module helper: " + this.name); }, /* socketNotificationReceived(notification, payload) @@ -37,8 +38,8 @@ var NodeHelper = Class.extend({ * argument notification string - The identifier of the notification. * argument payload mixed - The payload of the notification. */ - socketNotificationReceived: function(notification, payload) { - console.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload); + socketNotificationReceived: function (notification, payload) { + Log.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload); }, /* setName(name) @@ -46,7 +47,7 @@ var NodeHelper = Class.extend({ * * argument name string - Module name. */ - setName: function(name) { + setName: function (name) { this.name = name; }, @@ -55,7 +56,7 @@ var NodeHelper = Class.extend({ * * argument path string - Module path. */ - setPath: function(path) { + setPath: function (path) { this.path = path; }, @@ -65,7 +66,7 @@ var NodeHelper = Class.extend({ * argument notification string - The identifier of the notification. * argument payload mixed - The payload of the notification. */ - sendSocketNotification: function(notification, payload) { + sendSocketNotification: function (notification, payload) { this.io.of(this.name).emit(notification, payload); }, @@ -75,7 +76,7 @@ var NodeHelper = Class.extend({ * * argument app Express app - The Express app object. */ - setExpressApp: function(app) { + setExpressApp: function (app) { this.expressApp = app; var publicPath = this.path + "/public"; @@ -88,16 +89,16 @@ var NodeHelper = Class.extend({ * * argument io Socket.io - The Socket io object. */ - setSocketIO: function(io) { + setSocketIO: function (io) { var self = this; self.io = io; - console.log("Connecting socket for: " + this.name); + Log.log("Connecting socket for: " + this.name); var namespace = this.name; - io.of(namespace).on("connection", function(socket) { + io.of(namespace).on("connection", function (socket) { // add a catch all event. var onevent = socket.onevent; - socket.onevent = function(packet) { + socket.onevent = function (packet) { var args = packet.data || []; onevent.call(this, packet); // original call packet.data = ["*"].concat(args); @@ -105,9 +106,9 @@ var NodeHelper = Class.extend({ }; // register catch all. - socket.on("*", function(notification, payload) { + socket.on("*", function (notification, payload) { if (notification !== "*") { - //console.log('received message in namespace: ' + namespace); + //Log.log('received message in namespace: ' + namespace); self.socketNotificationReceived(notification, payload); } }); @@ -115,9 +116,11 @@ var NodeHelper = Class.extend({ } }); -NodeHelper.create = function(moduleDefinition) { +NodeHelper.create = function (moduleDefinition) { return NodeHelper.extend(moduleDefinition); }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = NodeHelper;} +if (typeof module !== "undefined") { + module.exports = NodeHelper; +} diff --git a/js/server.js b/js/server.js index 4d08fc14..5116de53 100644 --- a/js/server.js +++ b/js/server.js @@ -4,48 +4,48 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ - var express = require("express"); var app = require("express")(); var path = require("path"); var ipfilter = require("express-ipfilter").IpFilter; var fs = require("fs"); var helmet = require("helmet"); -var Utils = require(__dirname + "/utils.js"); -var Server = function(config, callback) { +var Log = require("./logger.js"); +var Utils = require("./utils.js"); +var Server = function (config, callback) { var port = config.port; if (process.env.MM_PORT) { port = process.env.MM_PORT; } var server = null; - if(config.useHttps){ + if (config.useHttps) { var options = { key: fs.readFileSync(config.httpsPrivateKey), cert: fs.readFileSync(config.httpsCertificate) }; server = require("https").Server(options, app); - }else{ + } else { server = require("http").Server(app); } var io = require("socket.io")(server); - console.log("Starting server on port " + port + " ... "); + Log.log("Starting server on port " + port + " ... "); server.listen(port, config.address ? config.address : "localhost"); if (config.ipWhitelist instanceof Array && config.ipWhitelist.length === 0) { - console.info(Utils.colors.warn("You're using a full whitelist configuration to allow for all IPs")); + Log.info(Utils.colors.warn("You're using a full whitelist configuration to allow for all IPs")); } - app.use(function(req, res, next) { - var result = ipfilter(config.ipWhitelist, {mode: config.ipWhitelist.length === 0 ? "deny" : "allow", log: false})(req, res, function(err) { + app.use(function (req, res, next) { + var result = ipfilter(config.ipWhitelist, { mode: config.ipWhitelist.length === 0 ? "deny" : "allow", log: false })(req, res, function (err) { if (err === undefined) { return next(); } - console.log(err.message); + Log.log(err.message); res.status(403).send("This device is not allowed to access your mirror.
Please check your config.js or config.js.sample to change this."); }); }); @@ -59,20 +59,20 @@ var Server = function(config, callback) { app.use(directory, express.static(path.resolve(global.root_path + directory))); } - app.get("/version", function(req,res) { + app.get("/version", function (req, res) { res.send(global.version); }); - app.get("/config", function(req,res) { + app.get("/config", function (req, res) { res.send(config); }); - app.get("/", function(req, res) { - var html = fs.readFileSync(path.resolve(global.root_path + "/index.html"), {encoding: "utf8"}); + app.get("/", function (req, res) { + var html = fs.readFileSync(path.resolve(global.root_path + "/index.html"), { encoding: "utf8" }); html = html.replace("#VERSION#", global.version); var configFile = "config/config.js"; - if (typeof(global.configuration_file) !== "undefined") { + if (typeof global.configuration_file !== "undefined") { configFile = global.configuration_file; } html = html.replace("#CONFIG_FILE#", configFile); diff --git a/js/socketclient.js b/js/socketclient.js index 2274c20e..2a50083f 100644 --- a/js/socketclient.js +++ b/js/socketclient.js @@ -6,7 +6,7 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -var MMSocket = function(moduleName) { +var MMSocket = function (moduleName) { var self = this; if (typeof moduleName !== "string") { @@ -17,16 +17,16 @@ var MMSocket = function(moduleName) { // Private Methods var base = "/"; - if ((typeof config !== "undefined") && (typeof config.basePath !== "undefined")) { + if (typeof config !== "undefined" && typeof config.basePath !== "undefined") { base = config.basePath; } self.socket = io("/" + self.moduleName, { path: base + "socket.io" }); - var notificationCallback = function() {}; + var notificationCallback = function () {}; var onevent = self.socket.onevent; - self.socket.onevent = function(packet) { + self.socket.onevent = function (packet) { var args = packet.data || []; onevent.call(this, packet); // original call packet.data = ["*"].concat(args); @@ -34,18 +34,18 @@ var MMSocket = function(moduleName) { }; // register catch all. - self.socket.on("*", function(notification, payload) { + self.socket.on("*", function (notification, payload) { if (notification !== "*") { notificationCallback(notification, payload); } }); // Public Methods - this.setNotificationCallback = function(callback) { + this.setNotificationCallback = function (callback) { notificationCallback = callback; }; - this.sendNotification = function(notification, payload) { + this.sendNotification = function (notification, payload) { if (typeof payload === "undefined") { payload = {}; } diff --git a/js/translator.js b/js/translator.js index 1ebf9fbf..0f4bc00a 100644 --- a/js/translator.js +++ b/js/translator.js @@ -6,13 +6,12 @@ * By Christopher Fenner https://github.com/CFenner * MIT Licensed. */ -var Translator = (function() { - - /* loadJSON(file, callback) +var Translator = (function () { + /** * Load a JSON file via XHR. * - * argument file string - Path of the file we want to load. - * argument callback function - Function called when done. + * @param {string} file Path of the file we want to load. + * @param {Function} callback Function called when done. */ function loadJSON(file, callback) { var xhr = new XMLHttpRequest(); @@ -20,125 +19,52 @@ var Translator = (function() { xhr.open("GET", file, true); xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { - callback(JSON.parse(stripComments(xhr.responseText))); + callback(JSON.parse(xhr.responseText)); } }; xhr.send(null); } - /* loadJSON(str, options) - * Remove any commenting from a json file so it can be parsed. - * - * argument str string - The string that contains json with comments. - * argument opts function - Strip options. - * - * return the stripped string. - */ - function stripComments(str, opts) { - // strip comments copied from: https://github.com/sindresorhus/strip-json-comments - - var singleComment = 1; - var multiComment = 2; - - function stripWithoutWhitespace() { - return ""; - } - - function stripWithWhitespace(str, start, end) { - return str.slice(start, end).replace(/\S/g, " "); - } - - opts = opts || {}; - - var currentChar; - var nextChar; - var insideString = false; - var insideComment = false; - var offset = 0; - var ret = ""; - var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; - - for (var i = 0; i < str.length; i++) { - currentChar = str[i]; - nextChar = str[i + 1]; - - if (!insideComment && currentChar === "\"") { - var escaped = str[i - 1] === "\\" && str[i - 2] !== "\\"; - if (!escaped) { - insideString = !insideString; - } - } - - if (insideString) { - continue; - } - - if (!insideComment && currentChar + nextChar === "//") { - ret += str.slice(offset, i); - offset = i; - insideComment = singleComment; - i++; - } else if (insideComment === singleComment && currentChar + nextChar === "\r\n") { - i++; - insideComment = false; - ret += strip(str, offset, i); - offset = i; - continue; - } else if (insideComment === singleComment && currentChar === "\n") { - insideComment = false; - ret += strip(str, offset, i); - offset = i; - } else if (!insideComment && currentChar + nextChar === "/*") { - ret += str.slice(offset, i); - offset = i; - insideComment = multiComment; - i++; - continue; - } else if (insideComment === multiComment && currentChar + nextChar === "*/") { - i++; - insideComment = false; - ret += strip(str, offset, i + 1); - offset = i + 1; - continue; - } - } - - return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset)); - } - return { coreTranslations: {}, coreTranslationsFallback: {}, translations: {}, translationsFallback: {}, - /* translate(module, key, variables) + /** * Load a translation for a given key for a given module. * - * argument module Module - The module to load the translation for. - * argument key string - The key of the text to translate. - * argument variables - The variables to use within the translation template (optional) + * @param {Module} module The module to load the translation for. + * @param {string} key The key of the text to translate. + * @param {object} variables The variables to use within the translation template (optional) + * @returns {string} the translated key */ - translate: function(module, key, variables) { + translate: function (module, key, variables) { variables = variables || {}; //Empty object by default - // Combines template and variables like: - // template: "Please wait for {timeToWait} before continuing with {work}." - // variables: {timeToWait: "2 hours", work: "painting"} - // to: "Please wait for 2 hours before continuing with painting." + /** + * Combines template and variables like: + * template: "Please wait for {timeToWait} before continuing with {work}." + * variables: {timeToWait: "2 hours", work: "painting"} + * to: "Please wait for 2 hours before continuing with painting." + * + * @param {string} template Text with placeholder + * @param {object} variables Variables for the placeholder + * @returns {string} the template filled with the variables + */ function createStringFromTemplate(template, variables) { - if(Object.prototype.toString.call(template) !== "[object String]") { + if (Object.prototype.toString.call(template) !== "[object String]") { return template; } - if(variables.fallback && !template.match(new RegExp("{.+}"))) { + if (variables.fallback && !template.match(new RegExp("{.+}"))) { template = variables.fallback; } - return template.replace(new RegExp("{([^}]+)}", "g"), function(_unused, varName){ - return variables[varName] || "{"+varName+"}"; + return template.replace(new RegExp("{([^}]+)}", "g"), function (_unused, varName) { + return variables[varName] || "{" + varName + "}"; }); } - if(this.translations[module.name] && key in this.translations[module.name]) { + if (this.translations[module.name] && key in this.translations[module.name]) { // Log.log("Got translation for " + key + " from module translation: "); return createStringFromTemplate(this.translations[module.name][key], variables); } @@ -161,15 +87,15 @@ var Translator = (function() { return key; }, - /* load(module, file, isFallback, callback) + /** * Load a translation file (json) and remember the data. * - * argument module Module - The module to load the translation file for. - * argument file string - Path of the file we want to load. - * argument isFallback boolean - Flag to indicate fallback translations. - * argument callback function - Function called when done. + * @param {Module} module The module to load the translation file for. + * @param {string} file Path of the file we want to load. + * @param {boolean} isFallback Flag to indicate fallback translations. + * @param {Function} callback Function called when done. */ - load: function(module, file, isFallback, callback) { + load: function (module, file, isFallback, callback) { if (!isFallback) { Log.log(module.name + " - Load translation: " + file); } else { @@ -177,8 +103,8 @@ var Translator = (function() { } var self = this; - if(!this.translationsFallback[module.name]) { - loadJSON(module.file(file), function(json) { + if (!this.translationsFallback[module.name]) { + loadJSON(module.file(file), function (json) { if (!isFallback) { self.translations[module.name] = json; } else { @@ -191,17 +117,17 @@ var Translator = (function() { } }, - /* loadCoreTranslations(lang) + /** * Load the core translations. * - * argument lang String - The language identifier of the core language. + * @param {string} lang The language identifier of the core language. */ - loadCoreTranslations: function(lang) { + loadCoreTranslations: function (lang) { var self = this; if (lang in translations) { Log.log("Loading core translation file: " + translations[lang]); - loadJSON(translations[lang], function(translations) { + loadJSON(translations[lang], function (translations) { self.coreTranslations = translations; }); } else { @@ -211,23 +137,25 @@ var Translator = (function() { self.loadCoreTranslationsFallback(); }, - /* loadCoreTranslationsFallback() + /** * Load the core translations fallback. * The first language defined in translations.js will be used. */ - loadCoreTranslationsFallback: function() { + loadCoreTranslationsFallback: function () { var self = this; // The variable `first` will contain the first // defined translation after the following line. - for (var first in translations) {break;} + for (var first in translations) { + break; + } if (first) { Log.log("Loading core translation fallback file: " + translations[first]); - loadJSON(translations[first], function(translations) { + loadJSON(translations[first], function (translations) { self.coreTranslationsFallback = translations; }); } - }, + } }; })(); diff --git a/js/utils.js b/js/utils.js index df11d0b2..5044447d 100644 --- a/js/utils.js +++ b/js/utils.js @@ -10,8 +10,11 @@ var Utils = { colors: { warn: colors.yellow, error: colors.red, - info: colors.blue + info: colors.blue, + pass: colors.green } }; -if (typeof module !== "undefined") {module.exports = Utils;} +if (typeof module !== "undefined") { + module.exports = Utils; +} diff --git a/jsconfig.json b/jsconfig.json index 2b354edc..6ae848fc 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -6,8 +6,5 @@ "module": "commonjs", "allowSyntheticDefaultImports": true }, - "exclude": [ - "modules", - "node_modules" - ] + "exclude": ["modules", "node_modules"] } diff --git a/modules/default/alert/README.md b/modules/default/alert/README.md index 4d3c6a65..2e7973a3 100644 --- a/modules/default/alert/README.md +++ b/modules/default/alert/README.md @@ -1,4 +1,5 @@ # Module: Alert + The alert module is one of the default modules of the MagicMirror. This module displays notifications from other modules. For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/alert.html). diff --git a/modules/default/alert/alert.js b/modules/default/alert/alert.js index 66b88601..b2eb2eb2 100644 --- a/modules/default/alert/alert.js +++ b/modules/default/alert/alert.js @@ -6,7 +6,7 @@ * By Paul-Vincent Roll https://paulvincentroll.com/ * MIT Licensed. */ -Module.register("alert",{ +Module.register("alert", { defaults: { // scale|slide|genie|jelly|flip|bouncyflip|exploader effect: "slide", @@ -17,31 +17,33 @@ Module.register("alert",{ //Position position: "center", //shown at startup - welcome_message: false, + welcome_message: false }, - getScripts: function() { + getScripts: function () { return ["notificationFx.js"]; }, - getStyles: function() { + getStyles: function () { return ["notificationFx.css", "font-awesome.css"]; }, // Define required translations. - getTranslations: function() { + getTranslations: function () { return { en: "translations/en.json", de: "translations/de.json", - nl: "translations/nl.json", + nl: "translations/nl.json" }; }, - show_notification: function(message) { - if (this.config.effect === "slide") {this.config.effect = this.config.effect + "-" + this.config.position;} + show_notification: function (message) { + if (this.config.effect === "slide") { + this.config.effect = this.config.effect + "-" + this.config.position; + } let msg = ""; if (message.title) { msg += "" + message.title + ""; } - if (message.message){ - if (msg !== ""){ - msg+= "
"; + if (message.message) { + if (msg !== "") { + msg += "
"; } msg += "" + message.message + ""; } @@ -53,22 +55,26 @@ Module.register("alert",{ ttl: message.timer !== undefined ? message.timer : this.config.display_time }).show(); }, - show_alert: function(params, sender) { + show_alert: function (params, sender) { let image = ""; //Set standard params if not provided by module - if (typeof params.timer === "undefined") { params.timer = null; } - if (typeof params.imageHeight === "undefined") { params.imageHeight = "80px"; } + if (typeof params.timer === "undefined") { + params.timer = null; + } + if (typeof params.imageHeight === "undefined") { + params.imageHeight = "80px"; + } if (typeof params.imageUrl === "undefined" && typeof params.imageFA === "undefined") { params.imageUrl = null; - } else if (typeof params.imageFA === "undefined"){ - image = "
"; - } else if (typeof params.imageUrl === "undefined"){ - image = "
"; + } else if (typeof params.imageFA === "undefined") { + image = "
"; + } else if (typeof params.imageUrl === "undefined") { + image = "
"; } //Create overlay const overlay = document.createElement("div"); overlay.id = "overlay"; - overlay.innerHTML += "
"; + overlay.innerHTML += '
'; document.body.insertBefore(overlay, document.body.firstChild); //If module already has an open alert close it @@ -82,7 +88,7 @@ Module.register("alert",{ message += "" + params.title + ""; } if (params.message) { - if (message !== ""){ + if (message !== "") { message += "
"; } @@ -104,9 +110,8 @@ Module.register("alert",{ this.hide_alert(sender); }, params.timer); } - }, - hide_alert: function(sender) { + hide_alert: function (sender) { //Dismiss alert and remove from this.alerts if (this.alerts[sender.name]) { this.alerts[sender.name].dismiss(); @@ -116,18 +121,25 @@ Module.register("alert",{ overlay.parentNode.removeChild(overlay); } }, - setPosition: function(pos) { + setPosition: function (pos) { //Add css to body depending on the set position for notifications const sheet = document.createElement("style"); - if (pos === "center") {sheet.innerHTML = ".ns-box {margin-left: auto; margin-right: auto;text-align: center;}";} - if (pos === "right") {sheet.innerHTML = ".ns-box {margin-left: auto;text-align: right;}";} - if (pos === "left") {sheet.innerHTML = ".ns-box {margin-right: auto;text-align: left;}";} + if (pos === "center") { + sheet.innerHTML = ".ns-box {margin-left: auto; margin-right: auto;text-align: center;}"; + } + if (pos === "right") { + sheet.innerHTML = ".ns-box {margin-left: auto;text-align: right;}"; + } + if (pos === "left") { + sheet.innerHTML = ".ns-box {margin-right: auto;text-align: left;}"; + } document.body.appendChild(sheet); - }, - notificationReceived: function(notification, payload, sender) { + notificationReceived: function (notification, payload, sender) { if (notification === "SHOW_ALERT") { - if (typeof payload.type === "undefined") { payload.type = "alert"; } + if (typeof payload.type === "undefined") { + payload.type = "alert"; + } if (payload.type === "alert") { this.show_alert(payload, sender); } else if (payload.type === "notification") { @@ -137,15 +149,14 @@ Module.register("alert",{ this.hide_alert(sender); } }, - start: function() { + start: function () { this.alerts = {}; this.setPosition(this.config.position); if (this.config.welcome_message) { - if (this.config.welcome_message === true){ - this.show_notification({title: this.translate("sysTitle"), message: this.translate("welcome")}); - } - else{ - this.show_notification({title: this.translate("sysTitle"), message: this.config.welcome_message}); + if (this.config.welcome_message === true) { + this.show_notification({ title: this.translate("sysTitle"), message: this.translate("welcome") }); + } else { + this.show_notification({ title: this.translate("sysTitle"), message: this.config.welcome_message }); } } Log.info("Starting module: " + this.name); diff --git a/modules/default/alert/notificationFx.css b/modules/default/alert/notificationFx.css index 96491233..0782d464 100644 --- a/modules/default/alert/notificationFx.css +++ b/modules/default/alert/notificationFx.css @@ -235,8 +235,12 @@ } @keyframes animFade { - 0% { opacity: 0; } - 100% { opacity: 1; } + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } } @keyframes animJelly { diff --git a/modules/default/alert/notificationFx.js b/modules/default/alert/notificationFx.js index 9d548949..89034420 100644 --- a/modules/default/alert/notificationFx.js +++ b/modules/default/alert/notificationFx.js @@ -10,10 +10,13 @@ * Copyright 2014, Codrops * https://tympanus.net/codrops/ */ -(function(window) { - +(function (window) { /** - * extend obj function + * Extend one object with another one + * + * @param {object} a The object to extend + * @param {object} b The object which extends the other, overwrites existing keys + * @returns {object} The merged object */ function extend(a, b) { for (let key in b) { @@ -25,7 +28,10 @@ } /** - * NotificationFx function + * NotificationFx constructor + * + * @param {object} options The configuration options + * @class */ function NotificationFx(options) { this.options = extend({}, this.options); @@ -58,19 +64,22 @@ ttl: 6000, al_no: "ns-box", // callbacks - onClose: function() { return false; }, - onOpen: function() { return false; } + onClose: function () { + return false; + }, + onOpen: function () { + return false; + } }; /** - * init function - * initialize and cache some vars + * Initialize and cache some vars */ - NotificationFx.prototype._init = function() { + NotificationFx.prototype._init = function () { // create HTML structure this.ntf = document.createElement("div"); this.ntf.className = this.options.al_no + " ns-" + this.options.layout + " ns-effect-" + this.options.effect + " ns-type-" + this.options.type; - let strinner = "
"; + let strinner = '
'; strinner += this.options.message; strinner += "
"; this.ntf.innerHTML = strinner; @@ -92,17 +101,19 @@ }; /** - * init events + * Init events */ - NotificationFx.prototype._initEvents = function() { + NotificationFx.prototype._initEvents = function () { // dismiss notification by tapping on it if someone has a touchscreen - this.ntf.querySelector(".ns-box-inner").addEventListener("click", () => { this.dismiss(); }); + this.ntf.querySelector(".ns-box-inner").addEventListener("click", () => { + this.dismiss(); + }); }; /** - * show the notification + * Show the notification */ - NotificationFx.prototype.show = function() { + NotificationFx.prototype.show = function () { this.active = true; this.ntf.classList.remove("ns-hide"); this.ntf.classList.add("ns-show"); @@ -110,9 +121,9 @@ }; /** - * dismiss the notification + * Dismiss the notification */ - NotificationFx.prototype.dismiss = function() { + NotificationFx.prototype.dismiss = function () { this.active = false; clearTimeout(this.dismissttl); this.ntf.classList.remove("ns-show"); @@ -125,7 +136,9 @@ // after animation ends remove ntf from the DOM const onEndAnimationFn = (ev) => { - if (ev.target !== this.ntf) {return false;} + if (ev.target !== this.ntf) { + return false; + } this.ntf.removeEventListener("animationend", onEndAnimationFn); if (ev.target.parentNode === this.options.wrapper) { @@ -137,8 +150,7 @@ }; /** - * add to global namespace + * Add to global namespace */ window.NotificationFx = NotificationFx; - })(window); diff --git a/modules/default/alert/translations/bg.json b/modules/default/alert/translations/bg.json index abf0c96f..e97844c8 100644 --- a/modules/default/alert/translations/bg.json +++ b/modules/default/alert/translations/bg.json @@ -1,4 +1,4 @@ { - "sysTitle": "MagicMirror нотификация", - "welcome": "Добре дошли, стартирането беше успешно" + "sysTitle": "MagicMirror нотификация", + "welcome": "Добре дошли, стартирането беше успешно" } diff --git a/modules/default/alert/translations/da.json b/modules/default/alert/translations/da.json index 234f22b1..f79a5011 100644 --- a/modules/default/alert/translations/da.json +++ b/modules/default/alert/translations/da.json @@ -1,4 +1,4 @@ { - "sysTitle": "MagicMirror Notifikation", - "welcome": "Velkommen, modulet er succesfuldt startet!" + "sysTitle": "MagicMirror Notifikation", + "welcome": "Velkommen, modulet er succesfuldt startet!" } diff --git a/modules/default/alert/translations/de.json b/modules/default/alert/translations/de.json index 4ab7edbb..6a0340f2 100644 --- a/modules/default/alert/translations/de.json +++ b/modules/default/alert/translations/de.json @@ -1,4 +1,4 @@ { - "sysTitle": "MagicMirror Benachrichtigung", - "welcome": "Willkommen, Start war erfolgreich!" + "sysTitle": "MagicMirror Benachrichtigung", + "welcome": "Willkommen, Start war erfolgreich!" } diff --git a/modules/default/alert/translations/en.json b/modules/default/alert/translations/en.json index a8589a67..9854d518 100644 --- a/modules/default/alert/translations/en.json +++ b/modules/default/alert/translations/en.json @@ -1,4 +1,4 @@ { - "sysTitle": "MagicMirror Notification", - "welcome": "Welcome, start was successful!" + "sysTitle": "MagicMirror Notification", + "welcome": "Welcome, start was successful!" } diff --git a/modules/default/alert/translations/es.json b/modules/default/alert/translations/es.json index 39478251..84339233 100644 --- a/modules/default/alert/translations/es.json +++ b/modules/default/alert/translations/es.json @@ -1,4 +1,4 @@ { - "sysTitle": "MagicMirror Notificaciones", - "welcome": "Bienvenido, ¡se iniciado correctamente!" + "sysTitle": "MagicMirror Notificaciones", + "welcome": "Bienvenido, ¡se iniciado correctamente!" } diff --git a/modules/default/alert/translations/fr.json b/modules/default/alert/translations/fr.json index c89417f2..6ed40c62 100644 --- a/modules/default/alert/translations/fr.json +++ b/modules/default/alert/translations/fr.json @@ -1,4 +1,4 @@ { - "sysTitle": "MagicMirror Notification", - "welcome": "Bienvenue, le démarrage a été un succès!" + "sysTitle": "MagicMirror Notification", + "welcome": "Bienvenue, le démarrage a été un succès!" } diff --git a/modules/default/alert/translations/hu.json b/modules/default/alert/translations/hu.json index be618365..332458b5 100644 --- a/modules/default/alert/translations/hu.json +++ b/modules/default/alert/translations/hu.json @@ -1,4 +1,4 @@ { - "sysTitle": "MagicMirror értesítés", - "welcome": "Üdvözöljük, indulás sikeres!" + "sysTitle": "MagicMirror értesítés", + "welcome": "Üdvözöljük, indulás sikeres!" } diff --git a/modules/default/alert/translations/nl.json b/modules/default/alert/translations/nl.json index 9cda9089..39978191 100644 --- a/modules/default/alert/translations/nl.json +++ b/modules/default/alert/translations/nl.json @@ -1,4 +1,4 @@ { - "sysTitle": "MagicMirror Notificatie", - "welcome": "Welkom, Succesvol gestart!" + "sysTitle": "MagicMirror Notificatie", + "welcome": "Welkom, Succesvol gestart!" } diff --git a/modules/default/alert/translations/ru.json b/modules/default/alert/translations/ru.json index 60ddf3d8..fe535c2d 100644 --- a/modules/default/alert/translations/ru.json +++ b/modules/default/alert/translations/ru.json @@ -1,4 +1,4 @@ { - "sysTitle": "MagicMirror Уведомление", - "welcome": "Добро пожаловать, старт был успешным!" + "sysTitle": "MagicMirror Уведомление", + "welcome": "Добро пожаловать, старт был успешным!" } diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 5c8f187b..3583aa18 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -1,4 +1,5 @@ # Module: Calendar + The `calendar` module is one of the default modules of the MagicMirror. This module displays events from a public .ical calendar. It can combine multiple calendars. diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 24a2c45d..af804139 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -7,7 +7,6 @@ * MIT Licensed. */ Module.register("calendar", { - // Define module defaults defaults: { maximumEntries: 10, // Total Maximum Entries @@ -18,8 +17,11 @@ Module.register("calendar", { displayRepeatingCountTitle: false, defaultRepeatingCountTitle: "", maxTitleLength: 25, + maxLocationTitleLength: 25, wrapEvents: false, // wrap events to multiple lines breaking at maxTitleLength + wrapLocationEvents: false, maxTitleLines: 3, + maxEventTitleLines: 3, fetchInterval: 5 * 60 * 1000, // Update every 5 minutes. animationSpeed: 2000, fade: true, @@ -39,13 +41,16 @@ Module.register("calendar", { calendars: [ { symbol: "calendar", - url: "https://www.calendarlabs.com/templates/ical/US-Holidays.ics", - }, + url: "https://www.calendarlabs.com/templates/ical/US-Holidays.ics" + } ], titleReplace: { "De verjaardag van ": "", "'s birthday": "" }, + locationTitleReplace: { + "street ": "" + }, broadcastEvents: true, excludedEvents: [], sliceMultiDayEvents: false, @@ -85,7 +90,7 @@ Module.register("calendar", { var calendarConfig = { maximumEntries: calendar.maximumEntries, maximumNumberOfDays: calendar.maximumNumberOfDays, - broadcastPastEvents: calendar.broadcastPastEvents, + broadcastPastEvents: calendar.broadcastPastEvents }; if (calendar.symbolClass === "undefined" || calendar.symbolClass === null) { calendarConfig.symbolClass = ""; @@ -98,7 +103,7 @@ Module.register("calendar", { } // we check user and password here for backwards compatibility with old configs - if(calendar.user && calendar.pass) { + if (calendar.user && calendar.pass) { Log.warn("Deprecation warning: Please update your calendar authentication configuration."); Log.warn("https://github.com/MichMich/MagicMirror/tree/v2.1.2/modules/default/calendar#calendar-authentication-options"); calendar.auth = { @@ -112,7 +117,7 @@ Module.register("calendar", { // Trigger ADD_CALENDAR every fetchInterval to make sure there is always a calendar // fetcher running on the server side. var self = this; - setInterval(function() { + setInterval(function () { self.addCalendar(calendar.url, calendar.auth, calendarConfig); }, self.config.fetchInterval); } @@ -123,6 +128,10 @@ Module.register("calendar", { // Override socket notification handler. socketNotificationReceived: function (notification, payload) { + if (this.identifier !== payload.id) { + return; + } + if (notification === "CALENDAR_EVENTS") { if (this.hasCalendarURL(payload.url)) { this.calendarData[payload.url] = payload.events; @@ -144,13 +153,12 @@ Module.register("calendar", { // Override dom generator. getDom: function () { - var events = this.createEventList(); var wrapper = document.createElement("table"); wrapper.className = this.config.tableClass; if (events.length === 0) { - wrapper.innerHTML = (this.loaded) ? this.translate("EMPTY") : this.translate("LOADING"); + wrapper.innerHTML = this.loaded ? this.translate("EMPTY") : this.translate("LOADING"); wrapper.className = this.config.tableClass + " dimmed"; return wrapper; } @@ -169,8 +177,8 @@ Module.register("calendar", { for (var e in events) { var event = events[e]; var dateAsString = moment(event.startDate, "x").format(this.config.dateFormat); - if(this.config.timeFormat === "dateheaders"){ - if(lastSeenDate !== dateAsString){ + if (this.config.timeFormat === "dateheaders") { + if (lastSeenDate !== dateAsString) { var dateRow = document.createElement("tr"); dateRow.className = "normal"; var dateCell = document.createElement("td"); @@ -181,9 +189,10 @@ Module.register("calendar", { dateRow.appendChild(dateCell); wrapper.appendChild(dateRow); - if (e >= startFade) { //fading + if (e >= startFade) { + //fading currentFadeStep = e - startFade; - dateRow.style.opacity = 1 - (1 / fadeSteps * currentFadeStep); + dateRow.style.opacity = 1 - (1 / fadeSteps) * currentFadeStep; } lastSeenDate = dateAsString; @@ -196,7 +205,7 @@ Module.register("calendar", { eventWrapper.style.cssText = "color:" + this.colorForUrl(event.url); } - eventWrapper.className = "normal"; + eventWrapper.className = "normal event"; if (this.config.displaySymbol) { var symbolWrapper = document.createElement("td"); @@ -208,21 +217,18 @@ Module.register("calendar", { var symbolClass = this.symbolClassForUrl(event.url); symbolWrapper.className = "symbol align-right " + symbolClass; - var symbols = this.symbolsForUrl(event.url); - if(typeof symbols === "string") { - symbols = [symbols]; - } - - for(var i = 0; i < symbols.length; i++) { + var symbols = this.symbolsForEvent(event); + for (var i = 0; i < symbols.length; i++) { var symbol = document.createElement("span"); symbol.className = "fa fa-fw fa-" + symbols[i]; - if(i > 0){ + if (i > 0) { symbol.style.paddingLeft = "5px"; } symbolWrapper.appendChild(symbol); } + eventWrapper.appendChild(symbolWrapper); - } else if(this.config.timeFormat === "dateheaders"){ + } else if (this.config.timeFormat === "dateheaders") { var blankCell = document.createElement("td"); blankCell.innerHTML = "   "; eventWrapper.appendChild(blankCell); @@ -232,7 +238,6 @@ Module.register("calendar", { repeatingCountTitle = ""; if (this.config.displayRepeatingCountTitle && event.firstYear !== undefined) { - repeatingCountTitle = this.countTitleForUrl(event.url); if (repeatingCountTitle !== "") { @@ -243,7 +248,7 @@ Module.register("calendar", { } } - titleWrapper.innerHTML = this.titleTransform(event.title) + repeatingCountTitle; + titleWrapper.innerHTML = this.titleTransform(event.title, this.config.titleReplace, this.config.wrapEvents, this.config.maxTitleLength, this.config.maxTitleLines) + repeatingCountTitle; var titleClass = this.titleClassForUrl(event.url); @@ -255,12 +260,10 @@ Module.register("calendar", { var timeWrapper; - if(this.config.timeFormat === "dateheaders"){ - + if (this.config.timeFormat === "dateheaders") { if (event.fullDayEvent) { titleWrapper.colSpan = "2"; titleWrapper.align = "left"; - } else { timeWrapper = document.createElement("td"); timeWrapper.className = "time light " + this.timeClassForUrl(event.url); @@ -276,7 +279,6 @@ Module.register("calendar", { timeWrapper = document.createElement("td"); eventWrapper.appendChild(titleWrapper); - //console.log(event.today); var now = new Date(); // Define second, minute, hour, and day variables var oneSecond = 1000; // 1,000 milliseconds @@ -298,14 +300,14 @@ Module.register("calendar", { } } else { /* Check to see if the user displays absolute or relative dates with their events - * Also check to see if an event is happening within an 'urgency' time frameElement - * For example, if the user set an .urgency of 7 days, those events that fall within that - * time frame will be displayed with 'in xxx' time format or moment.fromNow() - * - * Note: this needs to be put in its own function, as the whole thing repeats again verbatim - */ + * Also check to see if an event is happening within an 'urgency' time frameElement + * For example, if the user set an .urgency of 7 days, those events that fall within that + * time frame will be displayed with 'in xxx' time format or moment.fromNow() + * + * Note: this needs to be put in its own function, as the whole thing repeats again verbatim + */ if (this.config.timeFormat === "absolute") { - if ((this.config.urgency > 1) && (event.startDate - now < (this.config.urgency * oneDay))) { + if (this.config.urgency > 1 && event.startDate - now < this.config.urgency * oneDay) { // This event falls within the config.urgency period that the user has set timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").from(moment().format("YYYYMMDD"))); } else { @@ -315,9 +317,9 @@ Module.register("calendar", { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").from(moment().format("YYYYMMDD"))); } } - if(this.config.showEnd){ - timeWrapper.innerHTML += "-" ; - timeWrapper.innerHTML += this.capFirst(moment(event.endDate , "x").format(this.config.fullDayEventDateFormat)); + if (this.config.showEnd) { + timeWrapper.innerHTML += "-"; + timeWrapper.innerHTML += this.capFirst(moment(event.endDate, "x").format(this.config.fullDayEventDateFormat)); } } else { if (event.startDate >= new Date()) { @@ -327,7 +329,7 @@ Module.register("calendar", { // If event is within 6 hour, display 'in xxx' time format or moment.fromNow() timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); } else { - if(this.config.timeFormat === "absolute" && !this.config.nextDaysRelative) { + if (this.config.timeFormat === "absolute" && !this.config.nextDaysRelative) { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat)); } else { // Otherwise just say 'Today/Tomorrow at such-n-such time' @@ -336,14 +338,14 @@ Module.register("calendar", { } } else { /* Check to see if the user displays absolute or relative dates with their events - * Also check to see if an event is happening within an 'urgency' time frameElement - * For example, if the user set an .urgency of 7 days, those events that fall within that - * time frame will be displayed with 'in xxx' time format or moment.fromNow() - * - * Note: this needs to be put in its own function, as the whole thing repeats again verbatim - */ + * Also check to see if an event is happening within an 'urgency' time frameElement + * For example, if the user set an .urgency of 7 days, those events that fall within that + * time frame will be displayed with 'in xxx' time format or moment.fromNow() + * + * Note: this needs to be put in its own function, as the whole thing repeats again verbatim + */ if (this.config.timeFormat === "absolute") { - if ((this.config.urgency > 1) && (event.startDate - now < (this.config.urgency * oneDay))) { + if (this.config.urgency > 1 && event.startDate - now < this.config.urgency * oneDay) { // This event falls within the config.urgency period that the user has set timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); } else { @@ -364,11 +366,9 @@ Module.register("calendar", { if (this.config.showEnd) { timeWrapper.innerHTML += "-"; timeWrapper.innerHTML += this.capFirst(moment(event.endDate, "x").format(this.config.dateEndFormat)); - } } //timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll'); - //console.log(event); timeWrapper.className = "time light " + this.timeClassForUrl(event.url); eventWrapper.appendChild(timeWrapper); } @@ -378,7 +378,7 @@ Module.register("calendar", { // Create fade effect. if (e >= startFade) { currentFadeStep = e - startFade; - eventWrapper.style.opacity = 1 - (1 / fadeSteps * currentFadeStep); + eventWrapper.style.opacity = 1 - (1 / fadeSteps) * currentFadeStep; } if (this.config.showLocation) { @@ -394,14 +394,14 @@ Module.register("calendar", { var descCell = document.createElement("td"); descCell.className = "location"; descCell.colSpan = "2"; - descCell.innerHTML = event.location; + descCell.innerHTML = this.titleTransform(event.location, this.config.locationTitleReplace, this.config.wrapLocationEvents, this.config.maxLocationTitleLength, this.config.maxEventTitleLines); locationRow.appendChild(descCell); wrapper.appendChild(locationRow); if (e >= startFade) { currentFadeStep = e - startFade; - locationRow.style.opacity = 1 - (1 / fadeSteps * currentFadeStep); + locationRow.style.opacity = 1 - (1 / fadeSteps) * currentFadeStep; } } } @@ -416,28 +416,27 @@ Module.register("calendar", { * it will a localeSpecification object with the system locale time format. * * @param {number} timeFormat Specifies either 12 or 24 hour time format - * @returns {moment.LocaleSpecification} + * @returns {moment.LocaleSpecification} formatted time */ - getLocaleSpecification: function(timeFormat) { + getLocaleSpecification: function (timeFormat) { switch (timeFormat) { - case 12: { - return { longDateFormat: {LT: "h:mm A"} }; - } - case 24: { - return { longDateFormat: {LT: "HH:mm"} }; - } - default: { - return { longDateFormat: {LT: moment.localeData().longDateFormat("LT")} }; - } + case 12: { + return { longDateFormat: { LT: "h:mm A" } }; + } + case 24: { + return { longDateFormat: { LT: "HH:mm" } }; + } + default: { + return { longDateFormat: { LT: moment.localeData().longDateFormat("LT") } }; + } } }, - /* hasCalendarURL(url) - * Check if this config contains the calendar url. + /** + * Checks if this config contains the calendar url. * - * argument url string - Url to look for. - * - * return bool - Has calendar url + * @param {string} url The calendar url + * @returns {boolean} True if the calendar config contains the url, False otherwise */ hasCalendarURL: function (url) { for (var c in this.config.calendars) { @@ -450,10 +449,10 @@ Module.register("calendar", { return false; }, - /* createEventList() + /** * Creates the sorted list of all events. * - * return array - Array with events. + * @returns {object[]} Array with events. */ createEventList: function () { var events = []; @@ -464,37 +463,38 @@ Module.register("calendar", { var calendar = this.calendarData[c]; for (var e in calendar) { var event = JSON.parse(JSON.stringify(calendar[e])); // clone object - if(event.endDate < now) { + + if (event.endDate < now) { continue; } - if(this.config.hidePrivate) { - if(event.class === "PRIVATE") { + if (this.config.hidePrivate) { + if (event.class === "PRIVATE") { // do not add the current event, skip it continue; } } - if(this.config.hideOngoing) { - if(event.startDate < now) { + if (this.config.hideOngoing) { + if (event.startDate < now) { continue; } } - if(this.listContainsEvent(events,event)){ + if (this.listContainsEvent(events, event)) { continue; } event.url = c; - event.today = event.startDate >= today && event.startDate < (today + 24 * 60 * 60 * 1000); + event.today = event.startDate >= today && event.startDate < today + 24 * 60 * 60 * 1000; /* if sliceMultiDayEvents is set to true, multiday events (events exceeding at least one midnight) are sliced into days, - * otherwise, esp. in dateheaders mode it is not clear how long these events are. - */ - var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf("day").format("x"))/(1000*60*60*24)) + 1; + * otherwise, esp. in dateheaders mode it is not clear how long these events are. + */ + var maxCount = Math.ceil((event.endDate - 1 - moment(event.startDate, "x").endOf("day").format("x")) / (1000 * 60 * 60 * 24)) + 1; if (this.config.sliceMultiDayEvents && maxCount > 1) { var splitEvents = []; var midnight = moment(event.startDate, "x").clone().startOf("day").add(1, "day").format("x"); var count = 1; while (event.endDate > midnight) { var thisEvent = JSON.parse(JSON.stringify(event)); // clone object - thisEvent.today = thisEvent.startDate >= today && thisEvent.startDate < (today + 24 * 60 * 60 * 1000); + thisEvent.today = thisEvent.startDate >= today && thisEvent.startDate < today + 24 * 60 * 60 * 1000; thisEvent.endDate = midnight; thisEvent.title += " (" + count + "/" + maxCount + ")"; splitEvents.push(thisEvent); @@ -504,11 +504,11 @@ Module.register("calendar", { midnight = moment(midnight, "x").add(1, "day").format("x"); // next day } // Last day - event.title += " ("+count+"/"+maxCount+")"; + event.title += " (" + count + "/" + maxCount + ")"; splitEvents.push(event); for (event of splitEvents) { - if ((event.endDate > now) && (event.endDate <= future)) { + if (event.endDate > now && event.endDate <= future) { events.push(event); } } @@ -524,22 +524,25 @@ Module.register("calendar", { return events.slice(0, this.config.maximumEntries); }, - listContainsEvent: function(eventList, event){ - for(var evt of eventList){ - if(evt.title === event.title && parseInt(evt.startDate) === parseInt(event.startDate)){ + listContainsEvent: function (eventList, event) { + for (var evt of eventList) { + if (evt.title === event.title && parseInt(evt.startDate) === parseInt(event.startDate)) { return true; } } return false; }, - /* createEventList(url) + /** * Requests node helper to add calendar url. * - * argument url string - Url to add. + * @param {string} url The calendar url to add + * @param {object} auth The authentication method and credentials + * @param {object} calendarConfig The config of the specific calendar */ addCalendar: function (url, auth, calendarConfig) { this.sendSocketNotification("ADD_CALENDAR", { + id: this.identifier, url: url, excludedEvents: calendarConfig.excludedEvents || this.config.excludedEvents, maximumEntries: calendarConfig.maximumEntries || this.config.maximumEntries, @@ -549,99 +552,105 @@ Module.register("calendar", { titleClass: calendarConfig.titleClass, timeClass: calendarConfig.timeClass, auth: auth, - broadcastPastEvents: calendarConfig.broadcastPastEvents || this.config.broadcastPastEvents, + broadcastPastEvents: calendarConfig.broadcastPastEvents || this.config.broadcastPastEvents }); }, /** - * symbolsForUrl(url) - * Retrieves the symbols for a specific url. + * Retrieves the symbols for a specific event. * - * argument url string - Url to look for. - * - * return string/array - The Symbols + * @param {object} event Event to look for. + * @returns {string[]} The symbols */ - symbolsForUrl: function (url) { - return this.getCalendarProperty(url, "symbol", this.config.defaultSymbol); + symbolsForEvent: function (event) { + let symbols = this.getCalendarPropertyAsArray(event.url, "symbol", this.config.defaultSymbol); + + if (event.recurringEvent === true && this.hasCalendarProperty(event.url, "recurringSymbol")) { + symbols = this.mergeUnique(this.getCalendarPropertyAsArray(event.url, "recurringSymbol", this.config.defaultSymbol), symbols); + } + + if (event.fullDayEvent === true && this.hasCalendarProperty(event.url, "fullDaySymbol")) { + symbols = this.mergeUnique(this.getCalendarPropertyAsArray(event.url, "fullDaySymbol", this.config.defaultSymbol), symbols); + } + + return symbols; + }, + + mergeUnique: function (arr1, arr2) { + return arr1.concat( + arr2.filter(function (item) { + return arr1.indexOf(item) === -1; + }) + ); }, /** - * symbolClassForUrl(url) - * Retrieves the symbolClass for a specific url. + * Retrieves the symbolClass for a specific calendar url. * - * @param url string - Url to look for. - * - * @returns string + * @param {string} url The calendar url + * @returns {string} The class to be used for the symbols of the calendar */ symbolClassForUrl: function (url) { return this.getCalendarProperty(url, "symbolClass", ""); }, /** - * titleClassForUrl(url) - * Retrieves the titleClass for a specific url. + * Retrieves the titleClass for a specific calendar url. * - * @param url string - Url to look for. - * - * @returns string + * @param {string} url The calendar url + * @returns {string} The class to be used for the title of the calendar */ titleClassForUrl: function (url) { return this.getCalendarProperty(url, "titleClass", ""); }, /** - * timeClassForUrl(url) - * Retrieves the timeClass for a specific url. + * Retrieves the timeClass for a specific calendar url. * - * @param url string - Url to look for. - * - * @returns string + * @param {string} url The calendar url + * @returns {string} The class to be used for the time of the calendar */ timeClassForUrl: function (url) { return this.getCalendarProperty(url, "timeClass", ""); }, - /* calendarNameForUrl(url) - * Retrieves the calendar name for a specific url. + /** + * Retrieves the calendar name for a specific calendar url. * - * argument url string - Url to look for. - * - * return string - The name of the calendar + * @param {string} url The calendar url + * @returns {string} The name of the calendar */ calendarNameForUrl: function (url) { return this.getCalendarProperty(url, "name", ""); }, - /* colorForUrl(url) - * Retrieves the color for a specific url. + /** + * Retrieves the color for a specific calendar url. * - * argument url string - Url to look for. - * - * return string - The Color + * @param {string} url The calendar url + * @returns {string} The color */ colorForUrl: function (url) { return this.getCalendarProperty(url, "color", "#fff"); }, - /* countTitleForUrl(url) - * Retrieves the name for a specific url. + /** + * Retrieves the count title for a specific calendar url. * - * argument url string - Url to look for. - * - * return string - The Symbol + * @param {string} url The calendar url + * @returns {string} The title */ countTitleForUrl: function (url) { return this.getCalendarProperty(url, "repeatingCountTitle", this.config.defaultRepeatingCountTitle); }, - /* getCalendarProperty(url, property, defaultValue) - * Helper method to retrieve the property for a specific url. + /** + * Helper method to retrieve the property for a specific calendar url. * - * argument url string - Url to look for. - * argument property string - Property to look for. - * argument defaultValue string - Value if property is not found. - * - * return string - The Property + * @param {string} url The calendar url + * @param {string} property The property to look for + * @param {string} defaultValue The value if the property is not found + * @returns {*} The property */ getCalendarProperty: function (url, property, defaultValue) { for (var c in this.config.calendars) { @@ -654,6 +663,16 @@ Module.register("calendar", { return defaultValue; }, + getCalendarPropertyAsArray: function (url, property, defaultValue) { + let p = this.getCalendarProperty(url, property, defaultValue); + if (!(p instanceof Array)) p = [p]; + return p; + }, + + hasCalendarProperty: function (url, property) { + return !!this.getCalendarProperty(url, property, undefined); + }, + /** * Shortens a string if it's longer than maxLength and add a ellipsis to the end * @@ -676,8 +695,9 @@ Module.register("calendar", { for (var i = 0; i < words.length; i++) { var word = words[i]; - if (currentLine.length + word.length < (typeof maxLength === "number" ? maxLength : 25) - 1) { // max - 1 to account for a space - currentLine += (word + " "); + if (currentLine.length + word.length < (typeof maxLength === "number" ? maxLength : 25) - 1) { + // max - 1 to account for a space + currentLine += word + " "; } else { line++; if (line > maxTitleLines - 1) { @@ -688,9 +708,9 @@ Module.register("calendar", { } if (currentLine.length > 0) { - temp += (currentLine + "
" + word + " "); + temp += currentLine + "
" + word + " "; } else { - temp += (word + "
"); + temp += word + "
"; } currentLine = ""; } @@ -706,26 +726,31 @@ Module.register("calendar", { } }, - /* capFirst(string) + /** * Capitalize the first letter of a string - * Return capitalized string + * + * @param {string} string The string to capitalize + * @returns {string} The capitalized string */ capFirst: function (string) { return string.charAt(0).toUpperCase() + string.slice(1); }, - /* titleTransform(title) + /** * Transforms the title of an event for usage. * Replaces parts of the text as defined in config.titleReplace. * Shortens title based on config.maxTitleLength and config.wrapEvents * - * argument title string - The title to transform. - * - * return string - The transformed title. + * @param {string} title The title to transform. + * @param {object} titleReplace Pairs of strings to be replaced in the title + * @param {boolean} wrapEvents Wrap the text after the line has reached maxLength + * @param {number} maxTitleLength The max length of the string + * @param {number} maxTitleLines The max number of vertical lines before cutting event title + * @returns {string} The transformed title. */ - titleTransform: function (title) { - for (var needle in this.config.titleReplace) { - var replacement = this.config.titleReplace[needle]; + titleTransform: function (title, titleReplace, wrapEvents, maxTitleLength, maxTitleLines) { + for (var needle in titleReplace) { + var replacement = titleReplace[needle]; var regParts = needle.match(/^\/(.+)\/([gim]*)$/); if (regParts) { @@ -736,11 +761,11 @@ Module.register("calendar", { title = title.replace(needle, replacement); } - title = this.shorten(title, this.config.maxTitleLength, this.config.wrapEvents, this.config.maxTitleLines); + title = this.shorten(title, maxTitleLength, wrapEvents, maxTitleLines); return title; }, - /* broadcastEvents() + /** * Broadcasts the events to all other modules for reuse. * The all events available in one array, sorted on startdate. */ @@ -750,7 +775,7 @@ Module.register("calendar", { var calendar = this.calendarData[url]; for (var e in calendar) { var event = cloneObject(calendar[e]); - event.symbol = this.symbolsForUrl(url); + event.symbol = this.symbolsForEvent(event); event.calendarName = this.calendarNameForUrl(url); event.color = this.colorForUrl(url); delete event.url; @@ -758,11 +783,10 @@ Module.register("calendar", { } } - eventList.sort(function(a,b) { + eventList.sort(function (a, b) { return a.startDate - b.startDate; }); this.sendNotification("CALENDAR_EVENTS", eventList); - } }); diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 177fd9ac..a67dc99b 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -4,78 +4,95 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ +const Log = require("../../../js/logger.js"); +const ical = require("ical"); +const request = require("request"); -const ical = require("./vendor/ical.js"); +/** + * Moment date + * + * @external Moment + * @see {@link http://momentjs.com} + */ const moment = require("moment"); -var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents) { - var self = this; +/** + * + * @param {string} url The url of the calendar to fetch + * @param {number} reloadInterval Time in ms the calendar is fetched again + * @param {string[]} excludedEvents An array of words / phrases from event titles that will be excluded from being shown. + * @param {number} maximumEntries The maximum number of events fetched. + * @param {number} maximumNumberOfDays The maximum number of days an event should be in the future. + * @param {object} auth The object containing options for authentication against the calendar. + * @param {boolean} includePastEvents If true events from the past maximumNumberOfDays will be fetched too + * @class + */ +const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents) { + const self = this; - var reloadTimer = null; - var events = []; + let reloadTimer = null; + let events = []; - var fetchFailedCallback = function() {}; - var eventsReceivedCallback = function() {}; + let fetchFailedCallback = function () {}; + let eventsReceivedCallback = function () {}; - /* fetchCalendar() + /** * Initiates calendar fetch. */ - var fetchCalendar = function() { - + const fetchCalendar = function () { clearTimeout(reloadTimer); reloadTimer = null; - var nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]); - var opts = { + const nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]); + const opts = { headers: { - "User-Agent": "Mozilla/5.0 (Node.js "+ nodeVersion + ") MagicMirror/" + global.version + " (https://github.com/MichMich/MagicMirror/)" + "User-Agent": "Mozilla/5.0 (Node.js " + nodeVersion + ") MagicMirror/" + global.version + " (https://github.com/MichMich/MagicMirror/)" }, gzip: true }; if (auth) { - if(auth.method === "bearer"){ + if (auth.method === "bearer") { opts.auth = { bearer: auth.pass }; - } else { opts.auth = { user: auth.user, - pass: auth.pass + pass: auth.pass, + sendImmediately: auth.method !== "digest" }; - - if(auth.method === "digest"){ - opts.auth.sendImmediately = false; - } else { - opts.auth.sendImmediately = true; - } } } - ical.fromURL(url, opts, function(err, data) { + request(url, opts, function (err, r, requestData) { if (err) { fetchFailedCallback(self, err); scheduleTimer(); return; + } else if (r.statusCode !== 200) { + fetchFailedCallback(self, r.statusCode + ": " + r.statusMessage); + scheduleTimer(); + return; } - // console.log(data); - var newEvents = []; + const data = ical.parseICS(requestData); + const newEvents = []; // limitFunction doesn't do much limiting, see comment re: the dates array in rrule section below as to why we need to do the filtering ourselves - var limitFunction = function(date, i) {return true;}; - - var eventDate = function(event, time) { - return (event[time].length === 8) ? moment(event[time], "YYYYMMDD") : moment(new Date(event[time])); + const limitFunction = function (date, i) { + return true; }; - for (var e in data) { - var event = data[e]; - var now = new Date(); - var today = moment().startOf("day").toDate(); - var future = moment().startOf("day").add(maximumNumberOfDays, "days").subtract(1,"seconds").toDate(); // Subtract 1 second so that events that start on the middle of the night will not repeat. - var past = today; + const eventDate = function (event, time) { + return event[time].length === 8 ? moment(event[time], "YYYYMMDD") : moment(new Date(event[time])); + }; + + Object.entries(data).forEach(([key, event]) => { + const now = new Date(); + const today = moment().startOf("day").toDate(); + const future = moment().startOf("day").add(maximumNumberOfDays, "days").subtract(1, "seconds").toDate(); // Subtract 1 second so that events that start on the middle of the night will not repeat. + let past = today; if (includePastEvents) { past = moment().startOf("day").subtract(maximumNumberOfDays, "days").toDate(); @@ -83,7 +100,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri // FIXME: Ugly fix to solve the facebook birthday issue. // Otherwise, the recurring events only show the birthday for next year. - var isFacebookBirthday = false; + let isFacebookBirthday = false; if (typeof event.uid !== "undefined") { if (event.uid.indexOf("@facebook.com") !== -1) { isFacebookBirthday = true; @@ -91,14 +108,13 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri } if (event.type === "VEVENT") { + let startDate = eventDate(event, "start"); + let endDate; - var startDate = eventDate(event, "start"); - var endDate; if (typeof event.end !== "undefined") { endDate = eventDate(event, "end"); - } else if(typeof event.duration !== "undefined") { - var dur=moment.duration(event.duration); - endDate = startDate.clone().add(dur); + } else if (typeof event.duration !== "undefined") { + endDate = startDate.clone().add(moment.duration(event.duration)); } else { if (!isFacebookBirthday) { endDate = startDate; @@ -107,20 +123,20 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri } } - // calculate the duration f the event for use with recurring events. - var duration = parseInt(endDate.format("x")) - parseInt(startDate.format("x")); + // calculate the duration of the event for use with recurring events. + let duration = parseInt(endDate.format("x")) - parseInt(startDate.format("x")); if (event.start.length === 8) { startDate = startDate.startOf("day"); } - var title = getTitleFromEvent(event); + const title = getTitleFromEvent(event); - var excluded = false, + let excluded = false, dateFilter = null; - for (var f in excludedEvents) { - var filter = excludedEvents[f], + for (let f in excludedEvents) { + let filter = excludedEvents[f], testTitle = title.toLowerCase(), until = null, useRegex = false, @@ -163,87 +179,80 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri } if (excluded) { - continue; + return; } - var location = event.location || false; - var geo = event.geo || false; - var description = event.description || false; + const location = event.location || false; + const geo = event.geo || false; + const description = event.description || false; if (typeof event.rrule !== "undefined" && event.rrule !== null && !isFacebookBirthday) { - var rule = event.rrule; - var addedEvents = 0; + const rule = event.rrule; + let addedEvents = 0; + + const pastMoment = moment(past); + const futureMoment = moment(future); // can cause problems with e.g. birthdays before 1900 - if(rule.options && rule.origOptions && rule.origOptions.dtstart && rule.origOptions.dtstart.getFullYear() < 1900 || - rule.options && rule.options.dtstart && rule.options.dtstart.getFullYear() < 1900){ + if ((rule.options && rule.origOptions && rule.origOptions.dtstart && rule.origOptions.dtstart.getFullYear() < 1900) || (rule.options && rule.options.dtstart && rule.options.dtstart.getFullYear() < 1900)) { rule.origOptions.dtstart.setYear(1900); rule.options.dtstart.setYear(1900); } // For recurring events, get the set of start dates that fall within the range - // of dates we"re looking for. + // of dates we're looking for. // kblankenship1989 - to fix issue #1798, converting all dates to locale time first, then converting back to UTC time - var pastLocal = moment(past).subtract(past.getTimezoneOffset(), "minutes").toDate(); - var futureLocal = moment(future).subtract(future.getTimezoneOffset(), "minutes").toDate(); - var datesLocal = rule.between(pastLocal, futureLocal, true, limitFunction); - var dates = datesLocal.map(function(dateLocal) { - var date = moment(dateLocal).add(dateLocal.getTimezoneOffset(), "minutes").toDate(); - return date; - }); + let pastLocal = 0; + let futureLocal = 0; + if (isFullDayEvent(event)) { + // if full day event, only use the date part of the ranges + pastLocal = pastMoment.toDate(); + futureLocal = futureMoment.toDate(); + } else { + pastLocal = pastMoment.subtract(past.getTimezoneOffset(), "minutes").toDate(); + futureLocal = futureMoment.subtract(future.getTimezoneOffset(), "minutes").toDate(); + } + const dates = rule.between(pastLocal, futureLocal, true, limitFunction); // The "dates" array contains the set of dates within our desired date range range that are valid - // for the recurrence rule. *However*, it"s possible for us to have a specific recurrence that + // for the recurrence rule. *However*, it's possible for us to have a specific recurrence that // had its date changed from outside the range to inside the range. For the time being, - // we"ll handle this by adding *all* recurrence entries into the set of dates that we check, - // because the logic below will filter out any recurrences that don"t actually belong within + // we'll handle this by adding *all* recurrence entries into the set of dates that we check, + // because the logic below will filter out any recurrences that don't actually belong within // our display range. // Would be great if there was a better way to handle this. - if (event.recurrences !== undefined) - { - var pastMoment = moment(past); - var futureMoment = moment(future); - - for (var r in event.recurrences) - { + if (event.recurrences !== undefined) { + for (let r in event.recurrences) { // Only add dates that weren't already in the range we added from the rrule so that // we don"t double-add those events. - if (moment(new Date(r)).isBetween(pastMoment, futureMoment) !== true) - { + if (moment(new Date(r)).isBetween(pastMoment, futureMoment) !== true) { dates.push(new Date(r)); } } } // Loop through the set of date entries to see which recurrences should be added to our event list. - for (var d in dates) { - var date = dates[d]; + for (let d in dates) { + const date = dates[d]; // ical.js started returning recurrences and exdates as ISOStrings without time information. // .toISOString().substring(0,10) is the method they use to calculate keys, so we'll do the same // (see https://github.com/peterbraden/ical.js/pull/84 ) - var dateKey = date.toISOString().substring(0,10); - var curEvent = event; - var showRecurrence = true; - - // Stop parsing this event's recurrences if we've already found maximumEntries worth of recurrences. - // (The logic below would still filter the extras, but the check is simple since we're already tracking the count) - if (addedEvents >= maximumEntries) { - break; - } + const dateKey = date.toISOString().substring(0, 10); + let curEvent = event; + let showRecurrence = true; + let duration = 0; startDate = moment(date); - // For each date that we"re checking, it"s possible that there is a recurrence override for that one day. - if ((curEvent.recurrences !== undefined) && (curEvent.recurrences[dateKey] !== undefined)) - { + // For each date that we're checking, it's possible that there is a recurrence override for that one day. + if (curEvent.recurrences !== undefined && curEvent.recurrences[dateKey] !== undefined) { // We found an override, so for this recurrence, use a potentially different title, start date, and duration. curEvent = curEvent.recurrences[dateKey]; startDate = moment(curEvent.start); duration = parseInt(moment(curEvent.end).format("x")) - parseInt(startDate.format("x")); } - // If there"s no recurrence override, check for an exception date. Exception dates represent exceptions to the rule. - else if ((curEvent.exdate !== undefined) && (curEvent.exdate[dateKey] !== undefined)) - { + // If there's no recurrence override, check for an exception date. Exception dates represent exceptions to the rule. + else if (curEvent.exdate !== undefined && curEvent.exdate[dateKey] !== undefined) { // This date is an exception date, which means we should skip it in the recurrence pattern. showRecurrence = false; } @@ -253,7 +262,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri endDate = endDate.endOf("day"); } - var recurrenceTitle = getTitleFromEvent(curEvent); + const recurrenceTitle = getTitleFromEvent(curEvent); // If this recurrence ends before the start of the date range, or starts after the end of the date range, don"t add // it to the event list. @@ -265,13 +274,14 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri showRecurrence = false; } - if ((showRecurrence === true) && (addedEvents < maximumEntries)) { + if (showRecurrence === true) { addedEvents++; newEvents.push({ title: recurrenceTitle, startDate: startDate.format("x"), endDate: endDate.format("x"), fullDayEvent: isFullDayEvent(event), + recurringEvent: true, class: event.class, firstYear: event.start.getFullYear(), location: location, @@ -282,43 +292,41 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri } // end recurring event parsing } else { - // console.log("Single event ..."); // Single event. - var fullDayEvent = (isFacebookBirthday) ? true : isFullDayEvent(event); + const fullDayEvent = isFacebookBirthday ? true : isFullDayEvent(event); if (includePastEvents) { + // Past event is too far in the past, so skip. if (endDate < past) { - //console.log("Past event is too far in the past. So skip: " + title); - continue; + return; } } else { + // It's not a fullday event, and it is in the past, so skip. if (!fullDayEvent && endDate < new Date()) { - //console.log("It's not a fullday event, and it is in the past. So skip: " + title); - continue; + return; } + // It's a fullday event, and it is before today, So skip. if (fullDayEvent && endDate <= today) { - //console.log("It's a fullday event, and it is before today. So skip: " + title); - continue; + return; } } + // It exceeds the maximumNumberOfDays limit, so skip. if (startDate > future) { - //console.log("It exceeds the maximumNumberOfDays limit. So skip: " + title); - continue; + return; } if (timeFilterApplies(now, endDate, dateFilter)) { - continue; + return; } - // adjust start date so multiple day events will be displayed as happening today even though they started some days ago already + // Adjust start date so multiple day events will be displayed as happening today even though they started some days ago already if (fullDayEvent && startDate <= today) { startDate = moment(today); } // Every thing is good. Add it to the list. - newEvents.push({ title: title, startDate: startDate.format("x"), @@ -329,16 +337,13 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri geo: geo, description: description }); - } } - } - - newEvents.sort(function(a, b) { - return a.startDate - b.startDate; }); - //console.log(newEvents); + newEvents.sort(function (a, b) { + return a.startDate - b.startDate; + }); events = newEvents.slice(0, maximumEntries); @@ -347,33 +352,31 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri }); }; - /* scheduleTimer() + /** * Schedule the timer for the next update. */ - var scheduleTimer = function() { - //console.log('Schedule update timer.'); + const scheduleTimer = function () { clearTimeout(reloadTimer); - reloadTimer = setTimeout(function() { + reloadTimer = setTimeout(function () { fetchCalendar(); }, reloadInterval); }; - /* isFullDayEvent(event) + /** * Checks if an event is a fullday event. * - * argument event object - The event object to check. - * - * return bool - The event is a fullday event. + * @param {object} event The event object to check. + * @returns {boolean} True if the event is a fullday event, false otherwise */ - var isFullDayEvent = function(event) { + const isFullDayEvent = function (event) { if (event.start.length === 8 || event.start.dateOnly) { return true; } - var start = event.start || 0; - var startDate = new Date(start); - var end = event.end || 0; - if (((end - start) % (24 * 60 * 60 * 1000)) === 0 && startDate.getHours() === 0 && startDate.getMinutes() === 0) { + const start = event.start || 0; + const startDate = new Date(start); + const end = event.end || 0; + if ((end - start) % (24 * 60 * 60 * 1000) === 0 && startDate.getHours() === 0 && startDate.getMinutes() === 0) { // Is 24 hours, and starts on the middle of the night. return true; } @@ -381,20 +384,19 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri return false; }; - /* timeFilterApplies() + /** * Determines if the user defined time filter should apply * - * argument now Date - Date object using previously created object for consistency - * argument endDate Moment - Moment object representing the event end date - * argument filter string - The time to subtract from the end date to determine if an event should be shown - * - * return bool - The event should be filtered out + * @param {Date} now Date object using previously created object for consistency + * @param {Moment} endDate Moment object representing the event end date + * @param {string} filter The time to subtract from the end date to determine if an event should be shown + * @returns {boolean} True if the event should be filtered out, false otherwise */ - var timeFilterApplies = function(now, endDate, filter) { + const timeFilterApplies = function (now, endDate, filter) { if (filter) { - var until = filter.split(" "), + const until = filter.split(" "), value = parseInt(until[0]), - increment = until[1].slice("-1") === "s" ? until[1] : until[1] + "s", // Massage the data for moment js + increment = until[1].slice(-1) === "s" ? until[1] : until[1] + "s", // Massage the data for moment js filterUntil = moment(endDate.format()).subtract(value, increment); return now < filterUntil.format("x"); @@ -403,17 +405,16 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri return false; }; - /* getTitleFromEvent(event) - * Gets the title from the event. - * - * argument event object - The event object to check. - * - * return string - The title of the event, or "Event" if no title is found. - */ - var getTitleFromEvent = function (event) { - var title = "Event"; + /** + * Gets the title from the event. + * + * @param {object} event The event object to check. + * @returns {string} The title of the event, or "Event" if no title is found. + */ + const getTitleFromEvent = function (event) { + let title = "Event"; if (event.summary) { - title = (typeof event.summary.val !== "undefined") ? event.summary.val : event.summary; + title = typeof event.summary.val !== "undefined" ? event.summary.val : event.summary; } else if (event.description) { title = event.description; } @@ -421,7 +422,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri return title; }; - var testTitleByFilter = function (title, filter, useRegex, regexFlags) { + const testTitleByFilter = function (title, filter, useRegex, regexFlags) { if (useRegex) { // Assume if leading slash, there is also trailing slash if (filter[0] === "/") { @@ -439,54 +440,54 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri /* public methods */ - /* startFetch() + /** * Initiate fetchCalendar(); */ - this.startFetch = function() { + this.startFetch = function () { fetchCalendar(); }; - /* broadcastItems() + /** * Broadcast the existing events. */ - this.broadcastEvents = function() { - //console.log('Broadcasting ' + events.length + ' events.'); + this.broadcastEvents = function () { + Log.info("Calendar-Fetcher: Broadcasting " + events.length + " events."); eventsReceivedCallback(self); }; - /* onReceive(callback) + /** * Sets the on success callback * - * argument callback function - The on success callback. + * @param {Function} callback The on success callback. */ - this.onReceive = function(callback) { + this.onReceive = function (callback) { eventsReceivedCallback = callback; }; - /* onError(callback) + /** * Sets the on error callback * - * argument callback function - The on error callback. + * @param {Function} callback The on error callback. */ - this.onError = function(callback) { + this.onError = function (callback) { fetchFailedCallback = callback; }; - /* url() + /** * Returns the url of this fetcher. * - * return string - The url of this fetcher. + * @returns {string} The url of this fetcher. */ - this.url = function() { + this.url = function () { return url; }; - /* events() + /** * Returns current available events for this fetcher. * - * return array - The current available events for this fetcher. + * @returns {object[]} The current available events for this fetcher. */ - this.events = function() { + this.events = function () { return events; }; }; diff --git a/modules/default/calendar/debug.js b/modules/default/calendar/debug.js index 51e6f20c..f01bcc0d 100644 --- a/modules/default/calendar/debug.js +++ b/modules/default/calendar/debug.js @@ -5,31 +5,30 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ +const CalendarFetcher = require("./calendarfetcher.js"); -var CalendarFetcher = require("./calendarfetcher.js"); - -var url = "https://calendar.google.com/calendar/ical/pkm1t2uedjbp0uvq1o7oj1jouo%40group.calendar.google.com/private-08ba559f89eec70dd74bbd887d0a3598/basic.ics"; // Standard test URL -// var url = "https://www.googleapis.com/calendar/v3/calendars/primary/events/"; // URL for Bearer auth (must be configured in Google OAuth2 first) -var fetchInterval = 60 * 60 * 1000; -var maximumEntries = 10; -var maximumNumberOfDays = 365; -var user = "magicmirror"; -var pass = "MyStrongPass"; -var auth = { +const url = "https://calendar.google.com/calendar/ical/pkm1t2uedjbp0uvq1o7oj1jouo%40group.calendar.google.com/private-08ba559f89eec70dd74bbd887d0a3598/basic.ics"; // Standard test URL +//const url = "https://www.googleapis.com/calendar/v3/calendars/primary/events/"; // URL for Bearer auth (must be configured in Google OAuth2 first) +const fetchInterval = 60 * 60 * 1000; +const maximumEntries = 10; +const maximumNumberOfDays = 365; +const user = "magicmirror"; +const pass = "MyStrongPass"; +const auth = { user: user, pass: pass }; console.log("Create fetcher ..."); -var fetcher = new CalendarFetcher(url, fetchInterval, [], maximumEntries, maximumNumberOfDays, auth); +const fetcher = new CalendarFetcher(url, fetchInterval, [], maximumEntries, maximumNumberOfDays, auth); -fetcher.onReceive(function(fetcher) { +fetcher.onReceive(function (fetcher) { console.log(fetcher.events()); console.log("------------------------------------------------------------"); }); -fetcher.onError(function(fetcher, error) { +fetcher.onError(function (fetcher, error) { console.log("Fetcher error:"); console.log(error); }); diff --git a/modules/default/calendar/node_helper.js b/modules/default/calendar/node_helper.js index 2d923cf3..862755a0 100644 --- a/modules/default/calendar/node_helper.js +++ b/modules/default/calendar/node_helper.js @@ -4,73 +4,72 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ - -var NodeHelper = require("node_helper"); -var validUrl = require("valid-url"); -var CalendarFetcher = require("./calendarfetcher.js"); +const NodeHelper = require("node_helper"); +const validUrl = require("valid-url"); +const CalendarFetcher = require("./calendarfetcher.js"); +const Log = require("../../../js/logger"); module.exports = NodeHelper.create({ // Override start method. - start: function() { - var events = []; - + start: function () { + Log.log("Starting node helper for: " + this.name); this.fetchers = []; - - console.log("Starting node helper for: " + this.name); - }, // Override socketNotificationReceived method. - socketNotificationReceived: function(notification, payload) { + socketNotificationReceived: function (notification, payload) { if (notification === "ADD_CALENDAR") { - //console.log('ADD_CALENDAR: '); - this.createFetcher(payload.url, payload.fetchInterval, payload.excludedEvents, payload.maximumEntries, payload.maximumNumberOfDays, payload.auth, payload.broadcastPastEvents); + this.createFetcher(payload.url, payload.fetchInterval, payload.excludedEvents, payload.maximumEntries, payload.maximumNumberOfDays, payload.auth, payload.broadcastPastEvents, payload.id); } }, - /* createFetcher(url, reloadInterval) + /** * Creates a fetcher for a new url if it doesn't exist yet. * Otherwise it reuses the existing one. * - * attribute url string - URL of the news feed. - * attribute reloadInterval number - Reload interval in milliseconds. + * @param {string} url The url of the calendar + * @param {number} fetchInterval How often does the calendar needs to be fetched in ms + * @param {string[]} excludedEvents An array of words / phrases from event titles that will be excluded from being shown. + * @param {number} maximumEntries The maximum number of events fetched. + * @param {number} maximumNumberOfDays The maximum number of days an event should be in the future. + * @param {object} auth The object containing options for authentication against the calendar. + * @param {boolean} broadcastPastEvents If true events from the past maximumNumberOfDays will be included in event broadcasts + * @param {string} identifier ID of the module */ - - createFetcher: function(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, broadcastPastEvents) { + createFetcher: function (url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, broadcastPastEvents, identifier) { var self = this; if (!validUrl.isUri(url)) { - self.sendSocketNotification("INCORRECT_URL", {url: url}); + self.sendSocketNotification("INCORRECT_URL", { id: identifier, url: url }); return; } var fetcher; - if (typeof self.fetchers[url] === "undefined") { - console.log("Create new calendar fetcher for url: " + url + " - Interval: " + fetchInterval); + if (typeof self.fetchers[identifier + url] === "undefined") { + Log.log("Create new calendar fetcher for url: " + url + " - Interval: " + fetchInterval); fetcher = new CalendarFetcher(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, broadcastPastEvents); - fetcher.onReceive(function(fetcher) { - //console.log('Broadcast events.'); - //console.log(fetcher.events()); - + fetcher.onReceive(function (fetcher) { self.sendSocketNotification("CALENDAR_EVENTS", { + id: identifier, url: fetcher.url(), events: fetcher.events() }); }); - fetcher.onError(function(fetcher, error) { - console.error("Calendar Error. Could not fetch calendar: ", fetcher.url(), error); + fetcher.onError(function (fetcher, error) { + Log.error("Calendar Error. Could not fetch calendar: ", fetcher.url(), error); self.sendSocketNotification("FETCH_ERROR", { + id: identifier, url: fetcher.url(), error: error }); }); - self.fetchers[url] = fetcher; + self.fetchers[identifier + url] = fetcher; } else { - //console.log('Use existing news fetcher for url: ' + url); - fetcher = self.fetchers[url]; + Log.log("Use existing calendar fetcher for url: " + url); + fetcher = self.fetchers[identifier + url]; fetcher.broadcastEvents(); } diff --git a/modules/default/calendar/vendor/ical.js/.travis.yml b/modules/default/calendar/vendor/ical.js/.travis.yml deleted file mode 100644 index d5d4c1e3..00000000 --- a/modules/default/calendar/vendor/ical.js/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "8.9" -install: npm install diff --git a/modules/default/calendar/vendor/ical.js/LICENSE b/modules/default/calendar/vendor/ical.js/LICENSE deleted file mode 100644 index e454a525..00000000 --- a/modules/default/calendar/vendor/ical.js/LICENSE +++ /dev/null @@ -1,178 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - diff --git a/modules/default/calendar/vendor/ical.js/NOTICE b/modules/default/calendar/vendor/ical.js/NOTICE deleted file mode 100644 index d5f926db..00000000 --- a/modules/default/calendar/vendor/ical.js/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2012 Peter Braden - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/modules/default/calendar/vendor/ical.js/example.js b/modules/default/calendar/vendor/ical.js/example.js deleted file mode 100644 index 7b41f1ad..00000000 --- a/modules/default/calendar/vendor/ical.js/example.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const ical = require('ical'); -const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - -ical.fromURL('http://lanyrd.com/topics/nodejs/nodejs.ics', {}, function (err, data) { - for (let k in data) { - if (data.hasOwnProperty(k)) { - var ev = data[k]; - if (data[k].type == 'VEVENT') { - console.log(`${ev.summary} is in ${ev.location} on the ${ev.start.getDate()} of ${months[ev.start.getMonth()]} at ${ev.start.toLocaleTimeString('en-GB')}`); - - } - } - } -}); diff --git a/modules/default/calendar/vendor/ical.js/example_rrule.js b/modules/default/calendar/vendor/ical.js/example_rrule.js deleted file mode 100644 index 6233c4b2..00000000 --- a/modules/default/calendar/vendor/ical.js/example_rrule.js +++ /dev/null @@ -1,118 +0,0 @@ -var ical = require('./node-ical') -var moment = require('moment') - -var data = ical.parseFile('./examples/example_rrule.ics'); - -// Complicated example demonstrating how to handle recurrence rules and exceptions. - -for (var k in data) { - - // When dealing with calendar recurrences, you need a range of dates to query against, - // because otherwise you can get an infinite number of calendar events. - var rangeStart = moment("2017-01-01"); - var rangeEnd = moment("2017-12-31"); - - - var event = data[k] - if (event.type === 'VEVENT') { - - var title = event.summary; - var startDate = moment(event.start); - var endDate = moment(event.end); - - // Calculate the duration of the event for use with recurring events. - var duration = parseInt(endDate.format("x")) - parseInt(startDate.format("x")); - - // Simple case - no recurrences, just print out the calendar event. - if (typeof event.rrule === 'undefined') - { - console.log('title:' + title); - console.log('startDate:' + startDate.format('MMMM Do YYYY, h:mm:ss a')); - console.log('endDate:' + endDate.format('MMMM Do YYYY, h:mm:ss a')); - console.log('duration:' + moment.duration(duration).humanize()); - console.log(); - } - - // Complicated case - if an RRULE exists, handle multiple recurrences of the event. - else if (typeof event.rrule !== 'undefined') - { - // For recurring events, get the set of event start dates that fall within the range - // of dates we're looking for. - var dates = event.rrule.between( - rangeStart.toDate(), - rangeEnd.toDate(), - true, - function(date, i) {return true;} - ) - - // The "dates" array contains the set of dates within our desired date range range that are valid - // for the recurrence rule. *However*, it's possible for us to have a specific recurrence that - // had its date changed from outside the range to inside the range. One way to handle this is - // to add *all* recurrence override entries into the set of dates that we check, and then later - // filter out any recurrences that don't actually belong within our range. - if (event.recurrences != undefined) - { - for (var r in event.recurrences) - { - // Only add dates that weren't already in the range we added from the rrule so that - // we don't double-add those events. - if (moment(new Date(r)).isBetween(rangeStart, rangeEnd) != true) - { - dates.push(new Date(r)); - } - } - } - - // Loop through the set of date entries to see which recurrences should be printed. - for(var i in dates) { - - var date = dates[i]; - var curEvent = event; - var showRecurrence = true; - var curDuration = duration; - - startDate = moment(date); - - // Use just the date of the recurrence to look up overrides and exceptions (i.e. chop off time information) - var dateLookupKey = date.toISOString().substring(0, 10); - - // For each date that we're checking, it's possible that there is a recurrence override for that one day. - if ((curEvent.recurrences != undefined) && (curEvent.recurrences[dateLookupKey] != undefined)) - { - // We found an override, so for this recurrence, use a potentially different title, start date, and duration. - curEvent = curEvent.recurrences[dateLookupKey]; - startDate = moment(curEvent.start); - curDuration = parseInt(moment(curEvent.end).format("x")) - parseInt(startDate.format("x")); - } - // If there's no recurrence override, check for an exception date. Exception dates represent exceptions to the rule. - else if ((curEvent.exdate != undefined) && (curEvent.exdate[dateLookupKey] != undefined)) - { - // This date is an exception date, which means we should skip it in the recurrence pattern. - showRecurrence = false; - } - - // Set the the title and the end date from either the regular event or the recurrence override. - var recurrenceTitle = curEvent.summary; - endDate = moment(parseInt(startDate.format("x")) + curDuration, 'x'); - - // If this recurrence ends before the start of the date range, or starts after the end of the date range, - // don't process it. - if (endDate.isBefore(rangeStart) || startDate.isAfter(rangeEnd)) { - showRecurrence = false; - } - - if (showRecurrence === true) { - - console.log('title:' + recurrenceTitle); - console.log('startDate:' + startDate.format('MMMM Do YYYY, h:mm:ss a')); - console.log('endDate:' + endDate.format('MMMM Do YYYY, h:mm:ss a')); - console.log('duration:' + moment.duration(curDuration).humanize()); - console.log(); - } - - } - } - } -} - - diff --git a/modules/default/calendar/vendor/ical.js/examples/example_rrule.ics b/modules/default/calendar/vendor/ical.js/examples/example_rrule.ics deleted file mode 100644 index 4f72c0ec..00000000 --- a/modules/default/calendar/vendor/ical.js/examples/example_rrule.ics +++ /dev/null @@ -1,40 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Google Inc//Google Calendar 70.9054//EN -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:ical -X-WR-TIMEZONE:US/Central -X-WR-CALDESC: -BEGIN:VEVENT -UID:98765432-ABCD-DCBB-999A-987765432123 -DTSTART;TZID=US/Central:20170601T090000 -DTEND;TZID=US/Central:20170601T170000 -DTSTAMP:20170727T044436Z -EXDATE;TZID=US/Central:20170706T090000,20170713T090000,20170720T090000,20 - 170803T090000 -LAST-MODIFIED:20170727T044435Z -RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20170814T045959Z;BYDAY=TH -SEQUENCE:0 -SUMMARY:Recurring weekly meeting from June 1 - Aug 14 (except July 6, July 13, July 20, Aug 3) -END:VEVENT -BEGIN:VEVENT -UID:98765432-ABCD-DCBB-999A-987765432123 -RECURRENCE-ID;TZID=US/Central:20170629T090000 -DTSTART;TZID=US/Central:20170703T090000 -DTEND;TZID=US/Central:20170703T120000 -DTSTAMP:20170727T044436Z -LAST-MODIFIED:20170216T143445Z -SEQUENCE:0 -SUMMARY:Last meeting in June moved to Monday July 3 and shortened to half day -END:VEVENT -BEGIN:VEVENT -UID:12354454-ABCD-DCBB-999A-2349872354897 -DTSTART;TZID=US/Central:20171201T130000 -DTEND;TZID=US/Central:20171201T150000 -DTSTAMP:20170727T044436Z -LAST-MODIFIED:20170727T044435Z -SEQUENCE:0 -SUMMARY:Single event on Dec 1 -END:VEVENT -END:VCALENDAR \ No newline at end of file diff --git a/modules/default/calendar/vendor/ical.js/ical.js b/modules/default/calendar/vendor/ical.js/ical.js deleted file mode 100644 index 024625b7..00000000 --- a/modules/default/calendar/vendor/ical.js/ical.js +++ /dev/null @@ -1,452 +0,0 @@ -(function(name, definition) { - -/**************** - * A tolerant, minimal icalendar parser - * (http://tools.ietf.org/html/rfc5545) - * - * - * **************/ - - if (typeof module !== 'undefined') { - module.exports = definition(); - } else if (typeof define === 'function' && typeof define.amd === 'object'){ - define(definition); - } else { - this[name] = definition(); - } - -}('ical', function(){ - - // Unescape Text re RFC 4.3.11 - var text = function(t){ - t = t || ""; - return (t - .replace(/\\\,/g, ',') - .replace(/\\\;/g, ';') - .replace(/\\[nN]/g, '\n') - .replace(/\\\\/g, '\\') - ) - } - - var parseParams = function(p){ - var out = {} - for (var i = 0; i 0) { - //trimming the leading and perform storeParam - name = name.substring(2); - return (storeParam(name))(val, params, ctx, stack, line); - } - - return storeParam(name.toLowerCase())(val, params, ctx); - }, - - - parseICS : function(str){ - var self = this - var lines = str.split(/\r?\n/) - var ctx = {} - var stack = [] - - for (var i = 0, ii = lines.length, l = lines[0]; i (peterbraden.co.uk)", - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "git://github.com/peterbraden/ical.js.git" - }, - "dependencies": { - "request": "^2.88.0", - "rrule": "2.4.1" - }, - "devDependencies": { - "vows": "0.8.2", - "underscore": "1.9.1" - }, - "scripts": { - "test": "./node_modules/vows/bin/vows ./test/test.js" - } -} diff --git a/modules/default/calendar/vendor/ical.js/readme.md b/modules/default/calendar/vendor/ical.js/readme.md deleted file mode 100644 index 5f056436..00000000 --- a/modules/default/calendar/vendor/ical.js/readme.md +++ /dev/null @@ -1,62 +0,0 @@ -# ical.js # -(Formerly node-ical) - -[![Build Status](https://travis-ci.org/peterbraden/ical.js.png)](https://travis-ci.org/peterbraden/ical.js) - -A tolerant, minimal icalendar parser for javascript/node -(http://tools.ietf.org/html/rfc5545) - - - -## Install - Node.js ## - -ical.js is availble on npm: - - npm install ical - - - -## API ## - - ical.parseICS(str) - -Parses a string with an ICS File - - var data = ical.parseFile(filename) - -Reads in the specified iCal file, parses it and returns the parsed data - - ical.fromURL(url, options, function(err, data) {} ) - -Use the request library to fetch the specified URL (```opts``` gets passed on to the ```request()``` call), and call the function with the result (either an error or the data). - - - -## Example 1 - Print list of upcoming node conferences (see example.js) -```javascript -'use strict'; - -const ical = require('ical'); -const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - -ical.fromURL('http://lanyrd.com/topics/nodejs/nodejs.ics', {}, function (err, data) { - for (let k in data) { - if (data.hasOwnProperty(k)) { - var ev = data[k]; - if (data[k].type == 'VEVENT') { - console.log(`${ev.summary} is in ${ev.location} on the ${ev.start.getDate()} of ${months[ev.start.getMonth()]} at ${ev.start.toLocaleTimeString('en-GB')}`); - - } - } - } -}); -``` - -## Recurrences and Exceptions ## -Calendar events with recurrence rules can be significantly more complicated to handle correctly. There are three parts to handling them: - - 1. rrule - the recurrence rule specifying the pattern of recurring dates and times for the event. - 2. recurrences - an optional array of event data that can override specific occurrences of the event. - 3. exdate - an optional array of dates that should be excluded from the recurrence pattern. - -See example_rrule.js for an example of handling recurring calendar events. diff --git a/modules/default/calendar/vendor/ical.js/test/test.js b/modules/default/calendar/vendor/ical.js/test/test.js deleted file mode 100644 index c20587a4..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test.js +++ /dev/null @@ -1,500 +0,0 @@ -/**** - * Tests - * - * - ***/ -process.env.TZ = 'America/San_Francisco'; -var ical = require('../index') - -var vows = require('vows') - , assert = require('assert') - , _ = require('underscore') - -vows.describe('node-ical').addBatch({ - 'when parsing test1.ics (node conferences schedule from lanyrd.com, modified)': { - topic: function () { - return ical.parseFile('./test/test1.ics') - } - - ,'we get 9 events': function (topic) { - var events = _.select(_.values(topic), function(x){ return x.type==='VEVENT'}) - assert.equal (events.length, 9); - } - - ,'event 47f6e' : { - topic: function(events){ - return _.select(_.values(events), - function(x){ - return x.uid ==='47f6ea3f28af2986a2192fa39a91fa7d60d26b76'})[0] - } - ,'is in fort lauderdale' : function(topic){ - assert.equal(topic.location, "Fort Lauderdale, United States") - } - ,'starts Tue, 29 Nov 2011' : function(topic){ - assert.equal(topic.start.toDateString(), new Date(2011,10,29).toDateString()) - } - } - , 'event 480a' : { - topic: function(events){ - return _.select(_.values(events), - function(x){ - return x.uid ==='480a3ad48af5ed8965241f14920f90524f533c18'})[0] - } - , 'has a summary (invalid colon handling tolerance)' : function(topic){ - assert.equal(topic.summary, '[Async]: Everything Express') - } - , 'has a date only start datetime' : function(topic){ - assert.equal(topic.start.dateOnly, true) - } - , 'has a date only end datetime' : function(topic){ - assert.equal(topic.end.dateOnly, true) - } - } - , 'event d4c8' :{ - topic : function(events){ - return _.select(_.values(events), - function(x){ - return x.uid === 'd4c826dfb701f611416d69b4df81caf9ff80b03a'})[0] - } - , 'has a start datetime' : function(topic){ - assert.equal(topic.start.toDateString(), new Date(Date.UTC(2011, 2, 12, 20, 0, 0)).toDateString()) - } - } - - , 'event sdfkf09fsd0 (Invalid Date)' :{ - topic : function(events){ - return _.select(_.values(events), - function(x){ - return x.uid === 'sdfkf09fsd0'})[0] - } - , 'has a start datetime' : function(topic){ - assert.equal(topic.start, "Next Year") - } - } - } - , 'with test2.ics (testing ical features)' : { - topic: function () { - return ical.parseFile('./test/test2.ics') - } - , 'todo item uid4@host1.com' : { - topic : function(items){ - return items['uid4@host1.com'] - } - , 'is a VTODO' : function(topic){ - assert.equal(topic.type, 'VTODO') - } - } - , 'vfreebusy' : { - topic: function(events) { - return _.select(_.values(events), function(x) { - return x.type === 'VFREEBUSY'; - })[0]; - } - , 'has a URL' : function(topic) { - assert.equal(topic.url, 'http://www.host.com/calendar/busytime/jsmith.ifb'); - } - } - , 'vfreebusy first freebusy' : { - topic: function(events) { - return _.select(_.values(events), function(x) { - return x.type === 'VFREEBUSY'; - })[0].freebusy[0]; - } - , 'has undefined type defaulting to busy' : function(topic) { - assert.equal(topic.type, "BUSY"); - } - , 'has an start datetime' : function(topic) { - assert.equal(topic.start.getFullYear(), 1998); - assert.equal(topic.start.getUTCMonth(), 2); - assert.equal(topic.start.getUTCDate(), 14); - assert.equal(topic.start.getUTCHours(), 23); - assert.equal(topic.start.getUTCMinutes(), 30); - } - , 'has an end datetime' : function(topic) { - assert.equal(topic.end.getFullYear(), 1998); - assert.equal(topic.end.getUTCMonth(), 2); - assert.equal(topic.end.getUTCDate(), 15); - assert.equal(topic.end.getUTCHours(), 00); - assert.equal(topic.end.getUTCMinutes(), 30); - } - } - } - , 'with test3.ics (testing tvcountdown.com)' : { - topic: function() { - return ical.parseFile('./test/test3.ics'); - } - , 'event -83' : { - topic: function(events) { - return _.select(_.values(events), function(x) { - return x.uid === '20110505T220000Z-83@tvcountdown.com'; - })[0]; - } - , 'has a start datetime' : function(topic) { - assert.equal(topic.start.getFullYear(), 2011); - assert.equal(topic.start.getMonth(), 4); - } - , 'has an end datetime' : function(topic) { - assert.equal(topic.end.getFullYear(), 2011); - assert.equal(topic.end.getMonth(), 4); - } - } - } - - , 'with test4.ics (testing tripit.com)' : { - topic: function() { - return ical.parseFile('./test/test4.ics'); - } - , 'event c32a5...' : { - topic: function(events) { - return _.select(_.values(events), function(x) { - return x.uid === 'c32a5eaba2354bb29e012ec18da827db90550a3b@tripit.com'; - })[0]; - } - , 'has a start datetime' : function(topic) { - assert.equal(topic.start.getFullYear(), 2011); - assert.equal(topic.start.getMonth(), 09); - assert.equal(topic.start.getDate(), 11); - } - - , 'has a summary' : function(topic){ - // escaped commas and semicolons should be replaced - assert.equal(topic.summary, 'South San Francisco, CA, October 2011;') - - } - - , 'has a description' : function(topic){ - var desired = 'John Doe is in South San Francisco, CA from Oct 11 ' + - 'to Oct 13, 2011\nView and/or edit details in TripIt : http://www.tripit.c' + - 'om/trip/show/id/23710889\nTripIt - organize your travel at http://www.trip' + - 'it.com\n' - assert.equal(topic.description, desired) - - } - - , 'has a geolocation' : function(topic){ - assert.ok(topic.geo, 'no geo param') - assert.equal(topic.geo.lat, 37.654656) - assert.equal(topic.geo.lon, -122.40775) - } - - , 'has transparency' : function(topic){ - assert.equal(topic.transparency, 'TRANSPARENT') - } - - } - } - - - - , 'with test5.ics (testing meetup.com)' : { - topic: function () { - return ical.parseFile('./test/test5.ics') - } - , 'event nsmxnyppbfc@meetup.com' : { - topic: function(events) { - return _.select(_.values(events), function(x) { - return x.uid === 'event_nsmxnyppbfc@meetup.com'; - })[0]; - } - , 'has a start' : function(topic){ - assert.equal(topic.start.tz, 'America/Phoenix') - assert.equal(topic.start.toISOString(), new Date(2011, 10, 09, 19, 0,0).toISOString()) - } - } - } - - , 'with test6.ics (testing assembly.org)': { - topic: function () { - return ical.parseFile('./test/test6.ics') - } - , 'event with no ID' : { - topic: function(events) { - return _.select(_.values(events), function(x) { - return x.summary === 'foobar Summer 2011 starts!'; - })[0]; - } - , 'has a start' : function(topic){ - assert.equal(topic.start.toISOString(), new Date(2011, 07, 04, 12, 0,0).toISOString()) - } - } - , 'event with rrule' :{ - topic: function(events){ - return _.select(_.values(events), function(x){ - return x.summary === "foobarTV broadcast starts" - })[0]; - } - , "Has an RRULE": function(topic){ - assert.notEqual(topic.rrule, undefined); - } - , "RRule text": function(topic){ - assert.equal(topic.rrule.toText(), "every 5 weeks on Monday, Friday until January 30, 2013") - } - } - } - , 'with test7.ics (testing dtstart of rrule)' :{ - topic: function() { - return ical.parseFile('./test/test7.ics'); - }, - 'recurring yearly event (14 july)': { - topic: function(events){ - var ev = _.values(events)[0]; - return ev.rrule.between(new Date(2013, 0, 1), new Date(2014, 0, 1)); - }, - 'dt start well set': function(topic) { - assert.equal(topic[0].toDateString(), new Date(2013, 6, 14).toDateString()); - } - } - } - , "with test 8.ics (VTODO completion)": { - topic: function() { - return ical.parseFile('./test/test8.ics'); - }, - 'grabbing VTODO task': { - topic: function(topic) { - return _.values(topic)[0]; - }, - 'task completed': function(task){ - assert.equal(task.completion, 100); - assert.equal(task.completed.toISOString(), new Date(2013, 06, 16, 10, 57, 45).toISOString()); - } - } - } - , "with test 9.ics (VEVENT with VALARM)": { - topic: function() { - return ical.parseFile('./test/test9.ics'); - }, - 'grabbing VEVENT task': { - topic: function(topic) { - return _.values(topic)[0]; - }, - 'task completed': function(task){ - assert.equal(task.summary, "Event with an alarm"); - } - } - } - , 'with test 11.ics (VEVENT with custom properties)': { - topic: function() { - return ical.parseFile('./test10.ics'); - }, - 'grabbing custom properties': { - topic: function(topic) { - - } - } - }, - - 'with test10.ics': { - topic: function () { - return ical.parseFile('./test/test10.ics'); - }, - - 'when categories present': { - topic: function (t) {return _.values(t)[0]}, - - 'should be a list': function (e) { - assert(e.categories instanceof [].constructor); - }, - - 'should contain individual category values': function (e) { - assert.deepEqual(e.categories, ['cat1', 'cat2', 'cat3']); - } - }, - - 'when categories present with trailing whitespace': { - topic: function (t) {return _.values(t)[1]}, - - 'should contain individual category values without whitespace': function (e) { - assert.deepEqual(e.categories, ['cat1', 'cat2', 'cat3']); - } - }, - - 'when categories present but empty': { - topic: function (t) {return _.values(t)[2]}, - - 'should be an empty list': function (e) { - assert.deepEqual(e.categories, []); - } - }, - - 'when categories present but singular': { - topic: function (t) {return _.values(t)[3]}, - - 'should be a list of single item': function (e) { - assert.deepEqual(e.categories, ['lonely-cat']); - } - }, - - 'when categories present on multiple lines': { - topic: function (t) {return _.values(t)[4]}, - - 'should contain the category values in an array': function (e) { - assert.deepEqual(e.categories, ['cat1', 'cat2', 'cat3']); - } - } - }, - - 'with test11.ics (testing zimbra freebusy)': { - topic: function () { - return ical.parseFile('./test/test11.ics'); - }, - - 'freebusy params' : { - topic: function(events) { - return _.values(events)[0]; - } - , 'has a URL' : function(topic) { - assert.equal(topic.url, 'http://mail.example.com/yvr-2a@example.com/20140416'); - } - , 'has an ORGANIZER' : function(topic) { - assert.equal(topic.organizer, 'mailto:yvr-2a@example.com'); - } - , 'has an start datetime' : function(topic) { - assert.equal(topic.start.getFullYear(), 2014); - assert.equal(topic.start.getMonth(), 3); - } - , 'has an end datetime' : function(topic) { - assert.equal(topic.end.getFullYear(), 2014); - assert.equal(topic.end.getMonth(), 6); - } - } - , 'freebusy busy events' : { - topic: function(events) { - return _.select(_.values(events)[0].freebusy, function(x) { - return x.type === 'BUSY'; - })[0]; - } - , 'has an start datetime' : function(topic) { - assert.equal(topic.start.getFullYear(), 2014); - assert.equal(topic.start.getMonth(), 3); - assert.equal(topic.start.getUTCHours(), 15); - assert.equal(topic.start.getUTCMinutes(), 15); - } - , 'has an end datetime' : function(topic) { - assert.equal(topic.end.getFullYear(), 2014); - assert.equal(topic.end.getMonth(), 3); - assert.equal(topic.end.getUTCHours(), 19); - assert.equal(topic.end.getUTCMinutes(), 00); - } - } - } - - , 'with test12.ics (testing recurrences and exdates)': { - topic: function () { - return ical.parseFile('./test/test12.ics') - } - , 'event with rrule': { - topic: function (events) { - return _.select(_.values(events), function (x) { - return x.uid === '0000001'; - })[0]; - } - , "Has an RRULE": function (topic) { - assert.notEqual(topic.rrule, undefined); - } - , "Has summary Treasure Hunting": function (topic) { - assert.equal(topic.summary, 'Treasure Hunting'); - } - , "Has two EXDATES": function (topic) { - assert.notEqual(topic.exdate, undefined); - assert.notEqual(topic.exdate[new Date(2015, 06, 08, 12, 0, 0).toISOString().substring(0, 10)], undefined); - assert.notEqual(topic.exdate[new Date(2015, 06, 10, 12, 0, 0).toISOString().substring(0, 10)], undefined); - } - , "Has a RECURRENCE-ID override": function (topic) { - assert.notEqual(topic.recurrences, undefined); - assert.notEqual(topic.recurrences[new Date(2015, 06, 07, 12, 0, 0).toISOString().substring(0, 10)], undefined); - assert.equal(topic.recurrences[new Date(2015, 06, 07, 12, 0, 0).toISOString().substring(0, 10)].summary, 'More Treasure Hunting'); - } - } - } - - , 'with test13.ics (testing recurrence-id before rrule)': { - topic: function () { - return ical.parseFile('./test/test13.ics') - } - , 'event with rrule': { - topic: function (events) { - return _.select(_.values(events), function (x) { - return x.uid === '6m2q7kb2l02798oagemrcgm6pk@google.com'; - })[0]; - } - , "Has an RRULE": function (topic) { - assert.notEqual(topic.rrule, undefined); - } - , "Has summary 'repeated'": function (topic) { - assert.equal(topic.summary, 'repeated'); - } - , "Has a RECURRENCE-ID override": function (topic) { - assert.notEqual(topic.recurrences, undefined); - assert.notEqual(topic.recurrences[new Date(2016, 7, 26, 14, 0, 0).toISOString().substring(0, 10)], undefined); - assert.equal(topic.recurrences[new Date(2016, 7, 26, 14, 0, 0).toISOString().substring(0, 10)].summary, 'bla bla'); - } - } - } - - , 'with test14.ics (testing comma-separated exdates)': { - topic: function () { - return ical.parseFile('./test/test14.ics') - } - , 'event with comma-separated exdate': { - topic: function (events) { - return _.select(_.values(events), function (x) { - return x.uid === '98765432-ABCD-DCBB-999A-987765432123'; - })[0]; - } - , "Has summary 'Example of comma-separated exdates'": function (topic) { - assert.equal(topic.summary, 'Example of comma-separated exdates'); - } - , "Has four comma-separated EXDATES": function (topic) { - assert.notEqual(topic.exdate, undefined); - // Verify the four comma-separated EXDATES are there - assert.notEqual(topic.exdate[new Date(2017, 6, 6, 12, 0, 0).toISOString().substring(0, 10)], undefined); - assert.notEqual(topic.exdate[new Date(2017, 6, 17, 12, 0, 0).toISOString().substring(0, 10)], undefined); - assert.notEqual(topic.exdate[new Date(2017, 6, 20, 12, 0, 0).toISOString().substring(0, 10)], undefined); - assert.notEqual(topic.exdate[new Date(2017, 7, 3, 12, 0, 0).toISOString().substring(0, 10)], undefined); - // Verify an arbitrary date isn't there - assert.equal(topic.exdate[new Date(2017, 4, 5, 12, 0, 0).toISOString().substring(0, 10)], undefined); - } - } - } - - , 'with test14.ics (testing exdates with bad times)': { - topic: function () { - return ical.parseFile('./test/test14.ics') - } - , 'event with exdates with bad times': { - topic: function (events) { - return _.select(_.values(events), function (x) { - return x.uid === '1234567-ABCD-ABCD-ABCD-123456789012'; - })[0]; - } - , "Has summary 'Example of exdate with bad times'": function (topic) { - assert.equal(topic.summary, 'Example of exdate with bad times'); - } - , "Has two EXDATES even though they have bad times": function (topic) { - assert.notEqual(topic.exdate, undefined); - // Verify the two EXDATES are there, even though they have bad times - assert.notEqual(topic.exdate[new Date(2017, 11, 18, 12, 0, 0).toISOString().substring(0, 10)], undefined); - assert.notEqual(topic.exdate[new Date(2017, 11, 19, 12, 0, 0).toISOString().substring(0, 10)], undefined); - } - } - } - - , 'url request errors': { - topic : function () { - ical.fromURL('http://255.255.255.255/', {}, this.callback); - } - , 'are passed back to the callback' : function (err, result) { - assert.instanceOf(err, Error); - if (!err){ - console.log(">E:", err, result) - } - } - } -}).export(module) - - -//ical.fromURL('http://lanyrd.com/topics/nodejs/nodejs.ics', -// {}, -// function(err, data){ -// console.log("OUT:", data) -// }) diff --git a/modules/default/calendar/vendor/ical.js/test/test1.ics b/modules/default/calendar/vendor/ical.js/test/test1.ics deleted file mode 100644 index ff8cc076..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test1.ics +++ /dev/null @@ -1,78 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//lanyrd.com//Lanyrd//EN -X-ORIGINAL-URL:http://lanyrd.com/topics/nodejs/nodejs.ics -X-WR-CALNAME;CHARSET=utf-8:Node.js conferences -VERSION:2.0 -METHOD:PUBLISH -BEGIN:VEVENT -SUMMARY;CHARSET=utf-8:Dyncon 2011 -LOCATION;CHARSET=utf-8:Stockholm, Sweden -URL:http://lanyrd.com/2011/dyncon/ -UID:d4c826dfb701f611416d69b4df81caf9ff80b03a -DTSTART:20110312T200000Z -DTEND;VALUE=DATE:20110314 -END:VEVENT -BEGIN:VEVENT -SUMMARY;CHARSET=utf-8:[Async]: Everything Express -LOCATION;CHARSET=utf-8:Brighton, United Kingdom -URL:http://lanyrd.com/2011/asyncjs-express/ -UID:480a3ad48af5ed8965241f14920f90524f533c18 -DTSTART;VALUE=DATE:20110324 -DTEND;VALUE=DATE:20110325 -END:VEVENT -BEGIN:VEVENT -SUMMARY;CHARSET=utf-8:JSConf US 2011 -LOCATION;CHARSET=utf-8:Portland, United States -URL:http://lanyrd.com/2011/jsconf/ -UID:ed334cc85db5ebdff5ff5a630a7a48631a677dbe -DTSTART;VALUE=DATE:20110502 -DTEND;VALUE=DATE:20110504 -END:VEVENT -BEGIN:VEVENT -SUMMARY;CHARSET=utf-8:NodeConf 2011 -LOCATION;CHARSET=utf-8:Portland, United States -URL:http://lanyrd.com/2011/nodeconf/ -UID:25169a7b1ba5c248278f47120a40878055dc8c15 -DTSTART;VALUE=DATE:20110505 -DTEND;VALUE=DATE:20110506 -END:VEVENT -BEGIN:VEVENT -SUMMARY;CHARSET=utf-8:BrazilJS -LOCATION;CHARSET=utf-8:Fortaleza, Brazil -URL:http://lanyrd.com/2011/braziljs/ -UID:dafee3be83624f3388c5635662229ff11766bb9c -DTSTART;VALUE=DATE:20110513 -DTEND;VALUE=DATE:20110515 -END:VEVENT -BEGIN:VEVENT -SUMMARY;CHARSET=utf-8:Falsy Values -LOCATION;CHARSET=utf-8:Warsaw, Poland -URL:http://lanyrd.com/2011/falsy-values/ -UID:73cad6a09ac4e7310979c6130f871d17d990b5ad -DTSTART;VALUE=DATE:20110518 -DTEND;VALUE=DATE:20110521 -END:VEVENT -BEGIN:VEVENT -SUMMARY;CHARSET=utf-8:nodecamp.eu -LOCATION;CHARSET=utf-8:Cologne, Germany -URL:http://lanyrd.com/2011/nodecampde/ -UID:b728a5fdb5f292b6293e4a2fd97a1ccfc69e9d6f -DTSTART;VALUE=DATE:20110611 -DTEND;VALUE=DATE:20110613 -END:VEVENT -BEGIN:VEVENT -SUMMARY;CHARSET=utf-8:Rich Web Experience 2011 -LOCATION;CHARSET=utf-8:Fort Lauderdale, United States -URL:http://lanyrd.com/2011/rich-web-experience/ -UID:47f6ea3f28af2986a2192fa39a91fa7d60d26b76 -DTSTART;VALUE=DATE:20111129 -DTEND;VALUE=DATE:20111203 -END:VEVENT -BEGIN:VEVENT -SUMMARY;CHARSET=utf-8:Foobar -UID:sdfkf09fsd0 -DTSTART;VALUE=DATE:Next Year -DTEND;VALUE=DATE:20111203 -END:VEVENT - -END:VCALENDAR diff --git a/modules/default/calendar/vendor/ical.js/test/test10.ics b/modules/default/calendar/vendor/ical.js/test/test10.ics deleted file mode 100644 index 40763b3b..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test10.ics +++ /dev/null @@ -1,34 +0,0 @@ -BEGIN:VCALENDAR -BEGIN:VEVENT -UID:1 -SUMMARY:Event with a category -DESCRIPTION:Details for an event with a category -CATEGORIES:cat1,cat2,cat3 -END:VEVENT -BEGIN:VEVENT -UID:2 -SUMMARY:Event with a category -DESCRIPTION:Details for an event with a category -CATEGORIES:cat1 , cat2, cat3 -END:VEVENT -BEGIN:VEVENT -UID:3 -SUMMARY:Event with a category -DESCRIPTION:Details for an event with a category -CATEGORIES: -END:VEVENT -BEGIN:VEVENT -UID:4 -SUMMARY:Event with a category -DESCRIPTION:Details for an event with a category -CATEGORIES:lonely-cat -END:VEVENT -BEGIN:VEVENT -UID:5 -SUMMARY:Event with a category -DESCRIPTION:Details for an event with a category -CATEGORIES:cat1 -CATEGORIES:cat2 -CATEGORIES:cat3 -END:VEVENT -END:VCALENDAR diff --git a/modules/default/calendar/vendor/ical.js/test/test11.ics b/modules/default/calendar/vendor/ical.js/test/test11.ics deleted file mode 100644 index 3a7e80de..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test11.ics +++ /dev/null @@ -1,41 +0,0 @@ -BEGIN:VCALENDAR -PRODID:Zimbra-Calendar-Provider -VERSION:2.0 -METHOD:PUBLISH -BEGIN:VFREEBUSY -ORGANIZER:mailto:yvr-2a@example.com -DTSTAMP:20140516T235436Z -DTSTART:20140415T235436Z -DTEND:20140717T235436Z -URL:http://mail.example.com/yvr-2a@example.com/20140416 -FREEBUSY;FBTYPE=BUSY:20140416T151500Z/20140416T190000Z -FREEBUSY;FBTYPE=BUSY:20140416T195500Z/20140416T231500Z -FREEBUSY;FBTYPE=BUSY:20140417T193000Z/20140417T203000Z -FREEBUSY;FBTYPE=BUSY:20140421T210000Z/20140421T213000Z -FREEBUSY;FBTYPE=BUSY:20140423T180000Z/20140423T190000Z -FREEBUSY;FBTYPE=BUSY:20140423T200000Z/20140423T210000Z -FREEBUSY;FBTYPE=BUSY:20140423T223500Z/20140423T231500Z -FREEBUSY;FBTYPE=BUSY:20140424T155000Z/20140424T165500Z -FREEBUSY;FBTYPE=BUSY:20140424T170000Z/20140424T183000Z -FREEBUSY;FBTYPE=BUSY:20140424T195000Z/20140424T230000Z -FREEBUSY;FBTYPE=BUSY:20140425T144500Z/20140425T161500Z -FREEBUSY;FBTYPE=BUSY:20140425T180000Z/20140425T194500Z -FREEBUSY;FBTYPE=BUSY:20140425T223000Z/20140425T230000Z -FREEBUSY;FBTYPE=BUSY:20140428T151500Z/20140428T163000Z -FREEBUSY;FBTYPE=BUSY:20140428T170000Z/20140428T173000Z -FREEBUSY;FBTYPE=BUSY:20140428T195500Z/20140428T213000Z -FREEBUSY;FBTYPE=BUSY:20140428T231000Z/20140428T234000Z -FREEBUSY;FBTYPE=BUSY:20140429T152500Z/20140429T170000Z -FREEBUSY;FBTYPE=BUSY:20140429T180000Z/20140429T183000Z -FREEBUSY;FBTYPE=BUSY:20140429T201500Z/20140429T230000Z -FREEBUSY;FBTYPE=BUSY:20140430T162500Z/20140430T165500Z -FREEBUSY;FBTYPE=BUSY:20140430T180000Z/20140430T190000Z -FREEBUSY;FBTYPE=BUSY:20140501T170000Z/20140501T173000Z -FREEBUSY;FBTYPE=BUSY:20140501T175000Z/20140501T190000Z -FREEBUSY;FBTYPE=BUSY:20140501T232000Z/20140501T235000Z -FREEBUSY;FBTYPE=BUSY:20140502T163500Z/20140502T173000Z -FREEBUSY;FBTYPE=BUSY:20140505T165500Z/20140505T173000Z -FREEBUSY;FBTYPE=BUSY:20140505T201500Z/20140505T203000Z -FREEBUSY;FBTYPE=BUSY:20140505T210000Z/20140505T213000Z -END:VFREEBUSY -END:VCALENDAR diff --git a/modules/default/calendar/vendor/ical.js/test/test12.ics b/modules/default/calendar/vendor/ical.js/test/test12.ics deleted file mode 100644 index 4e78603b..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test12.ics +++ /dev/null @@ -1,19 +0,0 @@ -BEGIN:VCALENDAR -BEGIN:VEVENT -UID:0000001 -SUMMARY:Treasure Hunting -DTSTART;TZID=America/Los_Angeles:20150706T120000 -DTEND;TZID=America/Los_Angeles:20150706T130000 -RRULE:FREQ=DAILY;COUNT=10 -EXDATE;TZID=America/Los_Angeles:20150708T120000 -EXDATE;TZID=America/Los_Angeles:20150710T120000 -END:VEVENT -BEGIN:VEVENT -UID:0000001 -SUMMARY:More Treasure Hunting -LOCATION:The other island -DTSTART;TZID=America/Los_Angeles:20150709T150000 -DTEND;TZID=America/Los_Angeles:20150707T160000 -RECURRENCE-ID;TZID=America/Los_Angeles:20150707T120000 -END:VEVENT -END:VCALENDAR diff --git a/modules/default/calendar/vendor/ical.js/test/test13.ics b/modules/default/calendar/vendor/ical.js/test/test13.ics deleted file mode 100644 index 3118186b..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test13.ics +++ /dev/null @@ -1,57 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Google Inc//Google Calendar 70.9054//EN -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:ical -X-WR-TIMEZONE:Europe/Kiev -X-WR-CALDESC: -BEGIN:VTIMEZONE -TZID:Europe/Kiev -X-LIC-LOCATION:Europe/Kiev -BEGIN:DAYLIGHT -TZOFFSETFROM:+0200 -TZOFFSETTO:+0300 -TZNAME:EEST -DTSTART:19700329T030000 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU -END:DAYLIGHT -BEGIN:STANDARD -TZOFFSETFROM:+0300 -TZOFFSETTO:+0200 -TZNAME:EET -DTSTART:19701025T040000 -RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU -END:STANDARD -END:VTIMEZONE -BEGIN:VEVENT -DTSTART;TZID=Europe/Kiev:20160826T140000 -DTEND;TZID=Europe/Kiev:20160826T150000 -DTSTAMP:20160825T061505Z -UID:6m2q7kb2l02798oagemrcgm6pk@google.com -RECURRENCE-ID;TZID=Europe/Kiev:20160826T140000 -CREATED:20160823T125221Z -DESCRIPTION: -LAST-MODIFIED:20160823T130320Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:bla bla -TRANSP:OPAQUE -END:VEVENT -BEGIN:VEVENT -DTSTART;TZID=Europe/Kiev:20160825T140000 -DTEND;TZID=Europe/Kiev:20160825T150000 -RRULE:FREQ=DAILY;UNTIL=20160828T110000Z -DTSTAMP:20160825T061505Z -UID:6m2q7kb2l02798oagemrcgm6pk@google.com -CREATED:20160823T125221Z -DESCRIPTION: -LAST-MODIFIED:20160823T125221Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:repeated -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR \ No newline at end of file diff --git a/modules/default/calendar/vendor/ical.js/test/test14.ics b/modules/default/calendar/vendor/ical.js/test/test14.ics deleted file mode 100644 index 5c4f5caf..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test14.ics +++ /dev/null @@ -1,33 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Google Inc//Google Calendar 70.9054//EN -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:ical -X-WR-TIMEZONE:Europe/Kiev -X-WR-CALDESC: -BEGIN:VEVENT -UID:98765432-ABCD-DCBB-999A-987765432123 -DTSTART;TZID=US/Central:20170216T090000 -DTEND;TZID=US/Central:20170216T190000 -DTSTAMP:20170727T044436Z -EXDATE;TZID=US/Central:20170706T090000,20170717T090000,20170720T090000,20 - 170803T090000 -LAST-MODIFIED:20170727T044435Z -RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20170814T045959Z;INTERVAL=2;BYDAY=MO,TH -SEQUENCE:0 -SUMMARY:Example of comma-separated exdates -END:VEVENT -BEGIN:VEVENT -UID:1234567-ABCD-ABCD-ABCD-123456789012 -DTSTART:20170814T140000Z -DTEND:20170815T000000Z -DTSTAMP:20171204T134925Z -EXDATE:20171219T060000 -EXDATE:20171218T060000 -LAST-MODIFIED:20171024T140004Z -RRULE:FREQ=WEEKLY;WKST=SU;INTERVAL=2;BYDAY=MO,TU -SEQUENCE:0 -SUMMARY:Example of exdate with bad times -END:VEVENT -END:VCALENDAR \ No newline at end of file diff --git a/modules/default/calendar/vendor/ical.js/test/test2.ics b/modules/default/calendar/vendor/ical.js/test/test2.ics deleted file mode 100644 index 29baf8cd..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test2.ics +++ /dev/null @@ -1,83 +0,0 @@ -BEGIN:VCALENDAR -CALSCALE:GREGORIAN -X-WR-TIMEZONE;VALUE=TEXT:US/Pacific -METHOD:PUBLISH -PRODID:-//Apple Computer\, Inc//iCal 1.0//EN -X-WR-CALNAME;VALUE=TEXT:Example -VERSION:2.0 -BEGIN:VEVENT -SEQUENCE:5 -DTSTART;TZID=US/Pacific:20021028T140000 -DTSTAMP:20021028T011706Z -SUMMARY:Coffee with Jason -UID:EC9439B1-FF65-11D6-9973-003065F99D04 -DTEND;TZID=US/Pacific:20021028T150000 -END:VEVENT -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-P1D -ACTION:DISPLAY -DESCRIPTION:Event reminder -END:VALARM -BEGIN:VEVENT -SEQUENCE:1 -DTSTAMP:20021128T012034Z -SUMMARY:Code Review -UID:EC944331-FF65-11D6-9973-003065F99D04 -DTSTART;TZID=US/Pacific:20021127T120000 -DURATION:PT1H -END:VEVENT -BEGIN:VEVENT -SEQUENCE:1 -DTSTAMP:20021028T012034Z -SUMMARY:Dinner with T -UID:EC944CFA-FF65-11D6-9973-003065F99D04 -DTSTART;TZID=US/Pacific:20021216T200000 -DURATION:PT1H -END:VEVENT -BEGIN:VTODO -DTSTAMP:19980130T134500Z -SEQUENCE:2 -UID:uid4@host1.com -ORGANIZER:MAILTO:unclesam@us.gov -ATTENDEE;PARTSTAT=ACCEPTED:MAILTO:jqpublic@host.com -DUE:19980415T235959 -STATUS:NEEDS-ACTION -SUMMARY:Submit Income Taxes -END:VTODO -BEGIN:VALARM -ACTION:AUDIO -TRIGGER:19980403T120000 -ATTACH;FMTTYPE=audio/basic:http://host.com/pub/audio- - files/ssbanner.aud -REPEAT:4 -DURATION:PT1H -END:VALARM -BEGIN:VJOURNAL -DTSTAMP:19970324T120000Z -UID:uid5@host1.com -ORGANIZER:MAILTO:jsmith@host.com -STATUS:DRAFT -CLASS:PUBLIC -CATEGORY:Project Report, XYZ, Weekly Meeting -DESCRIPTION:Project xyz Review Meeting Minutes\n - Agenda\n1. Review of project version 1.0 requirements.\n2. - Definition - of project processes.\n3. Review of project schedule.\n - Participants: John Smith, Jane Doe, Jim Dandy\n-It was - decided that the requirements need to be signed off by - product marketing.\n-Project processes were accepted.\n - -Project schedule needs to account for scheduled holidays - and employee vacation time. Check with HR for specific - dates.\n-New schedule will be distributed by Friday.\n- - Next weeks meeting is cancelled. No meeting until 3/23. -END:VJOURNAL -BEGIN:VFREEBUSY -ORGANIZER:MAILTO:jsmith@host.com -DTSTART:19980313T141711Z -DTEND:19980410T141711Z -FREEBUSY:19980314T233000Z/19980315T003000Z -FREEBUSY:19980316T153000Z/19980316T163000Z -FREEBUSY:19980318T030000Z/19980318T040000Z -URL:http://www.host.com/calendar/busytime/jsmith.ifb -END:VFREEBUSY -END:VCALENDAR diff --git a/modules/default/calendar/vendor/ical.js/test/test3.ics b/modules/default/calendar/vendor/ical.js/test/test3.ics deleted file mode 100644 index ee7111e7..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test3.ics +++ /dev/null @@ -1,226 +0,0 @@ -BEGIN:VCALENDAR -CALSCALE:GREGORIAN -PRODID:tvcountdown.com -X-WR-CALNAME:tvcountdown.com -VERSION:2.0 -METHOD:PUBLISH -X-WR-TIMEZONE:US/Eastern -X-WR-CALNAME;VALUE=TEXT:tvcountdown.com -X-WR-CALDESC: -BEGIN:VEVENT -UID:20110519T200000Z-79@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110519T200000 -DTEND;VALUE=DATE-TIME:20110519T203000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Big Bang Theory - S04E24 - The Roomate Transmogrfication -END:VEVENT -BEGIN:VEVENT -UID:20110512T200000Z-79@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110512T200000 -DTEND;VALUE=DATE-TIME:20110512T203000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Big Bang Theory - S04E23 - The Engagement Reaction -END:VEVENT -BEGIN:VEVENT -UID:20110505T220000Z-83@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110505T220000 -DTEND;VALUE=DATE-TIME:20110505T223000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:30 Rock - S05E23 - Respawn -END:VEVENT -BEGIN:VEVENT -UID:20110505T200000Z-79@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110505T200000 -DTEND;VALUE=DATE-TIME:20110505T203000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Big Bang Theory - S04E22 - The Wildebeest Implementation -END:VEVENT -BEGIN:VEVENT -UID:20110504T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110504T230000 -DTEND;VALUE=DATE-TIME:20110504T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E59 - David Barton -END:VEVENT -BEGIN:VEVENT -UID:20110503T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110503T230000 -DTEND;VALUE=DATE-TIME:20110503T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E58 - Rachel Maddow -END:VEVENT -BEGIN:VEVENT -UID:20110502T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110502T230000 -DTEND;VALUE=DATE-TIME:20110502T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E57 - Philip K. Howard -END:VEVENT -BEGIN:VEVENT -UID:20110428T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110428T230000 -DTEND;VALUE=DATE-TIME:20110428T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E56 - William Cohan -END:VEVENT -BEGIN:VEVENT -UID:20110428T220000Z-83@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110428T220000 -DTEND;VALUE=DATE-TIME:20110428T223000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:30 Rock - S05E22 - Everything Sunny All the Time Always -END:VEVENT -BEGIN:VEVENT -UID:20110428T200000Z-79@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110428T200000 -DTEND;VALUE=DATE-TIME:20110428T203000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Big Bang Theory - S04E21 - The Agreement Dissection -END:VEVENT -BEGIN:VEVENT -UID:20110427T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110427T230000 -DTEND;VALUE=DATE-TIME:20110427T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E55 - Sen. Bernie Sanders -END:VEVENT -BEGIN:VEVENT -UID:20110426T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110426T230000 -DTEND;VALUE=DATE-TIME:20110426T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E54 - Elizabeth Warren -END:VEVENT -BEGIN:VEVENT -UID:20110425T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110425T230000 -DTEND;VALUE=DATE-TIME:20110425T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E53 - Gigi Ibrahim -END:VEVENT -BEGIN:VEVENT -UID:20110421T220000Z-83@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110421T220000 -DTEND;VALUE=DATE-TIME:20110421T223000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:30 Rock - S05E21 - 100th Episode Part 2 of 2 -END:VEVENT -BEGIN:VEVENT -UID:20110421T220000Z-83@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110421T220000 -DTEND;VALUE=DATE-TIME:20110421T223000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:30 Rock - S05E20 - 100th Episode Part 1 of 2 -END:VEVENT -BEGIN:VEVENT -UID:20110414T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110414T230000 -DTEND;VALUE=DATE-TIME:20110414T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E52 - Ricky Gervais -END:VEVENT -BEGIN:VEVENT -UID:20110414T220000Z-83@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110414T220000 -DTEND;VALUE=DATE-TIME:20110414T223000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:30 Rock - S05E19 - I Heart Connecticut -END:VEVENT -BEGIN:VEVENT -UID:20110413T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110413T230000 -DTEND;VALUE=DATE-TIME:20110413T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E51 - Tracy Morgan -END:VEVENT -BEGIN:VEVENT -UID:20110412T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110412T230000 -DTEND;VALUE=DATE-TIME:20110412T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E50 - Gov. Deval Patrick -END:VEVENT -BEGIN:VEVENT -UID:20110411T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110411T230000 -DTEND;VALUE=DATE-TIME:20110411T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E49 - Foo Fighters -END:VEVENT -BEGIN:VEVENT -UID:20110407T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110407T230000 -DTEND;VALUE=DATE-TIME:20110407T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E48 - Jamie Oliver -END:VEVENT -BEGIN:VEVENT -UID:20110407T200000Z-79@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110407T200000 -DTEND;VALUE=DATE-TIME:20110407T203000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Big Bang Theory - S04E20 - The Herb Garden Germination -END:VEVENT -BEGIN:VEVENT -UID:20110406T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110406T230000 -DTEND;VALUE=DATE-TIME:20110406T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E47 - Mike Huckabee -END:VEVENT -BEGIN:VEVENT -UID:20110405T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110405T230000 -DTEND;VALUE=DATE-TIME:20110405T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E46 - Colin Quinn -END:VEVENT -BEGIN:VEVENT -UID:20110404T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110404T230000 -DTEND;VALUE=DATE-TIME:20110404T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E45 - Billy Crystal -END:VEVENT -BEGIN:VEVENT -UID:20110331T230000Z-289@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110331T230000 -DTEND;VALUE=DATE-TIME:20110331T233000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Daily Show - S16E44 - Norm MacDonald -END:VEVENT -BEGIN:VEVENT -UID:20110331T200000Z-79@tvcountdown.com -DTSTART;VALUE=DATE-TIME:20110331T200000 -DTEND;VALUE=DATE-TIME:20110331T203000 -DTSTAMP:20110430T192946Z -URL;VALUE=URI: -SUMMARY:The Big Bang Theory - S04E19 - The Zarnecki Incursion -END:VEVENT -END:VCALENDAR \ No newline at end of file diff --git a/modules/default/calendar/vendor/ical.js/test/test4.ics b/modules/default/calendar/vendor/ical.js/test/test4.ics deleted file mode 100644 index 390a404c..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test4.ics +++ /dev/null @@ -1,747 +0,0 @@ -BEGIN:VCALENDAR -X-WR-CALNAME:John Doe (TripIt) -X-WR-CALDESC:TripIt Calendar -X-PUBLISHED-TTL:PT15M -PRODID:-//John Doe/NONSGML Bennu 0.1//EN -VERSION:2.0 -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -UID:c32a5eaba2354bb29e012ec18da827db90550a3b@tripit.com -DTSTART;VALUE=DATE:20111011 -DTEND;VALUE=DATE:20111014 -SUMMARY:South San Francisco\, CA\, October 2011\; -LOCATION:South San Francisco\, CA -GEO:37.654656;-122.40775 -TRANSP:TRANSPARENT -DESCRIPTION:John Doe is in South San Francisco\, CA from Oct 11 - to Oct 13\, 2011\nView and/or edit details in TripIt : http://www.tripit.c - om/trip/show/id/23710889\nTripIt - organize your travel at http://www.trip - it.com\n -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -TRANSP:TRANSPARENT -UID:item-ee275ccffa83f492d9eb63b01953b39f18d4f944@tripit.com -DTSTART:20111011T100500 -DTEND:20111011T110500 -SUMMARY:Directions from SFO to Embassy Suites San Francisco Airport - Sout - h San Francisco -LOCATION:250 GATEWAY BLVD\, South San Francisco\, CA\, 94080 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/1234\n \n[Directions] 10/11/2011 10:05am - Directions from S - FO to Embassy Suites San Francisco Airport - South San Francisco \nfrom: S - FO \nto: 250 GATEWAY BLVD\, South San Francisco\, CA\, 94080 \nView direct - ions here: http://maps.google.com/maps?output=mobile&saddr=SFO&daddr=250+G - ATEWAY+BLVD%2C+South+San+Francisco%2C+CA%2C+94080 \n \n \n\nTripIt - organ - ize your travel at http://www.tripit.com -GEO:37.655634;-122.401273 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111011T165500Z -SUMMARY:US403 PHX to SFO -LOCATION:Phoenix (PHX) -UID:item-c576afd397cf1f90578b4ba35e781b61ba8897db@tripit.com -DTSTART:20111011T144500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/1234\n \n[Flight] 10/11/2011 US Airways(US) #403 dep PHX 7:4 - 5am MST arr SFO 9:55am PDT\; John Doe\; seat(s) 8B\; conf #DXH9K - Z\, BXQ9WH \nBooked on http://www.americanexpress-travel.com/\; Reference - #: 4127 8626 9715\; http://www.americanexpress-travel.com/\; US:1-800-297- - 2977\, Outside:210-582-2716 \n \n \n\nTripIt - organize your travel at htt - p://www.tripit.com -GEO:37.618889;-122.375 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Pick-up Rental Car: Dollar Rent A Car -TRANSP:TRANSPARENT -UID:item-e99a90ee1c7e4f5b68a4e551009e5bb6c475940c@tripit.com -DTSTART:20111011T172500Z -DTEND:20111011T182500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/1234\n \n[Car Rental] Dollar Rent A Car\; San Francisco Inte - rnational Airport\; primary driver John Doe\; conf #R9508361 \np - ickup 10/11/2011 10:25am\; dropoff 10/13/2011 6:49pm \nEconomy \nBooked on - http://www.americanexpress-travel.com/\; Reference #: 4127 8626 9715\; ht - tp://www.americanexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582 - -2716 \n \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-in: Embassy Suites San Francisco Airport - South San Francis - co -TRANSP:TRANSPARENT -UID:item-7f3288d418bed063cc82b4512e792fbb5d8ae761@tripit.com -DTSTART:20111011T185500Z -DTEND:20111011T195500Z -LOCATION:250 GATEWAY BLVD\, South San Francisco\, CA\, 94080 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/23710889\n \n[Lodging] Embassy Suites San Francisco Airport - So - uth San Francisco\; primary guest John Doe\; conf #R9508361 \n25 - 0 GATEWAY BLVD\, South San Francisco\, CA\, 94080\; tel 1.650.589.3400 \na - rrive 10/11/2011\; depart 10/13/2011\; rooms: 1 \nBooked on http://www.ame - ricanexpress-travel.com/\; Reference #: 4127 8626 9715\; http://www.americ - anexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582-2716 \n \n \n\ - nTripIt - organize your travel at http://www.tripit.com -GEO:37.655634;-122.401273 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-out: Embassy Suites San Francisco Airport - South San Franci - sco -TRANSP:TRANSPARENT -UID:item-5eb4cb5fc25c55b0423921e18336e57f8c34598d@tripit.com -DTSTART:20111014T011900Z -DTEND:20111014T021900Z -LOCATION:250 GATEWAY BLVD\, South San Francisco\, CA\, 94080 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/23710889\n \n[Lodging] Embassy Suites San Francisco Airport - So - uth San Francisco\; primary guest John Doe\; conf #R9508361 \n25 - 0 GATEWAY BLVD\, South San Francisco\, CA\, 94080\; tel 1.650.589.3400 \na - rrive 10/11/2011\; depart 10/13/2011\; rooms: 1 \nBooked on http://www.ame - ricanexpress-travel.com/\; Reference #: 4127 8626 9715\; http://www.americ - anexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582-2716 \n \n \n\ - nTripIt - organize your travel at http://www.tripit.com -GEO:37.655634;-122.401273 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Drop-off Rental Car: Dollar Rent A Car -TRANSP:TRANSPARENT -UID:item-11fdbf5d02e84646025716d9f9c7a4158e1fb025@tripit.com -DTSTART:20111014T014900Z -DTEND:20111014T024900Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/23710889\n \n[Car Rental] Dollar Rent A Car\; San Francisco Inte - rnational Airport\; primary driver John Doe\; conf #R9508361 \np - ickup 10/11/2011 10:25am\; dropoff 10/13/2011 6:49pm \nEconomy \nBooked on - http://www.americanexpress-travel.com/\; Reference #: 4127 8626 9715\; ht - tp://www.americanexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582 - -2716 \n \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111014T051900Z -SUMMARY:CO6256 SFO to PHX -LOCATION:San Francisco (SFO) -UID:item-cb485a571a01972d6bdc74c2b829905d6e3786bf@tripit.com -DTSTART:20111014T031900Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/23710889\n \n[Flight] 10/13/2011 Continental Airlines(CO) #6256 - dep SFO 8:19pm PDT arr PHX 10:19pm MST\; John Doe\; conf #DXH9KZ - \, BXQ9WH(Operated by United Airlines flight 6256) \nBooked on http://www. - americanexpress-travel.com/\; Reference #: 4127 8626 9715\; http://www.ame - ricanexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582-2716 \n \n - \n\nTripIt - organize your travel at http://www.tripit.com -GEO:33.436111;-112.009444 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -UID:c7b133db1e7be2713a4a63b75dcbad209690cab5@tripit.com -DTSTART;VALUE=DATE:20111023 -DTEND;VALUE=DATE:20111028 -SUMMARY:Santa Barbara\, CA\, October 2011 -LOCATION:Santa Barbara\, CA -GEO:34.420831;-119.69819 -TRANSP:TRANSPARENT -DESCRIPTION:John Doe is in Santa Barbara\, CA from Oct 23 to Oct - 27\, 2011\nView and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\nTripIt - organize your travel at http://www.tripit.com - \n -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111023T191200Z -SUMMARY:US2719 PHX to SBA -LOCATION:Phoenix (PHX) -UID:item-c4375369e9070fcc04df39ed18c4d93087577591@tripit.com -DTSTART:20111023T173500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\n \n[Flight] 10/23/2011 US Airways(US) #2719 dep PHX 10 - :35am MST arr SBA 12:12pm PDT\; John Doe Ticket #0378717202638\; - conf #A44XS5\, PRX98G\, FYYJZ4 \nBooked on http://www.americanexpress-tra - vel.com/\; Reference #: 7128 8086 8504\; http://www.americanexpress-travel - .com/\; US:1-800-297-2977\, Outside:210-582-2716\; Total Cost: $699.99 \n - \n \n\nTripIt - organize your travel at http://www.tripit.com -GEO:34.427778;-119.839444 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -TRANSP:TRANSPARENT -UID:item-962e4f045d12149319d1837ec096bf43770abd6e@tripit.com -DTSTART:20111025T094000 -DTEND:20111025T104000 -SUMMARY:Directions from Hertz to Sofitel San Francisco Bay -LOCATION:223 Twin Dolphin Drive\, Redwood City\, CA\, 94065 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\n \n[Directions] 10/25/2011 9:40am - Directions from He - rtz to Sofitel San Francisco Bay \nfrom: 780 McDonnell Road\, San Francisc - o\, CA\, 94128 \nto: 223 Twin Dolphin Drive\, Redwood City\, CA\, 94065 \n - View directions here: http://maps.google.com/maps?output=mobile&saddr=780+ - McDonnell+Road%2C+San+Francisco%2C+CA%2C+94128&daddr=223+Twin+Dolphin+Driv - e%2C+Redwood+City%2C+CA%2C+94065 \n \n \n\nTripIt - organize your travel a - t http://www.tripit.com -GEO:37.5232475;-122.261296 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111025T162600Z -SUMMARY:UA5304 SBA to SFO -LOCATION:Santa Barbara (SBA) -UID:item-ae300a6934c3820974dba2c9c5b8fae843c67693@tripit.com -DTSTART:20111025T150900Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\n \n[Flight] 10/25/2011 United Airlines(UA) #5304 dep S - BA 8:09am PDT arr SFO 9:26am PDT\; John Doe Ticket #037871720263 - 8\; seat(s) 11B\; conf #A44XS5\, PRX98G\, FYYJZ4 \nBooked on http://www.am - ericanexpress-travel.com/\; Reference #: 7128 8086 8504\; http://www.ameri - canexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582-2716\; Total - Cost: $699.99 \n \n \n\nTripIt - organize your travel at http://www.tripit - .com -GEO:37.618889;-122.375 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Pick-up Rental Car: Hertz -TRANSP:TRANSPARENT -UID:item-2a9fd5a57a4cdda4677fc6ce23738e1954fdbe2a@tripit.com -DTSTART:20111025T163000Z -DTEND:20111025T173000Z -LOCATION:780 McDonnell Road\, San Francisco\, CA\, 94128 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\n \n[Car Rental] Hertz\; San Francisco International Ai - rport\; primary driver John Doe\; conf #F2633064194 \n780 McDonn - ell Road\, San Francisco\, CA\, 94128 \npickup 10/25/2011 9:30am\; dropoff - 10/27/2011 7:00pm \nToyota Corolla or similar\; 84.57 USD \nBooked on htt - p://www.hertz.com/\; Reference #: F2633064194\; http://www.hertz.com/\; 80 - 0-654-3131\; Booking Rate: 84.57 USD\; Total Cost: 333.76 USD \n \n \n\nTr - ipIt - organize your travel at http://www.tripit.com -GEO:37.6297569;-122.4000351 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -TRANSP:TRANSPARENT -UID:item-98dfcb0bcfdcffcce9c58a84947212ed67cadda6@tripit.com -DTSTART:20111025T163600Z -DTEND:20111025T173600Z -SUMMARY:Directions from SFO to Sofitel San Francisco Bay -LOCATION:223 Twin Dolphin Drive\, Redwood City\, CA\, 94065 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\n \n[Directions] 10/25/2011 9:36am - Directions from SF - O to Sofitel San Francisco Bay \nfrom: SFO \nto: 223 Twin Dolphin Drive\, - Redwood City\, CA\, 94065 \nView directions here: http://maps.google.com/m - aps?output=mobile&saddr=SFO&daddr=223+Twin+Dolphin+Drive%2C+Redwood+City%2 - C+CA%2C+94065 \n \n \n\nTripIt - organize your travel at http://www.tripit - .com -GEO:37.5232475;-122.261296 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-in: Sofitel San Francisco Bay -TRANSP:TRANSPARENT -UID:item-8de3937b336c333faf2d55ad0a41c5ca6cc02393@tripit.com -DTSTART:20111025T220000Z -DTEND:20111025T230000Z -LOCATION:223 Twin Dolphin Drive\, Redwood City\, CA\, 94065 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\n \n[Lodging] Sofitel San Francisco Bay\; primary guest - John Doe\; conf #F80-0GMW \n223 Twin Dolphin Drive\, Redwood Ci - ty\, CA\, 94065\; tel (+1)650/598-9000 \narrive 10/25/2011\; depart 10/27/ - 2011\; rooms: 1 \nBooked on http://www.sofitel.com/\; http://www.sofitel.c - om/\; Total Cost: 564.00 USD \n \n \n\nTripIt - organize your travel at ht - tp://www.tripit.com -GEO:37.5232475;-122.261296 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-out: Sofitel San Francisco Bay -TRANSP:TRANSPARENT -UID:item-f3ade58646964bde101616a6d26ea7784a1a81e8@tripit.com -DTSTART:20111027T190000Z -DTEND:20111027T200000Z -LOCATION:223 Twin Dolphin Drive\, Redwood City\, CA\, 94065 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\n \n[Lodging] Sofitel San Francisco Bay\; primary guest - John Doe\; conf #F80-0GMW \n223 Twin Dolphin Drive\, Redwood Ci - ty\, CA\, 94065\; tel (+1)650/598-9000 \narrive 10/25/2011\; depart 10/27/ - 2011\; rooms: 1 \nBooked on http://www.sofitel.com/\; http://www.sofitel.c - om/\; Total Cost: 564.00 USD \n \n \n\nTripIt - organize your travel at ht - tp://www.tripit.com -GEO:37.5232475;-122.261296 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Drop-off Rental Car: Hertz -TRANSP:TRANSPARENT -UID:item-50620273fea0614d37775649034d5e1de92ae361@tripit.com -DTSTART:20111028T020000Z -DTEND:20111028T030000Z -LOCATION:780 McDonnell Road\, San Francisco\, CA\, 94128 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\n \n[Car Rental] Hertz\; San Francisco International Ai - rport\; primary driver John Doe\; conf #F2633064194 \n780 McDonn - ell Road\, San Francisco\, CA\, 94128 \npickup 10/25/2011 9:30am\; dropoff - 10/27/2011 7:00pm \nToyota Corolla or similar\; 84.57 USD \nBooked on htt - p://www.hertz.com/\; Reference #: F2633064194\; http://www.hertz.com/\; 80 - 0-654-3131\; Booking Rate: 84.57 USD\; Total Cost: 333.76 USD \n \n \n\nTr - ipIt - organize your travel at http://www.tripit.com -GEO:37.6297569;-122.4000351 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111028T051900Z -SUMMARY:CO6256 SFO to PHX -LOCATION:San Francisco (SFO) -UID:item-71d327f30d8beeaf7bf50c8fa63ce16005b9b0df@tripit.com -DTSTART:20111028T031900Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24259445\n \n[Flight] 10/27/2011 Continental Airlines(CO) #6256 - dep SFO 8:19pm PDT arr PHX 10:19pm MST\; John Doe Ticket #037871 - 7202638\; seat(s) 17D\; conf #A44XS5\, PRX98G\, FYYJZ4(Operated by United - Airlines flight 6256) \nBooked on http://www.americanexpress-travel.com/\; - Reference #: 7128 8086 8504\; http://www.americanexpress-travel.com/\; US - :1-800-297-2977\, Outside:210-582-2716\; Total Cost: $699.99 \n \n \n\nTri - pIt - organize your travel at http://www.tripit.com -GEO:33.436111;-112.009444 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -UID:2d4b446e63a94ade7dab0f0e9546b2d1965f011c@tripit.com -DTSTART;VALUE=DATE:20111108 -DTEND;VALUE=DATE:20111111 -SUMMARY:Redwood City\, CA\, November 2011 -LOCATION:Redwood City\, CA -GEO:37.485215;-122.236355 -TRANSP:TRANSPARENT -DESCRIPTION:John Doe is in Redwood City\, CA from Nov 8 to Nov 1 - 0\, 2011\nView and/or edit details in TripIt : http://www.tripit.com/trip/ - show/id/24913749\nTripIt - organize your travel at http://www.tripit.com\n -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111108T175700Z -SUMMARY:US403 PHX to SFO -LOCATION:Phoenix (PHX) -UID:item-7de7d829b2f95991de6d01c3d68f24b84770168c@tripit.com -DTSTART:20111108T154500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24913749\n \n[Flight] 11/8/2011 US Airways(US) #403 dep PHX 8:45 - am MST arr SFO 9:57am PST\; John Doe\; seat(s) 21C\; conf #FJDX0 - J\, I2W8HW \nBooked on http://www.americanexpress-travel.com/\; Reference - #: 4129 9623 4732\; http://www.americanexpress-travel.com/\; US:1-800-297- - 2977\, Outside:210-582-2716 \n \n \n\nTripIt - organize your travel at htt - p://www.tripit.com -GEO:37.618889;-122.375 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Pick-up Rental Car: Dollar Rent A Car -TRANSP:TRANSPARENT -UID:item-1ac6982fefdd79bc5ea849785f415a6291c450b1@tripit.com -DTSTART:20111108T182700Z -DTEND:20111108T192700Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24913749\n \n[Car Rental] Dollar Rent A Car\; San Francisco Inte - rnational Airport\; primary driver John Doe\; conf #Q0058133 \np - ickup 11/8/2011 10:27am\; dropoff 11/10/2011 6:25pm \nEconomy \nBooked on - http://www.americanexpress-travel.com/\; Reference #: 4129 9623 4732\; htt - p://www.americanexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582- - 2716 \n \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-in: Sofitel San Francisco Bay -TRANSP:TRANSPARENT -UID:item-126e584ffbefbec32a15ca503f0bdf8d3f9cc2f4@tripit.com -DTSTART:20111108T195700Z -DTEND:20111108T205700Z -LOCATION:223 TWIN DOLPHIN DR\, Redwood City\, CA\, 94065-1514 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24913749\n \n[Lodging] Sofitel San Francisco Bay\; primary guest - John Doe\; conf #Q0058133 \n223 TWIN DOLPHIN DR\, Redwood City\ - , CA\, 94065-1514\; tel 1.650.598.9000 \narrive 11/8/2011\; depart 11/10/2 - 011\; rooms: 1 \nBooked on http://www.americanexpress-travel.com/\; Refere - nce #: 4129 9623 4732\; http://www.americanexpress-travel.com/\; US:1-800- - 297-2977\, Outside:210-582-2716 \n \n \n\nTripIt - organize your travel at - http://www.tripit.com -GEO:37.5232475;-122.261296 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-out: Sofitel San Francisco Bay -TRANSP:TRANSPARENT -UID:item-ff48c502022356ccaa862ebb61761a0de08a1ce9@tripit.com -DTSTART:20111111T015500Z -DTEND:20111111T025500Z -LOCATION:223 TWIN DOLPHIN DR\, Redwood City\, CA\, 94065-1514 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24913749\n \n[Lodging] Sofitel San Francisco Bay\; primary guest - John Doe\; conf #Q0058133 \n223 TWIN DOLPHIN DR\, Redwood City\ - , CA\, 94065-1514\; tel 1.650.598.9000 \narrive 11/8/2011\; depart 11/10/2 - 011\; rooms: 1 \nBooked on http://www.americanexpress-travel.com/\; Refere - nce #: 4129 9623 4732\; http://www.americanexpress-travel.com/\; US:1-800- - 297-2977\, Outside:210-582-2716 \n \n \n\nTripIt - organize your travel at - http://www.tripit.com -GEO:37.5232475;-122.261296 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Drop-off Rental Car: Dollar Rent A Car -TRANSP:TRANSPARENT -UID:item-c0273c03ddbb68a9b05d5d43a489bc318136ca42@tripit.com -DTSTART:20111111T022500Z -DTEND:20111111T032500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24913749\n \n[Car Rental] Dollar Rent A Car\; San Francisco Inte - rnational Airport\; primary driver John Doe\; conf #Q0058133 \np - ickup 11/8/2011 10:27am\; dropoff 11/10/2011 6:25pm \nEconomy \nBooked on - http://www.americanexpress-travel.com/\; Reference #: 4129 9623 4732\; htt - p://www.americanexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582- - 2716 \n \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111111T055400Z -SUMMARY:CO496 SFO to PHX -LOCATION:San Francisco (SFO) -UID:item-3473cf9275326ac393b37859df3b04306b4849aa@tripit.com -DTSTART:20111111T035500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/24913749\n \n[Flight] 11/10/2011 Continental Airlines(CO) #496 d - ep SFO 7:55pm PST arr PHX 10:54pm MST\; John Doe\; seat(s) 26B\; - conf #FJDX0J\, I2W8HW(Operated by United Airlines flight 496) \nBooked on - http://www.americanexpress-travel.com/\; Reference #: 4129 9623 4732\; ht - tp://www.americanexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582 - -2716 \n \n \n\nTripIt - organize your travel at http://www.tripit.com -GEO:33.436111;-112.009444 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -UID:4ee5ded058432990e3d8808f48ca851e04923b6d@tripit.com -DTSTART;VALUE=DATE:20111129 -DTEND;VALUE=DATE:20111202 -SUMMARY:Milpitas\, CA\, November 2011 -LOCATION:Milpitas\, CA -GEO:37.428272;-121.906624 -TRANSP:TRANSPARENT -DESCRIPTION:John Doe is in Milpitas\, CA from Nov 29 to Dec 1\, - 2011\nView and/or edit details in TripIt : http://www.tripit.com/trip/show - /id/25671681\nTripIt - organize your travel at http://www.tripit.com\n -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111129T172400Z -SUMMARY:US282 PHX to SJC -LOCATION:Phoenix (PHX) -UID:item-644d5973b50d521d50e475ccf5321605d54bd0d5@tripit.com -DTSTART:20111129T152500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/25671681\n \n[Flight] 11/29/2011 US Airways(US) #282 dep PHX 8:2 - 5am MST arr SJC 9:24am PST\; John Doe\; seat(s) 17C\; conf #DQKD - GY \nBooked on http://www.americanexpress-travel.com/\; Reference #: 4131 - 3301 9911\; http://www.americanexpress-travel.com/\; US:1-800-297-2977\, O - utside:210-582-2716 \n \n \n\nTripIt - organize your travel at http://www. - tripit.com -GEO:37.361111;-121.925556 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Pick-up Rental Car: Alamo -TRANSP:TRANSPARENT -UID:item-10368bbdbc9b6f26f83098500633cc4eb604c751@tripit.com -DTSTART:20111129T175400Z -DTEND:20111129T185400Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/25671681\n \n[Car Rental] Alamo\; San Jose International Airport - \; primary driver John Doe\; conf #372828149COUNT \npickup 11/29 - /2011 9:54am\; dropoff 12/1/2011 5:45pm \nIntermediate \nBooked on http:// - www.americanexpress-travel.com/\; Reference #: 4131 3301 9911\; http://www - .americanexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582-2716 \n - \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-in: The Beverly Heritage Hotel -TRANSP:TRANSPARENT -UID:item-98d8638d3f1c011d03cb8f58b3a14a0f1203339b@tripit.com -DTSTART:20111129T192400Z -DTEND:20111129T202400Z -LOCATION:1820 Barber Lane\, Milpitas\, CA\, 95035 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/25671681\n \n[Lodging] The Beverly Heritage Hotel\; primary gues - t John Doe\; conf #372828149COUNT \n1820 Barber Lane\, Milpitas\ - , CA\, 95035\; tel 1.408.943.9080 \narrive 11/29/2011\; depart 12/1/2011\; - rooms: 1 \nBooked on http://www.americanexpress-travel.com/\; Reference # - : 4131 3301 9911\; http://www.americanexpress-travel.com/\; US:1-800-297-2 - 977\, Outside:210-582-2716 \n \n \n\nTripIt - organize your travel at http - ://www.tripit.com -GEO:37.4010467;-121.9116284 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111201T194400Z -SUMMARY:US273 SJC to PHX -LOCATION:San Jose (SJC) -UID:item-7b9ee9bb4edfe69743e32b33f9be55753956a883@tripit.com -DTSTART:20111201T175900Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/25671681\n \n[Flight] 12/1/2011 US Airways(US) #273 dep SJC 9:59 - am PST arr PHX 12:44pm MST\; John Doe Ticket #0378727451156\; co - nf #EMF71T \nBooked on http://www.americanexpress-travel.com/\; Reference - #: 5133 5264 1627\; http://www.americanexpress-travel.com/\; US:1-800-297- - 2977\, Outside:210-582-2716\; Total Cost: $316.69 \n \n \n\nTripIt - organ - ize your travel at http://www.tripit.com -GEO:33.436111;-112.009444 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-out: The Beverly Heritage Hotel -TRANSP:TRANSPARENT -UID:item-f79f203072002b8f06598dcb2be0e36af17b625b@tripit.com -DTSTART:20111202T011500Z -DTEND:20111202T021500Z -LOCATION:1820 Barber Lane\, Milpitas\, CA\, 95035 -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/25671681\n \n[Lodging] The Beverly Heritage Hotel\; primary gues - t John Doe\; conf #372828149COUNT \n1820 Barber Lane\, Milpitas\ - , CA\, 95035\; tel 1.408.943.9080 \narrive 11/29/2011\; depart 12/1/2011\; - rooms: 1 \nBooked on http://www.americanexpress-travel.com/\; Reference # - : 4131 3301 9911\; http://www.americanexpress-travel.com/\; US:1-800-297-2 - 977\, Outside:210-582-2716 \n \n \n\nTripIt - organize your travel at http - ://www.tripit.com -GEO:37.4010467;-121.9116284 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Drop-off Rental Car: Alamo -TRANSP:TRANSPARENT -UID:item-69f526ad49fa8ca0a74486f4fc77cc3f9d23a72f@tripit.com -DTSTART:20111202T014500Z -DTEND:20111202T024500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/25671681\n \n[Car Rental] Alamo\; San Jose International Airport - \; primary driver John Doe\; conf #372828149COUNT \npickup 11/29 - /2011 9:54am\; dropoff 12/1/2011 5:45pm \nIntermediate \nBooked on http:// - www.americanexpress-travel.com/\; Reference #: 4131 3301 9911\; http://www - .americanexpress-travel.com/\; US:1-800-297-2977\, Outside:210-582-2716 \n - \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111202T045900Z -SUMMARY:US288 SJC to PHX -LOCATION:San Jose (SJC) -UID:item-dab68a87c8dd49064ab0ba1dec5ba75ba46ff1d3@tripit.com -DTSTART:20111202T031500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/25671681\n \n[Flight] 12/1/2011 US Airways(US) #288 dep SJC 7:15 - pm PST arr PHX 9:59pm MST\; John Doe\; seat(s) 13C\; conf #DQKDG - Y \nBooked on http://www.americanexpress-travel.com/\; Reference #: 4131 3 - 301 9911\; http://www.americanexpress-travel.com/\; US:1-800-297-2977\, Ou - tside:210-582-2716 \n \n \n\nTripIt - organize your travel at http://www.t - ripit.com -GEO:33.436111;-112.009444 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -UID:67d48ddde166a2e9bbac2cf7d93fe493b0860008@tripit.com -DTSTART;VALUE=DATE:20111213 -DTEND;VALUE=DATE:20111216 -SUMMARY:San Jose\, CA\, December 2011 -LOCATION:San Jose\, CA -GEO:37.339386;-121.894955 -TRANSP:TRANSPARENT -DESCRIPTION:John Doe is in San Jose\, CA from Dec 13 to Dec 15\, - 2011\nView and/or edit details in TripIt : http://www.tripit.com/trip/sho - w/id/27037117\nTripIt - organize your travel at http://www.tripit.com\n -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111213T172400Z -SUMMARY:US282 PHX to SJC -LOCATION:Phoenix (PHX) -UID:item-2b1b9021be548a87dd335f190b60ab78c33b619d@tripit.com -DTSTART:20111213T152500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27037117\n \n[Flight] 12/13/2011 US Airways(US) #282 dep PHX 8:2 - 5am MST arr SJC 9:24am PST\; John Doe Ticket #0378728465928\; se - at(s) 15C\; conf #GGNV29 \nBooked on http://www.americanexpress-travel.com - /\; Reference #: 3134 0525 5102\; http://www.americanexpress-travel.com/\; - US:1-800-297-2977\, Outside:210-582-2716\; Total Cost: $406.39 \n \n \n\n - TripIt - organize your travel at http://www.tripit.com -GEO:37.361111;-121.925556 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Pick-up Rental Car: Advantage -TRANSP:TRANSPARENT -UID:item-619d345bb08aaef68e8767b672277243697f5bff@tripit.com -DTSTART:20111213T180000Z -DTEND:20111213T190000Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27037117\n \n[Car Rental] Advantage\; San Jose International Air - port\; primary driver John Doe\; conf #F31539020E7 \npickup 12/1 - 3/2011 10:00am\; dropoff 12/15/2011 7:00pm \nStandard Convertible \nRefere - nce #: 3134 0526 3890 \n \n \n\nTripIt - organize your travel at http://ww - w.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-in: Crestview Hotel: -TRANSP:TRANSPARENT -UID:item-fbe6c08e7523c82fac69b40ad1d0899f3d8d5982@tripit.com -DTSTART:20111213T192400Z -DTEND:20111213T202400Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27037117\n \n[Lodging] Crestview Hotel:\; conf #CR31342159 \ntel - 650-966-8848 \narrive 12/13/2011\; depart 12/15/2011 \nBooking Rate: 153. - 30 \n \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-out: Crestview Hotel: -TRANSP:TRANSPARENT -UID:item-7ed8b84628e650a6b37161c7825bac9e72add49f@tripit.com -DTSTART:20111216T011500Z -DTEND:20111216T021500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27037117\n \n[Lodging] Crestview Hotel:\; conf #CR31342159 \ntel - 650-966-8848 \narrive 12/13/2011\; depart 12/15/2011 \nBooking Rate: 153. - 30 \n \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Drop-off Rental Car: Advantage -TRANSP:TRANSPARENT -UID:item-623b54ebe07ffd48845f1a120a86940ce79c698b@tripit.com -DTSTART:20111216T030000Z -DTEND:20111216T040000Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27037117\n \n[Car Rental] Advantage\; San Jose International Air - port\; primary driver John Doe\; conf #F31539020E7 \npickup 12/1 - 3/2011 10:00am\; dropoff 12/15/2011 7:00pm \nStandard Convertible \nRefere - nce #: 3134 0526 3890 \n \n \n\nTripIt - organize your travel at http://ww - w.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20111216T045900Z -SUMMARY:US288 SJC to PHX -LOCATION:San Jose (SJC) -UID:item-52481e672972d2e88d5eaa5cf49bb801562c6014@tripit.com -DTSTART:20111216T031500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27037117\n \n[Flight] 12/15/2011 US Airways(US) #288 dep SJC 7:1 - 5pm PST arr PHX 9:59pm MST\; John Doe Ticket #0378728465928\; se - at(s) 7B\; conf #GGNV29 \nBooked on http://www.americanexpress-travel.com/ - \; Reference #: 3134 0525 5102\; http://www.americanexpress-travel.com/\; - US:1-800-297-2977\, Outside:210-582-2716\; Total Cost: $406.39 \n \n \n\nT - ripIt - organize your travel at http://www.tripit.com -GEO:33.436111;-112.009444 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -UID:7299ff29daed7d5c3e2ed4acc74deec5b7942bd5@tripit.com -DTSTART;VALUE=DATE:20120103 -DTEND;VALUE=DATE:20120106 -SUMMARY:San Francisco\, CA\, January 2012 -LOCATION:San Francisco\, CA -GEO:37.774929;-122.419415 -TRANSP:TRANSPARENT -DESCRIPTION:John Doe is in San Francisco\, CA from Jan 3 to Jan - 5\, 2012\nView and/or edit details in TripIt : http://www.tripit.com/trip/ - show/id/27863159\nTripIt - organize your travel at http://www.tripit.com\n -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20120103T175700Z -SUMMARY:US403 PHX to SFO -LOCATION:Phoenix (PHX) -UID:item-f099e76114bf43ef3b122432579d8b40995412a7@tripit.com -DTSTART:20120103T154500Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27863159\n \n[Flight] 1/3/2012 US Airways(US) #403 dep PHX 8:45a - m MST arr SFO 9:57am PST\; John Doe Ticket #0378731791515\; conf - #FH9B72\, L4F9M5 \nBooked on http://www.americanexpress-travel.com/\; Ref - erence #: 6135 7391 6119\; http://www.americanexpress-travel.com/\; US:1-8 - 00-297-2977\, Outside:210-582-2716\; Total Cost: $668.39 \n \n \n\nTripIt - - organize your travel at http://www.tripit.com -GEO:37.618889;-122.375 -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Pick-up Rental Car: Alamo -TRANSP:TRANSPARENT -UID:item-fae4b4b07b66fc87df125238e0aaf645106cf4f3@tripit.com -DTSTART:20120103T180000Z -DTEND:20120103T190000Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27863159\n \n[Car Rental] Alamo\; San Francisco International Ai - rport\; primary driver John Doe\; conf #373525981COUNT \npickup - 1/3/2012 10:00am\; dropoff 1/5/2012 6:00pm \nCompact \nReference #: 6135 7 - 391 6898 \n \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-in: Grand Hotel Sunnyvale -TRANSP:TRANSPARENT -UID:item-d89a856eb9da9dfdcb4da46f42e49af3a838fcbb@tripit.com -DTSTART:20120103T195700Z -DTEND:20120103T205700Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27863159\n \n[Lodging] Grand Hotel Sunnyvale\; conf #22084SY0361 - 18 \ntel 1-408-7208500 \narrive 1/3/2012\; depart 1/5/2012 \nBooking Rate: - USD 169.00 \nPolicies: Guarantee to valid form of payment is required at - time of booking\; Cancel 1 day prior to arrival date to avoid penalty of 1 - Nights Room Charge. Change fee may apply for early departures and changes - made to confirmed reservations.\; \n \n \n\nTripIt - organize your travel - at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Check-out: Grand Hotel Sunnyvale -TRANSP:TRANSPARENT -UID:item-6edc82f6411fd0b66f2f7f6baafa41623a8623a9@tripit.com -DTSTART:20120106T010900Z -DTEND:20120106T020900Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27863159\n \n[Lodging] Grand Hotel Sunnyvale\; conf #22084SY0361 - 18 \ntel 1-408-7208500 \narrive 1/3/2012\; depart 1/5/2012 \nBooking Rate: - USD 169.00 \nPolicies: Guarantee to valid form of payment is required at - time of booking\; Cancel 1 day prior to arrival date to avoid penalty of 1 - Nights Room Charge. Change fee may apply for early departures and changes - made to confirmed reservations.\; \n \n \n\nTripIt - organize your travel - at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -SUMMARY:Drop-off Rental Car: Alamo -TRANSP:TRANSPARENT -UID:item-58a31b96066ffd09b800af49de59a84f7b7a3a06@tripit.com -DTSTART:20120106T020000Z -DTEND:20120106T030000Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27863159\n \n[Car Rental] Alamo\; San Francisco International Ai - rport\; primary driver John Doe\; conf #373525981COUNT \npickup - 1/3/2012 10:00am\; dropoff 1/5/2012 6:00pm \nCompact \nReference #: 6135 7 - 391 6898 \n \n \n\nTripIt - organize your travel at http://www.tripit.com -END:VEVENT -BEGIN:VEVENT -DTSTAMP:20120101T215311Z -DTEND:20120106T050500Z -SUMMARY:CO496 SFO to PHX -LOCATION:San Francisco (SFO) -UID:item-7884351ce42d503b90ccc48c33c7c30bd4f44767@tripit.com -DTSTART:20120106T030900Z -DESCRIPTION:View and/or edit details in TripIt : http://www.tripit.com/tri - p/show/id/27863159\n \n[Flight] 1/5/2012 Continental Airlines(CO) #496 dep - SFO 7:09pm PST arr PHX 10:05pm MST\; John Doe Ticket #037873179 - 1515\; conf #FH9B72\, L4F9M5(Operated by United Airlines flight 496) \nBoo - ked on http://www.americanexpress-travel.com/\; Reference #: 6135 7391 611 - 9\; http://www.americanexpress-travel.com/\; US:1-800-297-2977\, Outside:2 - 10-582-2716\; Total Cost: $668.39 \n \n \n\nTripIt - organize your travel - at http://www.tripit.com -GEO:33.436111;-112.009444 -END:VEVENT -END:VCALENDAR diff --git a/modules/default/calendar/vendor/ical.js/test/test5.ics b/modules/default/calendar/vendor/ical.js/test/test5.ics deleted file mode 100644 index c51f25ee..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test5.ics +++ /dev/null @@ -1,41 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Meetup//RemoteApi//EN -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-ORIGINAL-URL:http://www.meetup.com/events/ical/8333638/dfdba2e469216075 - 3404f737feace78d526ff0ce/going -X-WR-CALNAME:My Meetups -X-MS-OLK-FORCEINSPECTOROPEN:TRUE -BEGIN:VTIMEZONE -TZID:America/Phoenix -TZURL:http://tzurl.org/zoneinfo-outlook/America/Phoenix -X-LIC-LOCATION:America/Phoenix -BEGIN:STANDARD -TZOFFSETFROM:-0700 -TZOFFSETTO:-0700 -TZNAME:MST -DTSTART:19700101T000000 -END:STANDARD -END:VTIMEZONE -BEGIN:VEVENT -DTSTAMP:20111106T155927Z -DTSTART;TZID=America/Phoenix:20111109T190000 -DTEND;TZID=America/Phoenix:20111109T210000 -STATUS:CONFIRMED -SUMMARY:Phoenix Drupal User Group Monthly Meetup -DESCRIPTION:Phoenix Drupal User Group\nWednesday\, November 9 at 7:00 PM\ - n\nCustomizing node display with template pages in Drupal 6\n\n Jon Shee - han and Matthew Berry of the Office of Knowledge Enterprise Development - (OKED) Knowledge...\n\nDetails: http://www.meetup.com/Phoenix-Drupal-Use - r-Group/events/33627272/ -CLASS:PUBLIC -CREATED:20100630T083023Z -GEO:33.56;-111.90 -LOCATION:Open Source Project Tempe (1415 E University Dr. #103A\, Tempe\, - AZ 85281) -URL:http://www.meetup.com/Phoenix-Drupal-User-Group/events/33627272/ -LAST-MODIFIED:20111102T213309Z -UID:event_nsmxnyppbfc@meetup.com -END:VEVENT -END:VCALENDAR \ No newline at end of file diff --git a/modules/default/calendar/vendor/ical.js/test/test6.ics b/modules/default/calendar/vendor/ical.js/test/test6.ics deleted file mode 100644 index 3762d02b..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test6.ics +++ /dev/null @@ -1,1170 +0,0 @@ -BEGIN:VCALENDAR -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110804T120000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T120000 -LOCATION:All Areas -SUMMARY:foobar Summer 2011 starts! -URL:F -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110804T120000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T120000 -LOCATION:Main entrance -SUMMARY:Main entrance opened -URL:http://www.foobar.org/summer11/come-to-party/entry-setup -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110804T120000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T120000 -LOCATION:Loading entrances #1 and #2 -SUMMARY:Loading doors are opened -URL:http://www.foobar.org/summer11/come-to-party/entry-setup -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110804T120000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T120000 -LOCATION:foobarTV -SUMMARY:foobarTV broadcast starts -RRULE:FREQ=WEEKLY;BYDAY=MO,FR;INTERVAL=5;UNTIL=20130130T230000Z -URL:http://www.foobartv.net -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110804T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T180000 -LOCATION:Loading entrances #1 and #2 -SUMMARY:Loading doors close -URL:http://www.foobar.org/summer11/come-to-party/entry-setup -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110805T120000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T120000 -LOCATION:Loading entrance #1 -SUMMARY:Loading doors are opened -URL:http://www.foobar.org/summer11/come-to-party/entry-setup -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110805T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T180000 -LOCATION:Loading entrance #1 -SUMMARY:Loading doors close -URL:http://www.foobar.org/summer11/come-to-party/entry-setup -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_deadline -DTEND;VALUE=DATE:20110804T220000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T220000 -LOCATION:PMS -SUMMARY:Oldskool demo\, individual and 4k intro compo deadline -URL:http://www.foobar.org/summer11/compos/how-to/submit-entry -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_deadline -DTEND;VALUE=DATE:20110805T200000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T200000 -LOCATION:PMS -SUMMARY:Group compo deadline -URL:http://www.foobar.org/summer11/compos/how-to/submit-entry -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110804T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T120000 -LOCATION:PMS -SUMMARY:Sign-up for street basketball & Guitar Hero solo guitar -URL:http://www.foobar.org/summer11/compos/gaming-sports -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110805T110000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T120000 -LOCATION:PMS -SUMMARY:Sign-up for sports and machine dance compos -URL:http://www.foobar.org/summer11/compos/gaming-sports -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110806T160000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T120000 -LOCATION:PMS -SUMMARY:Sign-up for poker tournament -URL:http://www.foobar.org/summer11/compos/sponsored-unofficial/poker -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110804T220000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T200000 -LOCATION:Outside main entrance -SUMMARY:Street basketball -URL:http://www.foobar.org/summer11/compos/sports-competitions/team/#stre - etbasketball -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110805T124500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T123000 -LOCATION:Infodesk -SUMMARY:Sport compos - gather up at the infodesk -URL:http://www.foobar.org/summer11/compos/gaming-sports -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110805T140000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T130000 -LOCATION:Grass fields by Messukeskus -SUMMARY:Disk throwing -URL:http://www.foobar.org/summer11/compos/sports-competitions/individual - /#disk -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110805T140000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T130000 -LOCATION:Grass fields by Messukeskus -SUMMARY:CD throwing -URL:http://www.foobar.org/summer11/compos/sports-competitions/individual - /#cd -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110805T160000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T140000 -LOCATION:Grass fields by Messukeskus -SUMMARY:ASUS soccer tournament -URL:http://www.foobar.org/summer11/compos/sports-competitions/team/#socc - er -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110805T000000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T180000 -LOCATION:Guitar Hero -SUMMARY:Guitar Hero: Guitar tournament - qualifying round #1 -URL:http://www.foobar.org/summer11/compos/gaming-sports/individual -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110805T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T120000 -LOCATION:Guitar Hero -SUMMARY:Guitar Hero: Guitar tournament - qualifying round #2 -URL:http://www.foobar.org/summer11/compos/gaming-sports/individual -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110806T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T120000 -LOCATION:Guitar Hero -SUMMARY:Guitar Hero: Guitar tournament - semifinal -URL:http://www.foobar.org/summer11/compos/gaming-sports/individual -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110807T130000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T120000 -LOCATION:Stage -SUMMARY:Guitar Hero: Guitar Tournament final -URL:http://www.foobar.org/summer11/compos/gaming-sports/individual -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110805T210000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T160000 -LOCATION:Third floor -SUMMARY:Machine Dance tournament -URL:http://www.foobar.org/summer11/compos/gaming-sports/individual/#danc - e -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110807T120000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T110000 -LOCATION:Stage -SUMMARY:Machine Dance tournament finals -URL:http://www.foobar.org/summer11/compos/gaming-sports/individual/#danc - e -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110807T000000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T200000 -LOCATION:Seminar area -SUMMARY:Poker tournament -URL:http://www.foobar.org/summer11/compos/sponsored-unofficial/poker -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110804T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T150000 -LOCATION:Infodesk -SUMMARY:GameDev compo recording - come to Infodesk -URL:http://www.foobar.org/summer11/compos/realtime/gamedev -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_showing -DTEND;VALUE=DATE:20110805T010000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T000000 -LOCATION:Big screen -SUMMARY:GameDev compo -URL:http://www.foobar.org/summer11/compos/realtime/gamedev -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110804T190000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T190000 -LOCATION:Website -SUMMARY:Fast music - sample set released -URL:http://www.foobar.org/summer11/compos/sound-vision/fast#music -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_deadline -DTEND;VALUE=DATE:20110804T203000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T203000 -LOCATION:PMS -SUMMARY:Fast music - deadline -URL:http://www.foobar.org/summer11/compos/sound-vision/fast#music -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110805T003000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T223000 -LOCATION:Infodesk -SUMMARY:Fast music - jury - come to Infodesk -URL:http://www.foobar.org/summer11/compos/sound-vision/fast#music -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110805T161500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T153000 -LOCATION:Big screen -SUMMARY:Fast music compo -URL:http://www.foobar.org/summer11/compos/sound-vision/fast#music -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110804T203000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T203000 -LOCATION:Website -SUMMARY:Fast graphics - objectives released -URL:http://www.foobar.org/summer11/compos/sound-vision/fast#graphics -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_deadline -DTEND;VALUE=DATE:20110804T220000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T220000 -LOCATION:PMS -SUMMARY:Fast graphics - deadline -URL:http://www.foobar.org/summer11/compos/sound-vision/fast#graphics -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110805T001500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T233000 -LOCATION:Infodesk -SUMMARY:Fast graphics - jury - come to Infodesk -URL:http://www.foobar.org/summer11/compos/sound-vision/fast#graphics -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110805T164500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T163000 -LOCATION:Big screen -SUMMARY:Fast graphics compo -URL:http://www.foobar.org/summer11/compos/sound-vision/fast#graphics -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110805T021500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T221500 -LOCATION:Infodesk -SUMMARY:Extreme music and Oldskool demo - jury - come to Infodesk -URL:http://www.foobar.org/summer11/compos/realtime/oldskool -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110805T150000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T110000 -LOCATION:Infodesk -SUMMARY:Extreme music and Oldskool demo - compo entry recording\, come to - Infodesk -URL:http://www.foobar.org/summer11/compos/realtime/oldskool -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110806T144500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T140000 -LOCATION:Big screen -SUMMARY:Extreme music compo -URL:http://www.foobar.org/summer11/compos/realtime/extreme#music -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110806T171500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T163000 -LOCATION:Big screen -SUMMARY:Oldskool demo compo -URL:http://www.foobar.org/summer11/compos/realtime/oldskool -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110805T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T130000 -LOCATION:Infodesk -SUMMARY:Music compo - jury - come to Infodesk -URL:http://www.foobar.org/summer11/compos/sound-vision/music#freestyle -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110806T161500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T153000 -LOCATION:Big screen -SUMMARY:Music compo -URL:http://www.foobar.org/summer11/compos/sound-vision/music#freestyle -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110805T163000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T140000 -LOCATION:Infodesk -SUMMARY:Graphics compo - jury - come to Infodesk -URL:http://www.foobar.org/summer11/compos/sound-vision/graphics#freestyl - e -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110806T151500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T150000 -LOCATION:Big screen -SUMMARY:Graphics compo -URL:http://www.foobar.org/summer11/compos/sound-vision/graphics#freestyl - e -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110805T110000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T090000 -LOCATION:Infodesk -SUMMARY:Real wild demo - recording assistance - come to Infodesk -URL:http://www.foobar.org/summer11/compos/realtime/demo#mobile -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110805T223000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T203000 -LOCATION:Infodesk -SUMMARY:Real wild demo - jury - come to Infodesk -URL:http://www.foobar.org/summer11/compos/realtime/demo#mobile -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110806T181500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T173000 -LOCATION:Big screen -SUMMARY:Real wild demo compo -URL:http://www.foobar.org/summer11/compos/realtime/demo#mobile -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110805T013000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T220000 -LOCATION:Infodesk -SUMMARY:Short film & Real Wild demo - format conversions help - come to In - fodesk -URL:http://www.foobar.org/summer11/compos/sound-vision/short-film -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110806T123000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T100000 -LOCATION:Infodesk -SUMMARY:Short film - jury - come to Infodesk -URL:http://www.foobar.org/summer11/compos/sound-vision/short-film -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110806T204500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T194500 -LOCATION:Big screen -SUMMARY:Short film compo -URL:http://www.foobar.org/summer11/compos/sound-vision/short-film -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110805T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T160000 -LOCATION:Infodesk -SUMMARY:4k intro - jury - come to Infodesk -URL:http://www.foobar.org/summer11/compos/realtime/demo#64k -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110806T214500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T210000 -LOCATION:Big screen -SUMMARY:4k intro compo -URL:http://www.foobar.org/summer11/compos/realtime/demo#64k -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110806T010000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T230000 -LOCATION:Infodesk -SUMMARY:64k intro - jury - come to Infodesk -URL:http://www.foobar.org/summer11/compos/realtime/demo#64k -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110806T224500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T220000 -LOCATION:Big screen -SUMMARY:64k intro compo -URL:http://www.foobar.org/summer11/compos/realtime/demo#64k -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_jury -DTEND;VALUE=DATE:20110806T160000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T130000 -LOCATION:Infodesk -SUMMARY:Demo - jury -URL:http://www.foobar.org/summer11/compos/realtime/demo#demo -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_show -DTEND;VALUE=DATE:20110806T230000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T220000 -LOCATION:Big screen -SUMMARY:Demo compo -URL:http://www.foobar.org/summer11/compos/realtime/demo#demo -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110804T160000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T120000 -LOCATION:Powerplay -SUMMARY:ASUS ROG Starcraft 2 - Brackets D\, E\, F -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110804T210000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T170000 -LOCATION:Powerplay -SUMMARY:ASUS ROG Starcraft 2 - Brackets C\, G\, H -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T020000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T220000 -LOCATION:Powerplay -SUMMARY:ASUS ROG Starcraft 2 - Brackets A\, B -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T140000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T110000 -LOCATION:Powerplay -SUMMARY:ASUS ROG Starcraft 2 - Single elimination 16 players -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T153000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T140000 -LOCATION:Powerplay -SUMMARY:ASUS ROG Starcraft 2 - Single elimination 6 players -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T193000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T180000 -LOCATION:Powerplay -SUMMARY:ASUS ROG Starcraft 2 - Semifinal 1 -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T210000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T193000 -LOCATION:Powerplay -SUMMARY:ASUS ROG Starcraft 2 - Semifinal 2 -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T223000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T210000 -LOCATION:Powerplay -SUMMARY:ASUS ROG Starcraft 2 - Bronze match -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110806T003000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T230000 -LOCATION:Stage -SUMMARY:ASUS ROG Starcraft 2 - Final -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110806T160000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T130000 -LOCATION:Game hall -SUMMARY:WCG.fi Starcraft 2 – Brackets -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110806T193000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T173000 -LOCATION:Game hall -SUMMARY:WCG.fi Starcraft 2 - Single elimination 8 players -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110806T210000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T200000 -LOCATION:Game hall -SUMMARY:WCG.fi Starcraft 2 - Semifinal 1 -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110806T220000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T210000 -LOCATION:Game hall -SUMMARY:WCG.fi Starcraft 2 - Semifinal 2 -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110807T003000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T223000 -LOCATION:Game hall -SUMMARY:WCG.fi Starcraft 2 - Bronze match -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110807T023000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T000000 -LOCATION:Stage -SUMMARY:WCG.fi Starcraft 2 - Final -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T003000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T193000 -LOCATION:Game hall -SUMMARY:Brink - Brackets -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T140000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T120000 -LOCATION:Game hall -SUMMARY:Brink - Bronze match -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T190000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T173000 -LOCATION:Stage -SUMMARY:Brink - Final -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T190000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T120000 -LOCATION:Game hall -SUMMARY:Team Fortress 2 - Brackets -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T230000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T210000 -LOCATION:Game hall -SUMMARY:Team Fortress 2 - Semifinal 1 -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T230000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T210000 -LOCATION:Game hall -SUMMARY:Team Fortress 2 - Semifinal 2 -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110806T170000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T150000 -LOCATION:Game hall -SUMMARY:Team Fortress 2 - Bronze match -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110806T130000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T110000 -LOCATION:Stage -SUMMARY:Team Fortress 2 - Final -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T003000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T180000 -LOCATION:Game hall -SUMMARY:FIFA 2011 - tournament -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110805T230000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T190000 -LOCATION:Game hall -SUMMARY:NHL 2011 - tournament -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110806T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T140000 -LOCATION:Game hall -SUMMARY:Tekken 6 - tournament -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110806T190000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T150000 -LOCATION:Game hall -SUMMARY:Super Street Fighter - tournament -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo_game -DTEND;VALUE=DATE:20110807T060000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T180000 -LOCATION:Own computer place -SUMMARY:Heroes of Newerth - Tournament -URL:http://www.peliliiga.fi -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110804T213000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T210000 -LOCATION:Stage -SUMMARY:Opening ceremony -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110806T170000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T170000 -LOCATION:PMS -SUMMARY:Voting closes for individual and Game development compos -URL:http://www.foobar.org/summer11/party_manual/intranet/vote -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110806T193000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T183000 -LOCATION:Stage -SUMMARY:Prize ceremony 1 -URL:http://www.foobar.org/summer11/compos/prizes/ -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110807T120000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T120000 -LOCATION:PMS -SUMMARY:Voting closes -URL:http://www.foobar.org/summer11/party_manual/intranet/vote -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Compo -DTEND;VALUE=DATE:20110807T143000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T140000 -LOCATION:Stage -SUMMARY:Prize ceremony 2 -URL:http://www.foobar.org/summer11/compos/prizes/ -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110807T150000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T143000 -LOCATION:Stage -SUMMARY:Closing ceremony -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110806T130000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T110000 -LOCATION:Outside loading door #1 -SUMMARY:Robowar tournament qualifier -URL:http://www.foobar.org/summer11/program/robosota -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110806T160000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T150000 -LOCATION:Outside loading door #1 -SUMMARY:Robowar tournament final -URL:http://www.foobar.org/summer11/program/robosota -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110804T233000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T220000 -LOCATION:Main stage -SUMMARY:Concert - Machinae Supremacy -URL:http://www.foobar.org/summer11/program/concerts -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110805T220000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T203000 -LOCATION:Main stage -SUMMARY:Concert - Press Play on Tape -URL:http://www.foobar.org/summer11/program/concerts -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110805T143000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T140000 -LOCATION:Stage -SUMMARY:Cosplay event presented by BatMud -URL:http://www.foobar.org/summer11/program/ -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110806T190000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T140000 -LOCATION:Powerplay -SUMMARY:ASUS presents - Paragon WOW raiding -URL:http://www.foobar.org/summer11/program/ -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110804T184500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T180000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Digital resistance\, East European demo art -URL:http://www.foobar.org/summer11/seminars/sessions#demoart -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110804T194500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T190000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Why Being Poor and Having No Budget is Good For - Making Game -URL:http://www.foobar.org/summer11/seminars/sessions#constraints -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110804T204500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T200000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Remix Culture In The Demoscene -URL:http://www.foobar.org/summer11/seminars/sessions#remix -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110804T214500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110804T210000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - DRM of Pacman -URL:http://www.foobar.org/summer11/seminars/sessions#drmpacman -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110805T104500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T100000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Perfect harmony: crowdsourcing matches musician - s and sound designers to game developers -URL:http://www.foobar.org/summer11/seminars/sessions#music -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110805T124500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T120000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Browserscene: Creating demos on the Web -URL:http://www.foobar.org/summer11/seminars/sessions#webgl2 -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110805T144500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T140000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Fumbling my way through pixel-based effects mad - e learning WebGL a lot easier -URL:http://www.foobar.org/summer11/seminars/sessions#webgl1 -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110805T154500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T150000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - The Making of RO.ME -URL:http://www.foobar.org/summer11/seminars/sessions#rome -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110805T164500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T160000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Developing next generation of online games -URL:http://www.foobar.org/summer11/seminars/sessions#nextgenonline -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110805T174500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T170000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Developing Games for Nokia Phones -URL:http://www.foobar.org/summer11/seminars/sessions#nokia_games -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110805T184500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T180000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Rocking your socks off with Windows Phone 7 -URL:http://www.foobar.org/summer11/seminars/sessions#wp7 -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110805T194500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T190000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Wonders of Kinect Windows SDK -URL:http://www.foobar.org/summer11/seminars/sessions#kinect -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110806T114500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T110000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Basics of demo programming -URL:http://www.foobar.org/summer11/seminars/sessions#demoprogramming -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110806T124500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T120000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Kajak3D\, an open source multiplatform game eng - ine -URL:http://www.foobar.org/summer11/seminars/sessions#kajak3d -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110806T134500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T130000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Adventures in multithreaded gameplay coding -URL:http://www.foobar.org/summer11/seminars/sessions#threaded -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110806T144500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T140000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - The art and design of Ridge Racer Unbounded -URL:http://www.foobar.org/summer11/seminars/sessions#ridgeracer -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110806T154500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T150000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Future of location based mobile games -URL:http://www.foobar.org/summer11/seminars/sessions#location -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110806T184500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T180000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Robowar -URL:http://www.foobar.org/summer11/seminars/sessions#robosota -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110807T100000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T100000 -LOCATION:Loading entrances #1 and #2 -SUMMARY:Loading doors open -URL:http://www.foobar.org/summer11/come-to-party/leaving -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110807T161500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T161500 -LOCATION:All areas -SUMMARY:Lights go on -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110807T163000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T163000 -LOCATION:All areas -SUMMARY:Party network goes down -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110807T170000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T170000 -LOCATION:All areas -SUMMARY:Electricity is cut -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110807T161500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T161500 -LOCATION:foobarTV -SUMMARY:foobarTV broadcast ends -URL:http://www.foobartv.net -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110807T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T180000 -LOCATION:Loading entrances #1\, #2 and #3 -SUMMARY:Loading doors closed -URL:http://www.foobar.org/summer11/come-to-party/leaving -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110807T180000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110807T180000 -LOCATION:All areas -SUMMARY:foobar Summer 2011 is over - see you next year! -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110805T153000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T150000 -LOCATION:Outside main entrance -SUMMARY:RC helicopters: flying demonstration with T-REX 600N -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110805T173000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T170000 -LOCATION:Outside main entrance -SUMMARY:RC helicopters: flying demonstration with T-REX 600N -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110806T133000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T130000 -LOCATION:Outside main entrance -SUMMARY:RC helicopters: flying demonstration with T-REX 600N -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110806T163000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T160000 -LOCATION:Outside main entrance -SUMMARY:RC helicopters: flying demonstration with T-REX 600N -URL: -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110806T164500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T160000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars – All aboard to the Dark side of the Moon (Iron - Sky) -URL:http://www.foobar.org/summer11/seminars/sessions#ironsky -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110806T174500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T170000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars – Angry Birds on the web -URL:http://www.foobar.org/summer11/seminars/sessions#angrybirds -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110806T230000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T120000 -LOCATION:Pelitalo stand -SUMMARY:Pelitalo events begin -URL:http://pelitalo.nettiareena.fi/foobar/ohjelma/ -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Event -DTEND;VALUE=DATE:20110806T210000 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110806T200000 -LOCATION:Pelitalo stand -SUMMARY:Bomberman tournament -URL:http://pelitalo.nettiareena.fi/foobar/ohjelma/ -END:VEVENT -BEGIN:VEVENT -CATEGORIES:Seminar -DTEND;VALUE=DATE:20110805T134500 -DTSTAMP;VALUE=DATE:20120214T224612 -DTSTART;VALUE=DATE:20110805T130000 -LOCATION:Seminar area -SUMMARY:ARTtech seminars - Deconstructing a browserscene demo -URL:http://www.foobar.org/summer11/seminars/sessions#webgl2 -END:VEVENT -END:VCALENDAR diff --git a/modules/default/calendar/vendor/ical.js/test/test7.ics b/modules/default/calendar/vendor/ical.js/test/test7.ics deleted file mode 100644 index 4379cd0e..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test7.ics +++ /dev/null @@ -1,16 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:ownCloud Calendar 0.6.3 -X-WR-CALNAME:Fête Nationale - Férié -BEGIN:VEVENT -CREATED:20090502T140513Z -DTSTAMP:20111106T124709Z -UID:FA9831E7-C238-4FEC-95E5-CD46BD466421 -SUMMARY:Fête Nationale - Férié -RRULE:FREQ=YEARLY -DTSTART;VALUE=DATE:20120714 -DTEND;VALUE=DATE:20120715 -TRANSP:OPAQUE -SEQUENCE:5 -END:VEVENT -END:VCALENDAR diff --git a/modules/default/calendar/vendor/ical.js/test/test8.ics b/modules/default/calendar/vendor/ical.js/test/test8.ics deleted file mode 100644 index e7b2f50f..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test8.ics +++ /dev/null @@ -1,23 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:ownCloud Calendar 0.6.3 -X-WR-CALNAME:Default calendar -BEGIN:VTODO -CREATED;VALUE=DATE-TIME:20130714T092804Z -UID:0aa462f13c -LAST-MODIFIED;VALUE=DATE-TIME:20130714T092804Z -DTSTAMP;VALUE=DATE-TIME:20130714T092804Z -CATEGORIES:Projets -SUMMARY:Migrer le blog -PERCENT-COMPLETE:100 -COMPLETED;VALUE=DATE-TIME;TZID=Europe/Monaco:20130716T105745 -END:VTODO -BEGIN:VTODO -CREATED;VALUE=DATE-TIME:20130714T092912Z -UID:5e05bbcf34 -LAST-MODIFIED;VALUE=DATE-TIME:20130714T092912Z -DTSTAMP;VALUE=DATE-TIME:20130714T092912Z -SUMMARY:Créer test unitaire erreur ical -CATEGORIES:Projets -END:VTODO -END:VCALENDAR diff --git a/modules/default/calendar/vendor/ical.js/test/test9.ics b/modules/default/calendar/vendor/ical.js/test/test9.ics deleted file mode 100644 index 76a1d7b9..00000000 --- a/modules/default/calendar/vendor/ical.js/test/test9.ics +++ /dev/null @@ -1,21 +0,0 @@ -BEGIN:VCALENDAR -BEGIN:VEVENT -UID:eb9e1bd2-ceba-499f-be77-f02773954c72 -SUMMARY:Event with an alarm -DESCRIPTION:This is an event with an alarm. -ORGANIZER="mailto:stomlinson@mozilla.com" -DTSTART;TZID="America/Los_Angeles":20130418T110000 -DTEND;TZID="America/Los_Angeles":20130418T120000 -STATUS:CONFIRMED -CLASS:PUBLIC -TRANSP:OPAQUE -LAST-MODIFIED:20130418T175632Z -DTSTAMP:20130418T175632Z -SEQUENCE:3 -BEGIN:VALARM -ACTION:DISPLAY -TRIGGER;RELATED=START:-PT5M -DESCRIPTION:Reminder -END:VALARM -END:VEVENT -END:VCALENDAR diff --git a/modules/default/clock/README.md b/modules/default/clock/README.md index 34a1448d..30019e00 100644 --- a/modules/default/clock/README.md +++ b/modules/default/clock/README.md @@ -1,4 +1,5 @@ # Module: Clock + The `clock` module is one of the default modules of the MagicMirror. This module displays the current date and time. The information will be updated realtime. diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 1b9a2a12..1c7109b6 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -6,7 +6,7 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -Module.register("clock",{ +Module.register("clock", { // Module config defaults. defaults: { displayType: "digital", // options: digital, analog, both @@ -31,18 +31,18 @@ Module.register("clock",{ showSunTimes: false, showMoonTimes: false, lat: 47.630539, - lon: -122.344147, + lon: -122.344147 }, // Define required scripts. - getScripts: function() { + getScripts: function () { return ["moment.js", "moment-timezone.js", "suncalc.js"]; }, // Define styles. - getStyles: function() { + getStyles: function () { return ["clock_styles.css"]; }, // Define start sequence. - start: function() { + start: function () { Log.info("Starting module: " + this.name); // Schedule update interval. @@ -51,21 +51,23 @@ Module.register("clock",{ self.minute = moment().minute(); //Calculate how many ms should pass until next update depending on if seconds is displayed or not - var delayCalculator = function(reducedSeconds) { + var delayCalculator = function (reducedSeconds) { + var EXTRA_DELAY = 50; //Deliberate imperceptable delay to prevent off-by-one timekeeping errors + if (self.config.displaySeconds) { - return 1000 - moment().milliseconds(); + return 1000 - moment().milliseconds() + EXTRA_DELAY; } else { - return ((60 - reducedSeconds) * 1000) - moment().milliseconds(); + return (60 - reducedSeconds) * 1000 - moment().milliseconds() + EXTRA_DELAY; } }; //A recursive timeout function instead of interval to avoid drifting - var notificationTimer = function() { + var notificationTimer = function () { self.updateDom(); //If seconds is displayed CLOCK_SECOND-notification should be sent (but not when CLOCK_MINUTE-notification is sent) if (self.config.displaySeconds) { - self.second = (self.second + 1) % 60; + self.second = moment().second(); if (self.second !== 0) { self.sendNotification("CLOCK_SECOND", self.second); setTimeout(notificationTimer, delayCalculator(0)); @@ -74,7 +76,7 @@ Module.register("clock",{ } //If minute changed or seconds isn't displayed send CLOCK_MINUTE-notification - self.minute = (self.minute + 1) % 60; + self.minute = moment().minute(); self.sendNotification("CLOCK_MINUTE", self.minute); setTimeout(notificationTimer, delayCalculator(0)); }; @@ -84,11 +86,9 @@ Module.register("clock",{ // Set locale. moment.locale(config.language); - }, // Override dom generator. - getDom: function() { - + getDom: function () { var wrapper = document.createElement("div"); /************************************ @@ -127,12 +127,12 @@ Module.register("clock",{ } if (this.config.clockBold === true) { - timeString = now.format(hourSymbol + "[]mm[]"); + timeString = now.format(hourSymbol + '[]mm[]'); } else { timeString = now.format(hourSymbol + ":mm"); } - if(this.config.showDate){ + if (this.config.showDate) { dateWrapper.innerHTML = now.format(this.config.dateFormat); } if (this.config.showWeek) { @@ -152,6 +152,13 @@ Module.register("clock",{ timeWrapper.appendChild(periodWrapper); } + /** + * Format the time according to the config + * + * @param {object} config The config of the module + * @param {object} time time to format + * @returns {string} The formatted time string + */ function formatTime(config, time) { var formatString = hourSymbol + ":mm"; if (config.showPeriod && config.timeFormat !== 24) { @@ -159,6 +166,7 @@ Module.register("clock",{ } return moment(time).format(formatString); } + if (this.config.showSunTimes) { const sunTimes = SunCalc.getTimes(now, this.config.lat, this.config.lon); const isVisible = now.isBetween(sunTimes.sunrise, sunTimes.sunset); @@ -173,9 +181,18 @@ Module.register("clock",{ } const untilNextEvent = moment.duration(moment(nextEvent).diff(now)); const untilNextEventString = untilNextEvent.hours() + "h " + untilNextEvent.minutes() + "m"; - sunWrapper.innerHTML = " " + untilNextEventString + "" + - "" + formatTime(this.config, sunTimes.sunrise) + "" + - "" + formatTime(this.config, sunTimes.sunset) + ""; + sunWrapper.innerHTML = + ' ' + + untilNextEventString + + "" + + '' + + formatTime(this.config, sunTimes.sunrise) + + "" + + '' + + formatTime(this.config, sunTimes.sunset) + + ""; } if (this.config.showMoonTimes) { const moonIllumination = SunCalc.getMoonIllumination(now.toDate()); @@ -190,9 +207,18 @@ Module.register("clock",{ } const isVisible = now.isBetween(moonRise, moonSet) || moonTimes.alwaysUp === true; const illuminatedFractionString = Math.round(moonIllumination.fraction * 100) + "%"; - moonWrapper.innerHTML = " " + illuminatedFractionString + "" + - " " + (moonRise ? formatTime(this.config, moonRise) : "...") + ""+ - " " + (moonSet ? formatTime(this.config, moonSet) : "...") + ""; + moonWrapper.innerHTML = + ' ' + + illuminatedFractionString + + "" + + ' ' + + (moonRise ? formatTime(this.config, moonRise) : "...") + + "" + + ' ' + + (moonSet ? formatTime(this.config, moonSet) : "...") + + ""; } /**************************************************************** @@ -206,7 +232,7 @@ Module.register("clock",{ if (this.config.timezone) { now.tz(this.config.timezone); } - var second = now.seconds() * 6, + var second = now.seconds() * 6, minute = now.minute() * 6 + second / 60, hour = ((now.hours() % 12) / 12) * 360 + 90 + minute / 12; @@ -217,13 +243,12 @@ Module.register("clock",{ clockCircle.style.height = this.config.analogSize; if (this.config.analogFace !== "" && this.config.analogFace !== "simple" && this.config.analogFace !== "none") { - clockCircle.style.background = "url("+ this.data.path + "faces/" + this.config.analogFace + ".svg)"; + clockCircle.style.background = "url(" + this.data.path + "faces/" + this.config.analogFace + ".svg)"; clockCircle.style.backgroundSize = "100%"; // The following line solves issue: https://github.com/MichMich/MagicMirror/issues/611 // clockCircle.style.border = "1px solid black"; clockCircle.style.border = "rgba(0, 0, 0, 0.1)"; //Updated fix for Issue 611 where non-black backgrounds are used - } else if (this.config.analogFace !== "none") { clockCircle.style.border = "2px solid white"; } @@ -303,9 +328,9 @@ Module.register("clock",{ digitalWrapper.appendChild(moonWrapper); digitalWrapper.appendChild(weekWrapper); - var appendClocks = function(condition, pos1, pos2) { - var padding = [0,0,0,0]; - padding[(placement === condition) ? pos1 : pos2] = "20px"; + var appendClocks = function (condition, pos1, pos2) { + var padding = [0, 0, 0, 0]; + padding[placement === condition ? pos1 : pos2] = "20px"; analogWrapper.style.padding = padding.join(" "); if (placement === condition) { wrapper.appendChild(analogWrapper); diff --git a/modules/default/clock/clock_styles.css b/modules/default/clock/clock_styles.css index a7a582c9..839336be 100644 --- a/modules/default/clock/clock_styles.css +++ b/modules/default/clock/clock_styles.css @@ -1,72 +1,72 @@ -.clockCircle { - margin: 0 auto; - position: relative; - border-radius: 50%; - background-size: 100%; -} - -.clockFace { - width: 100%; - height: 100%; -} - -.clockFace::after { - position: absolute; - top: 50%; - left: 50%; - width: 6px; - height: 6px; - margin: -3px 0 0 -3px; - background: white; - border-radius: 3px; - content: ""; - display: block; -} - -.clockHour { - width: 0; - height: 0; - position: absolute; - top: 50%; - left: 50%; - margin: -2px 0 -2px -25%; /* numbers much match negative length & thickness */ - padding: 2px 0 2px 25%; /* indicator length & thickness */ - background: white; - transform-origin: 100% 50%; - border-radius: 3px 0 0 3px; -} - -.clockMinute { - width: 0; - height: 0; - position: absolute; - top: 50%; - left: 50%; - margin: -35% -2px 0; /* numbers must match negative length & thickness */ - padding: 35% 2px 0; /* indicator length & thickness */ - background: white; - transform-origin: 50% 100%; - border-radius: 3px 0 0 3px; -} - -.clockSecond { - width: 0; - height: 0; - position: absolute; - top: 50%; - left: 50%; - margin: -38% -1px 0 0; /* numbers must match negative length & thickness */ - padding: 38% 1px 0 0; /* indicator length & thickness */ - background: #888; - transform-origin: 50% 100%; -} - -.module.clock .sun, -.module.clock .moon { - display: flex; -} - -.module.clock .sun > *, -.module.clock .moon > * { - flex: 1; -} +.clockCircle { + margin: 0 auto; + position: relative; + border-radius: 50%; + background-size: 100%; +} + +.clockFace { + width: 100%; + height: 100%; +} + +.clockFace::after { + position: absolute; + top: 50%; + left: 50%; + width: 6px; + height: 6px; + margin: -3px 0 0 -3px; + background: white; + border-radius: 3px; + content: ""; + display: block; +} + +.clockHour { + width: 0; + height: 0; + position: absolute; + top: 50%; + left: 50%; + margin: -2px 0 -2px -25%; /* numbers much match negative length & thickness */ + padding: 2px 0 2px 25%; /* indicator length & thickness */ + background: white; + transform-origin: 100% 50%; + border-radius: 3px 0 0 3px; +} + +.clockMinute { + width: 0; + height: 0; + position: absolute; + top: 50%; + left: 50%; + margin: -35% -2px 0; /* numbers must match negative length & thickness */ + padding: 35% 2px 0; /* indicator length & thickness */ + background: white; + transform-origin: 50% 100%; + border-radius: 3px 0 0 3px; +} + +.clockSecond { + width: 0; + height: 0; + position: absolute; + top: 50%; + left: 50%; + margin: -38% -1px 0 0; /* numbers must match negative length & thickness */ + padding: 38% 1px 0 0; /* indicator length & thickness */ + background: #888; + transform-origin: 50% 100%; +} + +.module.clock .sun, +.module.clock .moon { + display: flex; +} + +.module.clock .sun > *, +.module.clock .moon > * { + flex: 1; +} diff --git a/modules/default/clock/faces/face-001.svg b/modules/default/clock/faces/face-001.svg index 13436c76..abd08ce7 100644 --- a/modules/default/clock/faces/face-001.svg +++ b/modules/default/clock/faces/face-001.svg @@ -1 +1 @@ -face-001 +face-001 diff --git a/modules/default/clock/faces/face-002.svg b/modules/default/clock/faces/face-002.svg index a3ee3682..1ec31049 100644 --- a/modules/default/clock/faces/face-002.svg +++ b/modules/default/clock/faces/face-002.svg @@ -1 +1 @@ -face-002 +face-002 diff --git a/modules/default/clock/faces/face-003.svg b/modules/default/clock/faces/face-003.svg index d3fc32de..7cfeebac 100644 --- a/modules/default/clock/faces/face-003.svg +++ b/modules/default/clock/faces/face-003.svg @@ -1 +1 @@ -face-003 +face-003 diff --git a/modules/default/clock/faces/face-004.svg b/modules/default/clock/faces/face-004.svg index 140955d7..bc97588c 100644 --- a/modules/default/clock/faces/face-004.svg +++ b/modules/default/clock/faces/face-004.svg @@ -1 +1 @@ -face-004 +face-004 diff --git a/modules/default/clock/faces/face-005.svg b/modules/default/clock/faces/face-005.svg index fb52a435..0bc1b430 100644 --- a/modules/default/clock/faces/face-005.svg +++ b/modules/default/clock/faces/face-005.svg @@ -1 +1 @@ -faces +faces diff --git a/modules/default/clock/faces/face-006.svg b/modules/default/clock/faces/face-006.svg index a9eff826..63d1c935 100644 --- a/modules/default/clock/faces/face-006.svg +++ b/modules/default/clock/faces/face-006.svg @@ -1 +1 @@ -face-006 +face-006 diff --git a/modules/default/clock/faces/face-007.svg b/modules/default/clock/faces/face-007.svg index b0dde834..e557f55f 100644 --- a/modules/default/clock/faces/face-007.svg +++ b/modules/default/clock/faces/face-007.svg @@ -1 +1 @@ -face-007 +face-007 diff --git a/modules/default/clock/faces/face-008.svg b/modules/default/clock/faces/face-008.svg index 551ea7df..6fadb396 100644 --- a/modules/default/clock/faces/face-008.svg +++ b/modules/default/clock/faces/face-008.svg @@ -1 +1 @@ -face-008 +face-008 diff --git a/modules/default/clock/faces/face-009.svg b/modules/default/clock/faces/face-009.svg index cd3720f2..bd207e09 100644 --- a/modules/default/clock/faces/face-009.svg +++ b/modules/default/clock/faces/face-009.svg @@ -1 +1 @@ -face-009 +face-009 diff --git a/modules/default/clock/faces/face-010.svg b/modules/default/clock/faces/face-010.svg index d0af3acb..8c5e5848 100644 --- a/modules/default/clock/faces/face-010.svg +++ b/modules/default/clock/faces/face-010.svg @@ -1 +1 @@ -face-010 +face-010 diff --git a/modules/default/clock/faces/face-011.svg b/modules/default/clock/faces/face-011.svg index 2d5f27ba..9886fed5 100644 --- a/modules/default/clock/faces/face-011.svg +++ b/modules/default/clock/faces/face-011.svg @@ -1 +1 @@ -face-011 +face-011 diff --git a/modules/default/clock/faces/face-012.svg b/modules/default/clock/faces/face-012.svg index 8096d492..cfd80698 100644 --- a/modules/default/clock/faces/face-012.svg +++ b/modules/default/clock/faces/face-012.svg @@ -1 +1 @@ -face-012 +face-012 diff --git a/modules/default/compliments/README.md b/modules/default/compliments/README.md index c746f318..e1360f2e 100644 --- a/modules/default/compliments/README.md +++ b/modules/default/compliments/README.md @@ -1,4 +1,5 @@ # Module: Compliments + The `compliments` module is one of the default modules of the MagicMirror. This module displays a random compliment. diff --git a/modules/default/compliments/compliments.js b/modules/default/compliments/compliments.js index ff245eef..412fe170 100644 --- a/modules/default/compliments/compliments.js +++ b/modules/default/compliments/compliments.js @@ -5,31 +5,14 @@ * MIT Licensed. */ Module.register("compliments", { - // Module config defaults. defaults: { compliments: { - anytime: [ - "Hey there sexy!" - ], - morning: [ - "Good morning, handsome!", - "Enjoy your day!", - "How was your sleep?" - ], - afternoon: [ - "Hello, beauty!", - "You look sexy!", - "Looking good today!" - ], - evening: [ - "Wow, you look hot!", - "You look nice!", - "Hi, sexy!" - ], - "....-01-01": [ - "Happy new year!" - ] + anytime: ["Hey there sexy!"], + morning: ["Good morning, handsome!", "Enjoy your day!", "How was your sleep?"], + afternoon: ["Hello, beauty!", "You look sexy!", "Looking good today!"], + evening: ["Wow, you look hot!", "You look nice!", "Hi, sexy!"], + "....-01-01": ["Happy new year!"] }, updateInterval: 30000, remoteFile: null, @@ -41,31 +24,31 @@ Module.register("compliments", { random: true, mockDate: null }, - lastIndexUsed:-1, + lastIndexUsed: -1, // Set currentweather from module currentWeatherType: "", // Define required scripts. - getScripts: function() { + getScripts: function () { return ["moment.js"]; }, // Define start sequence. - start: function() { + start: function () { Log.info("Starting module: " + this.name); this.lastComplimentIndex = -1; var self = this; if (this.config.remoteFile !== null) { - this.complimentFile(function(response) { + this.complimentFile(function (response) { self.config.compliments = JSON.parse(response); self.updateDom(); }); } // Schedule update timer. - setInterval(function() { + setInterval(function () { self.updateDom(self.config.fadeSpeed); }, this.config.updateInterval); }, @@ -77,12 +60,12 @@ Module.register("compliments", { * * return Number - Random index. */ - randomIndex: function(compliments) { + randomIndex: function (compliments) { if (compliments.length === 1) { return 0; } - var generate = function() { + var generate = function () { return Math.floor(Math.random() * compliments.length); }; @@ -102,7 +85,7 @@ Module.register("compliments", { * * return compliments Array - Array with compliments for the time of the day. */ - complimentArray: function() { + complimentArray: function () { var hour = moment().hour(); var date = this.config.mockDate ? this.config.mockDate : moment().format("YYYY-MM-DD"); var compliments; @@ -111,7 +94,7 @@ Module.register("compliments", { compliments = this.config.compliments.morning.slice(0); } else if (hour >= this.config.afternoonStartTime && hour < this.config.afternoonEndTime && this.config.compliments.hasOwnProperty("afternoon")) { compliments = this.config.compliments.afternoon.slice(0); - } else if(this.config.compliments.hasOwnProperty("evening")) { + } else if (this.config.compliments.hasOwnProperty("evening")) { compliments = this.config.compliments.evening.slice(0); } @@ -137,13 +120,13 @@ Module.register("compliments", { /* complimentFile(callback) * Retrieve a file from the local filesystem */ - complimentFile: function(callback) { + complimentFile: function (callback) { var xobj = new XMLHttpRequest(), isRemote = this.config.remoteFile.indexOf("http://") === 0 || this.config.remoteFile.indexOf("https://") === 0, path = isRemote ? this.config.remoteFile : this.file(this.config.remoteFile); xobj.overrideMimeType("application/json"); xobj.open("GET", path, true); - xobj.onreadystatechange = function() { + xobj.onreadystatechange = function () { if (xobj.readyState === 4 && xobj.status === 200) { callback(xobj.responseText); } @@ -156,27 +139,26 @@ Module.register("compliments", { * * return compliment string - A compliment. */ - randomCompliment: function() { + randomCompliment: function () { // get the current time of day compliments list var compliments = this.complimentArray(); // variable for index to next message to display let index = 0; // are we randomizing - if(this.config.random){ + if (this.config.random) { // yes index = this.randomIndex(compliments); - } - else{ + } else { // no, sequential // if doing sequential, don't fall off the end - index = (this.lastIndexUsed >= (compliments.length-1))?0: ++this.lastIndexUsed; + index = this.lastIndexUsed >= compliments.length - 1 ? 0 : ++this.lastIndexUsed; } return compliments[index] || ""; }, // Override dom generator. - getDom: function() { + getDom: function () { var wrapper = document.createElement("div"); wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright pre-line"; // get the compliment text @@ -186,7 +168,7 @@ Module.register("compliments", { // create a span to hold it all var compliment = document.createElement("span"); // process all the parts of the compliment text - for (var part of parts){ + for (var part of parts) { // create a text element for each part compliment.appendChild(document.createTextNode(part)); // add a break ` @@ -200,7 +182,7 @@ Module.register("compliments", { }, // From data currentweather set weather type - setCurrentWeatherType: function(data) { + setCurrentWeatherType: function (data) { var weatherIconTable = { "01d": "day_sunny", "02d": "day_cloudy", @@ -225,10 +207,9 @@ Module.register("compliments", { }, // Override notification handler. - notificationReceived: function(notification, payload, sender) { + notificationReceived: function (notification, payload, sender) { if (notification === "CURRENTWEATHER_DATA") { this.setCurrentWeatherType(payload.data); } - }, - + } }); diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index 27b047da..d4db59ea 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -1,4 +1,5 @@ # Module: Current Weather + The `currentweather` module is one of the default modules of the MagicMirror. This module displays the current weather, including the windspeed, the sunset or sunrise time, the temperature and an icon to display the current conditions. diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index d24a92b4..0a43b23e 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -4,8 +4,7 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -Module.register("currentweather",{ - +Module.register("currentweather", { // Default module config. defaults: { location: false, @@ -24,6 +23,7 @@ Module.register("currentweather",{ lang: config.language, decimalSymbol: ".", showHumidity: false, + showSun: true, degreeLabel: false, showIndoorTemperature: false, showIndoorHumidity: false, @@ -37,6 +37,8 @@ Module.register("currentweather",{ weatherEndpoint: "weather", appendLocationNameToHeader: true, + useLocationAsHeader: false, + calendarClass: "calendar", tableClass: "large", @@ -63,7 +65,7 @@ Module.register("currentweather",{ "11n": "wi-night-thunderstorm", "13n": "wi-night-snow", "50n": "wi-night-alt-cloudy-windy" - }, + } }, // create a variable for the first upcoming calendar event. Used if no location is specified. @@ -73,17 +75,17 @@ Module.register("currentweather",{ fetchedLocationName: "", // Define required scripts. - getScripts: function() { + getScripts: function () { return ["moment.js"]; }, // Define required scripts. - getStyles: function() { + getStyles: function () { return ["weather-icons.css", "currentweather.css"]; }, // Define required translations. - getTranslations: function() { + getTranslations: function () { // The translations for the default modules are defined in the core translation files. // Therefor we can just return false. Otherwise we should have returned a dictionary. // If you're trying to build your own module including translations, check out the documentation. @@ -91,7 +93,7 @@ Module.register("currentweather",{ }, // Define start sequence. - start: function() { + start: function () { Log.info("Starting module: " + this.name); // Set locale. @@ -109,13 +111,11 @@ Module.register("currentweather",{ this.feelsLike = null; this.loaded = false; this.scheduleUpdate(this.config.initialLoadDelay); - }, // add extra information of current weather // windDirection, humidity, sunrise and sunset - addExtraInfoWeather: function(wrapper) { - + addExtraInfoWeather: function (wrapper) { var small = document.createElement("div"); small.className = "normal medium"; @@ -130,8 +130,8 @@ Module.register("currentweather",{ if (this.config.showWindDirection) { var windDirection = document.createElement("sup"); if (this.config.showWindDirectionAsArrow) { - if(this.windDeg !== null) { - windDirection.innerHTML = "   "; + if (this.windDeg !== null) { + windDirection.innerHTML = '   '; } } else { windDirection.innerHTML = " " + this.translate(this.windDirection); @@ -158,19 +158,21 @@ Module.register("currentweather",{ small.appendChild(humidityIcon); } - var sunriseSunsetIcon = document.createElement("span"); - sunriseSunsetIcon.className = "wi dimmed " + this.sunriseSunsetIcon; - small.appendChild(sunriseSunsetIcon); + if (this.config.showSun) { + var sunriseSunsetIcon = document.createElement("span"); + sunriseSunsetIcon.className = "wi dimmed " + this.sunriseSunsetIcon; + small.appendChild(sunriseSunsetIcon); - var sunriseSunsetTime = document.createElement("span"); - sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime; - small.appendChild(sunriseSunsetTime); + var sunriseSunsetTime = document.createElement("span"); + sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime; + small.appendChild(sunriseSunsetTime); + } wrapper.appendChild(small); }, // Override dom generator. - getDom: function() { + getDom: function () { var wrapper = document.createElement("div"); wrapper.className = this.config.tableClass; @@ -197,17 +199,17 @@ Module.register("currentweather",{ if (this.config.units === "metric" || this.config.units === "imperial") { degreeLabel += "°"; } - if(this.config.degreeLabel) { - switch(this.config.units) { - case "metric": - degreeLabel += "C"; - break; - case "imperial": - degreeLabel += "F"; - break; - case "default": - degreeLabel += "K"; - break; + if (this.config.degreeLabel) { + switch (this.config.units) { + case "metric": + degreeLabel += "C"; + break; + case "imperial": + degreeLabel += "F"; + break; + case "default": + degreeLabel += "K"; + break; } } @@ -250,7 +252,7 @@ Module.register("currentweather",{ wrapper.appendChild(large); - if (this.config.showFeelsLike && this.config.onlyTemp === false){ + if (this.config.showFeelsLike && this.config.onlyTemp === false) { var small = document.createElement("div"); small.className = "normal medium"; @@ -266,23 +268,24 @@ Module.register("currentweather",{ }, // Override getHeader method. - getHeader: function() { - if (this.config.appendLocationNameToHeader && this.data.header !== undefined) { - return this.data.header + " " + this.fetchedLocationName; - } - + getHeader: function () { if (this.config.useLocationAsHeader && this.config.location !== false) { return this.config.location; } - return this.data.header; + if (this.config.appendLocationNameToHeader) { + if (this.data.header) return this.data.header + " " + this.fetchedLocationName; + else return this.fetchedLocationName; + } + + return this.data.header ? this.data.header : ""; }, // Override notification handler. - notificationReceived: function(notification, payload, sender) { + notificationReceived: function (notification, payload, sender) { if (notification === "DOM_OBJECTS_CREATED") { if (this.config.appendLocationNameToHeader) { - this.hide(0, {lockString: this.identifier}); + this.hide(0, { lockString: this.identifier }); } } if (notification === "CALENDAR_EVENTS") { @@ -314,7 +317,7 @@ Module.register("currentweather",{ * Requests new data from openweather.org. * Calls processWeather on succesfull response. */ - updateWeather: function() { + updateWeather: function () { if (this.config.appid === "") { Log.error("CurrentWeather: APPID not set!"); return; @@ -326,7 +329,7 @@ Module.register("currentweather",{ var weatherRequest = new XMLHttpRequest(); weatherRequest.open("GET", url, true); - weatherRequest.onreadystatechange = function() { + weatherRequest.onreadystatechange = function () { if (this.readyState === 4) { if (this.status === 200) { self.processWeather(JSON.parse(this.response)); @@ -340,7 +343,7 @@ Module.register("currentweather",{ } if (retry) { - self.scheduleUpdate((self.loaded) ? -1 : self.config.retryDelay); + self.scheduleUpdate(self.loaded ? -1 : self.config.retryDelay); } } }; @@ -352,18 +355,18 @@ Module.register("currentweather",{ * * return String - URL params. */ - getParams: function() { + getParams: function () { var params = "?"; - if(this.config.locationID) { + if (this.config.locationID) { params += "id=" + this.config.locationID; - } else if(this.config.location) { + } else if (this.config.location) { params += "q=" + this.config.location; } else if (this.firstEvent && this.firstEvent.geo) { params += "lat=" + this.firstEvent.geo.lat + "&lon=" + this.firstEvent.geo.lon; } else if (this.firstEvent && this.firstEvent.location) { params += "q=" + this.firstEvent.location; } else { - this.hide(this.config.animationSpeed, {lockString:this.identifier}); + this.hide(this.config.animationSpeed, { lockString: this.identifier }); return; } @@ -379,8 +382,7 @@ Module.register("currentweather",{ * * argument data object - Weather information received form openweather.org. */ - processWeather: function(data) { - + processWeather: function (data) { if (!data || !data.main || typeof data.main.temp === "undefined") { // Did not receive usable new data. // Maybe this needs a better check? @@ -392,7 +394,7 @@ Module.register("currentweather",{ this.fetchedLocationName = data.name; this.feelsLike = 0; - if (this.config.useBeaufort){ + if (this.config.useBeaufort) { this.windSpeed = this.ms2Beaufort(this.roundValue(data.wind.speed)); } else if (this.config.useKMPHwind) { this.windSpeed = parseFloat((data.wind.speed * 60 * 60) / 1000).toFixed(0); @@ -404,50 +406,59 @@ Module.register("currentweather",{ var windInMph = parseFloat(data.wind.speed * 2.23694); var tempInF = 0; - switch (this.config.units){ - case "metric": tempInF = 1.8 * this.temperature + 32; - break; - case "imperial": tempInF = this.temperature; - break; - case "default": - tempInF = 1.8 * (this.temperature - 273.15) + 32; - break; + switch (this.config.units) { + case "metric": + tempInF = 1.8 * this.temperature + 32; + break; + case "imperial": + tempInF = this.temperature; + break; + case "default": + tempInF = 1.8 * (this.temperature - 273.15) + 32; + break; } - if (windInMph > 3 && tempInF < 50){ + if (windInMph > 3 && tempInF < 50) { // windchill - var windChillInF = Math.round(35.74+0.6215*tempInF-35.75*Math.pow(windInMph,0.16)+0.4275*tempInF*Math.pow(windInMph,0.16)); - var windChillInC = (windChillInF - 32) * (5/9); + var windChillInF = Math.round(35.74 + 0.6215 * tempInF - 35.75 * Math.pow(windInMph, 0.16) + 0.4275 * tempInF * Math.pow(windInMph, 0.16)); + var windChillInC = (windChillInF - 32) * (5 / 9); // this.feelsLike = windChillInC.toFixed(0); - switch (this.config.units){ - case "metric": this.feelsLike = windChillInC.toFixed(0); - break; - case "imperial": this.feelsLike = windChillInF.toFixed(0); - break; - case "default": - this.feelsLike = (windChillInC + 273.15).toFixed(0); - break; + switch (this.config.units) { + case "metric": + this.feelsLike = windChillInC.toFixed(0); + break; + case "imperial": + this.feelsLike = windChillInF.toFixed(0); + break; + case "default": + this.feelsLike = (windChillInC + 273.15).toFixed(0); + break; } - - } else if (tempInF > 80 && this.humidity > 40){ + } else if (tempInF > 80 && this.humidity > 40) { // heat index - var Hindex = -42.379 + 2.04901523*tempInF + 10.14333127*this.humidity - - 0.22475541*tempInF*this.humidity - 6.83783*Math.pow(10,-3)*tempInF*tempInF - - 5.481717*Math.pow(10,-2)*this.humidity*this.humidity - + 1.22874*Math.pow(10,-3)*tempInF*tempInF*this.humidity - + 8.5282*Math.pow(10,-4)*tempInF*this.humidity*this.humidity - - 1.99*Math.pow(10,-6)*tempInF*tempInF*this.humidity*this.humidity; + var Hindex = + -42.379 + + 2.04901523 * tempInF + + 10.14333127 * this.humidity - + 0.22475541 * tempInF * this.humidity - + 6.83783 * Math.pow(10, -3) * tempInF * tempInF - + 5.481717 * Math.pow(10, -2) * this.humidity * this.humidity + + 1.22874 * Math.pow(10, -3) * tempInF * tempInF * this.humidity + + 8.5282 * Math.pow(10, -4) * tempInF * this.humidity * this.humidity - + 1.99 * Math.pow(10, -6) * tempInF * tempInF * this.humidity * this.humidity; - switch (this.config.units){ - case "metric": this.feelsLike = parseFloat((Hindex - 32) / 1.8).toFixed(0); - break; - case "imperial": this.feelsLike = Hindex.toFixed(0); - break; - case "default": - var tc = parseFloat((Hindex - 32) / 1.8) + 273.15; - this.feelsLike = tc.toFixed(0); - break; + switch (this.config.units) { + case "metric": + this.feelsLike = parseFloat((Hindex - 32) / 1.8).toFixed(0); + break; + case "imperial": + this.feelsLike = Hindex.toFixed(0); + break; + case "default": + var tc = parseFloat((Hindex - 32) / 1.8) + 273.15; + this.feelsLike = tc.toFixed(0); + break; } } else { this.feelsLike = parseFloat(this.temperature).toFixed(0); @@ -464,7 +475,7 @@ Module.register("currentweather",{ // The moment().format('h') method has a bug on the Raspberry Pi. // So we need to generate the timestring manually. // See issue: https://github.com/MichMich/MagicMirror/issues/181 - var sunriseSunsetDateObject = (sunrise < now && sunset > now) ? sunset : sunrise; + var sunriseSunsetDateObject = sunrise < now && sunset > now ? sunset : sunrise; var timeString = moment(sunriseSunsetDateObject).format("HH:mm"); if (this.config.timeFormat !== 24) { //var hours = sunriseSunsetDateObject.getHours() % 12 || 12; @@ -483,12 +494,12 @@ Module.register("currentweather",{ } this.sunriseSunsetTime = timeString; - this.sunriseSunsetIcon = (sunrise < now && sunset > now) ? "wi-sunset" : "wi-sunrise"; + this.sunriseSunsetIcon = sunrise < now && sunset > now ? "wi-sunset" : "wi-sunrise"; - this.show(this.config.animationSpeed, {lockString:this.identifier}); + this.show(this.config.animationSpeed, { lockString: this.identifier }); this.loaded = true; this.updateDom(this.config.animationSpeed); - this.sendNotification("CURRENTWEATHER_DATA", {data: data}); + this.sendNotification("CURRENTWEATHER_DATA", { data: data }); }, /* scheduleUpdate() @@ -496,14 +507,14 @@ Module.register("currentweather",{ * * argument delay number - Milliseconds before next update. If empty, this.config.updateInterval is used. */ - scheduleUpdate: function(delay) { + scheduleUpdate: function (delay) { var nextLoad = this.config.updateInterval; if (typeof delay !== "undefined" && delay >= 0) { nextLoad = delay; } var self = this; - setTimeout(function() { + setTimeout(function () { self.updateWeather(); }, nextLoad); }, @@ -519,8 +530,8 @@ Module.register("currentweather",{ * * return number - Windspeed in beaufort. */ - ms2Beaufort: function(ms) { - var kmh = ms * 60 * 60 / 1000; + ms2Beaufort: function (ms) { + var kmh = (ms * 60 * 60) / 1000; var speeds = [1, 5, 11, 19, 28, 38, 49, 61, 74, 88, 102, 117, 1000]; for (var beaufort in speeds) { var speed = speeds[beaufort]; @@ -531,8 +542,8 @@ Module.register("currentweather",{ return 12; }, - deg2Cardinal: function(deg) { - if (deg>11.25 && deg<=33.75){ + deg2Cardinal: function (deg) { + if (deg > 11.25 && deg <= 33.75) { return "NNE"; } else if (deg > 33.75 && deg <= 56.25) { return "NE"; @@ -574,9 +585,8 @@ Module.register("currentweather",{ * * return string - Rounded Temperature. */ - roundValue: function(temperature) { + roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; return parseFloat(temperature).toFixed(decimals); } - }); diff --git a/modules/default/defaultmodules.js b/modules/default/defaultmodules.js index d792ae09..9bdcbe95 100644 --- a/modules/default/defaultmodules.js +++ b/modules/default/defaultmodules.js @@ -7,18 +7,9 @@ // Modules listed below can be loaded without the 'default/' prefix. Omitting the default folder name. -var defaultModules = [ - "alert", - "calendar", - "clock", - "compliments", - "currentweather", - "helloworld", - "newsfeed", - "weatherforecast", - "updatenotification", - "weather" -]; +var defaultModules = ["alert", "calendar", "clock", "compliments", "currentweather", "helloworld", "newsfeed", "weatherforecast", "updatenotification", "weather"]; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = defaultModules;} +if (typeof module !== "undefined") { + module.exports = defaultModules; +} diff --git a/modules/default/helloworld/README.md b/modules/default/helloworld/README.md index 8ad06f77..5d5d3a17 100644 --- a/modules/default/helloworld/README.md +++ b/modules/default/helloworld/README.md @@ -1,4 +1,5 @@ # Module: Hello World + The `helloworld` module is one of the default modules of the MagicMirror. It is a simple way to display a static text on the mirror. For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/helloworld.html). diff --git a/modules/default/helloworld/helloworld.js b/modules/default/helloworld/helloworld.js index 72474577..68eb22fc 100644 --- a/modules/default/helloworld/helloworld.js +++ b/modules/default/helloworld/helloworld.js @@ -4,8 +4,7 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -Module.register("helloworld",{ - +Module.register("helloworld", { // Default module config. defaults: { text: "Hello World!" diff --git a/modules/default/newsfeed/README.md b/modules/default/newsfeed/README.md index 33690aa6..484fedba 100644 --- a/modules/default/newsfeed/README.md +++ b/modules/default/newsfeed/README.md @@ -1,5 +1,6 @@ # Module: News Feed -The `newsfeed ` module is one of the default modules of the MagicMirror. -This module displays news headlines based on an RSS feed. Scrolling through news headlines happens time-based (````updateInterval````), but can also be controlled by sending news feed specific notifications to the module. + +The `newsfeed` module is one of the default modules of the MagicMirror. +This module displays news headlines based on an RSS feed. Scrolling through news headlines happens time-based (`updateInterval`), but can also be controlled by sending news feed specific notifications to the module. For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/newsfeed.html). diff --git a/modules/default/newsfeed/fetcher.js b/modules/default/newsfeed/fetcher.js deleted file mode 100644 index e74ac114..00000000 --- a/modules/default/newsfeed/fetcher.js +++ /dev/null @@ -1,159 +0,0 @@ -/* Magic Mirror - * Fetcher - * - * By Michael Teeuw https://michaelteeuw.nl - * MIT Licensed. - */ - -var FeedMe = require("feedme"); -var request = require("request"); -var iconv = require("iconv-lite"); - -/* Fetcher - * Responsible for requesting an update on the set interval and broadcasting the data. - * - * attribute url string - URL of the news feed. - * attribute reloadInterval number - Reload interval in milliseconds. - * attribute logFeedWarnings boolean - Log warnings when there is an error parsing a news article. - */ - -var Fetcher = function(url, reloadInterval, encoding, logFeedWarnings) { - var self = this; - if (reloadInterval < 1000) { - reloadInterval = 1000; - } - - var reloadTimer = null; - var items = []; - - var fetchFailedCallback = function() {}; - var itemsReceivedCallback = function() {}; - - /* private methods */ - - /* fetchNews() - * Request the new items. - */ - - var fetchNews = function() { - clearTimeout(reloadTimer); - reloadTimer = null; - items = []; - - var parser = new FeedMe(); - - parser.on("item", function(item) { - - var title = item.title; - var description = item.description || item.summary || item.content || ""; - var pubdate = item.pubdate || item.published || item.updated || item["dc:date"]; - var url = item.url || item.link || ""; - - if (title && pubdate) { - - var regex = /(<([^>]+)>)/ig; - description = description.toString().replace(regex, ""); - - items.push({ - title: title, - description: description, - pubdate: pubdate, - url: url, - }); - - } else if (logFeedWarnings) { - console.log("Can't parse feed item:"); - console.log(item); - console.log("Title: " + title); - console.log("Description: " + description); - console.log("Pubdate: " + pubdate); - } - }); - - parser.on("end", function() { - //console.log("end parsing - " + url); - self.broadcastItems(); - scheduleTimer(); - }); - - parser.on("error", function(error) { - fetchFailedCallback(self, error); - scheduleTimer(); - }); - - var nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]); - var headers = {"User-Agent": "Mozilla/5.0 (Node.js "+ nodeVersion + ") MagicMirror/" + global.version + " (https://github.com/MichMich/MagicMirror/)", - "Cache-Control": "max-age=0, no-cache, no-store, must-revalidate", - "Pragma": "no-cache"}; - - request({uri: url, encoding: null, headers: headers}) - .on("error", function(error) { - fetchFailedCallback(self, error); - scheduleTimer(); - }) - .pipe(iconv.decodeStream(encoding)).pipe(parser); - - }; - - /* scheduleTimer() - * Schedule the timer for the next update. - */ - - var scheduleTimer = function() { - //console.log('Schedule update timer.'); - clearTimeout(reloadTimer); - reloadTimer = setTimeout(function() { - fetchNews(); - }, reloadInterval); - }; - - /* public methods */ - - /* setReloadInterval() - * Update the reload interval, but only if we need to increase the speed. - * - * attribute interval number - Interval for the update in milliseconds. - */ - this.setReloadInterval = function(interval) { - if (interval > 1000 && interval < reloadInterval) { - reloadInterval = interval; - } - }; - - /* startFetch() - * Initiate fetchNews(); - */ - this.startFetch = function() { - fetchNews(); - }; - - /* broadcastItems() - * Broadcast the existing items. - */ - this.broadcastItems = function() { - if (items.length <= 0) { - //console.log('No items to broadcast yet.'); - return; - } - //console.log('Broadcasting ' + items.length + ' items.'); - itemsReceivedCallback(self); - }; - - this.onReceive = function(callback) { - itemsReceivedCallback = callback; - }; - - this.onError = function(callback) { - fetchFailedCallback = callback; - }; - - this.url = function() { - return url; - }; - - this.items = function() { - return items; - }; -}; - -module.exports = Fetcher; diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index edbac68d..2ff02888 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -4,8 +4,7 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -Module.register("newsfeed",{ - +Module.register("newsfeed", { // Default module config. defaults: { feeds: [ @@ -41,12 +40,12 @@ Module.register("newsfeed",{ }, // Define required scripts. - getScripts: function() { + getScripts: function () { return ["moment.js"]; }, // Define required translations. - getTranslations: function() { + getTranslations: function () { // The translations for the default modules are defined in the core translation files. // Therefor we can just return false. Otherwise we should have returned a dictionary. // If you're trying to build your own module including translations, check out the documentation. @@ -54,7 +53,7 @@ Module.register("newsfeed",{ }, // Define start sequence. - start: function() { + start: function () { Log.info("Starting module: " + this.name); // Set locale. @@ -71,7 +70,7 @@ Module.register("newsfeed",{ }, // Override socket notification handler. - socketNotificationReceived: function(notification, payload) { + socketNotificationReceived: function (notification, payload) { if (notification === "NEWS_ITEMS") { this.generateFeed(payload); @@ -84,12 +83,12 @@ Module.register("newsfeed",{ }, // Override dom generator. - getDom: function() { - var wrapper = document.createElement("div"); + getDom: function () { + const wrapper = document.createElement("div"); if (this.config.feedUrl) { wrapper.className = "small bright"; - wrapper.innerHTML = this.translate("configuration_changed"); + wrapper.innerHTML = this.translate("MODULE_CONFIG_CHANGED", { MODULE_NAME: "Newsfeed" }); return wrapper; } @@ -98,10 +97,9 @@ Module.register("newsfeed",{ } if (this.newsItems.length > 0) { - // this.config.showFullArticle is a run-time configuration, triggered by optional notifications if (!this.config.showFullArticle && (this.config.showSourceTitle || this.config.showPublishDate)) { - var sourceAndTimestamp = document.createElement("div"); + const sourceAndTimestamp = document.createElement("div"); sourceAndTimestamp.className = "newsfeed-source light small dimmed"; if (this.config.showSourceTitle && this.newsItems[this.activeItem].sourceTitle !== "") { @@ -113,7 +111,7 @@ Module.register("newsfeed",{ if (this.config.showPublishDate) { sourceAndTimestamp.innerHTML += moment(new Date(this.newsItems[this.activeItem].pubdate)).fromNow(); } - if (this.config.showSourceTitle && this.newsItems[this.activeItem].sourceTitle !== "" || this.config.showPublishDate) { + if ((this.config.showSourceTitle && this.newsItems[this.activeItem].sourceTitle !== "") || this.config.showPublishDate) { sourceAndTimestamp.innerHTML += ":"; } @@ -123,63 +121,58 @@ Module.register("newsfeed",{ //Remove selected tags from the beginning of rss feed items (title or description) if (this.config.removeStartTags === "title" || this.config.removeStartTags === "both") { - - for (let f=0; f this.config.lengthDescription ? txtDesc.substring(0, this.config.lengthDescription) + "..." : txtDesc) : txtDesc); + const txtDesc = this.newsItems[this.activeItem].description; + description.innerHTML = this.config.truncDescription ? (txtDesc.length > this.config.lengthDescription ? txtDesc.substring(0, this.config.lengthDescription) + "..." : txtDesc) : txtDesc; wrapper.appendChild(description); } if (this.config.showFullArticle) { - var fullArticle = document.createElement("iframe"); + const fullArticle = document.createElement("iframe"); fullArticle.className = ""; fullArticle.style.width = "100vw"; // very large height value to allow scrolling @@ -196,7 +189,6 @@ Module.register("newsfeed",{ if (this.config.hideLoading) { this.show(); } - } else { if (this.config.hideLoading) { this.hide(); @@ -209,14 +201,14 @@ Module.register("newsfeed",{ return wrapper; }, - getActiveItemURL: function() { + getActiveItemURL: function () { return typeof this.newsItems[this.activeItem].url === "string" ? this.newsItems[this.activeItem].url : this.newsItems[this.activeItem].url.href; }, - /* registerFeeds() - * registers the feeds to be used by the backend. + /** + * Registers the feeds to be used by the backend. */ - registerFeeds: function() { + registerFeeds: function () { for (var f in this.config.feeds) { var feed = this.config.feeds[f]; this.sendSocketNotification("ADD_FEED", { @@ -226,12 +218,12 @@ Module.register("newsfeed",{ } }, - /* generateFeed() + /** * Generate an ordered list of items for this configured module. * - * attribute feeds object - An object with feeds returned by the node helper. + * @param {object} feeds An object with feeds returned by the node helper. */ - generateFeed: function(feeds) { + generateFeed: function (feeds) { var newsItems = []; for (var feed in feeds) { var feedItems = feeds[feed]; @@ -239,24 +231,24 @@ Module.register("newsfeed",{ for (var i in feedItems) { var item = feedItems[i]; item.sourceTitle = this.titleForFeed(feed); - if (!(this.config.ignoreOldItems && ((Date.now() - new Date(item.pubdate)) > this.config.ignoreOlderThan))) { + if (!(this.config.ignoreOldItems && Date.now() - new Date(item.pubdate) > this.config.ignoreOlderThan)) { newsItems.push(item); } } } } - newsItems.sort(function(a,b) { + newsItems.sort(function (a, b) { var dateA = new Date(a.pubdate); var dateB = new Date(b.pubdate); return dateB - dateA; }); - if(this.config.maxNewsItems > 0) { + if (this.config.maxNewsItems > 0) { newsItems = newsItems.slice(0, this.config.maxNewsItems); } - if(this.config.prohibitedWords.length > 0) { - newsItems = newsItems.filter(function(value){ - for (var i=0; i < this.config.prohibitedWords.length; i++) { + if (this.config.prohibitedWords.length > 0) { + newsItems = newsItems.filter(function (value) { + for (var i = 0; i < this.config.prohibitedWords.length; i++) { if (value["title"].toLowerCase().indexOf(this.config.prohibitedWords[i].toLowerCase()) > -1) { return false; } @@ -267,8 +259,8 @@ Module.register("newsfeed",{ // get updated news items and broadcast them var updatedItems = []; - newsItems.forEach(value => { - if (this.newsItems.findIndex(value1 => value1 === value) === -1) { + newsItems.forEach((value) => { + if (this.newsItems.findIndex((value1) => value1 === value) === -1) { // Add item to updated items list updatedItems.push(value); } @@ -276,20 +268,19 @@ Module.register("newsfeed",{ // check if updated items exist, if so and if we should broadcast these updates, then lets do so if (this.config.broadcastNewsUpdates && updatedItems.length > 0) { - this.sendNotification("NEWS_FEED_UPDATE", {items: updatedItems}); + this.sendNotification("NEWS_FEED_UPDATE", { items: updatedItems }); } this.newsItems = newsItems; }, - /* subscribedToFeed(feedUrl) + /** * Check if this module is configured to show this feed. * - * attribute feedUrl string - Url of the feed to check. - * - * returns bool + * @param {string} feedUrl Url of the feed to check. + * @returns {boolean} True if it is subscribed, false otherwise */ - subscribedToFeed: function(feedUrl) { + subscribedToFeed: function (feedUrl) { for (var f in this.config.feeds) { var feed = this.config.feeds[f]; if (feed.url === feedUrl) { @@ -299,14 +290,13 @@ Module.register("newsfeed",{ return false; }, - /* titleForFeed(feedUrl) - * Returns title for a specific feed Url. + /** + * Returns title for the specific feed url. * - * attribute feedUrl string - Url of the feed to check. - * - * returns string + * @param {string} feedUrl Url of the feed + * @returns {string} The title of the feed */ - titleForFeed: function(feedUrl) { + titleForFeed: function (feedUrl) { for (var f in this.config.feeds) { var feed = this.config.feeds[f]; if (feed.url === feedUrl) { @@ -316,56 +306,45 @@ Module.register("newsfeed",{ return ""; }, - /* scheduleUpdateInterval() + /** * Schedule visual update. */ - scheduleUpdateInterval: function() { + scheduleUpdateInterval: function () { var self = this; self.updateDom(self.config.animationSpeed); // Broadcast NewsFeed if needed if (self.config.broadcastNewsFeeds) { - self.sendNotification("NEWS_FEED", {items: self.newsItems}); + self.sendNotification("NEWS_FEED", { items: self.newsItems }); } - this.timer = setInterval(function() { + this.timer = setInterval(function () { self.activeItem++; self.updateDom(self.config.animationSpeed); // Broadcast NewsFeed if needed if (self.config.broadcastNewsFeeds) { - self.sendNotification("NEWS_FEED", {items: self.newsItems}); + self.sendNotification("NEWS_FEED", { items: self.newsItems }); } }, this.config.updateInterval); }, - /* capitalizeFirstLetter(string) - * Capitalizes the first character of a string. - * - * argument string string - Input string. - * - * return string - Capitalized output string. - */ - capitalizeFirstLetter: function(string) { - return string.charAt(0).toUpperCase() + string.slice(1); - }, - - resetDescrOrFullArticleAndTimer: function() { + resetDescrOrFullArticleAndTimer: function () { this.isShowingDescription = this.config.showDescription; this.config.showFullArticle = false; this.scrollPosition = 0; // reset bottom bar alignment document.getElementsByClassName("region bottom bar")[0].style.bottom = "0"; document.getElementsByClassName("region bottom bar")[0].style.top = "inherit"; - if(!this.timer){ + if (!this.timer) { this.scheduleUpdateInterval(); } }, - notificationReceived: function(notification, payload, sender) { - var before = this.activeItem; - if(notification === "ARTICLE_NEXT"){ + notificationReceived: function (notification, payload, sender) { + const before = this.activeItem; + if (notification === "ARTICLE_NEXT") { this.activeItem++; if (this.activeItem >= this.newsItems.length) { this.activeItem = 0; @@ -373,7 +352,7 @@ Module.register("newsfeed",{ this.resetDescrOrFullArticleAndTimer(); Log.info(this.name + " - going from article #" + before + " to #" + this.activeItem + " (of " + this.newsItems.length + ")"); this.updateDom(100); - } else if(notification === "ARTICLE_PREVIOUS"){ + } else if (notification === "ARTICLE_PREVIOUS") { this.activeItem--; if (this.activeItem < 0) { this.activeItem = this.newsItems.length - 1; @@ -383,51 +362,50 @@ Module.register("newsfeed",{ this.updateDom(100); } // if "more details" is received the first time: show article summary, on second time show full article - else if(notification === "ARTICLE_MORE_DETAILS"){ + else if (notification === "ARTICLE_MORE_DETAILS") { // full article is already showing, so scrolling down - if(this.config.showFullArticle === true){ + if (this.config.showFullArticle === true) { this.scrollPosition += this.config.scrollLength; window.scrollTo(0, this.scrollPosition); Log.info(this.name + " - scrolling down"); Log.info(this.name + " - ARTICLE_MORE_DETAILS, scroll position: " + this.config.scrollLength); - } - else { + } else { this.showFullArticle(); } - } else if(notification === "ARTICLE_SCROLL_UP"){ - if(this.config.showFullArticle === true){ + } else if (notification === "ARTICLE_SCROLL_UP") { + if (this.config.showFullArticle === true) { this.scrollPosition -= this.config.scrollLength; window.scrollTo(0, this.scrollPosition); Log.info(this.name + " - scrolling up"); Log.info(this.name + " - ARTICLE_SCROLL_UP, scroll position: " + this.config.scrollLength); } - } else if(notification === "ARTICLE_LESS_DETAILS"){ + } else if (notification === "ARTICLE_LESS_DETAILS") { this.resetDescrOrFullArticleAndTimer(); Log.info(this.name + " - showing only article titles again"); this.updateDom(100); - } else if (notification === "ARTICLE_TOGGLE_FULL"){ - if (this.config.showFullArticle){ + } else if (notification === "ARTICLE_TOGGLE_FULL") { + if (this.config.showFullArticle) { this.activeItem++; this.resetDescrOrFullArticleAndTimer(); } else { this.showFullArticle(); } - } else if (notification === "ARTICLE_INFO_REQUEST"){ + } else if (notification === "ARTICLE_INFO_REQUEST") { this.sendNotification("ARTICLE_INFO_RESPONSE", { - title: this.newsItems[this.activeItem].title, + title: this.newsItems[this.activeItem].title, source: this.newsItems[this.activeItem].sourceTitle, - date: this.newsItems[this.activeItem].pubdate, - desc: this.newsItems[this.activeItem].description, - url: this.getActiveItemURL() + date: this.newsItems[this.activeItem].pubdate, + desc: this.newsItems[this.activeItem].description, + url: this.getActiveItemURL() }); } }, - showFullArticle: function() { + showFullArticle: function () { this.isShowingDescription = !this.isShowingDescription; this.config.showFullArticle = !this.isShowingDescription; // make bottom bar align to top to allow scrolling - if(this.config.showFullArticle === true){ + if (this.config.showFullArticle === true) { document.getElementsByClassName("region bottom bar")[0].style.bottom = "inherit"; document.getElementsByClassName("region bottom bar")[0].style.top = "-90px"; } diff --git a/modules/default/newsfeed/newsfeedfetcher.js b/modules/default/newsfeed/newsfeedfetcher.js new file mode 100644 index 00000000..20e45258 --- /dev/null +++ b/modules/default/newsfeed/newsfeedfetcher.js @@ -0,0 +1,159 @@ +/* Magic Mirror + * Node Helper: Newsfeed - NewsfeedFetcher + * + * By Michael Teeuw https://michaelteeuw.nl + * MIT Licensed. + */ +const Log = require("../../../js/logger.js"); +const FeedMe = require("feedme"); +const request = require("request"); +const iconv = require("iconv-lite"); + +/** + * Responsible for requesting an update on the set interval and broadcasting the data. + * + * @param {string} url URL of the news feed. + * @param {number} reloadInterval Reload interval in milliseconds. + * @param {string} encoding Encoding of the feed. + * @param {boolean} logFeedWarnings If true log warnings when there is an error parsing a news article. + * @class + */ +const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings) { + const self = this; + + let reloadTimer = null; + let items = []; + + let fetchFailedCallback = function () {}; + let itemsReceivedCallback = function () {}; + + if (reloadInterval < 1000) { + reloadInterval = 1000; + } + + /* private methods */ + + /** + * Request the new items. + */ + const fetchNews = function () { + clearTimeout(reloadTimer); + reloadTimer = null; + items = []; + + const parser = new FeedMe(); + + parser.on("item", function (item) { + const title = item.title; + let description = item.description || item.summary || item.content || ""; + const pubdate = item.pubdate || item.published || item.updated || item["dc:date"]; + const url = item.url || item.link || ""; + + if (title && pubdate) { + const regex = /(<([^>]+)>)/gi; + description = description.toString().replace(regex, ""); + + items.push({ + title: title, + description: description, + pubdate: pubdate, + url: url + }); + } else if (logFeedWarnings) { + Log.warn("Can't parse feed item:"); + Log.warn(item); + Log.warn("Title: " + title); + Log.warn("Description: " + description); + Log.warn("Pubdate: " + pubdate); + } + }); + + parser.on("end", function () { + self.broadcastItems(); + scheduleTimer(); + }); + + parser.on("error", function (error) { + fetchFailedCallback(self, error); + scheduleTimer(); + }); + + const nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]); + const opts = { + headers: { + "User-Agent": "Mozilla/5.0 (Node.js " + nodeVersion + ") MagicMirror/" + global.version + " (https://github.com/MichMich/MagicMirror/)", + "Cache-Control": "max-age=0, no-cache, no-store, must-revalidate", + Pragma: "no-cache" + }, + encoding: null + }; + + request(url, opts) + .on("error", function (error) { + fetchFailedCallback(self, error); + scheduleTimer(); + }) + .pipe(iconv.decodeStream(encoding)) + .pipe(parser); + }; + + /** + * Schedule the timer for the next update. + */ + const scheduleTimer = function () { + clearTimeout(reloadTimer); + reloadTimer = setTimeout(function () { + fetchNews(); + }, reloadInterval); + }; + + /* public methods */ + + /** + * Update the reload interval, but only if we need to increase the speed. + * + * @param {number} interval Interval for the update in milliseconds. + */ + this.setReloadInterval = function (interval) { + if (interval > 1000 && interval < reloadInterval) { + reloadInterval = interval; + } + }; + + /** + * Initiate fetchNews(); + */ + this.startFetch = function () { + fetchNews(); + }; + + /** + * Broadcast the existing items. + */ + this.broadcastItems = function () { + if (items.length <= 0) { + Log.info("Newsfeed-Fetcher: No items to broadcast yet."); + return; + } + Log.info("Newsfeed-Fetcher: Broadcasting " + items.length + " items."); + itemsReceivedCallback(self); + }; + + this.onReceive = function (callback) { + itemsReceivedCallback = callback; + }; + + this.onError = function (callback) { + fetchFailedCallback = callback; + }; + + this.url = function () { + return url; + }; + + this.items = function () { + return items; + }; +}; + +module.exports = NewsfeedFetcher; diff --git a/modules/default/newsfeed/node_helper.js b/modules/default/newsfeed/node_helper.js index ef547bd2..bdfcbfcc 100644 --- a/modules/default/newsfeed/node_helper.js +++ b/modules/default/newsfeed/node_helper.js @@ -5,64 +5,62 @@ * MIT Licensed. */ -var NodeHelper = require("node_helper"); -var validUrl = require("valid-url"); -var Fetcher = require("./fetcher.js"); +const NodeHelper = require("node_helper"); +const validUrl = require("valid-url"); +const NewsfeedFetcher = require("./newsfeedfetcher.js"); +const Log = require("../../../js/logger"); module.exports = NodeHelper.create({ - // Subclass start method. - start: function() { - console.log("Starting module: " + this.name); + // Override start method. + start: function () { + Log.log("Starting node helper for: " + this.name); this.fetchers = []; }, - // Subclass socketNotificationReceived received. - socketNotificationReceived: function(notification, payload) { + // Override socketNotificationReceived received. + socketNotificationReceived: function (notification, payload) { if (notification === "ADD_FEED") { this.createFetcher(payload.feed, payload.config); - return; } }, - /* createFetcher(feed, config) + /** * Creates a fetcher for a new feed if it doesn't exist yet. * Otherwise it reuses the existing one. * - * attribute feed object - A feed object. - * attribute config object - A configuration object containing reload interval in milliseconds. + * @param {object} feed The feed object. + * @param {object} config The configuration object. */ - createFetcher: function(feed, config) { - var self = this; - - var url = feed.url || ""; - var encoding = feed.encoding || "UTF-8"; - var reloadInterval = feed.reloadInterval || config.reloadInterval || 5 * 60 * 1000; + createFetcher: function (feed, config) { + const url = feed.url || ""; + const encoding = feed.encoding || "UTF-8"; + const reloadInterval = feed.reloadInterval || config.reloadInterval || 5 * 60 * 1000; if (!validUrl.isUri(url)) { - self.sendSocketNotification("INCORRECT_URL", url); + this.sendSocketNotification("INCORRECT_URL", url); return; } - var fetcher; - if (typeof self.fetchers[url] === "undefined") { - console.log("Create new news fetcher for url: " + url + " - Interval: " + reloadInterval); - fetcher = new Fetcher(url, reloadInterval, encoding, config.logFeedWarnings); + let fetcher; + if (typeof this.fetchers[url] === "undefined") { + Log.log("Create new news fetcher for url: " + url + " - Interval: " + reloadInterval); + fetcher = new NewsfeedFetcher(url, reloadInterval, encoding, config.logFeedWarnings); - fetcher.onReceive(function(fetcher) { - self.broadcastFeeds(); + fetcher.onReceive(() => { + this.broadcastFeeds(); }); - fetcher.onError(function(fetcher, error) { - self.sendSocketNotification("FETCH_ERROR", { + fetcher.onError((fetcher, error) => { + this.sendSocketNotification("FETCH_ERROR", { url: fetcher.url(), error: error }); }); - self.fetchers[url] = fetcher; + this.fetchers[url] = fetcher; } else { - console.log("Use existing news fetcher for url: " + url); - fetcher = self.fetchers[url]; + Log.log("Use existing news fetcher for url: " + url); + fetcher = this.fetchers[url]; fetcher.setReloadInterval(reloadInterval); fetcher.broadcastItems(); } @@ -70,11 +68,11 @@ module.exports = NodeHelper.create({ fetcher.startFetch(); }, - /* broadcastFeeds() + /** * Creates an object with all feed items of the different registered feeds, * and broadcasts these using sendSocketNotification. */ - broadcastFeeds: function() { + broadcastFeeds: function () { var feeds = {}; for (var f in this.fetchers) { feeds[f] = this.fetchers[f].items(); diff --git a/modules/default/newsfeed/translations/de.json b/modules/default/newsfeed/translations/de.json deleted file mode 100644 index 9ec3ef7b..00000000 --- a/modules/default/newsfeed/translations/de.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "configuration_changed": "Die Konfigurationsoptionen für das Newsfeed-Modul haben sich geändert. \nBitte überprüfen Sie die Dokumentation." -} \ No newline at end of file diff --git a/modules/default/newsfeed/translations/en.json b/modules/default/newsfeed/translations/en.json deleted file mode 100644 index 23b6100d..00000000 --- a/modules/default/newsfeed/translations/en.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "configuration_changed": "The configuration options for the newsfeed module have changed.\nPlease check the documentation." -} \ No newline at end of file diff --git a/modules/default/newsfeed/translations/es.json b/modules/default/newsfeed/translations/es.json deleted file mode 100644 index 6143f68c..00000000 --- a/modules/default/newsfeed/translations/es.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "configuration_changed": "Las opciones de configuración para el módulo de suministro de noticias han cambiado. \nVerifique la documentación." -} \ No newline at end of file diff --git a/modules/default/newsfeed/translations/fr.json b/modules/default/newsfeed/translations/fr.json deleted file mode 100644 index 85c6b412..00000000 --- a/modules/default/newsfeed/translations/fr.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "configuration_changed": "Les options de configuration du module newsfeed ont changé. \nVeuillez consulter la documentation." -} \ No newline at end of file diff --git a/modules/default/updatenotification/README.md b/modules/default/updatenotification/README.md index af6305e6..0ab6886a 100644 --- a/modules/default/updatenotification/README.md +++ b/modules/default/updatenotification/README.md @@ -1,4 +1,5 @@ # Module: Update Notification + The `updatenotification` module is one of the default modules of the MagicMirror. This will display a message whenever a new version of the MagicMirror application is available. diff --git a/modules/default/updatenotification/node_helper.js b/modules/default/updatenotification/node_helper.js index 2fc62c95..973dca51 100644 --- a/modules/default/updatenotification/node_helper.js +++ b/modules/default/updatenotification/node_helper.js @@ -1,26 +1,24 @@ -var SimpleGit = require("simple-git"); -var simpleGits = []; -var fs = require("fs"); -var path = require("path"); -var defaultModules = require(__dirname + "/../defaultmodules.js"); -var NodeHelper = require("node_helper"); +const SimpleGit = require("simple-git"); +const simpleGits = []; +const fs = require("fs"); +const path = require("path"); +const defaultModules = require(__dirname + "/../defaultmodules.js"); +const Log = require(__dirname + "/../../../js/logger.js"); +const NodeHelper = require("node_helper"); module.exports = NodeHelper.create({ - config: {}, updateTimer: null, updateProcessStarted: false, - start: function () { - }, - - configureModules: function(modules) { + start: function () {}, + configureModules: function (modules) { // Push MagicMirror itself , biggest chance it'll show up last in UI and isn't overwritten // others will be added in front // this method returns promises so we can't wait for every one to resolve before continuing - simpleGits.push({"module": "default", "git": SimpleGit(path.normalize(__dirname + "/../../../"))}); + simpleGits.push({ module: "default", git: SimpleGit(path.normalize(__dirname + "/../../../")) }); var promises = []; @@ -30,10 +28,10 @@ module.exports = NodeHelper.create({ var moduleFolder = path.normalize(__dirname + "/../../" + moduleName); try { - //console.log("checking git for module="+moduleName) + Log.info("Checking git for module: " + moduleName); let stat = fs.statSync(path.join(moduleFolder, ".git")); promises.push(this.resolveRemote(moduleName, moduleFolder)); - } catch(err) { + } catch (err) { // Error when directory .git doesn't exist // This module is not managed with git, skip continue; @@ -47,7 +45,7 @@ module.exports = NodeHelper.create({ socketNotificationReceived: function (notification, payload) { if (notification === "CONFIG") { this.config = payload; - } else if(notification === "MODULES") { + } else if (notification === "MODULES") { // if this is the 1st time thru the update check process if (!this.updateProcessStarted) { this.updateProcessStarted = true; @@ -56,7 +54,7 @@ module.exports = NodeHelper.create({ } }, - resolveRemote: function(moduleName, moduleFolder) { + resolveRemote: function (moduleName, moduleFolder) { return new Promise((resolve, reject) => { var git = SimpleGit(moduleFolder); git.getRemotes(true, (err, remotes) => { @@ -65,19 +63,19 @@ module.exports = NodeHelper.create({ return resolve(); } // Folder has .git and has at least one git remote, watch this folder - simpleGits.unshift({"module": moduleName, "git": git}); + simpleGits.unshift({ module: moduleName, git: git }); resolve(); }); }); }, - performFetch: function() { + performFetch: function () { var self = this; simpleGits.forEach((sg) => { - sg.git.fetch().status((err, data) => { + sg.git.fetch(["--dry-run"]).status((err, data) => { data.module = sg.module; if (!err) { - sg.git.log({"-1": null}, (err, data2) => { + sg.git.log({ "-1": null }, (err, data2) => { if (!err && data2.latest && "hash" in data2.latest) { data.hash = data2.latest.hash; self.sendSocketNotification("STATUS", data); @@ -90,19 +88,19 @@ module.exports = NodeHelper.create({ this.scheduleNextFetch(this.config.updateInterval); }, - scheduleNextFetch: function(delay) { + scheduleNextFetch: function (delay) { if (delay < 60 * 1000) { delay = 60 * 1000; } var self = this; clearTimeout(this.updateTimer); - this.updateTimer = setTimeout(function() { + this.updateTimer = setTimeout(function () { self.performFetch(); }, delay); }, - ignoreUpdateChecking: function(moduleName) { + ignoreUpdateChecking: function (moduleName) { // Should not check for updates for default modules if (defaultModules.indexOf(moduleName) >= 0) { return true; @@ -116,5 +114,4 @@ module.exports = NodeHelper.create({ // The rest of the modules that passes should check for updates return false; } - }); diff --git a/modules/default/updatenotification/updatenotification.js b/modules/default/updatenotification/updatenotification.js index 0c4e2ad9..3de82f1c 100644 --- a/modules/default/updatenotification/updatenotification.js +++ b/modules/default/updatenotification/updatenotification.js @@ -5,7 +5,6 @@ * MIT Licensed. */ Module.register("updatenotification", { - defaults: { updateInterval: 10 * 60 * 1000, // every 10 minutes refreshInterval: 24 * 60 * 60 * 1000, // one day @@ -18,7 +17,10 @@ Module.register("updatenotification", { start: function () { var self = this; Log.log("Start updatenotification"); - setInterval( () => { self.moduleList = {};self.updateDom(2); } , self.config.refreshInterval); + setInterval(() => { + self.moduleList = {}; + self.updateDom(2); + }, self.config.refreshInterval); }, notificationReceived: function (notification, payload, sender) { @@ -39,16 +41,15 @@ Module.register("updatenotification", { var self = this; if (payload && payload.behind > 0) { // if we haven't seen info for this module - if(this.moduleList[payload.module] === undefined){ + if (this.moduleList[payload.module] === undefined) { // save it - this.moduleList[payload.module]=payload; + this.moduleList[payload.module] = payload; self.updateDom(2); } //self.show(1000, { lockString: self.identifier }); - - } else if (payload && payload.behind === 0){ + } else if (payload && payload.behind === 0) { // if the module WAS in the list, but shouldn't be - if(this.moduleList[payload.module] !== undefined){ + if (this.moduleList[payload.module] !== undefined) { // remove it delete this.moduleList[payload.module]; self.updateDom(2); @@ -56,23 +57,18 @@ Module.register("updatenotification", { } }, - diffLink: function(module, text) { + diffLink: function (module, text) { var localRef = module.hash; var remoteRef = module.tracking.replace(/.*\//, ""); - return "" + - text + - ""; + return '' + text + ""; }, // Override dom generator. getDom: function () { var wrapper = document.createElement("div"); - if(this.suspended === false){ + if (this.suspended === false) { // process the hash of module info found - for(var key of Object.keys(this.moduleList)){ + for (var key of Object.keys(this.moduleList)) { let m = this.moduleList[key]; var message = document.createElement("div"); @@ -93,7 +89,7 @@ Module.register("updatenotification", { var text = document.createElement("span"); if (m.module === "default") { text.innerHTML = this.translate("UPDATE_NOTIFICATION"); - subtextHtml = this.diffLink(m,subtextHtml); + subtextHtml = this.diffLink(m, subtextHtml); } else { text.innerHTML = this.translate("UPDATE_NOTIFICATION_MODULE", { MODULE_NAME: m.module @@ -112,11 +108,11 @@ Module.register("updatenotification", { return wrapper; }, - suspend: function() { - this.suspended=true; + suspend: function () { + this.suspended = true; }, - resume: function() { - this.suspended=false; + resume: function () { + this.suspended = false; this.updateDom(2); } }); diff --git a/modules/default/weather/README.md b/modules/default/weather/README.md index 93f1595d..aebf0863 100755 --- a/modules/default/weather/README.md +++ b/modules/default/weather/README.md @@ -1,5 +1,5 @@ # Weather Module -This module aims to be the replacement for the current `currentweather` and `weatherforcast` modules. The module will be configurable to be used as a current weather view, or to show the forecast. This way the module can be used twice to fullfil both purposes. +This module aims to be the replacement for the current `currentweather` and `weatherforcast` modules. The module will be configurable to be used as a current weather view, or to show the forecast. This way the module can be used twice to fulfill both purposes. For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/weather.html). diff --git a/modules/default/weather/current.njk b/modules/default/weather/current.njk index 33dac07a..c838c1e9 100755 --- a/modules/default/weather/current.njk +++ b/modules/default/weather/current.njk @@ -1,4 +1,7 @@ -{% if current %} +{% if current or weatherData %} + {% if weatherData %} + {% set current = weatherData.current %} + {% endif %} {% if not config.onlyTemp %}
@@ -22,14 +25,16 @@ {% if config.showHumidity and current.humidity %} {{ current.humidity | decimalSymbol }}  {% endif %} - - - {% if current.nextSunAction() === "sunset" %} - {{ current.sunset | formatTime }} - {% else %} - {{ current.sunrise | formatTime }} - {% endif %} - + {% if config.showSun %} + + + {% if current.nextSunAction() === "sunset" %} + {{ current.sunset | formatTime }} + {% else %} + {{ current.sunrise | formatTime }} + {% endif %} + + {% endif %}
{% endif %}
diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index fed0e85c..7d0f515d 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -1,5 +1,10 @@ -{% if forecast %} - {% set numSteps = forecast | calcNumSteps %} +{% if forecast or weatherData %} + {% if weatherData %} + {% set forecast = weatherData.days %} + {% set numSteps = forecast | calcNumEntries %} + {% else %} + {% set numSteps = forecast | calcNumSteps %} + {% endif %} {% set currentStep = 0 %} {% set forecast = forecast.slice(0, numSteps) %} diff --git a/modules/default/weather/hourly.njk b/modules/default/weather/hourly.njk new file mode 100644 index 00000000..e241b010 --- /dev/null +++ b/modules/default/weather/hourly.njk @@ -0,0 +1,32 @@ +{% if hourly or weatherData %} + {% if weatherData %} + {% set hourly = weatherData.hours %} + {% endif %} + {% set numSteps = hourly | calcNumEntries %} + {% set currentStep = 0 %} +
+ {% set hours = hourly.slice(0, numSteps) %} + {% for hour in hours %} + + + + + {% if config.showPrecipitationAmount %} + + {% endif %} + + {% set currentStep = currentStep + 1 %} + {% endfor %} +
{{ hour.date | formatTime }} + {{ hour.temperature | roundValue | unit("temperature") }} + + {{ hour.precipitation | unit("precip") }} +
+{% else %} +
+ {{ "LOADING" | translate | safe }} +
+{% endif %} + + + diff --git a/modules/default/weather/providers/README.md b/modules/default/weather/providers/README.md index a1bb24df..02cef8dd 100755 --- a/modules/default/weather/providers/README.md +++ b/modules/default/weather/providers/README.md @@ -15,15 +15,15 @@ Table of Contents: This is the script in which the weather provider will be defined. In its most simple form, the weather provider must implement the following: -````javascript +```javascript WeatherProvider.register("yourprovider", { - providerName: "YourProvider", + providerName: "YourProvider", - fetchCurrentWeather() {}, + fetchCurrentWeather() {}, - fetchWeatherForecast() {} + fetchWeatherForecast() {} }); -```` +``` ### Weather provider methods to implement @@ -89,24 +89,24 @@ A convenience function to make requests. It returns a promise. ### WeatherObject -| Property | Type | Value/Unit | -| --- | --- | --- | -| units | `string` | Gets initialized with the constructor.
Possible values: `metric`, `imperial` | -| tempUnits | `string` | Gets initialized with the constructor.
Possible values: `metric`, `imperial` | -| windUnits | `string` | Gets initialized with the constructor.
Possible values: `metric`, `imperial` | -| date | `object` | [Moment.js](https://momentjs.com/) object of the time/date. | -| windSpeed |`number` | Metric: `meter/second`
Imperial: `miles/hour` | -| windDirection |`number` | Direction of the wind in degrees. | -| sunrise |`object` | [Moment.js](https://momentjs.com/) object of sunrise. | -| sunset |`object` | [Moment.js](https://momentjs.com/) object of sunset. | -| temperature | `number` | Current temperature | -| minTemperature | `number` | Lowest temperature of the day. | -| maxTemperature | `number` | Highest temperature of the day. | -| weatherType | `string` | Icon name of the weather type.
Possible values: [WeatherIcons](https://www.npmjs.com/package/weathericons) | -| humidity | `number` | Percentage of humidity | -| rain | `number` | Metric: `millimeters`
Imperial: `inches` | -| snow | `number` | Metric: `millimeters`
Imperial: `inches` | -| precipitation | `number` | Metric: `millimeters`
Imperial: `inches`
UK Met Office provider: `percent` | +| Property | Type | Value/Unit | +| -------------- | -------- | --------------------------------------------------------------------------------------------------------------- | +| units | `string` | Gets initialized with the constructor.
Possible values: `metric`, `imperial` | +| tempUnits | `string` | Gets initialized with the constructor.
Possible values: `metric`, `imperial` | +| windUnits | `string` | Gets initialized with the constructor.
Possible values: `metric`, `imperial` | +| date | `object` | [Moment.js](https://momentjs.com/) object of the time/date. | +| windSpeed | `number` | Metric: `meter/second`
Imperial: `miles/hour` | +| windDirection | `number` | Direction of the wind in degrees. | +| sunrise | `object` | [Moment.js](https://momentjs.com/) object of sunrise. | +| sunset | `object` | [Moment.js](https://momentjs.com/) object of sunset. | +| temperature | `number` | Current temperature | +| minTemperature | `number` | Lowest temperature of the day. | +| maxTemperature | `number` | Highest temperature of the day. | +| weatherType | `string` | Icon name of the weather type.
Possible values: [WeatherIcons](https://www.npmjs.com/package/weathericons) | +| humidity | `number` | Percentage of humidity | +| rain | `number` | Metric: `millimeters`
Imperial: `inches` | +| snow | `number` | Metric: `millimeters`
Imperial: `inches` | +| precipitation | `number` | Metric: `millimeters`
Imperial: `inches`
UK Met Office provider: `percent` | #### Current weather diff --git a/modules/default/weather/providers/darksky.js b/modules/default/weather/providers/darksky.js index ea36da28..4ba90105 100755 --- a/modules/default/weather/providers/darksky.js +++ b/modules/default/weather/providers/darksky.js @@ -22,15 +22,16 @@ WeatherProvider.register("darksky", { fetchCurrentWeather() { this.fetchData(this.getUrl()) - .then(data => { - if(!data || !data.currently || typeof data.currently.temperature === "undefined") { + .then((data) => { + if (!data || !data.currently || typeof data.currently.temperature === "undefined") { // No usable data? return; } const currentWeather = this.generateWeatherDayFromCurrentWeather(data); this.setCurrentWeather(currentWeather); - }).catch(function(request) { + }) + .catch(function (request) { Log.error("Could not load data ... ", request); }) .finally(() => this.updateAvailable()); @@ -38,15 +39,16 @@ WeatherProvider.register("darksky", { fetchWeatherForecast() { this.fetchData(this.getUrl()) - .then(data => { - if(!data || !data.daily || !data.daily.data.length) { + .then((data) => { + if (!data || !data.daily || !data.daily.data.length) { // No usable data? return; } const forecast = this.generateWeatherObjectsFromForecast(data.daily.data); this.setWeatherForecast(forecast); - }).catch(function(request) { + }) + .catch(function (request) { Log.error("Could not load data ... ", request); }) .finally(() => this.updateAvailable()); @@ -109,12 +111,12 @@ WeatherProvider.register("darksky", { const weatherTypes = { "clear-day": "day-sunny", "clear-night": "night-clear", - "rain": "rain", - "snow": "snow", - "sleet": "snow", - "wind": "wind", - "fog": "fog", - "cloudy": "cloudy", + rain: "rain", + snow: "snow", + sleet: "snow", + wind: "wind", + fog: "fog", + cloudy: "cloudy", "partly-cloudy-day": "day-cloudy", "partly-cloudy-night": "night-cloudy" }; diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index 1a134f47..12635f1b 100755 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -9,7 +9,6 @@ * This class is the blueprint for a weather provider. */ WeatherProvider.register("openweathermap", { - // Set the name of the provider. // This isn't strictly necessary, since it will fallback to the provider identifier // But for debugging (and future alerts) it would be nice to have the real name. @@ -18,7 +17,7 @@ WeatherProvider.register("openweathermap", { // Overwrite the fetchCurrentWeather method. fetchCurrentWeather() { this.fetchData(this.getUrl()) - .then(data => { + .then((data) => { if (!data || !data.main || typeof data.main.temp === "undefined") { // Did not receive usable new data. // Maybe this needs a better check? @@ -30,16 +29,16 @@ WeatherProvider.register("openweathermap", { const currentWeather = this.generateWeatherObjectFromCurrentWeather(data); this.setCurrentWeather(currentWeather); }) - .catch(function(request) { + .catch(function (request) { Log.error("Could not load data ... ", request); }) .finally(() => this.updateAvailable()); }, - // Overwrite the fetchCurrentWeather method. + // Overwrite the fetchWeatherForecast method. fetchWeatherForecast() { this.fetchData(this.getUrl()) - .then(data => { + .then((data) => { if (!data || !data.list || !data.list.length) { // Did not receive usable new data. // Maybe this needs a better check? @@ -51,7 +50,28 @@ WeatherProvider.register("openweathermap", { const forecast = this.generateWeatherObjectsFromForecast(data.list); this.setWeatherForecast(forecast); }) - .catch(function(request) { + .catch(function (request) { + Log.error("Could not load data ... ", request); + }) + .finally(() => this.updateAvailable()); + }, + + // Overwrite the fetchWeatherData method. + fetchWeatherData() { + this.fetchData(this.getUrl()) + .then((data) => { + if (!data) { + // Did not receive usable new data. + // Maybe this needs a better check? + return; + } + + this.setFetchedLocation(`(${data.lat},${data.lon})`); + + const weatherData = this.generateWeatherObjectsFromOnecall(data); + this.setWeatherData(weatherData); + }) + .catch(function (request) { Log.error("Could not load data ... ", request); }) .finally(() => this.updateAvailable()); @@ -86,7 +106,6 @@ WeatherProvider.register("openweathermap", { * Generate WeatherObjects based on forecast information */ generateWeatherObjectsFromForecast(forecasts) { - if (this.config.weatherEndpoint === "/forecast") { return this.fetchForecastHourly(forecasts); } else if (this.config.weatherEndpoint === "/forecast/daily") { @@ -97,6 +116,18 @@ WeatherProvider.register("openweathermap", { return days; }, + /* + * Generate WeatherObjects based on One Call forecast information + */ + generateWeatherObjectsFromOnecall(data) { + if (this.config.weatherEndpoint === "/onecall") { + return this.fetchOnecall(data); + } + // if weatherEndpoint does not match onecall, what should be returned? + const weatherData = { current: new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits), hours: [], days: [] }; + return weatherData; + }, + /* * fetch forecast information for 3-hourly forecast (available for free subscription). */ @@ -113,7 +144,6 @@ WeatherProvider.register("openweathermap", { let weather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); for (const forecast of forecasts) { - if (date !== moment(forecast.dt, "X").format("YYYY-MM-DD")) { // calculate minimum/maximum temperature, specify rain amount weather.minTemperature = Math.min.apply(null, minTemp); @@ -139,7 +169,6 @@ WeatherProvider.register("openweathermap", { // If the first value of today is later than 17:00, we have an icon at least! weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); - } if (moment(forecast.dt, "X").format("H") >= 8 && moment(forecast.dt, "X").format("H") <= 17) { @@ -225,6 +254,129 @@ WeatherProvider.register("openweathermap", { return days; }, + /* + * Fetch One Call forecast information (available for free subscription). + * Factors in timezone offsets. + * Minutely forecasts are excluded for the moment, see getParams(). + */ + fetchOnecall(data) { + let precip = false; + + // get current weather, if requested + const current = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); + if (data.hasOwnProperty("current")) { + current.date = moment(data.current.dt, "X").utcOffset(data.timezone_offset / 60); + current.windSpeed = data.current.wind_speed; + current.windDirection = data.current.wind_deg; + current.sunrise = moment(data.current.sunrise, "X").utcOffset(data.timezone_offset / 60); + current.sunset = moment(data.current.sunset, "X").utcOffset(data.timezone_offset / 60); + current.temperature = data.current.temp; + current.weatherType = this.convertWeatherType(data.current.weather[0].icon); + current.humidity = data.current.humidity; + if (data.current.hasOwnProperty("rain") && !isNaN(data.current["rain"]["1h"])) { + if (this.config.units === "imperial") { + current.rain = data.current["rain"]["1h"] / 25.4; + } else { + current.rain = data.current["rain"]["1h"]; + } + precip = true; + } + if (data.current.hasOwnProperty("snow") && !isNaN(data.current["snow"]["1h"])) { + if (this.config.units === "imperial") { + current.snow = data.current["snow"]["1h"] / 25.4; + } else { + current.snow = data.current["snow"]["1h"]; + } + precip = true; + } + if (precip) { + current.precipitation = current.rain + current.snow; + } + current.feelsLikeTemp = data.current.feels_like; + } + + let weather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); + + // get hourly weather, if requested + const hours = []; + if (data.hasOwnProperty("hourly")) { + for (const hour of data.hourly) { + weather.date = moment(hour.dt, "X").utcOffset(data.timezone_offset / 60); + // weather.date = moment(hour.dt, "X").utcOffset(data.timezone_offset/60).format(onecallDailyFormat+","+onecallHourlyFormat); + weather.temperature = hour.temp; + weather.feelsLikeTemp = hour.feels_like; + weather.humidity = hour.humidity; + weather.windSpeed = hour.wind_speed; + weather.windDirection = hour.wind_deg; + weather.weatherType = this.convertWeatherType(hour.weather[0].icon); + precip = false; + if (hour.hasOwnProperty("rain") && !isNaN(hour.rain["1h"])) { + if (this.config.units === "imperial") { + weather.rain = hour.rain["1h"] / 25.4; + } else { + weather.rain = hour.rain["1h"]; + } + precip = true; + } + if (hour.hasOwnProperty("snow") && !isNaN(hour.snow["1h"])) { + if (this.config.units === "imperial") { + weather.snow = hour.snow["1h"] / 25.4; + } else { + weather.snow = hour.snow["1h"]; + } + precip = true; + } + if (precip) { + weather.precipitation = weather.rain + weather.snow; + } + + hours.push(weather); + weather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); + } + } + + // get daily weather, if requested + const days = []; + if (data.hasOwnProperty("daily")) { + for (const day of data.daily) { + weather.date = moment(day.dt, "X").utcOffset(data.timezone_offset / 60); + weather.sunrise = moment(day.sunrise, "X").utcOffset(data.timezone_offset / 60); + weather.sunset = moment(day.sunset, "X").utcOffset(data.timezone_offset / 60); + weather.minTemperature = day.temp.min; + weather.maxTemperature = day.temp.max; + weather.humidity = day.humidity; + weather.windSpeed = day.wind_speed; + weather.windDirection = day.wind_deg; + weather.weatherType = this.convertWeatherType(day.weather[0].icon); + precip = false; + if (!isNaN(day.rain)) { + if (this.config.units === "imperial") { + weather.rain = day.rain / 25.4; + } else { + weather.rain = day.rain; + } + precip = true; + } + if (!isNaN(day.snow)) { + if (this.config.units === "imperial") { + weather.snow = day.snow / 25.4; + } else { + weather.snow = day.snow; + } + precip = true; + } + if (precip) { + weather.precipitation = weather.rain + weather.snow; + } + + days.push(weather); + weather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); + } + } + + return { current: current, hours: hours, days: days }; + }, + /* * Convert the OpenWeatherMap icons to a more usable name. */ @@ -260,16 +412,28 @@ WeatherProvider.register("openweathermap", { */ getParams() { let params = "?"; - if(this.config.locationID) { + if (this.config.weatherEndpoint === "/onecall") { + params += "lat=" + this.config.lat; + params += "&lon=" + this.config.lon; + if (this.config.type === "current") { + params += "&exclude=minutely,hourly,daily"; + } else if (this.config.type === "hourly") { + params += "&exclude=current,minutely,daily"; + } else if (this.config.type === "daily" || this.config.type === "forecast") { + params += "&exclude=current,minutely,hourly"; + } else { + params += "&exclude=minutely"; + } + } else if (this.config.locationID) { params += "id=" + this.config.locationID; - } else if(this.config.location) { + } else if (this.config.location) { params += "q=" + this.config.location; } else if (this.firstEvent && this.firstEvent.geo) { params += "lat=" + this.firstEvent.geo.lat + "&lon=" + this.firstEvent.geo.lon; } else if (this.firstEvent && this.firstEvent.location) { params += "q=" + this.firstEvent.location; } else { - this.hide(this.config.animationSpeed, {lockString:this.identifier}); + this.hide(this.config.animationSpeed, { lockString: this.identifier }); return; } diff --git a/modules/default/weather/providers/ukmetoffice.js b/modules/default/weather/providers/ukmetoffice.js index 17cc463e..f1a50074 100755 --- a/modules/default/weather/providers/ukmetoffice.js +++ b/modules/default/weather/providers/ukmetoffice.js @@ -9,7 +9,6 @@ * This class is a provider for UK Met Office Datapoint. */ WeatherProvider.register("ukmetoffice", { - // Set the name of the provider. // This isn't strictly necessary, since it will fallback to the provider identifier // But for debugging (and future alerts) it would be nice to have the real name. @@ -23,7 +22,7 @@ WeatherProvider.register("ukmetoffice", { // Overwrite the fetchCurrentWeather method. fetchCurrentWeather() { this.fetchData(this.getUrl("3hourly")) - .then(data => { + .then((data) => { if (!data || !data.SiteRep || !data.SiteRep.DV || !data.SiteRep.DV.Location || !data.SiteRep.DV.Location.Period || data.SiteRep.DV.Location.Period.length === 0) { // Did not receive usable new data. // Maybe this needs a better check? @@ -35,7 +34,7 @@ WeatherProvider.register("ukmetoffice", { const currentWeather = this.generateWeatherObjectFromCurrentWeather(data); this.setCurrentWeather(currentWeather); }) - .catch(function(request) { + .catch(function (request) { Log.error("Could not load data ... ", request); }) .finally(() => this.updateAvailable()); @@ -44,7 +43,7 @@ WeatherProvider.register("ukmetoffice", { // Overwrite the fetchCurrentWeather method. fetchWeatherForecast() { this.fetchData(this.getUrl("daily")) - .then(data => { + .then((data) => { if (!data || !data.SiteRep || !data.SiteRep.DV || !data.SiteRep.DV.Location || !data.SiteRep.DV.Location.Period || data.SiteRep.DV.Location.Period.length === 0) { // Did not receive usable new data. // Maybe this needs a better check? @@ -56,7 +55,7 @@ WeatherProvider.register("ukmetoffice", { const forecast = this.generateWeatherObjectsFromForecast(data); this.setWeatherForecast(forecast); }) - .catch(function(request) { + .catch(function (request) { Log.error("Could not load data ... ", request); }) .finally(() => this.updateAvailable()); @@ -83,18 +82,17 @@ WeatherProvider.register("ukmetoffice", { // loop round each of the (5) periods, look for today (the first period may be yesterday) for (var i in currentWeatherData.SiteRep.DV.Location.Period) { - let periodDate = moment.utc(currentWeatherData.SiteRep.DV.Location.Period[i].value.substr(0,10), "YYYY-MM-DD"); + let periodDate = moment.utc(currentWeatherData.SiteRep.DV.Location.Period[i].value.substr(0, 10), "YYYY-MM-DD"); // ignore if period is before today if (periodDate.isSameOrAfter(moment.utc().startOf("day"))) { - // check this is the period we want, after today the diff will be -ve if (moment().diff(periodDate, "minutes") > 0) { // loop round the reports looking for the one we are in // $ value specifies the time in minutes-of-the-day: 0, 180, 360,...1260 - for (var j in currentWeatherData.SiteRep.DV.Location.Period[i].Rep){ + for (var j in currentWeatherData.SiteRep.DV.Location.Period[i].Rep) { let p = currentWeatherData.SiteRep.DV.Location.Period[i].Rep[j].$; - if (timeInMins >= p && timeInMins-180 < p) { + if (timeInMins >= p && timeInMins - 180 < p) { // finally got the one we want, so populate weather object currentWeather.humidity = currentWeatherData.SiteRep.DV.Location.Period[i].Rep[j].H; currentWeather.temperature = this.convertTemp(currentWeatherData.SiteRep.DV.Location.Period[i].Rep[j].T); @@ -121,7 +119,6 @@ WeatherProvider.register("ukmetoffice", { * Generate WeatherObjects based on forecast information */ generateWeatherObjectsFromForecast(forecasts) { - const days = []; // loop round the (5) periods getting the data @@ -131,12 +128,12 @@ WeatherProvider.register("ukmetoffice", { // data times are always UTC const dateStr = forecasts.SiteRep.DV.Location.Period[j].value; - let periodDate = moment.utc(dateStr.substr(0,10), "YYYY-MM-DD"); + let periodDate = moment.utc(dateStr.substr(0, 10), "YYYY-MM-DD"); // ignore if period is before today if (periodDate.isSameOrAfter(moment.utc().startOf("day"))) { // populate the weather object - weather.date = moment.utc(dateStr.substr(0,10), "YYYY-MM-DD"); + weather.date = moment.utc(dateStr.substr(0, 10), "YYYY-MM-DD"); weather.minTemperature = this.convertTemp(forecasts.SiteRep.DV.Location.Period[j].Rep[1].Nm); weather.maxTemperature = this.convertTemp(forecasts.SiteRep.DV.Location.Period[j].Rep[0].Dm); weather.weatherType = this.convertWeatherType(forecasts.SiteRep.DV.Location.Period[j].Rep[0].W); @@ -207,7 +204,7 @@ WeatherProvider.register("ukmetoffice", { * Convert temp (from degrees C) if required */ convertTemp(tempInC) { - return this.tempUnits === "imperial" ? tempInC * 9 / 5 + 32 : tempInC; + return this.tempUnits === "imperial" ? (tempInC * 9) / 5 + 32 : tempInC; }, /* @@ -222,22 +219,22 @@ WeatherProvider.register("ukmetoffice", { */ convertWindDirection(windDirection) { const windCardinals = { - "N": 0, - "NNE": 22, - "NE": 45, - "ENE": 67, - "E": 90, - "ESE": 112, - "SE": 135, - "SSE": 157, - "S": 180, - "SSW": 202, - "SW": 225, - "WSW": 247, - "W": 270, - "WNW": 292, - "NW": 315, - "NNW": 337 + N: 0, + NNE: 22, + NE: 45, + ENE: 67, + E: 90, + ESE: 112, + SE: 135, + SSE: 157, + S: 180, + SSW: 202, + SW: 225, + WSW: 247, + W: 270, + WNW: 292, + NW: 315, + NNW: 337 }; return windCardinals.hasOwnProperty(windDirection) ? windCardinals[windDirection] : null; diff --git a/modules/default/weather/providers/ukmetofficedatahub.js b/modules/default/weather/providers/ukmetofficedatahub.js new file mode 100644 index 00000000..9ed74684 --- /dev/null +++ b/modules/default/weather/providers/ukmetofficedatahub.js @@ -0,0 +1,303 @@ +/* Magic Mirror + * Module: Weather + * + * By Malcolm Oakes https://github.com/maloakes + * Existing Met Office provider edited for new MetOffice Data Hub by CreepinJesus http://github.com/XBCreepinJesus + * MIT Licensed. + * + * This class is a provider for UK Met Office Data Hub (the replacement for their Data Point services). + * For more information on Data Hub, see https://www.metoffice.gov.uk/services/data/datapoint/notifications/weather-datahub + * Data available: + * Hourly data for next 2 days ("hourly") - https://www.metoffice.gov.uk/binaries/content/assets/metofficegovuk/pdf/data/global-spot-data-hourly.pdf + * 3-hourly data for the next 7 days ("3hourly") - https://www.metoffice.gov.uk/binaries/content/assets/metofficegovuk/pdf/data/global-spot-data-3-hourly.pdf + * Daily data for the next 7 days ("daily") - https://www.metoffice.gov.uk/binaries/content/assets/metofficegovuk/pdf/data/global-spot-data-daily.pdf + */ + +/* NOTES + * This provider requires longitude/latitude coordinates, rather than a location ID (as with the previous Met Office provider) + * Provide the following in your config.js file: + * weatherProvider: "ukmetofficedatahub", + * apiBase: "https://api-metoffice.apiconnect.ibmcloud.com/metoffice/production/v0/forecasts/point/", + * apiKey: "[YOUR API KEY]", + * apiSecret: "[YOUR API SECRET]]", + * lat: [LATITUDE (DECIMAL)], + * lon: [LONGITUDE (DECIMAL)], + * windUnits: "mps" | "kph" | "mph" (default) + * tempUnits: "imperial" | "metric" (default) + * + * At time of writing, free accounts are limited to 360 requests a day per service (hourly, 3hourly, daily); take this in mind when + * setting your update intervals. For reference, 360 requests per day is once every 4 minutes. + * + * Pay attention to the units of the supplied data from the Met Office - it is given in SI/metric units where applicable: + * - Temperatures are in degrees Celsius (°C) + * - Wind speeds are in metres per second (m/s) + * - Wind direction given in degrees (°) + * - Pressures are in Pascals (Pa) + * - Distances are in metres (m) + * - Probabilities and humidity are given as percentages (%) + * - Precipitation is measured in millimetres (mm) with rates per hour (mm/h) + * + * See the PDFs linked above for more information on the data their corresponding units. + */ + +WeatherProvider.register("ukmetofficedatahub", { + // Set the name of the provider. + providerName: "UK Met Office (DataHub)", + + // Build URL with query strings according to DataHub API (https://metoffice.apiconnect.ibmcloud.com/metoffice/production/api) + getUrl(forecastType) { + let queryStrings = "?"; + queryStrings += "latitude=" + this.config.lat; + queryStrings += "&longitude=" + this.config.lon; + if (this.config.appendLocationNameToHeader) { + queryStrings += "&includeLocationName=" + true; + } + + // Return URL, making sure there is a trailing "/" in the base URL. + return this.config.apiBase + (this.config.apiBase.endsWith("/") ? "" : "/") + forecastType + queryStrings; + }, + + // Build the list of headers for the request + // For DataHub requests, the API key/secret are sent in the headers rather than as query strings. + // Headers defined according to Data Hub API (https://metoffice.apiconnect.ibmcloud.com/metoffice/production/api) + getHeaders() { + let headers = { + accept: "application/json", + "x-ibm-client-id": this.config.apiKey, + "x-ibm-client-secret": this.config.apiSecret + }; + + return headers; + }, + + // Fetch data using supplied URL and request headers + async fetchWeather(url, headers) { + const response = await fetch(url, { headers: headers }); + + // Return JSON data + return response.json(); + }, + + // Fetch hourly forecast data (to use for current weather) + fetchCurrentWeather() { + this.fetchWeather(this.getUrl("hourly"), this.getHeaders()) + .then((data) => { + // Check data is useable + if (!data || !data.features || !data.features[0].properties || !data.features[0].properties.timeSeries || data.features[0].properties.timeSeries.length == 0) { + // Did not receive usable new data. + // Maybe this needs a better check? + Log.error("Possibly bad current/hourly data?"); + Log.info(data); + return; + } + + // Set location name + this.setFetchedLocation(`${data.features[0].properties.location.name}`); + + // Generate current weather data + const currentWeather = this.generateWeatherObjectFromCurrentWeather(data); + this.setCurrentWeather(currentWeather); + }) + + // Catch any error(s) + .catch((error) => Log.error("Could not load data: " + error.message)) + + // Let the module know there're new data available + .finally(() => this.updateAvailable()); + }, + + // Create a WeatherObject using current weather data (data for the current hour) + generateWeatherObjectFromCurrentWeather(currentWeatherData) { + const currentWeather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); + + // Extract the actual forecasts + let forecastDataHours = currentWeatherData.features[0].properties.timeSeries; + + // Define now + let nowUtc = moment.utc(); + + // Find hour that contains the current time + for (hour in forecastDataHours) { + let forecastTime = moment.utc(forecastDataHours[hour].time); + if (nowUtc.isSameOrAfter(forecastTime) && nowUtc.isBefore(moment(forecastTime.add(1, "h")))) { + currentWeather.date = forecastTime; + currentWeather.windSpeed = this.convertWindSpeed(forecastDataHours[hour].windSpeed10m); + currentWeather.windDirection = forecastDataHours[hour].windDirectionFrom10m; + currentWeather.temperature = this.convertTemp(forecastDataHours[hour].screenTemperature); + currentWeather.minTemperature = this.convertTemp(forecastDataHours[hour].minScreenAirTemp); + currentWeather.maxTemperature = this.convertTemp(forecastDataHours[hour].maxScreenAirTemp); + currentWeather.weatherType = this.convertWeatherType(forecastDataHours[hour].significantWeatherCode); + currentWeather.humidity = forecastDataHours[hour].screenRelativeHumidity; + currentWeather.rain = forecastDataHours[hour].totalPrecipAmount; + currentWeather.snow = forecastDataHours[hour].totalSnowAmount; + currentWeather.precipitation = forecastDataHours[hour].probOfPrecipitation; + currentWeather.feelsLikeTemp = this.convertTemp(forecastDataHours[hour].feelsLikeTemperature); + + // Pass on full details so they can be used in custom templates + // Note the units of the supplied data when using this (see top of file) + currentWeather.rawData = forecastDataHours[hour]; + } + } + + // Determine the sunrise/sunset times - (still) not supplied in UK Met Office data + // Passes {longitude, latitude, height} to calcAstroData + // Could just pass lat/long from this.config, but returned data from MO also contains elevation + let times = this.calcAstroData(currentWeatherData.features[0].geometry.coordinates); + currentWeather.sunrise = times[0]; + currentWeather.sunset = times[1]; + + return currentWeather; + }, + + // Fetch daily forecast data + fetchWeatherForecast() { + this.fetchWeather(this.getUrl("daily"), this.getHeaders()) + .then((data) => { + // Check data is useable + if (!data || !data.features || !data.features[0].properties || !data.features[0].properties.timeSeries || data.features[0].properties.timeSeries.length == 0) { + // Did not receive usable new data. + // Maybe this needs a better check? + Log.error("Possibly bad forecast data?"); + Log.info(data); + return; + } + + // Set location name + this.setFetchedLocation(`${data.features[0].properties.location.name}`); + + // Generate the forecast data + const forecast = this.generateWeatherObjectsFromForecast(data); + this.setWeatherForecast(forecast); + }) + + // Catch any error(s) + .catch((error) => Log.error("Could not load data: " + error.message)) + + // Let the module know there're new data available + .finally(() => this.updateAvailable()); + }, + + // Create a WeatherObject for each day using daily forecast data + generateWeatherObjectsFromForecast(forecasts) { + const dailyForecasts = []; + + // Extract the actual forecasts + let forecastDataDays = forecasts.features[0].properties.timeSeries; + + // Define today + let today = moment.utc().startOf("date"); + + // Go through each day in the forecasts + for (day in forecastDataDays) { + const forecastWeather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); + + // Get date of forecast + let forecastDate = moment.utc(forecastDataDays[day].time); + + // Check if forecast is for today or in the future (i.e., ignore yesterday's forecast) + if (forecastDate.isSameOrAfter(today)) { + forecastWeather.date = forecastDate; + forecastWeather.minTemperature = this.convertTemp(forecastDataDays[day].nightMinScreenTemperature); + forecastWeather.maxTemperature = this.convertTemp(forecastDataDays[day].dayMaxScreenTemperature); + + // Using daytime forecast values + forecastWeather.windSpeed = this.convertWindSpeed(forecastDataDays[day].midday10MWindSpeed); + forecastWeather.windDirection = forecastDataDays[day].midday10MWindDirection; + forecastWeather.weatherType = this.convertWeatherType(forecastDataDays[day].daySignificantWeatherCode); + forecastWeather.precipitation = forecastDataDays[day].dayProbabilityOfPrecipitation; + forecastWeather.temperature = forecastDataDays[day].dayMaxScreenTemperature; + forecastWeather.humidity = forecastDataDays[day].middayRelativeHumidity; + forecastWeather.rain = forecastDataDays[day].dayProbabilityOfRain; + forecastWeather.snow = forecastDataDays[day].dayProbabilityOfSnow; + forecastWeather.feelsLikeTemp = this.convertTemp(forecastDataDays[day].dayMaxFeelsLikeTemp); + + // Pass on full details so they can be used in custom templates + // Note the units of the supplied data when using this (see top of file) + + forecastWeather.rawData = forecastDataDays[day]; + + dailyForecasts.push(forecastWeather); + } + } + + return dailyForecasts; + }, + + // Set the fetched location name. + setFetchedLocation: function (name) { + this.fetchedLocationName = name; + }, + + // Calculate sunrise/sunset times + calcAstroData(location) { + const sunTimes = []; + + // Careful to pass values to SunCalc in correct order (latitude, longitude, elevation) + let times = SunCalc.getTimes(new Date(), location[1], location[0], location[2]); + sunTimes.push(moment(times.sunrise, "X")); + sunTimes.push(moment(times.sunset, "X")); + + return sunTimes; + }, + + // Convert temperatures to Fahrenheit (from degrees C), if required + convertTemp(tempInC) { + return this.config.tempUnits === "imperial" ? (tempInC * 9) / 5 + 32 : tempInC; + }, + + // Convert wind speed from metres per second + // To keep the supplied metres per second units, use "mps" + // To use kilometres per hour, use "kph" + // Else assumed imperial and the value is returned in miles per hour (a Met Office user is likely to be UK-based) + convertWindSpeed(windInMpS) { + if (this.config.windUnits == "mps") { + return windInMpS; + } + + if (this.config.windUnits == "kph" || this.config.windUnits == "metric") { + return windInMpS * 3.6; + } + + return windInMpS * 2.23694; + }, + + // Match the Met Office "significant weather code" to a weathericons.css icon + // Use: https://metoffice.apiconnect.ibmcloud.com/metoffice/production/node/264 + // and: https://erikflowers.github.io/weather-icons/ + convertWeatherType(weatherType) { + const weatherTypes = { + 0: "night-clear", + 1: "day-sunny", + 2: "night-alt-cloudy", + 3: "day-cloudy", + 5: "fog", + 6: "fog", + 7: "cloudy", + 8: "cloud", + 9: "night-sprinkle", + 10: "day-sprinkle", + 11: "raindrops", + 12: "sprinkle", + 13: "night-alt-showers", + 14: "day-showers", + 15: "rain", + 16: "night-alt-sleet", + 17: "day-sleet", + 18: "sleet", + 19: "night-alt-hail", + 20: "day-hail", + 21: "hail", + 22: "night-alt-snow", + 23: "day-snow", + 24: "snow", + 25: "night-alt-snow", + 26: "day-snow", + 27: "snow", + 28: "night-alt-thunderstorm", + 29: "day-thunderstorm", + 30: "thunderstorm" + }; + + return weatherTypes.hasOwnProperty(weatherType) ? weatherTypes[weatherType] : null; + } +}); diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js index 68211b56..1b28bba1 100755 --- a/modules/default/weather/providers/weathergov.js +++ b/modules/default/weather/providers/weathergov.js @@ -3,77 +3,155 @@ /* Magic Mirror * Module: Weather * Provider: weather.gov + * https://weather-gov.github.io/api/general-faqs * - * By Vince Peri + * Original by Vince Peri * MIT Licensed. * * This class is a provider for weather.gov. * Note that this is only for US locations (lat and lon) and does not require an API key - * Since it is free, there are some items missing - like sunrise, sunset, humidity, etc. + * Since it is free, there are some items missing - like sunrise, sunset */ -WeatherProvider.register("weathergov", { +WeatherProvider.register("weathergov", { // Set the name of the provider. // This isn't strictly necessary, since it will fallback to the provider identifier // But for debugging (and future alerts) it would be nice to have the real name. providerName: "Weather.gov", + // Flag all needed URLs availability + configURLs: false, + + //This API has multiple urls involved + forecastURL: "tbd", + forecastHourlyURL: "tbd", + forecastGridDataURL: "tbd", + observationStationsURL: "tbd", + stationObsURL: "tbd", + + // Called to set the config, this config is the same as the weather module's config. + setConfig: function (config) { + this.config = config; + (this.config.apiBase = "https://api.weather.gov"), this.fetchWxGovURLs(this.config); + }, + + // Called when the weather provider is about to start. + start: function () { + Log.info(`Weather provider: ${this.providerName} started.`); + }, + + // This returns the name of the fetched location or an empty string. + fetchedLocation: function () { + return this.fetchedLocationName || ""; + }, + // Overwrite the fetchCurrentWeather method. fetchCurrentWeather() { - this.fetchData(this.getUrl()) - .then(data => { - if (!data || !data.properties || !data.properties.periods || !data.properties.periods.length) { + if (!this.configURLs) { + Log.info("fetch wx waiting on config URLs"); + return; + } + this.fetchData(this.stationObsURL) + .then((data) => { + if (!data || !data.properties) { // Did not receive usable new data. - // Maybe this needs a better check? return; } - - const currentWeather = this.generateWeatherObjectFromCurrentWeather(data.properties.periods[0]); + const currentWeather = this.generateWeatherObjectFromCurrentWeather(data.properties); this.setCurrentWeather(currentWeather); }) - .catch(function(request) { - Log.error("Could not load data ... ", request); + .catch(function (request) { + Log.error("Could not load station obs data ... ", request); }) .finally(() => this.updateAvailable()); }, - // Overwrite the fetchCurrentWeather method. + // Overwrite the fetchWeatherForecast method. fetchWeatherForecast() { - this.fetchData(this.getUrl()) - .then(data => { + if (!this.configURLs) { + Log.info("fetch wx waiting on config URLs"); + return; + } + this.fetchData(this.forecastURL) + .then((data) => { if (!data || !data.properties || !data.properties.periods || !data.properties.periods.length) { // Did not receive usable new data. - // Maybe this needs a better check? return; } - const forecast = this.generateWeatherObjectsFromForecast(data.properties.periods); this.setWeatherForecast(forecast); }) - .catch(function(request) { - Log.error("Could not load data ... ", request); + .catch(function (request) { + Log.error("Could not load forecast hourly data ... ", request); }) .finally(() => this.updateAvailable()); }, /** Weather.gov Specific Methods - These are not part of the default provider methods */ + /* - * Gets the complete url for the request + * Get specific URLs */ - getUrl() { - return this.config.apiBase + this.config.lat + "," + this.config.lon + this.config.weatherEndpoint; + fetchWxGovURLs(config) { + this.fetchData(`${config.apiBase}/points/${config.lat},${config.lon}`) + .then((data) => { + if (!data || !data.properties) { + // points URL did not respond with usable data. + return; + } + this.fetchedLocationName = data.properties.relativeLocation.properties.city + ", " + data.properties.relativeLocation.properties.state; + Log.log("Forecast location is " + this.fetchedLocationName); + this.forecastURL = data.properties.forecast; + this.forecastHourlyURL = data.properties.forecastHourly; + this.forecastGridDataURL = data.properties.forecastGridData; + this.observationStationsURL = data.properties.observationStations; + // with this URL, we chain another promise for the station obs URL + return this.fetchData(data.properties.observationStations); + }) + .then((obsData) => { + if (!obsData || !obsData.features) { + // obs station URL did not respond with usable data. + return; + } + this.stationObsURL = obsData.features[0].id + "/observations/latest"; + }) + .catch((err) => { + Log.error(err); + }) + .finally(() => { + // excellent, let's fetch some actual wx data + this.configURLs = true; + this.fetchCurrentWeather(); + }); }, /* * Generate a WeatherObject based on currentWeatherInformation + * Weather.gov API uses specific units; API does not include choice of units + * ... object needs data in units based on config! */ generateWeatherObjectFromCurrentWeather(currentWeatherData) { const currentWeather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits); - currentWeather.temperature = currentWeatherData.temperature; - currentWeather.windSpeed = currentWeatherData.windSpeed.split(" ", 1); - currentWeather.windDirection = this.convertWindDirection(currentWeatherData.windDirection); - currentWeather.weatherType = this.convertWeatherType(currentWeatherData.shortForecast, currentWeatherData.isDaytime); + currentWeather.date = moment(currentWeatherData.timestamp); + currentWeather.temperature = this.convertTemp(currentWeatherData.temperature.value); + currentWeather.windSpeed = this.covertSpeed(currentWeatherData.windSpeed.value); + currentWeather.windDirection = currentWeatherData.windDirection.value; + currentWeather.minTemperature = this.convertTemp(currentWeatherData.minTemperatureLast24Hours.value); + currentWeather.maxTemperature = this.convertTemp(currentWeatherData.maxTemperatureLast24Hours.value); + currentWeather.humidity = Math.round(currentWeatherData.relativeHumidity.value); + currentWeather.rain = null; + currentWeather.snow = null; + currentWeather.precipitation = this.convertLength(currentWeatherData.precipitationLastHour.value); + currentWeather.feelsLikeTemp = this.convertTemp(currentWeatherData.heatIndex.value); + + let isDaytime = true; + if (currentWeatherData.icon.includes("day")) { + isDaytime = true; + } else { + isDaytime = false; + } + currentWeather.weatherType = this.convertWeatherType(currentWeatherData.textDescription, isDaytime); // determine the sunrise/sunset times - not supplied in weather.gov data let times = this.calcAstroData(this.config.lat, this.config.lon); @@ -105,9 +183,7 @@ WeatherProvider.register("weathergov", { weather.precipitation = 0; for (const forecast of forecasts) { - if (date !== moment(forecast.startTime).format("YYYY-MM-DD")) { - // calculate minimum/maximum temperature, specify rain amount weather.minTemperature = Math.min.apply(null, minTemp); weather.maxTemperature = Math.max.apply(null, maxTemp); @@ -127,7 +203,7 @@ WeatherProvider.register("weathergov", { // specify date weather.date = moment(forecast.startTime); - // If the first value of today is later than 17:00, we have an icon at least! + // use the forecast isDayTime attribute to help build the weatherType label weather.weatherType = this.convertWeatherType(forecast.shortForecast, forecast.isDaytime); } @@ -151,6 +227,34 @@ WeatherProvider.register("weathergov", { return days.slice(1); }, + /* + * Unit conversions + */ + // conversion to fahrenheit + convertTemp(temp) { + if (this.config.tempUnits === "imperial") { + return (9 / 5) * temp + 32; + } else { + return temp; + } + }, + // conversion to mph + covertSpeed(metSec) { + if (this.config.windUnits === "imperial") { + return metSec * 2.23694; + } else { + return metSec; + } + }, + // conversion to inches + convertLength(meters) { + if (this.config.units === "imperial") { + return meters * 39.3701; + } else { + return meters; + } + }, + /* * Calculate the astronomical data */ @@ -240,22 +344,22 @@ WeatherProvider.register("weathergov", { */ convertWindDirection(windDirection) { const windCardinals = { - "N": 0, - "NNE": 22, - "NE": 45, - "ENE": 67, - "E": 90, - "ESE": 112, - "SE": 135, - "SSE": 157, - "S": 180, - "SSW": 202, - "SW": 225, - "WSW": 247, - "W": 270, - "WNW": 292, - "NW": 315, - "NNW": 337 + N: 0, + NNE: 22, + NE: 45, + ENE: 67, + E: 90, + ESE: 112, + SE: 135, + SSE: 157, + S: 180, + SSW: 202, + SW: 225, + WSW: 247, + W: 270, + WNW: 292, + NW: 315, + NNW: 337 }; return windCardinals.hasOwnProperty(windDirection) ? windCardinals[windDirection] : null; diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 6e277447..b5a68a52 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -6,16 +6,17 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -Module.register("weather",{ +Module.register("weather", { // Default module config. defaults: { weatherProvider: "openweathermap", roundTemp: false, - type: "current", //current, forecast + type: "current", // current, forecast, daily (equivalent to forecast), hourly (only with OpenWeatherMap /onecall endpoint) + lat: 0, + lon: 0, location: false, locationID: false, - appid: "", units: config.units, tempUnits: config.units, @@ -31,19 +32,23 @@ Module.register("weather",{ useBeaufort: true, lang: config.language, showHumidity: false, + showSun: true, degreeLabel: false, decimalSymbol: ".", showIndoorTemperature: false, showIndoorHumidity: false, maxNumberOfDays: 5, + maxEntries: 5, fade: true, fadePoint: 0.25, // Start on 1/4th of the list. initialLoadDelay: 0, // 0 seconds delay retryDelay: 2500, + apiKey: "", + apiSecret: "", apiVersion: "2.5", - apiBase: "https://api.openweathermap.org/data/", + apiBase: "https://api.openweathermap.org/data/", // TODO: this should not be part of the weather.js file, but should be contained in the openweatherprovider weatherEndpoint: "/weather", appendLocationNameToHeader: true, @@ -60,28 +65,23 @@ Module.register("weather",{ weatherProvider: null, // Define required scripts. - getStyles: function() { + getStyles: function () { return ["font-awesome.css", "weather-icons.css", "weather.css"]; }, // Return the scripts that are necessary for the weather module. getScripts: function () { - return [ - "moment.js", - "weatherprovider.js", - "weatherobject.js", - "suncalc.js", - this.file("providers/" + this.config.weatherProvider.toLowerCase() + ".js") - ]; + return ["moment.js", "weatherprovider.js", "weatherobject.js", "suncalc.js", this.file("providers/" + this.config.weatherProvider.toLowerCase() + ".js")]; }, // Override getHeader method. - getHeader: function() { - if (this.config.appendLocationNameToHeader && this.data.header !== undefined && this.weatherProvider) { - return this.data.header + " " + this.weatherProvider.fetchedLocation(); + getHeader: function () { + if (this.config.appendLocationNameToHeader && this.weatherProvider) { + if (this.data.header) return this.data.header + " " + this.weatherProvider.fetchedLocation(); + else return this.weatherProvider.fetchedLocation(); } - return this.data.header; + return this.data.header ? this.data.header : ""; }, // Start the weather module. @@ -102,7 +102,7 @@ Module.register("weather",{ }, // Override notification handler. - notificationReceived: function(notification, payload, sender) { + notificationReceived: function (notification, payload, sender) { if (notification === "CALENDAR_EVENTS") { var senderClasses = sender.data.classes.toLowerCase().split(" "); if (senderClasses.indexOf(this.config.calendarClass.toLowerCase()) !== -1) { @@ -128,7 +128,17 @@ Module.register("weather",{ // Select the template depending on the display type. getTemplate: function () { - return `${this.config.type.toLowerCase()}.njk`; + switch (this.config.type.toLowerCase()) { + case "current": + return `current.njk`; + case "hourly": + return `hourly.njk`; + case "daily": + case "forecast": + return `forecast.njk`; + default: + return `${this.config.type.toLowerCase()}.njk`; + } }, // Add all the data to the template. @@ -137,6 +147,7 @@ Module.register("weather",{ config: this.config, current: this.weatherProvider.currentWeather(), forecast: this.weatherProvider.weatherForecast(), + weatherData: this.weatherProvider.weatherData(), indoor: { humidity: this.indoorHumidity, temperature: this.indoorTemperature @@ -145,20 +156,22 @@ Module.register("weather",{ }, // What to do when the weather provider has new information available? - updateAvailable: function() { + updateAvailable: function () { Log.log("New weather information available."); this.updateDom(0); this.scheduleUpdate(); }, - scheduleUpdate: function(delay = null) { + scheduleUpdate: function (delay = null) { var nextLoad = this.config.updateInterval; if (delay !== null && delay >= 0) { nextLoad = delay; } setTimeout(() => { - if (this.config.type === "forecast") { + if (this.config.weatherEndpoint === "/onecall") { + this.weatherProvider.fetchWeatherData(); + } else if (this.config.type === "forecast") { this.weatherProvider.fetchWeatherForecast(); } else { this.weatherProvider.fetchCurrentWeather(); @@ -166,88 +179,113 @@ Module.register("weather",{ }, nextLoad); }, - roundValue: function(temperature) { + roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; return parseFloat(temperature).toFixed(decimals); }, addFilters() { - this.nunjucksEnvironment().addFilter("formatTime", function(date) { - date = moment(date); + this.nunjucksEnvironment().addFilter( + "formatTime", + function (date) { + date = moment(date); - if (this.config.timeFormat !== 24) { - if (this.config.showPeriod) { - if (this.config.showPeriodUpper) { - return date.format("h:mm A"); + if (this.config.timeFormat !== 24) { + if (this.config.showPeriod) { + if (this.config.showPeriodUpper) { + return date.format("h:mm A"); + } else { + return date.format("h:mm a"); + } } else { - return date.format("h:mm a"); - } - } else { - return date.format("h:mm"); - } - } - - return date.format("HH:mm"); - }.bind(this)); - - this.nunjucksEnvironment().addFilter("unit", function (value, type) { - if (type === "temperature") { - if (this.config.tempUnits === "metric" || this.config.tempUnits === "imperial") { - value += "°"; - } - if (this.config.degreeLabel) { - if (this.config.tempUnits === "metric") { - value += "C"; - } else if (this.config.tempUnits === "imperial") { - value += "F"; - } else { - value += "K"; + return date.format("h:mm"); } } - } else if (type === "precip") { - if (isNaN(value) || value === 0 || value.toFixed(2) === "0.00") { - value = ""; - } else { - if (this.config.weatherProvider === "ukmetoffice") { - value += "%"; - } else { - value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`; + + return date.format("HH:mm"); + }.bind(this) + ); + + this.nunjucksEnvironment().addFilter( + "unit", + function (value, type) { + if (type === "temperature") { + if (this.config.tempUnits === "metric" || this.config.tempUnits === "imperial") { + value += "°"; } + if (this.config.degreeLabel) { + if (this.config.tempUnits === "metric") { + value += "C"; + } else if (this.config.tempUnits === "imperial") { + value += "F"; + } else { + value += "K"; + } + } + } else if (type === "precip") { + if (value === null || isNaN(value) || value === 0 || value.toFixed(2) === "0.00") { + value = ""; + } else { + if (this.config.weatherProvider === "ukmetoffice" || this.config.weatherProvider === "ukmetofficedatahub") { + value += "%"; + } else { + value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`; + } + } + } else if (type === "humidity") { + value += "%"; } - } else if (type === "humidity") { - value += "%"; - } - return value; - }.bind(this)); + return value; + }.bind(this) + ); - this.nunjucksEnvironment().addFilter("roundValue", function(value) { - return this.roundValue(value); - }.bind(this)); + this.nunjucksEnvironment().addFilter( + "roundValue", + function (value) { + return this.roundValue(value); + }.bind(this) + ); - this.nunjucksEnvironment().addFilter("decimalSymbol", function(value) { - return value.toString().replace(/\./g, this.config.decimalSymbol); - }.bind(this)); + this.nunjucksEnvironment().addFilter( + "decimalSymbol", + function (value) { + return value.toString().replace(/\./g, this.config.decimalSymbol); + }.bind(this) + ); - this.nunjucksEnvironment().addFilter("calcNumSteps", function(forecast) { - return Math.min(forecast.length, this.config.maxNumberOfDays); - }.bind(this)); + this.nunjucksEnvironment().addFilter( + "calcNumSteps", + function (forecast) { + return Math.min(forecast.length, this.config.maxNumberOfDays); + }.bind(this) + ); - this.nunjucksEnvironment().addFilter("opacity", function(currentStep, numSteps) { - if (this.config.fade && this.config.fadePoint < 1) { - if (this.config.fadePoint < 0) { - this.config.fadePoint = 0; - } - var startingPoint = numSteps * this.config.fadePoint; - var numFadesteps = numSteps - startingPoint; - if (currentStep >= startingPoint) { - return 1 - (currentStep - startingPoint) / numFadesteps; + this.nunjucksEnvironment().addFilter( + "calcNumEntries", + function (dataArray) { + return Math.min(dataArray.length, this.config.maxEntries); + }.bind(this) + ); + + this.nunjucksEnvironment().addFilter( + "opacity", + function (currentStep, numSteps) { + if (this.config.fade && this.config.fadePoint < 1) { + if (this.config.fadePoint < 0) { + this.config.fadePoint = 0; + } + var startingPoint = numSteps * this.config.fadePoint; + var numFadesteps = numSteps - startingPoint; + if (currentStep >= startingPoint) { + return 1 - (currentStep - startingPoint) / numFadesteps; + } else { + return 1; + } } else { return 1; } - } else { - return 1; - } - }.bind(this)); + }.bind(this) + ); } }); diff --git a/modules/default/weather/weatherobject.js b/modules/default/weather/weatherobject.js index 0ecab34d..0ee42123 100755 --- a/modules/default/weather/weatherobject.js +++ b/modules/default/weather/weatherobject.js @@ -11,7 +11,6 @@ */ class WeatherObject { constructor(units, tempUnits, windUnits) { - this.units = units; this.tempUnits = tempUnits; this.windUnits = windUnits; @@ -29,11 +28,10 @@ class WeatherObject { this.snow = null; this.precipitation = null; this.feelsLikeTemp = null; - } cardinalWindDirection() { - if (this.windDirection > 11.25 && this.windDirection <= 33.75){ + if (this.windDirection > 11.25 && this.windDirection <= 33.75) { return "NNE"; } else if (this.windDirection > 33.75 && this.windDirection <= 56.25) { return "NE"; @@ -69,7 +67,7 @@ class WeatherObject { } beaufortWindSpeed() { - const windInKmh = (this.windUnits === "imperial") ? this.windSpeed * 1.609344 : this.windSpeed * 60 * 60 / 1000; + const windInKmh = this.windUnits === "imperial" ? this.windSpeed * 1.609344 : (this.windSpeed * 60 * 60) / 1000; const speeds = [1, 5, 11, 19, 28, 38, 49, 61, 74, 88, 102, 117, 1000]; for (const [index, speed] of speeds.entries()) { if (speed > windInKmh) { @@ -87,21 +85,25 @@ class WeatherObject { if (this.feelsLikeTemp) { return this.feelsLikeTemp; } - const windInMph = (this.windUnits === "imperial") ? this.windSpeed : this.windSpeed * 2.23694; - const tempInF = this.tempUnits === "imperial" ? this.temperature : this.temperature * 9 / 5 + 32; + const windInMph = this.windUnits === "imperial" ? this.windSpeed : this.windSpeed * 2.23694; + const tempInF = this.tempUnits === "imperial" ? this.temperature : (this.temperature * 9) / 5 + 32; let feelsLike = tempInF; if (windInMph > 3 && tempInF < 50) { feelsLike = Math.round(35.74 + 0.6215 * tempInF - 35.75 * Math.pow(windInMph, 0.16) + 0.4275 * tempInF * Math.pow(windInMph, 0.16)); } else if (tempInF > 80 && this.humidity > 40) { - feelsLike = -42.379 + 2.04901523 * tempInF + 10.14333127 * this.humidity - - 0.22475541 * tempInF * this.humidity - 6.83783 * Math.pow(10, -3) * tempInF * tempInF - - 5.481717 * Math.pow(10, -2) * this.humidity * this.humidity - + 1.22874 * Math.pow(10, -3) * tempInF * tempInF * this.humidity - + 8.5282 * Math.pow(10, -4) * tempInF * this.humidity * this.humidity - - 1.99 * Math.pow(10, -6) * tempInF * tempInF * this.humidity * this.humidity; + feelsLike = + -42.379 + + 2.04901523 * tempInF + + 10.14333127 * this.humidity - + 0.22475541 * tempInF * this.humidity - + 6.83783 * Math.pow(10, -3) * tempInF * tempInF - + 5.481717 * Math.pow(10, -2) * this.humidity * this.humidity + + 1.22874 * Math.pow(10, -3) * tempInF * tempInF * this.humidity + + 8.5282 * Math.pow(10, -4) * tempInF * this.humidity * this.humidity - + 1.99 * Math.pow(10, -6) * tempInF * tempInF * this.humidity * this.humidity; } - return this.tempUnits === "imperial" ? feelsLike : (feelsLike - 32) * 5 / 9; + return this.tempUnits === "imperial" ? feelsLike : ((feelsLike - 32) * 5) / 9; } } diff --git a/modules/default/weather/weatherprovider.js b/modules/default/weather/weatherprovider.js index bea363f0..8642e9a4 100644 --- a/modules/default/weather/weatherprovider.js +++ b/modules/default/weather/weatherprovider.js @@ -12,10 +12,11 @@ var WeatherProvider = Class.extend({ // Weather Provider Properties providerName: null, - // The following properties have accestor methods. + // The following properties have accessor methods. // Try to not access them directly. currentWeatherObject: null, weatherForecastArray: null, + weatherDataObject: null, fetchedLocationName: null, // The following properties will be set automatically. @@ -28,77 +29,93 @@ var WeatherProvider = Class.extend({ // All the following methods can be overwritten, although most are good as they are. // Called when a weather provider is initialized. - init: function(config) { + init: function (config) { this.config = config; Log.info(`Weather provider: ${this.providerName} initialized.`); }, // Called to set the config, this config is the same as the weather module's config. - setConfig: function(config) { + setConfig: function (config) { this.config = config; Log.info(`Weather provider: ${this.providerName} config set.`, this.config); }, // Called when the weather provider is about to start. - start: function() { + start: function () { Log.info(`Weather provider: ${this.providerName} started.`); }, // This method should start the API request to fetch the current weather. // This method should definitely be overwritten in the provider. - fetchCurrentWeather: function() { + fetchCurrentWeather: function () { Log.warn(`Weather provider: ${this.providerName} does not subclass the fetchCurrentWeather method.`); }, // This method should start the API request to fetch the weather forecast. // This method should definitely be overwritten in the provider. - fetchWeatherForecast: function() { + fetchWeatherForecast: function () { Log.warn(`Weather provider: ${this.providerName} does not subclass the fetchWeatherForecast method.`); }, + // This method should start the API request to fetch the weather forecast. + // This method should definitely be overwritten in the provider. + fetchWeatherData: function () { + Log.warn(`Weather provider: ${this.providerName} does not subclass the fetchWeatherData method.`); + }, + // This returns a WeatherDay object for the current weather. - currentWeather: function() { + currentWeather: function () { return this.currentWeatherObject; }, // This returns an array of WeatherDay objects for the weather forecast. - weatherForecast: function() { + weatherForecast: function () { return this.weatherForecastArray; }, + // This returns an object containing WeatherDay object(s) depending on the type of call. + weatherData: function () { + return this.weatherDataObject; + }, + // This returns the name of the fetched location or an empty string. - fetchedLocation: function() { + fetchedLocation: function () { return this.fetchedLocationName || ""; }, // Set the currentWeather and notify the delegate that new information is available. - setCurrentWeather: function(currentWeatherObject) { + setCurrentWeather: function (currentWeatherObject) { // We should check here if we are passing a WeatherDay this.currentWeatherObject = currentWeatherObject; }, // Set the weatherForecastArray and notify the delegate that new information is available. - setWeatherForecast: function(weatherForecastArray) { + setWeatherForecast: function (weatherForecastArray) { // We should check here if we are passing a WeatherDay this.weatherForecastArray = weatherForecastArray; }, + // Set the weatherDataObject and notify the delegate that new information is available. + setWeatherData: function (weatherDataObject) { + this.weatherDataObject = weatherDataObject; + }, + // Set the fetched location name. - setFetchedLocation: function(name) { + setFetchedLocation: function (name) { this.fetchedLocationName = name; }, // Notify the delegate that new weather is available. - updateAvailable: function() { + updateAvailable: function () { this.delegate.updateAvailable(this); }, // A convenience function to make requests. It returns a promise. - fetchData: function(url, method = "GET", data = null) { - return new Promise(function(resolve, reject) { + fetchData: function (url, method = "GET", data = null) { + return new Promise(function (resolve, reject) { var request = new XMLHttpRequest(); request.open(method, url, true); - request.onreadystatechange = function() { + request.onreadystatechange = function () { if (this.readyState === 4) { if (this.status === 200) { resolve(JSON.parse(this.response)); @@ -119,15 +136,22 @@ WeatherProvider.providers = []; /** * Static method to register a new weather provider. + * + * @param {string} providerIdentifier The name of the weather provider + * @param {object} providerDetails The details of the weather provider */ -WeatherProvider.register = function(providerIdentifier, providerDetails) { +WeatherProvider.register = function (providerIdentifier, providerDetails) { WeatherProvider.providers[providerIdentifier.toLowerCase()] = WeatherProvider.extend(providerDetails); }; /** * Static method to initialize a new weather provider. + * + * @param {string} providerIdentifier The name of the weather provider + * @param {object} delegate The weather module + * @returns {object} The new weather provider */ -WeatherProvider.initialize = function(providerIdentifier, delegate) { +WeatherProvider.initialize = function (providerIdentifier, delegate) { providerIdentifier = providerIdentifier.toLowerCase(); var provider = new WeatherProvider.providers[providerIdentifier](); diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index 7dfbd16f..035e23c0 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -1,4 +1,5 @@ # Module: Weather Forecast + The `weatherforecast` module is one of the default modules of the MagicMirror. This module displays the weather forecast for the coming week, including an an icon to display the current conditions, the minimum temperature and the maximum temperature. diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 8df266a0..4ecc18aa 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -4,12 +4,13 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ -Module.register("weatherforecast",{ - +Module.register("weatherforecast", { // Default module config. defaults: { location: false, locationID: false, + lat: false, + lon: false, appid: "", units: config.units, maxNumberOfDays: 7, @@ -30,6 +31,7 @@ Module.register("weatherforecast",{ apiVersion: "2.5", apiBase: "https://api.openweathermap.org/data/", forecastEndpoint: "forecast/daily", + excludes: false, appendLocationNameToHeader: true, calendarClass: "calendar", @@ -56,7 +58,7 @@ Module.register("weatherforecast",{ "11n": "wi-night-thunderstorm", "13n": "wi-night-snow", "50n": "wi-night-alt-cloudy-windy" - }, + } }, // create a variable for the first upcoming calendar event. Used if no location is specified. @@ -66,17 +68,17 @@ Module.register("weatherforecast",{ fetchedLocationName: "", // Define required scripts. - getScripts: function() { + getScripts: function () { return ["moment.js"]; }, // Define required scripts. - getStyles: function() { + getStyles: function () { return ["weather-icons.css", "weatherforecast.css"]; }, // Define required translations. - getTranslations: function() { + getTranslations: function () { // The translations for the default modules are defined in the core translation files. // Therefor we can just return false. Otherwise we should have returned a dictionary. // If you're trying to build your own module including translations, check out the documentation. @@ -84,7 +86,7 @@ Module.register("weatherforecast",{ }, // Define start sequence. - start: function() { + start: function () { Log.info("Starting module: " + this.name); // Set locale. @@ -95,14 +97,13 @@ Module.register("weatherforecast",{ this.scheduleUpdate(this.config.initialLoadDelay); this.updateTimer = null; - }, // Override dom generator. - getDom: function() { + getDom: function () { var wrapper = document.createElement("div"); - if (this.config.appid === "") { + if (this.config.appid === "" || this.config.appid === "YOUR_OPENWEATHER_API_KEY") { wrapper.innerHTML = "Please set the correct openweather appid in the config for module: " + this.name + "."; wrapper.className = "dimmed light small"; return wrapper; @@ -143,17 +144,17 @@ Module.register("weatherforecast",{ if (this.config.units === "metric" || this.config.units === "imperial") { degreeLabel += "°"; } - if(this.config.scale) { - switch(this.config.units) { - case "metric": - degreeLabel += "C"; - break; - case "imperial": - degreeLabel += "F"; - break; - case "default": - degreeLabel = "K"; - break; + if (this.config.scale) { + switch (this.config.units) { + case "metric": + degreeLabel += "C"; + break; + case "imperial": + degreeLabel += "F"; + break; + case "default": + degreeLabel = "K"; + break; } } @@ -176,7 +177,7 @@ Module.register("weatherforecast",{ if (isNaN(forecast.rain)) { rainCell.innerHTML = ""; } else { - if(config.units !== "imperial") { + if (config.units !== "imperial") { rainCell.innerHTML = parseFloat(forecast.rain).toFixed(1).replace(".", this.config.decimalSymbol) + " mm"; } else { rainCell.innerHTML = (parseFloat(forecast.rain) / 25.4).toFixed(2).replace(".", this.config.decimalSymbol) + " in"; @@ -194,7 +195,7 @@ Module.register("weatherforecast",{ var steps = this.forecast.length - startingPoint; if (f >= startingPoint) { var currentStep = f - startingPoint; - row.style.opacity = 1 - (1 / steps * currentStep); + row.style.opacity = 1 - (1 / steps) * currentStep; } } } @@ -203,19 +204,20 @@ Module.register("weatherforecast",{ }, // Override getHeader method. - getHeader: function() { + getHeader: function () { if (this.config.appendLocationNameToHeader) { - return this.data.header + " " + this.fetchedLocationName; + if (this.data.header) return this.data.header + " " + this.fetchedLocationName; + else return this.fetchedLocationName; } - return this.data.header; + return this.data.header ? this.data.header : ""; }, // Override notification handler. - notificationReceived: function(notification, payload, sender) { + notificationReceived: function (notification, payload, sender) { if (notification === "DOM_OBJECTS_CREATED") { if (this.config.appendLocationNameToHeader) { - this.hide(0, {lockString: this.identifier}); + this.hide(0, { lockString: this.identifier }); } } if (notification === "CALENDAR_EVENTS") { @@ -239,7 +241,7 @@ Module.register("weatherforecast",{ * Requests new data from openweather.org. * Calls processWeather on successful response. */ - updateWeather: function() { + updateWeather: function () { if (this.config.appid === "") { Log.error("WeatherForecast: APPID not set!"); return; @@ -251,7 +253,7 @@ Module.register("weatherforecast",{ var weatherRequest = new XMLHttpRequest(); weatherRequest.open("GET", url, true); - weatherRequest.onreadystatechange = function() { + weatherRequest.onreadystatechange = function () { if (this.readyState === 4) { if (this.status === 200) { self.processWeather(JSON.parse(this.response)); @@ -269,7 +271,7 @@ Module.register("weatherforecast",{ } if (retry) { - self.scheduleUpdate((self.loaded) ? -1 : self.config.retryDelay); + self.scheduleUpdate(self.loaded ? -1 : self.config.retryDelay); } } }; @@ -281,21 +283,34 @@ Module.register("weatherforecast",{ * * return String - URL params. */ - getParams: function() { + getParams: function () { var params = "?"; - if(this.config.locationID) { + if (this.config.locationID) { params += "id=" + this.config.locationID; - } else if(this.config.location) { + } else if (this.config.lat && this.config.lon) { + params += "lat=" + this.config.lat + "&lon=" + this.config.lon; + } else if (this.config.location) { params += "q=" + this.config.location; } else if (this.firstEvent && this.firstEvent.geo) { params += "lat=" + this.firstEvent.geo.lat + "&lon=" + this.firstEvent.geo.lon; } else if (this.firstEvent && this.firstEvent.location) { params += "q=" + this.firstEvent.location; } else { - this.hide(this.config.animationSpeed, {lockString:this.identifier}); + this.hide(this.config.animationSpeed, { lockString: this.identifier }); return; } + let numberOfDays; + if (this.config.forecastEndpoint === "forecast") { + numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays; + // don't get forecasts for the next day, as it would not represent the whole day + numberOfDays = numberOfDays * 8 - (Math.round(new Date().getHours() / 3) % 8); + } else { + numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays; + } + params += "&cnt=" + numberOfDays; + + params += "&exclude=" + this.config.excludes; params += "&units=" + this.config.units; params += "&lang=" + this.config.lang; params += "&APPID=" + this.config.appid; @@ -310,9 +325,9 @@ Module.register("weatherforecast",{ * from openweather.org * */ - parserDataWeather: function(data) { + parserDataWeather: function (data) { if (data.hasOwnProperty("main")) { - data["temp"] = {"min": data.main.temp_min, "max": data.main.temp_max}; + data["temp"] = { min: data.main.temp_min, max: data.main.temp_max }; } return data; }, @@ -322,21 +337,39 @@ Module.register("weatherforecast",{ * * argument data object - Weather information received form openweather.org. */ - processWeather: function(data) { - this.fetchedLocationName = data.city.name + ", " + data.city.country; + processWeather: function (data) { + // Forcast16 (paid) API endpoint provides this data. Onecall endpoint + // does not. + if (data.city) { + this.fetchedLocationName = data.city.name + ", " + data.city.country; + } else if (this.config.location) { + this.fetchedLocationName = this.config.location; + } else { + this.fetchedLocationName = "Unknown"; + } this.forecast = []; var lastDay = null; var forecastData = {}; - for (var i = 0, count = data.list.length; i < count; i++) { + // Handle different structs between forecast16 and onecall endpoints + var forecastList = null; + if (data.list) { + forecastList = data.list; + } else if (data.daily) { + forecastList = data.daily; + } else { + Log.error("Unexpected forecast data"); + return undefined; + } - var forecast = data.list[i]; - this.parserDataWeather(forecast); // hack issue #1017 + for (var i = 0, count = forecastList.length; i < count; i++) { + var forecast = forecastList[i]; + forecast = this.parserDataWeather(forecast); // hack issue #1017 var day; var hour; - if(forecast.dt_txt) { + if (forecast.dt_txt) { day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd"); hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H"); } else { @@ -350,7 +383,7 @@ Module.register("weatherforecast",{ icon: this.config.iconTable[forecast.weather[0].icon], maxTemp: this.roundValue(forecast.temp.max), minTemp: this.roundValue(forecast.temp.min), - rain: this.processRain(forecast, data.list) + rain: this.processRain(forecast, forecastList) }; this.forecast.push(forecastData); @@ -375,7 +408,7 @@ Module.register("weatherforecast",{ } //Log.log(this.forecast); - this.show(this.config.animationSpeed, {lockString:this.identifier}); + this.show(this.config.animationSpeed, { lockString: this.identifier }); this.loaded = true; this.updateDom(this.config.animationSpeed); }, @@ -385,7 +418,7 @@ Module.register("weatherforecast",{ * * argument delay number - Milliseconds before next update. If empty, this.config.updateInterval is used. */ - scheduleUpdate: function(delay) { + scheduleUpdate: function (delay) { var nextLoad = this.config.updateInterval; if (typeof delay !== "undefined" && delay >= 0) { nextLoad = delay; @@ -393,7 +426,7 @@ Module.register("weatherforecast",{ var self = this; clearTimeout(this.updateTimer); - this.updateTimer = setTimeout(function() { + this.updateTimer = setTimeout(function () { self.updateWeather(); }, nextLoad); }, @@ -409,8 +442,8 @@ Module.register("weatherforecast",{ * * return number - Windspeed in beaufort. */ - ms2Beaufort: function(ms) { - var kmh = ms * 60 * 60 / 1000; + ms2Beaufort: function (ms) { + var kmh = (ms * 60 * 60) / 1000; var speeds = [1, 5, 11, 19, 28, 38, 49, 61, 74, 88, 102, 117, 1000]; for (var beaufort in speeds) { var speed = speeds[beaufort]; @@ -428,7 +461,7 @@ Module.register("weatherforecast",{ * * return string - Rounded Temperature. */ - roundValue: function(temperature) { + roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; return parseFloat(temperature).toFixed(decimals); }, @@ -440,16 +473,16 @@ Module.register("weatherforecast",{ * That object has a property "3h" which contains the amount of rain since the previous forecast in the list. * This code finds all forecasts that is for the same day and sums the amount of rain and returns that. */ - processRain: function(forecast, allForecasts) { + processRain: function (forecast, allForecasts) { //If the amount of rain actually is a number, return it if (!isNaN(forecast.rain)) { return forecast.rain; } //Find all forecasts that is for the same day - var checkDateTime = (forecast.dt_txt) ? moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss") : moment(forecast.dt, "X"); - var daysForecasts = allForecasts.filter(function(item) { - var itemDateTime = (item.dt_txt) ? moment(item.dt_txt, "YYYY-MM-DD hh:mm:ss") : moment(item.dt, "X"); + var checkDateTime = forecast.dt_txt ? moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss") : moment(forecast.dt, "X"); + var daysForecasts = allForecasts.filter(function (item) { + var itemDateTime = item.dt_txt ? moment(item.dt_txt, "YYYY-MM-DD hh:mm:ss") : moment(item.dt, "X"); return itemDateTime.isSame(checkDateTime, "day") && item.rain instanceof Object; }); @@ -459,10 +492,12 @@ Module.register("weatherforecast",{ } //Summarize all the rain from the matching days - return daysForecasts.map(function(item) { - return Object.values(item.rain)[0]; - }).reduce(function(a, b) { - return a + b; - }, 0); + return daysForecasts + .map(function (item) { + return Object.values(item.rain)[0]; + }) + .reduce(function (a, b) { + return a + b; + }, 0); } }); diff --git a/package-lock.json b/package-lock.json index 6487057e..a950f435 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.12.0-develop", + "version": "2.13.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -13,19 +13,19 @@ } }, "@babel/core": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", - "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.2.tgz", + "integrity": "sha512-KQmV9yguEjQsXqyOUGKjS4+3K8/DlOCE2pZcq4augdQmtTy5iv5EHtmMSJ7V4c1BIPjuwtZYqYLCq9Ga+hGBRQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.0", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.0", - "@babel/parser": "^7.9.0", - "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0", + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.2", + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helpers": "^7.10.1", + "@babel/parser": "^7.10.2", + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.2", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -36,6 +36,46 @@ "source-map": "^0.5.0" }, "dependencies": { + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -59,16 +99,25 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, "@babel/generator": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", - "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz", + "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==", "dev": true, "requires": { - "@babel/types": "^7.9.5", + "@babel/types": "^7.10.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -83,113 +132,113 @@ } }, "@babel/helper-function-name": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", - "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.1.tgz", + "integrity": "sha512-fcpumwhs3YyZ/ttd5Rz0xn0TpIwVkN7X0V38B9TWNfVF42KEkhkAAuPCQ3oXmtTRtiPJrmZ0TrfS0GKF0eMaRQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.9.5" + "@babel/helper-get-function-arity": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.1.tgz", + "integrity": "sha512-F5qdXkYGOQUb0hpRaPoetF9AnsXknKjWMZ+wmsIRsp5ge5sFh4c3h1eH2pRTTuy9KKAA2+TTYomGXAtEL2fQEw==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.1.tgz", + "integrity": "sha512-u7XLXeM2n50gb6PWJ9hoO5oO7JFPaZtrh35t8RqKLT1jFKj9IWeD1zrcrYp1q1qiZTdEarfDWfTIP8nGsu0h5g==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.1.tgz", + "integrity": "sha512-SFxgwYmZ3HZPyZwJRiVNLRHWuW2OgE5k2nrVs6D9Iv4PPnXVffuEHy83Sfx/l4SqF+5kyJXjAyUmrG7tNm+qVg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-module-transforms": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", - "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.1.tgz", + "integrity": "sha512-RLHRCAzyJe7Q7sF4oy2cB+kRnU4wDZY/H2xJFGof+M+SJEGhZsb+GFj5j1AD8NiSaVBJ+Pf0/WObiXu/zxWpFg==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.6", - "@babel/types": "^7.9.0", + "@babel/helper-module-imports": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1", + "@babel/helper-simple-access": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1", "lodash": "^4.17.13" } }, "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.1.tgz", + "integrity": "sha512-a0DjNS1prnBsoKx83dP2falChcs7p3i8VMzdrSbfLhuQra/2ENC4sbri34dz/rWmDADsmF1q5GbfaXydh0Jbjg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-replace-supers": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", - "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.1.tgz", + "integrity": "sha512-SOwJzEfpuQwInzzQJGjGaiG578UYmyi2Xw668klPWV5n07B73S0a9btjLk/52Mlcxa+5AdIYqws1KyXRfMoB7A==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.8.6", - "@babel/types": "^7.8.6" + "@babel/helper-member-expression-to-functions": "^7.10.1", + "@babel/helper-optimise-call-expression": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.1.tgz", + "integrity": "sha512-VSWpWzRzn9VtgMJBIWTZ+GP107kZdQ4YplJlCmIrjoLVSi/0upixezHCDG8kpPVTBJpKfxTH01wDhh+jS2zKbw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz", + "integrity": "sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", "dev": true }, "@babel/helpers": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", - "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.1.tgz", + "integrity": "sha512-muQNHF+IdU6wGgkaJyhhEmI54MOZBKsFfsXFhboz1ybwJ1Kl7IHlbm2a++4jwrmY5UYsgitt5lfqo1wMFcHmyw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0" + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/highlight": { @@ -231,9 +280,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz", + "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ==", "dev": true }, "@babel/runtime": { @@ -253,34 +302,143 @@ } } }, - "@babel/template": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", - "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "@babel/runtime-corejs3": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.4.tgz", + "integrity": "sha512-BFlgP2SoLO9HJX9WBwN67gHWMBhDX/eDz64Jajd6mR/UAUzqrNMm99d4qHnVaKscAElZoFiPv+JpR/Siud5lXw==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6" + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.4" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + } + } + }, + "@babel/template": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/traverse": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", - "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.1.tgz", + "integrity": "sha512-C/cTuXeKt85K+p08jN6vMDz8vSV0vZcI0wmQ36o6mjbuo++kPMdpOYw23W2XH04dbRt9/nMEfA4W3eR21CD+TQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.5", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.5", + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.1", + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" }, "dependencies": { + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -295,20 +453,111 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz", + "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.5", + "@babel/helper-validator-identifier": "^7.10.1", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true + }, + "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==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -352,24 +601,6 @@ "url-template": "^2.0.8" } }, - "@prantlf/jsonlint": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/@prantlf/jsonlint/-/jsonlint-10.2.0.tgz", - "integrity": "sha512-KMFfds0peWLLfCu3bhClTiEN0tdj/Z86QJvn1awKHws6r+Sx6T3a44Eadz6OvqN6ZpsRkqaRpZxqddvvDAdDZQ==", - "dev": true, - "requires": { - "ajv": "6.10.2", - "commander": "4.0.1" - }, - "dependencies": { - "commander": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.0.1.tgz", - "integrity": "sha512-IPF4ouhCP+qdlcmCedhxX4xiGBPyigb8v5NeUp+0LyhwLgxMqyp3S0vl7TAPfS/hiP7FC3caI/PB9lTmP8r1NA==", - "dev": true - } - } - }, "@stylelint/postcss-css-in-js": { "version": "0.37.1", "resolved": "https://registry.npmjs.org/@stylelint/postcss-css-in-js/-/postcss-css-in-js-0.37.1.tgz", @@ -394,6 +625,12 @@ "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, "@types/minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", @@ -434,9 +671,9 @@ } }, "acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==" + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==" }, "acorn-globals": { "version": "4.3.4", @@ -481,6 +718,24 @@ "es6-promisify": "^5.0.0" } }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "dependencies": { + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + } + } + }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -498,21 +753,6 @@ "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", "dev": true }, - "ansi-escapes": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", - "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", - "requires": { - "type-fest": "^0.11.0" - }, - "dependencies": { - "type-fest": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", - "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==" - } - } - }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -548,6 +788,21 @@ "integrity": "sha1-7klza2ObTxCLbp5ibG2pkwa0FpI=", "dev": true }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -563,6 +818,12 @@ } } }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, "array-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", @@ -591,9 +852,9 @@ "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" }, "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true }, "asn1": { @@ -620,12 +881,6 @@ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==" }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, "async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -643,18 +898,18 @@ "dev": true }, "autoprefixer": { - "version": "9.7.6", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.7.6.tgz", - "integrity": "sha512-F7cYpbN7uVVhACZTeeIeealwdGM6wMtfWARVLTy5xmKtgVdBNJvbDRoCK3YO1orcs7gv/KwYlb3iXwu9Ug9BkQ==", + "version": "9.8.0", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.0.tgz", + "integrity": "sha512-D96ZiIHXbDmU02dBaemyAg53ez+6F5yZmapmgKcjm35yEe1uVDYI8hGW3VYoGRaG290ZFf91YxHrR518vC0u/A==", "dev": true, "requires": { - "browserslist": "^4.11.1", - "caniuse-lite": "^1.0.30001039", + "browserslist": "^4.12.0", + "caniuse-lite": "^1.0.30001061", "chalk": "^2.4.2", "normalize-range": "^0.1.2", "num2fraction": "^1.2.2", - "postcss": "^7.0.27", - "postcss-value-parser": "^4.0.3" + "postcss": "^7.0.30", + "postcss-value-parser": "^4.1.0" }, "dependencies": { "ansi-styles": { @@ -694,9 +949,9 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz", - "integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==" + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", + "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" }, "babel-polyfill": { "version": "6.26.0", @@ -844,9 +1099,9 @@ } }, "bowser": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.8.1.tgz", - "integrity": "sha512-FxxltGKqMHkVa3KtpA+kdnxH0caHPDewccyrK3vW1bsMw6Zco4vRPmMunowX0pXlDZqhxkKSpToADQI2Sk4OeQ==" + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.9.0.tgz", + "integrity": "sha512-2ld76tuLBNFekRgmJfT2+3j5MIrP6bFict8WAIT3beq+srz1gcKNAdNKMqHqauQt63NmAa88HfP1/Ypa9Er3HA==" }, "brace-expansion": { "version": "1.1.11", @@ -949,6 +1204,18 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, "callsite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", @@ -979,9 +1246,9 @@ "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" }, "caniuse-lite": { - "version": "1.0.30001045", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001045.tgz", - "integrity": "sha512-Y8o2Iz1KPcD6FjySbk1sPpvJqchgxk/iow0DABpGyzA1UeQAuxh63Xh0Enj5/BrsYbXtCN32JmR4ZxQTCQ6E6A==", + "version": "1.0.30001084", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001084.tgz", + "integrity": "sha512-ftdc5oGmhEbLUuMZ/Qp3mOpzfZLCxPYKcvGv6v2dJJ+8EdqcvZRbAGOiLmkM/PV1QGta/uwBs8/nCl6sokDW6w==", "dev": true }, "caseless": { @@ -1054,11 +1321,6 @@ "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", "dev": true }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -1081,23 +1343,28 @@ "readdirp": "~3.2.0" } }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "clarinet": { "version": "0.12.4", "resolved": "https://registry.npmjs.org/clarinet/-/clarinet-0.12.4.tgz", "integrity": "sha512-Rx9Zw8KQkoPO3/O2yPRchCZm3cGubCQiRLmmFAlbkDKobUIPP3JYul+bKILR9DIv1gSVwPQSgF8JGGkXzX8Q0w==" }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "requires": { - "restore-cursor": "^3.1.0" - } + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true }, "cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true }, "cliui": { "version": "4.1.0", @@ -1195,6 +1462,24 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "comment-parser": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.7.5.tgz", + "integrity": "sha512-iH9YA35ccw94nx5244GVkpyC9eVTsL71jZz6iz5w6RIf79JLF2AsXHXq9p6Oaohyl3sx5qSMnGsWUDFIAfWL4w==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, "component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", @@ -1328,6 +1613,12 @@ "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", "dev": true }, + "core-js-pure": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -1379,6 +1670,7 @@ "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -1435,12 +1727,6 @@ "cssom": "0.3.x" } }, - "current-week-number": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/current-week-number/-/current-week-number-1.0.7.tgz", - "integrity": "sha1-VnJ4rrX+WN7LFQuayGT5Pc5O2XI=", - "dev": true - }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -1618,6 +1904,23 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + } + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -1679,11 +1982,6 @@ } } }, - "dns-prefetch-control": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/dns-prefetch-control/-/dns-prefetch-control-0.2.0.tgz", - "integrity": "sha512-hvSnros73+qyZXhHFjx2CMLwoj3Fe7eR9EJsFsqmcI1bB2OBWL/+0YzaEaKssCHnj/6crawNnUyw74Gm2EKe+Q==" - }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -1707,6 +2005,12 @@ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", "dev": true + }, + "entities": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", + "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==", + "dev": true } } }, @@ -1831,15 +2135,15 @@ } }, "electron-to-chromium": { - "version": "1.3.414", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.414.tgz", - "integrity": "sha512-UfxhIvED++qLwWrAq9uYVcqF8FdeV9sU2S7qhiHYFODxzXRrd1GZRl/PjITHsTEejgibcWDraD8TQqoHb1aCBQ==", + "version": "1.3.478", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.478.tgz", + "integrity": "sha512-pt9GUDD52uEO9ZXWcG4UuW/HwE8T+a8iFP7K2qqWrHB5wUxbbvCIXGBVpQDDQwSR766Nn4AkmLYxOUNd4Ji5Dw==", "dev": true }, "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, "encodeurl": { "version": "1.0.2", @@ -1931,10 +2235,25 @@ "has-binary2": "~1.0.2" } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "requires": { + "ansi-colors": "^4.1.1" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" + } + } + }, "entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", - "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", "dev": true }, "env-paths": { @@ -1988,6 +2307,12 @@ "is-symbol": "^1.0.2" } }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -2035,21 +2360,22 @@ } }, "eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.6.0.tgz", + "integrity": "sha512-QlAManNtqr7sozWm5TF4wIH9gmUm2hE3vNRUvyoYAa4y1l5/jxD/PQStEjBMQtCqZmSep8UxrcecI60hOpe61w==", "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.2.0", + "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", @@ -2058,47 +2384,68 @@ "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", + "levn": "^0.4.1", + "lodash": "^4.17.19", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "requires": { - "color-convert": "^1.9.0" + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" } }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, "debug": { @@ -2109,64 +2456,198 @@ "ms": "^2.1.1" } }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" + }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" } }, "strip-json-comments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", - "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" } } } }, + "eslint-config-prettier": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", + "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + }, + "dependencies": { + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + } + } + }, + "eslint-plugin-jsdoc": { + "version": "30.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.1.0.tgz", + "integrity": "sha512-eMsX+TMW6ycgXwxqU9xqfts2/e7cWCSGzk+gHgDvqaITyMJr8AcHTdd4pAMjpnOh0cd16lPZv+/R5LbQ4uVHQA==", + "dev": true, + "requires": { + "comment-parser": "^0.7.5", + "debug": "^4.1.1", + "jsdoctypeparser": "^8.0.0", + "lodash": "^4.17.15", + "regextras": "^0.7.1", + "semver": "^7.3.2", + "spdx-expression-parse": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + } + } + }, + "eslint-plugin-prettier": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", + "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, "eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "requires": { "eslint-visitor-keys": "^1.1.0" } }, "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" }, "espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", + "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", "requires": { - "acorn": "^7.1.1", + "acorn": "^7.3.1", "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^1.3.0" } }, "esprima": { @@ -2175,17 +2656,17 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.2.0.tgz", - "integrity": "sha512-weltsSqdeWIX9G2qQZz7KlTRJdkkOCTPgLYJUz1Hacf48R4YOwGPHO3+ORfWedqJKbq5WQmsgK90n+pFLIKt/Q==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "requires": { - "estraverse": "^5.0.0" + "estraverse": "^5.1.0" }, "dependencies": { "estraverse": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.0.0.tgz", - "integrity": "sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A==" + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==" } } }, @@ -2250,11 +2731,6 @@ "homedir-polyfill": "^1.0.1" } }, - "expect-ct": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/expect-ct/-/expect-ct-0.2.0.tgz", - "integrity": "sha512-6SK3MG/Bbhm8MsgyJAylg+ucIOU71/FzyFalcfu5nY19dH8y/z0tBJU0wrNBXD4B27EoQtqPF/9wqH0iYAd04g==" - }, "express": { "version": "4.17.1", "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", @@ -2342,26 +2818,6 @@ "is-extendable": "^0.1.0" } }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - } - } - }, "extract-zip": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", @@ -2398,10 +2854,16 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "fast-glob": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", - "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -2423,9 +2885,9 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "fastq": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", - "integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", + "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -2454,14 +2916,6 @@ "sax": "^1.0.0" } }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "file-entry-cache": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", @@ -2508,6 +2962,17 @@ } } }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", @@ -2517,6 +2982,15 @@ "pinkie-promise": "^2.0.0" } }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, "flat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", @@ -2537,9 +3011,62 @@ } }, "flatted": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==" + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } }, "forever-agent": { "version": "0.6.1", @@ -2561,16 +3088,17 @@ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" }, - "frameguard": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/frameguard/-/frameguard-3.1.0.tgz", - "integrity": "sha512-TxgSKM+7LTA6sidjOiSZK9wxY0ffMPY3Wta//MqwmX0nZuEHc8QrkV8Fh3ZhMJeiH+Uyh/tcaarImRy8u77O7g==" - }, "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, + "fromentries": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", + "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", + "dev": true + }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -2643,6 +3171,12 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "get-stdin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", @@ -2680,7 +3214,6 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2727,9 +3260,9 @@ } }, "globby": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.0.tgz", - "integrity": "sha512-iuehFnR3xu5wBBtm4xi0dMe92Ob87ufyu/dHwpDYfbcpYpIbrO5OnS8M1vWvrBhSGEJ3/Ecj7gnX76P8YxpPEg==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", + "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", "dev": true, "requires": { "array-union": "^2.1.0", @@ -2741,9 +3274,9 @@ }, "dependencies": { "ignore": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", - "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", "dev": true } } @@ -2795,12 +3328,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true - }, "grapheme-splitter": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", @@ -2881,6 +3408,24 @@ "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, + "hasha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "dependencies": { + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + } + } + }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", @@ -2888,22 +3433,18 @@ "dev": true }, "helmet": { - "version": "3.21.2", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.21.2.tgz", - "integrity": "sha512-okUo+MeWgg00cKB8Csblu8EXgcIoDyb5ZS/3u0W4spCimeVuCUvVZ6Vj3O2VJ1Sxpyb8jCDvzu0L1KKT11pkIg==", + "version": "3.23.3", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.23.3.tgz", + "integrity": "sha512-U3MeYdzPJQhtvqAVBPntVgAvNSOJyagwZwyKsFdyRa8TV3pOKVFljalPOCxbw5Wwf2kncGhmP0qHjyazIdNdSA==", "requires": { "depd": "2.0.0", - "dns-prefetch-control": "0.2.0", "dont-sniff-mimetype": "1.1.0", - "expect-ct": "0.2.0", "feature-policy": "0.3.0", - "frameguard": "3.1.0", "helmet-crossdomain": "0.4.0", - "helmet-csp": "2.9.4", + "helmet-csp": "2.10.0", "hide-powered-by": "1.1.0", "hpkp": "2.0.0", "hsts": "2.2.0", - "ienoopen": "1.1.0", "nocache": "2.1.0", "referrer-policy": "1.2.0", "x-xss-protection": "1.3.0" @@ -2922,11 +3463,11 @@ "integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA==" }, "helmet-csp": { - "version": "2.9.4", - "resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.9.4.tgz", - "integrity": "sha512-qUgGx8+yk7Xl8XFEGI4MFu1oNmulxhQVTlV8HP8tV3tpfslCs30OZz/9uQqsWPvDISiu/NwrrCowsZBhFADYqg==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.10.0.tgz", + "integrity": "sha512-Rz953ZNEFk8sT2XvewXkYN0Ho4GEZdjAZy4stjiEQV3eN7GDxg1QKmYggH7otDyIA7uGA6XnUMVSgeJwbR5X+w==", "requires": { - "bowser": "^2.7.0", + "bowser": "2.9.0", "camelize": "1.0.0", "content-security-policy-builder": "2.1.0", "dasherize": "2.0.0" @@ -2980,6 +3521,12 @@ "whatwg-encoding": "^1.0.1" } }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, "html-tags": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.1.0.tgz", @@ -3000,12 +3547,6 @@ "readable-stream": "^3.1.1" }, "dependencies": { - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -3106,18 +3647,106 @@ "debug": "^3.1.0" } }, + "husky": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", + "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^6.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "hyperlinker": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", "integrity": "sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==", "dev": true }, - "iconv-lite": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.1.tgz", - "integrity": "sha512-ONHr16SQvKZNSqjQT9gy5z24Jw+uqfO02/ngBSBoqChZ+W8qXX7GPRa1RoUnzGADw8K63R1BXUMzarCVQBpY8Q==", + "ical": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/ical/-/ical-0.8.0.tgz", + "integrity": "sha512-/viUSb/RGLLnlgm0lWRlPBtVeQguQRErSPYl3ugnUaKUnzQswKqOG3M8/P1v1AB5NJwlHTuvTq1cs4mpeG2rCg==", "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "rrule": "2.4.1" + }, + "dependencies": { + "rrule": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/rrule/-/rrule-2.4.1.tgz", + "integrity": "sha512-+NcvhETefswZq13T8nkuEnnQ6YgUeZaqMqVbp+ZiFDPCbp3AVgQIwUvNVDdMNrP05bKZG9ddDULFp0qZZYDrxg==", + "requires": { + "luxon": "^1.3.3" + } + } + } + }, + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "ieee754": { @@ -3126,11 +3755,6 @@ "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", "dev": true }, - "ienoopen": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ienoopen/-/ienoopen-1.1.0.tgz", - "integrity": "sha512-MFs36e/ca6ohEKtinTJ5VvAJ6oDRAYFdYXweUnGY9L9vcoqFOU4n2ZhmJ0C4z/cwGZ3YIQRSB3XZ1+ghZkY5NQ==" - }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -3194,108 +3818,6 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, - "inquirer": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", - "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", - "requires": { - "ansi-escapes": "^4.2.1", - "chalk": "^3.0.0", - "cli-cursor": "^3.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.15", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.5.3", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" - }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "run-async": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", - "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", - "requires": { - "is-promise": "^2.1.0" - } - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", @@ -3433,7 +3955,8 @@ "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true }, "is-regex": { "version": "1.0.5", @@ -3481,6 +4004,12 @@ "integrity": "sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "is-word-character": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz", @@ -3502,6 +4031,168 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3521,6 +4212,12 @@ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, + "jsdoctypeparser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-8.0.0.tgz", + "integrity": "sha512-eLCs6s4JqN8TjFJfgdiLHRvogLhOAJz+5RIA2FtoMe6ZDyuvghvppnlIToqAEnVbxRqLMrfnNXpW8FpmR6IMBw==", + "dev": true + }, "jsdom": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", @@ -3556,9 +4253,9 @@ }, "dependencies": { "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", "dev": true }, "ws": { @@ -3655,12 +4352,6 @@ "minimist": "^1.2.0" } }, - "jsonc-parser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.2.1.tgz", - "integrity": "sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w==", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -3732,9 +4423,9 @@ "dev": true }, "known-css-properties": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.18.0.tgz", - "integrity": "sha512-69AgJ1rQa7VvUsd2kpvVq+VeObDuo3zrj0CzM5Slmf6yduQFAI2kXPDQJR2IE/u6MSAUOJrwSzjg5vlz8qcMiw==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.19.0.tgz", + "integrity": "sha512-eYboRV94Vco725nKMlpkn3nV2+96p9c3gKXRsYqAJSswSENvBhN7n5L+uDhY58xQa0UukWsDMTGELzmD8Q+wTA==", "dev": true }, "lazystream": { @@ -3799,26 +4490,6 @@ "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", "dev": true }, - "leprechaun": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/leprechaun/-/leprechaun-0.0.2.tgz", - "integrity": "sha1-i5ZRSp5jTFP75ZqAlPM3jI+yCE0=", - "dev": true, - "requires": { - "log-symbols": "^1.0.2" - }, - "dependencies": { - "log-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", - "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", - "dev": true, - "requires": { - "chalk": "^1.0.0" - } - } - } - }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -3829,6 +4500,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, "requires": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -3840,15 +4512,6 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, - "linkify-it": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", - "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", - "dev": true, - "requires": { - "uc.micro": "^1.0.1" - } - }, "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -3880,15 +4543,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "lodash.differencewith": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.differencewith/-/lodash.differencewith-4.5.0.tgz", - "integrity": "sha1-uvr7yRi1UVTheRdqALsK76rIVLc=", - "dev": true + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash.find": { "version": "4.6.0", @@ -3896,10 +4553,10 @@ "integrity": "sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E=", "dev": true }, - "lodash.flatten": { + "lodash.flattendeep": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, "lodash.includes": { @@ -3950,24 +4607,12 @@ "integrity": "sha1-oIYCrBLk+4P5H8H7ejYKTZujUgU=", "dev": true }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, "lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", "dev": true }, - "lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=", - "dev": true - }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -4041,6 +4686,23 @@ "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", "dev": true }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "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==", + "dev": true + } + } + }, "map-age-cleaner": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", @@ -4061,19 +4723,6 @@ "integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==", "dev": true }, - "markdown-it": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", - "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "entities": "~2.0.0", - "linkify-it": "^2.0.0", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - } - }, "markdown-table": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", @@ -4083,94 +4732,6 @@ "repeat-string": "^1.0.0" } }, - "markdownlint": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.20.2.tgz", - "integrity": "sha512-TU/SgsylEzp9oAj9dGGZ6009yJq48GpEAeYIsREje5NuvadzO12qvl4wV21vHIerdPy/aSEyM2e9c+CzWq6Reg==", - "dev": true, - "requires": { - "markdown-it": "10.0.0" - } - }, - "markdownlint-cli": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.22.0.tgz", - "integrity": "sha512-qRg6tK5dXWqkaFvEstz9YSQal1ECMgofrSZgdBOaPWG8cD50pk8Hs0ZpBCJ6SCHPKF71pCdtuSL2u82sIx2XWA==", - "dev": true, - "requires": { - "commander": "~2.9.0", - "deep-extend": "~0.5.1", - "get-stdin": "~5.0.1", - "glob": "~7.1.2", - "ignore": "~5.1.4", - "js-yaml": "~3.13.1", - "jsonc-parser": "~2.2.0", - "lodash.differencewith": "~4.5.0", - "lodash.flatten": "~4.4.0", - "markdownlint": "~0.19.0", - "markdownlint-rule-helpers": "~0.7.0", - "minimatch": "~3.0.4", - "rc": "~1.2.7" - }, - "dependencies": { - "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", - "dev": true, - "requires": { - "graceful-readlink": ">= 1.0.0" - } - }, - "deep-extend": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", - "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", - "dev": true - }, - "get-stdin": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", - "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", - "dev": true - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "ignore": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", - "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", - "dev": true - }, - "markdownlint": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.19.0.tgz", - "integrity": "sha512-+MsWOnYVUH4klcKM7iRx5cno9FQMDAb6FC6mWlZkeXPwIaK6Z5Vd9VkXkykPidRqmLHU2wI+MNyfUMnUCBw3pQ==", - "dev": true, - "requires": { - "markdown-it": "10.0.0" - } - } - } - }, - "markdownlint-rule-helpers": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/markdownlint-rule-helpers/-/markdownlint-rule-helpers-0.7.0.tgz", - "integrity": "sha512-xZByWJNBaCMHo7nYPv/5aO8Jt68YcMvyouFXhuXmJzbqCsQy8rfCj0kYcv22kdK5PwAgMdbHg0hyTdURbUZtJw==", - "dev": true - }, "mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", @@ -4186,12 +4747,6 @@ "unist-util-visit": "^2.0.0" } }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", - "dev": true - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -4235,10 +4790,16 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "merge2": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", - "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, "methods": { @@ -4277,12 +4838,13 @@ "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true }, "min-indent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz", - "integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true }, "minimatch": { @@ -4299,15 +4861,22 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "minimist-options": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.0.2.tgz", - "integrity": "sha512-seq4hpWkYSUh1y7NXxzucwAN9yVlBc3Upgdjz8vLCP97jG8kaOmzYrVH/m7tQ1NYD1wdtZbSLfdy4zFmRWuc/w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", "dev": true, "requires": { "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" }, "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -4671,89 +5240,47 @@ "integrity": "sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==" }, "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz", + "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==" + }, + "mri": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.5.tgz", + "integrity": "sha512-d2RKzMD4JNyHMbnbWnznPaa8vbdlq/4pNZ3IgdaGrVbBhebBsGUUE/6qorTMYNS6TwuH3ilfOlD2bf4Igh8CKg==", + "dev": true }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + "multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + }, + "dependencies": { + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + } + } }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, - "nconf": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/nconf/-/nconf-0.10.0.tgz", - "integrity": "sha512-fKiXMQrpP7CYWJQzKkPPx9hPgmq+YLDyxcG9N8RpiE9FoCkCbzD0NyW0YhE3xn3Aupe7nnDeIx4PFzYehpHT9Q==", - "dev": true, - "requires": { - "async": "^1.4.0", - "ini": "^1.3.0", - "secure-keys": "^1.0.0", - "yargs": "^3.19.0" - }, - "dependencies": { - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "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=", - "dev": true - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, - "yargs": { - "version": "3.32.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", - "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", - "dev": true, - "requires": { - "camelcase": "^2.0.1", - "cliui": "^3.0.3", - "decamelize": "^1.1.1", - "os-locale": "^1.4.0", - "string-width": "^1.0.1", - "window-size": "^0.1.4", - "y18n": "^3.2.0" - } - } - } - }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -4762,7 +5289,8 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true }, "nocache": { "version": "2.1.0", @@ -4786,15 +5314,24 @@ } }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", "dev": true }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, "node-releases": { - "version": "1.1.53", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.53.tgz", - "integrity": "sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ==", + "version": "1.1.58", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.58.tgz", + "integrity": "sha512-NxBudgVKiRh/2aPWMgPR7bPTX0VPmGx5QBwCtdHitnqFE5/O8DeBXuIMH1nwNnw/aMo6AjOrpsHzfY3UbUJ7yg==", "dev": true }, "normalize-package-data": { @@ -4887,6 +5424,270 @@ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "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==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true + }, + "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==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "15.4.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.0.tgz", + "integrity": "sha512-D3fRFnZwLWp8jVAAhPZBsmeIHY8tTsb8ItV9KaAaopmC6wde2u6Yw29JBIZHXw14kgkRnYmDgmQU4FVMDlIsWw==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^3.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "dependencies": { + "decamelize": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", + "integrity": "sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==", + "dev": true, + "requires": { + "xregexp": "^4.2.4" + } + } + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -4963,10 +5764,17 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, "requires": { "mimic-fn": "^2.1.0" } }, + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true + }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -4989,6 +5797,7 @@ "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, "requires": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", @@ -5022,7 +5831,8 @@ "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true }, "p-defer": { "version": "1.0.0", @@ -5060,12 +5870,33 @@ "p-limit": "^1.1.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.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=", "dev": true }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5185,7 +6016,8 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true }, "path-parse": { "version": "1.0.6", @@ -5253,6 +6085,66 @@ "integrity": "sha1-DPd1eml38b9/ajIge3CeN3OI6HQ=", "dev": true }, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true + }, + "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==", + "dev": true + } + } + }, "pkg-up": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", @@ -5273,6 +6165,15 @@ } } }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, "pn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", @@ -5280,9 +6181,9 @@ "dev": true }, "postcss": { - "version": "7.0.27", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.27.tgz", - "integrity": "sha512-WuQETPMcW9Uf1/22HWUWP9lgsIC+KEHg2kozMflKjbeUtw9ujvFX6QmIfozaErDkmLWS9WEnEdEe6Uo9/BNTdQ==", + "version": "7.0.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", + "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -5434,12 +6335,12 @@ } }, "postcss-scss": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-2.0.0.tgz", - "integrity": "sha512-um9zdGKaDZirMm+kZFKKVsnKPF7zF7qBAtIfTSnZXD1jZ0JNZIxdB6TxQOjCnlSzLRInVl2v3YdBh/M881C4ug==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-2.1.1.tgz", + "integrity": "sha512-jQmGnj0hSGLd9RscFw9LyuSVAa5Bl1/KBPqG1NQw9w8ND55nY4ZEsdlVuYJvLPpV+y0nwTV5v/4rHPzZRihQbA==", "dev": true, "requires": { - "postcss": "^7.0.0" + "postcss": "^7.0.6" } }, "postcss-selector-parser": { @@ -5460,15 +6361,31 @@ "dev": true }, "postcss-value-parser": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.3.tgz", - "integrity": "sha512-N7h4pG+Nnu5BEIzyeaaIYWs0LI5XC40OrRh5L60z0QjFsqGWcHcbkBvpe1WYpcIS9yQ8sOi/vIPt1ejQCrMVrg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "dev": true }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } }, "pretty-bytes": { "version": "1.0.4", @@ -5479,11 +6396,208 @@ "meow": "^3.1.0" } }, + "pretty-quick": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-2.0.1.tgz", + "integrity": "sha512-y7bJt77XadjUr+P1uKqZxFWLddvj3SKY6EU4BuQtMxmmEFSMpbN132pUWdSG1g1mtUfO0noBvn7wBf0BVeomHg==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "execa": "^2.1.0", + "find-up": "^4.1.0", + "ignore": "^5.1.4", + "mri": "^1.1.4", + "multimatch": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cross-spawn": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-2.1.0.tgz", + "integrity": "sha512-Y/URAVapfbYy2Xp/gb6A0E7iR8xeqOCXsuuaoMn7A5PzrXUK84E1gyiEfq0wQd/GHA6GsoHWwhNq8anb0mleIw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^3.0.0", + "onetime": "^5.1.0", + "p-finally": "^2.0.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-stream": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "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==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "npm-run-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz", + "integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "p-finally": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz", + "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true + }, + "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==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -5669,9 +6783,24 @@ "dev": true }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==" + }, + "regextras": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.1.tgz", + "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==", + "dev": true + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } }, "remark": { "version": "12.0.0", @@ -5685,9 +6814,9 @@ } }, "remark-parse": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.1.tgz", - "integrity": "sha512-Ye/5W57tdQZWsfkuVyRq9SUWRgECHnDsMuyUMzdSKpTbNPkZeGtoYfsrkeSi4+Xyl0mhcPPddHITXPcCPHrl3w==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.2.tgz", + "integrity": "sha512-eMI6kMRjsAGpMXXBAywJwiwAse+KNpmt+BK55Oofy4KvBZEqUDj6mWbGLJZrujoPIPPxDXzn3T9baRlpsm2jnQ==", "dev": true, "requires": { "ccount": "^1.0.0", @@ -5717,9 +6846,9 @@ } }, "remark-stringify": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-8.0.0.tgz", - "integrity": "sha512-cABVYVloFH+2ZI5bdqzoOmemcz/ZuhQSH6W6ZNYnLojAUUn3xtX7u+6BpnYp35qHoGr2NFBsERV14t4vCIeW8w==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-8.1.0.tgz", + "integrity": "sha512-FSPZv1ds76oAZjurhhuV5qXSUSoz6QRPuwYK38S41sLHwg4oB7ejnmZshj7qwjgYLf93kdz6BOX9j5aidNE7rA==", "dev": true, "requires": { "ccount": "^1.0.0", @@ -5773,9 +6902,9 @@ "dev": true }, "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -5784,7 +6913,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -5794,9 +6923,20 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" + }, + "dependencies": { + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + } } }, "request-promise-core": { @@ -5856,15 +6996,6 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -5889,21 +7020,6 @@ "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "requires": { "glob": "^7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } } }, "rrule": { @@ -5950,14 +7066,6 @@ "rx-lite": "*" } }, - "rxjs": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", - "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", - "requires": { - "tslib": "^1.9.0" - } - }, "safe-buffer": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", @@ -5973,17 +7081,23 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, - "secure-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/secure-keys/-/secure-keys-1.0.0.tgz", - "integrity": "sha1-8MgtmKOxOah3aogIBQuCRDEIf8o=", - "dev": true - }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, "send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -6052,6 +7166,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -6059,7 +7174,8 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true }, "signal-exit": { "version": "3.0.2", @@ -6262,6 +7378,40 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", @@ -6803,9 +7953,9 @@ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" }, "stringify-entities": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.0.0.tgz", - "integrity": "sha512-h7NJJIssprqlyjHT2eQt2W1F+MCcNmwPGlKb0bWEdET/3N44QN3QbUF/ueKCgAssyKRZ3Br9rQ7FcXjHr0qLHw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.0.1.tgz", + "integrity": "sha512-Lsk3ISA2++eJYqBMPKcr/8eby1I6L0gP0NlxF8Zja6c05yr/yCYyb2c9PwXjd08Ib3If1vn1rbs1H5ZtVuOfvQ==", "dev": true, "requires": { "character-entities-html4": "^1.0.0", @@ -6837,6 +7987,12 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, "strip-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", @@ -6857,37 +8013,37 @@ "dev": true }, "stylelint": { - "version": "13.3.3", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-13.3.3.tgz", - "integrity": "sha512-j8Oio2T1YNiJc6iXDaPYd74Jg4zOa1bByNm/g9/Nvnq4tDPsIjMi46jhRZyPPktGPwjJ5FwcmCqIRlH6PVP8mA==", + "version": "13.6.1", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-13.6.1.tgz", + "integrity": "sha512-XyvKyNE7eyrqkuZ85Citd/Uv3ljGiuYHC6UiztTR6sWS9rza8j3UeQv/eGcQS9NZz/imiC4GKdk1EVL3wst5vw==", "dev": true, "requires": { "@stylelint/postcss-css-in-js": "^0.37.1", "@stylelint/postcss-markdown": "^0.36.1", - "autoprefixer": "^9.7.6", + "autoprefixer": "^9.8.0", "balanced-match": "^1.0.0", - "chalk": "^4.0.0", + "chalk": "^4.1.0", "cosmiconfig": "^6.0.0", "debug": "^4.1.1", "execall": "^2.0.0", "file-entry-cache": "^5.0.1", - "get-stdin": "^7.0.0", + "get-stdin": "^8.0.0", "global-modules": "^2.0.0", - "globby": "^11.0.0", + "globby": "^11.0.1", "globjoin": "^0.1.4", "html-tags": "^3.1.0", - "ignore": "^5.1.4", + "ignore": "^5.1.8", "import-lazy": "^4.0.0", "imurmurhash": "^0.1.4", - "known-css-properties": "^0.18.0", + "known-css-properties": "^0.19.0", "leven": "^3.1.0", "lodash": "^4.17.15", - "log-symbols": "^3.0.0", + "log-symbols": "^4.0.0", "mathml-tag-names": "^2.1.3", - "meow": "^6.1.0", + "meow": "^7.0.1", "micromatch": "^4.0.2", "normalize-selector": "^0.2.0", - "postcss": "^7.0.27", + "postcss": "^7.0.32", "postcss-html": "^0.36.0", "postcss-less": "^3.1.4", "postcss-media-query-parser": "^0.2.3", @@ -6895,10 +8051,10 @@ "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^4.0.2", "postcss-sass": "^0.4.4", - "postcss-scss": "^2.0.0", + "postcss-scss": "^2.1.1", "postcss-selector-parser": "^6.0.2", "postcss-syntax": "^0.36.2", - "postcss-value-parser": "^4.0.3", + "postcss-value-parser": "^4.1.0", "resolve-from": "^5.0.0", "slash": "^3.0.0", "specificity": "^0.4.1", @@ -6908,7 +8064,7 @@ "sugarss": "^2.0.0", "svg-tags": "^1.0.0", "table": "^5.4.6", - "v8-compile-cache": "^2.1.0", + "v8-compile-cache": "^2.1.1", "write-file-atomic": "^3.0.3" }, "dependencies": { @@ -6929,9 +8085,9 @@ } }, "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", + "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", "dev": true }, "camelcase-keys": { @@ -6943,12 +8099,20 @@ "camelcase": "^5.3.1", "map-obj": "^4.0.0", "quick-lru": "^4.0.1" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } } }, "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -6979,6 +8143,12 @@ "ms": "^2.1.1" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -6990,9 +8160,9 @@ } }, "get-stdin": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", - "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", "dev": true }, "has-flag": { @@ -7002,9 +8172,9 @@ "dev": true }, "ignore": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", - "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", "dev": true }, "indent-string": { @@ -7028,6 +8198,15 @@ "p-locate": "^4.1.0" } }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + } + }, "map-obj": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", @@ -7035,22 +8214,24 @@ "dev": true }, "meow": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.0.tgz", - "integrity": "sha512-iIAoeI01v6pmSfObAAWFoITAA4GgiT45m4SmJgoxtZfvI0fyZwhV4d0lTwiUXvAKIPlma05Feb2Xngl52Mj5Cg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.0.1.tgz", + "integrity": "sha512-tBKIQqVrAHqwit0vfuFPY3LlzJYkEOFyKa3bPgxzNl6q/RtN8KQ+ALYEASYuFayzSAsjlhXj/JZ10rH85Q6TUw==", "dev": true, "requires": { "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.1.1", + "arrify": "^2.0.1", + "camelcase": "^6.0.0", + "camelcase-keys": "^6.2.2", "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.0.0", - "minimist-options": "^4.0.1", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", "normalize-package-data": "^2.5.0", - "read-pkg-up": "^7.0.0", + "read-pkg-up": "^7.0.1", "redent": "^3.0.0", "trim-newlines": "^3.0.0", - "type-fest": "^0.8.1", - "yargs-parser": "^18.1.1" + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" } }, "p-limit": { @@ -7124,6 +8305,14 @@ "find-up": "^4.1.0", "read-pkg": "^5.2.0", "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } } }, "redent": { @@ -7186,6 +8375,12 @@ "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", "dev": true }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, "yargs-parser": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", @@ -7194,10 +8389,24 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } } } } }, + "stylelint-config-prettier": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/stylelint-config-prettier/-/stylelint-config-prettier-8.0.2.tgz", + "integrity": "sha512-TN1l93iVTXpF9NJstlvP7nOu9zY2k+mN0NSFQ/VEGz15ZIP9ohdDZTtCWHs5LjctAhSAzaILULGbgiM0ItId3A==", + "dev": true + }, "stylelint-config-recommended": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-3.0.0.tgz", @@ -7213,6 +8422,15 @@ "stylelint-config-recommended": "^3.0.0" } }, + "stylelint-prettier": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/stylelint-prettier/-/stylelint-prettier-1.1.2.tgz", + "integrity": "sha512-8QZ+EtBpMCXYB6cY0hNE3aCDKMySIx4Q8/malLaqgU/KXXa6Cj2KK8ulG1AJvUMD5XSSP8rOotqaCzR/BW6qAA==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, "sugarss": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/sugarss/-/sugarss-2.0.0.tgz", @@ -7313,11 +8531,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, "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", @@ -7343,6 +8556,33 @@ } } }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -7356,7 +8596,8 @@ "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true }, "through2": { "version": "0.2.3", @@ -7371,6 +8612,7 @@ "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, "requires": { "os-tmpdir": "~1.0.2" } @@ -7410,6 +8652,7 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" @@ -7418,7 +8661,8 @@ "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true } } }, @@ -7476,6 +8720,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, "requires": { "prelude-ls": "~1.1.2" } @@ -7514,12 +8759,6 @@ "is-typedarray": "^1.0.0" } }, - "uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, "unherit": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", @@ -7691,9 +8930,9 @@ "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" }, "v8-compile-cache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", - "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==" }, "valid-url": { "version": "1.0.9", @@ -7725,9 +8964,9 @@ } }, "vfile": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.1.0.tgz", - "integrity": "sha512-BaTPalregj++64xbGK6uIlsurN3BCRNM/P2Pg8HezlGzKd1O9PrwIac6bd9Pdx2uTb0QHoioZ+rXKolbVXEgJg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.1.1.tgz", + "integrity": "sha512-lRjkpyDGjVlBA7cDQhQ+gNcvB1BGaTHYuSOcY3S7OhDmBtnzX95FhtZZDecSTDm6aajFymyve6S5DN4ZHGezdQ==", "dev": true, "requires": { "@types/unist": "^2.0.0", @@ -7833,6 +9072,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, "requires": { "isexe": "^2.0.0" } @@ -7843,6 +9083,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", @@ -7852,12 +9098,6 @@ "string-width": "^1.0.2 || 2" } }, - "window-size": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", - "dev": true - }, "windows-release": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz", @@ -7934,6 +9174,15 @@ "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" }, + "xregexp": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", + "integrity": "sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==", + "dev": true, + "requires": { + "@babel/runtime-corejs3": "^7.8.3" + } + }, "xtend": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", @@ -7957,36 +9206,6 @@ "@babel/runtime": "^7.9.2" } }, - "yaml-lint": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/yaml-lint/-/yaml-lint-1.2.4.tgz", - "integrity": "sha512-qpKE0szyKsE9TrlVPi+bxKxVAjl30QjNAOyOxy7noQdf/WCCYUlT4xiCRxMG48eyeBzMBtBN6PgGfaB0MJePNw==", - "dev": true, - "requires": { - "glob": "^7.1.2", - "js-yaml": "^3.10.0", - "leprechaun": "0.0.2", - "lodash.merge": "^4.6.1", - "lodash.snakecase": "^4.1.1", - "nconf": "^0.10.0" - }, - "dependencies": { - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, "yargs": { "version": "11.1.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.1.tgz", diff --git a/package.json b/package.json index dbcca2e8..5eb4d6b4 100644 --- a/package.json +++ b/package.json @@ -1,88 +1,97 @@ { - "name": "magicmirror", - "version": "2.12.0-develop", - "description": "The open source modular smart mirror platform.", - "main": "js/electron.js", - "scripts": { - "start": "DISPLAY=\"${DISPLAY:=:0}\" ./node_modules/.bin/electron js/electron.js", - "server": "node ./serveronly", - "install": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error", - "install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error", - "postinstall": "npm run install-fonts && echo \"MagicMirror installation finished successfully! \n\"", - "test": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests --recursive", - "test:unit": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/unit --recursive", - "test:e2e": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/e2e --recursive", - "test:lint": "npm run test:js && npm run test:style", - "test:js": "eslint *.js js/**/*.js modules/default/**/*.js clientonly/*.js serveronly/*.js translations/*.js vendor/*.js tests/**/*.js config/* --config .eslintrc.json", - "test:style": "stylelint css/main.css modules/default/**/*.css --config .stylelintrc.json", - "config:check": "node js/check_config.js", - "lint": "npm run lint:js && npm run lint:json && npm run lint:markdown && npm run lint:style && npm run lint:yaml", - "lint:js": "eslint *.js js/**/*.js modules/default/**/*.js clientonly/*.js serveronly/*.js translations/*.js vendor/*.js tests/**/*.js config/* --config .eslintrc.json --fix", - "lint:json": "jsonlint -q package.json .eslintrc.json .markdownlintrc.json .stylelintrc.json modules/default/ translations/ vendor/package.json", - "lint:markdown": "markdownlint *.md modules/README.md modules/default/**/*.md --config .markdownlintrc.json", - "lint:style": "stylelint css/main.css modules/default/**/*.css --config .stylelintrc.json --fix", - "lint:yaml": "yamllint .travis.yml" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/MichMich/MagicMirror.git" - }, - "keywords": [ - "magic mirror", - "smart mirror", - "mirror UI", - "modular" - ], - "author": "Michael Teeuw", - "contributors": [ - "https://github.com/MichMich/MagicMirror/graphs/contributors" - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/MichMich/MagicMirror/issues" - }, - "homepage": "https://magicmirror.builders", - "devDependencies": { - "@prantlf/jsonlint": "^10.2.0", - "chai": "^4.2.0", - "chai-as-promised": "^7.1.1", - "current-week-number": "^1.0.7", - "danger": "^3.1.3", - "http-auth": "^3.2.3", - "jsdom": "^11.6.2", - "markdownlint": "^0.20.2", - "markdownlint-cli": "^0.22.0", - "mocha": "^7.1.2", - "mocha-each": "^2.0.1", - "mocha-logger": "^1.0.6", - "spectron": "^8.0.0", - "stylelint": "^13.3.3", - "stylelint-config-standard": "^20.0.0", - "yaml-lint": "^1.2.4" - }, - "optionalDependencies": { - "electron": "^6.1.7" - }, - "dependencies": { - "colors": "^1.1.2", - "console-stamp": "^0.2.9", - "eslint": "^6.8.0", - "express": "^4.16.2", - "express-ipfilter": "^1.0.1", - "feedme": "latest", - "helmet": "^3.21.2", - "iconv-lite": "latest", - "lodash": "^4.17.15", - "module-alias": "^2.2.2", - "moment": "latest", - "request": "^2.88.0", - "rrule": "^2.6.2", - "rrule-alt": "^2.2.8", - "simple-git": "^1.85.0", - "socket.io": "^2.1.1", - "valid-url": "latest" - }, - "_moduleAliases": { - "node_helper": "js/node_helper.js" - } + "name": "magicmirror", + "version": "2.13.0-develop", + "description": "The open source modular smart mirror platform.", + "main": "js/electron.js", + "scripts": { + "start": "DISPLAY=\"${DISPLAY:=:0}\" ./node_modules/.bin/electron js/electron.js", + "server": "node ./serveronly", + "install": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error", + "install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error", + "postinstall": "npm run install-fonts && echo \"MagicMirror installation finished successfully! \n\"", + "test": "NODE_ENV=test mocha tests --recursive", + "test:coverage": "NODE_ENV=test nyc mocha tests --recursive --timeout=3000", + "test:e2e": "NODE_ENV=test mocha tests/e2e --recursive", + "test:unit": "NODE_ENV=test mocha tests/unit --recursive", + "test:prettier": "prettier --check **/*.{js,css,json,md,yml}", + "test:js": "eslint *.js js/**/*.js modules/default/**/*.js clientonly/*.js serveronly/*.js translations/*.js vendor/*.js tests/**/*.js config/* --config .eslintrc.json --quiet", + "test:css": "stylelint css/main.css modules/default/**/*.css --config .stylelintrc.json", + "test:calendar": "node ./modules/default/calendar/debug.js", + "config:check": "node js/check_config.js", + "lint:prettier": "prettier --write **/*.{js,css,json,md,yml}", + "lint:js": "eslint *.js js/**/*.js modules/default/**/*.js clientonly/*.js serveronly/*.js translations/*.js vendor/*.js tests/**/*.js config/* --config .eslintrc.json --fix", + "lint:css": "stylelint css/main.css modules/default/**/*.css --config .stylelintrc.json --fix" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/MichMich/MagicMirror.git" + }, + "keywords": [ + "magic mirror", + "smart mirror", + "mirror UI", + "modular" + ], + "author": "Michael Teeuw", + "contributors": [ + "https://github.com/MichMich/MagicMirror/graphs/contributors" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/MichMich/MagicMirror/issues" + }, + "homepage": "https://magicmirror.builders", + "devDependencies": { + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "danger": "^3.1.3", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-jsdoc": "^30.1.0", + "eslint-plugin-prettier": "^3.1.4", + "http-auth": "^3.2.3", + "husky": "^4.2.5", + "jsdom": "^11.6.2", + "mocha": "^7.1.2", + "mocha-each": "^2.0.1", + "mocha-logger": "^1.0.6", + "nyc": "^15.1.0", + "prettier": "^2.0.5", + "pretty-quick": "^2.0.1", + "spectron": "^8.0.0", + "stylelint": "^13.6.1", + "stylelint-config-prettier": "^8.0.2", + "stylelint-config-standard": "^20.0.0", + "stylelint-prettier": "^1.1.2" + }, + "optionalDependencies": { + "electron": "^6.1.7" + }, + "dependencies": { + "colors": "^1.1.2", + "console-stamp": "^0.2.9", + "eslint": "^7.6.0", + "express": "^4.16.2", + "express-ipfilter": "^1.0.1", + "feedme": "latest", + "helmet": "^3.23.3", + "ical": "^0.8.0", + "iconv-lite": "latest", + "lodash": "^4.17.19", + "module-alias": "^2.2.2", + "moment": "latest", + "request": "^2.88.2", + "rrule": "^2.6.4", + "rrule-alt": "^2.2.8", + "simple-git": "^1.85.0", + "socket.io": "^2.1.1", + "valid-url": "latest" + }, + "_moduleAliases": { + "node_helper": "js/node_helper.js" + }, + "husky": { + "hooks": { + "pre-commit": "pretty-quick --staged" + } + } } diff --git a/serveronly/index.js b/serveronly/index.js index f7da58f5..9cc7d942 100644 --- a/serveronly/index.js +++ b/serveronly/index.js @@ -1,6 +1,8 @@ -var app = require("../js/app.js"); -app.start(function(config) { +const app = require("../js/app.js"); +const Log = require("../js/logger.js"); + +app.start(function (config) { var bindAddress = config.address ? config.address : "localhost"; var httpType = config.useHttps ? "https" : "http"; - console.log("\nReady to go! Please point your browser to: " + httpType + "://" + bindAddress + ":" + config.port); + Log.log("\nReady to go! Please point your browser to: " + httpType + "://" + bindAddress + ":" + config.port); }); diff --git a/tests/configs/data/StripComments.json b/tests/configs/data/StripComments.json deleted file mode 100644 index 62d5d618..00000000 --- a/tests/configs/data/StripComments.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - // Escaped - "FOO\"BAR": "Today", - - /* - * The following lines - * represent cardinal directions - */ - "N": "N", - "E": "E", - "S": "S", - "W": "W" -} diff --git a/tests/configs/data/TranslationTest.json b/tests/configs/data/TranslationTest.json index bbb13845..8a24a16f 100644 --- a/tests/configs/data/TranslationTest.json +++ b/tests/configs/data/TranslationTest.json @@ -1,33 +1,33 @@ { - "LOADING": "Loading …", + "LOADING": "Loading …", - "TODAY": "Today", - "TOMORROW": "Tomorrow", - "DAYAFTERTOMORROW": "In 2 days", - "RUNNING": "Ends in", - "EMPTY": "No upcoming events.", + "TODAY": "Today", + "TOMORROW": "Tomorrow", + "DAYAFTERTOMORROW": "In 2 days", + "RUNNING": "Ends in", + "EMPTY": "No upcoming events.", - "WEEK": "Week {weekNumber}", + "WEEK": "Week {weekNumber}", - "N": "N", - "NNE": "NNE", - "NE": "NE", - "ENE": "ENE", - "E": "E", - "ESE": "ESE", - "SE": "SE", - "SSE": "SSE", - "S": "S", - "SSW": "SSW", - "SW": "SW", - "WSW": "WSW", - "W": "W", - "WNW": "WNW", - "NW": "NW", - "NNW": "NNW", + "N": "N", + "NNE": "NNE", + "NE": "NE", + "ENE": "ENE", + "E": "E", + "ESE": "ESE", + "SE": "SE", + "SSE": "SSE", + "S": "S", + "SSW": "SSW", + "SW": "SW", + "WSW": "WSW", + "W": "W", + "WNW": "WNW", + "NW": "NW", + "NNW": "NNW", - "UPDATE_NOTIFICATION": "MagicMirror² update available.", - "UPDATE_NOTIFICATION_MODULE": "Update available for MODULE_NAME module.", - "UPDATE_INFO_SINGLE": "The current installation is COMMIT_COUNT commit behind on the BRANCH_NAME branch.", - "UPDATE_INFO_MULTIPLE": "The current installation is COMMIT_COUNT commits behind on the BRANCH_NAME branch." + "UPDATE_NOTIFICATION": "MagicMirror² update available.", + "UPDATE_NOTIFICATION_MODULE": "Update available for MODULE_NAME module.", + "UPDATE_INFO_SINGLE": "The current installation is COMMIT_COUNT commit behind on the BRANCH_NAME branch.", + "UPDATE_INFO_MULTIPLE": "The current installation is COMMIT_COUNT commits behind on the BRANCH_NAME branch." } diff --git a/tests/configs/data/calendar_test_icons.ics b/tests/configs/data/calendar_test_icons.ics new file mode 100644 index 00000000..7f24060d --- /dev/null +++ b/tests/configs/data/calendar_test_icons.ics @@ -0,0 +1,56 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//ical.marudot.com//iCal Event Maker +X-WR-CALNAME:TestEvents +NAME:TestEvents +CALSCALE:GREGORIAN +BEGIN:VTIMEZONE +TZID:Europe/Berlin +TZURL:http://tzurl.org/zoneinfo-outlook/Europe/Berlin +X-LIC-LOCATION:Europe/Berlin +BEGIN:DAYLIGHT +TZOFFSETFROM:+0100 +TZOFFSETTO:+0200 +TZNAME:CEST +DTSTART:19700329T020000 +RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU +END:DAYLIGHT +BEGIN:STANDARD +TZOFFSETFROM:+0200 +TZOFFSETTO:+0100 +TZNAME:CET +DTSTART:19701025T030000 +RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +DTSTAMP:20200719T094531Z +UID:20200719T094531Z-1871115387@marudot.com +DTSTART;TZID=Europe/Berlin:20300101T120000 +DTEND;TZID=Europe/Berlin:20300101T130000 +SUMMARY:TestEvent +END:VEVENT +BEGIN:VEVENT +DTSTAMP:20200719T094531Z +UID:20200719T094531Z-1929725136@marudot.com +DTSTART;TZID=Europe/Berlin:20300701T120000 +RRULE:FREQ=YEARLY;BYMONTH=7;BYMONTHDAY=1 +DTEND;TZID=Europe/Berlin:20300701T130000 +SUMMARY:TestEventRepeat +END:VEVENT +BEGIN:VEVENT +DTSTAMP:20200719T094531Z +UID:20200719T094531Z-371801474@marudot.com +DTSTART;VALUE=DATE:20300401 +DTEND;VALUE=DATE:20300402 +SUMMARY:TestEventDay +END:VEVENT +BEGIN:VEVENT +DTSTAMP:20200719T094531Z +UID:20200719T094531Z-133401084@marudot.com +DTSTART;VALUE=DATE:20301001 +RRULE:FREQ=YEARLY;BYMONTH=10;BYMONTHDAY=1 +DTEND;VALUE=DATE:20301002 +SUMMARY:TestEventRepeatDay +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/tests/configs/data/en.json b/tests/configs/data/en.json index bbb13845..8a24a16f 100644 --- a/tests/configs/data/en.json +++ b/tests/configs/data/en.json @@ -1,33 +1,33 @@ { - "LOADING": "Loading …", + "LOADING": "Loading …", - "TODAY": "Today", - "TOMORROW": "Tomorrow", - "DAYAFTERTOMORROW": "In 2 days", - "RUNNING": "Ends in", - "EMPTY": "No upcoming events.", + "TODAY": "Today", + "TOMORROW": "Tomorrow", + "DAYAFTERTOMORROW": "In 2 days", + "RUNNING": "Ends in", + "EMPTY": "No upcoming events.", - "WEEK": "Week {weekNumber}", + "WEEK": "Week {weekNumber}", - "N": "N", - "NNE": "NNE", - "NE": "NE", - "ENE": "ENE", - "E": "E", - "ESE": "ESE", - "SE": "SE", - "SSE": "SSE", - "S": "S", - "SSW": "SSW", - "SW": "SW", - "WSW": "WSW", - "W": "W", - "WNW": "WNW", - "NW": "NW", - "NNW": "NNW", + "N": "N", + "NNE": "NNE", + "NE": "NE", + "ENE": "ENE", + "E": "E", + "ESE": "ESE", + "SE": "SE", + "SSE": "SSE", + "S": "S", + "SSW": "SSW", + "SW": "SW", + "WSW": "WSW", + "W": "W", + "WNW": "WNW", + "NW": "NW", + "NNW": "NNW", - "UPDATE_NOTIFICATION": "MagicMirror² update available.", - "UPDATE_NOTIFICATION_MODULE": "Update available for MODULE_NAME module.", - "UPDATE_INFO_SINGLE": "The current installation is COMMIT_COUNT commit behind on the BRANCH_NAME branch.", - "UPDATE_INFO_MULTIPLE": "The current installation is COMMIT_COUNT commits behind on the BRANCH_NAME branch." + "UPDATE_NOTIFICATION": "MagicMirror² update available.", + "UPDATE_NOTIFICATION_MODULE": "Update available for MODULE_NAME module.", + "UPDATE_INFO_SINGLE": "The current installation is COMMIT_COUNT commit behind on the BRANCH_NAME branch.", + "UPDATE_INFO_MULTIPLE": "The current installation is COMMIT_COUNT commits behind on the BRANCH_NAME branch." } diff --git a/tests/configs/empty_ipWhiteList.js b/tests/configs/empty_ipWhiteList.js index 232836c3..991ca8e5 100644 --- a/tests/configs/empty_ipWhiteList.js +++ b/tests/configs/empty_ipWhiteList.js @@ -13,13 +13,14 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, - modules: [ - ] + modules: [] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/env.js b/tests/configs/env.js index ef244c39..998c1b8d 100644 --- a/tests/configs/env.js +++ b/tests/configs/env.js @@ -13,13 +13,14 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, - modules: [ - ] + modules: [] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/calendar/auth-default.js b/tests/configs/modules/calendar/auth-default.js index 3fee5015..19259119 100644 --- a/tests/configs/modules/calendar/auth-default.js +++ b/tests/configs/modules/calendar/auth-default.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -38,4 +38,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/calendar/basic-auth.js b/tests/configs/modules/calendar/basic-auth.js index 1b210102..cd6a0695 100644 --- a/tests/configs/modules/calendar/basic-auth.js +++ b/tests/configs/modules/calendar/basic-auth.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -39,4 +39,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/calendar/custom.js b/tests/configs/modules/calendar/custom.js new file mode 100644 index 00000000..2084419d --- /dev/null +++ b/tests/configs/modules/calendar/custom.js @@ -0,0 +1,41 @@ +/* Magic Mirror Test config custom calendar + * + * MIT Licensed. + */ +let config = { + port: 8080, + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], + + language: "en", + timeFormat: 12, + units: "metric", + electronOptions: { + webPreferences: { + nodeIntegration: true + } + }, + + modules: [ + { + module: "calendar", + position: "bottom_bar", + config: { + calendars: [ + { + symbol: "birthday-cake", + fullDaySymbol: "calendar-day", + recurringSymbol: "undo", + maximumEntries: 4, + maximumNumberOfDays: 10000, + url: "http://localhost:8080/tests/configs/data/calendar_test_icons.ics" + } + ] + } + } + ] +}; + +/*************** DO NOT EDIT THE LINE BELOW ***************/ +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/calendar/default.js b/tests/configs/modules/calendar/default.js index 3f70d930..9fecc1f9 100644 --- a/tests/configs/modules/calendar/default.js +++ b/tests/configs/modules/calendar/default.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -34,4 +34,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/calendar/fail-basic-auth.js b/tests/configs/modules/calendar/fail-basic-auth.js index ad22046a..922c3cdb 100644 --- a/tests/configs/modules/calendar/fail-basic-auth.js +++ b/tests/configs/modules/calendar/fail-basic-auth.js @@ -15,8 +15,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -41,4 +41,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/calendar/old-basic-auth.js b/tests/configs/modules/calendar/old-basic-auth.js index 971a2d2a..b580be92 100644 --- a/tests/configs/modules/calendar/old-basic-auth.js +++ b/tests/configs/modules/calendar/old-basic-auth.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -36,4 +36,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/clock_12hr.js b/tests/configs/modules/clock/clock_12hr.js index 31f9e4ea..d938fc5d 100644 --- a/tests/configs/modules/clock/clock_12hr.js +++ b/tests/configs/modules/clock/clock_12hr.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -26,4 +26,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/clock_24hr.js b/tests/configs/modules/clock/clock_24hr.js index e5dd89f6..cd47d14b 100644 --- a/tests/configs/modules/clock/clock_24hr.js +++ b/tests/configs/modules/clock/clock_24hr.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -26,4 +26,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/clock_analog.js b/tests/configs/modules/clock/clock_analog.js new file mode 100644 index 00000000..a353e0f4 --- /dev/null +++ b/tests/configs/modules/clock/clock_analog.js @@ -0,0 +1,33 @@ +/* Magic Mirror Test config for analog clock face + * + * MIT Licensed. + */ +let config = { + port: 8080, + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], + + language: "en", + timeFormat: 24, + units: "metric", + electronOptions: { + webPreferences: { + nodeIntegration: true + } + }, + + modules: [ + { + module: "clock", + position: "middle_center", + config: { + displayType: "analog", + analogFace: "face-006" + } + } + ] +}; + +/*************** DO NOT EDIT THE LINE BELOW ***************/ +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/clock_displaySeconds_false.js b/tests/configs/modules/clock/clock_displaySeconds_false.js index 91bbebba..5e2a1d3f 100644 --- a/tests/configs/modules/clock/clock_displaySeconds_false.js +++ b/tests/configs/modules/clock/clock_displaySeconds_false.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -29,4 +29,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/clock_showPeriodUpper.js b/tests/configs/modules/clock/clock_showPeriodUpper.js index e7ee7d0a..a001f6bc 100644 --- a/tests/configs/modules/clock/clock_showPeriodUpper.js +++ b/tests/configs/modules/clock/clock_showPeriodUpper.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -29,4 +29,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/clock_showWeek.js b/tests/configs/modules/clock/clock_showWeek.js index 8a5f305a..dc36d7d4 100644 --- a/tests/configs/modules/clock/clock_showWeek.js +++ b/tests/configs/modules/clock/clock_showWeek.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -29,4 +29,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/es/clock_12hr.js b/tests/configs/modules/clock/es/clock_12hr.js index d546e608..4b0f7f83 100644 --- a/tests/configs/modules/clock/es/clock_12hr.js +++ b/tests/configs/modules/clock/es/clock_12hr.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -26,4 +26,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/es/clock_24hr.js b/tests/configs/modules/clock/es/clock_24hr.js index abdf7a44..ae5b2e24 100644 --- a/tests/configs/modules/clock/es/clock_24hr.js +++ b/tests/configs/modules/clock/es/clock_24hr.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -26,4 +26,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/es/clock_showPeriodUpper.js b/tests/configs/modules/clock/es/clock_showPeriodUpper.js index 6bb396db..7aac8efe 100644 --- a/tests/configs/modules/clock/es/clock_showPeriodUpper.js +++ b/tests/configs/modules/clock/es/clock_showPeriodUpper.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -29,4 +29,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/clock/es/clock_showWeek.js b/tests/configs/modules/clock/es/clock_showWeek.js index 120ef4ef..1c20388d 100644 --- a/tests/configs/modules/clock/es/clock_showWeek.js +++ b/tests/configs/modules/clock/es/clock_showWeek.js @@ -16,8 +16,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -32,4 +32,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/compliments/compliments_anytime.js b/tests/configs/modules/compliments/compliments_anytime.js index 1d2818bc..9b0ab340 100644 --- a/tests/configs/modules/compliments/compliments_anytime.js +++ b/tests/configs/modules/compliments/compliments_anytime.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -27,7 +27,6 @@ var config = { afternoon: [], evening: [], anytime: ["Anytime here"] - } } } @@ -35,4 +34,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/compliments/compliments_date.js b/tests/configs/modules/compliments/compliments_date.js index 7ea984b1..91975410 100644 --- a/tests/configs/modules/compliments/compliments_date.js +++ b/tests/configs/modules/compliments/compliments_date.js @@ -14,8 +14,8 @@ let config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -28,9 +28,7 @@ let config = { morning: [], afternoon: [], evening: [], - "....-01-01": [ - "Happy new year!" - ] + "....-01-01": ["Happy new year!"] } } } @@ -38,4 +36,6 @@ let config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/compliments/compliments_only_anytime.js b/tests/configs/modules/compliments/compliments_only_anytime.js index f0189652..47c22480 100644 --- a/tests/configs/modules/compliments/compliments_only_anytime.js +++ b/tests/configs/modules/compliments/compliments_only_anytime.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -24,7 +24,6 @@ var config = { config: { compliments: { anytime: ["Anytime here"] - } } } @@ -32,4 +31,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/compliments/compliments_parts_day.js b/tests/configs/modules/compliments/compliments_parts_day.js index b4443567..09766227 100644 --- a/tests/configs/modules/compliments/compliments_parts_day.js +++ b/tests/configs/modules/compliments/compliments_parts_day.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -23,15 +23,9 @@ var config = { position: "middle_center", config: { compliments: { - morning: [ - "Hi", "Good Morning", "Morning test" - ], - afternoon: [ - "Hello", "Good Afternoon", "Afternoon test" - ], - evening: [ - "Hello There", "Good Evening", "Evening test" - ] + morning: ["Hi", "Good Morning", "Morning test"], + afternoon: ["Hello", "Good Afternoon", "Afternoon test"], + evening: ["Hello There", "Good Evening", "Evening test"] } } } @@ -39,4 +33,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/display.js b/tests/configs/modules/display.js new file mode 100644 index 00000000..6550becc --- /dev/null +++ b/tests/configs/modules/display.js @@ -0,0 +1,42 @@ +/* Magic Mirror Test config for display setters module using the helloworld module + * + * MIT Licensed. + */ +var config = { + port: 8080, + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], + + language: "en", + timeFormat: 24, + units: "metric", + electronOptions: { + fullscreen: false, + width: 800, + height: 600, + webPreferences: { + nodeIntegration: true + } + }, + + modules: [ + { + module: "helloworld", + position: "top_bar", + header: "test_header", + config: { + text: "Test Display Header" + } + }, + { + module: "helloworld", + position: "bottom_bar", + config: { + text: "Test Hide Header" + } + } + ] +}; +/*************** DO NOT EDIT THE LINE BELOW ***************/ +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/helloworld/helloworld.js b/tests/configs/modules/helloworld/helloworld.js index 6b617cf2..17603be1 100644 --- a/tests/configs/modules/helloworld/helloworld.js +++ b/tests/configs/modules/helloworld/helloworld.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -29,4 +29,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/helloworld/helloworld_default.js b/tests/configs/modules/helloworld/helloworld_default.js index 8207175f..1218ec80 100644 --- a/tests/configs/modules/helloworld/helloworld_default.js +++ b/tests/configs/modules/helloworld/helloworld_default.js @@ -13,8 +13,8 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -26,4 +26,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/newsfeed/default.js b/tests/configs/modules/newsfeed/default.js index 5cb9d311..3da874cf 100644 --- a/tests/configs/modules/newsfeed/default.js +++ b/tests/configs/modules/newsfeed/default.js @@ -13,13 +13,12 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ { - module: "newsfeed", position: "bottom_bar", config: { @@ -27,7 +26,7 @@ var config = { { title: "Rodrigo Ramirez Blog", url: "http://localhost:8080/tests/configs/data/feed_test_rodrigoramirez.xml" - }, + } ] } } @@ -35,4 +34,6 @@ var config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/positions.js b/tests/configs/modules/positions.js index 1d36a0c0..92a2201a 100644 --- a/tests/configs/modules/positions.js +++ b/tests/configs/modules/positions.js @@ -15,16 +15,14 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: - // Using exotic content. This is why dont accept go to JSON configuration file - (function() { - var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", - "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", - "bottom_bar", "fullscreen_above", "fullscreen_below"]; + // Using exotic content. This is why don't accept go to JSON configuration file + (function () { + var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", "bottom_bar", "fullscreen_above", "fullscreen_below"]; var modules = Array(); for (var idx in positions) { modules.push({ @@ -36,7 +34,9 @@ var config = { }); } return modules; - })(), + })() }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/weather/currentweather_default.js b/tests/configs/modules/weather/currentweather_default.js index d52a7962..57ce23e4 100644 --- a/tests/configs/modules/weather/currentweather_default.js +++ b/tests/configs/modules/weather/currentweather_default.js @@ -14,8 +14,8 @@ let config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -32,4 +32,6 @@ let config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/weather/currentweather_options.js b/tests/configs/modules/weather/currentweather_options.js index abea5bd1..3c9021f5 100644 --- a/tests/configs/modules/weather/currentweather_options.js +++ b/tests/configs/modules/weather/currentweather_options.js @@ -14,8 +14,8 @@ let config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -28,6 +28,7 @@ let config = { initialLoadDelay: 3000, useBeaufort: false, showWindDirectionAsArrow: true, + showSun: false, showHumidity: true, roundTemp: true, degreeLabel: true @@ -37,4 +38,6 @@ let config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/weather/currentweather_units.js b/tests/configs/modules/weather/currentweather_units.js index e7ad1dbc..f7303784 100644 --- a/tests/configs/modules/weather/currentweather_units.js +++ b/tests/configs/modules/weather/currentweather_units.js @@ -14,8 +14,8 @@ let config = { units: "imperial", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -34,4 +34,6 @@ let config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/weather/forecastweather_default.js b/tests/configs/modules/weather/forecastweather_default.js index c87ca260..ad4aff76 100644 --- a/tests/configs/modules/weather/forecastweather_default.js +++ b/tests/configs/modules/weather/forecastweather_default.js @@ -14,8 +14,8 @@ let config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -34,4 +34,6 @@ let config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/weather/forecastweather_options.js b/tests/configs/modules/weather/forecastweather_options.js index 82e3da08..877c4ac6 100644 --- a/tests/configs/modules/weather/forecastweather_options.js +++ b/tests/configs/modules/weather/forecastweather_options.js @@ -14,8 +14,8 @@ let config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, modules: [ @@ -37,4 +37,6 @@ let config = { }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/noIpWhiteList.js b/tests/configs/noIpWhiteList.js index 79366e09..68c711e6 100644 --- a/tests/configs/noIpWhiteList.js +++ b/tests/configs/noIpWhiteList.js @@ -13,13 +13,14 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, - modules: [ - ] + modules: [] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/port_8090.js b/tests/configs/port_8090.js index d1dc546f..433508df 100644 --- a/tests/configs/port_8090.js +++ b/tests/configs/port_8090.js @@ -13,13 +13,14 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } }, - modules: [ - ] + modules: [] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/without_modules.js b/tests/configs/without_modules.js index 921e71d7..051b3509 100644 --- a/tests/configs/without_modules.js +++ b/tests/configs/without_modules.js @@ -13,11 +13,12 @@ var config = { units: "metric", electronOptions: { webPreferences: { - nodeIntegration: true, - }, + nodeIntegration: true + } } - }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== "undefined") {module.exports = config;} +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/e2e/dev_console.js b/tests/e2e/dev_console.js index 8cddee1d..4e5d1ca1 100644 --- a/tests/e2e/dev_console.js +++ b/tests/e2e/dev_console.js @@ -4,7 +4,7 @@ const expect = require("chai").expect; const describe = global.describe; const it = global.it; -describe("Development console tests", function() { +describe("Development console tests", function () { // FIXME: This tests fail and crash another tests // Suspect problem with window focus return false; @@ -14,47 +14,47 @@ describe("Development console tests", function() { var app = null; - before(function() { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/env.js"; }); - describe("Without 'dev' commandline argument", function() { - before(function() { + describe("Without 'dev' commandline argument", function () { + before(function () { return helpers .startApplication({ args: ["js/electron.js"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - after(function() { + after(function () { return helpers.stopApplication(app); }); - it("should not open dev console when absent", function() { + it("should not open dev console when absent", function () { return expect(app.browserWindow.isDevToolsOpened()).to.eventually.equal(false); }); }); - describe("With 'dev' commandline argument", function() { - before(function() { + describe("With 'dev' commandline argument", function () { + before(function () { return helpers .startApplication({ args: ["js/electron.js", "dev"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - after(function() { + after(function () { return helpers.stopApplication(app); }); - it("should open dev console when provided", function() { + it("should open dev console when provided", function () { return expect(app.browserWindow.isDevToolsOpened()).to.eventually.equal(true); }); }); diff --git a/tests/e2e/env_spec.js b/tests/e2e/env_spec.js index 73784e96..7fef9f3c 100644 --- a/tests/e2e/env_spec.js +++ b/tests/e2e/env_spec.js @@ -7,59 +7,61 @@ const it = global.it; const beforeEach = global.beforeEach; const afterEach = global.afterEach; -describe("Electron app environment", function() { +describe("Electron app environment", function () { helpers.setupTimeout(this); var app = null; - before(function() { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/env.js"; }); - beforeEach(function() { + beforeEach(function () { return helpers .startApplication({ args: ["js/electron.js"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - afterEach(function() { + afterEach(function () { return helpers.stopApplication(app); }); - it("should open a browserwindow", function() { - return app.client - .waitUntilWindowLoaded() - // .browserWindow.focus() - .getWindowCount() - .should.eventually.equal(1) - .browserWindow.isMinimized() - .should.eventually.be.false.browserWindow.isDevToolsOpened() - .should.eventually.be.false.browserWindow.isVisible() - .should.eventually.be.true.browserWindow.isFocused() - .should.eventually.be.true.browserWindow.getBounds() - .should.eventually.have.property("width") - .and.be.above(0) - .browserWindow.getBounds() - .should.eventually.have.property("height") - .and.be.above(0) - .browserWindow.getTitle() - .should.eventually.equal("MagicMirror²"); + it("should open a browserwindow", function () { + return ( + app.client + .waitUntilWindowLoaded() + // .browserWindow.focus() + .getWindowCount() + .should.eventually.equal(1) + .browserWindow.isMinimized() + .should.eventually.be.false.browserWindow.isDevToolsOpened() + .should.eventually.be.false.browserWindow.isVisible() + .should.eventually.be.true.browserWindow.isFocused() + .should.eventually.be.true.browserWindow.getBounds() + .should.eventually.have.property("width") + .and.be.above(0) + .browserWindow.getBounds() + .should.eventually.have.property("height") + .and.be.above(0) + .browserWindow.getTitle() + .should.eventually.equal("MagicMirror²") + ); }); - it("get request from http://localhost:8080 should return 200", function(done) { - request.get("http://localhost:8080", function(err, res, body) { + it("get request from http://localhost:8080 should return 200", function (done) { + request.get("http://localhost:8080", function (err, res, body) { expect(res.statusCode).to.equal(200); done(); }); }); - it("get request from http://localhost:8080/nothing should return 404", function(done) { - request.get("http://localhost:8080/nothing", function(err, res, body) { + it("get request from http://localhost:8080/nothing should return 404", function (done) { + request.get("http://localhost:8080/nothing", function (err, res, body) { expect(res.statusCode).to.equal(404); done(); }); diff --git a/tests/e2e/fonts.js b/tests/e2e/fonts.js index 7ebfb034..d6c69e50 100644 --- a/tests/e2e/fonts.js +++ b/tests/e2e/fonts.js @@ -5,7 +5,7 @@ const forEach = require("mocha-each"); const describe = global.describe; -describe("All font files from roboto.css should be downloadable", function() { +describe("All font files from roboto.css should be downloadable", function () { helpers.setupTimeout(this); var app; @@ -21,7 +21,7 @@ describe("All font files from roboto.css should be downloadable", function() { match = regex.exec(fileContent); } - before(function() { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/without_modules.js"; @@ -29,18 +29,18 @@ describe("All font files from roboto.css should be downloadable", function() { .startApplication({ args: ["js/electron.js"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - after(function() { + after(function () { return helpers.stopApplication(app); }); forEach(fontFiles).it("should return 200 HTTP code for file '%s'", (fontFile, done) => { var fontUrl = "http://localhost:8080/fonts/" + fontFile; - request.get(fontUrl, function(err, res, body) { + request.get(fontUrl, function (err, res, body) { expect(res.statusCode).to.equal(200); done(); }); diff --git a/tests/e2e/global-setup.js b/tests/e2e/global-setup.js index c4b170fe..cce9fc05 100644 --- a/tests/e2e/global-setup.js +++ b/tests/e2e/global-setup.js @@ -6,7 +6,7 @@ * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * MIT Licensed. * -*/ + */ const Application = require("spectron").Application; const assert = require("assert"); @@ -14,12 +14,12 @@ const chai = require("chai"); const chaiAsPromised = require("chai-as-promised"); const path = require("path"); -global.before(function() { +global.before(function () { chai.should(); chai.use(chaiAsPromised); }); -exports.getElectronPath = function() { +exports.getElectronPath = function () { var electronPath = path.join(__dirname, "..", "..", "node_modules", ".bin", "electron"); if (process.platform === "win32") { electronPath += ".cmd"; @@ -28,7 +28,7 @@ exports.getElectronPath = function() { }; // Set timeout - if this is run within Travis, increase timeout -exports.setupTimeout = function(test) { +exports.setupTimeout = function (test) { if (process.env.CI) { test.timeout(30000); } else { @@ -36,26 +36,26 @@ exports.setupTimeout = function(test) { } }; -exports.startApplication = function(options) { +exports.startApplication = function (options) { options.path = exports.getElectronPath(); if (process.env.CI) { options.startTimeout = 30000; } var app = new Application(options); - return app.start().then(function() { + return app.start().then(function () { assert.equal(app.isRunning(), true); chaiAsPromised.transferPromiseness = app.transferPromiseness; return app; }); }; -exports.stopApplication = function(app) { +exports.stopApplication = function (app) { if (!app || !app.isRunning()) { return; } - return app.stop().then(function() { + return app.stop().then(function () { assert.equal(app.isRunning(), false); }); }; diff --git a/tests/e2e/ipWhistlist_spec.js b/tests/e2e/ipWhistlist_spec.js index c544465e..e22231b9 100644 --- a/tests/e2e/ipWhistlist_spec.js +++ b/tests/e2e/ipWhistlist_spec.js @@ -13,9 +13,13 @@ describe("ipWhitelist directive configuration", function () { var app = null; beforeEach(function () { - return helpers.startApplication({ - args: ["js/electron.js"] - }).then(function (startedApp) { app = startedApp; }); + return helpers + .startApplication({ + args: ["js/electron.js"] + }) + .then(function (startedApp) { + app = startedApp; + }); }); afterEach(function () { @@ -47,5 +51,4 @@ describe("ipWhitelist directive configuration", function () { }); }); }); - }); diff --git a/tests/e2e/modules/calendar_spec.js b/tests/e2e/modules/calendar_spec.js index beeba148..3712871c 100644 --- a/tests/e2e/modules/calendar_spec.js +++ b/tests/e2e/modules/calendar_spec.js @@ -1,101 +1,141 @@ const helpers = require("../global-setup"); const serverBasicAuth = require("../../servers/basic-auth.js"); +const expect = require("chai").expect; const describe = global.describe; const it = global.it; const beforeEach = global.beforeEach; const afterEach = global.afterEach; -describe("Calendar module", function() { +describe("Calendar module", function () { helpers.setupTimeout(this); var app = null; - beforeEach(function() { + beforeEach(function () { return helpers .startApplication({ args: ["js/electron.js"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - afterEach(function() { + afterEach(function () { return helpers.stopApplication(app); }); - describe("Default configuration", function() { - before(function() { + describe("Default configuration", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/calendar/default.js"; }); - it("Should return TestEvents", function() { - return app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); + it("should show the default maximumEntries of 10", async () => { + await app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); + const events = await app.client.$$(".calendar .event"); + return expect(events.length).equals(10); + }); + + it("should show the default calendar symbol in each event", async () => { + await app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); + const icons = await app.client.$$(".calendar .event .fa-calendar"); + return expect(icons.length).not.equals(0); }); }); - describe("Basic auth", function() { - before(function() { + describe("Custom configuration", function () { + before(function () { + // Set config sample for use in test + process.env.MM_CONFIG_FILE = "tests/configs/modules/calendar/custom.js"; + }); + + it("should show the custom maximumEntries of 4", async () => { + await app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); + const events = await app.client.$$(".calendar .event"); + return expect(events.length).equals(4); + }); + + it("should show the custom calendar symbol in each event", async () => { + await app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); + const icons = await app.client.$$(".calendar .event .fa-birthday-cake"); + return expect(icons.length).equals(4); + }); + + it("should show two custom icons for repeating events", async () => { + await app.client.waitUntilTextExists(".calendar", "TestEventRepeat", 10000); + const icons = await app.client.$$(".calendar .event .fa-undo"); + return expect(icons.length).equals(2); + }); + + it("should show two custom icons for day events", async () => { + await app.client.waitUntilTextExists(".calendar", "TestEventDay", 10000); + const icons = await app.client.$$(".calendar .event .fa-calendar-day"); + return expect(icons.length).equals(2); + }); + }); + + describe("Basic auth", function () { + before(function () { serverBasicAuth.listen(8010); // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/calendar/basic-auth.js"; }); - after(function(done) { + after(function (done) { serverBasicAuth.close(done()); }); - it("Should return TestEvents", function() { + it("should return TestEvents", function () { return app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); }); }); - describe("Basic auth by default", function() { - before(function() { + describe("Basic auth by default", function () { + before(function () { serverBasicAuth.listen(8011); // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/calendar/auth-default.js"; }); - after(function(done) { + after(function (done) { serverBasicAuth.close(done()); }); - it("Should return TestEvents", function() { + it("should return TestEvents", function () { return app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); }); }); - describe("Basic auth backward compatibility configuration: DEPRECATED", function() { - before(function() { + describe("Basic auth backward compatibility configuration: DEPRECATED", function () { + before(function () { serverBasicAuth.listen(8012); // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/calendar/old-basic-auth.js"; }); - after(function(done) { + after(function (done) { serverBasicAuth.close(done()); }); - it("Should return TestEvents", function() { + it("should return TestEvents", function () { return app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); }); }); - describe("Fail Basic auth", function() { - before(function() { + describe("Fail Basic auth", function () { + before(function () { serverBasicAuth.listen(8020); // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/calendar/fail-basic-auth.js"; }); - after(function(done) { + after(function (done) { serverBasicAuth.close(done()); }); - it("Should return No upcoming events", function() { + it("should return No upcoming events", function () { return app.client.waitUntilTextExists(".calendar", "No upcoming events.", 10000); }); }); diff --git a/tests/e2e/modules/clock_es_spec.js b/tests/e2e/modules/clock_es_spec.js index 7ad4ae64..6006aeb6 100644 --- a/tests/e2e/modules/clock_es_spec.js +++ b/tests/e2e/modules/clock_es_spec.js @@ -5,81 +5,80 @@ const it = global.it; const beforeEach = global.beforeEach; const afterEach = global.afterEach; -describe("Clock set to spanish language module", function() { +describe("Clock set to spanish language module", function () { helpers.setupTimeout(this); var app = null; - beforeEach(function() { + beforeEach(function () { return helpers .startApplication({ args: ["js/electron.js"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - afterEach(function() { + afterEach(function () { return helpers.stopApplication(app); }); - describe("with default 24hr clock config", function() { - before(function() { + describe("with default 24hr clock config", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/es/clock_24hr.js"; }); - it("shows date with correct format", function() { + it("shows date with correct format", function () { const dateRegex = /^(?:lunes|martes|miércoles|jueves|viernes|sábado|domingo), \d{1,2} de (?:enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre) de \d{4}$/; return app.client.waitUntilWindowLoaded().getText(".clock .date").should.eventually.match(dateRegex); }); - it("shows time in 24hr format", function() { + it("shows time in 24hr format", function () { const timeRegex = /^(?:2[0-3]|[01]\d):[0-5]\d[0-5]\d$/; return app.client.waitUntilWindowLoaded().getText(".clock .time").should.eventually.match(timeRegex); }); }); - describe("with default 12hr clock config", function() { - before(function() { + describe("with default 12hr clock config", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/es/clock_12hr.js"; }); - it("shows date with correct format", function() { + it("shows date with correct format", function () { const dateRegex = /^(?:lunes|martes|miércoles|jueves|viernes|sábado|domingo), \d{1,2} de (?:enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre) de \d{4}$/; return app.client.waitUntilWindowLoaded().getText(".clock .date").should.eventually.match(dateRegex); }); - it("shows time in 12hr format", function() { + it("shows time in 12hr format", function () { const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[0-5]\d[ap]m$/; return app.client.waitUntilWindowLoaded().getText(".clock .time").should.eventually.match(timeRegex); }); }); - describe("with showPeriodUpper config enabled", function() { - before(function() { + describe("with showPeriodUpper config enabled", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/es/clock_showPeriodUpper.js"; }); - it("shows 12hr time with upper case AM/PM", function() { + it("shows 12hr time with upper case AM/PM", function () { const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[0-5]\d[AP]M$/; return app.client.waitUntilWindowLoaded().getText(".clock .time").should.eventually.match(timeRegex); }); }); - describe("with showWeek config enabled", function() { - before(function() { + describe("with showWeek config enabled", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/es/clock_showWeek.js"; }); - it("shows week with correct format", function() { + it("shows week with correct format", function () { const weekRegex = /^Semana [0-9]{1,2}$/; - return app.client.waitUntilWindowLoaded() - .getText(".clock .week").should.eventually.match(weekRegex); + return app.client.waitUntilWindowLoaded().getText(".clock .week").should.eventually.match(weekRegex); }); }); }); diff --git a/tests/e2e/modules/clock_spec.js b/tests/e2e/modules/clock_spec.js index be4ef0e3..2bf148c6 100644 --- a/tests/e2e/modules/clock_spec.js +++ b/tests/e2e/modules/clock_spec.js @@ -1,104 +1,117 @@ const helpers = require("../global-setup"); +const expect = require("chai").expect; +const moment = require("moment"); const describe = global.describe; const it = global.it; const beforeEach = global.beforeEach; const afterEach = global.afterEach; -describe("Clock module", function() { +describe("Clock module", function () { helpers.setupTimeout(this); var app = null; - beforeEach(function() { + beforeEach(function () { return helpers .startApplication({ args: ["js/electron.js"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - afterEach(function() { + afterEach(function () { return helpers.stopApplication(app); }); - describe("with default 24hr clock config", function() { - before(function() { + describe("with default 24hr clock config", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/clock_24hr.js"; }); - it("shows date with correct format", function() { + it("should show the date in the correct format", function () { const dateRegex = /^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}, \d{4}$/; return app.client.waitUntilWindowLoaded().getText(".clock .date").should.eventually.match(dateRegex); }); - it("shows time in 24hr format", function() { + it("should show the time in 24hr format", function () { const timeRegex = /^(?:2[0-3]|[01]\d):[0-5]\d[0-5]\d$/; return app.client.waitUntilWindowLoaded().getText(".clock .time").should.eventually.match(timeRegex); }); }); - describe("with default 12hr clock config", function() { - before(function() { + describe("with default 12hr clock config", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/clock_12hr.js"; }); - it("shows date with correct format", function() { + it("should show the date in the correct format", function () { const dateRegex = /^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}, \d{4}$/; return app.client.waitUntilWindowLoaded().getText(".clock .date").should.eventually.match(dateRegex); }); - it("shows time in 12hr format", function() { + it("should show the time in 12hr format", function () { const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[0-5]\d[ap]m$/; return app.client.waitUntilWindowLoaded().getText(".clock .time").should.eventually.match(timeRegex); }); }); - describe("with showPeriodUpper config enabled", function() { - before(function() { + describe("with showPeriodUpper config enabled", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/clock_showPeriodUpper.js"; }); - it("shows 12hr time with upper case AM/PM", function() { + it("should show 12hr time with upper case AM/PM", function () { const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[0-5]\d[AP]M$/; return app.client.waitUntilWindowLoaded().getText(".clock .time").should.eventually.match(timeRegex); }); }); - describe("with displaySeconds config disabled", function() { - before(function() { + describe("with displaySeconds config disabled", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/clock_displaySeconds_false.js"; }); - it("shows 12hr time without seconds am/pm", function() { + it("should show 12hr time without seconds am/pm", function () { const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[ap]m$/; return app.client.waitUntilWindowLoaded().getText(".clock .time").should.eventually.match(timeRegex); }); }); - describe("with showWeek config enabled", function() { - before(function() { + describe("with showWeek config enabled", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/clock_showWeek.js"; }); - it("shows week with correct format", function() { + it("should show the week in the correct format", function () { const weekRegex = /^Week [0-9]{1,2}$/; return app.client.waitUntilWindowLoaded().getText(".clock .week").should.eventually.match(weekRegex); }); - it("shows week with correct number of week of year", function() { - it("FIXME: if the day is a sunday this not match"); - // const currentWeekNumber = require("current-week-number")(); - // const weekToShow = "Week " + currentWeekNumber; - // return app.client.waitUntilWindowLoaded() - // .getText(".clock .week").should.eventually.equal(weekToShow); + it("should show the week with the correct number of week of year", function () { + const currentWeekNumber = moment().week(); + const weekToShow = "Week " + currentWeekNumber; + return app.client.waitUntilWindowLoaded().getText(".clock .week").should.eventually.equal(weekToShow); + }); + }); + + describe("with analog clock face enabled", function () { + before(function () { + // Set config sample for use in test + process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/clock_analog.js"; + }); + + it("should show the analog clock face", async () => { + await app.client.waitUntilWindowLoaded(10000); + const clock = await app.client.$$(".clockCircle"); + return expect(clock.length).equals(1); }); }); }); diff --git a/tests/e2e/modules/compliments_spec.js b/tests/e2e/modules/compliments_spec.js index 97fd0ed9..841aae03 100644 --- a/tests/e2e/modules/compliments_spec.js +++ b/tests/e2e/modules/compliments_spec.js @@ -6,101 +6,119 @@ const it = global.it; const beforeEach = global.beforeEach; const afterEach = global.afterEach; -describe("Compliments module", function() { +describe("Compliments module", function () { helpers.setupTimeout(this); var app = null; - beforeEach(function() { + beforeEach(function () { return helpers .startApplication({ args: ["js/electron.js"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - afterEach(function() { + afterEach(function () { return helpers.stopApplication(app); }); - describe("parts of days", function() { - before(function() { + describe("parts of days", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_parts_day.js"; }); - it("if Morning compliments for that part of day", function() { + it("if Morning compliments for that part of day", function () { var hour = new Date().getHours(); if (hour >= 3 && hour < 12) { // if morning check - return app.client.waitUntilWindowLoaded().getText(".compliments").then(function(text) { - expect(text).to.be.oneOf(["Hi", "Good Morning", "Morning test"]); - }); + return app.client + .waitUntilWindowLoaded() + .getText(".compliments") + .then(function (text) { + expect(text).to.be.oneOf(["Hi", "Good Morning", "Morning test"]); + }); } }); - it("if Afternoon show Compliments for that part of day", function() { + it("if Afternoon show Compliments for that part of day", function () { var hour = new Date().getHours(); if (hour >= 12 && hour < 17) { // if morning check - return app.client.waitUntilWindowLoaded().getText(".compliments").then(function(text) { - expect(text).to.be.oneOf(["Hello", "Good Afternoon", "Afternoon test"]); - }); + return app.client + .waitUntilWindowLoaded() + .getText(".compliments") + .then(function (text) { + expect(text).to.be.oneOf(["Hello", "Good Afternoon", "Afternoon test"]); + }); } }); - it("if Evening show Compliments for that part of day", function() { + it("if Evening show Compliments for that part of day", function () { var hour = new Date().getHours(); if (!(hour >= 3 && hour < 12) && !(hour >= 12 && hour < 17)) { // if evening check - return app.client.waitUntilWindowLoaded().getText(".compliments").then(function(text) { - expect(text).to.be.oneOf(["Hello There", "Good Evening", "Evening test"]); - }); + return app.client + .waitUntilWindowLoaded() + .getText(".compliments") + .then(function (text) { + expect(text).to.be.oneOf(["Hello There", "Good Evening", "Evening test"]); + }); } }); }); - describe("Feature anytime in compliments module", function() { - describe("Set anytime and empty compliments for morning, evening and afternoon ", function() { - before(function() { + describe("Feature anytime in compliments module", function () { + describe("Set anytime and empty compliments for morning, evening and afternoon ", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_anytime.js"; }); - it("Show anytime because if configure empty parts of day compliments and set anytime compliments", function() { - return app.client.waitUntilWindowLoaded().getText(".compliments").then(function(text) { - expect(text).to.be.oneOf(["Anytime here"]); - }); + it("Show anytime because if configure empty parts of day compliments and set anytime compliments", function () { + return app.client + .waitUntilWindowLoaded() + .getText(".compliments") + .then(function (text) { + expect(text).to.be.oneOf(["Anytime here"]); + }); }); }); - describe("Only anytime present in configuration compliments", function() { - before(function() { + describe("Only anytime present in configuration compliments", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_only_anytime.js"; }); - it("Show anytime compliments", function() { - return app.client.waitUntilWindowLoaded().getText(".compliments").then(function(text) { - expect(text).to.be.oneOf(["Anytime here"]); - }); + it("Show anytime compliments", function () { + return app.client + .waitUntilWindowLoaded() + .getText(".compliments") + .then(function (text) { + expect(text).to.be.oneOf(["Anytime here"]); + }); }); }); }); - describe("Feature date in compliments module", function() { - describe("Set date and empty compliments for anytime, morning, evening and afternoon", function() { - before(function() { + describe("Feature date in compliments module", function () { + describe("Set date and empty compliments for anytime, morning, evening and afternoon", function () { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_date.js"; }); - it("Show happy new year compliment on new years day", function() { - return app.client.waitUntilWindowLoaded().getText(".compliments").then(function(text) { - expect(text).to.be.oneOf(["Happy new year!"]); - }); + it("Show happy new year compliment on new years day", function () { + return app.client + .waitUntilWindowLoaded() + .getText(".compliments") + .then(function (text) { + expect(text).to.be.oneOf(["Happy new year!"]); + }); }); }); }); diff --git a/tests/e2e/modules/helloworld_spec.js b/tests/e2e/modules/helloworld_spec.js index a59e2ae4..e215b3aa 100644 --- a/tests/e2e/modules/helloworld_spec.js +++ b/tests/e2e/modules/helloworld_spec.js @@ -5,46 +5,44 @@ const it = global.it; const beforeEach = global.beforeEach; const afterEach = global.afterEach; -describe("Test helloworld module", function() { +describe("Test helloworld module", function () { helpers.setupTimeout(this); var app = null; - beforeEach(function() { + beforeEach(function () { return helpers .startApplication({ args: ["js/electron.js"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - afterEach(function() { + afterEach(function () { return helpers.stopApplication(app); }); describe("helloworld set config text", function () { - before(function() { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/helloworld/helloworld.js"; }); it("Test message helloworld module", function () { - return app.client.waitUntilWindowLoaded() - .getText(".helloworld").should.eventually.equal("Test HelloWorld Module"); + return app.client.waitUntilWindowLoaded().getText(".helloworld").should.eventually.equal("Test HelloWorld Module"); }); }); describe("helloworld default config text", function () { - before(function() { + before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/helloworld/helloworld_default.js"; }); it("Test message helloworld module", function () { - return app.client.waitUntilWindowLoaded() - .getText(".helloworld").should.eventually.equal("Hello World!"); + return app.client.waitUntilWindowLoaded().getText(".helloworld").should.eventually.equal("Hello World!"); }); }); }); diff --git a/tests/e2e/modules/mocks/index.js b/tests/e2e/modules/mocks/index.js index afd061c6..c7082638 100644 --- a/tests/e2e/modules/mocks/index.js +++ b/tests/e2e/modules/mocks/index.js @@ -1,4 +1,4 @@ const generateWeather = require("./weather_current"); const generateWeatherForecast = require("./weather_forecast"); -module.exports = {generateWeather, generateWeatherForecast}; +module.exports = { generateWeather, generateWeatherForecast }; diff --git a/tests/e2e/modules/mocks/weather_current.js b/tests/e2e/modules/mocks/weather_current.js index 807ee559..a0c3401d 100644 --- a/tests/e2e/modules/mocks/weather_current.js +++ b/tests/e2e/modules/mocks/weather_current.js @@ -1,54 +1,60 @@ const _ = require("lodash"); function generateWeather(extendedData = {}) { - return JSON.stringify(_.merge({}, { - coord:{ - lon: 11.58, - lat: 48.14 - }, - weather:[ + return JSON.stringify( + _.merge( + {}, { - id: 615, - main: "Snow", - description: "light rain and snow", - icon: "13d" + coord: { + lon: 11.58, + lat: 48.14 + }, + weather: [ + { + id: 615, + main: "Snow", + description: "light rain and snow", + icon: "13d" + }, + { + id: 500, + main: "Rain", + description: "light rain", + icon: "10d" + } + ], + base: "stations", + main: { + temp: 1.49, + pressure: 1005, + humidity: 93.7, + temp_min: 1, + temp_max: 2 + }, + visibility: 7000, + wind: { + speed: 11.8, + deg: 250 + }, + clouds: { + all: 75 + }, + dt: 1547387400, + sys: { + type: 1, + id: 1267, + message: 0.0031, + country: "DE", + sunrise: 1547362817, + sunset: 1547394301 + }, + id: 2867714, + name: "Munich", + cod: 200 }, - { - id: 500, - main: "Rain", - description: "light rain", - icon: "10d" - } - ], - base: "stations", - main:{ - temp: 1.49, - pressure: 1005, - humidity: 93.7, - temp_min: 1, - temp_max: 2 - }, - visibility: 7000, - wind:{ - speed: 11.8, - deg: 250 - }, - clouds:{ - all: 75 - }, - dt: 1547387400, - sys:{ - type: 1, - id: 1267, - message: 0.0031, - country: "DE", - sunrise: 1547362817, - sunset: 1547394301 - }, - id: 2867714, - name: "Munich", - cod: 200 - }, extendedData)); + extendedData + ) + ); } module.exports = generateWeather; diff --git a/tests/e2e/modules/mocks/weather_forecast.js b/tests/e2e/modules/mocks/weather_forecast.js index 9e74262f..eaf2e375 100644 --- a/tests/e2e/modules/mocks/weather_forecast.js +++ b/tests/e2e/modules/mocks/weather_forecast.js @@ -1,97 +1,111 @@ const _ = require("lodash"); function generateWeatherForecast(extendedData = {}) { - return JSON.stringify(_.merge({}, { - "city": { - "id": 2867714, - "name": "Munich", - "coord": {"lon": 11.5754, "lat": 48.1371}, - "country": "DE", - "population": 1260391, - "timezone": 7200 - }, - "cod": "200", - "message": 0.9653487, - "cnt": 7, - "list": [{ - "dt": 1568372400, - "sunrise": 1568350044, - "sunset": 1568395948, - "temp": {"day": 24.44, "min": 15.35, "max": 24.44, "night": 15.35, "eve": 18, "morn": 23.03}, - "pressure": 1031.65, - "humidity": 70, - "weather": [{"id": 801, "main": "Clouds", "description": "few clouds", "icon": "02d"}], - "speed": 3.35, - "deg": 314, - "clouds": 21 - }, { - "dt": 1568458800, - "sunrise": 1568436525, - "sunset": 1568482223, - "temp": {"day": 20.81, "min": 13.56, "max": 21.02, "night": 13.56, "eve": 16.6, "morn": 15.88}, - "pressure": 1028.81, - "humidity": 72, - "weather": [{"id": 500, "main": "Rain", "description": "light rain", "icon": "10d"}], - "speed": 2.21, - "deg": 81, - "clouds": 100 - }, { - "dt": 1568545200, - "sunrise": 1568523007, - "sunset": 1568568497, - "temp": {"day": 22.65, "min": 13.76, "max": 22.88, "night": 15.27, "eve": 17.45, "morn": 13.76}, - "pressure": 1023.75, - "humidity": 64, - "weather": [{"id": 800, "main": "Clear", "description": "sky is clear", "icon": "01d"}], - "speed": 1.15, - "deg": 7, - "clouds": 0 - }, { - "dt": 1568631600, - "sunrise": 1568609489, - "sunset": 1568654771, - "temp": {"day": 23.45, "min": 13.95, "max": 23.45, "night": 13.95, "eve": 17.75, "morn": 15.21}, - "pressure": 1020.41, - "humidity": 64, - "weather": [{"id": 800, "main": "Clear", "description": "sky is clear", "icon": "01d"}], - "speed": 3.07, - "deg": 298, - "clouds": 7 - }, { - "dt": 1568718000, - "sunrise": 1568695970, - "sunset": 1568741045, - "temp": {"day": 20.55, "min": 10.95, "max": 20.55, "night": 10.95, "eve": 14.82, "morn": 13.24}, - "pressure": 1019.4, - "humidity": 66, - "weather": [{"id": 800, "main": "Clear", "description": "sky is clear", "icon": "01d"}], - "speed": 2.8, - "deg": 333, - "clouds": 2 - }, { - "dt": 1568804400, - "sunrise": 1568782452, - "sunset": 1568827319, - "temp": {"day": 18.15, "min": 7.75, "max": 18.15, "night": 7.75, "eve": 12.45, "morn": 9.41}, - "pressure": 1017.56, - "humidity": 52, - "weather": [{"id": 800, "main": "Clear", "description": "sky is clear", "icon": "01d"}], - "speed": 2.92, - "deg": 34, - "clouds": 0 - }, { - "dt": 1568890800, - "sunrise": 1568868934, - "sunset": 1568913593, - "temp": {"day": 14.85, "min": 5.56, "max": 15.05, "night": 5.56, "eve": 9.56, "morn": 6.25}, - "pressure": 1022.7, - "humidity": 59, - "weather": [{"id": 800, "main": "Clear", "description": "sky is clear", "icon": "01d"}], - "speed": 2.89, - "deg": 51, - "clouds": 1 - }] - }, extendedData)); + return JSON.stringify( + _.merge( + {}, + { + city: { + id: 2867714, + name: "Munich", + coord: { lon: 11.5754, lat: 48.1371 }, + country: "DE", + population: 1260391, + timezone: 7200 + }, + cod: "200", + message: 0.9653487, + cnt: 7, + list: [ + { + dt: 1568372400, + sunrise: 1568350044, + sunset: 1568395948, + temp: { day: 24.44, min: 15.35, max: 24.44, night: 15.35, eve: 18, morn: 23.03 }, + pressure: 1031.65, + humidity: 70, + weather: [{ id: 801, main: "Clouds", description: "few clouds", icon: "02d" }], + speed: 3.35, + deg: 314, + clouds: 21 + }, + { + dt: 1568458800, + sunrise: 1568436525, + sunset: 1568482223, + temp: { day: 20.81, min: 13.56, max: 21.02, night: 13.56, eve: 16.6, morn: 15.88 }, + pressure: 1028.81, + humidity: 72, + weather: [{ id: 500, main: "Rain", description: "light rain", icon: "10d" }], + speed: 2.21, + deg: 81, + clouds: 100 + }, + { + dt: 1568545200, + sunrise: 1568523007, + sunset: 1568568497, + temp: { day: 22.65, min: 13.76, max: 22.88, night: 15.27, eve: 17.45, morn: 13.76 }, + pressure: 1023.75, + humidity: 64, + weather: [{ id: 800, main: "Clear", description: "sky is clear", icon: "01d" }], + speed: 1.15, + deg: 7, + clouds: 0 + }, + { + dt: 1568631600, + sunrise: 1568609489, + sunset: 1568654771, + temp: { day: 23.45, min: 13.95, max: 23.45, night: 13.95, eve: 17.75, morn: 15.21 }, + pressure: 1020.41, + humidity: 64, + weather: [{ id: 800, main: "Clear", description: "sky is clear", icon: "01d" }], + speed: 3.07, + deg: 298, + clouds: 7 + }, + { + dt: 1568718000, + sunrise: 1568695970, + sunset: 1568741045, + temp: { day: 20.55, min: 10.95, max: 20.55, night: 10.95, eve: 14.82, morn: 13.24 }, + pressure: 1019.4, + humidity: 66, + weather: [{ id: 800, main: "Clear", description: "sky is clear", icon: "01d" }], + speed: 2.8, + deg: 333, + clouds: 2 + }, + { + dt: 1568804400, + sunrise: 1568782452, + sunset: 1568827319, + temp: { day: 18.15, min: 7.75, max: 18.15, night: 7.75, eve: 12.45, morn: 9.41 }, + pressure: 1017.56, + humidity: 52, + weather: [{ id: 800, main: "Clear", description: "sky is clear", icon: "01d" }], + speed: 2.92, + deg: 34, + clouds: 0 + }, + { + dt: 1568890800, + sunrise: 1568868934, + sunset: 1568913593, + temp: { day: 14.85, min: 5.56, max: 15.05, night: 5.56, eve: 9.56, morn: 6.25 }, + pressure: 1022.7, + humidity: 59, + weather: [{ id: 800, main: "Clear", description: "sky is clear", icon: "01d" }], + speed: 2.89, + deg: 51, + clouds: 1 + } + ] + }, + extendedData + ) + ); } module.exports = generateWeatherForecast; diff --git a/tests/e2e/modules/newsfeed_spec.js b/tests/e2e/modules/newsfeed_spec.js index 88cb8c3e..9c9ee2ca 100644 --- a/tests/e2e/modules/newsfeed_spec.js +++ b/tests/e2e/modules/newsfeed_spec.js @@ -5,31 +5,31 @@ const it = global.it; const beforeEach = global.beforeEach; const afterEach = global.afterEach; -describe("Newsfeed module", function() { +describe("Newsfeed module", function () { helpers.setupTimeout(this); var app = null; - beforeEach(function() { + beforeEach(function () { return helpers .startApplication({ args: ["js/electron.js"] }) - .then(function(startedApp) { + .then(function (startedApp) { app = startedApp; }); }); - afterEach(function() { + afterEach(function () { return helpers.stopApplication(app); }); - describe("Default configuration", function() { - before(function() { + describe("Default configuration", function () { + before(function () { process.env.MM_CONFIG_FILE = "tests/configs/modules/newsfeed/default.js"; }); - it("show title newsfeed", function() { + it("show title newsfeed", function () { return app.client.waitUntilTextExists(".newsfeed .small", "Rodrigo Ramirez Blog", 10000).should.be.fulfilled; }); }); diff --git a/tests/e2e/modules/weather_spec.js b/tests/e2e/modules/weather_spec.js index ea916e5e..d87a44cd 100644 --- a/tests/e2e/modules/weather_spec.js +++ b/tests/e2e/modules/weather_spec.js @@ -6,10 +6,9 @@ const wdajaxstub = require("webdriverajaxstub"); const helpers = require("../global-setup"); -const {generateWeather, generateWeatherForecast} = require("./mocks"); - -describe("Weather module", function() { +const { generateWeather, generateWeatherForecast } = require("./mocks"); +describe("Weather module", function () { let app; helpers.setupTimeout(this); @@ -24,85 +23,85 @@ describe("Weather module", function() { app.client.setupStub(); } - afterEach(function() { + afterEach(function () { return helpers.stopApplication(app); }); - describe("Current weather", function() { + describe("Current weather", function () { let template; - before(function() { + before(function () { template = fs.readFileSync(path.join(__dirname, "..", "..", "..", "modules", "default", "weather", "current.njk"), "utf8"); }); - describe("Default configuration", function() { - before(function() { + describe("Default configuration", function () { + before(function () { process.env.MM_CONFIG_FILE = "tests/configs/modules/weather/currentweather_default.js"; }); - it("should render wind speed and wind direction", async function() { + it("should render wind speed and wind direction", async function () { const weather = generateWeather(); - await setup({template, data: weather}); + await setup({ template, data: weather }); return app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(2)", "6 WSW", 10000); }); - it("should render sunrise", async function() { + it("should render sunrise", async function () { const sunrise = moment().startOf("day").unix(); const sunset = moment().startOf("day").unix(); - const weather = generateWeather({sys: {sunrise, sunset}}); - await setup({template, data: weather}); + const weather = generateWeather({ sys: { sunrise, sunset } }); + await setup({ template, data: weather }); await app.client.waitForExist(".weather .normal.medium span.wi.dimmed.wi-sunrise", 10000); return app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(4)", "12:00 am", 10000); }); - it("should render sunset", async function() { + it("should render sunset", async function () { const sunrise = moment().startOf("day").unix(); const sunset = moment().endOf("day").unix(); - const weather = generateWeather({sys: {sunrise, sunset}}); - await setup({template, data: weather}); + const weather = generateWeather({ sys: { sunrise, sunset } }); + await setup({ template, data: weather }); await app.client.waitForExist(".weather .normal.medium span.wi.dimmed.wi-sunset", 10000); return app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(4)", "11:59 pm", 10000); }); - it("should render temperature with icon", async function() { + it("should render temperature with icon", async function () { const weather = generateWeather(); - await setup({template, data: weather}); + await setup({ template, data: weather }); await app.client.waitForExist(".weather .large.light span.wi.weathericon.wi-snow", 10000); return app.client.waitUntilTextExists(".weather .large.light span.bright", "1.5°", 10000); }); - it("should render feels like temperature", async function() { + it("should render feels like temperature", async function () { const weather = generateWeather(); - await setup({template, data: weather}); + await setup({ template, data: weather }); return app.client.waitUntilTextExists(".weather .normal.medium span.dimmed", "Feels like -5.6°", 10000); }); }); - describe("Configuration Options", function() { - before(function() { + describe("Configuration Options", function () { + before(function () { process.env.MM_CONFIG_FILE = "tests/configs/modules/weather/currentweather_options.js"; }); - it("should render useBeaufort = false", async function() { + it("should render useBeaufort = false", async function () { const weather = generateWeather(); - await setup({template, data: weather}); + await setup({ template, data: weather }); return app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(2)", "12", 10000); }); - it("should render showWindDirectionAsArrow = true", async function() { + it("should render showWindDirectionAsArrow = true", async function () { const weather = generateWeather(); - await setup({template, data: weather}); + await setup({ template, data: weather }); await app.client.waitForExist(".weather .normal.medium sup i.fa-long-arrow-up", 10000); const element = await app.client.getHTML(".weather .normal.medium sup i.fa-long-arrow-up"); @@ -110,17 +109,17 @@ describe("Weather module", function() { expect(element).to.include("transform:rotate(250deg);"); }); - it("should render showHumidity = true", async function() { + it("should render showHumidity = true", async function () { const weather = generateWeather(); - await setup({template, data: weather}); + await setup({ template, data: weather }); await app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(3)", "93", 10000); return app.client.waitForExist(".weather .normal.medium sup i.wi-humidity", 10000); }); - it("should render degreeLabel = true", async function() { + it("should render degreeLabel = true", async function () { const weather = generateWeather(); - await setup({template, data: weather}); + await setup({ template, data: weather }); await app.client.waitUntilTextExists(".weather .large.light span.bright", "1°C", 10000); @@ -128,41 +127,41 @@ describe("Weather module", function() { }); }); - describe("Current weather units", function() { - before(function() { + describe("Current weather units", function () { + before(function () { process.env.MM_CONFIG_FILE = "tests/configs/modules/weather/currentweather_units.js"; }); - it("should render imperial units", async function() { + it("should render imperial units", async function () { const weather = generateWeather({ - main:{ - temp: 1.49 * 9 / 5 + 32, - temp_min: 1 * 9 / 5 + 32, - temp_max: 2 * 9 / 5 + 32 + main: { + temp: (1.49 * 9) / 5 + 32, + temp_min: (1 * 9) / 5 + 32, + temp_max: (2 * 9) / 5 + 32 }, - wind:{ + wind: { speed: 11.8 * 2.23694 - }, + } }); - await setup({template, data: weather}); + await setup({ template, data: weather }); await app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(2)", "6 WSW", 10000); await app.client.waitUntilTextExists(".weather .large.light span.bright", "34,7°", 10000); return app.client.waitUntilTextExists(".weather .normal.medium span.dimmed", "22,0°", 10000); }); - it("should render decimalSymbol = ','", async function() { + it("should render decimalSymbol = ','", async function () { const weather = generateWeather({ - main:{ - temp: 1.49 * 9 / 5 + 32, - temp_min: 1 * 9 / 5 + 32, - temp_max: 2 * 9 / 5 + 32 + main: { + temp: (1.49 * 9) / 5 + 32, + temp_min: (1 * 9) / 5 + 32, + temp_max: (2 * 9) / 5 + 32 }, - wind:{ + wind: { speed: 11.8 * 2.23694 - }, + } }); - await setup({template, data: weather}); + await setup({ template, data: weather }); await app.client.waitUntilTextExists(".weather .normal.medium span:nth-child(3)", "93,7", 10000); await app.client.waitUntilTextExists(".weather .large.light span.bright", "34,7°", 10000); @@ -171,21 +170,21 @@ describe("Weather module", function() { }); }); - describe("Weather Forecast", function() { + describe("Weather Forecast", function () { let template; - before(function() { + before(function () { template = fs.readFileSync(path.join(__dirname, "..", "..", "..", "modules", "default", "weather", "forecast.njk"), "utf8"); }); - describe("Default configuration", function() { - before(function() { + describe("Default configuration", function () { + before(function () { process.env.MM_CONFIG_FILE = "tests/configs/modules/weather/forecastweather_default.js"; }); - it("should render days", async function() { + it("should render days", async function () { const weather = generateWeatherForecast(); - await setup({template, data: weather}); + await setup({ template, data: weather }); const days = ["Fri", "Sat", "Sun", "Mon", "Tue"]; @@ -194,9 +193,9 @@ describe("Weather module", function() { } }); - it("should render icons", async function() { + it("should render icons", async function () { const weather = generateWeatherForecast(); - await setup({template, data: weather}); + await setup({ template, data: weather }); const icons = ["day-cloudy", "rain", "day-sunny", "day-sunny", "day-sunny"]; @@ -205,9 +204,9 @@ describe("Weather module", function() { } }); - it("should render max temperatures", async function() { + it("should render max temperatures", async function () { const weather = generateWeatherForecast(); - await setup({template, data: weather}); + await setup({ template, data: weather }); const temperatures = ["24.4°", "21.0°", "22.9°", "23.4°", "20.6°"]; @@ -216,9 +215,9 @@ describe("Weather module", function() { } }); - it("should render min temperatures", async function() { + it("should render min temperatures", async function () { const weather = generateWeatherForecast(); - await setup({template, data: weather}); + await setup({ template, data: weather }); const temperatures = ["15.3°", "13.6°", "13.8°", "13.9°", "10.9°"]; @@ -227,9 +226,9 @@ describe("Weather module", function() { } }); - it("should render fading of rows", async function() { + it("should render fading of rows", async function () { const weather = generateWeatherForecast(); - await setup({template, data: weather}); + await setup({ template, data: weather }); const opacities = [1, 1, 0.8, 0.5333333333333333, 0.2666666666666667]; @@ -242,21 +241,21 @@ describe("Weather module", function() { }); }); - describe("Configuration Options", function() { - before(function() { + describe("Configuration Options", function () { + before(function () { process.env.MM_CONFIG_FILE = "tests/configs/modules/weather/forecastweather_options.js"; }); - it("should render custom table class", async function() { + it("should render custom table class", async function () { const weather = generateWeatherForecast(); - await setup({template, data: weather}); + await setup({ template, data: weather }); await app.client.waitForExist(".weather table.myTableClass", 10000); }); - it("should render colored rows", async function() { + it("should render colored rows", async function () { const weather = generateWeatherForecast(); - await setup({template, data: weather}); + await setup({ template, data: weather }); await app.client.waitForExist(".weather table.myTableClass", 10000); diff --git a/tests/e2e/modules_display_spec.js b/tests/e2e/modules_display_spec.js new file mode 100644 index 00000000..9497c60b --- /dev/null +++ b/tests/e2e/modules_display_spec.js @@ -0,0 +1,41 @@ +const helpers = require("./global-setup"); + +const describe = global.describe; +const it = global.it; + +describe("Display of modules", function () { + helpers.setupTimeout(this); + + var app = null; + + beforeEach(function () { + return helpers + .startApplication({ + args: ["js/electron.js"] + }) + .then(function (startedApp) { + app = startedApp; + }); + }); + + afterEach(function () { + return helpers.stopApplication(app); + }); + + describe("Using helloworld", function () { + before(function () { + // Set config sample for use in test + process.env.MM_CONFIG_FILE = "tests/configs/modules/display.js"; + }); + + it("should show the test header", async () => { + await app.client.waitForExist("#module_0_helloworld", 10000); + return app.client.element("#module_0_helloworld .module-header").isVisible().should.eventually.equal(true).getText("#module_0_helloworld .module-header").should.eventually.equal("TEST_HEADER"); + }); + + it("should show no header if no header text is specified", async () => { + await app.client.waitForExist("#module_1_helloworld", 10000); + return app.client.element("#module_1_helloworld .module-header").isVisible().should.eventually.equal(false); + }); + }); +}); diff --git a/tests/e2e/modules_position_spec.js b/tests/e2e/modules_position_spec.js index ca24ecee..930acbfd 100644 --- a/tests/e2e/modules_position_spec.js +++ b/tests/e2e/modules_position_spec.js @@ -9,7 +9,6 @@ describe("Position of modules", function () { var app = null; describe("Using helloworld", function () { - after(function () { return helpers.stopApplication(app); }); @@ -17,14 +16,16 @@ describe("Position of modules", function () { before(function () { // Set config sample for use in test process.env.MM_CONFIG_FILE = "tests/configs/modules/positions.js"; - return helpers.startApplication({ - args: ["js/electron.js"] - }).then(function (startedApp) { app = startedApp; }); + return helpers + .startApplication({ + args: ["js/electron.js"] + }) + .then(function (startedApp) { + app = startedApp; + }); }); - var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", - "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", - "bottom_bar", "fullscreen_above", "fullscreen_below"]; + var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", "bottom_bar", "fullscreen_above", "fullscreen_below"]; var position; var className; @@ -32,8 +33,10 @@ describe("Position of modules", function () { position = positions[idx]; className = position.replace("_", "."); it("show text in " + position, function () { - return app.client.waitUntilWindowLoaded() - .getText("." + className).should.eventually.equal("Text in " + position); + return app.client + .waitUntilWindowLoaded() + .getText("." + className) + .should.eventually.equal("Text in " + position); }); } }); diff --git a/tests/e2e/port_config.js b/tests/e2e/port_config.js index 41f50e75..77889748 100644 --- a/tests/e2e/port_config.js +++ b/tests/e2e/port_config.js @@ -13,9 +13,13 @@ describe("port directive configuration", function () { var app = null; beforeEach(function () { - return helpers.startApplication({ - args: ["js/electron.js"] - }).then(function (startedApp) { app = startedApp; }); + return helpers + .startApplication({ + args: ["js/electron.js"] + }) + .then(function (startedApp) { + app = startedApp; + }); }); afterEach(function () { diff --git a/tests/e2e/translations_spec.js b/tests/e2e/translations_spec.js index e589689e..cf039eb1 100644 --- a/tests/e2e/translations_spec.js +++ b/tests/e2e/translations_spec.js @@ -5,13 +5,13 @@ const expect = chai.expect; const mlog = require("mocha-logger"); const translations = require("../../translations/translations.js"); const helmet = require("helmet"); -const {JSDOM} = require("jsdom"); +const { JSDOM } = require("jsdom"); const express = require("express"); -describe("Translations", function() { +describe("Translations", function () { let server; - before(function() { + before(function () { const app = express(); app.use(helmet()); app.use(function (req, res, next) { @@ -23,12 +23,12 @@ describe("Translations", function() { server = app.listen(3000); }); - after(function() { + after(function () { server.close(); }); - it("should have a translation file in the specified path", function() { - for(let language in translations) { + it("should have a translation file in the specified path", function () { + for (let language in translations) { const file = fs.statSync(translations[language]); expect(file.isFile()).to.be.equal(true); } @@ -41,16 +41,18 @@ describe("Translations", function() { } }; - describe("Parsing language files through the Translator class", function() { - for(let language in translations) { - it(`should parse ${language}`, function(done) { - const dom = new JSDOM(`\ - \ + \ - \ + \ - \ + \ - \ + \ - \ + \ - \ + \ - \ + \ - \ + \ - \ +