From f81464bb59a906d2904e81d5da225b918c304ad9 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sat, 31 Mar 2012 12:14:39 -0400 Subject: [PATCH 001/319] Minor tidying, directory restructuring, and licensing. --- .gitignore | 2 ++ LICENSE.txt | 26 +++++++++++++++++++ build.sh | 26 +++++++++++++++++++ node_modules/gsettingsBridge/README.md | 21 ++++++++++++--- .../gsettingsBridge/gsettings_bridge.js | 12 +++++++++ node_modules/gsettingsBridge/index.js | 12 +++++++++ .../nodegsettings/nodegsettings.cc | 12 +++++++++ .../nodegsettings/nodegsettings_tests.js | 12 +++++++++ node_modules/gsettingsBridge/package.json | 6 ++--- .../{ => tests/data}/gmag-orig.json | 0 .../{ => tests/data}/gmag-test1.json | 0 .../gsettingsBridge/{ => tests}/tests.js | 6 ++--- start.sh | 20 +++----------- 13 files changed, 128 insertions(+), 27 deletions(-) create mode 100644 .gitignore create mode 100644 LICENSE.txt create mode 100755 build.sh rename node_modules/gsettingsBridge/{ => tests/data}/gmag-orig.json (100%) rename node_modules/gsettingsBridge/{ => tests/data}/gmag-test1.json (100%) rename node_modules/gsettingsBridge/{ => tests}/tests.js (76%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..42d1f89 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/gsettingsBridge/nodegsettings/.lock-wscript +node_modules/gsettingsBridge/nodegsettings/build diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..fda9113 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,26 @@ +Copyright (c) 2012, OCAD University +Copyright (c) 2012, Steven Githens +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of OCAD University nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..d1a24f4 --- /dev/null +++ b/build.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +node_modules="../node_modules" +universal="../node_modules/universal" +repoURL="git://github.com/GPII/universal.git" + +# Clone the necessary GPII framework dependencies from Git. + +if [ -d $node_modules ]; then + echo "$node_modules already exists" +else + echo "$node_modules does not exist" + echo "creating $node_modules" + mkdir -p "$node_modules" +fi +if [ -d $universal ]; then + echo "$universal already exists" +else + echo "$universal does not exist" + echo "cloning universal" + git clone "$repoURL" "$universal" +fi + +# Compile the GSettings C++ Bridge +cd node_modules/gsettingsBridge/nodegsettings +node-waf configure build diff --git a/node_modules/gsettingsBridge/README.md b/node_modules/gsettingsBridge/README.md index e725feb..24a9220 100644 --- a/node_modules/gsettingsBridge/README.md +++ b/node_modules/gsettingsBridge/README.md @@ -1,8 +1,21 @@ -To compile the node extension: +GPII Node.jS GSettings Bridge +----------------------------- -cd nodegsettings -node-waf configure build -node nodegsettings_tests.js # Run the tests +The GPII gsettingsBridge is a Node.js bridge to GNOME's native GSettings API, written in C++. + +To compile the module: + +* Run build.sh at the top of this repository + +Or, by hand: + +* cd nodegsettings +* node-waf configure build +* node nodegsettings_tests.js # Run the tests + + +Notes +----- gsettings_bridge for Fluid diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index a8d0c06..d132176 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -1,3 +1,15 @@ +/*! +GPII Node.js GSettings Bridge + +Copyright 2012 Steven Githens + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + (function () { "use strict"; diff --git a/node_modules/gsettingsBridge/index.js b/node_modules/gsettingsBridge/index.js index f2a5ac2..c03d2d6 100644 --- a/node_modules/gsettingsBridge/index.js +++ b/node_modules/gsettingsBridge/index.js @@ -1,3 +1,15 @@ +/*! +GPII Node.js GSettings Bridge + +Copyright 2012 Steven Githens + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + var fluid = require("universal"); var loader = fluid.getLoader(__dirname); diff --git a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index 8b700b6..f45e84f 100644 --- a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -1,3 +1,15 @@ +/* +GPII Node.js GSettings Bridge + +Copyright 2012 Steven Githens + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + #include #include diff --git a/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js b/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js index 311ca5d..4b1d9c0 100644 --- a/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js +++ b/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js @@ -1,3 +1,15 @@ +/*! +GPII Node.js GSettings Bridge + +Copyright 2012 Steven Githens + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + var util = require('util'); var assert = require('assert'); var exec = require('child_process').exec; diff --git a/node_modules/gsettingsBridge/package.json b/node_modules/gsettingsBridge/package.json index 029a4e4..f91b663 100644 --- a/node_modules/gsettingsBridge/package.json +++ b/node_modules/gsettingsBridge/package.json @@ -1,8 +1,8 @@ { "name": "gsettingsBridge", - "description": "gsettingsBridge handles gsettings settings and launchers.", + "description": "The GPII gsettingsBridge is a Node.js bridge to GNOME's native GSettings API.", "version": "0.1", - "author": "GPII", + "author": "Steve Githens", "bugs": "http://wiki.gpii.net/index.php/Main_Page", "homepage": "http://gpii.net/", "dependencies": {}, @@ -12,7 +12,7 @@ "url": "http://www.opensource.org/licenses/BSD-3-Clause" } ], - "keywords": ["gpii", "accessibility", "settings", "fluid", "IoC", "Inversion of Control", "configuration", "evented"], + "keywords": ["gpii", "accessibility", "settings", "fluid"], "repository": "git://github.com:GPII/linux.git", "main": "./index.js", "engines": { "node" : ">=0.1.9" } diff --git a/node_modules/gsettingsBridge/gmag-orig.json b/node_modules/gsettingsBridge/tests/data/gmag-orig.json similarity index 100% rename from node_modules/gsettingsBridge/gmag-orig.json rename to node_modules/gsettingsBridge/tests/data/gmag-orig.json diff --git a/node_modules/gsettingsBridge/gmag-test1.json b/node_modules/gsettingsBridge/tests/data/gmag-test1.json similarity index 100% rename from node_modules/gsettingsBridge/gmag-test1.json rename to node_modules/gsettingsBridge/tests/data/gmag-test1.json diff --git a/node_modules/gsettingsBridge/tests.js b/node_modules/gsettingsBridge/tests/tests.js similarity index 76% rename from node_modules/gsettingsBridge/tests.js rename to node_modules/gsettingsBridge/tests/tests.js index 9b19050..629d553 100644 --- a/node_modules/gsettingsBridge/tests.js +++ b/node_modules/gsettingsBridge/tests/tests.js @@ -3,14 +3,14 @@ var util = require("util"); var fs = require('fs'); var test1 = function() { - fs.readFile('gmag-orig.json', function(error,data) { + fs.readFile('data/gmag-orig.json', function(error,data) { var settings = JSON.parse(data); util.puts(JSON.stringify(gsettings.setSettings(settings))); }); }; var test2 = function() { - fs.readFile('gmag-test1.json', function(error,data) { + fs.readFile('data/gmag-test1.json', function(error,data) { var settings = JSON.parse(data); util.puts(JSON.stringify(gsettings.getSettings(settings))); }); @@ -20,4 +20,4 @@ util.puts("Ok testing..."); util.puts(JSON.stringify(gsettings)); //test1(); test2(); -util.puts("DOne"); \ No newline at end of file +util.puts("Done"); \ No newline at end of file diff --git a/start.sh b/start.sh index a1c386d..5e413a1 100755 --- a/start.sh +++ b/start.sh @@ -1,23 +1,9 @@ #!/bin/sh -node_modules="../node_modules" -universal="../node_modules/universal" -repoURL="git://github.com/GPII/universal.git" fileName="gpii.js" -if [ -d $node_modules ]; then - echo "$node_modules already exists" -else - echo "$node_modules does not exist" - echo "creating $node_modules" - mkdir -p "$node_modules" -fi -if [ -d $universal ]; then - echo "$universal already exists" -else - echo "$universal does not exist" - echo "cloning universal" - git clone "$repoURL" "$universal" -fi +# Install required dependencies if necessary. +./install.sh +# Start the Flow Manager node "$fileName" \ No newline at end of file From ba32ec2d53c6d5c37007d0ce3bfea3eec7fc2ce2 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 2 Apr 2012 09:55:02 -0400 Subject: [PATCH 002/319] Fixed start.sh to correctly invoke the install script. --- start.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/start.sh b/start.sh index 5e413a1..7959162 100755 --- a/start.sh +++ b/start.sh @@ -2,8 +2,8 @@ fileName="gpii.js" -# Install required dependencies if necessary. -./install.sh +# Build and install the GPII +./build.sh # Start the Flow Manager -node "$fileName" \ No newline at end of file +node "$fileName" From c97d253a6d40068cd8f86c4654b97ef610336f71 Mon Sep 17 00:00:00 2001 From: boyan Date: Mon, 13 Feb 2012 17:21:18 +0200 Subject: [PATCH 003/319] Initial commit --- README | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..d9a95cc --- /dev/null +++ b/README @@ -0,0 +1,4 @@ +This repository contains GPII-related prototypes, created as a part of the Cloud4All project. For more information, please visit: +http://gpii.net/ +http://wiki.gpii.net/ +http://cordis.europa.eu/fetch?CALLER=PROJ_ICT&ACTION=D&DOC=5&CAT=PROJ&QUERY=013516d86760:1ec6:217fdf0e&RCN=101353 From bcf7cb90699f760fb33f7f3ab4f946f693f2dfe6 Mon Sep 17 00:00:00 2001 From: boyan Date: Mon, 13 Feb 2012 19:19:01 +0200 Subject: [PATCH 004/319] Initial prototype of user authentication with a USB stick. --- README | 3 +++ usb_auth/80-local.rules | 2 ++ usb_auth/README | 8 ++++++++ usb_auth/token.txt | 1 + usb_auth/trigger.sh | 5 +++++ usb_auth/usb_app.js | 20 ++++++++++++++++++++ usb_auth/usb_test.sh | 16 ++++++++++++++++ 7 files changed, 55 insertions(+) create mode 100644 usb_auth/80-local.rules create mode 100644 usb_auth/README create mode 100644 usb_auth/token.txt create mode 100755 usb_auth/trigger.sh create mode 100644 usb_auth/usb_app.js create mode 100755 usb_auth/usb_test.sh diff --git a/README b/README index d9a95cc..a16c080 100644 --- a/README +++ b/README @@ -2,3 +2,6 @@ This repository contains GPII-related prototypes, created as a part of the Cloud http://gpii.net/ http://wiki.gpii.net/ http://cordis.europa.eu/fetch?CALLER=PROJ_ICT&ACTION=D&DOC=5&CAT=PROJ&QUERY=013516d86760:1ec6:217fdf0e&RCN=101353 + +The following projects can be found in the repository: +usb_auth - User authentication with a USB stick and a token. Linux prototype. diff --git a/usb_auth/80-local.rules b/usb_auth/80-local.rules new file mode 100644 index 0000000..22340e1 --- /dev/null +++ b/usb_auth/80-local.rules @@ -0,0 +1,2 @@ +KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/home/boyan/repos/gpiistack/usb_auth/trigger.sh 1 /dev/%k" +KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/home/boyan/repos/gpiistack/usb_auth/trigger.sh 0 /dev/%k" diff --git a/usb_auth/README b/usb_auth/README new file mode 100644 index 0000000..b2206ad --- /dev/null +++ b/usb_auth/README @@ -0,0 +1,8 @@ +Usage instructions: +1. Change the path in the '80-local.rules' and 'trigger.sh' to the folder where the corresponding files are located on your machine. +2. Copy '80-local.rules' to /etc/udev/rules.d (you will need admin privileges). +3. Run 'usb_app.js' using Node.js server. +4. Copy 'token.txt' to a USB flash disk. +5. Add/remove the USB disc and observe the output in 'log.txt' in the same folder. + +Tested on Fedora 16 with Gnome 3.2.2.1 diff --git a/usb_auth/token.txt b/usb_auth/token.txt new file mode 100644 index 0000000..fc62ad5 --- /dev/null +++ b/usb_auth/token.txt @@ -0,0 +1 @@ +intergalacticSheepherder diff --git a/usb_auth/trigger.sh b/usb_auth/trigger.sh new file mode 100755 index 0000000..92fff5c --- /dev/null +++ b/usb_auth/trigger.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# This is a workaround for correct udev script execution. +# There should be a way to avoid using a intermediate file. +cd /home/boyan/repos/gpiistack/usb_auth +./usb_test.sh $1 $2 & exit diff --git a/usb_auth/usb_app.js b/usb_auth/usb_app.js new file mode 100644 index 0000000..cee5676 --- /dev/null +++ b/usb_auth/usb_app.js @@ -0,0 +1,20 @@ +var http = require('http'); +var url = require('url'); +var fs = require('fs'); + +var app = http.createServer(function (request, response) { + response.writeHead(200, {'Content-Type': 'text/plain'}); + + var urlString = url.parse(request.url, true).query; + var logFile = fs.openSync('./log.txt', 'a+'); + if (urlString.action == 'login') { + fs.writeSync(logFile, 'User logged in on device ' + urlString.device + ' with token ' + urlString.token + '\n', null); + } else if (urlString.action == 'logout') { + fs.writeSync(logFile, 'User logged out from device ' + urlString.device + '\n', null); + } + fs.close(logFile); + + response.end('See log file for detailed info about the request.\n'); +}).listen(8000); + +console.log('Server running at http://127.0.0.1:8000/'); diff --git a/usb_auth/usb_test.sh b/usb_auth/usb_test.sh new file mode 100755 index 0000000..e474949 --- /dev/null +++ b/usb_auth/usb_test.sh @@ -0,0 +1,16 @@ +#!/bin/sh +if [ $1 -eq 1 ]; then + # USB disk drive is added. + retries=0 + # Wait for drive to be mounted. There should be a better solution using nautilus. + until [[ `mount | grep $2` || $retries -ge 5 ]]; do + retries=$[$retries+1] + sleep 1 + done + loc=`mount | grep /sdb1 |cut -d " " -f 3` # The location where the USB disk drive is mounted. + token=`cat $loc/token.txt` # The token that identifies the user. + curl http://localhost:8000/users?action=login\&device=$2\&token=$token # A call to the Node.js server +else + # USB disk drive is removed. + curl http://localhost:8000/users?action=logout\&device=$2 +fi From f9798c6cb9c43c3a68b1e9018d27ea2d7283ac8f Mon Sep 17 00:00:00 2001 From: boyan Date: Fri, 17 Feb 2012 17:28:45 +0200 Subject: [PATCH 005/319] Switched the server to express. --- usb_auth/README | 2 +- usb_auth/app.js | 35 + usb_auth/node_modules/.bin/express | 1 + usb_auth/node_modules/.bin/jade | 1 + usb_auth/node_modules/express/.npmignore | 7 + usb_auth/node_modules/express/History.md | 805 +++++ usb_auth/node_modules/express/LICENSE | 22 + usb_auth/node_modules/express/Makefile | 29 + usb_auth/node_modules/express/Readme.md | 145 + usb_auth/node_modules/express/bin/express | 416 +++ usb_auth/node_modules/express/index.js | 2 + usb_auth/node_modules/express/lib/express.js | 79 + usb_auth/node_modules/express/lib/http.js | 582 +++ usb_auth/node_modules/express/lib/https.js | 52 + usb_auth/node_modules/express/lib/request.js | 323 ++ usb_auth/node_modules/express/lib/response.js | 460 +++ .../express/lib/router/collection.js | 53 + .../node_modules/express/lib/router/index.js | 398 +++ .../express/lib/router/methods.js | 70 + .../node_modules/express/lib/router/route.js | 88 + usb_auth/node_modules/express/lib/utils.js | 152 + usb_auth/node_modules/express/lib/view.js | 460 +++ .../node_modules/express/lib/view/partial.js | 40 + .../node_modules/express/lib/view/view.js | 210 ++ .../express/node_modules/connect/.npmignore | 11 + .../express/node_modules/connect/LICENSE | 24 + .../express/node_modules/connect/index.js | 2 + .../express/node_modules/connect/lib/cache.js | 81 + .../node_modules/connect/lib/connect.js | 106 + .../express/node_modules/connect/lib/http.js | 217 ++ .../express/node_modules/connect/lib/https.js | 47 + .../express/node_modules/connect/lib/index.js | 46 + .../connect/lib/middleware/basicAuth.js | 93 + .../connect/lib/middleware/bodyParser.js | 196 + .../connect/lib/middleware/compiler.js | 163 + .../connect/lib/middleware/cookieParser.js | 46 + .../connect/lib/middleware/csrf.js | 105 + .../connect/lib/middleware/directory.js | 222 ++ .../connect/lib/middleware/errorHandler.js | 100 + .../connect/lib/middleware/favicon.js | 76 + .../connect/lib/middleware/limit.js | 82 + .../connect/lib/middleware/logger.js | 299 ++ .../connect/lib/middleware/methodOverride.js | 38 + .../connect/lib/middleware/profiler.js | 100 + .../connect/lib/middleware/query.js | 40 + .../connect/lib/middleware/responseTime.js | 34 + .../connect/lib/middleware/router.js | 379 ++ .../connect/lib/middleware/session.js | 346 ++ .../connect/lib/middleware/session/cookie.js | 126 + .../connect/lib/middleware/session/memory.js | 131 + .../connect/lib/middleware/session/session.js | 137 + .../connect/lib/middleware/session/store.js | 87 + .../connect/lib/middleware/static.js | 225 ++ .../connect/lib/middleware/staticCache.js | 175 + .../connect/lib/middleware/vhost.js | 44 + .../express/node_modules/connect/lib/patch.js | 79 + .../connect/lib/public/directory.html | 75 + .../connect/lib/public/error.html | 13 + .../connect/lib/public/favicon.ico | Bin 0 -> 1406 bytes .../connect/lib/public/icons/page.png | Bin 0 -> 635 bytes .../connect/lib/public/icons/page_add.png | Bin 0 -> 739 bytes .../connect/lib/public/icons/page_attach.png | Bin 0 -> 794 bytes .../connect/lib/public/icons/page_code.png | Bin 0 -> 818 bytes .../connect/lib/public/icons/page_copy.png | Bin 0 -> 663 bytes .../connect/lib/public/icons/page_delete.png | Bin 0 -> 740 bytes .../connect/lib/public/icons/page_edit.png | Bin 0 -> 807 bytes .../connect/lib/public/icons/page_error.png | Bin 0 -> 793 bytes .../connect/lib/public/icons/page_excel.png | Bin 0 -> 817 bytes .../connect/lib/public/icons/page_find.png | Bin 0 -> 879 bytes .../connect/lib/public/icons/page_gear.png | Bin 0 -> 833 bytes .../connect/lib/public/icons/page_go.png | Bin 0 -> 779 bytes .../connect/lib/public/icons/page_green.png | Bin 0 -> 621 bytes .../connect/lib/public/icons/page_key.png | Bin 0 -> 801 bytes .../lib/public/icons/page_lightning.png | Bin 0 -> 839 bytes .../connect/lib/public/icons/page_link.png | Bin 0 -> 830 bytes .../lib/public/icons/page_paintbrush.png | Bin 0 -> 813 bytes .../connect/lib/public/icons/page_paste.png | Bin 0 -> 703 bytes .../connect/lib/public/icons/page_red.png | Bin 0 -> 641 bytes .../connect/lib/public/icons/page_refresh.png | Bin 0 -> 858 bytes .../connect/lib/public/icons/page_save.png | Bin 0 -> 774 bytes .../connect/lib/public/icons/page_white.png | Bin 0 -> 294 bytes .../lib/public/icons/page_white_acrobat.png | Bin 0 -> 591 bytes .../public/icons/page_white_actionscript.png | Bin 0 -> 664 bytes .../lib/public/icons/page_white_add.png | Bin 0 -> 512 bytes .../connect/lib/public/icons/page_white_c.png | Bin 0 -> 587 bytes .../lib/public/icons/page_white_camera.png | Bin 0 -> 656 bytes .../lib/public/icons/page_white_cd.png | Bin 0 -> 666 bytes .../lib/public/icons/page_white_code.png | Bin 0 -> 603 bytes .../lib/public/icons/page_white_code_red.png | Bin 0 -> 587 bytes .../public/icons/page_white_coldfusion.png | Bin 0 -> 592 bytes .../public/icons/page_white_compressed.png | Bin 0 -> 724 bytes .../lib/public/icons/page_white_copy.png | Bin 0 -> 309 bytes .../lib/public/icons/page_white_cplusplus.png | Bin 0 -> 621 bytes .../lib/public/icons/page_white_csharp.png | Bin 0 -> 700 bytes .../lib/public/icons/page_white_cup.png | Bin 0 -> 639 bytes .../lib/public/icons/page_white_database.png | Bin 0 -> 579 bytes .../lib/public/icons/page_white_delete.png | Bin 0 -> 536 bytes .../lib/public/icons/page_white_dvd.png | Bin 0 -> 638 bytes .../lib/public/icons/page_white_edit.png | Bin 0 -> 618 bytes .../lib/public/icons/page_white_error.png | Bin 0 -> 623 bytes .../lib/public/icons/page_white_excel.png | Bin 0 -> 663 bytes .../lib/public/icons/page_white_find.png | Bin 0 -> 676 bytes .../lib/public/icons/page_white_flash.png | Bin 0 -> 582 bytes .../lib/public/icons/page_white_freehand.png | Bin 0 -> 639 bytes .../lib/public/icons/page_white_gear.png | Bin 0 -> 402 bytes .../lib/public/icons/page_white_get.png | Bin 0 -> 516 bytes .../lib/public/icons/page_white_go.png | Bin 0 -> 612 bytes .../connect/lib/public/icons/page_white_h.png | Bin 0 -> 603 bytes .../public/icons/page_white_horizontal.png | Bin 0 -> 296 bytes .../lib/public/icons/page_white_key.png | Bin 0 -> 616 bytes .../lib/public/icons/page_white_lightning.png | Bin 0 -> 669 bytes .../lib/public/icons/page_white_link.png | Bin 0 -> 614 bytes .../lib/public/icons/page_white_magnify.png | Bin 0 -> 554 bytes .../lib/public/icons/page_white_medal.png | Bin 0 -> 706 bytes .../lib/public/icons/page_white_office.png | Bin 0 -> 779 bytes .../lib/public/icons/page_white_paint.png | Bin 0 -> 688 bytes .../public/icons/page_white_paintbrush.png | Bin 0 -> 618 bytes .../lib/public/icons/page_white_paste.png | Bin 0 -> 620 bytes .../lib/public/icons/page_white_php.png | Bin 0 -> 538 bytes .../lib/public/icons/page_white_picture.png | Bin 0 -> 650 bytes .../public/icons/page_white_powerpoint.png | Bin 0 -> 588 bytes .../lib/public/icons/page_white_put.png | Bin 0 -> 523 bytes .../lib/public/icons/page_white_ruby.png | Bin 0 -> 626 bytes .../lib/public/icons/page_white_stack.png | Bin 0 -> 317 bytes .../lib/public/icons/page_white_star.png | Bin 0 -> 565 bytes .../lib/public/icons/page_white_swoosh.png | Bin 0 -> 634 bytes .../lib/public/icons/page_white_text.png | Bin 0 -> 342 bytes .../public/icons/page_white_text_width.png | Bin 0 -> 315 bytes .../lib/public/icons/page_white_tux.png | Bin 0 -> 668 bytes .../lib/public/icons/page_white_vector.png | Bin 0 -> 644 bytes .../public/icons/page_white_visualstudio.png | Bin 0 -> 702 bytes .../lib/public/icons/page_white_width.png | Bin 0 -> 309 bytes .../lib/public/icons/page_white_word.png | Bin 0 -> 651 bytes .../lib/public/icons/page_white_world.png | Bin 0 -> 734 bytes .../lib/public/icons/page_white_wrench.png | Bin 0 -> 613 bytes .../lib/public/icons/page_white_zip.png | Bin 0 -> 386 bytes .../connect/lib/public/icons/page_word.png | Bin 0 -> 777 bytes .../connect/lib/public/icons/page_world.png | Bin 0 -> 903 bytes .../node_modules/connect/lib/public/style.css | 141 + .../express/node_modules/connect/lib/utils.js | 451 +++ .../node_modules/formidable/..travis.yml.un~ | Bin 0 -> 953 bytes .../node_modules/formidable/.Readme.md.un~ | Bin 0 -> 6414 bytes .../node_modules/formidable/.npmignore | 4 + .../node_modules/formidable/.package.json.un~ | Bin 0 -> 542 bytes .../node_modules/formidable/.travis.yml | 4 + .../connect/node_modules/formidable/Makefile | 14 + .../connect/node_modules/formidable/Readme.md | 303 ++ .../connect/node_modules/formidable/TODO | 3 + .../benchmark/bench-multipart-parser.js | 70 + .../node_modules/formidable/example/post.js | 43 + .../node_modules/formidable/example/upload.js | 48 + .../connect/node_modules/formidable/index.js | 1 + .../formidable/lib/.incoming_form.js.un~ | Bin 0 -> 12289 bytes .../node_modules/formidable/lib/file.js | 61 + .../formidable/lib/incoming_form.js | 378 ++ .../node_modules/formidable/lib/index.js | 3 + .../formidable/lib/multipart_parser.js | 312 ++ .../formidable/lib/querystring_parser.js | 25 + .../node_modules/formidable/lib/util.js | 6 + .../node_modules/formidable/package.json | 22 + .../formidable/test/.common.js.un~ | Bin 0 -> 1666 bytes .../node_modules/formidable/test/.run.js.un~ | Bin 0 -> 541 bytes .../node_modules/formidable/test/common.js | 19 + .../test/fixture/file/funkyfilename.txt | 1 + .../formidable/test/fixture/file/plain.txt | 1 + .../http/no-filename/.generic.http.un~ | Bin 0 -> 641 bytes .../http/special-chars-in-filename/info.md | 3 + .../test/fixture/js/.no-filename.js.un~ | Bin 0 -> 1147 bytes .../js/.special-chars-in-filename.js.un~ | Bin 0 -> 2129 bytes .../formidable/test/fixture/js/no-filename.js | 3 + .../fixture/js/special-chars-in-filename.js | 21 + .../formidable/test/fixture/multipart.js | 72 + .../test/integration/.test-fixtures.js.un~ | Bin 0 -> 30260 bytes .../test/integration/test-fixtures.js | 89 + .../formidable/test/legacy/common.js | 24 + .../integration/test-multipart-parser.js | 80 + .../test/legacy/simple/test-file.js | 104 + .../test/legacy/simple/test-incoming-form.js | 726 ++++ .../legacy/simple/test-multipart-parser.js | 50 + .../legacy/simple/test-querystring-parser.js | 45 + .../legacy/system/test-multi-video-upload.js | 72 + .../node_modules/formidable/test/run.js | 2 + .../node_modules/formidable/test/tmp/.empty | 0 .../test/unit/.test-incoming-form.js.un~ | Bin 0 -> 61302 bytes .../test/unit/test-incoming-form.js | 63 + .../node_modules/formidable/tool/record.js | 47 + .../express/node_modules/connect/package.json | 25 + .../express/node_modules/connect/test.js | 52 + .../express/node_modules/mime/LICENSE | 19 + .../express/node_modules/mime/README.md | 50 + .../express/node_modules/mime/mime.js | 92 + .../express/node_modules/mime/package.json | 22 + .../express/node_modules/mime/test.js | 79 + .../node_modules/mime/types/mime.types | 1479 ++++++++ .../node_modules/mime/types/node.types | 43 + .../node_modules/mkdirp/.gitignore.orig | 2 + .../node_modules/mkdirp/.gitignore.rej | 5 + .../express/node_modules/mkdirp/.npmignore | 2 + .../express/node_modules/mkdirp/LICENSE | 21 + .../node_modules/mkdirp/README.markdown | 54 + .../node_modules/mkdirp/examples/pow.js | 6 + .../node_modules/mkdirp/examples/pow.js.orig | 6 + .../node_modules/mkdirp/examples/pow.js.rej | 19 + .../express/node_modules/mkdirp/index.js | 79 + .../express/node_modules/mkdirp/package.json | 23 + .../express/node_modules/mkdirp/test/chmod.js | 38 + .../node_modules/mkdirp/test/clobber.js | 37 + .../node_modules/mkdirp/test/mkdirp.js | 28 + .../express/node_modules/mkdirp/test/perm.js | 32 + .../node_modules/mkdirp/test/perm_sync.js | 39 + .../express/node_modules/mkdirp/test/race.js | 41 + .../express/node_modules/mkdirp/test/rel.js | 32 + .../express/node_modules/mkdirp/test/sync.js | 27 + .../express/node_modules/mkdirp/test/umask.js | 28 + .../node_modules/mkdirp/test/umask_sync.js | 27 + .../express/node_modules/qs/.gitmodules | 6 + .../express/node_modules/qs/.npmignore | 1 + .../express/node_modules/qs/.travis.yml | 4 + .../express/node_modules/qs/History.md | 73 + .../express/node_modules/qs/Makefile | 5 + .../express/node_modules/qs/Readme.md | 54 + .../express/node_modules/qs/benchmark.js | 17 + .../express/node_modules/qs/examples.js | 51 + .../express/node_modules/qs/index.js | 2 + .../node_modules/qs/lib/querystring.js | 264 ++ .../express/node_modules/qs/package.json | 16 + .../express/node_modules/qs/test/mocha.opts | 2 + .../express/node_modules/qs/test/parse.js | 167 + .../express/node_modules/qs/test/stringify.js | 103 + usb_auth/node_modules/express/package.json | 39 + .../node_modules/express/testing/foo/app.js | 35 + .../express/testing/foo/package.json | 9 + .../testing/foo/public/stylesheets/style.css | 8 + .../express/testing/foo/routes/index.js | 10 + .../express/testing/foo/views/index.jade | 2 + .../express/testing/foo/views/layout.jade | 6 + .../node_modules/express/testing/index.js | 43 + .../express/testing/public/test.txt | 2971 ++++++++++++++++ .../express/testing/views/page.html | 1 + .../express/testing/views/page.jade | 3 + .../express/testing/views/test.md | 1 + .../express/testing/views/user/index.jade | 1 + .../express/testing/views/user/list.jade | 1 + usb_auth/node_modules/jade/.npmignore | 4 + usb_auth/node_modules/jade/LICENSE | 22 + usb_auth/node_modules/jade/bin/jade | 125 + usb_auth/node_modules/jade/index.js | 2 + usb_auth/node_modules/jade/jade.js | 3140 +++++++++++++++++ usb_auth/node_modules/jade/jade.min.js | 2 + usb_auth/node_modules/jade/lib/compiler.js | 503 +++ usb_auth/node_modules/jade/lib/doctypes.js | 18 + usb_auth/node_modules/jade/lib/filters.js | 97 + usb_auth/node_modules/jade/lib/index.js | 1 + usb_auth/node_modules/jade/lib/inline-tags.js | 28 + usb_auth/node_modules/jade/lib/jade.js | 237 ++ usb_auth/node_modules/jade/lib/lexer.js | 707 ++++ .../jade/lib/nodes/block-comment.js | 33 + usb_auth/node_modules/jade/lib/nodes/block.js | 100 + usb_auth/node_modules/jade/lib/nodes/case.js | 43 + usb_auth/node_modules/jade/lib/nodes/code.js | 35 + .../node_modules/jade/lib/nodes/comment.js | 32 + .../node_modules/jade/lib/nodes/doctype.js | 29 + usb_auth/node_modules/jade/lib/nodes/each.js | 35 + .../node_modules/jade/lib/nodes/filter.js | 35 + usb_auth/node_modules/jade/lib/nodes/index.js | 20 + .../node_modules/jade/lib/nodes/literal.js | 31 + usb_auth/node_modules/jade/lib/nodes/mixin.js | 34 + usb_auth/node_modules/jade/lib/nodes/node.js | 14 + usb_auth/node_modules/jade/lib/nodes/tag.js | 80 + usb_auth/node_modules/jade/lib/nodes/text.js | 42 + usb_auth/node_modules/jade/lib/parser.js | 651 ++++ usb_auth/node_modules/jade/lib/runtime.js | 118 + .../node_modules/jade/lib/self-closing.js | 18 + usb_auth/node_modules/jade/lib/utils.js | 49 + .../jade/node_modules/commander/.npmignore | 4 + .../jade/node_modules/commander/.travis.yml | 4 + .../jade/node_modules/commander/History.md | 99 + .../jade/node_modules/commander/Makefile | 7 + .../jade/node_modules/commander/Readme.md | 263 ++ .../jade/node_modules/commander/index.js | 2 + .../node_modules/commander/lib/commander.js | 992 ++++++ .../jade/node_modules/commander/package.json | 13 + .../jade/node_modules/mkdirp/.gitignore.orig | 2 + .../jade/node_modules/mkdirp/.gitignore.rej | 5 + .../jade/node_modules/mkdirp/.npmignore | 2 + .../jade/node_modules/mkdirp/LICENSE | 21 + .../jade/node_modules/mkdirp/README.markdown | 54 + .../jade/node_modules/mkdirp/examples/pow.js | 6 + .../node_modules/mkdirp/examples/pow.js.orig | 6 + .../node_modules/mkdirp/examples/pow.js.rej | 19 + .../jade/node_modules/mkdirp/index.js | 79 + .../jade/node_modules/mkdirp/package.json | 23 + .../jade/node_modules/mkdirp/test/chmod.js | 38 + .../jade/node_modules/mkdirp/test/clobber.js | 37 + .../jade/node_modules/mkdirp/test/mkdirp.js | 28 + .../jade/node_modules/mkdirp/test/perm.js | 32 + .../node_modules/mkdirp/test/perm_sync.js | 39 + .../jade/node_modules/mkdirp/test/race.js | 41 + .../jade/node_modules/mkdirp/test/rel.js | 32 + .../jade/node_modules/mkdirp/test/sync.js | 27 + .../jade/node_modules/mkdirp/test/umask.js | 28 + .../node_modules/mkdirp/test/umask_sync.js | 27 + usb_auth/node_modules/jade/package.json | 23 + usb_auth/node_modules/jade/runtime.js | 123 + usb_auth/node_modules/jade/runtime.min.js | 1 + usb_auth/package.json | 9 + usb_auth/routes/index.js | 18 + usb_auth/usb_app.js | 20 - usb_auth/usb_test.sh | 4 +- usb_auth/views/index.jade | 1 + usb_auth/views/layout.jade | 5 + 311 files changed, 26386 insertions(+), 23 deletions(-) create mode 100644 usb_auth/app.js create mode 120000 usb_auth/node_modules/.bin/express create mode 120000 usb_auth/node_modules/.bin/jade create mode 100644 usb_auth/node_modules/express/.npmignore create mode 100644 usb_auth/node_modules/express/History.md create mode 100644 usb_auth/node_modules/express/LICENSE create mode 100644 usb_auth/node_modules/express/Makefile create mode 100644 usb_auth/node_modules/express/Readme.md create mode 100755 usb_auth/node_modules/express/bin/express create mode 100644 usb_auth/node_modules/express/index.js create mode 100644 usb_auth/node_modules/express/lib/express.js create mode 100644 usb_auth/node_modules/express/lib/http.js create mode 100644 usb_auth/node_modules/express/lib/https.js create mode 100644 usb_auth/node_modules/express/lib/request.js create mode 100644 usb_auth/node_modules/express/lib/response.js create mode 100644 usb_auth/node_modules/express/lib/router/collection.js create mode 100644 usb_auth/node_modules/express/lib/router/index.js create mode 100644 usb_auth/node_modules/express/lib/router/methods.js create mode 100644 usb_auth/node_modules/express/lib/router/route.js create mode 100644 usb_auth/node_modules/express/lib/utils.js create mode 100644 usb_auth/node_modules/express/lib/view.js create mode 100644 usb_auth/node_modules/express/lib/view/partial.js create mode 100644 usb_auth/node_modules/express/lib/view/view.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/.npmignore create mode 100644 usb_auth/node_modules/express/node_modules/connect/LICENSE create mode 100644 usb_auth/node_modules/express/node_modules/connect/index.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/cache.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/connect.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/http.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/https.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/index.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/compiler.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/csrf.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/directory.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/favicon.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/limit.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/logger.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/profiler.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/query.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/responseTime.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/router.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/memory.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/session.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/store.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/static.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/staticCache.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/vhost.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/patch.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/public/directory.html create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/public/error.html create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/public/favicon.ico create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_add.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_code.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_delete.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_edit.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_error.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_find.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_gear.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_go.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_green.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_key.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_link.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_red.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_save.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_add.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_c.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_camera.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_cd.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_compressed.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_cplusplus.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_csharp.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_cup.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_database.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_delete.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_dvd.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_error.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_flash.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_go.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_h.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_horizontal.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_lightning.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_medal.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paintbrush.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paste.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_php.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_put.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_text.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_text_width.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_tux.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_vector.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_visualstudio.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_word.png create mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_world.png create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/public/style.css create mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/utils.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/..travis.yml.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.Readme.md.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.package.json.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Makefile create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/TODO create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/index.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/.incoming_form.js.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/package.json create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/.common.js.un~ create mode 100755 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/.run.js.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/.generic.http.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.no-filename.js.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.special-chars-in-filename.js.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/.test-fixtures.js.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js create mode 100755 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/tmp/.empty create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/.test-incoming-form.js.un~ create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js create mode 100644 usb_auth/node_modules/express/node_modules/connect/package.json create mode 100644 usb_auth/node_modules/express/node_modules/connect/test.js create mode 100644 usb_auth/node_modules/express/node_modules/mime/LICENSE create mode 100644 usb_auth/node_modules/express/node_modules/mime/README.md create mode 100644 usb_auth/node_modules/express/node_modules/mime/mime.js create mode 100644 usb_auth/node_modules/express/node_modules/mime/package.json create mode 100644 usb_auth/node_modules/express/node_modules/mime/test.js create mode 100644 usb_auth/node_modules/express/node_modules/mime/types/mime.types create mode 100644 usb_auth/node_modules/express/node_modules/mime/types/node.types create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.orig create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.rej create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/.npmignore create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/LICENSE create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/README.markdown create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.orig create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.rej create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/index.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/package.json create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/chmod.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/clobber.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/mkdirp.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/perm.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/perm_sync.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/race.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/rel.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/sync.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/umask.js create mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/umask_sync.js create mode 100644 usb_auth/node_modules/express/node_modules/qs/.gitmodules create mode 100644 usb_auth/node_modules/express/node_modules/qs/.npmignore create mode 100644 usb_auth/node_modules/express/node_modules/qs/.travis.yml create mode 100644 usb_auth/node_modules/express/node_modules/qs/History.md create mode 100644 usb_auth/node_modules/express/node_modules/qs/Makefile create mode 100644 usb_auth/node_modules/express/node_modules/qs/Readme.md create mode 100644 usb_auth/node_modules/express/node_modules/qs/benchmark.js create mode 100644 usb_auth/node_modules/express/node_modules/qs/examples.js create mode 100644 usb_auth/node_modules/express/node_modules/qs/index.js create mode 100644 usb_auth/node_modules/express/node_modules/qs/lib/querystring.js create mode 100644 usb_auth/node_modules/express/node_modules/qs/package.json create mode 100644 usb_auth/node_modules/express/node_modules/qs/test/mocha.opts create mode 100644 usb_auth/node_modules/express/node_modules/qs/test/parse.js create mode 100644 usb_auth/node_modules/express/node_modules/qs/test/stringify.js create mode 100644 usb_auth/node_modules/express/package.json create mode 100644 usb_auth/node_modules/express/testing/foo/app.js create mode 100644 usb_auth/node_modules/express/testing/foo/package.json create mode 100644 usb_auth/node_modules/express/testing/foo/public/stylesheets/style.css create mode 100644 usb_auth/node_modules/express/testing/foo/routes/index.js create mode 100644 usb_auth/node_modules/express/testing/foo/views/index.jade create mode 100644 usb_auth/node_modules/express/testing/foo/views/layout.jade create mode 100644 usb_auth/node_modules/express/testing/index.js create mode 100644 usb_auth/node_modules/express/testing/public/test.txt create mode 100644 usb_auth/node_modules/express/testing/views/page.html create mode 100644 usb_auth/node_modules/express/testing/views/page.jade create mode 100644 usb_auth/node_modules/express/testing/views/test.md create mode 100644 usb_auth/node_modules/express/testing/views/user/index.jade create mode 100644 usb_auth/node_modules/express/testing/views/user/list.jade create mode 100644 usb_auth/node_modules/jade/.npmignore create mode 100644 usb_auth/node_modules/jade/LICENSE create mode 100755 usb_auth/node_modules/jade/bin/jade create mode 100644 usb_auth/node_modules/jade/index.js create mode 100644 usb_auth/node_modules/jade/jade.js create mode 100644 usb_auth/node_modules/jade/jade.min.js create mode 100644 usb_auth/node_modules/jade/lib/compiler.js create mode 100644 usb_auth/node_modules/jade/lib/doctypes.js create mode 100644 usb_auth/node_modules/jade/lib/filters.js create mode 120000 usb_auth/node_modules/jade/lib/index.js create mode 100644 usb_auth/node_modules/jade/lib/inline-tags.js create mode 100644 usb_auth/node_modules/jade/lib/jade.js create mode 100644 usb_auth/node_modules/jade/lib/lexer.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/block-comment.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/block.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/case.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/code.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/comment.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/doctype.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/each.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/filter.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/index.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/literal.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/mixin.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/node.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/tag.js create mode 100644 usb_auth/node_modules/jade/lib/nodes/text.js create mode 100644 usb_auth/node_modules/jade/lib/parser.js create mode 100644 usb_auth/node_modules/jade/lib/runtime.js create mode 100644 usb_auth/node_modules/jade/lib/self-closing.js create mode 100644 usb_auth/node_modules/jade/lib/utils.js create mode 100644 usb_auth/node_modules/jade/node_modules/commander/.npmignore create mode 100644 usb_auth/node_modules/jade/node_modules/commander/.travis.yml create mode 100644 usb_auth/node_modules/jade/node_modules/commander/History.md create mode 100644 usb_auth/node_modules/jade/node_modules/commander/Makefile create mode 100644 usb_auth/node_modules/jade/node_modules/commander/Readme.md create mode 100644 usb_auth/node_modules/jade/node_modules/commander/index.js create mode 100644 usb_auth/node_modules/jade/node_modules/commander/lib/commander.js create mode 100644 usb_auth/node_modules/jade/node_modules/commander/package.json create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.orig create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.rej create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/.npmignore create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/LICENSE create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/README.markdown create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/index.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/package.json create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/chmod.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/clobber.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/mkdirp.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/perm.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/perm_sync.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/race.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/rel.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/sync.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/umask.js create mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/umask_sync.js create mode 100644 usb_auth/node_modules/jade/package.json create mode 100644 usb_auth/node_modules/jade/runtime.js create mode 100644 usb_auth/node_modules/jade/runtime.min.js create mode 100644 usb_auth/package.json create mode 100644 usb_auth/routes/index.js delete mode 100644 usb_auth/usb_app.js create mode 100644 usb_auth/views/index.jade create mode 100644 usb_auth/views/layout.jade diff --git a/usb_auth/README b/usb_auth/README index b2206ad..d71fe42 100644 --- a/usb_auth/README +++ b/usb_auth/README @@ -1,7 +1,7 @@ Usage instructions: 1. Change the path in the '80-local.rules' and 'trigger.sh' to the folder where the corresponding files are located on your machine. 2. Copy '80-local.rules' to /etc/udev/rules.d (you will need admin privileges). -3. Run 'usb_app.js' using Node.js server. +3. Run 'app.js' using Node.js server. 4. Copy 'token.txt' to a USB flash disk. 5. Add/remove the USB disc and observe the output in 'log.txt' in the same folder. diff --git a/usb_auth/app.js b/usb_auth/app.js new file mode 100644 index 0000000..8f734b5 --- /dev/null +++ b/usb_auth/app.js @@ -0,0 +1,35 @@ + +/** + * Module dependencies. + */ + +var express = require('express') + , routes = require('./routes'); + +var app = module.exports = express.createServer(); + +// Configuration + +app.configure(function(){ + app.set('views', __dirname + '/views'); + app.set('view engine', 'jade'); + app.use(express.bodyParser()); + app.use(express.methodOverride()); + app.use(app.router); + app.use(express.static(__dirname + '/public')); +}); + +app.configure('development', function(){ + app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); +}); + +app.configure('production', function(){ + app.use(express.errorHandler()); +}); + +// Routes + +app.get('/users', routes.index); + +app.listen(3000); +console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); diff --git a/usb_auth/node_modules/.bin/express b/usb_auth/node_modules/.bin/express new file mode 120000 index 0000000..b741d99 --- /dev/null +++ b/usb_auth/node_modules/.bin/express @@ -0,0 +1 @@ +../express/bin/express \ No newline at end of file diff --git a/usb_auth/node_modules/.bin/jade b/usb_auth/node_modules/.bin/jade new file mode 120000 index 0000000..571fae7 --- /dev/null +++ b/usb_auth/node_modules/.bin/jade @@ -0,0 +1 @@ +../jade/bin/jade \ No newline at end of file diff --git a/usb_auth/node_modules/express/.npmignore b/usb_auth/node_modules/express/.npmignore new file mode 100644 index 0000000..74bd365 --- /dev/null +++ b/usb_auth/node_modules/express/.npmignore @@ -0,0 +1,7 @@ +.git* +docs/ +examples/ +support/ +test/ +testing.js +.DS_Store diff --git a/usb_auth/node_modules/express/History.md b/usb_auth/node_modules/express/History.md new file mode 100644 index 0000000..113ae6f --- /dev/null +++ b/usb_auth/node_modules/express/History.md @@ -0,0 +1,805 @@ + +2.5.8 / 2012-02-08 +================== + + * Update mkdirp dep. Closes #991 + +2.5.7 / 2012-02-06 +================== + + * Fixed `app.all` duplicate DELETE requests [mscdex] + +2.5.6 / 2012-01-13 +================== + + * Updated hamljs dev dep. Closes #953 + +2.5.5 / 2012-01-08 +================== + + * Fixed: set `filename` on cached templates [matthewleon] + +2.5.4 / 2012-01-02 +================== + + * Fixed `express(1)` eol on 0.4.x. Closes #947 + +2.5.3 / 2011-12-30 +================== + + * Fixed `req.is()` when a charset is present + +2.5.2 / 2011-12-10 +================== + + * Fixed: express(1) LF -> CRLF for windows + +2.5.1 / 2011-11-17 +================== + + * Changed: updated connect to 1.8.x + * Removed sass.js support from express(1) + +2.5.0 / 2011-10-24 +================== + + * Added ./routes dir for generated app by default + * Added npm install reminder to express(1) app gen + * Added 0.5.x support + * Removed `make test-cov` since it wont work with node 0.5.x + * Fixed express(1) public dir for windows. Closes #866 + +2.4.7 / 2011-10-05 +================== + + * Added mkdirp to express(1). Closes #795 + * Added simple _json-config_ example + * Added shorthand for the parsed request's pathname via `req.path` + * Changed connect dep to 1.7.x to fix npm issue... + * Fixed `res.redirect()` __HEAD__ support. [reported by xerox] + * Fixed `req.flash()`, only escape args + * Fixed absolute path checking on windows. Closes #829 [reported by andrewpmckenzie] + +2.4.6 / 2011-08-22 +================== + + * Fixed multiple param callback regression. Closes #824 [reported by TroyGoode] + +2.4.5 / 2011-08-19 +================== + + * Added support for routes to handle errors. Closes #809 + * Added `app.routes.all()`. Closes #803 + * Added "basepath" setting to work in conjunction with reverse proxies etc. + * Refactored `Route` to use a single array of callbacks + * Added support for multiple callbacks for `app.param()`. Closes #801 +Closes #805 + * Changed: removed .call(self) for route callbacks + * Dependency: `qs >= 0.3.1` + * Fixed `res.redirect()` on windows due to `join()` usage. Closes #808 + +2.4.4 / 2011-08-05 +================== + + * Fixed `res.header()` intention of a set, even when `undefined` + * Fixed `*`, value no longer required + * Fixed `res.send(204)` support. Closes #771 + +2.4.3 / 2011-07-14 +================== + + * Added docs for `status` option special-case. Closes #739 + * Fixed `options.filename`, exposing the view path to template engines + +2.4.2. / 2011-07-06 +================== + + * Revert "removed jsonp stripping" for XSS + +2.4.1 / 2011-07-06 +================== + + * Added `res.json()` JSONP support. Closes #737 + * Added _extending-templates_ example. Closes #730 + * Added "strict routing" setting for trailing slashes + * Added support for multiple envs in `app.configure()` calls. Closes #735 + * Changed: `res.send()` using `res.json()` + * Changed: when cookie `path === null` don't default it + * Changed; default cookie path to "home" setting. Closes #731 + * Removed _pids/logs_ creation from express(1) + +2.4.0 / 2011-06-28 +================== + + * Added chainable `res.status(code)` + * Added `res.json()`, an explicit version of `res.send(obj)` + * Added simple web-service example + +2.3.12 / 2011-06-22 +================== + + * \#express is now on freenode! come join! + * Added `req.get(field, param)` + * Added links to Japanese documentation, thanks @hideyukisaito! + * Added; the `express(1)` generated app outputs the env + * Added `content-negotiation` example + * Dependency: connect >= 1.5.1 < 2.0.0 + * Fixed view layout bug. Closes #720 + * Fixed; ignore body on 304. Closes #701 + +2.3.11 / 2011-06-04 +================== + + * Added `npm test` + * Removed generation of dummy test file from `express(1)` + * Fixed; `express(1)` adds express as a dep + * Fixed; prune on `prepublish` + +2.3.10 / 2011-05-27 +================== + + * Added `req.route`, exposing the current route + * Added _package.json_ generation support to `express(1)` + * Fixed call to `app.param()` function for optional params. Closes #682 + +2.3.9 / 2011-05-25 +================== + + * Fixed bug-ish with `../' in `res.partial()` calls + +2.3.8 / 2011-05-24 +================== + + * Fixed `app.options()` + +2.3.7 / 2011-05-23 +================== + + * Added route `Collection`, ex: `app.get('/user/:id').remove();` + * Added support for `app.param(fn)` to define param logic + * Removed `app.param()` support for callback with return value + * Removed module.parent check from express(1) generated app. Closes #670 + * Refactored router. Closes #639 + +2.3.6 / 2011-05-20 +================== + + * Changed; using devDependencies instead of git submodules + * Fixed redis session example + * Fixed markdown example + * Fixed view caching, should not be enabled in development + +2.3.5 / 2011-05-20 +================== + + * Added export `.view` as alias for `.View` + +2.3.4 / 2011-05-08 +================== + + * Added `./examples/say` + * Fixed `res.sendfile()` bug preventing the transfer of files with spaces + +2.3.3 / 2011-05-03 +================== + + * Added "case sensitive routes" option. + * Changed; split methods supported per rfc [slaskis] + * Fixed route-specific middleware when using the same callback function several times + +2.3.2 / 2011-04-27 +================== + + * Fixed view hints + +2.3.1 / 2011-04-26 +================== + + * Added `app.match()` as `app.match.all()` + * Added `app.lookup()` as `app.lookup.all()` + * Added `app.remove()` for `app.remove.all()` + * Added `app.remove.VERB()` + * Fixed template caching collision issue. Closes #644 + * Moved router over from connect and started refactor + +2.3.0 / 2011-04-25 +================== + + * Added options support to `res.clearCookie()` + * Added `res.helpers()` as alias of `res.locals()` + * Added; json defaults to UTF-8 with `res.send()`. Closes #632. [Daniel * Dependency `connect >= 1.4.0` + * Changed; auto set Content-Type in res.attachement [Aaron Heckmann] + * Renamed "cache views" to "view cache". Closes #628 + * Fixed caching of views when using several apps. Closes #637 + * Fixed gotcha invoking `app.param()` callbacks once per route middleware. +Closes #638 + * Fixed partial lookup precedence. Closes #631 +Shaw] + +2.2.2 / 2011-04-12 +================== + + * Added second callback support for `res.download()` connection errors + * Fixed `filename` option passing to template engine + +2.2.1 / 2011-04-04 +================== + + * Added `layout(path)` helper to change the layout within a view. Closes #610 + * Fixed `partial()` collection object support. + Previously only anything with `.length` would work. + When `.length` is present one must still be aware of holes, + however now `{ collection: {foo: 'bar'}}` is valid, exposes + `keyInCollection` and `keysInCollection`. + + * Performance improved with better view caching + * Removed `request` and `response` locals + * Changed; errorHandler page title is now `Express` instead of `Connect` + +2.2.0 / 2011-03-30 +================== + + * Added `app.lookup.VERB()`, ex `app.lookup.put('/user/:id')`. Closes #606 + * Added `app.match.VERB()`, ex `app.match.put('/user/12')`. Closes #606 + * Added `app.VERB(path)` as alias of `app.lookup.VERB()`. + * Dependency `connect >= 1.2.0` + +2.1.1 / 2011-03-29 +================== + + * Added; expose `err.view` object when failing to locate a view + * Fixed `res.partial()` call `next(err)` when no callback is given [reported by aheckmann] + * Fixed; `res.send(undefined)` responds with 204 [aheckmann] + +2.1.0 / 2011-03-24 +================== + + * Added `/_?` partial lookup support. Closes #447 + * Added `request`, `response`, and `app` local variables + * Added `settings` local variable, containing the app's settings + * Added `req.flash()` exception if `req.session` is not available + * Added `res.send(bool)` support (json response) + * Fixed stylus example for latest version + * Fixed; wrap try/catch around `res.render()` + +2.0.0 / 2011-03-17 +================== + + * Fixed up index view path alternative. + * Changed; `res.locals()` without object returns the locals + +2.0.0rc3 / 2011-03-17 +================== + + * Added `res.locals(obj)` to compliment `res.local(key, val)` + * Added `res.partial()` callback support + * Fixed recursive error reporting issue in `res.render()` + +2.0.0rc2 / 2011-03-17 +================== + + * Changed; `partial()` "locals" are now optional + * Fixed `SlowBuffer` support. Closes #584 [reported by tyrda01] + * Fixed .filename view engine option [reported by drudge] + * Fixed blog example + * Fixed `{req,res}.app` reference when mounting [Ben Weaver] + +2.0.0rc / 2011-03-14 +================== + + * Fixed; expose `HTTPSServer` constructor + * Fixed express(1) default test charset. Closes #579 [reported by secoif] + * Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP] + +2.0.0beta3 / 2011-03-09 +================== + + * Added support for `res.contentType()` literal + The original `res.contentType('.json')`, + `res.contentType('application/json')`, and `res.contentType('json')` + will work now. + * Added `res.render()` status option support back + * Added charset option for `res.render()` + * Added `.charset` support (via connect 1.0.4) + * Added view resolution hints when in development and a lookup fails + * Added layout lookup support relative to the page view. + For example while rendering `./views/user/index.jade` if you create + `./views/user/layout.jade` it will be used in favour of the root layout. + * Fixed `res.redirect()`. RFC states absolute url [reported by unlink] + * Fixed; default `res.send()` string charset to utf8 + * Removed `Partial` constructor (not currently used) + +2.0.0beta2 / 2011-03-07 +================== + + * Added res.render() `.locals` support back to aid in migration process + * Fixed flash example + +2.0.0beta / 2011-03-03 +================== + + * Added HTTPS support + * Added `res.cookie()` maxAge support + * Added `req.header()` _Referrer_ / _Referer_ special-case, either works + * Added mount support for `res.redirect()`, now respects the mount-point + * Added `union()` util, taking place of `merge(clone())` combo + * Added stylus support to express(1) generated app + * Added secret to session middleware used in examples and generated app + * Added `res.local(name, val)` for progressive view locals + * Added default param support to `req.param(name, default)` + * Added `app.disabled()` and `app.enabled()` + * Added `app.register()` support for omitting leading ".", either works + * Added `res.partial()`, using the same interface as `partial()` within a view. Closes #539 + * Added `app.param()` to map route params to async/sync logic + * Added; aliased `app.helpers()` as `app.locals()`. Closes #481 + * Added extname with no leading "." support to `res.contentType()` + * Added `cache views` setting, defaulting to enabled in "production" env + * Added index file partial resolution, eg: partial('user') may try _views/user/index.jade_. + * Added `req.accepts()` support for extensions + * Changed; `res.download()` and `res.sendfile()` now utilize Connect's + static file server `connect.static.send()`. + * Changed; replaced `connect.utils.mime()` with npm _mime_ module + * Changed; allow `req.query` to be pre-defined (via middleware or other parent + * Changed view partial resolution, now relative to parent view + * Changed view engine signature. no longer `engine.render(str, options, callback)`, now `engine.compile(str, options) -> Function`, the returned function accepts `fn(locals)`. + * Fixed `req.param()` bug returning Array.prototype methods. Closes #552 + * Fixed; using `Stream#pipe()` instead of `sys.pump()` in `res.sendfile()` + * Fixed; using _qs_ module instead of _querystring_ + * Fixed; strip unsafe chars from jsonp callbacks + * Removed "stream threshold" setting + +1.0.8 / 2011-03-01 +================== + + * Allow `req.query` to be pre-defined (via middleware or other parent app) + * "connect": ">= 0.5.0 < 1.0.0". Closes #547 + * Removed the long deprecated __EXPRESS_ENV__ support + +1.0.7 / 2011-02-07 +================== + + * Fixed `render()` setting inheritance. + Mounted apps would not inherit "view engine" + +1.0.6 / 2011-02-07 +================== + + * Fixed `view engine` setting bug when period is in dirname + +1.0.5 / 2011-02-05 +================== + + * Added secret to generated app `session()` call + +1.0.4 / 2011-02-05 +================== + + * Added `qs` dependency to _package.json_ + * Fixed namespaced `require()`s for latest connect support + +1.0.3 / 2011-01-13 +================== + + * Remove unsafe characters from JSONP callback names [Ryan Grove] + +1.0.2 / 2011-01-10 +================== + + * Removed nested require, using `connect.router` + +1.0.1 / 2010-12-29 +================== + + * Fixed for middleware stacked via `createServer()` + previously the `foo` middleware passed to `createServer(foo)` + would not have access to Express methods such as `res.send()` + or props like `req.query` etc. + +1.0.0 / 2010-11-16 +================== + + * Added; deduce partial object names from the last segment. + For example by default `partial('forum/post', postObject)` will + give you the _post_ object, providing a meaningful default. + * Added http status code string representation to `res.redirect()` body + * Added; `res.redirect()` supporting _text/plain_ and _text/html_ via __Accept__. + * Added `req.is()` to aid in content negotiation + * Added partial local inheritance [suggested by masylum]. Closes #102 + providing access to parent template locals. + * Added _-s, --session[s]_ flag to express(1) to add session related middleware + * Added _--template_ flag to express(1) to specify the + template engine to use. + * Added _--css_ flag to express(1) to specify the + stylesheet engine to use (or just plain css by default). + * Added `app.all()` support [thanks aheckmann] + * Added partial direct object support. + You may now `partial('user', user)` providing the "user" local, + vs previously `partial('user', { object: user })`. + * Added _route-separation_ example since many people question ways + to do this with CommonJS modules. Also view the _blog_ example for + an alternative. + * Performance; caching view path derived partial object names + * Fixed partial local inheritance precedence. [reported by Nick Poulden] Closes #454 + * Fixed jsonp support; _text/javascript_ as per mailinglist discussion + +1.0.0rc4 / 2010-10-14 +================== + + * Added _NODE_ENV_ support, _EXPRESS_ENV_ is deprecated and will be removed in 1.0.0 + * Added route-middleware support (very helpful, see the [docs](http://expressjs.com/guide.html#Route-Middleware)) + * Added _jsonp callback_ setting to enable/disable jsonp autowrapping [Dav Glass] + * Added callback query check on response.send to autowrap JSON objects for simple webservice implementations [Dav Glass] + * Added `partial()` support for array-like collections. Closes #434 + * Added support for swappable querystring parsers + * Added session usage docs. Closes #443 + * Added dynamic helper caching. Closes #439 [suggested by maritz] + * Added authentication example + * Added basic Range support to `res.sendfile()` (and `res.download()` etc) + * Changed; `express(1)` generated app using 2 spaces instead of 4 + * Default env to "development" again [aheckmann] + * Removed _context_ option is no more, use "scope" + * Fixed; exposing _./support_ libs to examples so they can run without installs + * Fixed mvc example + +1.0.0rc3 / 2010-09-20 +================== + + * Added confirmation for `express(1)` app generation. Closes #391 + * Added extending of flash formatters via `app.flashFormatters` + * Added flash formatter support. Closes #411 + * Added streaming support to `res.sendfile()` using `sys.pump()` when >= "stream threshold" + * Added _stream threshold_ setting for `res.sendfile()` + * Added `res.send()` __HEAD__ support + * Added `res.clearCookie()` + * Added `res.cookie()` + * Added `res.render()` headers option + * Added `res.redirect()` response bodies + * Added `res.render()` status option support. Closes #425 [thanks aheckmann] + * Fixed `res.sendfile()` responding with 403 on malicious path + * Fixed `res.download()` bug; when an error occurs remove _Content-Disposition_ + * Fixed; mounted apps settings now inherit from parent app [aheckmann] + * Fixed; stripping Content-Length / Content-Type when 204 + * Fixed `res.send()` 204. Closes #419 + * Fixed multiple _Set-Cookie_ headers via `res.header()`. Closes #402 + * Fixed bug messing with error handlers when `listenFD()` is called instead of `listen()`. [thanks guillermo] + + +1.0.0rc2 / 2010-08-17 +================== + + * Added `app.register()` for template engine mapping. Closes #390 + * Added `res.render()` callback support as second argument (no options) + * Added callback support to `res.download()` + * Added callback support for `res.sendfile()` + * Added support for middleware access via `express.middlewareName()` vs `connect.middlewareName()` + * Added "partials" setting to docs + * Added default expresso tests to `express(1)` generated app. Closes #384 + * Fixed `res.sendfile()` error handling, defer via `next()` + * Fixed `res.render()` callback when a layout is used [thanks guillermo] + * Fixed; `make install` creating ~/.node_libraries when not present + * Fixed issue preventing error handlers from being defined anywhere. Closes #387 + +1.0.0rc / 2010-07-28 +================== + + * Added mounted hook. Closes #369 + * Added connect dependency to _package.json_ + + * Removed "reload views" setting and support code + development env never caches, production always caches. + + * Removed _param_ in route callbacks, signature is now + simply (req, res, next), previously (req, res, params, next). + Use _req.params_ for path captures, _req.query_ for GET params. + + * Fixed "home" setting + * Fixed middleware/router precedence issue. Closes #366 + * Fixed; _configure()_ callbacks called immediately. Closes #368 + +1.0.0beta2 / 2010-07-23 +================== + + * Added more examples + * Added; exporting `Server` constructor + * Added `Server#helpers()` for view locals + * Added `Server#dynamicHelpers()` for dynamic view locals. Closes #349 + * Added support for absolute view paths + * Added; _home_ setting defaults to `Server#route` for mounted apps. Closes #363 + * Added Guillermo Rauch to the contributor list + * Added support for "as" for non-collection partials. Closes #341 + * Fixed _install.sh_, ensuring _~/.node_libraries_ exists. Closes #362 [thanks jf] + * Fixed `res.render()` exceptions, now passed to `next()` when no callback is given [thanks guillermo] + * Fixed instanceof `Array` checks, now `Array.isArray()` + * Fixed express(1) expansion of public dirs. Closes #348 + * Fixed middleware precedence. Closes #345 + * Fixed view watcher, now async [thanks aheckmann] + +1.0.0beta / 2010-07-15 +================== + + * Re-write + - much faster + - much lighter + - Check [ExpressJS.com](http://expressjs.com) for migration guide and updated docs + +0.14.0 / 2010-06-15 +================== + + * Utilize relative requires + * Added Static bufferSize option [aheckmann] + * Fixed caching of view and partial subdirectories [aheckmann] + * Fixed mime.type() comments now that ".ext" is not supported + * Updated haml submodule + * Updated class submodule + * Removed bin/express + +0.13.0 / 2010-06-01 +================== + + * Added node v0.1.97 compatibility + * Added support for deleting cookies via Request#cookie('key', null) + * Updated haml submodule + * Fixed not-found page, now using using charset utf-8 + * Fixed show-exceptions page, now using using charset utf-8 + * Fixed view support due to fs.readFile Buffers + * Changed; mime.type() no longer accepts ".type" due to node extname() changes + +0.12.0 / 2010-05-22 +================== + + * Added node v0.1.96 compatibility + * Added view `helpers` export which act as additional local variables + * Updated haml submodule + * Changed ETag; removed inode, modified time only + * Fixed LF to CRLF for setting multiple cookies + * Fixed cookie complation; values are now urlencoded + * Fixed cookies parsing; accepts quoted values and url escaped cookies + +0.11.0 / 2010-05-06 +================== + + * Added support for layouts using different engines + - this.render('page.html.haml', { layout: 'super-cool-layout.html.ejs' }) + - this.render('page.html.haml', { layout: 'foo' }) // assumes 'foo.html.haml' + - this.render('page.html.haml', { layout: false }) // no layout + * Updated ext submodule + * Updated haml submodule + * Fixed EJS partial support by passing along the context. Issue #307 + +0.10.1 / 2010-05-03 +================== + + * Fixed binary uploads. + +0.10.0 / 2010-04-30 +================== + + * Added charset support via Request#charset (automatically assigned to 'UTF-8' when respond()'s + encoding is set to 'utf8' or 'utf-8'. + * Added "encoding" option to Request#render(). Closes #299 + * Added "dump exceptions" setting, which is enabled by default. + * Added simple ejs template engine support + * Added error reponse support for text/plain, application/json. Closes #297 + * Added callback function param to Request#error() + * Added Request#sendHead() + * Added Request#stream() + * Added support for Request#respond(304, null) for empty response bodies + * Added ETag support to Request#sendfile() + * Added options to Request#sendfile(), passed to fs.createReadStream() + * Added filename arg to Request#download() + * Performance enhanced due to pre-reversing plugins so that plugins.reverse() is not called on each request + * Performance enhanced by preventing several calls to toLowerCase() in Router#match() + * Changed; Request#sendfile() now streams + * Changed; Renamed Request#halt() to Request#respond(). Closes #289 + * Changed; Using sys.inspect() instead of JSON.encode() for error output + * Changed; run() returns the http.Server instance. Closes #298 + * Changed; Defaulting Server#host to null (INADDR_ANY) + * Changed; Logger "common" format scale of 0.4f + * Removed Logger "request" format + * Fixed; Catching ENOENT in view caching, preventing error when "views/partials" is not found + * Fixed several issues with http client + * Fixed Logger Content-Length output + * Fixed bug preventing Opera from retaining the generated session id. Closes #292 + +0.9.0 / 2010-04-14 +================== + + * Added DSL level error() route support + * Added DSL level notFound() route support + * Added Request#error() + * Added Request#notFound() + * Added Request#render() callback function. Closes #258 + * Added "max upload size" setting + * Added "magic" variables to collection partials (\_\_index\_\_, \_\_length\_\_, \_\_isFirst\_\_, \_\_isLast\_\_). Closes #254 + * Added [haml.js](http://github.com/visionmedia/haml.js) submodule; removed haml-js + * Added callback function support to Request#halt() as 3rd/4th arg + * Added preprocessing of route param wildcards using param(). Closes #251 + * Added view partial support (with collections etc) + * Fixed bug preventing falsey params (such as ?page=0). Closes #286 + * Fixed setting of multiple cookies. Closes #199 + * Changed; view naming convention is now NAME.TYPE.ENGINE (for example page.html.haml) + * Changed; session cookie is now httpOnly + * Changed; Request is no longer global + * Changed; Event is no longer global + * Changed; "sys" module is no longer global + * Changed; moved Request#download to Static plugin where it belongs + * Changed; Request instance created before body parsing. Closes #262 + * Changed; Pre-caching views in memory when "cache view contents" is enabled. Closes #253 + * Changed; Pre-caching view partials in memory when "cache view partials" is enabled + * Updated support to node --version 0.1.90 + * Updated dependencies + * Removed set("session cookie") in favour of use(Session, { cookie: { ... }}) + * Removed utils.mixin(); use Object#mergeDeep() + +0.8.0 / 2010-03-19 +================== + + * Added coffeescript example app. Closes #242 + * Changed; cache api now async friendly. Closes #240 + * Removed deprecated 'express/static' support. Use 'express/plugins/static' + +0.7.6 / 2010-03-19 +================== + + * Added Request#isXHR. Closes #229 + * Added `make install` (for the executable) + * Added `express` executable for setting up simple app templates + * Added "GET /public/*" to Static plugin, defaulting to /public + * Added Static plugin + * Fixed; Request#render() only calls cache.get() once + * Fixed; Namespacing View caches with "view:" + * Fixed; Namespacing Static caches with "static:" + * Fixed; Both example apps now use the Static plugin + * Fixed set("views"). Closes #239 + * Fixed missing space for combined log format + * Deprecated Request#sendfile() and 'express/static' + * Removed Server#running + +0.7.5 / 2010-03-16 +================== + + * Added Request#flash() support without args, now returns all flashes + * Updated ext submodule + +0.7.4 / 2010-03-16 +================== + + * Fixed session reaper + * Changed; class.js replacing js-oo Class implementation (quite a bit faster, no browser cruft) + +0.7.3 / 2010-03-16 +================== + + * Added package.json + * Fixed requiring of haml / sass due to kiwi removal + +0.7.2 / 2010-03-16 +================== + + * Fixed GIT submodules (HAH!) + +0.7.1 / 2010-03-16 +================== + + * Changed; Express now using submodules again until a PM is adopted + * Changed; chat example using millisecond conversions from ext + +0.7.0 / 2010-03-15 +================== + + * Added Request#pass() support (finds the next matching route, or the given path) + * Added Logger plugin (default "common" format replaces CommonLogger) + * Removed Profiler plugin + * Removed CommonLogger plugin + +0.6.0 / 2010-03-11 +================== + + * Added seed.yml for kiwi package management support + * Added HTTP client query string support when method is GET. Closes #205 + + * Added support for arbitrary view engines. + For example "foo.engine.html" will now require('engine'), + the exports from this module are cached after the first require(). + + * Added async plugin support + + * Removed usage of RESTful route funcs as http client + get() etc, use http.get() and friends + + * Removed custom exceptions + +0.5.0 / 2010-03-10 +================== + + * Added ext dependency (library of js extensions) + * Removed extname() / basename() utils. Use path module + * Removed toArray() util. Use arguments.values + * Removed escapeRegexp() util. Use RegExp.escape() + * Removed process.mixin() dependency. Use utils.mixin() + * Removed Collection + * Removed ElementCollection + * Shameless self promotion of ebook "Advanced JavaScript" (http://dev-mag.com) ;) + +0.4.0 / 2010-02-11 +================== + + * Added flash() example to sample upload app + * Added high level restful http client module (express/http) + * Changed; RESTful route functions double as HTTP clients. Closes #69 + * Changed; throwing error when routes are added at runtime + * Changed; defaulting render() context to the current Request. Closes #197 + * Updated haml submodule + +0.3.0 / 2010-02-11 +================== + + * Updated haml / sass submodules. Closes #200 + * Added flash message support. Closes #64 + * Added accepts() now allows multiple args. fixes #117 + * Added support for plugins to halt. Closes #189 + * Added alternate layout support. Closes #119 + * Removed Route#run(). Closes #188 + * Fixed broken specs due to use(Cookie) missing + +0.2.1 / 2010-02-05 +================== + + * Added "plot" format option for Profiler (for gnuplot processing) + * Added request number to Profiler plugin + * Fixed binary encoding for multi-part file uploads, was previously defaulting to UTF8 + * Fixed issue with routes not firing when not files are present. Closes #184 + * Fixed process.Promise -> events.Promise + +0.2.0 / 2010-02-03 +================== + + * Added parseParam() support for name[] etc. (allows for file inputs with "multiple" attr) Closes #180 + * Added Both Cache and Session option "reapInterval" may be "reapEvery". Closes #174 + * Added expiration support to cache api with reaper. Closes #133 + * Added cache Store.Memory#reap() + * Added Cache; cache api now uses first class Cache instances + * Added abstract session Store. Closes #172 + * Changed; cache Memory.Store#get() utilizing Collection + * Renamed MemoryStore -> Store.Memory + * Fixed use() of the same plugin several time will always use latest options. Closes #176 + +0.1.0 / 2010-02-03 +================== + + * Changed; Hooks (before / after) pass request as arg as well as evaluated in their context + * Updated node support to 0.1.27 Closes #169 + * Updated dirname(__filename) -> __dirname + * Updated libxmljs support to v0.2.0 + * Added session support with memory store / reaping + * Added quick uid() helper + * Added multi-part upload support + * Added Sass.js support / submodule + * Added production env caching view contents and static files + * Added static file caching. Closes #136 + * Added cache plugin with memory stores + * Added support to StaticFile so that it works with non-textual files. + * Removed dirname() helper + * Removed several globals (now their modules must be required) + +0.0.2 / 2010-01-10 +================== + + * Added view benchmarks; currently haml vs ejs + * Added Request#attachment() specs. Closes #116 + * Added use of node's parseQuery() util. Closes #123 + * Added `make init` for submodules + * Updated Haml + * Updated sample chat app to show messages on load + * Updated libxmljs parseString -> parseHtmlString + * Fixed `make init` to work with older versions of git + * Fixed specs can now run independant specs for those who cant build deps. Closes #127 + * Fixed issues introduced by the node url module changes. Closes 126. + * Fixed two assertions failing due to Collection#keys() returning strings + * Fixed faulty Collection#toArray() spec due to keys() returning strings + * Fixed `make test` now builds libxmljs.node before testing + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/usb_auth/node_modules/express/LICENSE b/usb_auth/node_modules/express/LICENSE new file mode 100644 index 0000000..36075a3 --- /dev/null +++ b/usb_auth/node_modules/express/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2009-2011 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/express/Makefile b/usb_auth/node_modules/express/Makefile new file mode 100644 index 0000000..dfbfd67 --- /dev/null +++ b/usb_auth/node_modules/express/Makefile @@ -0,0 +1,29 @@ + +DOCS = $(shell find docs/*.md) +HTMLDOCS = $(DOCS:.md=.html) +TESTS = $(shell find test/*.test.js) + +test: + @NODE_ENV=test ./node_modules/.bin/expresso $(TESTS) + +docs: $(HTMLDOCS) + @ echo "... generating TOC" + @./support/toc.js docs/guide.html + +%.html: %.md + @echo "... $< -> $@" + @markdown $< \ + | cat docs/layout/head.html - docs/layout/foot.html \ + > $@ + +site: + rm -fr /tmp/docs \ + && cp -fr docs /tmp/docs \ + && git checkout gh-pages \ + && cp -fr /tmp/docs/* . \ + && echo "done" + +docclean: + rm -f docs/*.{1,html} + +.PHONY: site test docs docclean \ No newline at end of file diff --git a/usb_auth/node_modules/express/Readme.md b/usb_auth/node_modules/express/Readme.md new file mode 100644 index 0000000..d2c64c7 --- /dev/null +++ b/usb_auth/node_modules/express/Readme.md @@ -0,0 +1,145 @@ + +# Express + + Insanely fast (and small) server-side JavaScript web development framework + built on [node](http://nodejs.org) and [Connect](http://github.com/senchalabs/connect). + + var app = express.createServer(); + + app.get('/', function(req, res){ + res.send('Hello World'); + }); + + app.listen(3000); + +## Installation + + $ npm install express + +or to access the `express(1)` executable install globally: + + $ npm install -g express + +## Quick Start + + The quickest way to get started with express is to utilize the executable `express(1)` to generate an application as shown below: + + Create the app: + + $ npm install -g express + $ express /tmp/foo && cd /tmp/foo + + Install dependencies: + + $ npm install -d + + Start the server: + + $ node app.js + +## Features + + * Robust routing + * Redirection helpers + * Dynamic view helpers + * Content negotiation + * Focus on high performance + * View rendering and partials support + * Environment based configuration + * Session based flash notifications + * Built on [Connect](http://github.com/senchalabs/connect) + * High test coverage + * Executable for generating applications quickly + * Application level view options + +Via Connect: + + * Session support + * Cache API + * Mime helpers + * ETag support + * Persistent flash notifications + * Cookie support + * JSON-RPC + * Logging + * and _much_ more! + +## Contributors + +The following are the major contributors of Express (in no specific order). + + * TJ Holowaychuk ([visionmedia](http://github.com/visionmedia)) + * Ciaran Jessup ([ciaranj](http://github.com/ciaranj)) + * Aaron Heckmann ([aheckmann](http://github.com/aheckmann)) + * Guillermo Rauch ([guille](http://github.com/guille)) + +## More Information + + * #express on freenode + * [express-expose](http://github.com/visionmedia/express-expose) expose objects, functions, modules and more to client-side js with ease + * [express-configure](http://github.com/visionmedia/express-configuration) async configuration support + * [express-messages](http://github.com/visionmedia/express-messages) flash notification rendering helper + * [express-namespace](http://github.com/visionmedia/express-namespace) namespaced route support + * [express-params](https://github.com/visionmedia/express-params) param pre-condition functions + * [express-mongoose](https://github.com/LearnBoost/express-mongoose) plugin for easy rendering of Mongoose async Query results + * Follow [tjholowaychuk](http://twitter.com/tjholowaychuk) on twitter for updates + * [Google Group](http://groups.google.com/group/express-js) for discussion + * Visit the [Wiki](http://github.com/visionmedia/express/wiki) + * [日本語ドキュメンテーション](http://hideyukisaito.com/doc/expressjs/) by [hideyukisaito](https://github.com/hideyukisaito) + * Screencast - [Introduction](http://bit.ly/eRYu0O) + * Screencast - [View Partials](http://bit.ly/dU13Fx) + * Screencast - [Route Specific Middleware](http://bit.ly/hX4IaH) + * Screencast - [Route Path Placeholder Preconditions](http://bit.ly/eNqmVs) + +## Node Compatibility + +Express 1.x is compatible with node 0.2.x and connect < 1.0. + +Express 2.x is compatible with node 0.4.x or 0.6.x, and connect 1.x + +Express 3.x (master) will be compatible with node 0.6.x and connect 2.x + +## Viewing Examples + +First install the dev dependencies to install all the example / test suite deps: + + $ npm install + +then run whichever tests you want: + + $ node examples/jade/app.js + +## Running Tests + +To run the test suite first invoke the following command within the repo, installing the development dependencies: + + $ npm install + +then run the tests: + + $ make test + +## License + +(The MIT License) + +Copyright (c) 2009-2011 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/usb_auth/node_modules/express/bin/express b/usb_auth/node_modules/express/bin/express new file mode 100755 index 0000000..2c902c3 --- /dev/null +++ b/usb_auth/node_modules/express/bin/express @@ -0,0 +1,416 @@ +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var fs = require('fs') + , os = require('os') + , exec = require('child_process').exec + , mkdirp = require('mkdirp'); + +/** + * Framework version. + */ + +var version = '2.5.8'; + +/** + * Add session support. + */ + +var sessions = false; + +/** + * CSS engine to utilize. + */ + +var cssEngine; + +/** + * End-of-line code. + */ + +var eol = os.platform + ? ('win32' == os.platform() ? '\r\n' : '\n') + : '\n'; + +/** + * Template engine to utilize. + */ + +var templateEngine = 'jade'; + +/** + * Usage documentation. + */ + +var usage = '' + + '\n' + + ' Usage: express [options] [path]\n' + + '\n' + + ' Options:\n' + + ' -s, --sessions add session support\n' + + ' -t, --template add template support (jade|ejs). default=jade\n' + + ' -c, --css add stylesheet support (stylus). default=plain css\n' + + ' -v, --version output framework version\n' + + ' -h, --help output help information\n' + ; + +/** + * Routes index template. + */ + +var index = [ + '' + , '/*' + , ' * GET home page.' + , ' */' + , '' + , 'exports.index = function(req, res){' + , ' res.render(\'index\', { title: \'Express\' })' + , '};' +].join(eol); + +/** + * Jade layout template. + */ + +var jadeLayout = [ + '!!!' + , 'html' + , ' head' + , ' title= title' + , ' link(rel=\'stylesheet\', href=\'/stylesheets/style.css\')' + , ' body!= body' +].join(eol); + +/** + * Jade index template. + */ + +var jadeIndex = [ + 'h1= title' + , 'p Welcome to #{title}' +].join(eol); + +/** + * EJS layout template. + */ + +var ejsLayout = [ + '' + , '' + , ' ' + , ' <%= title %>' + , ' ' + , ' ' + , ' ' + , ' <%- body %>' + , ' ' + , '' +].join(eol); + +/** + * EJS index template. + */ + +var ejsIndex = [ + '

<%= title %>

' + , '

Welcome to <%= title %>

' + ].join(eol); + +/** + * Default css template. + */ + +var css = [ + 'body {' + , ' padding: 50px;' + , ' font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;' + , '}' + , '' + , 'a {' + , ' color: #00B7FF;' + , '}' +].join(eol); + +/** + * Default stylus template. + */ + +var stylus = [ + 'body' + , ' padding: 50px' + , ' font: 14px "Lucida Grande", Helvetica, Arial, sans-serif' + , 'a' + , ' color: #00B7FF' +].join(eol); + +/** + * App template. + */ + +var app = [ + '' + , '/**' + , ' * Module dependencies.' + , ' */' + , '' + , 'var express = require(\'express\')' + , ' , routes = require(\'./routes\');' + , '' + , 'var app = module.exports = express.createServer();' + , '' + , '// Configuration' + , '' + , 'app.configure(function(){' + , ' app.set(\'views\', __dirname + \'/views\');' + , ' app.set(\'view engine\', \':TEMPLATE\');' + , ' app.use(express.bodyParser());' + , ' app.use(express.methodOverride());{sess}{css}' + , ' app.use(app.router);' + , ' app.use(express.static(__dirname + \'/public\'));' + , '});' + , '' + , 'app.configure(\'development\', function(){' + , ' app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));' + , '});' + , '' + , 'app.configure(\'production\', function(){' + , ' app.use(express.errorHandler());' + , '});' + , '' + , '// Routes' + , '' + , 'app.get(\'/\', routes.index);' + , '' + , 'app.listen(3000);' + , 'console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);' + , '' +].join(eol); + +// Parse arguments + +var args = process.argv.slice(2) + , path = '.'; + +while (args.length) { + var arg = args.shift(); + switch (arg) { + case '-h': + case '--help': + abort(usage); + break; + case '-v': + case '--version': + abort(version); + break; + case '-s': + case '--session': + case '--sessions': + sessions = true; + break; + case '-c': + case '--css': + args.length + ? (cssEngine = args.shift()) + : abort('--css requires an argument'); + break; + case '-t': + case '--template': + args.length + ? (templateEngine = args.shift()) + : abort('--template requires an argument'); + break; + default: + path = arg; + } +} + +// Generate application + +(function createApplication(path) { + emptyDirectory(path, function(empty){ + if (empty) { + createApplicationAt(path); + } else { + confirm('destination is not empty, continue? ', function(ok){ + if (ok) { + process.stdin.destroy(); + createApplicationAt(path); + } else { + abort('aborting'); + } + }); + } + }); +})(path); + +/** + * Create application at the given directory `path`. + * + * @param {String} path + */ + +function createApplicationAt(path) { + console.log(); + process.on('exit', function(){ + console.log(); + console.log(' dont forget to install dependencies:'); + console.log(' $ cd %s && npm install', path); + console.log(); + }); + + mkdir(path, function(){ + mkdir(path + '/public'); + mkdir(path + '/public/javascripts'); + mkdir(path + '/public/images'); + mkdir(path + '/public/stylesheets', function(){ + switch (cssEngine) { + case 'stylus': + write(path + '/public/stylesheets/style.styl', stylus); + break; + default: + write(path + '/public/stylesheets/style.css', css); + } + }); + + mkdir(path + '/routes', function(){ + write(path + '/routes/index.js', index); + }); + + mkdir(path + '/views', function(){ + switch (templateEngine) { + case 'ejs': + write(path + '/views/layout.ejs', ejsLayout); + write(path + '/views/index.ejs', ejsIndex); + break; + case 'jade': + write(path + '/views/layout.jade', jadeLayout); + write(path + '/views/index.jade', jadeIndex); + break; + } + }); + + // CSS Engine support + switch (cssEngine) { + case 'stylus': + app = app.replace('{css}', eol + ' app.use(require(\'stylus\').middleware({ src: __dirname + \'/public\' }));'); + break; + default: + app = app.replace('{css}', ''); + } + + // Session support + app = app.replace('{sess}', sessions + ? eol + ' app.use(express.cookieParser());' + eol + ' app.use(express.session({ secret: \'your secret here\' }));' + : ''); + + // Template support + app = app.replace(':TEMPLATE', templateEngine); + + // package.json + var json = '{' + eol; + json += ' "name": "application-name"' + eol; + json += ' , "version": "0.0.1"' + eol; + json += ' , "private": true' + eol; + json += ' , "dependencies": {' + eol; + json += ' "express": "' + version + '"' + eol; + if (cssEngine) json += ' , "' + cssEngine + '": ">= 0.0.1"' + eol; + if (templateEngine) json += ' , "' + templateEngine + '": ">= 0.0.1"' + eol; + json += ' }' + eol; + json += '}'; + + + write(path + '/package.json', json); + write(path + '/app.js', app); + }); +} + +/** + * Check if the given directory `path` is empty. + * + * @param {String} path + * @param {Function} fn + */ + +function emptyDirectory(path, fn) { + fs.readdir(path, function(err, files){ + if (err && 'ENOENT' != err.code) throw err; + fn(!files || !files.length); + }); +} + +/** + * echo str > path. + * + * @param {String} path + * @param {String} str + */ + +function write(path, str) { + fs.writeFile(path, str); + console.log(' \x1b[36mcreate\x1b[0m : ' + path); +} + +/** + * Prompt confirmation with the given `msg`. + * + * @param {String} msg + * @param {Function} fn + */ + +function confirm(msg, fn) { + prompt(msg, function(val){ + fn(/^ *y(es)?/i.test(val)); + }); +} + +/** + * Prompt input with the given `msg` and callback `fn`. + * + * @param {String} msg + * @param {Function} fn + */ + +function prompt(msg, fn) { + // prompt + if (' ' == msg[msg.length - 1]) { + process.stdout.write(msg); + } else { + console.log(msg); + } + + // stdin + process.stdin.setEncoding('ascii'); + process.stdin.once('data', function(data){ + fn(data); + }).resume(); +} + +/** + * Mkdir -p. + * + * @param {String} path + * @param {Function} fn + */ + +function mkdir(path, fn) { + mkdirp(path, 0755, function(err){ + if (err) throw err; + console.log(' \033[36mcreate\033[0m : ' + path); + fn && fn(); + }); +} + +/** + * Exit with the given `str`. + * + * @param {String} str + */ + +function abort(str) { + console.error(str); + process.exit(1); +} diff --git a/usb_auth/node_modules/express/index.js b/usb_auth/node_modules/express/index.js new file mode 100644 index 0000000..8d81ea7 --- /dev/null +++ b/usb_auth/node_modules/express/index.js @@ -0,0 +1,2 @@ + +module.exports = require('./lib/express'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/lib/express.js b/usb_auth/node_modules/express/lib/express.js new file mode 100644 index 0000000..0a0d5ad --- /dev/null +++ b/usb_auth/node_modules/express/lib/express.js @@ -0,0 +1,79 @@ + +/*! + * Express + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var connect = require('connect') + , HTTPSServer = require('./https') + , HTTPServer = require('./http') + , Route = require('./router/route') + +/** + * Re-export connect auto-loaders. + * + * This prevents the need to `require('connect')` in order + * to access core middleware, so for example `express.logger()` instead + * of `require('connect').logger()`. + */ + +var exports = module.exports = connect.middleware; + +/** + * Framework version. + */ + +exports.version = '2.5.8'; + +/** + * Shortcut for `new Server(...)`. + * + * @param {Function} ... + * @return {Server} + * @api public + */ + +exports.createServer = function(options){ + if ('object' == typeof options) { + return new HTTPSServer(options, Array.prototype.slice.call(arguments, 1)); + } else { + return new HTTPServer(Array.prototype.slice.call(arguments)); + } +}; + +/** + * Expose constructors. + */ + +exports.HTTPServer = HTTPServer; +exports.HTTPSServer = HTTPSServer; +exports.Route = Route; + +/** + * View extensions. + */ + +exports.View = +exports.view = require('./view'); + +/** + * Response extensions. + */ + +require('./response'); + +/** + * Request extensions. + */ + +require('./request'); + +// Error handler title + +exports.errorHandler.title = 'Express'; + diff --git a/usb_auth/node_modules/express/lib/http.js b/usb_auth/node_modules/express/lib/http.js new file mode 100644 index 0000000..da2158f --- /dev/null +++ b/usb_auth/node_modules/express/lib/http.js @@ -0,0 +1,582 @@ +/*! + * Express - HTTPServer + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var qs = require('qs') + , connect = require('connect') + , router = require('./router') + , Router = require('./router') + , view = require('./view') + , toArray = require('./utils').toArray + , methods = router.methods.concat('del', 'all') + , url = require('url') + , utils = connect.utils; + +/** + * Expose `HTTPServer`. + */ + +exports = module.exports = HTTPServer; + +/** + * Server proto. + */ + +var app = HTTPServer.prototype; + +/** + * Initialize a new `HTTPServer` with optional `middleware`. + * + * @param {Array} middleware + * @api public + */ + +function HTTPServer(middleware){ + connect.HTTPServer.call(this, []); + this.init(middleware); +}; + +/** + * Inherit from `connect.HTTPServer`. + */ + +app.__proto__ = connect.HTTPServer.prototype; + +/** + * Initialize the server. + * + * @param {Array} middleware + * @api private + */ + +app.init = function(middleware){ + var self = this; + this.cache = {}; + this.settings = {}; + this.redirects = {}; + this.isCallbacks = {}; + this._locals = {}; + this.dynamicViewHelpers = {}; + this.errorHandlers = []; + + this.set('env', process.env.NODE_ENV || 'development'); + + // expose objects to each other + this.use(function(req, res, next){ + req.query = req.query || {}; + res.setHeader('X-Powered-By', 'Express'); + req.app = res.app = self; + req.res = res; + res.req = req; + req.next = next; + // assign req.query + if (req.url.indexOf('?') > 0) { + var query = url.parse(req.url).query; + req.query = qs.parse(query); + } + next(); + }); + + // apply middleware + if (middleware) middleware.forEach(self.use.bind(self)); + + // router + this.routes = new Router(this); + this.__defineGetter__('router', function(){ + this.__usedRouter = true; + return self.routes.middleware; + }); + + // default locals + this.locals({ + settings: this.settings + , app: this + }); + + // default development configuration + this.configure('development', function(){ + this.enable('hints'); + }); + + // default production configuration + this.configure('production', function(){ + this.enable('view cache'); + }); + + // register error handlers on "listening" + // so that they disregard definition position. + this.on('listening', this.registerErrorHandlers.bind(this)); + + // route manipulation methods + methods.forEach(function(method){ + self.lookup[method] = function(path){ + return self.routes.lookup(method, path); + }; + + self.match[method] = function(path){ + return self.routes.match(method, path); + }; + + self.remove[method] = function(path){ + return self.routes.lookup(method, path).remove(); + }; + }); + + // del -> delete + self.lookup.del = self.lookup.delete; + self.match.del = self.match.delete; + self.remove.del = self.remove.delete; +}; + +/** + * Remove routes matching the given `path`. + * + * @param {Route} path + * @return {Boolean} + * @api public + */ + +app.remove = function(path){ + return this.routes.lookup('all', path).remove(); +}; + +/** + * Lookup routes defined with a path + * equivalent to `path`. + * + * @param {Stirng} path + * @return {Array} + * @api public + */ + +app.lookup = function(path){ + return this.routes.lookup('all', path); +}; + +/** + * Lookup routes matching the given `url`. + * + * @param {Stirng} url + * @return {Array} + * @api public + */ + +app.match = function(url){ + return this.routes.match('all', url); +}; + +/** + * When using the vhost() middleware register error handlers. + */ + +app.onvhost = function(){ + this.registerErrorHandlers(); +}; + +/** + * Register error handlers. + * + * @return {Server} for chaining + * @api public + */ + +app.registerErrorHandlers = function(){ + this.errorHandlers.forEach(function(fn){ + this.use(function(err, req, res, next){ + fn.apply(this, arguments); + }); + }, this); + return this; +}; + +/** + * Proxy `connect.HTTPServer#use()` to apply settings to + * mounted applications. + * + * @param {String|Function|Server} route + * @param {Function|Server} middleware + * @return {Server} for chaining + * @api public + */ + +app.use = function(route, middleware){ + var app, base, handle; + + if ('string' != typeof route) { + middleware = route, route = '/'; + } + + // express app + if (middleware.handle && middleware.set) app = middleware; + + // restore .app property on req and res + if (app) { + app.route = route; + middleware = function(req, res, next) { + var orig = req.app; + app.handle(req, res, function(err){ + req.app = res.app = orig; + next(err); + }); + }; + } + + connect.HTTPServer.prototype.use.call(this, route, middleware); + + // mounted an app, invoke the hook + // and adjust some settings + if (app) { + base = this.set('basepath') || this.route; + if ('/' == base) base = ''; + base = base + (app.set('basepath') || app.route); + app.set('basepath', base); + app.parent = this; + if (app.__mounted) app.__mounted.call(app, this); + } + + return this; +}; + +/** + * Assign a callback `fn` which is called + * when this `Server` is passed to `Server#use()`. + * + * Examples: + * + * var app = express.createServer() + * , blog = express.createServer(); + * + * blog.mounted(function(parent){ + * // parent is app + * // "this" is blog + * }); + * + * app.use(blog); + * + * @param {Function} fn + * @return {Server} for chaining + * @api public + */ + +app.mounted = function(fn){ + this.__mounted = fn; + return this; +}; + +/** + * See: view.register. + * + * @return {Server} for chaining + * @api public + */ + +app.register = function(){ + view.register.apply(this, arguments); + return this; +}; + +/** + * Register the given view helpers `obj`. This method + * can be called several times to apply additional helpers. + * + * @param {Object} obj + * @return {Server} for chaining + * @api public + */ + +app.helpers = +app.locals = function(obj){ + utils.merge(this._locals, obj); + return this; +}; + +/** + * Register the given dynamic view helpers `obj`. This method + * can be called several times to apply additional helpers. + * + * @param {Object} obj + * @return {Server} for chaining + * @api public + */ + +app.dynamicHelpers = function(obj){ + utils.merge(this.dynamicViewHelpers, obj); + return this; +}; + +/** + * Map the given param placeholder `name`(s) to the given callback(s). + * + * Param mapping is used to provide pre-conditions to routes + * which us normalized placeholders. This callback has the same + * signature as regular middleware, for example below when ":userId" + * is used this function will be invoked in an attempt to load the user. + * + * app.param('userId', function(req, res, next, id){ + * User.find(id, function(err, user){ + * if (err) { + * next(err); + * } else if (user) { + * req.user = user; + * next(); + * } else { + * next(new Error('failed to load user')); + * } + * }); + * }); + * + * Passing a single function allows you to map logic + * to the values passed to `app.param()`, for example + * this is useful to provide coercion support in a concise manner. + * + * The following example maps regular expressions to param values + * ensuring that they match, otherwise passing control to the next + * route: + * + * app.param(function(name, regexp){ + * if (regexp instanceof RegExp) { + * return function(req, res, next, val){ + * var captures; + * if (captures = regexp.exec(String(val))) { + * req.params[name] = captures; + * next(); + * } else { + * next('route'); + * } + * } + * } + * }); + * + * We can now use it as shown below, where "/commit/:commit" expects + * that the value for ":commit" is at 5 or more digits. The capture + * groups are then available as `req.params.commit` as we defined + * in the function above. + * + * app.param('commit', /^\d{5,}$/); + * + * For more of this useful functionality take a look + * at [express-params](http://github.com/visionmedia/express-params). + * + * @param {String|Array|Function} name + * @param {Function} fn + * @return {Server} for chaining + * @api public + */ + +app.param = function(name, fn){ + var self = this + , fns = [].slice.call(arguments, 1); + + // array + if (Array.isArray(name)) { + name.forEach(function(name){ + fns.forEach(function(fn){ + self.param(name, fn); + }); + }); + // param logic + } else if ('function' == typeof name) { + this.routes.param(name); + // single + } else { + if (':' == name[0]) name = name.substr(1); + fns.forEach(function(fn){ + self.routes.param(name, fn); + }); + } + + return this; +}; + +/** + * Assign a custom exception handler callback `fn`. + * These handlers are always _last_ in the middleware stack. + * + * @param {Function} fn + * @return {Server} for chaining + * @api public + */ + +app.error = function(fn){ + this.errorHandlers.push(fn); + return this; +}; + +/** + * Register the given callback `fn` for the given `type`. + * + * @param {String} type + * @param {Function} fn + * @return {Server} for chaining + * @api public + */ + +app.is = function(type, fn){ + if (!fn) return this.isCallbacks[type]; + this.isCallbacks[type] = fn; + return this; +}; + +/** + * Assign `setting` to `val`, or return `setting`'s value. + * Mounted servers inherit their parent server's settings. + * + * @param {String} setting + * @param {String} val + * @return {Server|Mixed} for chaining, or the setting value + * @api public + */ + +app.set = function(setting, val){ + if (val === undefined) { + if (this.settings.hasOwnProperty(setting)) { + return this.settings[setting]; + } else if (this.parent) { + return this.parent.set(setting); + } + } else { + this.settings[setting] = val; + return this; + } +}; + +/** + * Check if `setting` is enabled. + * + * @param {String} setting + * @return {Boolean} + * @api public + */ + +app.enabled = function(setting){ + return !!this.set(setting); +}; + +/** + * Check if `setting` is disabled. + * + * @param {String} setting + * @return {Boolean} + * @api public + */ + +app.disabled = function(setting){ + return !this.set(setting); +}; + +/** + * Enable `setting`. + * + * @param {String} setting + * @return {Server} for chaining + * @api public + */ + +app.enable = function(setting){ + return this.set(setting, true); +}; + +/** + * Disable `setting`. + * + * @param {String} setting + * @return {Server} for chaining + * @api public + */ + +app.disable = function(setting){ + return this.set(setting, false); +}; + +/** + * Redirect `key` to `url`. + * + * @param {String} key + * @param {String} url + * @return {Server} for chaining + * @api public + */ + +app.redirect = function(key, url){ + this.redirects[key] = url; + return this; +}; + +/** + * Configure callback for zero or more envs, + * when no env is specified that callback will + * be invoked for all environments. Any combination + * can be used multiple times, in any order desired. + * + * Examples: + * + * app.configure(function(){ + * // executed for all envs + * }); + * + * app.configure('stage', function(){ + * // executed staging env + * }); + * + * app.configure('stage', 'production', function(){ + * // executed for stage and production + * }); + * + * @param {String} env... + * @param {Function} fn + * @return {Server} for chaining + * @api public + */ + +app.configure = function(env, fn){ + var envs = 'all' + , args = toArray(arguments); + fn = args.pop(); + if (args.length) envs = args; + if ('all' == envs || ~envs.indexOf(this.settings.env)) fn.call(this); + return this; +}; + +/** + * Delegate `.VERB(...)` calls to `.route(VERB, ...)`. + */ + +methods.forEach(function(method){ + app[method] = function(path){ + if (1 == arguments.length) return this.routes.lookup(method, path); + var args = [method].concat(toArray(arguments)); + if (!this.__usedRouter) this.use(this.router); + return this.routes._route.apply(this.routes, args); + } +}); + +/** + * Special-cased "all" method, applying the given route `path`, + * middleware, and callback to _every_ HTTP method. + * + * @param {String} path + * @param {Function} ... + * @return {Server} for chaining + * @api public + */ + +app.all = function(path){ + var args = arguments; + if (1 == args.length) return this.routes.lookup('all', path); + methods.forEach(function(method){ + if ('all' == method || 'del' == method) return; + app[method].apply(this, args); + }, this); + return this; +}; + +// del -> delete alias + +app.del = app.delete; + diff --git a/usb_auth/node_modules/express/lib/https.js b/usb_auth/node_modules/express/lib/https.js new file mode 100644 index 0000000..8a8c008 --- /dev/null +++ b/usb_auth/node_modules/express/lib/https.js @@ -0,0 +1,52 @@ + +/*! + * Express - HTTPSServer + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var connect = require('connect') + , HTTPServer = require('./http') + , https = require('https'); + +/** + * Expose `HTTPSServer`. + */ + +exports = module.exports = HTTPSServer; + +/** + * Server proto. + */ + +var app = HTTPSServer.prototype; + +/** + * Initialize a new `HTTPSServer` with the + * given `options`, and optional `middleware`. + * + * @param {Object} options + * @param {Array} middleware + * @api public + */ + +function HTTPSServer(options, middleware){ + connect.HTTPSServer.call(this, options, []); + this.init(middleware); +}; + +/** + * Inherit from `connect.HTTPSServer`. + */ + +app.__proto__ = connect.HTTPSServer.prototype; + +// mixin HTTPServer methods + +Object.keys(HTTPServer.prototype).forEach(function(method){ + app[method] = HTTPServer.prototype[method]; +}); diff --git a/usb_auth/node_modules/express/lib/request.js b/usb_auth/node_modules/express/lib/request.js new file mode 100644 index 0000000..1d5ab40 --- /dev/null +++ b/usb_auth/node_modules/express/lib/request.js @@ -0,0 +1,323 @@ + +/*! + * Express - request + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var http = require('http') + , req = http.IncomingMessage.prototype + , utils = require('./utils') + , parse = require('url').parse + , mime = require('mime'); + +/** + * Default flash formatters. + * + * @type Object + */ + +var flashFormatters = exports.flashFormatters = { + s: function(val){ + return String(val); + } +}; + +/** + * Return request header or optional default. + * + * The `Referrer` header field is special-cased, + * both `Referrer` and `Referer` will yield are + * interchangeable. + * + * Examples: + * + * req.header('Content-Type'); + * // => "text/plain" + * + * req.header('content-type'); + * // => "text/plain" + * + * req.header('Accept'); + * // => undefined + * + * req.header('Accept', 'text/html'); + * // => "text/html" + * + * @param {String} name + * @param {String} defaultValue + * @return {String} + * @api public + */ + +req.header = function(name, defaultValue){ + switch (name = name.toLowerCase()) { + case 'referer': + case 'referrer': + return this.headers.referrer + || this.headers.referer + || defaultValue; + default: + return this.headers[name] || defaultValue; + } +}; + +/** + * Get `field`'s `param` value, defaulting to ''. + * + * Examples: + * + * req.get('content-disposition', 'filename'); + * // => "something.png" + * + * @param {String} field + * @param {String} param + * @return {String} + * @api public + */ + +req.get = function(field, param){ + var val = this.header(field); + if (!val) return ''; + var regexp = new RegExp(param + ' *= *(?:"([^"]+)"|([^;]+))', 'i'); + if (!regexp.exec(val)) return ''; + return RegExp.$1 || RegExp.$2; +}; + +/** + * Short-hand for `require('url').parse(req.url).pathname`. + * + * @return {String} + * @api public + */ + +req.__defineGetter__('path', function(){ + return parse(this.url).pathname; +}); + +/** + * Check if the _Accept_ header is present, and includes the given `type`. + * + * When the _Accept_ header is not present `true` is returned. Otherwise + * the given `type` is matched by an exact match, and then subtypes. You + * may pass the subtype such as "html" which is then converted internally + * to "text/html" using the mime lookup table. + * + * Examples: + * + * // Accept: text/html + * req.accepts('html'); + * // => true + * + * // Accept: text/*; application/json + * req.accepts('html'); + * req.accepts('text/html'); + * req.accepts('text/plain'); + * req.accepts('application/json'); + * // => true + * + * req.accepts('image/png'); + * req.accepts('png'); + * // => false + * + * @param {String} type + * @return {Boolean} + * @api public + */ + +req.accepts = function(type){ + var accept = this.header('Accept'); + + // normalize extensions ".json" -> "json" + if (type && '.' == type[0]) type = type.substr(1); + + // when Accept does not exist, or is '*/*' return true + if (!accept || '*/*' == accept) { + return true; + } else if (type) { + // allow "html" vs "text/html" etc + if (!~type.indexOf('/')) type = mime.lookup(type); + + // check if we have a direct match + if (~accept.indexOf(type)) return true; + + // check if we have type/* + type = type.split('/')[0] + '/*'; + return !!~accept.indexOf(type); + } else { + return false; + } +}; + +/** + * Return the value of param `name` when present or `defaultValue`. + * + * - Checks route placeholders, ex: _/user/:id_ + * - Checks query string params, ex: ?id=12 + * - Checks urlencoded body params, ex: id=12 + * + * To utilize urlencoded request bodies, `req.body` + * should be an object. This can be done by using + * the `connect.bodyParser` middleware. + * + * @param {String} name + * @param {Mixed} defaultValue + * @return {String} + * @api public + */ + +req.param = function(name, defaultValue){ + // route params like /user/:id + if (this.params && this.params.hasOwnProperty(name) && undefined !== this.params[name]) { + return this.params[name]; + } + // query string params + if (undefined !== this.query[name]) { + return this.query[name]; + } + // request body params via connect.bodyParser + if (this.body && undefined !== this.body[name]) { + return this.body[name]; + } + return defaultValue; +}; + +/** + * Queue flash `msg` of the given `type`. + * + * Examples: + * + * req.flash('info', 'email sent'); + * req.flash('error', 'email delivery failed'); + * req.flash('info', 'email re-sent'); + * // => 2 + * + * req.flash('info'); + * // => ['email sent', 'email re-sent'] + * + * req.flash('info'); + * // => [] + * + * req.flash(); + * // => { error: ['email delivery failed'], info: [] } + * + * Formatting: + * + * Flash notifications also support arbitrary formatting support. + * For example you may pass variable arguments to `req.flash()` + * and use the %s specifier to be replaced by the associated argument: + * + * req.flash('info', 'email has been sent to %s.', userName); + * + * To add custom formatters use the `exports.flashFormatters` object. + * + * @param {String} type + * @param {String} msg + * @return {Array|Object|Number} + * @api public + */ + +req.flash = function(type, msg){ + if (this.session === undefined) throw Error('req.flash() requires sessions'); + var msgs = this.session.flash = this.session.flash || {}; + if (type && msg) { + var i = 2 + , args = arguments + , formatters = this.app.flashFormatters || {}; + formatters.__proto__ = flashFormatters; + msg = utils.miniMarkdown(msg); + msg = msg.replace(/%([a-zA-Z])/g, function(_, format){ + var formatter = formatters[format]; + if (formatter) return formatter(utils.escape(args[i++])); + }); + return (msgs[type] = msgs[type] || []).push(msg); + } else if (type) { + var arr = msgs[type]; + delete msgs[type]; + return arr || []; + } else { + this.session.flash = {}; + return msgs; + } +}; + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains the give mime `type`. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * req.is('html'); + * req.is('text/html'); + * // => true + * + * // When Content-Type is application/json + * req.is('json'); + * req.is('application/json'); + * // => true + * + * req.is('html'); + * // => false + * + * Ad-hoc callbacks can also be registered with Express, to perform + * assertions again the request, for example if we need an expressive + * way to check if our incoming request is an image, we can register "an image" + * callback: + * + * app.is('an image', function(req){ + * return 0 == req.headers['content-type'].indexOf('image'); + * }); + * + * Now within our route callbacks, we can use to to assert content types + * such as "image/jpeg", "image/png", etc. + * + * app.post('/image/upload', function(req, res, next){ + * if (req.is('an image')) { + * // do something + * } else { + * next(); + * } + * }); + * + * @param {String} type + * @return {Boolean} + * @api public + */ + +req.is = function(type){ + var fn = this.app.is(type); + if (fn) return fn(this); + var ct = this.headers['content-type']; + if (!ct) return false; + ct = ct.split(';')[0]; + if (!~type.indexOf('/')) type = mime.lookup(type); + if (~type.indexOf('*')) { + type = type.split('/'); + ct = ct.split('/'); + if ('*' == type[0] && type[1] == ct[1]) return true; + if ('*' == type[1] && type[0] == ct[0]) return true; + return false; + } + return !! ~ct.indexOf(type); +}; + +// Callback for isXMLHttpRequest / xhr + +function isxhr() { + return this.header('X-Requested-With', '').toLowerCase() === 'xmlhttprequest'; +} + +/** + * Check if the request was an _XMLHttpRequest_. + * + * @return {Boolean} + * @api public + */ + +req.__defineGetter__('isXMLHttpRequest', isxhr); +req.__defineGetter__('xhr', isxhr); diff --git a/usb_auth/node_modules/express/lib/response.js b/usb_auth/node_modules/express/lib/response.js new file mode 100644 index 0000000..a671771 --- /dev/null +++ b/usb_auth/node_modules/express/lib/response.js @@ -0,0 +1,460 @@ + +/*! + * Express - response + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var fs = require('fs') + , http = require('http') + , path = require('path') + , connect = require('connect') + , utils = connect.utils + , parseRange = require('./utils').parseRange + , res = http.ServerResponse.prototype + , send = connect.static.send + , mime = require('mime') + , basename = path.basename + , join = path.join; + +/** + * Send a response with the given `body` and optional `headers` and `status` code. + * + * Examples: + * + * res.send(); + * res.send(new Buffer('wahoo')); + * res.send({ some: 'json' }); + * res.send('

some html

'); + * res.send('Sorry, cant find that', 404); + * res.send('text', { 'Content-Type': 'text/plain' }, 201); + * res.send(404); + * + * @param {String|Object|Number|Buffer} body or status + * @param {Object|Number} headers or status + * @param {Number} status + * @return {ServerResponse} + * @api public + */ + +res.send = function(body, headers, status){ + // allow status as second arg + if ('number' == typeof headers) { + status = headers, + headers = null; + } + + // default status + status = status || this.statusCode; + + // allow 0 args as 204 + if (!arguments.length || undefined === body) status = 204; + + // determine content type + switch (typeof body) { + case 'number': + if (!this.header('Content-Type')) { + this.contentType('.txt'); + } + body = http.STATUS_CODES[status = body]; + break; + case 'string': + if (!this.header('Content-Type')) { + this.charset = this.charset || 'utf-8'; + this.contentType('.html'); + } + break; + case 'boolean': + case 'object': + if (Buffer.isBuffer(body)) { + if (!this.header('Content-Type')) { + this.contentType('.bin'); + } + } else { + return this.json(body, headers, status); + } + break; + } + + // populate Content-Length + if (undefined !== body && !this.header('Content-Length')) { + this.header('Content-Length', Buffer.isBuffer(body) + ? body.length + : Buffer.byteLength(body)); + } + + // merge headers passed + if (headers) { + var fields = Object.keys(headers); + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i]; + this.header(field, headers[field]); + } + } + + // strip irrelevant headers + if (204 == status || 304 == status) { + this.removeHeader('Content-Type'); + this.removeHeader('Content-Length'); + body = ''; + } + + // respond + this.statusCode = status; + this.end('HEAD' == this.req.method ? null : body); + return this; +}; + +/** + * Send JSON response with `obj`, optional `headers`, and optional `status`. + * + * Examples: + * + * res.json(null); + * res.json({ user: 'tj' }); + * res.json('oh noes!', 500); + * res.json('I dont have that', 404); + * + * @param {Mixed} obj + * @param {Object|Number} headers or status + * @param {Number} status + * @return {ServerResponse} + * @api public + */ + +res.json = function(obj, headers, status){ + var body = JSON.stringify(obj) + , callback = this.req.query.callback + , jsonp = this.app.enabled('jsonp callback'); + + this.charset = this.charset || 'utf-8'; + this.header('Content-Type', 'application/json'); + + if (callback && jsonp) { + this.header('Content-Type', 'text/javascript'); + body = callback.replace(/[^\w$.]/g, '') + '(' + body + ');'; + } + + return this.send(body, headers, status); +}; + +/** + * Set status `code`. + * + * @param {Number} code + * @return {ServerResponse} + * @api public + */ + +res.status = function(code){ + this.statusCode = code; + return this; +}; + +/** + * Transfer the file at the given `path`. Automatically sets + * the _Content-Type_ response header field. `next()` is called + * when `path` is a directory, or when an error occurs. + * + * Options: + * + * - `maxAge` defaulting to 0 + * - `root` root directory for relative filenames + * + * @param {String} path + * @param {Object|Function} options or fn + * @param {Function} fn + * @api public + */ + +res.sendfile = function(path, options, fn){ + var next = this.req.next; + options = options || {}; + + // support function as second arg + if ('function' == typeof options) { + fn = options; + options = {}; + } + + options.path = encodeURIComponent(path); + options.callback = fn; + send(this.req, this, next, options); +}; + +/** + * Set _Content-Type_ response header passed through `mime.lookup()`. + * + * Examples: + * + * var filename = 'path/to/image.png'; + * res.contentType(filename); + * // res.headers['Content-Type'] is now "image/png" + * + * res.contentType('.html'); + * res.contentType('html'); + * res.contentType('json'); + * res.contentType('png'); + * + * @param {String} type + * @return {String} the resolved mime type + * @api public + */ + +res.contentType = function(type){ + return this.header('Content-Type', mime.lookup(type)); +}; + +/** + * Set _Content-Disposition_ header to _attachment_ with optional `filename`. + * + * @param {String} filename + * @return {ServerResponse} + * @api public + */ + +res.attachment = function(filename){ + if (filename) this.contentType(filename); + this.header('Content-Disposition', filename + ? 'attachment; filename="' + basename(filename) + '"' + : 'attachment'); + return this; +}; + +/** + * Transfer the file at the given `path`, with optional + * `filename` as an attachment and optional callback `fn(err)`, + * and optional `fn2(err)` which is invoked when an error has + * occurred after header has been sent. + * + * @param {String} path + * @param {String|Function} filename or fn + * @param {Function} fn + * @param {Function} fn2 + * @api public + */ + +res.download = function(path, filename, fn, fn2){ + var self = this; + + // support callback as second arg + if ('function' == typeof filename) { + fn2 = fn; + fn = filename; + filename = null; + } + + // transfer the file + this.attachment(filename || path).sendfile(path, function(err){ + var sentHeader = self._header; + if (err) { + if (!sentHeader) self.removeHeader('Content-Disposition'); + if (sentHeader) { + fn2 && fn2(err); + } else if (fn) { + fn(err); + } else { + self.req.next(err); + } + } else if (fn) { + fn(); + } + }); +}; + +/** + * Set or get response header `name` with optional `val`. + * + * @param {String} name + * @param {String} val + * @return {ServerResponse} for chaining + * @api public + */ + +res.header = function(name, val){ + if (1 == arguments.length) return this.getHeader(name); + this.setHeader(name, val); + return this; +}; + +/** + * Clear cookie `name`. + * + * @param {String} name + * @param {Object} options + * @api public + */ + +res.clearCookie = function(name, options){ + var opts = { expires: new Date(1) }; + this.cookie(name, '', options + ? utils.merge(options, opts) + : opts); +}; + +/** + * Set cookie `name` to `val`, with the given `options`. + * + * Options: + * + * - `maxAge` max-age in milliseconds, converted to `expires` + * - `path` defaults to the "basepath" setting which is typically "/" + * + * Examples: + * + * // "Remember Me" for 15 minutes + * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); + * + * // save as above + * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) + * + * @param {String} name + * @param {String} val + * @param {Options} options + * @api public + */ + +res.cookie = function(name, val, options){ + options = options || {}; + if ('maxAge' in options) options.expires = new Date(Date.now() + options.maxAge); + if (undefined === options.path) options.path = this.app.set('basepath'); + var cookie = utils.serializeCookie(name, val, options); + this.header('Set-Cookie', cookie); +}; + +/** + * Redirect to the given `url` with optional response `status` + * defauling to 302. + * + * The given `url` can also be the name of a mapped url, for + * example by default express supports "back" which redirects + * to the _Referrer_ or _Referer_ headers or the application's + * "basepath" setting. Express also supports "basepath" out of the box, + * which can be set via `app.set('basepath', '/blog');`, and defaults + * to '/'. + * + * Redirect Mapping: + * + * To extend the redirect mapping capabilities that Express provides, + * we may use the `app.redirect()` method: + * + * app.redirect('google', 'http://google.com'); + * + * Now in a route we may call: + * + * res.redirect('google'); + * + * We may also map dynamic redirects: + * + * app.redirect('comments', function(req, res){ + * return '/post/' + req.params.id + '/comments'; + * }); + * + * So now we may do the following, and the redirect will dynamically adjust to + * the context of the request. If we called this route with _GET /post/12_ our + * redirect _Location_ would be _/post/12/comments_. + * + * app.get('/post/:id', function(req, res){ + * res.redirect('comments'); + * }); + * + * Unless an absolute `url` is given, the app's mount-point + * will be respected. For example if we redirect to `/posts`, + * and our app is mounted at `/blog` we will redirect to `/blog/posts`. + * + * @param {String} url + * @param {Number} code + * @api public + */ + +res.redirect = function(url, status){ + var app = this.app + , req = this.req + , base = app.set('basepath') || app.route + , status = status || 302 + , head = 'HEAD' == req.method + , body; + + // Setup redirect map + var map = { + back: req.header('Referrer', base) + , home: base + }; + + // Support custom redirect map + map.__proto__ = app.redirects; + + // Attempt mapped redirect + var mapped = 'function' == typeof map[url] + ? map[url](req, this) + : map[url]; + + // Perform redirect + url = mapped || url; + + // Relative + if (!~url.indexOf('://')) { + // Respect mount-point + if ('/' != base && 0 != url.indexOf(base)) url = base + url; + + // Absolute + var host = req.headers.host + , tls = req.connection.encrypted; + url = 'http' + (tls ? 's' : '') + '://' + host + url; + } + + // Support text/{plain,html} by default + if (req.accepts('html')) { + body = '

' + http.STATUS_CODES[status] + '. Redirecting to ' + url + '

'; + this.header('Content-Type', 'text/html'); + } else { + body = http.STATUS_CODES[status] + '. Redirecting to ' + url; + this.header('Content-Type', 'text/plain'); + } + + // Respond + this.statusCode = status; + this.header('Location', url); + this.end(head ? null : body); +}; + +/** + * Assign the view local variable `name` to `val` or return the + * local previously assigned to `name`. + * + * @param {String} name + * @param {Mixed} val + * @return {Mixed} val + * @api public + */ + +res.local = function(name, val){ + this._locals = this._locals || {}; + return undefined === val + ? this._locals[name] + : this._locals[name] = val; +}; + +/** + * Assign several locals with the given `obj`, + * or return the locals. + * + * @param {Object} obj + * @return {Object|Undefined} + * @api public + */ + +res.locals = +res.helpers = function(obj){ + if (obj) { + for (var key in obj) { + this.local(key, obj[key]); + } + } else { + return this._locals; + } +}; diff --git a/usb_auth/node_modules/express/lib/router/collection.js b/usb_auth/node_modules/express/lib/router/collection.js new file mode 100644 index 0000000..991a9a2 --- /dev/null +++ b/usb_auth/node_modules/express/lib/router/collection.js @@ -0,0 +1,53 @@ + +/*! + * Express - router - Collection + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Expose `Collection`. + */ + +module.exports = Collection; + +/** + * Initialize a new route `Collection` + * with the given `router`. + * + * @param {Router} router + * @api private + */ + +function Collection(router) { + Array.apply(this, arguments); + this.router = router; +} + +/** + * Inherit from `Array.prototype`. + */ + +Collection.prototype.__proto__ = Array.prototype; + +/** + * Remove the routes in this collection. + * + * @return {Collection} of routes removed + * @api public + */ + +Collection.prototype.remove = function(){ + var router = this.router + , len = this.length + , ret = new Collection(this.router); + + for (var i = 0; i < len; ++i) { + if (router.remove(this[i])) { + ret.push(this[i]); + } + } + + return ret; +}; + diff --git a/usb_auth/node_modules/express/lib/router/index.js b/usb_auth/node_modules/express/lib/router/index.js new file mode 100644 index 0000000..ff1498b --- /dev/null +++ b/usb_auth/node_modules/express/lib/router/index.js @@ -0,0 +1,398 @@ + +/*! + * Express - Router + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Route = require('./route') + , Collection = require('./collection') + , utils = require('../utils') + , parse = require('url').parse + , toArray = utils.toArray; + +/** + * Expose `Router` constructor. + */ + +exports = module.exports = Router; + +/** + * Expose HTTP methods. + */ + +var methods = exports.methods = require('./methods'); + +/** + * Initialize a new `Router` with the given `app`. + * + * @param {express.HTTPServer} app + * @api private + */ + +function Router(app) { + var self = this; + this.app = app; + this.routes = {}; + this.params = {}; + this._params = []; + + this.middleware = function(req, res, next){ + self._dispatch(req, res, next); + }; +} + +/** + * Register a param callback `fn` for the given `name`. + * + * @param {String|Function} name + * @param {Function} fn + * @return {Router} for chaining + * @api public + */ + +Router.prototype.param = function(name, fn){ + // param logic + if ('function' == typeof name) { + this._params.push(name); + return; + } + + // apply param functions + var params = this._params + , len = params.length + , ret; + + for (var i = 0; i < len; ++i) { + if (ret = params[i](name, fn)) { + fn = ret; + } + } + + // ensure we end up with a + // middleware function + if ('function' != typeof fn) { + throw new Error('invalid param() call for ' + name + ', got ' + fn); + } + + (this.params[name] = this.params[name] || []).push(fn); + return this; +}; + +/** + * Return a `Collection` of all routes defined. + * + * @return {Collection} + * @api public + */ + +Router.prototype.all = function(){ + return this.find(function(){ + return true; + }); +}; + +/** + * Remove the given `route`, returns + * a bool indicating if the route was present + * or not. + * + * @param {Route} route + * @return {Boolean} + * @api public + */ + +Router.prototype.remove = function(route){ + var routes = this.routes[route.method] + , len = routes.length; + + for (var i = 0; i < len; ++i) { + if (route == routes[i]) { + routes.splice(i, 1); + return true; + } + } +}; + +/** + * Return routes with route paths matching `path`. + * + * @param {String} method + * @param {String} path + * @return {Collection} + * @api public + */ + +Router.prototype.lookup = function(method, path){ + return this.find(function(route){ + return path == route.path + && (route.method == method + || method == 'all'); + }); +}; + +/** + * Return routes with regexps that match the given `url`. + * + * @param {String} method + * @param {String} url + * @return {Collection} + * @api public + */ + +Router.prototype.match = function(method, url){ + return this.find(function(route){ + return route.match(url) + && (route.method == method + || method == 'all'); + }); +}; + +/** + * Find routes based on the return value of `fn` + * which is invoked once per route. + * + * @param {Function} fn + * @return {Collection} + * @api public + */ + +Router.prototype.find = function(fn){ + var len = methods.length + , ret = new Collection(this) + , method + , routes + , route; + + for (var i = 0; i < len; ++i) { + method = methods[i]; + routes = this.routes[method]; + if (!routes) continue; + for (var j = 0, jlen = routes.length; j < jlen; ++j) { + route = routes[j]; + if (fn(route)) ret.push(route); + } + } + + return ret; +}; + +/** + * Route dispatcher aka the route "middleware". + * + * @param {IncomingMessage} req + * @param {ServerResponse} res + * @param {Function} next + * @api private + */ + +Router.prototype._dispatch = function(req, res, next){ + var params = this.params + , self = this; + + // route dispatch + (function pass(i, err){ + var paramCallbacks + , paramIndex = 0 + , paramVal + , route + , keys + , key + , ret; + + // match next route + function nextRoute(err) { + pass(req._route_index + 1, err); + } + + // match route + req.route = route = self._match(req, i); + + // implied OPTIONS + if (!route && 'OPTIONS' == req.method) return self._options(req, res); + + // no route + if (!route) return next(err); + + // we have a route + // start at param 0 + req.params = route.params; + keys = route.keys; + i = 0; + + // param callbacks + function param(err) { + paramIndex = 0; + key = keys[i++]; + paramVal = key && req.params[key.name]; + paramCallbacks = key && params[key.name]; + + try { + if ('route' == err) { + nextRoute(); + } else if (err) { + i = 0; + callbacks(err); + } else if (paramCallbacks && undefined !== paramVal) { + paramCallback(); + } else if (key) { + param(); + } else { + i = 0; + callbacks(); + } + } catch (err) { + param(err); + } + }; + + param(err); + + // single param callbacks + function paramCallback(err) { + var fn = paramCallbacks[paramIndex++]; + if (err || !fn) return param(err); + fn(req, res, paramCallback, paramVal, key.name); + } + + // invoke route callbacks + function callbacks(err) { + var fn = route.callbacks[i++]; + try { + if ('route' == err) { + nextRoute(); + } else if (err && fn) { + if (fn.length < 4) return callbacks(err); + fn(err, req, res, callbacks); + } else if (fn) { + fn(req, res, callbacks); + } else { + nextRoute(err); + } + } catch (err) { + callbacks(err); + } + } + })(0); +}; + +/** + * Respond to __OPTIONS__ method. + * + * @param {IncomingMessage} req + * @param {ServerResponse} res + * @api private + */ + +Router.prototype._options = function(req, res){ + var path = parse(req.url).pathname + , body = this._optionsFor(path).join(','); + res.send(body, { Allow: body }); +}; + +/** + * Return an array of HTTP verbs or "options" for `path`. + * + * @param {String} path + * @return {Array} + * @api private + */ + +Router.prototype._optionsFor = function(path){ + var self = this; + return methods.filter(function(method){ + var routes = self.routes[method]; + if (!routes || 'options' == method) return; + for (var i = 0, len = routes.length; i < len; ++i) { + if (routes[i].match(path)) return true; + } + }).map(function(method){ + return method.toUpperCase(); + }); +}; + +/** + * Attempt to match a route for `req` + * starting from offset `i`. + * + * @param {IncomingMessage} req + * @param {Number} i + * @return {Route} + * @api private + */ + +Router.prototype._match = function(req, i){ + var method = req.method.toLowerCase() + , url = parse(req.url) + , path = url.pathname + , routes = this.routes + , captures + , route + , keys; + + // pass HEAD to GET routes + if ('head' == method) method = 'get'; + + // routes for this method + if (routes = routes[method]) { + + // matching routes + for (var len = routes.length; i < len; ++i) { + route = routes[i]; + if (captures = route.match(path)) { + keys = route.keys; + route.params = []; + + // params from capture groups + for (var j = 1, jlen = captures.length; j < jlen; ++j) { + var key = keys[j-1] + , val = 'string' == typeof captures[j] + ? decodeURIComponent(captures[j]) + : captures[j]; + if (key) { + route.params[key.name] = val; + } else { + route.params.push(val); + } + } + + // all done + req._route_index = i; + return route; + } + } + } +}; + +/** + * Route `method`, `path`, and one or more callbacks. + * + * @param {String} method + * @param {String} path + * @param {Function} callback... + * @return {Router} for chaining + * @api private + */ + +Router.prototype._route = function(method, path, callbacks){ + var app = this.app + , callbacks = utils.flatten(toArray(arguments, 2)); + + // ensure path was given + if (!path) throw new Error('app.' + method + '() requires a path'); + + // create the route + var route = new Route(method, path, callbacks, { + sensitive: app.enabled('case sensitive routes') + , strict: app.enabled('strict routing') + }); + + // add it + (this.routes[method] = this.routes[method] || []) + .push(route); + return this; +}; diff --git a/usb_auth/node_modules/express/lib/router/methods.js b/usb_auth/node_modules/express/lib/router/methods.js new file mode 100644 index 0000000..e19787b --- /dev/null +++ b/usb_auth/node_modules/express/lib/router/methods.js @@ -0,0 +1,70 @@ + +/*! + * Express - router - methods + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Hypertext Transfer Protocol -- HTTP/1.1 + * http://www.ietf.org/rfc/rfc2616.txt + */ + +var RFC2616 = ['OPTIONS', 'GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'CONNECT']; + +/** + * HTTP Extensions for Distributed Authoring -- WEBDAV + * http://www.ietf.org/rfc/rfc2518.txt + */ + +var RFC2518 = ['PROPFIND', 'PROPPATCH', 'MKCOL', 'COPY', 'MOVE', 'LOCK', 'UNLOCK']; + +/** + * Versioning Extensions to WebDAV + * http://www.ietf.org/rfc/rfc3253.txt + */ + +var RFC3253 = ['VERSION-CONTROL', 'REPORT', 'CHECKOUT', 'CHECKIN', 'UNCHECKOUT', 'MKWORKSPACE', 'UPDATE', 'LABEL', 'MERGE', 'BASELINE-CONTROL', 'MKACTIVITY']; + +/** + * Ordered Collections Protocol (WebDAV) + * http://www.ietf.org/rfc/rfc3648.txt + */ + +var RFC3648 = ['ORDERPATCH']; + +/** + * Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol + * http://www.ietf.org/rfc/rfc3744.txt + */ + +var RFC3744 = ['ACL']; + +/** + * Web Distributed Authoring and Versioning (WebDAV) SEARCH + * http://www.ietf.org/rfc/rfc5323.txt + */ + +var RFC5323 = ['SEARCH']; + +/** + * PATCH Method for HTTP + * http://www.ietf.org/rfc/rfc5789.txt + */ + +var RFC5789 = ['PATCH']; + +/** + * Expose the methods. + */ + +module.exports = [].concat( + RFC2616 + , RFC2518 + , RFC3253 + , RFC3648 + , RFC3744 + , RFC5323 + , RFC5789).map(function(method){ + return method.toLowerCase(); + }); diff --git a/usb_auth/node_modules/express/lib/router/route.js b/usb_auth/node_modules/express/lib/router/route.js new file mode 100644 index 0000000..7f2965c --- /dev/null +++ b/usb_auth/node_modules/express/lib/router/route.js @@ -0,0 +1,88 @@ + +/*! + * Express - router - Route + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Expose `Route`. + */ + +module.exports = Route; + +/** + * Initialize `Route` with the given HTTP `method`, `path`, + * and an array of `callbacks` and `options`. + * + * Options: + * + * - `sensitive` enable case-sensitive routes + * - `strict` enable strict matching for trailing slashes + * + * @param {String} method + * @param {String} path + * @param {Array} callbacks + * @param {Object} options. + * @api private + */ + +function Route(method, path, callbacks, options) { + options = options || {}; + this.path = path; + this.method = method; + this.callbacks = callbacks; + this.regexp = normalize(path + , this.keys = [] + , options.sensitive + , options.strict); +} + +/** + * Check if this route matches `path` and return captures made. + * + * @param {String} path + * @return {Array} + * @api private + */ + +Route.prototype.match = function(path){ + return this.regexp.exec(path); +}; + +/** + * Normalize the given path string, + * returning a regular expression. + * + * An empty array should be passed, + * which will contain the placeholder + * key names. For example "/user/:id" will + * then contain ["id"]. + * + * @param {String|RegExp} path + * @param {Array} keys + * @param {Boolean} sensitive + * @param {Boolean} strict + * @return {RegExp} + * @api private + */ + +function normalize(path, keys, sensitive, strict) { + if (path instanceof RegExp) return path; + path = path + .concat(strict ? '' : '/?') + .replace(/\/\(/g, '(?:/') + .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, function(_, slash, format, key, capture, optional){ + keys.push({ name: key, optional: !! optional }); + slash = slash || ''; + return '' + + (optional ? '' : slash) + + '(?:' + + (optional ? slash : '') + + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')' + + (optional || ''); + }) + .replace(/([\/.])/g, '\\$1') + .replace(/\*/g, '(.*)'); + return new RegExp('^' + path + '$', sensitive ? '' : 'i'); +} diff --git a/usb_auth/node_modules/express/lib/utils.js b/usb_auth/node_modules/express/lib/utils.js new file mode 100644 index 0000000..d579f7c --- /dev/null +++ b/usb_auth/node_modules/express/lib/utils.js @@ -0,0 +1,152 @@ + +/*! + * Express - Utils + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Check if `path` looks absolute. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +exports.isAbsolute = function(path){ + if ('/' == path[0]) return true; + if (':' == path[1] && '\\' == path[2]) return true; +}; + +/** + * Merge object `b` with `a` giving precedence to + * values in object `a`. + * + * @param {Object} a + * @param {Object} b + * @return {Object} a + * @api private + */ + +exports.union = function(a, b){ + if (a && b) { + var keys = Object.keys(b) + , len = keys.length + , key; + for (var i = 0; i < len; ++i) { + key = keys[i]; + if (!a.hasOwnProperty(key)) { + a[key] = b[key]; + } + } + } + return a; +}; + +/** + * Flatten the given `arr`. + * + * @param {Array} arr + * @return {Array} + * @api private + */ + +exports.flatten = function(arr, ret){ + var ret = ret || [] + , len = arr.length; + for (var i = 0; i < len; ++i) { + if (Array.isArray(arr[i])) { + exports.flatten(arr[i], ret); + } else { + ret.push(arr[i]); + } + } + return ret; +}; + +/** + * Parse mini markdown implementation. + * The following conversions are supported, + * primarily for the "flash" middleware: + * + * _foo_ or *foo* become foo + * __foo__ or **foo** become foo + * [A](B) becomes A + * + * @param {String} str + * @return {String} + * @api private + */ + +exports.miniMarkdown = function(str){ + return String(str) + .replace(/(__|\*\*)(.*?)\1/g, '$2') + .replace(/(_|\*)(.*?)\1/g, '$2') + .replace(/\[([^\]]+)\]\(([^)]+)\)/g, '$1'); +}; + +/** + * Escape special characters in the given string of html. + * + * @param {String} html + * @return {String} + * @api private + */ + +exports.escape = function(html) { + return String(html) + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(//g, '>'); +}; + +/** + * Parse "Range" header `str` relative to the given file `size`. + * + * @param {Number} size + * @param {String} str + * @return {Array} + * @api private + */ + +exports.parseRange = function(size, str){ + var valid = true; + var arr = str.substr(6).split(',').map(function(range){ + var range = range.split('-') + , start = parseInt(range[0], 10) + , end = parseInt(range[1], 10); + + // -500 + if (isNaN(start)) { + start = size - end; + end = size - 1; + // 500- + } else if (isNaN(end)) { + end = size - 1; + } + + // Invalid + if (isNaN(start) || isNaN(end) || start > end) valid = false; + + return { start: start, end: end }; + }); + return valid ? arr : undefined; +}; + +/** + * Fast alternative to `Array.prototype.slice.call()`. + * + * @param {Arguments} args + * @param {Number} n + * @return {Array} + * @api public + */ + +exports.toArray = function(args, i){ + var arr = [] + , len = args.length + , i = i || 0; + for (; i < len; ++i) arr.push(args[i]); + return arr; +}; diff --git a/usb_auth/node_modules/express/lib/view.js b/usb_auth/node_modules/express/lib/view.js new file mode 100644 index 0000000..5258249 --- /dev/null +++ b/usb_auth/node_modules/express/lib/view.js @@ -0,0 +1,460 @@ + +/*! + * Express - view + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var path = require('path') + , extname = path.extname + , dirname = path.dirname + , basename = path.basename + , utils = require('connect').utils + , View = require('./view/view') + , partial = require('./view/partial') + , union = require('./utils').union + , merge = utils.merge + , http = require('http') + , res = http.ServerResponse.prototype; + +/** + * Expose constructors. + */ + +exports = module.exports = View; + +/** + * Export template engine registrar. + */ + +exports.register = View.register; + +/** + * Lookup and compile `view` with cache support by supplying + * both the `cache` object and `cid` string, + * followed by `options` passed to `exports.lookup()`. + * + * @param {String} view + * @param {Object} cache + * @param {Object} cid + * @param {Object} options + * @return {View} + * @api private + */ + +exports.compile = function(view, cache, cid, options){ + if (cache && cid && cache[cid]){ + options.filename = cache[cid].path; + return cache[cid]; + } + + // lookup + view = exports.lookup(view, options); + + // hints + if (!view.exists) { + if (options.hint) hintAtViewPaths(view.original, options); + var err = new Error('failed to locate view "' + view.original.view + '"'); + err.view = view.original; + throw err; + } + + // compile + options.filename = view.path; + view.fn = view.templateEngine.compile(view.contents, options); + cache[cid] = view; + + return view; +}; + +/** + * Lookup `view`, returning an instanceof `View`. + * + * Options: + * + * - `root` root directory path + * - `defaultEngine` default template engine + * - `parentView` parent `View` object + * - `cache` cache object + * - `cacheid` optional cache id + * + * Lookup: + * + * - partial `_` + * - any `/index` + * - non-layout `..//index` + * - any `/` + * - partial `/_` + * + * @param {String} view + * @param {Object} options + * @return {View} + * @api private + */ + +exports.lookup = function(view, options){ + var orig = view = new View(view, options) + , partial = options.isPartial + , layout = options.isLayout; + + // Try _ prefix ex: ./views/_.jade + // taking precedence over the direct path + if (partial) { + view = new View(orig.prefixPath, options); + if (!view.exists) view = orig; + } + + // Try index ex: ./views/user/index.jade + if (!layout && !view.exists) view = new View(orig.indexPath, options); + + // Try ..//index ex: ../user/index.jade + // when calling partial('user') within the same dir + if (!layout && !view.exists) view = new View(orig.upIndexPath, options); + + // Try root ex: /user.jade + if (!view.exists) view = new View(orig.rootPath, options); + + // Try root _ prefix ex: /_user.jade + if (!view.exists && partial) view = new View(view.prefixPath, options); + + view.original = orig; + return view; +}; + +/** + * Partial render helper. + * + * @api private + */ + +function renderPartial(res, view, options, parentLocals, parent){ + var collection, object, locals; + + if (options) { + // collection + if (options.collection) { + collection = options.collection; + delete options.collection; + } else if ('length' in options) { + collection = options; + options = {}; + } + + // locals + if (options.locals) { + locals = options.locals; + delete options.locals; + } + + // object + if ('Object' != options.constructor.name) { + object = options; + options = {}; + } else if (undefined != options.object) { + object = options.object; + delete options.object; + } + } else { + options = {}; + } + + // Inherit locals from parent + union(options, parentLocals); + + // Merge locals + if (locals) merge(options, locals); + + // Partials dont need layouts + options.isPartial = true; + options.layout = false; + + // Deduce name from view path + var name = options.as || partial.resolveObjectName(view); + + // Render partial + function render(){ + if (object) { + if ('string' == typeof name) { + options[name] = object; + } else if (name === global) { + merge(options, object); + } + } + return res.render(view, options, null, parent, true); + } + + // Collection support + if (collection) { + var len = collection.length + , buf = '' + , keys + , key + , val; + + options.collectionLength = len; + + if ('number' == typeof len || Array.isArray(collection)) { + for (var i = 0; i < len; ++i) { + val = collection[i]; + options.firstInCollection = i == 0; + options.indexInCollection = i; + options.lastInCollection = i == len - 1; + object = val; + buf += render(); + } + } else { + keys = Object.keys(collection); + len = keys.length; + options.collectionLength = len; + options.collectionKeys = keys; + for (var i = 0; i < len; ++i) { + key = keys[i]; + val = collection[key]; + options.keyInCollection = key; + options.firstInCollection = i == 0; + options.indexInCollection = i; + options.lastInCollection = i == len - 1; + object = val; + buf += render(); + } + } + + return buf; + } else { + return render(); + } +}; + +/** + * Render `view` partial with the given `options`. Optionally a + * callback `fn(err, str)` may be passed instead of writing to + * the socket. + * + * Options: + * + * - `object` Single object with name derived from the view (unless `as` is present) + * + * - `as` Variable name for each `collection` value, defaults to the view name. + * * as: 'something' will add the `something` local variable + * * as: this will use the collection value as the template context + * * as: global will merge the collection value's properties with `locals` + * + * - `collection` Array of objects, the name is derived from the view name itself. + * For example _video.html_ will have a object _video_ available to it. + * + * @param {String} view + * @param {Object|Array|Function} options, collection, callback, or object + * @param {Function} fn + * @return {String} + * @api public + */ + +res.partial = function(view, options, fn){ + var app = this.app + , options = options || {} + , viewEngine = app.set('view engine') + , parent = {}; + + // accept callback as second argument + if ('function' == typeof options) { + fn = options; + options = {}; + } + + // root "views" option + parent.dirname = app.set('views') || process.cwd() + '/views'; + + // utilize "view engine" option + if (viewEngine) parent.engine = viewEngine; + + // render the partial + try { + var str = renderPartial(this, view, options, null, parent); + } catch (err) { + if (fn) { + fn(err); + } else { + this.req.next(err); + } + return; + } + + // callback or transfer + if (fn) { + fn(null, str); + } else { + this.send(str); + } +}; + +/** + * Render `view` with the given `options` and optional callback `fn`. + * When a callback function is given a response will _not_ be made + * automatically, however otherwise a response of _200_ and _text/html_ is given. + * + * Options: + * + * - `scope` Template evaluation context (the value of `this`) + * - `debug` Output debugging information + * - `status` Response status code + * + * @param {String} view + * @param {Object|Function} options or callback function + * @param {Function} fn + * @api public + */ + +res.render = function(view, opts, fn, parent, sub){ + // support callback function as second arg + if ('function' == typeof opts) { + fn = opts, opts = null; + } + + try { + return this._render(view, opts, fn, parent, sub); + } catch (err) { + // callback given + if (fn) { + fn(err); + // unwind to root call to prevent multiple callbacks + } else if (sub) { + throw err; + // root template, next(err) + } else { + this.req.next(err); + } + } +}; + +// private render() + +res._render = function(view, opts, fn, parent, sub){ + var options = {} + , self = this + , app = this.app + , helpers = app._locals + , dynamicHelpers = app.dynamicViewHelpers + , viewOptions = app.set('view options') + , root = app.set('views') || process.cwd() + '/views'; + + // cache id + var cid = app.enabled('view cache') + ? view + (parent ? ':' + parent.path : '') + : false; + + // merge "view options" + if (viewOptions) merge(options, viewOptions); + + // merge res._locals + if (this._locals) merge(options, this._locals); + + // merge render() options + if (opts) merge(options, opts); + + // merge render() .locals + if (opts && opts.locals) merge(options, opts.locals); + + // status support + if (options.status) this.statusCode = options.status; + + // capture attempts + options.attempts = []; + + var partial = options.isPartial + , layout = options.layout; + + // Layout support + if (true === layout || undefined === layout) { + layout = 'layout'; + } + + // Default execution scope to a plain object + options.scope = options.scope || {}; + + // Populate view + options.parentView = parent; + + // "views" setting + options.root = root; + + // "view engine" setting + options.defaultEngine = app.set('view engine'); + + // charset option + if (options.charset) this.charset = options.charset; + + // Dynamic helper support + if (false !== options.dynamicHelpers) { + // cache + if (!this.__dynamicHelpers) { + this.__dynamicHelpers = {}; + for (var key in dynamicHelpers) { + this.__dynamicHelpers[key] = dynamicHelpers[key].call( + this.app + , this.req + , this); + } + } + + // apply + merge(options, this.__dynamicHelpers); + } + + // Merge view helpers + union(options, helpers); + + // Always expose partial() as a local + options.partial = function(path, opts){ + return renderPartial(self, path, opts, options, view); + }; + + // View lookup + options.hint = app.enabled('hints'); + view = exports.compile(view, app.cache, cid, options); + + // layout helper + options.layout = function(path){ + layout = path; + }; + + // render + var str = view.fn.call(options.scope, options); + + // layout expected + if (layout) { + options.isLayout = true; + options.layout = false; + options.body = str; + this.render(layout, options, fn, view, true); + // partial return + } else if (partial) { + return str; + // render complete, and + // callback given + } else if (fn) { + fn(null, str); + // respond + } else { + this.send(str); + } +} + +/** + * Hint at view path resolution, outputting the + * paths that Express has tried. + * + * @api private + */ + +function hintAtViewPaths(view, options) { + console.error(); + console.error('failed to locate view "' + view.view + '", tried:'); + options.attempts.forEach(function(path){ + console.error(' - %s', path); + }); + console.error(); +} diff --git a/usb_auth/node_modules/express/lib/view/partial.js b/usb_auth/node_modules/express/lib/view/partial.js new file mode 100644 index 0000000..7d2f69b --- /dev/null +++ b/usb_auth/node_modules/express/lib/view/partial.js @@ -0,0 +1,40 @@ + +/*! + * Express - view - Partial + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Memory cache. + */ + +var cache = {}; + +/** + * Resolve partial object name from the view path. + * + * Examples: + * + * "user.ejs" becomes "user" + * "forum thread.ejs" becomes "forumThread" + * "forum/thread/post.ejs" becomes "post" + * "blog-post.ejs" becomes "blogPost" + * + * @return {String} + * @api private + */ + +exports.resolveObjectName = function(view){ + return cache[view] || (cache[view] = view + .split('/') + .slice(-1)[0] + .split('.')[0] + .replace(/^_/, '') + .replace(/[^a-zA-Z0-9 ]+/g, ' ') + .split(/ +/).map(function(word, i){ + return i + ? word[0].toUpperCase() + word.substr(1) + : word; + }).join('')); +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/lib/view/view.js b/usb_auth/node_modules/express/lib/view/view.js new file mode 100644 index 0000000..7d9392c --- /dev/null +++ b/usb_auth/node_modules/express/lib/view/view.js @@ -0,0 +1,210 @@ + +/*! + * Express - View + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var path = require('path') + , utils = require('../utils') + , extname = path.extname + , dirname = path.dirname + , basename = path.basename + , fs = require('fs') + , stat = fs.statSync; + +/** + * Expose `View`. + */ + +exports = module.exports = View; + +/** + * Require cache. + */ + +var cache = {}; + +/** + * Initialize a new `View` with the given `view` path and `options`. + * + * @param {String} view + * @param {Object} options + * @api private + */ + +function View(view, options) { + options = options || {}; + this.view = view; + this.root = options.root; + this.relative = false !== options.relative; + this.defaultEngine = options.defaultEngine; + this.parent = options.parentView; + this.basename = basename(view); + this.engine = this.resolveEngine(); + this.extension = '.' + this.engine; + this.name = this.basename.replace(this.extension, ''); + this.path = this.resolvePath(); + this.dirname = dirname(this.path); + if (options.attempts) { + if (!~options.attempts.indexOf(this.path)) + options.attempts.push(this.path); + } +}; + +/** + * Check if the view path exists. + * + * @return {Boolean} + * @api public + */ + +View.prototype.__defineGetter__('exists', function(){ + try { + stat(this.path); + return true; + } catch (err) { + return false; + } +}); + +/** + * Resolve view engine. + * + * @return {String} + * @api private + */ + +View.prototype.resolveEngine = function(){ + // Explicit + if (~this.basename.indexOf('.')) return extname(this.basename).substr(1); + // Inherit from parent + if (this.parent) return this.parent.engine; + // Default + return this.defaultEngine; +}; + +/** + * Resolve view path. + * + * @return {String} + * @api private + */ + +View.prototype.resolvePath = function(){ + var path = this.view; + // Implicit engine + if (!~this.basename.indexOf('.')) path += this.extension; + // Absolute + if (utils.isAbsolute(path)) return path; + // Relative to parent + if (this.relative && this.parent) return this.parent.dirname + '/' + path; + // Relative to root + return this.root + ? this.root + '/' + path + : path; +}; + +/** + * Get view contents. This is a one-time hit, so we + * can afford to be sync. + * + * @return {String} + * @api public + */ + +View.prototype.__defineGetter__('contents', function(){ + return fs.readFileSync(this.path, 'utf8'); +}); + +/** + * Get template engine api, cache exports to reduce + * require() calls. + * + * @return {Object} + * @api public + */ + +View.prototype.__defineGetter__('templateEngine', function(){ + var ext = this.extension; + return cache[ext] || (cache[ext] = require(this.engine)); +}); + +/** + * Return root path alternative. + * + * @return {String} + * @api public + */ + +View.prototype.__defineGetter__('rootPath', function(){ + this.relative = false; + return this.resolvePath(); +}); + +/** + * Return index path alternative. + * + * @return {String} + * @api public + */ + +View.prototype.__defineGetter__('indexPath', function(){ + return this.dirname + + '/' + this.basename.replace(this.extension, '') + + '/index' + this.extension; +}); + +/** + * Return ..//index path alternative. + * + * @return {String} + * @api public + */ + +View.prototype.__defineGetter__('upIndexPath', function(){ + return this.dirname + '/../' + this.name + '/index' + this.extension; +}); + +/** + * Return _ prefix path alternative + * + * @return {String} + * @api public + */ + +View.prototype.__defineGetter__('prefixPath', function(){ + return this.dirname + '/_' + this.basename; +}); + +/** + * Register the given template engine `exports` + * as `ext`. For example we may wish to map ".html" + * files to jade: + * + * app.register('.html', require('jade')); + * + * or + * + * app.register('html', require('jade')); + * + * This is also useful for libraries that may not + * match extensions correctly. For example my haml.js + * library is installed from npm as "hamljs" so instead + * of layout.hamljs, we can register the engine as ".haml": + * + * app.register('.haml', require('haml-js')); + * + * @param {String} ext + * @param {Object} obj + * @api public + */ + +exports.register = function(ext, exports) { + if ('.' != ext[0]) ext = '.' + ext; + cache[ext] = exports; +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/.npmignore b/usb_auth/node_modules/express/node_modules/connect/.npmignore new file mode 100644 index 0000000..b04a224 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/.npmignore @@ -0,0 +1,11 @@ +*.markdown +*.md +.git* +Makefile +benchmarks/ +docs/ +examples/ +install.sh +support/ +test/ +.DS_Store diff --git a/usb_auth/node_modules/express/node_modules/connect/LICENSE b/usb_auth/node_modules/express/node_modules/connect/LICENSE new file mode 100644 index 0000000..0c5d22d --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2010 Sencha Inc. +Copyright (c) 2011 LearnBoost +Copyright (c) 2011 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/index.js b/usb_auth/node_modules/express/node_modules/connect/index.js new file mode 100644 index 0000000..7477048 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/index.js @@ -0,0 +1,2 @@ + +module.exports = require('./lib/connect'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/cache.js b/usb_auth/node_modules/express/node_modules/connect/lib/cache.js new file mode 100644 index 0000000..4aa026e --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/cache.js @@ -0,0 +1,81 @@ + +/*! + * Connect - Cache + * Copyright(c) 2011 Sencha Inc. + * MIT Licensed + */ + +/** + * Expose `Cache`. + */ + +module.exports = Cache; + +/** + * LRU cache store. + * + * @param {Number} limit + * @api private + */ + +function Cache(limit) { + this.store = {}; + this.keys = []; + this.limit = limit; +} + +/** + * Touch `key`, promoting the object. + * + * @param {String} key + * @param {Number} i + * @api private + */ + +Cache.prototype.touch = function(key, i){ + this.keys.splice(i,1); + this.keys.push(key); +}; + +/** + * Remove `key`. + * + * @param {String} key + * @api private + */ + +Cache.prototype.remove = function(key){ + delete this.store[key]; +}; + +/** + * Get the object stored for `key`. + * + * @param {String} key + * @return {Array} + * @api private + */ + +Cache.prototype.get = function(key){ + return this.store[key]; +}; + +/** + * Add a cache `key`. + * + * @param {String} key + * @return {Array} + * @api private + */ + +Cache.prototype.add = function(key){ + // initialize store + var len = this.keys.push(key); + + // limit reached, invalid LRU + if (len > this.limit) this.remove(this.keys.shift()); + + var arr = this.store[key] = []; + arr.createdAt = new Date; + return arr; +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/connect.js b/usb_auth/node_modules/express/node_modules/connect/lib/connect.js new file mode 100644 index 0000000..7857023 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/connect.js @@ -0,0 +1,106 @@ + +/*! + * Connect + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var HTTPServer = require('./http').Server + , HTTPSServer = require('./https').Server + , fs = require('fs'); + +// node patches + +require('./patch'); + +// expose createServer() as the module + +exports = module.exports = createServer; + +/** + * Framework version. + */ + +exports.version = '1.8.5'; + +/** + * Initialize a new `connect.HTTPServer` with the middleware + * passed to this function. When an object is passed _first_, + * we assume these are the tls options, and return a `connect.HTTPSServer`. + * + * Examples: + * + * An example HTTP server, accepting several middleware. + * + * var server = connect.createServer( + * connect.logger() + * , connect.static(__dirname + '/public') + * ); + * + * An HTTPS server, utilizing the same middleware as above. + * + * var server = connect.createServer( + * { key: key, cert: cert } + * , connect.logger() + * , connect.static(__dirname + '/public') + * ); + * + * Alternatively with connect 1.0 we may omit `createServer()`. + * + * connect( + * connect.logger() + * , connect.static(__dirname + '/public') + * ).listen(3000); + * + * @param {Object|Function} ... + * @return {Server} + * @api public + */ + +function createServer() { + if ('object' == typeof arguments[0]) { + return new HTTPSServer(arguments[0], Array.prototype.slice.call(arguments, 1)); + } else { + return new HTTPServer(Array.prototype.slice.call(arguments)); + } +}; + +// support connect.createServer() + +exports.createServer = createServer; + +// auto-load getters + +exports.middleware = {}; + +/** + * Auto-load bundled middleware with getters. + */ + +fs.readdirSync(__dirname + '/middleware').forEach(function(filename){ + if (/\.js$/.test(filename)) { + var name = filename.substr(0, filename.lastIndexOf('.')); + exports.middleware.__defineGetter__(name, function(){ + return require('./middleware/' + name); + }); + } +}); + +// expose utils + +exports.utils = require('./utils'); + +// expose getters as first-class exports + +exports.utils.merge(exports, exports.middleware); + +// expose constructors + +exports.HTTPServer = HTTPServer; +exports.HTTPSServer = HTTPSServer; + diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/http.js b/usb_auth/node_modules/express/node_modules/connect/lib/http.js new file mode 100644 index 0000000..09898e2 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/http.js @@ -0,0 +1,217 @@ + +/*! + * Connect - HTTPServer + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var http = require('http') + , parse = require('url').parse + , assert = require('assert'); + +// environment + +var env = process.env.NODE_ENV || 'development'; + +/** + * Initialize a new `Server` with the given `middleware`. + * + * Examples: + * + * var server = connect.createServer( + * connect.favicon() + * , connect.logger() + * , connect.static(__dirname + '/public') + * ); + * + * @params {Array} middleware + * @return {Server} + * @api public + */ + +var Server = exports.Server = function HTTPServer(middleware) { + this.stack = []; + middleware.forEach(function(fn){ + this.use(fn); + }, this); + http.Server.call(this, this.handle); +}; + +/** + * Inherit from `http.Server.prototype`. + */ + +Server.prototype.__proto__ = http.Server.prototype; + +/** + * Utilize the given middleware `handle` to the given `route`, + * defaulting to _/_. This "route" is the mount-point for the + * middleware, when given a value other than _/_ the middleware + * is only effective when that segment is present in the request's + * pathname. + * + * For example if we were to mount a function at _/admin_, it would + * be invoked on _/admin_, and _/admin/settings_, however it would + * not be invoked for _/_, or _/posts_. + * + * This is effectively the same as passing middleware to `connect.createServer()`, + * however provides a progressive api. + * + * Examples: + * + * var server = connect.createServer(); + * server.use(connect.favicon()); + * server.use(connect.logger()); + * server.use(connect.static(__dirname + '/public')); + * + * If we wanted to prefix static files with _/public_, we could + * "mount" the `static()` middleware: + * + * server.use('/public', connect.static(__dirname + '/public')); + * + * This api is chainable, meaning the following is valid: + * + * connect.createServer() + * .use(connect.favicon()) + * .use(connect.logger()) + * .use(connect.static(__dirname + '/public')) + * .listen(3000); + * + * @param {String|Function} route or handle + * @param {Function} handle + * @return {Server} + * @api public + */ + +Server.prototype.use = function(route, handle){ + this.route = '/'; + + // default route to '/' + if ('string' != typeof route) { + handle = route; + route = '/'; + } + + // wrap sub-apps + if ('function' == typeof handle.handle) { + var server = handle; + server.route = route; + handle = function(req, res, next) { + server.handle(req, res, next); + }; + } + + // wrap vanilla http.Servers + if (handle instanceof http.Server) { + handle = handle.listeners('request')[0]; + } + + // normalize route to not trail with slash + if ('/' == route[route.length - 1]) { + route = route.substr(0, route.length - 1); + } + + // add the middleware + this.stack.push({ route: route, handle: handle }); + + // allow chaining + return this; +}; + +/** + * Handle server requests, punting them down + * the middleware stack. + * + * @api private + */ + +Server.prototype.handle = function(req, res, out) { + var writeHead = res.writeHead + , stack = this.stack + , removed = '' + , index = 0; + + function next(err) { + var layer, path, c; + req.url = removed + req.url; + req.originalUrl = req.originalUrl || req.url; + removed = ''; + + layer = stack[index++]; + + // all done + if (!layer || res.headerSent) { + // but wait! we have a parent + if (out) return out(err); + + // error + if (err) { + var msg = 'production' == env + ? 'Internal Server Error' + : err.stack || err.toString(); + + // output to stderr in a non-test env + if ('test' != env) console.error(err.stack || err.toString()); + + // unable to respond + if (res.headerSent) return req.socket.destroy(); + + res.statusCode = 500; + res.setHeader('Content-Type', 'text/plain'); + if ('HEAD' == req.method) return res.end(); + res.end(msg); + } else { + res.statusCode = 404; + res.setHeader('Content-Type', 'text/plain'); + if ('HEAD' == req.method) return res.end(); + res.end('Cannot ' + req.method + ' ' + req.url); + } + return; + } + + try { + path = parse(req.url).pathname; + if (undefined == path) path = '/'; + + // skip this layer if the route doesn't match. + if (0 != path.indexOf(layer.route)) return next(err); + + c = path[layer.route.length]; + if (c && '/' != c && '.' != c) return next(err); + + // Call the layer handler + // Trim off the part of the url that matches the route + removed = layer.route; + req.url = req.url.substr(removed.length); + + // Ensure leading slash + if ('/' != req.url[0]) req.url = '/' + req.url; + + var arity = layer.handle.length; + if (err) { + if (arity === 4) { + layer.handle(err, req, res, next); + } else { + next(err); + } + } else if (arity < 4) { + layer.handle(req, res, next); + } else { + next(); + } + } catch (e) { + if (e instanceof assert.AssertionError) { + console.error(e.stack + '\n'); + next(e); + } else { + next(e); + } + } + } + next(); +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/https.js b/usb_auth/node_modules/express/node_modules/connect/lib/https.js new file mode 100644 index 0000000..9b09fa4 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/https.js @@ -0,0 +1,47 @@ + +/*! + * Connect - HTTPServer + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var HTTPServer = require('./http').Server + , https = require('https'); + +/** + * Initialize a new `Server` with the given + *`options` and `middleware`. The HTTPS api + * is identical to the [HTTP](http.html) server, + * however TLS `options` must be provided before + * passing in the optional middleware. + * + * @params {Object} options + * @params {Array} middleawre + * @return {Server} + * @api public + */ + +var Server = exports.Server = function HTTPSServer(options, middleware) { + this.stack = []; + middleware.forEach(function(fn){ + this.use(fn); + }, this); + https.Server.call(this, options, this.handle); +}; + +/** + * Inherit from `http.Server.prototype`. + */ + +Server.prototype.__proto__ = https.Server.prototype; + +// mixin HTTPServer methods + +Object.keys(HTTPServer.prototype).forEach(function(method){ + Server.prototype[method] = HTTPServer.prototype[method]; +}); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/index.js b/usb_auth/node_modules/express/node_modules/connect/lib/index.js new file mode 100644 index 0000000..77b14c3 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/index.js @@ -0,0 +1,46 @@ + +/** + * # Connect + * + * Connect is a middleware framework for node, + * shipping with over 11 bundled middleware and a rich choice of + * [3rd-party middleware](https://github.com/senchalabs/connect/wiki). + * + * Installation: + * + * $ npm install connect + * + * API: + * + * - [connect](connect.html) general + * - [http](http.html) http server + * - [https](https.html) https server + * + * Middleware: + * + * - [logger](middleware-logger.html) request logger with custom format support + * - [csrf](middleware-csrf.html) Cross-site request forgery protection + * - [basicAuth](middleware-basicAuth.html) basic http authentication + * - [bodyParser](middleware-bodyParser.html) extensible request body parser + * - [cookieParser](middleware-cookieParser.html) cookie parser + * - [session](middleware-session.html) session management support with bundled [MemoryStore](middleware-session-memory.html) + * - [compiler](middleware-compiler.html) static asset compiler (sass, less, coffee-script, etc) + * - [methodOverride](middleware-methodOverride.html) faux HTTP method support + * - [responseTime](middleware-responseTime.html) calculates response-time and exposes via X-Response-Time + * - [router](middleware-router.html) provides rich Sinatra / Express-like routing + * - [staticCache](middleware-staticCache.html) memory cache layer for the static() middleware + * - [static](middleware-static.html) streaming static file server supporting `Range` and more + * - [directory](middleware-directory.html) directory listing middleware + * - [vhost](middleware-vhost.html) virtual host sub-domain mapping middleware + * - [favicon](middleware-favicon.html) efficient favicon server (with default icon) + * - [limit](middleware-limit.html) limit the bytesize of request bodies + * - [profiler](middleware-profiler.html) request profiler reporting response-time, memory usage, etc + * - [query](middleware-query.html) automatic querystring parser, populating `req.query` + * - [errorHandler](middleware-errorHandler.html) flexible error handler + * + * Internals: + * + * - connect [utilities](utils.html) + * - node monkey [patches](patch.html) + * + */ \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js new file mode 100644 index 0000000..3ff472b --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js @@ -0,0 +1,93 @@ + +/*! + * Connect - basicAuth + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var utils = require('../utils') + , unauthorized = utils.unauthorized + , badRequest = utils.badRequest; + +/** + * Enfore basic authentication by providing a `callback(user, pass)`, + * which must return `true` in order to gain access. Alternatively an async + * method is provided as well, invoking `callback(user, pass, callback)`. Populates + * `req.remoteUser`. The final alternative is simply passing username / password + * strings. + * + * Examples: + * + * connect(connect.basicAuth('username', 'password')); + * + * connect( + * connect.basicAuth(function(user, pass){ + * return 'tj' == user & 'wahoo' == pass; + * }) + * ); + * + * connect( + * connect.basicAuth(function(user, pass, fn){ + * User.authenticate({ user: user, pass: pass }, fn); + * }) + * ); + * + * @param {Function|String} callback or username + * @param {String} realm + * @api public + */ + +module.exports = function basicAuth(callback, realm) { + var username, password; + + // user / pass strings + if ('string' == typeof callback) { + username = callback; + password = realm; + if ('string' != typeof password) throw new Error('password argument required'); + realm = arguments[2]; + callback = function(user, pass){ + return user == username && pass == password; + } + } + + realm = realm || 'Authorization Required'; + + return function(req, res, next) { + var authorization = req.headers.authorization; + + if (req.remoteUser) return next(); + if (!authorization) return unauthorized(res, realm); + + var parts = authorization.split(' ') + , scheme = parts[0] + , credentials = new Buffer(parts[1], 'base64').toString().split(':'); + + if ('Basic' != scheme) return badRequest(res); + + // async + if (callback.length >= 3) { + var pause = utils.pause(req); + callback(credentials[0], credentials[1], function(err, user){ + if (err || !user) return unauthorized(res, realm); + req.remoteUser = user; + next(); + pause.resume(); + }); + // sync + } else { + if (callback(credentials[0], credentials[1])) { + req.remoteUser = credentials[0]; + next(); + } else { + unauthorized(res, realm); + } + } + } +}; + diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js new file mode 100644 index 0000000..a52568c --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js @@ -0,0 +1,196 @@ + +/*! + * Connect - bodyParser + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var qs = require('qs') + , formidable = require('formidable'); + +/** + * Extract the mime type from the given request's + * _Content-Type_ header. + * + * @param {IncomingMessage} req + * @return {String} + * @api private + */ + +function mime(req) { + var str = req.headers['content-type'] || ''; + return str.split(';')[0]; +} + +/** + * Parse request bodies. + * + * By default _application/json_, _application/x-www-form-urlencoded_, + * and _multipart/form-data_ are supported, however you may map `connect.bodyParser.parse[contentType]` + * to a function receiving `(req, options, callback)`. + * + * Examples: + * + * connect.createServer( + * connect.bodyParser() + * , function(req, res) { + * res.end('viewing user ' + req.body.user.name); + * } + * ); + * + * $ curl -d 'user[name]=tj' http://localhost/ + * $ curl -d '{"user":{"name":"tj"}}' -H "Content-Type: application/json" http://localhost/ + * + * Multipart req.files: + * + * As a security measure files are stored in a separate object, stored + * as `req.files`. This prevents attacks that may potentially alter + * filenames, and depending on the application gain access to restricted files. + * + * Multipart configuration: + * + * The `options` passed are provided to each parser function. + * The _multipart/form-data_ parser merges these with formidable's + * IncomingForm object, allowing you to tweak the upload directory, + * size limits, etc. For example you may wish to retain the file extension + * and change the upload directory: + * + * server.use(bodyParser({ uploadDir: '/www/mysite.com/uploads' })); + * + * View [node-formidable](https://github.com/felixge/node-formidable) for more information. + * + * If you wish to use formidable directly within your app, and do not + * desire this behaviour for multipart requests simply remove the + * parser: + * + * delete connect.bodyParser.parse['multipart/form-data']; + * + * Or + * + * delete express.bodyParser.parse['multipart/form-data']; + * + * @param {Object} options + * @return {Function} + * @api public + */ + +exports = module.exports = function bodyParser(options){ + options = options || {}; + return function bodyParser(req, res, next) { + if (req.body) return next(); + req.body = {}; + + if ('GET' == req.method || 'HEAD' == req.method) return next(); + var parser = exports.parse[mime(req)]; + if (parser) { + parser(req, options, next); + } else { + next(); + } + } +}; + +/** + * Parsers. + */ + +exports.parse = {}; + +/** + * Parse application/x-www-form-urlencoded. + */ + +exports.parse['application/x-www-form-urlencoded'] = function(req, options, fn){ + var buf = ''; + req.setEncoding('utf8'); + req.on('data', function(chunk){ buf += chunk }); + req.on('end', function(){ + try { + req.body = buf.length + ? qs.parse(buf) + : {}; + fn(); + } catch (err){ + fn(err); + } + }); +}; + +/** + * Parse application/json. + */ + +exports.parse['application/json'] = function(req, options, fn){ + var buf = ''; + req.setEncoding('utf8'); + req.on('data', function(chunk){ buf += chunk }); + req.on('end', function(){ + try { + req.body = buf.length + ? JSON.parse(buf) + : {}; + fn(); + } catch (err){ + fn(err); + } + }); +}; + +/** + * Parse multipart/form-data. + * + * TODO: make multiple support optional + * TODO: revisit "error" flag if it's a formidable bug + */ + +exports.parse['multipart/form-data'] = function(req, options, fn){ + var form = new formidable.IncomingForm + , data = {} + , files = {} + , done; + + Object.keys(options).forEach(function(key){ + form[key] = options[key]; + }); + + function ondata(name, val, data){ + if (Array.isArray(data[name])) { + data[name].push(val); + } else if (data[name]) { + data[name] = [data[name], val]; + } else { + data[name] = val; + } + } + + form.on('field', function(name, val){ + ondata(name, val, data); + }); + + form.on('file', function(name, val){ + ondata(name, val, files); + }); + + form.on('error', function(err){ + fn(err); + done = true; + }); + + form.on('end', function(){ + if (done) return; + try { + req.body = qs.parse(data); + req.files = qs.parse(files); + fn(); + } catch (err) { + fn(err); + } + }); + + form.parse(req); +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/compiler.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/compiler.js new file mode 100644 index 0000000..dc4dd66 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/compiler.js @@ -0,0 +1,163 @@ + +/*! + * Connect - compiler + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var fs = require('fs') + , path = require('path') + , parse = require('url').parse; + +/** + * Require cache. + */ + +var cache = {}; + +/** + * Setup compiler. + * + * Options: + * + * - `src` Source directory, defaults to **CWD**. + * - `dest` Destination directory, defaults `src`. + * - `enable` Array of enabled compilers. + * + * Compilers: + * + * - `sass` Compiles sass to css + * - `less` Compiles less to css + * - `coffeescript` Compiles coffee to js + * + * @param {Object} options + * @api public + */ + +exports = module.exports = function compiler(options){ + options = options || {}; + + var srcDir = options.src || process.cwd() + , destDir = options.dest || srcDir + , enable = options.enable; + + if (!enable || enable.length === 0) { + throw new Error('compiler\'s "enable" option is not set, nothing will be compiled.'); + } + + return function compiler(req, res, next){ + if ('GET' != req.method) return next(); + var pathname = parse(req.url).pathname; + for (var i = 0, len = enable.length; i < len; ++i) { + var name = enable[i] + , compiler = compilers[name]; + if (compiler.match.test(pathname)) { + var src = (srcDir + pathname).replace(compiler.match, compiler.ext) + , dest = destDir + pathname; + + // Compare mtimes + fs.stat(src, function(err, srcStats){ + if (err) { + if ('ENOENT' == err.code) { + next(); + } else { + next(err); + } + } else { + fs.stat(dest, function(err, destStats){ + if (err) { + // Oh snap! it does not exist, compile it + if ('ENOENT' == err.code) { + compile(); + } else { + next(err); + } + } else { + // Source has changed, compile it + if (srcStats.mtime > destStats.mtime) { + compile(); + } else { + // Defer file serving + next(); + } + } + }); + } + }); + + // Compile to the destination + function compile() { + fs.readFile(src, 'utf8', function(err, str){ + if (err) { + next(err); + } else { + compiler.compile(str, function(err, str){ + if (err) { + next(err); + } else { + fs.writeFile(dest, str, 'utf8', function(err){ + next(err); + }); + } + }); + } + }); + } + return; + } + } + next(); + }; +}; + +/** + * Bundled compilers: + * + * - [sass](http://github.com/visionmedia/sass.js) to _css_ + * - [less](http://github.com/cloudhead/less.js) to _css_ + * - [coffee](http://github.com/jashkenas/coffee-script) to _js_ + */ + +var compilers = exports.compilers = { + sass: { + match: /\.css$/, + ext: '.sass', + compile: function(str, fn){ + var sass = cache.sass || (cache.sass = require('sass')); + try { + fn(null, sass.render(str)); + } catch (err) { + fn(err); + } + } + }, + less: { + match: /\.css$/, + ext: '.less', + compile: function(str, fn){ + var less = cache.less || (cache.less = require('less')); + try { + less.render(str, fn); + } catch (err) { + fn(err); + } + } + }, + coffeescript: { + match: /\.js$/, + ext: '.coffee', + compile: function(str, fn){ + var coffee = cache.coffee || (cache.coffee = require('coffee-script')); + try { + fn(null, coffee.compile(str)); + } catch (err) { + fn(err); + } + } + } +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js new file mode 100644 index 0000000..d6b69de --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js @@ -0,0 +1,46 @@ + +/*! + * Connect - cookieParser + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var utils = require('./../utils'); + +/** + * Parse _Cookie_ header and populate `req.cookies` + * with an object keyed by the cookie names. + * + * Examples: + * + * connect.createServer( + * connect.cookieParser() + * , function(req, res, next){ + * res.end(JSON.stringify(req.cookies)); + * } + * ); + * + * @return {Function} + * @api public + */ + +module.exports = function cookieParser(){ + return function cookieParser(req, res, next) { + var cookie = req.headers.cookie; + if (req.cookies) return next(); + req.cookies = {}; + if (cookie) { + try { + req.cookies = utils.parseCookie(cookie); + } catch (err) { + return next(err); + } + } + next(); + }; +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/csrf.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/csrf.js new file mode 100644 index 0000000..1dcf0d1 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/csrf.js @@ -0,0 +1,105 @@ + +/*! + * Connect - csrf + * Copyright(c) 2011 Sencha Inc. + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var utils = require('../utils') + , crypto = require('crypto'); + +/** + * CRSF protection middleware. + * + * By default this middleware generates a token named "_csrf" + * which should be added to requests which mutate + * state, within a hidden form field, query-string etc. This + * token is validated against the visitor's `req.session._csrf` + * property which is re-generated per request. + * + * The default `value` function checks `req.body` generated + * by the `bodyParser()` middleware, `req.query` generated + * by `query()`, and the "X-CSRF-Token" header field. + * + * This middleware requires session support, thus should be added + * somewhere _below_ `session()` and `cookieParser()`. + * + * Examples: + * + * var form = '\n\ + *
\n\ + * \n\ + * \n\ + * \n\ + * \n\ + *
\n\ + * '; + * + * connect( + * connect.cookieParser() + * , connect.session({ secret: 'keyboard cat' }) + * , connect.bodyParser() + * , connect.csrf() + * + * , function(req, res, next){ + * if ('POST' != req.method) return next(); + * req.session.user = req.body.user; + * next(); + * } + * + * , function(req, res){ + * res.setHeader('Content-Type', 'text/html'); + * var body = form + * .replace('{token}', req.session._csrf) + * .replace('{user}', req.session.user && req.session.user.name || ''); + * res.end(body); + * } + * ).listen(3000); + * + * Options: + * + * - `value` a function accepting the request, returning the token + * + * @param {Object} options + * @api public + */ + +module.exports = function csrf(options) { + var options = options || {} + , value = options.value || defaultValue; + + return function(req, res, next){ + // generate CSRF token + var token = req.session._csrf || (req.session._csrf = utils.uid(24)); + + // ignore GET (for now) + if ('GET' == req.method) return next(); + + // determine value + var val = value(req); + + // check + if (val != token) return utils.forbidden(res); + + next(); + } +}; + +/** + * Default value function, checking the `req.body` + * and `req.query` for the CSRF token. + * + * @param {IncomingMessage} req + * @return {String} + * @api private + */ + +function defaultValue(req) { + return (req.body && req.body._csrf) + || (req.query && req.query._csrf) + || (req.headers['x-csrf-token']); +} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/directory.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/directory.js new file mode 100644 index 0000000..df5b5e6 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/directory.js @@ -0,0 +1,222 @@ + +/*! + * Connect - directory + * Copyright(c) 2011 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +// TODO: icon / style for directories +// TODO: arrow key navigation +// TODO: make icons extensible + +/** + * Module dependencies. + */ + +var fs = require('fs') + , parse = require('url').parse + , utils = require('../utils') + , path = require('path') + , normalize = path.normalize + , extname = path.extname + , join = path.join; + +/** + * Icon cache. + */ + +var cache = {}; + +/** + * Serve directory listings with the given `root` path. + * + * Options: + * + * - `hidden` display hidden (dot) files. Defaults to false. + * - `icons` display icons. Defaults to false. + * - `filter` Apply this filter function to files. Defaults to false. + * + * @param {String} root + * @param {Object} options + * @return {Function} + * @api public + */ + +exports = module.exports = function directory(root, options){ + options = options || {}; + + // root required + if (!root) throw new Error('directory() root path required'); + var hidden = options.hidden + , icons = options.icons + , filter = options.filter + , root = normalize(root); + + return function directory(req, res, next) { + var accept = req.headers.accept || 'text/plain' + , url = parse(req.url) + , dir = decodeURIComponent(url.pathname) + , path = normalize(join(root, dir)) + , originalUrl = parse(req.originalUrl) + , originalDir = decodeURIComponent(originalUrl.pathname) + , showUp = path != root && path != root + '/'; + + // null byte(s) + if (~path.indexOf('\0')) return utils.badRequest(res); + + // malicious path + if (0 != path.indexOf(root)) return utils.forbidden(res); + + // check if we have a directory + fs.stat(path, function(err, stat){ + if (err) return 'ENOENT' == err.code + ? next() + : next(err); + + if (!stat.isDirectory()) return next(); + + // fetch files + fs.readdir(path, function(err, files){ + if (err) return next(err); + if (!hidden) files = removeHidden(files); + if (filter) files = files.filter(filter); + files.sort(); + // content-negotiation + for (var key in exports) { + if (~accept.indexOf(key) || ~accept.indexOf('*/*')) { + exports[key](req, res, files, next, originalDir, showUp, icons); + return; + } + } + utils.notAcceptable(res); + }); + }); + }; +}; + +/** + * Respond with text/html. + */ + +exports.html = function(req, res, files, next, dir, showUp, icons){ + fs.readFile(__dirname + '/../public/directory.html', 'utf8', function(err, str){ + if (err) return next(err); + fs.readFile(__dirname + '/../public/style.css', 'utf8', function(err, style){ + if (err) return next(err); + if (showUp) files.unshift('..'); + str = str + .replace('{style}', style) + .replace('{files}', html(files, dir, icons)) + .replace('{directory}', dir) + .replace('{linked-path}', htmlPath(dir)); + res.setHeader('Content-Type', 'text/html'); + res.setHeader('Content-Length', str.length); + res.end(str); + }); + }); +}; + +/** + * Respond with application/json. + */ + +exports.json = function(req, res, files){ + files = JSON.stringify(files); + res.setHeader('Content-Type', 'application/json'); + res.setHeader('Content-Length', files.length); + res.end(files); +}; + +/** + * Respond with text/plain. + */ + +exports.plain = function(req, res, files){ + files = files.join('\n') + '\n'; + res.setHeader('Content-Type', 'text/plain'); + res.setHeader('Content-Length', files.length); + res.end(files); +}; + +/** + * Map html `dir`, returning a linked path. + */ + +function htmlPath(dir) { + var curr = []; + return dir.split('/').map(function(part){ + curr.push(part); + return '' + part + ''; + }).join(' / '); +} + +/** + * Map html `files`, returning an html unordered list. + */ + +function html(files, dir, useIcons) { + return '
    ' + files.map(function(file){ + var icon = '' + , classes = []; + + if (useIcons && '..' != file) { + icon = icons[extname(file)] || icons.default; + icon = ''; + classes.push('icon'); + } + + return '
  • ' + + icon + file + '
  • '; + + }).join('\n') + '
'; +} + +/** + * Load and cache the given `icon`. + * + * @param {String} icon + * @return {String} + * @api private + */ + +function load(icon) { + if (cache[icon]) return cache[icon]; + return cache[icon] = fs.readFileSync(__dirname + '/../public/icons/' + icon, 'base64'); +} + +/** + * Filter "hidden" `files`, aka files + * beginning with a `.`. + * + * @param {Array} files + * @return {Array} + * @api private + */ + +function removeHidden(files) { + return files.filter(function(file){ + return '.' != file[0]; + }); +} + +/** + * Icon map. + */ + +var icons = { + '.js': 'page_white_code_red.png' + , '.c': 'page_white_c.png' + , '.h': 'page_white_h.png' + , '.cc': 'page_white_cplusplus.png' + , '.php': 'page_white_php.png' + , '.rb': 'page_white_ruby.png' + , '.cpp': 'page_white_cplusplus.png' + , '.swf': 'page_white_flash.png' + , '.pdf': 'page_white_acrobat.png' + , 'default': 'page_white.png' +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js new file mode 100644 index 0000000..f2fc44f --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js @@ -0,0 +1,100 @@ +/*! + * Connect - errorHandler + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var utils = require('../utils') + , url = require('url') + , fs = require('fs'); + +/** + * Flexible error handler, providing (_optional_) stack traces + * and error message responses for requests accepting text, html, + * or json. + * + * Options: + * + * - `showStack`, `stack` respond with both the error message and stack trace. Defaults to `false` + * - `showMessage`, `message`, respond with the exception message only. Defaults to `false` + * - `dumpExceptions`, `dump`, dump exceptions to stderr (without terminating the process). Defaults to `false` + * + * Text: + * + * By default, and when _text/plain_ is accepted a simple stack trace + * or error message will be returned. + * + * JSON: + * + * When _application/json_ is accepted, connect will respond with + * an object in the form of `{ "error": error }`. + * + * HTML: + * + * When accepted connect will output a nice html stack trace. + * + * @param {Object} options + * @return {Function} + * @api public + */ + +exports = module.exports = function errorHandler(options){ + options = options || {}; + + // defaults + var showStack = options.showStack || options.stack + , showMessage = options.showMessage || options.message + , dumpExceptions = options.dumpExceptions || options.dump + , formatUrl = options.formatUrl; + + return function errorHandler(err, req, res, next){ + res.statusCode = 500; + if (dumpExceptions) console.error(err.stack); + if (showStack) { + var accept = req.headers.accept || ''; + // html + if (~accept.indexOf('html')) { + fs.readFile(__dirname + '/../public/style.css', 'utf8', function(e, style){ + fs.readFile(__dirname + '/../public/error.html', 'utf8', function(e, html){ + var stack = (err.stack || '') + .split('\n').slice(1) + .map(function(v){ return '
  • ' + v + '
  • '; }).join(''); + html = html + .replace('{style}', style) + .replace('{stack}', stack) + .replace('{title}', exports.title) + .replace(/\{error\}/g, utils.escape(err.toString())); + res.setHeader('Content-Type', 'text/html'); + res.end(html); + }); + }); + // json + } else if (~accept.indexOf('json')) { + var json = JSON.stringify({ error: err }); + res.setHeader('Content-Type', 'application/json'); + res.end(json); + // plain text + } else { + res.writeHead(500, { 'Content-Type': 'text/plain' }); + res.end(err.stack); + } + } else { + var body = showMessage + ? err.toString() + : 'Internal Server Error'; + res.setHeader('Content-Type', 'text/plain'); + res.end(body); + } + }; +}; + +/** + * Template title. + */ + +exports.title = 'Connect'; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/favicon.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/favicon.js new file mode 100644 index 0000000..8eeafba --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/favicon.js @@ -0,0 +1,76 @@ + +/*! + * Connect - favicon + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var fs = require('fs') + , utils = require('../utils'); + +/** + * Favicon cache. + */ + +var icon; + +/** + * By default serves the connect favicon, or the favicon + * located by the given `path`. + * + * Options: + * + * - `maxAge` cache-control max-age directive, defaulting to 1 day + * + * Examples: + * + * connect.createServer( + * connect.favicon() + * ); + * + * connect.createServer( + * connect.favicon(__dirname + '/public/favicon.ico') + * ); + * + * @param {String} path + * @param {Object} options + * @return {Function} + * @api public + */ + +module.exports = function favicon(path, options){ + var options = options || {} + , path = path || __dirname + '/../public/favicon.ico' + , maxAge = options.maxAge || 86400000; + + return function favicon(req, res, next){ + if ('/favicon.ico' == req.url) { + if (icon) { + res.writeHead(200, icon.headers); + res.end(icon.body); + } else { + fs.readFile(path, function(err, buf){ + if (err) return next(err); + icon = { + headers: { + 'Content-Type': 'image/x-icon' + , 'Content-Length': buf.length + , 'ETag': '"' + utils.md5(buf) + '"' + , 'Cache-Control': 'public, max-age=' + (maxAge / 1000) + }, + body: buf + }; + res.writeHead(200, icon.headers); + res.end(icon.body); + }); + } + } else { + next(); + } + }; +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/limit.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/limit.js new file mode 100644 index 0000000..4dafdd3 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/limit.js @@ -0,0 +1,82 @@ + +/*! + * Connect - limit + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Limit request bodies to the given size in `bytes`. + * + * A string representation of the bytesize may also be passed, + * for example "5mb", "200kb", "1gb", etc. + * + * Examples: + * + * var server = connect( + * connect.limit('5.5mb') + * ).listen(3000); + * + * TODO: pause EV_READ + * + * @param {Number|String} bytes + * @return {Function} + * @api public + */ + +module.exports = function limit(bytes){ + if ('string' == typeof bytes) bytes = parse(bytes); + if ('number' != typeof bytes) throw new Error('limit() bytes required'); + return function limit(req, res, next){ + var received = 0 + , len = req.headers['content-length'] + ? parseInt(req.headers['content-length'], 10) + : null; + + // deny the request + function deny() { + req.destroy(); + } + + // self-awareness + if (req._limit) return next(); + req._limit = true; + + // limit by content-length + if (len && len > bytes) { + res.statusCode = 413; + res.end('Request Entity Too Large'); + return; + } + + // limit + req.on('data', function(chunk){ + received += chunk.length; + if (received > bytes) deny(); + }); + + next(); + }; +}; + +/** + * Parse byte `size` string. + * + * @param {String} size + * @return {Number} + * @api private + */ + +function parse(size) { + var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb)$/) + , n = parseFloat(parts[1]) + , type = parts[2]; + + var map = { + kb: 1024 + , mb: 1024 * 1024 + , gb: 1024 * 1024 * 1024 + }; + + return map[type] * n; +} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/logger.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/logger.js new file mode 100644 index 0000000..75cc5aa --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/logger.js @@ -0,0 +1,299 @@ + +/*! + * Connect - logger + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Log buffer. + */ + +var buf = []; + +/** + * Default log buffer duration. + */ + +var defaultBufferDuration = 1000; + +/** + * Log requests with the given `options` or a `format` string. + * + * Options: + * + * - `format` Format string, see below for tokens + * - `stream` Output stream, defaults to _stdout_ + * - `buffer` Buffer duration, defaults to 1000ms when _true_ + * - `immediate` Write log line on request instead of response (for response times) + * + * Tokens: + * + * - `:req[header]` ex: `:req[Accept]` + * - `:res[header]` ex: `:res[Content-Length]` + * - `:http-version` + * - `:response-time` + * - `:remote-addr` + * - `:date` + * - `:method` + * - `:url` + * - `:referrer` + * - `:user-agent` + * - `:status` + * + * Formats: + * + * Pre-defined formats that ship with connect: + * + * - `default` ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"' + * - `short` ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms' + * - `tiny` ':method :url :status :res[content-length] - :response-time ms' + * - `dev` concise output colored by response status for development use + * + * Examples: + * + * connect.logger() // default + * connect.logger('short') + * connect.logger('tiny') + * connect.logger('dev') + * connect.logger(':method :url - :referrer') + * connect.logger(':req[content-type] -> :res[content-type]') + * connect.logger(function(req, res){ return 'some format string' }) + * + * Defining Tokens: + * + * To define a token, simply invoke `connect.logger.token()` with the + * name and a callback function. The value returned is then available + * as ":type" in this case. + * + * connect.logger.token('type', function(req, res){ return req.headers['content-type']; }) + * + * Defining Formats: + * + * All default formats are defined this way, however it's public API as well: + * + * connect.logger.format('name', 'string or function') + * + * @param {String|Function|Object} format or options + * @return {Function} + * @api public + */ + +exports = module.exports = function logger(options) { + if ('object' == typeof options) { + options = options || {}; + } else if (options) { + options = { format: options }; + } else { + options = {}; + } + + // output on request instead of response + var immediate = options.immediate; + + // format name + var fmt = exports[options.format] || options.format || exports.default; + + // compile format + if ('function' != typeof fmt) fmt = compile(fmt); + + // options + var stream = options.stream || process.stdout + , buffer = options.buffer; + + // buffering support + if (buffer) { + var realStream = stream + , interval = 'number' == typeof buffer + ? buffer + : defaultBufferDuration; + + // flush interval + setInterval(function(){ + if (buf.length) { + realStream.write(buf.join(''), 'ascii'); + buf.length = 0; + } + }, interval); + + // swap the stream + stream = { + write: function(str){ + buf.push(str); + } + }; + } + + return function logger(req, res, next) { + req._startTime = new Date; + + // mount safety + if (req._logging) return next(); + + // flag as logging + req._logging = true; + + // immediate + if (immediate) { + var line = fmt(exports, req, res); + if (null == line) return; + stream.write(line + '\n', 'ascii'); + } else { + // proxy end to output loggging + var end = res.end; + res.end = function(chunk, encoding){ + res.end = end; + res.end(chunk, encoding); + var line = fmt(exports, req, res); + if (null == line) return; + stream.write(line + '\n', 'ascii'); + }; + } + + + next(); + }; +}; + +/** + * Compile `fmt` into a function. + * + * @param {String} fmt + * @return {Function} + * @api private + */ + +function compile(fmt) { + fmt = fmt.replace(/"/g, '\\"'); + var js = ' return "' + fmt.replace(/:([-\w]{2,})(?:\[([^\]]+)\])?/g, function(_, name, arg){ + return '"\n + (tokens["' + name + '"](req, res, "' + arg + '") || "-") + "'; + }) + '";' + return new Function('tokens, req, res', js); +}; + +/** + * Define a token function with the given `name`, + * and callback `fn(req, res)`. + * + * @param {String} name + * @param {Function} fn + * @return {Object} exports for chaining + * @api public + */ + +exports.token = function(name, fn) { + exports[name] = fn; + return this; +}; + +/** + * Define a `fmt` with the given `name`. + * + * @param {String} name + * @param {String|Function} fmt + * @return {Object} exports for chaining + * @api public + */ + +exports.format = function(name, str){ + exports[name] = str; + return this; +}; + +// default format + +exports.format('default', ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'); + +// short format + +exports.format('short', ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms'); + +// tiny format + +exports.format('tiny', ':method :url :status :res[content-length] - :response-time ms'); + +// dev (colored) + +exports.format('dev', function(tokens, req, res){ + var status = res.statusCode + , color = 32; + + if (status >= 500) color = 31 + else if (status >= 400) color = 33 + else if (status >= 300) color = 36; + + return '\033[90m' + req.method + + ' ' + req.originalUrl + ' ' + + '\033[' + color + 'm' + res.statusCode + + ' \033[90m' + + (new Date - req._startTime) + + 'ms\033[0m'; +}); + +// request url + +exports.token('url', function(req){ + return req.originalUrl; +}); + +// request method + +exports.token('method', function(req){ + return req.method; +}); + +// response time in milliseconds + +exports.token('response-time', function(req){ + return new Date - req._startTime; +}); + +// UTC date + +exports.token('date', function(){ + return new Date().toUTCString(); +}); + +// response status code + +exports.token('status', function(req, res){ + return res.statusCode; +}); + +// normalized referrer + +exports.token('referrer', function(req){ + return req.headers['referer'] || req.headers['referrer']; +}); + +// remote address + +exports.token('remote-addr', function(req){ + return req.socket && (req.socket.remoteAddress || (req.socket.socket && req.socket.socket.remoteAddress)); +}); + +// HTTP version + +exports.token('http-version', function(req){ + return req.httpVersionMajor + '.' + req.httpVersionMinor; +}); + +// UA string + +exports.token('user-agent', function(req){ + return req.headers['user-agent']; +}); + +// request header + +exports.token('req', function(req, res, field){ + return req.headers[field.toLowerCase()]; +}); + +// response header + +exports.token('res', function(req, res, field){ + return (res._headers || {})[field.toLowerCase()]; +}); + diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js new file mode 100644 index 0000000..db4e9f3 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js @@ -0,0 +1,38 @@ + +/*! + * Connect - methodOverride + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Provides faux HTTP method support. + * + * Pass an optional `key` to use when checking for + * a method override, othewise defaults to _\_method_. + * The original method is available via `req.originalMethod`. + * + * @param {String} key + * @return {Function} + * @api public + */ + +module.exports = function methodOverride(key){ + key = key || "_method"; + return function methodOverride(req, res, next) { + req.originalMethod = req.originalMethod || req.method; + + // req.body + if (req.body && key in req.body) { + req.method = req.body[key].toUpperCase(); + delete req.body[key]; + // check X-HTTP-Method-Override + } else if (req.headers['x-http-method-override']) { + req.method = req.headers['x-http-method-override'].toUpperCase(); + } + + next(); + }; +}; + diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/profiler.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/profiler.js new file mode 100644 index 0000000..b0b5bac --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/profiler.js @@ -0,0 +1,100 @@ + +/*! + * Connect - profiler + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Profile the duration of a request. + * + * Typically this middleware should be utilized + * _above_ all others, as it proxies the `res.end()` + * method, being first allows it to encapsulate all + * other middleware. + * + * Example Output: + * + * GET / + * response time 2ms + * memory rss 52.00kb + * memory vsize 2.07mb + * heap before 3.76mb / 8.15mb + * heap after 3.80mb / 8.15mb + * + * @api public + */ + +module.exports = function profiler(){ + return function(req, res, next){ + var end = res.end + , start = snapshot(); + + // state snapshot + function snapshot() { + return { + mem: process.memoryUsage() + , time: new Date + }; + } + + // proxy res.end() + res.end = function(data, encoding){ + res.end = end; + res.end(data, encoding); + compare(req, start, snapshot()) + }; + + next(); + } +}; + +/** + * Compare `start` / `end` snapshots. + * + * @param {IncomingRequest} req + * @param {Object} start + * @param {Object} end + * @api private + */ + +function compare(req, start, end) { + console.log(); + row(req.method, req.url); + row('response time:', (end.time - start.time) + 'ms'); + row('memory rss:', formatBytes(end.mem.rss - start.mem.rss)); + row('memory vsize:', formatBytes(end.mem.vsize - start.mem.vsize)); + row('heap before:', formatBytes(start.mem.heapUsed) + ' / ' + formatBytes(start.mem.heapTotal)); + row('heap after:', formatBytes(end.mem.heapUsed) + ' / ' + formatBytes(end.mem.heapTotal)); + console.log(); +} + +/** + * Row helper + * + * @param {String} key + * @param {String} val + * @api private + */ + +function row(key, val) { + console.log(' \033[90m%s\033[0m \033[36m%s\033[0m', key, val); +} + +/** + * Format byte-size. + * + * @param {Number} bytes + * @return {String} + * @api private + */ + +function formatBytes(bytes) { + var kb = 1024 + , mb = 1024 * kb + , gb = 1024 * mb; + if (bytes < kb) return bytes + 'b'; + if (bytes < mb) return (bytes / kb).toFixed(2) + 'kb'; + if (bytes < gb) return (bytes / mb).toFixed(2) + 'mb'; + return (bytes / gb).toFixed(2) + 'gb'; +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/query.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/query.js new file mode 100644 index 0000000..d3b1acd --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/query.js @@ -0,0 +1,40 @@ + +/*! + * Connect - query + * Copyright(c) 2011 TJ Holowaychuk + * Copyright(c) 2011 Sencha Inc. + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var qs = require('qs') + , parse = require('url').parse; + +/** + * Automatically parse the query-string when available, + * populating the `req.query` object. + * + * Examples: + * + * connect( + * connect.query() + * , function(req, res){ + * res.end(JSON.stringify(req.query)); + * } + * ).listen(3000); + * + * @return {Function} + * @api public + */ + +module.exports = function query(){ + return function query(req, res, next){ + req.query = ~req.url.indexOf('?') + ? qs.parse(parse(req.url).query) + : {}; + next(); + }; +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/responseTime.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/responseTime.js new file mode 100644 index 0000000..2b2133a --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/responseTime.js @@ -0,0 +1,34 @@ + +/*! + * Connect - responseTime + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Adds the `X-Response-Time` header displaying the response + * duration in milliseconds. + * + * @return {Function} + * @api public + */ + +module.exports = function responseTime(){ + return function(req, res, next){ + var writeHead = res.writeHead + , start = new Date; + + if (res._responseTime) return next(); + res._responseTime = true; + + // proxy writeHead to calculate duration + res.writeHead = function(status, headers){ + var duration = new Date - start; + res.setHeader('X-Response-Time', duration + 'ms'); + res.writeHead = writeHead; + res.writeHead(status, headers); + }; + + next(); + }; +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/router.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/router.js new file mode 100644 index 0000000..a07452e --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/router.js @@ -0,0 +1,379 @@ + +/*! + * Connect - router + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var utils = require('../utils') + , parse = require('url').parse; + +/** + * Expose router. + */ + +exports = module.exports = router; + +/** + * Supported HTTP / WebDAV methods. + */ + +var _methods = exports.methods = [ + 'get' + , 'post' + , 'put' + , 'delete' + , 'connect' + , 'options' + , 'trace' + , 'copy' + , 'lock' + , 'mkcol' + , 'move' + , 'propfind' + , 'proppatch' + , 'unlock' + , 'report' + , 'mkactivity' + , 'checkout' + , 'merge' +]; + +/** + * Provides Sinatra and Express-like routing capabilities. + * + * Examples: + * + * connect.router(function(app){ + * app.get('/user/:id', function(req, res, next){ + * // populates req.params.id + * }); + * app.put('/user/:id', function(req, res, next){ + * // populates req.params.id + * }); + * }) + * + * @param {Function} fn + * @return {Function} + * @api public + */ + +function router(fn){ + var self = this + , methods = {} + , routes = {} + , params = {}; + + if (!fn) throw new Error('router provider requires a callback function'); + + // Generate method functions + _methods.forEach(function(method){ + methods[method] = generateMethodFunction(method.toUpperCase()); + }); + + // Alias del -> delete + methods.del = methods.delete; + + // Apply callback to all methods + methods.all = function(){ + var args = arguments; + _methods.forEach(function(name){ + methods[name].apply(this, args); + }); + return self; + }; + + // Register param callback + methods.param = function(name, fn){ + params[name] = fn; + }; + + fn.call(this, methods); + + function generateMethodFunction(name) { + var localRoutes = routes[name] = routes[name] || []; + return function(path, fn){ + var keys = [] + , middleware = []; + + // slice middleware + if (arguments.length > 2) { + middleware = Array.prototype.slice.call(arguments, 1, arguments.length); + fn = middleware.pop(); + middleware = utils.flatten(middleware); + } + + fn.middleware = middleware; + + if (!path) throw new Error(name + ' route requires a path'); + if (!fn) throw new Error(name + ' route ' + path + ' requires a callback'); + var regexp = path instanceof RegExp + ? path + : normalizePath(path, keys); + localRoutes.push({ + fn: fn + , path: regexp + , keys: keys + , orig: path + , method: name + }); + return self; + }; + } + + function router(req, res, next){ + var route + , self = this; + + (function pass(i){ + if (route = match(req, routes, i)) { + var i = 0 + , keys = route.keys; + + req.params = route.params; + + // Param preconditions + (function param(err) { + try { + var key = keys[i++] + , val = req.params[key] + , fn = params[key]; + + if ('route' == err) { + pass(req._route_index + 1); + // Error + } else if (err) { + next(err); + // Param has callback + } else if (fn) { + // Return style + if (1 == fn.length) { + req.params[key] = fn(val); + param(); + // Middleware style + } else { + fn(req, res, param, val); + } + // Finished processing params + } else if (!key) { + // route middleware + i = 0; + (function nextMiddleware(err){ + var fn = route.middleware[i++]; + if ('route' == err) { + pass(req._route_index + 1); + } else if (err) { + next(err); + } else if (fn) { + fn(req, res, nextMiddleware); + } else { + route.call(self, req, res, function(err){ + if (err) { + next(err); + } else { + pass(req._route_index + 1); + } + }); + } + })(); + // More params + } else { + param(); + } + } catch (err) { + next(err); + } + })(); + } else if ('OPTIONS' == req.method) { + options(req, res, routes); + } else { + next(); + } + })(); + }; + + router.remove = function(path, method){ + var fns = router.lookup(path, method); + fns.forEach(function(fn){ + routes[fn.method].splice(fn.index, 1); + }); + }; + + router.lookup = function(path, method, ret){ + ret = ret || []; + + // method specific lookup + if (method) { + method = method.toUpperCase(); + if (routes[method]) { + routes[method].forEach(function(route, i){ + if (path == route.orig) { + var fn = route.fn; + fn.regexp = route.path; + fn.keys = route.keys; + fn.path = route.orig; + fn.method = route.method; + fn.index = i; + ret.push(fn); + } + }); + } + // global lookup + } else { + _methods.forEach(function(method){ + router.lookup(path, method, ret); + }); + } + + return ret; + }; + + router.match = function(url, method, ret){ + var ret = ret || [] + , i = 0 + , fn + , req; + + // method specific matches + if (method) { + method = method.toUpperCase(); + req = { url: url, method: method }; + while (fn = match(req, routes, i)) { + i = req._route_index + 1; + ret.push(fn); + } + // global matches + } else { + _methods.forEach(function(method){ + router.match(url, method, ret); + }); + } + + return ret; + }; + + return router; +} + +/** + * Respond to OPTIONS. + * + * @param {ServerRequest} req + * @param {ServerResponse} req + * @param {Array} routes + * @api private + */ + +function options(req, res, routes) { + var pathname = parse(req.url).pathname + , body = optionsFor(pathname, routes).join(','); + res.writeHead(200, { + 'Content-Length': body.length + , 'Allow': body + }); + res.end(body); +} + +/** + * Return OPTIONS array for the given `path`, matching `routes`. + * + * @param {String} path + * @param {Array} routes + * @return {Array} + * @api private + */ + +function optionsFor(path, routes) { + return _methods.filter(function(method){ + var arr = routes[method.toUpperCase()]; + for (var i = 0, len = arr.length; i < len; ++i) { + if (arr[i].path.test(path)) return true; + } + }).map(function(method){ + return method.toUpperCase(); + }); +} + +/** + * Normalize the given path string, + * returning a regular expression. + * + * An empty array should be passed, + * which will contain the placeholder + * key names. For example "/user/:id" will + * then contain ["id"]. + * + * @param {String} path + * @param {Array} keys + * @return {RegExp} + * @api private + */ + +function normalizePath(path, keys) { + path = path + .concat('/?') + .replace(/\/\(/g, '(?:/') + .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, function(_, slash, format, key, capture, optional){ + keys.push(key); + slash = slash || ''; + return '' + + (optional ? '' : slash) + + '(?:' + + (optional ? slash : '') + + (format || '') + (capture || '([^/]+?)') + ')' + + (optional || ''); + }) + .replace(/([\/.])/g, '\\$1') + .replace(/\*/g, '(.+)'); + return new RegExp('^' + path + '$', 'i'); +} + +/** + * Attempt to match the given request to + * one of the routes. When successful + * a route function is returned. + * + * @param {ServerRequest} req + * @param {Object} routes + * @return {Function} + * @api private + */ + +function match(req, routes, i) { + var captures + , method = req.method + , i = i || 0; + if ('HEAD' == method) method = 'GET'; + if (routes = routes[method]) { + var url = parse(req.url) + , pathname = url.pathname; + for (var len = routes.length; i < len; ++i) { + var route = routes[i] + , fn = route.fn + , path = route.path + , keys = fn.keys = route.keys; + if (captures = path.exec(pathname)) { + fn.method = method; + fn.params = []; + for (var j = 1, len = captures.length; j < len; ++j) { + var key = keys[j-1], + val = typeof captures[j] === 'string' + ? decodeURIComponent(captures[j]) + : captures[j]; + if (key) { + fn.params[key] = val; + } else { + fn.params.push(val); + } + } + req._route_index = i; + return fn; + } + } + } +} diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session.js new file mode 100644 index 0000000..7fbeb18 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session.js @@ -0,0 +1,346 @@ + +/*! + * Connect - session + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Session = require('./session/session') + , MemoryStore = require('./session/memory') + , Cookie = require('./session/cookie') + , Store = require('./session/store') + , utils = require('./../utils') + , parse = require('url').parse + , crypto = require('crypto'); + +// environment + +var env = process.env.NODE_ENV; + +/** + * Expose the middleware. + */ + +exports = module.exports = session; + +/** + * Expose constructors. + */ + +exports.Store = Store; +exports.Cookie = Cookie; +exports.Session = Session; +exports.MemoryStore = MemoryStore; + +/** + * Warning message for `MemoryStore` usage in production. + */ + +var warning = 'Warning: connection.session() MemoryStore is not\n' + + 'designed for a production environment, as it will leak\n' + + 'memory, and obviously only work within a single process.'; + +/** + * Default finger-printing function. + */ + +function defaultFingerprint(req) { + var ua = req.headers['user-agent'] || ''; + return ua.replace(/;?\schromeframe\/[\d\.]+/, ''); +}; + +/** + * Paths to ignore. + */ + +exports.ignore = []; + +/** + * Setup session store with the given `options`. + * + * Session data is _not_ saved in the cookie itself, however + * cookies are used, so we must use the [cookieParser()](middleware-cookieParser.html) + * middleware _before_ `session()`. + * + * Examples: + * + * connect.createServer( + * connect.cookieParser() + * , connect.session({ secret: 'keyboard cat' }) + * ); + * + * Options: + * + * - `key` cookie name defaulting to `connect.sid` + * - `store` Session store instance + * - `fingerprint` Custom fingerprint generating function + * - `cookie` Session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: 14400000 }` + * - `secret` Secret string used to compute hash + * + * Ignore Paths: + * + * By default `/favicon.ico` is the only ignored path, all others + * will utilize sessions, to manipulate the paths ignored, use + * `connect.session.ignore.push('/my/path')`. This works for _full_ + * pathnames only, not segments nor substrings. + * + * connect.session.ignore.push('/robots.txt'); + * + * ## req.session + * + * To store or access session data, simply use the request property `req.session`, + * which is (generally) serialized as JSON by the store, so nested objects + * are typically fine. For example below is a user-specific view counter: + * + * connect( + * connect.cookieParser() + * , connect.session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }}) + * , connect.favicon() + * , function(req, res, next){ + * var sess = req.session; + * if (sess.views) { + * res.setHeader('Content-Type', 'text/html'); + * res.write('

    views: ' + sess.views + '

    '); + * res.write('

    expires in: ' + (sess.cookie.maxAge / 1000) + 's

    '); + * res.end(); + * sess.views++; + * } else { + * sess.views = 1; + * res.end('welcome to the session demo. refresh!'); + * } + * } + * ).listen(3000); + * + * ## Session#regenerate() + * + * To regenerate the session simply invoke the method, once complete + * a new SID and `Session` instance will be initialized at `req.session`. + * + * req.session.regenerate(function(err){ + * // will have a new session here + * }); + * + * ## Session#destroy() + * + * Destroys the session, removing `req.session`, will be re-generated next request. + * + * req.session.destroy(function(err){ + * // cannot access session here + * }); + * + * ## Session#reload() + * + * Reloads the session data. + * + * req.session.reload(function(err){ + * // session updated + * }); + * + * ## Session#save() + * + * Save the session. + * + * req.session.save(function(err){ + * // session saved + * }); + * + * ## Session#touch() + * + * Updates the `.maxAge`, and `.lastAccess` properties. Typically this is + * not necessary to call, as the session middleware does this for you. + * + * ## Session#cookie + * + * Each session has a unique cookie object accompany it. This allows + * you to alter the session cookie per visitor. For example we can + * set `req.session.cookie.expires` to `false` to enable the cookie + * to remain for only the duration of the user-agent. + * + * ## Session#maxAge + * + * Alternatively `req.session.cookie.maxAge` will return the time + * remaining in milliseconds, which we may also re-assign a new value + * to adjust the `.expires` property appropriately. The following + * are essentially equivalent + * + * var hour = 3600000; + * req.session.cookie.expires = new Date(Date.now() + hour); + * req.session.cookie.maxAge = hour; + * + * For example when `maxAge` is set to `60000` (one minute), and 30 seconds + * has elapsed it will return `30000` until the current request has completed, + * at which time `req.session.touch()` is called to update `req.session.lastAccess`, + * and reset `req.session.maxAge` to its original value. + * + * req.session.cookie.maxAge; + * // => 30000 + * + * Session Store Implementation: + * + * Every session store _must_ implement the following methods + * + * - `.get(sid, callback)` + * - `.set(sid, session, callback)` + * - `.destroy(sid, callback)` + * + * Recommended methods include, but are not limited to: + * + * - `.length(callback)` + * - `.clear(callback)` + * + * For an example implementation view the [connect-redis](http://github.com/visionmedia/connect-redis) repo. + * + * @param {Object} options + * @return {Function} + * @api public + */ + +function session(options){ + var options = options || {} + , key = options.key || 'connect.sid' + , secret = options.secret + , store = options.store || new MemoryStore + , fingerprint = options.fingerprint || defaultFingerprint + , cookie = options.cookie; + + // notify user that this store is not + // meant for a production environment + if ('production' == env && store instanceof MemoryStore) { + console.warn(warning); + } + + // ensure secret is present + if (!secret) { + throw new Error('connect.session({ secret: "string" }) required for security'); + } + + // session hashing function + store.hash = function(req, base) { + return crypto + .createHmac('sha256', secret) + .update(base + fingerprint(req)) + .digest('base64') + .replace(/=*$/, ''); + }; + + // generates the new session + store.generate = function(req){ + var base = utils.uid(24); + var sessionID = base + '.' + store.hash(req, base); + req.sessionID = sessionID; + req.session = new Session(req); + req.session.cookie = new Cookie(cookie); + }; + + return function session(req, res, next) { + // self-awareness + if (req.session) return next(); + + // parse url + var url = parse(req.url) + , path = url.pathname; + + // ignorable paths + if (~exports.ignore.indexOf(path)) return next(); + + // expose store + req.sessionStore = store; + + // proxy writeHead() to Set-Cookie + var writeHead = res.writeHead; + res.writeHead = function(status, headers){ + if (req.session) { + var cookie = req.session.cookie; + // only send secure session cookies when there is a secure connection. + // proxySecure is a custom attribute to allow for a reverse proxy + // to handle SSL connections and to communicate to connect over HTTP that + // the incoming connection is secure. + var secured = cookie.secure && (req.connection.encrypted || req.connection.proxySecure); + if (secured || !cookie.secure) { + res.setHeader('Set-Cookie', cookie.serialize(key, req.sessionID)); + } + } + + res.writeHead = writeHead; + return res.writeHead(status, headers); + }; + + // proxy end() to commit the session + var end = res.end; + res.end = function(data, encoding){ + res.end = end; + if (req.session) { + // HACK: ensure Set-Cookie for implicit writeHead() + if (!res._header) res._implicitHeader(); + req.session.resetMaxAge(); + req.session.save(function(){ + res.end(data, encoding); + }); + } else { + res.end(data, encoding); + } + }; + + // session hashing + function hash(base) { + return store.hash(req, base); + } + + // generate the session + function generate() { + store.generate(req); + } + + // get the sessionID from the cookie + req.sessionID = req.cookies[key]; + + // make a new session if the browser doesn't send a sessionID + if (!req.sessionID) { + generate(); + next(); + return; + } + + // check the fingerprint + var parts = req.sessionID.split('.'); + if (parts[1] != hash(parts[0])) { + generate(); + next(); + return; + } + + // generate the session object + var pause = utils.pause(req); + store.get(req.sessionID, function(err, sess){ + // proxy to resume() events + var _next = next; + next = function(err){ + _next(err); + pause.resume(); + } + + // error handling + if (err) { + if ('ENOENT' == err.code) { + generate(); + next(); + } else { + next(err); + } + // no session + } else if (!sess) { + generate(); + next(); + // populate req.session + } else { + store.createSession(req, sess); + next(); + } + }); + }; +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js new file mode 100644 index 0000000..793c2e9 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js @@ -0,0 +1,126 @@ + +/*! + * Connect - session - Cookie + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var utils = require('../../utils'); + +/** + * Initialize a new `Cookie` with the given `options`. + * + * @param {Object} options + * @api private + */ + +var Cookie = module.exports = function Cookie(options) { + this.path = '/'; + this.httpOnly = true; + this.maxAge = 14400000; + if (options) utils.merge(this, options); + this.originalMaxAge = undefined == this.originalMaxAge + ? this.maxAge + : this.originalMaxAge; +}; + +/** + * Prototype. + */ + +Cookie.prototype = { + + /** + * Set expires `date`. + * + * @param {Date} date + * @api public + */ + + set expires(date) { + this._expires = date; + this.originalMaxAge = this.maxAge; + }, + + /** + * Get expires `date`. + * + * @return {Date} + * @api public + */ + + get expires() { + return this._expires; + }, + + /** + * Set expires via max-age in `ms`. + * + * @param {Number} ms + * @api public + */ + + set maxAge(ms) { + this.expires = 'number' == typeof ms + ? new Date(Date.now() + ms) + : ms; + }, + + /** + * Get expires max-age in `ms`. + * + * @return {Number} + * @api public + */ + + get maxAge() { + return this.expires instanceof Date + ? this.expires.valueOf() - Date.now() + : this.expires; + }, + + /** + * Return cookie data object. + * + * @return {Object} + * @api private + */ + + get data() { + return { + originalMaxAge: this.originalMaxAge + , expires: this._expires + , secure: this.secure + , httpOnly: this.httpOnly + , domain: this.domain + , path: this.path + } + }, + + /** + * Return a serialized cookie string. + * + * @return {String} + * @api public + */ + + serialize: function(name, val){ + return utils.serializeCookie(name, val, this.data); + }, + + /** + * Return JSON representation of this cookie. + * + * @return {Object} + * @api private + */ + + toJSON: function(){ + return this.data; + } +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/memory.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/memory.js new file mode 100644 index 0000000..ec569f5 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/memory.js @@ -0,0 +1,131 @@ + +/*! + * Connect - session - MemoryStore + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Store = require('./store') + , utils = require('../../utils') + , Session = require('./session'); + +/** + * Initialize a new `MemoryStore`. + * + * @api public + */ + +var MemoryStore = module.exports = function MemoryStore() { + this.sessions = {}; +}; + +/** + * Inherit from `Store.prototype`. + */ + +MemoryStore.prototype.__proto__ = Store.prototype; + +/** + * Attempt to fetch session by the given `sid`. + * + * @param {String} sid + * @param {Function} fn + * @api public + */ + +MemoryStore.prototype.get = function(sid, fn){ + var self = this; + process.nextTick(function(){ + var expires + , sess = self.sessions[sid]; + if (sess) { + sess = JSON.parse(sess); + expires = 'string' == typeof sess.cookie.expires + ? new Date(sess.cookie.expires) + : sess.cookie.expires; + if (!expires || new Date < expires) { + fn(null, sess); + } else { + self.destroy(sid, fn); + } + } else { + fn(); + } + }); +}; + +/** + * Commit the given `sess` object associated with the given `sid`. + * + * @param {String} sid + * @param {Session} sess + * @param {Function} fn + * @api public + */ + +MemoryStore.prototype.set = function(sid, sess, fn){ + var self = this; + process.nextTick(function(){ + self.sessions[sid] = JSON.stringify(sess); + fn && fn(); + }); +}; + +/** + * Destroy the session associated with the given `sid`. + * + * @param {String} sid + * @api public + */ + +MemoryStore.prototype.destroy = function(sid, fn){ + var self = this; + process.nextTick(function(){ + delete self.sessions[sid]; + fn && fn(); + }); +}; + +/** + * Invoke the given callback `fn` with all active sessions. + * + * @param {Function} fn + * @api public + */ + +MemoryStore.prototype.all = function(fn){ + var arr = [] + , keys = Object.keys(this.sessions); + for (var i = 0, len = keys.length; i < len; ++i) { + arr.push(this.sessions[keys[i]]); + } + fn(null, arr); +}; + +/** + * Clear all sessions. + * + * @param {Function} fn + * @api public + */ + +MemoryStore.prototype.clear = function(fn){ + this.sessions = {}; + fn && fn(); +}; + +/** + * Fetch number of sessions. + * + * @param {Function} fn + * @api public + */ + +MemoryStore.prototype.length = function(fn){ + fn(null, Object.keys(this.sessions).length); +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/session.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/session.js new file mode 100644 index 0000000..4e7e1a6 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/session.js @@ -0,0 +1,137 @@ + +/*! + * Connect - session - Session + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var utils = require('../../utils') + , Cookie = require('./cookie'); + +/** + * Create a new `Session` with the given request and `data`. + * + * @param {IncomingRequest} req + * @param {Object} data + * @api private + */ + +var Session = module.exports = function Session(req, data) { + Object.defineProperty(this, 'req', { value: req }); + Object.defineProperty(this, 'id', { value: req.sessionID }); + if ('object' == typeof data) { + utils.merge(this, data); + } else { + this.lastAccess = Date.now(); + } +}; + +/** + * Update `.lastAccess` timestamp, + * and reset `.cookie.maxAge` to prevent + * the cookie from expiring when the + * session is still active. + * + * @return {Session} for chaining + * @api public + */ + +Session.prototype.touch = function(){ + return this + .resetLastAccess() + .resetMaxAge(); +}; + +/** + * Update `.lastAccess` timestamp. + * + * @return {Session} for chaining + * @api public + */ + +Session.prototype.resetLastAccess = function(){ + this.lastAccess = Date.now(); + return this; +}; + +/** + * Reset `.maxAge` to `.originalMaxAge`. + * + * @return {Session} for chaining + * @api public + */ + +Session.prototype.resetMaxAge = function(){ + this.cookie.maxAge = this.cookie.originalMaxAge; + return this; +}; + +/** + * Save the session data with optional callback `fn(err)`. + * + * @param {Function} fn + * @return {Session} for chaining + * @api public + */ + +Session.prototype.save = function(fn){ + this.req.sessionStore.set(this.id, this, fn || function(){}); + return this; +}; + +/** + * Re-loads the session data _without_ altering + * the maxAge or lastAccess properties. Invokes the + * callback `fn(err)`, after which time if no exception + * has occurred the `req.session` property will be + * a new `Session` object, although representing the + * same session. + * + * @param {Function} fn + * @return {Session} for chaining + * @api public + */ + +Session.prototype.reload = function(fn){ + var req = this.req + , store = this.req.sessionStore; + store.get(this.id, function(err, sess){ + if (err) return fn(err); + if (!sess) return fn(new Error('failed to load session')); + store.createSession(req, sess); + fn(); + }); + return this; +}; + +/** + * Destroy `this` session. + * + * @param {Function} fn + * @return {Session} for chaining + * @api public + */ + +Session.prototype.destroy = function(fn){ + delete this.req.session; + this.req.sessionStore.destroy(this.id, fn); + return this; +}; + +/** + * Regenerate this request's session. + * + * @param {Function} fn + * @return {Session} for chaining + * @api public + */ + +Session.prototype.regenerate = function(fn){ + this.req.sessionStore.regenerate(this.req, fn); + return this; +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/store.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/store.js new file mode 100644 index 0000000..6a3d47d --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/store.js @@ -0,0 +1,87 @@ + +/*! + * Connect - session - Store + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var EventEmitter = require('events').EventEmitter + , Session = require('./session') + , Cookie = require('./cookie') + , utils = require('../../utils'); + +/** + * Initialize abstract `Store`. + * + * @api private + */ + +var Store = module.exports = function Store(options){}; + +/** + * Inherit from `EventEmitter.prototype`. + */ + +Store.prototype.__proto__ = EventEmitter.prototype; + +/** + * Re-generate the given requests's session. + * + * @param {IncomingRequest} req + * @return {Function} fn + * @api public + */ + +Store.prototype.regenerate = function(req, fn){ + var self = this; + this.destroy(req.sessionID, function(err){ + self.generate(req); + fn(err); + }); +}; + +/** + * Load a `Session` instance via the given `sid` + * and invoke the callback `fn(err, sess)`. + * + * @param {String} sid + * @param {Function} fn + * @api public + */ + +Store.prototype.load = function(sid, fn){ + var self = this; + this.get(sid, function(err, sess){ + if (err) return fn(err); + if (!sess) return fn(); + var req = { sessionID: sid, sessionStore: self }; + sess = self.createSession(req, sess, false); + fn(null, sess); + }); +}; + +/** + * Create session from JSON `sess` data. + * + * @param {IncomingRequest} req + * @param {Object} sess + * @return {Session} + * @api private + */ + +Store.prototype.createSession = function(req, sess, update){ + var expires = sess.cookie.expires + , orig = sess.cookie.originalMaxAge + , update = null == update ? true : false; + sess.cookie = new Cookie(sess.cookie); + if ('string' == typeof expires) sess.cookie.expires = new Date(expires); + sess.cookie.originalMaxAge = orig; + req.session = new Session(req, sess); + if (update) req.session.resetLastAccess(); + return req.session; +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/static.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/static.js new file mode 100644 index 0000000..b9c2c86 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/static.js @@ -0,0 +1,225 @@ + +/*! + * Connect - staticProvider + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var fs = require('fs') + , path = require('path') + , join = path.join + , basename = path.basename + , normalize = path.normalize + , utils = require('../utils') + , Buffer = require('buffer').Buffer + , parse = require('url').parse + , mime = require('mime'); + +/** + * Static file server with the given `root` path. + * + * Examples: + * + * var oneDay = 86400000; + * + * connect( + * connect.static(__dirname + '/public') + * ).listen(3000); + * + * connect( + * connect.static(__dirname + '/public', { maxAge: oneDay }) + * ).listen(3000); + * + * Options: + * + * - `maxAge` Browser cache maxAge in milliseconds. defaults to 0 + * - `hidden` Allow transfer of hidden files. defaults to false + * - `redirect` Redirect to trailing "/" when the pathname is a dir + * + * @param {String} root + * @param {Object} options + * @return {Function} + * @api public + */ + +exports = module.exports = function static(root, options){ + options = options || {}; + + // root required + if (!root) throw new Error('static() root path required'); + options.root = root; + + return function static(req, res, next) { + options.path = req.url; + options.getOnly = true; + send(req, res, next, options); + }; +}; + +/** + * Expose mime module. + */ + +exports.mime = mime; + +/** + * Respond with 416 "Requested Range Not Satisfiable" + * + * @param {ServerResponse} res + * @api private + */ + +function invalidRange(res) { + var body = 'Requested Range Not Satisfiable'; + res.setHeader('Content-Type', 'text/plain'); + res.setHeader('Content-Length', body.length); + res.statusCode = 416; + res.end(body); +} + +/** + * Attempt to tranfer the requseted file to `res`. + * + * @param {ServerRequest} + * @param {ServerResponse} + * @param {Function} next + * @param {Object} options + * @api private + */ + +var send = exports.send = function(req, res, next, options){ + options = options || {}; + if (!options.path) throw new Error('path required'); + + // setup + var maxAge = options.maxAge || 0 + , ranges = req.headers.range + , head = 'HEAD' == req.method + , get = 'GET' == req.method + , root = options.root ? normalize(options.root) : null + , redirect = false === options.redirect ? false : true + , getOnly = options.getOnly + , fn = options.callback + , hidden = options.hidden + , done; + + // replace next() with callback when available + if (fn) next = fn; + + // ignore non-GET requests + if (getOnly && !get && !head) return next(); + + // parse url + var url = parse(options.path) + , path = decodeURIComponent(url.pathname) + , type; + + // null byte(s) + if (~path.indexOf('\0')) return utils.badRequest(res); + + // when root is not given, consider .. malicious + if (!root && ~path.indexOf('..')) return utils.forbidden(res); + + // join / normalize from optional root dir + path = normalize(join(root, path)); + + // malicious path + if (root && 0 != path.indexOf(root)) return fn + ? fn(new Error('Forbidden')) + : utils.forbidden(res); + + // index.html support + if (normalize('/') == path[path.length - 1]) path += 'index.html'; + + // "hidden" file + if (!hidden && '.' == basename(path)[0]) return next(); + + fs.stat(path, function(err, stat){ + // mime type + type = mime.lookup(path); + + // ignore ENOENT + if (err) { + if (fn) return fn(err); + return 'ENOENT' == err.code + ? next() + : next(err); + // redirect directory in case index.html is present + } else if (stat.isDirectory()) { + if (!redirect) return next(); + res.statusCode = 301; + res.setHeader('Location', url.pathname + '/'); + res.end('Redirecting to ' + url.pathname + '/'); + return; + } + + // header fields + if (!res.getHeader('Date')) res.setHeader('Date', new Date().toUTCString()); + if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + (maxAge / 1000)); + if (!res.getHeader('Last-Modified')) res.setHeader('Last-Modified', stat.mtime.toUTCString()); + if (!res.getHeader('ETag')) res.setHeader('ETag', utils.etag(stat)); + if (!res.getHeader('content-type')) { + var charset = mime.charsets.lookup(type); + res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); + } + res.setHeader('Accept-Ranges', 'bytes'); + + // conditional GET support + if (utils.conditionalGET(req)) { + if (!utils.modified(req, res)) { + req.emit('static'); + return utils.notModified(res); + } + } + + var opts = {}; + var chunkSize = stat.size; + + // we have a Range request + if (ranges) { + ranges = utils.parseRange(stat.size, ranges); + // valid + if (ranges) { + // TODO: stream options + // TODO: multiple support + opts.start = ranges[0].start; + opts.end = ranges[0].end; + chunkSize = opts.end - opts.start + 1; + res.statusCode = 206; + res.setHeader('Content-Range', 'bytes ' + + opts.start + + '-' + + opts.end + + '/' + + stat.size); + // invalid + } else { + return fn + ? fn(new Error('Requested Range Not Satisfiable')) + : invalidRange(res); + } + } + + res.setHeader('Content-Length', chunkSize); + + // transfer + if (head) return res.end(); + + // stream + var stream = fs.createReadStream(path, opts); + req.emit('static', stream); + stream.pipe(res); + + // callback + if (fn) { + function callback(err) { done || fn(err); done = true } + req.on('close', callback); + stream.on('end', callback); + } + }); +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/staticCache.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/staticCache.js new file mode 100644 index 0000000..9ea8eb7 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/staticCache.js @@ -0,0 +1,175 @@ + +/*! + * Connect - staticCache + * Copyright(c) 2011 Sencha Inc. + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var http = require('http') + , utils = require('../utils') + , Cache = require('../cache') + , url = require('url') + , fs = require('fs'); + +/** + * Enables a memory cache layer on top of + * the `static()` middleware, serving popular + * static files. + * + * By default a maximum of 128 objects are + * held in cache, with a max of 256k each, + * totalling ~32mb. + * + * A Least-Recently-Used (LRU) cache algo + * is implemented through the `Cache` object, + * simply rotating cache objects as they are + * hit. This means that increasingly popular + * objects maintain their positions while + * others get shoved out of the stack and + * garbage collected. + * + * Benchmarks: + * + * static(): 2700 rps + * node-static: 5300 rps + * static() + staticCache(): 7500 rps + * + * Options: + * + * - `maxObjects` max cache objects [128] + * - `maxLength` max cache object length 256kb + * + * @param {Type} name + * @return {Type} + * @api public + */ + +module.exports = function staticCache(options){ + var options = options || {} + , cache = new Cache(options.maxObjects || 128) + , maxlen = options.maxLength || 1024 * 256; + + return function staticCache(req, res, next){ + var path = url.parse(req.url).pathname + , ranges = req.headers.range + , hit = cache.get(path) + , hitCC + , uaCC + , header + , age; + + // cache static + req.on('static', function(stream){ + var headers = res._headers + , cc = utils.parseCacheControl(headers['cache-control'] || '') + , contentLength = headers['content-length'] + , hit; + + // ignore larger files + if (!contentLength || contentLength > maxlen) return; + + // dont cache items we shouldn't be + if ( cc['no-cache'] + || cc['no-store'] + || cc['private'] + || cc['must-revalidate']) return; + + // if already in cache then validate + if (hit = cache.get(path)){ + if (headers.etag == hit[0].etag) { + hit[0].date = new Date; + return; + } else { + cache.remove(path); + } + } + + // validation notifiactions don't contain a steam + if (null == stream) return; + + // add the cache object + var arr = cache.add(path); + arr.push(headers); + + // store the chunks + stream.on('data', function(chunk){ + arr.push(chunk); + }); + + // flag it as complete + stream.on('end', function(){ + arr.complete = true; + }); + }); + + // cache hit, doesnt support range requests + if (hit && hit.complete && !ranges) { + header = utils.merge({}, hit[0]); + header.Age = age = (new Date - new Date(header.date)) / 1000 | 0; + header.date = new Date().toUTCString(); + + // parse cache-controls + hitCC = utils.parseCacheControl(header['cache-control'] || ''); + uaCC = utils.parseCacheControl(req.headers['cache-control'] || ''); + + // check if we must revalidate(bypass) + if (hitCC['no-cache'] || uaCC['no-cache']) return next(); + + // check freshness of entity + if (isStale(hitCC, age) || isStale(uaCC, age)) return next(); + + // conditional GET support + if (utils.conditionalGET(req)) { + if (!utils.modified(req, res, header)) { + header['content-length'] = 0; + res.writeHead(304, header); + return res.end(); + } + } + + // HEAD support + if ('HEAD' == req.method) { + header['content-length'] = 0; + res.writeHead(200, header); + return res.end(); + } + + // respond with cache + res.writeHead(200, header); + + // backpressure + function write(i) { + var buf = hit[i]; + if (!buf) return res.end(); + if (false === res.write(buf)) { + res.once('drain', function(){ + write(++i); + }); + } else { + write(++i); + } + } + + return write(1); + } + + next(); + } +}; + +/** + * Check if cache item is stale + * + * @param {Object} cc + * @param {Number} age + * @return {Boolean} + * @api private + */ + +function isStale(cc, age) { + return cc['max-age'] && cc['max-age'] <= age; +} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/vhost.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/vhost.js new file mode 100644 index 0000000..913d756 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/vhost.js @@ -0,0 +1,44 @@ + +/*! + * Connect - vhost + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Setup vhost for the given `hostname` and `server`. + * + * Examples: + * + * connect( + * connect.vhost('foo.com', + * connect.createServer(...middleware...) + * ), + * connect.vhost('bar.com', + * connect.createServer(...middleware...) + * ) + * ); + * + * @param {String} hostname + * @param {Server} server + * @return {Function} + * @api public + */ + +module.exports = function vhost(hostname, server){ + if (!hostname) throw new Error('vhost hostname required'); + if (!server) throw new Error('vhost server required'); + var regexp = new RegExp('^' + hostname.replace(/[*]/g, '(.*?)') + '$'); + if (server.onvhost) server.onvhost(hostname); + return function vhost(req, res, next){ + if (!req.headers.host) return next(); + var host = req.headers.host.split(':')[0]; + if (req.subdomains = regexp.exec(host)) { + req.subdomains = req.subdomains[0].split('.').slice(0, -1); + server.emit("request", req, res); + } else { + next(); + } + }; +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/patch.js b/usb_auth/node_modules/express/node_modules/connect/lib/patch.js new file mode 100644 index 0000000..a6ff297 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/patch.js @@ -0,0 +1,79 @@ + +/*! + * Connect + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var http = require('http') + , res = http.OutgoingMessage.prototype; + +// original setHeader() + +var setHeader = res.setHeader; + +// original _renderHeaders() + +var _renderHeaders = res._renderHeaders; + +if (res._hasConnectPatch) return; + +/** + * Provide a public "header sent" flag + * until node does. + * + * @return {Boolean} + * @api public + */ + +res.__defineGetter__('headerSent', function(){ + return this._headerSent; +}); + +/** + * Set header `field` to `val`, special-casing + * the `Set-Cookie` field for multiple support. + * + * @param {String} field + * @param {String} val + * @api public + */ + +res.setHeader = function(field, val){ + var key = field.toLowerCase() + , prev; + + // special-case Set-Cookie + if (this._headers && 'set-cookie' == key) { + if (prev = this.getHeader(field)) { + val = Array.isArray(prev) + ? prev.concat(val) + : [prev, val]; + } + // charset + } else if ('content-type' == key && this.charset) { + val += '; charset=' + this.charset; + } + + return setHeader.call(this, field, val); +}; + +/** + * Proxy `res.end()` to expose a 'header' event, + * allowing arbitrary augmentation before the header + * fields are written to the socket. + * + * NOTE: this _only_ supports node's progressive header + * field API aka `res.setHeader()`. + */ + +res._renderHeaders = function(){ + this.emit('header'); + return _renderHeaders.call(this); +}; + +res._hasConnectPatch = true; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/directory.html b/usb_auth/node_modules/express/node_modules/connect/lib/public/directory.html new file mode 100644 index 0000000..15164bb --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/public/directory.html @@ -0,0 +1,75 @@ + + + listing directory {directory} + + + + + +
    +

    {linked-path}

    + {files} +
    + + \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/error.html b/usb_auth/node_modules/express/node_modules/connect/lib/public/error.html new file mode 100644 index 0000000..34e0df5 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/public/error.html @@ -0,0 +1,13 @@ + + + {error} + + + +
    +

    {title}

    +

    500 {error}

    +
      {stack}
    +
    + + \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/favicon.ico b/usb_auth/node_modules/express/node_modules/connect/lib/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..895fc96a76b68b4924f1c51d022e1b82fa0f461f GIT binary patch literal 1406 zcmZQzU<5(|0R}M0U}azs1F|%L7$l?s#Ec9aKoZP=&}i&OouUjIY8@C}uZw4x5z5N2 zvEG^C^vXtt_xtJ?p3O32c(KTx;lsgZhW%5M85Sf}k-mf`L80)|7ga~M{a znlL=>m1Q`#uoPkbC~GtXMnhnDh5$DU1D6mx+;2QAKt3ZQFH}H~1y~00GcqzVg9QXw z_<%(a7y$V|wJgF=E>MgE#Aid|14}IyCM5MhEnxFF;pTzOK(>#80puP=gnOXwAd33` mpMe2}f66m3eB@_fcnmb^7!b1nO#opK8zcsj1F30)+jEP);68^d)m`eN0o>(5%D`Q(1;j>g@G;xlf`0VBQ`PFY?6)!N&f?*K}$p; zB!U=NBn{eB8${1}&-2_L*HuZp@ZP1@clS@cHp)4iM1ewzw59vko7eMM{e9z|%NNdX z0V;`?KKSzTCvTm5bc{L^CIKLUxc2X{i{ISz$8Sgf{q)1nXTP{`{s?9mQ$4&hPiKC- zY8q7(Y1Xu5iCf33=O4Vy(+|zQ?rW#gkKB0f%}?+6{G*qT22|DQB-73`YzA{N4W^=s zq0kQYcbtFfz zLz)H<&|z(Y4kBG67=JY6c|L1R-#TR>fC$3^Y%QEnYO1xHsf)+GU`3F<{J0kR(;pbF3)zyg$H+idfnl-wl5Wkh!vUH z4Z32YP=l_}1rZd1W_D&^$A($A+&a0e&P?xx0!ctY2}*<#p+qPVN*B(YzvAWXa*%bzq z7Fz41LKILT(GWohi9|LgIzSZBhb*Zf6R6O}WYQ4GOi&71s9lmll0x6;8&ILOl$j(c z0Z1T(6Tg09{?wd{moFHNN6PS?$|e>1MxSJ(0Z7o2)J-Zv|>acY@f`(Y@g7GwsEj5NLQo+q|HsxQ5}XSX_d@*^A9ZT9=A{W~j+$GyI1 zc4oqTHx@1FlRjw4XWyPN5i2~l_F3@aBk!0yu^aoRDvXy}8@HCjUVQUsuSH4$T5|r< zzZOn^?Wfa6y|Q($Hx4{ws+)wX6-HP4zo!S?4KJ@7PG@G3G{CjXs(p*kIrj6rHs7_y z+=<-=Q62s9FuWa^X~WKgJIAAZJR&XBB002ovPDHLkV1jCMPILeO literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png new file mode 100755 index 0000000000000000000000000000000000000000..89ee2da0753040d1ba0a3487473a715a8fe89322 GIT binary patch literal 794 zcmV+#1LgdQP)i_t#ewV_0K6;=bl;e_Jt7$~$sQ)q$+ia<4Ec+jeaGt9oWH@O|2`W6&O0t!k{B9sUvLWxkCaPsd9W(`fa z;j-|^ZI^2XnzhgZWYRW-kP&J>DWPo`%;JaBX}or79k=+Jo@h%4Eo72tqev+cB?PjP zO<|ByL#>Tehyq$jR74O$B9WDW1`tK`LzYyL3A9iAcRxLkJ`I)n}v%Od-3H>j$OTBtk>(k-9o?8PqI=0 zB&f-+KOXVnjyKJlf4iHOtnuiE_4+ZVJ$dHjU<^o^YCjQ-wt^!;rPpBv(@pFO{9rdw98 z_s@3+yta93oyfL>7AD5}r=|`zS3Gm$_|(iSl8XBd9k%=91J0j2=ivT5cJ18ZmDjh{ z$-RMd{jQ#X79#Sc literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_code.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_code.png new file mode 100755 index 0000000000000000000000000000000000000000..f7ea90419d950f9e69d977a1f5847456d96a5f0b GIT binary patch literal 818 zcmV-21I_%2P)@LCln44|RX7Ti z0HI3&7jPq){odH{?_{%nYVq_;n_c4WbUpvU(&Cvnj!vq|kVC-vpF6vp^;;e0mm6HW z+WPzA`AZ|;pPp$&dNjzrc??4rt`k%Q1l*u-BPD0MQ}Fbm8jnsyezNt7+u{23>t7Em zJtETY?ja9KrVs^!LJ$xEMF3-bAZO;-IQJavE60KA7fO$VY_%N)R6s>g5mW>fL4&aR z*EVgKKTBXm!=L?S0?xM zYqL@C$|EDF2q*3zWW7;PDZ}SK*IE8;i!3U62=qn80C&*I1Le7WwNP5EcX;_oh2dJn zf#HgBe4@r$GcjHjmj2vAfT%(YN?}kK=(*+1*DkNNc1H5R++vfBMhACi<5uFUU+N4+ z<&U*CPmWi}REa7C6-t>2im1CWv5Jkefxa6>)dEj-CAW wWa{_}BJ!}~75?MkfaCnj>Dn=~vkLS70Pk`;z)@TQj{pDw07*qoM6N<$f@imYHUIzs literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png new file mode 100755 index 0000000000000000000000000000000000000000..195dc6d6c365d298e466026b37c1959d96119ea7 GIT binary patch literal 663 zcmV;I0%-k-P)^@R5;6Z z(>-WZK@^7J_sq=QY_e{46@P+~LNG}sRzZsxQHvCsN*h5ir6^j7pq-$xu$N#V1gx}9 zClV7;5)7zih-s3DB)G=7|99>ji@So7-P24n=VQ(@GctDX!^_@$bj%oviY6e4Dh;od zooe%Wvs8LEKQ&&bL&@bwi=STIAI@!-gB2jC5+?y?VR~VkrNxam-`6*8&po|RZ5LpS zNKdJ%c4bTX`XjKsnecf%W>1%6WT?pKNdLLq{=(f(Col?P1+oq@R>)W(n=x!|*BIIh z6DJGw_w`)u6yN|vAhMteYK5#b%r5^v+VCFl1IGssaclZZMS{vs-LJ2$)n7DAr6==K z<29#%AXsBsDoO}SBaXR#_Ap!JKx)(1)3O2pj0_dYWz5By*X74fRT01$Fk%P_RzOMDtV?GU{nsYq#K8iy zb6qzLYDj`_f5$BwC*WE(t0m#xYJ*=jC2|HQYHh=pf#QG7oowi`h!L!{DB$8|qY{~X zu8@sU1tWq;n$XThR0%;45mdqXM892|{CJ@0DS*}>?ami06Q_^tvM~Y3K(_-`#m!8f z8f!QIrH4y#61;0Ym0cCoLl8{IPombPHtnn7%SbTdI&G-d>ZQo!_wBMF9nzX!g8HVY xYTJPGciz9XMh3w2fmZ(7v{)r*QZD48?mrio{~IaoqP z|1Ep}yDQG09bP~E^Dk?@JiKQJ z6-pO(3~IOP)IYisL6D6;oAEd;E%zR}{U$rMRNuD6nQV7nesKS>)yLo7JuDCrD>Abi zbj3uW23?^GA}9jQ{M^8v?ejL?HaT7AX5WPZNkBmfN`w-jL?{tT7ykZt$%Yln?p_m~ z-?>&d(LD(jAd}h=LPltPQbO$*Wbyl@G-_k5jXbb#qffHY03>M1jfEqoPJQ6Mr=Byp=^jfzePZV1 zLjCmNi31hdIJHa%e;5g=1(`u3BRzfeExY%=VCu{loOr{`%2hUR*x>tL^W_TTaj);0 zpPR6CUD1+0>4TQ6zVfH3TQ;%l6#(_%yspK@3gcmG#Q4!WCPyLU93nMKk7E2pcA=l45({2jNho>sdF*A~bA zxX?-cp~y_z_kFf+yqu3m#QiB}03?Z&9vvR5TNgj<)($Vm)xq5G>|o2sFMag&6aNF+ WAT1?sQBYt20000iHtsh1EzPArg^Q zIZrOk#rNsfjaSbMAL;<4h;Z=jvu8dzyz8N&Nb7=z03ZUw?9z%8KQEa6yM5=kUnka& z3?FJk2}L7q>na=T#;<7U*P91xfF`;`6%pVgWgRy0?1ZryL@%z52=-!fGXWGEn4M351L4<+7eDgwo|moqXT+s1&Kmn>-uQQ8mL7XY)w5Zk*(g+<3Y3tmkR!bL zOUKaUtj_pX26sH+=Iorwu}MGd`_%O-_sS}8VpG#fJA)Fcs#ezwtZf?q?Ac70mDv`rVs{$od?VPKeqf<-kUjNtS6ecB*mq<&M97K^6IVsDO zt2$Ru!b+>2S<}_H>$RcInusU_8PMNdf(W{sNlJ3FkrwMJPeBPO#d}Y^a{9TH(#{Y) l0D?dWAV4eUJX#h`!2gmISk&ZKd4B)^002ovPDHLkV1g&sd|Lnj literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_error.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_error.png new file mode 100755 index 0000000000000000000000000000000000000000..f07f449a44ff2761bfc7b752db3d08d0e1238b02 GIT binary patch literal 793 zcmV+!1LpjRP)lHwhvrAu0-@MQwt}+5~MQTtu}C0%;W( z1<{R?aHBz*g;pk%AyQVBR_Zu5m~;ES_vxI-O!vIF|H*|T{l`n#garr?$RMk>)?Y48 z(ZF2yTneKb};DNWF+jK)IF`6_IfJ{i|F3o%Q+l&4_HGBD|ACE8na_6>L z=s{^>-C(a7J$6=8A_%h5W!1K6dcL!D?XX+Ndk)oei?UundDpX_E&1Y&`)3P8#Ny0s z2Ag7_&ZPhyGj%)g&S6V2LNun1;iBQm#Fwlfv zgyESZR$X}2P;=RW!2zid1r$hBL{K7>2qi*f7>pT1=RdT3@-anEoH{ z={KFOO;Dh#bV*jaN>}M>RZqQd`S=6O9C3KpI~I>l%QFYfo;jqQYe5fcn`)+)zMm6P z4X&L(>gnN0!%J4^rhX->?$S5bY<=GEU%jc!KLL8sww-Eg;h z`H-yBHa)yfojYT}&G*GFc$<(Yja_q=lZvj66DC^O5%$B)|Z(CeD=n`|eM04SP; z>-=-l+xdJjA~vR6^xB#o{ehf~tSM`iwaQv$O<8NIHA}W_WOw*~ XD^gE}t;YAo00000NkvXXu0mjfl6ZQ> literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png new file mode 100755 index 0000000000000000000000000000000000000000..eb6158eb5ca9c4b64c81e70e0fd894dbc8e2bed9 GIT binary patch literal 817 zcmV-11J3-3P)hdKqhFO_H1|Vn1E?(=|cjAh_&P}y{{^`u< zcYD@PK?$)4i~7o9*6F_$F$4lR(d4AAvrez^(88Hk+)+B7E)M3jc=Ewl4$S^`_qwSF zA%qz@=c2EOsz@0qB1IqsqJU)HaG&+}%`-OM8YqW{K85hqj@4&V9vz!Cm_n0-W#f;# zeEpJde%vdgRn5?(+PY=W*z~|lT2-mtown({ll8&3S5+lWz5K}LTRW{k{eJn3Qz!SU zQ`@qI_n2;K?RG~pYJ9=dj-RWgG;P&wEuoAxL~Q)<>x0b=dED^Outj&xQ^rA;u3pw| zca_ClTh_d9cxXg_U!lLRl0`xU@$=UXO|_dRdtXfKwPawmnf(LC7u}-U>8k6}3u|{8 zs9LHr>MIJZGD^r9h|q2yF24Wuh+PM^yMN9GP1$khlDkdyCY}D{kg}jEf-(kW5jBY> z0rB29ZhG-r=i_R{;+1k0?A-sBM;AP6(k1i9ZuixR4?MqXOvphQgCYj~RnXKKL~J9Q zIDNz~XMfO{ZhUg&BTtMyXJqDVqc<x643?SvKHx004lTvR=0a5$dUw z>Xb470000$S;ka1sfH4I-R8njUol7M4dtApOahDylptpYswf1hD#CwFoz6oEA>(SIECU&IQ%a}GXdnC!9$70`0uH1B00000NkvXXu0mjf!8w72 literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_find.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_find.png new file mode 100755 index 0000000000000000000000000000000000000000..2f193889f7ea091c292acdd684c595dcb206b5c4 GIT binary patch literal 879 zcmV-#1CacQP)@+1&aazfGU7ezSm^v zpACwO+tu0su66!(dT=`e05DeeCnCFJW(8|RKtKa{4LGONnx2V85A4m%PEQ?MEtR-esdM$pB-`H542D0)N2zSC6Imf)4L8?>%ZrW+H>xCKi$unm zvGZq-*Q%Aahx;C*=l+K%-?>XB)6TB$-L$r*`RUvlA`xP1NG2?)ge8@TQ4EN|Jks0u zcDg;oFC#-#R`YbWB`D?Q`1#y7l$LXhjSLf8AvQuB84}i#j0^!#g{VE#(K7h@5pFHy zSenl=@XBEdxp`h2Ji>CR%=qXJ7!e|?paKet-~;#ok#jETyeB(5&Bkhp;!+;51~G=) zH?L7xmDUu_h+a$+xuWom;AWW!mS$%%+436Rjc@}y?l1134kgD0AOf$OmjOR zstUlshZk$ZC!bAyIg{Y29z#&@3SJ;6D4+_eFume9^#TmMccC5u0J!ZCTnO6m$lnD| z5JeFHf`Xs~1vP>RLKI1GKDY<~pjr2&bi(fX;6Nj-ss@Ds0CcoO0H{JsEQkm{q03skAA);_bv3q{k31qwVo&s-q`Z?_e+j^w(WL? zl+uETs5+~xBU2};OqEE9ETLGwsMGe1%iTRNue)9}|0~E4B*@5#oRXZ9oRXZ9TqRep zPrGZuoOON4n@=uPbyP1y4G=+HktC6l(gZoFD>@_lXDrN?wo+zozGt3P=Qh+3L7+}q z2!WK7geXLnO3Vw;o12Skp%_E#+N#9;DDWP?Q-VS3B$v~Ha)dDzWn0zG~O(^_1!n0HYp-( z+;wPIdoFgQlpYV!10V>5@a)1LyGBMvoa}miyp(bxbMTM-FYNyx;V@TfYddyT00000 LNkvXXu0mjf90!wr literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_go.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_go.png new file mode 100755 index 0000000000000000000000000000000000000000..80fe1ed0cc75fbb67e9398ae686641f8fb287238 GIT binary patch literal 779 zcmV+m1N8ifP)JNR2Ufr z!Apo%Wf%b9=l#x^8AolrB&K9H?Pg_|78WA8(M3toqE%3B#7*srcF`i*xhupr27%Nr ziguah1+mN)U5GNmyEfQ3-e%_i&-vb-Co#(>FJ+EhQEwjRYVQ(&UYy{U@%vbY||>@4x=B^vIqabI?L* z;-S&DS^V3-ni4^fl|HMkOEbgX)(390>A}|VIypb5Xee4g;7ck zwKh^A3Mi1Mh@eC$5lV!}Fw%sP623U`g3pd_Hr5sunLvTskx4}&Gm%Q6L}(l4x}jCe z*81q1_4-O*ffi~_nMslo?EQ8t*&Ec(pzEw$vc}pKn_Qp0>D7Jr>ATNC3w@9f|Y+U&+)#!t7l&wKp+nP{PQsb+fb=Yf!Fu&5j8vpRj{FT>jD z>d>$sx;A&+`n$HcF}&sYKSyR;=(=9tvvOj@hUG;~4qTYk^_@E=?$*^_pVh_bGnOt~ z;pEw)j{SK$XVc;qy181rT655gW9NG{(yeablViIL>cDI_ux8m>Pp{tY$J0lgo4#ax za?j0EA3s0S!f>{~ykN9h_RhM&g3K(E`q(dE(Rd49+%xMeR9{qlWnmd{s#(SQ>PmFtSQqUjAtB;_Vvt6}AS_5YgM`Uqu`yva+H8^=4U$e4gHb}u zAQ2N{V3A%pO|?Pv?tb6z=jC}SiRa$G^v3q?*6XcYz$p|cq{uLj@#~Fi`J(>5{@&&N zy%T^+;>8cXx%|o77anP?&W1?1A(>-T49z9pyeCl@7YI+Si zKti7=B~``}TImz(G{0PnlQA3P#MAd}sorMjkP!50B7$nAkU^%#nl{Q9lW0@}9fE-> zN(q7tRuiC_T1r|BBtVBTlQ2+70$Rf;eF`Z;lx46Cpu-rEgb)EBKq(b^W8l<^We(`D z43?0=01z<3G6+UUv6`CsWCk6^93!#+<;ws7007{zS3k2k9-zZKFO~(k`>s0y006+1 zgF_jyIhsL-`FMf~JL~C=cV75(CrJ|q;MVO961G=O zm9d)YpJg5g(4i_HKL75eSE}mq$Y}r}hyVdcV~p>6a}oXr80q`oj%+s700000NkvXX Hu0mjfPs|!l literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_key.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_key.png new file mode 100755 index 0000000000000000000000000000000000000000..d6626cb09eb11a298b90a8a27b0d8eab41f49a82 GIT binary patch literal 801 zcmV++1K#|JP)$lC4gU2-`f*>nhR-;k6IP7e>YO!0^w)WK%3$w02v-#>5Ep64PCP| zJihT#O|N+nT7XR2h7dAB?UEAOhJF^mol1i`QtQB`HSY}RE7=r! z)zaVIHr5?>v2Gz&fdYw&2ug$!p+txby(aWZ7(4QT)l2`jX7eMQ{>)lG6ev(fWKxmH zOr%mM5$6B%u~qGtCf40#`mbGj3s!n+^%wnJ&#rl>g<4Z)lB5J6f!?|AP275)Zswr* z%T}4~{;_(?waU!#?JabbF3Cy-kf0{R{z}6$e=5yMQKt3BPcl2>zoTPMqMwF;3!_n|>sT?~bK_-2O_m+o>GJ6h zt=+g$4n7y%1qVJI7*5Yw(hqM=JusY{d}*?U(Oj*gT655eZ>Ksn(qrd7v3}DX1}C>` z+X+8@+4-pVq_fxG zlU}~Ye!0+%>J+pPk+0wV{GM$QaYM?5ux)w2z59=S&H2+K?;gH$bZGzL&g5>G ft+noNiyiPkP9r@8gT|RZ00000NkvXXu0mjfuqTIu literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png new file mode 100755 index 0000000000000000000000000000000000000000..7e568703d6432c530224e443771a04fc1e2e59c6 GIT binary patch literal 839 zcmV-N1GxN&P)73{`^;G#xwAtHz%LU)4b zqTRU=ve1RNa3QT=ZM7C`iJ~QFQ*9t7<~pX$d^7W%^M8FFCkcQj-~0ZRTBCB(J0^iD z-~e!d9LR`f3#|=(>$bPvx_D-~2jC%pJ=n_e_OK zeJ_2b-KdDDh@@UlzBSMC;EPygH_MwjWBnPGQegihBV73D?-x9PlHL9A=(Vg=8^d<4 z<9r=UkxuIm)*CO=9e###7PztDxUv}e?$0)rQicmYhV`pQ%S!g@;K(?TVfhM#E?bM| z=B0gfb6h@a8bf5FVT-SV~6}?X}9lK@@Yynoty&1zdZP@?RfODsl=2XzzU% zS8gIN43How+9%bK2S@Xbc`O>`z5`%^;pXGy8^4f>9^3!Sp@|O&)m;dOa3q6d;4P-l zca|=H_{G&m?D_+&-}r{u-J$5T=(X4R&)q|O^gN8cgv;s#@5sEPT5_Z)oFo9Ac>l+I zc4ng5zHpps|9)<_Rw>5bKzE(M1j)dFWI_%OH$BJSz0?T+02W0)_a>#vFqb!*d|5wB zzBUN|M&ty51O@=i?kiDrjQ{{}e|^rU?OS|RdxxP1p5mAw36cX72#`R6UsoeCQFI~! z0ATITp!vfeYyQ?Dr=^5BAshfEa0nB~JG?nUa2Aur006MC*<9`)86SPS(W^`H2n+xi ztOWohsFfVfVWrI7PSKW}BmkyPoj(-|J?ES|BGd-}fIxr{00@ANnO*ZR`#)pee4I5T Rmm>fG002ovPDHLkV1i|Hc$okI literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_link.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_link.png new file mode 100755 index 0000000000000000000000000000000000000000..312eab0914ab59271384686255d1be913a6b3add GIT binary patch literal 830 zcmV-E1Ht@>P)VWgGzD=Y79#JI$lhEn`|2MpRa?Bt#-nSD~P0P(mbVe{KrOBoKnSsk>m|ML{6l zBosu@om4j#WzNLRAk+{k1JRvL(MfE&vvbb->v>W{*z*1_uMP}0cIRX*?mz+wk%*#O z%0D-+$B*g1nRkvI+_3E8Pr1NC6@5M&4vWaLCnNlr;lNlr4i91z&)eBGqL{L{GNu;Fof}GS9{gM5BJuH;2QWk8yuOZdB3pGR#s8bd~ zAmt<>3Q=YH$t5YJ5;7@+8Uh6=ktBgY6#6Pa%2F?h910?U8cLT43KAj$Z1*==ra&gILO{WkHfs(--F=bly9l~${z@AT>V$oat!YAD@M zBE0v_F{`g#^wOSP-u~!wvlmXdd*uqFqoZ0^{&nEMDU+=!>({S0wrQhFmoB}Yq1)~0 z^{A)L8Xjzdr(W4_exYO6u3a{4*kIeXZMJUR>Q=ksjW_p!rAwDKYUs90>6Q|C>56o@ zbrSq^Xk7Gq#>dAsn@un`Hz$?w$;Ss`%jV7L%9ShgHFV~C)6M>B`Tp%|nqPc&G*A3| z)Qe+}vT4-x^t1~XE@(6wR;^lPWMo9n*~E!cy~)YRsT2{`?fqeIw-e7N@mOA%UcCIq z_kH(_EK7|>pM*1Wt2^DaDAp|cvp*@(ZZDKpYkKC^?97(`0sb&XTXy7N#sB~S07*qo IM6N<$f;YmCWB>pF literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png new file mode 100755 index 0000000000000000000000000000000000000000..246a2f0b426faa0c7f5ba009e32b1deaf88d1288 GIT binary patch literal 813 zcmV+|1JeA7P)otxGRZMDZ!_a~nK|b_-`n%VosaL{KDuPV10`(1LIen8kX2Xff$3BE zah#djvFGJ&eE^89Pk*-O^+&d>FC~^GjRYVQ(uuPJyS|-v?9lxA-+tM5>1Qu*n+Ir1 z6KhA>X4$XDH6?-|E5oe1E?pQ5-M;2xw_ex!x}I2+b=}mPFW$U%^;o(Zg*LP!K^1kP%8ynsD^= z1y^6xD1#GLjO{VLdh@0GKY7;d$+NGukV)GRLPn^=q=dF%B#XaJrNP`0E6=}e&Gj3d zKJbQre*WXt!60_DnIzgMQc6S#fvjXxsE1v7;T;njHkdy2miIqAS(nX~o%cO+q+b#h z5tIleLWvL=dQE8OC#{%y*Tnku&K`Tuub&_ELI0t_ea{@3f>Jv&sYqld(%}3_GY3Dm z;O{3*Y?v^A`a|D;^qrM=ykI)U6QHd%WhO~VF!SGjGn0GOZrc3mGZudNl9{Q#X5&-F zuGwVReFLBjE5jr!!^-5*L%!I%PkYH#Hs5rMrEBl^)9)9XTD;xjHFxVZMc3~Dw6#k$ z(-S}RE$bgMHv6Z`mS5|u$$78sp4G-8b@lVkl`HtEv+MGn!F&bKcHPi$$oP_;=BrPf z$(~b3&p3CsuQxhoV$%jIR;`lB-s7FDX)xCTXuJ7ZyIQk96uIR=HBt%-P?N*bp`)EF zq14c}QM+O70NTOa@V~_)&GMZ$^cQDlkyOCa(H3Mf+6xhCuZh`VSN{cQBl5Ys9{cp( rh`2H3A^=GuC6HjQ*7|*0>;m{7QlnX3z3MSD00000NkvXXu0mjfR5FYo literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png new file mode 100755 index 0000000000000000000000000000000000000000..968f073fdddc1cc0f0800b1ac4001cd9a55f053d GIT binary patch literal 703 zcmV;w0zmzVP)AVs!l4K}n~L(tL`6d4Up4iSWnZ3Qg~4n+_J zDGk-qQdogO5JUtO-d5pRp7Nd7_r1^a|M&Zq%mn9Oe((|e0sw%Ur!K7T1pojj=U#f? zQM`qbQrM^DPkwa?DK_be^~z<~RgSMIa<`xP_4P7gg2jCwJ{9^k!fsU=#Ti|%I3p;>90Qd+7|~0h&mIklA#nb>ATL2+v$&u)OBgB z;nsHb)I&QRKeX40H~~cIZxCd}5C} z=79lXoXK%6YlyLtsV$~bSm?Upq|DJh#{|*a7XMm`4QJWZ>s6nL2R1|&J z0VPEwJ9?!n`o5PKAjc->P1Gi8BY*%!5&FVp=#)$mMJYul1Jton}gujiUf??eOy!x&!tsjxy;=Q3_DdcXx=a^OBhW0N~`A@4xB0a*%F? l+@c^sQA%W+?pa#c`9H5UNfS6T{e=Jk002ovPDHLkV1grvM=byV literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_red.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_red.png new file mode 100755 index 0000000000000000000000000000000000000000..0b18247da5850f3c2486373a3e179acd2772e8aa GIT binary patch literal 641 zcmV-{0)G98P);68^@7JE5sw#jpE*579S@TLkU(6yap1yN*Zuy>-hV%Q_v4Ar&!63c8OBr(ZRhFu z_kWs36-AmgZCT>x!RqM;Zu9tqvoHI~k@UmYo_g(*J3c%2{N8}7I+|qKPQzv}7t>%W zsu&9G)UmCzkDYSw{fBnuW4j;1fKV_nicw`$8C6D=F_qu`zUiK$2Oc?5UVY+D(`I@R zW`KlwqLftWHH3Z2_XVNfKn>VgT~k=@- z+N>c>0|@A_HbI9Jn`v0~7cfIF(TS69zaomDS1QtgvaBBfGEPLHccO2~3jc>n^6}^HAEh-2#VxC7YYcDXv!L9X= z-R*SOUvIs;n`8(LxP4~^2|JsiN^hq6cU}5dn4v1~Kl{eT7pm&f$PoY`hyVe%y8G*S bxB&kH@RuR86sIAS00000NkvXXu0mjfZBi!% literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png new file mode 100755 index 0000000000000000000000000000000000000000..cf347c7d4685128a4a447abb9fb8e939417644f4 GIT binary patch literal 858 zcmV-g1Eu_lP)`6pHR2Ufr z!EI=jWf;Km|8+n2IrHqe<9xxFVk)&(Nh?w$Xk`TAyvb=#e=0aySC z00NkRDM597_LiNIJ2M^qhuTvB004REvvU8@of{r?P8tmo3;+Pk0F0@*jAMhdOkS&1 zhJPPfQa;pP0|4+Yk%#j>X}o-s#EF1_DMV93FsfPP`G*>Ks>L&)Q}w2g%slu0kBfW1 z+*$*0BC^oTl6>OGIq(9BgG4|C90Dk-N_mPazGrQ7uHZ|>BLD!-KmZ)z1e^#?1Sf(M z!6m}K(^b|i%$TcA5bC}r$tAA?0C)g1@CgWliJ;NAk&ZF+-w#}$`-3nZ32C6IVKrHp zr+(!L2hRfF&AsTw>_@ z1y23;E%Oz}?q^Q2d($ayO;-sON2t7$w(Z|o0Pw1YnSp^}0PI+I5HnDNsFCA?oorkG z5sUIGIq=FSyxcj+xlhkm0en=52Bx3@02o12gdAU$_i?v6iyFMuc7P9#zQ-Hf; zVuV$t9P5`m)F2w1?t6{<8%wk{w-PP#Sj#%1MbsjrSI6n;D_@8q9`~W98dNQf$j=iI z6~hpgww&be%X_HI50Hhx@W==u4TLPB;ei-J-1}G8wH}|{i#Lk-WZAyfv}k4y0|fvU zZTy^$u6L>2nWo(NDSV2@MRD}JQ4(c%G%=dG@_vxH?>gcH#*Ue2HC}9sapf8X?R$Z;XEnm&g zW99mh)5jNw008mK8)r^`_{yH0rNn%u1|SpC(tjf#om=+r#lh+?Kb>DVb9`|C0Bvbv zN3U(>f4-tAC1hosRoA7p(b(hL*V}(j>ug<`&U)|l$6o$)!>PBQ9RQSwn9asj2p*|xhU*R^vq?*Twb0t!lm5}`yW5lRy-U0ZYK?8to!;o!r!XeOE$ z0HB3T+6EEoI4PlR=wonwqJ+TvCoWh&$?CAPVYcU= zD{DS0?AkOtb@-hh^ZLq~FMjxYf19X?pa_YqtgZGvv2TaxcF#KT?O%=_*a-kW_;N|D zakkWsOe!)HsT5WRBiC+p;N-c>0Qwy(1D2MDBC595oXSiR07)sKNk-%9*rDBOO^HUD zZW#;)R&EZpqha<(HK$(tZYU#V29<@0qCXgU{gXeGpc_|pTqQD-WO|}%yKZbeX7k*H z2W~CK$v8NBAq~czrc5A(v51g0Wma7`G8}f=ZcuAiYYxZan@gP(;Ku66M6?bquGiHe z3Q0ya)%Lvk@kLixZfZyU@#UFbv+>pYhcj8TRKSr_sWG8i^X~UA**LvbD3(_Lba3xm ziYcpup*A9qJ$?AA=Og05lndxfwr`!C+O~h|B~4 z01q8H`StcY);%&mId7_+)76ovRpeNWRp&4M?#jx@|E-)x%P*A6t^fc407*qoM6N<$ Ef@ddc(f|Me literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white.png new file mode 100755 index 0000000000000000000000000000000000000000..8b8b1ca0000bc8fa8d0379926736029f8fabe364 GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-&H;pyTSqH(@-Vl>|&1p(LP>kg~E zYiz5X^`c$+%8#zC{u)yfe-5 zmgid={Z3k(ERKCKrE7DF;=x4^O+ pzO8rLO8p|Ip=x)jHOtWj`bJBmKdh_V<`47(gQu&X%Q~loCIFbEay|e6 literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png new file mode 100755 index 0000000000000000000000000000000000000000..8f8095e46fa4965700afe1f9d065d8a37b101676 GIT binary patch literal 591 zcmV-V0~O9lw>B8WRlD)Gm}Jrz31u-X&&gn2lvjs=i{7nIaL6v2==uw+8Lcs(8j27 z;|c`rmSv@Lx!heopGP^^Ieb3f=R!%Lpp$}iMS-&P3EJ)s48wrJ_Ni0~k|c47D2nj= z{jS6bt|kFpFf|p5cM`_&0Zh|`rfEp0(}=}lT#(6RpzAsUfxv^LSYX>WlAaN$>)*J5 z0#sE+JRUD8iT9*fz{)_^7@6P&!sEjTcD+I9Z4YjT1`wH@fV{cEvneYGFU%maIEU2s55&K(LixD|{p-uiS@?KNj zk-Go8G$hH6g002ovPDHLkV1hVj1#|!a literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png new file mode 100755 index 0000000000000000000000000000000000000000..159b24075191fc259cfd80c797a1b0d74c168422 GIT binary patch literal 664 zcmV;J0%!e+P)7Z7t2}reCh0o`+ zAlt$F2tW%oO@m<=(B8a-_VgLl#~yUMUDWG!0qFPppd^03e+x1WpkO1NhIaKD2A)-@ z=Py8(Wi%R%JtYZG#sTKH@6Z+&!S3Edf8jFJJNKuva#KJQD3X^7;H^fd2di znEN&c58aUG>`>P{Vqq$kLb+TP{?I!d4(|o59X_%|nVEZq2Rk60n7072SWJ{64CV?3 zgS!EB=eYxwQ>P2&$}(iT6UMvuFgHHIEdNA29!EBtg=v~X!DxxEH~}L2zn|52%xalaq@DTdhh{EVwv0IaQ=!?daer zTKp4I`l8SDt;d{8Q`5Ko;BXUi&oAG1l4}59P-{|^S(Rmord5s6qsh<&m@Ab^wqCD) zHyRD}lKLDzpYN&@q5&*47mGzGiqcXpmqR9#K|CH8kXS4RNs`(iEF%HjP%f8ItyaZK z6$%Apvsok(2>~dTO5jTZfq;N?0ch4l01f$k9?4{~Youl-#x{UDMr#AFIkz@SDwPtQ z$gQ^$2|*(Ps9LQiav_8o8Ne<=Zx1*M*syo80sEO1tB%>5 zfdHB`1z+!R@?ghPRKmL)hWEvZE$=*54ose*0JiUNTM_)cMDXhxEKg(?-pD=y<)L4J zT0dSyD0&NhJ$^_8Ko9uom%-ZM4BTM{Tw$9qyPj=-9W;N(Wi@3*-Q4pq`Gcp}^vvNr zyd&PsmG>fpCSZz?K}UIEd;HGgG%0MG>ymxKPwy{>wy(m*Atq7)0000~7 zMNw2LQirBVQoa8G3P(rY+l;L4iy+JwSqmy$9JlSkk z&*$^Eg+c)@!R|v4gdc8+TTn&eWHO0VD&>$!B%o;;WLf4CNs=Inq9d`xA4otCWHK38 zmc{pkX`0Y=9g3oGK{}lVy~OYL|C5lQ&U^l;wrg|7w=BcA9L4-r411?K7f`@348&rw zXD#uW)DK;H`hxO}u%=@Cj{;#u#_;bb1_KgUOT2Hp6;)MvC6P$vQP3=g1O5#aU%I!K zZ1dc@f}YvG&*Spnplm2rIp^VdA^HydZ0X1axdms2!RKi5x-SFA4p@ zC@N|PI$ryHL@t-(!zBsf2-+sYAukhDHU7Lxm88-p zDk^c;sHj}OKUc4lGZU}6umlGVNAJx0%sKDOFwQx|V2pVvxhYKe|L9TNk!~md3BVrm zYPDL8Hk*yU-ER3~LGwJ7N`0ZV&nOhBI{~~A;@ND*=kxg?#^W&`4u`zk?Mg_e)8XlK z`T#M+OaR1!<#Nf_>$S`xrqd}OjYhoJ>q)?3vEX8pY&I()ERjfjrXM$k7e+-Qs3Ihj zNyOuEQ2EGYG7ro!o6VOBQEwuV2z)*tR8>WxP{616FY)p1Pn1d}#9}cxolZC$4n(6- z35hJq0;FlHC{ zp*iF(lgUK(E`($(s9pJ8Kn?(M734H_63WHtf}6SQQ_MXEP!#0|&@>J8dL5TfG&tBw z#tYn{TCGZvAr>cca%YYn^!t73tg8OOJ2FvJ(`YpCyVZi*?Ur+1uUA$hAg8-aK)c;e zQ<)!XwHh|n&ND=$@^)>aF-`~n}#*WMkD*M|f8r$i*z7+W! qF|A!t*4fE(R`<_YIkN&?Jng?3oQ|aAqClPi0000t>5xmo{nArfL4CJwMMm+N`pQ3p^Le$?rMud6Rbxz!-yG7bz2z$^USP5(;udf(gfQ zG~f68y^)EvcNWp#bUoDt2=h+^%o-?-|mo~iieWqLNP<0m@2PTB7ftyb= z@H`K$>v9Pr5X`L|rw&CEN2(9SB7A2SE;d|j9@*F}sd(@*2l|P*fWfK>1drZUrtUA7 zNXO~pKn1cjf~~TLbje1g>EPPzN2GH#UIBxJ{}S9=E`{zs-w#hO?vcH+hJxroI5v?j zD!4lP0WXq8zUx3RAP@|Gq$}6wXCjFLZY^YSWBxN9#&g)ro$%5}aYn#y=tJ_aIT%4d z5d4u`rlp!};XGmbZkJE*kYJoi&N0pd*yxY{0${xD;;Q1h^8f$<07*qoM6N<$f(}t7 Ae*gdg literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png new file mode 100755 index 0000000000000000000000000000000000000000..0c76bd1297751b66230f74719504b2adb02b1615 GIT binary patch literal 603 zcmV-h0;K(kP)^~*-1fljz_B$LUvK}k?BNXe#Y!m=zM!!V#}8bncK5m;8VP zw86G*RI63?Cd%b9bX|ueNlZ|wR6rj|r_)VIP@r2imh3?SN+^{|kY%~8B{maJ@F*OK z&VH9LwOeGt#DRjj0~v~8`>iO7!Ybi;zE$va`A^T#yW`y44;k^#O~K5*jD=qcUhPSc zvyy~q;5H_1WT1l~cqje9yfa+l!hu6xjdOJ8s;8E^+=QQ$tw p?%p!Hy#YapB=@+^9(46X{{RQg%9y;OKjr`c002ovPDHLkV1g7l326WT literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png new file mode 100755 index 0000000000000000000000000000000000000000..87a69145075afd8f8fd8b391c5da1249ec8b2889 GIT binary patch literal 587 zcmV-R0<`^!P)LWh{^|hy<@Q*xw+qo|KpY<+vaXbbW{L4q( zTsjXEJvb}e%bgb=o%W0h?4u1;^bWTqH8}5Th002ovPDHLkV1nrS0P+9; literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png new file mode 100755 index 0000000000000000000000000000000000000000..c66011fb0fbdcbf210483d676b7131542a0e282b GIT binary patch literal 592 zcmV-W0k7R5;6x zlV4BMP#DI+Z{WQcKZBTk0lfkj5F$ztWhP#lcuyb@0@rA^#Kpu5KLA&Rgc}o#aSmis zrZC__xY^&#cI&!!{c|4Q_tcec*#b>|Y15wPcY2=o3;-Bl=(t4;6Ok*pL)-{*A;GX^ zS(@WGp6j~k1wBVR9)BB_gar`}HyRBXh7nM!)u5^>N~MyN6bc0-5{W?44iB<`2biXb zR;wk?jIQg@G!5l)SqhrXCU}x$GU-dY1sra}0uCq@153FUULT=jNwSk}0WBjKz}Jdu z<5gB*<^XtpAmp3m^ZEXQZWd1krhft}CoYaF4cSMvTJ01}X3X37KYdx-D0$c{doUe8 ztY{vlGr-e*;N!WAV%_hgUawyYrhegW>^F)pv%uUTFslHn; zvJ)l{%w(~{!O4`KTmK{Q{zCYltLfs&4?nz|6IdlqHCvX;|HGv~!QW?8P~_d#e0$v$ z)5XHEz{3>qMiH`1+qNYf?huS+@L`J9_$cjJF)Hf?@pu;)`9}BXwGUM{2!{y-4|Z{L zG>z?O%Cp8P5T#j1DID7u_*(Jg?7iss8AZQ+&;u_J{FmILf((9eoiL5nGUe>Fgq*U$z0000 zJ3A|*qoWOonz+4ZQ0KNhDB07SX1?#FrNy8%K)_l}y&kh`*KYdy`Y99&tgNgMLSSrc z?B?+B@HO@P-jS~z2Rgc6yy~Y~%>oJpBxsb$5<&nRLqiuR7K=@0SZj~jTs|sv_jWVX zGe?WflejOaq|Vec=s9+ahmXbyJ|T)Sl*?s82sr2H?Ce~HD5WI+Sz&tmWrN()wI2}+ zKqg92t*l^-#ae~;9%KFlWkmwnY=-UK`_|%ICZ#P1gdjK<2n38VXsuC7{WiU!fZFmm zW~Sda9(Qi@pxO}$ARY+;t##Ao27usOqNt7Hwq6K7G1il@xitj=LIM&{N&#SuX;x4x zmG6FhCg-$PI;hQ=;1iZ>F>^~@)IPi;l}fX?SZ!QiO=X<|pSVkNpJuLHzW(FT_~W-v z?vFpkyE>8ee4d=7wKauH5~dd_M7d2Aa=ICC{Nj7Blqv&DQEP#j_VeWV&WXL>c=LLK zsmYg^_JiDb;%U!UxO%qjFAvsDFj-kzT2$GbV(ZopPM$i$z`!7jvEk07BcC=6FMt4` z*0u3Sy`0b~%#(0000K literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png new file mode 100755 index 0000000000000000000000000000000000000000..a9f31a278e17993d8d4e13beac2f9d5f7b42d08f GIT binary patch literal 309 zcmV-50m}Y~P)sF~CC`eaI+m%Y8jfzomMvZQaNUIT3LIrJ$h)_W{ zwF|LDNlB-g`Hb_G$;>3F$9JF3WYR|3fy2C+_wH}*xp!_4fF2UN4lt#d26oXwru}hT z0+0%Vz-l&|Tdh_L-Ng1G2*RBtBncRx;99K)&+}s0whhxXp{go}$g&Jk6k|vfypI5M z!1sNGVaV?!*L7i87Bo%cfO@?S`bajL{R<($@$|PtgBRcCGIJ_2a|&kO>G-s2aR3E4 zjssoScUa;zIdOeGHBnH13G)W-zt$kUQgNfG;96b=v&4NzRt&@7nN%v3HsG`<<+F$cumMs448N!W3r&2Z*b~D5^$^d6Jxn@SFK5Q8*uKSR7x{I|H-_N1f+AD zSYC5@2K4OKL$==F9U@CH;ONNL(W}oZICHn;d?~pw?GRIsH*x-68Oy6SuK`)`{E)46 z9^3(-HXa#X89SBv?u_YP)WjsQrp;}0X?Bxrvf12IKW8>3t`e~W9|JS<{btTNbNT@EQIWBSNJTX8AMGXD z-SsH|s#>j9Xf~VMtyT-YMD}5^SWHTY5->o`k|d#AE_YQd79j`%GMS7FNvG3b7^Vy9 zn0HYCJy5MyQLoqKnW|JOp-?D*<2V^msZ>BOv0ANd2n7t@{=V;sZrQ>3c})5_%ms4z z7!qXwHHe~!QFj8aR~&*-3F?O|;#(ESIXP~Os%|~y^7c15*q5`gz2-5ol!fU92NIGT z_ves+>+Tf3gfcL?!nimYmR}cw*|BGULzI^7!;k#3K^YO#;!+vM@N~(99+<;fdqr zYPJm+pXYFYk;neQyXXEcTQDNQx57i`Okp9A#n?<7!{#tnKJdsF>utb@JH7dU01gfL zEK2hoPZAnO5+je3&^i*hWM`qCW^vLK!O*?U-#IvXV?#6koWqrwnD{j&K`7N>^tR3G z8zr1(qVOzcF#nF1&0MZ5C$l8*E^Uth0000zE0Ay_3@1Z_7#f-XWL#E{8Al7>L$ z0Rx7lnddoqAyfT%&#`$;v0@*5YdW3w z7mLNoa=FAshK% zDiy@zakyMAxr-H?iQDZi^!t5;Eno2A=?>mMx`Vg(Z!?<53LHLvfTPa`$mjDcX*Qdv zR;ylN4OH+m)fVX&Z#yZpUae;ss@a$K&})gHovkhr@w#xyPVlfVgXti1_357y%I-UHDvRWYvPEX+#g+j4Q9ayba zh7uQN1j%HQgA=Fp9DfODAU^*3*FCs^6IpO7xg`RUXyP)(;=d!ly=#I^l3e0Cub`{H Z`5PU3+D2e&<<>s`J(VpX#y^kqzQ;#=2x({YMw9Q&ndHT&`BD$#%Ql?{+)-OuSA`r}MWJ zVg+2Gc(GW}a=BERPNy^;kEz$|38dTYlFQ{%5S!g@|8f8D_!Nu9_Ni2glF1}xG8xi! zorc39&F6EPOeWOt_XS`W2H_Bo$MXugy}SEctJQj=(TLXTHL(jRXfzs>NF=0SHk;94 zF!&HjdZNX(3U3;LY64IMX__Xv%_wjLC!J2`0Jw?X=zPK$C$`&dYPDKaC={e16bcE@ zgun^<0k;ak*=xLE)@(Lqu~MmsFoMCLY&0Qog`NO(h@kyxaA%EbwJLy8sU*Vi`~52K zX0wrqW;_LmMq@evX4iAM9Od(Q0eHP$1%L|xAh@vrqB`HPQLon}f3aAka=9!3hr=O- z5F9`#J_7Jhah=U(4RjaRhkS4Xkk98kDz-`i!r|~~AQ1TFcDw(@<8g{aBE)l)PNxNE zI(RPyc>9e{@WGSMU%i7*v{!&P$WLz25)0oc=Dl-yy%xYZAm4b-rttL7UjR#%`#j_F R;_m(?iiXTHIMmcoLoO94I8;j@ zv^2DJ5#orqydFJX|Gm$_Bi_vyew+j6{r}$Qc@D1%fQqeAhJj)1!z4pP83k2MV2~s! zSt^w(<#HLFVBg_#xz1W8ioi(WY&Hu~6zil?DI^jJgu`K35(hkP)H%@Imesbg#5!Ps_$Ni*SiR8&sKb9?M`0-mH)gtg&YgRX#*TXz@Z+| z;|2H@xzE0TfuORhuO2k6#K8#sW^J`mQ0+E@$K`QkFV+DTlI$w{GJ;zid{*v9xeIe_ z$|Bp`@iKkgoFK3{4Z)#DWKV~W4K@5WZN+Ql_7%YxNqSx7%cWud&cX>)_PvD*UzxZg a%Kia9Rjz_59@~-t0000)l$0ECbfb-0$}>7z|u>IvuoHEmW&j4lzv=KA+EpIObc7e7{sGA)QVmnM@*^ z%|h38^m;wC+ilpk%>l#V5LCqP_y2_Cayd^XlX;j*r54R*lW!zbqtSpQNyz8(JVmWm zyV4S$2{Uhyc{Cb0QQbf{ZGT{Kr zvJi{K_&f+q^Pv4MK$hhS4TgFj_FD*rLOePdE-E^T7ZzTFCRUB`*?9&h(a#C!-v8lWG#k3AOJQaUey6Oasked^kDPe=Khg@7s584 zg`XfS1)&u*_c;I76#%`kkBfiZgKKo@0)9d6vZw=ExQUtV?eW{Y1Xv}=4X(2zy85d> Y0C^(qLv?Ui{{R3007*qoM6N<$f-gW7od5s; literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png new file mode 100755 index 0000000000000000000000000000000000000000..b93e77600def75c9a144d3d0a5088a62c02cbb0b GIT binary patch literal 618 zcmV-w0+s!VP)$>5Y&axjp2O=VLu>*f>1L;s0)kkvKC!*u?s6CVL=HJ6oP~pNfZc; zsKr=bq;7MITw8NXw{SZm%59TId2x_9BQ zV86`NuvGI!>o^V!Na!=$7GJE{Cq`b+XwknM{UcGHFTTfmuS+ zm-zYC!P3+zmY;SG$?!fYkOih`QYaLxyF}A86h$GGN}kFj)_o*0e zjPMP%zTG7FYMAfO2Nn1D`D0Cj?Wl>5q%@CE10nX)KxpNmwk+!IWkzywiYD( zqUXiYYIq3qcRyMGJ;IY`(Gz~E$J$zu2+R{)xGlE*88b3WK6V*J>}2iPY1HH|tER0W z_+^^FdppY?o)Gt5M2`%xwRDH@R3G}^i1l4|6uchm0X0f!@&YdVLB5K&dd7Rv{)DXX zt^&vP;}kqj3f>94j+4xd93>s|Q!Ezi>?r8(Il$P}PFxSqu{d*!Y%*#cX(R0f|Juz# z3o0_xI14Al->1uky@W-rCI_%l&>PK^TXNSN{byMk2AI5vbwp!K-%-@!-vPR3iikL1L7HA!^!~ChCFU#lnGzp88=I z67V8PHBo4(l$u?-AKmT8?#_0rKW9dUNRbpLc`}piywAM9$xZ-3fR1C75T(BjCn-l* zjUcci2oXXo-}iqun@#)+`W@kL_-U&|2>MxZy~3IdmRm&8b)9!2%ksg3R)nNnT*TJOC=6{2hG86Dz+<^p6qfG5$i^UNUh+u)CD7O2 zK>Ioazn;U|+X0x$=feveYZL1W*Fm%e5P1sajd#eW#^5(ddx76*pt$^)b}$Q4oPabL zLc^HF>Z{8za;f$LtN0P$6C?1{X*jtXkRJ8IEeyiSzencvH3Ux_y>y^}wfJrRCQN#9 z?&e+C>sSAfrE%mZD5RfZ`gSndD)=P?+nG5Oq$zmY&-v+gc7R6c0u8^Ke#|XOq?gF@othF3zFpM8Il<8BJrWqBtF>b#_ye4{0)Xbu6j&@UIhRE002ov JPDHLkV1nWI9dZBw literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png new file mode 100755 index 0000000000000000000000000000000000000000..b977d7e52e2446ea01201c5c7209ac3a05f12c9f GIT binary patch literal 663 zcmV;I0%-k-P)^@R5;6x zlTS!gQ5431_q{u#M2 zg&W%y6a}>qj1Z|7Vu&-DW6d~k-n;jnHsjb-q#u0C^W!_5^C=MlKq<8oNCQ6qS00!X z5eI;XP=g!^f}j{hku}E1zZ?XCjE;`p19k(Rh%^AQQ54xysU+ocx$c#f61Z4HnT#3u~FR(3>BnZniMIF4DouI8Hi4u>cAK%EN)5PO(ip3(% zIgBx+QYirR){Z8QwV$9Z(Mpt=L-Or3#bf-G@66}txq0yc*T(zNTBDT0T8rO^JeNbSI-Tzf5!pBioy4NwAN^?iN#{;fH1Jke4Xa`^fR8m z%h6dq%xX)S?7`zae))(Xst^Scp6B8FejQW?RLTM8@0=vnnntuRGBM2dpo>gbCnTD= z^<;=JuqdSf@O>Z8^XdR?s+KEfhDdB_#ahFj^giCtzT(s8kA$AViyTqaAR;KGaLzUU z<=GqA4bRwpX|IG~*x>pZ!@zLr`XQ`od>m(`;jz|M_*1GDO#$7;n74ppb8=eiqh760 x0yt}J1#p`gw$`o!R{d7zU9~!Un@nJV{4bstt4Au+Up@c;002ovPDHLkV1kWhGjjj{ literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png new file mode 100755 index 0000000000000000000000000000000000000000..581843637079359a6a58fcdccf0763690c67b063 GIT binary patch literal 676 zcmV;V0$crwP)_k3`4d{s8lK_6bi^@vq&To98fNoK}7)fx$e2^Y&@<^jR_Ee+8}KG;X`@ z@bCyiolqX>bb1ZIs%QGnjzFU~L8H~d?e;*XP(h(S262}XyZ3a0h07r{KV?E70l+e- zE`%3x|M5#q+;HOC(h@A^M)7Rn13dm0&>K$j%k_F4wOWlsNCIH+!c_#{eS&TL8v4yc zcpnPEY`cQzZ$ILq{U-MA6Z6Z|1p!FZjQ}tXSb25J@HphEqX-6Hqo?-_Zn@{d#>2Ml zJGhxTAd&emK$lV-QK&VM&ix0Xy{GyS3Wp(+E1^8BhD3T0a)m-Lw@Lu4zQRrP)9(3F z^>$hh@N>OAXrmPYunLi|fJ$_*5i`46;M>~*5D{bp>-OL3{+!MJa`3kv~Q#QfQ%c z)1s}QE<_XaYBG;IuRF=td#+}fi4h(6HgoUyJLi0t(*dA^B)%@8kkG&bdM5P5^Z5WF z%d%>m^SbN0XeV)wbUOXn5Ag#A$gJx+7-OCkMM1S%MWIlTkbFLmOeW(&n&wUd&;`>p zVcRy$Z{K0=?SpNnP^;BYEEXleFbq(UY&LrXX$6qkJ~)8+b{=jj3HEXds;Z(?D%}}L zX3`39&dy=Zyar!ehA}e>w)(*vrCct{PI9^2Jpj&OZS8<3-@{0(gNv%1{)zAiLY+_^ zl}e>Ofd4&#Irj#7>=o=Uhv5IJ@?sN0^J|(WL2Uun$4}si6}TG-s3T#p&6GE<<2W)O zf{^Y2HlO#*QDvTp3v&d@;8*}aUC4lisG9(w7@d5Y8y)}U#FwCkqp*Mcgme4{&gGRf zlBfd`nF9cQBKB2_L{F8G2)7pAf$i)Ds`|}-c>pc^LRW{w4SQ)3N^BbZx)6BlCZts! zKph%`(m#xg-q3I7=(us;9<)*2%iuQ1J`oV3gU6V~T}^JU5714JN33&GwEEru0d}Uo U{MPL+lmGw#07*qoM6N<$f^vibe*gdg literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png new file mode 100755 index 0000000000000000000000000000000000000000..8d719df5205f7415ce657e5c277db4533c82f346 GIT binary patch literal 639 zcmV-_0)YLAP)p{{sC7)XB-g4w*W1a1)XtvxrMYa1o?wn&v~3 zHnC|#(>B_M1d`_7gfzLiHy=0c<2kQQdXu*33(xYN_xYW39(cz9jEVT%VokB8|DoF~ z8u%Q5sdl@4VB7X#uh+v_;yOGY&pRi?378ghv)P1cngiAAb<}D#l*?rWDV0j_dc6Zk z-|P~AJZQCA=yWcQjG8fYnimzj*3KqTfN0Cy!G^$7)+bQ$+mHVd1J zvwOR^5Lm<|R+uyB1Nu4vL?d4qa3tn?9H7SZH@~u=fFHEDfSH|bHU6kh0O3%cLdyny z{`9S2Sw~WMy0MPy!64i`jdk4Z3>^+KIL_fN2V_d&ywBt`^IJpxUI$=YAph~5`;xCe Z{s%Y0vkUXDnO6V+002ovPDHLkV1loX8z=w( literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png new file mode 100755 index 0000000000000000000000000000000000000000..106f5aa3611a4807ec8c21701c631730275089a4 GIT binary patch literal 402 zcmV;D0d4+?P)<@FR}JvtGRKa0_WfK^c7uXaFH3q@Y!Hnl8VySc`OtkPN3;#l*y*l23+99h*9JzA00}rAC!#M1dZ#v9YOBH|eC*${MmzzYjBu!!-< zK8tujf&(6i)1biy*F>4{f*Kd(IU-JsG&#b_@NgTnx@40)2@2%c;*=?-2Za=}O}7&( w%_K#(S>e1j&gfY?mR})n>>0+8p`iTe2d1K2h8#$+)&Kwi07*qoM6N<$f(2cptN;K2 literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png new file mode 100755 index 0000000000000000000000000000000000000000..e4a1ecba1b60e54f3777717ed105cdde745b7184 GIT binary patch literal 516 zcmV+f0{i`mP)o)wchR-92qq~y6`XqbKmElbB3z{pkZs0VPF`CFvS?7jDn^mFo>d9Y&06* z&1MsS!M-CH3ee+h_sy)Ms%B*ec3R0RpVi9?*mU84yoq(Bw8 z<4(999dJJE!V%pWT~HGRIAb;(#O%2K3?uRpz}AfgE8e9q&OSdr^e^}lC$QXZz;S2A z)w>^oHy>?v)q--`!pmuBe96PxP0u*inQvyFW(llfv9 zXV1s*Jh`y2H%B3ZTA(AzpsQ?hb6_PyZ=c1?_B4fbl>G%!@ubJln=!)x0000#DY{xaiib^#X=YT4@yE_&2#eBulEdzjE`u&@G%2(&u{J-<}d(^uY4W_kMfEX z@!X)AR9F&FL?RJyJRUzvBoeqN{5kY`z3wcM0+du73~_0|*lac! z42Dw(Eg1o{Ash}P8jXrqN+1w`*XxDD;ShmPCZC7#4;wWbHoMvBl$=zF-`?*9j*Nbjd=v@OWt_BgKxP-3wd zy37?ATx&$b+&zRM!K;BD%Okw`Sb@&Pak8$KRX19jWZmC0&n*Ggv%j8nvSPDFw zEkV65AGOoBQ8kf`R|}Px*&INNS%osq9b{Fq2I(x6@xM>tg=vRLF?I`0rWzHyRc>}g~)F_Qn`A>)C_iwK%Z zrIJ;xR)UI1Y4Ozts|-Nho;q zVk9-bX)%F~!;63iu$Fk=VJn3~fmb5S@@)ZqjBT2{f`vT`b2}zxb0$o;EF@G3&BHK^ zc)`1kUzo^Qkk$?KFKHNBD?nP-MJ3b@&4fg;g5l2wMi^g?9qj+~@b;62o_U1_S1J`g z7m^UMg25FX1MJ5AQxAJ5F5WDt=$=-@JV-!LHA2vuxl9kN>PS8x??^AINH6LjF*#nbk4}=n3gfWp$kEX5IpHS zYiQ{@d7Nl&d$#+7-TckP&Q}N91e-C#5QQ<|d}62BjvZR2H60wE-&H<>}%WqH(_V;zPbB1rgSSSC(0? zWlQ#?N3UgnJ9m2C29w!SwoOo5_2Iq!<8vCyEoDoj@#oV($oJEg6Bj@;nD|2g8 s%L|>IZ381yx9RvPhV4J)*SeoEV4lyr#k*`nfWBbxboFyt=akR{0DpOPi2wiq literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png new file mode 100755 index 0000000000000000000000000000000000000000..d61648452284da1bc28b10385f95b5d2bf027901 GIT binary patch literal 616 zcmV-u0+;=XP)-tZUVHjYHp;RjQ0M0pRlXN=mLv{hk9Ebp9&~+Wj-T9IkpzWPWd#fZ)d=zV^~S`;LE*!&u-?g42^wwN&Xr1~#d5ifl_2*B1OoS}CDno^8a50ArfE8;stQF>AP54J@H~%T zFz84s;dO!QJKD36(~!QOg!t_^gfFcSKDU4yK0+Ypg$NT^mIYcQ6bk*3P(lBLh7Df_ zTu=2xC#+-_%)|{Cv8zz0t|0y4D5M`xAc{gwOKc`ou<*&VjUREFHs1qd<_xSkKeTBt zgyCi=@jj;&Ns^GsWWaIUl0Y2azcDlF@u{(P*!+EH;lnU~b|Lv{4|4Hdkh!qoQHiE$ zY#y>KFA0QEw=4Z|uV{0A^`Y=D}hB$GP&<$bi8q(u;p^0(my3Rz7fP}|# zGZ&#uor4@c3q9r|f?H6-UZmfgKx(iV(MQ`MPWB>iC~SxnN5H*zb*A3#zWwgu&c|}3 zn^g87H{pdeasl%Lhmab&jC?lES}7C?4BFDNA<}20hoY@w_IU%i*T;}}wh!589}7~7 z#Ug`-R~4j&+K_y4kW@X7qLr-)S5qVKU)tO;+kXJ++{vPI@{hVK|PhMVVx_`)vx~zUs}c9O-Ok{00000NkvXXu0mjf DS5_-g literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png new file mode 100755 index 0000000000000000000000000000000000000000..bf7bd1c9bfd78d689c73ba67cf914182933ee68c GIT binary patch literal 614 zcmV-s0-61ZP)OOAS;jTeL{ZSdz-%)SMH9tDF;N4B6%j=d15J&5qy`F#vB?Ar zqS1nH@%ny_XSI*Y>) z1f5QYdmzT>YciP<3WehS<{GovEaLGv27>{*-7f0&I$yJ^L%ZGPv1YT$V|u;*+ZCWz ztHI~CDVsuy($SfR6-`N~K?9GTB#l%%0h7 z-q`K-y~E)+s8lMyTrPL8^_pUo)9G|SluG5pPqw6!LJB_PzyJUM07*qoM6N<$f^=yZ AYybcN literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png new file mode 100755 index 0000000000000000000000000000000000000000..f6b74cc40f82fc83e4dfa6e9647ccc1b34e6ed7e GIT binary patch literal 554 zcmV+_0@eMAP)Vb2f>2}Fa82O3m(Ob=t*sniin`NpInLyMJgI`saru@YOPfh zy4g0#G*cV!#N%;Gq9_VH9?v%kjS3Rb1j8^;C={$Gp=lbj z*(?%?geA!5^Pok%UauwjA)v4g2`HedDw4_Mk4hhBQt?e7YJ5(hcj|3dNu^TOPGnjB zTTsqd3GIZ=Bb`n=7no)dflv&K(lsWw?lH6T1Yht0F9qgIuzh}ym0%n<3d3EBWB*pg z+G!I0lbAEXyd>k|QNuwr4=KX1D+tLPv)j@C1=N4sA4NF9A>HcO3G47*Y6!+SrUH-7 z1hb;^#S=r|`aMh>J#dWruAEf}gcR(DRUC`ZUev&$Sbh0SgLiTXeeHEU<$_YV;9281 zym`igIE%Sm8DpDw7@71Tv^EB5xSdUR*0$Mqp+Wq8OoaZtOg52&)zZ;;M=7#C1Yd6x svjx>8ad4e2x|*xHHwRjcjs6zA0XLDUqKT6dS^xk507*qoM6N<$f*wetruo^Ag2=LamM1T#~4RmC^m`_ zs}H7d&XJ}mg+hU?tu0noRvyjI&o2SRAeYZFesYkts79I^jJ7!A7%6nJwq8O?iT55M z1OQ` zbL{!Cp5o*IRmE9PInMCSPjTwfT~J+EYkz}tjxY=fg5Yf6EQ@DG$0kMJ9h^&$W}9BU zP1oj2;?MWVkKIEl)r=Y;L^Cx2q|>!)qJJ8zE7-V*-Cf7V8_2#1c0N975t~+&QUpQJ z5(uo(-O_`%Rj@U@t>JYAgd!>L?0Idxtd#oW2gc!jinsAEva8|kF4#Ic**mmml_{d^$s}Q5Q)KCys4sfck5bP1SyeHwh2`A<@N&t2j0^lgHC_^(pAAPCNjwl+>AN%C4Ll>_8Hjda%9 oS~i=#*e)>KsPlg0=2)Qg6BCqJ=F8HdGXMYp07*qoM6N<$f@i)wr~m)} literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png new file mode 100755 index 0000000000000000000000000000000000000000..a65bcb3e1e9613cd9e4950850db43d7025a5fdf9 GIT binary patch literal 779 zcmV+m1N8ifP)JNR5;6x zll@CmQ5eTZ^k*a#RQf}fVOdd`5NJh6S(>6Cf$wEW#f&JyAR#GAn9>Gml;nOf3WCDa z5({5&UB$(IF?G#$x4X@Ickg!Y-HU!Z_rzX=qAq-XI_LS^=lOCT0|0{#{kBkYDS7{3 zD`iu%E=`cDX_^#^#n$5SIQ|4Zhsk8>N|zXHXG@*41$i-7`Jr{8`3S_OEcmY|RF48wXkk?WpdVM4OePBSbfh z#4_=eXJg@3epx~gi>QbUmO}Bm(ENN3+@c?jWiKvSrm(o|W}Ud*?vy~fn1!V~Cl4kB zI-;c!8f~-v)jX82%EG($>?;KSD$64f2&4qQ#=Yyrcpy$57RAVuV#vKMP)0hT$r6m# zc^F^XaJ8R9Q|}x^NoJYIvYZkq-z}Tnj@UJK2l2H zG}p+VvtjP2Z%bsb$~7QLJ9#pC0dKi`ppOd^_V;ME6tdzC0PtV|r=@e@37O`%0k^=5^`%cf$eu00N17Ro!{^30krz>a%3j34C?*{Mt2^a4~ zK=P+Qq%|f;Tc&+9ps;@Mw`EE%rgs&#y=j6BUGg96oIqdwj9-fiy*N(|@o)eD002ov JPDHLkV1j#pUPb@_ literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png new file mode 100755 index 0000000000000000000000000000000000000000..23a37b891c2f5faa3b8128d45373ceab794ca609 GIT binary patch literal 688 zcmV;h0#E&kP)PK^TXt2QS_@2qt2T|9~baC-vaPn=ziepcfAwB$0!O2Q)E}1e8!q+9)KT5JVKU z7HNY}h##OS-BxWHWjD0wrPDeEfUClHs%Q6&2u@FTOJkKMQN|_Rlw6rQz$gPzqGNtj z#ruSeFeh835JJFiM6vp@6M5bXj%k7CMt%SIwfbF_fD-3*Os`9Ly_Q3WQ_SX33E{pX z9_WIeeTCGQ3wYALpBcK+P-iuw;3i&7xCua37k5# z`>c`M@sGeC7cdsdz`aE9lOz!hPholbyz%T85LYf6O*@SA+9&+^7k>+4M8$A8iNQq{ zQvn8k?-+dU`Z@gK0z$EtPV#+`^OH`R@cE-cuE&_!D)SZGxmQxeobP_Zwq zMEgi6ePN45N`|V1so0uE8^}1xw8s;VM%Ai@7} z2-&Cyvez_-O4?6uv{zTaj|YeYEk34i~K@`8YW2g{x* zc;7z3lItpVy_et{Z-ZZ)<@*%{l7Ao8mu@V7*gz<_1##mwW*%LEwCdzNsVLYx2*T-J z#HeQ*_a=R~KDdVNk$EVgAIRl$oQi_(`_IrdJciDpH|Xe{K-YsMtc!cRnFi$qzsr4z z5*$;ecov%3->1{YNy6-Gf(Ecy&_I$CjI#laeuE+S120^|Vjsf)W&i*H07*qoM6N<$ Ef)^4A_ab^avY?n0hpS-#mn_4{O$e%cm-@NH=3`90Wq+3`~HKArSdfX`&Z12 z(CY$VW-MNtXX4xy%yUeE?}*~0-|iByA@ZrwXgph4S*bhcc5{HB!DFVm_v}P*g7+Q~K}7K0lcp(^N@X>U zV`{ZpeIf${R6Hgg4FL^`X$Eu75k(PE6ycl$AW0Ic)#@rR7Z(7;V?i-dR1K935Jgcx zPfkwK>2wGokf!Nih^ARp6-6arYFG#(9Ta!x93nFEjoA==z(g?#sDg?Owk?Mg7K+>l zWYsf(<`#+$h9Sp6gFOg_dd+80SkUpk&xM7h0`Sov9W73spU;GP073|VfZ&Gd$J$*0<~TV5aPS|qWH57|VJz+d0000vYep8SaFV10Q$h+;hIUPX_=v5b}%>Tm<(&j1&5;I!55C)oN0s(P%ZB zP3Q#ahfpXKWF@S?jm4U#fv)QovMhrriclyNs6-G12#3R##4PSZ0VY(dRWJ;Lwuq{# zAW0Gwi$yA^R4RZ!;W+L`f&%x{=D^VK#BBWL4Ys{;*!A7Q;!=dN<&D8*GzGaF4`hV4 zDbY0{NrMX>ZqF=0((gR5-zL$kC*b)!fwu{Euru|XrG<$^n#@)7i_>rCmRxnDq>$Y%gJaCkRd|tE*a2x05Pe!I^e13o69#&RQZ36s0 zB=O|K2Yi(jsMqThn}9t?f5E-)L^naZ+db$&%M$!bCdm=jv7?t_lB?3&%Ltq(>ESw? c;MI421LCcoDG!2@;{X5v07*qoM6N<$f`UZt7XSbN literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png new file mode 100755 index 0000000000000000000000000000000000000000..134b6693687b2fa5fe36d48a9c0b8001f937c741 GIT binary patch literal 650 zcmV;50(Jd~P)VHAd+bMNh~)LLRqN>D)-jd9UvB%+hyKX5U|&4t0)fzgD-MPpQ$nHU%yoz=vI zMGb>1Xu!6Hw$NT~@Au<4P-+{9;Uw?&oj31uzH>xX0T7Xkz!(tn|Ed9-s_FqyReC13 z(ll)vW1O{Ck5ihay12Ob2ABc@RUI;zHpaMiyRDs0r>|D4rHw{ItJSJnYjt~jTbGuW z`X(~}?!&86q40R8<4zYw;$qi0^3ec=c&<&H;r`8W%H=Xymf^i;Wo6~<+}zx2UMzpC z*6MZN?(FMv`n|KO3(KFiUaucP0;Z!@LcUNa%8#vGK5aZ>wDgB0Gi=t*argWJcdlMQ z2#MpEX0wU+9&0U?N(F#OgpviU_Y{jYMsj65U3|PjwUOY}lUYj?MTiK_Il}NCVx-Eh zDx-TzMk7se+M#W_>?A1-x}ZXw3kkyz5kW)_hkjsi@RhKadN#H$Hq)$07*qoM6N<$f}lhwPXGV_ literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png new file mode 100755 index 0000000000000000000000000000000000000000..c4eff0387d5888c638ba09473ba6d2369f7b56f0 GIT binary patch literal 588 zcmV-S0<-;zP)HU2HvUSp%6 z*n}iP63IK?dpo;h@sj9~pcxo;VVTc-XLiP@DgefqE#NE=@oyUd-&HjLpsLIuSFXV-EMck)oQ(A`s%*^&wf0(rNiNHsU%=0Rw;WC z(kbc37l6fo`-0uR!pYkYv8U^3?nsh^@pw!K0TH3uYyx1_2>|JbXPmfskJ|1YAw9w! z9`N)1^Aesr;y5Nr5-ODn)oOL|CGi}f9!&iVwpK$khlIX10X$H6^A_stBJqvLhU$?V`QXqKme*s~gVDJ4A;LTs_e15jhc1;By a82kqHEPVYFAD2!50000JNR5;6( zlS@kiVHAe7MZY2;Xi-5)WxDDgv@tCUl*&p14T@Z~3ThM5LP4tuQfLu@EnG;nXc<8S z6&3BN?fx-cv-Kp6>HRiNTHE>$X( zD&=w+?GWC>?RLAGC6Yix;an~UmSt)tSf}1VS6N1N2ONORdD? zaj}w6DAZZdOud9Ep?M?{iQWbE5^9HLLZZF|1kdy0Tu4InEuboP9@nvbZ-P0n4AZTy zyMRIxRDmUE#LdqYuD=-Qz4N^bC`_#S7vcLn1M}{J(Wl3#c4VWczu&)AjUlh(11>gp>f`wv{KnjF%!aA*Jk N002ovPDHLkV1kkt*XsZP literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png new file mode 100755 index 0000000000000000000000000000000000000000..f59b7c4365fa1720af1aa04eb47167ddaa6eeed4 GIT binary patch literal 626 zcmV-&0*(ENP)ZS(e|#C2>JN4>y}l*tQ*E7zP@R2CCJnkW?xa6bgk%(hgtZ z0=~d?U3i`+Mvi4!&~+WPT1^NX#{u6&QIx+DE(oR{&T5&-ovF?@wGw)P&AtpHZa|G%V*GUUqL@@!d4V$`8=##4)ytY959JG zdc&Kho)&AL70^i z!PEmeeDWCB-UbK(*4JST44^tV2z_J(dn~+vBMJT97_7rzFio=~XczIv?PQ5$v%u~y zu(bteXb5I1h2zCV{Jc2~V{{yzZipgsP6;k264$*#5q?GzCm|CPa9CKqm4b116h3Pu z?+%Cm52plC8|5P0@igf2GV1KkCfk{Zecu=G@VNrf>s%g9c5D%@cfxVb6$nY`1IW=4 zt10QqSps_2JLp0f3I0j0u>#qA;v!+T))KEbCg|mo3q0pG{OR}p0fPds8+K~d>Hq)$ M07*qoM6N<$g1S2e3jhEB literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png new file mode 100755 index 0000000000000000000000000000000000000000..44084add79b9a0fc3354d16bbd4b4b5ff8095da7 GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$R@9E+gqH(@-qA%AW0|7U8+xDRI z0k`B18}ImRw2g{jTGP$Pmx3yI6F_2s&$|`cJ!i0UN zB3H;=r{#{FwLaNVJ&hZl9+MTHGx1T^-A=Q0?hRb#8a~x50X%;`b6ik3cw=#XdxWy= zgrpBoDjpwP&g9<9h3x!k_B!?vuTJVkmIJ-U N;OXk;vd$@?2>|rNdMN+^ literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png new file mode 100755 index 0000000000000000000000000000000000000000..3a1441c9a12062a4bb3d706000d3ca14399aebca GIT binary patch literal 565 zcmV-50?Pe~P)SCZIX8XZzY2l?gCw6LlgWJ5Avz#QX4|&mI8LN)w~J1vgL=KLAhlWz*=#m~gyvxa z&;iC6gb?aZvMdXxX`<0+D1hs_pqJ!wxqlEH;CJ)je~uL(gpi@v>!I0f_Kl=E(E+Tq z26na*9gribxx-Oft(HnstyXUUy!39&E-cI%J5Rsy;(PGZH{g{ty!HVC&yGPT3H8x# zw{^gBPW)O0FMoh{k%l<`1a|To_Wl&u&-GXm8izU|&<&utILc4wc6s@u1bmTz6x{qg zTw@7=FQRcg&r`h+gcR$*Jbv+*DPk7v)B@e0o2 z6IlBXW&8xh@9)YKiV~2>+z&XKd24JT55YWz&JtfvCg4r^~bLP79-yS@n$OW00000NkvXXu0mjf DStt2z literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png new file mode 100755 index 0000000000000000000000000000000000000000..e7708292adabf4821612bfca032cbd019c63180b GIT binary patch literal 634 zcmV-=0)_pFP)KrcWDBzIw9XCtIF5G<@j zP(;CSqHxUrerI>~wKyloM4~t_Ofl@UFEj6$Bmm6p1aK6H{5zI_FOn(%k{CiRq?CT< zoV}Ey-7=-5nVFes;1m!f?EqZLIs4k$n%39XN4dPbtX{9DZnvvaiWV0aH9I>yf;2<< zHmo7WNC<&iE4ji-iKJpsBApDKiAiqWy8R$FV|M@E-RCB03vjWNGQZJxKCc-cSB=dq z#v3snoDMC=4<2BDgiZrv0Veh~mz(X=S@;fbe>CJO_5|oe2o3=wgfW(StLzI-qr&kc zhXEJ?9=`nWXzrUKL_p*Kr9u@95MU9EKqp2vi+%&1&gUn&>Ut_d3>wiyiAJg5G7j%G z#$sf%Kqau!AAHP&4Q?edl!FWqpT=C{D}$15WC#5QQ<|d}62BjvZR2H60wE-%6;pyTSA|c6o&@eC9QG)Hj&ExYL zO&oVL^)+cM^qd@ApywS>pwx0H@RDN}hq;7mU-SKczYQ-hnrr=;iDAQMZQ+*g=YOM= z!QlMQEn7FbaD->uKAYgo_j9)W&$$zS*W9}m(ey0q$&7l-XEWO0Y(9M=SnhLbwy;d>@~SY$Ku*0xPvIOQeV1x7u_z-2-X>_74(yfh7C znXL|3GZ+d2`3re2hs?MKC#5QQ<|d}62BjvZR2H60wE-$R>*?YcqH(@;f-l!01CbW>s1Izr z3LkoHh<3E?TVANoG4CX|$empRCCS=R(U(hVJfm~E?IkDKRK&NP2|n`v>d(vV;W1uY zrFGVdwn;4b{qUtE`?GB`)E1ga&i2|7ncUL1b!KMq^QnT#_gn?_Z8(c`1Q~Vy3oL!N z$M8vHL&U1J3SJF!56azQU3B6>r|ZQ{U6)pC|tRy7$(5JQ<@7eB8yk=XcNf-aBIe#;8c_B$^=N z{-Iq&o3%O}V4~G($=zcP(LI|+6dq{?rby~MXwJQ*=!bOvl%?k zYY;jP^@M_k03MHL+-9?_3W5MN=moFW3xmPHU=-4Bw;62MrIhg_lwHEsv)V9U4x>+9cG2kIz8fWo`WyMMfz zdg-)p!<(hFR{VYSDJHEJn09O@#)%q0l?GUg9eS2~vKPUtd+=ak5lWLd-jI=;cjEf# zt$1;~?G!t@s+VLwL=P+Ks;E z!Jkh#NeohG;&02OFD7^EY zP!_PL2~i9VnPEW6Fz?O3dVF_U$duAL$=SU7&hNc@-drC5A4z=IgjR%B|D)?dOEaGb zuwod-$hPex$8oSoqK;@Z8u3EBfK@V2CKKqo?yA%2pjNA)(P%)HWf#)x^$?52W{|1b zPXOA$IfrSQV2q(qC_vLR)a!L9isAxjoeoJRlgE&G0Ga8krBVsGjZJJ-x6y1i(eL-q zwB%+o53no?l}ZJh#drAjlc6nhs3RTn;1IH+x;K#|X)!=#fM76)$IqT4^N}IF%aQ#o zTKS@*)|#L#jiCPi9~);c`x>TR|0{+9a?O5Exg#~V5W2C7G9nAAN(~f z2caqx&t~GhnK;qW3~&OuEke?%u(8Jxs_+ZVVz1^-uLrP95TahadGG$+(D&+%2QMF8 eFxE8s%l`oWamgLPAe&$S0000dKE@duOisOkyZ-5 zuwDqkAi_*y5o3Xrq7ieT<<3p#-R^dGySwea-CgZZZITBc?#1u+FtBuUCJUZe;~j-%Tu@ZpYB;$&ydfdZG#(j;(iB#^yRlqv#C*LO zXWXM0cpKKBlj#L6awm|;A38Zs3mg;sQZmCAZT8m@X{AlP6 zVI=SsiA16x=>2%^XV3U0y4~G+MNE!B{!#;~%L2l(14PX>EblXb{rnCSlVKe0dyf-O zuY#uOf}m&2xq80;4d3i|cuNw}U@sg3VKRU)>Os_1L3pl5mK*|?X3#a}K+EVZt&w?w zefXKP^ZqnW-3y9AhYJZ~r4m*!Z3OSz3d}2Q`nDM_f_u>L%8Cb}8`?bl)x?gwAy>zp z06y57kT6sry1g2l{|V%UW?)JwnbzUugbvpOF3=oZDo}spfs2EWKOH{_^59;ue!o^A z@e7dWS|QI`Ff-E$USJ`LqDF}zH%R}YOlMiv63A=qK^d}n!5_(fW%^k4U_D`_meIDi kNMKea>saR;>gt<+0gk_zsk5>Xc>n+a07*qoM6N<$f>Jg*?*IS* literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png new file mode 100755 index 0000000000000000000000000000000000000000..1eb880947ddf3e745c29e8d9dc90f09c7e6e323c GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$R?&;zfqH(@;q9b3Efq-lM(nr^( z=EYR73-9e)UYMWsXy%?aZsD68Yyv^2$~6QgEcljw%kx>O(f-gQ?@fOOx3A-0+Qw?O zRx~W)kn~Qe2d6f9nMG#g9Q04Mk==M~N!Dglvxk!fgVh#w@ZV$IY1+Xc`d{d2UcaP~ zfWp)_Ivqj}l2SPy^9ZWy6rG9Yx4v67_uA&&9|XA~5-#3)W3%em1peD8RWH^#O%XoM zxMPud%}GTj#~*+7JMxTd!`{^Q+>(D3*|@KV`*G2;{QnANOxu1$r2xIe;OXk;vd$@? F2>@zac~<}c literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png new file mode 100755 index 0000000000000000000000000000000000000000..ae8ecbf47672a874c0958d0d113a56162c2bd364 GIT binary patch literal 651 zcmV;60(AX}P)hkjP zNW|QGv-YFNLN^qH@tJycPNG5ti6B7;r4mEr#lr@*T8*M85D`{ZR^BWwF23T<%MYIh zdC)S*p=|xk^!~H=+HSZ183~y8v4|mYmZxt&)5{{~>J`>E223Q5>T$=~mtA71q-jdG z+eJhOAyBW^0k9Gk1+rX8)zFx((CG^&tDY>6XaS~Fy!WJON|Gdujg5^~Vzt@o%BcYLiNiTQSD`zL^ociBz_>bDlpw3kriQ@Z`bVsGz-_6N>$&gTDiKDTKR^ z-hB*tHa^>!oD~5TK^0UK5rZ}RBm50Bv}S-yA%s=Ha5RYb{)!z2N&$&64gfhybBu8p lh~_|?8^bu;BRYt{<}Yrwd83Y=s?Goa002ovPDHLkV1l%3CP4rI literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png new file mode 100755 index 0000000000000000000000000000000000000000..6ed2490ed1432d5d667a76235360824a1088e928 GIT binary patch literal 734 zcmV<40wMj0P)JT{hN;C#tgf#9krG=I>5!<*aE1_(spcgF}<`n4i zJi-}^6UUeU4jUFwdCiVPDm%`Zx^UBa8J(mnR6wEgz^}o8;)M*Y(@l_!Kfv)}4+NuM zaPXE50z)r)9=D=SR|RIqfQ^j}Hu!fzMeQBo+@PZk1G8hOw|vBTvkx`HM)Xe9q3xao z@`p0`NO!2904FHSLA6E@Y-O6zH$DQzvq@aHsz}}<(!v(Z_+EodX%R&NZW75g+nENo zV0020rxE^;7d!067AN>6*+&YLp$9uH6F-=In`XC{Cn%+o|5)b&boEPr02w@|P*oGm QmjD0&07*qoM6N<$g78X0Q~&?~ literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png new file mode 100755 index 0000000000000000000000000000000000000000..fecadd08afed92536be91ab12d8e37b6bf410d5d GIT binary patch literal 613 zcmV-r0-F7aP)wK%m(L+9IV|s|#(WRl-O^4GvaQsnHq|OstfO zIJ3}3<01}YGARE4m!7=)QisvlHUo!Qymx-@-t*p_129Ko-#pVI)6#!*kLj-AGXWNR zyA_{wKii_amK7^YT-v z6#plaNm#8`-kz@OvjIt^4%IN{@J3bR zRI}ME1Mv85p|%;RK>ViR>APPLB4;;BpCtqE@P+*7!G>I4UjNx~e>r3HA^tWCQ@S)l z{BslcSwL-CxQ&_ZZSv_g0Tu{yi*X){Mt|W7)lbE`SQxFP00000NkvXXu0mjf;)M*S literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png new file mode 100755 index 0000000000000000000000000000000000000000..fd4bbccdf1643f4ff5022fbc59b82546e259317e GIT binary patch literal 386 zcmV-|0e$|7P)_QM!1S$Bhw4w+iRuFWf;tfR6D%SMJrb+tx zC9R6{2>Ou6#juIy6u(I?|;&Owi$sRB4^20apB5xE2 z#B9XekY66S6lzfCL!eEQRgo0LokTA55@Y#%_wN!TXPw^Q4IIXsG~v#u_4t;x_HM16EQ@QRY+rut&97&UefsPmLrQ5P zBC2kcbux9L%2bJz$P$XV$*zSxb2e@6_3O#;&!FD<&hLjGn%~%en;7)djE^d6!t$lW7GyIOKlQ46hr`Z zjLNuRDP_53dNoN?wd&HMgL^m1DXFU<5dQsrceN>fSz00000)O9XRTN^$%%`*Fg>ryDtc(lF@?b>dE!20r+y z#Q*>(wbV5H`-E4Do={CJp7=ERhw15hgZi)?jRG88 zzVz(5;g?Td1izJyO33bhjg2Qc7FVY@f9!o)Gu?DII~vm-Dc?}3M!fsgjP?F(7`rgg z+xOk8XD)e?Zl=5+un`5!7kr?F=eq)K-5uqr%yU$1hLv){Vlm=)*5~`lwMciiXFu*g z)*Jkz6AF>#zb(Vx`Iv{bdGZHtlW)v(y5k^|xgSUc9%0}S20nrYrO}78ofk?bV!5)4 z=Ngz@+$9N1>>mA%IWx`Fqa240bWkiW;2TZgd8CZS0U}@mknC;!2;wi$eI@`h0y2JS`Eae0CW}q(2(%!m8 zWq$`PDU>LT1_y*bBv#P5<@q0@ttz$hIH}YMDvAigCc=y*)jY-VOpTd;A8@3t7Xh4r z0KTWOk;N2Ox4!&&^4B*no$WtTX!BXB)rg!y8dvGgKBQKLJNXRRp0}Bsjd1|LNQX~c zbC~fjrk2iL@4dYF*vt;}dFn(%h)n_-vzEIHMOKRkdF%3Lq|zBgKm_h>TEq!))nWjq zzn;B!?!(dQcHu$#=JF`cS&W~C`WHFW^B!~MI#k)>1Vk&eQy8P1O`J6V04{D@|7d6^ zyBABnh-d^H0FX&L07M||E0n_dp4v&Q%PSE9p#R#Hq)`5I_(B5CE#q dxjPz0{s-<+c#AC!i7@~G002ovPDHLkV1iPlpuqqD literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/style.css b/usb_auth/node_modules/express/node_modules/connect/lib/public/style.css new file mode 100644 index 0000000..32b6507 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/public/style.css @@ -0,0 +1,141 @@ +body { + margin: 0; + padding: 80px 100px; + font: 13px "Helvetica Neue", "Lucida Grande", "Arial"; + background: #ECE9E9 -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ECE9E9)); + background: #ECE9E9 -moz-linear-gradient(top, #fff, #ECE9E9); + background-repeat: no-repeat; + color: #555; + -webkit-font-smoothing: antialiased; +} +h1, h2, h3 { + margin: 0; + font-size: 22px; + color: #343434; +} +h1 em, h2 em { + padding: 0 5px; + font-weight: normal; +} +h1 { + font-size: 60px; +} +h2 { + margin-top: 10px; +} +h3 { + margin: 5px 0 10px 0; + padding-bottom: 5px; + border-bottom: 1px solid #eee; + font-size: 18px; +} +ul { + margin: 0; + padding: 0; +} +ul li { + margin: 5px 0; + padding: 3px 8px; + list-style: none; +} +ul li:hover { + cursor: pointer; + color: #2e2e2e; +} +ul li .path { + padding-left: 5px; + font-weight: bold; +} +ul li .line { + padding-right: 5px; + font-style: italic; +} +ul li:first-child .path { + padding-left: 0; +} +p { + line-height: 1.5; +} +a { + color: #555; + text-decoration: none; +} +a:hover { + color: #303030; +} +#stacktrace { + margin-top: 15px; +} +.directory h1 { + margin-bottom: 15px; + font-size: 18px; +} +ul#files { + width: 100%; + height: 500px; +} +ul#files li { + padding: 0; +} +ul#files li img { + position: absolute; + top: 5px; + left: 5px; +} +ul#files li a { + position: relative; + display: block; + margin: 1px; + width: 30%; + height: 25px; + line-height: 25px; + text-indent: 8px; + float: left; + border: 1px solid transparent; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + overflow: hidden; + text-overflow: ellipsis; +} +ul#files li a.icon { + text-indent: 25px; +} +ul#files li a:focus, +ul#files li a:hover { + outline: none; + background: rgba(255,255,255,0.65); + border: 1px solid #ececec; +} +ul#files li a.highlight { + -webkit-transition: background .4s ease-in-out; + background: #ffff4f; + border-color: #E9DC51; +} +#search { + display: block; + position: fixed; + top: 20px; + right: 20px; + width: 90px; + -webkit-transition: width ease 0.2s, opacity ease 0.4s; + -moz-transition: width ease 0.2s, opacity ease 0.4s; + -webkit-border-radius: 32px; + -moz-border-radius: 32px; + -webkit-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03); + -moz-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03); + -webkit-font-smoothing: antialiased; + text-align: left; + font: 13px "Helvetica Neue", Arial, sans-serif; + padding: 4px 10px; + border: none; + background: transparent; + margin-bottom: 0; + outline: none; + opacity: 0.7; + color: #888; +} +#search:focus { + width: 120px; + opacity: 1.0; +} diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/utils.js b/usb_auth/node_modules/express/node_modules/connect/lib/utils.js new file mode 100644 index 0000000..d0bc172 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/lib/utils.js @@ -0,0 +1,451 @@ + +/*! + * Connect - utils + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , Path = require('path') + , fs = require('fs'); + +/** + * Flatten the given `arr`. + * + * @param {Array} arr + * @return {Array} + * @api private + */ + +exports.flatten = function(arr, ret){ + var ret = ret || [] + , len = arr.length; + for (var i = 0; i < len; ++i) { + if (Array.isArray(arr[i])) { + exports.flatten(arr[i], ret); + } else { + ret.push(arr[i]); + } + } + return ret; +}; + +/** + * Return md5 hash of the given string and optional encoding, + * defaulting to hex. + * + * utils.md5('wahoo'); + * // => "e493298061761236c96b02ea6aa8a2ad" + * + * @param {String} str + * @param {String} encoding + * @return {String} + * @api public + */ + +exports.md5 = function(str, encoding){ + return crypto + .createHash('md5') + .update(str) + .digest(encoding || 'hex'); +}; + +/** + * Merge object b with object a. + * + * var a = { foo: 'bar' } + * , b = { bar: 'baz' }; + * + * utils.merge(a, b); + * // => { foo: 'bar', bar: 'baz' } + * + * @param {Object} a + * @param {Object} b + * @return {Object} + * @api public + */ + +exports.merge = function(a, b){ + if (a && b) { + for (var key in b) { + a[key] = b[key]; + } + } + return a; +}; + +/** + * Escape the given string of `html`. + * + * @param {String} html + * @return {String} + * @api public + */ + +exports.escape = function(html){ + return String(html) + .replace(/&(?!\w+;)/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +}; + + +/** + * Return a unique identifier with the given `len`. + * + * utils.uid(10); + * // => "FDaS435D2z" + * + * @param {Number} len + * @return {String} + * @api public + */ + +exports.uid = function(len) { + var buf = [] + , chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' + , charlen = chars.length; + + for (var i = 0; i < len; ++i) { + buf.push(chars[getRandomInt(0, charlen - 1)]); + } + + return buf.join(''); +}; + +/** + * Parse the given cookie string into an object. + * + * @param {String} str + * @return {Object} + * @api public + */ + +exports.parseCookie = function(str){ + var obj = {} + , pairs = str.split(/[;,] */); + for (var i = 0, len = pairs.length; i < len; ++i) { + var pair = pairs[i] + , eqlIndex = pair.indexOf('=') + , key = pair.substr(0, eqlIndex).trim().toLowerCase() + , val = pair.substr(++eqlIndex, pair.length).trim(); + + // quoted values + if ('"' == val[0]) val = val.slice(1, -1); + + // only assign once + if (undefined == obj[key]) { + val = val.replace(/\+/g, ' '); + try { + obj[key] = decodeURIComponent(val); + } catch (err) { + if (err instanceof URIError) { + obj[key] = val; + } else { + throw err; + } + } + } + } + return obj; +}; + +/** + * Serialize the given object into a cookie string. + * + * utils.serializeCookie('name', 'tj', { httpOnly: true }) + * // => "name=tj; httpOnly" + * + * @param {String} name + * @param {String} val + * @param {Object} obj + * @return {String} + * @api public + */ + +exports.serializeCookie = function(name, val, obj){ + var pairs = [name + '=' + encodeURIComponent(val)] + , obj = obj || {}; + + if (obj.domain) pairs.push('domain=' + obj.domain); + if (obj.path) pairs.push('path=' + obj.path); + if (obj.expires) pairs.push('expires=' + obj.expires.toUTCString()); + if (obj.httpOnly) pairs.push('httpOnly'); + if (obj.secure) pairs.push('secure'); + + return pairs.join('; '); +}; + +/** + * Pause `data` and `end` events on the given `obj`. + * Middleware performing async tasks _should_ utilize + * this utility (or similar), to re-emit data once + * the async operation has completed, otherwise these + * events may be lost. + * + * var pause = utils.pause(req); + * fs.readFile(path, function(){ + * next(); + * pause.resume(); + * }); + * + * @param {Object} obj + * @return {Object} + * @api public + */ + +exports.pause = function(obj){ + var onData + , onEnd + , events = []; + + // buffer data + obj.on('data', onData = function(data, encoding){ + events.push(['data', data, encoding]); + }); + + // buffer end + obj.on('end', onEnd = function(data, encoding){ + events.push(['end', data, encoding]); + }); + + return { + end: function(){ + obj.removeListener('data', onData); + obj.removeListener('end', onEnd); + }, + resume: function(){ + this.end(); + for (var i = 0, len = events.length; i < len; ++i) { + obj.emit.apply(obj, events[i]); + } + } + }; +}; + +/** + * Check `req` and `res` to see if it has been modified. + * + * @param {IncomingMessage} req + * @param {ServerResponse} res + * @return {Boolean} + * @api public + */ + +exports.modified = function(req, res, headers) { + var headers = headers || res._headers || {} + , modifiedSince = req.headers['if-modified-since'] + , lastModified = headers['last-modified'] + , noneMatch = req.headers['if-none-match'] + , etag = headers['etag']; + + if (noneMatch) noneMatch = noneMatch.split(/ *, */); + + // check If-None-Match + if (noneMatch && etag && ~noneMatch.indexOf(etag)) { + return false; + } + + // check If-Modified-Since + if (modifiedSince && lastModified) { + modifiedSince = new Date(modifiedSince); + lastModified = new Date(lastModified); + // Ignore invalid dates + if (!isNaN(modifiedSince.getTime())) { + if (lastModified <= modifiedSince) return false; + } + } + + return true; +}; + +/** + * Strip `Content-*` headers from `res`. + * + * @param {ServerResponse} res + * @api public + */ + +exports.removeContentHeaders = function(res){ + Object.keys(res._headers).forEach(function(field){ + if (0 == field.indexOf('content')) { + res.removeHeader(field); + } + }); +}; + +/** + * Check if `req` is a conditional GET request. + * + * @param {IncomingMessage} req + * @return {Boolean} + * @api public + */ + +exports.conditionalGET = function(req) { + return req.headers['if-modified-since'] + || req.headers['if-none-match']; +}; + +/** + * Respond with 403 "Forbidden". + * + * @param {ServerResponse} res + * @api public + */ + +exports.forbidden = function(res) { + var body = 'Forbidden'; + res.setHeader('Content-Type', 'text/plain'); + res.setHeader('Content-Length', body.length); + res.statusCode = 403; + res.end(body); +}; + +/** + * Respond with 401 "Unauthorized". + * + * @param {ServerResponse} res + * @param {String} realm + * @api public + */ + +exports.unauthorized = function(res, realm) { + res.statusCode = 401; + res.setHeader('WWW-Authenticate', 'Basic realm="' + realm + '"'); + res.end('Unauthorized'); +}; + +/** + * Respond with 400 "Bad Request". + * + * @param {ServerResponse} res + * @api public + */ + +exports.badRequest = function(res) { + res.statusCode = 400; + res.end('Bad Request'); +}; + +/** + * Respond with 304 "Not Modified". + * + * @param {ServerResponse} res + * @param {Object} headers + * @api public + */ + +exports.notModified = function(res) { + exports.removeContentHeaders(res); + res.statusCode = 304; + res.end(); +}; + +/** + * Return an ETag in the form of `"-"` + * from the given `stat`. + * + * @param {Object} stat + * @return {String} + * @api public + */ + +exports.etag = function(stat) { + return '"' + stat.size + '-' + Number(stat.mtime) + '"'; +}; + +/** + * Parse "Range" header `str` relative to the given file `size`. + * + * @param {Number} size + * @param {String} str + * @return {Array} + * @api public + */ + +exports.parseRange = function(size, str){ + var valid = true; + var arr = str.substr(6).split(',').map(function(range){ + var range = range.split('-') + , start = parseInt(range[0], 10) + , end = parseInt(range[1], 10); + + // -500 + if (isNaN(start)) { + start = size - end; + end = size - 1; + // 500- + } else if (isNaN(end)) { + end = size - 1; + } + + // Invalid + if (isNaN(start) || isNaN(end) || start > end) valid = false; + + return { start: start, end: end }; + }); + return valid ? arr : undefined; +}; + +/** + * Parse the given Cache-Control `str`. + * + * @param {String} str + * @return {Object} + * @api public + */ + +exports.parseCacheControl = function(str){ + var directives = str.split(',') + , obj = {}; + + for(var i = 0, len = directives.length; i < len; i++) { + var parts = directives[i].split('=') + , key = parts.shift().trim() + , val = parseInt(parts.shift(), 10); + + obj[key] = isNaN(val) ? true : val; + } + + return obj; +}; + + +/** + * Convert array-like object to an `Array`. + * + * node-bench measured "16.5 times faster than Array.prototype.slice.call()" + * + * @param {Object} obj + * @return {Array} + * @api public + */ + +var toArray = exports.toArray = function(obj){ + var len = obj.length + , arr = new Array(len); + for (var i = 0; i < len; ++i) { + arr[i] = obj[i]; + } + return arr; +}; + +/** + * Retrun a random int, used by `utils.uid()` + * + * @param {Number} min + * @param {Number} max + * @return {Number} + * @api private + */ + +function getRandomInt(min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; +} diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/..travis.yml.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/..travis.yml.un~ new file mode 100644 index 0000000000000000000000000000000000000000..5dc982fce6fb6694dbdcae443e5a802ea26f7f90 GIT binary patch literal 953 zcmWH`%$*;a=aT=FfvLGaXYHXQ%)gz~yID`YatKNKb=_A?ZZ)IGZo`!)V!!QUU|?VY zVr0Mw_=LwfIGWH^pcyvGr6dG^(R2oyYrxS2$`i2Q2L(L4f`YDs Lfu5;p~v?DJU?c3r(N-yoyY!M@ZA|| zZtuN%{<>2g3-&+lKKZdyDo*U|cB(%ccW&HX{y2BnaWYd*H^x+%5#?!BN2w2Isg%oR z@oCO^`c+*pq)HU{=$trC;N+JG*@6=rhtI$T(dD@62AWfMF2AlCFawZfnlvPi*}10VR*V1A9)sm|OA3#sLX5vwRyI36{I3}cLD25r_ASr{Oa zxV}BWbv~6V9FG|zhp~ROwXQ~DQdN__*XM?U025B8lB+X*cxu^wN`V zv}>o#qD`N>8=4MOdS{9;f)R9bYFav^WPnIQ_eIhT_otieM^}j%o`ee?UyRqVv-E2$ zqMPG--v~o|b*cltFr7eyHANN%h$N=pq-nOl>8-<A^~Y` cSd!+tq)5H^3ReDr@#nQhw@Q@Rt-UwD0dLwRtN;K2 literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore new file mode 100644 index 0000000..4fbabb3 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore @@ -0,0 +1,4 @@ +/test/tmp/ +*.upload +*.un~ +*.http diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.package.json.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.package.json.un~ new file mode 100644 index 0000000000000000000000000000000000000000..26c5b26c92be8977ee5b5204a8156a1e1a3e8ba7 GIT binary patch literal 542 zcmWH`%$*;a=aT=Ff$8}Zxt^rL1?Q$te0Ff%Dc4$uz)iCgIF`P2U-0#OxM;8f0|SE? z5F-OdAP0m&0LBLM{VsbHus}rOFF@o`NRSjeOyoZhz>R?kj?z>N0bq3GL!;xX1khYI hAch4$C@O>%fIulNu}H~ELCHYRK+jxB$F%YJDgYFGC4T?_ literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml new file mode 100644 index 0000000..f1d0f13 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Makefile b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Makefile new file mode 100644 index 0000000..8945872 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Makefile @@ -0,0 +1,14 @@ +SHELL := /bin/bash + +test: + @./test/run.js + +build: npm test + +npm: + npm install . + +clean: + rm test/tmp/* + +.PHONY: test clean build diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md new file mode 100644 index 0000000..3427514 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md @@ -0,0 +1,303 @@ +# Formidable + +[![Build Status](https://secure.travis-ci.org/felixge/node-formidable.png)](http://travis-ci.org/felixge/node-formidable) + +## Purpose + +A node.js module for parsing form data, especially file uploads. + +## Current status + +This module was developed for [Transloadit](http://transloadit.com/), a service focused on uploading +and encoding images and videos. It has been battle-tested against hundreds of GB of file uploads from +a large variety of clients and is considered production-ready. + +## Features + +* Fast (~500mb/sec), non-buffering multipart parser +* Automatically writing file uploads to disk +* Low memory footprint +* Graceful error handling +* Very high test coverage + +## Changelog + +### v1.0.9 + +* Emit progress when content length header parsed (Tim Koschützki) +* Fix Readme syntax due to GitHub changes (goob) +* Replace references to old 'sys' module in Readme with 'util' (Peter Sugihara) + +### v1.0.8 + +* Strip potentially unsafe characters when using `keepExtensions: true`. +* Switch to utest / urun for testing +* Add travis build + +### v1.0.7 + +* Remove file from package that was causing problems when installing on windows. (#102) +* Fix typos in Readme (Jason Davies). + +### v1.0.6 + +* Do not default to the default to the field name for file uploads where + filename="". + +### v1.0.5 + +* Support filename="" in multipart parts +* Explain unexpected end() errors in parser better + +**Note:** Starting with this version, formidable emits 'file' events for empty +file input fields. Previously those were incorrectly emitted as regular file +input fields with value = "". + +### v1.0.4 + +* Detect a good default tmp directory regardless of platform. (#88) + +### v1.0.3 + +* Fix problems with utf8 characters (#84) / semicolons in filenames (#58) +* Small performance improvements +* New test suite and fixture system + +### v1.0.2 + +* Exclude node\_modules folder from git +* Implement new `'aborted'` event +* Fix files in example folder to work with recent node versions +* Make gently a devDependency + +[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.1...v1.0.2) + +### v1.0.1 + +* Fix package.json to refer to proper main directory. (#68, Dean Landolt) + +[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.0...v1.0.1) + +### v1.0.0 + +* Add support for multipart boundaries that are quoted strings. (Jeff Craig) + +This marks the beginning of development on version 2.0 which will include +several architectural improvements. + +[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.11...v1.0.0) + +### v0.9.11 + +* Emit `'progress'` event when receiving data, regardless of parsing it. (Tim Koschützki) +* Use [W3C FileAPI Draft](http://dev.w3.org/2006/webapi/FileAPI/) properties for File class + +**Important:** The old property names of the File class will be removed in a +future release. + +[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.10...v0.9.11) + +### Older releases + +These releases were done before starting to maintain the above Changelog: + +* [v0.9.10](https://github.com/felixge/node-formidable/compare/v0.9.9...v0.9.10) +* [v0.9.9](https://github.com/felixge/node-formidable/compare/v0.9.8...v0.9.9) +* [v0.9.8](https://github.com/felixge/node-formidable/compare/v0.9.7...v0.9.8) +* [v0.9.7](https://github.com/felixge/node-formidable/compare/v0.9.6...v0.9.7) +* [v0.9.6](https://github.com/felixge/node-formidable/compare/v0.9.5...v0.9.6) +* [v0.9.5](https://github.com/felixge/node-formidable/compare/v0.9.4...v0.9.5) +* [v0.9.4](https://github.com/felixge/node-formidable/compare/v0.9.3...v0.9.4) +* [v0.9.3](https://github.com/felixge/node-formidable/compare/v0.9.2...v0.9.3) +* [v0.9.2](https://github.com/felixge/node-formidable/compare/v0.9.1...v0.9.2) +* [v0.9.1](https://github.com/felixge/node-formidable/compare/v0.9.0...v0.9.1) +* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) +* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) +* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) +* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) +* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) +* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) +* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) +* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) +* [v0.1.0](https://github.com/felixge/node-formidable/commits/v0.1.0) + +## Installation + +Via [npm](http://github.com/isaacs/npm): + + npm install formidable@latest + +Manually: + + git clone git://github.com/felixge/node-formidable.git formidable + vim my.js + # var formidable = require('./formidable'); + +Note: Formidable requires [gently](http://github.com/felixge/node-gently) to run the unit tests, but you won't need it for just using the library. + +## Example + +Parse an incoming file upload. + + var formidable = require('formidable'), + http = require('http'), + + util = require('util'); + + http.createServer(function(req, res) { + if (req.url == '/upload' && req.method.toLowerCase() == 'post') { + // parse a file upload + var form = new formidable.IncomingForm(); + form.parse(req, function(err, fields, files) { + res.writeHead(200, {'content-type': 'text/plain'}); + res.write('received upload:\n\n'); + res.end(util.inspect({fields: fields, files: files})); + }); + return; + } + + // show a file upload form + res.writeHead(200, {'content-type': 'text/html'}); + res.end( + '
    '+ + '
    '+ + '
    '+ + ''+ + '
    ' + ); + }).listen(80); + +## API + +### formidable.IncomingForm + +__new formidable.IncomingForm()__ + +Creates a new incoming form. + +__incomingForm.encoding = 'utf-8'__ + +The encoding to use for incoming form fields. + +__incomingForm.uploadDir = process.env.TMP || '/tmp' || process.cwd()__ + +The directory for placing file uploads in. You can move them later on using +`fs.rename()`. The default directory is picked at module load time depending on +the first existing directory from those listed above. + +__incomingForm.keepExtensions = false__ + +If you want the files written to `incomingForm.uploadDir` to include the extensions of the original files, set this property to `true`. + +__incomingForm.type__ + +Either 'multipart' or 'urlencoded' depending on the incoming request. + +__incomingForm.maxFieldsSize = 2 * 1024 * 1024__ + +Limits the amount of memory a field (not file) can allocate in bytes. +If this value is exceeded, an `'error'` event is emitted. The default +size is 2MB. + +__incomingForm.bytesReceived__ + +The amount of bytes received for this form so far. + +__incomingForm.bytesExpected__ + +The expected number of bytes in this form. + +__incomingForm.parse(request, [cb])__ + +Parses an incoming node.js `request` containing form data. If `cb` is provided, all fields an files are collected and passed to the callback: + + incomingForm.parse(req, function(err, fields, files) { + // ... + }); + +__incomingForm.onPart(part)__ + +You may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events processing which would occur otherwise, making you fully responsible for handling the processing. + + incomingForm.onPart = function(part) { + part.addListener('data', function() { + // ... + }); + } + +If you want to use formidable to only handle certain parts for you, you can do so: + + incomingForm.onPart = function(part) { + if (!part.filename) { + // let formidable handle all non-file parts + incomingForm.handlePart(part); + } + } + +Check the code in this method for further inspiration. + +__Event: 'progress' (bytesReceived, bytesExpected)__ + +Emitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar. + +__Event: 'field' (name, value)__ + +Emitted whenever a field / value pair has been received. + +__Event: 'fileBegin' (name, file)__ + +Emitted whenever a new file is detected in the upload stream. Use this even if +you want to stream the file to somewhere else while buffering the upload on +the file system. + +__Event: 'file' (name, file)__ + +Emitted whenever a field / file pair has been received. `file` is an instance of `File`. + +__Event: 'error' (err)__ + +Emitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events. + +__Event: 'aborted'__ + +Emitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core). + +__Event: 'end' ()__ + +Emitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response. + +### formidable.File + +__file.size = 0__ + +The size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet. + +__file.path = null__ + +The path this file is being written to. You can modify this in the `'fileBegin'` event in +case you are unhappy with the way formidable generates a temporary path for your files. + +__file.name = null__ + +The name this file had according to the uploading client. + +__file.type = null__ + +The mime type of this file, according to the uploading client. + +__file.lastModifiedDate = null__ + +A date object (or `null`) containing the time this file was last written to. Mostly +here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/). + +## License + +Formidable is licensed under the MIT license. + +## Ports + +* [multipart-parser](http://github.com/FooBarWidget/multipart-parser): a C++ parser based on formidable + +## Credits + +* [Ryan Dahl](http://twitter.com/ryah) for his work on [http-parser](http://github.com/ry/http-parser) which heavily inspired multipart_parser.js diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/TODO b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/TODO new file mode 100644 index 0000000..e1107f2 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/TODO @@ -0,0 +1,3 @@ +- Better bufferMaxSize handling approach +- Add tests for JSON parser pull request and merge it +- Implement QuerystringParser the same way as MultipartParser diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js new file mode 100644 index 0000000..bff41f1 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js @@ -0,0 +1,70 @@ +require('../test/common'); +var multipartParser = require('../lib/multipart_parser'), + MultipartParser = multipartParser.MultipartParser, + parser = new MultipartParser(), + Buffer = require('buffer').Buffer, + boundary = '-----------------------------168072824752491622650073', + mb = 100, + buffer = createMultipartBuffer(boundary, mb * 1024 * 1024), + callbacks = + { partBegin: -1, + partEnd: -1, + headerField: -1, + headerValue: -1, + partData: -1, + end: -1, + }; + + +parser.initWithBoundary(boundary); +parser.onHeaderField = function() { + callbacks.headerField++; +}; + +parser.onHeaderValue = function() { + callbacks.headerValue++; +}; + +parser.onPartBegin = function() { + callbacks.partBegin++; +}; + +parser.onPartData = function() { + callbacks.partData++; +}; + +parser.onPartEnd = function() { + callbacks.partEnd++; +}; + +parser.onEnd = function() { + callbacks.end++; +}; + +var start = +new Date(), + nparsed = parser.write(buffer), + duration = +new Date - start, + mbPerSec = (mb / (duration / 1000)).toFixed(2); + +console.log(mbPerSec+' mb/sec'); + +assert.equal(nparsed, buffer.length); + +function createMultipartBuffer(boundary, size) { + var head = + '--'+boundary+'\r\n' + + 'content-disposition: form-data; name="field1"\r\n' + + '\r\n' + , tail = '\r\n--'+boundary+'--\r\n' + , buffer = new Buffer(size); + + buffer.write(head, 'ascii', 0); + buffer.write(tail, 'ascii', buffer.length - tail.length); + return buffer; +} + +process.on('exit', function() { + for (var k in callbacks) { + assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]); + } +}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js new file mode 100644 index 0000000..f6c15a6 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js @@ -0,0 +1,43 @@ +require('../test/common'); +var http = require('http'), + util = require('util'), + formidable = require('formidable'), + server; + +server = http.createServer(function(req, res) { + if (req.url == '/') { + res.writeHead(200, {'content-type': 'text/html'}); + res.end( + '
    '+ + '
    '+ + '
    '+ + ''+ + '
    ' + ); + } else if (req.url == '/post') { + var form = new formidable.IncomingForm(), + fields = []; + + form + .on('error', function(err) { + res.writeHead(200, {'content-type': 'text/plain'}); + res.end('error:\n\n'+util.inspect(err)); + }) + .on('field', function(field, value) { + console.log(field, value); + fields.push([field, value]); + }) + .on('end', function() { + console.log('-> post done'); + res.writeHead(200, {'content-type': 'text/plain'}); + res.end('received fields:\n\n '+util.inspect(fields)); + }); + form.parse(req); + } else { + res.writeHead(404, {'content-type': 'text/plain'}); + res.end('404'); + } +}); +server.listen(TEST_PORT); + +console.log('listening on http://localhost:'+TEST_PORT+'/'); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js new file mode 100644 index 0000000..050cdd9 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js @@ -0,0 +1,48 @@ +require('../test/common'); +var http = require('http'), + util = require('util'), + formidable = require('formidable'), + server; + +server = http.createServer(function(req, res) { + if (req.url == '/') { + res.writeHead(200, {'content-type': 'text/html'}); + res.end( + '
    '+ + '
    '+ + '
    '+ + ''+ + '
    ' + ); + } else if (req.url == '/upload') { + var form = new formidable.IncomingForm(), + files = [], + fields = []; + + form.uploadDir = TEST_TMP; + + form + .on('field', function(field, value) { + console.log(field, value); + fields.push([field, value]); + }) + .on('file', function(field, file) { + console.log(field, file); + files.push([field, file]); + }) + .on('end', function() { + console.log('-> upload done'); + res.writeHead(200, {'content-type': 'text/plain'}); + res.write('received fields:\n\n '+util.inspect(fields)); + res.write('\n\n'); + res.end('received files:\n\n '+util.inspect(files)); + }); + form.parse(req); + } else { + res.writeHead(404, {'content-type': 'text/plain'}); + res.end('404'); + } +}); +server.listen(TEST_PORT); + +console.log('listening on http://localhost:'+TEST_PORT+'/'); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/index.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/index.js new file mode 100644 index 0000000..be41032 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/formidable'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/.incoming_form.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/.incoming_form.js.un~ new file mode 100644 index 0000000000000000000000000000000000000000..2e3220132c00294f535af61df327cd09af6553b0 GIT binary patch literal 12289 zcmeI2%T5$Q6o$KDKt@qPK)gg56=5dh%&5^sLNGDnEm3d-UV!LGhH!@vf@n<84I3Z9 zg$p*uxbYEu0!?@ZSDQjF-B|UYjn(jWFum7s*sv4e}dp|Vazwq6w zx$^7k*R_>b4eNCs?XMqv`MH$IG_GxY8tVPrvvKFc+XJ5GzwkWoVuDg(bs1Tr4_0=m zusE9^FC=rx(d*B;>*24QvkHis5X` zd-4ruDb*A+{-sm?6j=vR`a_9t#i!iQzed0xrz_fvSFwFc?yy2R+XI_-uQ3kK`+cMs zdNA~#(;t9RO*~#wj|;uaZx|iU*P<+mF#6MEGfsyt2#Z~AgzkD2y83v0CBKvqSb!2! zt`Il}OU0uq(+F07B&O@Ic2HHSeQnzZfIE4sQI&W1dZYubcyr% zxk4h{msrd%PiCoiL^(MzHCup@>J`~Ra`nndqRO&sK%FD0B4c41k-Vu%(#WEudusqm zB|M03kMe}jIpL{zRAn0Bx~*}Q3$IZNPZS1qv6{p;!pF#(P<9HFs90u3$nHfUYtqQ@ z5h2*1vbge!5OTxl#{DWNwx$ubft|1g<9n!TuX2HKv9h?zDN9Ah!ZboOSdIvv*GTyE z3NS%M`%sod$XH1{+IN_Ou-N5BnC_Qj!eDWg9tcb^G=TgKt$VWo9`wbddU20Hy537- zQFUenZ#W8GGvMi|uatCO5Zr#{ATeZa&8TytQ<1SStLN5I&MlV<$U$v1#~CJ~=*Wf9 zsM0VZ_b^Ivt=q_DLv#=vj}OI5OjV;tY(d$HPNHI&8KHX=g|2NIy3s9mkQ{%KiF?G6 z*|nnV*hy3@Gb477qu8}qU^g-rDi5mTu1y>yl1z`6cpN=TY;u_qy|E~ICo0jC1-g(S z)OSdEN<3Z1r{YnSX~ghp6vK`PhUrvD5h~>VPTVD;OtAxHr$mX0WoAV2SrkP;Ecsw4 zT`LbULWtb;iKm2=F`h=*VU(y?W=0q%qA+&uf{`{nbO#?4P-C0&l&~_&lc;kjRb(to zBb1X-D7$t?iM=cGT@OtjR(=v#o=odPor9?&V__P>oYpXd^}1j(jbUQFj^<=&Q_>D= zufgIgR4Kb(*job2%5*cM7Vye1F@iaxVFvS`0nB8yGPm}Xi8i52+M^UELd)9Z3a8C5 zE>;FdQWoS`Bw~BRbUU_btJp#XocuIQbY}&p;buX-tt`C9S=?h+earg*X&>cFi$C;k zu;*NI?}Lhrg=zFYEb{x{7q<@5Oq@SQ2jm?rZ$Pfc)YA!lObEVP>=` c6kM~4DA*?xw1dShYq1ivyeHpUvp+um1>qtr4FCWD literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js new file mode 100644 index 0000000..6dc8720 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js @@ -0,0 +1,61 @@ +if (global.GENTLY) require = GENTLY.hijack(require); + +var util = require('./util'), + WriteStream = require('fs').WriteStream, + EventEmitter = require('events').EventEmitter; + +function File(properties) { + EventEmitter.call(this); + + this.size = 0; + this.path = null; + this.name = null; + this.type = null; + this.lastModifiedDate = null; + + this._writeStream = null; + + for (var key in properties) { + this[key] = properties[key]; + } + + this._backwardsCompatibility(); +} +module.exports = File; +util.inherits(File, EventEmitter); + +// @todo Next release: Show error messages when accessing these +File.prototype._backwardsCompatibility = function() { + var self = this; + this.__defineGetter__('length', function() { + return self.size; + }); + this.__defineGetter__('filename', function() { + return self.name; + }); + this.__defineGetter__('mime', function() { + return self.type; + }); +}; + +File.prototype.open = function() { + this._writeStream = new WriteStream(this.path); +}; + +File.prototype.write = function(buffer, cb) { + var self = this; + this._writeStream.write(buffer, function() { + self.lastModifiedDate = new Date(); + self.size += buffer.length; + self.emit('progress', self.size); + cb(); + }); +}; + +File.prototype.end = function(cb) { + var self = this; + this._writeStream.end(function() { + self.emit('end'); + cb(); + }); +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js new file mode 100644 index 0000000..b1e2bfb --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js @@ -0,0 +1,378 @@ +if (global.GENTLY) require = GENTLY.hijack(require); + +var fs = require('fs'); +var util = require('./util'), + path = require('path'), + File = require('./file'), + MultipartParser = require('./multipart_parser').MultipartParser, + QuerystringParser = require('./querystring_parser').QuerystringParser, + StringDecoder = require('string_decoder').StringDecoder, + EventEmitter = require('events').EventEmitter; + +function IncomingForm() { + if (!(this instanceof IncomingForm)) return new IncomingForm; + EventEmitter.call(this); + + this.error = null; + this.ended = false; + + this.maxFieldsSize = 2 * 1024 * 1024; + this.keepExtensions = false; + this.uploadDir = IncomingForm.UPLOAD_DIR; + this.encoding = 'utf-8'; + this.headers = null; + this.type = null; + + this.bytesReceived = null; + this.bytesExpected = null; + + this._parser = null; + this._flushing = 0; + this._fieldsSize = 0; +}; +util.inherits(IncomingForm, EventEmitter); +exports.IncomingForm = IncomingForm; + +IncomingForm.UPLOAD_DIR = (function() { + var dirs = [process.env.TMP, '/tmp', process.cwd()]; + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + var isDirectory = false; + + try { + isDirectory = fs.statSync(dir).isDirectory(); + } catch (e) {} + + if (isDirectory) return dir; + } +})(); + +IncomingForm.prototype.parse = function(req, cb) { + this.pause = function() { + try { + req.pause(); + } catch (err) { + // the stream was destroyed + if (!this.ended) { + // before it was completed, crash & burn + this._error(err); + } + return false; + } + return true; + }; + + this.resume = function() { + try { + req.resume(); + } catch (err) { + // the stream was destroyed + if (!this.ended) { + // before it was completed, crash & burn + this._error(err); + } + return false; + } + + return true; + }; + + this.writeHeaders(req.headers); + + var self = this; + req + .on('error', function(err) { + self._error(err); + }) + .on('aborted', function() { + self.emit('aborted'); + }) + .on('data', function(buffer) { + self.write(buffer); + }) + .on('end', function() { + if (self.error) { + return; + } + + var err = self._parser.end(); + if (err) { + self._error(err); + } + }); + + if (cb) { + var fields = {}, files = {}; + this + .on('field', function(name, value) { + fields[name] = value; + }) + .on('file', function(name, file) { + files[name] = file; + }) + .on('error', function(err) { + cb(err, fields, files); + }) + .on('end', function() { + cb(null, fields, files); + }); + } + + return this; +}; + +IncomingForm.prototype.writeHeaders = function(headers) { + this.headers = headers; + this._parseContentLength(); + this._parseContentType(); +}; + +IncomingForm.prototype.write = function(buffer) { + if (!this._parser) { + this._error(new Error('unintialized parser')); + return; + } + + this.bytesReceived += buffer.length; + this.emit('progress', this.bytesReceived, this.bytesExpected); + + var bytesParsed = this._parser.write(buffer); + if (bytesParsed !== buffer.length) { + this._error(new Error('parser error, '+bytesParsed+' of '+buffer.length+' bytes parsed')); + } + + return bytesParsed; +}; + +IncomingForm.prototype.pause = function() { + // this does nothing, unless overwritten in IncomingForm.parse + return false; +}; + +IncomingForm.prototype.resume = function() { + // this does nothing, unless overwritten in IncomingForm.parse + return false; +}; + +IncomingForm.prototype.onPart = function(part) { + // this method can be overwritten by the user + this.handlePart(part); +}; + +IncomingForm.prototype.handlePart = function(part) { + var self = this; + + if (part.filename === undefined) { + var value = '' + , decoder = new StringDecoder(this.encoding); + + part.on('data', function(buffer) { + self._fieldsSize += buffer.length; + if (self._fieldsSize > self.maxFieldsSize) { + self._error(new Error('maxFieldsSize exceeded, received '+self._fieldsSize+' bytes of field data')); + return; + } + value += decoder.write(buffer); + }); + + part.on('end', function() { + self.emit('field', part.name, value); + }); + return; + } + + this._flushing++; + + var file = new File({ + path: this._uploadPath(part.filename), + name: part.filename, + type: part.mime, + }); + + this.emit('fileBegin', part.name, file); + + file.open(); + + part.on('data', function(buffer) { + self.pause(); + file.write(buffer, function() { + self.resume(); + }); + }); + + part.on('end', function() { + file.end(function() { + self._flushing--; + self.emit('file', part.name, file); + self._maybeEnd(); + }); + }); +}; + +IncomingForm.prototype._parseContentType = function() { + if (!this.headers['content-type']) { + this._error(new Error('bad content-type header, no content-type')); + return; + } + + if (this.headers['content-type'].match(/urlencoded/i)) { + this._initUrlencoded(); + return; + } + + if (this.headers['content-type'].match(/multipart/i)) { + var m; + if (m = this.headers['content-type'].match(/boundary=(?:"([^"]+)"|([^;]+))/i)) { + this._initMultipart(m[1] || m[2]); + } else { + this._error(new Error('bad content-type header, no multipart boundary')); + } + return; + } + + this._error(new Error('bad content-type header, unknown content-type: '+this.headers['content-type'])); +}; + +IncomingForm.prototype._error = function(err) { + if (this.error) { + return; + } + + this.error = err; + this.pause(); + this.emit('error', err); +}; + +IncomingForm.prototype._parseContentLength = function() { + if (this.headers['content-length']) { + this.bytesReceived = 0; + this.bytesExpected = parseInt(this.headers['content-length'], 10); + this.emit('progress', this.bytesReceived, this.bytesExpected); + } +}; + +IncomingForm.prototype._newParser = function() { + return new MultipartParser(); +}; + +IncomingForm.prototype._initMultipart = function(boundary) { + this.type = 'multipart'; + + var parser = new MultipartParser(), + self = this, + headerField, + headerValue, + part; + + parser.initWithBoundary(boundary); + + parser.onPartBegin = function() { + part = new EventEmitter(); + part.headers = {}; + part.name = null; + part.filename = null; + part.mime = null; + headerField = ''; + headerValue = ''; + }; + + parser.onHeaderField = function(b, start, end) { + headerField += b.toString(self.encoding, start, end); + }; + + parser.onHeaderValue = function(b, start, end) { + headerValue += b.toString(self.encoding, start, end); + }; + + parser.onHeaderEnd = function() { + headerField = headerField.toLowerCase(); + part.headers[headerField] = headerValue; + + var m; + if (headerField == 'content-disposition') { + if (m = headerValue.match(/name="([^"]+)"/i)) { + part.name = m[1]; + } + + part.filename = self._fileName(headerValue); + } else if (headerField == 'content-type') { + part.mime = headerValue; + } + + headerField = ''; + headerValue = ''; + }; + + parser.onHeadersEnd = function() { + self.onPart(part); + }; + + parser.onPartData = function(b, start, end) { + part.emit('data', b.slice(start, end)); + }; + + parser.onPartEnd = function() { + part.emit('end'); + }; + + parser.onEnd = function() { + self.ended = true; + self._maybeEnd(); + }; + + this._parser = parser; +}; + +IncomingForm.prototype._fileName = function(headerValue) { + var m = headerValue.match(/filename="(.*?)"($|; )/i) + if (!m) return; + + var filename = m[1].substr(m[1].lastIndexOf('\\') + 1); + filename = filename.replace(/%22/g, '"'); + filename = filename.replace(/&#([\d]{4});/g, function(m, code) { + return String.fromCharCode(code); + }); + return filename; +}; + +IncomingForm.prototype._initUrlencoded = function() { + this.type = 'urlencoded'; + + var parser = new QuerystringParser() + , self = this; + + parser.onField = function(key, val) { + self.emit('field', key, val); + }; + + parser.onEnd = function() { + self.ended = true; + self._maybeEnd(); + }; + + this._parser = parser; +}; + +IncomingForm.prototype._uploadPath = function(filename) { + var name = ''; + for (var i = 0; i < 32; i++) { + name += Math.floor(Math.random() * 16).toString(16); + } + + if (this.keepExtensions) { + var ext = path.extname(filename); + ext = ext.replace(/(\.[a-z0-9]+).*/, '$1') + + name += ext; + } + + return path.join(this.uploadDir, name); +}; + +IncomingForm.prototype._maybeEnd = function() { + if (!this.ended || this._flushing) { + return; + } + + this.emit('end'); +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js new file mode 100644 index 0000000..7a6e3e1 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js @@ -0,0 +1,3 @@ +var IncomingForm = require('./incoming_form').IncomingForm; +IncomingForm.IncomingForm = IncomingForm; +module.exports = IncomingForm; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js new file mode 100644 index 0000000..9ca567c --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js @@ -0,0 +1,312 @@ +var Buffer = require('buffer').Buffer, + s = 0, + S = + { PARSER_UNINITIALIZED: s++, + START: s++, + START_BOUNDARY: s++, + HEADER_FIELD_START: s++, + HEADER_FIELD: s++, + HEADER_VALUE_START: s++, + HEADER_VALUE: s++, + HEADER_VALUE_ALMOST_DONE: s++, + HEADERS_ALMOST_DONE: s++, + PART_DATA_START: s++, + PART_DATA: s++, + PART_END: s++, + END: s++, + }, + + f = 1, + F = + { PART_BOUNDARY: f, + LAST_BOUNDARY: f *= 2, + }, + + LF = 10, + CR = 13, + SPACE = 32, + HYPHEN = 45, + COLON = 58, + A = 97, + Z = 122, + + lower = function(c) { + return c | 0x20; + }; + +for (var s in S) { + exports[s] = S[s]; +} + +function MultipartParser() { + this.boundary = null; + this.boundaryChars = null; + this.lookbehind = null; + this.state = S.PARSER_UNINITIALIZED; + + this.index = null; + this.flags = 0; +}; +exports.MultipartParser = MultipartParser; + +MultipartParser.stateToString = function(stateNumber) { + for (var state in S) { + var number = S[state]; + if (number === stateNumber) return state; + } +}; + +MultipartParser.prototype.initWithBoundary = function(str) { + this.boundary = new Buffer(str.length+4); + this.boundary.write('\r\n--', 'ascii', 0); + this.boundary.write(str, 'ascii', 4); + this.lookbehind = new Buffer(this.boundary.length+8); + this.state = S.START; + + this.boundaryChars = {}; + for (var i = 0; i < this.boundary.length; i++) { + this.boundaryChars[this.boundary[i]] = true; + } +}; + +MultipartParser.prototype.write = function(buffer) { + var self = this, + i = 0, + len = buffer.length, + prevIndex = this.index, + index = this.index, + state = this.state, + flags = this.flags, + lookbehind = this.lookbehind, + boundary = this.boundary, + boundaryChars = this.boundaryChars, + boundaryLength = this.boundary.length, + boundaryEnd = boundaryLength - 1, + bufferLength = buffer.length, + c, + cl, + + mark = function(name) { + self[name+'Mark'] = i; + }, + clear = function(name) { + delete self[name+'Mark']; + }, + callback = function(name, buffer, start, end) { + if (start !== undefined && start === end) { + return; + } + + var callbackSymbol = 'on'+name.substr(0, 1).toUpperCase()+name.substr(1); + if (callbackSymbol in self) { + self[callbackSymbol](buffer, start, end); + } + }, + dataCallback = function(name, clear) { + var markSymbol = name+'Mark'; + if (!(markSymbol in self)) { + return; + } + + if (!clear) { + callback(name, buffer, self[markSymbol], buffer.length); + self[markSymbol] = 0; + } else { + callback(name, buffer, self[markSymbol], i); + delete self[markSymbol]; + } + }; + + for (i = 0; i < len; i++) { + c = buffer[i]; + switch (state) { + case S.PARSER_UNINITIALIZED: + return i; + case S.START: + index = 0; + state = S.START_BOUNDARY; + case S.START_BOUNDARY: + if (index == boundary.length - 2) { + if (c != CR) { + return i; + } + index++; + break; + } else if (index - 1 == boundary.length - 2) { + if (c != LF) { + return i; + } + index = 0; + callback('partBegin'); + state = S.HEADER_FIELD_START; + break; + } + + if (c != boundary[index+2]) { + return i; + } + index++; + break; + case S.HEADER_FIELD_START: + state = S.HEADER_FIELD; + mark('headerField'); + index = 0; + case S.HEADER_FIELD: + if (c == CR) { + clear('headerField'); + state = S.HEADERS_ALMOST_DONE; + break; + } + + index++; + if (c == HYPHEN) { + break; + } + + if (c == COLON) { + if (index == 1) { + // empty header field + return i; + } + dataCallback('headerField', true); + state = S.HEADER_VALUE_START; + break; + } + + cl = lower(c); + if (cl < A || cl > Z) { + return i; + } + break; + case S.HEADER_VALUE_START: + if (c == SPACE) { + break; + } + + mark('headerValue'); + state = S.HEADER_VALUE; + case S.HEADER_VALUE: + if (c == CR) { + dataCallback('headerValue', true); + callback('headerEnd'); + state = S.HEADER_VALUE_ALMOST_DONE; + } + break; + case S.HEADER_VALUE_ALMOST_DONE: + if (c != LF) { + return i; + } + state = S.HEADER_FIELD_START; + break; + case S.HEADERS_ALMOST_DONE: + if (c != LF) { + return i; + } + + callback('headersEnd'); + state = S.PART_DATA_START; + break; + case S.PART_DATA_START: + state = S.PART_DATA + mark('partData'); + case S.PART_DATA: + prevIndex = index; + + if (index == 0) { + // boyer-moore derrived algorithm to safely skip non-boundary data + i += boundaryEnd; + while (i < bufferLength && !(buffer[i] in boundaryChars)) { + i += boundaryLength; + } + i -= boundaryEnd; + c = buffer[i]; + } + + if (index < boundary.length) { + if (boundary[index] == c) { + if (index == 0) { + dataCallback('partData', true); + } + index++; + } else { + index = 0; + } + } else if (index == boundary.length) { + index++; + if (c == CR) { + // CR = part boundary + flags |= F.PART_BOUNDARY; + } else if (c == HYPHEN) { + // HYPHEN = end boundary + flags |= F.LAST_BOUNDARY; + } else { + index = 0; + } + } else if (index - 1 == boundary.length) { + if (flags & F.PART_BOUNDARY) { + index = 0; + if (c == LF) { + // unset the PART_BOUNDARY flag + flags &= ~F.PART_BOUNDARY; + callback('partEnd'); + callback('partBegin'); + state = S.HEADER_FIELD_START; + break; + } + } else if (flags & F.LAST_BOUNDARY) { + if (c == HYPHEN) { + callback('partEnd'); + callback('end'); + state = S.END; + } else { + index = 0; + } + } else { + index = 0; + } + } + + if (index > 0) { + // when matching a possible boundary, keep a lookbehind reference + // in case it turns out to be a false lead + lookbehind[index-1] = c; + } else if (prevIndex > 0) { + // if our boundary turned out to be rubbish, the captured lookbehind + // belongs to partData + callback('partData', lookbehind, 0, prevIndex); + prevIndex = 0; + mark('partData'); + + // reconsider the current character even so it interrupted the sequence + // it could be the beginning of a new sequence + i--; + } + + break; + case S.END: + break; + default: + return i; + } + } + + dataCallback('headerField'); + dataCallback('headerValue'); + dataCallback('partData'); + + this.index = index; + this.state = state; + this.flags = flags; + + return len; +}; + +MultipartParser.prototype.end = function() { + if (this.state != S.END) { + return new Error('MultipartParser.end(): stream ended unexpectedly: ' + this.explain()); + } +}; + +MultipartParser.prototype.explain = function() { + return 'state = ' + MultipartParser.stateToString(this.state); +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js new file mode 100644 index 0000000..63f109e --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js @@ -0,0 +1,25 @@ +if (global.GENTLY) require = GENTLY.hijack(require); + +// This is a buffering parser, not quite as nice as the multipart one. +// If I find time I'll rewrite this to be fully streaming as well +var querystring = require('querystring'); + +function QuerystringParser() { + this.buffer = ''; +}; +exports.QuerystringParser = QuerystringParser; + +QuerystringParser.prototype.write = function(buffer) { + this.buffer += buffer.toString('ascii'); + return buffer.length; +}; + +QuerystringParser.prototype.end = function() { + var fields = querystring.parse(this.buffer); + for (var field in fields) { + this.onField(field, fields[field]); + } + this.buffer = ''; + + this.onEnd(); +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js new file mode 100644 index 0000000..e9493e9 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js @@ -0,0 +1,6 @@ +// Backwards compatibility ... +try { + module.exports = require('util'); +} catch (e) { + module.exports = require('sys'); +} diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/package.json b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/package.json new file mode 100644 index 0000000..4cf5f2d --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/package.json @@ -0,0 +1,22 @@ +{ + "name": "formidable", + "version": "1.0.9", + "dependencies": {}, + "devDependencies": { + "gently": "0.8.0", + "findit": "0.1.1", + "hashish": "0.0.4", + "urun": "0.0.4", + "utest": "0.0.3" + }, + "directories": { + "lib": "./lib" + }, + "main": "./lib/index", + "scripts": { + "test": "make test" + }, + "engines": { + "node": "*" + } +} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/.common.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/.common.js.un~ new file mode 100644 index 0000000000000000000000000000000000000000..00420761503c6a48f67dcc878b7ea3595f57d4c4 GIT binary patch literal 1666 zcmWH`%$*;a=aT=Ff$8He&D_W32b3d1pH?Keh_o7=jl+@QR1!i}8_3=G0R zj0_lo9A>Bhh=ySXzssIYEFf7%hWHCm1x!#HM1iFEVf_C<02YA>jM7vN0bq2Lfun{;qPqD-y2U_o zbxmv2MsS=WM?T2Cp!fwD36cl|oT|eu;v%g1UZ5YH^7^ zP)J<|tezdH24*lwy^?}LT4qH_X;CV=9;h%>AIM=KyFdV>PgFr6Co>6250D2{$_kVQ VSpxzfrMwDY*Fe#c48#WW{Vsb1uz*xCGQ?kiDn_P2ieQE?{09OA4_VnLn>rx?j1GTjbbOV7 T8VQRla5SKZf<;UlpRWP{lBXd7 literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js new file mode 100644 index 0000000..eb432ad --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js @@ -0,0 +1,19 @@ +var mysql = require('..'); +var path = require('path'); + +var root = path.join(__dirname, '../'); +exports.dir = { + root : root, + lib : root + '/lib', + fixture : root + '/test/fixture', + tmp : root + '/test/tmp', +}; + +exports.port = 13532; + +exports.formidable = require('..'); +exports.assert = require('assert'); + +exports.require = function(lib) { + return require(exports.dir.lib + '/' + lib); +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt new file mode 100644 index 0000000..e7a4785 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt @@ -0,0 +1 @@ +I am a text file with a funky name! diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt new file mode 100644 index 0000000..9b6903e --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt @@ -0,0 +1 @@ +I am a plain text file diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/.generic.http.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/.generic.http.un~ new file mode 100644 index 0000000000000000000000000000000000000000..a863c08aec4e610f4e4b4340331b0f34eec45e61 GIT binary patch literal 641 zcmWH`%$*;a=aT=FfoZOok%Ha=ek068d0LI3~& literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md new file mode 100644 index 0000000..3c9dbe3 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md @@ -0,0 +1,3 @@ +* Opera does not allow submitting this file, it shows a warning to the + user that the file could not be found instead. Tested in 9.8, 11.51 on OSX. + Reported to Opera on 08.09.2011 (tracking email DSK-346009@bugs.opera.com). diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.no-filename.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.no-filename.js.un~ new file mode 100644 index 0000000000000000000000000000000000000000..ea9828b0ac20914dbecd85a13e554592b0b9b6ff GIT binary patch literal 1147 zcmWH`%$*;a=aT=Ffyrl+PG{?quti?~*K$u2*NeQ&wDszYs*>YVJqo8yd@OK{fq{V; zh+P#Fs!J*hQmqu!(=u~X)pZo|5_3Vk(t@1)#1tSOBn%Y;^D0V8i$DqrauPH1^hzp9 z)N6Hs1~CD#1Q0Vq*+2>`1`-Eh27gJ5J1h{{_zNHbAOK51m~f3CLm2)80ayeoIZ9DG z1c1?T5gZ+i3}0dK21*bh42mV{Bn;C=a9o27LWl*SDcr4{Kc8 P<0=G*%>Jg0&sPBeAD(H* literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.special-chars-in-filename.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.special-chars-in-filename.js.un~ new file mode 100644 index 0000000000000000000000000000000000000000..4c13bdb1a76bb2141c36a4151c55d2245c51d722 GIT binary patch literal 2129 zcmWH`%$*;a=aT=Ff$7jJdo{nc&(5>&F0gERG`Cjfk;|I)s%ak=uD_IgQSz@O0|SF7 z5J#6K7AX`Inp^>DA+5gDrhOxC@3k|DA+0JDLk6dtYEDW zqpskfpsb*x5T~G~prN3tpsNrM)S|6Wtx&5Ftq`k_pirk*QccT015?K0$>Udf@VmpDL@r_fst04 zmtC0#EkV?+p>YXwC@B6w@d`>xqq!LtDm174Hm`pHj!Q=DxmgB#Toz|!0!weSCYvR{;RB@}4~a literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js new file mode 100644 index 0000000..0bae449 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js @@ -0,0 +1,3 @@ +module.exports['generic.http'] = [ + {type: 'file', name: 'upload', filename: '', fixture: 'plain.txt'}, +]; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js new file mode 100644 index 0000000..eb76fdc --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js @@ -0,0 +1,21 @@ +var properFilename = 'funkyfilename.txt'; + +function expect(filename) { + return [ + {type: 'field', name: 'title', value: 'Weird filename'}, + {type: 'file', name: 'upload', filename: filename, fixture: properFilename}, + ]; +}; + +var webkit = " ? % * | \" < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; +var ffOrIe = " ? % * | \" < > . ☃ ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; + +module.exports = { + 'osx-chrome-13.http' : expect(webkit), + 'osx-firefox-3.6.http' : expect(ffOrIe), + 'osx-safari-5.http' : expect(webkit), + 'xp-chrome-12.http' : expect(webkit), + 'xp-ie-7.http' : expect(ffOrIe), + 'xp-ie-8.http' : expect(ffOrIe), + 'xp-safari-5.http' : expect(webkit), +}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js new file mode 100644 index 0000000..a476169 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js @@ -0,0 +1,72 @@ +exports['rfc1867'] = + { boundary: 'AaB03x', + raw: + '--AaB03x\r\n'+ + 'content-disposition: form-data; name="field1"\r\n'+ + '\r\n'+ + 'Joe Blow\r\nalmost tricked you!\r\n'+ + '--AaB03x\r\n'+ + 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ + 'Content-Type: text/plain\r\n'+ + '\r\n'+ + '... contents of file1.txt ...\r\r\n'+ + '--AaB03x--\r\n', + parts: + [ { headers: { + 'content-disposition': 'form-data; name="field1"', + }, + data: 'Joe Blow\r\nalmost tricked you!', + }, + { headers: { + 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', + 'Content-Type': 'text/plain', + }, + data: '... contents of file1.txt ...\r', + } + ] + }; + +exports['noTrailing\r\n'] = + { boundary: 'AaB03x', + raw: + '--AaB03x\r\n'+ + 'content-disposition: form-data; name="field1"\r\n'+ + '\r\n'+ + 'Joe Blow\r\nalmost tricked you!\r\n'+ + '--AaB03x\r\n'+ + 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ + 'Content-Type: text/plain\r\n'+ + '\r\n'+ + '... contents of file1.txt ...\r\r\n'+ + '--AaB03x--', + parts: + [ { headers: { + 'content-disposition': 'form-data; name="field1"', + }, + data: 'Joe Blow\r\nalmost tricked you!', + }, + { headers: { + 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', + 'Content-Type': 'text/plain', + }, + data: '... contents of file1.txt ...\r', + } + ] + }; + +exports['emptyHeader'] = + { boundary: 'AaB03x', + raw: + '--AaB03x\r\n'+ + 'content-disposition: form-data; name="field1"\r\n'+ + ': foo\r\n'+ + '\r\n'+ + 'Joe Blow\r\nalmost tricked you!\r\n'+ + '--AaB03x\r\n'+ + 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ + 'Content-Type: text/plain\r\n'+ + '\r\n'+ + '... contents of file1.txt ...\r\r\n'+ + '--AaB03x--\r\n', + expectError: true, + }; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/.test-fixtures.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/.test-fixtures.js.un~ new file mode 100644 index 0000000000000000000000000000000000000000..a4d8a0e0a078bcb546453d0c1dcf02d76716b331 GIT binary patch literal 30260 zcmeI5OKcri8Gvt`cO5rPlafdCICj$dnmFSYD6|ePky?-lZE%~`^g#u;_PD;mzSp_; z+9awf)Uttn7l4E+9*c?vARbaBP`3zHNZl79gxJ6agv0_-{_o8B$G!|?(i=~=9&P`*Ht_4IlfOIk_SGL=_|89`JMoL@FJFKCSMOf@`oI75 z&5?_*z18^pziPGGv*OM;*PM6t;rZr`-byDObKSJFns$=e#dbHXk6n~o&WXE2+zxS< z#37fAt6h2L^51rGb*T2G-;0L~WS;-arQ7uQJrSRjo{0YYtbr@R`+Vo>V*9H}SN;h12VV6kxqqiP6|g#S9&bdc zYWbjiLHQGl@{DBULS~>j?>xx*XfWSNH|oy2R%0n0ck?T)*hQ%#dc%vGg-4*?=wjOJMNYnonBWAQ(_Q7 zgqBz?jk!)Ljd9Cix&8#rFmiu(U$FLMzTNqBV|JmQn|gX(IQ#Um=<)nsNOh>aHG@&yp*R;!5hxhF|yKT9kFa zPviFeFg@*m+cUh!8b{7`n)qw**Bazd_$`j#hY4>tzEZh2T@3#uBa;ya1F zovr@T+A0Q(`Vm^t-If(>_Hrc%+=j&+;W*Z-XrY2QiMt)Ew=63njEI{S2dmRq*5-9& zFgT#?6Q=^uM4Zn$LR7Vs^qp!_{LLE2-*|{SveCx{xe@gvKpX^Os4W9A2r)=ef!>fF zL}IFmlD?C8YIeCD$T{1c`HwZb19DN-53!Ss6_XcJ>20KIU5)jl3Xtg-Q-U5RX~b3z zZB!M8eToo!(y&GN-j)cndNZ5bS>L_PJ1SV zEWv_>s(>tFQf*ZA^Eyisx?P;Fzr+WV56fKVj($r!C>I|KH^_WyW@R!OS?Kkali5z% z=%rWvtZFu&dRA{q7MtB(+Ny_1xaBs3Heavm;9(tH$pP@><|Vd_s)>?*5!eG3Hcy1A zpO$gw+At3?Tvj3N+)N`WRZB^~2&vmFDK(tWNru?%Aafs?VKNr%c8o{YrO8P~>9qR{2UHF(d4=&V`U^!|E0kXXH zi&wO5~F!0R|ObWcuc`#RMXa#LU{B`DSab*^`jW(j?uRty!I&nQL~Euu`Lbh0auP#~*Pkb@C);%|oFr8ixx9D6fgHq%Ichlm& z)M>9Q`xWipLh@px>sPo#tZ_FgDUJHo=7))}(CEq@k%hb<9a+3@%4B`W#OwtMzhK<& z5y}cEdx((6+}u+XEX$Z*XtolC&4H9sm$xOj+peARARiZ}!b7f_jU52hN?AYGq}8f~ z3q9Dj{sGGgacm4kKo*+`uZs8KPZ3Nbw*Eo&;CO`0LlXfK-)-ic2-ov@i`YbXos|ER zYcgn7Q(D!4G!bX}5rN}zaZLTiCgPTx2vi#$ZXRaaGNW0}d5I6VYNDiHZT4$@Hrbr6{LWPLWjy>#eBN>-L-6@MP+{|Gs23r`HV+l(kxwM18mZ!2Vp`pi zo+b9AC8moDYH$P2d1KS_*4RMhNG%8$$q>VgbtOuuB6f*qGh>_C3f*10OWeQU)|D~! z^DkV~4HmE(HpO!i&PT4XqBNQ*6D-2+8P9HK)*V6hK)xc5igI7p&IRM+DjgP#Qd>GF z!4Zyw0FxBF#YcdumXf{&X!{ek-n?dwPrLWik|6;7d=?N3O)rJE5Qb+>iQ${iQ$(gl zGi8EBn101FWvU3S%JiTbrSr3hlYttP&Y1#15KHtcf{~ihOqpO2YD<<{za`$S)YKAX zR#>NX13`%0V+sdNlJT=zk)Y8`ncyuGq{?F;r*?N(2|6V==>j=O-D?U3MWTC&}=n)w@>p@t2sL3U9lfCuy_ z(Sq<0rysD+7Uj%%|f(N>)AMi&M{92`(zi$Dmx+xeKnFWX=exsDq!6N8-79Fa0 z;+_x(x?Q02)~Qo7)WbUL02a%?DuAQ|ZpcBg77=@)_bvV}J+8PR)rQXKGx^^N#^ z+!0>D*RR~@*D&DrVR0%jg=6frsz$2#ML2$KD~=;MM>b7dNpJM@OA7rU0e9Y%6{tFH zjFWIiF{OeqiHo zr^JCyF@fa*$3Z{_ChFd3VJM-B6v6Zji%AFTPfM=W!t^}&6dkA%j)Q;^#D1_JElkx? z(l3JUb&C$w(}86CXwh+=Q2|I59jGQa4gyB*A=7AeD4~iJLH8|-P6usYAlEPk2g!Y= z6yO4HT>mplDIF|==-V41dPcIux@7W&4YlD5QDNF8`!G}h2(bH20f7m?I1)EXDIF{V z@Vi?9lr7d901O~?As1#JF=d1&#_A zh5?$a!K)oAMnBVHXETeLE|@<`CP8=vB6ihARX^9HBm{O9uzL~g-}`@H2lK~58Sr=n z==ctC5Um|8RFERrf8eq2%C>Fjs9u{~S-&vW&X${C=G{bIRGIIseP0-G5166?l_eIx zdJ;hz&6Eii0r{r2U)pL^uORb9<9x}{O)AUKd4kx-P2r$PGCuD}&}gPiusFfpnJMa0 zq7wA4pGoU0;(Ng2Pj0@P2)s|2asrkukE9ywRg_RgiopD_HOD(7w?pEdCD(QPPdQ_! z4uHg+VApXe@E+ti2w+JO7h$4=Dw1nb5+QtNNNiQZ(l^Rr?%5cf>`Pt$oo{I}^TlCU zO@1`EmV*q?0#kq5%VGvg4rGGXE%B?Z7j$exuH=6*F|v;i9dD(F8^l zQ;k&dOCx$taxG+H@VaD*2+Mp{CYqShOqpO2et+~PHn`TpsruokW@b%{)0f22t0aTi zt3(M^qzIdzIP|+3sKInX!SElddI|DHIQLG8!9Ns31isX8&Yl?|O>liLuq4 zo0zzT(ZNwu*y9pDCXSgHFA=9|qNLB>YZV)w(UUUEa>jN~P(4#IkBH+vjrg^eTmD*0 zsHgIWShPspgjQK!V|^gjQz)T|uxfsLNC2(+i9PXouzgq_?1T2f)(Ds72I{HNExzcf ZyQb^%g*QKKOb+BmWX&o2c>P~~^j~kcCXoOD literal 0 HcmV?d00001 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js new file mode 100644 index 0000000..66ad259 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js @@ -0,0 +1,89 @@ +var hashish = require('hashish'); +var fs = require('fs'); +var findit = require('findit'); +var path = require('path'); +var http = require('http'); +var net = require('net'); +var assert = require('assert'); + +var common = require('../common'); +var formidable = common.formidable; + +var server = http.createServer(); +server.listen(common.port, findFixtures); + +function findFixtures() { + var fixtures = []; + findit + .sync(common.dir.fixture + '/js') + .forEach(function(jsPath) { + if (!/\.js$/.test(jsPath)) return; + + var group = path.basename(jsPath, '.js'); + hashish.forEach(require(jsPath), function(fixture, name) { + fixtures.push({ + name : group + '/' + name, + fixture : fixture, + }); + }); + }); + + testNext(fixtures); +} + +function testNext(fixtures) { + var fixture = fixtures.shift(); + if (!fixture) return server.close(); + + var name = fixture.name; + var fixture = fixture.fixture; + + uploadFixture(name, function(err, parts) { + if (err) throw err; + + fixture.forEach(function(expectedPart, i) { + var parsedPart = parts[i]; + assert.equal(parsedPart.type, expectedPart.type); + assert.equal(parsedPart.name, expectedPart.name); + + if (parsedPart.type === 'file') { + var filename = parsedPart.value.name; + assert.equal(filename, expectedPart.filename); + } + }); + + testNext(fixtures); + }); +}; + +function uploadFixture(name, cb) { + server.once('request', function(req, res) { + var form = new formidable.IncomingForm(); + form.uploadDir = common.dir.tmp; + form.parse(req); + + function callback() { + var realCallback = cb; + cb = function() {}; + realCallback.apply(null, arguments); + } + + var parts = []; + form + .on('error', callback) + .on('fileBegin', function(name, value) { + parts.push({type: 'file', name: name, value: value}); + }) + .on('field', function(name, value) { + parts.push({type: 'field', name: name, value: value}); + }) + .on('end', function() { + callback(null, parts); + }); + }); + + var socket = net.createConnection(common.port); + var file = fs.createReadStream(common.dir.fixture + '/http/' + name); + + file.pipe(socket); +} diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js new file mode 100644 index 0000000..2b98598 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js @@ -0,0 +1,24 @@ +var path = require('path'), + fs = require('fs'); + +try { + global.Gently = require('gently'); +} catch (e) { + throw new Error('this test suite requires node-gently'); +} + +exports.lib = path.join(__dirname, '../../lib'); + +global.GENTLY = new Gently(); + +global.assert = require('assert'); +global.TEST_PORT = 13532; +global.TEST_FIXTURES = path.join(__dirname, '../fixture'); +global.TEST_TMP = path.join(__dirname, '../tmp'); + +// Stupid new feature in node that complains about gently attaching too many +// listeners to process 'exit'. This is a workaround until I can think of a +// better way to deal with this. +if (process.setMaxListeners) { + process.setMaxListeners(10000); +} diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js new file mode 100644 index 0000000..75232aa --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js @@ -0,0 +1,80 @@ +var common = require('../common'); +var CHUNK_LENGTH = 10, + multipartParser = require(common.lib + '/multipart_parser'), + MultipartParser = multipartParser.MultipartParser, + parser = new MultipartParser(), + fixtures = require(TEST_FIXTURES + '/multipart'), + Buffer = require('buffer').Buffer; + +Object.keys(fixtures).forEach(function(name) { + var fixture = fixtures[name], + buffer = new Buffer(Buffer.byteLength(fixture.raw, 'binary')), + offset = 0, + chunk, + nparsed, + + parts = [], + part = null, + headerField, + headerValue, + endCalled = ''; + + parser.initWithBoundary(fixture.boundary); + parser.onPartBegin = function() { + part = {headers: {}, data: ''}; + parts.push(part); + headerField = ''; + headerValue = ''; + }; + + parser.onHeaderField = function(b, start, end) { + headerField += b.toString('ascii', start, end); + }; + + parser.onHeaderValue = function(b, start, end) { + headerValue += b.toString('ascii', start, end); + } + + parser.onHeaderEnd = function() { + part.headers[headerField] = headerValue; + headerField = ''; + headerValue = ''; + }; + + parser.onPartData = function(b, start, end) { + var str = b.toString('ascii', start, end); + part.data += b.slice(start, end); + } + + parser.onEnd = function() { + endCalled = true; + } + + buffer.write(fixture.raw, 'binary', 0); + + while (offset < buffer.length) { + if (offset + CHUNK_LENGTH < buffer.length) { + chunk = buffer.slice(offset, offset+CHUNK_LENGTH); + } else { + chunk = buffer.slice(offset, buffer.length); + } + offset = offset + CHUNK_LENGTH; + + nparsed = parser.write(chunk); + if (nparsed != chunk.length) { + if (fixture.expectError) { + return; + } + puts('-- ERROR --'); + p(chunk.toString('ascii')); + throw new Error(chunk.length+' bytes written, but only '+nparsed+' bytes parsed!'); + } + } + + if (fixture.expectError) { + throw new Error('expected parse error did not happen'); + } + + assert.ok(endCalled); + assert.deepEqual(parts, fixture.parts); +}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js new file mode 100644 index 0000000..52ceedb --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js @@ -0,0 +1,104 @@ +var common = require('../common'); +var WriteStreamStub = GENTLY.stub('fs', 'WriteStream'); + +var File = require(common.lib + '/file'), + EventEmitter = require('events').EventEmitter, + file, + gently; + +function test(test) { + gently = new Gently(); + file = new File(); + test(); + gently.verify(test.name); +} + +test(function constructor() { + assert.ok(file instanceof EventEmitter); + assert.strictEqual(file.size, 0); + assert.strictEqual(file.path, null); + assert.strictEqual(file.name, null); + assert.strictEqual(file.type, null); + assert.strictEqual(file.lastModifiedDate, null); + + assert.strictEqual(file._writeStream, null); + + (function testSetProperties() { + var file2 = new File({foo: 'bar'}); + assert.equal(file2.foo, 'bar'); + })(); +}); + +test(function open() { + var WRITE_STREAM; + file.path = '/foo'; + + gently.expect(WriteStreamStub, 'new', function (path) { + WRITE_STREAM = this; + assert.strictEqual(path, file.path); + }); + + file.open(); + assert.strictEqual(file._writeStream, WRITE_STREAM); +}); + +test(function write() { + var BUFFER = {length: 10}, + CB_STUB, + CB = function() { + CB_STUB.apply(this, arguments); + }; + + file._writeStream = {}; + + gently.expect(file._writeStream, 'write', function (buffer, cb) { + assert.strictEqual(buffer, BUFFER); + + gently.expect(file, 'emit', function (event, bytesWritten) { + assert.ok(file.lastModifiedDate instanceof Date); + assert.equal(event, 'progress'); + assert.equal(bytesWritten, file.size); + }); + + CB_STUB = gently.expect(function writeCb() { + assert.equal(file.size, 10); + }); + + cb(); + + gently.expect(file, 'emit', function (event, bytesWritten) { + assert.equal(event, 'progress'); + assert.equal(bytesWritten, file.size); + }); + + CB_STUB = gently.expect(function writeCb() { + assert.equal(file.size, 20); + }); + + cb(); + }); + + file.write(BUFFER, CB); +}); + +test(function end() { + var CB_STUB, + CB = function() { + CB_STUB.apply(this, arguments); + }; + + file._writeStream = {}; + + gently.expect(file._writeStream, 'end', function (cb) { + gently.expect(file, 'emit', function (event) { + assert.equal(event, 'end'); + }); + + CB_STUB = gently.expect(function endCb() { + }); + + cb(); + }); + + file.end(CB); +}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js new file mode 100644 index 0000000..b64df8b --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js @@ -0,0 +1,726 @@ +var common = require('../common'); +var MultipartParserStub = GENTLY.stub('./multipart_parser', 'MultipartParser'), + QuerystringParserStub = GENTLY.stub('./querystring_parser', 'QuerystringParser'), + EventEmitterStub = GENTLY.stub('events', 'EventEmitter'), + FileStub = GENTLY.stub('./file'); + +var formidable = require(common.lib + '/index'), + IncomingForm = formidable.IncomingForm, + events = require('events'), + fs = require('fs'), + path = require('path'), + Buffer = require('buffer').Buffer, + fixtures = require(TEST_FIXTURES + '/multipart'), + form, + gently; + +function test(test) { + gently = new Gently(); + gently.expect(EventEmitterStub, 'call'); + form = new IncomingForm(); + test(); + gently.verify(test.name); +} + +test(function constructor() { + assert.strictEqual(form.error, null); + assert.strictEqual(form.ended, false); + assert.strictEqual(form.type, null); + assert.strictEqual(form.headers, null); + assert.strictEqual(form.keepExtensions, false); + assert.strictEqual(form.uploadDir, '/tmp'); + assert.strictEqual(form.encoding, 'utf-8'); + assert.strictEqual(form.bytesReceived, null); + assert.strictEqual(form.bytesExpected, null); + assert.strictEqual(form.maxFieldsSize, 2 * 1024 * 1024); + assert.strictEqual(form._parser, null); + assert.strictEqual(form._flushing, 0); + assert.strictEqual(form._fieldsSize, 0); + assert.ok(form instanceof EventEmitterStub); + assert.equal(form.constructor.name, 'IncomingForm'); + + (function testSimpleConstructor() { + gently.expect(EventEmitterStub, 'call'); + var form = IncomingForm(); + assert.ok(form instanceof IncomingForm); + })(); + + (function testSimpleConstructorShortcut() { + gently.expect(EventEmitterStub, 'call'); + var form = formidable(); + assert.ok(form instanceof IncomingForm); + })(); +}); + +test(function parse() { + var REQ = {headers: {}} + , emit = {}; + + gently.expect(form, 'writeHeaders', function(headers) { + assert.strictEqual(headers, REQ.headers); + }); + + var events = ['error', 'aborted', 'data', 'end']; + gently.expect(REQ, 'on', events.length, function(event, fn) { + assert.equal(event, events.shift()); + emit[event] = fn; + return this; + }); + + form.parse(REQ); + + (function testPause() { + gently.expect(REQ, 'pause'); + assert.strictEqual(form.pause(), true); + })(); + + (function testPauseCriticalException() { + form.ended = false; + + var ERR = new Error('dasdsa'); + gently.expect(REQ, 'pause', function() { + throw ERR; + }); + + gently.expect(form, '_error', function(err) { + assert.strictEqual(err, ERR); + }); + + assert.strictEqual(form.pause(), false); + })(); + + (function testPauseHarmlessException() { + form.ended = true; + + var ERR = new Error('dasdsa'); + gently.expect(REQ, 'pause', function() { + throw ERR; + }); + + assert.strictEqual(form.pause(), false); + })(); + + (function testResume() { + gently.expect(REQ, 'resume'); + assert.strictEqual(form.resume(), true); + })(); + + (function testResumeCriticalException() { + form.ended = false; + + var ERR = new Error('dasdsa'); + gently.expect(REQ, 'resume', function() { + throw ERR; + }); + + gently.expect(form, '_error', function(err) { + assert.strictEqual(err, ERR); + }); + + assert.strictEqual(form.resume(), false); + })(); + + (function testResumeHarmlessException() { + form.ended = true; + + var ERR = new Error('dasdsa'); + gently.expect(REQ, 'resume', function() { + throw ERR; + }); + + assert.strictEqual(form.resume(), false); + })(); + + (function testEmitError() { + var ERR = new Error('something bad happened'); + gently.expect(form, '_error',function(err) { + assert.strictEqual(err, ERR); + }); + emit.error(ERR); + })(); + + (function testEmitAborted() { + gently.expect(form, 'emit',function(event) { + assert.equal(event, 'aborted'); + }); + + emit.aborted(); + })(); + + + (function testEmitData() { + var BUFFER = [1, 2, 3]; + gently.expect(form, 'write', function(buffer) { + assert.strictEqual(buffer, BUFFER); + }); + emit.data(BUFFER); + })(); + + (function testEmitEnd() { + form._parser = {}; + + (function testWithError() { + var ERR = new Error('haha'); + gently.expect(form._parser, 'end', function() { + return ERR; + }); + + gently.expect(form, '_error', function(err) { + assert.strictEqual(err, ERR); + }); + + emit.end(); + })(); + + (function testWithoutError() { + gently.expect(form._parser, 'end'); + emit.end(); + })(); + + (function testAfterError() { + form.error = true; + emit.end(); + })(); + })(); + + (function testWithCallback() { + gently.expect(EventEmitterStub, 'call'); + var form = new IncomingForm(), + REQ = {headers: {}}, + parseCalled = 0; + + gently.expect(form, 'writeHeaders'); + gently.expect(REQ, 'on', 4, function() { + return this; + }); + + gently.expect(form, 'on', 4, function(event, fn) { + if (event == 'field') { + fn('field1', 'foo'); + fn('field1', 'bar'); + fn('field2', 'nice'); + } + + if (event == 'file') { + fn('file1', '1'); + fn('file1', '2'); + fn('file2', '3'); + } + + if (event == 'end') { + fn(); + } + return this; + }); + + form.parse(REQ, gently.expect(function parseCbOk(err, fields, files) { + assert.deepEqual(fields, {field1: 'bar', field2: 'nice'}); + assert.deepEqual(files, {file1: '2', file2: '3'}); + })); + + gently.expect(form, 'writeHeaders'); + gently.expect(REQ, 'on', 4, function() { + return this; + }); + + var ERR = new Error('test'); + gently.expect(form, 'on', 3, function(event, fn) { + if (event == 'field') { + fn('foo', 'bar'); + } + + if (event == 'error') { + fn(ERR); + gently.expect(form, 'on'); + } + return this; + }); + + form.parse(REQ, gently.expect(function parseCbErr(err, fields, files) { + assert.strictEqual(err, ERR); + assert.deepEqual(fields, {foo: 'bar'}); + })); + })(); +}); + +test(function pause() { + assert.strictEqual(form.pause(), false); +}); + +test(function resume() { + assert.strictEqual(form.resume(), false); +}); + + +test(function writeHeaders() { + var HEADERS = {}; + gently.expect(form, '_parseContentLength'); + gently.expect(form, '_parseContentType'); + + form.writeHeaders(HEADERS); + assert.strictEqual(form.headers, HEADERS); +}); + +test(function write() { + var parser = {}, + BUFFER = [1, 2, 3]; + + form._parser = parser; + form.bytesExpected = 523423; + + (function testBasic() { + gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { + assert.equal(event, 'progress'); + assert.equal(bytesReceived, BUFFER.length); + assert.equal(bytesExpected, form.bytesExpected); + }); + + gently.expect(parser, 'write', function(buffer) { + assert.strictEqual(buffer, BUFFER); + return buffer.length; + }); + + assert.equal(form.write(BUFFER), BUFFER.length); + assert.equal(form.bytesReceived, BUFFER.length); + })(); + + (function testParserError() { + gently.expect(form, 'emit'); + + gently.expect(parser, 'write', function(buffer) { + assert.strictEqual(buffer, BUFFER); + return buffer.length - 1; + }); + + gently.expect(form, '_error', function(err) { + assert.ok(err.message.match(/parser error/i)); + }); + + assert.equal(form.write(BUFFER), BUFFER.length - 1); + assert.equal(form.bytesReceived, BUFFER.length + BUFFER.length); + })(); + + (function testUninitialized() { + delete form._parser; + + gently.expect(form, '_error', function(err) { + assert.ok(err.message.match(/unintialized parser/i)); + }); + form.write(BUFFER); + })(); +}); + +test(function parseContentType() { + var HEADERS = {}; + + form.headers = {'content-type': 'application/x-www-form-urlencoded'}; + gently.expect(form, '_initUrlencoded'); + form._parseContentType(); + + // accept anything that has 'urlencoded' in it + form.headers = {'content-type': 'broken-client/urlencoded-stupid'}; + gently.expect(form, '_initUrlencoded'); + form._parseContentType(); + + var BOUNDARY = '---------------------------57814261102167618332366269'; + form.headers = {'content-type': 'multipart/form-data; boundary='+BOUNDARY}; + + gently.expect(form, '_initMultipart', function(boundary) { + assert.equal(boundary, BOUNDARY); + }); + form._parseContentType(); + + (function testQuotedBoundary() { + form.headers = {'content-type': 'multipart/form-data; boundary="' + BOUNDARY + '"'}; + + gently.expect(form, '_initMultipart', function(boundary) { + assert.equal(boundary, BOUNDARY); + }); + form._parseContentType(); + })(); + + (function testNoBoundary() { + form.headers = {'content-type': 'multipart/form-data'}; + + gently.expect(form, '_error', function(err) { + assert.ok(err.message.match(/no multipart boundary/i)); + }); + form._parseContentType(); + })(); + + (function testNoContentType() { + form.headers = {}; + + gently.expect(form, '_error', function(err) { + assert.ok(err.message.match(/no content-type/i)); + }); + form._parseContentType(); + })(); + + (function testUnknownContentType() { + form.headers = {'content-type': 'invalid'}; + + gently.expect(form, '_error', function(err) { + assert.ok(err.message.match(/unknown content-type/i)); + }); + form._parseContentType(); + })(); +}); + +test(function parseContentLength() { + var HEADERS = {}; + + form.headers = {}; + form._parseContentLength(); + assert.strictEqual(form.bytesReceived, null); + assert.strictEqual(form.bytesExpected, null); + + form.headers['content-length'] = '8'; + gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { + assert.equal(event, 'progress'); + assert.equal(bytesReceived, 0); + assert.equal(bytesExpected, 8); + }); + form._parseContentLength(); + assert.strictEqual(form.bytesReceived, 0); + assert.strictEqual(form.bytesExpected, 8); + + // JS can be evil, lets make sure we are not + form.headers['content-length'] = '08'; + gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { + assert.equal(event, 'progress'); + assert.equal(bytesReceived, 0); + assert.equal(bytesExpected, 8); + }); + form._parseContentLength(); + assert.strictEqual(form.bytesExpected, 8); +}); + +test(function _initMultipart() { + var BOUNDARY = '123', + PARSER; + + gently.expect(MultipartParserStub, 'new', function() { + PARSER = this; + }); + + gently.expect(MultipartParserStub.prototype, 'initWithBoundary', function(boundary) { + assert.equal(boundary, BOUNDARY); + }); + + form._initMultipart(BOUNDARY); + assert.equal(form.type, 'multipart'); + assert.strictEqual(form._parser, PARSER); + + (function testRegularField() { + var PART; + gently.expect(EventEmitterStub, 'new', function() { + PART = this; + }); + + gently.expect(form, 'onPart', function(part) { + assert.strictEqual(part, PART); + assert.deepEqual + ( part.headers + , { 'content-disposition': 'form-data; name="field1"' + , 'foo': 'bar' + } + ); + assert.equal(part.name, 'field1'); + + var strings = ['hello', ' world']; + gently.expect(part, 'emit', 2, function(event, b) { + assert.equal(event, 'data'); + assert.equal(b.toString(), strings.shift()); + }); + + gently.expect(part, 'emit', function(event, b) { + assert.equal(event, 'end'); + }); + }); + + PARSER.onPartBegin(); + PARSER.onHeaderField(new Buffer('content-disposition'), 0, 10); + PARSER.onHeaderField(new Buffer('content-disposition'), 10, 19); + PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 0, 14); + PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 14, 24); + PARSER.onHeaderEnd(); + PARSER.onHeaderField(new Buffer('foo'), 0, 3); + PARSER.onHeaderValue(new Buffer('bar'), 0, 3); + PARSER.onHeaderEnd(); + PARSER.onHeadersEnd(); + PARSER.onPartData(new Buffer('hello world'), 0, 5); + PARSER.onPartData(new Buffer('hello world'), 5, 11); + PARSER.onPartEnd(); + })(); + + (function testFileField() { + var PART; + gently.expect(EventEmitterStub, 'new', function() { + PART = this; + }); + + gently.expect(form, 'onPart', function(part) { + assert.deepEqual + ( part.headers + , { 'content-disposition': 'form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"' + , 'content-type': 'text/plain' + } + ); + assert.equal(part.name, 'field2'); + assert.equal(part.filename, 'Sun"et.jpg'); + assert.equal(part.mime, 'text/plain'); + + gently.expect(part, 'emit', function(event, b) { + assert.equal(event, 'data'); + assert.equal(b.toString(), '... contents of file1.txt ...'); + }); + + gently.expect(part, 'emit', function(event, b) { + assert.equal(event, 'end'); + }); + }); + + PARSER.onPartBegin(); + PARSER.onHeaderField(new Buffer('content-disposition'), 0, 19); + PARSER.onHeaderValue(new Buffer('form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"'), 0, 85); + PARSER.onHeaderEnd(); + PARSER.onHeaderField(new Buffer('Content-Type'), 0, 12); + PARSER.onHeaderValue(new Buffer('text/plain'), 0, 10); + PARSER.onHeaderEnd(); + PARSER.onHeadersEnd(); + PARSER.onPartData(new Buffer('... contents of file1.txt ...'), 0, 29); + PARSER.onPartEnd(); + })(); + + (function testEnd() { + gently.expect(form, '_maybeEnd'); + PARSER.onEnd(); + assert.ok(form.ended); + })(); +}); + +test(function _fileName() { + // TODO + return; +}); + +test(function _initUrlencoded() { + var PARSER; + + gently.expect(QuerystringParserStub, 'new', function() { + PARSER = this; + }); + + form._initUrlencoded(); + assert.equal(form.type, 'urlencoded'); + assert.strictEqual(form._parser, PARSER); + + (function testOnField() { + var KEY = 'KEY', VAL = 'VAL'; + gently.expect(form, 'emit', function(field, key, val) { + assert.equal(field, 'field'); + assert.equal(key, KEY); + assert.equal(val, VAL); + }); + + PARSER.onField(KEY, VAL); + })(); + + (function testOnEnd() { + gently.expect(form, '_maybeEnd'); + + PARSER.onEnd(); + assert.equal(form.ended, true); + })(); +}); + +test(function _error() { + var ERR = new Error('bla'); + + gently.expect(form, 'pause'); + gently.expect(form, 'emit', function(event, err) { + assert.equal(event, 'error'); + assert.strictEqual(err, ERR); + }); + + form._error(ERR); + assert.strictEqual(form.error, ERR); + + // make sure _error only does its thing once + form._error(ERR); +}); + +test(function onPart() { + var PART = {}; + gently.expect(form, 'handlePart', function(part) { + assert.strictEqual(part, PART); + }); + + form.onPart(PART); +}); + +test(function handlePart() { + (function testUtf8Field() { + var PART = new events.EventEmitter(); + PART.name = 'my_field'; + + gently.expect(form, 'emit', function(event, field, value) { + assert.equal(event, 'field'); + assert.equal(field, 'my_field'); + assert.equal(value, 'hello world: €'); + }); + + form.handlePart(PART); + PART.emit('data', new Buffer('hello')); + PART.emit('data', new Buffer(' world: ')); + PART.emit('data', new Buffer([0xE2])); + PART.emit('data', new Buffer([0x82, 0xAC])); + PART.emit('end'); + })(); + + (function testBinaryField() { + var PART = new events.EventEmitter(); + PART.name = 'my_field2'; + + gently.expect(form, 'emit', function(event, field, value) { + assert.equal(event, 'field'); + assert.equal(field, 'my_field2'); + assert.equal(value, 'hello world: '+new Buffer([0xE2, 0x82, 0xAC]).toString('binary')); + }); + + form.encoding = 'binary'; + form.handlePart(PART); + PART.emit('data', new Buffer('hello')); + PART.emit('data', new Buffer(' world: ')); + PART.emit('data', new Buffer([0xE2])); + PART.emit('data', new Buffer([0x82, 0xAC])); + PART.emit('end'); + })(); + + (function testFieldSize() { + form.maxFieldsSize = 8; + var PART = new events.EventEmitter(); + PART.name = 'my_field'; + + gently.expect(form, '_error', function(err) { + assert.equal(err.message, 'maxFieldsSize exceeded, received 9 bytes of field data'); + }); + + form.handlePart(PART); + form._fieldsSize = 1; + PART.emit('data', new Buffer(7)); + PART.emit('data', new Buffer(1)); + })(); + + (function testFilePart() { + var PART = new events.EventEmitter(), + FILE = new events.EventEmitter(), + PATH = '/foo/bar'; + + PART.name = 'my_file'; + PART.filename = 'sweet.txt'; + PART.mime = 'sweet.txt'; + + gently.expect(form, '_uploadPath', function(filename) { + assert.equal(filename, PART.filename); + return PATH; + }); + + gently.expect(FileStub, 'new', function(properties) { + assert.equal(properties.path, PATH); + assert.equal(properties.name, PART.filename); + assert.equal(properties.type, PART.mime); + FILE = this; + + gently.expect(form, 'emit', function (event, field, file) { + assert.equal(event, 'fileBegin'); + assert.strictEqual(field, PART.name); + assert.strictEqual(file, FILE); + }); + + gently.expect(FILE, 'open'); + }); + + form.handlePart(PART); + assert.equal(form._flushing, 1); + + var BUFFER; + gently.expect(form, 'pause'); + gently.expect(FILE, 'write', function(buffer, cb) { + assert.strictEqual(buffer, BUFFER); + gently.expect(form, 'resume'); + // @todo handle cb(new Err) + cb(); + }); + + PART.emit('data', BUFFER = new Buffer('test')); + + gently.expect(FILE, 'end', function(cb) { + gently.expect(form, 'emit', function(event, field, file) { + assert.equal(event, 'file'); + assert.strictEqual(file, FILE); + }); + + gently.expect(form, '_maybeEnd'); + + cb(); + assert.equal(form._flushing, 0); + }); + + PART.emit('end'); + })(); +}); + +test(function _uploadPath() { + (function testUniqueId() { + var UUID_A, UUID_B; + gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) { + assert.equal(uploadDir, form.uploadDir); + UUID_A = uuid; + }); + form._uploadPath(); + + gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) { + UUID_B = uuid; + }); + form._uploadPath(); + + assert.notEqual(UUID_A, UUID_B); + })(); + + (function testFileExtension() { + form.keepExtensions = true; + var FILENAME = 'foo.jpg', + EXT = '.bar'; + + gently.expect(GENTLY.hijacked.path, 'extname', function(filename) { + assert.equal(filename, FILENAME); + gently.restore(path, 'extname'); + + return EXT; + }); + + gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, name) { + assert.equal(path.extname(name), EXT); + }); + form._uploadPath(FILENAME); + })(); +}); + +test(function _maybeEnd() { + gently.expect(form, 'emit', 0); + form._maybeEnd(); + + form.ended = true; + form._flushing = 1; + form._maybeEnd(); + + gently.expect(form, 'emit', function(event) { + assert.equal(event, 'end'); + }); + + form.ended = true; + form._flushing = 0; + form._maybeEnd(); +}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js new file mode 100644 index 0000000..d8dc968 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js @@ -0,0 +1,50 @@ +var common = require('../common'); +var multipartParser = require(common.lib + '/multipart_parser'), + MultipartParser = multipartParser.MultipartParser, + events = require('events'), + Buffer = require('buffer').Buffer, + parser; + +function test(test) { + parser = new MultipartParser(); + test(); +} + +test(function constructor() { + assert.equal(parser.boundary, null); + assert.equal(parser.state, 0); + assert.equal(parser.flags, 0); + assert.equal(parser.boundaryChars, null); + assert.equal(parser.index, null); + assert.equal(parser.lookbehind, null); + assert.equal(parser.constructor.name, 'MultipartParser'); +}); + +test(function initWithBoundary() { + var boundary = 'abc'; + parser.initWithBoundary(boundary); + assert.deepEqual(Array.prototype.slice.call(parser.boundary), [13, 10, 45, 45, 97, 98, 99]); + assert.equal(parser.state, multipartParser.START); + + assert.deepEqual(parser.boundaryChars, {10: true, 13: true, 45: true, 97: true, 98: true, 99: true}); +}); + +test(function parserError() { + var boundary = 'abc', + buffer = new Buffer(5); + + parser.initWithBoundary(boundary); + buffer.write('--ad', 'ascii', 0); + assert.equal(parser.write(buffer), 3); +}); + +test(function end() { + (function testError() { + assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly: ' + parser.explain()); + })(); + + (function testRegular() { + parser.state = multipartParser.END; + assert.strictEqual(parser.end(), undefined); + })(); +}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js new file mode 100644 index 0000000..54d3e2d --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js @@ -0,0 +1,45 @@ +var common = require('../common'); +var QuerystringParser = require(common.lib + '/querystring_parser').QuerystringParser, + Buffer = require('buffer').Buffer, + gently, + parser; + +function test(test) { + gently = new Gently(); + parser = new QuerystringParser(); + test(); + gently.verify(test.name); +} + +test(function constructor() { + assert.equal(parser.buffer, ''); + assert.equal(parser.constructor.name, 'QuerystringParser'); +}); + +test(function write() { + var a = new Buffer('a=1'); + assert.equal(parser.write(a), a.length); + + var b = new Buffer('&b=2'); + parser.write(b); + assert.equal(parser.buffer, a + b); +}); + +test(function end() { + var FIELDS = {a: ['b', {c: 'd'}], e: 'f'}; + + gently.expect(GENTLY.hijacked.querystring, 'parse', function(str) { + assert.equal(str, parser.buffer); + return FIELDS; + }); + + gently.expect(parser, 'onField', Object.keys(FIELDS).length, function(key, val) { + assert.deepEqual(FIELDS[key], val); + }); + + gently.expect(parser, 'onEnd'); + + parser.buffer = 'my buffer'; + parser.end(); + assert.equal(parser.buffer, ''); +}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js new file mode 100644 index 0000000..fcfdb94 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js @@ -0,0 +1,72 @@ +var common = require('../common'); +var BOUNDARY = '---------------------------10102754414578508781458777923', + FIXTURE = TEST_FIXTURES+'/multi_video.upload', + fs = require('fs'), + util = require(common.lib + '/util'), + http = require('http'), + formidable = require(common.lib + '/index'), + server = http.createServer(); + +server.on('request', function(req, res) { + var form = new formidable.IncomingForm(), + uploads = {}; + + form.uploadDir = TEST_TMP; + form.parse(req); + + form + .on('fileBegin', function(field, file) { + assert.equal(field, 'upload'); + + var tracker = {file: file, progress: [], ended: false}; + uploads[file.filename] = tracker; + file + .on('progress', function(bytesReceived) { + tracker.progress.push(bytesReceived); + assert.equal(bytesReceived, file.length); + }) + .on('end', function() { + tracker.ended = true; + }); + }) + .on('field', function(field, value) { + assert.equal(field, 'title'); + assert.equal(value, ''); + }) + .on('file', function(field, file) { + assert.equal(field, 'upload'); + assert.strictEqual(uploads[file.filename].file, file); + }) + .on('end', function() { + assert.ok(uploads['shortest_video.flv']); + assert.ok(uploads['shortest_video.flv'].ended); + assert.ok(uploads['shortest_video.flv'].progress.length > 3); + assert.equal(uploads['shortest_video.flv'].progress.slice(-1), uploads['shortest_video.flv'].file.length); + assert.ok(uploads['shortest_video.mp4']); + assert.ok(uploads['shortest_video.mp4'].ended); + assert.ok(uploads['shortest_video.mp4'].progress.length > 3); + + server.close(); + res.writeHead(200); + res.end('good'); + }); +}); + +server.listen(TEST_PORT, function() { + var client = http.createClient(TEST_PORT), + stat = fs.statSync(FIXTURE), + headers = { + 'content-type': 'multipart/form-data; boundary='+BOUNDARY, + 'content-length': stat.size, + } + request = client.request('POST', '/', headers), + fixture = new fs.ReadStream(FIXTURE); + + fixture + .on('data', function(b) { + request.write(b); + }) + .on('end', function() { + request.end(); + }); +}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js new file mode 100755 index 0000000..50b2361 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('urun')(__dirname) diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/tmp/.empty b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/tmp/.empty new file mode 100644 index 0000000..e69de29 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/.test-incoming-form.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/.test-incoming-form.js.un~ new file mode 100644 index 0000000000000000000000000000000000000000..4002e6d77c8c5034e28b755dd5e4df04a088bafc GIT binary patch literal 61302 zcmeI5+m9T_b%)oKD3O*(ij+jsA}KX5((GE~$Xeb+QWRGdO_RE;ZqeFFoKVBvUUIG7 zndQt5FJ@>-3ymHdnP>ijapoKy6j`bXWKOzB<*XtE*=wX6AnLjrOU|zYMK<|Ip|98@~E0-}?IB ze*3lWuRhUu|Ghu>z3+bZy&tc6_w$`~|9I}}LqkI+Bt4vowR*k0yU@%p^;@&U`PGHJ zS))1G9c_#plP!)&+A8T|lD;AdBiA%Ee)Hwyck=1>p>yBlQ?XS==Kk^#%lEMKV=-41 z3(5Wu6d1pG=8qkYp`jltw>#uG`y_#4&*fG(TgZD0+3{?$GdI_1H>X>@g_pap&vvf3 z;_%3^gYP($Y|p-GU}T-Mgi@8LnWN+<{JyBHZU;70-(`ng9HD3>a)ff1X7h<+rR?XMiaj@K;UCg- zO8F&5HPzG0h+m7kr5JSNt!HfI7N_c`m5M;m486w3xLJC~|T8IN`*9{s0FF)0pq z7{lMrw#B(-+80iDx^n}+E}d`2e|&CQK5vXP?dF9STVJHs755W6%4^&L)=`hQjo z4(W-hn;g?!y%i8^T=(NUeYRZ7R^9+x!b{*(mYR8~q*qmyzAVeGES>&eF7-GNj7kF2 zdLpvnM!PkaH}+=NJv6rXxFmcNqpI>y37XTS{vXsO7Q)mWC<6_Z<*xS3-&tsiV?Q4{ zZ(}pyum+5)vTV_M@M_lyJa_-gIx)bq&YePni6jw*nhKM$11PzL`S%tk*x2x(B+%WF zWjDOrvHD&~YEVn0RE^j?gw%H|DRmr3sWX9OojDV5f!y7=CTB9r)G4B_Iuqq8XZo&1 z#0K<^hb1kJLs;YDkVVnSA-4102Dgz!%bnom)@(o55g%A>pgM1G|9yceSbN2 z8(}xy?J$I}h#Q>llcYv%bhD}ZR7GO)5N_{VZW@cI&q)~RJ4e85H0J^|oGt~8MwHsc z5K#YYL2<3pu!F1Gojf}8s6eyHoC?@VA4`3qQKn8Y1l12LDm+K!2i02F7s_y{Uc2CP zzd04y=?-ZO(g;(l7|m-dBO=Z7xr}hs5jezR`b84UjU%G@DQEC^X z@ompCo=r&L(ax_ddYmzMv<$Kb%_)L2d7u#_su+#%jvM8ZUC3-UX9KlF$_Nrwj3%YG z(qP$QP6cFyEGb$vqSP*iVER`Zf^hFfwD_bXLXgc_*5InvIGR;l(168c9W_9*ce
    IVtEJ4-oRCMdZ2qdgi16PSGAyQdt<|{^o^gAUz%K<$i);+?qH*hs15iX`dKtzbK5JW$;Ui6q8 zZCKJNN!&3VE~Z88J~urxn~%%nsO-wj!bO>cexX0htn`bmZfkNO@AhQURK+b7G&4zR zkfwTP$pKY~nt2G_A6dFMmda0{zb)gzat2!_zR6f&W4hC6E?iw`aHSht@>UY#iOsSl z49~UR%FpDjsk}R^HH?hNYfD;1Id}zi{9Y}S!Y3sqA6G?U@{m^WKeiQ&$k85`bW##N zexTaN`|Z3p*_zL%vP=EW0<$7396Xc#cS%wMGj%&l4z5bn%u&)giR89?S=W!>JUe93 z;#DgDZ5({=+OAj!*D6W}hx%?wYP5)bl9Gd~A~CroZ_Bn7thTLSuN(>q|0Xi&~-Z~@m@LZnL6%u$lA660}&mM63j9?A9toC;i41J*?hgMvOvf73EDT)b~kJ zqeX0%lzLcIBqk4O1>0>a(5X_ig5`TyKLcr~?;Exw>w1b9i2gD#MKkoWqF{EDoPz+WF%*nw~cTPTRgsD{wVK=-SJM&rvWZcY1e0!A*_y?^MhkzX9S5VhOiq6j0_>;X8Zdyf?6UK zg~#k1O-egMusm%l1{s*r%rhfO?P3U~PcC&R1{%S@ZStAwnP=x)eo|@HYENaYsi_&h zTcS0a_4?=cU3625tM9C-_qZfA(3g(}(x`~aQZo<1z1QN#(^P&QqkX`WyaUB_wF0nA zHm{mMo;{v5j>$JybdK*j-|Fsi^U$AMeja*JpUgZjXQAsi%+NgCR2we{O^1QC)H`@V zqOy?Y(zMNmv2DgPiGt`In$^8SFQ1#4?96uB)qMaEPe@V&u#S?Z(KS`2ZXN>lQx+=z zr1CSIUfBm6i=UBNR8c<7hx(W#HChCtdC9d^k(fNB6&$p!K!>~;L%_B7SG#t9Vfv}T zOJmjk4asNC$&X3798FKxc%w|6VhGu%ELogN<;TBwR?RtoZ1<7F`=1vJfUTo zYjC0p(P7!(|Kr^h&EwOO)Mz?8C2_7P@J56f3u!K6wz*_-v|W;DF3WetfI2Nn4TylF zPe|YpA;v<$owVSPevc%;={P1xKEtv%Z~@m@>WWo~nmI~p_q*GaZCCtU6(XJju;WK` zQw#MolGJDsk4Z{BtSS3YPC-0d-cA8V~`Ou_C!IDnwWaxYHIK z((^tR;IxMY$@46G0~c_eB}A%3%^W4QhvkhpE!!UUGgXL=`Hgpew8IL}e?gKOErZv@ zoTb*FO4Q6lTEiLJ8gN#XpPp8o7A!Ba>3*N*~$<`r`~U{haAv5OI=Rxt$C*^sUfEU!u$_oo4}@|C;P6?#?bW+9kf zb(mHaKd;BM2bF)VKWg>VKlzYJwjb6u-fO}Cy04RrromOwjo+r`fFuzX(i~c@Ijk<4 z13?RS=`;(2&;-ay8-X*fm|iOEAS z{knB1q^CbqhjKrL>VD>1KXDT?{S^>cKV{AjkU+kZb;-w2A;Lo7{l-#w*2mUxqrf+; zdtBi8X>&rLOTK0Vi7M8@74B=m`n)+oKqg-^f`Xb?w>h$YZv#pz|)H&NTyi!1}-XF!*cR3RERJh=qVz~Rfzt|`WFt#hP<(cf63Pu zEPvn8n4W3p%`ePfIKlT9$k!JP!dFn{lGMQL2Hsea(5fso^ANP(v}jk$f$oxYhy%J2 zQ()*CU@u-v6HqS&-89SIz)F1%XF{p6)XYmIy{a(52wh!SLf5~xD3^lU&d31COt_fq zO!a5;fj5He0=0SrCkJ+2LPDsr)XYmIy{ez^^?=Zo1>xT;hj51(+$kr`EM*9@i@s(u zcsj>rAu&XS2!r7kzkjK!EKg{i!th&F4EdZLwpB4?z)rl-b+~uPMjQoWhcR|I+n(&q z&9pC^mggYiz_KvcX*bI@FylWy$8(a#NYid!)XI}c*Ae?#cT#Js*UP&)6RWJXSX=DI z32;If~nTL@5jwAc= zB9vQ7_UXlB>6)4XdARtI>%mN<;bjnm^eyubfScBnMlp>jwTmH$zvmF&Qy|8>nDL;_ zyA{NXM=`-%4r79A)|?(Fsbe$il82%~goWVy2Z!(8Y7adg;h`mCn9iC10^TsbpLK~b zDnwYRq|`xqo3HD#mL*L5FUNRYHRI>185eUqgZko3&9?P3VM|914&S6@mu-+C!E59fh($($S@f#>cZ zQzvVbsZ$Jq_u>N%-hI{Z9;$%HF!kUr6kuIR^ZxvR2|#BFpej)_2cR24mK;^}DmkI+ z$8WxPb!p$J@^cp|Uq7=nkZk~PbU+YdJxOZNfFeRgcB7atW;9!pzMMS$q8FsSse0<7N;UQBpcw6_@f_IY|2}m ztyvlNo82peMDzLNLOxYSHDK#YQUfUm+{}uE5fvh=R8s1oyu;T8MpqV$*B!=<)joJD zMhQtPFoNxhubd2|9Pl9)5=K;run>&zIEb%b8y&`mTp>$O1ld(dv<(cL9N1Yx zs7ln#=^yoR5vpo=Ld)Wbzi2yDHrg-gkR*Mu4w7pudjl8O#q?lZ6^Y4fAsUqp zNd(E4C8>c6UrkYqDiV{|Lc~DIF^=jHf#hwLy@88unBbeD7DR}#5Jbi6D*nk3-hmfA zEs3b*HqUvNiCPBptIPX4n7$)P?QJP=kQA|~A~AUgJ$IVZd3Aq33cHKz(s7`nl@6s{O$ z>J&lpnBNgq-J4sIPe|Iu`th4DAF|;J8xgADgnBIm$uF?%4O}>C3RhH-n7kGu23Vfq zs6Jc)$yZqR1}?U7fq(KMm8E7Lg6N3#BD@1HIw6U0<;02xS$h5XyxWvs^6{x&YpO9) z1}xSIrB+9r!)#?CQAULb3!(h9qrAPi-r-n>*JTT|JkerF-iTJ5QB8DFD+(P8XZRwiKyJ2g&wO_Qs&- zqmu5G %s', req.method, req.url, socket.filename); + + req.on('end', function() { + if (req.url !== '/') { + res.end(JSON.stringify({ + method: req.method, + url: req.url, + filename: socket.filename, + })); + return; + } + + res.writeHead(200, {'content-type': 'text/html'}); + res.end( + '
    '+ + '
    '+ + '
    '+ + ''+ + '
    ' + ); + }); +}); + +server.on('connection', function(socket) { + connections++; + + socket.id = connections; + socket.filename = 'connection-' + socket.id + '.http'; + socket.file = fs.createWriteStream(socket.filename); + socket.pipe(socket.file); + + console.log('--> %s', socket.filename); + socket.on('close', function() { + console.log('<-- %s', socket.filename); + }); +}); + +var port = process.env.PORT || 8080; +server.listen(port, function() { + console.log('Recording connections on port %s', port); +}); diff --git a/usb_auth/node_modules/express/node_modules/connect/package.json b/usb_auth/node_modules/express/node_modules/connect/package.json new file mode 100644 index 0000000..f9c43d5 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/package.json @@ -0,0 +1,25 @@ +{ + "name": "connect", + "version": "1.8.5", + "description": "High performance middleware framework", + "keywords": ["framework", "web", "middleware", "connect", "rack"], + "repository": "git://github.com/senchalabs/connect.git", + "author": "TJ Holowaychuk (http://tjholowaychuk.com)", + "repository": "git://github.com/senchalabs/connect", + "dependencies": { + "qs": ">= 0.4.0", + "mime": ">= 0.0.1", + "formidable": "1.0.x" + }, + "devDependencies": { + "expresso": "0.9.2", + "koala": "0.1.2", + "less": "1.1.1", + "sass": "0.5.0", + "markdown": "0.2.1", + "ejs": "0.4.3", + "should": "0.3.2" + }, + "main": "index", + "engines": { "node": ">= 0.4.1 < 0.7.0" } +} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/test.js b/usb_auth/node_modules/express/node_modules/connect/test.js new file mode 100644 index 0000000..a1e1d55 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/connect/test.js @@ -0,0 +1,52 @@ + +var connect = require('./') + , http = require('http') + , RedisStore = require('connect-redis')(connect); + +var app = connect(); +app.use(connect.cookieParser('fucj')); +app.use(connect.session({store:new RedisStore})); +app.use(function(req, res, next){ + req.session.views = (req.session.views || 0) + 1; + res.writeHead(200, {"Content-Type": "text/plain"}); + res.end("You've viewed this page "+req.session.views+" times."); +}) + +http.createServer(app).listen(3000); + + +// var set = RedisStore.prototype.set; +// +// function slow(sid){ +// console.log('%s saving', sid); +// var args = arguments; +// setTimeout(function(self){ +// console.log('%s saved', sid); +// set.apply(self, args); +// }, 2000, this); +// }; +// +// http.createServer(connect() +// .use(connect.logger('dev')) +// .use(connect.cookieParser('keyboard cat')) +// .use(connect.session({ store: new RedisStore })) +// .use(function(req, res, next){ +// var sess = req.session; +// switch (req.url) { +// case '/foo.js': +// console.log('%s foo.js sid', sess.id); +// RedisStore.prototype.set = set; +// res.end('data'); +// break; +// default: +// console.log('%s html sid', sess.id); +// RedisStore.prototype.set = slow; +// res.setHeader('Content-Type', 'html'); +// res.write(''); +// setTimeout(function(){ +// res.end(''); +// }, 1000); +// } +// })).listen(3000); +// +// console.log('port 3000'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mime/LICENSE b/usb_auth/node_modules/express/node_modules/mime/LICENSE new file mode 100644 index 0000000..451fc45 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mime/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Benjamin Thomas, Robert Kieffer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/usb_auth/node_modules/express/node_modules/mime/README.md b/usb_auth/node_modules/express/node_modules/mime/README.md new file mode 100644 index 0000000..a157de1 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mime/README.md @@ -0,0 +1,50 @@ +# mime + +Support for mapping between file extensions and MIME types. This module uses the latest version of the Apache "mime.types" file (maps over 620 types to 800+ extensions). It is also trivially easy to add your own types and extensions, should you need to do that. + +## Install + +Install with [npm](http://github.com/isaacs/npm): + + npm install mime + +## API - Queries + +### mime.lookup(path) +Get the mime type associated with a file. This is method is case-insensitive. Everything in path up to and including the last '/' or '.' is ignored, so you can pass it paths, filenames, or extensions, like so: + + var mime = require('mime'); + + mime.lookup('/path/to/file.txt'); // => 'text/plain' + mime.lookup('file.txt'); // => 'text/plain' + mime.lookup('.txt'); // => 'text/plain' + mime.lookup('htm'); // => 'text/html' + +### mime.extension(type) - lookup the default extension for type + + mime.extension('text/html'); // => 'html' + mime.extension('application/octet-stream'); // => 'bin' + +### mime.charsets.lookup() - map mime-type to charset + + mime.charsets.lookup('text/plain'); // => 'UTF-8' + +(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) + +## API - Customizing + +The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/bentomas/node-mime/wiki/Requesting-New-Types). +### mime.define() - Add custom mime/extension mappings + + mime.define({ + 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], + 'application/x-my-type': ['x-mt', 'x-mtt'], + // etc ... + }); + + mime.lookup('x-sft'); // => 'text/x-some-format' + mime.extension('text/x-some-format'); // => 'x-sf' + +### mime.load(filepath) - Load mappings from an Apache ".types" format file + + mime.load('./my_project.types'); diff --git a/usb_auth/node_modules/express/node_modules/mime/mime.js b/usb_auth/node_modules/express/node_modules/mime/mime.js new file mode 100644 index 0000000..5fac753 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mime/mime.js @@ -0,0 +1,92 @@ +var path = require('path'), + fs = require('fs'); + +var mime = module.exports = { + /** Map of extension to mime type */ + types: {}, + + /** Map of mime type to extension */ + extensions :{}, + + /** + * Define mimetype -> extension mappings. Each key is a mime-type that maps + * to an array of extensions associated with the type. The first extension is + * used as the default extension for the type. + * + * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); + * + * @param map (Object) type definitions + */ + define: function(map) { + for (var type in map) { + var exts = map[type]; + + for (var i = 0; i < exts.length; i++) { + mime.types[exts[i]] = type; + } + + // Default extension is the first one we encounter + if (!mime.extensions[type]) { + mime.extensions[type] = exts[0]; + } + } + }, + + /** + * Load an Apache2-style ".types" file + * + * This may be called multiple times (it's expected). Where files declare + * overlapping types/extensions, the last file wins. + * + * @param file (String) path of file to load. + */ + load: function(file) { + // Read file and split into lines + var map = {}, + content = fs.readFileSync(file, 'ascii'), + lines = content.split(/[\r\n]+/); + + lines.forEach(function(line, lineno) { + // Clean up whitespace/comments, and split into fields + var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); + map[fields.shift()] = fields; + }); + + mime.define(map); + }, + + /** + * Lookup a mime type based on extension + */ + lookup: function(path, fallback) { + var ext = path.replace(/.*[\.\/]/, '').toLowerCase(); + return mime.types[ext] || fallback || mime.default_type; + }, + + /** + * Return file extension associated with a mime type + */ + extension: function(mimeType) { + return mime.extensions[mimeType]; + }, + + /** + * Lookup a charset based on mime type. + */ + charsets: { + lookup: function (mimeType, fallback) { + // Assume text types are utf8. Modify mime logic as needed. + return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; + } + } +}; + +// Load our local copy of +// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types +mime.load(path.join(__dirname, 'types/mime.types')); + +// Overlay enhancements submitted by the node.js community +mime.load(path.join(__dirname, 'types/node.types')); + +// Set the default type +mime.default_type = mime.types.bin; diff --git a/usb_auth/node_modules/express/node_modules/mime/package.json b/usb_auth/node_modules/express/node_modules/mime/package.json new file mode 100644 index 0000000..85277b0 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mime/package.json @@ -0,0 +1,22 @@ +{ + "author": { + "name": "Robert Kieffer", + "url": "http://github.com/broofa", + "email": "robert@broofa.com" + }, + "contributors": [ + { + "name": "Benjamin Thomas", + "url": "http://github.com/bentomas", + "email": "benjamin@benjaminthomas.org" + } + ], + "dependencies": {}, + "description": "A comprehensive library for mime-type mapping", + "devDependencies": {"async_testing": ""}, + "keywords": ["util", "mime"], + "main": "mime.js", + "name": "mime", + "repository": {"url": "http://github.com/bentomas/node-mime", "type": "git"}, + "version": "1.2.4" +} diff --git a/usb_auth/node_modules/express/node_modules/mime/test.js b/usb_auth/node_modules/express/node_modules/mime/test.js new file mode 100644 index 0000000..b904895 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mime/test.js @@ -0,0 +1,79 @@ +/** + * Requires the async_testing module + * + * Usage: node test.js + */ +var mime = require('./mime'); +exports["test mime lookup"] = function(test) { + // easy + test.equal('text/plain', mime.lookup('text.txt')); + + // hidden file or multiple periods + test.equal('text/plain', mime.lookup('.text.txt')); + + // just an extension + test.equal('text/plain', mime.lookup('.txt')); + + // just an extension without a dot + test.equal('text/plain', mime.lookup('txt')); + + // default + test.equal('application/octet-stream', mime.lookup('text.nope')); + + // fallback + test.equal('fallback', mime.lookup('text.fallback', 'fallback')); + + test.finish(); +}; + +exports["test extension lookup"] = function(test) { + // easy + test.equal('txt', mime.extension(mime.types.text)); + test.equal('html', mime.extension(mime.types.htm)); + test.equal('bin', mime.extension('application/octet-stream')); + + test.finish(); +}; + +exports["test mime lookup uppercase"] = function(test) { + // easy + test.equal('text/plain', mime.lookup('TEXT.TXT')); + + // just an extension + test.equal('text/plain', mime.lookup('.TXT')); + + // just an extension without a dot + test.equal('text/plain', mime.lookup('TXT')); + + // default + test.equal('application/octet-stream', mime.lookup('TEXT.NOPE')); + + // fallback + test.equal('fallback', mime.lookup('TEXT.FALLBACK', 'fallback')); + + test.finish(); +}; + +exports["test custom types"] = function(test) { + test.equal('application/octet-stream', mime.lookup('file.buffer')); + test.equal('audio/mp4', mime.lookup('file.m4a')); + + test.finish(); +}; + +exports["test charset lookup"] = function(test) { + // easy + test.equal('UTF-8', mime.charsets.lookup('text/plain')); + + // none + test.ok(typeof mime.charsets.lookup(mime.types.js) == 'undefined'); + + // fallback + test.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); + + test.finish(); +}; + +if (module == require.main) { + require('async_testing').run(__filename, process.ARGV); +} diff --git a/usb_auth/node_modules/express/node_modules/mime/types/mime.types b/usb_auth/node_modules/express/node_modules/mime/types/mime.types new file mode 100644 index 0000000..6a90929 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mime/types/mime.types @@ -0,0 +1,1479 @@ +# This file maps Internet media types to unique file extension(s). +# Although created for httpd, this file is used by many software systems +# and has been placed in the public domain for unlimited redisribution. +# +# The table below contains both registered and (common) unregistered types. +# A type that has no unique extension can be ignored -- they are listed +# here to guide configurations toward known types and to make it easier to +# identify "new" types. File extensions are also commonly used to indicate +# content languages and encodings, so choose them carefully. +# +# Internet media types should be registered as described in RFC 4288. +# The registry is at . +# +# MIME type (lowercased) Extensions +# ============================================ ========== +# application/1d-interleaved-parityfec +# application/3gpp-ims+xml +# application/activemessage +application/andrew-inset ez +# application/applefile +application/applixware aw +application/atom+xml atom +application/atomcat+xml atomcat +# application/atomicmail +application/atomsvc+xml atomsvc +# application/auth-policy+xml +# application/batch-smtp +# application/beep+xml +# application/cals-1840 +application/ccxml+xml ccxml +application/cdmi-capability cdmia +application/cdmi-container cdmic +application/cdmi-domain cdmid +application/cdmi-object cdmio +application/cdmi-queue cdmiq +# application/cea-2018+xml +# application/cellml+xml +# application/cfw +# application/cnrp+xml +# application/commonground +# application/conference-info+xml +# application/cpl+xml +# application/csta+xml +# application/cstadata+xml +application/cu-seeme cu +# application/cybercash +application/davmount+xml davmount +# application/dca-rft +# application/dec-dx +# application/dialog-info+xml +# application/dicom +# application/dns +# application/dskpp+xml +application/dssc+der dssc +application/dssc+xml xdssc +# application/dvcs +application/ecmascript ecma +# application/edi-consent +# application/edi-x12 +# application/edifact +application/emma+xml emma +# application/epp+xml +application/epub+zip epub +# application/eshop +# application/example +application/exi exi +# application/fastinfoset +# application/fastsoap +# application/fits +application/font-tdpfr pfr +# application/framework-attributes+xml +# application/h224 +# application/held+xml +# application/http +application/hyperstudio stk +# application/ibe-key-request+xml +# application/ibe-pkg-reply+xml +# application/ibe-pp-data +# application/iges +# application/im-iscomposing+xml +# application/index +# application/index.cmd +# application/index.obj +# application/index.response +# application/index.vnd +# application/iotp +application/ipfix ipfix +# application/ipp +# application/isup +application/java-archive jar +application/java-serialized-object ser +application/java-vm class +application/javascript js +application/json json +# application/kpml-request+xml +# application/kpml-response+xml +application/lost+xml lostxml +application/mac-binhex40 hqx +application/mac-compactpro cpt +# application/macwriteii +application/mads+xml mads +application/marc mrc +application/marcxml+xml mrcx +application/mathematica ma nb mb +# application/mathml-content+xml +# application/mathml-presentation+xml +application/mathml+xml mathml +# application/mbms-associated-procedure-description+xml +# application/mbms-deregister+xml +# application/mbms-envelope+xml +# application/mbms-msk+xml +# application/mbms-msk-response+xml +# application/mbms-protection-description+xml +# application/mbms-reception-report+xml +# application/mbms-register+xml +# application/mbms-register-response+xml +# application/mbms-user-service-description+xml +application/mbox mbox +# application/media_control+xml +application/mediaservercontrol+xml mscml +application/metalink4+xml meta4 +application/mets+xml mets +# application/mikey +application/mods+xml mods +# application/moss-keys +# application/moss-signature +# application/mosskey-data +# application/mosskey-request +application/mp21 m21 mp21 +application/mp4 mp4s +# application/mpeg4-generic +# application/mpeg4-iod +# application/mpeg4-iod-xmt +# application/msc-ivr+xml +# application/msc-mixer+xml +application/msword doc dot +application/mxf mxf +# application/nasdata +# application/news-checkgroups +# application/news-groupinfo +# application/news-transmission +# application/nss +# application/ocsp-request +# application/ocsp-response +application/octet-stream bin dms lha lrf lzh so iso dmg dist distz pkg bpk dump elc deploy +application/oda oda +application/oebps-package+xml opf +application/ogg ogx +application/onenote onetoc onetoc2 onetmp onepkg +# application/parityfec +application/patch-ops-error+xml xer +application/pdf pdf +application/pgp-encrypted pgp +# application/pgp-keys +application/pgp-signature asc sig +application/pics-rules prf +# application/pidf+xml +# application/pidf-diff+xml +application/pkcs10 p10 +application/pkcs7-mime p7m p7c +application/pkcs7-signature p7s +application/pkcs8 p8 +application/pkix-attr-cert ac +application/pkix-cert cer +application/pkix-crl crl +application/pkix-pkipath pkipath +application/pkixcmp pki +application/pls+xml pls +# application/poc-settings+xml +application/postscript ai eps ps +# application/prs.alvestrand.titrax-sheet +application/prs.cww cww +# application/prs.nprend +# application/prs.plucker +# application/prs.rdf-xml-crypt +# application/prs.xsf+xml +application/pskc+xml pskcxml +# application/qsig +application/rdf+xml rdf +application/reginfo+xml rif +application/relax-ng-compact-syntax rnc +# application/remote-printing +application/resource-lists+xml rl +application/resource-lists-diff+xml rld +# application/riscos +# application/rlmi+xml +application/rls-services+xml rs +application/rsd+xml rsd +application/rss+xml rss +application/rtf rtf +# application/rtx +# application/samlassertion+xml +# application/samlmetadata+xml +application/sbml+xml sbml +application/scvp-cv-request scq +application/scvp-cv-response scs +application/scvp-vp-request spq +application/scvp-vp-response spp +application/sdp sdp +# application/set-payment +application/set-payment-initiation setpay +# application/set-registration +application/set-registration-initiation setreg +# application/sgml +# application/sgml-open-catalog +application/shf+xml shf +# application/sieve +# application/simple-filter+xml +# application/simple-message-summary +# application/simplesymbolcontainer +# application/slate +# application/smil +application/smil+xml smi smil +# application/soap+fastinfoset +# application/soap+xml +application/sparql-query rq +application/sparql-results+xml srx +# application/spirits-event+xml +application/srgs gram +application/srgs+xml grxml +application/sru+xml sru +application/ssml+xml ssml +# application/tamp-apex-update +# application/tamp-apex-update-confirm +# application/tamp-community-update +# application/tamp-community-update-confirm +# application/tamp-error +# application/tamp-sequence-adjust +# application/tamp-sequence-adjust-confirm +# application/tamp-status-query +# application/tamp-status-response +# application/tamp-update +# application/tamp-update-confirm +application/tei+xml tei teicorpus +application/thraud+xml tfi +# application/timestamp-query +# application/timestamp-reply +application/timestamped-data tsd +# application/tve-trigger +# application/ulpfec +# application/vemmi +# application/vividence.scriptfile +# application/vnd.3gpp.bsf+xml +application/vnd.3gpp.pic-bw-large plb +application/vnd.3gpp.pic-bw-small psb +application/vnd.3gpp.pic-bw-var pvb +# application/vnd.3gpp.sms +# application/vnd.3gpp2.bcmcsinfo+xml +# application/vnd.3gpp2.sms +application/vnd.3gpp2.tcap tcap +application/vnd.3m.post-it-notes pwn +application/vnd.accpac.simply.aso aso +application/vnd.accpac.simply.imp imp +application/vnd.acucobol acu +application/vnd.acucorp atc acutc +application/vnd.adobe.air-application-installer-package+zip air +application/vnd.adobe.fxp fxp fxpl +# application/vnd.adobe.partial-upload +application/vnd.adobe.xdp+xml xdp +application/vnd.adobe.xfdf xfdf +# application/vnd.aether.imp +# application/vnd.ah-barcode +application/vnd.ahead.space ahead +application/vnd.airzip.filesecure.azf azf +application/vnd.airzip.filesecure.azs azs +application/vnd.amazon.ebook azw +application/vnd.americandynamics.acc acc +application/vnd.amiga.ami ami +# application/vnd.amundsen.maze+xml +application/vnd.android.package-archive apk +application/vnd.anser-web-certificate-issue-initiation cii +application/vnd.anser-web-funds-transfer-initiation fti +application/vnd.antix.game-component atx +application/vnd.apple.installer+xml mpkg +application/vnd.apple.mpegurl m3u8 +# application/vnd.arastra.swi +application/vnd.aristanetworks.swi swi +application/vnd.audiograph aep +# application/vnd.autopackage +# application/vnd.avistar+xml +application/vnd.blueice.multipass mpm +# application/vnd.bluetooth.ep.oob +application/vnd.bmi bmi +application/vnd.businessobjects rep +# application/vnd.cab-jscript +# application/vnd.canon-cpdl +# application/vnd.canon-lips +# application/vnd.cendio.thinlinc.clientconf +application/vnd.chemdraw+xml cdxml +application/vnd.chipnuts.karaoke-mmd mmd +application/vnd.cinderella cdy +# application/vnd.cirpack.isdn-ext +application/vnd.claymore cla +application/vnd.cloanto.rp9 rp9 +application/vnd.clonk.c4group c4g c4d c4f c4p c4u +application/vnd.cluetrust.cartomobile-config c11amc +application/vnd.cluetrust.cartomobile-config-pkg c11amz +# application/vnd.commerce-battelle +application/vnd.commonspace csp +application/vnd.contact.cmsg cdbcmsg +application/vnd.cosmocaller cmc +application/vnd.crick.clicker clkx +application/vnd.crick.clicker.keyboard clkk +application/vnd.crick.clicker.palette clkp +application/vnd.crick.clicker.template clkt +application/vnd.crick.clicker.wordbank clkw +application/vnd.criticaltools.wbs+xml wbs +application/vnd.ctc-posml pml +# application/vnd.ctct.ws+xml +# application/vnd.cups-pdf +# application/vnd.cups-postscript +application/vnd.cups-ppd ppd +# application/vnd.cups-raster +# application/vnd.cups-raw +application/vnd.curl.car car +application/vnd.curl.pcurl pcurl +# application/vnd.cybank +application/vnd.data-vision.rdz rdz +application/vnd.dece.data uvf uvvf uvd uvvd +application/vnd.dece.ttml+xml uvt uvvt +application/vnd.dece.unspecified uvx uvvx +application/vnd.denovo.fcselayout-link fe_launch +# application/vnd.dir-bi.plate-dl-nosuffix +application/vnd.dna dna +application/vnd.dolby.mlp mlp +# application/vnd.dolby.mobile.1 +# application/vnd.dolby.mobile.2 +application/vnd.dpgraph dpg +application/vnd.dreamfactory dfac +application/vnd.dvb.ait ait +# application/vnd.dvb.dvbj +# application/vnd.dvb.esgcontainer +# application/vnd.dvb.ipdcdftnotifaccess +# application/vnd.dvb.ipdcesgaccess +# application/vnd.dvb.ipdcesgaccess2 +# application/vnd.dvb.ipdcesgpdd +# application/vnd.dvb.ipdcroaming +# application/vnd.dvb.iptv.alfec-base +# application/vnd.dvb.iptv.alfec-enhancement +# application/vnd.dvb.notif-aggregate-root+xml +# application/vnd.dvb.notif-container+xml +# application/vnd.dvb.notif-generic+xml +# application/vnd.dvb.notif-ia-msglist+xml +# application/vnd.dvb.notif-ia-registration-request+xml +# application/vnd.dvb.notif-ia-registration-response+xml +# application/vnd.dvb.notif-init+xml +# application/vnd.dvb.pfr +application/vnd.dvb.service svc +# application/vnd.dxr +application/vnd.dynageo geo +# application/vnd.easykaraoke.cdgdownload +# application/vnd.ecdis-update +application/vnd.ecowin.chart mag +# application/vnd.ecowin.filerequest +# application/vnd.ecowin.fileupdate +# application/vnd.ecowin.series +# application/vnd.ecowin.seriesrequest +# application/vnd.ecowin.seriesupdate +# application/vnd.emclient.accessrequest+xml +application/vnd.enliven nml +application/vnd.epson.esf esf +application/vnd.epson.msf msf +application/vnd.epson.quickanime qam +application/vnd.epson.salt slt +application/vnd.epson.ssf ssf +# application/vnd.ericsson.quickcall +application/vnd.eszigno3+xml es3 et3 +# application/vnd.etsi.aoc+xml +# application/vnd.etsi.cug+xml +# application/vnd.etsi.iptvcommand+xml +# application/vnd.etsi.iptvdiscovery+xml +# application/vnd.etsi.iptvprofile+xml +# application/vnd.etsi.iptvsad-bc+xml +# application/vnd.etsi.iptvsad-cod+xml +# application/vnd.etsi.iptvsad-npvr+xml +# application/vnd.etsi.iptvservice+xml +# application/vnd.etsi.iptvsync+xml +# application/vnd.etsi.iptvueprofile+xml +# application/vnd.etsi.mcid+xml +# application/vnd.etsi.overload-control-policy-dataset+xml +# application/vnd.etsi.sci+xml +# application/vnd.etsi.simservs+xml +# application/vnd.etsi.tsl+xml +# application/vnd.etsi.tsl.der +# application/vnd.eudora.data +application/vnd.ezpix-album ez2 +application/vnd.ezpix-package ez3 +# application/vnd.f-secure.mobile +application/vnd.fdf fdf +application/vnd.fdsn.mseed mseed +application/vnd.fdsn.seed seed dataless +# application/vnd.ffsns +# application/vnd.fints +application/vnd.flographit gph +application/vnd.fluxtime.clip ftc +# application/vnd.font-fontforge-sfd +application/vnd.framemaker fm frame maker book +application/vnd.frogans.fnc fnc +application/vnd.frogans.ltf ltf +application/vnd.fsc.weblaunch fsc +application/vnd.fujitsu.oasys oas +application/vnd.fujitsu.oasys2 oa2 +application/vnd.fujitsu.oasys3 oa3 +application/vnd.fujitsu.oasysgp fg5 +application/vnd.fujitsu.oasysprs bh2 +# application/vnd.fujixerox.art-ex +# application/vnd.fujixerox.art4 +# application/vnd.fujixerox.hbpl +application/vnd.fujixerox.ddd ddd +application/vnd.fujixerox.docuworks xdw +application/vnd.fujixerox.docuworks.binder xbd +# application/vnd.fut-misnet +application/vnd.fuzzysheet fzs +application/vnd.genomatix.tuxedo txd +# application/vnd.geocube+xml +application/vnd.geogebra.file ggb +application/vnd.geogebra.tool ggt +application/vnd.geometry-explorer gex gre +application/vnd.geonext gxt +application/vnd.geoplan g2w +application/vnd.geospace g3w +# application/vnd.globalplatform.card-content-mgt +# application/vnd.globalplatform.card-content-mgt-response +application/vnd.gmx gmx +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/vnd.grafeq gqf gqs +# application/vnd.gridmp +application/vnd.groove-account gac +application/vnd.groove-help ghf +application/vnd.groove-identity-message gim +application/vnd.groove-injector grv +application/vnd.groove-tool-message gtm +application/vnd.groove-tool-template tpl +application/vnd.groove-vcard vcg +application/vnd.hal+xml hal +application/vnd.handheld-entertainment+xml zmm +application/vnd.hbci hbci +# application/vnd.hcl-bireports +application/vnd.hhe.lesson-player les +application/vnd.hp-hpgl hpgl +application/vnd.hp-hpid hpid +application/vnd.hp-hps hps +application/vnd.hp-jlyt jlt +application/vnd.hp-pcl pcl +application/vnd.hp-pclxl pclxl +# application/vnd.httphone +application/vnd.hydrostatix.sof-data sfd-hdstx +application/vnd.hzn-3d-crossword x3d +# application/vnd.ibm.afplinedata +# application/vnd.ibm.electronic-media +application/vnd.ibm.minipay mpy +application/vnd.ibm.modcap afp listafp list3820 +application/vnd.ibm.rights-management irm +application/vnd.ibm.secure-container sc +application/vnd.iccprofile icc icm +application/vnd.igloader igl +application/vnd.immervision-ivp ivp +application/vnd.immervision-ivu ivu +# application/vnd.informedcontrol.rms+xml +# application/vnd.informix-visionary +# application/vnd.infotech.project +# application/vnd.infotech.project+xml +application/vnd.insors.igm igm +application/vnd.intercon.formnet xpw xpx +application/vnd.intergeo i2g +# application/vnd.intertrust.digibox +# application/vnd.intertrust.nncp +application/vnd.intu.qbo qbo +application/vnd.intu.qfx qfx +# application/vnd.iptc.g2.conceptitem+xml +# application/vnd.iptc.g2.knowledgeitem+xml +# application/vnd.iptc.g2.newsitem+xml +# application/vnd.iptc.g2.packageitem+xml +application/vnd.ipunplugged.rcprofile rcprofile +application/vnd.irepository.package+xml irp +application/vnd.is-xpr xpr +application/vnd.isac.fcs fcs +application/vnd.jam jam +# application/vnd.japannet-directory-service +# application/vnd.japannet-jpnstore-wakeup +# application/vnd.japannet-payment-wakeup +# application/vnd.japannet-registration +# application/vnd.japannet-registration-wakeup +# application/vnd.japannet-setstore-wakeup +# application/vnd.japannet-verification +# application/vnd.japannet-verification-wakeup +application/vnd.jcp.javame.midlet-rms rms +application/vnd.jisp jisp +application/vnd.joost.joda-archive joda +application/vnd.kahootz ktz ktr +application/vnd.kde.karbon karbon +application/vnd.kde.kchart chrt +application/vnd.kde.kformula kfo +application/vnd.kde.kivio flw +application/vnd.kde.kontour kon +application/vnd.kde.kpresenter kpr kpt +application/vnd.kde.kspread ksp +application/vnd.kde.kword kwd kwt +application/vnd.kenameaapp htke +application/vnd.kidspiration kia +application/vnd.kinar kne knp +application/vnd.koan skp skd skt skm +application/vnd.kodak-descriptor sse +application/vnd.las.las+xml lasxml +# application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop lbd +application/vnd.llamagraphics.life-balance.exchange+xml lbe +application/vnd.lotus-1-2-3 123 +application/vnd.lotus-approach apr +application/vnd.lotus-freelance pre +application/vnd.lotus-notes nsf +application/vnd.lotus-organizer org +application/vnd.lotus-screencam scm +application/vnd.lotus-wordpro lwp +application/vnd.macports.portpkg portpkg +# application/vnd.marlin.drm.actiontoken+xml +# application/vnd.marlin.drm.conftoken+xml +# application/vnd.marlin.drm.license+xml +# application/vnd.marlin.drm.mdcf +application/vnd.mcd mcd +application/vnd.medcalcdata mc1 +application/vnd.mediastation.cdkey cdkey +# application/vnd.meridian-slingshot +application/vnd.mfer mwf +application/vnd.mfmp mfm +application/vnd.micrografx.flo flo +application/vnd.micrografx.igx igx +application/vnd.mif mif +# application/vnd.minisoft-hp3000-save +# application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf daf +application/vnd.mobius.dis dis +application/vnd.mobius.mbk mbk +application/vnd.mobius.mqy mqy +application/vnd.mobius.msl msl +application/vnd.mobius.plc plc +application/vnd.mobius.txf txf +application/vnd.mophun.application mpn +application/vnd.mophun.certificate mpc +# application/vnd.motorola.flexsuite +# application/vnd.motorola.flexsuite.adsi +# application/vnd.motorola.flexsuite.fis +# application/vnd.motorola.flexsuite.gotap +# application/vnd.motorola.flexsuite.kmr +# application/vnd.motorola.flexsuite.ttc +# application/vnd.motorola.flexsuite.wem +# application/vnd.motorola.iprm +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry cil +# application/vnd.ms-asf +application/vnd.ms-cab-compressed cab +application/vnd.ms-excel xls xlm xla xlc xlt xlw +application/vnd.ms-excel.addin.macroenabled.12 xlam +application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb +application/vnd.ms-excel.sheet.macroenabled.12 xlsm +application/vnd.ms-excel.template.macroenabled.12 xltm +application/vnd.ms-fontobject eot +application/vnd.ms-htmlhelp chm +application/vnd.ms-ims ims +application/vnd.ms-lrm lrm +# application/vnd.ms-office.activex+xml +application/vnd.ms-officetheme thmx +application/vnd.ms-pki.seccat cat +application/vnd.ms-pki.stl stl +# application/vnd.ms-playready.initiator+xml +application/vnd.ms-powerpoint ppt pps pot +application/vnd.ms-powerpoint.addin.macroenabled.12 ppam +application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm +application/vnd.ms-powerpoint.slide.macroenabled.12 sldm +application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm +application/vnd.ms-powerpoint.template.macroenabled.12 potm +application/vnd.ms-project mpp mpt +# application/vnd.ms-tnef +# application/vnd.ms-wmdrm.lic-chlg-req +# application/vnd.ms-wmdrm.lic-resp +# application/vnd.ms-wmdrm.meter-chlg-req +# application/vnd.ms-wmdrm.meter-resp +application/vnd.ms-word.document.macroenabled.12 docm +application/vnd.ms-word.template.macroenabled.12 dotm +application/vnd.ms-works wps wks wcm wdb +application/vnd.ms-wpl wpl +application/vnd.ms-xpsdocument xps +application/vnd.mseq mseq +# application/vnd.msign +# application/vnd.multiad.creator +# application/vnd.multiad.creator.cif +# application/vnd.music-niff +application/vnd.musician mus +application/vnd.muvee.style msty +# application/vnd.ncd.control +# application/vnd.ncd.reference +# application/vnd.nervana +# application/vnd.netfpx +application/vnd.neurolanguage.nlu nlu +application/vnd.noblenet-directory nnd +application/vnd.noblenet-sealer nns +application/vnd.noblenet-web nnw +# application/vnd.nokia.catalogs +# application/vnd.nokia.conml+wbxml +# application/vnd.nokia.conml+xml +# application/vnd.nokia.isds-radio-presets +# application/vnd.nokia.iptv.config+xml +# application/vnd.nokia.landmark+wbxml +# application/vnd.nokia.landmark+xml +# application/vnd.nokia.landmarkcollection+xml +# application/vnd.nokia.n-gage.ac+xml +application/vnd.nokia.n-gage.data ngdat +application/vnd.nokia.n-gage.symbian.install n-gage +# application/vnd.nokia.ncd +# application/vnd.nokia.pcd+wbxml +# application/vnd.nokia.pcd+xml +application/vnd.nokia.radio-preset rpst +application/vnd.nokia.radio-presets rpss +application/vnd.novadigm.edm edm +application/vnd.novadigm.edx edx +application/vnd.novadigm.ext ext +# application/vnd.ntt-local.file-transfer +# application/vnd.ntt-local.sip-ta_remote +# application/vnd.ntt-local.sip-ta_tcp_stream +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.chart-template otc +application/vnd.oasis.opendocument.database odb +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.formula-template odft +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.image-template oti +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master odm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +# application/vnd.obn +# application/vnd.oipf.contentaccessdownload+xml +# application/vnd.oipf.contentaccessstreaming+xml +# application/vnd.oipf.cspg-hexbinary +# application/vnd.oipf.dae.svg+xml +# application/vnd.oipf.dae.xhtml+xml +# application/vnd.oipf.mippvcontrolmessage+xml +# application/vnd.oipf.pae.gem +# application/vnd.oipf.spdiscovery+xml +# application/vnd.oipf.spdlist+xml +# application/vnd.oipf.ueprofile+xml +# application/vnd.oipf.userprofile+xml +application/vnd.olpc-sugar xo +# application/vnd.oma-scws-config +# application/vnd.oma-scws-http-request +# application/vnd.oma-scws-http-response +# application/vnd.oma.bcast.associated-procedure-parameter+xml +# application/vnd.oma.bcast.drm-trigger+xml +# application/vnd.oma.bcast.imd+xml +# application/vnd.oma.bcast.ltkm +# application/vnd.oma.bcast.notification+xml +# application/vnd.oma.bcast.provisioningtrigger +# application/vnd.oma.bcast.sgboot +# application/vnd.oma.bcast.sgdd+xml +# application/vnd.oma.bcast.sgdu +# application/vnd.oma.bcast.simple-symbol-container +# application/vnd.oma.bcast.smartcard-trigger+xml +# application/vnd.oma.bcast.sprov+xml +# application/vnd.oma.bcast.stkm +# application/vnd.oma.cab-address-book+xml +# application/vnd.oma.cab-pcc+xml +# application/vnd.oma.dcd +# application/vnd.oma.dcdc +application/vnd.oma.dd2+xml dd2 +# application/vnd.oma.drm.risd+xml +# application/vnd.oma.group-usage-list+xml +# application/vnd.oma.poc.detailed-progress-report+xml +# application/vnd.oma.poc.final-report+xml +# application/vnd.oma.poc.groups+xml +# application/vnd.oma.poc.invocation-descriptor+xml +# application/vnd.oma.poc.optimized-progress-report+xml +# application/vnd.oma.push +# application/vnd.oma.scidm.messages+xml +# application/vnd.oma.xcap-directory+xml +# application/vnd.omads-email+xml +# application/vnd.omads-file+xml +# application/vnd.omads-folder+xml +# application/vnd.omaloc-supl-init +application/vnd.openofficeorg.extension oxt +# application/vnd.openxmlformats-officedocument.custom-properties+xml +# application/vnd.openxmlformats-officedocument.customxmlproperties+xml +# application/vnd.openxmlformats-officedocument.drawing+xml +# application/vnd.openxmlformats-officedocument.drawingml.chart+xml +# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml +# application/vnd.openxmlformats-officedocument.extended-properties+xml +# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml +# application/vnd.openxmlformats-officedocument.presentationml.comments+xml +# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml +# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml +# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx +# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml +application/vnd.openxmlformats-officedocument.presentationml.slide sldx +# application/vnd.openxmlformats-officedocument.presentationml.slide+xml +# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml +# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml +application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx +# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml +# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml +# application/vnd.openxmlformats-officedocument.presentationml.tags+xml +application/vnd.openxmlformats-officedocument.presentationml.template potx +# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx +# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx +# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml +# application/vnd.openxmlformats-officedocument.theme+xml +# application/vnd.openxmlformats-officedocument.themeoverride+xml +# application/vnd.openxmlformats-officedocument.vmldrawing +# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx +# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx +# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml +# application/vnd.openxmlformats-package.core-properties+xml +# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml +# application/vnd.openxmlformats-package.relationships+xml +# application/vnd.quobject-quoxdocument +# application/vnd.osa.netdeploy +application/vnd.osgeo.mapguide.package mgp +# application/vnd.osgi.bundle +application/vnd.osgi.dp dp +# application/vnd.otps.ct-kip+xml +application/vnd.palm pdb pqa oprc +# application/vnd.paos.xml +application/vnd.pawaafile paw +application/vnd.pg.format str +application/vnd.pg.osasli ei6 +# application/vnd.piaccess.application-licence +application/vnd.picsel efif +application/vnd.pmi.widget wg +# application/vnd.poc.group-advertisement+xml +application/vnd.pocketlearn plf +application/vnd.powerbuilder6 pbd +# application/vnd.powerbuilder6-s +# application/vnd.powerbuilder7 +# application/vnd.powerbuilder7-s +# application/vnd.powerbuilder75 +# application/vnd.powerbuilder75-s +# application/vnd.preminet +application/vnd.previewsystems.box box +application/vnd.proteus.magazine mgz +application/vnd.publishare-delta-tree qps +application/vnd.pvi.ptid1 ptid +# application/vnd.pwg-multiplexed +# application/vnd.pwg-xhtml-print+xml +# application/vnd.qualcomm.brew-app-res +application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb +# application/vnd.radisys.moml+xml +# application/vnd.radisys.msml+xml +# application/vnd.radisys.msml-audit+xml +# application/vnd.radisys.msml-audit-conf+xml +# application/vnd.radisys.msml-audit-conn+xml +# application/vnd.radisys.msml-audit-dialog+xml +# application/vnd.radisys.msml-audit-stream+xml +# application/vnd.radisys.msml-conf+xml +# application/vnd.radisys.msml-dialog+xml +# application/vnd.radisys.msml-dialog-base+xml +# application/vnd.radisys.msml-dialog-fax-detect+xml +# application/vnd.radisys.msml-dialog-fax-sendrecv+xml +# application/vnd.radisys.msml-dialog-group+xml +# application/vnd.radisys.msml-dialog-speech+xml +# application/vnd.radisys.msml-dialog-transform+xml +# application/vnd.rainstor.data +# application/vnd.rapid +application/vnd.realvnc.bed bed +application/vnd.recordare.musicxml mxl +application/vnd.recordare.musicxml+xml musicxml +# application/vnd.renlearn.rlprint +application/vnd.rig.cryptonote cryptonote +application/vnd.rim.cod cod +application/vnd.rn-realmedia rm +application/vnd.route66.link66+xml link66 +# application/vnd.ruckus.download +# application/vnd.s3sms +application/vnd.sailingtracker.track st +# application/vnd.sbm.cid +# application/vnd.sbm.mid2 +# application/vnd.scribus +# application/vnd.sealed.3df +# application/vnd.sealed.csf +# application/vnd.sealed.doc +# application/vnd.sealed.eml +# application/vnd.sealed.mht +# application/vnd.sealed.net +# application/vnd.sealed.ppt +# application/vnd.sealed.tiff +# application/vnd.sealed.xls +# application/vnd.sealedmedia.softseal.html +# application/vnd.sealedmedia.softseal.pdf +application/vnd.seemail see +application/vnd.sema sema +application/vnd.semd semd +application/vnd.semf semf +application/vnd.shana.informed.formdata ifm +application/vnd.shana.informed.formtemplate itp +application/vnd.shana.informed.interchange iif +application/vnd.shana.informed.package ipk +application/vnd.simtech-mindmapper twd twds +application/vnd.smaf mmf +# application/vnd.smart.notebook +application/vnd.smart.teacher teacher +# application/vnd.software602.filler.form+xml +# application/vnd.software602.filler.form-xml-zip +application/vnd.solent.sdkm+xml sdkm sdkd +application/vnd.spotfire.dxp dxp +application/vnd.spotfire.sfs sfs +# application/vnd.sss-cod +# application/vnd.sss-dtf +# application/vnd.sss-ntf +application/vnd.stardivision.calc sdc +application/vnd.stardivision.draw sda +application/vnd.stardivision.impress sdd +application/vnd.stardivision.math smf +application/vnd.stardivision.writer sdw vor +application/vnd.stardivision.writer-global sgl +application/vnd.stepmania.stepchart sm +# application/vnd.street-stream +application/vnd.sun.xml.calc sxc +application/vnd.sun.xml.calc.template stc +application/vnd.sun.xml.draw sxd +application/vnd.sun.xml.draw.template std +application/vnd.sun.xml.impress sxi +application/vnd.sun.xml.impress.template sti +application/vnd.sun.xml.math sxm +application/vnd.sun.xml.writer sxw +application/vnd.sun.xml.writer.global sxg +application/vnd.sun.xml.writer.template stw +# application/vnd.sun.wadl+xml +application/vnd.sus-calendar sus susp +application/vnd.svd svd +# application/vnd.swiftview-ics +application/vnd.symbian.install sis sisx +application/vnd.syncml+xml xsm +application/vnd.syncml.dm+wbxml bdm +application/vnd.syncml.dm+xml xdm +# application/vnd.syncml.dm.notification +# application/vnd.syncml.ds.notification +application/vnd.tao.intent-module-archive tao +application/vnd.tmobile-livetv tmo +application/vnd.trid.tpt tpt +application/vnd.triscape.mxs mxs +application/vnd.trueapp tra +# application/vnd.truedoc +# application/vnd.ubisoft.webplayer +application/vnd.ufdl ufd ufdl +application/vnd.uiq.theme utz +application/vnd.umajin umj +application/vnd.unity unityweb +application/vnd.uoml+xml uoml +# application/vnd.uplanet.alert +# application/vnd.uplanet.alert-wbxml +# application/vnd.uplanet.bearer-choice +# application/vnd.uplanet.bearer-choice-wbxml +# application/vnd.uplanet.cacheop +# application/vnd.uplanet.cacheop-wbxml +# application/vnd.uplanet.channel +# application/vnd.uplanet.channel-wbxml +# application/vnd.uplanet.list +# application/vnd.uplanet.list-wbxml +# application/vnd.uplanet.listcmd +# application/vnd.uplanet.listcmd-wbxml +# application/vnd.uplanet.signal +application/vnd.vcx vcx +# application/vnd.vd-study +# application/vnd.vectorworks +# application/vnd.verimatrix.vcas +# application/vnd.vidsoft.vidconference +application/vnd.visio vsd vst vss vsw +application/vnd.visionary vis +# application/vnd.vividence.scriptfile +application/vnd.vsf vsf +# application/vnd.wap.sic +# application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo wtb +# application/vnd.wfa.wsc +# application/vnd.wmc +# application/vnd.wmf.bootstrap +# application/vnd.wolfram.mathematica +# application/vnd.wolfram.mathematica.package +application/vnd.wolfram.player nbp +application/vnd.wordperfect wpd +application/vnd.wqd wqd +# application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf stf +# application/vnd.wv.csp+wbxml +# application/vnd.wv.csp+xml +# application/vnd.wv.ssp+xml +application/vnd.xara xar +application/vnd.xfdl xfdl +# application/vnd.xfdl.webform +# application/vnd.xmi+xml +# application/vnd.xmpie.cpkg +# application/vnd.xmpie.dpkg +# application/vnd.xmpie.plan +# application/vnd.xmpie.ppkg +# application/vnd.xmpie.xlim +application/vnd.yamaha.hv-dic hvd +application/vnd.yamaha.hv-script hvs +application/vnd.yamaha.hv-voice hvp +application/vnd.yamaha.openscoreformat osf +application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg +# application/vnd.yamaha.remote-setup +application/vnd.yamaha.smaf-audio saf +application/vnd.yamaha.smaf-phrase spf +# application/vnd.yamaha.tunnel-udpencap +application/vnd.yellowriver-custom-menu cmp +application/vnd.zul zir zirz +application/vnd.zzazz.deck+xml zaz +application/voicexml+xml vxml +# application/vq-rtcpxr +# application/watcherinfo+xml +# application/whoispp-query +# application/whoispp-response +application/widget wgt +application/winhlp hlp +# application/wita +# application/wordperfect5.1 +application/wsdl+xml wsdl +application/wspolicy+xml wspolicy +application/x-7z-compressed 7z +application/x-abiword abw +application/x-ace-compressed ace +application/x-authorware-bin aab x32 u32 vox +application/x-authorware-map aam +application/x-authorware-seg aas +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-bzip bz +application/x-bzip2 bz2 boz +application/x-cdlink vcd +application/x-chat chat +application/x-chess-pgn pgn +# application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-debian-package deb udeb +application/x-director dir dcr dxr cst cct cxt w3d fgd swa +application/x-doom wad +application/x-dtbncx+xml ncx +application/x-dtbook+xml dtb +application/x-dtbresource+xml res +application/x-dvi dvi +application/x-font-bdf bdf +# application/x-font-dos +# application/x-font-framemaker +application/x-font-ghostscript gsf +# application/x-font-libgrx +application/x-font-linux-psf psf +application/x-font-otf otf +application/x-font-pcf pcf +application/x-font-snf snf +# application/x-font-speedo +# application/x-font-sunos-news +application/x-font-ttf ttf ttc +application/x-font-type1 pfa pfb pfm afm +application/x-font-woff woff +# application/x-font-vfont +application/x-futuresplash spl +application/x-gnumeric gnumeric +application/x-gtar gtar +# application/x-gzip +application/x-hdf hdf +application/x-java-jnlp-file jnlp +application/x-latex latex +application/x-mobipocket-ebook prc mobi +application/x-ms-application application +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-ms-xbap xbap +application/x-msaccess mdb +application/x-msbinder obd +application/x-mscardfile crd +application/x-msclip clp +application/x-msdownload exe dll com bat msi +application/x-msmediaview mvb m13 m14 +application/x-msmetafile wmf +application/x-msmoney mny +application/x-mspublisher pub +application/x-msschedule scd +application/x-msterminal trm +application/x-mswrite wri +application/x-netcdf nc cdf +application/x-pkcs12 p12 pfx +application/x-pkcs7-certificates p7b spc +application/x-pkcs7-certreqresp p7r +application/x-rar-compressed rar +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-silverlight-app xap +application/x-stuffit sit +application/x-stuffitx sitx +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-tex-tfm tfm +application/x-texinfo texinfo texi +application/x-ustar ustar +application/x-wais-source src +application/x-x509-ca-cert der crt +application/x-xfig fig +application/x-xpinstall xpi +# application/x400-bp +# application/xcap-att+xml +# application/xcap-caps+xml +application/xcap-diff+xml xdf +# application/xcap-el+xml +# application/xcap-error+xml +# application/xcap-ns+xml +# application/xcon-conference-info-diff+xml +# application/xcon-conference-info+xml +application/xenc+xml xenc +application/xhtml+xml xhtml xht +# application/xhtml-voice+xml +application/xml xml xsl +application/xml-dtd dtd +# application/xml-external-parsed-entity +# application/xmpp+xml +application/xop+xml xop +application/xslt+xml xslt +application/xspf+xml xspf +application/xv+xml mxml xhvml xvml xvm +application/yang yang +application/yin+xml yin +application/zip zip +# audio/1d-interleaved-parityfec +# audio/32kadpcm +# audio/3gpp +# audio/3gpp2 +# audio/ac3 +audio/adpcm adp +# audio/amr +# audio/amr-wb +# audio/amr-wb+ +# audio/asc +# audio/atrac-advanced-lossless +# audio/atrac-x +# audio/atrac3 +audio/basic au snd +# audio/bv16 +# audio/bv32 +# audio/clearmode +# audio/cn +# audio/dat12 +# audio/dls +# audio/dsr-es201108 +# audio/dsr-es202050 +# audio/dsr-es202211 +# audio/dsr-es202212 +# audio/dvi4 +# audio/eac3 +# audio/evrc +# audio/evrc-qcp +# audio/evrc0 +# audio/evrc1 +# audio/evrcb +# audio/evrcb0 +# audio/evrcb1 +# audio/evrcwb +# audio/evrcwb0 +# audio/evrcwb1 +# audio/example +# audio/g719 +# audio/g722 +# audio/g7221 +# audio/g723 +# audio/g726-16 +# audio/g726-24 +# audio/g726-32 +# audio/g726-40 +# audio/g728 +# audio/g729 +# audio/g7291 +# audio/g729d +# audio/g729e +# audio/gsm +# audio/gsm-efr +# audio/gsm-hr-08 +# audio/ilbc +# audio/l16 +# audio/l20 +# audio/l24 +# audio/l8 +# audio/lpc +audio/midi mid midi kar rmi +# audio/mobile-xmf +audio/mp4 mp4a +# audio/mp4a-latm +# audio/mpa +# audio/mpa-robust +audio/mpeg mpga mp2 mp2a mp3 m2a m3a +# audio/mpeg4-generic +audio/ogg oga ogg spx +# audio/parityfec +# audio/pcma +# audio/pcma-wb +# audio/pcmu-wb +# audio/pcmu +# audio/prs.sid +# audio/qcelp +# audio/red +# audio/rtp-enc-aescm128 +# audio/rtp-midi +# audio/rtx +# audio/smv +# audio/smv0 +# audio/smv-qcp +# audio/sp-midi +# audio/speex +# audio/t140c +# audio/t38 +# audio/telephone-event +# audio/tone +# audio/uemclip +# audio/ulpfec +# audio/vdvi +# audio/vmr-wb +# audio/vnd.3gpp.iufp +# audio/vnd.4sb +# audio/vnd.audiokoz +# audio/vnd.celp +# audio/vnd.cisco.nse +# audio/vnd.cmles.radio-events +# audio/vnd.cns.anp1 +# audio/vnd.cns.inf1 +audio/vnd.dece.audio uva uvva +audio/vnd.digital-winds eol +# audio/vnd.dlna.adts +# audio/vnd.dolby.heaac.1 +# audio/vnd.dolby.heaac.2 +# audio/vnd.dolby.mlp +# audio/vnd.dolby.mps +# audio/vnd.dolby.pl2 +# audio/vnd.dolby.pl2x +# audio/vnd.dolby.pl2z +# audio/vnd.dolby.pulse.1 +audio/vnd.dra dra +audio/vnd.dts dts +audio/vnd.dts.hd dtshd +# audio/vnd.everad.plj +# audio/vnd.hns.audio +audio/vnd.lucent.voice lvp +audio/vnd.ms-playready.media.pya pya +# audio/vnd.nokia.mobile-xmf +# audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 ecelp4800 +audio/vnd.nuera.ecelp7470 ecelp7470 +audio/vnd.nuera.ecelp9600 ecelp9600 +# audio/vnd.octel.sbc +# audio/vnd.qcelp +# audio/vnd.rhetorex.32kadpcm +audio/vnd.rip rip +# audio/vnd.sealedmedia.softseal.mpeg +# audio/vnd.vmx.cvsd +# audio/vorbis +# audio/vorbis-config +audio/webm weba +audio/x-aac aac +audio/x-aiff aif aiff aifc +audio/x-mpegurl m3u +audio/x-ms-wax wax +audio/x-ms-wma wma +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin rmp +audio/x-wav wav +chemical/x-cdx cdx +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-csml csml +# chemical/x-pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +# image/example +# image/fits +image/g3fax g3 +image/gif gif +image/ief ief +# image/jp2 +image/jpeg jpeg jpg jpe +# image/jpm +# image/jpx +image/ktx ktx +# image/naplps +image/png png +image/prs.btif btif +# image/prs.pti +image/svg+xml svg svgz +# image/t38 +image/tiff tiff tif +# image/tiff-fx +image/vnd.adobe.photoshop psd +# image/vnd.cns.inf2 +image/vnd.dece.graphic uvi uvvi uvg uvvg +image/vnd.dvb.subtitle sub +image/vnd.djvu djvu djv +image/vnd.dwg dwg +image/vnd.dxf dxf +image/vnd.fastbidsheet fbs +image/vnd.fpx fpx +image/vnd.fst fst +image/vnd.fujixerox.edmics-mmr mmr +image/vnd.fujixerox.edmics-rlc rlc +# image/vnd.globalgraphics.pgb +# image/vnd.microsoft.icon +# image/vnd.mix +image/vnd.ms-modi mdi +image/vnd.net-fpx npx +# image/vnd.radiance +# image/vnd.sealed.png +# image/vnd.sealedmedia.softseal.gif +# image/vnd.sealedmedia.softseal.jpg +# image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff xif +image/webp webp +image/x-cmu-raster ras +image/x-cmx cmx +image/x-freehand fh fhc fh4 fh5 fh7 +image/x-icon ico +image/x-pcx pcx +image/x-pict pic pct +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +# message/cpim +# message/delivery-status +# message/disposition-notification +# message/example +# message/external-body +# message/feedback-report +# message/global +# message/global-delivery-status +# message/global-disposition-notification +# message/global-headers +# message/http +# message/imdn+xml +# message/news +# message/partial +message/rfc822 eml mime +# message/s-http +# message/sip +# message/sipfrag +# message/tracking-status +# message/vnd.si.simp +# model/example +model/iges igs iges +model/mesh msh mesh silo +model/vnd.collada+xml dae +model/vnd.dwf dwf +# model/vnd.flatland.3dml +model/vnd.gdl gdl +# model/vnd.gs-gdl +# model/vnd.gs.gdl +model/vnd.gtw gtw +# model/vnd.moml+xml +model/vnd.mts mts +# model/vnd.parasolid.transmit.binary +# model/vnd.parasolid.transmit.text +model/vnd.vtu vtu +model/vrml wrl vrml +# multipart/alternative +# multipart/appledouble +# multipart/byteranges +# multipart/digest +# multipart/encrypted +# multipart/example +# multipart/form-data +# multipart/header-set +# multipart/mixed +# multipart/parallel +# multipart/related +# multipart/report +# multipart/signed +# multipart/voice-message +# text/1d-interleaved-parityfec +text/calendar ics ifb +text/css css +text/csv csv +# text/directory +# text/dns +# text/ecmascript +# text/enriched +# text/example +text/html html htm +# text/javascript +text/n3 n3 +# text/parityfec +text/plain txt text conf def list log in +# text/prs.fallenstein.rst +text/prs.lines.tag dsc +# text/vnd.radisys.msml-basic-layout +# text/red +# text/rfc822-headers +text/richtext rtx +# text/rtf +# text/rtp-enc-aescm128 +# text/rtx +text/sgml sgml sgm +# text/t140 +text/tab-separated-values tsv +text/troff t tr roff man me ms +text/turtle ttl +# text/ulpfec +text/uri-list uri uris urls +# text/vnd.abc +text/vnd.curl curl +text/vnd.curl.dcurl dcurl +text/vnd.curl.scurl scurl +text/vnd.curl.mcurl mcurl +# text/vnd.dmclientscript +# text/vnd.esmertec.theme-descriptor +text/vnd.fly fly +text/vnd.fmi.flexstor flx +text/vnd.graphviz gv +text/vnd.in3d.3dml 3dml +text/vnd.in3d.spot spot +# text/vnd.iptc.newsml +# text/vnd.iptc.nitf +# text/vnd.latex-z +# text/vnd.motorola.reflex +# text/vnd.ms-mediapackage +# text/vnd.net2phone.commcenter.command +# text/vnd.si.uricatalogue +text/vnd.sun.j2me.app-descriptor jad +# text/vnd.trolltech.linguist +# text/vnd.wap.si +# text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-asm s asm +text/x-c c cc cxx cpp h hh dic +text/x-fortran f for f77 f90 +text/x-pascal p pas +text/x-java-source java +text/x-setext etx +text/x-uuencode uu +text/x-vcalendar vcs +text/x-vcard vcf +# text/xml +# text/xml-external-parsed-entity +# video/1d-interleaved-parityfec +video/3gpp 3gp +# video/3gpp-tt +video/3gpp2 3g2 +# video/bmpeg +# video/bt656 +# video/celb +# video/dv +# video/example +video/h261 h261 +video/h263 h263 +# video/h263-1998 +# video/h263-2000 +video/h264 h264 +# video/h264-rcdo +# video/h264-svc +video/jpeg jpgv +# video/jpeg2000 +video/jpm jpm jpgm +video/mj2 mj2 mjp2 +# video/mp1s +# video/mp2p +# video/mp2t +video/mp4 mp4 mp4v mpg4 +# video/mp4v-es +video/mpeg mpeg mpg mpe m1v m2v +# video/mpeg4-generic +# video/mpv +# video/nv +video/ogg ogv +# video/parityfec +# video/pointer +video/quicktime qt mov +# video/raw +# video/rtp-enc-aescm128 +# video/rtx +# video/smpte292m +# video/ulpfec +# video/vc1 +# video/vnd.cctv +video/vnd.dece.hd uvh uvvh +video/vnd.dece.mobile uvm uvvm +# video/vnd.dece.mp4 +video/vnd.dece.pd uvp uvvp +video/vnd.dece.sd uvs uvvs +video/vnd.dece.video uvv uvvv +# video/vnd.directv.mpeg +# video/vnd.directv.mpeg-tts +# video/vnd.dlna.mpeg-tts +video/vnd.fvt fvt +# video/vnd.hns.video +# video/vnd.iptvforum.1dparityfec-1010 +# video/vnd.iptvforum.1dparityfec-2005 +# video/vnd.iptvforum.2dparityfec-1010 +# video/vnd.iptvforum.2dparityfec-2005 +# video/vnd.iptvforum.ttsavc +# video/vnd.iptvforum.ttsmpeg2 +# video/vnd.motorola.video +# video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.ms-playready.media.pyv pyv +# video/vnd.nokia.interleaved-multimedia +# video/vnd.nokia.videovoip +# video/vnd.objectvideo +# video/vnd.sealed.mpeg1 +# video/vnd.sealed.mpeg4 +# video/vnd.sealed.swf +# video/vnd.sealedmedia.softseal.mov +video/vnd.uvvu.mp4 uvu uvvu +video/vnd.vivo viv +video/webm webm +video/x-f4v f4v +video/x-fli fli +video/x-flv flv +video/x-m4v m4v +video/x-ms-asf asf asx +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/usb_auth/node_modules/express/node_modules/mime/types/node.types b/usb_auth/node_modules/express/node_modules/mime/types/node.types new file mode 100644 index 0000000..fdabaa4 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mime/types/node.types @@ -0,0 +1,43 @@ +# What: Google Chrome Extension +# Why: To allow apps to (work) be served with the right content type header. +# http://codereview.chromium.org/2830017 +# Added by: niftylettuce +application/x-chrome-extension crx + +# What: OTF Message Silencer +# Why: To silence the "Resource interpreted as font but transferred with MIME +# type font/otf" message that occurs in Google Chrome +# Added by: niftylettuce +font/opentype otf + +# What: HTC support +# Why: To properly render .htc files such as CSS3PIE +# Added by: niftylettuce +text/x-component htc + +# What: HTML5 application cache manifest +# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps +# per https://developer.mozilla.org/en/offline_resources_in_firefox +# Added by: louisremi +text/cache-manifest appcache manifest + +# What: node binary buffer format +# Why: semi-standard extension w/in the node community +# Added by: tootallnate +application/octet-stream buffer + +# What: The "protected" MP-4 formats used by iTunes. +# Why: Required for streaming music to browsers (?) +# Added by: broofa +application/mp4 m4p +audio/mp4 m4a + +# What: Music playlist format (http://en.wikipedia.org/wiki/M3U) +# Why: See https://github.com/bentomas/node-mime/pull/6 +# Added by: mjrusso +application/x-mpegURL m3u8 + +# What: Video format, Part of RFC1890 +# Why: See https://github.com/bentomas/node-mime/pull/6 +# Added by: mjrusso +video/MP2T ts diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.orig b/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.orig new file mode 100644 index 0000000..9303c34 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.orig @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.rej b/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.rej new file mode 100644 index 0000000..69244ff --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.rej @@ -0,0 +1,5 @@ +--- /dev/null ++++ .gitignore +@@ -0,0 +1,2 @@ ++node_modules/ ++npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/.npmignore b/usb_auth/node_modules/express/node_modules/mkdirp/.npmignore new file mode 100644 index 0000000..9303c34 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/LICENSE b/usb_auth/node_modules/express/node_modules/mkdirp/LICENSE new file mode 100644 index 0000000..432d1ae --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/README.markdown b/usb_auth/node_modules/express/node_modules/mkdirp/README.markdown new file mode 100644 index 0000000..b4dd75f --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/README.markdown @@ -0,0 +1,54 @@ +mkdirp +====== + +Like `mkdir -p`, but in node.js! + +example +======= + +pow.js +------ + var mkdirp = require('mkdirp'); + + mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') + }); + +Output + pow! + +And now /tmp/foo/bar/baz exists, huzzah! + +methods +======= + +var mkdirp = require('mkdirp'); + +mkdirp(dir, mode, cb) +--------------------- + +Create a new directory and any necessary subdirectories at `dir` with octal +permission string `mode`. + +If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. + +mkdirp.sync(dir, mode) +---------------------- + +Synchronously create a new directory and any necessary subdirectories at `dir` +with octal permission string `mode`. + +If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. + +install +======= + +With [npm](http://npmjs.org) do: + + npm install mkdirp + +license +======= + +MIT/X11 diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js b/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js new file mode 100644 index 0000000..e692421 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js @@ -0,0 +1,6 @@ +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.orig b/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.orig new file mode 100644 index 0000000..7741462 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.orig @@ -0,0 +1,6 @@ +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', 0755, function (err) { + if (err) console.error(err) + else console.log('pow!') +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.rej b/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.rej new file mode 100644 index 0000000..81e7f43 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.rej @@ -0,0 +1,19 @@ +--- examples/pow.js ++++ examples/pow.js +@@ -1,6 +1,15 @@ +-var mkdirp = require('mkdirp').mkdirp; ++var mkdirp = require('../').mkdirp, ++ mkdirpSync = require('../').mkdirpSync; + + mkdirp('/tmp/foo/bar/baz', 0755, function (err) { + if (err) console.error(err) + else console.log('pow!') + }); ++ ++try { ++ mkdirpSync('/tmp/bar/foo/baz', 0755); ++ console.log('double pow!'); ++} ++catch (ex) { ++ console.log(ex); ++} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/index.js b/usb_auth/node_modules/express/node_modules/mkdirp/index.js new file mode 100644 index 0000000..25f43ad --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/index.js @@ -0,0 +1,79 @@ +var path = require('path'); +var fs = require('fs'); + +module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; + +function mkdirP (p, mode, f) { + if (typeof mode === 'function' || mode === undefined) { + f = mode; + mode = 0777 & (~process.umask()); + } + + var cb = f || function () {}; + if (typeof mode === 'string') mode = parseInt(mode, 8); + p = path.resolve(p); + + fs.mkdir(p, mode, function (er) { + if (!er) return cb(); + switch (er.code) { + case 'ENOENT': + mkdirP(path.dirname(p), mode, function (er) { + if (er) cb(er); + else mkdirP(p, mode, cb); + }); + break; + + case 'EEXIST': + fs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original EEXIST be the failure reason. + if (er2 || !stat.isDirectory()) cb(er) + else cb(); + }); + break; + + default: + cb(er); + break; + } + }); +} + +mkdirP.sync = function sync (p, mode) { + if (mode === undefined) { + mode = 0777 & (~process.umask()); + } + + if (typeof mode === 'string') mode = parseInt(mode, 8); + p = path.resolve(p); + + try { + fs.mkdirSync(p, mode) + } + catch (err0) { + switch (err0.code) { + case 'ENOENT' : + var err1 = sync(path.dirname(p), mode) + if (err1) throw err1; + else return sync(p, mode); + break; + + case 'EEXIST' : + var stat; + try { + stat = fs.statSync(p); + } + catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0; + else return null; + break; + default : + throw err0 + break; + } + } + + return null; +}; diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/package.json b/usb_auth/node_modules/express/node_modules/mkdirp/package.json new file mode 100644 index 0000000..1bf9ac7 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/package.json @@ -0,0 +1,23 @@ +{ + "name" : "mkdirp", + "description" : "Recursively mkdir, like `mkdir -p`", + "version" : "0.3.0", + "author" : "James Halliday (http://substack.net)", + "main" : "./index", + "keywords" : [ + "mkdir", + "directory" + ], + "repository" : { + "type" : "git", + "url" : "http://github.com/substack/node-mkdirp.git" + }, + "scripts" : { + "test" : "tap test/*.js" + }, + "devDependencies" : { + "tap" : "0.0.x" + }, + "license" : "MIT/X11", + "engines": { "node": "*" } +} diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/chmod.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/chmod.js new file mode 100644 index 0000000..520dcb8 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/chmod.js @@ -0,0 +1,38 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +test('chmod-pre', function (t) { + var mode = 0744 + mkdirp(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); + t.end(); + }); + }); +}); + +test('chmod', function (t) { + var mode = 0755 + mkdirp(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.end(); + }); + }); +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/clobber.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/clobber.js new file mode 100644 index 0000000..0eb7099 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/clobber.js @@ -0,0 +1,37 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +// a file in the way +var itw = ps.slice(0, 3).join('/'); + + +test('clobber-pre', function (t) { + console.error("about to write to "+itw) + fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); + + fs.stat(itw, function (er, stat) { + t.ifError(er) + t.ok(stat && stat.isFile(), 'should be file') + t.end() + }) +}) + +test('clobber', function (t) { + t.plan(2); + mkdirp(file, 0755, function (err) { + t.ok(err); + t.equal(err.code, 'ENOTDIR'); + t.end(); + }); +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/mkdirp.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/mkdirp.js new file mode 100644 index 0000000..b07cd70 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/mkdirp.js @@ -0,0 +1,28 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('woo', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkdirp(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/perm.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/perm.js new file mode 100644 index 0000000..23a7abb --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/perm.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('async perm', function (t) { + t.plan(2); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); + + mkdirp(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); + +test('async root perm', function (t) { + mkdirp('/tmp', 0755, function (err) { + if (err) t.fail(err); + t.end(); + }); + t.end(); +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/perm_sync.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/perm_sync.js new file mode 100644 index 0000000..f685f60 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/perm_sync.js @@ -0,0 +1,39 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('sync perm', function (t) { + t.plan(2); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; + + mkdirp.sync(file, 0755); + path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }); +}); + +test('sync root perm', function (t) { + t.plan(1); + + var file = '/tmp'; + mkdirp.sync(file, 0755); + path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }); +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/race.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/race.js new file mode 100644 index 0000000..96a0447 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/race.js @@ -0,0 +1,41 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('race', function (t) { + t.plan(4); + var ps = [ '', 'tmp' ]; + + for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); + } + var file = ps.join('/'); + + var res = 2; + mk(file, function () { + if (--res === 0) t.end(); + }); + + mk(file, function () { + if (--res === 0) t.end(); + }); + + function mk (file, cb) { + mkdirp(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + if (cb) cb(); + } + }) + }) + }); + } +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/rel.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/rel.js new file mode 100644 index 0000000..7985824 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/rel.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('rel', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var cwd = process.cwd(); + process.chdir('/tmp'); + + var file = [x,y,z].join('/'); + + mkdirp(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + process.chdir(cwd); + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/sync.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/sync.js new file mode 100644 index 0000000..e0e389d --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/sync.js @@ -0,0 +1,27 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('sync', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + var err = mkdirp.sync(file, 0755); + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/umask.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/umask.js new file mode 100644 index 0000000..64ccafe --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/umask.js @@ -0,0 +1,28 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('implicit mode from umask', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkdirp(file, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0777 & (~process.umask())); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/umask_sync.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/umask_sync.js new file mode 100644 index 0000000..83cba56 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/mkdirp/test/umask_sync.js @@ -0,0 +1,27 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('umask sync modes', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + var err = mkdirp.sync(file); + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, (0777 & (~process.umask()))); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) +}); diff --git a/usb_auth/node_modules/express/node_modules/qs/.gitmodules b/usb_auth/node_modules/express/node_modules/qs/.gitmodules new file mode 100644 index 0000000..49e31da --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/.gitmodules @@ -0,0 +1,6 @@ +[submodule "support/expresso"] + path = support/expresso + url = git://github.com/visionmedia/expresso.git +[submodule "support/should"] + path = support/should + url = git://github.com/visionmedia/should.js.git diff --git a/usb_auth/node_modules/express/node_modules/qs/.npmignore b/usb_auth/node_modules/express/node_modules/qs/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/usb_auth/node_modules/express/node_modules/qs/.travis.yml b/usb_auth/node_modules/express/node_modules/qs/.travis.yml new file mode 100644 index 0000000..2c0a8f6 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.4 \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/History.md b/usb_auth/node_modules/express/node_modules/qs/History.md new file mode 100644 index 0000000..3eaf7df --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/History.md @@ -0,0 +1,73 @@ + +0.4.2 / 2012-02-08 +================== + + * Fixed: ensure objects are created when appropriate not arrays [aheckmann] + +0.4.1 / 2012-01-26 +================== + + * Fixed stringify()ing numbers. Closes #23 + +0.4.0 / 2011-11-21 +================== + + * Allow parsing of an existing object (for `bodyParser()`) [jackyz] + * Replaced expresso with mocha + +0.3.2 / 2011-11-08 +================== + + * Fixed global variable leak + +0.3.1 / 2011-08-17 +================== + + * Added `try/catch` around malformed uri components + * Add test coverage for Array native method bleed-though + +0.3.0 / 2011-07-19 +================== + + * Allow `array[index]` and `object[property]` syntaxes [Aria Stewart] + +0.2.0 / 2011-06-29 +================== + + * Added `qs.stringify()` [Cory Forsyth] + +0.1.0 / 2011-04-13 +================== + + * Added jQuery-ish array support + +0.0.7 / 2011-03-13 +================== + + * Fixed; handle empty string and `== null` in `qs.parse()` [dmit] + allows for convenient `qs.parse(url.parse(str).query)` + +0.0.6 / 2011-02-14 +================== + + * Fixed; support for implicit arrays + +0.0.4 / 2011-02-09 +================== + + * Fixed `+` as a space + +0.0.3 / 2011-02-08 +================== + + * Fixed case when right-hand value contains "]" + +0.0.2 / 2011-02-07 +================== + + * Fixed "=" presence in key + +0.0.1 / 2011-02-07 +================== + + * Initial release \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/Makefile b/usb_auth/node_modules/express/node_modules/qs/Makefile new file mode 100644 index 0000000..e4df837 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/Makefile @@ -0,0 +1,5 @@ + +test: + @./node_modules/.bin/mocha + +.PHONY: test \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/Readme.md b/usb_auth/node_modules/express/node_modules/qs/Readme.md new file mode 100644 index 0000000..db0d145 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/Readme.md @@ -0,0 +1,54 @@ +# node-querystring + + query string parser for node supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. + +## Installation + + $ npm install qs + +## Examples + +```js +var qs = require('qs'); + +qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); +// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } + +qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) +// => user[name]=Tobi&user[email]=tobi%40learnboost.com +``` + +## Testing + +Install dev dependencies: + + $ npm install -d + +and execute: + + $ make test + +## License + +(The MIT License) + +Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/benchmark.js b/usb_auth/node_modules/express/node_modules/qs/benchmark.js new file mode 100644 index 0000000..97e2c93 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/benchmark.js @@ -0,0 +1,17 @@ + +var qs = require('./'); + +var times = 100000 + , start = new Date + , n = times; + +console.log('times: %d', times); + +while (n--) qs.parse('foo=bar'); +console.log('simple: %dms', new Date - start); + +var start = new Date + , n = times; + +while (n--) qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); +console.log('nested: %dms', new Date - start); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/examples.js b/usb_auth/node_modules/express/node_modules/qs/examples.js new file mode 100644 index 0000000..27617b7 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/examples.js @@ -0,0 +1,51 @@ + +/** + * Module dependencies. + */ + +var qs = require('./'); + +var obj = qs.parse('foo'); +console.log(obj) + +var obj = qs.parse('foo=bar=baz'); +console.log(obj) + +var obj = qs.parse('users[]'); +console.log(obj) + +var obj = qs.parse('name=tj&email=tj@vision-media.ca'); +console.log(obj) + +var obj = qs.parse('users[]=tj&users[]=tobi&users[]=jane'); +console.log(obj) + +var obj = qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); +console.log(obj) + +var obj = qs.parse('users[][name][first]=tj&users[][name][last]=holowaychuk'); +console.log(obj) + +var obj = qs.parse('a=a&a=b&a=c'); +console.log(obj) + +var obj = qs.parse('user[tj]=tj&user[tj]=TJ'); +console.log(obj) + +var obj = qs.parse('user[names]=tj&user[names]=TJ&user[names]=Tyler'); +console.log(obj) + +var obj = qs.parse('user[name][first]=tj&user[name][first]=TJ'); +console.log(obj) + +var obj = qs.parse('user[0]=tj&user[1]=TJ'); +console.log(obj) + +var obj = qs.parse('user[0]=tj&user[]=TJ'); +console.log(obj) + +var obj = qs.parse('user[0]=tj&user[foo]=TJ'); +console.log(obj) + +var str = qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}); +console.log(str); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/index.js b/usb_auth/node_modules/express/node_modules/qs/index.js new file mode 100644 index 0000000..d177d20 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/index.js @@ -0,0 +1,2 @@ + +module.exports = require('./lib/querystring'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/lib/querystring.js b/usb_auth/node_modules/express/node_modules/qs/lib/querystring.js new file mode 100644 index 0000000..6c72712 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/lib/querystring.js @@ -0,0 +1,264 @@ + +/*! + * querystring + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Library version. + */ + +exports.version = '0.4.2'; + +/** + * Object#toString() ref for stringify(). + */ + +var toString = Object.prototype.toString; + +/** + * Cache non-integer test regexp. + */ + +var isint = /^[0-9]+$/; + +function promote(parent, key) { + if (parent[key].length == 0) return parent[key] = {}; + var t = {}; + for (var i in parent[key]) t[i] = parent[key][i]; + parent[key] = t; + return t; +} + +function parse(parts, parent, key, val) { + var part = parts.shift(); + // end + if (!part) { + if (Array.isArray(parent[key])) { + parent[key].push(val); + } else if ('object' == typeof parent[key]) { + parent[key] = val; + } else if ('undefined' == typeof parent[key]) { + parent[key] = val; + } else { + parent[key] = [parent[key], val]; + } + // array + } else { + var obj = parent[key] = parent[key] || []; + if (']' == part) { + if (Array.isArray(obj)) { + if ('' != val) obj.push(val); + } else if ('object' == typeof obj) { + obj[Object.keys(obj).length] = val; + } else { + obj = parent[key] = [parent[key], val]; + } + // prop + } else if (~part.indexOf(']')) { + part = part.substr(0, part.length - 1); + if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); + parse(parts, obj, part, val); + // key + } else { + if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); + parse(parts, obj, part, val); + } + } +} + +/** + * Merge parent key/val pair. + */ + +function merge(parent, key, val){ + if (~key.indexOf(']')) { + var parts = key.split('[') + , len = parts.length + , last = len - 1; + parse(parts, parent, 'base', val); + // optimize + } else { + if (!isint.test(key) && Array.isArray(parent.base)) { + var t = {}; + for (var k in parent.base) t[k] = parent.base[k]; + parent.base = t; + } + set(parent.base, key, val); + } + + return parent; +} + +/** + * Parse the given obj. + */ + +function parseObject(obj){ + var ret = { base: {} }; + Object.keys(obj).forEach(function(name){ + merge(ret, name, obj[name]); + }); + return ret.base; +} + +/** + * Parse the given str. + */ + +function parseString(str){ + return String(str) + .split('&') + .reduce(function(ret, pair){ + try{ + pair = decodeURIComponent(pair.replace(/\+/g, ' ')); + } catch(e) { + // ignore + } + + var eql = pair.indexOf('=') + , brace = lastBraceInKey(pair) + , key = pair.substr(0, brace || eql) + , val = pair.substr(brace || eql, pair.length) + , val = val.substr(val.indexOf('=') + 1, val.length); + + // ?foo + if ('' == key) key = pair, val = ''; + + return merge(ret, key, val); + }, { base: {} }).base; +} + +/** + * Parse the given query `str` or `obj`, returning an object. + * + * @param {String} str | {Object} obj + * @return {Object} + * @api public + */ + +exports.parse = function(str){ + if (null == str || '' == str) return {}; + return 'object' == typeof str + ? parseObject(str) + : parseString(str); +}; + +/** + * Turn the given `obj` into a query string + * + * @param {Object} obj + * @return {String} + * @api public + */ + +var stringify = exports.stringify = function(obj, prefix) { + if (Array.isArray(obj)) { + return stringifyArray(obj, prefix); + } else if ('[object Object]' == toString.call(obj)) { + return stringifyObject(obj, prefix); + } else if ('string' == typeof obj) { + return stringifyString(obj, prefix); + } else { + return prefix + '=' + obj; + } +}; + +/** + * Stringify the given `str`. + * + * @param {String} str + * @param {String} prefix + * @return {String} + * @api private + */ + +function stringifyString(str, prefix) { + if (!prefix) throw new TypeError('stringify expects an object'); + return prefix + '=' + encodeURIComponent(str); +} + +/** + * Stringify the given `arr`. + * + * @param {Array} arr + * @param {String} prefix + * @return {String} + * @api private + */ + +function stringifyArray(arr, prefix) { + var ret = []; + if (!prefix) throw new TypeError('stringify expects an object'); + for (var i = 0; i < arr.length; i++) { + ret.push(stringify(arr[i], prefix + '[]')); + } + return ret.join('&'); +} + +/** + * Stringify the given `obj`. + * + * @param {Object} obj + * @param {String} prefix + * @return {String} + * @api private + */ + +function stringifyObject(obj, prefix) { + var ret = [] + , keys = Object.keys(obj) + , key; + + for (var i = 0, len = keys.length; i < len; ++i) { + key = keys[i]; + ret.push(stringify(obj[key], prefix + ? prefix + '[' + encodeURIComponent(key) + ']' + : encodeURIComponent(key))); + } + + return ret.join('&'); +} + +/** + * Set `obj`'s `key` to `val` respecting + * the weird and wonderful syntax of a qs, + * where "foo=bar&foo=baz" becomes an array. + * + * @param {Object} obj + * @param {String} key + * @param {String} val + * @api private + */ + +function set(obj, key, val) { + var v = obj[key]; + if (undefined === v) { + obj[key] = val; + } else if (Array.isArray(v)) { + v.push(val); + } else { + obj[key] = [v, val]; + } +} + +/** + * Locate last brace in `str` within the key. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function lastBraceInKey(str) { + var len = str.length + , brace + , c; + for (var i = 0; i < len; ++i) { + c = str[i]; + if (']' == c) brace = false; + if ('[' == c) brace = true; + if ('=' == c && !brace) return i; + } +} diff --git a/usb_auth/node_modules/express/node_modules/qs/package.json b/usb_auth/node_modules/express/node_modules/qs/package.json new file mode 100644 index 0000000..68dd5a6 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/package.json @@ -0,0 +1,16 @@ +{ + "name": "qs", + "description": "querystring parser", + "version": "0.4.2", + "repository": { + "type" : "git", + "url" : "git://github.com/visionmedia/node-querystring.git" + }, + "devDependencies": { + "mocha": "*" + , "should": "*" + }, + "author": "TJ Holowaychuk (http://tjholowaychuk.com)", + "main": "index", + "engines": { "node": "*" } +} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/test/mocha.opts b/usb_auth/node_modules/express/node_modules/qs/test/mocha.opts new file mode 100644 index 0000000..521cbb2 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/test/mocha.opts @@ -0,0 +1,2 @@ +--require should +--ui exports diff --git a/usb_auth/node_modules/express/node_modules/qs/test/parse.js b/usb_auth/node_modules/express/node_modules/qs/test/parse.js new file mode 100644 index 0000000..f219e27 --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/test/parse.js @@ -0,0 +1,167 @@ + +/** + * Module dependencies. + */ + +var qs = require('../'); + +module.exports = { + 'test basics': function(){ + qs.parse('0=foo').should.eql({ '0': 'foo' }); + + qs.parse('foo=c++') + .should.eql({ foo: 'c ' }); + + qs.parse('a[>=]=23') + .should.eql({ a: { '>=': '23' }}); + + qs.parse('a[<=>]==23') + .should.eql({ a: { '<=>': '=23' }}); + + qs.parse('a[==]=23') + .should.eql({ a: { '==': '23' }}); + + qs.parse('foo') + .should.eql({ foo: '' }); + + qs.parse('foo=bar') + .should.eql({ foo: 'bar' }); + + qs.parse('foo%3Dbar=baz') + .should.eql({ foo: 'bar=baz' }); + + qs.parse(' foo = bar = baz ') + .should.eql({ ' foo ': ' bar = baz ' }); + + qs.parse('foo=bar=baz') + .should.eql({ foo: 'bar=baz' }); + + qs.parse('foo=bar&bar=baz') + .should.eql({ foo: 'bar', bar: 'baz' }); + + qs.parse('foo=bar&baz') + .should.eql({ foo: 'bar', baz: '' }); + + qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World') + .should.eql({ + cht: 'p3' + , chd: 't:60,40' + , chs: '250x100' + , chl: 'Hello|World' + }); + }, + + 'test nesting': function(){ + qs.parse('ops[>=]=25') + .should.eql({ ops: { '>=': '25' }}); + + qs.parse('user[name]=tj') + .should.eql({ user: { name: 'tj' }}); + + qs.parse('user[name][first]=tj&user[name][last]=holowaychuk') + .should.eql({ user: { name: { first: 'tj', last: 'holowaychuk' }}}); + }, + + 'test escaping': function(){ + qs.parse('foo=foo%20bar') + .should.eql({ foo: 'foo bar' }); + }, + + 'test arrays': function(){ + qs.parse('images[]') + .should.eql({ images: [] }); + + qs.parse('user[]=tj') + .should.eql({ user: ['tj'] }); + + qs.parse('user[]=tj&user[]=tobi&user[]=jane') + .should.eql({ user: ['tj', 'tobi', 'jane'] }); + + qs.parse('user[names][]=tj&user[names][]=tyler') + .should.eql({ user: { names: ['tj', 'tyler'] }}); + + qs.parse('user[names][]=tj&user[names][]=tyler&user[email]=tj@vision-media.ca') + .should.eql({ user: { names: ['tj', 'tyler'], email: 'tj@vision-media.ca' }}); + + qs.parse('items=a&items=b') + .should.eql({ items: ['a', 'b'] }); + + qs.parse('user[names]=tj&user[names]=holowaychuk&user[names]=TJ') + .should.eql({ user: { names: ['tj', 'holowaychuk', 'TJ'] }}); + + qs.parse('user[name][first]=tj&user[name][first]=TJ') + .should.eql({ user: { name: { first: ['tj', 'TJ'] }}}); + + var o = qs.parse('existing[fcbaebfecc][name][last]=tj') + o.should.eql({ existing: { 'fcbaebfecc': { name: { last: 'tj' }}}}) + Array.isArray(o.existing).should.be.false; + }, + + 'test right-hand brackets': function(){ + qs.parse('pets=["tobi"]') + .should.eql({ pets: '["tobi"]' }); + + qs.parse('operators=[">=", "<="]') + .should.eql({ operators: '[">=", "<="]' }); + + qs.parse('op[>=]=[1,2,3]') + .should.eql({ op: { '>=': '[1,2,3]' }}); + + qs.parse('op[>=]=[1,2,3]&op[=]=[[[[1]]]]') + .should.eql({ op: { '>=': '[1,2,3]', '=': '[[[[1]]]]' }}); + }, + + 'test duplicates': function(){ + qs.parse('items=bar&items=baz&items=raz') + .should.eql({ items: ['bar', 'baz', 'raz'] }); + }, + + 'test empty': function(){ + qs.parse('').should.eql({}); + qs.parse(undefined).should.eql({}); + qs.parse(null).should.eql({}); + }, + + 'test arrays with indexes': function(){ + qs.parse('foo[0]=bar&foo[1]=baz').should.eql({ foo: ['bar', 'baz'] }); + qs.parse('foo[1]=bar&foo[0]=baz').should.eql({ foo: ['baz', 'bar'] }); + qs.parse('foo[base64]=RAWR').should.eql({ foo: { base64: 'RAWR' }}); + qs.parse('foo[64base]=RAWR').should.eql({ foo: { '64base': 'RAWR' }}); + }, + + 'test arrays becoming objects': function(){ + qs.parse('foo[0]=bar&foo[bad]=baz').should.eql({ foo: { 0: "bar", bad: "baz" }}); + qs.parse('foo[bad]=baz&foo[0]=bar').should.eql({ foo: { 0: "bar", bad: "baz" }}); + }, + + 'test bleed-through of Array native properties/methods': function(){ + Array.prototype.protoProperty = true; + Array.prototype.protoFunction = function () {}; + qs.parse('foo=bar').should.eql({ foo: 'bar' }); + }, + + 'test malformed uri': function(){ + qs.parse('{%:%}').should.eql({ '{%:%}': '' }); + qs.parse('foo=%:%}').should.eql({ 'foo': '%:%}' }); + }, + + 'test semi-parsed': function(){ + qs.parse({ 'user[name]': 'tobi' }) + .should.eql({ user: { name: 'tobi' }}); + + qs.parse({ 'user[name]': 'tobi', 'user[email][main]': 'tobi@lb.com' }) + .should.eql({ user: { name: 'tobi', email: { main: 'tobi@lb.com' } }}); + } + + // 'test complex': function(){ + // qs.parse('users[][name][first]=tj&users[foo]=bar') + // .should.eql({ + // users: [ { name: 'tj' }, { name: 'tobi' }, { foo: 'bar' }] + // }); + // + // qs.parse('users[][name][first]=tj&users[][name][first]=tobi') + // .should.eql({ + // users: [ { name: 'tj' }, { name: 'tobi' }] + // }); + // } +}; diff --git a/usb_auth/node_modules/express/node_modules/qs/test/stringify.js b/usb_auth/node_modules/express/node_modules/qs/test/stringify.js new file mode 100644 index 0000000..c2195cb --- /dev/null +++ b/usb_auth/node_modules/express/node_modules/qs/test/stringify.js @@ -0,0 +1,103 @@ + +/** + * Module dependencies. + */ + +var qs = require('../') + , should = require('should') + , str_identities = { + 'basics': [ + { str: 'foo=bar', obj: {'foo' : 'bar'}}, + { str: 'foo=%22bar%22', obj: {'foo' : '\"bar\"'}}, + { str: 'foo=', obj: {'foo': ''}}, + { str: 'foo=1&bar=2', obj: {'foo' : '1', 'bar' : '2'}}, + { str: 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', obj: {'my weird field': "q1!2\"'w$5&7/z8)?"}}, + { str: 'foo%3Dbaz=bar', obj: {'foo=baz': 'bar'}}, + { str: 'foo=bar&bar=baz', obj: {foo: 'bar', bar: 'baz'}} + ], + 'escaping': [ + { str: 'foo=foo%20bar', obj: {foo: 'foo bar'}}, + { str: 'cht=p3&chd=t%3A60%2C40&chs=250x100&chl=Hello%7CWorld', obj: { + cht: 'p3' + , chd: 't:60,40' + , chs: '250x100' + , chl: 'Hello|World' + }} + ], + 'nested': [ + { str: 'foo[]=bar&foo[]=quux', obj: {'foo' : ['bar', 'quux']}}, + { str: 'foo[]=bar', obj: {foo: ['bar']}}, + { str: 'foo[]=1&foo[]=2', obj: {'foo' : ['1', '2']}}, + { str: 'foo=bar&baz[]=1&baz[]=2&baz[]=3', obj: {'foo' : 'bar', 'baz' : ['1', '2', '3']}}, + { str: 'foo[]=bar&baz[]=1&baz[]=2&baz[]=3', obj: {'foo' : ['bar'], 'baz' : ['1', '2', '3']}}, + { str: 'x[y][z]=1', obj: {'x' : {'y' : {'z' : '1'}}}}, + { str: 'x[y][z][]=1', obj: {'x' : {'y' : {'z' : ['1']}}}}, + { str: 'x[y][z]=2', obj: {'x' : {'y' : {'z' : '2'}}}}, + { str: 'x[y][z][]=1&x[y][z][]=2', obj: {'x' : {'y' : {'z' : ['1', '2']}}}}, + { str: 'x[y][][z]=1', obj: {'x' : {'y' : [{'z' : '1'}]}}}, + { str: 'x[y][][z][]=1', obj: {'x' : {'y' : [{'z' : ['1']}]}}}, + { str: 'x[y][][z]=1&x[y][][w]=2', obj: {'x' : {'y' : [{'z' : '1', 'w' : '2'}]}}}, + { str: 'x[y][][v][w]=1', obj: {'x' : {'y' : [{'v' : {'w' : '1'}}]}}}, + { str: 'x[y][][z]=1&x[y][][v][w]=2', obj: {'x' : {'y' : [{'z' : '1', 'v' : {'w' : '2'}}]}}}, + { str: 'x[y][][z]=1&x[y][][z]=2', obj: {'x' : {'y' : [{'z' : '1'}, {'z' : '2'}]}}}, + { str: 'x[y][][z]=1&x[y][][w]=a&x[y][][z]=2&x[y][][w]=3', obj: {'x' : {'y' : [{'z' : '1', 'w' : 'a'}, {'z' : '2', 'w' : '3'}]}}}, + { str: 'user[name][first]=tj&user[name][last]=holowaychuk', obj: { user: { name: { first: 'tj', last: 'holowaychuk' }}}} + ], + 'errors': [ + { obj: 'foo=bar', message: 'stringify expects an object' }, + { obj: ['foo', 'bar'], message: 'stringify expects an object' } + ], + 'numbers': [ + { str: 'limit[]=1&limit[]=2&limit[]=3', obj: { limit: [1, 2, '3'] }}, + { str: 'limit=1', obj: { limit: 1 }} + ] + }; + + +// Assert error +function err(fn, msg){ + var err; + try { + fn(); + } catch (e) { + should.equal(e.message, msg); + return; + } + throw new Error('no exception thrown, expected "' + msg + '"'); +} + +function test(type) { + var str, obj; + for (var i = 0; i < str_identities[type].length; i++) { + str = str_identities[type][i].str; + obj = str_identities[type][i].obj; + qs.stringify(obj).should.eql(str); + } +} + +module.exports = { + 'test basics': function() { + test('basics'); + }, + + 'test escaping': function() { + test('escaping'); + }, + + 'test nested': function() { + test('nested'); + }, + + 'test numbers': function(){ + test('numbers'); + }, + + 'test errors': function() { + var obj, message; + for (var i = 0; i < str_identities['errors'].length; i++) { + message = str_identities['errors'][i].message; + obj = str_identities['errors'][i].obj; + err(function(){ qs.stringify(obj) }, message); + } + } +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/package.json b/usb_auth/node_modules/express/package.json new file mode 100644 index 0000000..6675674 --- /dev/null +++ b/usb_auth/node_modules/express/package.json @@ -0,0 +1,39 @@ +{ + "name": "express", + "description": "Sinatra inspired web development framework", + "version": "2.5.8", + "author": "TJ Holowaychuk ", + "contributors": [ + { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, + { "name": "Aaron Heckmann", "email": "aaron.heckmann+github@gmail.com" }, + { "name": "Ciaran Jessup", "email": "ciaranj@gmail.com" }, + { "name": "Guillermo Rauch", "email": "rauchg@gmail.com" } + ], + "dependencies": { + "connect": "1.x", + "mime": "1.2.4", + "qs": "0.4.x", + "mkdirp": "0.3.0" + }, + "devDependencies": { + "connect-form": "0.2.1", + "ejs": "0.4.2", + "expresso": "0.9.2", + "hamljs": "0.6.x", + "jade": "0.16.2", + "stylus": "0.13.0", + "should": "0.3.2", + "express-messages": "0.0.2", + "node-markdown": ">= 0.0.1", + "connect-redis": ">= 0.0.1" + }, + "keywords": ["framework", "sinatra", "web", "rest", "restful"], + "repository": "git://github.com/visionmedia/express", + "main": "index", + "bin": { "express": "./bin/express" }, + "scripts": { + "test": "make test", + "prepublish" : "npm prune" + }, + "engines": { "node": ">= 0.4.1 < 0.7.0" } +} \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/app.js b/usb_auth/node_modules/express/testing/foo/app.js new file mode 100644 index 0000000..7574676 --- /dev/null +++ b/usb_auth/node_modules/express/testing/foo/app.js @@ -0,0 +1,35 @@ + +/** + * Module dependencies. + */ + +var express = require('express') + , routes = require('./routes') + +var app = module.exports = express.createServer(); + +// Configuration + +app.configure(function(){ + app.set('views', __dirname + '/views'); + app.set('view engine', 'jade'); + app.use(express.bodyParser()); + app.use(express.methodOverride()); + app.use(app.router); + app.use(express.static(__dirname + '/public')); +}); + +app.configure('development', function(){ + app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); +}); + +app.configure('production', function(){ + app.use(express.errorHandler()); +}); + +// Routes + +app.get('/', routes.index); + +app.listen(3000); +console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); diff --git a/usb_auth/node_modules/express/testing/foo/package.json b/usb_auth/node_modules/express/testing/foo/package.json new file mode 100644 index 0000000..dd54123 --- /dev/null +++ b/usb_auth/node_modules/express/testing/foo/package.json @@ -0,0 +1,9 @@ +{ + "name": "application-name" + , "version": "0.0.1" + , "private": true + , "dependencies": { + "express": "2.5.0" + , "jade": ">= 0.0.1" + } +} \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/public/stylesheets/style.css b/usb_auth/node_modules/express/testing/foo/public/stylesheets/style.css new file mode 100644 index 0000000..30e047d --- /dev/null +++ b/usb_auth/node_modules/express/testing/foo/public/stylesheets/style.css @@ -0,0 +1,8 @@ +body { + padding: 50px; + font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; +} + +a { + color: #00B7FF; +} \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/routes/index.js b/usb_auth/node_modules/express/testing/foo/routes/index.js new file mode 100644 index 0000000..0b2205c --- /dev/null +++ b/usb_auth/node_modules/express/testing/foo/routes/index.js @@ -0,0 +1,10 @@ + +/* + * GET home page. + */ + +exports.index = function(req, res){ + res.writeHead(200); + req.doesnotexist(); + // res.render('index', { title: 'Express' }) +}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/views/index.jade b/usb_auth/node_modules/express/testing/foo/views/index.jade new file mode 100644 index 0000000..c9c35fa --- /dev/null +++ b/usb_auth/node_modules/express/testing/foo/views/index.jade @@ -0,0 +1,2 @@ +h1= title +p Welcome to #{title} \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/views/layout.jade b/usb_auth/node_modules/express/testing/foo/views/layout.jade new file mode 100644 index 0000000..1a36941 --- /dev/null +++ b/usb_auth/node_modules/express/testing/foo/views/layout.jade @@ -0,0 +1,6 @@ +!!! +html + head + title= title + link(rel='stylesheet', href='/stylesheets/style.css') + body!= body \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/index.js b/usb_auth/node_modules/express/testing/index.js new file mode 100644 index 0000000..3c5185d --- /dev/null +++ b/usb_auth/node_modules/express/testing/index.js @@ -0,0 +1,43 @@ + +/** + * Module dependencies. + */ + +var express = require('../') + , http = require('http') + , connect = require('connect'); + +var app = express.createServer(); + +app.get('/', function(req, res){ + req.foo(); + res.send('test'); +}); + +// app.set('views', __dirname + '/views'); +// app.set('view engine', 'jade'); +// +// app.configure(function(){ +// app.use(function(req, res, next){ +// debugger +// res.write('first'); +// console.error('first'); +// next(); +// }); +// +// app.use(app.router); +// +// app.use(function(req, res, next){ +// console.error('last'); +// res.end('last'); +// }); +// }); +// +// app.get('/', function(req, res, next){ +// console.error('middle'); +// res.write(' route '); +// next(); +// }); + +app.listen(3000); +console.log('listening on port 3000'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/public/test.txt b/usb_auth/node_modules/express/testing/public/test.txt new file mode 100644 index 0000000..cb9a165 --- /dev/null +++ b/usb_auth/node_modules/express/testing/public/test.txt @@ -0,0 +1,2971 @@ +foo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +bazfoo +bar +baz \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/page.html b/usb_auth/node_modules/express/testing/views/page.html new file mode 100644 index 0000000..4ff9827 --- /dev/null +++ b/usb_auth/node_modules/express/testing/views/page.html @@ -0,0 +1 @@ +p register test \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/page.jade b/usb_auth/node_modules/express/testing/views/page.jade new file mode 100644 index 0000000..9c3f888 --- /dev/null +++ b/usb_auth/node_modules/express/testing/views/page.jade @@ -0,0 +1,3 @@ +html + body + h1 test \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/test.md b/usb_auth/node_modules/express/testing/views/test.md new file mode 100644 index 0000000..9139ff4 --- /dev/null +++ b/usb_auth/node_modules/express/testing/views/test.md @@ -0,0 +1 @@ +testing _some_ markdown \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/user/index.jade b/usb_auth/node_modules/express/testing/views/user/index.jade new file mode 100644 index 0000000..1b66a4f --- /dev/null +++ b/usb_auth/node_modules/express/testing/views/user/index.jade @@ -0,0 +1 @@ +p user page \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/user/list.jade b/usb_auth/node_modules/express/testing/views/user/list.jade new file mode 100644 index 0000000..ed2b471 --- /dev/null +++ b/usb_auth/node_modules/express/testing/views/user/list.jade @@ -0,0 +1 @@ +p user list page \ No newline at end of file diff --git a/usb_auth/node_modules/jade/.npmignore b/usb_auth/node_modules/jade/.npmignore new file mode 100644 index 0000000..5eb48f0 --- /dev/null +++ b/usb_auth/node_modules/jade/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +lib-cov +testing +node_modules diff --git a/usb_auth/node_modules/jade/LICENSE b/usb_auth/node_modules/jade/LICENSE new file mode 100644 index 0000000..8ad0e0d --- /dev/null +++ b/usb_auth/node_modules/jade/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2009-2010 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/jade/bin/jade b/usb_auth/node_modules/jade/bin/jade new file mode 100755 index 0000000..fd4122c --- /dev/null +++ b/usb_auth/node_modules/jade/bin/jade @@ -0,0 +1,125 @@ +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var fs = require('fs') + , program = require('commander') + , path = require('path') + , basename = path.basename + , dirname = path.dirname + , resolve = path.resolve + , join = path.join + , mkdirp = require('mkdirp') + , jade = require('../'); + +// jade options + +var options = {}; + +// options + +program + .version(jade.version) + .usage('[options] [dir|file ...]') + .option('-o, --obj ', 'javascript options object') + .option('-O, --out ', 'output the compiled html to ') + .option('-p, --path ', 'filename used to resolve includes') + +program.on('--help', function(){ + console.log(' Examples:'); + console.log(''); + console.log(' # translate jade the templates dir'); + console.log(' $ jade templates'); + console.log(''); + console.log(' # create {foo,bar}.html'); + console.log(' $ jade {foo,bar}.jade'); + console.log(''); + console.log(' # jade over stdio'); + console.log(' $ jade < my.jade > my.html'); + console.log(''); + console.log(' # jade over stdio'); + console.log(' $ echo "h1 Jade!" | jade'); + console.log(''); + console.log(' # foo, bar dirs rendering to /tmp'); + console.log(' $ jade foo bar --out /tmp '); + console.log(''); +}); + +program.parse(process.argv); + +// options given, parse them + +if (program.obj) options = eval('(' + program.obj + ')'); + +// filename + +if (program.path) options.filename = program.path; + +// left-over args are file paths + +var files = program.args; + +// compile files + +if (files.length) { + console.log(); + files.forEach(renderFile); + process.on('exit', console.log); +// stdio +} else { + stdin(); +} + +/** + * Compile from stdin. + */ + +function stdin() { + var buf = ''; + process.stdin.setEncoding('utf8'); + process.stdin.on('data', function(chunk){ buf += chunk; }); + process.stdin.on('end', function(){ + var fn = jade.compile(buf, options); + process.stdout.write(fn(options)); + }).resume(); +} + +/** + * Process the given path, compiling the jade files found. + * Always walk the subdirectories. + */ + +function renderFile(path) { + var re = /\.jade$/; + fs.lstat(path, function(err, stat) { + if (err) throw err; + // Found jade file + if (stat.isFile() && re.test(path)) { + fs.readFile(path, 'utf8', function(err, str){ + if (err) throw err; + options.filename = path; + var fn = jade.compile(str, options); + path = path.replace(re, '.html'); + if (program.out) path = join(program.out, basename(path)); + var dir = resolve(dirname(path)); + mkdirp(dir, 0755, function(err){ + if (err) throw err; + fs.writeFile(path, fn(options), function(err){ + if (err) throw err; + console.log(' \033[90mrendered \033[36m%s\033[0m', path); + }); + }); + }); + // Found directory + } else if (stat.isDirectory()) { + fs.readdir(path, function(err, files) { + if (err) throw err; + files.map(function(filename) { + return path + '/' + filename; + }).forEach(renderFile); + }); + } + }); +} diff --git a/usb_auth/node_modules/jade/index.js b/usb_auth/node_modules/jade/index.js new file mode 100644 index 0000000..857e431 --- /dev/null +++ b/usb_auth/node_modules/jade/index.js @@ -0,0 +1,2 @@ + +module.exports = require('./lib/jade'); \ No newline at end of file diff --git a/usb_auth/node_modules/jade/jade.js b/usb_auth/node_modules/jade/jade.js new file mode 100644 index 0000000..22072f1 --- /dev/null +++ b/usb_auth/node_modules/jade/jade.js @@ -0,0 +1,3140 @@ +(function() { + +// CommonJS require() + +function require(p){ + var path = require.resolve(p) + , mod = require.modules[path]; + if (!mod) throw new Error('failed to require "' + p + '"'); + if (!mod.exports) { + mod.exports = {}; + mod.call(mod.exports, mod, mod.exports, require.relative(path)); + } + return mod.exports; + } + +require.modules = {}; + +require.resolve = function (path){ + var orig = path + , reg = path + '.js' + , index = path + '/index.js'; + return require.modules[reg] && reg + || require.modules[index] && index + || orig; + }; + +require.register = function (path, fn){ + require.modules[path] = fn; + }; + +require.relative = function (parent) { + return function(p){ + if ('.' != p[0]) return require(p); + + var path = parent.split('/') + , segs = p.split('/'); + path.pop(); + + for (var i = 0; i < segs.length; i++) { + var seg = segs[i]; + if ('..' == seg) path.pop(); + else if ('.' != seg) path.push(seg); + } + + return require(path.join('/')); + }; + }; + + +require.register("compiler.js", function(module, exports, require){ + +/*! + * Jade - Compiler + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var nodes = require('./nodes') + , filters = require('./filters') + , doctypes = require('./doctypes') + , selfClosing = require('./self-closing') + , inlineTags = require('./inline-tags') + , utils = require('./utils'); + + + if (!Object.keys) { + Object.keys = function(obj){ + var arr = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + arr.push(key); + } + } + return arr; + } + } + + if (!String.prototype.trimLeft) { + String.prototype.trimLeft = function(){ + return this.replace(/^\s+/, ''); + } + } + + + +/** + * Initialize `Compiler` with the given `node`. + * + * @param {Node} node + * @param {Object} options + * @api public + */ + +var Compiler = module.exports = function Compiler(node, options) { + this.options = options = options || {}; + this.node = node; + this.hasCompiledDoctype = false; + this.hasCompiledTag = false; + this.pp = options.pretty || false; + this.debug = false !== options.compileDebug; + this.indents = 0; + if (options.doctype) this.setDoctype(options.doctype); +}; + +/** + * Compiler prototype. + */ + +Compiler.prototype = { + + /** + * Compile parse tree to JavaScript. + * + * @api public + */ + + compile: function(){ + this.buf = ['var interp;']; + this.lastBufferedIdx = -1 + this.visit(this.node); + return this.buf.join('\n'); + }, + + /** + * Sets the default doctype `name`. Sets terse mode to `true` when + * html 5 is used, causing self-closing tags to end with ">" vs "/>", + * and boolean attributes are not mirrored. + * + * @param {string} name + * @api public + */ + + setDoctype: function(name){ + var doctype = doctypes[(name || 'default').toLowerCase()]; + doctype = doctype || ''; + this.doctype = doctype; + this.terse = '5' == name || 'html' == name; + this.xml = 0 == this.doctype.indexOf('" vs "/>", + * and boolean attributes are not mirrored. + * + * @param {Doctype} doctype + * @api public + */ + + visitDoctype: function(doctype){ + if (doctype && (doctype.val || !this.doctype)) { + this.setDoctype(doctype.val || 'default'); + } + + if (this.doctype) this.buffer(this.doctype); + this.hasCompiledDoctype = true; + }, + + /** + * Visit `mixin`, generating a function that + * may be called within the template. + * + * @param {Mixin} mixin + * @api public + */ + + visitMixin: function(mixin){ + var name = mixin.name.replace(/-/g, '_') + '_mixin' + , args = mixin.args || ''; + + if (mixin.block) { + this.buf.push('var ' + name + ' = function(' + args + '){'); + this.visit(mixin.block); + this.buf.push('}'); + } else { + this.buf.push(name + '(' + args + ');'); + } + }, + + /** + * Visit `tag` buffering tag markup, generating + * attributes, visiting the `tag`'s code and block. + * + * @param {Tag} tag + * @api public + */ + + visitTag: function(tag){ + this.indents++; + var name = tag.name; + + if (!this.hasCompiledTag) { + if (!this.hasCompiledDoctype && 'html' == name) { + this.visitDoctype(); + } + this.hasCompiledTag = true; + } + + // pretty print + if (this.pp && inlineTags.indexOf(name) == -1) { + this.buffer('\\n' + Array(this.indents).join(' ')); + } + + if (~selfClosing.indexOf(name) && !this.xml) { + this.buffer('<' + name); + this.visitAttributes(tag.attrs); + this.terse + ? this.buffer('>') + : this.buffer('/>'); + } else { + // Optimize attributes buffering + if (tag.attrs.length) { + this.buffer('<' + name); + if (tag.attrs.length) this.visitAttributes(tag.attrs); + this.buffer('>'); + } else { + this.buffer('<' + name + '>'); + } + if (tag.code) this.visitCode(tag.code); + if (tag.text) this.buffer(utils.text(tag.text.nodes[0].trimLeft())); + this.escape = 'pre' == tag.name; + this.visit(tag.block); + + // pretty print + if (this.pp && !~inlineTags.indexOf(name) && !tag.textOnly) { + this.buffer('\\n' + Array(this.indents).join(' ')); + } + + this.buffer(''); + } + this.indents--; + }, + + /** + * Visit `filter`, throwing when the filter does not exist. + * + * @param {Filter} filter + * @api public + */ + + visitFilter: function(filter){ + var fn = filters[filter.name]; + + // unknown filter + if (!fn) { + if (filter.isASTFilter) { + throw new Error('unknown ast filter "' + filter.name + ':"'); + } else { + throw new Error('unknown filter ":' + filter.name + '"'); + } + } + if (filter.isASTFilter) { + this.buf.push(fn(filter.block, this, filter.attrs)); + } else { + var text = filter.block.nodes.join(''); + this.buffer(utils.text(fn(text, filter.attrs))); + } + }, + + /** + * Visit `text` node. + * + * @param {Text} text + * @api public + */ + + visitText: function(text){ + text = utils.text(text.nodes.join('')); + if (this.escape) text = escape(text); + this.buffer(text); + this.buffer('\\n'); + }, + + /** + * Visit a `comment`, only buffering when the buffer flag is set. + * + * @param {Comment} comment + * @api public + */ + + visitComment: function(comment){ + if (!comment.buffer) return; + if (this.pp) this.buffer('\\n' + Array(this.indents + 1).join(' ')); + this.buffer(''); + }, + + /** + * Visit a `BlockComment`. + * + * @param {Comment} comment + * @api public + */ + + visitBlockComment: function(comment){ + if (!comment.buffer) return; + if (0 == comment.val.trim().indexOf('if')) { + this.buffer(''); + } else { + this.buffer(''); + } + }, + + /** + * Visit `code`, respecting buffer / escape flags. + * If the code is followed by a block, wrap it in + * a self-calling function. + * + * @param {Code} code + * @api public + */ + + visitCode: function(code){ + // Wrap code blocks with {}. + // we only wrap unbuffered code blocks ATM + // since they are usually flow control + + // Buffer code + if (code.buffer) { + var val = code.val.trimLeft(); + this.buf.push('var __val__ = ' + val); + val = 'null == __val__ ? "" : __val__'; + if (code.escape) val = 'escape(' + val + ')'; + this.buf.push("buf.push(" + val + ");"); + } else { + this.buf.push(code.val); + } + + // Block support + if (code.block) { + if (!code.buffer) this.buf.push('{'); + this.visit(code.block); + if (!code.buffer) this.buf.push('}'); + } + }, + + /** + * Visit `each` block. + * + * @param {Each} each + * @api public + */ + + visitEach: function(each){ + this.buf.push('' + + '// iterate ' + each.obj + '\n' + + '(function(){\n' + + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' + + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' + + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); + + this.visit(each.block); + + this.buf.push('' + + ' }\n' + + ' } else {\n' + + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' + + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' + + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); + + this.visit(each.block); + + this.buf.push(' }\n'); + + this.buf.push(' }\n }\n}).call(this);\n'); + }, + + /** + * Visit `attrs`. + * + * @param {Array} attrs + * @api public + */ + + visitAttributes: function(attrs){ + var buf = [] + , classes = []; + + if (this.terse) buf.push('terse: true'); + + attrs.forEach(function(attr){ + if (attr.name == 'class') { + classes.push('(' + attr.val + ')'); + } else { + var pair = "'" + attr.name + "':(" + attr.val + ')'; + buf.push(pair); + } + }); + + if (classes.length) { + classes = classes.join(" + ' ' + "); + buf.push("class: " + classes); + } + + buf = buf.join(', ').replace('class:', '"class":'); + + this.buf.push("buf.push(attrs({ " + buf + " }));"); + } +}; + +/** + * Escape the given string of `html`. + * + * @param {String} html + * @return {String} + * @api private + */ + +function escape(html){ + return String(html) + .replace(/&(?!\w+;)/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +} + +}); // module: compiler.js + +require.register("doctypes.js", function(module, exports, require){ + +/*! + * Jade - doctypes + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +module.exports = { + '5': '' + , 'xml': '' + , 'default': '' + , 'transitional': '' + , 'strict': '' + , 'frameset': '' + , '1.1': '' + , 'basic': '' + , 'mobile': '' +}; +}); // module: doctypes.js + +require.register("filters.js", function(module, exports, require){ + +/*! + * Jade - filters + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +module.exports = { + + /** + * Wrap text with CDATA block. + */ + + cdata: function(str){ + return ''; + }, + + /** + * Transform sass to css, wrapped in style tags. + */ + + sass: function(str){ + str = str.replace(/\\n/g, '\n'); + var sass = require('sass').render(str).replace(/\n/g, '\\n'); + return ''; + }, + + /** + * Transform stylus to css, wrapped in style tags. + */ + + stylus: function(str, options){ + var ret; + str = str.replace(/\\n/g, '\n'); + var stylus = require('stylus'); + stylus(str, options).render(function(err, css){ + if (err) throw err; + ret = css.replace(/\n/g, '\\n'); + }); + return ''; + }, + + /** + * Transform less to css, wrapped in style tags. + */ + + less: function(str){ + var ret; + str = str.replace(/\\n/g, '\n'); + require('less').render(str, function(err, css){ + if (err) throw err; + ret = ''; + }); + return ret; + }, + + /** + * Transform markdown to html. + */ + + markdown: function(str){ + var md; + + // support markdown / discount + try { + md = require('markdown'); + } catch (err){ + try { + md = require('discount'); + } catch (err) { + try { + md = require('markdown-js'); + } catch (err) { + try { + md = require('marked'); + } catch (err) { + throw new + Error('Cannot find markdown library, install markdown, discount, or marked.'); + } + } + } + } + + str = str.replace(/\\n/g, '\n'); + return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); + }, + + /** + * Transform coffeescript to javascript. + */ + + coffeescript: function(str){ + str = str.replace(/\\n/g, '\n'); + var js = require('coffee-script').compile(str).replace(/\n/g, '\\n'); + return ''; + } +}; + +}); // module: filters.js + +require.register("inline-tags.js", function(module, exports, require){ + +/*! + * Jade - inline tags + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +module.exports = [ + 'a' + , 'abbr' + , 'acronym' + , 'b' + , 'br' + , 'code' + , 'em' + , 'font' + , 'i' + , 'img' + , 'ins' + , 'kbd' + , 'map' + , 'samp' + , 'small' + , 'span' + , 'strong' + , 'sub' + , 'sup' +]; +}); // module: inline-tags.js + +require.register("jade.js", function(module, exports, require){ +/*! + * Jade + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Parser = require('./parser') + , Lexer = require('./lexer') + , Compiler = require('./compiler') + , runtime = require('./runtime') + +/** + * Library version. + */ + +exports.version = '0.20.1'; + +/** + * Expose self closing tags. + */ + +exports.selfClosing = require('./self-closing'); + +/** + * Default supported doctypes. + */ + +exports.doctypes = require('./doctypes'); + +/** + * Text filters. + */ + +exports.filters = require('./filters'); + +/** + * Utilities. + */ + +exports.utils = require('./utils'); + +/** + * Expose `Compiler`. + */ + +exports.Compiler = Compiler; + +/** + * Expose `Parser`. + */ + +exports.Parser = Parser; + +/** + * Expose `Lexer`. + */ + +exports.Lexer = Lexer; + +/** + * Nodes. + */ + +exports.nodes = require('./nodes'); + +/** + * Jade runtime helpers. + */ + +exports.runtime = runtime; + +/** + * Template function cache. + */ + +exports.cache = {}; + +/** + * Parse the given `str` of jade and return a function body. + * + * @param {String} str + * @param {Object} options + * @return {String} + * @api private + */ + +function parse(str, options){ + try { + // Parse + var parser = new Parser(str, options.filename, options); + + // Compile + var compiler = new (options.compiler || Compiler)(parser.parse(), options) + , js = compiler.compile(); + + // Debug compiler + if (options.debug) { + console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); + } + + return '' + + 'var buf = [];\n' + + (options.self + ? 'var self = locals || {};\n' + js + : 'with (locals || {}) {\n' + js + '\n}\n') + + 'return buf.join("");'; + } catch (err) { + parser = parser.context(); + runtime.rethrow(err, parser.filename, parser.lexer.lineno); + } +} + +/** + * Compile a `Function` representation of the given jade `str`. + * + * Options: + * + * - `compileDebug` when `false` debugging code is stripped from the compiled template + * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` + * for use with the Jade client-side runtime.js + * + * @param {String} str + * @param {Options} options + * @return {Function} + * @api public + */ + +exports.compile = function(str, options){ + var options = options || {} + , client = options.client + , filename = options.filename + ? JSON.stringify(options.filename) + : 'undefined' + , fn; + + if (options.compileDebug !== false) { + fn = [ + 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' + , 'try {' + , parse(String(str), options) + , '} catch (err) {' + , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' + , '}' + ].join('\n'); + } else { + fn = parse(String(str), options); + } + + if (client) { + fn = 'var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n' + fn; + } + + fn = new Function('locals, attrs, escape, rethrow', fn); + + if (client) return fn; + + return function(locals){ + return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow); + }; +}; + +/** + * Render the given `str` of jade and invoke + * the callback `fn(err, str)`. + * + * Options: + * + * - `cache` enable template caching + * - `filename` filename required for `include` / `extends` and caching + * + * @param {String} str + * @param {Object|Function} options or fn + * @param {Function} fn + * @api public + */ + +exports.render = function(str, options, fn){ + // swap args + if ('function' == typeof options) { + fn = options, options = {}; + } + + // cache requires .filename + if (options.cache && !options.filename) { + return fn(new Error('the "filename" option is required for caching')); + } + + try { + var path = options.filename; + var tmpl = options.cache + ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) + : exports.compile(str, options); + fn(null, tmpl(options)); + } catch (err) { + fn(err); + } +}; + +/** + * Render a Jade file at the given `path` and callback `fn(err, str)`. + * + * @param {String} path + * @param {Object|Function} options or callback + * @param {Function} fn + * @api public + */ + +exports.renderFile = function(path, options, fn){ + var key = path + ':string'; + + if ('function' == typeof options) { + fn = options, options = {}; + } + + try { + options.filename = path; + var str = options.cache + ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) + : fs.readFileSync(path, 'utf8'); + exports.render(str, options, fn); + } catch (err) { + fn(err); + } +}; + +/** + * Express support. + */ + +exports.__express = exports.renderFile; + +}); // module: jade.js + +require.register("lexer.js", function(module, exports, require){ + +/*! + * Jade - Lexer + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Initialize `Lexer` with the given `str`. + * + * Options: + * + * - `colons` allow colons for attr delimiters + * + * @param {String} str + * @param {Object} options + * @api private + */ + +var Lexer = module.exports = function Lexer(str, options) { + options = options || {}; + this.input = str.replace(/\r\n|\r/g, '\n'); + this.colons = options.colons; + this.deferredTokens = []; + this.lastIndents = 0; + this.lineno = 1; + this.stash = []; + this.indentStack = []; + this.indentRe = null; + this.pipeless = false; +}; + +/** + * Lexer prototype. + */ + +Lexer.prototype = { + + /** + * Construct a token with the given `type` and `val`. + * + * @param {String} type + * @param {String} val + * @return {Object} + * @api private + */ + + tok: function(type, val){ + return { + type: type + , line: this.lineno + , val: val + } + }, + + /** + * Consume the given `len` of input. + * + * @param {Number} len + * @api private + */ + + consume: function(len){ + this.input = this.input.substr(len); + }, + + /** + * Scan for `type` with the given `regexp`. + * + * @param {String} type + * @param {RegExp} regexp + * @return {Object} + * @api private + */ + + scan: function(regexp, type){ + var captures; + if (captures = regexp.exec(this.input)) { + this.consume(captures[0].length); + return this.tok(type, captures[1]); + } + }, + + /** + * Defer the given `tok`. + * + * @param {Object} tok + * @api private + */ + + defer: function(tok){ + this.deferredTokens.push(tok); + }, + + /** + * Lookahead `n` tokens. + * + * @param {Number} n + * @return {Object} + * @api private + */ + + lookahead: function(n){ + var fetch = n - this.stash.length; + while (fetch-- > 0) this.stash.push(this.next()); + return this.stash[--n]; + }, + + /** + * Return the indexOf `start` / `end` delimiters. + * + * @param {String} start + * @param {String} end + * @return {Number} + * @api private + */ + + indexOfDelimiters: function(start, end){ + var str = this.input + , nstart = 0 + , nend = 0 + , pos = 0; + for (var i = 0, len = str.length; i < len; ++i) { + if (start == str[i]) { + ++nstart; + } else if (end == str[i]) { + if (++nend == nstart) { + pos = i; + break; + } + } + } + return pos; + }, + + /** + * Stashed token. + */ + + stashed: function() { + return this.stash.length + && this.stash.shift(); + }, + + /** + * Deferred token. + */ + + deferred: function() { + return this.deferredTokens.length + && this.deferredTokens.shift(); + }, + + /** + * end-of-source. + */ + + eos: function() { + if (this.input.length) return; + if (this.indentStack.length) { + this.indentStack.shift(); + return this.tok('outdent'); + } else { + return this.tok('eos'); + } + }, + + /** + * Comment. + */ + + comment: function() { + var captures; + if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { + this.consume(captures[0].length); + var tok = this.tok('comment', captures[2]); + tok.buffer = '-' != captures[1]; + return tok; + } + }, + + /** + * Tag. + */ + + tag: function() { + var captures; + if (captures = /^(\w[-:\w]*)/.exec(this.input)) { + this.consume(captures[0].length); + var tok, name = captures[1]; + if (':' == name[name.length - 1]) { + name = name.slice(0, -1); + tok = this.tok('tag', name); + this.defer(this.tok(':')); + while (' ' == this.input[0]) this.input = this.input.substr(1); + } else { + tok = this.tok('tag', name); + } + return tok; + } + }, + + /** + * Filter. + */ + + filter: function() { + return this.scan(/^:(\w+)/, 'filter'); + }, + + /** + * Doctype. + */ + + doctype: function() { + return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); + }, + + /** + * Id. + */ + + id: function() { + return this.scan(/^#([\w-]+)/, 'id'); + }, + + /** + * Class. + */ + + className: function() { + return this.scan(/^\.([\w-]+)/, 'class'); + }, + + /** + * Text. + */ + + text: function() { + return this.scan(/^(?:\| ?)?([^\n]+)/, 'text'); + }, + + /** + * Extends. + */ + + extends: function() { + return this.scan(/^extends +([^\n]+)/, 'extends'); + }, + + /** + * Block prepend. + */ + + prepend: function() { + var captures; + if (captures = /^prepend +([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var mode = 'prepend' + , name = captures[1] + , tok = this.tok('block', name); + tok.mode = mode; + return tok; + } + }, + + /** + * Block append. + */ + + append: function() { + var captures; + if (captures = /^append +([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var mode = 'append' + , name = captures[1] + , tok = this.tok('block', name); + tok.mode = mode; + return tok; + } + }, + + /** + * Block. + */ + + block: function() { + var captures; + if (captures = /^block +(?:(prepend|append) +)?([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var mode = captures[1] || 'replace' + , name = captures[2] + , tok = this.tok('block', name); + tok.mode = mode; + return tok; + } + }, + + /** + * Yield. + */ + + yield: function() { + return this.scan(/^yield */, 'yield'); + }, + + /** + * Include. + */ + + include: function() { + return this.scan(/^include +([^\n]+)/, 'include'); + }, + + /** + * Case. + */ + + case: function() { + return this.scan(/^case +([^\n]+)/, 'case'); + }, + + /** + * When. + */ + + when: function() { + return this.scan(/^when +([^:\n]+)/, 'when'); + }, + + /** + * Default. + */ + + default: function() { + return this.scan(/^default */, 'default'); + }, + + /** + * Assignment. + */ + + assignment: function() { + var captures; + if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { + this.consume(captures[0].length); + var name = captures[1] + , val = captures[2]; + return this.tok('code', 'var ' + name + ' = (' + val + ');'); + } + }, + + /** + * Mixin. + */ + + mixin: function(){ + var captures; + if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { + this.consume(captures[0].length); + var tok = this.tok('mixin', captures[1]); + tok.args = captures[2]; + return tok; + } + }, + + /** + * Conditional. + */ + + conditional: function() { + var captures; + if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { + this.consume(captures[0].length); + var type = captures[1] + , js = captures[2]; + + switch (type) { + case 'if': js = 'if (' + js + ')'; break; + case 'unless': js = 'if (!(' + js + '))'; break; + case 'else if': js = 'else if (' + js + ')'; break; + case 'else': js = 'else'; break; + } + + return this.tok('code', js); + } + }, + + /** + * While. + */ + + while: function() { + var captures; + if (captures = /^while +([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + return this.tok('code', 'while (' + captures[1] + ')'); + } + }, + + /** + * Each. + */ + + each: function() { + var captures; + if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var tok = this.tok('each', captures[1]); + tok.key = captures[2] || '$index'; + tok.code = captures[3]; + return tok; + } + }, + + /** + * Code. + */ + + code: function() { + var captures; + if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var flags = captures[1]; + captures[1] = captures[2]; + var tok = this.tok('code', captures[1]); + tok.escape = flags[0] === '='; + tok.buffer = flags[0] === '=' || flags[1] === '='; + return tok; + } + }, + + /** + * Attributes. + */ + + attrs: function() { + if ('(' == this.input[0]) { + var index = this.indexOfDelimiters('(', ')') + , str = this.input.substr(1, index-1) + , tok = this.tok('attrs') + , len = str.length + , colons = this.colons + , states = ['key'] + , key = '' + , val = '' + , quote + , c; + + function state(){ + return states[states.length - 1]; + } + + function interpolate(attr) { + return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ + return quote + " + (" + expr + ") + " + quote; + }); + } + + this.consume(index + 1); + tok.attrs = {}; + + function parse(c) { + var real = c; + // TODO: remove when people fix ":" + if (colons && ':' == c) c = '='; + switch (c) { + case ',': + case '\n': + switch (state()) { + case 'expr': + case 'array': + case 'string': + case 'object': + val += c; + break; + default: + states.push('key'); + val = val.trim(); + key = key.trim(); + if ('' == key) return; + tok.attrs[key.replace(/^['"]|['"]$/g, '')] = '' == val + ? true + : interpolate(val); + key = val = ''; + } + break; + case '=': + switch (state()) { + case 'key char': + key += real; + break; + case 'val': + case 'expr': + case 'array': + case 'string': + case 'object': + val += real; + break; + default: + states.push('val'); + } + break; + case '(': + if ('val' == state() + || 'expr' == state()) states.push('expr'); + val += c; + break; + case ')': + if ('expr' == state() + || 'val' == state()) states.pop(); + val += c; + break; + case '{': + if ('val' == state()) states.push('object'); + val += c; + break; + case '}': + if ('object' == state()) states.pop(); + val += c; + break; + case '[': + if ('val' == state()) states.push('array'); + val += c; + break; + case ']': + if ('array' == state()) states.pop(); + val += c; + break; + case '"': + case "'": + switch (state()) { + case 'key': + states.push('key char'); + break; + case 'key char': + states.pop(); + break; + case 'string': + if (c == quote) states.pop(); + val += c; + break; + default: + states.push('string'); + val += c; + quote = c; + } + break; + case '': + break; + default: + switch (state()) { + case 'key': + case 'key char': + key += c; + break; + default: + val += c; + } + } + } + + for (var i = 0; i < len; ++i) { + parse(str[i]); + } + + parse(','); + + return tok; + } + }, + + /** + * Indent | Outdent | Newline. + */ + + indent: function() { + var captures, re; + + // established regexp + if (this.indentRe) { + captures = this.indentRe.exec(this.input); + // determine regexp + } else { + // tabs + re = /^\n(\t*) */; + captures = re.exec(this.input); + + // spaces + if (captures && !captures[1].length) { + re = /^\n( *)/; + captures = re.exec(this.input); + } + + // established + if (captures && captures[1].length) this.indentRe = re; + } + + if (captures) { + var tok + , indents = captures[1].length; + + ++this.lineno; + this.consume(indents + 1); + + if (' ' == this.input[0] || '\t' == this.input[0]) { + throw new Error('Invalid indentation, you can use tabs or spaces but not both'); + } + + // blank line + if ('\n' == this.input[0]) return this.tok('newline'); + + // outdent + if (this.indentStack.length && indents < this.indentStack[0]) { + while (this.indentStack.length && this.indentStack[0] > indents) { + this.stash.push(this.tok('outdent')); + this.indentStack.shift(); + } + tok = this.stash.pop(); + // indent + } else if (indents && indents != this.indentStack[0]) { + this.indentStack.unshift(indents); + tok = this.tok('indent', indents); + // newline + } else { + tok = this.tok('newline'); + } + + return tok; + } + }, + + /** + * Pipe-less text consumed only when + * pipeless is true; + */ + + pipelessText: function() { + if (this.pipeless) { + if ('\n' == this.input[0]) return; + var i = this.input.indexOf('\n'); + if (-1 == i) i = this.input.length; + var str = this.input.substr(0, i); + this.consume(str.length); + return this.tok('text', str); + } + }, + + /** + * ':' + */ + + colon: function() { + return this.scan(/^: */, ':'); + }, + + /** + * Return the next token object, or those + * previously stashed by lookahead. + * + * @return {Object} + * @api private + */ + + advance: function(){ + return this.stashed() + || this.next(); + }, + + /** + * Return the next token object. + * + * @return {Object} + * @api private + */ + + next: function() { + return this.deferred() + || this.eos() + || this.pipelessText() + || this.yield() + || this.doctype() + || this.case() + || this.when() + || this.default() + || this.extends() + || this.append() + || this.prepend() + || this.block() + || this.include() + || this.mixin() + || this.conditional() + || this.each() + || this.while() + || this.assignment() + || this.tag() + || this.filter() + || this.code() + || this.id() + || this.className() + || this.attrs() + || this.indent() + || this.comment() + || this.colon() + || this.text(); + } +}; + +}); // module: lexer.js + +require.register("nodes/block-comment.js", function(module, exports, require){ + +/*! + * Jade - nodes - BlockComment + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `BlockComment` with the given `block`. + * + * @param {String} val + * @param {Block} block + * @param {Boolean} buffer + * @api public + */ + +var BlockComment = module.exports = function BlockComment(val, block, buffer) { + this.block = block; + this.val = val; + this.buffer = buffer; +}; + +/** + * Inherit from `Node`. + */ + +BlockComment.prototype = new Node; +BlockComment.prototype.constructor = BlockComment; + +}); // module: nodes/block-comment.js + +require.register("nodes/block.js", function(module, exports, require){ + +/*! + * Jade - nodes - Block + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a new `Block` with an optional `node`. + * + * @param {Node} node + * @api public + */ + +var Block = module.exports = function Block(node){ + this.nodes = []; + if (node) this.push(node); +}; + +/** + * Inherit from `Node`. + */ + +Block.prototype = new Node; +Block.prototype.constructor = Block; + + +/** + * Replace the nodes in `other` with the nodes + * in `this` block. + * + * @param {Block} other + * @api private + */ + +Block.prototype.replace = function(other){ + other.nodes = this.nodes; +}; + +/** + * Pust the given `node`. + * + * @param {Node} node + * @return {Number} + * @api public + */ + +Block.prototype.push = function(node){ + return this.nodes.push(node); +}; + +/** + * Check if this block is empty. + * + * @return {Boolean} + * @api public + */ + +Block.prototype.isEmpty = function(){ + return 0 == this.nodes.length; +}; + +/** + * Unshift the given `node`. + * + * @param {Node} node + * @return {Number} + * @api public + */ + +Block.prototype.unshift = function(node){ + return this.nodes.unshift(node); +}; + +/** + * Return the "last" block, or the first `yield` node. + * + * @return {Block} + * @api private + */ + +Block.prototype.includeBlock = function(){ + var ret = this + , node; + + for (var i = 0, len = this.nodes.length; i < len; ++i) { + node = this.nodes[i]; + if (node.yield) return node; + else if (node.textOnly) continue; + else if (node.includeBlock) ret = node.includeBlock(); + else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); + } + + return ret; +}; + + +}); // module: nodes/block.js + +require.register("nodes/case.js", function(module, exports, require){ + +/*! + * Jade - nodes - Case + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a new `Case` with `expr`. + * + * @param {String} expr + * @api public + */ + +var Case = exports = module.exports = function Case(expr, block){ + this.expr = expr; + this.block = block; +}; + +/** + * Inherit from `Node`. + */ + +Case.prototype = new Node; +Case.prototype.constructor = Case; + + +var When = exports.When = function When(expr, block){ + this.expr = expr; + this.block = block; + this.debug = false; +}; + +/** + * Inherit from `Node`. + */ + +When.prototype = new Node; +When.prototype.constructor = When; + + + +}); // module: nodes/case.js + +require.register("nodes/code.js", function(module, exports, require){ + +/*! + * Jade - nodes - Code + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Code` node with the given code `val`. + * Code may also be optionally buffered and escaped. + * + * @param {String} val + * @param {Boolean} buffer + * @param {Boolean} escape + * @api public + */ + +var Code = module.exports = function Code(val, buffer, escape) { + this.val = val; + this.buffer = buffer; + this.escape = escape; + if (val.match(/^ *else/)) this.debug = false; +}; + +/** + * Inherit from `Node`. + */ + +Code.prototype = new Node; +Code.prototype.constructor = Code; + +}); // module: nodes/code.js + +require.register("nodes/comment.js", function(module, exports, require){ + +/*! + * Jade - nodes - Comment + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Comment` with the given `val`, optionally `buffer`, + * otherwise the comment may render in the output. + * + * @param {String} val + * @param {Boolean} buffer + * @api public + */ + +var Comment = module.exports = function Comment(val, buffer) { + this.val = val; + this.buffer = buffer; +}; + +/** + * Inherit from `Node`. + */ + +Comment.prototype = new Node; +Comment.prototype.constructor = Comment; + +}); // module: nodes/comment.js + +require.register("nodes/doctype.js", function(module, exports, require){ + +/*! + * Jade - nodes - Doctype + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Doctype` with the given `val`. + * + * @param {String} val + * @api public + */ + +var Doctype = module.exports = function Doctype(val) { + this.val = val; +}; + +/** + * Inherit from `Node`. + */ + +Doctype.prototype = new Node; +Doctype.prototype.constructor = Doctype; + +}); // module: nodes/doctype.js + +require.register("nodes/each.js", function(module, exports, require){ + +/*! + * Jade - nodes - Each + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize an `Each` node, representing iteration + * + * @param {String} obj + * @param {String} val + * @param {String} key + * @param {Block} block + * @api public + */ + +var Each = module.exports = function Each(obj, val, key, block) { + this.obj = obj; + this.val = val; + this.key = key; + this.block = block; +}; + +/** + * Inherit from `Node`. + */ + +Each.prototype = new Node; +Each.prototype.constructor = Each; + +}); // module: nodes/each.js + +require.register("nodes/filter.js", function(module, exports, require){ + +/*! + * Jade - nodes - Filter + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node') + , Block = require('./block'); + +/** + * Initialize a `Filter` node with the given + * filter `name` and `block`. + * + * @param {String} name + * @param {Block|Node} block + * @api public + */ + +var Filter = module.exports = function Filter(name, block, attrs) { + this.name = name; + this.block = block; + this.attrs = attrs; + this.isASTFilter = block instanceof Block; +}; + +/** + * Inherit from `Node`. + */ + +Filter.prototype = new Node; +Filter.prototype.constructor = Filter; + +}); // module: nodes/filter.js + +require.register("nodes/index.js", function(module, exports, require){ + +/*! + * Jade - nodes + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +exports.Node = require('./node'); +exports.Tag = require('./tag'); +exports.Code = require('./code'); +exports.Each = require('./each'); +exports.Case = require('./case'); +exports.Text = require('./text'); +exports.Block = require('./block'); +exports.Mixin = require('./mixin'); +exports.Filter = require('./filter'); +exports.Comment = require('./comment'); +exports.Literal = require('./literal'); +exports.BlockComment = require('./block-comment'); +exports.Doctype = require('./doctype'); + +}); // module: nodes/index.js + +require.register("nodes/literal.js", function(module, exports, require){ + +/*! + * Jade - nodes - Literal + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Literal` node with the given `str. + * + * @param {String} str + * @api public + */ + +var Literal = module.exports = function Literal(str) { + this.str = str + .replace(/\n/g, "\\n") + .replace(/'/g, "\\'"); +}; + +/** + * Inherit from `Node`. + */ + +Literal.prototype = new Node; +Literal.prototype.constructor = Literal; + + +}); // module: nodes/literal.js + +require.register("nodes/mixin.js", function(module, exports, require){ + +/*! + * Jade - nodes - Mixin + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a new `Mixin` with `name` and `block`. + * + * @param {String} name + * @param {String} args + * @param {Block} block + * @api public + */ + +var Mixin = module.exports = function Mixin(name, args, block){ + this.name = name; + this.args = args; + this.block = block; +}; + +/** + * Inherit from `Node`. + */ + +Mixin.prototype = new Node; +Mixin.prototype.constructor = Mixin; + + + +}); // module: nodes/mixin.js + +require.register("nodes/node.js", function(module, exports, require){ + +/*! + * Jade - nodes - Node + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Initialize a `Node`. + * + * @api public + */ + +var Node = module.exports = function Node(){}; +}); // module: nodes/node.js + +require.register("nodes/tag.js", function(module, exports, require){ + +/*! + * Jade - nodes - Tag + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'), + Block = require('./block'); + +/** + * Initialize a `Tag` node with the given tag `name` and optional `block`. + * + * @param {String} name + * @param {Block} block + * @api public + */ + +var Tag = module.exports = function Tag(name, block) { + this.name = name; + this.attrs = []; + this.block = block || new Block; +}; + +/** + * Inherit from `Node`. + */ + +Tag.prototype = new Node; +Tag.prototype.constructor = Tag; + + +/** + * Set attribute `name` to `val`, keep in mind these become + * part of a raw js object literal, so to quote a value you must + * '"quote me"', otherwise or example 'user.name' is literal JavaScript. + * + * @param {String} name + * @param {String} val + * @return {Tag} for chaining + * @api public + */ + +Tag.prototype.setAttribute = function(name, val){ + this.attrs.push({ name: name, val: val }); + return this; +}; + +/** + * Remove attribute `name` when present. + * + * @param {String} name + * @api public + */ + +Tag.prototype.removeAttribute = function(name){ + for (var i = 0, len = this.attrs.length; i < len; ++i) { + if (this.attrs[i] && this.attrs[i].name == name) { + delete this.attrs[i]; + } + } +}; + +/** + * Get attribute value by `name`. + * + * @param {String} name + * @return {String} + * @api public + */ + +Tag.prototype.getAttribute = function(name){ + for (var i = 0, len = this.attrs.length; i < len; ++i) { + if (this.attrs[i] && this.attrs[i].name == name) { + return this.attrs[i].val; + } + } +}; + +}); // module: nodes/tag.js + +require.register("nodes/text.js", function(module, exports, require){ + +/*! + * Jade - nodes - Text + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Text` node with optional `line`. + * + * @param {String} line + * @api public + */ + +var Text = module.exports = function Text(line) { + this.nodes = []; + if ('string' == typeof line) this.push(line); +}; + +/** + * Inherit from `Node`. + */ + +Text.prototype = new Node; +Text.prototype.constructor = Text; + + +/** + * Push the given `node.` + * + * @param {Node} node + * @return {Number} + * @api public + */ + +Text.prototype.push = function(node){ + return this.nodes.push(node); +}; + +}); // module: nodes/text.js + +require.register("parser.js", function(module, exports, require){ + +/*! + * Jade - Parser + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Lexer = require('./lexer') + , nodes = require('./nodes'); + +/** + * Initialize `Parser` with the given input `str` and `filename`. + * + * @param {String} str + * @param {String} filename + * @param {Object} options + * @api public + */ + +var Parser = exports = module.exports = function Parser(str, filename, options){ + this.input = str; + this.lexer = new Lexer(str, options); + this.filename = filename; + this.blocks = {}; + this.options = options; + this.contexts = [this]; +}; + +/** + * Tags that may not contain tags. + */ + +var textOnly = exports.textOnly = ['script', 'style']; + +/** + * Parser prototype. + */ + +Parser.prototype = { + + /** + * Push `parser` onto the context stack, + * or pop and return a `Parser`. + */ + + context: function(parser){ + if (parser) { + this.contexts.push(parser); + } else { + return this.contexts.pop(); + } + }, + + /** + * Return the next token object. + * + * @return {Object} + * @api private + */ + + advance: function(){ + return this.lexer.advance(); + }, + + /** + * Skip `n` tokens. + * + * @param {Number} n + * @api private + */ + + skip: function(n){ + while (n--) this.advance(); + }, + + /** + * Single token lookahead. + * + * @return {Object} + * @api private + */ + + peek: function() { + return this.lookahead(1); + }, + + /** + * Return lexer lineno. + * + * @return {Number} + * @api private + */ + + line: function() { + return this.lexer.lineno; + }, + + /** + * `n` token lookahead. + * + * @param {Number} n + * @return {Object} + * @api private + */ + + lookahead: function(n){ + return this.lexer.lookahead(n); + }, + + /** + * Parse input returning a string of js for evaluation. + * + * @return {String} + * @api public + */ + + parse: function(){ + var block = new nodes.Block, parser; + block.line = this.line(); + + while ('eos' != this.peek().type) { + if ('newline' == this.peek().type) { + this.advance(); + } else { + block.push(this.parseExpr()); + } + } + + if (parser = this.extending) { + this.context(parser); + var ast = parser.parse(); + this.context(); + return ast; + } + + return block; + }, + + /** + * Expect the given type, or throw an exception. + * + * @param {String} type + * @api private + */ + + expect: function(type){ + if (this.peek().type === type) { + return this.advance(); + } else { + throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); + } + }, + + /** + * Accept the given `type`. + * + * @param {String} type + * @api private + */ + + accept: function(type){ + if (this.peek().type === type) { + return this.advance(); + } + }, + + /** + * tag + * | doctype + * | mixin + * | include + * | filter + * | comment + * | text + * | each + * | code + * | yield + * | id + * | class + */ + + parseExpr: function(){ + switch (this.peek().type) { + case 'tag': + return this.parseTag(); + case 'mixin': + return this.parseMixin(); + case 'block': + return this.parseBlock(); + case 'case': + return this.parseCase(); + case 'when': + return this.parseWhen(); + case 'default': + return this.parseDefault(); + case 'extends': + return this.parseExtends(); + case 'include': + return this.parseInclude(); + case 'doctype': + return this.parseDoctype(); + case 'filter': + return this.parseFilter(); + case 'comment': + return this.parseComment(); + case 'text': + return this.parseText(); + case 'each': + return this.parseEach(); + case 'code': + return this.parseCode(); + case 'yield': + this.advance(); + var block = new nodes.Block; + block.yield = true; + return block; + case 'id': + case 'class': + var tok = this.advance(); + this.lexer.defer(this.lexer.tok('tag', 'div')); + this.lexer.defer(tok); + return this.parseExpr(); + default: + throw new Error('unexpected token "' + this.peek().type + '"'); + } + }, + + /** + * Text + */ + + parseText: function(){ + var tok = this.expect('text') + , node = new nodes.Text(tok.val); + node.line = this.line(); + return node; + }, + + /** + * ':' expr + * | block + */ + + parseBlockExpansion: function(){ + if (':' == this.peek().type) { + this.advance(); + return new nodes.Block(this.parseExpr()); + } else { + return this.block(); + } + }, + + /** + * case + */ + + parseCase: function(){ + var val = this.expect('case').val + , node = new nodes.Case(val); + node.line = this.line(); + node.block = this.block(); + return node; + }, + + /** + * when + */ + + parseWhen: function(){ + var val = this.expect('when').val + return new nodes.Case.When(val, this.parseBlockExpansion()); + }, + + /** + * default + */ + + parseDefault: function(){ + this.expect('default'); + return new nodes.Case.When('default', this.parseBlockExpansion()); + }, + + /** + * code + */ + + parseCode: function(){ + var tok = this.expect('code') + , node = new nodes.Code(tok.val, tok.buffer, tok.escape) + , block + , i = 1; + node.line = this.line(); + while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; + block = 'indent' == this.lookahead(i).type; + if (block) { + this.skip(i-1); + node.block = this.block(); + } + return node; + }, + + /** + * comment + */ + + parseComment: function(){ + var tok = this.expect('comment') + , node; + + if ('indent' == this.peek().type) { + node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); + } else { + node = new nodes.Comment(tok.val, tok.buffer); + } + + node.line = this.line(); + return node; + }, + + /** + * doctype + */ + + parseDoctype: function(){ + var tok = this.expect('doctype') + , node = new nodes.Doctype(tok.val); + node.line = this.line(); + return node; + }, + + /** + * filter attrs? text-block + */ + + parseFilter: function(){ + var block + , tok = this.expect('filter') + , attrs = this.accept('attrs'); + + this.lexer.pipeless = true; + block = this.parseTextBlock(); + this.lexer.pipeless = false; + + var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); + node.line = this.line(); + return node; + }, + + /** + * tag ':' attrs? block + */ + + parseASTFilter: function(){ + var block + , tok = this.expect('tag') + , attrs = this.accept('attrs'); + + this.expect(':'); + block = this.block(); + + var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); + node.line = this.line(); + return node; + }, + + /** + * each block + */ + + parseEach: function(){ + var tok = this.expect('each') + , node = new nodes.Each(tok.code, tok.val, tok.key); + node.line = this.line(); + node.block = this.block(); + return node; + }, + + /** + * 'extends' name + */ + + parseExtends: function(){ + var path = require('path') + , fs = require('fs') + , dirname = path.dirname + , basename = path.basename + , join = path.join; + + if (!this.filename) + throw new Error('the "filename" option is required to extend templates'); + + var path = this.expect('extends').val.trim() + , dir = dirname(this.filename); + + var path = join(dir, path + '.jade') + , str = fs.readFileSync(path, 'utf8') + , parser = new Parser(str, path, this.options); + + parser.blocks = this.blocks; + parser.contexts = this.contexts; + this.extending = parser; + + // TODO: null node + return new nodes.Literal(''); + }, + + /** + * 'block' name block + */ + + parseBlock: function(){ + var block = this.expect('block') + , mode = block.mode + , name = block.val.trim(); + + block = 'indent' == this.peek().type + ? this.block() + : new nodes.Block(new nodes.Literal('')); + + var prev = this.blocks[name]; + + if (prev) { + switch (prev.mode) { + case 'append': + block.nodes = block.nodes.concat(prev.nodes); + prev = block; + break; + case 'prepend': + block.nodes = prev.nodes.concat(block.nodes); + prev = block; + break; + } + } + + block.mode = mode; + return this.blocks[name] = prev || block; + }, + + /** + * include block? + */ + + parseInclude: function(){ + var path = require('path') + , fs = require('fs') + , dirname = path.dirname + , basename = path.basename + , join = path.join; + + var path = this.expect('include').val.trim() + , dir = dirname(this.filename); + + if (!this.filename) + throw new Error('the "filename" option is required to use includes'); + + // no extension + if (!~basename(path).indexOf('.')) { + path += '.jade'; + } + + // non-jade + if ('.jade' != path.substr(-5)) { + var path = join(dir, path) + , str = fs.readFileSync(path, 'utf8'); + return new nodes.Literal(str); + } + + var path = join(dir, path) + , str = fs.readFileSync(path, 'utf8') + , parser = new Parser(str, path, this.options); + + this.context(parser); + var ast = parser.parse(); + this.context(); + ast.filename = path; + + if ('indent' == this.peek().type) { + ast.includeBlock().push(this.block()); + } + + return ast; + }, + + /** + * mixin block + */ + + parseMixin: function(){ + var tok = this.expect('mixin') + , name = tok.val + , args = tok.args; + var block = 'indent' == this.peek().type + ? this.block() + : null; + return new nodes.Mixin(name, args, block); + }, + + /** + * indent (text | newline)* outdent + */ + + parseTextBlock: function(){ + var text = new nodes.Text; + text.line = this.line(); + var spaces = this.expect('indent').val; + if (null == this._spaces) this._spaces = spaces; + var indent = Array(spaces - this._spaces + 1).join(' '); + while ('outdent' != this.peek().type) { + switch (this.peek().type) { + case 'newline': + text.push('\\n'); + this.advance(); + break; + case 'indent': + text.push('\\n'); + this.parseTextBlock().nodes.forEach(function(node){ + text.push(node); + }); + text.push('\\n'); + break; + default: + text.push(indent + this.advance().val); + } + } + + if (spaces == this._spaces) this._spaces = null; + this.expect('outdent'); + return text; + }, + + /** + * indent expr* outdent + */ + + block: function(){ + var block = new nodes.Block; + block.line = this.line(); + this.expect('indent'); + while ('outdent' != this.peek().type) { + if ('newline' == this.peek().type) { + this.advance(); + } else { + block.push(this.parseExpr()); + } + } + this.expect('outdent'); + return block; + }, + + /** + * tag (attrs | class | id)* (text | code | ':')? newline* block? + */ + + parseTag: function(){ + // ast-filter look-ahead + var i = 2; + if ('attrs' == this.lookahead(i).type) ++i; + if (':' == this.lookahead(i).type) { + if ('indent' == this.lookahead(++i).type) { + return this.parseASTFilter(); + } + } + + var name = this.advance().val + , tag = new nodes.Tag(name) + , dot; + + tag.line = this.line(); + + // (attrs | class | id)* + out: + while (true) { + switch (this.peek().type) { + case 'id': + case 'class': + var tok = this.advance(); + tag.setAttribute(tok.type, "'" + tok.val + "'"); + continue; + case 'attrs': + var obj = this.advance().attrs + , names = Object.keys(obj); + for (var i = 0, len = names.length; i < len; ++i) { + var name = names[i] + , val = obj[name]; + tag.setAttribute(name, val); + } + continue; + default: + break out; + } + } + + // check immediate '.' + if ('.' == this.peek().val) { + dot = tag.textOnly = true; + this.advance(); + } + + // (text | code | ':')? + switch (this.peek().type) { + case 'text': + tag.text = this.parseText(); + break; + case 'code': + tag.code = this.parseCode(); + break; + case ':': + this.advance(); + tag.block = new nodes.Block; + tag.block.push(this.parseTag()); + break; + } + + // newline* + while ('newline' == this.peek().type) this.advance(); + + tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); + + // script special-case + if ('script' == tag.name) { + var type = tag.getAttribute('type'); + if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { + tag.textOnly = false; + } + } + + // block? + if ('indent' == this.peek().type) { + if (tag.textOnly) { + this.lexer.pipeless = true; + tag.block = this.parseTextBlock(); + this.lexer.pipeless = false; + } else { + var block = this.block(); + if (tag.block) { + for (var i = 0, len = block.nodes.length; i < len; ++i) { + tag.block.push(block.nodes[i]); + } + } else { + tag.block = block; + } + } + } + + return tag; + } +}; + +}); // module: parser.js + +require.register("runtime.js", function(module, exports, require){ + +/*! + * Jade - runtime + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Lame Array.isArray() polyfill for now. + */ + +if (!Array.isArray) { + Array.isArray = function(arr){ + return '[object Array]' == Object.prototype.toString.call(arr); + }; +} + +/** + * Lame Object.keys() polyfill for now. + */ + +if (!Object.keys) { + Object.keys = function(obj){ + var arr = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + arr.push(key); + } + } + return arr; + } +} + +/** + * Render the given attributes object. + * + * @param {Object} obj + * @return {String} + * @api private + */ + +exports.attrs = function attrs(obj){ + var buf = [] + , terse = obj.terse; + delete obj.terse; + var keys = Object.keys(obj) + , len = keys.length; + if (len) { + buf.push(''); + for (var i = 0; i < len; ++i) { + var key = keys[i] + , val = obj[key]; + if ('boolean' == typeof val || null == val) { + if (val) { + terse + ? buf.push(key) + : buf.push(key + '="' + key + '"'); + } + } else if ('class' == key && Array.isArray(val)) { + buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); + } else { + buf.push(key + '="' + exports.escape(val) + '"'); + } + } + } + return buf.join(' '); +}; + +/** + * Escape the given string of `html`. + * + * @param {String} html + * @return {String} + * @api private + */ + +exports.escape = function escape(html){ + return String(html) + .replace(/&(?!\w+;)/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +}; + +/** + * Re-throw the given `err` in context to the + * the jade in `filename` at the given `lineno`. + * + * @param {Error} err + * @param {String} filename + * @param {String} lineno + * @api private + */ + +exports.rethrow = function rethrow(err, filename, lineno){ + if (!filename) throw err; + + var context = 3 + , str = require('fs').readFileSync(filename, 'utf8') + , lines = str.split('\n') + , start = Math.max(lineno - context, 0) + , end = Math.min(lines.length, lineno + context); + + // Error context + var context = lines.slice(start, end).map(function(line, i){ + var curr = i + start + 1; + return (curr == lineno ? ' > ' : ' ') + + curr + + '| ' + + line; + }).join('\n'); + + // Alter exception message + err.path = filename; + err.message = (filename || 'Jade') + ':' + lineno + + '\n' + context + '\n\n' + err.message; + throw err; +}; + +}); // module: runtime.js + +require.register("self-closing.js", function(module, exports, require){ + +/*! + * Jade - self closing tags + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +module.exports = [ + 'meta' + , 'img' + , 'link' + , 'input' + , 'area' + , 'base' + , 'col' + , 'br' + , 'hr' +]; +}); // module: self-closing.js + +require.register("utils.js", function(module, exports, require){ + +/*! + * Jade - utils + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Convert interpolation in the given string to JavaScript. + * + * @param {String} str + * @return {String} + * @api private + */ + +var interpolate = exports.interpolate = function(str){ + return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ + return escape + ? str + : "' + " + + ('!' == flag ? '' : 'escape') + + "((interp = " + code.replace(/\\'/g, "'") + + ") == null ? '' : interp) + '"; + }); +}; + +/** + * Escape single quotes in `str`. + * + * @param {String} str + * @return {String} + * @api private + */ + +var escape = exports.escape = function(str) { + return str.replace(/'/g, "\\'"); +}; + +/** + * Interpolate, and escape the given `str`. + * + * @param {String} str + * @return {String} + * @api private + */ + +exports.text = function(str){ + return interpolate(escape(str)); +}; +}); // module: utils.js + +window.jade = require("jade"); +})(); diff --git a/usb_auth/node_modules/jade/jade.min.js b/usb_auth/node_modules/jade/jade.min.js new file mode 100644 index 0000000..ace59ff --- /dev/null +++ b/usb_auth/node_modules/jade/jade.min.js @@ -0,0 +1,2 @@ +(function(){function require(p){var path=require.resolve(p),mod=require.modules[path];if(!mod)throw new Error('failed to require "'+p+'"');return mod.exports||(mod.exports={},mod.call(mod.exports,mod,mod.exports,require.relative(path))),mod.exports}require.modules={},require.resolve=function(path){var orig=path,reg=path+".js",index=path+"/index.js";return require.modules[reg]&®||require.modules[index]&&index||orig},require.register=function(path,fn){require.modules[path]=fn},require.relative=function(parent){return function(p){if("."!=p[0])return require(p);var path=parent.split("/"),segs=p.split("/");path.pop();for(var i=0;i",this.doctype=doctype,this.terse="5"==name||"html"==name,this.xml=0==this.doctype.indexOf(""):this.buffer("/>")):(tag.attrs.length?(this.buffer("<"+name),tag.attrs.length&&this.visitAttributes(tag.attrs),this.buffer(">")):this.buffer("<"+name+">"),tag.code&&this.visitCode(tag.code),tag.text&&this.buffer(utils.text(tag.text.nodes[0].trimLeft())),this.escape="pre"==tag.name,this.visit(tag.block),this.pp&&!~inlineTags.indexOf(name)&&!tag.textOnly&&this.buffer("\\n"+Array(this.indents).join(" ")),this.buffer("")),this.indents--},visitFilter:function(filter){var fn=filters[filter.name];if(!fn)throw filter.isASTFilter?new Error('unknown ast filter "'+filter.name+':"'):new Error('unknown filter ":'+filter.name+'"');if(filter.isASTFilter)this.buf.push(fn(filter.block,this,filter.attrs));else{var text=filter.block.nodes.join("");this.buffer(utils.text(fn(text,filter.attrs)))}},visitText:function(text){text=utils.text(text.nodes.join("")),this.escape&&(text=escape(text)),this.buffer(text),this.buffer("\\n")},visitComment:function(comment){if(!comment.buffer)return;this.pp&&this.buffer("\\n"+Array(this.indents+1).join(" ")),this.buffer("")},visitBlockComment:function(comment){if(!comment.buffer)return;0==comment.val.trim().indexOf("if")?(this.buffer("")):(this.buffer(""))},visitCode:function(code){if(code.buffer){var val=code.val.trimLeft();this.buf.push("var __val__ = "+val),val='null == __val__ ? "" : __val__',code.escape&&(val="escape("+val+")"),this.buf.push("buf.push("+val+");")}else this.buf.push(code.val);code.block&&(code.buffer||this.buf.push("{"),this.visit(code.block),code.buffer||this.buf.push("}"))},visitEach:function(each){this.buf.push("// iterate "+each.obj+"\n"+"(function(){\n"+" if ('number' == typeof "+each.obj+".length) {\n"+" for (var "+each.key+" = 0, $$l = "+each.obj+".length; "+each.key+" < $$l; "+each.key+"++) {\n"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n } else {\n for (var "+each.key+" in "+each.obj+") {\n"+" if ("+each.obj+".hasOwnProperty("+each.key+")){"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n"),this.buf.push(" }\n }\n}).call(this);\n")},visitAttributes:function(attrs){var buf=[],classes=[];this.terse&&buf.push("terse: true"),attrs.forEach(function(attr){if(attr.name=="class")classes.push("("+attr.val+")");else{var pair="'"+attr.name+"':("+attr.val+")";buf.push(pair)}}),classes.length&&(classes=classes.join(" + ' ' + "),buf.push("class: "+classes)),buf=buf.join(", ").replace("class:",'"class":'),this.buf.push("buf.push(attrs({ "+buf+" }));")}};function escape(html){return String(html).replace(/&(?!\w+;)/g,"&").replace(//g,">").replace(/"/g,""")}}),require.register("doctypes.js",function(module,exports,require){module.exports={5:"",xml:'',"default":'',transitional:'',strict:'',frameset:'',1.1:'',basic:'',mobile:''}}),require.register("filters.js",function(module,exports,require){module.exports={cdata:function(str){return""},sass:function(str){str=str.replace(/\\n/g,"\n");var sass=require("sass").render(str).replace(/\n/g,"\\n");return'"},stylus:function(str,options){var ret;str=str.replace(/\\n/g,"\n");var stylus=require("stylus");return stylus(str,options).render(function(err,css){if(err)throw err;ret=css.replace(/\n/g,"\\n")}),'"},less:function(str){var ret;return str=str.replace(/\\n/g,"\n"),require("less").render(str,function(err,css){if(err)throw err;ret='"}),ret},markdown:function(str){var md;try{md=require("markdown")}catch(err){try{md=require("discount")}catch(err){try{md=require("markdown-js")}catch(err){try{md=require("marked")}catch(err){throw new Error("Cannot find markdown library, install markdown, discount, or marked.")}}}}return str=str.replace(/\\n/g,"\n"),md.parse(str).replace(/\n/g,"\\n").replace(/'/g,"'")},coffeescript:function(str){str=str.replace(/\\n/g,"\n");var js=require("coffee-script").compile(str).replace(/\n/g,"\\n");return'"}}}),require.register("inline-tags.js",function(module,exports,require){module.exports=["a","abbr","acronym","b","br","code","em","font","i","img","ins","kbd","map","samp","small","span","strong","sub","sup"]}),require.register("jade.js",function(module,exports,require){var Parser=require("./parser"),Lexer=require("./lexer"),Compiler=require("./compiler"),runtime=require("./runtime");exports.version="0.20.1",exports.selfClosing=require("./self-closing"),exports.doctypes=require("./doctypes"),exports.filters=require("./filters"),exports.utils=require("./utils"),exports.Compiler=Compiler,exports.Parser=Parser,exports.Lexer=Lexer,exports.nodes=require("./nodes"),exports.runtime=runtime,exports.cache={};function parse(str,options){try{var parser=new Parser(str,options.filename,options),compiler=new(options.compiler||Compiler)(parser.parse(),options),js=compiler.compile();return options.debug&&console.error("\nCompiled Function:\n\n%s",js.replace(/^/gm," ")),"var buf = [];\n"+(options.self?"var self = locals || {};\n"+js:"with (locals || {}) {\n"+js+"\n}\n")+'return buf.join("");'}catch(err){parser=parser.context(),runtime.rethrow(err,parser.filename,parser.lexer.lineno)}}exports.compile=function(str,options){var options=options||{},client=options.client,filename=options.filename?JSON.stringify(options.filename):"undefined",fn;return options.compileDebug!==!1?fn=["var __jade = [{ lineno: 1, filename: "+filename+" }];","try {",parse(String(str),options),"} catch (err) {"," rethrow(err, __jade[0].filename, __jade[0].lineno);","}"].join("\n"):fn=parse(String(str),options),client&&(fn="var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n"+fn),fn=new Function("locals, attrs, escape, rethrow",fn),client?fn:function(locals){return fn(locals,runtime.attrs,runtime.escape,runtime.rethrow)}},exports.render=function(str,options,fn){"function"==typeof options&&(fn=options,options={});if(options.cache&&!options.filename)return fn(new Error('the "filename" option is required for caching'));try{var path=options.filename,tmpl=options.cache?exports.cache[path]||(exports.cache[path]=exports.compile(str,options)):exports.compile(str,options);fn(null,tmpl(options))}catch(err){fn(err)}},exports.renderFile=function(path,options,fn){var key=path+":string";"function"==typeof options&&(fn=options,options={});try{options.filename=path;var str=options.cache?exports.cache[key]||(exports.cache[key]=fs.readFileSync(path,"utf8")):fs.readFileSync(path,"utf8");exports.render(str,options,fn)}catch(err){fn(err)}},exports.__express=exports.renderFile}),require.register("lexer.js",function(module,exports,require){var Lexer=module.exports=function(str,options){options=options||{},this.input=str.replace(/\r\n|\r/g,"\n"),this.colons=options.colons,this.deferredTokens=[],this.lastIndents=0,this.lineno=1,this.stash=[],this.indentStack=[],this.indentRe=null,this.pipeless=!1};Lexer.prototype={tok:function(type,val){return{type:type,line:this.lineno,val:val}},consume:function(len){this.input=this.input.substr(len)},scan:function(regexp,type){var captures;if(captures=regexp.exec(this.input))return this.consume(captures[0].length),this.tok(type,captures[1])},defer:function(tok){this.deferredTokens.push(tok)},lookahead:function(n){var fetch=n-this.stash.length;while(fetch-->0)this.stash.push(this.next());return this.stash[--n]},indexOfDelimiters:function(start,end){var str=this.input,nstart=0,nend=0,pos=0;for(var i=0,len=str.length;iindents)this.stash.push(this.tok("outdent")),this.indentStack.shift();tok=this.stash.pop()}else indents&&indents!=this.indentStack[0]?(this.indentStack.unshift(indents),tok=this.tok("indent",indents)):tok=this.tok("newline");return tok}},pipelessText:function(){if(this.pipeless){if("\n"==this.input[0])return;var i=this.input.indexOf("\n");-1==i&&(i=this.input.length);var str=this.input.substr(0,i);return this.consume(str.length),this.tok("text",str)}},colon:function(){return this.scan(/^: */,":")},advance:function(){return this.stashed()||this.next()},next:function(){return this.deferred()||this.eos()||this.pipelessText()||this.yield()||this.doctype()||this.case()||this.when()||this.default()||this.extends()||this.append()||this.prepend()||this.block()||this.include()||this.mixin()||this.conditional()||this.each()||this.while()||this.assignment()||this.tag()||this.filter()||this.code()||this.id()||this.className()||this.attrs()||this.indent()||this.comment()||this.colon()||this.text()}}}),require.register("nodes/block-comment.js",function(module,exports,require){var Node=require("./node"),BlockComment=module.exports=function(val,block,buffer){this.block=block,this.val=val,this.buffer=buffer};BlockComment.prototype=new Node,BlockComment.prototype.constructor=BlockComment}),require.register("nodes/block.js",function(module,exports,require){var Node=require("./node"),Block=module.exports=function(node){this.nodes=[],node&&this.push(node)};Block.prototype=new Node,Block.prototype.constructor=Block,Block.prototype.replace=function(other){other.nodes=this.nodes},Block.prototype.push=function(node){return this.nodes.push(node)},Block.prototype.isEmpty=function(){return 0==this.nodes.length},Block.prototype.unshift=function(node){return this.nodes.unshift(node)},Block.prototype.includeBlock=function(){var ret=this,node;for(var i=0,len=this.nodes.length;i/g,">").replace(/"/g,""")},exports.rethrow=function(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err}}),require.register("self-closing.js",function(module,exports,require){module.exports=["meta","img","link","input","area","base","col","br","hr"]}),require.register("utils.js",function(module,exports,require){var interpolate=exports.interpolate=function(str){return str.replace(/(\\)?([#!]){(.*?)}/g,function(str,escape,flag,code){return escape?str:"' + "+("!"==flag?"":"escape")+"((interp = "+code.replace(/\\'/g,"'")+") == null ? '' : interp) + '"})},escape=exports.escape=function(str){return str.replace(/'/g,"\\'")};exports.text=function(str){return interpolate(escape(str))}}),window.jade=require("jade")})(); \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/compiler.js b/usb_auth/node_modules/jade/lib/compiler.js new file mode 100644 index 0000000..5459da8 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/compiler.js @@ -0,0 +1,503 @@ + +/*! + * Jade - Compiler + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var nodes = require('./nodes') + , filters = require('./filters') + , doctypes = require('./doctypes') + , selfClosing = require('./self-closing') + , inlineTags = require('./inline-tags') + , utils = require('./utils'); + +// if browser +// +// if (!Object.keys) { +// Object.keys = function(obj){ +// var arr = []; +// for (var key in obj) { +// if (obj.hasOwnProperty(key)) { +// arr.push(key); +// } +// } +// return arr; +// } +// } +// +// if (!String.prototype.trimLeft) { +// String.prototype.trimLeft = function(){ +// return this.replace(/^\s+/, ''); +// } +// } +// +// end + + +/** + * Initialize `Compiler` with the given `node`. + * + * @param {Node} node + * @param {Object} options + * @api public + */ + +var Compiler = module.exports = function Compiler(node, options) { + this.options = options = options || {}; + this.node = node; + this.hasCompiledDoctype = false; + this.hasCompiledTag = false; + this.pp = options.pretty || false; + this.debug = false !== options.compileDebug; + this.indents = 0; + if (options.doctype) this.setDoctype(options.doctype); +}; + +/** + * Compiler prototype. + */ + +Compiler.prototype = { + + /** + * Compile parse tree to JavaScript. + * + * @api public + */ + + compile: function(){ + this.buf = ['var interp;']; + this.lastBufferedIdx = -1 + this.visit(this.node); + return this.buf.join('\n'); + }, + + /** + * Sets the default doctype `name`. Sets terse mode to `true` when + * html 5 is used, causing self-closing tags to end with ">" vs "/>", + * and boolean attributes are not mirrored. + * + * @param {string} name + * @api public + */ + + setDoctype: function(name){ + var doctype = doctypes[(name || 'default').toLowerCase()]; + doctype = doctype || ''; + this.doctype = doctype; + this.terse = '5' == name || 'html' == name; + this.xml = 0 == this.doctype.indexOf('" vs "/>", + * and boolean attributes are not mirrored. + * + * @param {Doctype} doctype + * @api public + */ + + visitDoctype: function(doctype){ + if (doctype && (doctype.val || !this.doctype)) { + this.setDoctype(doctype.val || 'default'); + } + + if (this.doctype) this.buffer(this.doctype); + this.hasCompiledDoctype = true; + }, + + /** + * Visit `mixin`, generating a function that + * may be called within the template. + * + * @param {Mixin} mixin + * @api public + */ + + visitMixin: function(mixin){ + var name = mixin.name.replace(/-/g, '_') + '_mixin' + , args = mixin.args || ''; + + if (mixin.block) { + this.buf.push('var ' + name + ' = function(' + args + '){'); + this.visit(mixin.block); + this.buf.push('}'); + } else { + this.buf.push(name + '(' + args + ');'); + } + }, + + /** + * Visit `tag` buffering tag markup, generating + * attributes, visiting the `tag`'s code and block. + * + * @param {Tag} tag + * @api public + */ + + visitTag: function(tag){ + this.indents++; + var name = tag.name; + + if (!this.hasCompiledTag) { + if (!this.hasCompiledDoctype && 'html' == name) { + this.visitDoctype(); + } + this.hasCompiledTag = true; + } + + // pretty print + if (this.pp && inlineTags.indexOf(name) == -1) { + this.buffer('\\n' + Array(this.indents).join(' ')); + } + + if (~selfClosing.indexOf(name) && !this.xml) { + this.buffer('<' + name); + this.visitAttributes(tag.attrs); + this.terse + ? this.buffer('>') + : this.buffer('/>'); + } else { + // Optimize attributes buffering + if (tag.attrs.length) { + this.buffer('<' + name); + if (tag.attrs.length) this.visitAttributes(tag.attrs); + this.buffer('>'); + } else { + this.buffer('<' + name + '>'); + } + if (tag.code) this.visitCode(tag.code); + if (tag.text) this.buffer(utils.text(tag.text.nodes[0].trimLeft())); + this.escape = 'pre' == tag.name; + this.visit(tag.block); + + // pretty print + if (this.pp && !~inlineTags.indexOf(name) && !tag.textOnly) { + this.buffer('\\n' + Array(this.indents).join(' ')); + } + + this.buffer(''); + } + this.indents--; + }, + + /** + * Visit `filter`, throwing when the filter does not exist. + * + * @param {Filter} filter + * @api public + */ + + visitFilter: function(filter){ + var fn = filters[filter.name]; + + // unknown filter + if (!fn) { + if (filter.isASTFilter) { + throw new Error('unknown ast filter "' + filter.name + ':"'); + } else { + throw new Error('unknown filter ":' + filter.name + '"'); + } + } + if (filter.isASTFilter) { + this.buf.push(fn(filter.block, this, filter.attrs)); + } else { + var text = filter.block.nodes.join(''); + filter.attrs = filter.attrs || {}; + filter.attrs.filename = this.options.filename; + this.buffer(utils.text(fn(text, filter.attrs))); + } + }, + + /** + * Visit `text` node. + * + * @param {Text} text + * @api public + */ + + visitText: function(text){ + text = utils.text(text.nodes.join('')); + if (this.escape) text = escape(text); + this.buffer(text); + this.buffer('\\n'); + }, + + /** + * Visit a `comment`, only buffering when the buffer flag is set. + * + * @param {Comment} comment + * @api public + */ + + visitComment: function(comment){ + if (!comment.buffer) return; + if (this.pp) this.buffer('\\n' + Array(this.indents + 1).join(' ')); + this.buffer(''); + }, + + /** + * Visit a `BlockComment`. + * + * @param {Comment} comment + * @api public + */ + + visitBlockComment: function(comment){ + if (!comment.buffer) return; + if (0 == comment.val.trim().indexOf('if')) { + this.buffer(''); + } else { + this.buffer(''); + } + }, + + /** + * Visit `code`, respecting buffer / escape flags. + * If the code is followed by a block, wrap it in + * a self-calling function. + * + * @param {Code} code + * @api public + */ + + visitCode: function(code){ + // Wrap code blocks with {}. + // we only wrap unbuffered code blocks ATM + // since they are usually flow control + + // Buffer code + if (code.buffer) { + var val = code.val.trimLeft(); + this.buf.push('var __val__ = ' + val); + val = 'null == __val__ ? "" : __val__'; + if (code.escape) val = 'escape(' + val + ')'; + this.buf.push("buf.push(" + val + ");"); + } else { + this.buf.push(code.val); + } + + // Block support + if (code.block) { + if (!code.buffer) this.buf.push('{'); + this.visit(code.block); + if (!code.buffer) this.buf.push('}'); + } + }, + + /** + * Visit `each` block. + * + * @param {Each} each + * @api public + */ + + visitEach: function(each){ + this.buf.push('' + + '// iterate ' + each.obj + '\n' + + '(function(){\n' + + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' + + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' + + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); + + this.visit(each.block); + + this.buf.push('' + + ' }\n' + + ' } else {\n' + + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' + // if browser + // + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' + // end + + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); + + this.visit(each.block); + + // if browser + // this.buf.push(' }\n'); + // end + + this.buf.push(' }\n }\n}).call(this);\n'); + }, + + /** + * Visit `attrs`. + * + * @param {Array} attrs + * @api public + */ + + visitAttributes: function(attrs){ + var buf = [] + , classes = []; + + if (this.terse) buf.push('terse: true'); + + attrs.forEach(function(attr){ + if (attr.name == 'class') { + classes.push('(' + attr.val + ')'); + } else { + var pair = "'" + attr.name + "':(" + attr.val + ')'; + buf.push(pair); + } + }); + + if (classes.length) { + classes = classes.join(" + ' ' + "); + buf.push("class: " + classes); + } + + buf = buf.join(', ').replace('class:', '"class":'); + + this.buf.push("buf.push(attrs({ " + buf + " }));"); + } +}; + +/** + * Escape the given string of `html`. + * + * @param {String} html + * @return {String} + * @api private + */ + +function escape(html){ + return String(html) + .replace(/&(?!\w+;)/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +} diff --git a/usb_auth/node_modules/jade/lib/doctypes.js b/usb_auth/node_modules/jade/lib/doctypes.js new file mode 100644 index 0000000..feeb560 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/doctypes.js @@ -0,0 +1,18 @@ + +/*! + * Jade - doctypes + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +module.exports = { + '5': '' + , 'xml': '' + , 'default': '' + , 'transitional': '' + , 'strict': '' + , 'frameset': '' + , '1.1': '' + , 'basic': '' + , 'mobile': '' +}; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/filters.js b/usb_auth/node_modules/jade/lib/filters.js new file mode 100644 index 0000000..a7e1bef --- /dev/null +++ b/usb_auth/node_modules/jade/lib/filters.js @@ -0,0 +1,97 @@ + +/*! + * Jade - filters + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +module.exports = { + + /** + * Wrap text with CDATA block. + */ + + cdata: function(str){ + return ''; + }, + + /** + * Transform sass to css, wrapped in style tags. + */ + + sass: function(str){ + str = str.replace(/\\n/g, '\n'); + var sass = require('sass').render(str).replace(/\n/g, '\\n'); + return ''; + }, + + /** + * Transform stylus to css, wrapped in style tags. + */ + + stylus: function(str, options){ + var ret; + str = str.replace(/\\n/g, '\n'); + var stylus = require('stylus'); + stylus(str, options).render(function(err, css){ + if (err) throw err; + ret = css.replace(/\n/g, '\\n'); + }); + return ''; + }, + + /** + * Transform less to css, wrapped in style tags. + */ + + less: function(str){ + var ret; + str = str.replace(/\\n/g, '\n'); + require('less').render(str, function(err, css){ + if (err) throw err; + ret = ''; + }); + return ret; + }, + + /** + * Transform markdown to html. + */ + + markdown: function(str){ + var md; + + // support markdown / discount + try { + md = require('markdown'); + } catch (err){ + try { + md = require('discount'); + } catch (err) { + try { + md = require('markdown-js'); + } catch (err) { + try { + md = require('marked'); + } catch (err) { + throw new + Error('Cannot find markdown library, install markdown, discount, or marked.'); + } + } + } + } + + str = str.replace(/\\n/g, '\n'); + return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); + }, + + /** + * Transform coffeescript to javascript. + */ + + coffeescript: function(str){ + str = str.replace(/\\n/g, '\n'); + var js = require('coffee-script').compile(str).replace(/\n/g, '\\n'); + return ''; + } +}; diff --git a/usb_auth/node_modules/jade/lib/index.js b/usb_auth/node_modules/jade/lib/index.js new file mode 120000 index 0000000..6a783c2 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/index.js @@ -0,0 +1 @@ +jade.js \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/inline-tags.js b/usb_auth/node_modules/jade/lib/inline-tags.js new file mode 100644 index 0000000..491de0b --- /dev/null +++ b/usb_auth/node_modules/jade/lib/inline-tags.js @@ -0,0 +1,28 @@ + +/*! + * Jade - inline tags + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +module.exports = [ + 'a' + , 'abbr' + , 'acronym' + , 'b' + , 'br' + , 'code' + , 'em' + , 'font' + , 'i' + , 'img' + , 'ins' + , 'kbd' + , 'map' + , 'samp' + , 'small' + , 'span' + , 'strong' + , 'sub' + , 'sup' +]; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/jade.js b/usb_auth/node_modules/jade/lib/jade.js new file mode 100644 index 0000000..9312cf7 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/jade.js @@ -0,0 +1,237 @@ +/*! + * Jade + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Parser = require('./parser') + , Lexer = require('./lexer') + , Compiler = require('./compiler') + , runtime = require('./runtime') +// if node + , fs = require('fs'); +// end + +/** + * Library version. + */ + +exports.version = '0.20.3'; + +/** + * Expose self closing tags. + */ + +exports.selfClosing = require('./self-closing'); + +/** + * Default supported doctypes. + */ + +exports.doctypes = require('./doctypes'); + +/** + * Text filters. + */ + +exports.filters = require('./filters'); + +/** + * Utilities. + */ + +exports.utils = require('./utils'); + +/** + * Expose `Compiler`. + */ + +exports.Compiler = Compiler; + +/** + * Expose `Parser`. + */ + +exports.Parser = Parser; + +/** + * Expose `Lexer`. + */ + +exports.Lexer = Lexer; + +/** + * Nodes. + */ + +exports.nodes = require('./nodes'); + +/** + * Jade runtime helpers. + */ + +exports.runtime = runtime; + +/** + * Template function cache. + */ + +exports.cache = {}; + +/** + * Parse the given `str` of jade and return a function body. + * + * @param {String} str + * @param {Object} options + * @return {String} + * @api private + */ + +function parse(str, options){ + try { + // Parse + var parser = new Parser(str, options.filename, options); + + // Compile + var compiler = new (options.compiler || Compiler)(parser.parse(), options) + , js = compiler.compile(); + + // Debug compiler + if (options.debug) { + console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); + } + + return '' + + 'var buf = [];\n' + + (options.self + ? 'var self = locals || {};\n' + js + : 'with (locals || {}) {\n' + js + '\n}\n') + + 'return buf.join("");'; + } catch (err) { + parser = parser.context(); + runtime.rethrow(err, parser.filename, parser.lexer.lineno); + } +} + +/** + * Compile a `Function` representation of the given jade `str`. + * + * Options: + * + * - `compileDebug` when `false` debugging code is stripped from the compiled template + * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` + * for use with the Jade client-side runtime.js + * + * @param {String} str + * @param {Options} options + * @return {Function} + * @api public + */ + +exports.compile = function(str, options){ + var options = options || {} + , client = options.client + , filename = options.filename + ? JSON.stringify(options.filename) + : 'undefined' + , fn; + + if (options.compileDebug !== false) { + fn = [ + 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' + , 'try {' + , parse(String(str), options) + , '} catch (err) {' + , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' + , '}' + ].join('\n'); + } else { + fn = parse(String(str), options); + } + + if (client) { + fn = 'var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n' + fn; + } + + fn = new Function('locals, attrs, escape, rethrow', fn); + + if (client) return fn; + + return function(locals){ + return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow); + }; +}; + +/** + * Render the given `str` of jade and invoke + * the callback `fn(err, str)`. + * + * Options: + * + * - `cache` enable template caching + * - `filename` filename required for `include` / `extends` and caching + * + * @param {String} str + * @param {Object|Function} options or fn + * @param {Function} fn + * @api public + */ + +exports.render = function(str, options, fn){ + // swap args + if ('function' == typeof options) { + fn = options, options = {}; + } + + // cache requires .filename + if (options.cache && !options.filename) { + return fn(new Error('the "filename" option is required for caching')); + } + + try { + var path = options.filename; + var tmpl = options.cache + ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) + : exports.compile(str, options); + fn(null, tmpl(options)); + } catch (err) { + fn(err); + } +}; + +/** + * Render a Jade file at the given `path` and callback `fn(err, str)`. + * + * @param {String} path + * @param {Object|Function} options or callback + * @param {Function} fn + * @api public + */ + +exports.renderFile = function(path, options, fn){ + var key = path + ':string'; + + if ('function' == typeof options) { + fn = options, options = {}; + } + + try { + options.filename = path; + var str = options.cache + ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) + : fs.readFileSync(path, 'utf8'); + exports.render(str, options, fn); + } catch (err) { + fn(err); + } +}; + +/** + * Express support. + */ + +exports.__express = exports.renderFile; diff --git a/usb_auth/node_modules/jade/lib/lexer.js b/usb_auth/node_modules/jade/lib/lexer.js new file mode 100644 index 0000000..aac94f5 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/lexer.js @@ -0,0 +1,707 @@ + +/*! + * Jade - Lexer + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Initialize `Lexer` with the given `str`. + * + * Options: + * + * - `colons` allow colons for attr delimiters + * + * @param {String} str + * @param {Object} options + * @api private + */ + +var Lexer = module.exports = function Lexer(str, options) { + options = options || {}; + this.input = str.replace(/\r\n|\r/g, '\n'); + this.colons = options.colons; + this.deferredTokens = []; + this.lastIndents = 0; + this.lineno = 1; + this.stash = []; + this.indentStack = []; + this.indentRe = null; + this.pipeless = false; +}; + +/** + * Lexer prototype. + */ + +Lexer.prototype = { + + /** + * Construct a token with the given `type` and `val`. + * + * @param {String} type + * @param {String} val + * @return {Object} + * @api private + */ + + tok: function(type, val){ + return { + type: type + , line: this.lineno + , val: val + } + }, + + /** + * Consume the given `len` of input. + * + * @param {Number} len + * @api private + */ + + consume: function(len){ + this.input = this.input.substr(len); + }, + + /** + * Scan for `type` with the given `regexp`. + * + * @param {String} type + * @param {RegExp} regexp + * @return {Object} + * @api private + */ + + scan: function(regexp, type){ + var captures; + if (captures = regexp.exec(this.input)) { + this.consume(captures[0].length); + return this.tok(type, captures[1]); + } + }, + + /** + * Defer the given `tok`. + * + * @param {Object} tok + * @api private + */ + + defer: function(tok){ + this.deferredTokens.push(tok); + }, + + /** + * Lookahead `n` tokens. + * + * @param {Number} n + * @return {Object} + * @api private + */ + + lookahead: function(n){ + var fetch = n - this.stash.length; + while (fetch-- > 0) this.stash.push(this.next()); + return this.stash[--n]; + }, + + /** + * Return the indexOf `start` / `end` delimiters. + * + * @param {String} start + * @param {String} end + * @return {Number} + * @api private + */ + + indexOfDelimiters: function(start, end){ + var str = this.input + , nstart = 0 + , nend = 0 + , pos = 0; + for (var i = 0, len = str.length; i < len; ++i) { + if (start == str[i]) { + ++nstart; + } else if (end == str[i]) { + if (++nend == nstart) { + pos = i; + break; + } + } + } + return pos; + }, + + /** + * Stashed token. + */ + + stashed: function() { + return this.stash.length + && this.stash.shift(); + }, + + /** + * Deferred token. + */ + + deferred: function() { + return this.deferredTokens.length + && this.deferredTokens.shift(); + }, + + /** + * end-of-source. + */ + + eos: function() { + if (this.input.length) return; + if (this.indentStack.length) { + this.indentStack.shift(); + return this.tok('outdent'); + } else { + return this.tok('eos'); + } + }, + + /** + * Comment. + */ + + comment: function() { + var captures; + if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { + this.consume(captures[0].length); + var tok = this.tok('comment', captures[2]); + tok.buffer = '-' != captures[1]; + return tok; + } + }, + + /** + * Tag. + */ + + tag: function() { + var captures; + if (captures = /^(\w[-:\w]*)/.exec(this.input)) { + this.consume(captures[0].length); + var tok, name = captures[1]; + if (':' == name[name.length - 1]) { + name = name.slice(0, -1); + tok = this.tok('tag', name); + this.defer(this.tok(':')); + while (' ' == this.input[0]) this.input = this.input.substr(1); + } else { + tok = this.tok('tag', name); + } + return tok; + } + }, + + /** + * Filter. + */ + + filter: function() { + return this.scan(/^:(\w+)/, 'filter'); + }, + + /** + * Doctype. + */ + + doctype: function() { + return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); + }, + + /** + * Id. + */ + + id: function() { + return this.scan(/^#([\w-]+)/, 'id'); + }, + + /** + * Class. + */ + + className: function() { + return this.scan(/^\.([\w-]+)/, 'class'); + }, + + /** + * Text. + */ + + text: function() { + return this.scan(/^(?:\| ?)?([^\n]+)/, 'text'); + }, + + /** + * Extends. + */ + + extends: function() { + return this.scan(/^extends +([^\n]+)/, 'extends'); + }, + + /** + * Block prepend. + */ + + prepend: function() { + var captures; + if (captures = /^prepend +([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var mode = 'prepend' + , name = captures[1] + , tok = this.tok('block', name); + tok.mode = mode; + return tok; + } + }, + + /** + * Block append. + */ + + append: function() { + var captures; + if (captures = /^append +([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var mode = 'append' + , name = captures[1] + , tok = this.tok('block', name); + tok.mode = mode; + return tok; + } + }, + + /** + * Block. + */ + + block: function() { + var captures; + if (captures = /^block +(?:(prepend|append) +)?([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var mode = captures[1] || 'replace' + , name = captures[2] + , tok = this.tok('block', name); + tok.mode = mode; + return tok; + } + }, + + /** + * Yield. + */ + + yield: function() { + return this.scan(/^yield */, 'yield'); + }, + + /** + * Include. + */ + + include: function() { + return this.scan(/^include +([^\n]+)/, 'include'); + }, + + /** + * Case. + */ + + case: function() { + return this.scan(/^case +([^\n]+)/, 'case'); + }, + + /** + * When. + */ + + when: function() { + return this.scan(/^when +([^:\n]+)/, 'when'); + }, + + /** + * Default. + */ + + default: function() { + return this.scan(/^default */, 'default'); + }, + + /** + * Assignment. + */ + + assignment: function() { + var captures; + if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { + this.consume(captures[0].length); + var name = captures[1] + , val = captures[2]; + return this.tok('code', 'var ' + name + ' = (' + val + ');'); + } + }, + + /** + * Mixin. + */ + + mixin: function(){ + var captures; + if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { + this.consume(captures[0].length); + var tok = this.tok('mixin', captures[1]); + tok.args = captures[2]; + return tok; + } + }, + + /** + * Conditional. + */ + + conditional: function() { + var captures; + if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { + this.consume(captures[0].length); + var type = captures[1] + , js = captures[2]; + + switch (type) { + case 'if': js = 'if (' + js + ')'; break; + case 'unless': js = 'if (!(' + js + '))'; break; + case 'else if': js = 'else if (' + js + ')'; break; + case 'else': js = 'else'; break; + } + + return this.tok('code', js); + } + }, + + /** + * While. + */ + + while: function() { + var captures; + if (captures = /^while +([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + return this.tok('code', 'while (' + captures[1] + ')'); + } + }, + + /** + * Each. + */ + + each: function() { + var captures; + if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var tok = this.tok('each', captures[1]); + tok.key = captures[2] || '$index'; + tok.code = captures[3]; + return tok; + } + }, + + /** + * Code. + */ + + code: function() { + var captures; + if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { + this.consume(captures[0].length); + var flags = captures[1]; + captures[1] = captures[2]; + var tok = this.tok('code', captures[1]); + tok.escape = flags[0] === '='; + tok.buffer = flags[0] === '=' || flags[1] === '='; + return tok; + } + }, + + /** + * Attributes. + */ + + attrs: function() { + if ('(' == this.input[0]) { + var index = this.indexOfDelimiters('(', ')') + , str = this.input.substr(1, index-1) + , tok = this.tok('attrs') + , len = str.length + , colons = this.colons + , states = ['key'] + , key = '' + , val = '' + , quote + , c; + + function state(){ + return states[states.length - 1]; + } + + function interpolate(attr) { + return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ + return quote + " + (" + expr + ") + " + quote; + }); + } + + this.consume(index + 1); + tok.attrs = {}; + + function parse(c) { + var real = c; + // TODO: remove when people fix ":" + if (colons && ':' == c) c = '='; + switch (c) { + case ',': + case '\n': + switch (state()) { + case 'expr': + case 'array': + case 'string': + case 'object': + val += c; + break; + default: + states.push('key'); + val = val.trim(); + key = key.trim(); + if ('' == key) return; + tok.attrs[key.replace(/^['"]|['"]$/g, '')] = '' == val + ? true + : interpolate(val); + key = val = ''; + } + break; + case '=': + switch (state()) { + case 'key char': + key += real; + break; + case 'val': + case 'expr': + case 'array': + case 'string': + case 'object': + val += real; + break; + default: + states.push('val'); + } + break; + case '(': + if ('val' == state() + || 'expr' == state()) states.push('expr'); + val += c; + break; + case ')': + if ('expr' == state() + || 'val' == state()) states.pop(); + val += c; + break; + case '{': + if ('val' == state()) states.push('object'); + val += c; + break; + case '}': + if ('object' == state()) states.pop(); + val += c; + break; + case '[': + if ('val' == state()) states.push('array'); + val += c; + break; + case ']': + if ('array' == state()) states.pop(); + val += c; + break; + case '"': + case "'": + switch (state()) { + case 'key': + states.push('key char'); + break; + case 'key char': + states.pop(); + break; + case 'string': + if (c == quote) states.pop(); + val += c; + break; + default: + states.push('string'); + val += c; + quote = c; + } + break; + case '': + break; + default: + switch (state()) { + case 'key': + case 'key char': + key += c; + break; + default: + val += c; + } + } + } + + for (var i = 0; i < len; ++i) { + parse(str[i]); + } + + parse(','); + + return tok; + } + }, + + /** + * Indent | Outdent | Newline. + */ + + indent: function() { + var captures, re; + + // established regexp + if (this.indentRe) { + captures = this.indentRe.exec(this.input); + // determine regexp + } else { + // tabs + re = /^\n(\t*) */; + captures = re.exec(this.input); + + // spaces + if (captures && !captures[1].length) { + re = /^\n( *)/; + captures = re.exec(this.input); + } + + // established + if (captures && captures[1].length) this.indentRe = re; + } + + if (captures) { + var tok + , indents = captures[1].length; + + ++this.lineno; + this.consume(indents + 1); + + if (' ' == this.input[0] || '\t' == this.input[0]) { + throw new Error('Invalid indentation, you can use tabs or spaces but not both'); + } + + // blank line + if ('\n' == this.input[0]) return this.tok('newline'); + + // outdent + if (this.indentStack.length && indents < this.indentStack[0]) { + while (this.indentStack.length && this.indentStack[0] > indents) { + this.stash.push(this.tok('outdent')); + this.indentStack.shift(); + } + tok = this.stash.pop(); + // indent + } else if (indents && indents != this.indentStack[0]) { + this.indentStack.unshift(indents); + tok = this.tok('indent', indents); + // newline + } else { + tok = this.tok('newline'); + } + + return tok; + } + }, + + /** + * Pipe-less text consumed only when + * pipeless is true; + */ + + pipelessText: function() { + if (this.pipeless) { + if ('\n' == this.input[0]) return; + var i = this.input.indexOf('\n'); + if (-1 == i) i = this.input.length; + var str = this.input.substr(0, i); + this.consume(str.length); + return this.tok('text', str); + } + }, + + /** + * ':' + */ + + colon: function() { + return this.scan(/^: */, ':'); + }, + + /** + * Return the next token object, or those + * previously stashed by lookahead. + * + * @return {Object} + * @api private + */ + + advance: function(){ + return this.stashed() + || this.next(); + }, + + /** + * Return the next token object. + * + * @return {Object} + * @api private + */ + + next: function() { + return this.deferred() + || this.eos() + || this.pipelessText() + || this.yield() + || this.doctype() + || this.case() + || this.when() + || this.default() + || this.extends() + || this.append() + || this.prepend() + || this.block() + || this.include() + || this.mixin() + || this.conditional() + || this.each() + || this.while() + || this.assignment() + || this.tag() + || this.filter() + || this.code() + || this.id() + || this.className() + || this.attrs() + || this.indent() + || this.comment() + || this.colon() + || this.text(); + } +}; diff --git a/usb_auth/node_modules/jade/lib/nodes/block-comment.js b/usb_auth/node_modules/jade/lib/nodes/block-comment.js new file mode 100644 index 0000000..4f41e4a --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/block-comment.js @@ -0,0 +1,33 @@ + +/*! + * Jade - nodes - BlockComment + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `BlockComment` with the given `block`. + * + * @param {String} val + * @param {Block} block + * @param {Boolean} buffer + * @api public + */ + +var BlockComment = module.exports = function BlockComment(val, block, buffer) { + this.block = block; + this.val = val; + this.buffer = buffer; +}; + +/** + * Inherit from `Node`. + */ + +BlockComment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/block.js b/usb_auth/node_modules/jade/lib/nodes/block.js new file mode 100644 index 0000000..db63c77 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/block.js @@ -0,0 +1,100 @@ + +/*! + * Jade - nodes - Block + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a new `Block` with an optional `node`. + * + * @param {Node} node + * @api public + */ + +var Block = module.exports = function Block(node){ + this.nodes = []; + if (node) this.push(node); +}; + +/** + * Inherit from `Node`. + */ + +Block.prototype.__proto__ = Node.prototype; + +/** + * Replace the nodes in `other` with the nodes + * in `this` block. + * + * @param {Block} other + * @api private + */ + +Block.prototype.replace = function(other){ + other.nodes = this.nodes; +}; + +/** + * Pust the given `node`. + * + * @param {Node} node + * @return {Number} + * @api public + */ + +Block.prototype.push = function(node){ + return this.nodes.push(node); +}; + +/** + * Check if this block is empty. + * + * @return {Boolean} + * @api public + */ + +Block.prototype.isEmpty = function(){ + return 0 == this.nodes.length; +}; + +/** + * Unshift the given `node`. + * + * @param {Node} node + * @return {Number} + * @api public + */ + +Block.prototype.unshift = function(node){ + return this.nodes.unshift(node); +}; + +/** + * Return the "last" block, or the first `yield` node. + * + * @return {Block} + * @api private + */ + +Block.prototype.includeBlock = function(){ + var ret = this + , node; + + for (var i = 0, len = this.nodes.length; i < len; ++i) { + node = this.nodes[i]; + if (node.yield) return node; + else if (node.textOnly) continue; + else if (node.includeBlock) ret = node.includeBlock(); + else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); + } + + return ret; +}; + diff --git a/usb_auth/node_modules/jade/lib/nodes/case.js b/usb_auth/node_modules/jade/lib/nodes/case.js new file mode 100644 index 0000000..08ff033 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/case.js @@ -0,0 +1,43 @@ + +/*! + * Jade - nodes - Case + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a new `Case` with `expr`. + * + * @param {String} expr + * @api public + */ + +var Case = exports = module.exports = function Case(expr, block){ + this.expr = expr; + this.block = block; +}; + +/** + * Inherit from `Node`. + */ + +Case.prototype.__proto__ = Node.prototype; + +var When = exports.When = function When(expr, block){ + this.expr = expr; + this.block = block; + this.debug = false; +}; + +/** + * Inherit from `Node`. + */ + +When.prototype.__proto__ = Node.prototype; + diff --git a/usb_auth/node_modules/jade/lib/nodes/code.js b/usb_auth/node_modules/jade/lib/nodes/code.js new file mode 100644 index 0000000..babc675 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/code.js @@ -0,0 +1,35 @@ + +/*! + * Jade - nodes - Code + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Code` node with the given code `val`. + * Code may also be optionally buffered and escaped. + * + * @param {String} val + * @param {Boolean} buffer + * @param {Boolean} escape + * @api public + */ + +var Code = module.exports = function Code(val, buffer, escape) { + this.val = val; + this.buffer = buffer; + this.escape = escape; + if (val.match(/^ *else/)) this.debug = false; +}; + +/** + * Inherit from `Node`. + */ + +Code.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/comment.js b/usb_auth/node_modules/jade/lib/nodes/comment.js new file mode 100644 index 0000000..2e1469e --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/comment.js @@ -0,0 +1,32 @@ + +/*! + * Jade - nodes - Comment + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Comment` with the given `val`, optionally `buffer`, + * otherwise the comment may render in the output. + * + * @param {String} val + * @param {Boolean} buffer + * @api public + */ + +var Comment = module.exports = function Comment(val, buffer) { + this.val = val; + this.buffer = buffer; +}; + +/** + * Inherit from `Node`. + */ + +Comment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/doctype.js b/usb_auth/node_modules/jade/lib/nodes/doctype.js new file mode 100644 index 0000000..b8f33e5 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/doctype.js @@ -0,0 +1,29 @@ + +/*! + * Jade - nodes - Doctype + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Doctype` with the given `val`. + * + * @param {String} val + * @api public + */ + +var Doctype = module.exports = function Doctype(val) { + this.val = val; +}; + +/** + * Inherit from `Node`. + */ + +Doctype.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/each.js b/usb_auth/node_modules/jade/lib/nodes/each.js new file mode 100644 index 0000000..f54101f --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/each.js @@ -0,0 +1,35 @@ + +/*! + * Jade - nodes - Each + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize an `Each` node, representing iteration + * + * @param {String} obj + * @param {String} val + * @param {String} key + * @param {Block} block + * @api public + */ + +var Each = module.exports = function Each(obj, val, key, block) { + this.obj = obj; + this.val = val; + this.key = key; + this.block = block; +}; + +/** + * Inherit from `Node`. + */ + +Each.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/filter.js b/usb_auth/node_modules/jade/lib/nodes/filter.js new file mode 100644 index 0000000..5a0a237 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/filter.js @@ -0,0 +1,35 @@ + +/*! + * Jade - nodes - Filter + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node') + , Block = require('./block'); + +/** + * Initialize a `Filter` node with the given + * filter `name` and `block`. + * + * @param {String} name + * @param {Block|Node} block + * @api public + */ + +var Filter = module.exports = function Filter(name, block, attrs) { + this.name = name; + this.block = block; + this.attrs = attrs; + this.isASTFilter = block instanceof Block; +}; + +/** + * Inherit from `Node`. + */ + +Filter.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/index.js b/usb_auth/node_modules/jade/lib/nodes/index.js new file mode 100644 index 0000000..386ad2f --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/index.js @@ -0,0 +1,20 @@ + +/*! + * Jade - nodes + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +exports.Node = require('./node'); +exports.Tag = require('./tag'); +exports.Code = require('./code'); +exports.Each = require('./each'); +exports.Case = require('./case'); +exports.Text = require('./text'); +exports.Block = require('./block'); +exports.Mixin = require('./mixin'); +exports.Filter = require('./filter'); +exports.Comment = require('./comment'); +exports.Literal = require('./literal'); +exports.BlockComment = require('./block-comment'); +exports.Doctype = require('./doctype'); diff --git a/usb_auth/node_modules/jade/lib/nodes/literal.js b/usb_auth/node_modules/jade/lib/nodes/literal.js new file mode 100644 index 0000000..3ddab65 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/literal.js @@ -0,0 +1,31 @@ + +/*! + * Jade - nodes - Literal + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Literal` node with the given `str. + * + * @param {String} str + * @api public + */ + +var Literal = module.exports = function Literal(str) { + this.str = str + .replace(/\n/g, "\\n") + .replace(/'/g, "\\'"); +}; + +/** + * Inherit from `Node`. + */ + +Literal.prototype.__proto__ = Node.prototype; diff --git a/usb_auth/node_modules/jade/lib/nodes/mixin.js b/usb_auth/node_modules/jade/lib/nodes/mixin.js new file mode 100644 index 0000000..f007c84 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/mixin.js @@ -0,0 +1,34 @@ + +/*! + * Jade - nodes - Mixin + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a new `Mixin` with `name` and `block`. + * + * @param {String} name + * @param {String} args + * @param {Block} block + * @api public + */ + +var Mixin = module.exports = function Mixin(name, args, block){ + this.name = name; + this.args = args; + this.block = block; +}; + +/** + * Inherit from `Node`. + */ + +Mixin.prototype.__proto__ = Node.prototype; + diff --git a/usb_auth/node_modules/jade/lib/nodes/node.js b/usb_auth/node_modules/jade/lib/nodes/node.js new file mode 100644 index 0000000..0669e67 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/node.js @@ -0,0 +1,14 @@ + +/*! + * Jade - nodes - Node + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Initialize a `Node`. + * + * @api public + */ + +var Node = module.exports = function Node(){}; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/tag.js b/usb_auth/node_modules/jade/lib/nodes/tag.js new file mode 100644 index 0000000..35993c9 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/tag.js @@ -0,0 +1,80 @@ + +/*! + * Jade - nodes - Tag + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'), + Block = require('./block'); + +/** + * Initialize a `Tag` node with the given tag `name` and optional `block`. + * + * @param {String} name + * @param {Block} block + * @api public + */ + +var Tag = module.exports = function Tag(name, block) { + this.name = name; + this.attrs = []; + this.block = block || new Block; +}; + +/** + * Inherit from `Node`. + */ + +Tag.prototype.__proto__ = Node.prototype; + +/** + * Set attribute `name` to `val`, keep in mind these become + * part of a raw js object literal, so to quote a value you must + * '"quote me"', otherwise or example 'user.name' is literal JavaScript. + * + * @param {String} name + * @param {String} val + * @return {Tag} for chaining + * @api public + */ + +Tag.prototype.setAttribute = function(name, val){ + this.attrs.push({ name: name, val: val }); + return this; +}; + +/** + * Remove attribute `name` when present. + * + * @param {String} name + * @api public + */ + +Tag.prototype.removeAttribute = function(name){ + for (var i = 0, len = this.attrs.length; i < len; ++i) { + if (this.attrs[i] && this.attrs[i].name == name) { + delete this.attrs[i]; + } + } +}; + +/** + * Get attribute value by `name`. + * + * @param {String} name + * @return {String} + * @api public + */ + +Tag.prototype.getAttribute = function(name){ + for (var i = 0, len = this.attrs.length; i < len; ++i) { + if (this.attrs[i] && this.attrs[i].name == name) { + return this.attrs[i].val; + } + } +}; diff --git a/usb_auth/node_modules/jade/lib/nodes/text.js b/usb_auth/node_modules/jade/lib/nodes/text.js new file mode 100644 index 0000000..3baff4b --- /dev/null +++ b/usb_auth/node_modules/jade/lib/nodes/text.js @@ -0,0 +1,42 @@ + +/*! + * Jade - nodes - Text + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Node = require('./node'); + +/** + * Initialize a `Text` node with optional `line`. + * + * @param {String} line + * @api public + */ + +var Text = module.exports = function Text(line) { + this.nodes = []; + if ('string' == typeof line) this.push(line); +}; + +/** + * Inherit from `Node`. + */ + +Text.prototype.__proto__ = Node.prototype; + +/** + * Push the given `node.` + * + * @param {Node} node + * @return {Number} + * @api public + */ + +Text.prototype.push = function(node){ + return this.nodes.push(node); +}; diff --git a/usb_auth/node_modules/jade/lib/parser.js b/usb_auth/node_modules/jade/lib/parser.js new file mode 100644 index 0000000..3dcfb57 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/parser.js @@ -0,0 +1,651 @@ + +/*! + * Jade - Parser + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var Lexer = require('./lexer') + , nodes = require('./nodes'); + +/** + * Initialize `Parser` with the given input `str` and `filename`. + * + * @param {String} str + * @param {String} filename + * @param {Object} options + * @api public + */ + +var Parser = exports = module.exports = function Parser(str, filename, options){ + this.input = str; + this.lexer = new Lexer(str, options); + this.filename = filename; + this.blocks = {}; + this.options = options; + this.contexts = [this]; +}; + +/** + * Tags that may not contain tags. + */ + +var textOnly = exports.textOnly = ['script', 'style']; + +/** + * Parser prototype. + */ + +Parser.prototype = { + + /** + * Push `parser` onto the context stack, + * or pop and return a `Parser`. + */ + + context: function(parser){ + if (parser) { + this.contexts.push(parser); + } else { + return this.contexts.pop(); + } + }, + + /** + * Return the next token object. + * + * @return {Object} + * @api private + */ + + advance: function(){ + return this.lexer.advance(); + }, + + /** + * Skip `n` tokens. + * + * @param {Number} n + * @api private + */ + + skip: function(n){ + while (n--) this.advance(); + }, + + /** + * Single token lookahead. + * + * @return {Object} + * @api private + */ + + peek: function() { + return this.lookahead(1); + }, + + /** + * Return lexer lineno. + * + * @return {Number} + * @api private + */ + + line: function() { + return this.lexer.lineno; + }, + + /** + * `n` token lookahead. + * + * @param {Number} n + * @return {Object} + * @api private + */ + + lookahead: function(n){ + return this.lexer.lookahead(n); + }, + + /** + * Parse input returning a string of js for evaluation. + * + * @return {String} + * @api public + */ + + parse: function(){ + var block = new nodes.Block, parser; + block.line = this.line(); + + while ('eos' != this.peek().type) { + if ('newline' == this.peek().type) { + this.advance(); + } else { + block.push(this.parseExpr()); + } + } + + if (parser = this.extending) { + this.context(parser); + var ast = parser.parse(); + this.context(); + return ast; + } + + return block; + }, + + /** + * Expect the given type, or throw an exception. + * + * @param {String} type + * @api private + */ + + expect: function(type){ + if (this.peek().type === type) { + return this.advance(); + } else { + throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); + } + }, + + /** + * Accept the given `type`. + * + * @param {String} type + * @api private + */ + + accept: function(type){ + if (this.peek().type === type) { + return this.advance(); + } + }, + + /** + * tag + * | doctype + * | mixin + * | include + * | filter + * | comment + * | text + * | each + * | code + * | yield + * | id + * | class + */ + + parseExpr: function(){ + switch (this.peek().type) { + case 'tag': + return this.parseTag(); + case 'mixin': + return this.parseMixin(); + case 'block': + return this.parseBlock(); + case 'case': + return this.parseCase(); + case 'when': + return this.parseWhen(); + case 'default': + return this.parseDefault(); + case 'extends': + return this.parseExtends(); + case 'include': + return this.parseInclude(); + case 'doctype': + return this.parseDoctype(); + case 'filter': + return this.parseFilter(); + case 'comment': + return this.parseComment(); + case 'text': + return this.parseText(); + case 'each': + return this.parseEach(); + case 'code': + return this.parseCode(); + case 'yield': + this.advance(); + var block = new nodes.Block; + block.yield = true; + return block; + case 'id': + case 'class': + var tok = this.advance(); + this.lexer.defer(this.lexer.tok('tag', 'div')); + this.lexer.defer(tok); + return this.parseExpr(); + default: + throw new Error('unexpected token "' + this.peek().type + '"'); + } + }, + + /** + * Text + */ + + parseText: function(){ + var tok = this.expect('text') + , node = new nodes.Text(tok.val); + node.line = this.line(); + return node; + }, + + /** + * ':' expr + * | block + */ + + parseBlockExpansion: function(){ + if (':' == this.peek().type) { + this.advance(); + return new nodes.Block(this.parseExpr()); + } else { + return this.block(); + } + }, + + /** + * case + */ + + parseCase: function(){ + var val = this.expect('case').val + , node = new nodes.Case(val); + node.line = this.line(); + node.block = this.block(); + return node; + }, + + /** + * when + */ + + parseWhen: function(){ + var val = this.expect('when').val + return new nodes.Case.When(val, this.parseBlockExpansion()); + }, + + /** + * default + */ + + parseDefault: function(){ + this.expect('default'); + return new nodes.Case.When('default', this.parseBlockExpansion()); + }, + + /** + * code + */ + + parseCode: function(){ + var tok = this.expect('code') + , node = new nodes.Code(tok.val, tok.buffer, tok.escape) + , block + , i = 1; + node.line = this.line(); + while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; + block = 'indent' == this.lookahead(i).type; + if (block) { + this.skip(i-1); + node.block = this.block(); + } + return node; + }, + + /** + * comment + */ + + parseComment: function(){ + var tok = this.expect('comment') + , node; + + if ('indent' == this.peek().type) { + node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); + } else { + node = new nodes.Comment(tok.val, tok.buffer); + } + + node.line = this.line(); + return node; + }, + + /** + * doctype + */ + + parseDoctype: function(){ + var tok = this.expect('doctype') + , node = new nodes.Doctype(tok.val); + node.line = this.line(); + return node; + }, + + /** + * filter attrs? text-block + */ + + parseFilter: function(){ + var block + , tok = this.expect('filter') + , attrs = this.accept('attrs'); + + this.lexer.pipeless = true; + block = this.parseTextBlock(); + this.lexer.pipeless = false; + + var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); + node.line = this.line(); + return node; + }, + + /** + * tag ':' attrs? block + */ + + parseASTFilter: function(){ + var block + , tok = this.expect('tag') + , attrs = this.accept('attrs'); + + this.expect(':'); + block = this.block(); + + var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); + node.line = this.line(); + return node; + }, + + /** + * each block + */ + + parseEach: function(){ + var tok = this.expect('each') + , node = new nodes.Each(tok.code, tok.val, tok.key); + node.line = this.line(); + node.block = this.block(); + return node; + }, + + /** + * 'extends' name + */ + + parseExtends: function(){ + var path = require('path') + , fs = require('fs') + , dirname = path.dirname + , basename = path.basename + , join = path.join; + + if (!this.filename) + throw new Error('the "filename" option is required to extend templates'); + + var path = this.expect('extends').val.trim() + , dir = dirname(this.filename); + + var path = join(dir, path + '.jade') + , str = fs.readFileSync(path, 'utf8') + , parser = new Parser(str, path, this.options); + + parser.blocks = this.blocks; + parser.contexts = this.contexts; + this.extending = parser; + + // TODO: null node + return new nodes.Literal(''); + }, + + /** + * 'block' name block + */ + + parseBlock: function(){ + var block = this.expect('block') + , mode = block.mode + , name = block.val.trim(); + + block = 'indent' == this.peek().type + ? this.block() + : new nodes.Block(new nodes.Literal('')); + + var prev = this.blocks[name]; + + if (prev) { + switch (prev.mode) { + case 'append': + block.nodes = block.nodes.concat(prev.nodes); + prev = block; + break; + case 'prepend': + block.nodes = prev.nodes.concat(block.nodes); + prev = block; + break; + } + } + + block.mode = mode; + return this.blocks[name] = prev || block; + }, + + /** + * include block? + */ + + parseInclude: function(){ + var path = require('path') + , fs = require('fs') + , dirname = path.dirname + , basename = path.basename + , join = path.join; + + var path = this.expect('include').val.trim() + , dir = dirname(this.filename); + + if (!this.filename) + throw new Error('the "filename" option is required to use includes'); + + // no extension + if (!~basename(path).indexOf('.')) { + path += '.jade'; + } + + // non-jade + if ('.jade' != path.substr(-5)) { + var path = join(dir, path) + , str = fs.readFileSync(path, 'utf8'); + return new nodes.Literal(str); + } + + var path = join(dir, path) + , str = fs.readFileSync(path, 'utf8') + , parser = new Parser(str, path, this.options); + + this.context(parser); + var ast = parser.parse(); + this.context(); + ast.filename = path; + + if ('indent' == this.peek().type) { + ast.includeBlock().push(this.block()); + } + + return ast; + }, + + /** + * mixin block + */ + + parseMixin: function(){ + var tok = this.expect('mixin') + , name = tok.val + , args = tok.args; + var block = 'indent' == this.peek().type + ? this.block() + : null; + return new nodes.Mixin(name, args, block); + }, + + /** + * indent (text | newline)* outdent + */ + + parseTextBlock: function(){ + var text = new nodes.Text; + text.line = this.line(); + var spaces = this.expect('indent').val; + if (null == this._spaces) this._spaces = spaces; + var indent = Array(spaces - this._spaces + 1).join(' '); + while ('outdent' != this.peek().type) { + switch (this.peek().type) { + case 'newline': + text.push('\\n'); + this.advance(); + break; + case 'indent': + text.push('\\n'); + this.parseTextBlock().nodes.forEach(function(node){ + text.push(node); + }); + text.push('\\n'); + break; + default: + text.push(indent + this.advance().val); + } + } + + if (spaces == this._spaces) this._spaces = null; + this.expect('outdent'); + return text; + }, + + /** + * indent expr* outdent + */ + + block: function(){ + var block = new nodes.Block; + block.line = this.line(); + this.expect('indent'); + while ('outdent' != this.peek().type) { + if ('newline' == this.peek().type) { + this.advance(); + } else { + block.push(this.parseExpr()); + } + } + this.expect('outdent'); + return block; + }, + + /** + * tag (attrs | class | id)* (text | code | ':')? newline* block? + */ + + parseTag: function(){ + // ast-filter look-ahead + var i = 2; + if ('attrs' == this.lookahead(i).type) ++i; + if (':' == this.lookahead(i).type) { + if ('indent' == this.lookahead(++i).type) { + return this.parseASTFilter(); + } + } + + var name = this.advance().val + , tag = new nodes.Tag(name) + , dot; + + tag.line = this.line(); + + // (attrs | class | id)* + out: + while (true) { + switch (this.peek().type) { + case 'id': + case 'class': + var tok = this.advance(); + tag.setAttribute(tok.type, "'" + tok.val + "'"); + continue; + case 'attrs': + var obj = this.advance().attrs + , names = Object.keys(obj); + for (var i = 0, len = names.length; i < len; ++i) { + var name = names[i] + , val = obj[name]; + tag.setAttribute(name, val); + } + continue; + default: + break out; + } + } + + // check immediate '.' + if ('.' == this.peek().val) { + dot = tag.textOnly = true; + this.advance(); + } + + // (text | code | ':')? + switch (this.peek().type) { + case 'text': + tag.text = this.parseText(); + break; + case 'code': + tag.code = this.parseCode(); + break; + case ':': + this.advance(); + tag.block = new nodes.Block; + tag.block.push(this.parseTag()); + break; + } + + // newline* + while ('newline' == this.peek().type) this.advance(); + + tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); + + // script special-case + if ('script' == tag.name) { + var type = tag.getAttribute('type'); + if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { + tag.textOnly = false; + } + } + + // block? + if ('indent' == this.peek().type) { + if (tag.textOnly) { + this.lexer.pipeless = true; + tag.block = this.parseTextBlock(); + this.lexer.pipeless = false; + } else { + var block = this.block(); + if (tag.block) { + for (var i = 0, len = block.nodes.length; i < len; ++i) { + tag.block.push(block.nodes[i]); + } + } else { + tag.block = block; + } + } + } + + return tag; + } +}; diff --git a/usb_auth/node_modules/jade/lib/runtime.js b/usb_auth/node_modules/jade/lib/runtime.js new file mode 100644 index 0000000..7b357ca --- /dev/null +++ b/usb_auth/node_modules/jade/lib/runtime.js @@ -0,0 +1,118 @@ + +/*! + * Jade - runtime + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Lame Array.isArray() polyfill for now. + */ + +if (!Array.isArray) { + Array.isArray = function(arr){ + return '[object Array]' == Object.prototype.toString.call(arr); + }; +} + +/** + * Lame Object.keys() polyfill for now. + */ + +if (!Object.keys) { + Object.keys = function(obj){ + var arr = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + arr.push(key); + } + } + return arr; + } +} + +/** + * Render the given attributes object. + * + * @param {Object} obj + * @return {String} + * @api private + */ + +exports.attrs = function attrs(obj){ + var buf = [] + , terse = obj.terse; + delete obj.terse; + var keys = Object.keys(obj) + , len = keys.length; + if (len) { + buf.push(''); + for (var i = 0; i < len; ++i) { + var key = keys[i] + , val = obj[key]; + if ('boolean' == typeof val || null == val) { + if (val) { + terse + ? buf.push(key) + : buf.push(key + '="' + key + '"'); + } + } else if ('class' == key && Array.isArray(val)) { + buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); + } else { + buf.push(key + '="' + exports.escape(val) + '"'); + } + } + } + return buf.join(' '); +}; + +/** + * Escape the given string of `html`. + * + * @param {String} html + * @return {String} + * @api private + */ + +exports.escape = function escape(html){ + return String(html) + .replace(/&(?!\w+;)/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +}; + +/** + * Re-throw the given `err` in context to the + * the jade in `filename` at the given `lineno`. + * + * @param {Error} err + * @param {String} filename + * @param {String} lineno + * @api private + */ + +exports.rethrow = function rethrow(err, filename, lineno){ + if (!filename) throw err; + + var context = 3 + , str = require('fs').readFileSync(filename, 'utf8') + , lines = str.split('\n') + , start = Math.max(lineno - context, 0) + , end = Math.min(lines.length, lineno + context); + + // Error context + var context = lines.slice(start, end).map(function(line, i){ + var curr = i + start + 1; + return (curr == lineno ? ' > ' : ' ') + + curr + + '| ' + + line; + }).join('\n'); + + // Alter exception message + err.path = filename; + err.message = (filename || 'Jade') + ':' + lineno + + '\n' + context + '\n\n' + err.message; + throw err; +}; diff --git a/usb_auth/node_modules/jade/lib/self-closing.js b/usb_auth/node_modules/jade/lib/self-closing.js new file mode 100644 index 0000000..293e7f8 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/self-closing.js @@ -0,0 +1,18 @@ + +/*! + * Jade - self closing tags + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +module.exports = [ + 'meta' + , 'img' + , 'link' + , 'input' + , 'area' + , 'base' + , 'col' + , 'br' + , 'hr' +]; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/utils.js b/usb_auth/node_modules/jade/lib/utils.js new file mode 100644 index 0000000..ff46d02 --- /dev/null +++ b/usb_auth/node_modules/jade/lib/utils.js @@ -0,0 +1,49 @@ + +/*! + * Jade - utils + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Convert interpolation in the given string to JavaScript. + * + * @param {String} str + * @return {String} + * @api private + */ + +var interpolate = exports.interpolate = function(str){ + return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ + return escape + ? str + : "' + " + + ('!' == flag ? '' : 'escape') + + "((interp = " + code.replace(/\\'/g, "'") + + ") == null ? '' : interp) + '"; + }); +}; + +/** + * Escape single quotes in `str`. + * + * @param {String} str + * @return {String} + * @api private + */ + +var escape = exports.escape = function(str) { + return str.replace(/'/g, "\\'"); +}; + +/** + * Interpolate, and escape the given `str`. + * + * @param {String} str + * @return {String} + * @api private + */ + +exports.text = function(str){ + return interpolate(escape(str)); +}; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/commander/.npmignore b/usb_auth/node_modules/jade/node_modules/commander/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/commander/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/usb_auth/node_modules/jade/node_modules/commander/.travis.yml b/usb_auth/node_modules/jade/node_modules/commander/.travis.yml new file mode 100644 index 0000000..f1d0f13 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/commander/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/usb_auth/node_modules/jade/node_modules/commander/History.md b/usb_auth/node_modules/jade/node_modules/commander/History.md new file mode 100644 index 0000000..66c6894 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/commander/History.md @@ -0,0 +1,99 @@ + +0.5.2 / 2012-01-17 +================== + + * Added support for 0.7.x + +0.5.1 / 2011-12-20 +================== + + * Fixed `password()` for recent nodes. Closes #36 + +0.5.0 / 2011-12-04 +================== + + * Added sub-command option support [itay] + +0.4.3 / 2011-12-04 +================== + + * Fixed custom help ordering. Closes #32 + +0.4.2 / 2011-11-24 +================== + + * Added travis support + * Fixed: line-buffered input automatically trimmed. Closes #31 + +0.4.1 / 2011-11-18 +================== + + * Removed listening for "close" on --help + +0.4.0 / 2011-11-15 +================== + + * Added support for `--`. Closes #24 + +0.3.3 / 2011-11-14 +================== + + * Fixed: wait for close event when writing help info [Jerry Hamlet] + +0.3.2 / 2011-11-01 +================== + + * Fixed long flag definitions with values [felixge] + +0.3.1 / 2011-10-31 +================== + + * Changed `--version` short flag to `-V` from `-v` + * Changed `.version()` so it's configurable [felixge] + +0.3.0 / 2011-10-31 +================== + + * Added support for long flags only. Closes #18 + +0.2.1 / 2011-10-24 +================== + + * "node": ">= 0.4.x < 0.7.0". Closes #20 + +0.2.0 / 2011-09-26 +================== + + * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] + +0.1.0 / 2011-08-24 +================== + + * Added support for custom `--help` output + +0.0.5 / 2011-08-18 +================== + + * Changed: when the user enters nothing prompt for password again + * Fixed issue with passwords beginning with numbers [NuckChorris] + +0.0.4 / 2011-08-15 +================== + + * Fixed `Commander#args` + +0.0.3 / 2011-08-15 +================== + + * Added default option value support + +0.0.2 / 2011-08-15 +================== + + * Added mask support to `Command#password(str[, mask], fn)` + * Added `Command#password(str, fn)` + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/usb_auth/node_modules/jade/node_modules/commander/Makefile b/usb_auth/node_modules/jade/node_modules/commander/Makefile new file mode 100644 index 0000000..0074625 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/commander/Makefile @@ -0,0 +1,7 @@ + +TESTS = $(shell find test/test.*.js) + +test: + @./test/run $(TESTS) + +.PHONY: test \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/commander/Readme.md b/usb_auth/node_modules/jade/node_modules/commander/Readme.md new file mode 100644 index 0000000..2efbe7a --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/commander/Readme.md @@ -0,0 +1,263 @@ + +# Commander.js + + The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). + + [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) + +## Installation + + $ npm install commander + +## Option parsing + + Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .version('0.0.1') + .option('-p, --peppers', 'Add peppers') + .option('-P, --pineapple', 'Add pineapple') + .option('-b, --bbq', 'Add bbq sauce') + .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') + .parse(process.argv); + +console.log('you ordered a pizza with:'); +if (program.peppers) console.log(' - peppers'); +if (program.pineapple) console.log(' - pineappe'); +if (program.bbq) console.log(' - bbq'); +console.log(' - %s cheese', program.cheese); +``` + + Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. + +## Automated --help + + The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: + +``` + $ ./examples/pizza --help + + Usage: pizza [options] + + Options: + + -v, --version output the version number + -p, --peppers Add peppers + -P, --pineapple Add pineappe + -b, --bbq Add bbq sauce + -c, --cheese Add the specified type of cheese [marble] + -h, --help output usage information + +``` + +## Coercion + +```js +function range(val) { + return val.split('..').map(Number); +} + +function list(val) { + return val.split(','); +} + +program + .version('0.0.1') + .usage('[options] ') + .option('-i, --integer ', 'An integer argument', parseInt) + .option('-f, --float ', 'A float argument', parseFloat) + .option('-r, --range ..', 'A range', range) + .option('-l, --list ', 'A list', list) + .option('-o, --optional [value]', 'An optional value') + .parse(process.argv); + +console.log(' int: %j', program.integer); +console.log(' float: %j', program.float); +console.log(' optional: %j', program.optional); +program.range = program.range || []; +console.log(' range: %j..%j', program.range[0], program.range[1]); +console.log(' list: %j', program.list); +console.log(' args: %j', program.args); +``` + +## Custom help + + You can display arbitrary `-h, --help` information + by listening for "--help". Commander will automatically + exit once you are done so that the remainder of your program + does not execute causing undesired behaviours, for example + in the following executable "stuff" will not output when + `--help` is used. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('../'); + +function list(val) { + return val.split(',').map(Number); +} + +program + .version('0.0.1') + .option('-f, --foo', 'enable some foo') + .option('-b, --bar', 'enable some bar') + .option('-B, --baz', 'enable some baz'); + +// must be before .parse() since +// node's emit() is immediate + +program.on('--help', function(){ + console.log(' Examples:'); + console.log(''); + console.log(' $ custom-help --help'); + console.log(' $ custom-help -h'); + console.log(''); +}); + +program.parse(process.argv); + +console.log('stuff'); +``` + +yielding the following help output: + +``` + +Usage: custom-help [options] + +Options: + + -h, --help output usage information + -v, --version output the version number + -f, --foo enable some foo + -b, --bar enable some bar + -B, --baz enable some baz + +Examples: + + $ custom-help --help + $ custom-help -h + +``` + +## .prompt(msg, fn) + + Single-line prompt: + +```js +program.prompt('name: ', function(name){ + console.log('hi %s', name); +}); +``` + + Multi-line prompt: + +```js +program.prompt('description:', function(name){ + console.log('hi %s', name); +}); +``` + + Coercion: + +```js +program.prompt('Age: ', Number, function(age){ + console.log('age: %j', age); +}); +``` + +```js +program.prompt('Birthdate: ', Date, function(date){ + console.log('date: %s', date); +}); +``` + +## .password(msg[, mask], fn) + +Prompt for password without echoing: + +```js +program.password('Password: ', function(pass){ + console.log('got "%s"', pass); + process.stdin.destroy(); +}); +``` + +Prompt for password with mask char "*": + +```js +program.password('Password: ', '*', function(pass){ + console.log('got "%s"', pass); + process.stdin.destroy(); +}); +``` + +## .confirm(msg, fn) + + Confirm with the given `msg`: + +```js +program.confirm('continue? ', function(ok){ + console.log(' got %j', ok); +}); +``` + +## .choose(list, fn) + + Let the user choose from a `list`: + +```js +var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; + +console.log('Choose the coolest pet:'); +program.choose(list, function(i){ + console.log('you chose %d "%s"', i, list[i]); +}); +``` + +## Links + + - [API documentation](http://visionmedia.github.com/commander.js/) + - [ascii tables](https://github.com/LearnBoost/cli-table) + - [progress bars](https://github.com/visionmedia/node-progress) + - [more progress bars](https://github.com/substack/node-multimeter) + - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) + +## License + +(The MIT License) + +Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/commander/index.js b/usb_auth/node_modules/jade/node_modules/commander/index.js new file mode 100644 index 0000000..06ec1e4 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/commander/index.js @@ -0,0 +1,2 @@ + +module.exports = require('./lib/commander'); \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/commander/lib/commander.js b/usb_auth/node_modules/jade/node_modules/commander/lib/commander.js new file mode 100644 index 0000000..b9cbd5d --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/commander/lib/commander.js @@ -0,0 +1,992 @@ + +/*! + * commander + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var EventEmitter = require('events').EventEmitter + , path = require('path') + , tty = require('tty') + , basename = path.basename; + +/** + * Expose the root command. + */ + +exports = module.exports = new Command; + +/** + * Expose `Command`. + */ + +exports.Command = Command; + +/** + * Expose `Option`. + */ + +exports.Option = Option; + +/** + * Initialize a new `Option` with the given `flags` and `description`. + * + * @param {String} flags + * @param {String} description + * @api public + */ + +function Option(flags, description) { + this.flags = flags; + this.required = ~flags.indexOf('<'); + this.optional = ~flags.indexOf('['); + this.bool = !~flags.indexOf('-no-'); + flags = flags.split(/[ ,|]+/); + if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); + this.long = flags.shift(); + this.description = description; +} + +/** + * Return option name. + * + * @return {String} + * @api private + */ + +Option.prototype.name = function(){ + return this.long + .replace('--', '') + .replace('no-', ''); +}; + +/** + * Check if `arg` matches the short or long flag. + * + * @param {String} arg + * @return {Boolean} + * @api private + */ + +Option.prototype.is = function(arg){ + return arg == this.short + || arg == this.long; +}; + +/** + * Initialize a new `Command`. + * + * @param {String} name + * @api public + */ + +function Command(name) { + this.commands = []; + this.options = []; + this.args = []; + this.name = name; +} + +/** + * Inherit from `EventEmitter.prototype`. + */ + +Command.prototype.__proto__ = EventEmitter.prototype; + +/** + * Add command `name`. + * + * The `.action()` callback is invoked when the + * command `name` is specified via __ARGV__, + * and the remaining arguments are applied to the + * function for access. + * + * When the `name` is "*" an un-matched command + * will be passed as the first arg, followed by + * the rest of __ARGV__ remaining. + * + * Examples: + * + * program + * .version('0.0.1') + * .option('-C, --chdir ', 'change the working directory') + * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') + * .option('-T, --no-tests', 'ignore test hook') + * + * program + * .command('setup') + * .description('run remote setup commands') + * .action(function(){ + * console.log('setup'); + * }); + * + * program + * .command('exec ') + * .description('run the given remote command') + * .action(function(cmd){ + * console.log('exec "%s"', cmd); + * }); + * + * program + * .command('*') + * .description('deploy the given env') + * .action(function(env){ + * console.log('deploying "%s"', env); + * }); + * + * program.parse(process.argv); + * + * @param {String} name + * @return {Command} the new command + * @api public + */ + +Command.prototype.command = function(name){ + var args = name.split(/ +/); + var cmd = new Command(args.shift()); + this.commands.push(cmd); + cmd.parseExpectedArgs(args); + cmd.parent = this; + return cmd; +}; + +/** + * Parse expected `args`. + * + * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. + * + * @param {Array} args + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parseExpectedArgs = function(args){ + if (!args.length) return; + var self = this; + args.forEach(function(arg){ + switch (arg[0]) { + case '<': + self.args.push({ required: true, name: arg.slice(1, -1) }); + break; + case '[': + self.args.push({ required: false, name: arg.slice(1, -1) }); + break; + } + }); + return this; +}; + +/** + * Register callback `fn` for the command. + * + * Examples: + * + * program + * .command('help') + * .description('display verbose help') + * .action(function(){ + * // output help here + * }); + * + * @param {Function} fn + * @return {Command} for chaining + * @api public + */ + +Command.prototype.action = function(fn){ + var self = this; + this.parent.on(this.name, function(args, unknown){ + // Parse any so-far unknown options + unknown = unknown || []; + var parsed = self.parseOptions(unknown); + + // Output help if necessary + outputHelpIfNecessary(self, parsed.unknown); + + // If there are still any unknown options, then we simply + // die, unless someone asked for help, in which case we give it + // to them, and then we die. + if (parsed.unknown.length > 0) { + self.unknownOption(parsed.unknown[0]); + } + + self.args.forEach(function(arg, i){ + if (arg.required && null == args[i]) { + self.missingArgument(arg.name); + } + }); + + // Always append ourselves to the end of the arguments, + // to make sure we match the number of arguments the user + // expects + if (self.args.length) { + args[self.args.length] = self; + } else { + args.push(self); + } + + fn.apply(this, args); + }); + return this; +}; + +/** + * Define option with `flags`, `description` and optional + * coercion `fn`. + * + * The `flags` string should contain both the short and long flags, + * separated by comma, a pipe or space. The following are all valid + * all will output this way when `--help` is used. + * + * "-p, --pepper" + * "-p|--pepper" + * "-p --pepper" + * + * Examples: + * + * // simple boolean defaulting to false + * program.option('-p, --pepper', 'add pepper'); + * + * --pepper + * program.pepper + * // => Boolean + * + * // simple boolean defaulting to false + * program.option('-C, --no-cheese', 'remove cheese'); + * + * program.cheese + * // => true + * + * --no-cheese + * program.cheese + * // => true + * + * // required argument + * program.option('-C, --chdir ', 'change the working directory'); + * + * --chdir /tmp + * program.chdir + * // => "/tmp" + * + * // optional argument + * program.option('-c, --cheese [type]', 'add cheese [marble]'); + * + * @param {String} flags + * @param {String} description + * @param {Function|Mixed} fn or default + * @param {Mixed} defaultValue + * @return {Command} for chaining + * @api public + */ + +Command.prototype.option = function(flags, description, fn, defaultValue){ + var self = this + , option = new Option(flags, description) + , oname = option.name() + , name = camelcase(oname); + + // default as 3rd arg + if ('function' != typeof fn) defaultValue = fn, fn = null; + + // preassign default value only for --no-*, [optional], or + if (false == option.bool || option.optional || option.required) { + // when --no-* we make sure default is true + if (false == option.bool) defaultValue = true; + // preassign only if we have a default + if (undefined !== defaultValue) self[name] = defaultValue; + } + + // register the option + this.options.push(option); + + // when it's passed assign the value + // and conditionally invoke the callback + this.on(oname, function(val){ + // coercion + if (null != val && fn) val = fn(val); + + // unassigned or bool + if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { + // if no value, bool true, and we have a default, then use it! + if (null == val) { + self[name] = option.bool + ? defaultValue || true + : false; + } else { + self[name] = val; + } + } else if (null !== val) { + // reassign + self[name] = val; + } + }); + + return this; +}; + +/** + * Parse `argv`, settings options and invoking commands when defined. + * + * @param {Array} argv + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parse = function(argv){ + // store raw args + this.rawArgs = argv; + + // guess name + if (!this.name) this.name = basename(argv[1]); + + // process argv + var parsed = this.parseOptions(this.normalize(argv.slice(2))); + this.args = parsed.args; + return this.parseArgs(this.args, parsed.unknown); +}; + +/** + * Normalize `args`, splitting joined short flags. For example + * the arg "-abc" is equivalent to "-a -b -c". + * + * @param {Array} args + * @return {Array} + * @api private + */ + +Command.prototype.normalize = function(args){ + var ret = [] + , arg; + + for (var i = 0, len = args.length; i < len; ++i) { + arg = args[i]; + if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { + arg.slice(1).split('').forEach(function(c){ + ret.push('-' + c); + }); + } else { + ret.push(arg); + } + } + + return ret; +}; + +/** + * Parse command `args`. + * + * When listener(s) are available those + * callbacks are invoked, otherwise the "*" + * event is emitted and those actions are invoked. + * + * @param {Array} args + * @return {Command} for chaining + * @api private + */ + +Command.prototype.parseArgs = function(args, unknown){ + var cmds = this.commands + , len = cmds.length + , name; + + if (args.length) { + name = args[0]; + if (this.listeners(name).length) { + this.emit(args.shift(), args, unknown); + } else { + this.emit('*', args); + } + } else { + outputHelpIfNecessary(this, unknown); + + // If there were no args and we have unknown options, + // then they are extraneous and we need to error. + if (unknown.length > 0) { + this.unknownOption(unknown[0]); + } + } + + return this; +}; + +/** + * Return an option matching `arg` if any. + * + * @param {String} arg + * @return {Option} + * @api private + */ + +Command.prototype.optionFor = function(arg){ + for (var i = 0, len = this.options.length; i < len; ++i) { + if (this.options[i].is(arg)) { + return this.options[i]; + } + } +}; + +/** + * Parse options from `argv` returning `argv` + * void of these options. + * + * @param {Array} argv + * @return {Array} + * @api public + */ + +Command.prototype.parseOptions = function(argv){ + var args = [] + , len = argv.length + , literal + , option + , arg; + + var unknownOptions = []; + + // parse options + for (var i = 0; i < len; ++i) { + arg = argv[i]; + + // literal args after -- + if ('--' == arg) { + literal = true; + continue; + } + + if (literal) { + args.push(arg); + continue; + } + + // find matching Option + option = this.optionFor(arg); + + // option is defined + if (option) { + // requires arg + if (option.required) { + arg = argv[++i]; + if (null == arg) return this.optionMissingArgument(option); + if ('-' == arg[0]) return this.optionMissingArgument(option, arg); + this.emit(option.name(), arg); + // optional arg + } else if (option.optional) { + arg = argv[i+1]; + if (null == arg || '-' == arg[0]) { + arg = null; + } else { + ++i; + } + this.emit(option.name(), arg); + // bool + } else { + this.emit(option.name()); + } + continue; + } + + // looks like an option + if (arg.length > 1 && '-' == arg[0]) { + unknownOptions.push(arg); + + // If the next argument looks like it might be + // an argument for this option, we pass it on. + // If it isn't, then it'll simply be ignored + if (argv[i+1] && '-' != argv[i+1][0]) { + unknownOptions.push(argv[++i]); + } + continue; + } + + // arg + args.push(arg); + } + + return { args: args, unknown: unknownOptions }; +}; + +/** + * Argument `name` is missing. + * + * @param {String} name + * @api private + */ + +Command.prototype.missingArgument = function(name){ + console.error(); + console.error(" error: missing required argument `%s'", name); + console.error(); + process.exit(1); +}; + +/** + * `Option` is missing an argument, but received `flag` or nothing. + * + * @param {String} option + * @param {String} flag + * @api private + */ + +Command.prototype.optionMissingArgument = function(option, flag){ + console.error(); + if (flag) { + console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); + } else { + console.error(" error: option `%s' argument missing", option.flags); + } + console.error(); + process.exit(1); +}; + +/** + * Unknown option `flag`. + * + * @param {String} flag + * @api private + */ + +Command.prototype.unknownOption = function(flag){ + console.error(); + console.error(" error: unknown option `%s'", flag); + console.error(); + process.exit(1); +}; + +/** + * Set the program version to `str`. + * + * This method auto-registers the "-V, --version" flag + * which will print the version number when passed. + * + * @param {String} str + * @param {String} flags + * @return {Command} for chaining + * @api public + */ + +Command.prototype.version = function(str, flags){ + if (0 == arguments.length) return this._version; + this._version = str; + flags = flags || '-V, --version'; + this.option(flags, 'output the version number'); + this.on('version', function(){ + console.log(str); + process.exit(0); + }); + return this; +}; + +/** + * Set the description `str`. + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.description = function(str){ + if (0 == arguments.length) return this._description; + this._description = str; + return this; +}; + +/** + * Set / get the command usage `str`. + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.usage = function(str){ + var args = this.args.map(function(arg){ + return arg.required + ? '<' + arg.name + '>' + : '[' + arg.name + ']'; + }); + + var usage = '[options' + + (this.commands.length ? '] [command' : '') + + ']' + + (this.args.length ? ' ' + args : ''); + if (0 == arguments.length) return this._usage || usage; + this._usage = str; + + return this; +}; + +/** + * Return the largest option length. + * + * @return {Number} + * @api private + */ + +Command.prototype.largestOptionLength = function(){ + return this.options.reduce(function(max, option){ + return Math.max(max, option.flags.length); + }, 0); +}; + +/** + * Return help for options. + * + * @return {String} + * @api private + */ + +Command.prototype.optionHelp = function(){ + var width = this.largestOptionLength(); + + // Prepend the help information + return [pad('-h, --help', width) + ' ' + 'output usage information'] + .concat(this.options.map(function(option){ + return pad(option.flags, width) + + ' ' + option.description; + })) + .join('\n'); +}; + +/** + * Return command help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.commandHelp = function(){ + if (!this.commands.length) return ''; + return [ + '' + , ' Commands:' + , '' + , this.commands.map(function(cmd){ + var args = cmd.args.map(function(arg){ + return arg.required + ? '<' + arg.name + '>' + : '[' + arg.name + ']'; + }).join(' '); + + return cmd.name + + (cmd.options.length + ? ' [options]' + : '') + ' ' + args + + (cmd.description() + ? '\n' + cmd.description() + : ''); + }).join('\n\n').replace(/^/gm, ' ') + , '' + ].join('\n'); +}; + +/** + * Return program help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.helpInformation = function(){ + return [ + '' + , ' Usage: ' + this.name + ' ' + this.usage() + , '' + this.commandHelp() + , ' Options:' + , '' + , '' + this.optionHelp().replace(/^/gm, ' ') + , '' + , '' + ].join('\n'); +}; + +/** + * Prompt for a `Number`. + * + * @param {String} str + * @param {Function} fn + * @api private + */ + +Command.prototype.promptForNumber = function(str, fn){ + var self = this; + this.promptSingleLine(str, function parseNumber(val){ + val = Number(val); + if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber); + fn(val); + }); +}; + +/** + * Prompt for a `Date`. + * + * @param {String} str + * @param {Function} fn + * @api private + */ + +Command.prototype.promptForDate = function(str, fn){ + var self = this; + this.promptSingleLine(str, function parseDate(val){ + val = new Date(val); + if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate); + fn(val); + }); +}; + +/** + * Single-line prompt. + * + * @param {String} str + * @param {Function} fn + * @api private + */ + +Command.prototype.promptSingleLine = function(str, fn){ + if ('function' == typeof arguments[2]) { + return this['promptFor' + (fn.name || fn)](str, arguments[2]); + } + + process.stdout.write(str); + process.stdin.setEncoding('utf8'); + process.stdin.once('data', function(val){ + fn(val.trim()); + }).resume(); +}; + +/** + * Multi-line prompt. + * + * @param {String} str + * @param {Function} fn + * @api private + */ + +Command.prototype.promptMultiLine = function(str, fn){ + var buf = []; + console.log(str); + process.stdin.setEncoding('utf8'); + process.stdin.on('data', function(val){ + if ('\n' == val || '\r\n' == val) { + process.stdin.removeAllListeners('data'); + fn(buf.join('\n')); + } else { + buf.push(val.trimRight()); + } + }).resume(); +}; + +/** + * Prompt `str` and callback `fn(val)` + * + * Commander supports single-line and multi-line prompts. + * To issue a single-line prompt simply add white-space + * to the end of `str`, something like "name: ", whereas + * for a multi-line prompt omit this "description:". + * + * + * Examples: + * + * program.prompt('Username: ', function(name){ + * console.log('hi %s', name); + * }); + * + * program.prompt('Description:', function(desc){ + * console.log('description was "%s"', desc.trim()); + * }); + * + * @param {String} str + * @param {Function} fn + * @api public + */ + +Command.prototype.prompt = function(str, fn){ + if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments); + this.promptMultiLine(str, fn); +}; + +/** + * Prompt for password with `str`, `mask` char and callback `fn(val)`. + * + * The mask string defaults to '', aka no output is + * written while typing, you may want to use "*" etc. + * + * Examples: + * + * program.password('Password: ', function(pass){ + * console.log('got "%s"', pass); + * process.stdin.destroy(); + * }); + * + * program.password('Password: ', '*', function(pass){ + * console.log('got "%s"', pass); + * process.stdin.destroy(); + * }); + * + * @param {String} str + * @param {String} mask + * @param {Function} fn + * @api public + */ + +Command.prototype.password = function(str, mask, fn){ + var self = this + , buf = ''; + + // default mask + if ('function' == typeof mask) { + fn = mask; + mask = ''; + } + + process.stdin.resume(); + tty.setRawMode(true); + process.stdout.write(str); + + // keypress + process.stdin.on('keypress', function(c, key){ + if (key && 'enter' == key.name) { + console.log(); + process.stdin.removeAllListeners('keypress'); + tty.setRawMode(false); + if (!buf.trim().length) return self.password(str, mask, fn); + fn(buf); + return; + } + + if (key && key.ctrl && 'c' == key.name) { + console.log('%s', buf); + process.exit(); + } + + process.stdout.write(mask); + buf += c; + }).resume(); +}; + +/** + * Confirmation prompt with `str` and callback `fn(bool)` + * + * Examples: + * + * program.confirm('continue? ', function(ok){ + * console.log(' got %j', ok); + * process.stdin.destroy(); + * }); + * + * @param {String} str + * @param {Function} fn + * @api public + */ + + +Command.prototype.confirm = function(str, fn){ + var self = this; + this.prompt(str, function(ok){ + if (!ok.trim()) { + return self.confirm(str, fn); + } + fn(parseBool(ok)); + }); +}; + +/** + * Choice prompt with `list` of items and callback `fn(index, item)` + * + * Examples: + * + * var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; + * + * console.log('Choose the coolest pet:'); + * program.choose(list, function(i){ + * console.log('you chose %d "%s"', i, list[i]); + * process.stdin.destroy(); + * }); + * + * @param {Array} list + * @param {Function} fn + * @api public + */ + +Command.prototype.choose = function(list, fn){ + var self = this; + + list.forEach(function(item, i){ + console.log(' %d) %s', i + 1, item); + }); + + function again() { + self.prompt(' : ', function(val){ + val = parseInt(val, 10) - 1; + if (null == list[val]) { + again(); + } else { + fn(val, list[val]); + } + }); + } + + again(); +}; + +/** + * Camel-case the given `flag` + * + * @param {String} flag + * @return {String} + * @api private + */ + +function camelcase(flag) { + return flag.split('-').reduce(function(str, word){ + return str + word[0].toUpperCase() + word.slice(1); + }); +} + +/** + * Parse a boolean `str`. + * + * @param {String} str + * @return {Boolean} + * @api private + */ + +function parseBool(str) { + return /^y|yes|ok|true$/i.test(str); +} + +/** + * Pad `str` to `width`. + * + * @param {String} str + * @param {Number} width + * @return {String} + * @api private + */ + +function pad(str, width) { + var len = Math.max(0, width - str.length); + return str + Array(len + 1).join(' '); +} + +/** + * Output help information if necessary + * + * @param {Command} command to output help for + * @param {Array} array of options to search for -h or --help + * @api private + */ + +function outputHelpIfNecessary(cmd, options) { + options = options || []; + for (var i = 0; i < options.length; i++) { + if (options[i] == '--help' || options[i] == '-h') { + process.stdout.write(cmd.helpInformation()); + cmd.emit('--help'); + process.exit(0); + } + } +} diff --git a/usb_auth/node_modules/jade/node_modules/commander/package.json b/usb_auth/node_modules/jade/node_modules/commander/package.json new file mode 100644 index 0000000..724ba47 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/commander/package.json @@ -0,0 +1,13 @@ +{ + "name": "commander" + , "version": "0.5.2" + , "description": "the complete solution for node.js command-line programs" + , "keywords": ["command", "option", "parser", "prompt", "stdin"] + , "author": "TJ Holowaychuk " + , "repository": { "type": "git", "url": "https://github.com/visionmedia/commander.js.git" } + , "dependencies": {} + , "devDependencies": { "should": ">= 0.0.1" } + , "scripts": { "test": "make test" } + , "main": "index" + , "engines": { "node": ">= 0.4.x < 0.8.0" } +} \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.orig b/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.orig new file mode 100644 index 0000000..9303c34 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.orig @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.rej b/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.rej new file mode 100644 index 0000000..69244ff --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.rej @@ -0,0 +1,5 @@ +--- /dev/null ++++ .gitignore +@@ -0,0 +1,2 @@ ++node_modules/ ++npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/.npmignore b/usb_auth/node_modules/jade/node_modules/mkdirp/.npmignore new file mode 100644 index 0000000..9303c34 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/LICENSE b/usb_auth/node_modules/jade/node_modules/mkdirp/LICENSE new file mode 100644 index 0000000..432d1ae --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/README.markdown b/usb_auth/node_modules/jade/node_modules/mkdirp/README.markdown new file mode 100644 index 0000000..b4dd75f --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/README.markdown @@ -0,0 +1,54 @@ +mkdirp +====== + +Like `mkdir -p`, but in node.js! + +example +======= + +pow.js +------ + var mkdirp = require('mkdirp'); + + mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') + }); + +Output + pow! + +And now /tmp/foo/bar/baz exists, huzzah! + +methods +======= + +var mkdirp = require('mkdirp'); + +mkdirp(dir, mode, cb) +--------------------- + +Create a new directory and any necessary subdirectories at `dir` with octal +permission string `mode`. + +If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. + +mkdirp.sync(dir, mode) +---------------------- + +Synchronously create a new directory and any necessary subdirectories at `dir` +with octal permission string `mode`. + +If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. + +install +======= + +With [npm](http://npmjs.org) do: + + npm install mkdirp + +license +======= + +MIT/X11 diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js b/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js new file mode 100644 index 0000000..e692421 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js @@ -0,0 +1,6 @@ +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig b/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig new file mode 100644 index 0000000..7741462 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig @@ -0,0 +1,6 @@ +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', 0755, function (err) { + if (err) console.error(err) + else console.log('pow!') +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej b/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej new file mode 100644 index 0000000..81e7f43 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej @@ -0,0 +1,19 @@ +--- examples/pow.js ++++ examples/pow.js +@@ -1,6 +1,15 @@ +-var mkdirp = require('mkdirp').mkdirp; ++var mkdirp = require('../').mkdirp, ++ mkdirpSync = require('../').mkdirpSync; + + mkdirp('/tmp/foo/bar/baz', 0755, function (err) { + if (err) console.error(err) + else console.log('pow!') + }); ++ ++try { ++ mkdirpSync('/tmp/bar/foo/baz', 0755); ++ console.log('double pow!'); ++} ++catch (ex) { ++ console.log(ex); ++} \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/index.js b/usb_auth/node_modules/jade/node_modules/mkdirp/index.js new file mode 100644 index 0000000..25f43ad --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/index.js @@ -0,0 +1,79 @@ +var path = require('path'); +var fs = require('fs'); + +module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; + +function mkdirP (p, mode, f) { + if (typeof mode === 'function' || mode === undefined) { + f = mode; + mode = 0777 & (~process.umask()); + } + + var cb = f || function () {}; + if (typeof mode === 'string') mode = parseInt(mode, 8); + p = path.resolve(p); + + fs.mkdir(p, mode, function (er) { + if (!er) return cb(); + switch (er.code) { + case 'ENOENT': + mkdirP(path.dirname(p), mode, function (er) { + if (er) cb(er); + else mkdirP(p, mode, cb); + }); + break; + + case 'EEXIST': + fs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original EEXIST be the failure reason. + if (er2 || !stat.isDirectory()) cb(er) + else cb(); + }); + break; + + default: + cb(er); + break; + } + }); +} + +mkdirP.sync = function sync (p, mode) { + if (mode === undefined) { + mode = 0777 & (~process.umask()); + } + + if (typeof mode === 'string') mode = parseInt(mode, 8); + p = path.resolve(p); + + try { + fs.mkdirSync(p, mode) + } + catch (err0) { + switch (err0.code) { + case 'ENOENT' : + var err1 = sync(path.dirname(p), mode) + if (err1) throw err1; + else return sync(p, mode); + break; + + case 'EEXIST' : + var stat; + try { + stat = fs.statSync(p); + } + catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0; + else return null; + break; + default : + throw err0 + break; + } + } + + return null; +}; diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/package.json b/usb_auth/node_modules/jade/node_modules/mkdirp/package.json new file mode 100644 index 0000000..1bf9ac7 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/package.json @@ -0,0 +1,23 @@ +{ + "name" : "mkdirp", + "description" : "Recursively mkdir, like `mkdir -p`", + "version" : "0.3.0", + "author" : "James Halliday (http://substack.net)", + "main" : "./index", + "keywords" : [ + "mkdir", + "directory" + ], + "repository" : { + "type" : "git", + "url" : "http://github.com/substack/node-mkdirp.git" + }, + "scripts" : { + "test" : "tap test/*.js" + }, + "devDependencies" : { + "tap" : "0.0.x" + }, + "license" : "MIT/X11", + "engines": { "node": "*" } +} diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/chmod.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/chmod.js new file mode 100644 index 0000000..520dcb8 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/chmod.js @@ -0,0 +1,38 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +test('chmod-pre', function (t) { + var mode = 0744 + mkdirp(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); + t.end(); + }); + }); +}); + +test('chmod', function (t) { + var mode = 0755 + mkdirp(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.end(); + }); + }); +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/clobber.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/clobber.js new file mode 100644 index 0000000..0eb7099 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/clobber.js @@ -0,0 +1,37 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +// a file in the way +var itw = ps.slice(0, 3).join('/'); + + +test('clobber-pre', function (t) { + console.error("about to write to "+itw) + fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); + + fs.stat(itw, function (er, stat) { + t.ifError(er) + t.ok(stat && stat.isFile(), 'should be file') + t.end() + }) +}) + +test('clobber', function (t) { + t.plan(2); + mkdirp(file, 0755, function (err) { + t.ok(err); + t.equal(err.code, 'ENOTDIR'); + t.end(); + }); +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/mkdirp.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/mkdirp.js new file mode 100644 index 0000000..b07cd70 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/mkdirp.js @@ -0,0 +1,28 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('woo', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkdirp(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm.js new file mode 100644 index 0000000..23a7abb --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('async perm', function (t) { + t.plan(2); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); + + mkdirp(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); + +test('async root perm', function (t) { + mkdirp('/tmp', 0755, function (err) { + if (err) t.fail(err); + t.end(); + }); + t.end(); +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm_sync.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm_sync.js new file mode 100644 index 0000000..f685f60 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm_sync.js @@ -0,0 +1,39 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('sync perm', function (t) { + t.plan(2); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; + + mkdirp.sync(file, 0755); + path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }); +}); + +test('sync root perm', function (t) { + t.plan(1); + + var file = '/tmp'; + mkdirp.sync(file, 0755); + path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }); +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/race.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/race.js new file mode 100644 index 0000000..96a0447 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/race.js @@ -0,0 +1,41 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('race', function (t) { + t.plan(4); + var ps = [ '', 'tmp' ]; + + for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); + } + var file = ps.join('/'); + + var res = 2; + mk(file, function () { + if (--res === 0) t.end(); + }); + + mk(file, function () { + if (--res === 0) t.end(); + }); + + function mk (file, cb) { + mkdirp(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + if (cb) cb(); + } + }) + }) + }); + } +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/rel.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/rel.js new file mode 100644 index 0000000..7985824 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/rel.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('rel', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var cwd = process.cwd(); + process.chdir('/tmp'); + + var file = [x,y,z].join('/'); + + mkdirp(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + process.chdir(cwd); + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/sync.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/sync.js new file mode 100644 index 0000000..e0e389d --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/sync.js @@ -0,0 +1,27 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('sync', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + var err = mkdirp.sync(file, 0755); + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask.js new file mode 100644 index 0000000..64ccafe --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask.js @@ -0,0 +1,28 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('implicit mode from umask', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkdirp(file, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0777 & (~process.umask())); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask_sync.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask_sync.js new file mode 100644 index 0000000..83cba56 --- /dev/null +++ b/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask_sync.js @@ -0,0 +1,27 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('umask sync modes', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + var err = mkdirp.sync(file); + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, (0777 & (~process.umask()))); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) +}); diff --git a/usb_auth/node_modules/jade/package.json b/usb_auth/node_modules/jade/package.json new file mode 100644 index 0000000..a32e8e8 --- /dev/null +++ b/usb_auth/node_modules/jade/package.json @@ -0,0 +1,23 @@ +{ + "name": "jade", + "description": "Jade template engine", + "version": "0.20.3", + "author": "TJ Holowaychuk ", + "repository": "git://github.com/visionmedia/jade", + "main": "./index.js", + "bin": { "jade": "./bin/jade" }, + "dependencies": { + "commander": "0.5.x", + "mkdirp": ">= 0.0.7" + }, + "devDependencies": { + "mocha": "*", + "coffee-script": ">= 0.0.1", + "markdown": ">= 0.0.1", + "stylus": ">= 0.0.1", + "uubench": "0.0.1", + "uglify-js": ">= 1.0.7" + }, + "scripts" : { "prepublish" : "npm prune" }, + "engines": { "node": ">= 0.1.98" } +} diff --git a/usb_auth/node_modules/jade/runtime.js b/usb_auth/node_modules/jade/runtime.js new file mode 100644 index 0000000..39f8a28 --- /dev/null +++ b/usb_auth/node_modules/jade/runtime.js @@ -0,0 +1,123 @@ + +var jade = (function(exports){ +/*! + * Jade - runtime + * Copyright(c) 2010 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Lame Array.isArray() polyfill for now. + */ + +if (!Array.isArray) { + Array.isArray = function(arr){ + return '[object Array]' == Object.prototype.toString.call(arr); + }; +} + +/** + * Lame Object.keys() polyfill for now. + */ + +if (!Object.keys) { + Object.keys = function(obj){ + var arr = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + arr.push(key); + } + } + return arr; + } +} + +/** + * Render the given attributes object. + * + * @param {Object} obj + * @return {String} + * @api private + */ + +exports.attrs = function attrs(obj){ + var buf = [] + , terse = obj.terse; + delete obj.terse; + var keys = Object.keys(obj) + , len = keys.length; + if (len) { + buf.push(''); + for (var i = 0; i < len; ++i) { + var key = keys[i] + , val = obj[key]; + if ('boolean' == typeof val || null == val) { + if (val) { + terse + ? buf.push(key) + : buf.push(key + '="' + key + '"'); + } + } else if ('class' == key && Array.isArray(val)) { + buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); + } else { + buf.push(key + '="' + exports.escape(val) + '"'); + } + } + } + return buf.join(' '); +}; + +/** + * Escape the given string of `html`. + * + * @param {String} html + * @return {String} + * @api private + */ + +exports.escape = function escape(html){ + return String(html) + .replace(/&(?!\w+;)/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +}; + +/** + * Re-throw the given `err` in context to the + * the jade in `filename` at the given `lineno`. + * + * @param {Error} err + * @param {String} filename + * @param {String} lineno + * @api private + */ + +exports.rethrow = function rethrow(err, filename, lineno){ + if (!filename) throw err; + + var context = 3 + , str = require('fs').readFileSync(filename, 'utf8') + , lines = str.split('\n') + , start = Math.max(lineno - context, 0) + , end = Math.min(lines.length, lineno + context); + + // Error context + var context = lines.slice(start, end).map(function(line, i){ + var curr = i + start + 1; + return (curr == lineno ? ' > ' : ' ') + + curr + + '| ' + + line; + }).join('\n'); + + // Alter exception message + err.path = filename; + err.message = (filename || 'Jade') + ':' + lineno + + '\n' + context + '\n\n' + err.message; + throw err; +}; + + return exports; + +})({}); \ No newline at end of file diff --git a/usb_auth/node_modules/jade/runtime.min.js b/usb_auth/node_modules/jade/runtime.min.js new file mode 100644 index 0000000..8c19a98 --- /dev/null +++ b/usb_auth/node_modules/jade/runtime.min.js @@ -0,0 +1 @@ +var jade=function(exports){return Array.isArray||(Array.isArray=function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}),Object.keys||(Object.keys=function(obj){var arr=[];for(var key in obj)obj.hasOwnProperty(key)&&arr.push(key);return arr}),exports.attrs=function(obj){var buf=[],terse=obj.terse;delete obj.terse;var keys=Object.keys(obj),len=keys.length;if(len){buf.push("");for(var i=0;i/g,">").replace(/"/g,""")},exports.rethrow=function(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err},exports}({}) \ No newline at end of file diff --git a/usb_auth/package.json b/usb_auth/package.json new file mode 100644 index 0000000..6f61ed5 --- /dev/null +++ b/usb_auth/package.json @@ -0,0 +1,9 @@ +{ + "name": "usb_auth" + , "version": "0.1" + , "private": true + , "dependencies": { + "express": "2.5.8" + , "jade": ">= 0.0.1" + } +} diff --git a/usb_auth/routes/index.js b/usb_auth/routes/index.js new file mode 100644 index 0000000..dff1c46 --- /dev/null +++ b/usb_auth/routes/index.js @@ -0,0 +1,18 @@ +var url = require('url'); +var fs = require('fs'); + +/* + * GET home page. + */ + +exports.index = function(req, res){ + var urlString = url.parse(req.url, true).query; + var logFile = fs.openSync('./log.txt', 'a+'); + if (urlString.action == 'login') { + fs.writeSync(logFile, 'User logged in on device ' + urlString.device + ' with token ' + urlString.token + '\n', null); + } else if (urlString.action == 'logout') { + fs.writeSync(logFile, 'User logged out from device ' + urlString.device + '\n', null); + } + fs.close(logFile); + res.render('index', { title: 'See log file for detailed info about the request.\n' }) +}; diff --git a/usb_auth/usb_app.js b/usb_auth/usb_app.js deleted file mode 100644 index cee5676..0000000 --- a/usb_auth/usb_app.js +++ /dev/null @@ -1,20 +0,0 @@ -var http = require('http'); -var url = require('url'); -var fs = require('fs'); - -var app = http.createServer(function (request, response) { - response.writeHead(200, {'Content-Type': 'text/plain'}); - - var urlString = url.parse(request.url, true).query; - var logFile = fs.openSync('./log.txt', 'a+'); - if (urlString.action == 'login') { - fs.writeSync(logFile, 'User logged in on device ' + urlString.device + ' with token ' + urlString.token + '\n', null); - } else if (urlString.action == 'logout') { - fs.writeSync(logFile, 'User logged out from device ' + urlString.device + '\n', null); - } - fs.close(logFile); - - response.end('See log file for detailed info about the request.\n'); -}).listen(8000); - -console.log('Server running at http://127.0.0.1:8000/'); diff --git a/usb_auth/usb_test.sh b/usb_auth/usb_test.sh index e474949..82c74f2 100755 --- a/usb_auth/usb_test.sh +++ b/usb_auth/usb_test.sh @@ -9,8 +9,8 @@ if [ $1 -eq 1 ]; then done loc=`mount | grep /sdb1 |cut -d " " -f 3` # The location where the USB disk drive is mounted. token=`cat $loc/token.txt` # The token that identifies the user. - curl http://localhost:8000/users?action=login\&device=$2\&token=$token # A call to the Node.js server + curl http://localhost:3000/users?action=login\&device=$2\&token=$token # A call to the Node.js server else # USB disk drive is removed. - curl http://localhost:8000/users?action=logout\&device=$2 + curl http://localhost:3000/users?action=logout\&device=$2 fi diff --git a/usb_auth/views/index.jade b/usb_auth/views/index.jade new file mode 100644 index 0000000..fbb28d1 --- /dev/null +++ b/usb_auth/views/index.jade @@ -0,0 +1 @@ +h1= title diff --git a/usb_auth/views/layout.jade b/usb_auth/views/layout.jade new file mode 100644 index 0000000..1e785a3 --- /dev/null +++ b/usb_auth/views/layout.jade @@ -0,0 +1,5 @@ +!!! +html + head + title= title + body!= body From edc855197225c327aa85b19cb4ccea4b6dac043f Mon Sep 17 00:00:00 2001 From: boyan Date: Mon, 20 Feb 2012 15:48:21 +0200 Subject: [PATCH 006/319] Communication to preference server added --- usb_auth/app.js | 10 ++-------- usb_auth/routes/index.js | 16 +++++++++++++--- usb_auth/usb_test.sh | 6 +++--- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/usb_auth/app.js b/usb_auth/app.js index 8f734b5..ec965f0 100644 --- a/usb_auth/app.js +++ b/usb_auth/app.js @@ -1,15 +1,10 @@ - -/** - * Module dependencies. - */ - +// Module dependencies. var express = require('express') , routes = require('./routes'); var app = module.exports = express.createServer(); // Configuration - app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); @@ -28,8 +23,7 @@ app.configure('production', function(){ }); // Routes - -app.get('/users', routes.index); +app.get('/user', routes.user); app.listen(3000); console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); diff --git a/usb_auth/routes/index.js b/usb_auth/routes/index.js index dff1c46..24b0b97 100644 --- a/usb_auth/routes/index.js +++ b/usb_auth/routes/index.js @@ -1,15 +1,25 @@ var url = require('url'); var fs = require('fs'); +var http = require('http'); /* - * GET home page. + * GET users. */ - -exports.index = function(req, res){ +exports.user = function(req, res){ var urlString = url.parse(req.url, true).query; var logFile = fs.openSync('./log.txt', 'a+'); if (urlString.action == 'login') { fs.writeSync(logFile, 'User logged in on device ' + urlString.device + ' with token ' + urlString.token + '\n', null); + var prefServer = { + host: 'localhost', + port: 8000, + path: '/user' + urlString.token + }; + http.get(prefServer, function (res) { + // Do nothing. + }).on('error', function (e) { + console.log('Cannot connect to preferences server.'); + }); } else if (urlString.action == 'logout') { fs.writeSync(logFile, 'User logged out from device ' + urlString.device + '\n', null); } diff --git a/usb_auth/usb_test.sh b/usb_auth/usb_test.sh index 82c74f2..655d120 100755 --- a/usb_auth/usb_test.sh +++ b/usb_auth/usb_test.sh @@ -7,10 +7,10 @@ if [ $1 -eq 1 ]; then retries=$[$retries+1] sleep 1 done - loc=`mount | grep /sdb1 |cut -d " " -f 3` # The location where the USB disk drive is mounted. + loc=`mount | grep $2 |cut -d " " -f 3` # The location where the USB disk drive is mounted. token=`cat $loc/token.txt` # The token that identifies the user. - curl http://localhost:3000/users?action=login\&device=$2\&token=$token # A call to the Node.js server + curl http://localhost:3000/user?action=login\&device=$2\&token=$token # A call to the Node.js server else # USB disk drive is removed. - curl http://localhost:3000/users?action=logout\&device=$2 + curl http://localhost:3000/user?action=logout\&device=$2 fi From adf88b4c10b4f6c449a683a5e7d6102ab402dd46 Mon Sep 17 00:00:00 2001 From: boyan Date: Tue, 21 Feb 2012 15:04:42 +0200 Subject: [PATCH 007/319] Removing the Node.js server. The script now directly calls the preferences server --- usb_auth/app.js | 29 - usb_auth/node_modules/.bin/express | 1 - usb_auth/node_modules/.bin/jade | 1 - usb_auth/node_modules/express/.npmignore | 7 - usb_auth/node_modules/express/History.md | 805 ----- usb_auth/node_modules/express/LICENSE | 22 - usb_auth/node_modules/express/Makefile | 29 - usb_auth/node_modules/express/Readme.md | 145 - usb_auth/node_modules/express/bin/express | 416 --- usb_auth/node_modules/express/index.js | 2 - usb_auth/node_modules/express/lib/express.js | 79 - usb_auth/node_modules/express/lib/http.js | 582 --- usb_auth/node_modules/express/lib/https.js | 52 - usb_auth/node_modules/express/lib/request.js | 323 -- usb_auth/node_modules/express/lib/response.js | 460 --- .../express/lib/router/collection.js | 53 - .../node_modules/express/lib/router/index.js | 398 --- .../express/lib/router/methods.js | 70 - .../node_modules/express/lib/router/route.js | 88 - usb_auth/node_modules/express/lib/utils.js | 152 - usb_auth/node_modules/express/lib/view.js | 460 --- .../node_modules/express/lib/view/partial.js | 40 - .../node_modules/express/lib/view/view.js | 210 -- .../express/node_modules/connect/.npmignore | 11 - .../express/node_modules/connect/LICENSE | 24 - .../express/node_modules/connect/index.js | 2 - .../express/node_modules/connect/lib/cache.js | 81 - .../node_modules/connect/lib/connect.js | 106 - .../express/node_modules/connect/lib/http.js | 217 -- .../express/node_modules/connect/lib/https.js | 47 - .../express/node_modules/connect/lib/index.js | 46 - .../connect/lib/middleware/basicAuth.js | 93 - .../connect/lib/middleware/bodyParser.js | 196 - .../connect/lib/middleware/compiler.js | 163 - .../connect/lib/middleware/cookieParser.js | 46 - .../connect/lib/middleware/csrf.js | 105 - .../connect/lib/middleware/directory.js | 222 -- .../connect/lib/middleware/errorHandler.js | 100 - .../connect/lib/middleware/favicon.js | 76 - .../connect/lib/middleware/limit.js | 82 - .../connect/lib/middleware/logger.js | 299 -- .../connect/lib/middleware/methodOverride.js | 38 - .../connect/lib/middleware/profiler.js | 100 - .../connect/lib/middleware/query.js | 40 - .../connect/lib/middleware/responseTime.js | 34 - .../connect/lib/middleware/router.js | 379 -- .../connect/lib/middleware/session.js | 346 -- .../connect/lib/middleware/session/cookie.js | 126 - .../connect/lib/middleware/session/memory.js | 131 - .../connect/lib/middleware/session/session.js | 137 - .../connect/lib/middleware/session/store.js | 87 - .../connect/lib/middleware/static.js | 225 -- .../connect/lib/middleware/staticCache.js | 175 - .../connect/lib/middleware/vhost.js | 44 - .../express/node_modules/connect/lib/patch.js | 79 - .../connect/lib/public/directory.html | 75 - .../connect/lib/public/error.html | 13 - .../connect/lib/public/favicon.ico | Bin 1406 -> 0 bytes .../connect/lib/public/icons/page.png | Bin 635 -> 0 bytes .../connect/lib/public/icons/page_add.png | Bin 739 -> 0 bytes .../connect/lib/public/icons/page_attach.png | Bin 794 -> 0 bytes .../connect/lib/public/icons/page_code.png | Bin 818 -> 0 bytes .../connect/lib/public/icons/page_copy.png | Bin 663 -> 0 bytes .../connect/lib/public/icons/page_delete.png | Bin 740 -> 0 bytes .../connect/lib/public/icons/page_edit.png | Bin 807 -> 0 bytes .../connect/lib/public/icons/page_error.png | Bin 793 -> 0 bytes .../connect/lib/public/icons/page_excel.png | Bin 817 -> 0 bytes .../connect/lib/public/icons/page_find.png | Bin 879 -> 0 bytes .../connect/lib/public/icons/page_gear.png | Bin 833 -> 0 bytes .../connect/lib/public/icons/page_go.png | Bin 779 -> 0 bytes .../connect/lib/public/icons/page_green.png | Bin 621 -> 0 bytes .../connect/lib/public/icons/page_key.png | Bin 801 -> 0 bytes .../lib/public/icons/page_lightning.png | Bin 839 -> 0 bytes .../connect/lib/public/icons/page_link.png | Bin 830 -> 0 bytes .../lib/public/icons/page_paintbrush.png | Bin 813 -> 0 bytes .../connect/lib/public/icons/page_paste.png | Bin 703 -> 0 bytes .../connect/lib/public/icons/page_red.png | Bin 641 -> 0 bytes .../connect/lib/public/icons/page_refresh.png | Bin 858 -> 0 bytes .../connect/lib/public/icons/page_save.png | Bin 774 -> 0 bytes .../connect/lib/public/icons/page_white.png | Bin 294 -> 0 bytes .../lib/public/icons/page_white_acrobat.png | Bin 591 -> 0 bytes .../public/icons/page_white_actionscript.png | Bin 664 -> 0 bytes .../lib/public/icons/page_white_add.png | Bin 512 -> 0 bytes .../connect/lib/public/icons/page_white_c.png | Bin 587 -> 0 bytes .../lib/public/icons/page_white_camera.png | Bin 656 -> 0 bytes .../lib/public/icons/page_white_cd.png | Bin 666 -> 0 bytes .../lib/public/icons/page_white_code.png | Bin 603 -> 0 bytes .../lib/public/icons/page_white_code_red.png | Bin 587 -> 0 bytes .../public/icons/page_white_coldfusion.png | Bin 592 -> 0 bytes .../public/icons/page_white_compressed.png | Bin 724 -> 0 bytes .../lib/public/icons/page_white_copy.png | Bin 309 -> 0 bytes .../lib/public/icons/page_white_cplusplus.png | Bin 621 -> 0 bytes .../lib/public/icons/page_white_csharp.png | Bin 700 -> 0 bytes .../lib/public/icons/page_white_cup.png | Bin 639 -> 0 bytes .../lib/public/icons/page_white_database.png | Bin 579 -> 0 bytes .../lib/public/icons/page_white_delete.png | Bin 536 -> 0 bytes .../lib/public/icons/page_white_dvd.png | Bin 638 -> 0 bytes .../lib/public/icons/page_white_edit.png | Bin 618 -> 0 bytes .../lib/public/icons/page_white_error.png | Bin 623 -> 0 bytes .../lib/public/icons/page_white_excel.png | Bin 663 -> 0 bytes .../lib/public/icons/page_white_find.png | Bin 676 -> 0 bytes .../lib/public/icons/page_white_flash.png | Bin 582 -> 0 bytes .../lib/public/icons/page_white_freehand.png | Bin 639 -> 0 bytes .../lib/public/icons/page_white_gear.png | Bin 402 -> 0 bytes .../lib/public/icons/page_white_get.png | Bin 516 -> 0 bytes .../lib/public/icons/page_white_go.png | Bin 612 -> 0 bytes .../connect/lib/public/icons/page_white_h.png | Bin 603 -> 0 bytes .../public/icons/page_white_horizontal.png | Bin 296 -> 0 bytes .../lib/public/icons/page_white_key.png | Bin 616 -> 0 bytes .../lib/public/icons/page_white_lightning.png | Bin 669 -> 0 bytes .../lib/public/icons/page_white_link.png | Bin 614 -> 0 bytes .../lib/public/icons/page_white_magnify.png | Bin 554 -> 0 bytes .../lib/public/icons/page_white_medal.png | Bin 706 -> 0 bytes .../lib/public/icons/page_white_office.png | Bin 779 -> 0 bytes .../lib/public/icons/page_white_paint.png | Bin 688 -> 0 bytes .../public/icons/page_white_paintbrush.png | Bin 618 -> 0 bytes .../lib/public/icons/page_white_paste.png | Bin 620 -> 0 bytes .../lib/public/icons/page_white_php.png | Bin 538 -> 0 bytes .../lib/public/icons/page_white_picture.png | Bin 650 -> 0 bytes .../public/icons/page_white_powerpoint.png | Bin 588 -> 0 bytes .../lib/public/icons/page_white_put.png | Bin 523 -> 0 bytes .../lib/public/icons/page_white_ruby.png | Bin 626 -> 0 bytes .../lib/public/icons/page_white_stack.png | Bin 317 -> 0 bytes .../lib/public/icons/page_white_star.png | Bin 565 -> 0 bytes .../lib/public/icons/page_white_swoosh.png | Bin 634 -> 0 bytes .../lib/public/icons/page_white_text.png | Bin 342 -> 0 bytes .../public/icons/page_white_text_width.png | Bin 315 -> 0 bytes .../lib/public/icons/page_white_tux.png | Bin 668 -> 0 bytes .../lib/public/icons/page_white_vector.png | Bin 644 -> 0 bytes .../public/icons/page_white_visualstudio.png | Bin 702 -> 0 bytes .../lib/public/icons/page_white_width.png | Bin 309 -> 0 bytes .../lib/public/icons/page_white_word.png | Bin 651 -> 0 bytes .../lib/public/icons/page_white_world.png | Bin 734 -> 0 bytes .../lib/public/icons/page_white_wrench.png | Bin 613 -> 0 bytes .../lib/public/icons/page_white_zip.png | Bin 386 -> 0 bytes .../connect/lib/public/icons/page_word.png | Bin 777 -> 0 bytes .../connect/lib/public/icons/page_world.png | Bin 903 -> 0 bytes .../node_modules/connect/lib/public/style.css | 141 - .../express/node_modules/connect/lib/utils.js | 451 --- .../node_modules/formidable/..travis.yml.un~ | Bin 953 -> 0 bytes .../node_modules/formidable/.Readme.md.un~ | Bin 6414 -> 0 bytes .../node_modules/formidable/.npmignore | 4 - .../node_modules/formidable/.package.json.un~ | Bin 542 -> 0 bytes .../node_modules/formidable/.travis.yml | 4 - .../connect/node_modules/formidable/Makefile | 14 - .../connect/node_modules/formidable/Readme.md | 303 -- .../connect/node_modules/formidable/TODO | 3 - .../benchmark/bench-multipart-parser.js | 70 - .../node_modules/formidable/example/post.js | 43 - .../node_modules/formidable/example/upload.js | 48 - .../connect/node_modules/formidable/index.js | 1 - .../formidable/lib/.incoming_form.js.un~ | Bin 12289 -> 0 bytes .../node_modules/formidable/lib/file.js | 61 - .../formidable/lib/incoming_form.js | 378 -- .../node_modules/formidable/lib/index.js | 3 - .../formidable/lib/multipart_parser.js | 312 -- .../formidable/lib/querystring_parser.js | 25 - .../node_modules/formidable/lib/util.js | 6 - .../node_modules/formidable/package.json | 22 - .../formidable/test/.common.js.un~ | Bin 1666 -> 0 bytes .../node_modules/formidable/test/.run.js.un~ | Bin 541 -> 0 bytes .../node_modules/formidable/test/common.js | 19 - .../test/fixture/file/funkyfilename.txt | 1 - .../formidable/test/fixture/file/plain.txt | 1 - .../http/no-filename/.generic.http.un~ | Bin 641 -> 0 bytes .../http/special-chars-in-filename/info.md | 3 - .../test/fixture/js/.no-filename.js.un~ | Bin 1147 -> 0 bytes .../js/.special-chars-in-filename.js.un~ | Bin 2129 -> 0 bytes .../formidable/test/fixture/js/no-filename.js | 3 - .../fixture/js/special-chars-in-filename.js | 21 - .../formidable/test/fixture/multipart.js | 72 - .../test/integration/.test-fixtures.js.un~ | Bin 30260 -> 0 bytes .../test/integration/test-fixtures.js | 89 - .../formidable/test/legacy/common.js | 24 - .../integration/test-multipart-parser.js | 80 - .../test/legacy/simple/test-file.js | 104 - .../test/legacy/simple/test-incoming-form.js | 726 ---- .../legacy/simple/test-multipart-parser.js | 50 - .../legacy/simple/test-querystring-parser.js | 45 - .../legacy/system/test-multi-video-upload.js | 72 - .../node_modules/formidable/test/run.js | 2 - .../node_modules/formidable/test/tmp/.empty | 0 .../test/unit/.test-incoming-form.js.un~ | Bin 61302 -> 0 bytes .../test/unit/test-incoming-form.js | 63 - .../node_modules/formidable/tool/record.js | 47 - .../express/node_modules/connect/package.json | 25 - .../express/node_modules/connect/test.js | 52 - .../express/node_modules/mime/LICENSE | 19 - .../express/node_modules/mime/README.md | 50 - .../express/node_modules/mime/mime.js | 92 - .../express/node_modules/mime/package.json | 22 - .../express/node_modules/mime/test.js | 79 - .../node_modules/mime/types/mime.types | 1479 -------- .../node_modules/mime/types/node.types | 43 - .../node_modules/mkdirp/.gitignore.orig | 2 - .../node_modules/mkdirp/.gitignore.rej | 5 - .../express/node_modules/mkdirp/.npmignore | 2 - .../express/node_modules/mkdirp/LICENSE | 21 - .../node_modules/mkdirp/README.markdown | 54 - .../node_modules/mkdirp/examples/pow.js | 6 - .../node_modules/mkdirp/examples/pow.js.orig | 6 - .../node_modules/mkdirp/examples/pow.js.rej | 19 - .../express/node_modules/mkdirp/index.js | 79 - .../express/node_modules/mkdirp/package.json | 23 - .../express/node_modules/mkdirp/test/chmod.js | 38 - .../node_modules/mkdirp/test/clobber.js | 37 - .../node_modules/mkdirp/test/mkdirp.js | 28 - .../express/node_modules/mkdirp/test/perm.js | 32 - .../node_modules/mkdirp/test/perm_sync.js | 39 - .../express/node_modules/mkdirp/test/race.js | 41 - .../express/node_modules/mkdirp/test/rel.js | 32 - .../express/node_modules/mkdirp/test/sync.js | 27 - .../express/node_modules/mkdirp/test/umask.js | 28 - .../node_modules/mkdirp/test/umask_sync.js | 27 - .../express/node_modules/qs/.gitmodules | 6 - .../express/node_modules/qs/.npmignore | 1 - .../express/node_modules/qs/.travis.yml | 4 - .../express/node_modules/qs/History.md | 73 - .../express/node_modules/qs/Makefile | 5 - .../express/node_modules/qs/Readme.md | 54 - .../express/node_modules/qs/benchmark.js | 17 - .../express/node_modules/qs/examples.js | 51 - .../express/node_modules/qs/index.js | 2 - .../node_modules/qs/lib/querystring.js | 264 -- .../express/node_modules/qs/package.json | 16 - .../express/node_modules/qs/test/mocha.opts | 2 - .../express/node_modules/qs/test/parse.js | 167 - .../express/node_modules/qs/test/stringify.js | 103 - usb_auth/node_modules/express/package.json | 39 - .../node_modules/express/testing/foo/app.js | 35 - .../express/testing/foo/package.json | 9 - .../testing/foo/public/stylesheets/style.css | 8 - .../express/testing/foo/routes/index.js | 10 - .../express/testing/foo/views/index.jade | 2 - .../express/testing/foo/views/layout.jade | 6 - .../node_modules/express/testing/index.js | 43 - .../express/testing/public/test.txt | 2971 ---------------- .../express/testing/views/page.html | 1 - .../express/testing/views/page.jade | 3 - .../express/testing/views/test.md | 1 - .../express/testing/views/user/index.jade | 1 - .../express/testing/views/user/list.jade | 1 - usb_auth/node_modules/jade/.npmignore | 4 - usb_auth/node_modules/jade/LICENSE | 22 - usb_auth/node_modules/jade/bin/jade | 125 - usb_auth/node_modules/jade/index.js | 2 - usb_auth/node_modules/jade/jade.js | 3140 ----------------- usb_auth/node_modules/jade/jade.min.js | 2 - usb_auth/node_modules/jade/lib/compiler.js | 503 --- usb_auth/node_modules/jade/lib/doctypes.js | 18 - usb_auth/node_modules/jade/lib/filters.js | 97 - usb_auth/node_modules/jade/lib/index.js | 1 - usb_auth/node_modules/jade/lib/inline-tags.js | 28 - usb_auth/node_modules/jade/lib/jade.js | 237 -- usb_auth/node_modules/jade/lib/lexer.js | 707 ---- .../jade/lib/nodes/block-comment.js | 33 - usb_auth/node_modules/jade/lib/nodes/block.js | 100 - usb_auth/node_modules/jade/lib/nodes/case.js | 43 - usb_auth/node_modules/jade/lib/nodes/code.js | 35 - .../node_modules/jade/lib/nodes/comment.js | 32 - .../node_modules/jade/lib/nodes/doctype.js | 29 - usb_auth/node_modules/jade/lib/nodes/each.js | 35 - .../node_modules/jade/lib/nodes/filter.js | 35 - usb_auth/node_modules/jade/lib/nodes/index.js | 20 - .../node_modules/jade/lib/nodes/literal.js | 31 - usb_auth/node_modules/jade/lib/nodes/mixin.js | 34 - usb_auth/node_modules/jade/lib/nodes/node.js | 14 - usb_auth/node_modules/jade/lib/nodes/tag.js | 80 - usb_auth/node_modules/jade/lib/nodes/text.js | 42 - usb_auth/node_modules/jade/lib/parser.js | 651 ---- usb_auth/node_modules/jade/lib/runtime.js | 118 - .../node_modules/jade/lib/self-closing.js | 18 - usb_auth/node_modules/jade/lib/utils.js | 49 - .../jade/node_modules/commander/.npmignore | 4 - .../jade/node_modules/commander/.travis.yml | 4 - .../jade/node_modules/commander/History.md | 99 - .../jade/node_modules/commander/Makefile | 7 - .../jade/node_modules/commander/Readme.md | 263 -- .../jade/node_modules/commander/index.js | 2 - .../node_modules/commander/lib/commander.js | 992 ------ .../jade/node_modules/commander/package.json | 13 - .../jade/node_modules/mkdirp/.gitignore.orig | 2 - .../jade/node_modules/mkdirp/.gitignore.rej | 5 - .../jade/node_modules/mkdirp/.npmignore | 2 - .../jade/node_modules/mkdirp/LICENSE | 21 - .../jade/node_modules/mkdirp/README.markdown | 54 - .../jade/node_modules/mkdirp/examples/pow.js | 6 - .../node_modules/mkdirp/examples/pow.js.orig | 6 - .../node_modules/mkdirp/examples/pow.js.rej | 19 - .../jade/node_modules/mkdirp/index.js | 79 - .../jade/node_modules/mkdirp/package.json | 23 - .../jade/node_modules/mkdirp/test/chmod.js | 38 - .../jade/node_modules/mkdirp/test/clobber.js | 37 - .../jade/node_modules/mkdirp/test/mkdirp.js | 28 - .../jade/node_modules/mkdirp/test/perm.js | 32 - .../node_modules/mkdirp/test/perm_sync.js | 39 - .../jade/node_modules/mkdirp/test/race.js | 41 - .../jade/node_modules/mkdirp/test/rel.js | 32 - .../jade/node_modules/mkdirp/test/sync.js | 27 - .../jade/node_modules/mkdirp/test/umask.js | 28 - .../node_modules/mkdirp/test/umask_sync.js | 27 - usb_auth/node_modules/jade/package.json | 23 - usb_auth/node_modules/jade/runtime.js | 123 - usb_auth/node_modules/jade/runtime.min.js | 1 - usb_auth/package.json | 9 - usb_auth/routes/index.js | 28 - usb_auth/usb_test.sh | 7 +- usb_auth/views/index.jade | 1 - usb_auth/views/layout.jade | 5 - 309 files changed, 5 insertions(+), 26389 deletions(-) delete mode 100644 usb_auth/app.js delete mode 120000 usb_auth/node_modules/.bin/express delete mode 120000 usb_auth/node_modules/.bin/jade delete mode 100644 usb_auth/node_modules/express/.npmignore delete mode 100644 usb_auth/node_modules/express/History.md delete mode 100644 usb_auth/node_modules/express/LICENSE delete mode 100644 usb_auth/node_modules/express/Makefile delete mode 100644 usb_auth/node_modules/express/Readme.md delete mode 100755 usb_auth/node_modules/express/bin/express delete mode 100644 usb_auth/node_modules/express/index.js delete mode 100644 usb_auth/node_modules/express/lib/express.js delete mode 100644 usb_auth/node_modules/express/lib/http.js delete mode 100644 usb_auth/node_modules/express/lib/https.js delete mode 100644 usb_auth/node_modules/express/lib/request.js delete mode 100644 usb_auth/node_modules/express/lib/response.js delete mode 100644 usb_auth/node_modules/express/lib/router/collection.js delete mode 100644 usb_auth/node_modules/express/lib/router/index.js delete mode 100644 usb_auth/node_modules/express/lib/router/methods.js delete mode 100644 usb_auth/node_modules/express/lib/router/route.js delete mode 100644 usb_auth/node_modules/express/lib/utils.js delete mode 100644 usb_auth/node_modules/express/lib/view.js delete mode 100644 usb_auth/node_modules/express/lib/view/partial.js delete mode 100644 usb_auth/node_modules/express/lib/view/view.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/.npmignore delete mode 100644 usb_auth/node_modules/express/node_modules/connect/LICENSE delete mode 100644 usb_auth/node_modules/express/node_modules/connect/index.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/cache.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/connect.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/http.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/https.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/index.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/compiler.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/csrf.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/directory.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/favicon.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/limit.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/logger.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/profiler.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/query.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/responseTime.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/router.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/memory.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/session.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/store.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/static.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/staticCache.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/middleware/vhost.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/patch.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/public/directory.html delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/public/error.html delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/public/favicon.ico delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_add.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_code.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_delete.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_edit.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_error.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_find.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_gear.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_go.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_green.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_key.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_link.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_red.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_save.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_add.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_c.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_camera.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_cd.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_compressed.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_cplusplus.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_csharp.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_cup.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_database.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_delete.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_dvd.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_error.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_flash.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_go.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_h.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_horizontal.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_lightning.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_medal.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paintbrush.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paste.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_php.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_put.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_text.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_text_width.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_tux.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_vector.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_visualstudio.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_word.png delete mode 100755 usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_world.png delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/public/style.css delete mode 100644 usb_auth/node_modules/express/node_modules/connect/lib/utils.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/..travis.yml.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.Readme.md.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.package.json.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Makefile delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/TODO delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/index.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/.incoming_form.js.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/package.json delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/.common.js.un~ delete mode 100755 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/.run.js.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/.generic.http.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.no-filename.js.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.special-chars-in-filename.js.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/.test-fixtures.js.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js delete mode 100755 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/tmp/.empty delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/.test-incoming-form.js.un~ delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js delete mode 100644 usb_auth/node_modules/express/node_modules/connect/package.json delete mode 100644 usb_auth/node_modules/express/node_modules/connect/test.js delete mode 100644 usb_auth/node_modules/express/node_modules/mime/LICENSE delete mode 100644 usb_auth/node_modules/express/node_modules/mime/README.md delete mode 100644 usb_auth/node_modules/express/node_modules/mime/mime.js delete mode 100644 usb_auth/node_modules/express/node_modules/mime/package.json delete mode 100644 usb_auth/node_modules/express/node_modules/mime/test.js delete mode 100644 usb_auth/node_modules/express/node_modules/mime/types/mime.types delete mode 100644 usb_auth/node_modules/express/node_modules/mime/types/node.types delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.orig delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.rej delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/.npmignore delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/LICENSE delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/README.markdown delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.orig delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.rej delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/index.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/package.json delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/chmod.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/clobber.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/mkdirp.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/perm.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/perm_sync.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/race.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/rel.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/sync.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/umask.js delete mode 100644 usb_auth/node_modules/express/node_modules/mkdirp/test/umask_sync.js delete mode 100644 usb_auth/node_modules/express/node_modules/qs/.gitmodules delete mode 100644 usb_auth/node_modules/express/node_modules/qs/.npmignore delete mode 100644 usb_auth/node_modules/express/node_modules/qs/.travis.yml delete mode 100644 usb_auth/node_modules/express/node_modules/qs/History.md delete mode 100644 usb_auth/node_modules/express/node_modules/qs/Makefile delete mode 100644 usb_auth/node_modules/express/node_modules/qs/Readme.md delete mode 100644 usb_auth/node_modules/express/node_modules/qs/benchmark.js delete mode 100644 usb_auth/node_modules/express/node_modules/qs/examples.js delete mode 100644 usb_auth/node_modules/express/node_modules/qs/index.js delete mode 100644 usb_auth/node_modules/express/node_modules/qs/lib/querystring.js delete mode 100644 usb_auth/node_modules/express/node_modules/qs/package.json delete mode 100644 usb_auth/node_modules/express/node_modules/qs/test/mocha.opts delete mode 100644 usb_auth/node_modules/express/node_modules/qs/test/parse.js delete mode 100644 usb_auth/node_modules/express/node_modules/qs/test/stringify.js delete mode 100644 usb_auth/node_modules/express/package.json delete mode 100644 usb_auth/node_modules/express/testing/foo/app.js delete mode 100644 usb_auth/node_modules/express/testing/foo/package.json delete mode 100644 usb_auth/node_modules/express/testing/foo/public/stylesheets/style.css delete mode 100644 usb_auth/node_modules/express/testing/foo/routes/index.js delete mode 100644 usb_auth/node_modules/express/testing/foo/views/index.jade delete mode 100644 usb_auth/node_modules/express/testing/foo/views/layout.jade delete mode 100644 usb_auth/node_modules/express/testing/index.js delete mode 100644 usb_auth/node_modules/express/testing/public/test.txt delete mode 100644 usb_auth/node_modules/express/testing/views/page.html delete mode 100644 usb_auth/node_modules/express/testing/views/page.jade delete mode 100644 usb_auth/node_modules/express/testing/views/test.md delete mode 100644 usb_auth/node_modules/express/testing/views/user/index.jade delete mode 100644 usb_auth/node_modules/express/testing/views/user/list.jade delete mode 100644 usb_auth/node_modules/jade/.npmignore delete mode 100644 usb_auth/node_modules/jade/LICENSE delete mode 100755 usb_auth/node_modules/jade/bin/jade delete mode 100644 usb_auth/node_modules/jade/index.js delete mode 100644 usb_auth/node_modules/jade/jade.js delete mode 100644 usb_auth/node_modules/jade/jade.min.js delete mode 100644 usb_auth/node_modules/jade/lib/compiler.js delete mode 100644 usb_auth/node_modules/jade/lib/doctypes.js delete mode 100644 usb_auth/node_modules/jade/lib/filters.js delete mode 120000 usb_auth/node_modules/jade/lib/index.js delete mode 100644 usb_auth/node_modules/jade/lib/inline-tags.js delete mode 100644 usb_auth/node_modules/jade/lib/jade.js delete mode 100644 usb_auth/node_modules/jade/lib/lexer.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/block-comment.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/block.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/case.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/code.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/comment.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/doctype.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/each.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/filter.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/index.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/literal.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/mixin.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/node.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/tag.js delete mode 100644 usb_auth/node_modules/jade/lib/nodes/text.js delete mode 100644 usb_auth/node_modules/jade/lib/parser.js delete mode 100644 usb_auth/node_modules/jade/lib/runtime.js delete mode 100644 usb_auth/node_modules/jade/lib/self-closing.js delete mode 100644 usb_auth/node_modules/jade/lib/utils.js delete mode 100644 usb_auth/node_modules/jade/node_modules/commander/.npmignore delete mode 100644 usb_auth/node_modules/jade/node_modules/commander/.travis.yml delete mode 100644 usb_auth/node_modules/jade/node_modules/commander/History.md delete mode 100644 usb_auth/node_modules/jade/node_modules/commander/Makefile delete mode 100644 usb_auth/node_modules/jade/node_modules/commander/Readme.md delete mode 100644 usb_auth/node_modules/jade/node_modules/commander/index.js delete mode 100644 usb_auth/node_modules/jade/node_modules/commander/lib/commander.js delete mode 100644 usb_auth/node_modules/jade/node_modules/commander/package.json delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.orig delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.rej delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/.npmignore delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/LICENSE delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/README.markdown delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/index.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/package.json delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/chmod.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/clobber.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/mkdirp.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/perm.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/perm_sync.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/race.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/rel.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/sync.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/umask.js delete mode 100644 usb_auth/node_modules/jade/node_modules/mkdirp/test/umask_sync.js delete mode 100644 usb_auth/node_modules/jade/package.json delete mode 100644 usb_auth/node_modules/jade/runtime.js delete mode 100644 usb_auth/node_modules/jade/runtime.min.js delete mode 100644 usb_auth/package.json delete mode 100644 usb_auth/routes/index.js delete mode 100644 usb_auth/views/index.jade delete mode 100644 usb_auth/views/layout.jade diff --git a/usb_auth/app.js b/usb_auth/app.js deleted file mode 100644 index ec965f0..0000000 --- a/usb_auth/app.js +++ /dev/null @@ -1,29 +0,0 @@ -// Module dependencies. -var express = require('express') - , routes = require('./routes'); - -var app = module.exports = express.createServer(); - -// Configuration -app.configure(function(){ - app.set('views', __dirname + '/views'); - app.set('view engine', 'jade'); - app.use(express.bodyParser()); - app.use(express.methodOverride()); - app.use(app.router); - app.use(express.static(__dirname + '/public')); -}); - -app.configure('development', function(){ - app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); -}); - -app.configure('production', function(){ - app.use(express.errorHandler()); -}); - -// Routes -app.get('/user', routes.user); - -app.listen(3000); -console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); diff --git a/usb_auth/node_modules/.bin/express b/usb_auth/node_modules/.bin/express deleted file mode 120000 index b741d99..0000000 --- a/usb_auth/node_modules/.bin/express +++ /dev/null @@ -1 +0,0 @@ -../express/bin/express \ No newline at end of file diff --git a/usb_auth/node_modules/.bin/jade b/usb_auth/node_modules/.bin/jade deleted file mode 120000 index 571fae7..0000000 --- a/usb_auth/node_modules/.bin/jade +++ /dev/null @@ -1 +0,0 @@ -../jade/bin/jade \ No newline at end of file diff --git a/usb_auth/node_modules/express/.npmignore b/usb_auth/node_modules/express/.npmignore deleted file mode 100644 index 74bd365..0000000 --- a/usb_auth/node_modules/express/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -.git* -docs/ -examples/ -support/ -test/ -testing.js -.DS_Store diff --git a/usb_auth/node_modules/express/History.md b/usb_auth/node_modules/express/History.md deleted file mode 100644 index 113ae6f..0000000 --- a/usb_auth/node_modules/express/History.md +++ /dev/null @@ -1,805 +0,0 @@ - -2.5.8 / 2012-02-08 -================== - - * Update mkdirp dep. Closes #991 - -2.5.7 / 2012-02-06 -================== - - * Fixed `app.all` duplicate DELETE requests [mscdex] - -2.5.6 / 2012-01-13 -================== - - * Updated hamljs dev dep. Closes #953 - -2.5.5 / 2012-01-08 -================== - - * Fixed: set `filename` on cached templates [matthewleon] - -2.5.4 / 2012-01-02 -================== - - * Fixed `express(1)` eol on 0.4.x. Closes #947 - -2.5.3 / 2011-12-30 -================== - - * Fixed `req.is()` when a charset is present - -2.5.2 / 2011-12-10 -================== - - * Fixed: express(1) LF -> CRLF for windows - -2.5.1 / 2011-11-17 -================== - - * Changed: updated connect to 1.8.x - * Removed sass.js support from express(1) - -2.5.0 / 2011-10-24 -================== - - * Added ./routes dir for generated app by default - * Added npm install reminder to express(1) app gen - * Added 0.5.x support - * Removed `make test-cov` since it wont work with node 0.5.x - * Fixed express(1) public dir for windows. Closes #866 - -2.4.7 / 2011-10-05 -================== - - * Added mkdirp to express(1). Closes #795 - * Added simple _json-config_ example - * Added shorthand for the parsed request's pathname via `req.path` - * Changed connect dep to 1.7.x to fix npm issue... - * Fixed `res.redirect()` __HEAD__ support. [reported by xerox] - * Fixed `req.flash()`, only escape args - * Fixed absolute path checking on windows. Closes #829 [reported by andrewpmckenzie] - -2.4.6 / 2011-08-22 -================== - - * Fixed multiple param callback regression. Closes #824 [reported by TroyGoode] - -2.4.5 / 2011-08-19 -================== - - * Added support for routes to handle errors. Closes #809 - * Added `app.routes.all()`. Closes #803 - * Added "basepath" setting to work in conjunction with reverse proxies etc. - * Refactored `Route` to use a single array of callbacks - * Added support for multiple callbacks for `app.param()`. Closes #801 -Closes #805 - * Changed: removed .call(self) for route callbacks - * Dependency: `qs >= 0.3.1` - * Fixed `res.redirect()` on windows due to `join()` usage. Closes #808 - -2.4.4 / 2011-08-05 -================== - - * Fixed `res.header()` intention of a set, even when `undefined` - * Fixed `*`, value no longer required - * Fixed `res.send(204)` support. Closes #771 - -2.4.3 / 2011-07-14 -================== - - * Added docs for `status` option special-case. Closes #739 - * Fixed `options.filename`, exposing the view path to template engines - -2.4.2. / 2011-07-06 -================== - - * Revert "removed jsonp stripping" for XSS - -2.4.1 / 2011-07-06 -================== - - * Added `res.json()` JSONP support. Closes #737 - * Added _extending-templates_ example. Closes #730 - * Added "strict routing" setting for trailing slashes - * Added support for multiple envs in `app.configure()` calls. Closes #735 - * Changed: `res.send()` using `res.json()` - * Changed: when cookie `path === null` don't default it - * Changed; default cookie path to "home" setting. Closes #731 - * Removed _pids/logs_ creation from express(1) - -2.4.0 / 2011-06-28 -================== - - * Added chainable `res.status(code)` - * Added `res.json()`, an explicit version of `res.send(obj)` - * Added simple web-service example - -2.3.12 / 2011-06-22 -================== - - * \#express is now on freenode! come join! - * Added `req.get(field, param)` - * Added links to Japanese documentation, thanks @hideyukisaito! - * Added; the `express(1)` generated app outputs the env - * Added `content-negotiation` example - * Dependency: connect >= 1.5.1 < 2.0.0 - * Fixed view layout bug. Closes #720 - * Fixed; ignore body on 304. Closes #701 - -2.3.11 / 2011-06-04 -================== - - * Added `npm test` - * Removed generation of dummy test file from `express(1)` - * Fixed; `express(1)` adds express as a dep - * Fixed; prune on `prepublish` - -2.3.10 / 2011-05-27 -================== - - * Added `req.route`, exposing the current route - * Added _package.json_ generation support to `express(1)` - * Fixed call to `app.param()` function for optional params. Closes #682 - -2.3.9 / 2011-05-25 -================== - - * Fixed bug-ish with `../' in `res.partial()` calls - -2.3.8 / 2011-05-24 -================== - - * Fixed `app.options()` - -2.3.7 / 2011-05-23 -================== - - * Added route `Collection`, ex: `app.get('/user/:id').remove();` - * Added support for `app.param(fn)` to define param logic - * Removed `app.param()` support for callback with return value - * Removed module.parent check from express(1) generated app. Closes #670 - * Refactored router. Closes #639 - -2.3.6 / 2011-05-20 -================== - - * Changed; using devDependencies instead of git submodules - * Fixed redis session example - * Fixed markdown example - * Fixed view caching, should not be enabled in development - -2.3.5 / 2011-05-20 -================== - - * Added export `.view` as alias for `.View` - -2.3.4 / 2011-05-08 -================== - - * Added `./examples/say` - * Fixed `res.sendfile()` bug preventing the transfer of files with spaces - -2.3.3 / 2011-05-03 -================== - - * Added "case sensitive routes" option. - * Changed; split methods supported per rfc [slaskis] - * Fixed route-specific middleware when using the same callback function several times - -2.3.2 / 2011-04-27 -================== - - * Fixed view hints - -2.3.1 / 2011-04-26 -================== - - * Added `app.match()` as `app.match.all()` - * Added `app.lookup()` as `app.lookup.all()` - * Added `app.remove()` for `app.remove.all()` - * Added `app.remove.VERB()` - * Fixed template caching collision issue. Closes #644 - * Moved router over from connect and started refactor - -2.3.0 / 2011-04-25 -================== - - * Added options support to `res.clearCookie()` - * Added `res.helpers()` as alias of `res.locals()` - * Added; json defaults to UTF-8 with `res.send()`. Closes #632. [Daniel * Dependency `connect >= 1.4.0` - * Changed; auto set Content-Type in res.attachement [Aaron Heckmann] - * Renamed "cache views" to "view cache". Closes #628 - * Fixed caching of views when using several apps. Closes #637 - * Fixed gotcha invoking `app.param()` callbacks once per route middleware. -Closes #638 - * Fixed partial lookup precedence. Closes #631 -Shaw] - -2.2.2 / 2011-04-12 -================== - - * Added second callback support for `res.download()` connection errors - * Fixed `filename` option passing to template engine - -2.2.1 / 2011-04-04 -================== - - * Added `layout(path)` helper to change the layout within a view. Closes #610 - * Fixed `partial()` collection object support. - Previously only anything with `.length` would work. - When `.length` is present one must still be aware of holes, - however now `{ collection: {foo: 'bar'}}` is valid, exposes - `keyInCollection` and `keysInCollection`. - - * Performance improved with better view caching - * Removed `request` and `response` locals - * Changed; errorHandler page title is now `Express` instead of `Connect` - -2.2.0 / 2011-03-30 -================== - - * Added `app.lookup.VERB()`, ex `app.lookup.put('/user/:id')`. Closes #606 - * Added `app.match.VERB()`, ex `app.match.put('/user/12')`. Closes #606 - * Added `app.VERB(path)` as alias of `app.lookup.VERB()`. - * Dependency `connect >= 1.2.0` - -2.1.1 / 2011-03-29 -================== - - * Added; expose `err.view` object when failing to locate a view - * Fixed `res.partial()` call `next(err)` when no callback is given [reported by aheckmann] - * Fixed; `res.send(undefined)` responds with 204 [aheckmann] - -2.1.0 / 2011-03-24 -================== - - * Added `/_?` partial lookup support. Closes #447 - * Added `request`, `response`, and `app` local variables - * Added `settings` local variable, containing the app's settings - * Added `req.flash()` exception if `req.session` is not available - * Added `res.send(bool)` support (json response) - * Fixed stylus example for latest version - * Fixed; wrap try/catch around `res.render()` - -2.0.0 / 2011-03-17 -================== - - * Fixed up index view path alternative. - * Changed; `res.locals()` without object returns the locals - -2.0.0rc3 / 2011-03-17 -================== - - * Added `res.locals(obj)` to compliment `res.local(key, val)` - * Added `res.partial()` callback support - * Fixed recursive error reporting issue in `res.render()` - -2.0.0rc2 / 2011-03-17 -================== - - * Changed; `partial()` "locals" are now optional - * Fixed `SlowBuffer` support. Closes #584 [reported by tyrda01] - * Fixed .filename view engine option [reported by drudge] - * Fixed blog example - * Fixed `{req,res}.app` reference when mounting [Ben Weaver] - -2.0.0rc / 2011-03-14 -================== - - * Fixed; expose `HTTPSServer` constructor - * Fixed express(1) default test charset. Closes #579 [reported by secoif] - * Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP] - -2.0.0beta3 / 2011-03-09 -================== - - * Added support for `res.contentType()` literal - The original `res.contentType('.json')`, - `res.contentType('application/json')`, and `res.contentType('json')` - will work now. - * Added `res.render()` status option support back - * Added charset option for `res.render()` - * Added `.charset` support (via connect 1.0.4) - * Added view resolution hints when in development and a lookup fails - * Added layout lookup support relative to the page view. - For example while rendering `./views/user/index.jade` if you create - `./views/user/layout.jade` it will be used in favour of the root layout. - * Fixed `res.redirect()`. RFC states absolute url [reported by unlink] - * Fixed; default `res.send()` string charset to utf8 - * Removed `Partial` constructor (not currently used) - -2.0.0beta2 / 2011-03-07 -================== - - * Added res.render() `.locals` support back to aid in migration process - * Fixed flash example - -2.0.0beta / 2011-03-03 -================== - - * Added HTTPS support - * Added `res.cookie()` maxAge support - * Added `req.header()` _Referrer_ / _Referer_ special-case, either works - * Added mount support for `res.redirect()`, now respects the mount-point - * Added `union()` util, taking place of `merge(clone())` combo - * Added stylus support to express(1) generated app - * Added secret to session middleware used in examples and generated app - * Added `res.local(name, val)` for progressive view locals - * Added default param support to `req.param(name, default)` - * Added `app.disabled()` and `app.enabled()` - * Added `app.register()` support for omitting leading ".", either works - * Added `res.partial()`, using the same interface as `partial()` within a view. Closes #539 - * Added `app.param()` to map route params to async/sync logic - * Added; aliased `app.helpers()` as `app.locals()`. Closes #481 - * Added extname with no leading "." support to `res.contentType()` - * Added `cache views` setting, defaulting to enabled in "production" env - * Added index file partial resolution, eg: partial('user') may try _views/user/index.jade_. - * Added `req.accepts()` support for extensions - * Changed; `res.download()` and `res.sendfile()` now utilize Connect's - static file server `connect.static.send()`. - * Changed; replaced `connect.utils.mime()` with npm _mime_ module - * Changed; allow `req.query` to be pre-defined (via middleware or other parent - * Changed view partial resolution, now relative to parent view - * Changed view engine signature. no longer `engine.render(str, options, callback)`, now `engine.compile(str, options) -> Function`, the returned function accepts `fn(locals)`. - * Fixed `req.param()` bug returning Array.prototype methods. Closes #552 - * Fixed; using `Stream#pipe()` instead of `sys.pump()` in `res.sendfile()` - * Fixed; using _qs_ module instead of _querystring_ - * Fixed; strip unsafe chars from jsonp callbacks - * Removed "stream threshold" setting - -1.0.8 / 2011-03-01 -================== - - * Allow `req.query` to be pre-defined (via middleware or other parent app) - * "connect": ">= 0.5.0 < 1.0.0". Closes #547 - * Removed the long deprecated __EXPRESS_ENV__ support - -1.0.7 / 2011-02-07 -================== - - * Fixed `render()` setting inheritance. - Mounted apps would not inherit "view engine" - -1.0.6 / 2011-02-07 -================== - - * Fixed `view engine` setting bug when period is in dirname - -1.0.5 / 2011-02-05 -================== - - * Added secret to generated app `session()` call - -1.0.4 / 2011-02-05 -================== - - * Added `qs` dependency to _package.json_ - * Fixed namespaced `require()`s for latest connect support - -1.0.3 / 2011-01-13 -================== - - * Remove unsafe characters from JSONP callback names [Ryan Grove] - -1.0.2 / 2011-01-10 -================== - - * Removed nested require, using `connect.router` - -1.0.1 / 2010-12-29 -================== - - * Fixed for middleware stacked via `createServer()` - previously the `foo` middleware passed to `createServer(foo)` - would not have access to Express methods such as `res.send()` - or props like `req.query` etc. - -1.0.0 / 2010-11-16 -================== - - * Added; deduce partial object names from the last segment. - For example by default `partial('forum/post', postObject)` will - give you the _post_ object, providing a meaningful default. - * Added http status code string representation to `res.redirect()` body - * Added; `res.redirect()` supporting _text/plain_ and _text/html_ via __Accept__. - * Added `req.is()` to aid in content negotiation - * Added partial local inheritance [suggested by masylum]. Closes #102 - providing access to parent template locals. - * Added _-s, --session[s]_ flag to express(1) to add session related middleware - * Added _--template_ flag to express(1) to specify the - template engine to use. - * Added _--css_ flag to express(1) to specify the - stylesheet engine to use (or just plain css by default). - * Added `app.all()` support [thanks aheckmann] - * Added partial direct object support. - You may now `partial('user', user)` providing the "user" local, - vs previously `partial('user', { object: user })`. - * Added _route-separation_ example since many people question ways - to do this with CommonJS modules. Also view the _blog_ example for - an alternative. - * Performance; caching view path derived partial object names - * Fixed partial local inheritance precedence. [reported by Nick Poulden] Closes #454 - * Fixed jsonp support; _text/javascript_ as per mailinglist discussion - -1.0.0rc4 / 2010-10-14 -================== - - * Added _NODE_ENV_ support, _EXPRESS_ENV_ is deprecated and will be removed in 1.0.0 - * Added route-middleware support (very helpful, see the [docs](http://expressjs.com/guide.html#Route-Middleware)) - * Added _jsonp callback_ setting to enable/disable jsonp autowrapping [Dav Glass] - * Added callback query check on response.send to autowrap JSON objects for simple webservice implementations [Dav Glass] - * Added `partial()` support for array-like collections. Closes #434 - * Added support for swappable querystring parsers - * Added session usage docs. Closes #443 - * Added dynamic helper caching. Closes #439 [suggested by maritz] - * Added authentication example - * Added basic Range support to `res.sendfile()` (and `res.download()` etc) - * Changed; `express(1)` generated app using 2 spaces instead of 4 - * Default env to "development" again [aheckmann] - * Removed _context_ option is no more, use "scope" - * Fixed; exposing _./support_ libs to examples so they can run without installs - * Fixed mvc example - -1.0.0rc3 / 2010-09-20 -================== - - * Added confirmation for `express(1)` app generation. Closes #391 - * Added extending of flash formatters via `app.flashFormatters` - * Added flash formatter support. Closes #411 - * Added streaming support to `res.sendfile()` using `sys.pump()` when >= "stream threshold" - * Added _stream threshold_ setting for `res.sendfile()` - * Added `res.send()` __HEAD__ support - * Added `res.clearCookie()` - * Added `res.cookie()` - * Added `res.render()` headers option - * Added `res.redirect()` response bodies - * Added `res.render()` status option support. Closes #425 [thanks aheckmann] - * Fixed `res.sendfile()` responding with 403 on malicious path - * Fixed `res.download()` bug; when an error occurs remove _Content-Disposition_ - * Fixed; mounted apps settings now inherit from parent app [aheckmann] - * Fixed; stripping Content-Length / Content-Type when 204 - * Fixed `res.send()` 204. Closes #419 - * Fixed multiple _Set-Cookie_ headers via `res.header()`. Closes #402 - * Fixed bug messing with error handlers when `listenFD()` is called instead of `listen()`. [thanks guillermo] - - -1.0.0rc2 / 2010-08-17 -================== - - * Added `app.register()` for template engine mapping. Closes #390 - * Added `res.render()` callback support as second argument (no options) - * Added callback support to `res.download()` - * Added callback support for `res.sendfile()` - * Added support for middleware access via `express.middlewareName()` vs `connect.middlewareName()` - * Added "partials" setting to docs - * Added default expresso tests to `express(1)` generated app. Closes #384 - * Fixed `res.sendfile()` error handling, defer via `next()` - * Fixed `res.render()` callback when a layout is used [thanks guillermo] - * Fixed; `make install` creating ~/.node_libraries when not present - * Fixed issue preventing error handlers from being defined anywhere. Closes #387 - -1.0.0rc / 2010-07-28 -================== - - * Added mounted hook. Closes #369 - * Added connect dependency to _package.json_ - - * Removed "reload views" setting and support code - development env never caches, production always caches. - - * Removed _param_ in route callbacks, signature is now - simply (req, res, next), previously (req, res, params, next). - Use _req.params_ for path captures, _req.query_ for GET params. - - * Fixed "home" setting - * Fixed middleware/router precedence issue. Closes #366 - * Fixed; _configure()_ callbacks called immediately. Closes #368 - -1.0.0beta2 / 2010-07-23 -================== - - * Added more examples - * Added; exporting `Server` constructor - * Added `Server#helpers()` for view locals - * Added `Server#dynamicHelpers()` for dynamic view locals. Closes #349 - * Added support for absolute view paths - * Added; _home_ setting defaults to `Server#route` for mounted apps. Closes #363 - * Added Guillermo Rauch to the contributor list - * Added support for "as" for non-collection partials. Closes #341 - * Fixed _install.sh_, ensuring _~/.node_libraries_ exists. Closes #362 [thanks jf] - * Fixed `res.render()` exceptions, now passed to `next()` when no callback is given [thanks guillermo] - * Fixed instanceof `Array` checks, now `Array.isArray()` - * Fixed express(1) expansion of public dirs. Closes #348 - * Fixed middleware precedence. Closes #345 - * Fixed view watcher, now async [thanks aheckmann] - -1.0.0beta / 2010-07-15 -================== - - * Re-write - - much faster - - much lighter - - Check [ExpressJS.com](http://expressjs.com) for migration guide and updated docs - -0.14.0 / 2010-06-15 -================== - - * Utilize relative requires - * Added Static bufferSize option [aheckmann] - * Fixed caching of view and partial subdirectories [aheckmann] - * Fixed mime.type() comments now that ".ext" is not supported - * Updated haml submodule - * Updated class submodule - * Removed bin/express - -0.13.0 / 2010-06-01 -================== - - * Added node v0.1.97 compatibility - * Added support for deleting cookies via Request#cookie('key', null) - * Updated haml submodule - * Fixed not-found page, now using using charset utf-8 - * Fixed show-exceptions page, now using using charset utf-8 - * Fixed view support due to fs.readFile Buffers - * Changed; mime.type() no longer accepts ".type" due to node extname() changes - -0.12.0 / 2010-05-22 -================== - - * Added node v0.1.96 compatibility - * Added view `helpers` export which act as additional local variables - * Updated haml submodule - * Changed ETag; removed inode, modified time only - * Fixed LF to CRLF for setting multiple cookies - * Fixed cookie complation; values are now urlencoded - * Fixed cookies parsing; accepts quoted values and url escaped cookies - -0.11.0 / 2010-05-06 -================== - - * Added support for layouts using different engines - - this.render('page.html.haml', { layout: 'super-cool-layout.html.ejs' }) - - this.render('page.html.haml', { layout: 'foo' }) // assumes 'foo.html.haml' - - this.render('page.html.haml', { layout: false }) // no layout - * Updated ext submodule - * Updated haml submodule - * Fixed EJS partial support by passing along the context. Issue #307 - -0.10.1 / 2010-05-03 -================== - - * Fixed binary uploads. - -0.10.0 / 2010-04-30 -================== - - * Added charset support via Request#charset (automatically assigned to 'UTF-8' when respond()'s - encoding is set to 'utf8' or 'utf-8'. - * Added "encoding" option to Request#render(). Closes #299 - * Added "dump exceptions" setting, which is enabled by default. - * Added simple ejs template engine support - * Added error reponse support for text/plain, application/json. Closes #297 - * Added callback function param to Request#error() - * Added Request#sendHead() - * Added Request#stream() - * Added support for Request#respond(304, null) for empty response bodies - * Added ETag support to Request#sendfile() - * Added options to Request#sendfile(), passed to fs.createReadStream() - * Added filename arg to Request#download() - * Performance enhanced due to pre-reversing plugins so that plugins.reverse() is not called on each request - * Performance enhanced by preventing several calls to toLowerCase() in Router#match() - * Changed; Request#sendfile() now streams - * Changed; Renamed Request#halt() to Request#respond(). Closes #289 - * Changed; Using sys.inspect() instead of JSON.encode() for error output - * Changed; run() returns the http.Server instance. Closes #298 - * Changed; Defaulting Server#host to null (INADDR_ANY) - * Changed; Logger "common" format scale of 0.4f - * Removed Logger "request" format - * Fixed; Catching ENOENT in view caching, preventing error when "views/partials" is not found - * Fixed several issues with http client - * Fixed Logger Content-Length output - * Fixed bug preventing Opera from retaining the generated session id. Closes #292 - -0.9.0 / 2010-04-14 -================== - - * Added DSL level error() route support - * Added DSL level notFound() route support - * Added Request#error() - * Added Request#notFound() - * Added Request#render() callback function. Closes #258 - * Added "max upload size" setting - * Added "magic" variables to collection partials (\_\_index\_\_, \_\_length\_\_, \_\_isFirst\_\_, \_\_isLast\_\_). Closes #254 - * Added [haml.js](http://github.com/visionmedia/haml.js) submodule; removed haml-js - * Added callback function support to Request#halt() as 3rd/4th arg - * Added preprocessing of route param wildcards using param(). Closes #251 - * Added view partial support (with collections etc) - * Fixed bug preventing falsey params (such as ?page=0). Closes #286 - * Fixed setting of multiple cookies. Closes #199 - * Changed; view naming convention is now NAME.TYPE.ENGINE (for example page.html.haml) - * Changed; session cookie is now httpOnly - * Changed; Request is no longer global - * Changed; Event is no longer global - * Changed; "sys" module is no longer global - * Changed; moved Request#download to Static plugin where it belongs - * Changed; Request instance created before body parsing. Closes #262 - * Changed; Pre-caching views in memory when "cache view contents" is enabled. Closes #253 - * Changed; Pre-caching view partials in memory when "cache view partials" is enabled - * Updated support to node --version 0.1.90 - * Updated dependencies - * Removed set("session cookie") in favour of use(Session, { cookie: { ... }}) - * Removed utils.mixin(); use Object#mergeDeep() - -0.8.0 / 2010-03-19 -================== - - * Added coffeescript example app. Closes #242 - * Changed; cache api now async friendly. Closes #240 - * Removed deprecated 'express/static' support. Use 'express/plugins/static' - -0.7.6 / 2010-03-19 -================== - - * Added Request#isXHR. Closes #229 - * Added `make install` (for the executable) - * Added `express` executable for setting up simple app templates - * Added "GET /public/*" to Static plugin, defaulting to /public - * Added Static plugin - * Fixed; Request#render() only calls cache.get() once - * Fixed; Namespacing View caches with "view:" - * Fixed; Namespacing Static caches with "static:" - * Fixed; Both example apps now use the Static plugin - * Fixed set("views"). Closes #239 - * Fixed missing space for combined log format - * Deprecated Request#sendfile() and 'express/static' - * Removed Server#running - -0.7.5 / 2010-03-16 -================== - - * Added Request#flash() support without args, now returns all flashes - * Updated ext submodule - -0.7.4 / 2010-03-16 -================== - - * Fixed session reaper - * Changed; class.js replacing js-oo Class implementation (quite a bit faster, no browser cruft) - -0.7.3 / 2010-03-16 -================== - - * Added package.json - * Fixed requiring of haml / sass due to kiwi removal - -0.7.2 / 2010-03-16 -================== - - * Fixed GIT submodules (HAH!) - -0.7.1 / 2010-03-16 -================== - - * Changed; Express now using submodules again until a PM is adopted - * Changed; chat example using millisecond conversions from ext - -0.7.0 / 2010-03-15 -================== - - * Added Request#pass() support (finds the next matching route, or the given path) - * Added Logger plugin (default "common" format replaces CommonLogger) - * Removed Profiler plugin - * Removed CommonLogger plugin - -0.6.0 / 2010-03-11 -================== - - * Added seed.yml for kiwi package management support - * Added HTTP client query string support when method is GET. Closes #205 - - * Added support for arbitrary view engines. - For example "foo.engine.html" will now require('engine'), - the exports from this module are cached after the first require(). - - * Added async plugin support - - * Removed usage of RESTful route funcs as http client - get() etc, use http.get() and friends - - * Removed custom exceptions - -0.5.0 / 2010-03-10 -================== - - * Added ext dependency (library of js extensions) - * Removed extname() / basename() utils. Use path module - * Removed toArray() util. Use arguments.values - * Removed escapeRegexp() util. Use RegExp.escape() - * Removed process.mixin() dependency. Use utils.mixin() - * Removed Collection - * Removed ElementCollection - * Shameless self promotion of ebook "Advanced JavaScript" (http://dev-mag.com) ;) - -0.4.0 / 2010-02-11 -================== - - * Added flash() example to sample upload app - * Added high level restful http client module (express/http) - * Changed; RESTful route functions double as HTTP clients. Closes #69 - * Changed; throwing error when routes are added at runtime - * Changed; defaulting render() context to the current Request. Closes #197 - * Updated haml submodule - -0.3.0 / 2010-02-11 -================== - - * Updated haml / sass submodules. Closes #200 - * Added flash message support. Closes #64 - * Added accepts() now allows multiple args. fixes #117 - * Added support for plugins to halt. Closes #189 - * Added alternate layout support. Closes #119 - * Removed Route#run(). Closes #188 - * Fixed broken specs due to use(Cookie) missing - -0.2.1 / 2010-02-05 -================== - - * Added "plot" format option for Profiler (for gnuplot processing) - * Added request number to Profiler plugin - * Fixed binary encoding for multi-part file uploads, was previously defaulting to UTF8 - * Fixed issue with routes not firing when not files are present. Closes #184 - * Fixed process.Promise -> events.Promise - -0.2.0 / 2010-02-03 -================== - - * Added parseParam() support for name[] etc. (allows for file inputs with "multiple" attr) Closes #180 - * Added Both Cache and Session option "reapInterval" may be "reapEvery". Closes #174 - * Added expiration support to cache api with reaper. Closes #133 - * Added cache Store.Memory#reap() - * Added Cache; cache api now uses first class Cache instances - * Added abstract session Store. Closes #172 - * Changed; cache Memory.Store#get() utilizing Collection - * Renamed MemoryStore -> Store.Memory - * Fixed use() of the same plugin several time will always use latest options. Closes #176 - -0.1.0 / 2010-02-03 -================== - - * Changed; Hooks (before / after) pass request as arg as well as evaluated in their context - * Updated node support to 0.1.27 Closes #169 - * Updated dirname(__filename) -> __dirname - * Updated libxmljs support to v0.2.0 - * Added session support with memory store / reaping - * Added quick uid() helper - * Added multi-part upload support - * Added Sass.js support / submodule - * Added production env caching view contents and static files - * Added static file caching. Closes #136 - * Added cache plugin with memory stores - * Added support to StaticFile so that it works with non-textual files. - * Removed dirname() helper - * Removed several globals (now their modules must be required) - -0.0.2 / 2010-01-10 -================== - - * Added view benchmarks; currently haml vs ejs - * Added Request#attachment() specs. Closes #116 - * Added use of node's parseQuery() util. Closes #123 - * Added `make init` for submodules - * Updated Haml - * Updated sample chat app to show messages on load - * Updated libxmljs parseString -> parseHtmlString - * Fixed `make init` to work with older versions of git - * Fixed specs can now run independant specs for those who cant build deps. Closes #127 - * Fixed issues introduced by the node url module changes. Closes 126. - * Fixed two assertions failing due to Collection#keys() returning strings - * Fixed faulty Collection#toArray() spec due to keys() returning strings - * Fixed `make test` now builds libxmljs.node before testing - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/usb_auth/node_modules/express/LICENSE b/usb_auth/node_modules/express/LICENSE deleted file mode 100644 index 36075a3..0000000 --- a/usb_auth/node_modules/express/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2009-2011 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/express/Makefile b/usb_auth/node_modules/express/Makefile deleted file mode 100644 index dfbfd67..0000000 --- a/usb_auth/node_modules/express/Makefile +++ /dev/null @@ -1,29 +0,0 @@ - -DOCS = $(shell find docs/*.md) -HTMLDOCS = $(DOCS:.md=.html) -TESTS = $(shell find test/*.test.js) - -test: - @NODE_ENV=test ./node_modules/.bin/expresso $(TESTS) - -docs: $(HTMLDOCS) - @ echo "... generating TOC" - @./support/toc.js docs/guide.html - -%.html: %.md - @echo "... $< -> $@" - @markdown $< \ - | cat docs/layout/head.html - docs/layout/foot.html \ - > $@ - -site: - rm -fr /tmp/docs \ - && cp -fr docs /tmp/docs \ - && git checkout gh-pages \ - && cp -fr /tmp/docs/* . \ - && echo "done" - -docclean: - rm -f docs/*.{1,html} - -.PHONY: site test docs docclean \ No newline at end of file diff --git a/usb_auth/node_modules/express/Readme.md b/usb_auth/node_modules/express/Readme.md deleted file mode 100644 index d2c64c7..0000000 --- a/usb_auth/node_modules/express/Readme.md +++ /dev/null @@ -1,145 +0,0 @@ - -# Express - - Insanely fast (and small) server-side JavaScript web development framework - built on [node](http://nodejs.org) and [Connect](http://github.com/senchalabs/connect). - - var app = express.createServer(); - - app.get('/', function(req, res){ - res.send('Hello World'); - }); - - app.listen(3000); - -## Installation - - $ npm install express - -or to access the `express(1)` executable install globally: - - $ npm install -g express - -## Quick Start - - The quickest way to get started with express is to utilize the executable `express(1)` to generate an application as shown below: - - Create the app: - - $ npm install -g express - $ express /tmp/foo && cd /tmp/foo - - Install dependencies: - - $ npm install -d - - Start the server: - - $ node app.js - -## Features - - * Robust routing - * Redirection helpers - * Dynamic view helpers - * Content negotiation - * Focus on high performance - * View rendering and partials support - * Environment based configuration - * Session based flash notifications - * Built on [Connect](http://github.com/senchalabs/connect) - * High test coverage - * Executable for generating applications quickly - * Application level view options - -Via Connect: - - * Session support - * Cache API - * Mime helpers - * ETag support - * Persistent flash notifications - * Cookie support - * JSON-RPC - * Logging - * and _much_ more! - -## Contributors - -The following are the major contributors of Express (in no specific order). - - * TJ Holowaychuk ([visionmedia](http://github.com/visionmedia)) - * Ciaran Jessup ([ciaranj](http://github.com/ciaranj)) - * Aaron Heckmann ([aheckmann](http://github.com/aheckmann)) - * Guillermo Rauch ([guille](http://github.com/guille)) - -## More Information - - * #express on freenode - * [express-expose](http://github.com/visionmedia/express-expose) expose objects, functions, modules and more to client-side js with ease - * [express-configure](http://github.com/visionmedia/express-configuration) async configuration support - * [express-messages](http://github.com/visionmedia/express-messages) flash notification rendering helper - * [express-namespace](http://github.com/visionmedia/express-namespace) namespaced route support - * [express-params](https://github.com/visionmedia/express-params) param pre-condition functions - * [express-mongoose](https://github.com/LearnBoost/express-mongoose) plugin for easy rendering of Mongoose async Query results - * Follow [tjholowaychuk](http://twitter.com/tjholowaychuk) on twitter for updates - * [Google Group](http://groups.google.com/group/express-js) for discussion - * Visit the [Wiki](http://github.com/visionmedia/express/wiki) - * [日本語ドキュメンテーション](http://hideyukisaito.com/doc/expressjs/) by [hideyukisaito](https://github.com/hideyukisaito) - * Screencast - [Introduction](http://bit.ly/eRYu0O) - * Screencast - [View Partials](http://bit.ly/dU13Fx) - * Screencast - [Route Specific Middleware](http://bit.ly/hX4IaH) - * Screencast - [Route Path Placeholder Preconditions](http://bit.ly/eNqmVs) - -## Node Compatibility - -Express 1.x is compatible with node 0.2.x and connect < 1.0. - -Express 2.x is compatible with node 0.4.x or 0.6.x, and connect 1.x - -Express 3.x (master) will be compatible with node 0.6.x and connect 2.x - -## Viewing Examples - -First install the dev dependencies to install all the example / test suite deps: - - $ npm install - -then run whichever tests you want: - - $ node examples/jade/app.js - -## Running Tests - -To run the test suite first invoke the following command within the repo, installing the development dependencies: - - $ npm install - -then run the tests: - - $ make test - -## License - -(The MIT License) - -Copyright (c) 2009-2011 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/usb_auth/node_modules/express/bin/express b/usb_auth/node_modules/express/bin/express deleted file mode 100755 index 2c902c3..0000000 --- a/usb_auth/node_modules/express/bin/express +++ /dev/null @@ -1,416 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var fs = require('fs') - , os = require('os') - , exec = require('child_process').exec - , mkdirp = require('mkdirp'); - -/** - * Framework version. - */ - -var version = '2.5.8'; - -/** - * Add session support. - */ - -var sessions = false; - -/** - * CSS engine to utilize. - */ - -var cssEngine; - -/** - * End-of-line code. - */ - -var eol = os.platform - ? ('win32' == os.platform() ? '\r\n' : '\n') - : '\n'; - -/** - * Template engine to utilize. - */ - -var templateEngine = 'jade'; - -/** - * Usage documentation. - */ - -var usage = '' - + '\n' - + ' Usage: express [options] [path]\n' - + '\n' - + ' Options:\n' - + ' -s, --sessions add session support\n' - + ' -t, --template add template support (jade|ejs). default=jade\n' - + ' -c, --css add stylesheet support (stylus). default=plain css\n' - + ' -v, --version output framework version\n' - + ' -h, --help output help information\n' - ; - -/** - * Routes index template. - */ - -var index = [ - '' - , '/*' - , ' * GET home page.' - , ' */' - , '' - , 'exports.index = function(req, res){' - , ' res.render(\'index\', { title: \'Express\' })' - , '};' -].join(eol); - -/** - * Jade layout template. - */ - -var jadeLayout = [ - '!!!' - , 'html' - , ' head' - , ' title= title' - , ' link(rel=\'stylesheet\', href=\'/stylesheets/style.css\')' - , ' body!= body' -].join(eol); - -/** - * Jade index template. - */ - -var jadeIndex = [ - 'h1= title' - , 'p Welcome to #{title}' -].join(eol); - -/** - * EJS layout template. - */ - -var ejsLayout = [ - '' - , '' - , ' ' - , ' <%= title %>' - , ' ' - , ' ' - , ' ' - , ' <%- body %>' - , ' ' - , '' -].join(eol); - -/** - * EJS index template. - */ - -var ejsIndex = [ - '

    <%= title %>

    ' - , '

    Welcome to <%= title %>

    ' - ].join(eol); - -/** - * Default css template. - */ - -var css = [ - 'body {' - , ' padding: 50px;' - , ' font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;' - , '}' - , '' - , 'a {' - , ' color: #00B7FF;' - , '}' -].join(eol); - -/** - * Default stylus template. - */ - -var stylus = [ - 'body' - , ' padding: 50px' - , ' font: 14px "Lucida Grande", Helvetica, Arial, sans-serif' - , 'a' - , ' color: #00B7FF' -].join(eol); - -/** - * App template. - */ - -var app = [ - '' - , '/**' - , ' * Module dependencies.' - , ' */' - , '' - , 'var express = require(\'express\')' - , ' , routes = require(\'./routes\');' - , '' - , 'var app = module.exports = express.createServer();' - , '' - , '// Configuration' - , '' - , 'app.configure(function(){' - , ' app.set(\'views\', __dirname + \'/views\');' - , ' app.set(\'view engine\', \':TEMPLATE\');' - , ' app.use(express.bodyParser());' - , ' app.use(express.methodOverride());{sess}{css}' - , ' app.use(app.router);' - , ' app.use(express.static(__dirname + \'/public\'));' - , '});' - , '' - , 'app.configure(\'development\', function(){' - , ' app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));' - , '});' - , '' - , 'app.configure(\'production\', function(){' - , ' app.use(express.errorHandler());' - , '});' - , '' - , '// Routes' - , '' - , 'app.get(\'/\', routes.index);' - , '' - , 'app.listen(3000);' - , 'console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);' - , '' -].join(eol); - -// Parse arguments - -var args = process.argv.slice(2) - , path = '.'; - -while (args.length) { - var arg = args.shift(); - switch (arg) { - case '-h': - case '--help': - abort(usage); - break; - case '-v': - case '--version': - abort(version); - break; - case '-s': - case '--session': - case '--sessions': - sessions = true; - break; - case '-c': - case '--css': - args.length - ? (cssEngine = args.shift()) - : abort('--css requires an argument'); - break; - case '-t': - case '--template': - args.length - ? (templateEngine = args.shift()) - : abort('--template requires an argument'); - break; - default: - path = arg; - } -} - -// Generate application - -(function createApplication(path) { - emptyDirectory(path, function(empty){ - if (empty) { - createApplicationAt(path); - } else { - confirm('destination is not empty, continue? ', function(ok){ - if (ok) { - process.stdin.destroy(); - createApplicationAt(path); - } else { - abort('aborting'); - } - }); - } - }); -})(path); - -/** - * Create application at the given directory `path`. - * - * @param {String} path - */ - -function createApplicationAt(path) { - console.log(); - process.on('exit', function(){ - console.log(); - console.log(' dont forget to install dependencies:'); - console.log(' $ cd %s && npm install', path); - console.log(); - }); - - mkdir(path, function(){ - mkdir(path + '/public'); - mkdir(path + '/public/javascripts'); - mkdir(path + '/public/images'); - mkdir(path + '/public/stylesheets', function(){ - switch (cssEngine) { - case 'stylus': - write(path + '/public/stylesheets/style.styl', stylus); - break; - default: - write(path + '/public/stylesheets/style.css', css); - } - }); - - mkdir(path + '/routes', function(){ - write(path + '/routes/index.js', index); - }); - - mkdir(path + '/views', function(){ - switch (templateEngine) { - case 'ejs': - write(path + '/views/layout.ejs', ejsLayout); - write(path + '/views/index.ejs', ejsIndex); - break; - case 'jade': - write(path + '/views/layout.jade', jadeLayout); - write(path + '/views/index.jade', jadeIndex); - break; - } - }); - - // CSS Engine support - switch (cssEngine) { - case 'stylus': - app = app.replace('{css}', eol + ' app.use(require(\'stylus\').middleware({ src: __dirname + \'/public\' }));'); - break; - default: - app = app.replace('{css}', ''); - } - - // Session support - app = app.replace('{sess}', sessions - ? eol + ' app.use(express.cookieParser());' + eol + ' app.use(express.session({ secret: \'your secret here\' }));' - : ''); - - // Template support - app = app.replace(':TEMPLATE', templateEngine); - - // package.json - var json = '{' + eol; - json += ' "name": "application-name"' + eol; - json += ' , "version": "0.0.1"' + eol; - json += ' , "private": true' + eol; - json += ' , "dependencies": {' + eol; - json += ' "express": "' + version + '"' + eol; - if (cssEngine) json += ' , "' + cssEngine + '": ">= 0.0.1"' + eol; - if (templateEngine) json += ' , "' + templateEngine + '": ">= 0.0.1"' + eol; - json += ' }' + eol; - json += '}'; - - - write(path + '/package.json', json); - write(path + '/app.js', app); - }); -} - -/** - * Check if the given directory `path` is empty. - * - * @param {String} path - * @param {Function} fn - */ - -function emptyDirectory(path, fn) { - fs.readdir(path, function(err, files){ - if (err && 'ENOENT' != err.code) throw err; - fn(!files || !files.length); - }); -} - -/** - * echo str > path. - * - * @param {String} path - * @param {String} str - */ - -function write(path, str) { - fs.writeFile(path, str); - console.log(' \x1b[36mcreate\x1b[0m : ' + path); -} - -/** - * Prompt confirmation with the given `msg`. - * - * @param {String} msg - * @param {Function} fn - */ - -function confirm(msg, fn) { - prompt(msg, function(val){ - fn(/^ *y(es)?/i.test(val)); - }); -} - -/** - * Prompt input with the given `msg` and callback `fn`. - * - * @param {String} msg - * @param {Function} fn - */ - -function prompt(msg, fn) { - // prompt - if (' ' == msg[msg.length - 1]) { - process.stdout.write(msg); - } else { - console.log(msg); - } - - // stdin - process.stdin.setEncoding('ascii'); - process.stdin.once('data', function(data){ - fn(data); - }).resume(); -} - -/** - * Mkdir -p. - * - * @param {String} path - * @param {Function} fn - */ - -function mkdir(path, fn) { - mkdirp(path, 0755, function(err){ - if (err) throw err; - console.log(' \033[36mcreate\033[0m : ' + path); - fn && fn(); - }); -} - -/** - * Exit with the given `str`. - * - * @param {String} str - */ - -function abort(str) { - console.error(str); - process.exit(1); -} diff --git a/usb_auth/node_modules/express/index.js b/usb_auth/node_modules/express/index.js deleted file mode 100644 index 8d81ea7..0000000 --- a/usb_auth/node_modules/express/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/express'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/lib/express.js b/usb_auth/node_modules/express/lib/express.js deleted file mode 100644 index 0a0d5ad..0000000 --- a/usb_auth/node_modules/express/lib/express.js +++ /dev/null @@ -1,79 +0,0 @@ - -/*! - * Express - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var connect = require('connect') - , HTTPSServer = require('./https') - , HTTPServer = require('./http') - , Route = require('./router/route') - -/** - * Re-export connect auto-loaders. - * - * This prevents the need to `require('connect')` in order - * to access core middleware, so for example `express.logger()` instead - * of `require('connect').logger()`. - */ - -var exports = module.exports = connect.middleware; - -/** - * Framework version. - */ - -exports.version = '2.5.8'; - -/** - * Shortcut for `new Server(...)`. - * - * @param {Function} ... - * @return {Server} - * @api public - */ - -exports.createServer = function(options){ - if ('object' == typeof options) { - return new HTTPSServer(options, Array.prototype.slice.call(arguments, 1)); - } else { - return new HTTPServer(Array.prototype.slice.call(arguments)); - } -}; - -/** - * Expose constructors. - */ - -exports.HTTPServer = HTTPServer; -exports.HTTPSServer = HTTPSServer; -exports.Route = Route; - -/** - * View extensions. - */ - -exports.View = -exports.view = require('./view'); - -/** - * Response extensions. - */ - -require('./response'); - -/** - * Request extensions. - */ - -require('./request'); - -// Error handler title - -exports.errorHandler.title = 'Express'; - diff --git a/usb_auth/node_modules/express/lib/http.js b/usb_auth/node_modules/express/lib/http.js deleted file mode 100644 index da2158f..0000000 --- a/usb_auth/node_modules/express/lib/http.js +++ /dev/null @@ -1,582 +0,0 @@ -/*! - * Express - HTTPServer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var qs = require('qs') - , connect = require('connect') - , router = require('./router') - , Router = require('./router') - , view = require('./view') - , toArray = require('./utils').toArray - , methods = router.methods.concat('del', 'all') - , url = require('url') - , utils = connect.utils; - -/** - * Expose `HTTPServer`. - */ - -exports = module.exports = HTTPServer; - -/** - * Server proto. - */ - -var app = HTTPServer.prototype; - -/** - * Initialize a new `HTTPServer` with optional `middleware`. - * - * @param {Array} middleware - * @api public - */ - -function HTTPServer(middleware){ - connect.HTTPServer.call(this, []); - this.init(middleware); -}; - -/** - * Inherit from `connect.HTTPServer`. - */ - -app.__proto__ = connect.HTTPServer.prototype; - -/** - * Initialize the server. - * - * @param {Array} middleware - * @api private - */ - -app.init = function(middleware){ - var self = this; - this.cache = {}; - this.settings = {}; - this.redirects = {}; - this.isCallbacks = {}; - this._locals = {}; - this.dynamicViewHelpers = {}; - this.errorHandlers = []; - - this.set('env', process.env.NODE_ENV || 'development'); - - // expose objects to each other - this.use(function(req, res, next){ - req.query = req.query || {}; - res.setHeader('X-Powered-By', 'Express'); - req.app = res.app = self; - req.res = res; - res.req = req; - req.next = next; - // assign req.query - if (req.url.indexOf('?') > 0) { - var query = url.parse(req.url).query; - req.query = qs.parse(query); - } - next(); - }); - - // apply middleware - if (middleware) middleware.forEach(self.use.bind(self)); - - // router - this.routes = new Router(this); - this.__defineGetter__('router', function(){ - this.__usedRouter = true; - return self.routes.middleware; - }); - - // default locals - this.locals({ - settings: this.settings - , app: this - }); - - // default development configuration - this.configure('development', function(){ - this.enable('hints'); - }); - - // default production configuration - this.configure('production', function(){ - this.enable('view cache'); - }); - - // register error handlers on "listening" - // so that they disregard definition position. - this.on('listening', this.registerErrorHandlers.bind(this)); - - // route manipulation methods - methods.forEach(function(method){ - self.lookup[method] = function(path){ - return self.routes.lookup(method, path); - }; - - self.match[method] = function(path){ - return self.routes.match(method, path); - }; - - self.remove[method] = function(path){ - return self.routes.lookup(method, path).remove(); - }; - }); - - // del -> delete - self.lookup.del = self.lookup.delete; - self.match.del = self.match.delete; - self.remove.del = self.remove.delete; -}; - -/** - * Remove routes matching the given `path`. - * - * @param {Route} path - * @return {Boolean} - * @api public - */ - -app.remove = function(path){ - return this.routes.lookup('all', path).remove(); -}; - -/** - * Lookup routes defined with a path - * equivalent to `path`. - * - * @param {Stirng} path - * @return {Array} - * @api public - */ - -app.lookup = function(path){ - return this.routes.lookup('all', path); -}; - -/** - * Lookup routes matching the given `url`. - * - * @param {Stirng} url - * @return {Array} - * @api public - */ - -app.match = function(url){ - return this.routes.match('all', url); -}; - -/** - * When using the vhost() middleware register error handlers. - */ - -app.onvhost = function(){ - this.registerErrorHandlers(); -}; - -/** - * Register error handlers. - * - * @return {Server} for chaining - * @api public - */ - -app.registerErrorHandlers = function(){ - this.errorHandlers.forEach(function(fn){ - this.use(function(err, req, res, next){ - fn.apply(this, arguments); - }); - }, this); - return this; -}; - -/** - * Proxy `connect.HTTPServer#use()` to apply settings to - * mounted applications. - * - * @param {String|Function|Server} route - * @param {Function|Server} middleware - * @return {Server} for chaining - * @api public - */ - -app.use = function(route, middleware){ - var app, base, handle; - - if ('string' != typeof route) { - middleware = route, route = '/'; - } - - // express app - if (middleware.handle && middleware.set) app = middleware; - - // restore .app property on req and res - if (app) { - app.route = route; - middleware = function(req, res, next) { - var orig = req.app; - app.handle(req, res, function(err){ - req.app = res.app = orig; - next(err); - }); - }; - } - - connect.HTTPServer.prototype.use.call(this, route, middleware); - - // mounted an app, invoke the hook - // and adjust some settings - if (app) { - base = this.set('basepath') || this.route; - if ('/' == base) base = ''; - base = base + (app.set('basepath') || app.route); - app.set('basepath', base); - app.parent = this; - if (app.__mounted) app.__mounted.call(app, this); - } - - return this; -}; - -/** - * Assign a callback `fn` which is called - * when this `Server` is passed to `Server#use()`. - * - * Examples: - * - * var app = express.createServer() - * , blog = express.createServer(); - * - * blog.mounted(function(parent){ - * // parent is app - * // "this" is blog - * }); - * - * app.use(blog); - * - * @param {Function} fn - * @return {Server} for chaining - * @api public - */ - -app.mounted = function(fn){ - this.__mounted = fn; - return this; -}; - -/** - * See: view.register. - * - * @return {Server} for chaining - * @api public - */ - -app.register = function(){ - view.register.apply(this, arguments); - return this; -}; - -/** - * Register the given view helpers `obj`. This method - * can be called several times to apply additional helpers. - * - * @param {Object} obj - * @return {Server} for chaining - * @api public - */ - -app.helpers = -app.locals = function(obj){ - utils.merge(this._locals, obj); - return this; -}; - -/** - * Register the given dynamic view helpers `obj`. This method - * can be called several times to apply additional helpers. - * - * @param {Object} obj - * @return {Server} for chaining - * @api public - */ - -app.dynamicHelpers = function(obj){ - utils.merge(this.dynamicViewHelpers, obj); - return this; -}; - -/** - * Map the given param placeholder `name`(s) to the given callback(s). - * - * Param mapping is used to provide pre-conditions to routes - * which us normalized placeholders. This callback has the same - * signature as regular middleware, for example below when ":userId" - * is used this function will be invoked in an attempt to load the user. - * - * app.param('userId', function(req, res, next, id){ - * User.find(id, function(err, user){ - * if (err) { - * next(err); - * } else if (user) { - * req.user = user; - * next(); - * } else { - * next(new Error('failed to load user')); - * } - * }); - * }); - * - * Passing a single function allows you to map logic - * to the values passed to `app.param()`, for example - * this is useful to provide coercion support in a concise manner. - * - * The following example maps regular expressions to param values - * ensuring that they match, otherwise passing control to the next - * route: - * - * app.param(function(name, regexp){ - * if (regexp instanceof RegExp) { - * return function(req, res, next, val){ - * var captures; - * if (captures = regexp.exec(String(val))) { - * req.params[name] = captures; - * next(); - * } else { - * next('route'); - * } - * } - * } - * }); - * - * We can now use it as shown below, where "/commit/:commit" expects - * that the value for ":commit" is at 5 or more digits. The capture - * groups are then available as `req.params.commit` as we defined - * in the function above. - * - * app.param('commit', /^\d{5,}$/); - * - * For more of this useful functionality take a look - * at [express-params](http://github.com/visionmedia/express-params). - * - * @param {String|Array|Function} name - * @param {Function} fn - * @return {Server} for chaining - * @api public - */ - -app.param = function(name, fn){ - var self = this - , fns = [].slice.call(arguments, 1); - - // array - if (Array.isArray(name)) { - name.forEach(function(name){ - fns.forEach(function(fn){ - self.param(name, fn); - }); - }); - // param logic - } else if ('function' == typeof name) { - this.routes.param(name); - // single - } else { - if (':' == name[0]) name = name.substr(1); - fns.forEach(function(fn){ - self.routes.param(name, fn); - }); - } - - return this; -}; - -/** - * Assign a custom exception handler callback `fn`. - * These handlers are always _last_ in the middleware stack. - * - * @param {Function} fn - * @return {Server} for chaining - * @api public - */ - -app.error = function(fn){ - this.errorHandlers.push(fn); - return this; -}; - -/** - * Register the given callback `fn` for the given `type`. - * - * @param {String} type - * @param {Function} fn - * @return {Server} for chaining - * @api public - */ - -app.is = function(type, fn){ - if (!fn) return this.isCallbacks[type]; - this.isCallbacks[type] = fn; - return this; -}; - -/** - * Assign `setting` to `val`, or return `setting`'s value. - * Mounted servers inherit their parent server's settings. - * - * @param {String} setting - * @param {String} val - * @return {Server|Mixed} for chaining, or the setting value - * @api public - */ - -app.set = function(setting, val){ - if (val === undefined) { - if (this.settings.hasOwnProperty(setting)) { - return this.settings[setting]; - } else if (this.parent) { - return this.parent.set(setting); - } - } else { - this.settings[setting] = val; - return this; - } -}; - -/** - * Check if `setting` is enabled. - * - * @param {String} setting - * @return {Boolean} - * @api public - */ - -app.enabled = function(setting){ - return !!this.set(setting); -}; - -/** - * Check if `setting` is disabled. - * - * @param {String} setting - * @return {Boolean} - * @api public - */ - -app.disabled = function(setting){ - return !this.set(setting); -}; - -/** - * Enable `setting`. - * - * @param {String} setting - * @return {Server} for chaining - * @api public - */ - -app.enable = function(setting){ - return this.set(setting, true); -}; - -/** - * Disable `setting`. - * - * @param {String} setting - * @return {Server} for chaining - * @api public - */ - -app.disable = function(setting){ - return this.set(setting, false); -}; - -/** - * Redirect `key` to `url`. - * - * @param {String} key - * @param {String} url - * @return {Server} for chaining - * @api public - */ - -app.redirect = function(key, url){ - this.redirects[key] = url; - return this; -}; - -/** - * Configure callback for zero or more envs, - * when no env is specified that callback will - * be invoked for all environments. Any combination - * can be used multiple times, in any order desired. - * - * Examples: - * - * app.configure(function(){ - * // executed for all envs - * }); - * - * app.configure('stage', function(){ - * // executed staging env - * }); - * - * app.configure('stage', 'production', function(){ - * // executed for stage and production - * }); - * - * @param {String} env... - * @param {Function} fn - * @return {Server} for chaining - * @api public - */ - -app.configure = function(env, fn){ - var envs = 'all' - , args = toArray(arguments); - fn = args.pop(); - if (args.length) envs = args; - if ('all' == envs || ~envs.indexOf(this.settings.env)) fn.call(this); - return this; -}; - -/** - * Delegate `.VERB(...)` calls to `.route(VERB, ...)`. - */ - -methods.forEach(function(method){ - app[method] = function(path){ - if (1 == arguments.length) return this.routes.lookup(method, path); - var args = [method].concat(toArray(arguments)); - if (!this.__usedRouter) this.use(this.router); - return this.routes._route.apply(this.routes, args); - } -}); - -/** - * Special-cased "all" method, applying the given route `path`, - * middleware, and callback to _every_ HTTP method. - * - * @param {String} path - * @param {Function} ... - * @return {Server} for chaining - * @api public - */ - -app.all = function(path){ - var args = arguments; - if (1 == args.length) return this.routes.lookup('all', path); - methods.forEach(function(method){ - if ('all' == method || 'del' == method) return; - app[method].apply(this, args); - }, this); - return this; -}; - -// del -> delete alias - -app.del = app.delete; - diff --git a/usb_auth/node_modules/express/lib/https.js b/usb_auth/node_modules/express/lib/https.js deleted file mode 100644 index 8a8c008..0000000 --- a/usb_auth/node_modules/express/lib/https.js +++ /dev/null @@ -1,52 +0,0 @@ - -/*! - * Express - HTTPSServer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var connect = require('connect') - , HTTPServer = require('./http') - , https = require('https'); - -/** - * Expose `HTTPSServer`. - */ - -exports = module.exports = HTTPSServer; - -/** - * Server proto. - */ - -var app = HTTPSServer.prototype; - -/** - * Initialize a new `HTTPSServer` with the - * given `options`, and optional `middleware`. - * - * @param {Object} options - * @param {Array} middleware - * @api public - */ - -function HTTPSServer(options, middleware){ - connect.HTTPSServer.call(this, options, []); - this.init(middleware); -}; - -/** - * Inherit from `connect.HTTPSServer`. - */ - -app.__proto__ = connect.HTTPSServer.prototype; - -// mixin HTTPServer methods - -Object.keys(HTTPServer.prototype).forEach(function(method){ - app[method] = HTTPServer.prototype[method]; -}); diff --git a/usb_auth/node_modules/express/lib/request.js b/usb_auth/node_modules/express/lib/request.js deleted file mode 100644 index 1d5ab40..0000000 --- a/usb_auth/node_modules/express/lib/request.js +++ /dev/null @@ -1,323 +0,0 @@ - -/*! - * Express - request - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , req = http.IncomingMessage.prototype - , utils = require('./utils') - , parse = require('url').parse - , mime = require('mime'); - -/** - * Default flash formatters. - * - * @type Object - */ - -var flashFormatters = exports.flashFormatters = { - s: function(val){ - return String(val); - } -}; - -/** - * Return request header or optional default. - * - * The `Referrer` header field is special-cased, - * both `Referrer` and `Referer` will yield are - * interchangeable. - * - * Examples: - * - * req.header('Content-Type'); - * // => "text/plain" - * - * req.header('content-type'); - * // => "text/plain" - * - * req.header('Accept'); - * // => undefined - * - * req.header('Accept', 'text/html'); - * // => "text/html" - * - * @param {String} name - * @param {String} defaultValue - * @return {String} - * @api public - */ - -req.header = function(name, defaultValue){ - switch (name = name.toLowerCase()) { - case 'referer': - case 'referrer': - return this.headers.referrer - || this.headers.referer - || defaultValue; - default: - return this.headers[name] || defaultValue; - } -}; - -/** - * Get `field`'s `param` value, defaulting to ''. - * - * Examples: - * - * req.get('content-disposition', 'filename'); - * // => "something.png" - * - * @param {String} field - * @param {String} param - * @return {String} - * @api public - */ - -req.get = function(field, param){ - var val = this.header(field); - if (!val) return ''; - var regexp = new RegExp(param + ' *= *(?:"([^"]+)"|([^;]+))', 'i'); - if (!regexp.exec(val)) return ''; - return RegExp.$1 || RegExp.$2; -}; - -/** - * Short-hand for `require('url').parse(req.url).pathname`. - * - * @return {String} - * @api public - */ - -req.__defineGetter__('path', function(){ - return parse(this.url).pathname; -}); - -/** - * Check if the _Accept_ header is present, and includes the given `type`. - * - * When the _Accept_ header is not present `true` is returned. Otherwise - * the given `type` is matched by an exact match, and then subtypes. You - * may pass the subtype such as "html" which is then converted internally - * to "text/html" using the mime lookup table. - * - * Examples: - * - * // Accept: text/html - * req.accepts('html'); - * // => true - * - * // Accept: text/*; application/json - * req.accepts('html'); - * req.accepts('text/html'); - * req.accepts('text/plain'); - * req.accepts('application/json'); - * // => true - * - * req.accepts('image/png'); - * req.accepts('png'); - * // => false - * - * @param {String} type - * @return {Boolean} - * @api public - */ - -req.accepts = function(type){ - var accept = this.header('Accept'); - - // normalize extensions ".json" -> "json" - if (type && '.' == type[0]) type = type.substr(1); - - // when Accept does not exist, or is '*/*' return true - if (!accept || '*/*' == accept) { - return true; - } else if (type) { - // allow "html" vs "text/html" etc - if (!~type.indexOf('/')) type = mime.lookup(type); - - // check if we have a direct match - if (~accept.indexOf(type)) return true; - - // check if we have type/* - type = type.split('/')[0] + '/*'; - return !!~accept.indexOf(type); - } else { - return false; - } -}; - -/** - * Return the value of param `name` when present or `defaultValue`. - * - * - Checks route placeholders, ex: _/user/:id_ - * - Checks query string params, ex: ?id=12 - * - Checks urlencoded body params, ex: id=12 - * - * To utilize urlencoded request bodies, `req.body` - * should be an object. This can be done by using - * the `connect.bodyParser` middleware. - * - * @param {String} name - * @param {Mixed} defaultValue - * @return {String} - * @api public - */ - -req.param = function(name, defaultValue){ - // route params like /user/:id - if (this.params && this.params.hasOwnProperty(name) && undefined !== this.params[name]) { - return this.params[name]; - } - // query string params - if (undefined !== this.query[name]) { - return this.query[name]; - } - // request body params via connect.bodyParser - if (this.body && undefined !== this.body[name]) { - return this.body[name]; - } - return defaultValue; -}; - -/** - * Queue flash `msg` of the given `type`. - * - * Examples: - * - * req.flash('info', 'email sent'); - * req.flash('error', 'email delivery failed'); - * req.flash('info', 'email re-sent'); - * // => 2 - * - * req.flash('info'); - * // => ['email sent', 'email re-sent'] - * - * req.flash('info'); - * // => [] - * - * req.flash(); - * // => { error: ['email delivery failed'], info: [] } - * - * Formatting: - * - * Flash notifications also support arbitrary formatting support. - * For example you may pass variable arguments to `req.flash()` - * and use the %s specifier to be replaced by the associated argument: - * - * req.flash('info', 'email has been sent to %s.', userName); - * - * To add custom formatters use the `exports.flashFormatters` object. - * - * @param {String} type - * @param {String} msg - * @return {Array|Object|Number} - * @api public - */ - -req.flash = function(type, msg){ - if (this.session === undefined) throw Error('req.flash() requires sessions'); - var msgs = this.session.flash = this.session.flash || {}; - if (type && msg) { - var i = 2 - , args = arguments - , formatters = this.app.flashFormatters || {}; - formatters.__proto__ = flashFormatters; - msg = utils.miniMarkdown(msg); - msg = msg.replace(/%([a-zA-Z])/g, function(_, format){ - var formatter = formatters[format]; - if (formatter) return formatter(utils.escape(args[i++])); - }); - return (msgs[type] = msgs[type] || []).push(msg); - } else if (type) { - var arr = msgs[type]; - delete msgs[type]; - return arr || []; - } else { - this.session.flash = {}; - return msgs; - } -}; - -/** - * Check if the incoming request contains the "Content-Type" - * header field, and it contains the give mime `type`. - * - * Examples: - * - * // With Content-Type: text/html; charset=utf-8 - * req.is('html'); - * req.is('text/html'); - * // => true - * - * // When Content-Type is application/json - * req.is('json'); - * req.is('application/json'); - * // => true - * - * req.is('html'); - * // => false - * - * Ad-hoc callbacks can also be registered with Express, to perform - * assertions again the request, for example if we need an expressive - * way to check if our incoming request is an image, we can register "an image" - * callback: - * - * app.is('an image', function(req){ - * return 0 == req.headers['content-type'].indexOf('image'); - * }); - * - * Now within our route callbacks, we can use to to assert content types - * such as "image/jpeg", "image/png", etc. - * - * app.post('/image/upload', function(req, res, next){ - * if (req.is('an image')) { - * // do something - * } else { - * next(); - * } - * }); - * - * @param {String} type - * @return {Boolean} - * @api public - */ - -req.is = function(type){ - var fn = this.app.is(type); - if (fn) return fn(this); - var ct = this.headers['content-type']; - if (!ct) return false; - ct = ct.split(';')[0]; - if (!~type.indexOf('/')) type = mime.lookup(type); - if (~type.indexOf('*')) { - type = type.split('/'); - ct = ct.split('/'); - if ('*' == type[0] && type[1] == ct[1]) return true; - if ('*' == type[1] && type[0] == ct[0]) return true; - return false; - } - return !! ~ct.indexOf(type); -}; - -// Callback for isXMLHttpRequest / xhr - -function isxhr() { - return this.header('X-Requested-With', '').toLowerCase() === 'xmlhttprequest'; -} - -/** - * Check if the request was an _XMLHttpRequest_. - * - * @return {Boolean} - * @api public - */ - -req.__defineGetter__('isXMLHttpRequest', isxhr); -req.__defineGetter__('xhr', isxhr); diff --git a/usb_auth/node_modules/express/lib/response.js b/usb_auth/node_modules/express/lib/response.js deleted file mode 100644 index a671771..0000000 --- a/usb_auth/node_modules/express/lib/response.js +++ /dev/null @@ -1,460 +0,0 @@ - -/*! - * Express - response - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , http = require('http') - , path = require('path') - , connect = require('connect') - , utils = connect.utils - , parseRange = require('./utils').parseRange - , res = http.ServerResponse.prototype - , send = connect.static.send - , mime = require('mime') - , basename = path.basename - , join = path.join; - -/** - * Send a response with the given `body` and optional `headers` and `status` code. - * - * Examples: - * - * res.send(); - * res.send(new Buffer('wahoo')); - * res.send({ some: 'json' }); - * res.send('

    some html

    '); - * res.send('Sorry, cant find that', 404); - * res.send('text', { 'Content-Type': 'text/plain' }, 201); - * res.send(404); - * - * @param {String|Object|Number|Buffer} body or status - * @param {Object|Number} headers or status - * @param {Number} status - * @return {ServerResponse} - * @api public - */ - -res.send = function(body, headers, status){ - // allow status as second arg - if ('number' == typeof headers) { - status = headers, - headers = null; - } - - // default status - status = status || this.statusCode; - - // allow 0 args as 204 - if (!arguments.length || undefined === body) status = 204; - - // determine content type - switch (typeof body) { - case 'number': - if (!this.header('Content-Type')) { - this.contentType('.txt'); - } - body = http.STATUS_CODES[status = body]; - break; - case 'string': - if (!this.header('Content-Type')) { - this.charset = this.charset || 'utf-8'; - this.contentType('.html'); - } - break; - case 'boolean': - case 'object': - if (Buffer.isBuffer(body)) { - if (!this.header('Content-Type')) { - this.contentType('.bin'); - } - } else { - return this.json(body, headers, status); - } - break; - } - - // populate Content-Length - if (undefined !== body && !this.header('Content-Length')) { - this.header('Content-Length', Buffer.isBuffer(body) - ? body.length - : Buffer.byteLength(body)); - } - - // merge headers passed - if (headers) { - var fields = Object.keys(headers); - for (var i = 0, len = fields.length; i < len; ++i) { - var field = fields[i]; - this.header(field, headers[field]); - } - } - - // strip irrelevant headers - if (204 == status || 304 == status) { - this.removeHeader('Content-Type'); - this.removeHeader('Content-Length'); - body = ''; - } - - // respond - this.statusCode = status; - this.end('HEAD' == this.req.method ? null : body); - return this; -}; - -/** - * Send JSON response with `obj`, optional `headers`, and optional `status`. - * - * Examples: - * - * res.json(null); - * res.json({ user: 'tj' }); - * res.json('oh noes!', 500); - * res.json('I dont have that', 404); - * - * @param {Mixed} obj - * @param {Object|Number} headers or status - * @param {Number} status - * @return {ServerResponse} - * @api public - */ - -res.json = function(obj, headers, status){ - var body = JSON.stringify(obj) - , callback = this.req.query.callback - , jsonp = this.app.enabled('jsonp callback'); - - this.charset = this.charset || 'utf-8'; - this.header('Content-Type', 'application/json'); - - if (callback && jsonp) { - this.header('Content-Type', 'text/javascript'); - body = callback.replace(/[^\w$.]/g, '') + '(' + body + ');'; - } - - return this.send(body, headers, status); -}; - -/** - * Set status `code`. - * - * @param {Number} code - * @return {ServerResponse} - * @api public - */ - -res.status = function(code){ - this.statusCode = code; - return this; -}; - -/** - * Transfer the file at the given `path`. Automatically sets - * the _Content-Type_ response header field. `next()` is called - * when `path` is a directory, or when an error occurs. - * - * Options: - * - * - `maxAge` defaulting to 0 - * - `root` root directory for relative filenames - * - * @param {String} path - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -res.sendfile = function(path, options, fn){ - var next = this.req.next; - options = options || {}; - - // support function as second arg - if ('function' == typeof options) { - fn = options; - options = {}; - } - - options.path = encodeURIComponent(path); - options.callback = fn; - send(this.req, this, next, options); -}; - -/** - * Set _Content-Type_ response header passed through `mime.lookup()`. - * - * Examples: - * - * var filename = 'path/to/image.png'; - * res.contentType(filename); - * // res.headers['Content-Type'] is now "image/png" - * - * res.contentType('.html'); - * res.contentType('html'); - * res.contentType('json'); - * res.contentType('png'); - * - * @param {String} type - * @return {String} the resolved mime type - * @api public - */ - -res.contentType = function(type){ - return this.header('Content-Type', mime.lookup(type)); -}; - -/** - * Set _Content-Disposition_ header to _attachment_ with optional `filename`. - * - * @param {String} filename - * @return {ServerResponse} - * @api public - */ - -res.attachment = function(filename){ - if (filename) this.contentType(filename); - this.header('Content-Disposition', filename - ? 'attachment; filename="' + basename(filename) + '"' - : 'attachment'); - return this; -}; - -/** - * Transfer the file at the given `path`, with optional - * `filename` as an attachment and optional callback `fn(err)`, - * and optional `fn2(err)` which is invoked when an error has - * occurred after header has been sent. - * - * @param {String} path - * @param {String|Function} filename or fn - * @param {Function} fn - * @param {Function} fn2 - * @api public - */ - -res.download = function(path, filename, fn, fn2){ - var self = this; - - // support callback as second arg - if ('function' == typeof filename) { - fn2 = fn; - fn = filename; - filename = null; - } - - // transfer the file - this.attachment(filename || path).sendfile(path, function(err){ - var sentHeader = self._header; - if (err) { - if (!sentHeader) self.removeHeader('Content-Disposition'); - if (sentHeader) { - fn2 && fn2(err); - } else if (fn) { - fn(err); - } else { - self.req.next(err); - } - } else if (fn) { - fn(); - } - }); -}; - -/** - * Set or get response header `name` with optional `val`. - * - * @param {String} name - * @param {String} val - * @return {ServerResponse} for chaining - * @api public - */ - -res.header = function(name, val){ - if (1 == arguments.length) return this.getHeader(name); - this.setHeader(name, val); - return this; -}; - -/** - * Clear cookie `name`. - * - * @param {String} name - * @param {Object} options - * @api public - */ - -res.clearCookie = function(name, options){ - var opts = { expires: new Date(1) }; - this.cookie(name, '', options - ? utils.merge(options, opts) - : opts); -}; - -/** - * Set cookie `name` to `val`, with the given `options`. - * - * Options: - * - * - `maxAge` max-age in milliseconds, converted to `expires` - * - `path` defaults to the "basepath" setting which is typically "/" - * - * Examples: - * - * // "Remember Me" for 15 minutes - * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); - * - * // save as above - * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) - * - * @param {String} name - * @param {String} val - * @param {Options} options - * @api public - */ - -res.cookie = function(name, val, options){ - options = options || {}; - if ('maxAge' in options) options.expires = new Date(Date.now() + options.maxAge); - if (undefined === options.path) options.path = this.app.set('basepath'); - var cookie = utils.serializeCookie(name, val, options); - this.header('Set-Cookie', cookie); -}; - -/** - * Redirect to the given `url` with optional response `status` - * defauling to 302. - * - * The given `url` can also be the name of a mapped url, for - * example by default express supports "back" which redirects - * to the _Referrer_ or _Referer_ headers or the application's - * "basepath" setting. Express also supports "basepath" out of the box, - * which can be set via `app.set('basepath', '/blog');`, and defaults - * to '/'. - * - * Redirect Mapping: - * - * To extend the redirect mapping capabilities that Express provides, - * we may use the `app.redirect()` method: - * - * app.redirect('google', 'http://google.com'); - * - * Now in a route we may call: - * - * res.redirect('google'); - * - * We may also map dynamic redirects: - * - * app.redirect('comments', function(req, res){ - * return '/post/' + req.params.id + '/comments'; - * }); - * - * So now we may do the following, and the redirect will dynamically adjust to - * the context of the request. If we called this route with _GET /post/12_ our - * redirect _Location_ would be _/post/12/comments_. - * - * app.get('/post/:id', function(req, res){ - * res.redirect('comments'); - * }); - * - * Unless an absolute `url` is given, the app's mount-point - * will be respected. For example if we redirect to `/posts`, - * and our app is mounted at `/blog` we will redirect to `/blog/posts`. - * - * @param {String} url - * @param {Number} code - * @api public - */ - -res.redirect = function(url, status){ - var app = this.app - , req = this.req - , base = app.set('basepath') || app.route - , status = status || 302 - , head = 'HEAD' == req.method - , body; - - // Setup redirect map - var map = { - back: req.header('Referrer', base) - , home: base - }; - - // Support custom redirect map - map.__proto__ = app.redirects; - - // Attempt mapped redirect - var mapped = 'function' == typeof map[url] - ? map[url](req, this) - : map[url]; - - // Perform redirect - url = mapped || url; - - // Relative - if (!~url.indexOf('://')) { - // Respect mount-point - if ('/' != base && 0 != url.indexOf(base)) url = base + url; - - // Absolute - var host = req.headers.host - , tls = req.connection.encrypted; - url = 'http' + (tls ? 's' : '') + '://' + host + url; - } - - // Support text/{plain,html} by default - if (req.accepts('html')) { - body = '
    '; - this.header('Content-Type', 'text/html'); - } else { - body = http.STATUS_CODES[status] + '. Redirecting to ' + url; - this.header('Content-Type', 'text/plain'); - } - - // Respond - this.statusCode = status; - this.header('Location', url); - this.end(head ? null : body); -}; - -/** - * Assign the view local variable `name` to `val` or return the - * local previously assigned to `name`. - * - * @param {String} name - * @param {Mixed} val - * @return {Mixed} val - * @api public - */ - -res.local = function(name, val){ - this._locals = this._locals || {}; - return undefined === val - ? this._locals[name] - : this._locals[name] = val; -}; - -/** - * Assign several locals with the given `obj`, - * or return the locals. - * - * @param {Object} obj - * @return {Object|Undefined} - * @api public - */ - -res.locals = -res.helpers = function(obj){ - if (obj) { - for (var key in obj) { - this.local(key, obj[key]); - } - } else { - return this._locals; - } -}; diff --git a/usb_auth/node_modules/express/lib/router/collection.js b/usb_auth/node_modules/express/lib/router/collection.js deleted file mode 100644 index 991a9a2..0000000 --- a/usb_auth/node_modules/express/lib/router/collection.js +++ /dev/null @@ -1,53 +0,0 @@ - -/*! - * Express - router - Collection - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Expose `Collection`. - */ - -module.exports = Collection; - -/** - * Initialize a new route `Collection` - * with the given `router`. - * - * @param {Router} router - * @api private - */ - -function Collection(router) { - Array.apply(this, arguments); - this.router = router; -} - -/** - * Inherit from `Array.prototype`. - */ - -Collection.prototype.__proto__ = Array.prototype; - -/** - * Remove the routes in this collection. - * - * @return {Collection} of routes removed - * @api public - */ - -Collection.prototype.remove = function(){ - var router = this.router - , len = this.length - , ret = new Collection(this.router); - - for (var i = 0; i < len; ++i) { - if (router.remove(this[i])) { - ret.push(this[i]); - } - } - - return ret; -}; - diff --git a/usb_auth/node_modules/express/lib/router/index.js b/usb_auth/node_modules/express/lib/router/index.js deleted file mode 100644 index ff1498b..0000000 --- a/usb_auth/node_modules/express/lib/router/index.js +++ /dev/null @@ -1,398 +0,0 @@ - -/*! - * Express - Router - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Route = require('./route') - , Collection = require('./collection') - , utils = require('../utils') - , parse = require('url').parse - , toArray = utils.toArray; - -/** - * Expose `Router` constructor. - */ - -exports = module.exports = Router; - -/** - * Expose HTTP methods. - */ - -var methods = exports.methods = require('./methods'); - -/** - * Initialize a new `Router` with the given `app`. - * - * @param {express.HTTPServer} app - * @api private - */ - -function Router(app) { - var self = this; - this.app = app; - this.routes = {}; - this.params = {}; - this._params = []; - - this.middleware = function(req, res, next){ - self._dispatch(req, res, next); - }; -} - -/** - * Register a param callback `fn` for the given `name`. - * - * @param {String|Function} name - * @param {Function} fn - * @return {Router} for chaining - * @api public - */ - -Router.prototype.param = function(name, fn){ - // param logic - if ('function' == typeof name) { - this._params.push(name); - return; - } - - // apply param functions - var params = this._params - , len = params.length - , ret; - - for (var i = 0; i < len; ++i) { - if (ret = params[i](name, fn)) { - fn = ret; - } - } - - // ensure we end up with a - // middleware function - if ('function' != typeof fn) { - throw new Error('invalid param() call for ' + name + ', got ' + fn); - } - - (this.params[name] = this.params[name] || []).push(fn); - return this; -}; - -/** - * Return a `Collection` of all routes defined. - * - * @return {Collection} - * @api public - */ - -Router.prototype.all = function(){ - return this.find(function(){ - return true; - }); -}; - -/** - * Remove the given `route`, returns - * a bool indicating if the route was present - * or not. - * - * @param {Route} route - * @return {Boolean} - * @api public - */ - -Router.prototype.remove = function(route){ - var routes = this.routes[route.method] - , len = routes.length; - - for (var i = 0; i < len; ++i) { - if (route == routes[i]) { - routes.splice(i, 1); - return true; - } - } -}; - -/** - * Return routes with route paths matching `path`. - * - * @param {String} method - * @param {String} path - * @return {Collection} - * @api public - */ - -Router.prototype.lookup = function(method, path){ - return this.find(function(route){ - return path == route.path - && (route.method == method - || method == 'all'); - }); -}; - -/** - * Return routes with regexps that match the given `url`. - * - * @param {String} method - * @param {String} url - * @return {Collection} - * @api public - */ - -Router.prototype.match = function(method, url){ - return this.find(function(route){ - return route.match(url) - && (route.method == method - || method == 'all'); - }); -}; - -/** - * Find routes based on the return value of `fn` - * which is invoked once per route. - * - * @param {Function} fn - * @return {Collection} - * @api public - */ - -Router.prototype.find = function(fn){ - var len = methods.length - , ret = new Collection(this) - , method - , routes - , route; - - for (var i = 0; i < len; ++i) { - method = methods[i]; - routes = this.routes[method]; - if (!routes) continue; - for (var j = 0, jlen = routes.length; j < jlen; ++j) { - route = routes[j]; - if (fn(route)) ret.push(route); - } - } - - return ret; -}; - -/** - * Route dispatcher aka the route "middleware". - * - * @param {IncomingMessage} req - * @param {ServerResponse} res - * @param {Function} next - * @api private - */ - -Router.prototype._dispatch = function(req, res, next){ - var params = this.params - , self = this; - - // route dispatch - (function pass(i, err){ - var paramCallbacks - , paramIndex = 0 - , paramVal - , route - , keys - , key - , ret; - - // match next route - function nextRoute(err) { - pass(req._route_index + 1, err); - } - - // match route - req.route = route = self._match(req, i); - - // implied OPTIONS - if (!route && 'OPTIONS' == req.method) return self._options(req, res); - - // no route - if (!route) return next(err); - - // we have a route - // start at param 0 - req.params = route.params; - keys = route.keys; - i = 0; - - // param callbacks - function param(err) { - paramIndex = 0; - key = keys[i++]; - paramVal = key && req.params[key.name]; - paramCallbacks = key && params[key.name]; - - try { - if ('route' == err) { - nextRoute(); - } else if (err) { - i = 0; - callbacks(err); - } else if (paramCallbacks && undefined !== paramVal) { - paramCallback(); - } else if (key) { - param(); - } else { - i = 0; - callbacks(); - } - } catch (err) { - param(err); - } - }; - - param(err); - - // single param callbacks - function paramCallback(err) { - var fn = paramCallbacks[paramIndex++]; - if (err || !fn) return param(err); - fn(req, res, paramCallback, paramVal, key.name); - } - - // invoke route callbacks - function callbacks(err) { - var fn = route.callbacks[i++]; - try { - if ('route' == err) { - nextRoute(); - } else if (err && fn) { - if (fn.length < 4) return callbacks(err); - fn(err, req, res, callbacks); - } else if (fn) { - fn(req, res, callbacks); - } else { - nextRoute(err); - } - } catch (err) { - callbacks(err); - } - } - })(0); -}; - -/** - * Respond to __OPTIONS__ method. - * - * @param {IncomingMessage} req - * @param {ServerResponse} res - * @api private - */ - -Router.prototype._options = function(req, res){ - var path = parse(req.url).pathname - , body = this._optionsFor(path).join(','); - res.send(body, { Allow: body }); -}; - -/** - * Return an array of HTTP verbs or "options" for `path`. - * - * @param {String} path - * @return {Array} - * @api private - */ - -Router.prototype._optionsFor = function(path){ - var self = this; - return methods.filter(function(method){ - var routes = self.routes[method]; - if (!routes || 'options' == method) return; - for (var i = 0, len = routes.length; i < len; ++i) { - if (routes[i].match(path)) return true; - } - }).map(function(method){ - return method.toUpperCase(); - }); -}; - -/** - * Attempt to match a route for `req` - * starting from offset `i`. - * - * @param {IncomingMessage} req - * @param {Number} i - * @return {Route} - * @api private - */ - -Router.prototype._match = function(req, i){ - var method = req.method.toLowerCase() - , url = parse(req.url) - , path = url.pathname - , routes = this.routes - , captures - , route - , keys; - - // pass HEAD to GET routes - if ('head' == method) method = 'get'; - - // routes for this method - if (routes = routes[method]) { - - // matching routes - for (var len = routes.length; i < len; ++i) { - route = routes[i]; - if (captures = route.match(path)) { - keys = route.keys; - route.params = []; - - // params from capture groups - for (var j = 1, jlen = captures.length; j < jlen; ++j) { - var key = keys[j-1] - , val = 'string' == typeof captures[j] - ? decodeURIComponent(captures[j]) - : captures[j]; - if (key) { - route.params[key.name] = val; - } else { - route.params.push(val); - } - } - - // all done - req._route_index = i; - return route; - } - } - } -}; - -/** - * Route `method`, `path`, and one or more callbacks. - * - * @param {String} method - * @param {String} path - * @param {Function} callback... - * @return {Router} for chaining - * @api private - */ - -Router.prototype._route = function(method, path, callbacks){ - var app = this.app - , callbacks = utils.flatten(toArray(arguments, 2)); - - // ensure path was given - if (!path) throw new Error('app.' + method + '() requires a path'); - - // create the route - var route = new Route(method, path, callbacks, { - sensitive: app.enabled('case sensitive routes') - , strict: app.enabled('strict routing') - }); - - // add it - (this.routes[method] = this.routes[method] || []) - .push(route); - return this; -}; diff --git a/usb_auth/node_modules/express/lib/router/methods.js b/usb_auth/node_modules/express/lib/router/methods.js deleted file mode 100644 index e19787b..0000000 --- a/usb_auth/node_modules/express/lib/router/methods.js +++ /dev/null @@ -1,70 +0,0 @@ - -/*! - * Express - router - methods - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Hypertext Transfer Protocol -- HTTP/1.1 - * http://www.ietf.org/rfc/rfc2616.txt - */ - -var RFC2616 = ['OPTIONS', 'GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'CONNECT']; - -/** - * HTTP Extensions for Distributed Authoring -- WEBDAV - * http://www.ietf.org/rfc/rfc2518.txt - */ - -var RFC2518 = ['PROPFIND', 'PROPPATCH', 'MKCOL', 'COPY', 'MOVE', 'LOCK', 'UNLOCK']; - -/** - * Versioning Extensions to WebDAV - * http://www.ietf.org/rfc/rfc3253.txt - */ - -var RFC3253 = ['VERSION-CONTROL', 'REPORT', 'CHECKOUT', 'CHECKIN', 'UNCHECKOUT', 'MKWORKSPACE', 'UPDATE', 'LABEL', 'MERGE', 'BASELINE-CONTROL', 'MKACTIVITY']; - -/** - * Ordered Collections Protocol (WebDAV) - * http://www.ietf.org/rfc/rfc3648.txt - */ - -var RFC3648 = ['ORDERPATCH']; - -/** - * Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol - * http://www.ietf.org/rfc/rfc3744.txt - */ - -var RFC3744 = ['ACL']; - -/** - * Web Distributed Authoring and Versioning (WebDAV) SEARCH - * http://www.ietf.org/rfc/rfc5323.txt - */ - -var RFC5323 = ['SEARCH']; - -/** - * PATCH Method for HTTP - * http://www.ietf.org/rfc/rfc5789.txt - */ - -var RFC5789 = ['PATCH']; - -/** - * Expose the methods. - */ - -module.exports = [].concat( - RFC2616 - , RFC2518 - , RFC3253 - , RFC3648 - , RFC3744 - , RFC5323 - , RFC5789).map(function(method){ - return method.toLowerCase(); - }); diff --git a/usb_auth/node_modules/express/lib/router/route.js b/usb_auth/node_modules/express/lib/router/route.js deleted file mode 100644 index 7f2965c..0000000 --- a/usb_auth/node_modules/express/lib/router/route.js +++ /dev/null @@ -1,88 +0,0 @@ - -/*! - * Express - router - Route - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Expose `Route`. - */ - -module.exports = Route; - -/** - * Initialize `Route` with the given HTTP `method`, `path`, - * and an array of `callbacks` and `options`. - * - * Options: - * - * - `sensitive` enable case-sensitive routes - * - `strict` enable strict matching for trailing slashes - * - * @param {String} method - * @param {String} path - * @param {Array} callbacks - * @param {Object} options. - * @api private - */ - -function Route(method, path, callbacks, options) { - options = options || {}; - this.path = path; - this.method = method; - this.callbacks = callbacks; - this.regexp = normalize(path - , this.keys = [] - , options.sensitive - , options.strict); -} - -/** - * Check if this route matches `path` and return captures made. - * - * @param {String} path - * @return {Array} - * @api private - */ - -Route.prototype.match = function(path){ - return this.regexp.exec(path); -}; - -/** - * Normalize the given path string, - * returning a regular expression. - * - * An empty array should be passed, - * which will contain the placeholder - * key names. For example "/user/:id" will - * then contain ["id"]. - * - * @param {String|RegExp} path - * @param {Array} keys - * @param {Boolean} sensitive - * @param {Boolean} strict - * @return {RegExp} - * @api private - */ - -function normalize(path, keys, sensitive, strict) { - if (path instanceof RegExp) return path; - path = path - .concat(strict ? '' : '/?') - .replace(/\/\(/g, '(?:/') - .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, function(_, slash, format, key, capture, optional){ - keys.push({ name: key, optional: !! optional }); - slash = slash || ''; - return '' - + (optional ? '' : slash) - + '(?:' - + (optional ? slash : '') - + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')' - + (optional || ''); - }) - .replace(/([\/.])/g, '\\$1') - .replace(/\*/g, '(.*)'); - return new RegExp('^' + path + '$', sensitive ? '' : 'i'); -} diff --git a/usb_auth/node_modules/express/lib/utils.js b/usb_auth/node_modules/express/lib/utils.js deleted file mode 100644 index d579f7c..0000000 --- a/usb_auth/node_modules/express/lib/utils.js +++ /dev/null @@ -1,152 +0,0 @@ - -/*! - * Express - Utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Check if `path` looks absolute. - * - * @param {String} path - * @return {Boolean} - * @api private - */ - -exports.isAbsolute = function(path){ - if ('/' == path[0]) return true; - if (':' == path[1] && '\\' == path[2]) return true; -}; - -/** - * Merge object `b` with `a` giving precedence to - * values in object `a`. - * - * @param {Object} a - * @param {Object} b - * @return {Object} a - * @api private - */ - -exports.union = function(a, b){ - if (a && b) { - var keys = Object.keys(b) - , len = keys.length - , key; - for (var i = 0; i < len; ++i) { - key = keys[i]; - if (!a.hasOwnProperty(key)) { - a[key] = b[key]; - } - } - } - return a; -}; - -/** - * Flatten the given `arr`. - * - * @param {Array} arr - * @return {Array} - * @api private - */ - -exports.flatten = function(arr, ret){ - var ret = ret || [] - , len = arr.length; - for (var i = 0; i < len; ++i) { - if (Array.isArray(arr[i])) { - exports.flatten(arr[i], ret); - } else { - ret.push(arr[i]); - } - } - return ret; -}; - -/** - * Parse mini markdown implementation. - * The following conversions are supported, - * primarily for the "flash" middleware: - * - * _foo_ or *foo* become foo - * __foo__ or **foo** become foo - * [A](B) becomes A - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.miniMarkdown = function(str){ - return String(str) - .replace(/(__|\*\*)(.*?)\1/g, '$2') - .replace(/(_|\*)(.*?)\1/g, '$2') - .replace(/\[([^\]]+)\]\(([^)]+)\)/g, '$1'); -}; - -/** - * Escape special characters in the given string of html. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function(html) { - return String(html) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(//g, '>'); -}; - -/** - * Parse "Range" header `str` relative to the given file `size`. - * - * @param {Number} size - * @param {String} str - * @return {Array} - * @api private - */ - -exports.parseRange = function(size, str){ - var valid = true; - var arr = str.substr(6).split(',').map(function(range){ - var range = range.split('-') - , start = parseInt(range[0], 10) - , end = parseInt(range[1], 10); - - // -500 - if (isNaN(start)) { - start = size - end; - end = size - 1; - // 500- - } else if (isNaN(end)) { - end = size - 1; - } - - // Invalid - if (isNaN(start) || isNaN(end) || start > end) valid = false; - - return { start: start, end: end }; - }); - return valid ? arr : undefined; -}; - -/** - * Fast alternative to `Array.prototype.slice.call()`. - * - * @param {Arguments} args - * @param {Number} n - * @return {Array} - * @api public - */ - -exports.toArray = function(args, i){ - var arr = [] - , len = args.length - , i = i || 0; - for (; i < len; ++i) arr.push(args[i]); - return arr; -}; diff --git a/usb_auth/node_modules/express/lib/view.js b/usb_auth/node_modules/express/lib/view.js deleted file mode 100644 index 5258249..0000000 --- a/usb_auth/node_modules/express/lib/view.js +++ /dev/null @@ -1,460 +0,0 @@ - -/*! - * Express - view - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var path = require('path') - , extname = path.extname - , dirname = path.dirname - , basename = path.basename - , utils = require('connect').utils - , View = require('./view/view') - , partial = require('./view/partial') - , union = require('./utils').union - , merge = utils.merge - , http = require('http') - , res = http.ServerResponse.prototype; - -/** - * Expose constructors. - */ - -exports = module.exports = View; - -/** - * Export template engine registrar. - */ - -exports.register = View.register; - -/** - * Lookup and compile `view` with cache support by supplying - * both the `cache` object and `cid` string, - * followed by `options` passed to `exports.lookup()`. - * - * @param {String} view - * @param {Object} cache - * @param {Object} cid - * @param {Object} options - * @return {View} - * @api private - */ - -exports.compile = function(view, cache, cid, options){ - if (cache && cid && cache[cid]){ - options.filename = cache[cid].path; - return cache[cid]; - } - - // lookup - view = exports.lookup(view, options); - - // hints - if (!view.exists) { - if (options.hint) hintAtViewPaths(view.original, options); - var err = new Error('failed to locate view "' + view.original.view + '"'); - err.view = view.original; - throw err; - } - - // compile - options.filename = view.path; - view.fn = view.templateEngine.compile(view.contents, options); - cache[cid] = view; - - return view; -}; - -/** - * Lookup `view`, returning an instanceof `View`. - * - * Options: - * - * - `root` root directory path - * - `defaultEngine` default template engine - * - `parentView` parent `View` object - * - `cache` cache object - * - `cacheid` optional cache id - * - * Lookup: - * - * - partial `_` - * - any `/index` - * - non-layout `..//index` - * - any `/` - * - partial `/_` - * - * @param {String} view - * @param {Object} options - * @return {View} - * @api private - */ - -exports.lookup = function(view, options){ - var orig = view = new View(view, options) - , partial = options.isPartial - , layout = options.isLayout; - - // Try _ prefix ex: ./views/_.jade - // taking precedence over the direct path - if (partial) { - view = new View(orig.prefixPath, options); - if (!view.exists) view = orig; - } - - // Try index ex: ./views/user/index.jade - if (!layout && !view.exists) view = new View(orig.indexPath, options); - - // Try ..//index ex: ../user/index.jade - // when calling partial('user') within the same dir - if (!layout && !view.exists) view = new View(orig.upIndexPath, options); - - // Try root ex: /user.jade - if (!view.exists) view = new View(orig.rootPath, options); - - // Try root _ prefix ex: /_user.jade - if (!view.exists && partial) view = new View(view.prefixPath, options); - - view.original = orig; - return view; -}; - -/** - * Partial render helper. - * - * @api private - */ - -function renderPartial(res, view, options, parentLocals, parent){ - var collection, object, locals; - - if (options) { - // collection - if (options.collection) { - collection = options.collection; - delete options.collection; - } else if ('length' in options) { - collection = options; - options = {}; - } - - // locals - if (options.locals) { - locals = options.locals; - delete options.locals; - } - - // object - if ('Object' != options.constructor.name) { - object = options; - options = {}; - } else if (undefined != options.object) { - object = options.object; - delete options.object; - } - } else { - options = {}; - } - - // Inherit locals from parent - union(options, parentLocals); - - // Merge locals - if (locals) merge(options, locals); - - // Partials dont need layouts - options.isPartial = true; - options.layout = false; - - // Deduce name from view path - var name = options.as || partial.resolveObjectName(view); - - // Render partial - function render(){ - if (object) { - if ('string' == typeof name) { - options[name] = object; - } else if (name === global) { - merge(options, object); - } - } - return res.render(view, options, null, parent, true); - } - - // Collection support - if (collection) { - var len = collection.length - , buf = '' - , keys - , key - , val; - - options.collectionLength = len; - - if ('number' == typeof len || Array.isArray(collection)) { - for (var i = 0; i < len; ++i) { - val = collection[i]; - options.firstInCollection = i == 0; - options.indexInCollection = i; - options.lastInCollection = i == len - 1; - object = val; - buf += render(); - } - } else { - keys = Object.keys(collection); - len = keys.length; - options.collectionLength = len; - options.collectionKeys = keys; - for (var i = 0; i < len; ++i) { - key = keys[i]; - val = collection[key]; - options.keyInCollection = key; - options.firstInCollection = i == 0; - options.indexInCollection = i; - options.lastInCollection = i == len - 1; - object = val; - buf += render(); - } - } - - return buf; - } else { - return render(); - } -}; - -/** - * Render `view` partial with the given `options`. Optionally a - * callback `fn(err, str)` may be passed instead of writing to - * the socket. - * - * Options: - * - * - `object` Single object with name derived from the view (unless `as` is present) - * - * - `as` Variable name for each `collection` value, defaults to the view name. - * * as: 'something' will add the `something` local variable - * * as: this will use the collection value as the template context - * * as: global will merge the collection value's properties with `locals` - * - * - `collection` Array of objects, the name is derived from the view name itself. - * For example _video.html_ will have a object _video_ available to it. - * - * @param {String} view - * @param {Object|Array|Function} options, collection, callback, or object - * @param {Function} fn - * @return {String} - * @api public - */ - -res.partial = function(view, options, fn){ - var app = this.app - , options = options || {} - , viewEngine = app.set('view engine') - , parent = {}; - - // accept callback as second argument - if ('function' == typeof options) { - fn = options; - options = {}; - } - - // root "views" option - parent.dirname = app.set('views') || process.cwd() + '/views'; - - // utilize "view engine" option - if (viewEngine) parent.engine = viewEngine; - - // render the partial - try { - var str = renderPartial(this, view, options, null, parent); - } catch (err) { - if (fn) { - fn(err); - } else { - this.req.next(err); - } - return; - } - - // callback or transfer - if (fn) { - fn(null, str); - } else { - this.send(str); - } -}; - -/** - * Render `view` with the given `options` and optional callback `fn`. - * When a callback function is given a response will _not_ be made - * automatically, however otherwise a response of _200_ and _text/html_ is given. - * - * Options: - * - * - `scope` Template evaluation context (the value of `this`) - * - `debug` Output debugging information - * - `status` Response status code - * - * @param {String} view - * @param {Object|Function} options or callback function - * @param {Function} fn - * @api public - */ - -res.render = function(view, opts, fn, parent, sub){ - // support callback function as second arg - if ('function' == typeof opts) { - fn = opts, opts = null; - } - - try { - return this._render(view, opts, fn, parent, sub); - } catch (err) { - // callback given - if (fn) { - fn(err); - // unwind to root call to prevent multiple callbacks - } else if (sub) { - throw err; - // root template, next(err) - } else { - this.req.next(err); - } - } -}; - -// private render() - -res._render = function(view, opts, fn, parent, sub){ - var options = {} - , self = this - , app = this.app - , helpers = app._locals - , dynamicHelpers = app.dynamicViewHelpers - , viewOptions = app.set('view options') - , root = app.set('views') || process.cwd() + '/views'; - - // cache id - var cid = app.enabled('view cache') - ? view + (parent ? ':' + parent.path : '') - : false; - - // merge "view options" - if (viewOptions) merge(options, viewOptions); - - // merge res._locals - if (this._locals) merge(options, this._locals); - - // merge render() options - if (opts) merge(options, opts); - - // merge render() .locals - if (opts && opts.locals) merge(options, opts.locals); - - // status support - if (options.status) this.statusCode = options.status; - - // capture attempts - options.attempts = []; - - var partial = options.isPartial - , layout = options.layout; - - // Layout support - if (true === layout || undefined === layout) { - layout = 'layout'; - } - - // Default execution scope to a plain object - options.scope = options.scope || {}; - - // Populate view - options.parentView = parent; - - // "views" setting - options.root = root; - - // "view engine" setting - options.defaultEngine = app.set('view engine'); - - // charset option - if (options.charset) this.charset = options.charset; - - // Dynamic helper support - if (false !== options.dynamicHelpers) { - // cache - if (!this.__dynamicHelpers) { - this.__dynamicHelpers = {}; - for (var key in dynamicHelpers) { - this.__dynamicHelpers[key] = dynamicHelpers[key].call( - this.app - , this.req - , this); - } - } - - // apply - merge(options, this.__dynamicHelpers); - } - - // Merge view helpers - union(options, helpers); - - // Always expose partial() as a local - options.partial = function(path, opts){ - return renderPartial(self, path, opts, options, view); - }; - - // View lookup - options.hint = app.enabled('hints'); - view = exports.compile(view, app.cache, cid, options); - - // layout helper - options.layout = function(path){ - layout = path; - }; - - // render - var str = view.fn.call(options.scope, options); - - // layout expected - if (layout) { - options.isLayout = true; - options.layout = false; - options.body = str; - this.render(layout, options, fn, view, true); - // partial return - } else if (partial) { - return str; - // render complete, and - // callback given - } else if (fn) { - fn(null, str); - // respond - } else { - this.send(str); - } -} - -/** - * Hint at view path resolution, outputting the - * paths that Express has tried. - * - * @api private - */ - -function hintAtViewPaths(view, options) { - console.error(); - console.error('failed to locate view "' + view.view + '", tried:'); - options.attempts.forEach(function(path){ - console.error(' - %s', path); - }); - console.error(); -} diff --git a/usb_auth/node_modules/express/lib/view/partial.js b/usb_auth/node_modules/express/lib/view/partial.js deleted file mode 100644 index 7d2f69b..0000000 --- a/usb_auth/node_modules/express/lib/view/partial.js +++ /dev/null @@ -1,40 +0,0 @@ - -/*! - * Express - view - Partial - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Memory cache. - */ - -var cache = {}; - -/** - * Resolve partial object name from the view path. - * - * Examples: - * - * "user.ejs" becomes "user" - * "forum thread.ejs" becomes "forumThread" - * "forum/thread/post.ejs" becomes "post" - * "blog-post.ejs" becomes "blogPost" - * - * @return {String} - * @api private - */ - -exports.resolveObjectName = function(view){ - return cache[view] || (cache[view] = view - .split('/') - .slice(-1)[0] - .split('.')[0] - .replace(/^_/, '') - .replace(/[^a-zA-Z0-9 ]+/g, ' ') - .split(/ +/).map(function(word, i){ - return i - ? word[0].toUpperCase() + word.substr(1) - : word; - }).join('')); -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/lib/view/view.js b/usb_auth/node_modules/express/lib/view/view.js deleted file mode 100644 index 7d9392c..0000000 --- a/usb_auth/node_modules/express/lib/view/view.js +++ /dev/null @@ -1,210 +0,0 @@ - -/*! - * Express - View - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var path = require('path') - , utils = require('../utils') - , extname = path.extname - , dirname = path.dirname - , basename = path.basename - , fs = require('fs') - , stat = fs.statSync; - -/** - * Expose `View`. - */ - -exports = module.exports = View; - -/** - * Require cache. - */ - -var cache = {}; - -/** - * Initialize a new `View` with the given `view` path and `options`. - * - * @param {String} view - * @param {Object} options - * @api private - */ - -function View(view, options) { - options = options || {}; - this.view = view; - this.root = options.root; - this.relative = false !== options.relative; - this.defaultEngine = options.defaultEngine; - this.parent = options.parentView; - this.basename = basename(view); - this.engine = this.resolveEngine(); - this.extension = '.' + this.engine; - this.name = this.basename.replace(this.extension, ''); - this.path = this.resolvePath(); - this.dirname = dirname(this.path); - if (options.attempts) { - if (!~options.attempts.indexOf(this.path)) - options.attempts.push(this.path); - } -}; - -/** - * Check if the view path exists. - * - * @return {Boolean} - * @api public - */ - -View.prototype.__defineGetter__('exists', function(){ - try { - stat(this.path); - return true; - } catch (err) { - return false; - } -}); - -/** - * Resolve view engine. - * - * @return {String} - * @api private - */ - -View.prototype.resolveEngine = function(){ - // Explicit - if (~this.basename.indexOf('.')) return extname(this.basename).substr(1); - // Inherit from parent - if (this.parent) return this.parent.engine; - // Default - return this.defaultEngine; -}; - -/** - * Resolve view path. - * - * @return {String} - * @api private - */ - -View.prototype.resolvePath = function(){ - var path = this.view; - // Implicit engine - if (!~this.basename.indexOf('.')) path += this.extension; - // Absolute - if (utils.isAbsolute(path)) return path; - // Relative to parent - if (this.relative && this.parent) return this.parent.dirname + '/' + path; - // Relative to root - return this.root - ? this.root + '/' + path - : path; -}; - -/** - * Get view contents. This is a one-time hit, so we - * can afford to be sync. - * - * @return {String} - * @api public - */ - -View.prototype.__defineGetter__('contents', function(){ - return fs.readFileSync(this.path, 'utf8'); -}); - -/** - * Get template engine api, cache exports to reduce - * require() calls. - * - * @return {Object} - * @api public - */ - -View.prototype.__defineGetter__('templateEngine', function(){ - var ext = this.extension; - return cache[ext] || (cache[ext] = require(this.engine)); -}); - -/** - * Return root path alternative. - * - * @return {String} - * @api public - */ - -View.prototype.__defineGetter__('rootPath', function(){ - this.relative = false; - return this.resolvePath(); -}); - -/** - * Return index path alternative. - * - * @return {String} - * @api public - */ - -View.prototype.__defineGetter__('indexPath', function(){ - return this.dirname - + '/' + this.basename.replace(this.extension, '') - + '/index' + this.extension; -}); - -/** - * Return ..//index path alternative. - * - * @return {String} - * @api public - */ - -View.prototype.__defineGetter__('upIndexPath', function(){ - return this.dirname + '/../' + this.name + '/index' + this.extension; -}); - -/** - * Return _ prefix path alternative - * - * @return {String} - * @api public - */ - -View.prototype.__defineGetter__('prefixPath', function(){ - return this.dirname + '/_' + this.basename; -}); - -/** - * Register the given template engine `exports` - * as `ext`. For example we may wish to map ".html" - * files to jade: - * - * app.register('.html', require('jade')); - * - * or - * - * app.register('html', require('jade')); - * - * This is also useful for libraries that may not - * match extensions correctly. For example my haml.js - * library is installed from npm as "hamljs" so instead - * of layout.hamljs, we can register the engine as ".haml": - * - * app.register('.haml', require('haml-js')); - * - * @param {String} ext - * @param {Object} obj - * @api public - */ - -exports.register = function(ext, exports) { - if ('.' != ext[0]) ext = '.' + ext; - cache[ext] = exports; -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/.npmignore b/usb_auth/node_modules/express/node_modules/connect/.npmignore deleted file mode 100644 index b04a224..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.markdown -*.md -.git* -Makefile -benchmarks/ -docs/ -examples/ -install.sh -support/ -test/ -.DS_Store diff --git a/usb_auth/node_modules/express/node_modules/connect/LICENSE b/usb_auth/node_modules/express/node_modules/connect/LICENSE deleted file mode 100644 index 0c5d22d..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2010 Sencha Inc. -Copyright (c) 2011 LearnBoost -Copyright (c) 2011 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/index.js b/usb_auth/node_modules/express/node_modules/connect/index.js deleted file mode 100644 index 7477048..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/connect'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/cache.js b/usb_auth/node_modules/express/node_modules/connect/lib/cache.js deleted file mode 100644 index 4aa026e..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/cache.js +++ /dev/null @@ -1,81 +0,0 @@ - -/*! - * Connect - Cache - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Expose `Cache`. - */ - -module.exports = Cache; - -/** - * LRU cache store. - * - * @param {Number} limit - * @api private - */ - -function Cache(limit) { - this.store = {}; - this.keys = []; - this.limit = limit; -} - -/** - * Touch `key`, promoting the object. - * - * @param {String} key - * @param {Number} i - * @api private - */ - -Cache.prototype.touch = function(key, i){ - this.keys.splice(i,1); - this.keys.push(key); -}; - -/** - * Remove `key`. - * - * @param {String} key - * @api private - */ - -Cache.prototype.remove = function(key){ - delete this.store[key]; -}; - -/** - * Get the object stored for `key`. - * - * @param {String} key - * @return {Array} - * @api private - */ - -Cache.prototype.get = function(key){ - return this.store[key]; -}; - -/** - * Add a cache `key`. - * - * @param {String} key - * @return {Array} - * @api private - */ - -Cache.prototype.add = function(key){ - // initialize store - var len = this.keys.push(key); - - // limit reached, invalid LRU - if (len > this.limit) this.remove(this.keys.shift()); - - var arr = this.store[key] = []; - arr.createdAt = new Date; - return arr; -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/connect.js b/usb_auth/node_modules/express/node_modules/connect/lib/connect.js deleted file mode 100644 index 7857023..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/connect.js +++ /dev/null @@ -1,106 +0,0 @@ - -/*! - * Connect - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var HTTPServer = require('./http').Server - , HTTPSServer = require('./https').Server - , fs = require('fs'); - -// node patches - -require('./patch'); - -// expose createServer() as the module - -exports = module.exports = createServer; - -/** - * Framework version. - */ - -exports.version = '1.8.5'; - -/** - * Initialize a new `connect.HTTPServer` with the middleware - * passed to this function. When an object is passed _first_, - * we assume these are the tls options, and return a `connect.HTTPSServer`. - * - * Examples: - * - * An example HTTP server, accepting several middleware. - * - * var server = connect.createServer( - * connect.logger() - * , connect.static(__dirname + '/public') - * ); - * - * An HTTPS server, utilizing the same middleware as above. - * - * var server = connect.createServer( - * { key: key, cert: cert } - * , connect.logger() - * , connect.static(__dirname + '/public') - * ); - * - * Alternatively with connect 1.0 we may omit `createServer()`. - * - * connect( - * connect.logger() - * , connect.static(__dirname + '/public') - * ).listen(3000); - * - * @param {Object|Function} ... - * @return {Server} - * @api public - */ - -function createServer() { - if ('object' == typeof arguments[0]) { - return new HTTPSServer(arguments[0], Array.prototype.slice.call(arguments, 1)); - } else { - return new HTTPServer(Array.prototype.slice.call(arguments)); - } -}; - -// support connect.createServer() - -exports.createServer = createServer; - -// auto-load getters - -exports.middleware = {}; - -/** - * Auto-load bundled middleware with getters. - */ - -fs.readdirSync(__dirname + '/middleware').forEach(function(filename){ - if (/\.js$/.test(filename)) { - var name = filename.substr(0, filename.lastIndexOf('.')); - exports.middleware.__defineGetter__(name, function(){ - return require('./middleware/' + name); - }); - } -}); - -// expose utils - -exports.utils = require('./utils'); - -// expose getters as first-class exports - -exports.utils.merge(exports, exports.middleware); - -// expose constructors - -exports.HTTPServer = HTTPServer; -exports.HTTPSServer = HTTPSServer; - diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/http.js b/usb_auth/node_modules/express/node_modules/connect/lib/http.js deleted file mode 100644 index 09898e2..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/http.js +++ /dev/null @@ -1,217 +0,0 @@ - -/*! - * Connect - HTTPServer - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , parse = require('url').parse - , assert = require('assert'); - -// environment - -var env = process.env.NODE_ENV || 'development'; - -/** - * Initialize a new `Server` with the given `middleware`. - * - * Examples: - * - * var server = connect.createServer( - * connect.favicon() - * , connect.logger() - * , connect.static(__dirname + '/public') - * ); - * - * @params {Array} middleware - * @return {Server} - * @api public - */ - -var Server = exports.Server = function HTTPServer(middleware) { - this.stack = []; - middleware.forEach(function(fn){ - this.use(fn); - }, this); - http.Server.call(this, this.handle); -}; - -/** - * Inherit from `http.Server.prototype`. - */ - -Server.prototype.__proto__ = http.Server.prototype; - -/** - * Utilize the given middleware `handle` to the given `route`, - * defaulting to _/_. This "route" is the mount-point for the - * middleware, when given a value other than _/_ the middleware - * is only effective when that segment is present in the request's - * pathname. - * - * For example if we were to mount a function at _/admin_, it would - * be invoked on _/admin_, and _/admin/settings_, however it would - * not be invoked for _/_, or _/posts_. - * - * This is effectively the same as passing middleware to `connect.createServer()`, - * however provides a progressive api. - * - * Examples: - * - * var server = connect.createServer(); - * server.use(connect.favicon()); - * server.use(connect.logger()); - * server.use(connect.static(__dirname + '/public')); - * - * If we wanted to prefix static files with _/public_, we could - * "mount" the `static()` middleware: - * - * server.use('/public', connect.static(__dirname + '/public')); - * - * This api is chainable, meaning the following is valid: - * - * connect.createServer() - * .use(connect.favicon()) - * .use(connect.logger()) - * .use(connect.static(__dirname + '/public')) - * .listen(3000); - * - * @param {String|Function} route or handle - * @param {Function} handle - * @return {Server} - * @api public - */ - -Server.prototype.use = function(route, handle){ - this.route = '/'; - - // default route to '/' - if ('string' != typeof route) { - handle = route; - route = '/'; - } - - // wrap sub-apps - if ('function' == typeof handle.handle) { - var server = handle; - server.route = route; - handle = function(req, res, next) { - server.handle(req, res, next); - }; - } - - // wrap vanilla http.Servers - if (handle instanceof http.Server) { - handle = handle.listeners('request')[0]; - } - - // normalize route to not trail with slash - if ('/' == route[route.length - 1]) { - route = route.substr(0, route.length - 1); - } - - // add the middleware - this.stack.push({ route: route, handle: handle }); - - // allow chaining - return this; -}; - -/** - * Handle server requests, punting them down - * the middleware stack. - * - * @api private - */ - -Server.prototype.handle = function(req, res, out) { - var writeHead = res.writeHead - , stack = this.stack - , removed = '' - , index = 0; - - function next(err) { - var layer, path, c; - req.url = removed + req.url; - req.originalUrl = req.originalUrl || req.url; - removed = ''; - - layer = stack[index++]; - - // all done - if (!layer || res.headerSent) { - // but wait! we have a parent - if (out) return out(err); - - // error - if (err) { - var msg = 'production' == env - ? 'Internal Server Error' - : err.stack || err.toString(); - - // output to stderr in a non-test env - if ('test' != env) console.error(err.stack || err.toString()); - - // unable to respond - if (res.headerSent) return req.socket.destroy(); - - res.statusCode = 500; - res.setHeader('Content-Type', 'text/plain'); - if ('HEAD' == req.method) return res.end(); - res.end(msg); - } else { - res.statusCode = 404; - res.setHeader('Content-Type', 'text/plain'); - if ('HEAD' == req.method) return res.end(); - res.end('Cannot ' + req.method + ' ' + req.url); - } - return; - } - - try { - path = parse(req.url).pathname; - if (undefined == path) path = '/'; - - // skip this layer if the route doesn't match. - if (0 != path.indexOf(layer.route)) return next(err); - - c = path[layer.route.length]; - if (c && '/' != c && '.' != c) return next(err); - - // Call the layer handler - // Trim off the part of the url that matches the route - removed = layer.route; - req.url = req.url.substr(removed.length); - - // Ensure leading slash - if ('/' != req.url[0]) req.url = '/' + req.url; - - var arity = layer.handle.length; - if (err) { - if (arity === 4) { - layer.handle(err, req, res, next); - } else { - next(err); - } - } else if (arity < 4) { - layer.handle(req, res, next); - } else { - next(); - } - } catch (e) { - if (e instanceof assert.AssertionError) { - console.error(e.stack + '\n'); - next(e); - } else { - next(e); - } - } - } - next(); -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/https.js b/usb_auth/node_modules/express/node_modules/connect/lib/https.js deleted file mode 100644 index 9b09fa4..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/https.js +++ /dev/null @@ -1,47 +0,0 @@ - -/*! - * Connect - HTTPServer - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var HTTPServer = require('./http').Server - , https = require('https'); - -/** - * Initialize a new `Server` with the given - *`options` and `middleware`. The HTTPS api - * is identical to the [HTTP](http.html) server, - * however TLS `options` must be provided before - * passing in the optional middleware. - * - * @params {Object} options - * @params {Array} middleawre - * @return {Server} - * @api public - */ - -var Server = exports.Server = function HTTPSServer(options, middleware) { - this.stack = []; - middleware.forEach(function(fn){ - this.use(fn); - }, this); - https.Server.call(this, options, this.handle); -}; - -/** - * Inherit from `http.Server.prototype`. - */ - -Server.prototype.__proto__ = https.Server.prototype; - -// mixin HTTPServer methods - -Object.keys(HTTPServer.prototype).forEach(function(method){ - Server.prototype[method] = HTTPServer.prototype[method]; -}); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/index.js b/usb_auth/node_modules/express/node_modules/connect/lib/index.js deleted file mode 100644 index 77b14c3..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/index.js +++ /dev/null @@ -1,46 +0,0 @@ - -/** - * # Connect - * - * Connect is a middleware framework for node, - * shipping with over 11 bundled middleware and a rich choice of - * [3rd-party middleware](https://github.com/senchalabs/connect/wiki). - * - * Installation: - * - * $ npm install connect - * - * API: - * - * - [connect](connect.html) general - * - [http](http.html) http server - * - [https](https.html) https server - * - * Middleware: - * - * - [logger](middleware-logger.html) request logger with custom format support - * - [csrf](middleware-csrf.html) Cross-site request forgery protection - * - [basicAuth](middleware-basicAuth.html) basic http authentication - * - [bodyParser](middleware-bodyParser.html) extensible request body parser - * - [cookieParser](middleware-cookieParser.html) cookie parser - * - [session](middleware-session.html) session management support with bundled [MemoryStore](middleware-session-memory.html) - * - [compiler](middleware-compiler.html) static asset compiler (sass, less, coffee-script, etc) - * - [methodOverride](middleware-methodOverride.html) faux HTTP method support - * - [responseTime](middleware-responseTime.html) calculates response-time and exposes via X-Response-Time - * - [router](middleware-router.html) provides rich Sinatra / Express-like routing - * - [staticCache](middleware-staticCache.html) memory cache layer for the static() middleware - * - [static](middleware-static.html) streaming static file server supporting `Range` and more - * - [directory](middleware-directory.html) directory listing middleware - * - [vhost](middleware-vhost.html) virtual host sub-domain mapping middleware - * - [favicon](middleware-favicon.html) efficient favicon server (with default icon) - * - [limit](middleware-limit.html) limit the bytesize of request bodies - * - [profiler](middleware-profiler.html) request profiler reporting response-time, memory usage, etc - * - [query](middleware-query.html) automatic querystring parser, populating `req.query` - * - [errorHandler](middleware-errorHandler.html) flexible error handler - * - * Internals: - * - * - connect [utilities](utils.html) - * - node monkey [patches](patch.html) - * - */ \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js deleted file mode 100644 index 3ff472b..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js +++ /dev/null @@ -1,93 +0,0 @@ - -/*! - * Connect - basicAuth - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , unauthorized = utils.unauthorized - , badRequest = utils.badRequest; - -/** - * Enfore basic authentication by providing a `callback(user, pass)`, - * which must return `true` in order to gain access. Alternatively an async - * method is provided as well, invoking `callback(user, pass, callback)`. Populates - * `req.remoteUser`. The final alternative is simply passing username / password - * strings. - * - * Examples: - * - * connect(connect.basicAuth('username', 'password')); - * - * connect( - * connect.basicAuth(function(user, pass){ - * return 'tj' == user & 'wahoo' == pass; - * }) - * ); - * - * connect( - * connect.basicAuth(function(user, pass, fn){ - * User.authenticate({ user: user, pass: pass }, fn); - * }) - * ); - * - * @param {Function|String} callback or username - * @param {String} realm - * @api public - */ - -module.exports = function basicAuth(callback, realm) { - var username, password; - - // user / pass strings - if ('string' == typeof callback) { - username = callback; - password = realm; - if ('string' != typeof password) throw new Error('password argument required'); - realm = arguments[2]; - callback = function(user, pass){ - return user == username && pass == password; - } - } - - realm = realm || 'Authorization Required'; - - return function(req, res, next) { - var authorization = req.headers.authorization; - - if (req.remoteUser) return next(); - if (!authorization) return unauthorized(res, realm); - - var parts = authorization.split(' ') - , scheme = parts[0] - , credentials = new Buffer(parts[1], 'base64').toString().split(':'); - - if ('Basic' != scheme) return badRequest(res); - - // async - if (callback.length >= 3) { - var pause = utils.pause(req); - callback(credentials[0], credentials[1], function(err, user){ - if (err || !user) return unauthorized(res, realm); - req.remoteUser = user; - next(); - pause.resume(); - }); - // sync - } else { - if (callback(credentials[0], credentials[1])) { - req.remoteUser = credentials[0]; - next(); - } else { - unauthorized(res, realm); - } - } - } -}; - diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js deleted file mode 100644 index a52568c..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +++ /dev/null @@ -1,196 +0,0 @@ - -/*! - * Connect - bodyParser - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var qs = require('qs') - , formidable = require('formidable'); - -/** - * Extract the mime type from the given request's - * _Content-Type_ header. - * - * @param {IncomingMessage} req - * @return {String} - * @api private - */ - -function mime(req) { - var str = req.headers['content-type'] || ''; - return str.split(';')[0]; -} - -/** - * Parse request bodies. - * - * By default _application/json_, _application/x-www-form-urlencoded_, - * and _multipart/form-data_ are supported, however you may map `connect.bodyParser.parse[contentType]` - * to a function receiving `(req, options, callback)`. - * - * Examples: - * - * connect.createServer( - * connect.bodyParser() - * , function(req, res) { - * res.end('viewing user ' + req.body.user.name); - * } - * ); - * - * $ curl -d 'user[name]=tj' http://localhost/ - * $ curl -d '{"user":{"name":"tj"}}' -H "Content-Type: application/json" http://localhost/ - * - * Multipart req.files: - * - * As a security measure files are stored in a separate object, stored - * as `req.files`. This prevents attacks that may potentially alter - * filenames, and depending on the application gain access to restricted files. - * - * Multipart configuration: - * - * The `options` passed are provided to each parser function. - * The _multipart/form-data_ parser merges these with formidable's - * IncomingForm object, allowing you to tweak the upload directory, - * size limits, etc. For example you may wish to retain the file extension - * and change the upload directory: - * - * server.use(bodyParser({ uploadDir: '/www/mysite.com/uploads' })); - * - * View [node-formidable](https://github.com/felixge/node-formidable) for more information. - * - * If you wish to use formidable directly within your app, and do not - * desire this behaviour for multipart requests simply remove the - * parser: - * - * delete connect.bodyParser.parse['multipart/form-data']; - * - * Or - * - * delete express.bodyParser.parse['multipart/form-data']; - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function bodyParser(options){ - options = options || {}; - return function bodyParser(req, res, next) { - if (req.body) return next(); - req.body = {}; - - if ('GET' == req.method || 'HEAD' == req.method) return next(); - var parser = exports.parse[mime(req)]; - if (parser) { - parser(req, options, next); - } else { - next(); - } - } -}; - -/** - * Parsers. - */ - -exports.parse = {}; - -/** - * Parse application/x-www-form-urlencoded. - */ - -exports.parse['application/x-www-form-urlencoded'] = function(req, options, fn){ - var buf = ''; - req.setEncoding('utf8'); - req.on('data', function(chunk){ buf += chunk }); - req.on('end', function(){ - try { - req.body = buf.length - ? qs.parse(buf) - : {}; - fn(); - } catch (err){ - fn(err); - } - }); -}; - -/** - * Parse application/json. - */ - -exports.parse['application/json'] = function(req, options, fn){ - var buf = ''; - req.setEncoding('utf8'); - req.on('data', function(chunk){ buf += chunk }); - req.on('end', function(){ - try { - req.body = buf.length - ? JSON.parse(buf) - : {}; - fn(); - } catch (err){ - fn(err); - } - }); -}; - -/** - * Parse multipart/form-data. - * - * TODO: make multiple support optional - * TODO: revisit "error" flag if it's a formidable bug - */ - -exports.parse['multipart/form-data'] = function(req, options, fn){ - var form = new formidable.IncomingForm - , data = {} - , files = {} - , done; - - Object.keys(options).forEach(function(key){ - form[key] = options[key]; - }); - - function ondata(name, val, data){ - if (Array.isArray(data[name])) { - data[name].push(val); - } else if (data[name]) { - data[name] = [data[name], val]; - } else { - data[name] = val; - } - } - - form.on('field', function(name, val){ - ondata(name, val, data); - }); - - form.on('file', function(name, val){ - ondata(name, val, files); - }); - - form.on('error', function(err){ - fn(err); - done = true; - }); - - form.on('end', function(){ - if (done) return; - try { - req.body = qs.parse(data); - req.files = qs.parse(files); - fn(); - } catch (err) { - fn(err); - } - }); - - form.parse(req); -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/compiler.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/compiler.js deleted file mode 100644 index dc4dd66..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/compiler.js +++ /dev/null @@ -1,163 +0,0 @@ - -/*! - * Connect - compiler - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , path = require('path') - , parse = require('url').parse; - -/** - * Require cache. - */ - -var cache = {}; - -/** - * Setup compiler. - * - * Options: - * - * - `src` Source directory, defaults to **CWD**. - * - `dest` Destination directory, defaults `src`. - * - `enable` Array of enabled compilers. - * - * Compilers: - * - * - `sass` Compiles sass to css - * - `less` Compiles less to css - * - `coffeescript` Compiles coffee to js - * - * @param {Object} options - * @api public - */ - -exports = module.exports = function compiler(options){ - options = options || {}; - - var srcDir = options.src || process.cwd() - , destDir = options.dest || srcDir - , enable = options.enable; - - if (!enable || enable.length === 0) { - throw new Error('compiler\'s "enable" option is not set, nothing will be compiled.'); - } - - return function compiler(req, res, next){ - if ('GET' != req.method) return next(); - var pathname = parse(req.url).pathname; - for (var i = 0, len = enable.length; i < len; ++i) { - var name = enable[i] - , compiler = compilers[name]; - if (compiler.match.test(pathname)) { - var src = (srcDir + pathname).replace(compiler.match, compiler.ext) - , dest = destDir + pathname; - - // Compare mtimes - fs.stat(src, function(err, srcStats){ - if (err) { - if ('ENOENT' == err.code) { - next(); - } else { - next(err); - } - } else { - fs.stat(dest, function(err, destStats){ - if (err) { - // Oh snap! it does not exist, compile it - if ('ENOENT' == err.code) { - compile(); - } else { - next(err); - } - } else { - // Source has changed, compile it - if (srcStats.mtime > destStats.mtime) { - compile(); - } else { - // Defer file serving - next(); - } - } - }); - } - }); - - // Compile to the destination - function compile() { - fs.readFile(src, 'utf8', function(err, str){ - if (err) { - next(err); - } else { - compiler.compile(str, function(err, str){ - if (err) { - next(err); - } else { - fs.writeFile(dest, str, 'utf8', function(err){ - next(err); - }); - } - }); - } - }); - } - return; - } - } - next(); - }; -}; - -/** - * Bundled compilers: - * - * - [sass](http://github.com/visionmedia/sass.js) to _css_ - * - [less](http://github.com/cloudhead/less.js) to _css_ - * - [coffee](http://github.com/jashkenas/coffee-script) to _js_ - */ - -var compilers = exports.compilers = { - sass: { - match: /\.css$/, - ext: '.sass', - compile: function(str, fn){ - var sass = cache.sass || (cache.sass = require('sass')); - try { - fn(null, sass.render(str)); - } catch (err) { - fn(err); - } - } - }, - less: { - match: /\.css$/, - ext: '.less', - compile: function(str, fn){ - var less = cache.less || (cache.less = require('less')); - try { - less.render(str, fn); - } catch (err) { - fn(err); - } - } - }, - coffeescript: { - match: /\.js$/, - ext: '.coffee', - compile: function(str, fn){ - var coffee = cache.coffee || (cache.coffee = require('coffee-script')); - try { - fn(null, coffee.compile(str)); - } catch (err) { - fn(err); - } - } - } -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js deleted file mode 100644 index d6b69de..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js +++ /dev/null @@ -1,46 +0,0 @@ - -/*! - * Connect - cookieParser - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('./../utils'); - -/** - * Parse _Cookie_ header and populate `req.cookies` - * with an object keyed by the cookie names. - * - * Examples: - * - * connect.createServer( - * connect.cookieParser() - * , function(req, res, next){ - * res.end(JSON.stringify(req.cookies)); - * } - * ); - * - * @return {Function} - * @api public - */ - -module.exports = function cookieParser(){ - return function cookieParser(req, res, next) { - var cookie = req.headers.cookie; - if (req.cookies) return next(); - req.cookies = {}; - if (cookie) { - try { - req.cookies = utils.parseCookie(cookie); - } catch (err) { - return next(err); - } - } - next(); - }; -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/csrf.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/csrf.js deleted file mode 100644 index 1dcf0d1..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/csrf.js +++ /dev/null @@ -1,105 +0,0 @@ - -/*! - * Connect - csrf - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , crypto = require('crypto'); - -/** - * CRSF protection middleware. - * - * By default this middleware generates a token named "_csrf" - * which should be added to requests which mutate - * state, within a hidden form field, query-string etc. This - * token is validated against the visitor's `req.session._csrf` - * property which is re-generated per request. - * - * The default `value` function checks `req.body` generated - * by the `bodyParser()` middleware, `req.query` generated - * by `query()`, and the "X-CSRF-Token" header field. - * - * This middleware requires session support, thus should be added - * somewhere _below_ `session()` and `cookieParser()`. - * - * Examples: - * - * var form = '\n\ - *
    \n\ - * \n\ - * \n\ - * \n\ - * \n\ - *
    \n\ - * '; - * - * connect( - * connect.cookieParser() - * , connect.session({ secret: 'keyboard cat' }) - * , connect.bodyParser() - * , connect.csrf() - * - * , function(req, res, next){ - * if ('POST' != req.method) return next(); - * req.session.user = req.body.user; - * next(); - * } - * - * , function(req, res){ - * res.setHeader('Content-Type', 'text/html'); - * var body = form - * .replace('{token}', req.session._csrf) - * .replace('{user}', req.session.user && req.session.user.name || ''); - * res.end(body); - * } - * ).listen(3000); - * - * Options: - * - * - `value` a function accepting the request, returning the token - * - * @param {Object} options - * @api public - */ - -module.exports = function csrf(options) { - var options = options || {} - , value = options.value || defaultValue; - - return function(req, res, next){ - // generate CSRF token - var token = req.session._csrf || (req.session._csrf = utils.uid(24)); - - // ignore GET (for now) - if ('GET' == req.method) return next(); - - // determine value - var val = value(req); - - // check - if (val != token) return utils.forbidden(res); - - next(); - } -}; - -/** - * Default value function, checking the `req.body` - * and `req.query` for the CSRF token. - * - * @param {IncomingMessage} req - * @return {String} - * @api private - */ - -function defaultValue(req) { - return (req.body && req.body._csrf) - || (req.query && req.query._csrf) - || (req.headers['x-csrf-token']); -} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/directory.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/directory.js deleted file mode 100644 index df5b5e6..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/directory.js +++ /dev/null @@ -1,222 +0,0 @@ - -/*! - * Connect - directory - * Copyright(c) 2011 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -// TODO: icon / style for directories -// TODO: arrow key navigation -// TODO: make icons extensible - -/** - * Module dependencies. - */ - -var fs = require('fs') - , parse = require('url').parse - , utils = require('../utils') - , path = require('path') - , normalize = path.normalize - , extname = path.extname - , join = path.join; - -/** - * Icon cache. - */ - -var cache = {}; - -/** - * Serve directory listings with the given `root` path. - * - * Options: - * - * - `hidden` display hidden (dot) files. Defaults to false. - * - `icons` display icons. Defaults to false. - * - `filter` Apply this filter function to files. Defaults to false. - * - * @param {String} root - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function directory(root, options){ - options = options || {}; - - // root required - if (!root) throw new Error('directory() root path required'); - var hidden = options.hidden - , icons = options.icons - , filter = options.filter - , root = normalize(root); - - return function directory(req, res, next) { - var accept = req.headers.accept || 'text/plain' - , url = parse(req.url) - , dir = decodeURIComponent(url.pathname) - , path = normalize(join(root, dir)) - , originalUrl = parse(req.originalUrl) - , originalDir = decodeURIComponent(originalUrl.pathname) - , showUp = path != root && path != root + '/'; - - // null byte(s) - if (~path.indexOf('\0')) return utils.badRequest(res); - - // malicious path - if (0 != path.indexOf(root)) return utils.forbidden(res); - - // check if we have a directory - fs.stat(path, function(err, stat){ - if (err) return 'ENOENT' == err.code - ? next() - : next(err); - - if (!stat.isDirectory()) return next(); - - // fetch files - fs.readdir(path, function(err, files){ - if (err) return next(err); - if (!hidden) files = removeHidden(files); - if (filter) files = files.filter(filter); - files.sort(); - // content-negotiation - for (var key in exports) { - if (~accept.indexOf(key) || ~accept.indexOf('*/*')) { - exports[key](req, res, files, next, originalDir, showUp, icons); - return; - } - } - utils.notAcceptable(res); - }); - }); - }; -}; - -/** - * Respond with text/html. - */ - -exports.html = function(req, res, files, next, dir, showUp, icons){ - fs.readFile(__dirname + '/../public/directory.html', 'utf8', function(err, str){ - if (err) return next(err); - fs.readFile(__dirname + '/../public/style.css', 'utf8', function(err, style){ - if (err) return next(err); - if (showUp) files.unshift('..'); - str = str - .replace('{style}', style) - .replace('{files}', html(files, dir, icons)) - .replace('{directory}', dir) - .replace('{linked-path}', htmlPath(dir)); - res.setHeader('Content-Type', 'text/html'); - res.setHeader('Content-Length', str.length); - res.end(str); - }); - }); -}; - -/** - * Respond with application/json. - */ - -exports.json = function(req, res, files){ - files = JSON.stringify(files); - res.setHeader('Content-Type', 'application/json'); - res.setHeader('Content-Length', files.length); - res.end(files); -}; - -/** - * Respond with text/plain. - */ - -exports.plain = function(req, res, files){ - files = files.join('\n') + '\n'; - res.setHeader('Content-Type', 'text/plain'); - res.setHeader('Content-Length', files.length); - res.end(files); -}; - -/** - * Map html `dir`, returning a linked path. - */ - -function htmlPath(dir) { - var curr = []; - return dir.split('/').map(function(part){ - curr.push(part); - return '' + part + ''; - }).join(' / '); -} - -/** - * Map html `files`, returning an html unordered list. - */ - -function html(files, dir, useIcons) { - return '
      ' + files.map(function(file){ - var icon = '' - , classes = []; - - if (useIcons && '..' != file) { - icon = icons[extname(file)] || icons.default; - icon = ''; - classes.push('icon'); - } - - return '
    • ' - + icon + file + '
    • '; - - }).join('\n') + '
    '; -} - -/** - * Load and cache the given `icon`. - * - * @param {String} icon - * @return {String} - * @api private - */ - -function load(icon) { - if (cache[icon]) return cache[icon]; - return cache[icon] = fs.readFileSync(__dirname + '/../public/icons/' + icon, 'base64'); -} - -/** - * Filter "hidden" `files`, aka files - * beginning with a `.`. - * - * @param {Array} files - * @return {Array} - * @api private - */ - -function removeHidden(files) { - return files.filter(function(file){ - return '.' != file[0]; - }); -} - -/** - * Icon map. - */ - -var icons = { - '.js': 'page_white_code_red.png' - , '.c': 'page_white_c.png' - , '.h': 'page_white_h.png' - , '.cc': 'page_white_cplusplus.png' - , '.php': 'page_white_php.png' - , '.rb': 'page_white_ruby.png' - , '.cpp': 'page_white_cplusplus.png' - , '.swf': 'page_white_flash.png' - , '.pdf': 'page_white_acrobat.png' - , 'default': 'page_white.png' -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js deleted file mode 100644 index f2fc44f..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js +++ /dev/null @@ -1,100 +0,0 @@ -/*! - * Connect - errorHandler - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , url = require('url') - , fs = require('fs'); - -/** - * Flexible error handler, providing (_optional_) stack traces - * and error message responses for requests accepting text, html, - * or json. - * - * Options: - * - * - `showStack`, `stack` respond with both the error message and stack trace. Defaults to `false` - * - `showMessage`, `message`, respond with the exception message only. Defaults to `false` - * - `dumpExceptions`, `dump`, dump exceptions to stderr (without terminating the process). Defaults to `false` - * - * Text: - * - * By default, and when _text/plain_ is accepted a simple stack trace - * or error message will be returned. - * - * JSON: - * - * When _application/json_ is accepted, connect will respond with - * an object in the form of `{ "error": error }`. - * - * HTML: - * - * When accepted connect will output a nice html stack trace. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function errorHandler(options){ - options = options || {}; - - // defaults - var showStack = options.showStack || options.stack - , showMessage = options.showMessage || options.message - , dumpExceptions = options.dumpExceptions || options.dump - , formatUrl = options.formatUrl; - - return function errorHandler(err, req, res, next){ - res.statusCode = 500; - if (dumpExceptions) console.error(err.stack); - if (showStack) { - var accept = req.headers.accept || ''; - // html - if (~accept.indexOf('html')) { - fs.readFile(__dirname + '/../public/style.css', 'utf8', function(e, style){ - fs.readFile(__dirname + '/../public/error.html', 'utf8', function(e, html){ - var stack = (err.stack || '') - .split('\n').slice(1) - .map(function(v){ return '
  • ' + v + '
  • '; }).join(''); - html = html - .replace('{style}', style) - .replace('{stack}', stack) - .replace('{title}', exports.title) - .replace(/\{error\}/g, utils.escape(err.toString())); - res.setHeader('Content-Type', 'text/html'); - res.end(html); - }); - }); - // json - } else if (~accept.indexOf('json')) { - var json = JSON.stringify({ error: err }); - res.setHeader('Content-Type', 'application/json'); - res.end(json); - // plain text - } else { - res.writeHead(500, { 'Content-Type': 'text/plain' }); - res.end(err.stack); - } - } else { - var body = showMessage - ? err.toString() - : 'Internal Server Error'; - res.setHeader('Content-Type', 'text/plain'); - res.end(body); - } - }; -}; - -/** - * Template title. - */ - -exports.title = 'Connect'; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/favicon.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/favicon.js deleted file mode 100644 index 8eeafba..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/favicon.js +++ /dev/null @@ -1,76 +0,0 @@ - -/*! - * Connect - favicon - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , utils = require('../utils'); - -/** - * Favicon cache. - */ - -var icon; - -/** - * By default serves the connect favicon, or the favicon - * located by the given `path`. - * - * Options: - * - * - `maxAge` cache-control max-age directive, defaulting to 1 day - * - * Examples: - * - * connect.createServer( - * connect.favicon() - * ); - * - * connect.createServer( - * connect.favicon(__dirname + '/public/favicon.ico') - * ); - * - * @param {String} path - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function favicon(path, options){ - var options = options || {} - , path = path || __dirname + '/../public/favicon.ico' - , maxAge = options.maxAge || 86400000; - - return function favicon(req, res, next){ - if ('/favicon.ico' == req.url) { - if (icon) { - res.writeHead(200, icon.headers); - res.end(icon.body); - } else { - fs.readFile(path, function(err, buf){ - if (err) return next(err); - icon = { - headers: { - 'Content-Type': 'image/x-icon' - , 'Content-Length': buf.length - , 'ETag': '"' + utils.md5(buf) + '"' - , 'Cache-Control': 'public, max-age=' + (maxAge / 1000) - }, - body: buf - }; - res.writeHead(200, icon.headers); - res.end(icon.body); - }); - } - } else { - next(); - } - }; -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/limit.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/limit.js deleted file mode 100644 index 4dafdd3..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/limit.js +++ /dev/null @@ -1,82 +0,0 @@ - -/*! - * Connect - limit - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Limit request bodies to the given size in `bytes`. - * - * A string representation of the bytesize may also be passed, - * for example "5mb", "200kb", "1gb", etc. - * - * Examples: - * - * var server = connect( - * connect.limit('5.5mb') - * ).listen(3000); - * - * TODO: pause EV_READ - * - * @param {Number|String} bytes - * @return {Function} - * @api public - */ - -module.exports = function limit(bytes){ - if ('string' == typeof bytes) bytes = parse(bytes); - if ('number' != typeof bytes) throw new Error('limit() bytes required'); - return function limit(req, res, next){ - var received = 0 - , len = req.headers['content-length'] - ? parseInt(req.headers['content-length'], 10) - : null; - - // deny the request - function deny() { - req.destroy(); - } - - // self-awareness - if (req._limit) return next(); - req._limit = true; - - // limit by content-length - if (len && len > bytes) { - res.statusCode = 413; - res.end('Request Entity Too Large'); - return; - } - - // limit - req.on('data', function(chunk){ - received += chunk.length; - if (received > bytes) deny(); - }); - - next(); - }; -}; - -/** - * Parse byte `size` string. - * - * @param {String} size - * @return {Number} - * @api private - */ - -function parse(size) { - var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb)$/) - , n = parseFloat(parts[1]) - , type = parts[2]; - - var map = { - kb: 1024 - , mb: 1024 * 1024 - , gb: 1024 * 1024 * 1024 - }; - - return map[type] * n; -} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/logger.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/logger.js deleted file mode 100644 index 75cc5aa..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/logger.js +++ /dev/null @@ -1,299 +0,0 @@ - -/*! - * Connect - logger - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Log buffer. - */ - -var buf = []; - -/** - * Default log buffer duration. - */ - -var defaultBufferDuration = 1000; - -/** - * Log requests with the given `options` or a `format` string. - * - * Options: - * - * - `format` Format string, see below for tokens - * - `stream` Output stream, defaults to _stdout_ - * - `buffer` Buffer duration, defaults to 1000ms when _true_ - * - `immediate` Write log line on request instead of response (for response times) - * - * Tokens: - * - * - `:req[header]` ex: `:req[Accept]` - * - `:res[header]` ex: `:res[Content-Length]` - * - `:http-version` - * - `:response-time` - * - `:remote-addr` - * - `:date` - * - `:method` - * - `:url` - * - `:referrer` - * - `:user-agent` - * - `:status` - * - * Formats: - * - * Pre-defined formats that ship with connect: - * - * - `default` ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"' - * - `short` ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms' - * - `tiny` ':method :url :status :res[content-length] - :response-time ms' - * - `dev` concise output colored by response status for development use - * - * Examples: - * - * connect.logger() // default - * connect.logger('short') - * connect.logger('tiny') - * connect.logger('dev') - * connect.logger(':method :url - :referrer') - * connect.logger(':req[content-type] -> :res[content-type]') - * connect.logger(function(req, res){ return 'some format string' }) - * - * Defining Tokens: - * - * To define a token, simply invoke `connect.logger.token()` with the - * name and a callback function. The value returned is then available - * as ":type" in this case. - * - * connect.logger.token('type', function(req, res){ return req.headers['content-type']; }) - * - * Defining Formats: - * - * All default formats are defined this way, however it's public API as well: - * - * connect.logger.format('name', 'string or function') - * - * @param {String|Function|Object} format or options - * @return {Function} - * @api public - */ - -exports = module.exports = function logger(options) { - if ('object' == typeof options) { - options = options || {}; - } else if (options) { - options = { format: options }; - } else { - options = {}; - } - - // output on request instead of response - var immediate = options.immediate; - - // format name - var fmt = exports[options.format] || options.format || exports.default; - - // compile format - if ('function' != typeof fmt) fmt = compile(fmt); - - // options - var stream = options.stream || process.stdout - , buffer = options.buffer; - - // buffering support - if (buffer) { - var realStream = stream - , interval = 'number' == typeof buffer - ? buffer - : defaultBufferDuration; - - // flush interval - setInterval(function(){ - if (buf.length) { - realStream.write(buf.join(''), 'ascii'); - buf.length = 0; - } - }, interval); - - // swap the stream - stream = { - write: function(str){ - buf.push(str); - } - }; - } - - return function logger(req, res, next) { - req._startTime = new Date; - - // mount safety - if (req._logging) return next(); - - // flag as logging - req._logging = true; - - // immediate - if (immediate) { - var line = fmt(exports, req, res); - if (null == line) return; - stream.write(line + '\n', 'ascii'); - } else { - // proxy end to output loggging - var end = res.end; - res.end = function(chunk, encoding){ - res.end = end; - res.end(chunk, encoding); - var line = fmt(exports, req, res); - if (null == line) return; - stream.write(line + '\n', 'ascii'); - }; - } - - - next(); - }; -}; - -/** - * Compile `fmt` into a function. - * - * @param {String} fmt - * @return {Function} - * @api private - */ - -function compile(fmt) { - fmt = fmt.replace(/"/g, '\\"'); - var js = ' return "' + fmt.replace(/:([-\w]{2,})(?:\[([^\]]+)\])?/g, function(_, name, arg){ - return '"\n + (tokens["' + name + '"](req, res, "' + arg + '") || "-") + "'; - }) + '";' - return new Function('tokens, req, res', js); -}; - -/** - * Define a token function with the given `name`, - * and callback `fn(req, res)`. - * - * @param {String} name - * @param {Function} fn - * @return {Object} exports for chaining - * @api public - */ - -exports.token = function(name, fn) { - exports[name] = fn; - return this; -}; - -/** - * Define a `fmt` with the given `name`. - * - * @param {String} name - * @param {String|Function} fmt - * @return {Object} exports for chaining - * @api public - */ - -exports.format = function(name, str){ - exports[name] = str; - return this; -}; - -// default format - -exports.format('default', ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'); - -// short format - -exports.format('short', ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms'); - -// tiny format - -exports.format('tiny', ':method :url :status :res[content-length] - :response-time ms'); - -// dev (colored) - -exports.format('dev', function(tokens, req, res){ - var status = res.statusCode - , color = 32; - - if (status >= 500) color = 31 - else if (status >= 400) color = 33 - else if (status >= 300) color = 36; - - return '\033[90m' + req.method - + ' ' + req.originalUrl + ' ' - + '\033[' + color + 'm' + res.statusCode - + ' \033[90m' - + (new Date - req._startTime) - + 'ms\033[0m'; -}); - -// request url - -exports.token('url', function(req){ - return req.originalUrl; -}); - -// request method - -exports.token('method', function(req){ - return req.method; -}); - -// response time in milliseconds - -exports.token('response-time', function(req){ - return new Date - req._startTime; -}); - -// UTC date - -exports.token('date', function(){ - return new Date().toUTCString(); -}); - -// response status code - -exports.token('status', function(req, res){ - return res.statusCode; -}); - -// normalized referrer - -exports.token('referrer', function(req){ - return req.headers['referer'] || req.headers['referrer']; -}); - -// remote address - -exports.token('remote-addr', function(req){ - return req.socket && (req.socket.remoteAddress || (req.socket.socket && req.socket.socket.remoteAddress)); -}); - -// HTTP version - -exports.token('http-version', function(req){ - return req.httpVersionMajor + '.' + req.httpVersionMinor; -}); - -// UA string - -exports.token('user-agent', function(req){ - return req.headers['user-agent']; -}); - -// request header - -exports.token('req', function(req, res, field){ - return req.headers[field.toLowerCase()]; -}); - -// response header - -exports.token('res', function(req, res, field){ - return (res._headers || {})[field.toLowerCase()]; -}); - diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js deleted file mode 100644 index db4e9f3..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js +++ /dev/null @@ -1,38 +0,0 @@ - -/*! - * Connect - methodOverride - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Provides faux HTTP method support. - * - * Pass an optional `key` to use when checking for - * a method override, othewise defaults to _\_method_. - * The original method is available via `req.originalMethod`. - * - * @param {String} key - * @return {Function} - * @api public - */ - -module.exports = function methodOverride(key){ - key = key || "_method"; - return function methodOverride(req, res, next) { - req.originalMethod = req.originalMethod || req.method; - - // req.body - if (req.body && key in req.body) { - req.method = req.body[key].toUpperCase(); - delete req.body[key]; - // check X-HTTP-Method-Override - } else if (req.headers['x-http-method-override']) { - req.method = req.headers['x-http-method-override'].toUpperCase(); - } - - next(); - }; -}; - diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/profiler.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/profiler.js deleted file mode 100644 index b0b5bac..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/profiler.js +++ /dev/null @@ -1,100 +0,0 @@ - -/*! - * Connect - profiler - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Profile the duration of a request. - * - * Typically this middleware should be utilized - * _above_ all others, as it proxies the `res.end()` - * method, being first allows it to encapsulate all - * other middleware. - * - * Example Output: - * - * GET / - * response time 2ms - * memory rss 52.00kb - * memory vsize 2.07mb - * heap before 3.76mb / 8.15mb - * heap after 3.80mb / 8.15mb - * - * @api public - */ - -module.exports = function profiler(){ - return function(req, res, next){ - var end = res.end - , start = snapshot(); - - // state snapshot - function snapshot() { - return { - mem: process.memoryUsage() - , time: new Date - }; - } - - // proxy res.end() - res.end = function(data, encoding){ - res.end = end; - res.end(data, encoding); - compare(req, start, snapshot()) - }; - - next(); - } -}; - -/** - * Compare `start` / `end` snapshots. - * - * @param {IncomingRequest} req - * @param {Object} start - * @param {Object} end - * @api private - */ - -function compare(req, start, end) { - console.log(); - row(req.method, req.url); - row('response time:', (end.time - start.time) + 'ms'); - row('memory rss:', formatBytes(end.mem.rss - start.mem.rss)); - row('memory vsize:', formatBytes(end.mem.vsize - start.mem.vsize)); - row('heap before:', formatBytes(start.mem.heapUsed) + ' / ' + formatBytes(start.mem.heapTotal)); - row('heap after:', formatBytes(end.mem.heapUsed) + ' / ' + formatBytes(end.mem.heapTotal)); - console.log(); -} - -/** - * Row helper - * - * @param {String} key - * @param {String} val - * @api private - */ - -function row(key, val) { - console.log(' \033[90m%s\033[0m \033[36m%s\033[0m', key, val); -} - -/** - * Format byte-size. - * - * @param {Number} bytes - * @return {String} - * @api private - */ - -function formatBytes(bytes) { - var kb = 1024 - , mb = 1024 * kb - , gb = 1024 * mb; - if (bytes < kb) return bytes + 'b'; - if (bytes < mb) return (bytes / kb).toFixed(2) + 'kb'; - if (bytes < gb) return (bytes / mb).toFixed(2) + 'mb'; - return (bytes / gb).toFixed(2) + 'gb'; -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/query.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/query.js deleted file mode 100644 index d3b1acd..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/query.js +++ /dev/null @@ -1,40 +0,0 @@ - -/*! - * Connect - query - * Copyright(c) 2011 TJ Holowaychuk - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var qs = require('qs') - , parse = require('url').parse; - -/** - * Automatically parse the query-string when available, - * populating the `req.query` object. - * - * Examples: - * - * connect( - * connect.query() - * , function(req, res){ - * res.end(JSON.stringify(req.query)); - * } - * ).listen(3000); - * - * @return {Function} - * @api public - */ - -module.exports = function query(){ - return function query(req, res, next){ - req.query = ~req.url.indexOf('?') - ? qs.parse(parse(req.url).query) - : {}; - next(); - }; -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/responseTime.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/responseTime.js deleted file mode 100644 index 2b2133a..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/responseTime.js +++ /dev/null @@ -1,34 +0,0 @@ - -/*! - * Connect - responseTime - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Adds the `X-Response-Time` header displaying the response - * duration in milliseconds. - * - * @return {Function} - * @api public - */ - -module.exports = function responseTime(){ - return function(req, res, next){ - var writeHead = res.writeHead - , start = new Date; - - if (res._responseTime) return next(); - res._responseTime = true; - - // proxy writeHead to calculate duration - res.writeHead = function(status, headers){ - var duration = new Date - start; - res.setHeader('X-Response-Time', duration + 'ms'); - res.writeHead = writeHead; - res.writeHead(status, headers); - }; - - next(); - }; -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/router.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/router.js deleted file mode 100644 index a07452e..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/router.js +++ /dev/null @@ -1,379 +0,0 @@ - -/*! - * Connect - router - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , parse = require('url').parse; - -/** - * Expose router. - */ - -exports = module.exports = router; - -/** - * Supported HTTP / WebDAV methods. - */ - -var _methods = exports.methods = [ - 'get' - , 'post' - , 'put' - , 'delete' - , 'connect' - , 'options' - , 'trace' - , 'copy' - , 'lock' - , 'mkcol' - , 'move' - , 'propfind' - , 'proppatch' - , 'unlock' - , 'report' - , 'mkactivity' - , 'checkout' - , 'merge' -]; - -/** - * Provides Sinatra and Express-like routing capabilities. - * - * Examples: - * - * connect.router(function(app){ - * app.get('/user/:id', function(req, res, next){ - * // populates req.params.id - * }); - * app.put('/user/:id', function(req, res, next){ - * // populates req.params.id - * }); - * }) - * - * @param {Function} fn - * @return {Function} - * @api public - */ - -function router(fn){ - var self = this - , methods = {} - , routes = {} - , params = {}; - - if (!fn) throw new Error('router provider requires a callback function'); - - // Generate method functions - _methods.forEach(function(method){ - methods[method] = generateMethodFunction(method.toUpperCase()); - }); - - // Alias del -> delete - methods.del = methods.delete; - - // Apply callback to all methods - methods.all = function(){ - var args = arguments; - _methods.forEach(function(name){ - methods[name].apply(this, args); - }); - return self; - }; - - // Register param callback - methods.param = function(name, fn){ - params[name] = fn; - }; - - fn.call(this, methods); - - function generateMethodFunction(name) { - var localRoutes = routes[name] = routes[name] || []; - return function(path, fn){ - var keys = [] - , middleware = []; - - // slice middleware - if (arguments.length > 2) { - middleware = Array.prototype.slice.call(arguments, 1, arguments.length); - fn = middleware.pop(); - middleware = utils.flatten(middleware); - } - - fn.middleware = middleware; - - if (!path) throw new Error(name + ' route requires a path'); - if (!fn) throw new Error(name + ' route ' + path + ' requires a callback'); - var regexp = path instanceof RegExp - ? path - : normalizePath(path, keys); - localRoutes.push({ - fn: fn - , path: regexp - , keys: keys - , orig: path - , method: name - }); - return self; - }; - } - - function router(req, res, next){ - var route - , self = this; - - (function pass(i){ - if (route = match(req, routes, i)) { - var i = 0 - , keys = route.keys; - - req.params = route.params; - - // Param preconditions - (function param(err) { - try { - var key = keys[i++] - , val = req.params[key] - , fn = params[key]; - - if ('route' == err) { - pass(req._route_index + 1); - // Error - } else if (err) { - next(err); - // Param has callback - } else if (fn) { - // Return style - if (1 == fn.length) { - req.params[key] = fn(val); - param(); - // Middleware style - } else { - fn(req, res, param, val); - } - // Finished processing params - } else if (!key) { - // route middleware - i = 0; - (function nextMiddleware(err){ - var fn = route.middleware[i++]; - if ('route' == err) { - pass(req._route_index + 1); - } else if (err) { - next(err); - } else if (fn) { - fn(req, res, nextMiddleware); - } else { - route.call(self, req, res, function(err){ - if (err) { - next(err); - } else { - pass(req._route_index + 1); - } - }); - } - })(); - // More params - } else { - param(); - } - } catch (err) { - next(err); - } - })(); - } else if ('OPTIONS' == req.method) { - options(req, res, routes); - } else { - next(); - } - })(); - }; - - router.remove = function(path, method){ - var fns = router.lookup(path, method); - fns.forEach(function(fn){ - routes[fn.method].splice(fn.index, 1); - }); - }; - - router.lookup = function(path, method, ret){ - ret = ret || []; - - // method specific lookup - if (method) { - method = method.toUpperCase(); - if (routes[method]) { - routes[method].forEach(function(route, i){ - if (path == route.orig) { - var fn = route.fn; - fn.regexp = route.path; - fn.keys = route.keys; - fn.path = route.orig; - fn.method = route.method; - fn.index = i; - ret.push(fn); - } - }); - } - // global lookup - } else { - _methods.forEach(function(method){ - router.lookup(path, method, ret); - }); - } - - return ret; - }; - - router.match = function(url, method, ret){ - var ret = ret || [] - , i = 0 - , fn - , req; - - // method specific matches - if (method) { - method = method.toUpperCase(); - req = { url: url, method: method }; - while (fn = match(req, routes, i)) { - i = req._route_index + 1; - ret.push(fn); - } - // global matches - } else { - _methods.forEach(function(method){ - router.match(url, method, ret); - }); - } - - return ret; - }; - - return router; -} - -/** - * Respond to OPTIONS. - * - * @param {ServerRequest} req - * @param {ServerResponse} req - * @param {Array} routes - * @api private - */ - -function options(req, res, routes) { - var pathname = parse(req.url).pathname - , body = optionsFor(pathname, routes).join(','); - res.writeHead(200, { - 'Content-Length': body.length - , 'Allow': body - }); - res.end(body); -} - -/** - * Return OPTIONS array for the given `path`, matching `routes`. - * - * @param {String} path - * @param {Array} routes - * @return {Array} - * @api private - */ - -function optionsFor(path, routes) { - return _methods.filter(function(method){ - var arr = routes[method.toUpperCase()]; - for (var i = 0, len = arr.length; i < len; ++i) { - if (arr[i].path.test(path)) return true; - } - }).map(function(method){ - return method.toUpperCase(); - }); -} - -/** - * Normalize the given path string, - * returning a regular expression. - * - * An empty array should be passed, - * which will contain the placeholder - * key names. For example "/user/:id" will - * then contain ["id"]. - * - * @param {String} path - * @param {Array} keys - * @return {RegExp} - * @api private - */ - -function normalizePath(path, keys) { - path = path - .concat('/?') - .replace(/\/\(/g, '(?:/') - .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, function(_, slash, format, key, capture, optional){ - keys.push(key); - slash = slash || ''; - return '' - + (optional ? '' : slash) - + '(?:' - + (optional ? slash : '') - + (format || '') + (capture || '([^/]+?)') + ')' - + (optional || ''); - }) - .replace(/([\/.])/g, '\\$1') - .replace(/\*/g, '(.+)'); - return new RegExp('^' + path + '$', 'i'); -} - -/** - * Attempt to match the given request to - * one of the routes. When successful - * a route function is returned. - * - * @param {ServerRequest} req - * @param {Object} routes - * @return {Function} - * @api private - */ - -function match(req, routes, i) { - var captures - , method = req.method - , i = i || 0; - if ('HEAD' == method) method = 'GET'; - if (routes = routes[method]) { - var url = parse(req.url) - , pathname = url.pathname; - for (var len = routes.length; i < len; ++i) { - var route = routes[i] - , fn = route.fn - , path = route.path - , keys = fn.keys = route.keys; - if (captures = path.exec(pathname)) { - fn.method = method; - fn.params = []; - for (var j = 1, len = captures.length; j < len; ++j) { - var key = keys[j-1], - val = typeof captures[j] === 'string' - ? decodeURIComponent(captures[j]) - : captures[j]; - if (key) { - fn.params[key] = val; - } else { - fn.params.push(val); - } - } - req._route_index = i; - return fn; - } - } - } -} diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session.js deleted file mode 100644 index 7fbeb18..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session.js +++ /dev/null @@ -1,346 +0,0 @@ - -/*! - * Connect - session - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Session = require('./session/session') - , MemoryStore = require('./session/memory') - , Cookie = require('./session/cookie') - , Store = require('./session/store') - , utils = require('./../utils') - , parse = require('url').parse - , crypto = require('crypto'); - -// environment - -var env = process.env.NODE_ENV; - -/** - * Expose the middleware. - */ - -exports = module.exports = session; - -/** - * Expose constructors. - */ - -exports.Store = Store; -exports.Cookie = Cookie; -exports.Session = Session; -exports.MemoryStore = MemoryStore; - -/** - * Warning message for `MemoryStore` usage in production. - */ - -var warning = 'Warning: connection.session() MemoryStore is not\n' - + 'designed for a production environment, as it will leak\n' - + 'memory, and obviously only work within a single process.'; - -/** - * Default finger-printing function. - */ - -function defaultFingerprint(req) { - var ua = req.headers['user-agent'] || ''; - return ua.replace(/;?\schromeframe\/[\d\.]+/, ''); -}; - -/** - * Paths to ignore. - */ - -exports.ignore = []; - -/** - * Setup session store with the given `options`. - * - * Session data is _not_ saved in the cookie itself, however - * cookies are used, so we must use the [cookieParser()](middleware-cookieParser.html) - * middleware _before_ `session()`. - * - * Examples: - * - * connect.createServer( - * connect.cookieParser() - * , connect.session({ secret: 'keyboard cat' }) - * ); - * - * Options: - * - * - `key` cookie name defaulting to `connect.sid` - * - `store` Session store instance - * - `fingerprint` Custom fingerprint generating function - * - `cookie` Session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: 14400000 }` - * - `secret` Secret string used to compute hash - * - * Ignore Paths: - * - * By default `/favicon.ico` is the only ignored path, all others - * will utilize sessions, to manipulate the paths ignored, use - * `connect.session.ignore.push('/my/path')`. This works for _full_ - * pathnames only, not segments nor substrings. - * - * connect.session.ignore.push('/robots.txt'); - * - * ## req.session - * - * To store or access session data, simply use the request property `req.session`, - * which is (generally) serialized as JSON by the store, so nested objects - * are typically fine. For example below is a user-specific view counter: - * - * connect( - * connect.cookieParser() - * , connect.session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }}) - * , connect.favicon() - * , function(req, res, next){ - * var sess = req.session; - * if (sess.views) { - * res.setHeader('Content-Type', 'text/html'); - * res.write('

    views: ' + sess.views + '

    '); - * res.write('

    expires in: ' + (sess.cookie.maxAge / 1000) + 's

    '); - * res.end(); - * sess.views++; - * } else { - * sess.views = 1; - * res.end('welcome to the session demo. refresh!'); - * } - * } - * ).listen(3000); - * - * ## Session#regenerate() - * - * To regenerate the session simply invoke the method, once complete - * a new SID and `Session` instance will be initialized at `req.session`. - * - * req.session.regenerate(function(err){ - * // will have a new session here - * }); - * - * ## Session#destroy() - * - * Destroys the session, removing `req.session`, will be re-generated next request. - * - * req.session.destroy(function(err){ - * // cannot access session here - * }); - * - * ## Session#reload() - * - * Reloads the session data. - * - * req.session.reload(function(err){ - * // session updated - * }); - * - * ## Session#save() - * - * Save the session. - * - * req.session.save(function(err){ - * // session saved - * }); - * - * ## Session#touch() - * - * Updates the `.maxAge`, and `.lastAccess` properties. Typically this is - * not necessary to call, as the session middleware does this for you. - * - * ## Session#cookie - * - * Each session has a unique cookie object accompany it. This allows - * you to alter the session cookie per visitor. For example we can - * set `req.session.cookie.expires` to `false` to enable the cookie - * to remain for only the duration of the user-agent. - * - * ## Session#maxAge - * - * Alternatively `req.session.cookie.maxAge` will return the time - * remaining in milliseconds, which we may also re-assign a new value - * to adjust the `.expires` property appropriately. The following - * are essentially equivalent - * - * var hour = 3600000; - * req.session.cookie.expires = new Date(Date.now() + hour); - * req.session.cookie.maxAge = hour; - * - * For example when `maxAge` is set to `60000` (one minute), and 30 seconds - * has elapsed it will return `30000` until the current request has completed, - * at which time `req.session.touch()` is called to update `req.session.lastAccess`, - * and reset `req.session.maxAge` to its original value. - * - * req.session.cookie.maxAge; - * // => 30000 - * - * Session Store Implementation: - * - * Every session store _must_ implement the following methods - * - * - `.get(sid, callback)` - * - `.set(sid, session, callback)` - * - `.destroy(sid, callback)` - * - * Recommended methods include, but are not limited to: - * - * - `.length(callback)` - * - `.clear(callback)` - * - * For an example implementation view the [connect-redis](http://github.com/visionmedia/connect-redis) repo. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -function session(options){ - var options = options || {} - , key = options.key || 'connect.sid' - , secret = options.secret - , store = options.store || new MemoryStore - , fingerprint = options.fingerprint || defaultFingerprint - , cookie = options.cookie; - - // notify user that this store is not - // meant for a production environment - if ('production' == env && store instanceof MemoryStore) { - console.warn(warning); - } - - // ensure secret is present - if (!secret) { - throw new Error('connect.session({ secret: "string" }) required for security'); - } - - // session hashing function - store.hash = function(req, base) { - return crypto - .createHmac('sha256', secret) - .update(base + fingerprint(req)) - .digest('base64') - .replace(/=*$/, ''); - }; - - // generates the new session - store.generate = function(req){ - var base = utils.uid(24); - var sessionID = base + '.' + store.hash(req, base); - req.sessionID = sessionID; - req.session = new Session(req); - req.session.cookie = new Cookie(cookie); - }; - - return function session(req, res, next) { - // self-awareness - if (req.session) return next(); - - // parse url - var url = parse(req.url) - , path = url.pathname; - - // ignorable paths - if (~exports.ignore.indexOf(path)) return next(); - - // expose store - req.sessionStore = store; - - // proxy writeHead() to Set-Cookie - var writeHead = res.writeHead; - res.writeHead = function(status, headers){ - if (req.session) { - var cookie = req.session.cookie; - // only send secure session cookies when there is a secure connection. - // proxySecure is a custom attribute to allow for a reverse proxy - // to handle SSL connections and to communicate to connect over HTTP that - // the incoming connection is secure. - var secured = cookie.secure && (req.connection.encrypted || req.connection.proxySecure); - if (secured || !cookie.secure) { - res.setHeader('Set-Cookie', cookie.serialize(key, req.sessionID)); - } - } - - res.writeHead = writeHead; - return res.writeHead(status, headers); - }; - - // proxy end() to commit the session - var end = res.end; - res.end = function(data, encoding){ - res.end = end; - if (req.session) { - // HACK: ensure Set-Cookie for implicit writeHead() - if (!res._header) res._implicitHeader(); - req.session.resetMaxAge(); - req.session.save(function(){ - res.end(data, encoding); - }); - } else { - res.end(data, encoding); - } - }; - - // session hashing - function hash(base) { - return store.hash(req, base); - } - - // generate the session - function generate() { - store.generate(req); - } - - // get the sessionID from the cookie - req.sessionID = req.cookies[key]; - - // make a new session if the browser doesn't send a sessionID - if (!req.sessionID) { - generate(); - next(); - return; - } - - // check the fingerprint - var parts = req.sessionID.split('.'); - if (parts[1] != hash(parts[0])) { - generate(); - next(); - return; - } - - // generate the session object - var pause = utils.pause(req); - store.get(req.sessionID, function(err, sess){ - // proxy to resume() events - var _next = next; - next = function(err){ - _next(err); - pause.resume(); - } - - // error handling - if (err) { - if ('ENOENT' == err.code) { - generate(); - next(); - } else { - next(err); - } - // no session - } else if (!sess) { - generate(); - next(); - // populate req.session - } else { - store.createSession(req, sess); - next(); - } - }); - }; -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js deleted file mode 100644 index 793c2e9..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js +++ /dev/null @@ -1,126 +0,0 @@ - -/*! - * Connect - session - Cookie - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../../utils'); - -/** - * Initialize a new `Cookie` with the given `options`. - * - * @param {Object} options - * @api private - */ - -var Cookie = module.exports = function Cookie(options) { - this.path = '/'; - this.httpOnly = true; - this.maxAge = 14400000; - if (options) utils.merge(this, options); - this.originalMaxAge = undefined == this.originalMaxAge - ? this.maxAge - : this.originalMaxAge; -}; - -/** - * Prototype. - */ - -Cookie.prototype = { - - /** - * Set expires `date`. - * - * @param {Date} date - * @api public - */ - - set expires(date) { - this._expires = date; - this.originalMaxAge = this.maxAge; - }, - - /** - * Get expires `date`. - * - * @return {Date} - * @api public - */ - - get expires() { - return this._expires; - }, - - /** - * Set expires via max-age in `ms`. - * - * @param {Number} ms - * @api public - */ - - set maxAge(ms) { - this.expires = 'number' == typeof ms - ? new Date(Date.now() + ms) - : ms; - }, - - /** - * Get expires max-age in `ms`. - * - * @return {Number} - * @api public - */ - - get maxAge() { - return this.expires instanceof Date - ? this.expires.valueOf() - Date.now() - : this.expires; - }, - - /** - * Return cookie data object. - * - * @return {Object} - * @api private - */ - - get data() { - return { - originalMaxAge: this.originalMaxAge - , expires: this._expires - , secure: this.secure - , httpOnly: this.httpOnly - , domain: this.domain - , path: this.path - } - }, - - /** - * Return a serialized cookie string. - * - * @return {String} - * @api public - */ - - serialize: function(name, val){ - return utils.serializeCookie(name, val, this.data); - }, - - /** - * Return JSON representation of this cookie. - * - * @return {Object} - * @api private - */ - - toJSON: function(){ - return this.data; - } -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/memory.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/memory.js deleted file mode 100644 index ec569f5..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/memory.js +++ /dev/null @@ -1,131 +0,0 @@ - -/*! - * Connect - session - MemoryStore - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Store = require('./store') - , utils = require('../../utils') - , Session = require('./session'); - -/** - * Initialize a new `MemoryStore`. - * - * @api public - */ - -var MemoryStore = module.exports = function MemoryStore() { - this.sessions = {}; -}; - -/** - * Inherit from `Store.prototype`. - */ - -MemoryStore.prototype.__proto__ = Store.prototype; - -/** - * Attempt to fetch session by the given `sid`. - * - * @param {String} sid - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.get = function(sid, fn){ - var self = this; - process.nextTick(function(){ - var expires - , sess = self.sessions[sid]; - if (sess) { - sess = JSON.parse(sess); - expires = 'string' == typeof sess.cookie.expires - ? new Date(sess.cookie.expires) - : sess.cookie.expires; - if (!expires || new Date < expires) { - fn(null, sess); - } else { - self.destroy(sid, fn); - } - } else { - fn(); - } - }); -}; - -/** - * Commit the given `sess` object associated with the given `sid`. - * - * @param {String} sid - * @param {Session} sess - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.set = function(sid, sess, fn){ - var self = this; - process.nextTick(function(){ - self.sessions[sid] = JSON.stringify(sess); - fn && fn(); - }); -}; - -/** - * Destroy the session associated with the given `sid`. - * - * @param {String} sid - * @api public - */ - -MemoryStore.prototype.destroy = function(sid, fn){ - var self = this; - process.nextTick(function(){ - delete self.sessions[sid]; - fn && fn(); - }); -}; - -/** - * Invoke the given callback `fn` with all active sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.all = function(fn){ - var arr = [] - , keys = Object.keys(this.sessions); - for (var i = 0, len = keys.length; i < len; ++i) { - arr.push(this.sessions[keys[i]]); - } - fn(null, arr); -}; - -/** - * Clear all sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.clear = function(fn){ - this.sessions = {}; - fn && fn(); -}; - -/** - * Fetch number of sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.length = function(fn){ - fn(null, Object.keys(this.sessions).length); -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/session.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/session.js deleted file mode 100644 index 4e7e1a6..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/session.js +++ /dev/null @@ -1,137 +0,0 @@ - -/*! - * Connect - session - Session - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../../utils') - , Cookie = require('./cookie'); - -/** - * Create a new `Session` with the given request and `data`. - * - * @param {IncomingRequest} req - * @param {Object} data - * @api private - */ - -var Session = module.exports = function Session(req, data) { - Object.defineProperty(this, 'req', { value: req }); - Object.defineProperty(this, 'id', { value: req.sessionID }); - if ('object' == typeof data) { - utils.merge(this, data); - } else { - this.lastAccess = Date.now(); - } -}; - -/** - * Update `.lastAccess` timestamp, - * and reset `.cookie.maxAge` to prevent - * the cookie from expiring when the - * session is still active. - * - * @return {Session} for chaining - * @api public - */ - -Session.prototype.touch = function(){ - return this - .resetLastAccess() - .resetMaxAge(); -}; - -/** - * Update `.lastAccess` timestamp. - * - * @return {Session} for chaining - * @api public - */ - -Session.prototype.resetLastAccess = function(){ - this.lastAccess = Date.now(); - return this; -}; - -/** - * Reset `.maxAge` to `.originalMaxAge`. - * - * @return {Session} for chaining - * @api public - */ - -Session.prototype.resetMaxAge = function(){ - this.cookie.maxAge = this.cookie.originalMaxAge; - return this; -}; - -/** - * Save the session data with optional callback `fn(err)`. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.save = function(fn){ - this.req.sessionStore.set(this.id, this, fn || function(){}); - return this; -}; - -/** - * Re-loads the session data _without_ altering - * the maxAge or lastAccess properties. Invokes the - * callback `fn(err)`, after which time if no exception - * has occurred the `req.session` property will be - * a new `Session` object, although representing the - * same session. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.reload = function(fn){ - var req = this.req - , store = this.req.sessionStore; - store.get(this.id, function(err, sess){ - if (err) return fn(err); - if (!sess) return fn(new Error('failed to load session')); - store.createSession(req, sess); - fn(); - }); - return this; -}; - -/** - * Destroy `this` session. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.destroy = function(fn){ - delete this.req.session; - this.req.sessionStore.destroy(this.id, fn); - return this; -}; - -/** - * Regenerate this request's session. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.regenerate = function(fn){ - this.req.sessionStore.regenerate(this.req, fn); - return this; -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/store.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/store.js deleted file mode 100644 index 6a3d47d..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/session/store.js +++ /dev/null @@ -1,87 +0,0 @@ - -/*! - * Connect - session - Store - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , Session = require('./session') - , Cookie = require('./cookie') - , utils = require('../../utils'); - -/** - * Initialize abstract `Store`. - * - * @api private - */ - -var Store = module.exports = function Store(options){}; - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Store.prototype.__proto__ = EventEmitter.prototype; - -/** - * Re-generate the given requests's session. - * - * @param {IncomingRequest} req - * @return {Function} fn - * @api public - */ - -Store.prototype.regenerate = function(req, fn){ - var self = this; - this.destroy(req.sessionID, function(err){ - self.generate(req); - fn(err); - }); -}; - -/** - * Load a `Session` instance via the given `sid` - * and invoke the callback `fn(err, sess)`. - * - * @param {String} sid - * @param {Function} fn - * @api public - */ - -Store.prototype.load = function(sid, fn){ - var self = this; - this.get(sid, function(err, sess){ - if (err) return fn(err); - if (!sess) return fn(); - var req = { sessionID: sid, sessionStore: self }; - sess = self.createSession(req, sess, false); - fn(null, sess); - }); -}; - -/** - * Create session from JSON `sess` data. - * - * @param {IncomingRequest} req - * @param {Object} sess - * @return {Session} - * @api private - */ - -Store.prototype.createSession = function(req, sess, update){ - var expires = sess.cookie.expires - , orig = sess.cookie.originalMaxAge - , update = null == update ? true : false; - sess.cookie = new Cookie(sess.cookie); - if ('string' == typeof expires) sess.cookie.expires = new Date(expires); - sess.cookie.originalMaxAge = orig; - req.session = new Session(req, sess); - if (update) req.session.resetLastAccess(); - return req.session; -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/static.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/static.js deleted file mode 100644 index b9c2c86..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/static.js +++ /dev/null @@ -1,225 +0,0 @@ - -/*! - * Connect - staticProvider - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , path = require('path') - , join = path.join - , basename = path.basename - , normalize = path.normalize - , utils = require('../utils') - , Buffer = require('buffer').Buffer - , parse = require('url').parse - , mime = require('mime'); - -/** - * Static file server with the given `root` path. - * - * Examples: - * - * var oneDay = 86400000; - * - * connect( - * connect.static(__dirname + '/public') - * ).listen(3000); - * - * connect( - * connect.static(__dirname + '/public', { maxAge: oneDay }) - * ).listen(3000); - * - * Options: - * - * - `maxAge` Browser cache maxAge in milliseconds. defaults to 0 - * - `hidden` Allow transfer of hidden files. defaults to false - * - `redirect` Redirect to trailing "/" when the pathname is a dir - * - * @param {String} root - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function static(root, options){ - options = options || {}; - - // root required - if (!root) throw new Error('static() root path required'); - options.root = root; - - return function static(req, res, next) { - options.path = req.url; - options.getOnly = true; - send(req, res, next, options); - }; -}; - -/** - * Expose mime module. - */ - -exports.mime = mime; - -/** - * Respond with 416 "Requested Range Not Satisfiable" - * - * @param {ServerResponse} res - * @api private - */ - -function invalidRange(res) { - var body = 'Requested Range Not Satisfiable'; - res.setHeader('Content-Type', 'text/plain'); - res.setHeader('Content-Length', body.length); - res.statusCode = 416; - res.end(body); -} - -/** - * Attempt to tranfer the requseted file to `res`. - * - * @param {ServerRequest} - * @param {ServerResponse} - * @param {Function} next - * @param {Object} options - * @api private - */ - -var send = exports.send = function(req, res, next, options){ - options = options || {}; - if (!options.path) throw new Error('path required'); - - // setup - var maxAge = options.maxAge || 0 - , ranges = req.headers.range - , head = 'HEAD' == req.method - , get = 'GET' == req.method - , root = options.root ? normalize(options.root) : null - , redirect = false === options.redirect ? false : true - , getOnly = options.getOnly - , fn = options.callback - , hidden = options.hidden - , done; - - // replace next() with callback when available - if (fn) next = fn; - - // ignore non-GET requests - if (getOnly && !get && !head) return next(); - - // parse url - var url = parse(options.path) - , path = decodeURIComponent(url.pathname) - , type; - - // null byte(s) - if (~path.indexOf('\0')) return utils.badRequest(res); - - // when root is not given, consider .. malicious - if (!root && ~path.indexOf('..')) return utils.forbidden(res); - - // join / normalize from optional root dir - path = normalize(join(root, path)); - - // malicious path - if (root && 0 != path.indexOf(root)) return fn - ? fn(new Error('Forbidden')) - : utils.forbidden(res); - - // index.html support - if (normalize('/') == path[path.length - 1]) path += 'index.html'; - - // "hidden" file - if (!hidden && '.' == basename(path)[0]) return next(); - - fs.stat(path, function(err, stat){ - // mime type - type = mime.lookup(path); - - // ignore ENOENT - if (err) { - if (fn) return fn(err); - return 'ENOENT' == err.code - ? next() - : next(err); - // redirect directory in case index.html is present - } else if (stat.isDirectory()) { - if (!redirect) return next(); - res.statusCode = 301; - res.setHeader('Location', url.pathname + '/'); - res.end('Redirecting to ' + url.pathname + '/'); - return; - } - - // header fields - if (!res.getHeader('Date')) res.setHeader('Date', new Date().toUTCString()); - if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + (maxAge / 1000)); - if (!res.getHeader('Last-Modified')) res.setHeader('Last-Modified', stat.mtime.toUTCString()); - if (!res.getHeader('ETag')) res.setHeader('ETag', utils.etag(stat)); - if (!res.getHeader('content-type')) { - var charset = mime.charsets.lookup(type); - res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); - } - res.setHeader('Accept-Ranges', 'bytes'); - - // conditional GET support - if (utils.conditionalGET(req)) { - if (!utils.modified(req, res)) { - req.emit('static'); - return utils.notModified(res); - } - } - - var opts = {}; - var chunkSize = stat.size; - - // we have a Range request - if (ranges) { - ranges = utils.parseRange(stat.size, ranges); - // valid - if (ranges) { - // TODO: stream options - // TODO: multiple support - opts.start = ranges[0].start; - opts.end = ranges[0].end; - chunkSize = opts.end - opts.start + 1; - res.statusCode = 206; - res.setHeader('Content-Range', 'bytes ' - + opts.start - + '-' - + opts.end - + '/' - + stat.size); - // invalid - } else { - return fn - ? fn(new Error('Requested Range Not Satisfiable')) - : invalidRange(res); - } - } - - res.setHeader('Content-Length', chunkSize); - - // transfer - if (head) return res.end(); - - // stream - var stream = fs.createReadStream(path, opts); - req.emit('static', stream); - stream.pipe(res); - - // callback - if (fn) { - function callback(err) { done || fn(err); done = true } - req.on('close', callback); - stream.on('end', callback); - } - }); -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/staticCache.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/staticCache.js deleted file mode 100644 index 9ea8eb7..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +++ /dev/null @@ -1,175 +0,0 @@ - -/*! - * Connect - staticCache - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , utils = require('../utils') - , Cache = require('../cache') - , url = require('url') - , fs = require('fs'); - -/** - * Enables a memory cache layer on top of - * the `static()` middleware, serving popular - * static files. - * - * By default a maximum of 128 objects are - * held in cache, with a max of 256k each, - * totalling ~32mb. - * - * A Least-Recently-Used (LRU) cache algo - * is implemented through the `Cache` object, - * simply rotating cache objects as they are - * hit. This means that increasingly popular - * objects maintain their positions while - * others get shoved out of the stack and - * garbage collected. - * - * Benchmarks: - * - * static(): 2700 rps - * node-static: 5300 rps - * static() + staticCache(): 7500 rps - * - * Options: - * - * - `maxObjects` max cache objects [128] - * - `maxLength` max cache object length 256kb - * - * @param {Type} name - * @return {Type} - * @api public - */ - -module.exports = function staticCache(options){ - var options = options || {} - , cache = new Cache(options.maxObjects || 128) - , maxlen = options.maxLength || 1024 * 256; - - return function staticCache(req, res, next){ - var path = url.parse(req.url).pathname - , ranges = req.headers.range - , hit = cache.get(path) - , hitCC - , uaCC - , header - , age; - - // cache static - req.on('static', function(stream){ - var headers = res._headers - , cc = utils.parseCacheControl(headers['cache-control'] || '') - , contentLength = headers['content-length'] - , hit; - - // ignore larger files - if (!contentLength || contentLength > maxlen) return; - - // dont cache items we shouldn't be - if ( cc['no-cache'] - || cc['no-store'] - || cc['private'] - || cc['must-revalidate']) return; - - // if already in cache then validate - if (hit = cache.get(path)){ - if (headers.etag == hit[0].etag) { - hit[0].date = new Date; - return; - } else { - cache.remove(path); - } - } - - // validation notifiactions don't contain a steam - if (null == stream) return; - - // add the cache object - var arr = cache.add(path); - arr.push(headers); - - // store the chunks - stream.on('data', function(chunk){ - arr.push(chunk); - }); - - // flag it as complete - stream.on('end', function(){ - arr.complete = true; - }); - }); - - // cache hit, doesnt support range requests - if (hit && hit.complete && !ranges) { - header = utils.merge({}, hit[0]); - header.Age = age = (new Date - new Date(header.date)) / 1000 | 0; - header.date = new Date().toUTCString(); - - // parse cache-controls - hitCC = utils.parseCacheControl(header['cache-control'] || ''); - uaCC = utils.parseCacheControl(req.headers['cache-control'] || ''); - - // check if we must revalidate(bypass) - if (hitCC['no-cache'] || uaCC['no-cache']) return next(); - - // check freshness of entity - if (isStale(hitCC, age) || isStale(uaCC, age)) return next(); - - // conditional GET support - if (utils.conditionalGET(req)) { - if (!utils.modified(req, res, header)) { - header['content-length'] = 0; - res.writeHead(304, header); - return res.end(); - } - } - - // HEAD support - if ('HEAD' == req.method) { - header['content-length'] = 0; - res.writeHead(200, header); - return res.end(); - } - - // respond with cache - res.writeHead(200, header); - - // backpressure - function write(i) { - var buf = hit[i]; - if (!buf) return res.end(); - if (false === res.write(buf)) { - res.once('drain', function(){ - write(++i); - }); - } else { - write(++i); - } - } - - return write(1); - } - - next(); - } -}; - -/** - * Check if cache item is stale - * - * @param {Object} cc - * @param {Number} age - * @return {Boolean} - * @api private - */ - -function isStale(cc, age) { - return cc['max-age'] && cc['max-age'] <= age; -} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/vhost.js b/usb_auth/node_modules/express/node_modules/connect/lib/middleware/vhost.js deleted file mode 100644 index 913d756..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/middleware/vhost.js +++ /dev/null @@ -1,44 +0,0 @@ - -/*! - * Connect - vhost - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Setup vhost for the given `hostname` and `server`. - * - * Examples: - * - * connect( - * connect.vhost('foo.com', - * connect.createServer(...middleware...) - * ), - * connect.vhost('bar.com', - * connect.createServer(...middleware...) - * ) - * ); - * - * @param {String} hostname - * @param {Server} server - * @return {Function} - * @api public - */ - -module.exports = function vhost(hostname, server){ - if (!hostname) throw new Error('vhost hostname required'); - if (!server) throw new Error('vhost server required'); - var regexp = new RegExp('^' + hostname.replace(/[*]/g, '(.*?)') + '$'); - if (server.onvhost) server.onvhost(hostname); - return function vhost(req, res, next){ - if (!req.headers.host) return next(); - var host = req.headers.host.split(':')[0]; - if (req.subdomains = regexp.exec(host)) { - req.subdomains = req.subdomains[0].split('.').slice(0, -1); - server.emit("request", req, res); - } else { - next(); - } - }; -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/patch.js b/usb_auth/node_modules/express/node_modules/connect/lib/patch.js deleted file mode 100644 index a6ff297..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/patch.js +++ /dev/null @@ -1,79 +0,0 @@ - -/*! - * Connect - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , res = http.OutgoingMessage.prototype; - -// original setHeader() - -var setHeader = res.setHeader; - -// original _renderHeaders() - -var _renderHeaders = res._renderHeaders; - -if (res._hasConnectPatch) return; - -/** - * Provide a public "header sent" flag - * until node does. - * - * @return {Boolean} - * @api public - */ - -res.__defineGetter__('headerSent', function(){ - return this._headerSent; -}); - -/** - * Set header `field` to `val`, special-casing - * the `Set-Cookie` field for multiple support. - * - * @param {String} field - * @param {String} val - * @api public - */ - -res.setHeader = function(field, val){ - var key = field.toLowerCase() - , prev; - - // special-case Set-Cookie - if (this._headers && 'set-cookie' == key) { - if (prev = this.getHeader(field)) { - val = Array.isArray(prev) - ? prev.concat(val) - : [prev, val]; - } - // charset - } else if ('content-type' == key && this.charset) { - val += '; charset=' + this.charset; - } - - return setHeader.call(this, field, val); -}; - -/** - * Proxy `res.end()` to expose a 'header' event, - * allowing arbitrary augmentation before the header - * fields are written to the socket. - * - * NOTE: this _only_ supports node's progressive header - * field API aka `res.setHeader()`. - */ - -res._renderHeaders = function(){ - this.emit('header'); - return _renderHeaders.call(this); -}; - -res._hasConnectPatch = true; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/directory.html b/usb_auth/node_modules/express/node_modules/connect/lib/public/directory.html deleted file mode 100644 index 15164bb..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/public/directory.html +++ /dev/null @@ -1,75 +0,0 @@ - - - listing directory {directory} - - - - - -
    -

    {linked-path}

    - {files} -
    - - \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/error.html b/usb_auth/node_modules/express/node_modules/connect/lib/public/error.html deleted file mode 100644 index 34e0df5..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/public/error.html +++ /dev/null @@ -1,13 +0,0 @@ - - - {error} - - - -
    -

    {title}

    -

    500 {error}

    -
      {stack}
    -
    - - \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/favicon.ico b/usb_auth/node_modules/express/node_modules/connect/lib/public/favicon.ico deleted file mode 100644 index 895fc96a76b68b4924f1c51d022e1b82fa0f461f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmZQzU<5(|0R}M0U}azs1F|%L7$l?s#Ec9aKoZP=&}i&OouUjIY8@C}uZw4x5z5N2 zvEG^C^vXtt_xtJ?p3O32c(KTx;lsgZhW%5M85Sf}k-mf`L80)|7ga~M{a znlL=>m1Q`#uoPkbC~GtXMnhnDh5$DU1D6mx+;2QAKt3ZQFH}H~1y~00GcqzVg9QXw z_<%(a7y$V|wJgF=E>MgE#Aid|14}IyCM5MhEnxFF;pTzOK(>#80puP=gnOXwAd33` mpMe2}f66m3eB@_fcnmb^7!b1nO#opK8zcsj1F30)+jEP);68^d)m`eN0o>(5%D`Q(1;j>g@G;xlf`0VBQ`PFY?6)!N&f?*K}$p; zB!U=NBn{eB8${1}&-2_L*HuZp@ZP1@clS@cHp)4iM1ewzw59vko7eMM{e9z|%NNdX z0V;`?KKSzTCvTm5bc{L^CIKLUxc2X{i{ISz$8Sgf{q)1nXTP{`{s?9mQ$4&hPiKC- zY8q7(Y1Xu5iCf33=O4Vy(+|zQ?rW#gkKB0f%}?+6{G*qT22|DQB-73`YzA{N4W^=s zq0kQYcbtFfz zLz)H<&|z(Y4kBG67=JY6c|L1R-#TR>fC$3^Y%QEnYO1xHsf)+GU`3F<{J0kR(;pbF3)zyg$H+idfnl-wl5Wkh!vUH z4Z32YP=l_}1rZd1W_D&^$A($A+&a0e&P?xx0!ctY2}*<#p+qPVN*B(YzvAWXa*%bzq z7Fz41LKILT(GWohi9|LgIzSZBhb*Zf6R6O}WYQ4GOi&71s9lmll0x6;8&ILOl$j(c z0Z1T(6Tg09{?wd{moFHNN6PS?$|e>1MxSJ(0Z7o2)J-Zv|>acY@f`(Y@g7GwsEj5NLQo+q|HsxQ5}XSX_d@*^A9ZT9=A{W~j+$GyI1 zc4oqTHx@1FlRjw4XWyPN5i2~l_F3@aBk!0yu^aoRDvXy}8@HCjUVQUsuSH4$T5|r< zzZOn^?Wfa6y|Q($Hx4{ws+)wX6-HP4zo!S?4KJ@7PG@G3G{CjXs(p*kIrj6rHs7_y z+=<-=Q62s9FuWa^X~WKgJIAAZJR&XBB002ovPDHLkV1jCMPILeO diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png deleted file mode 100755 index 89ee2da0753040d1ba0a3487473a715a8fe89322..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 794 zcmV+#1LgdQP)i_t#ewV_0K6;=bl;e_Jt7$~$sQ)q$+ia<4Ec+jeaGt9oWH@O|2`W6&O0t!k{B9sUvLWxkCaPsd9W(`fa z;j-|^ZI^2XnzhgZWYRW-kP&J>DWPo`%;JaBX}or79k=+Jo@h%4Eo72tqev+cB?PjP zO<|ByL#>Tehyq$jR74O$B9WDW1`tK`LzYyL3A9iAcRxLkJ`I)n}v%Od-3H>j$OTBtk>(k-9o?8PqI=0 zB&f-+KOXVnjyKJlf4iHOtnuiE_4+ZVJ$dHjU<^o^YCjQ-wt^!;rPpBv(@pFO{9rdw98 z_s@3+yta93oyfL>7AD5}r=|`zS3Gm$_|(iSl8XBd9k%=91J0j2=ivT5cJ18ZmDjh{ z$-RMd{jQ#X79#Sc diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_code.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_code.png deleted file mode 100755 index f7ea90419d950f9e69d977a1f5847456d96a5f0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 818 zcmV-21I_%2P)@LCln44|RX7Ti z0HI3&7jPq){odH{?_{%nYVq_;n_c4WbUpvU(&Cvnj!vq|kVC-vpF6vp^;;e0mm6HW z+WPzA`AZ|;pPp$&dNjzrc??4rt`k%Q1l*u-BPD0MQ}Fbm8jnsyezNt7+u{23>t7Em zJtETY?ja9KrVs^!LJ$xEMF3-bAZO;-IQJavE60KA7fO$VY_%N)R6s>g5mW>fL4&aR z*EVgKKTBXm!=L?S0?xM zYqL@C$|EDF2q*3zWW7;PDZ}SK*IE8;i!3U62=qn80C&*I1Le7WwNP5EcX;_oh2dJn zf#HgBe4@r$GcjHjmj2vAfT%(YN?}kK=(*+1*DkNNc1H5R++vfBMhACi<5uFUU+N4+ z<&U*CPmWi}REa7C6-t>2im1CWv5Jkefxa6>)dEj-CAW wWa{_}BJ!}~75?MkfaCnj>Dn=~vkLS70Pk`;z)@TQj{pDw07*qoM6N<$f@imYHUIzs diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png deleted file mode 100755 index 195dc6d6c365d298e466026b37c1959d96119ea7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 663 zcmV;I0%-k-P)^@R5;6Z z(>-WZK@^7J_sq=QY_e{46@P+~LNG}sRzZsxQHvCsN*h5ir6^j7pq-$xu$N#V1gx}9 zClV7;5)7zih-s3DB)G=7|99>ji@So7-P24n=VQ(@GctDX!^_@$bj%oviY6e4Dh;od zooe%Wvs8LEKQ&&bL&@bwi=STIAI@!-gB2jC5+?y?VR~VkrNxam-`6*8&po|RZ5LpS zNKdJ%c4bTX`XjKsnecf%W>1%6WT?pKNdLLq{=(f(Col?P1+oq@R>)W(n=x!|*BIIh z6DJGw_w`)u6yN|vAhMteYK5#b%r5^v+VCFl1IGssaclZZMS{vs-LJ2$)n7DAr6==K z<29#%AXsBsDoO}SBaXR#_Ap!JKx)(1)3O2pj0_dYWz5By*X74fRT01$Fk%P_RzOMDtV?GU{nsYq#K8iy zb6qzLYDj`_f5$BwC*WE(t0m#xYJ*=jC2|HQYHh=pf#QG7oowi`h!L!{DB$8|qY{~X zu8@sU1tWq;n$XThR0%;45mdqXM892|{CJ@0DS*}>?ami06Q_^tvM~Y3K(_-`#m!8f z8f!QIrH4y#61;0Ym0cCoLl8{IPombPHtnn7%SbTdI&G-d>ZQo!_wBMF9nzX!g8HVY xYTJPGciz9XMh3w2fmZ(7v{)r*QZD48?mrio{~IaoqP z|1Ep}yDQG09bP~E^Dk?@JiKQJ z6-pO(3~IOP)IYisL6D6;oAEd;E%zR}{U$rMRNuD6nQV7nesKS>)yLo7JuDCrD>Abi zbj3uW23?^GA}9jQ{M^8v?ejL?HaT7AX5WPZNkBmfN`w-jL?{tT7ykZt$%Yln?p_m~ z-?>&d(LD(jAd}h=LPltPQbO$*Wbyl@G-_k5jXbb#qffHY03>M1jfEqoPJQ6Mr=Byp=^jfzePZV1 zLjCmNi31hdIJHa%e;5g=1(`u3BRzfeExY%=VCu{loOr{`%2hUR*x>tL^W_TTaj);0 zpPR6CUD1+0>4TQ6zVfH3TQ;%l6#(_%yspK@3gcmG#Q4!WCPyLU93nMKk7E2pcA=l45({2jNho>sdF*A~bA zxX?-cp~y_z_kFf+yqu3m#QiB}03?Z&9vvR5TNgj<)($Vm)xq5G>|o2sFMag&6aNF+ WAT1?sQBYt20000iHtsh1EzPArg^Q zIZrOk#rNsfjaSbMAL;<4h;Z=jvu8dzyz8N&Nb7=z03ZUw?9z%8KQEa6yM5=kUnka& z3?FJk2}L7q>na=T#;<7U*P91xfF`;`6%pVgWgRy0?1ZryL@%z52=-!fGXWGEn4M351L4<+7eDgwo|moqXT+s1&Kmn>-uQQ8mL7XY)w5Zk*(g+<3Y3tmkR!bL zOUKaUtj_pX26sH+=Iorwu}MGd`_%O-_sS}8VpG#fJA)Fcs#ezwtZf?q?Ac70mDv`rVs{$od?VPKeqf<-kUjNtS6ecB*mq<&M97K^6IVsDO zt2$Ru!b+>2S<}_H>$RcInusU_8PMNdf(W{sNlJ3FkrwMJPeBPO#d}Y^a{9TH(#{Y) l0D?dWAV4eUJX#h`!2gmISk&ZKd4B)^002ovPDHLkV1g&sd|Lnj diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_error.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_error.png deleted file mode 100755 index f07f449a44ff2761bfc7b752db3d08d0e1238b02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 793 zcmV+!1LpjRP)lHwhvrAu0-@MQwt}+5~MQTtu}C0%;W( z1<{R?aHBz*g;pk%AyQVBR_Zu5m~;ES_vxI-O!vIF|H*|T{l`n#garr?$RMk>)?Y48 z(ZF2yTneKb};DNWF+jK)IF`6_IfJ{i|F3o%Q+l&4_HGBD|ACE8na_6>L z=s{^>-C(a7J$6=8A_%h5W!1K6dcL!D?XX+Ndk)oei?UundDpX_E&1Y&`)3P8#Ny0s z2Ag7_&ZPhyGj%)g&S6V2LNun1;iBQm#Fwlfv zgyESZR$X}2P;=RW!2zid1r$hBL{K7>2qi*f7>pT1=RdT3@-anEoH{ z={KFOO;Dh#bV*jaN>}M>RZqQd`S=6O9C3KpI~I>l%QFYfo;jqQYe5fcn`)+)zMm6P z4X&L(>gnN0!%J4^rhX->?$S5bY<=GEU%jc!KLL8sww-Eg;h z`H-yBHa)yfojYT}&G*GFc$<(Yja_q=lZvj66DC^O5%$B)|Z(CeD=n`|eM04SP; z>-=-l+xdJjA~vR6^xB#o{ehf~tSM`iwaQv$O<8NIHA}W_WOw*~ XD^gE}t;YAo00000NkvXXu0mjfl6ZQ> diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png deleted file mode 100755 index eb6158eb5ca9c4b64c81e70e0fd894dbc8e2bed9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 817 zcmV-11J3-3P)hdKqhFO_H1|Vn1E?(=|cjAh_&P}y{{^`u< zcYD@PK?$)4i~7o9*6F_$F$4lR(d4AAvrez^(88Hk+)+B7E)M3jc=Ewl4$S^`_qwSF zA%qz@=c2EOsz@0qB1IqsqJU)HaG&+}%`-OM8YqW{K85hqj@4&V9vz!Cm_n0-W#f;# zeEpJde%vdgRn5?(+PY=W*z~|lT2-mtown({ll8&3S5+lWz5K}LTRW{k{eJn3Qz!SU zQ`@qI_n2;K?RG~pYJ9=dj-RWgG;P&wEuoAxL~Q)<>x0b=dED^Outj&xQ^rA;u3pw| zca_ClTh_d9cxXg_U!lLRl0`xU@$=UXO|_dRdtXfKwPawmnf(LC7u}-U>8k6}3u|{8 zs9LHr>MIJZGD^r9h|q2yF24Wuh+PM^yMN9GP1$khlDkdyCY}D{kg}jEf-(kW5jBY> z0rB29ZhG-r=i_R{;+1k0?A-sBM;AP6(k1i9ZuixR4?MqXOvphQgCYj~RnXKKL~J9Q zIDNz~XMfO{ZhUg&BTtMyXJqDVqc<x643?SvKHx004lTvR=0a5$dUw z>Xb470000$S;ka1sfH4I-R8njUol7M4dtApOahDylptpYswf1hD#CwFoz6oEA>(SIECU&IQ%a}GXdnC!9$70`0uH1B00000NkvXXu0mjf!8w72 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_find.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_find.png deleted file mode 100755 index 2f193889f7ea091c292acdd684c595dcb206b5c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 879 zcmV-#1CacQP)@+1&aazfGU7ezSm^v zpACwO+tu0su66!(dT=`e05DeeCnCFJW(8|RKtKa{4LGONnx2V85A4m%PEQ?MEtR-esdM$pB-`H542D0)N2zSC6Imf)4L8?>%ZrW+H>xCKi$unm zvGZq-*Q%Aahx;C*=l+K%-?>XB)6TB$-L$r*`RUvlA`xP1NG2?)ge8@TQ4EN|Jks0u zcDg;oFC#-#R`YbWB`D?Q`1#y7l$LXhjSLf8AvQuB84}i#j0^!#g{VE#(K7h@5pFHy zSenl=@XBEdxp`h2Ji>CR%=qXJ7!e|?paKet-~;#ok#jETyeB(5&Bkhp;!+;51~G=) zH?L7xmDUu_h+a$+xuWom;AWW!mS$%%+436Rjc@}y?l1134kgD0AOf$OmjOR zstUlshZk$ZC!bAyIg{Y29z#&@3SJ;6D4+_eFume9^#TmMccC5u0J!ZCTnO6m$lnD| z5JeFHf`Xs~1vP>RLKI1GKDY<~pjr2&bi(fX;6Nj-ss@Ds0CcoO0H{JsEQkm{q03skAA);_bv3q{k31qwVo&s-q`Z?_e+j^w(WL? zl+uETs5+~xBU2};OqEE9ETLGwsMGe1%iTRNue)9}|0~E4B*@5#oRXZ9oRXZ9TqRep zPrGZuoOON4n@=uPbyP1y4G=+HktC6l(gZoFD>@_lXDrN?wo+zozGt3P=Qh+3L7+}q z2!WK7geXLnO3Vw;o12Skp%_E#+N#9;DDWP?Q-VS3B$v~Ha)dDzWn0zG~O(^_1!n0HYp-( z+;wPIdoFgQlpYV!10V>5@a)1LyGBMvoa}miyp(bxbMTM-FYNyx;V@TfYddyT00000 LNkvXXu0mjf90!wr diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_go.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_go.png deleted file mode 100755 index 80fe1ed0cc75fbb67e9398ae686641f8fb287238..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 779 zcmV+m1N8ifP)JNR2Ufr z!Apo%Wf%b9=l#x^8AolrB&K9H?Pg_|78WA8(M3toqE%3B#7*srcF`i*xhupr27%Nr ziguah1+mN)U5GNmyEfQ3-e%_i&-vb-Co#(>FJ+EhQEwjRYVQ(&UYy{U@%vbY||>@4x=B^vIqabI?L* z;-S&DS^V3-ni4^fl|HMkOEbgX)(390>A}|VIypb5Xee4g;7ck zwKh^A3Mi1Mh@eC$5lV!}Fw%sP623U`g3pd_Hr5sunLvTskx4}&Gm%Q6L}(l4x}jCe z*81q1_4-O*ffi~_nMslo?EQ8t*&Ec(pzEw$vc}pKn_Qp0>D7Jr>ATNC3w@9f|Y+U&+)#!t7l&wKp+nP{PQsb+fb=Yf!Fu&5j8vpRj{FT>jD z>d>$sx;A&+`n$HcF}&sYKSyR;=(=9tvvOj@hUG;~4qTYk^_@E=?$*^_pVh_bGnOt~ z;pEw)j{SK$XVc;qy181rT655gW9NG{(yeablViIL>cDI_ux8m>Pp{tY$J0lgo4#ax za?j0EA3s0S!f>{~ykN9h_RhM&g3K(E`q(dE(Rd49+%xMeR9{qlWnmd{s#(SQ>PmFtSQqUjAtB;_Vvt6}AS_5YgM`Uqu`yva+H8^=4U$e4gHb}u zAQ2N{V3A%pO|?Pv?tb6z=jC}SiRa$G^v3q?*6XcYz$p|cq{uLj@#~Fi`J(>5{@&&N zy%T^+;>8cXx%|o77anP?&W1?1A(>-T49z9pyeCl@7YI+Si zKti7=B~``}TImz(G{0PnlQA3P#MAd}sorMjkP!50B7$nAkU^%#nl{Q9lW0@}9fE-> zN(q7tRuiC_T1r|BBtVBTlQ2+70$Rf;eF`Z;lx46Cpu-rEgb)EBKq(b^W8l<^We(`D z43?0=01z<3G6+UUv6`CsWCk6^93!#+<;ws7007{zS3k2k9-zZKFO~(k`>s0y006+1 zgF_jyIhsL-`FMf~JL~C=cV75(CrJ|q;MVO961G=O zm9d)YpJg5g(4i_HKL75eSE}mq$Y}r}hyVdcV~p>6a}oXr80q`oj%+s700000NkvXX Hu0mjfPs|!l diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_key.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_key.png deleted file mode 100755 index d6626cb09eb11a298b90a8a27b0d8eab41f49a82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 801 zcmV++1K#|JP)$lC4gU2-`f*>nhR-;k6IP7e>YO!0^w)WK%3$w02v-#>5Ep64PCP| zJihT#O|N+nT7XR2h7dAB?UEAOhJF^mol1i`QtQB`HSY}RE7=r! z)zaVIHr5?>v2Gz&fdYw&2ug$!p+txby(aWZ7(4QT)l2`jX7eMQ{>)lG6ev(fWKxmH zOr%mM5$6B%u~qGtCf40#`mbGj3s!n+^%wnJ&#rl>g<4Z)lB5J6f!?|AP275)Zswr* z%T}4~{;_(?waU!#?JabbF3Cy-kf0{R{z}6$e=5yMQKt3BPcl2>zoTPMqMwF;3!_n|>sT?~bK_-2O_m+o>GJ6h zt=+g$4n7y%1qVJI7*5Yw(hqM=JusY{d}*?U(Oj*gT655eZ>Ksn(qrd7v3}DX1}C>` z+X+8@+4-pVq_fxG zlU}~Ye!0+%>J+pPk+0wV{GM$QaYM?5ux)w2z59=S&H2+K?;gH$bZGzL&g5>G ft+noNiyiPkP9r@8gT|RZ00000NkvXXu0mjfuqTIu diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png deleted file mode 100755 index 7e568703d6432c530224e443771a04fc1e2e59c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 839 zcmV-N1GxN&P)73{`^;G#xwAtHz%LU)4b zqTRU=ve1RNa3QT=ZM7C`iJ~QFQ*9t7<~pX$d^7W%^M8FFCkcQj-~0ZRTBCB(J0^iD z-~e!d9LR`f3#|=(>$bPvx_D-~2jC%pJ=n_e_OK zeJ_2b-KdDDh@@UlzBSMC;EPygH_MwjWBnPGQegihBV73D?-x9PlHL9A=(Vg=8^d<4 z<9r=UkxuIm)*CO=9e###7PztDxUv}e?$0)rQicmYhV`pQ%S!g@;K(?TVfhM#E?bM| z=B0gfb6h@a8bf5FVT-SV~6}?X}9lK@@Yynoty&1zdZP@?RfODsl=2XzzU% zS8gIN43How+9%bK2S@Xbc`O>`z5`%^;pXGy8^4f>9^3!Sp@|O&)m;dOa3q6d;4P-l zca|=H_{G&m?D_+&-}r{u-J$5T=(X4R&)q|O^gN8cgv;s#@5sEPT5_Z)oFo9Ac>l+I zc4ng5zHpps|9)<_Rw>5bKzE(M1j)dFWI_%OH$BJSz0?T+02W0)_a>#vFqb!*d|5wB zzBUN|M&ty51O@=i?kiDrjQ{{}e|^rU?OS|RdxxP1p5mAw36cX72#`R6UsoeCQFI~! z0ATITp!vfeYyQ?Dr=^5BAshfEa0nB~JG?nUa2Aur006MC*<9`)86SPS(W^`H2n+xi ztOWohsFfVfVWrI7PSKW}BmkyPoj(-|J?ES|BGd-}fIxr{00@ANnO*ZR`#)pee4I5T Rmm>fG002ovPDHLkV1i|Hc$okI diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_link.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_link.png deleted file mode 100755 index 312eab0914ab59271384686255d1be913a6b3add..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 830 zcmV-E1Ht@>P)VWgGzD=Y79#JI$lhEn`|2MpRa?Bt#-nSD~P0P(mbVe{KrOBoKnSsk>m|ML{6l zBosu@om4j#WzNLRAk+{k1JRvL(MfE&vvbb->v>W{*z*1_uMP}0cIRX*?mz+wk%*#O z%0D-+$B*g1nRkvI+_3E8Pr1NC6@5M&4vWaLCnNlr;lNlr4i91z&)eBGqL{L{GNu;Fof}GS9{gM5BJuH;2QWk8yuOZdB3pGR#s8bd~ zAmt<>3Q=YH$t5YJ5;7@+8Uh6=ktBgY6#6Pa%2F?h910?U8cLT43KAj$Z1*==ra&gILO{WkHfs(--F=bly9l~${z@AT>V$oat!YAD@M zBE0v_F{`g#^wOSP-u~!wvlmXdd*uqFqoZ0^{&nEMDU+=!>({S0wrQhFmoB}Yq1)~0 z^{A)L8Xjzdr(W4_exYO6u3a{4*kIeXZMJUR>Q=ksjW_p!rAwDKYUs90>6Q|C>56o@ zbrSq^Xk7Gq#>dAsn@un`Hz$?w$;Ss`%jV7L%9ShgHFV~C)6M>B`Tp%|nqPc&G*A3| z)Qe+}vT4-x^t1~XE@(6wR;^lPWMo9n*~E!cy~)YRsT2{`?fqeIw-e7N@mOA%UcCIq z_kH(_EK7|>pM*1Wt2^DaDAp|cvp*@(ZZDKpYkKC^?97(`0sb&XTXy7N#sB~S07*qo IM6N<$f;YmCWB>pF diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png deleted file mode 100755 index 246a2f0b426faa0c7f5ba009e32b1deaf88d1288..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 813 zcmV+|1JeA7P)otxGRZMDZ!_a~nK|b_-`n%VosaL{KDuPV10`(1LIen8kX2Xff$3BE zah#djvFGJ&eE^89Pk*-O^+&d>FC~^GjRYVQ(uuPJyS|-v?9lxA-+tM5>1Qu*n+Ir1 z6KhA>X4$XDH6?-|E5oe1E?pQ5-M;2xw_ex!x}I2+b=}mPFW$U%^;o(Zg*LP!K^1kP%8ynsD^= z1y^6xD1#GLjO{VLdh@0GKY7;d$+NGukV)GRLPn^=q=dF%B#XaJrNP`0E6=}e&Gj3d zKJbQre*WXt!60_DnIzgMQc6S#fvjXxsE1v7;T;njHkdy2miIqAS(nX~o%cO+q+b#h z5tIleLWvL=dQE8OC#{%y*Tnku&K`Tuub&_ELI0t_ea{@3f>Jv&sYqld(%}3_GY3Dm z;O{3*Y?v^A`a|D;^qrM=ykI)U6QHd%WhO~VF!SGjGn0GOZrc3mGZudNl9{Q#X5&-F zuGwVReFLBjE5jr!!^-5*L%!I%PkYH#Hs5rMrEBl^)9)9XTD;xjHFxVZMc3~Dw6#k$ z(-S}RE$bgMHv6Z`mS5|u$$78sp4G-8b@lVkl`HtEv+MGn!F&bKcHPi$$oP_;=BrPf z$(~b3&p3CsuQxhoV$%jIR;`lB-s7FDX)xCTXuJ7ZyIQk96uIR=HBt%-P?N*bp`)EF zq14c}QM+O70NTOa@V~_)&GMZ$^cQDlkyOCa(H3Mf+6xhCuZh`VSN{cQBl5Ys9{cp( rh`2H3A^=GuC6HjQ*7|*0>;m{7QlnX3z3MSD00000NkvXXu0mjfR5FYo diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png deleted file mode 100755 index 968f073fdddc1cc0f0800b1ac4001cd9a55f053d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 703 zcmV;w0zmzVP)AVs!l4K}n~L(tL`6d4Up4iSWnZ3Qg~4n+_J zDGk-qQdogO5JUtO-d5pRp7Nd7_r1^a|M&Zq%mn9Oe((|e0sw%Ur!K7T1pojj=U#f? zQM`qbQrM^DPkwa?DK_be^~z<~RgSMIa<`xP_4P7gg2jCwJ{9^k!fsU=#Ti|%I3p;>90Qd+7|~0h&mIklA#nb>ATL2+v$&u)OBgB z;nsHb)I&QRKeX40H~~cIZxCd}5C} z=79lXoXK%6YlyLtsV$~bSm?Upq|DJh#{|*a7XMm`4QJWZ>s6nL2R1|&J z0VPEwJ9?!n`o5PKAjc->P1Gi8BY*%!5&FVp=#)$mMJYul1Jton}gujiUf??eOy!x&!tsjxy;=Q3_DdcXx=a^OBhW0N~`A@4xB0a*%F? l+@c^sQA%W+?pa#c`9H5UNfS6T{e=Jk002ovPDHLkV1grvM=byV diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_red.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_red.png deleted file mode 100755 index 0b18247da5850f3c2486373a3e179acd2772e8aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 641 zcmV-{0)G98P);68^@7JE5sw#jpE*579S@TLkU(6yap1yN*Zuy>-hV%Q_v4Ar&!63c8OBr(ZRhFu z_kWs36-AmgZCT>x!RqM;Zu9tqvoHI~k@UmYo_g(*J3c%2{N8}7I+|qKPQzv}7t>%W zsu&9G)UmCzkDYSw{fBnuW4j;1fKV_nicw`$8C6D=F_qu`zUiK$2Oc?5UVY+D(`I@R zW`KlwqLftWHH3Z2_XVNfKn>VgT~k=@- z+N>c>0|@A_HbI9Jn`v0~7cfIF(TS69zaomDS1QtgvaBBfGEPLHccO2~3jc>n^6}^HAEh-2#VxC7YYcDXv!L9X= z-R*SOUvIs;n`8(LxP4~^2|JsiN^hq6cU}5dn4v1~Kl{eT7pm&f$PoY`hyVe%y8G*S bxB&kH@RuR86sIAS00000NkvXXu0mjfZBi!% diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png deleted file mode 100755 index cf347c7d4685128a4a447abb9fb8e939417644f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 858 zcmV-g1Eu_lP)`6pHR2Ufr z!EI=jWf;Km|8+n2IrHqe<9xxFVk)&(Nh?w$Xk`TAyvb=#e=0aySC z00NkRDM597_LiNIJ2M^qhuTvB004REvvU8@of{r?P8tmo3;+Pk0F0@*jAMhdOkS&1 zhJPPfQa;pP0|4+Yk%#j>X}o-s#EF1_DMV93FsfPP`G*>Ks>L&)Q}w2g%slu0kBfW1 z+*$*0BC^oTl6>OGIq(9BgG4|C90Dk-N_mPazGrQ7uHZ|>BLD!-KmZ)z1e^#?1Sf(M z!6m}K(^b|i%$TcA5bC}r$tAA?0C)g1@CgWliJ;NAk&ZF+-w#}$`-3nZ32C6IVKrHp zr+(!L2hRfF&AsTw>_@ z1y23;E%Oz}?q^Q2d($ayO;-sON2t7$w(Z|o0Pw1YnSp^}0PI+I5HnDNsFCA?oorkG z5sUIGIq=FSyxcj+xlhkm0en=52Bx3@02o12gdAU$_i?v6iyFMuc7P9#zQ-Hf; zVuV$t9P5`m)F2w1?t6{<8%wk{w-PP#Sj#%1MbsjrSI6n;D_@8q9`~W98dNQf$j=iI z6~hpgww&be%X_HI50Hhx@W==u4TLPB;ei-J-1}G8wH}|{i#Lk-WZAyfv}k4y0|fvU zZTy^$u6L>2nWo(NDSV2@MRD}JQ4(c%G%=dG@_vxH?>gcH#*Ue2HC}9sapf8X?R$Z;XEnm&g zW99mh)5jNw008mK8)r^`_{yH0rNn%u1|SpC(tjf#om=+r#lh+?Kb>DVb9`|C0Bvbv zN3U(>f4-tAC1hosRoA7p(b(hL*V}(j>ug<`&U)|l$6o$)!>PBQ9RQSwn9asj2p*|xhU*R^vq?*Twb0t!lm5}`yW5lRy-U0ZYK?8to!;o!r!XeOE$ z0HB3T+6EEoI4PlR=wonwqJ+TvCoWh&$?CAPVYcU= zD{DS0?AkOtb@-hh^ZLq~FMjxYf19X?pa_YqtgZGvv2TaxcF#KT?O%=_*a-kW_;N|D zakkWsOe!)HsT5WRBiC+p;N-c>0Qwy(1D2MDBC595oXSiR07)sKNk-%9*rDBOO^HUD zZW#;)R&EZpqha<(HK$(tZYU#V29<@0qCXgU{gXeGpc_|pTqQD-WO|}%yKZbeX7k*H z2W~CK$v8NBAq~czrc5A(v51g0Wma7`G8}f=ZcuAiYYxZan@gP(;Ku66M6?bquGiHe z3Q0ya)%Lvk@kLixZfZyU@#UFbv+>pYhcj8TRKSr_sWG8i^X~UA**LvbD3(_Lba3xm ziYcpup*A9qJ$?AA=Og05lndxfwr`!C+O~h|B~4 z01q8H`StcY);%&mId7_+)76ovRpeNWRp&4M?#jx@|E-)x%P*A6t^fc407*qoM6N<$ Ef@ddc(f|Me diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white.png deleted file mode 100755 index 8b8b1ca0000bc8fa8d0379926736029f8fabe364..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-&H;pyTSqH(@-Vl>|&1p(LP>kg~E zYiz5X^`c$+%8#zC{u)yfe-5 zmgid={Z3k(ERKCKrE7DF;=x4^O+ pzO8rLO8p|Ip=x)jHOtWj`bJBmKdh_V<`47(gQu&X%Q~loCIFbEay|e6 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png deleted file mode 100755 index 8f8095e46fa4965700afe1f9d065d8a37b101676..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 591 zcmV-V0~O9lw>B8WRlD)Gm}Jrz31u-X&&gn2lvjs=i{7nIaL6v2==uw+8Lcs(8j27 z;|c`rmSv@Lx!heopGP^^Ieb3f=R!%Lpp$}iMS-&P3EJ)s48wrJ_Ni0~k|c47D2nj= z{jS6bt|kFpFf|p5cM`_&0Zh|`rfEp0(}=}lT#(6RpzAsUfxv^LSYX>WlAaN$>)*J5 z0#sE+JRUD8iT9*fz{)_^7@6P&!sEjTcD+I9Z4YjT1`wH@fV{cEvneYGFU%maIEU2s55&K(LixD|{p-uiS@?KNj zk-Go8G$hH6g002ovPDHLkV1hVj1#|!a diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png deleted file mode 100755 index 159b24075191fc259cfd80c797a1b0d74c168422..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 664 zcmV;J0%!e+P)7Z7t2}reCh0o`+ zAlt$F2tW%oO@m<=(B8a-_VgLl#~yUMUDWG!0qFPppd^03e+x1WpkO1NhIaKD2A)-@ z=Py8(Wi%R%JtYZG#sTKH@6Z+&!S3Edf8jFJJNKuva#KJQD3X^7;H^fd2di znEN&c58aUG>`>P{Vqq$kLb+TP{?I!d4(|o59X_%|nVEZq2Rk60n7072SWJ{64CV?3 zgS!EB=eYxwQ>P2&$}(iT6UMvuFgHHIEdNA29!EBtg=v~X!DxxEH~}L2zn|52%xalaq@DTdhh{EVwv0IaQ=!?daer zTKp4I`l8SDt;d{8Q`5Ko;BXUi&oAG1l4}59P-{|^S(Rmord5s6qsh<&m@Ab^wqCD) zHyRD}lKLDzpYN&@q5&*47mGzGiqcXpmqR9#K|CH8kXS4RNs`(iEF%HjP%f8ItyaZK z6$%Apvsok(2>~dTO5jTZfq;N?0ch4l01f$k9?4{~Youl-#x{UDMr#AFIkz@SDwPtQ z$gQ^$2|*(Ps9LQiav_8o8Ne<=Zx1*M*syo80sEO1tB%>5 zfdHB`1z+!R@?ghPRKmL)hWEvZE$=*54ose*0JiUNTM_)cMDXhxEKg(?-pD=y<)L4J zT0dSyD0&NhJ$^_8Ko9uom%-ZM4BTM{Tw$9qyPj=-9W;N(Wi@3*-Q4pq`Gcp}^vvNr zyd&PsmG>fpCSZz?K}UIEd;HGgG%0MG>ymxKPwy{>wy(m*Atq7)0000~7 zMNw2LQirBVQoa8G3P(rY+l;L4iy+JwSqmy$9JlSkk z&*$^Eg+c)@!R|v4gdc8+TTn&eWHO0VD&>$!B%o;;WLf4CNs=Inq9d`xA4otCWHK38 zmc{pkX`0Y=9g3oGK{}lVy~OYL|C5lQ&U^l;wrg|7w=BcA9L4-r411?K7f`@348&rw zXD#uW)DK;H`hxO}u%=@Cj{;#u#_;bb1_KgUOT2Hp6;)MvC6P$vQP3=g1O5#aU%I!K zZ1dc@f}YvG&*Spnplm2rIp^VdA^HydZ0X1axdms2!RKi5x-SFA4p@ zC@N|PI$ryHL@t-(!zBsf2-+sYAukhDHU7Lxm88-p zDk^c;sHj}OKUc4lGZU}6umlGVNAJx0%sKDOFwQx|V2pVvxhYKe|L9TNk!~md3BVrm zYPDL8Hk*yU-ER3~LGwJ7N`0ZV&nOhBI{~~A;@ND*=kxg?#^W&`4u`zk?Mg_e)8XlK z`T#M+OaR1!<#Nf_>$S`xrqd}OjYhoJ>q)?3vEX8pY&I()ERjfjrXM$k7e+-Qs3Ihj zNyOuEQ2EGYG7ro!o6VOBQEwuV2z)*tR8>WxP{616FY)p1Pn1d}#9}cxolZC$4n(6- z35hJq0;FlHC{ zp*iF(lgUK(E`($(s9pJ8Kn?(M734H_63WHtf}6SQQ_MXEP!#0|&@>J8dL5TfG&tBw z#tYn{TCGZvAr>cca%YYn^!t73tg8OOJ2FvJ(`YpCyVZi*?Ur+1uUA$hAg8-aK)c;e zQ<)!XwHh|n&ND=$@^)>aF-`~n}#*WMkD*M|f8r$i*z7+W! qF|A!t*4fE(R`<_YIkN&?Jng?3oQ|aAqClPi0000t>5xmo{nArfL4CJwMMm+N`pQ3p^Le$?rMud6Rbxz!-yG7bz2z$^USP5(;udf(gfQ zG~f68y^)EvcNWp#bUoDt2=h+^%o-?-|mo~iieWqLNP<0m@2PTB7ftyb= z@H`K$>v9Pr5X`L|rw&CEN2(9SB7A2SE;d|j9@*F}sd(@*2l|P*fWfK>1drZUrtUA7 zNXO~pKn1cjf~~TLbje1g>EPPzN2GH#UIBxJ{}S9=E`{zs-w#hO?vcH+hJxroI5v?j zD!4lP0WXq8zUx3RAP@|Gq$}6wXCjFLZY^YSWBxN9#&g)ro$%5}aYn#y=tJ_aIT%4d z5d4u`rlp!};XGmbZkJE*kYJoi&N0pd*yxY{0${xD;;Q1h^8f$<07*qoM6N<$f(}t7 Ae*gdg diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png deleted file mode 100755 index 0c76bd1297751b66230f74719504b2adb02b1615..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 603 zcmV-h0;K(kP)^~*-1fljz_B$LUvK}k?BNXe#Y!m=zM!!V#}8bncK5m;8VP zw86G*RI63?Cd%b9bX|ueNlZ|wR6rj|r_)VIP@r2imh3?SN+^{|kY%~8B{maJ@F*OK z&VH9LwOeGt#DRjj0~v~8`>iO7!Ybi;zE$va`A^T#yW`y44;k^#O~K5*jD=qcUhPSc zvyy~q;5H_1WT1l~cqje9yfa+l!hu6xjdOJ8s;8E^+=QQ$tw p?%p!Hy#YapB=@+^9(46X{{RQg%9y;OKjr`c002ovPDHLkV1g7l326WT diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png deleted file mode 100755 index 87a69145075afd8f8fd8b391c5da1249ec8b2889..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 587 zcmV-R0<`^!P)LWh{^|hy<@Q*xw+qo|KpY<+vaXbbW{L4q( zTsjXEJvb}e%bgb=o%W0h?4u1;^bWTqH8}5Th002ovPDHLkV1nrS0P+9; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png deleted file mode 100755 index c66011fb0fbdcbf210483d676b7131542a0e282b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 592 zcmV-W0k7R5;6x zlV4BMP#DI+Z{WQcKZBTk0lfkj5F$ztWhP#lcuyb@0@rA^#Kpu5KLA&Rgc}o#aSmis zrZC__xY^&#cI&!!{c|4Q_tcec*#b>|Y15wPcY2=o3;-Bl=(t4;6Ok*pL)-{*A;GX^ zS(@WGp6j~k1wBVR9)BB_gar`}HyRBXh7nM!)u5^>N~MyN6bc0-5{W?44iB<`2biXb zR;wk?jIQg@G!5l)SqhrXCU}x$GU-dY1sra}0uCq@153FUULT=jNwSk}0WBjKz}Jdu z<5gB*<^XtpAmp3m^ZEXQZWd1krhft}CoYaF4cSMvTJ01}X3X37KYdx-D0$c{doUe8 ztY{vlGr-e*;N!WAV%_hgUawyYrhegW>^F)pv%uUTFslHn; zvJ)l{%w(~{!O4`KTmK{Q{zCYltLfs&4?nz|6IdlqHCvX;|HGv~!QW?8P~_d#e0$v$ z)5XHEz{3>qMiH`1+qNYf?huS+@L`J9_$cjJF)Hf?@pu;)`9}BXwGUM{2!{y-4|Z{L zG>z?O%Cp8P5T#j1DID7u_*(Jg?7iss8AZQ+&;u_J{FmILf((9eoiL5nGUe>Fgq*U$z0000 zJ3A|*qoWOonz+4ZQ0KNhDB07SX1?#FrNy8%K)_l}y&kh`*KYdy`Y99&tgNgMLSSrc z?B?+B@HO@P-jS~z2Rgc6yy~Y~%>oJpBxsb$5<&nRLqiuR7K=@0SZj~jTs|sv_jWVX zGe?WflejOaq|Vec=s9+ahmXbyJ|T)Sl*?s82sr2H?Ce~HD5WI+Sz&tmWrN()wI2}+ zKqg92t*l^-#ae~;9%KFlWkmwnY=-UK`_|%ICZ#P1gdjK<2n38VXsuC7{WiU!fZFmm zW~Sda9(Qi@pxO}$ARY+;t##Ao27usOqNt7Hwq6K7G1il@xitj=LIM&{N&#SuX;x4x zmG6FhCg-$PI;hQ=;1iZ>F>^~@)IPi;l}fX?SZ!QiO=X<|pSVkNpJuLHzW(FT_~W-v z?vFpkyE>8ee4d=7wKauH5~dd_M7d2Aa=ICC{Nj7Blqv&DQEP#j_VeWV&WXL>c=LLK zsmYg^_JiDb;%U!UxO%qjFAvsDFj-kzT2$GbV(ZopPM$i$z`!7jvEk07BcC=6FMt4` z*0u3Sy`0b~%#(0000K diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png deleted file mode 100755 index a9f31a278e17993d8d4e13beac2f9d5f7b42d08f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcmV-50m}Y~P)sF~CC`eaI+m%Y8jfzomMvZQaNUIT3LIrJ$h)_W{ zwF|LDNlB-g`Hb_G$;>3F$9JF3WYR|3fy2C+_wH}*xp!_4fF2UN4lt#d26oXwru}hT z0+0%Vz-l&|Tdh_L-Ng1G2*RBtBncRx;99K)&+}s0whhxXp{go}$g&Jk6k|vfypI5M z!1sNGVaV?!*L7i87Bo%cfO@?S`bajL{R<($@$|PtgBRcCGIJ_2a|&kO>G-s2aR3E4 zjssoScUa;zIdOeGHBnH13G)W-zt$kUQgNfG;96b=v&4NzRt&@7nN%v3HsG`<<+F$cumMs448N!W3r&2Z*b~D5^$^d6Jxn@SFK5Q8*uKSR7x{I|H-_N1f+AD zSYC5@2K4OKL$==F9U@CH;ONNL(W}oZICHn;d?~pw?GRIsH*x-68Oy6SuK`)`{E)46 z9^3(-HXa#X89SBv?u_YP)WjsQrp;}0X?Bxrvf12IKW8>3t`e~W9|JS<{btTNbNT@EQIWBSNJTX8AMGXD z-SsH|s#>j9Xf~VMtyT-YMD}5^SWHTY5->o`k|d#AE_YQd79j`%GMS7FNvG3b7^Vy9 zn0HYCJy5MyQLoqKnW|JOp-?D*<2V^msZ>BOv0ANd2n7t@{=V;sZrQ>3c})5_%ms4z z7!qXwHHe~!QFj8aR~&*-3F?O|;#(ESIXP~Os%|~y^7c15*q5`gz2-5ol!fU92NIGT z_ves+>+Tf3gfcL?!nimYmR}cw*|BGULzI^7!;k#3K^YO#;!+vM@N~(99+<;fdqr zYPJm+pXYFYk;neQyXXEcTQDNQx57i`Okp9A#n?<7!{#tnKJdsF>utb@JH7dU01gfL zEK2hoPZAnO5+je3&^i*hWM`qCW^vLK!O*?U-#IvXV?#6koWqrwnD{j&K`7N>^tR3G z8zr1(qVOzcF#nF1&0MZ5C$l8*E^Uth0000zE0Ay_3@1Z_7#f-XWL#E{8Al7>L$ z0Rx7lnddoqAyfT%&#`$;v0@*5YdW3w z7mLNoa=FAshK% zDiy@zakyMAxr-H?iQDZi^!t5;Eno2A=?>mMx`Vg(Z!?<53LHLvfTPa`$mjDcX*Qdv zR;ylN4OH+m)fVX&Z#yZpUae;ss@a$K&})gHovkhr@w#xyPVlfVgXti1_357y%I-UHDvRWYvPEX+#g+j4Q9ayba zh7uQN1j%HQgA=Fp9DfODAU^*3*FCs^6IpO7xg`RUXyP)(;=d!ly=#I^l3e0Cub`{H Z`5PU3+D2e&<<>s`J(VpX#y^kqzQ;#=2x({YMw9Q&ndHT&`BD$#%Ql?{+)-OuSA`r}MWJ zVg+2Gc(GW}a=BERPNy^;kEz$|38dTYlFQ{%5S!g@|8f8D_!Nu9_Ni2glF1}xG8xi! zorc39&F6EPOeWOt_XS`W2H_Bo$MXugy}SEctJQj=(TLXTHL(jRXfzs>NF=0SHk;94 zF!&HjdZNX(3U3;LY64IMX__Xv%_wjLC!J2`0Jw?X=zPK$C$`&dYPDKaC={e16bcE@ zgun^<0k;ak*=xLE)@(Lqu~MmsFoMCLY&0Qog`NO(h@kyxaA%EbwJLy8sU*Vi`~52K zX0wrqW;_LmMq@evX4iAM9Od(Q0eHP$1%L|xAh@vrqB`HPQLon}f3aAka=9!3hr=O- z5F9`#J_7Jhah=U(4RjaRhkS4Xkk98kDz-`i!r|~~AQ1TFcDw(@<8g{aBE)l)PNxNE zI(RPyc>9e{@WGSMU%i7*v{!&P$WLz25)0oc=Dl-yy%xYZAm4b-rttL7UjR#%`#j_F R;_m(?iiXTHIMmcoLoO94I8;j@ zv^2DJ5#orqydFJX|Gm$_Bi_vyew+j6{r}$Qc@D1%fQqeAhJj)1!z4pP83k2MV2~s! zSt^w(<#HLFVBg_#xz1W8ioi(WY&Hu~6zil?DI^jJgu`K35(hkP)H%@Imesbg#5!Ps_$Ni*SiR8&sKb9?M`0-mH)gtg&YgRX#*TXz@Z+| z;|2H@xzE0TfuORhuO2k6#K8#sW^J`mQ0+E@$K`QkFV+DTlI$w{GJ;zid{*v9xeIe_ z$|Bp`@iKkgoFK3{4Z)#DWKV~W4K@5WZN+Ql_7%YxNqSx7%cWud&cX>)_PvD*UzxZg a%Kia9Rjz_59@~-t0000)l$0ECbfb-0$}>7z|u>IvuoHEmW&j4lzv=KA+EpIObc7e7{sGA)QVmnM@*^ z%|h38^m;wC+ilpk%>l#V5LCqP_y2_Cayd^XlX;j*r54R*lW!zbqtSpQNyz8(JVmWm zyV4S$2{Uhyc{Cb0QQbf{ZGT{Kr zvJi{K_&f+q^Pv4MK$hhS4TgFj_FD*rLOePdE-E^T7ZzTFCRUB`*?9&h(a#C!-v8lWG#k3AOJQaUey6Oasked^kDPe=Khg@7s584 zg`XfS1)&u*_c;I76#%`kkBfiZgKKo@0)9d6vZw=ExQUtV?eW{Y1Xv}=4X(2zy85d> Y0C^(qLv?Ui{{R3007*qoM6N<$f-gW7od5s; diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png deleted file mode 100755 index b93e77600def75c9a144d3d0a5088a62c02cbb0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 618 zcmV-w0+s!VP)$>5Y&axjp2O=VLu>*f>1L;s0)kkvKC!*u?s6CVL=HJ6oP~pNfZc; zsKr=bq;7MITw8NXw{SZm%59TId2x_9BQ zV86`NuvGI!>o^V!Na!=$7GJE{Cq`b+XwknM{UcGHFTTfmuS+ zm-zYC!P3+zmY;SG$?!fYkOih`QYaLxyF}A86h$GGN}kFj)_o*0e zjPMP%zTG7FYMAfO2Nn1D`D0Cj?Wl>5q%@CE10nX)KxpNmwk+!IWkzywiYD( zqUXiYYIq3qcRyMGJ;IY`(Gz~E$J$zu2+R{)xGlE*88b3WK6V*J>}2iPY1HH|tER0W z_+^^FdppY?o)Gt5M2`%xwRDH@R3G}^i1l4|6uchm0X0f!@&YdVLB5K&dd7Rv{)DXX zt^&vP;}kqj3f>94j+4xd93>s|Q!Ezi>?r8(Il$P}PFxSqu{d*!Y%*#cX(R0f|Juz# z3o0_xI14Al->1uky@W-rCI_%l&>PK^TXNSN{byMk2AI5vbwp!K-%-@!-vPR3iikL1L7HA!^!~ChCFU#lnGzp88=I z67V8PHBo4(l$u?-AKmT8?#_0rKW9dUNRbpLc`}piywAM9$xZ-3fR1C75T(BjCn-l* zjUcci2oXXo-}iqun@#)+`W@kL_-U&|2>MxZy~3IdmRm&8b)9!2%ksg3R)nNnT*TJOC=6{2hG86Dz+<^p6qfG5$i^UNUh+u)CD7O2 zK>Ioazn;U|+X0x$=feveYZL1W*Fm%e5P1sajd#eW#^5(ddx76*pt$^)b}$Q4oPabL zLc^HF>Z{8za;f$LtN0P$6C?1{X*jtXkRJ8IEeyiSzencvH3Ux_y>y^}wfJrRCQN#9 z?&e+C>sSAfrE%mZD5RfZ`gSndD)=P?+nG5Oq$zmY&-v+gc7R6c0u8^Ke#|XOq?gF@othF3zFpM8Il<8BJrWqBtF>b#_ye4{0)Xbu6j&@UIhRE002ov JPDHLkV1nWI9dZBw diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png deleted file mode 100755 index b977d7e52e2446ea01201c5c7209ac3a05f12c9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 663 zcmV;I0%-k-P)^@R5;6x zlTS!gQ5431_q{u#M2 zg&W%y6a}>qj1Z|7Vu&-DW6d~k-n;jnHsjb-q#u0C^W!_5^C=MlKq<8oNCQ6qS00!X z5eI;XP=g!^f}j{hku}E1zZ?XCjE;`p19k(Rh%^AQQ54xysU+ocx$c#f61Z4HnT#3u~FR(3>BnZniMIF4DouI8Hi4u>cAK%EN)5PO(ip3(% zIgBx+QYirR){Z8QwV$9Z(Mpt=L-Or3#bf-G@66}txq0yc*T(zNTBDT0T8rO^JeNbSI-Tzf5!pBioy4NwAN^?iN#{;fH1Jke4Xa`^fR8m z%h6dq%xX)S?7`zae))(Xst^Scp6B8FejQW?RLTM8@0=vnnntuRGBM2dpo>gbCnTD= z^<;=JuqdSf@O>Z8^XdR?s+KEfhDdB_#ahFj^giCtzT(s8kA$AViyTqaAR;KGaLzUU z<=GqA4bRwpX|IG~*x>pZ!@zLr`XQ`od>m(`;jz|M_*1GDO#$7;n74ppb8=eiqh760 x0yt}J1#p`gw$`o!R{d7zU9~!Un@nJV{4bstt4Au+Up@c;002ovPDHLkV1kWhGjjj{ diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png deleted file mode 100755 index 581843637079359a6a58fcdccf0763690c67b063..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 676 zcmV;V0$crwP)_k3`4d{s8lK_6bi^@vq&To98fNoK}7)fx$e2^Y&@<^jR_Ee+8}KG;X`@ z@bCyiolqX>bb1ZIs%QGnjzFU~L8H~d?e;*XP(h(S262}XyZ3a0h07r{KV?E70l+e- zE`%3x|M5#q+;HOC(h@A^M)7Rn13dm0&>K$j%k_F4wOWlsNCIH+!c_#{eS&TL8v4yc zcpnPEY`cQzZ$ILq{U-MA6Z6Z|1p!FZjQ}tXSb25J@HphEqX-6Hqo?-_Zn@{d#>2Ml zJGhxTAd&emK$lV-QK&VM&ix0Xy{GyS3Wp(+E1^8BhD3T0a)m-Lw@Lu4zQRrP)9(3F z^>$hh@N>OAXrmPYunLi|fJ$_*5i`46;M>~*5D{bp>-OL3{+!MJa`3kv~Q#QfQ%c z)1s}QE<_XaYBG;IuRF=td#+}fi4h(6HgoUyJLi0t(*dA^B)%@8kkG&bdM5P5^Z5WF z%d%>m^SbN0XeV)wbUOXn5Ag#A$gJx+7-OCkMM1S%MWIlTkbFLmOeW(&n&wUd&;`>p zVcRy$Z{K0=?SpNnP^;BYEEXleFbq(UY&LrXX$6qkJ~)8+b{=jj3HEXds;Z(?D%}}L zX3`39&dy=Zyar!ehA}e>w)(*vrCct{PI9^2Jpj&OZS8<3-@{0(gNv%1{)zAiLY+_^ zl}e>Ofd4&#Irj#7>=o=Uhv5IJ@?sN0^J|(WL2Uun$4}si6}TG-s3T#p&6GE<<2W)O zf{^Y2HlO#*QDvTp3v&d@;8*}aUC4lisG9(w7@d5Y8y)}U#FwCkqp*Mcgme4{&gGRf zlBfd`nF9cQBKB2_L{F8G2)7pAf$i)Ds`|}-c>pc^LRW{w4SQ)3N^BbZx)6BlCZts! zKph%`(m#xg-q3I7=(us;9<)*2%iuQ1J`oV3gU6V~T}^JU5714JN33&GwEEru0d}Uo U{MPL+lmGw#07*qoM6N<$f^vibe*gdg diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png deleted file mode 100755 index 8d719df5205f7415ce657e5c277db4533c82f346..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 639 zcmV-_0)YLAP)p{{sC7)XB-g4w*W1a1)XtvxrMYa1o?wn&v~3 zHnC|#(>B_M1d`_7gfzLiHy=0c<2kQQdXu*33(xYN_xYW39(cz9jEVT%VokB8|DoF~ z8u%Q5sdl@4VB7X#uh+v_;yOGY&pRi?378ghv)P1cngiAAb<}D#l*?rWDV0j_dc6Zk z-|P~AJZQCA=yWcQjG8fYnimzj*3KqTfN0Cy!G^$7)+bQ$+mHVd1J zvwOR^5Lm<|R+uyB1Nu4vL?d4qa3tn?9H7SZH@~u=fFHEDfSH|bHU6kh0O3%cLdyny z{`9S2Sw~WMy0MPy!64i`jdk4Z3>^+KIL_fN2V_d&ywBt`^IJpxUI$=YAph~5`;xCe Z{s%Y0vkUXDnO6V+002ovPDHLkV1loX8z=w( diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png deleted file mode 100755 index 106f5aa3611a4807ec8c21701c631730275089a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 402 zcmV;D0d4+?P)<@FR}JvtGRKa0_WfK^c7uXaFH3q@Y!Hnl8VySc`OtkPN3;#l*y*l23+99h*9JzA00}rAC!#M1dZ#v9YOBH|eC*${MmzzYjBu!!-< zK8tujf&(6i)1biy*F>4{f*Kd(IU-JsG&#b_@NgTnx@40)2@2%c;*=?-2Za=}O}7&( w%_K#(S>e1j&gfY?mR})n>>0+8p`iTe2d1K2h8#$+)&Kwi07*qoM6N<$f(2cptN;K2 diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png deleted file mode 100755 index e4a1ecba1b60e54f3777717ed105cdde745b7184..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 516 zcmV+f0{i`mP)o)wchR-92qq~y6`XqbKmElbB3z{pkZs0VPF`CFvS?7jDn^mFo>d9Y&06* z&1MsS!M-CH3ee+h_sy)Ms%B*ec3R0RpVi9?*mU84yoq(Bw8 z<4(999dJJE!V%pWT~HGRIAb;(#O%2K3?uRpz}AfgE8e9q&OSdr^e^}lC$QXZz;S2A z)w>^oHy>?v)q--`!pmuBe96PxP0u*inQvyFW(llfv9 zXV1s*Jh`y2H%B3ZTA(AzpsQ?hb6_PyZ=c1?_B4fbl>G%!@ubJln=!)x0000#DY{xaiib^#X=YT4@yE_&2#eBulEdzjE`u&@G%2(&u{J-<}d(^uY4W_kMfEX z@!X)AR9F&FL?RJyJRUzvBoeqN{5kY`z3wcM0+du73~_0|*lac! z42Dw(Eg1o{Ash}P8jXrqN+1w`*XxDD;ShmPCZC7#4;wWbHoMvBl$=zF-`?*9j*Nbjd=v@OWt_BgKxP-3wd zy37?ATx&$b+&zRM!K;BD%Okw`Sb@&Pak8$KRX19jWZmC0&n*Ggv%j8nvSPDFw zEkV65AGOoBQ8kf`R|}Px*&INNS%osq9b{Fq2I(x6@xM>tg=vRLF?I`0rWzHyRc>}g~)F_Qn`A>)C_iwK%Z zrIJ;xR)UI1Y4Ozts|-Nho;q zVk9-bX)%F~!;63iu$Fk=VJn3~fmb5S@@)ZqjBT2{f`vT`b2}zxb0$o;EF@G3&BHK^ zc)`1kUzo^Qkk$?KFKHNBD?nP-MJ3b@&4fg;g5l2wMi^g?9qj+~@b;62o_U1_S1J`g z7m^UMg25FX1MJ5AQxAJ5F5WDt=$=-@JV-!LHA2vuxl9kN>PS8x??^AINH6LjF*#nbk4}=n3gfWp$kEX5IpHS zYiQ{@d7Nl&d$#+7-TckP&Q}N91e-C#5QQ<|d}62BjvZR2H60wE-&H<>}%WqH(_V;zPbB1rgSSSC(0? zWlQ#?N3UgnJ9m2C29w!SwoOo5_2Iq!<8vCyEoDoj@#oV($oJEg6Bj@;nD|2g8 s%L|>IZ381yx9RvPhV4J)*SeoEV4lyr#k*`nfWBbxboFyt=akR{0DpOPi2wiq diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png deleted file mode 100755 index d61648452284da1bc28b10385f95b5d2bf027901..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 616 zcmV-u0+;=XP)-tZUVHjYHp;RjQ0M0pRlXN=mLv{hk9Ebp9&~+Wj-T9IkpzWPWd#fZ)d=zV^~S`;LE*!&u-?g42^wwN&Xr1~#d5ifl_2*B1OoS}CDno^8a50ArfE8;stQF>AP54J@H~%T zFz84s;dO!QJKD36(~!QOg!t_^gfFcSKDU4yK0+Ypg$NT^mIYcQ6bk*3P(lBLh7Df_ zTu=2xC#+-_%)|{Cv8zz0t|0y4D5M`xAc{gwOKc`ou<*&VjUREFHs1qd<_xSkKeTBt zgyCi=@jj;&Ns^GsWWaIUl0Y2azcDlF@u{(P*!+EH;lnU~b|Lv{4|4Hdkh!qoQHiE$ zY#y>KFA0QEw=4Z|uV{0A^`Y=D}hB$GP&<$bi8q(u;p^0(my3Rz7fP}|# zGZ&#uor4@c3q9r|f?H6-UZmfgKx(iV(MQ`MPWB>iC~SxnN5H*zb*A3#zWwgu&c|}3 zn^g87H{pdeasl%Lhmab&jC?lES}7C?4BFDNA<}20hoY@w_IU%i*T;}}wh!589}7~7 z#Ug`-R~4j&+K_y4kW@X7qLr-)S5qVKU)tO;+kXJ++{vPI@{hVK|PhMVVx_`)vx~zUs}c9O-Ok{00000NkvXXu0mjf DS5_-g diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png deleted file mode 100755 index bf7bd1c9bfd78d689c73ba67cf914182933ee68c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 614 zcmV-s0-61ZP)OOAS;jTeL{ZSdz-%)SMH9tDF;N4B6%j=d15J&5qy`F#vB?Ar zqS1nH@%ny_XSI*Y>) z1f5QYdmzT>YciP<3WehS<{GovEaLGv27>{*-7f0&I$yJ^L%ZGPv1YT$V|u;*+ZCWz ztHI~CDVsuy($SfR6-`N~K?9GTB#l%%0h7 z-q`K-y~E)+s8lMyTrPL8^_pUo)9G|SluG5pPqw6!LJB_PzyJUM07*qoM6N<$f^=yZ AYybcN diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png deleted file mode 100755 index f6b74cc40f82fc83e4dfa6e9647ccc1b34e6ed7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 554 zcmV+_0@eMAP)Vb2f>2}Fa82O3m(Ob=t*sniin`NpInLyMJgI`saru@YOPfh zy4g0#G*cV!#N%;Gq9_VH9?v%kjS3Rb1j8^;C={$Gp=lbj z*(?%?geA!5^Pok%UauwjA)v4g2`HedDw4_Mk4hhBQt?e7YJ5(hcj|3dNu^TOPGnjB zTTsqd3GIZ=Bb`n=7no)dflv&K(lsWw?lH6T1Yht0F9qgIuzh}ym0%n<3d3EBWB*pg z+G!I0lbAEXyd>k|QNuwr4=KX1D+tLPv)j@C1=N4sA4NF9A>HcO3G47*Y6!+SrUH-7 z1hb;^#S=r|`aMh>J#dWruAEf}gcR(DRUC`ZUev&$Sbh0SgLiTXeeHEU<$_YV;9281 zym`igIE%Sm8DpDw7@71Tv^EB5xSdUR*0$Mqp+Wq8OoaZtOg52&)zZ;;M=7#C1Yd6x svjx>8ad4e2x|*xHHwRjcjs6zA0XLDUqKT6dS^xk507*qoM6N<$f*wetruo^Ag2=LamM1T#~4RmC^m`_ zs}H7d&XJ}mg+hU?tu0noRvyjI&o2SRAeYZFesYkts79I^jJ7!A7%6nJwq8O?iT55M z1OQ` zbL{!Cp5o*IRmE9PInMCSPjTwfT~J+EYkz}tjxY=fg5Yf6EQ@DG$0kMJ9h^&$W}9BU zP1oj2;?MWVkKIEl)r=Y;L^Cx2q|>!)qJJ8zE7-V*-Cf7V8_2#1c0N975t~+&QUpQJ z5(uo(-O_`%Rj@U@t>JYAgd!>L?0Idxtd#oW2gc!jinsAEva8|kF4#Ic**mmml_{d^$s}Q5Q)KCys4sfck5bP1SyeHwh2`A<@N&t2j0^lgHC_^(pAAPCNjwl+>AN%C4Ll>_8Hjda%9 oS~i=#*e)>KsPlg0=2)Qg6BCqJ=F8HdGXMYp07*qoM6N<$f@i)wr~m)} diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png deleted file mode 100755 index a65bcb3e1e9613cd9e4950850db43d7025a5fdf9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 779 zcmV+m1N8ifP)JNR5;6x zll@CmQ5eTZ^k*a#RQf}fVOdd`5NJh6S(>6Cf$wEW#f&JyAR#GAn9>Gml;nOf3WCDa z5({5&UB$(IF?G#$x4X@Ickg!Y-HU!Z_rzX=qAq-XI_LS^=lOCT0|0{#{kBkYDS7{3 zD`iu%E=`cDX_^#^#n$5SIQ|4Zhsk8>N|zXHXG@*41$i-7`Jr{8`3S_OEcmY|RF48wXkk?WpdVM4OePBSbfh z#4_=eXJg@3epx~gi>QbUmO}Bm(ENN3+@c?jWiKvSrm(o|W}Ud*?vy~fn1!V~Cl4kB zI-;c!8f~-v)jX82%EG($>?;KSD$64f2&4qQ#=Yyrcpy$57RAVuV#vKMP)0hT$r6m# zc^F^XaJ8R9Q|}x^NoJYIvYZkq-z}Tnj@UJK2l2H zG}p+VvtjP2Z%bsb$~7QLJ9#pC0dKi`ppOd^_V;ME6tdzC0PtV|r=@e@37O`%0k^=5^`%cf$eu00N17Ro!{^30krz>a%3j34C?*{Mt2^a4~ zK=P+Qq%|f;Tc&+9ps;@Mw`EE%rgs&#y=j6BUGg96oIqdwj9-fiy*N(|@o)eD002ov JPDHLkV1j#pUPb@_ diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png deleted file mode 100755 index 23a37b891c2f5faa3b8128d45373ceab794ca609..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 688 zcmV;h0#E&kP)PK^TXt2QS_@2qt2T|9~baC-vaPn=ziepcfAwB$0!O2Q)E}1e8!q+9)KT5JVKU z7HNY}h##OS-BxWHWjD0wrPDeEfUClHs%Q6&2u@FTOJkKMQN|_Rlw6rQz$gPzqGNtj z#ruSeFeh835JJFiM6vp@6M5bXj%k7CMt%SIwfbF_fD-3*Os`9Ly_Q3WQ_SX33E{pX z9_WIeeTCGQ3wYALpBcK+P-iuw;3i&7xCua37k5# z`>c`M@sGeC7cdsdz`aE9lOz!hPholbyz%T85LYf6O*@SA+9&+^7k>+4M8$A8iNQq{ zQvn8k?-+dU`Z@gK0z$EtPV#+`^OH`R@cE-cuE&_!D)SZGxmQxeobP_Zwq zMEgi6ePN45N`|V1so0uE8^}1xw8s;VM%Ai@7} z2-&Cyvez_-O4?6uv{zTaj|YeYEk34i~K@`8YW2g{x* zc;7z3lItpVy_et{Z-ZZ)<@*%{l7Ao8mu@V7*gz<_1##mwW*%LEwCdzNsVLYx2*T-J z#HeQ*_a=R~KDdVNk$EVgAIRl$oQi_(`_IrdJciDpH|Xe{K-YsMtc!cRnFi$qzsr4z z5*$;ecov%3->1{YNy6-Gf(Ecy&_I$CjI#laeuE+S120^|Vjsf)W&i*H07*qoM6N<$ Ef)^4A_ab^avY?n0hpS-#mn_4{O$e%cm-@NH=3`90Wq+3`~HKArSdfX`&Z12 z(CY$VW-MNtXX4xy%yUeE?}*~0-|iByA@ZrwXgph4S*bhcc5{HB!DFVm_v}P*g7+Q~K}7K0lcp(^N@X>U zV`{ZpeIf${R6Hgg4FL^`X$Eu75k(PE6ycl$AW0Ic)#@rR7Z(7;V?i-dR1K935Jgcx zPfkwK>2wGokf!Nih^ARp6-6arYFG#(9Ta!x93nFEjoA==z(g?#sDg?Owk?Mg7K+>l zWYsf(<`#+$h9Sp6gFOg_dd+80SkUpk&xM7h0`Sov9W73spU;GP073|VfZ&Gd$J$*0<~TV5aPS|qWH57|VJz+d0000vYep8SaFV10Q$h+;hIUPX_=v5b}%>Tm<(&j1&5;I!55C)oN0s(P%ZB zP3Q#ahfpXKWF@S?jm4U#fv)QovMhrriclyNs6-G12#3R##4PSZ0VY(dRWJ;Lwuq{# zAW0Gwi$yA^R4RZ!;W+L`f&%x{=D^VK#BBWL4Ys{;*!A7Q;!=dN<&D8*GzGaF4`hV4 zDbY0{NrMX>ZqF=0((gR5-zL$kC*b)!fwu{Euru|XrG<$^n#@)7i_>rCmRxnDq>$Y%gJaCkRd|tE*a2x05Pe!I^e13o69#&RQZ36s0 zB=O|K2Yi(jsMqThn}9t?f5E-)L^naZ+db$&%M$!bCdm=jv7?t_lB?3&%Ltq(>ESw? c;MI421LCcoDG!2@;{X5v07*qoM6N<$f`UZt7XSbN diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png deleted file mode 100755 index 134b6693687b2fa5fe36d48a9c0b8001f937c741..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 650 zcmV;50(Jd~P)VHAd+bMNh~)LLRqN>D)-jd9UvB%+hyKX5U|&4t0)fzgD-MPpQ$nHU%yoz=vI zMGb>1Xu!6Hw$NT~@Au<4P-+{9;Uw?&oj31uzH>xX0T7Xkz!(tn|Ed9-s_FqyReC13 z(ll)vW1O{Ck5ihay12Ob2ABc@RUI;zHpaMiyRDs0r>|D4rHw{ItJSJnYjt~jTbGuW z`X(~}?!&86q40R8<4zYw;$qi0^3ec=c&<&H;r`8W%H=Xymf^i;Wo6~<+}zx2UMzpC z*6MZN?(FMv`n|KO3(KFiUaucP0;Z!@LcUNa%8#vGK5aZ>wDgB0Gi=t*argWJcdlMQ z2#MpEX0wU+9&0U?N(F#OgpviU_Y{jYMsj65U3|PjwUOY}lUYj?MTiK_Il}NCVx-Eh zDx-TzMk7se+M#W_>?A1-x}ZXw3kkyz5kW)_hkjsi@RhKadN#H$Hq)$07*qoM6N<$f}lhwPXGV_ diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png deleted file mode 100755 index c4eff0387d5888c638ba09473ba6d2369f7b56f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmV-S0<-;zP)HU2HvUSp%6 z*n}iP63IK?dpo;h@sj9~pcxo;VVTc-XLiP@DgefqE#NE=@oyUd-&HjLpsLIuSFXV-EMck)oQ(A`s%*^&wf0(rNiNHsU%=0Rw;WC z(kbc37l6fo`-0uR!pYkYv8U^3?nsh^@pw!K0TH3uYyx1_2>|JbXPmfskJ|1YAw9w! z9`N)1^Aesr;y5Nr5-ODn)oOL|CGi}f9!&iVwpK$khlIX10X$H6^A_stBJqvLhU$?V`QXqKme*s~gVDJ4A;LTs_e15jhc1;By a82kqHEPVYFAD2!50000JNR5;6( zlS@kiVHAe7MZY2;Xi-5)WxDDgv@tCUl*&p14T@Z~3ThM5LP4tuQfLu@EnG;nXc<8S z6&3BN?fx-cv-Kp6>HRiNTHE>$X( zD&=w+?GWC>?RLAGC6Yix;an~UmSt)tSf}1VS6N1N2ONORdD? zaj}w6DAZZdOud9Ep?M?{iQWbE5^9HLLZZF|1kdy0Tu4InEuboP9@nvbZ-P0n4AZTy zyMRIxRDmUE#LdqYuD=-Qz4N^bC`_#S7vcLn1M}{J(Wl3#c4VWczu&)AjUlh(11>gp>f`wv{KnjF%!aA*Jk N002ovPDHLkV1kkt*XsZP diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png deleted file mode 100755 index f59b7c4365fa1720af1aa04eb47167ddaa6eeed4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 626 zcmV-&0*(ENP)ZS(e|#C2>JN4>y}l*tQ*E7zP@R2CCJnkW?xa6bgk%(hgtZ z0=~d?U3i`+Mvi4!&~+WPT1^NX#{u6&QIx+DE(oR{&T5&-ovF?@wGw)P&AtpHZa|G%V*GUUqL@@!d4V$`8=##4)ytY959JG zdc&Kho)&AL70^i z!PEmeeDWCB-UbK(*4JST44^tV2z_J(dn~+vBMJT97_7rzFio=~XczIv?PQ5$v%u~y zu(bteXb5I1h2zCV{Jc2~V{{yzZipgsP6;k264$*#5q?GzCm|CPa9CKqm4b116h3Pu z?+%Cm52plC8|5P0@igf2GV1KkCfk{Zecu=G@VNrf>s%g9c5D%@cfxVb6$nY`1IW=4 zt10QqSps_2JLp0f3I0j0u>#qA;v!+T))KEbCg|mo3q0pG{OR}p0fPds8+K~d>Hq)$ M07*qoM6N<$g1S2e3jhEB diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png deleted file mode 100755 index 44084add79b9a0fc3354d16bbd4b4b5ff8095da7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$R@9E+gqH(@-qA%AW0|7U8+xDRI z0k`B18}ImRw2g{jTGP$Pmx3yI6F_2s&$|`cJ!i0UN zB3H;=r{#{FwLaNVJ&hZl9+MTHGx1T^-A=Q0?hRb#8a~x50X%;`b6ik3cw=#XdxWy= zgrpBoDjpwP&g9<9h3x!k_B!?vuTJVkmIJ-U N;OXk;vd$@?2>|rNdMN+^ diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png deleted file mode 100755 index 3a1441c9a12062a4bb3d706000d3ca14399aebca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 565 zcmV-50?Pe~P)SCZIX8XZzY2l?gCw6LlgWJ5Avz#QX4|&mI8LN)w~J1vgL=KLAhlWz*=#m~gyvxa z&;iC6gb?aZvMdXxX`<0+D1hs_pqJ!wxqlEH;CJ)je~uL(gpi@v>!I0f_Kl=E(E+Tq z26na*9gribxx-Oft(HnstyXUUy!39&E-cI%J5Rsy;(PGZH{g{ty!HVC&yGPT3H8x# zw{^gBPW)O0FMoh{k%l<`1a|To_Wl&u&-GXm8izU|&<&utILc4wc6s@u1bmTz6x{qg zTw@7=FQRcg&r`h+gcR$*Jbv+*DPk7v)B@e0o2 z6IlBXW&8xh@9)YKiV~2>+z&XKd24JT55YWz&JtfvCg4r^~bLP79-yS@n$OW00000NkvXXu0mjf DStt2z diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png deleted file mode 100755 index e7708292adabf4821612bfca032cbd019c63180b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 634 zcmV-=0)_pFP)KrcWDBzIw9XCtIF5G<@j zP(;CSqHxUrerI>~wKyloM4~t_Ofl@UFEj6$Bmm6p1aK6H{5zI_FOn(%k{CiRq?CT< zoV}Ey-7=-5nVFes;1m!f?EqZLIs4k$n%39XN4dPbtX{9DZnvvaiWV0aH9I>yf;2<< zHmo7WNC<&iE4ji-iKJpsBApDKiAiqWy8R$FV|M@E-RCB03vjWNGQZJxKCc-cSB=dq z#v3snoDMC=4<2BDgiZrv0Veh~mz(X=S@;fbe>CJO_5|oe2o3=wgfW(StLzI-qr&kc zhXEJ?9=`nWXzrUKL_p*Kr9u@95MU9EKqp2vi+%&1&gUn&>Ut_d3>wiyiAJg5G7j%G z#$sf%Kqau!AAHP&4Q?edl!FWqpT=C{D}$15WC#5QQ<|d}62BjvZR2H60wE-%6;pyTSA|c6o&@eC9QG)Hj&ExYL zO&oVL^)+cM^qd@ApywS>pwx0H@RDN}hq;7mU-SKczYQ-hnrr=;iDAQMZQ+*g=YOM= z!QlMQEn7FbaD->uKAYgo_j9)W&$$zS*W9}m(ey0q$&7l-XEWO0Y(9M=SnhLbwy;d>@~SY$Ku*0xPvIOQeV1x7u_z-2-X>_74(yfh7C znXL|3GZ+d2`3re2hs?MKC#5QQ<|d}62BjvZR2H60wE-$R>*?YcqH(@;f-l!01CbW>s1Izr z3LkoHh<3E?TVANoG4CX|$empRCCS=R(U(hVJfm~E?IkDKRK&NP2|n`v>d(vV;W1uY zrFGVdwn;4b{qUtE`?GB`)E1ga&i2|7ncUL1b!KMq^QnT#_gn?_Z8(c`1Q~Vy3oL!N z$M8vHL&U1J3SJF!56azQU3B6>r|ZQ{U6)pC|tRy7$(5JQ<@7eB8yk=XcNf-aBIe#;8c_B$^=N z{-Iq&o3%O}V4~G($=zcP(LI|+6dq{?rby~MXwJQ*=!bOvl%?k zYY;jP^@M_k03MHL+-9?_3W5MN=moFW3xmPHU=-4Bw;62MrIhg_lwHEsv)V9U4x>+9cG2kIz8fWo`WyMMfz zdg-)p!<(hFR{VYSDJHEJn09O@#)%q0l?GUg9eS2~vKPUtd+=ak5lWLd-jI=;cjEf# zt$1;~?G!t@s+VLwL=P+Ks;E z!Jkh#NeohG;&02OFD7^EY zP!_PL2~i9VnPEW6Fz?O3dVF_U$duAL$=SU7&hNc@-drC5A4z=IgjR%B|D)?dOEaGb zuwod-$hPex$8oSoqK;@Z8u3EBfK@V2CKKqo?yA%2pjNA)(P%)HWf#)x^$?52W{|1b zPXOA$IfrSQV2q(qC_vLR)a!L9isAxjoeoJRlgE&G0Ga8krBVsGjZJJ-x6y1i(eL-q zwB%+o53no?l}ZJh#drAjlc6nhs3RTn;1IH+x;K#|X)!=#fM76)$IqT4^N}IF%aQ#o zTKS@*)|#L#jiCPi9~);c`x>TR|0{+9a?O5Exg#~V5W2C7G9nAAN(~f z2caqx&t~GhnK;qW3~&OuEke?%u(8Jxs_+ZVVz1^-uLrP95TahadGG$+(D&+%2QMF8 eFxE8s%l`oWamgLPAe&$S0000dKE@duOisOkyZ-5 zuwDqkAi_*y5o3Xrq7ieT<<3p#-R^dGySwea-CgZZZITBc?#1u+FtBuUCJUZe;~j-%Tu@ZpYB;$&ydfdZG#(j;(iB#^yRlqv#C*LO zXWXM0cpKKBlj#L6awm|;A38Zs3mg;sQZmCAZT8m@X{AlP6 zVI=SsiA16x=>2%^XV3U0y4~G+MNE!B{!#;~%L2l(14PX>EblXb{rnCSlVKe0dyf-O zuY#uOf}m&2xq80;4d3i|cuNw}U@sg3VKRU)>Os_1L3pl5mK*|?X3#a}K+EVZt&w?w zefXKP^ZqnW-3y9AhYJZ~r4m*!Z3OSz3d}2Q`nDM_f_u>L%8Cb}8`?bl)x?gwAy>zp z06y57kT6sry1g2l{|V%UW?)JwnbzUugbvpOF3=oZDo}spfs2EWKOH{_^59;ue!o^A z@e7dWS|QI`Ff-E$USJ`LqDF}zH%R}YOlMiv63A=qK^d}n!5_(fW%^k4U_D`_meIDi kNMKea>saR;>gt<+0gk_zsk5>Xc>n+a07*qoM6N<$f>Jg*?*IS* diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png deleted file mode 100755 index 1eb880947ddf3e745c29e8d9dc90f09c7e6e323c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$R?&;zfqH(@;q9b3Efq-lM(nr^( z=EYR73-9e)UYMWsXy%?aZsD68Yyv^2$~6QgEcljw%kx>O(f-gQ?@fOOx3A-0+Qw?O zRx~W)kn~Qe2d6f9nMG#g9Q04Mk==M~N!Dglvxk!fgVh#w@ZV$IY1+Xc`d{d2UcaP~ zfWp)_Ivqj}l2SPy^9ZWy6rG9Yx4v67_uA&&9|XA~5-#3)W3%em1peD8RWH^#O%XoM zxMPud%}GTj#~*+7JMxTd!`{^Q+>(D3*|@KV`*G2;{QnANOxu1$r2xIe;OXk;vd$@? F2>@zac~<}c diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png deleted file mode 100755 index ae8ecbf47672a874c0958d0d113a56162c2bd364..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)hkjP zNW|QGv-YFNLN^qH@tJycPNG5ti6B7;r4mEr#lr@*T8*M85D`{ZR^BWwF23T<%MYIh zdC)S*p=|xk^!~H=+HSZ183~y8v4|mYmZxt&)5{{~>J`>E223Q5>T$=~mtA71q-jdG z+eJhOAyBW^0k9Gk1+rX8)zFx((CG^&tDY>6XaS~Fy!WJON|Gdujg5^~Vzt@o%BcYLiNiTQSD`zL^ociBz_>bDlpw3kriQ@Z`bVsGz-_6N>$&gTDiKDTKR^ z-hB*tHa^>!oD~5TK^0UK5rZ}RBm50Bv}S-yA%s=Ha5RYb{)!z2N&$&64gfhybBu8p lh~_|?8^bu;BRYt{<}Yrwd83Y=s?Goa002ovPDHLkV1l%3CP4rI diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png deleted file mode 100755 index 6ed2490ed1432d5d667a76235360824a1088e928..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 734 zcmV<40wMj0P)JT{hN;C#tgf#9krG=I>5!<*aE1_(spcgF}<`n4i zJi-}^6UUeU4jUFwdCiVPDm%`Zx^UBa8J(mnR6wEgz^}o8;)M*Y(@l_!Kfv)}4+NuM zaPXE50z)r)9=D=SR|RIqfQ^j}Hu!fzMeQBo+@PZk1G8hOw|vBTvkx`HM)Xe9q3xao z@`p0`NO!2904FHSLA6E@Y-O6zH$DQzvq@aHsz}}<(!v(Z_+EodX%R&NZW75g+nENo zV0020rxE^;7d!067AN>6*+&YLp$9uH6F-=In`XC{Cn%+o|5)b&boEPr02w@|P*oGm QmjD0&07*qoM6N<$g78X0Q~&?~ diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png deleted file mode 100755 index fecadd08afed92536be91ab12d8e37b6bf410d5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 613 zcmV-r0-F7aP)wK%m(L+9IV|s|#(WRl-O^4GvaQsnHq|OstfO zIJ3}3<01}YGARE4m!7=)QisvlHUo!Qymx-@-t*p_129Ko-#pVI)6#!*kLj-AGXWNR zyA_{wKii_amK7^YT-v z6#plaNm#8`-kz@OvjIt^4%IN{@J3bR zRI}ME1Mv85p|%;RK>ViR>APPLB4;;BpCtqE@P+*7!G>I4UjNx~e>r3HA^tWCQ@S)l z{BslcSwL-CxQ&_ZZSv_g0Tu{yi*X){Mt|W7)lbE`SQxFP00000NkvXXu0mjf;)M*S diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png b/usb_auth/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png deleted file mode 100755 index fd4bbccdf1643f4ff5022fbc59b82546e259317e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 386 zcmV-|0e$|7P)_QM!1S$Bhw4w+iRuFWf;tfR6D%SMJrb+tx zC9R6{2>Ou6#juIy6u(I?|;&Owi$sRB4^20apB5xE2 z#B9XekY66S6lzfCL!eEQRgo0LokTA55@Y#%_wN!TXPw^Q4IIXsG~v#u_4t;x_HM16EQ@QRY+rut&97&UefsPmLrQ5P zBC2kcbux9L%2bJz$P$XV$*zSxb2e@6_3O#;&!FD<&hLjGn%~%en;7)djE^d6!t$lW7GyIOKlQ46hr`Z zjLNuRDP_53dNoN?wd&HMgL^m1DXFU<5dQsrceN>fSz00000)O9XRTN^$%%`*Fg>ryDtc(lF@?b>dE!20r+y z#Q*>(wbV5H`-E4Do={CJp7=ERhw15hgZi)?jRG88 zzVz(5;g?Td1izJyO33bhjg2Qc7FVY@f9!o)Gu?DII~vm-Dc?}3M!fsgjP?F(7`rgg z+xOk8XD)e?Zl=5+un`5!7kr?F=eq)K-5uqr%yU$1hLv){Vlm=)*5~`lwMciiXFu*g z)*Jkz6AF>#zb(Vx`Iv{bdGZHtlW)v(y5k^|xgSUc9%0}S20nrYrO}78ofk?bV!5)4 z=Ngz@+$9N1>>mA%IWx`Fqa240bWkiW;2TZgd8CZS0U}@mknC;!2;wi$eI@`h0y2JS`Eae0CW}q(2(%!m8 zWq$`PDU>LT1_y*bBv#P5<@q0@ttz$hIH}YMDvAigCc=y*)jY-VOpTd;A8@3t7Xh4r z0KTWOk;N2Ox4!&&^4B*no$WtTX!BXB)rg!y8dvGgKBQKLJNXRRp0}Bsjd1|LNQX~c zbC~fjrk2iL@4dYF*vt;}dFn(%h)n_-vzEIHMOKRkdF%3Lq|zBgKm_h>TEq!))nWjq zzn;B!?!(dQcHu$#=JF`cS&W~C`WHFW^B!~MI#k)>1Vk&eQy8P1O`J6V04{D@|7d6^ zyBABnh-d^H0FX&L07M||E0n_dp4v&Q%PSE9p#R#Hq)`5I_(B5CE#q dxjPz0{s-<+c#AC!i7@~G002ovPDHLkV1iPlpuqqD diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/public/style.css b/usb_auth/node_modules/express/node_modules/connect/lib/public/style.css deleted file mode 100644 index 32b6507..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/public/style.css +++ /dev/null @@ -1,141 +0,0 @@ -body { - margin: 0; - padding: 80px 100px; - font: 13px "Helvetica Neue", "Lucida Grande", "Arial"; - background: #ECE9E9 -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ECE9E9)); - background: #ECE9E9 -moz-linear-gradient(top, #fff, #ECE9E9); - background-repeat: no-repeat; - color: #555; - -webkit-font-smoothing: antialiased; -} -h1, h2, h3 { - margin: 0; - font-size: 22px; - color: #343434; -} -h1 em, h2 em { - padding: 0 5px; - font-weight: normal; -} -h1 { - font-size: 60px; -} -h2 { - margin-top: 10px; -} -h3 { - margin: 5px 0 10px 0; - padding-bottom: 5px; - border-bottom: 1px solid #eee; - font-size: 18px; -} -ul { - margin: 0; - padding: 0; -} -ul li { - margin: 5px 0; - padding: 3px 8px; - list-style: none; -} -ul li:hover { - cursor: pointer; - color: #2e2e2e; -} -ul li .path { - padding-left: 5px; - font-weight: bold; -} -ul li .line { - padding-right: 5px; - font-style: italic; -} -ul li:first-child .path { - padding-left: 0; -} -p { - line-height: 1.5; -} -a { - color: #555; - text-decoration: none; -} -a:hover { - color: #303030; -} -#stacktrace { - margin-top: 15px; -} -.directory h1 { - margin-bottom: 15px; - font-size: 18px; -} -ul#files { - width: 100%; - height: 500px; -} -ul#files li { - padding: 0; -} -ul#files li img { - position: absolute; - top: 5px; - left: 5px; -} -ul#files li a { - position: relative; - display: block; - margin: 1px; - width: 30%; - height: 25px; - line-height: 25px; - text-indent: 8px; - float: left; - border: 1px solid transparent; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - overflow: hidden; - text-overflow: ellipsis; -} -ul#files li a.icon { - text-indent: 25px; -} -ul#files li a:focus, -ul#files li a:hover { - outline: none; - background: rgba(255,255,255,0.65); - border: 1px solid #ececec; -} -ul#files li a.highlight { - -webkit-transition: background .4s ease-in-out; - background: #ffff4f; - border-color: #E9DC51; -} -#search { - display: block; - position: fixed; - top: 20px; - right: 20px; - width: 90px; - -webkit-transition: width ease 0.2s, opacity ease 0.4s; - -moz-transition: width ease 0.2s, opacity ease 0.4s; - -webkit-border-radius: 32px; - -moz-border-radius: 32px; - -webkit-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03); - -moz-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03); - -webkit-font-smoothing: antialiased; - text-align: left; - font: 13px "Helvetica Neue", Arial, sans-serif; - padding: 4px 10px; - border: none; - background: transparent; - margin-bottom: 0; - outline: none; - opacity: 0.7; - color: #888; -} -#search:focus { - width: 120px; - opacity: 1.0; -} diff --git a/usb_auth/node_modules/express/node_modules/connect/lib/utils.js b/usb_auth/node_modules/express/node_modules/connect/lib/utils.js deleted file mode 100644 index d0bc172..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/lib/utils.js +++ /dev/null @@ -1,451 +0,0 @@ - -/*! - * Connect - utils - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var crypto = require('crypto') - , Path = require('path') - , fs = require('fs'); - -/** - * Flatten the given `arr`. - * - * @param {Array} arr - * @return {Array} - * @api private - */ - -exports.flatten = function(arr, ret){ - var ret = ret || [] - , len = arr.length; - for (var i = 0; i < len; ++i) { - if (Array.isArray(arr[i])) { - exports.flatten(arr[i], ret); - } else { - ret.push(arr[i]); - } - } - return ret; -}; - -/** - * Return md5 hash of the given string and optional encoding, - * defaulting to hex. - * - * utils.md5('wahoo'); - * // => "e493298061761236c96b02ea6aa8a2ad" - * - * @param {String} str - * @param {String} encoding - * @return {String} - * @api public - */ - -exports.md5 = function(str, encoding){ - return crypto - .createHash('md5') - .update(str) - .digest(encoding || 'hex'); -}; - -/** - * Merge object b with object a. - * - * var a = { foo: 'bar' } - * , b = { bar: 'baz' }; - * - * utils.merge(a, b); - * // => { foo: 'bar', bar: 'baz' } - * - * @param {Object} a - * @param {Object} b - * @return {Object} - * @api public - */ - -exports.merge = function(a, b){ - if (a && b) { - for (var key in b) { - a[key] = b[key]; - } - } - return a; -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api public - */ - -exports.escape = function(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - - -/** - * Return a unique identifier with the given `len`. - * - * utils.uid(10); - * // => "FDaS435D2z" - * - * @param {Number} len - * @return {String} - * @api public - */ - -exports.uid = function(len) { - var buf = [] - , chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' - , charlen = chars.length; - - for (var i = 0; i < len; ++i) { - buf.push(chars[getRandomInt(0, charlen - 1)]); - } - - return buf.join(''); -}; - -/** - * Parse the given cookie string into an object. - * - * @param {String} str - * @return {Object} - * @api public - */ - -exports.parseCookie = function(str){ - var obj = {} - , pairs = str.split(/[;,] */); - for (var i = 0, len = pairs.length; i < len; ++i) { - var pair = pairs[i] - , eqlIndex = pair.indexOf('=') - , key = pair.substr(0, eqlIndex).trim().toLowerCase() - , val = pair.substr(++eqlIndex, pair.length).trim(); - - // quoted values - if ('"' == val[0]) val = val.slice(1, -1); - - // only assign once - if (undefined == obj[key]) { - val = val.replace(/\+/g, ' '); - try { - obj[key] = decodeURIComponent(val); - } catch (err) { - if (err instanceof URIError) { - obj[key] = val; - } else { - throw err; - } - } - } - } - return obj; -}; - -/** - * Serialize the given object into a cookie string. - * - * utils.serializeCookie('name', 'tj', { httpOnly: true }) - * // => "name=tj; httpOnly" - * - * @param {String} name - * @param {String} val - * @param {Object} obj - * @return {String} - * @api public - */ - -exports.serializeCookie = function(name, val, obj){ - var pairs = [name + '=' + encodeURIComponent(val)] - , obj = obj || {}; - - if (obj.domain) pairs.push('domain=' + obj.domain); - if (obj.path) pairs.push('path=' + obj.path); - if (obj.expires) pairs.push('expires=' + obj.expires.toUTCString()); - if (obj.httpOnly) pairs.push('httpOnly'); - if (obj.secure) pairs.push('secure'); - - return pairs.join('; '); -}; - -/** - * Pause `data` and `end` events on the given `obj`. - * Middleware performing async tasks _should_ utilize - * this utility (or similar), to re-emit data once - * the async operation has completed, otherwise these - * events may be lost. - * - * var pause = utils.pause(req); - * fs.readFile(path, function(){ - * next(); - * pause.resume(); - * }); - * - * @param {Object} obj - * @return {Object} - * @api public - */ - -exports.pause = function(obj){ - var onData - , onEnd - , events = []; - - // buffer data - obj.on('data', onData = function(data, encoding){ - events.push(['data', data, encoding]); - }); - - // buffer end - obj.on('end', onEnd = function(data, encoding){ - events.push(['end', data, encoding]); - }); - - return { - end: function(){ - obj.removeListener('data', onData); - obj.removeListener('end', onEnd); - }, - resume: function(){ - this.end(); - for (var i = 0, len = events.length; i < len; ++i) { - obj.emit.apply(obj, events[i]); - } - } - }; -}; - -/** - * Check `req` and `res` to see if it has been modified. - * - * @param {IncomingMessage} req - * @param {ServerResponse} res - * @return {Boolean} - * @api public - */ - -exports.modified = function(req, res, headers) { - var headers = headers || res._headers || {} - , modifiedSince = req.headers['if-modified-since'] - , lastModified = headers['last-modified'] - , noneMatch = req.headers['if-none-match'] - , etag = headers['etag']; - - if (noneMatch) noneMatch = noneMatch.split(/ *, */); - - // check If-None-Match - if (noneMatch && etag && ~noneMatch.indexOf(etag)) { - return false; - } - - // check If-Modified-Since - if (modifiedSince && lastModified) { - modifiedSince = new Date(modifiedSince); - lastModified = new Date(lastModified); - // Ignore invalid dates - if (!isNaN(modifiedSince.getTime())) { - if (lastModified <= modifiedSince) return false; - } - } - - return true; -}; - -/** - * Strip `Content-*` headers from `res`. - * - * @param {ServerResponse} res - * @api public - */ - -exports.removeContentHeaders = function(res){ - Object.keys(res._headers).forEach(function(field){ - if (0 == field.indexOf('content')) { - res.removeHeader(field); - } - }); -}; - -/** - * Check if `req` is a conditional GET request. - * - * @param {IncomingMessage} req - * @return {Boolean} - * @api public - */ - -exports.conditionalGET = function(req) { - return req.headers['if-modified-since'] - || req.headers['if-none-match']; -}; - -/** - * Respond with 403 "Forbidden". - * - * @param {ServerResponse} res - * @api public - */ - -exports.forbidden = function(res) { - var body = 'Forbidden'; - res.setHeader('Content-Type', 'text/plain'); - res.setHeader('Content-Length', body.length); - res.statusCode = 403; - res.end(body); -}; - -/** - * Respond with 401 "Unauthorized". - * - * @param {ServerResponse} res - * @param {String} realm - * @api public - */ - -exports.unauthorized = function(res, realm) { - res.statusCode = 401; - res.setHeader('WWW-Authenticate', 'Basic realm="' + realm + '"'); - res.end('Unauthorized'); -}; - -/** - * Respond with 400 "Bad Request". - * - * @param {ServerResponse} res - * @api public - */ - -exports.badRequest = function(res) { - res.statusCode = 400; - res.end('Bad Request'); -}; - -/** - * Respond with 304 "Not Modified". - * - * @param {ServerResponse} res - * @param {Object} headers - * @api public - */ - -exports.notModified = function(res) { - exports.removeContentHeaders(res); - res.statusCode = 304; - res.end(); -}; - -/** - * Return an ETag in the form of `"-"` - * from the given `stat`. - * - * @param {Object} stat - * @return {String} - * @api public - */ - -exports.etag = function(stat) { - return '"' + stat.size + '-' + Number(stat.mtime) + '"'; -}; - -/** - * Parse "Range" header `str` relative to the given file `size`. - * - * @param {Number} size - * @param {String} str - * @return {Array} - * @api public - */ - -exports.parseRange = function(size, str){ - var valid = true; - var arr = str.substr(6).split(',').map(function(range){ - var range = range.split('-') - , start = parseInt(range[0], 10) - , end = parseInt(range[1], 10); - - // -500 - if (isNaN(start)) { - start = size - end; - end = size - 1; - // 500- - } else if (isNaN(end)) { - end = size - 1; - } - - // Invalid - if (isNaN(start) || isNaN(end) || start > end) valid = false; - - return { start: start, end: end }; - }); - return valid ? arr : undefined; -}; - -/** - * Parse the given Cache-Control `str`. - * - * @param {String} str - * @return {Object} - * @api public - */ - -exports.parseCacheControl = function(str){ - var directives = str.split(',') - , obj = {}; - - for(var i = 0, len = directives.length; i < len; i++) { - var parts = directives[i].split('=') - , key = parts.shift().trim() - , val = parseInt(parts.shift(), 10); - - obj[key] = isNaN(val) ? true : val; - } - - return obj; -}; - - -/** - * Convert array-like object to an `Array`. - * - * node-bench measured "16.5 times faster than Array.prototype.slice.call()" - * - * @param {Object} obj - * @return {Array} - * @api public - */ - -var toArray = exports.toArray = function(obj){ - var len = obj.length - , arr = new Array(len); - for (var i = 0; i < len; ++i) { - arr[i] = obj[i]; - } - return arr; -}; - -/** - * Retrun a random int, used by `utils.uid()` - * - * @param {Number} min - * @param {Number} max - * @return {Number} - * @api private - */ - -function getRandomInt(min, max) { - return Math.floor(Math.random() * (max - min + 1)) + min; -} diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/..travis.yml.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/..travis.yml.un~ deleted file mode 100644 index 5dc982fce6fb6694dbdcae443e5a802ea26f7f90..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 953 zcmWH`%$*;a=aT=FfvLGaXYHXQ%)gz~yID`YatKNKb=_A?ZZ)IGZo`!)V!!QUU|?VY zVr0Mw_=LwfIGWH^pcyvGr6dG^(R2oyYrxS2$`i2Q2L(L4f`YDs Lfu5;p~v?DJU?c3r(N-yoyY!M@ZA|| zZtuN%{<>2g3-&+lKKZdyDo*U|cB(%ccW&HX{y2BnaWYd*H^x+%5#?!BN2w2Isg%oR z@oCO^`c+*pq)HU{=$trC;N+JG*@6=rhtI$T(dD@62AWfMF2AlCFawZfnlvPi*}10VR*V1A9)sm|OA3#sLX5vwRyI36{I3}cLD25r_ASr{Oa zxV}BWbv~6V9FG|zhp~ROwXQ~DQdN__*XM?U025B8lB+X*cxu^wN`V zv}>o#qD`N>8=4MOdS{9;f)R9bYFav^WPnIQ_eIhT_otieM^}j%o`ee?UyRqVv-E2$ zqMPG--v~o|b*cltFr7eyHANN%h$N=pq-nOl>8-<A^~Y` cSd!+tq)5H^3ReDr@#nQhw@Q@Rt-UwD0dLwRtN;K2 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore deleted file mode 100644 index 4fbabb3..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -/test/tmp/ -*.upload -*.un~ -*.http diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.package.json.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.package.json.un~ deleted file mode 100644 index 26c5b26c92be8977ee5b5204a8156a1e1a3e8ba7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 542 zcmWH`%$*;a=aT=Ff$8}Zxt^rL1?Q$te0Ff%Dc4$uz)iCgIF`P2U-0#OxM;8f0|SE? z5F-OdAP0m&0LBLM{VsbHus}rOFF@o`NRSjeOyoZhz>R?kj?z>N0bq3GL!;xX1khYI hAch4$C@O>%fIulNu}H~ELCHYRK+jxB$F%YJDgYFGC4T?_ diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Makefile b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Makefile deleted file mode 100644 index 8945872..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -build: npm test - -npm: - npm install . - -clean: - rm test/tmp/* - -.PHONY: test clean build diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md deleted file mode 100644 index 3427514..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +++ /dev/null @@ -1,303 +0,0 @@ -# Formidable - -[![Build Status](https://secure.travis-ci.org/felixge/node-formidable.png)](http://travis-ci.org/felixge/node-formidable) - -## Purpose - -A node.js module for parsing form data, especially file uploads. - -## Current status - -This module was developed for [Transloadit](http://transloadit.com/), a service focused on uploading -and encoding images and videos. It has been battle-tested against hundreds of GB of file uploads from -a large variety of clients and is considered production-ready. - -## Features - -* Fast (~500mb/sec), non-buffering multipart parser -* Automatically writing file uploads to disk -* Low memory footprint -* Graceful error handling -* Very high test coverage - -## Changelog - -### v1.0.9 - -* Emit progress when content length header parsed (Tim Koschützki) -* Fix Readme syntax due to GitHub changes (goob) -* Replace references to old 'sys' module in Readme with 'util' (Peter Sugihara) - -### v1.0.8 - -* Strip potentially unsafe characters when using `keepExtensions: true`. -* Switch to utest / urun for testing -* Add travis build - -### v1.0.7 - -* Remove file from package that was causing problems when installing on windows. (#102) -* Fix typos in Readme (Jason Davies). - -### v1.0.6 - -* Do not default to the default to the field name for file uploads where - filename="". - -### v1.0.5 - -* Support filename="" in multipart parts -* Explain unexpected end() errors in parser better - -**Note:** Starting with this version, formidable emits 'file' events for empty -file input fields. Previously those were incorrectly emitted as regular file -input fields with value = "". - -### v1.0.4 - -* Detect a good default tmp directory regardless of platform. (#88) - -### v1.0.3 - -* Fix problems with utf8 characters (#84) / semicolons in filenames (#58) -* Small performance improvements -* New test suite and fixture system - -### v1.0.2 - -* Exclude node\_modules folder from git -* Implement new `'aborted'` event -* Fix files in example folder to work with recent node versions -* Make gently a devDependency - -[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.1...v1.0.2) - -### v1.0.1 - -* Fix package.json to refer to proper main directory. (#68, Dean Landolt) - -[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.0...v1.0.1) - -### v1.0.0 - -* Add support for multipart boundaries that are quoted strings. (Jeff Craig) - -This marks the beginning of development on version 2.0 which will include -several architectural improvements. - -[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.11...v1.0.0) - -### v0.9.11 - -* Emit `'progress'` event when receiving data, regardless of parsing it. (Tim Koschützki) -* Use [W3C FileAPI Draft](http://dev.w3.org/2006/webapi/FileAPI/) properties for File class - -**Important:** The old property names of the File class will be removed in a -future release. - -[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.10...v0.9.11) - -### Older releases - -These releases were done before starting to maintain the above Changelog: - -* [v0.9.10](https://github.com/felixge/node-formidable/compare/v0.9.9...v0.9.10) -* [v0.9.9](https://github.com/felixge/node-formidable/compare/v0.9.8...v0.9.9) -* [v0.9.8](https://github.com/felixge/node-formidable/compare/v0.9.7...v0.9.8) -* [v0.9.7](https://github.com/felixge/node-formidable/compare/v0.9.6...v0.9.7) -* [v0.9.6](https://github.com/felixge/node-formidable/compare/v0.9.5...v0.9.6) -* [v0.9.5](https://github.com/felixge/node-formidable/compare/v0.9.4...v0.9.5) -* [v0.9.4](https://github.com/felixge/node-formidable/compare/v0.9.3...v0.9.4) -* [v0.9.3](https://github.com/felixge/node-formidable/compare/v0.9.2...v0.9.3) -* [v0.9.2](https://github.com/felixge/node-formidable/compare/v0.9.1...v0.9.2) -* [v0.9.1](https://github.com/felixge/node-formidable/compare/v0.9.0...v0.9.1) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.1.0](https://github.com/felixge/node-formidable/commits/v0.1.0) - -## Installation - -Via [npm](http://github.com/isaacs/npm): - - npm install formidable@latest - -Manually: - - git clone git://github.com/felixge/node-formidable.git formidable - vim my.js - # var formidable = require('./formidable'); - -Note: Formidable requires [gently](http://github.com/felixge/node-gently) to run the unit tests, but you won't need it for just using the library. - -## Example - -Parse an incoming file upload. - - var formidable = require('formidable'), - http = require('http'), - - util = require('util'); - - http.createServer(function(req, res) { - if (req.url == '/upload' && req.method.toLowerCase() == 'post') { - // parse a file upload - var form = new formidable.IncomingForm(); - form.parse(req, function(err, fields, files) { - res.writeHead(200, {'content-type': 'text/plain'}); - res.write('received upload:\n\n'); - res.end(util.inspect({fields: fields, files: files})); - }); - return; - } - - // show a file upload form - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - }).listen(80); - -## API - -### formidable.IncomingForm - -__new formidable.IncomingForm()__ - -Creates a new incoming form. - -__incomingForm.encoding = 'utf-8'__ - -The encoding to use for incoming form fields. - -__incomingForm.uploadDir = process.env.TMP || '/tmp' || process.cwd()__ - -The directory for placing file uploads in. You can move them later on using -`fs.rename()`. The default directory is picked at module load time depending on -the first existing directory from those listed above. - -__incomingForm.keepExtensions = false__ - -If you want the files written to `incomingForm.uploadDir` to include the extensions of the original files, set this property to `true`. - -__incomingForm.type__ - -Either 'multipart' or 'urlencoded' depending on the incoming request. - -__incomingForm.maxFieldsSize = 2 * 1024 * 1024__ - -Limits the amount of memory a field (not file) can allocate in bytes. -If this value is exceeded, an `'error'` event is emitted. The default -size is 2MB. - -__incomingForm.bytesReceived__ - -The amount of bytes received for this form so far. - -__incomingForm.bytesExpected__ - -The expected number of bytes in this form. - -__incomingForm.parse(request, [cb])__ - -Parses an incoming node.js `request` containing form data. If `cb` is provided, all fields an files are collected and passed to the callback: - - incomingForm.parse(req, function(err, fields, files) { - // ... - }); - -__incomingForm.onPart(part)__ - -You may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events processing which would occur otherwise, making you fully responsible for handling the processing. - - incomingForm.onPart = function(part) { - part.addListener('data', function() { - // ... - }); - } - -If you want to use formidable to only handle certain parts for you, you can do so: - - incomingForm.onPart = function(part) { - if (!part.filename) { - // let formidable handle all non-file parts - incomingForm.handlePart(part); - } - } - -Check the code in this method for further inspiration. - -__Event: 'progress' (bytesReceived, bytesExpected)__ - -Emitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar. - -__Event: 'field' (name, value)__ - -Emitted whenever a field / value pair has been received. - -__Event: 'fileBegin' (name, file)__ - -Emitted whenever a new file is detected in the upload stream. Use this even if -you want to stream the file to somewhere else while buffering the upload on -the file system. - -__Event: 'file' (name, file)__ - -Emitted whenever a field / file pair has been received. `file` is an instance of `File`. - -__Event: 'error' (err)__ - -Emitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events. - -__Event: 'aborted'__ - -Emitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core). - -__Event: 'end' ()__ - -Emitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response. - -### formidable.File - -__file.size = 0__ - -The size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet. - -__file.path = null__ - -The path this file is being written to. You can modify this in the `'fileBegin'` event in -case you are unhappy with the way formidable generates a temporary path for your files. - -__file.name = null__ - -The name this file had according to the uploading client. - -__file.type = null__ - -The mime type of this file, according to the uploading client. - -__file.lastModifiedDate = null__ - -A date object (or `null`) containing the time this file was last written to. Mostly -here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/). - -## License - -Formidable is licensed under the MIT license. - -## Ports - -* [multipart-parser](http://github.com/FooBarWidget/multipart-parser): a C++ parser based on formidable - -## Credits - -* [Ryan Dahl](http://twitter.com/ryah) for his work on [http-parser](http://github.com/ry/http-parser) which heavily inspired multipart_parser.js diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/TODO b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/TODO deleted file mode 100644 index e1107f2..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/TODO +++ /dev/null @@ -1,3 +0,0 @@ -- Better bufferMaxSize handling approach -- Add tests for JSON parser pull request and merge it -- Implement QuerystringParser the same way as MultipartParser diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js deleted file mode 100644 index bff41f1..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +++ /dev/null @@ -1,70 +0,0 @@ -require('../test/common'); -var multipartParser = require('../lib/multipart_parser'), - MultipartParser = multipartParser.MultipartParser, - parser = new MultipartParser(), - Buffer = require('buffer').Buffer, - boundary = '-----------------------------168072824752491622650073', - mb = 100, - buffer = createMultipartBuffer(boundary, mb * 1024 * 1024), - callbacks = - { partBegin: -1, - partEnd: -1, - headerField: -1, - headerValue: -1, - partData: -1, - end: -1, - }; - - -parser.initWithBoundary(boundary); -parser.onHeaderField = function() { - callbacks.headerField++; -}; - -parser.onHeaderValue = function() { - callbacks.headerValue++; -}; - -parser.onPartBegin = function() { - callbacks.partBegin++; -}; - -parser.onPartData = function() { - callbacks.partData++; -}; - -parser.onPartEnd = function() { - callbacks.partEnd++; -}; - -parser.onEnd = function() { - callbacks.end++; -}; - -var start = +new Date(), - nparsed = parser.write(buffer), - duration = +new Date - start, - mbPerSec = (mb / (duration / 1000)).toFixed(2); - -console.log(mbPerSec+' mb/sec'); - -assert.equal(nparsed, buffer.length); - -function createMultipartBuffer(boundary, size) { - var head = - '--'+boundary+'\r\n' - + 'content-disposition: form-data; name="field1"\r\n' - + '\r\n' - , tail = '\r\n--'+boundary+'--\r\n' - , buffer = new Buffer(size); - - buffer.write(head, 'ascii', 0); - buffer.write(tail, 'ascii', buffer.length - tail.length); - return buffer; -} - -process.on('exit', function() { - for (var k in callbacks) { - assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]); - } -}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js deleted file mode 100644 index f6c15a6..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +++ /dev/null @@ -1,43 +0,0 @@ -require('../test/common'); -var http = require('http'), - util = require('util'), - formidable = require('formidable'), - server; - -server = http.createServer(function(req, res) { - if (req.url == '/') { - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - } else if (req.url == '/post') { - var form = new formidable.IncomingForm(), - fields = []; - - form - .on('error', function(err) { - res.writeHead(200, {'content-type': 'text/plain'}); - res.end('error:\n\n'+util.inspect(err)); - }) - .on('field', function(field, value) { - console.log(field, value); - fields.push([field, value]); - }) - .on('end', function() { - console.log('-> post done'); - res.writeHead(200, {'content-type': 'text/plain'}); - res.end('received fields:\n\n '+util.inspect(fields)); - }); - form.parse(req); - } else { - res.writeHead(404, {'content-type': 'text/plain'}); - res.end('404'); - } -}); -server.listen(TEST_PORT); - -console.log('listening on http://localhost:'+TEST_PORT+'/'); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js deleted file mode 100644 index 050cdd9..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +++ /dev/null @@ -1,48 +0,0 @@ -require('../test/common'); -var http = require('http'), - util = require('util'), - formidable = require('formidable'), - server; - -server = http.createServer(function(req, res) { - if (req.url == '/') { - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - } else if (req.url == '/upload') { - var form = new formidable.IncomingForm(), - files = [], - fields = []; - - form.uploadDir = TEST_TMP; - - form - .on('field', function(field, value) { - console.log(field, value); - fields.push([field, value]); - }) - .on('file', function(field, file) { - console.log(field, file); - files.push([field, file]); - }) - .on('end', function() { - console.log('-> upload done'); - res.writeHead(200, {'content-type': 'text/plain'}); - res.write('received fields:\n\n '+util.inspect(fields)); - res.write('\n\n'); - res.end('received files:\n\n '+util.inspect(files)); - }); - form.parse(req); - } else { - res.writeHead(404, {'content-type': 'text/plain'}); - res.end('404'); - } -}); -server.listen(TEST_PORT); - -console.log('listening on http://localhost:'+TEST_PORT+'/'); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/index.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/index.js deleted file mode 100644 index be41032..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/formidable'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/.incoming_form.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/.incoming_form.js.un~ deleted file mode 100644 index 2e3220132c00294f535af61df327cd09af6553b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12289 zcmeI2%T5$Q6o$KDKt@qPK)gg56=5dh%&5^sLNGDnEm3d-UV!LGhH!@vf@n<84I3Z9 zg$p*uxbYEu0!?@ZSDQjF-B|UYjn(jWFum7s*sv4e}dp|Vazwq6w zx$^7k*R_>b4eNCs?XMqv`MH$IG_GxY8tVPrvvKFc+XJ5GzwkWoVuDg(bs1Tr4_0=m zusE9^FC=rx(d*B;>*24QvkHis5X` zd-4ruDb*A+{-sm?6j=vR`a_9t#i!iQzed0xrz_fvSFwFc?yy2R+XI_-uQ3kK`+cMs zdNA~#(;t9RO*~#wj|;uaZx|iU*P<+mF#6MEGfsyt2#Z~AgzkD2y83v0CBKvqSb!2! zt`Il}OU0uq(+F07B&O@Ic2HHSeQnzZfIE4sQI&W1dZYubcyr% zxk4h{msrd%PiCoiL^(MzHCup@>J`~Ra`nndqRO&sK%FD0B4c41k-Vu%(#WEudusqm zB|M03kMe}jIpL{zRAn0Bx~*}Q3$IZNPZS1qv6{p;!pF#(P<9HFs90u3$nHfUYtqQ@ z5h2*1vbge!5OTxl#{DWNwx$ubft|1g<9n!TuX2HKv9h?zDN9Ah!ZboOSdIvv*GTyE z3NS%M`%sod$XH1{+IN_Ou-N5BnC_Qj!eDWg9tcb^G=TgKt$VWo9`wbddU20Hy537- zQFUenZ#W8GGvMi|uatCO5Zr#{ATeZa&8TytQ<1SStLN5I&MlV<$U$v1#~CJ~=*Wf9 zsM0VZ_b^Ivt=q_DLv#=vj}OI5OjV;tY(d$HPNHI&8KHX=g|2NIy3s9mkQ{%KiF?G6 z*|nnV*hy3@Gb477qu8}qU^g-rDi5mTu1y>yl1z`6cpN=TY;u_qy|E~ICo0jC1-g(S z)OSdEN<3Z1r{YnSX~ghp6vK`PhUrvD5h~>VPTVD;OtAxHr$mX0WoAV2SrkP;Ecsw4 zT`LbULWtb;iKm2=F`h=*VU(y?W=0q%qA+&uf{`{nbO#?4P-C0&l&~_&lc;kjRb(to zBb1X-D7$t?iM=cGT@OtjR(=v#o=odPor9?&V__P>oYpXd^}1j(jbUQFj^<=&Q_>D= zufgIgR4Kb(*job2%5*cM7Vye1F@iaxVFvS`0nB8yGPm}Xi8i52+M^UELd)9Z3a8C5 zE>;FdQWoS`Bw~BRbUU_btJp#XocuIQbY}&p;buX-tt`C9S=?h+earg*X&>cFi$C;k zu;*NI?}Lhrg=zFYEb{x{7q<@5Oq@SQ2jm?rZ$Pfc)YA!lObEVP>=` c6kM~4DA*?xw1dShYq1ivyeHpUvp+um1>qtr4FCWD diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js deleted file mode 100644 index 6dc8720..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +++ /dev/null @@ -1,61 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -var util = require('./util'), - WriteStream = require('fs').WriteStream, - EventEmitter = require('events').EventEmitter; - -function File(properties) { - EventEmitter.call(this); - - this.size = 0; - this.path = null; - this.name = null; - this.type = null; - this.lastModifiedDate = null; - - this._writeStream = null; - - for (var key in properties) { - this[key] = properties[key]; - } - - this._backwardsCompatibility(); -} -module.exports = File; -util.inherits(File, EventEmitter); - -// @todo Next release: Show error messages when accessing these -File.prototype._backwardsCompatibility = function() { - var self = this; - this.__defineGetter__('length', function() { - return self.size; - }); - this.__defineGetter__('filename', function() { - return self.name; - }); - this.__defineGetter__('mime', function() { - return self.type; - }); -}; - -File.prototype.open = function() { - this._writeStream = new WriteStream(this.path); -}; - -File.prototype.write = function(buffer, cb) { - var self = this; - this._writeStream.write(buffer, function() { - self.lastModifiedDate = new Date(); - self.size += buffer.length; - self.emit('progress', self.size); - cb(); - }); -}; - -File.prototype.end = function(cb) { - var self = this; - this._writeStream.end(function() { - self.emit('end'); - cb(); - }); -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js deleted file mode 100644 index b1e2bfb..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +++ /dev/null @@ -1,378 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -var fs = require('fs'); -var util = require('./util'), - path = require('path'), - File = require('./file'), - MultipartParser = require('./multipart_parser').MultipartParser, - QuerystringParser = require('./querystring_parser').QuerystringParser, - StringDecoder = require('string_decoder').StringDecoder, - EventEmitter = require('events').EventEmitter; - -function IncomingForm() { - if (!(this instanceof IncomingForm)) return new IncomingForm; - EventEmitter.call(this); - - this.error = null; - this.ended = false; - - this.maxFieldsSize = 2 * 1024 * 1024; - this.keepExtensions = false; - this.uploadDir = IncomingForm.UPLOAD_DIR; - this.encoding = 'utf-8'; - this.headers = null; - this.type = null; - - this.bytesReceived = null; - this.bytesExpected = null; - - this._parser = null; - this._flushing = 0; - this._fieldsSize = 0; -}; -util.inherits(IncomingForm, EventEmitter); -exports.IncomingForm = IncomingForm; - -IncomingForm.UPLOAD_DIR = (function() { - var dirs = [process.env.TMP, '/tmp', process.cwd()]; - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var isDirectory = false; - - try { - isDirectory = fs.statSync(dir).isDirectory(); - } catch (e) {} - - if (isDirectory) return dir; - } -})(); - -IncomingForm.prototype.parse = function(req, cb) { - this.pause = function() { - try { - req.pause(); - } catch (err) { - // the stream was destroyed - if (!this.ended) { - // before it was completed, crash & burn - this._error(err); - } - return false; - } - return true; - }; - - this.resume = function() { - try { - req.resume(); - } catch (err) { - // the stream was destroyed - if (!this.ended) { - // before it was completed, crash & burn - this._error(err); - } - return false; - } - - return true; - }; - - this.writeHeaders(req.headers); - - var self = this; - req - .on('error', function(err) { - self._error(err); - }) - .on('aborted', function() { - self.emit('aborted'); - }) - .on('data', function(buffer) { - self.write(buffer); - }) - .on('end', function() { - if (self.error) { - return; - } - - var err = self._parser.end(); - if (err) { - self._error(err); - } - }); - - if (cb) { - var fields = {}, files = {}; - this - .on('field', function(name, value) { - fields[name] = value; - }) - .on('file', function(name, file) { - files[name] = file; - }) - .on('error', function(err) { - cb(err, fields, files); - }) - .on('end', function() { - cb(null, fields, files); - }); - } - - return this; -}; - -IncomingForm.prototype.writeHeaders = function(headers) { - this.headers = headers; - this._parseContentLength(); - this._parseContentType(); -}; - -IncomingForm.prototype.write = function(buffer) { - if (!this._parser) { - this._error(new Error('unintialized parser')); - return; - } - - this.bytesReceived += buffer.length; - this.emit('progress', this.bytesReceived, this.bytesExpected); - - var bytesParsed = this._parser.write(buffer); - if (bytesParsed !== buffer.length) { - this._error(new Error('parser error, '+bytesParsed+' of '+buffer.length+' bytes parsed')); - } - - return bytesParsed; -}; - -IncomingForm.prototype.pause = function() { - // this does nothing, unless overwritten in IncomingForm.parse - return false; -}; - -IncomingForm.prototype.resume = function() { - // this does nothing, unless overwritten in IncomingForm.parse - return false; -}; - -IncomingForm.prototype.onPart = function(part) { - // this method can be overwritten by the user - this.handlePart(part); -}; - -IncomingForm.prototype.handlePart = function(part) { - var self = this; - - if (part.filename === undefined) { - var value = '' - , decoder = new StringDecoder(this.encoding); - - part.on('data', function(buffer) { - self._fieldsSize += buffer.length; - if (self._fieldsSize > self.maxFieldsSize) { - self._error(new Error('maxFieldsSize exceeded, received '+self._fieldsSize+' bytes of field data')); - return; - } - value += decoder.write(buffer); - }); - - part.on('end', function() { - self.emit('field', part.name, value); - }); - return; - } - - this._flushing++; - - var file = new File({ - path: this._uploadPath(part.filename), - name: part.filename, - type: part.mime, - }); - - this.emit('fileBegin', part.name, file); - - file.open(); - - part.on('data', function(buffer) { - self.pause(); - file.write(buffer, function() { - self.resume(); - }); - }); - - part.on('end', function() { - file.end(function() { - self._flushing--; - self.emit('file', part.name, file); - self._maybeEnd(); - }); - }); -}; - -IncomingForm.prototype._parseContentType = function() { - if (!this.headers['content-type']) { - this._error(new Error('bad content-type header, no content-type')); - return; - } - - if (this.headers['content-type'].match(/urlencoded/i)) { - this._initUrlencoded(); - return; - } - - if (this.headers['content-type'].match(/multipart/i)) { - var m; - if (m = this.headers['content-type'].match(/boundary=(?:"([^"]+)"|([^;]+))/i)) { - this._initMultipart(m[1] || m[2]); - } else { - this._error(new Error('bad content-type header, no multipart boundary')); - } - return; - } - - this._error(new Error('bad content-type header, unknown content-type: '+this.headers['content-type'])); -}; - -IncomingForm.prototype._error = function(err) { - if (this.error) { - return; - } - - this.error = err; - this.pause(); - this.emit('error', err); -}; - -IncomingForm.prototype._parseContentLength = function() { - if (this.headers['content-length']) { - this.bytesReceived = 0; - this.bytesExpected = parseInt(this.headers['content-length'], 10); - this.emit('progress', this.bytesReceived, this.bytesExpected); - } -}; - -IncomingForm.prototype._newParser = function() { - return new MultipartParser(); -}; - -IncomingForm.prototype._initMultipart = function(boundary) { - this.type = 'multipart'; - - var parser = new MultipartParser(), - self = this, - headerField, - headerValue, - part; - - parser.initWithBoundary(boundary); - - parser.onPartBegin = function() { - part = new EventEmitter(); - part.headers = {}; - part.name = null; - part.filename = null; - part.mime = null; - headerField = ''; - headerValue = ''; - }; - - parser.onHeaderField = function(b, start, end) { - headerField += b.toString(self.encoding, start, end); - }; - - parser.onHeaderValue = function(b, start, end) { - headerValue += b.toString(self.encoding, start, end); - }; - - parser.onHeaderEnd = function() { - headerField = headerField.toLowerCase(); - part.headers[headerField] = headerValue; - - var m; - if (headerField == 'content-disposition') { - if (m = headerValue.match(/name="([^"]+)"/i)) { - part.name = m[1]; - } - - part.filename = self._fileName(headerValue); - } else if (headerField == 'content-type') { - part.mime = headerValue; - } - - headerField = ''; - headerValue = ''; - }; - - parser.onHeadersEnd = function() { - self.onPart(part); - }; - - parser.onPartData = function(b, start, end) { - part.emit('data', b.slice(start, end)); - }; - - parser.onPartEnd = function() { - part.emit('end'); - }; - - parser.onEnd = function() { - self.ended = true; - self._maybeEnd(); - }; - - this._parser = parser; -}; - -IncomingForm.prototype._fileName = function(headerValue) { - var m = headerValue.match(/filename="(.*?)"($|; )/i) - if (!m) return; - - var filename = m[1].substr(m[1].lastIndexOf('\\') + 1); - filename = filename.replace(/%22/g, '"'); - filename = filename.replace(/&#([\d]{4});/g, function(m, code) { - return String.fromCharCode(code); - }); - return filename; -}; - -IncomingForm.prototype._initUrlencoded = function() { - this.type = 'urlencoded'; - - var parser = new QuerystringParser() - , self = this; - - parser.onField = function(key, val) { - self.emit('field', key, val); - }; - - parser.onEnd = function() { - self.ended = true; - self._maybeEnd(); - }; - - this._parser = parser; -}; - -IncomingForm.prototype._uploadPath = function(filename) { - var name = ''; - for (var i = 0; i < 32; i++) { - name += Math.floor(Math.random() * 16).toString(16); - } - - if (this.keepExtensions) { - var ext = path.extname(filename); - ext = ext.replace(/(\.[a-z0-9]+).*/, '$1') - - name += ext; - } - - return path.join(this.uploadDir, name); -}; - -IncomingForm.prototype._maybeEnd = function() { - if (!this.ended || this._flushing) { - return; - } - - this.emit('end'); -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js deleted file mode 100644 index 7a6e3e1..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +++ /dev/null @@ -1,3 +0,0 @@ -var IncomingForm = require('./incoming_form').IncomingForm; -IncomingForm.IncomingForm = IncomingForm; -module.exports = IncomingForm; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js deleted file mode 100644 index 9ca567c..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +++ /dev/null @@ -1,312 +0,0 @@ -var Buffer = require('buffer').Buffer, - s = 0, - S = - { PARSER_UNINITIALIZED: s++, - START: s++, - START_BOUNDARY: s++, - HEADER_FIELD_START: s++, - HEADER_FIELD: s++, - HEADER_VALUE_START: s++, - HEADER_VALUE: s++, - HEADER_VALUE_ALMOST_DONE: s++, - HEADERS_ALMOST_DONE: s++, - PART_DATA_START: s++, - PART_DATA: s++, - PART_END: s++, - END: s++, - }, - - f = 1, - F = - { PART_BOUNDARY: f, - LAST_BOUNDARY: f *= 2, - }, - - LF = 10, - CR = 13, - SPACE = 32, - HYPHEN = 45, - COLON = 58, - A = 97, - Z = 122, - - lower = function(c) { - return c | 0x20; - }; - -for (var s in S) { - exports[s] = S[s]; -} - -function MultipartParser() { - this.boundary = null; - this.boundaryChars = null; - this.lookbehind = null; - this.state = S.PARSER_UNINITIALIZED; - - this.index = null; - this.flags = 0; -}; -exports.MultipartParser = MultipartParser; - -MultipartParser.stateToString = function(stateNumber) { - for (var state in S) { - var number = S[state]; - if (number === stateNumber) return state; - } -}; - -MultipartParser.prototype.initWithBoundary = function(str) { - this.boundary = new Buffer(str.length+4); - this.boundary.write('\r\n--', 'ascii', 0); - this.boundary.write(str, 'ascii', 4); - this.lookbehind = new Buffer(this.boundary.length+8); - this.state = S.START; - - this.boundaryChars = {}; - for (var i = 0; i < this.boundary.length; i++) { - this.boundaryChars[this.boundary[i]] = true; - } -}; - -MultipartParser.prototype.write = function(buffer) { - var self = this, - i = 0, - len = buffer.length, - prevIndex = this.index, - index = this.index, - state = this.state, - flags = this.flags, - lookbehind = this.lookbehind, - boundary = this.boundary, - boundaryChars = this.boundaryChars, - boundaryLength = this.boundary.length, - boundaryEnd = boundaryLength - 1, - bufferLength = buffer.length, - c, - cl, - - mark = function(name) { - self[name+'Mark'] = i; - }, - clear = function(name) { - delete self[name+'Mark']; - }, - callback = function(name, buffer, start, end) { - if (start !== undefined && start === end) { - return; - } - - var callbackSymbol = 'on'+name.substr(0, 1).toUpperCase()+name.substr(1); - if (callbackSymbol in self) { - self[callbackSymbol](buffer, start, end); - } - }, - dataCallback = function(name, clear) { - var markSymbol = name+'Mark'; - if (!(markSymbol in self)) { - return; - } - - if (!clear) { - callback(name, buffer, self[markSymbol], buffer.length); - self[markSymbol] = 0; - } else { - callback(name, buffer, self[markSymbol], i); - delete self[markSymbol]; - } - }; - - for (i = 0; i < len; i++) { - c = buffer[i]; - switch (state) { - case S.PARSER_UNINITIALIZED: - return i; - case S.START: - index = 0; - state = S.START_BOUNDARY; - case S.START_BOUNDARY: - if (index == boundary.length - 2) { - if (c != CR) { - return i; - } - index++; - break; - } else if (index - 1 == boundary.length - 2) { - if (c != LF) { - return i; - } - index = 0; - callback('partBegin'); - state = S.HEADER_FIELD_START; - break; - } - - if (c != boundary[index+2]) { - return i; - } - index++; - break; - case S.HEADER_FIELD_START: - state = S.HEADER_FIELD; - mark('headerField'); - index = 0; - case S.HEADER_FIELD: - if (c == CR) { - clear('headerField'); - state = S.HEADERS_ALMOST_DONE; - break; - } - - index++; - if (c == HYPHEN) { - break; - } - - if (c == COLON) { - if (index == 1) { - // empty header field - return i; - } - dataCallback('headerField', true); - state = S.HEADER_VALUE_START; - break; - } - - cl = lower(c); - if (cl < A || cl > Z) { - return i; - } - break; - case S.HEADER_VALUE_START: - if (c == SPACE) { - break; - } - - mark('headerValue'); - state = S.HEADER_VALUE; - case S.HEADER_VALUE: - if (c == CR) { - dataCallback('headerValue', true); - callback('headerEnd'); - state = S.HEADER_VALUE_ALMOST_DONE; - } - break; - case S.HEADER_VALUE_ALMOST_DONE: - if (c != LF) { - return i; - } - state = S.HEADER_FIELD_START; - break; - case S.HEADERS_ALMOST_DONE: - if (c != LF) { - return i; - } - - callback('headersEnd'); - state = S.PART_DATA_START; - break; - case S.PART_DATA_START: - state = S.PART_DATA - mark('partData'); - case S.PART_DATA: - prevIndex = index; - - if (index == 0) { - // boyer-moore derrived algorithm to safely skip non-boundary data - i += boundaryEnd; - while (i < bufferLength && !(buffer[i] in boundaryChars)) { - i += boundaryLength; - } - i -= boundaryEnd; - c = buffer[i]; - } - - if (index < boundary.length) { - if (boundary[index] == c) { - if (index == 0) { - dataCallback('partData', true); - } - index++; - } else { - index = 0; - } - } else if (index == boundary.length) { - index++; - if (c == CR) { - // CR = part boundary - flags |= F.PART_BOUNDARY; - } else if (c == HYPHEN) { - // HYPHEN = end boundary - flags |= F.LAST_BOUNDARY; - } else { - index = 0; - } - } else if (index - 1 == boundary.length) { - if (flags & F.PART_BOUNDARY) { - index = 0; - if (c == LF) { - // unset the PART_BOUNDARY flag - flags &= ~F.PART_BOUNDARY; - callback('partEnd'); - callback('partBegin'); - state = S.HEADER_FIELD_START; - break; - } - } else if (flags & F.LAST_BOUNDARY) { - if (c == HYPHEN) { - callback('partEnd'); - callback('end'); - state = S.END; - } else { - index = 0; - } - } else { - index = 0; - } - } - - if (index > 0) { - // when matching a possible boundary, keep a lookbehind reference - // in case it turns out to be a false lead - lookbehind[index-1] = c; - } else if (prevIndex > 0) { - // if our boundary turned out to be rubbish, the captured lookbehind - // belongs to partData - callback('partData', lookbehind, 0, prevIndex); - prevIndex = 0; - mark('partData'); - - // reconsider the current character even so it interrupted the sequence - // it could be the beginning of a new sequence - i--; - } - - break; - case S.END: - break; - default: - return i; - } - } - - dataCallback('headerField'); - dataCallback('headerValue'); - dataCallback('partData'); - - this.index = index; - this.state = state; - this.flags = flags; - - return len; -}; - -MultipartParser.prototype.end = function() { - if (this.state != S.END) { - return new Error('MultipartParser.end(): stream ended unexpectedly: ' + this.explain()); - } -}; - -MultipartParser.prototype.explain = function() { - return 'state = ' + MultipartParser.stateToString(this.state); -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js deleted file mode 100644 index 63f109e..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +++ /dev/null @@ -1,25 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -// This is a buffering parser, not quite as nice as the multipart one. -// If I find time I'll rewrite this to be fully streaming as well -var querystring = require('querystring'); - -function QuerystringParser() { - this.buffer = ''; -}; -exports.QuerystringParser = QuerystringParser; - -QuerystringParser.prototype.write = function(buffer) { - this.buffer += buffer.toString('ascii'); - return buffer.length; -}; - -QuerystringParser.prototype.end = function() { - var fields = querystring.parse(this.buffer); - for (var field in fields) { - this.onField(field, fields[field]); - } - this.buffer = ''; - - this.onEnd(); -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js deleted file mode 100644 index e9493e9..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +++ /dev/null @@ -1,6 +0,0 @@ -// Backwards compatibility ... -try { - module.exports = require('util'); -} catch (e) { - module.exports = require('sys'); -} diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/package.json b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/package.json deleted file mode 100644 index 4cf5f2d..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "formidable", - "version": "1.0.9", - "dependencies": {}, - "devDependencies": { - "gently": "0.8.0", - "findit": "0.1.1", - "hashish": "0.0.4", - "urun": "0.0.4", - "utest": "0.0.3" - }, - "directories": { - "lib": "./lib" - }, - "main": "./lib/index", - "scripts": { - "test": "make test" - }, - "engines": { - "node": "*" - } -} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/.common.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/.common.js.un~ deleted file mode 100644 index 00420761503c6a48f67dcc878b7ea3595f57d4c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1666 zcmWH`%$*;a=aT=Ff$8He&D_W32b3d1pH?Keh_o7=jl+@QR1!i}8_3=G0R zj0_lo9A>Bhh=ySXzssIYEFf7%hWHCm1x!#HM1iFEVf_C<02YA>jM7vN0bq2Lfun{;qPqD-y2U_o zbxmv2MsS=WM?T2Cp!fwD36cl|oT|eu;v%g1UZ5YH^7^ zP)J<|tezdH24*lwy^?}LT4qH_X;CV=9;h%>AIM=KyFdV>PgFr6Co>6250D2{$_kVQ VSpxzfrMwDY*Fe#c48#WW{Vsb1uz*xCGQ?kiDn_P2ieQE?{09OA4_VnLn>rx?j1GTjbbOV7 T8VQRla5SKZf<;UlpRWP{lBXd7 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js deleted file mode 100644 index eb432ad..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +++ /dev/null @@ -1,19 +0,0 @@ -var mysql = require('..'); -var path = require('path'); - -var root = path.join(__dirname, '../'); -exports.dir = { - root : root, - lib : root + '/lib', - fixture : root + '/test/fixture', - tmp : root + '/test/tmp', -}; - -exports.port = 13532; - -exports.formidable = require('..'); -exports.assert = require('assert'); - -exports.require = function(lib) { - return require(exports.dir.lib + '/' + lib); -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt deleted file mode 100644 index e7a4785..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +++ /dev/null @@ -1 +0,0 @@ -I am a text file with a funky name! diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt deleted file mode 100644 index 9b6903e..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +++ /dev/null @@ -1 +0,0 @@ -I am a plain text file diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/.generic.http.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/.generic.http.un~ deleted file mode 100644 index a863c08aec4e610f4e4b4340331b0f34eec45e61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 641 zcmWH`%$*;a=aT=FfoZOok%Ha=ek068d0LI3~& diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md deleted file mode 100644 index 3c9dbe3..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +++ /dev/null @@ -1,3 +0,0 @@ -* Opera does not allow submitting this file, it shows a warning to the - user that the file could not be found instead. Tested in 9.8, 11.51 on OSX. - Reported to Opera on 08.09.2011 (tracking email DSK-346009@bugs.opera.com). diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.no-filename.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.no-filename.js.un~ deleted file mode 100644 index ea9828b0ac20914dbecd85a13e554592b0b9b6ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1147 zcmWH`%$*;a=aT=Ffyrl+PG{?quti?~*K$u2*NeQ&wDszYs*>YVJqo8yd@OK{fq{V; zh+P#Fs!J*hQmqu!(=u~X)pZo|5_3Vk(t@1)#1tSOBn%Y;^D0V8i$DqrauPH1^hzp9 z)N6Hs1~CD#1Q0Vq*+2>`1`-Eh27gJ5J1h{{_zNHbAOK51m~f3CLm2)80ayeoIZ9DG z1c1?T5gZ+i3}0dK21*bh42mV{Bn;C=a9o27LWl*SDcr4{Kc8 P<0=G*%>Jg0&sPBeAD(H* diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.special-chars-in-filename.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.special-chars-in-filename.js.un~ deleted file mode 100644 index 4c13bdb1a76bb2141c36a4151c55d2245c51d722..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2129 zcmWH`%$*;a=aT=Ff$7jJdo{nc&(5>&F0gERG`Cjfk;|I)s%ak=uD_IgQSz@O0|SF7 z5J#6K7AX`Inp^>DA+5gDrhOxC@3k|DA+0JDLk6dtYEDW zqpskfpsb*x5T~G~prN3tpsNrM)S|6Wtx&5Ftq`k_pirk*QccT015?K0$>Udf@VmpDL@r_fst04 zmtC0#EkV?+p>YXwC@B6w@d`>xqq!LtDm174Hm`pHj!Q=DxmgB#Toz|!0!weSCYvR{;RB@}4~a diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js deleted file mode 100644 index 0bae449..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports['generic.http'] = [ - {type: 'file', name: 'upload', filename: '', fixture: 'plain.txt'}, -]; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js deleted file mode 100644 index eb76fdc..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +++ /dev/null @@ -1,21 +0,0 @@ -var properFilename = 'funkyfilename.txt'; - -function expect(filename) { - return [ - {type: 'field', name: 'title', value: 'Weird filename'}, - {type: 'file', name: 'upload', filename: filename, fixture: properFilename}, - ]; -}; - -var webkit = " ? % * | \" < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; -var ffOrIe = " ? % * | \" < > . ☃ ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; - -module.exports = { - 'osx-chrome-13.http' : expect(webkit), - 'osx-firefox-3.6.http' : expect(ffOrIe), - 'osx-safari-5.http' : expect(webkit), - 'xp-chrome-12.http' : expect(webkit), - 'xp-ie-7.http' : expect(ffOrIe), - 'xp-ie-8.http' : expect(ffOrIe), - 'xp-safari-5.http' : expect(webkit), -}; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js deleted file mode 100644 index a476169..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js +++ /dev/null @@ -1,72 +0,0 @@ -exports['rfc1867'] = - { boundary: 'AaB03x', - raw: - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="field1"\r\n'+ - '\r\n'+ - 'Joe Blow\r\nalmost tricked you!\r\n'+ - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ - 'Content-Type: text/plain\r\n'+ - '\r\n'+ - '... contents of file1.txt ...\r\r\n'+ - '--AaB03x--\r\n', - parts: - [ { headers: { - 'content-disposition': 'form-data; name="field1"', - }, - data: 'Joe Blow\r\nalmost tricked you!', - }, - { headers: { - 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', - 'Content-Type': 'text/plain', - }, - data: '... contents of file1.txt ...\r', - } - ] - }; - -exports['noTrailing\r\n'] = - { boundary: 'AaB03x', - raw: - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="field1"\r\n'+ - '\r\n'+ - 'Joe Blow\r\nalmost tricked you!\r\n'+ - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ - 'Content-Type: text/plain\r\n'+ - '\r\n'+ - '... contents of file1.txt ...\r\r\n'+ - '--AaB03x--', - parts: - [ { headers: { - 'content-disposition': 'form-data; name="field1"', - }, - data: 'Joe Blow\r\nalmost tricked you!', - }, - { headers: { - 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', - 'Content-Type': 'text/plain', - }, - data: '... contents of file1.txt ...\r', - } - ] - }; - -exports['emptyHeader'] = - { boundary: 'AaB03x', - raw: - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="field1"\r\n'+ - ': foo\r\n'+ - '\r\n'+ - 'Joe Blow\r\nalmost tricked you!\r\n'+ - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ - 'Content-Type: text/plain\r\n'+ - '\r\n'+ - '... contents of file1.txt ...\r\r\n'+ - '--AaB03x--\r\n', - expectError: true, - }; diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/.test-fixtures.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/.test-fixtures.js.un~ deleted file mode 100644 index a4d8a0e0a078bcb546453d0c1dcf02d76716b331..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30260 zcmeI5OKcri8Gvt`cO5rPlafdCICj$dnmFSYD6|ePky?-lZE%~`^g#u;_PD;mzSp_; z+9awf)Uttn7l4E+9*c?vARbaBP`3zHNZl79gxJ6agv0_-{_o8B$G!|?(i=~=9&P`*Ht_4IlfOIk_SGL=_|89`JMoL@FJFKCSMOf@`oI75 z&5?_*z18^pziPGGv*OM;*PM6t;rZr`-byDObKSJFns$=e#dbHXk6n~o&WXE2+zxS< z#37fAt6h2L^51rGb*T2G-;0L~WS;-arQ7uQJrSRjo{0YYtbr@R`+Vo>V*9H}SN;h12VV6kxqqiP6|g#S9&bdc zYWbjiLHQGl@{DBULS~>j?>xx*XfWSNH|oy2R%0n0ck?T)*hQ%#dc%vGg-4*?=wjOJMNYnonBWAQ(_Q7 zgqBz?jk!)Ljd9Cix&8#rFmiu(U$FLMzTNqBV|JmQn|gX(IQ#Um=<)nsNOh>aHG@&yp*R;!5hxhF|yKT9kFa zPviFeFg@*m+cUh!8b{7`n)qw**Bazd_$`j#hY4>tzEZh2T@3#uBa;ya1F zovr@T+A0Q(`Vm^t-If(>_Hrc%+=j&+;W*Z-XrY2QiMt)Ew=63njEI{S2dmRq*5-9& zFgT#?6Q=^uM4Zn$LR7Vs^qp!_{LLE2-*|{SveCx{xe@gvKpX^Os4W9A2r)=ef!>fF zL}IFmlD?C8YIeCD$T{1c`HwZb19DN-53!Ss6_XcJ>20KIU5)jl3Xtg-Q-U5RX~b3z zZB!M8eToo!(y&GN-j)cndNZ5bS>L_PJ1SV zEWv_>s(>tFQf*ZA^Eyisx?P;Fzr+WV56fKVj($r!C>I|KH^_WyW@R!OS?Kkali5z% z=%rWvtZFu&dRA{q7MtB(+Ny_1xaBs3Heavm;9(tH$pP@><|Vd_s)>?*5!eG3Hcy1A zpO$gw+At3?Tvj3N+)N`WRZB^~2&vmFDK(tWNru?%Aafs?VKNr%c8o{YrO8P~>9qR{2UHF(d4=&V`U^!|E0kXXH zi&wO5~F!0R|ObWcuc`#RMXa#LU{B`DSab*^`jW(j?uRty!I&nQL~Euu`Lbh0auP#~*Pkb@C);%|oFr8ixx9D6fgHq%Ichlm& z)M>9Q`xWipLh@px>sPo#tZ_FgDUJHo=7))}(CEq@k%hb<9a+3@%4B`W#OwtMzhK<& z5y}cEdx((6+}u+XEX$Z*XtolC&4H9sm$xOj+peARARiZ}!b7f_jU52hN?AYGq}8f~ z3q9Dj{sGGgacm4kKo*+`uZs8KPZ3Nbw*Eo&;CO`0LlXfK-)-ic2-ov@i`YbXos|ER zYcgn7Q(D!4G!bX}5rN}zaZLTiCgPTx2vi#$ZXRaaGNW0}d5I6VYNDiHZT4$@Hrbr6{LWPLWjy>#eBN>-L-6@MP+{|Gs23r`HV+l(kxwM18mZ!2Vp`pi zo+b9AC8moDYH$P2d1KS_*4RMhNG%8$$q>VgbtOuuB6f*qGh>_C3f*10OWeQU)|D~! z^DkV~4HmE(HpO!i&PT4XqBNQ*6D-2+8P9HK)*V6hK)xc5igI7p&IRM+DjgP#Qd>GF z!4Zyw0FxBF#YcdumXf{&X!{ek-n?dwPrLWik|6;7d=?N3O)rJE5Qb+>iQ${iQ$(gl zGi8EBn101FWvU3S%JiTbrSr3hlYttP&Y1#15KHtcf{~ihOqpO2YD<<{za`$S)YKAX zR#>NX13`%0V+sdNlJT=zk)Y8`ncyuGq{?F;r*?N(2|6V==>j=O-D?U3MWTC&}=n)w@>p@t2sL3U9lfCuy_ z(Sq<0rysD+7Uj%%|f(N>)AMi&M{92`(zi$Dmx+xeKnFWX=exsDq!6N8-79Fa0 z;+_x(x?Q02)~Qo7)WbUL02a%?DuAQ|ZpcBg77=@)_bvV}J+8PR)rQXKGx^^N#^ z+!0>D*RR~@*D&DrVR0%jg=6frsz$2#ML2$KD~=;MM>b7dNpJM@OA7rU0e9Y%6{tFH zjFWIiF{OeqiHo zr^JCyF@fa*$3Z{_ChFd3VJM-B6v6Zji%AFTPfM=W!t^}&6dkA%j)Q;^#D1_JElkx? z(l3JUb&C$w(}86CXwh+=Q2|I59jGQa4gyB*A=7AeD4~iJLH8|-P6usYAlEPk2g!Y= z6yO4HT>mplDIF|==-V41dPcIux@7W&4YlD5QDNF8`!G}h2(bH20f7m?I1)EXDIF{V z@Vi?9lr7d901O~?As1#JF=d1&#_A zh5?$a!K)oAMnBVHXETeLE|@<`CP8=vB6ihARX^9HBm{O9uzL~g-}`@H2lK~58Sr=n z==ctC5Um|8RFERrf8eq2%C>Fjs9u{~S-&vW&X${C=G{bIRGIIseP0-G5166?l_eIx zdJ;hz&6Eii0r{r2U)pL^uORb9<9x}{O)AUKd4kx-P2r$PGCuD}&}gPiusFfpnJMa0 zq7wA4pGoU0;(Ng2Pj0@P2)s|2asrkukE9ywRg_RgiopD_HOD(7w?pEdCD(QPPdQ_! z4uHg+VApXe@E+ti2w+JO7h$4=Dw1nb5+QtNNNiQZ(l^Rr?%5cf>`Pt$oo{I}^TlCU zO@1`EmV*q?0#kq5%VGvg4rGGXE%B?Z7j$exuH=6*F|v;i9dD(F8^l zQ;k&dOCx$taxG+H@VaD*2+Mp{CYqShOqpO2et+~PHn`TpsruokW@b%{)0f22t0aTi zt3(M^qzIdzIP|+3sKInX!SElddI|DHIQLG8!9Ns31isX8&Yl?|O>liLuq4 zo0zzT(ZNwu*y9pDCXSgHFA=9|qNLB>YZV)w(UUUEa>jN~P(4#IkBH+vjrg^eTmD*0 zsHgIWShPspgjQK!V|^gjQz)T|uxfsLNC2(+i9PXouzgq_?1T2f)(Ds72I{HNExzcf ZyQb^%g*QKKOb+BmWX&o2c>P~~^j~kcCXoOD diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js deleted file mode 100644 index 66ad259..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +++ /dev/null @@ -1,89 +0,0 @@ -var hashish = require('hashish'); -var fs = require('fs'); -var findit = require('findit'); -var path = require('path'); -var http = require('http'); -var net = require('net'); -var assert = require('assert'); - -var common = require('../common'); -var formidable = common.formidable; - -var server = http.createServer(); -server.listen(common.port, findFixtures); - -function findFixtures() { - var fixtures = []; - findit - .sync(common.dir.fixture + '/js') - .forEach(function(jsPath) { - if (!/\.js$/.test(jsPath)) return; - - var group = path.basename(jsPath, '.js'); - hashish.forEach(require(jsPath), function(fixture, name) { - fixtures.push({ - name : group + '/' + name, - fixture : fixture, - }); - }); - }); - - testNext(fixtures); -} - -function testNext(fixtures) { - var fixture = fixtures.shift(); - if (!fixture) return server.close(); - - var name = fixture.name; - var fixture = fixture.fixture; - - uploadFixture(name, function(err, parts) { - if (err) throw err; - - fixture.forEach(function(expectedPart, i) { - var parsedPart = parts[i]; - assert.equal(parsedPart.type, expectedPart.type); - assert.equal(parsedPart.name, expectedPart.name); - - if (parsedPart.type === 'file') { - var filename = parsedPart.value.name; - assert.equal(filename, expectedPart.filename); - } - }); - - testNext(fixtures); - }); -}; - -function uploadFixture(name, cb) { - server.once('request', function(req, res) { - var form = new formidable.IncomingForm(); - form.uploadDir = common.dir.tmp; - form.parse(req); - - function callback() { - var realCallback = cb; - cb = function() {}; - realCallback.apply(null, arguments); - } - - var parts = []; - form - .on('error', callback) - .on('fileBegin', function(name, value) { - parts.push({type: 'file', name: name, value: value}); - }) - .on('field', function(name, value) { - parts.push({type: 'field', name: name, value: value}); - }) - .on('end', function() { - callback(null, parts); - }); - }); - - var socket = net.createConnection(common.port); - var file = fs.createReadStream(common.dir.fixture + '/http/' + name); - - file.pipe(socket); -} diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js deleted file mode 100644 index 2b98598..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +++ /dev/null @@ -1,24 +0,0 @@ -var path = require('path'), - fs = require('fs'); - -try { - global.Gently = require('gently'); -} catch (e) { - throw new Error('this test suite requires node-gently'); -} - -exports.lib = path.join(__dirname, '../../lib'); - -global.GENTLY = new Gently(); - -global.assert = require('assert'); -global.TEST_PORT = 13532; -global.TEST_FIXTURES = path.join(__dirname, '../fixture'); -global.TEST_TMP = path.join(__dirname, '../tmp'); - -// Stupid new feature in node that complains about gently attaching too many -// listeners to process 'exit'. This is a workaround until I can think of a -// better way to deal with this. -if (process.setMaxListeners) { - process.setMaxListeners(10000); -} diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js deleted file mode 100644 index 75232aa..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +++ /dev/null @@ -1,80 +0,0 @@ -var common = require('../common'); -var CHUNK_LENGTH = 10, - multipartParser = require(common.lib + '/multipart_parser'), - MultipartParser = multipartParser.MultipartParser, - parser = new MultipartParser(), - fixtures = require(TEST_FIXTURES + '/multipart'), - Buffer = require('buffer').Buffer; - -Object.keys(fixtures).forEach(function(name) { - var fixture = fixtures[name], - buffer = new Buffer(Buffer.byteLength(fixture.raw, 'binary')), - offset = 0, - chunk, - nparsed, - - parts = [], - part = null, - headerField, - headerValue, - endCalled = ''; - - parser.initWithBoundary(fixture.boundary); - parser.onPartBegin = function() { - part = {headers: {}, data: ''}; - parts.push(part); - headerField = ''; - headerValue = ''; - }; - - parser.onHeaderField = function(b, start, end) { - headerField += b.toString('ascii', start, end); - }; - - parser.onHeaderValue = function(b, start, end) { - headerValue += b.toString('ascii', start, end); - } - - parser.onHeaderEnd = function() { - part.headers[headerField] = headerValue; - headerField = ''; - headerValue = ''; - }; - - parser.onPartData = function(b, start, end) { - var str = b.toString('ascii', start, end); - part.data += b.slice(start, end); - } - - parser.onEnd = function() { - endCalled = true; - } - - buffer.write(fixture.raw, 'binary', 0); - - while (offset < buffer.length) { - if (offset + CHUNK_LENGTH < buffer.length) { - chunk = buffer.slice(offset, offset+CHUNK_LENGTH); - } else { - chunk = buffer.slice(offset, buffer.length); - } - offset = offset + CHUNK_LENGTH; - - nparsed = parser.write(chunk); - if (nparsed != chunk.length) { - if (fixture.expectError) { - return; - } - puts('-- ERROR --'); - p(chunk.toString('ascii')); - throw new Error(chunk.length+' bytes written, but only '+nparsed+' bytes parsed!'); - } - } - - if (fixture.expectError) { - throw new Error('expected parse error did not happen'); - } - - assert.ok(endCalled); - assert.deepEqual(parts, fixture.parts); -}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js deleted file mode 100644 index 52ceedb..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +++ /dev/null @@ -1,104 +0,0 @@ -var common = require('../common'); -var WriteStreamStub = GENTLY.stub('fs', 'WriteStream'); - -var File = require(common.lib + '/file'), - EventEmitter = require('events').EventEmitter, - file, - gently; - -function test(test) { - gently = new Gently(); - file = new File(); - test(); - gently.verify(test.name); -} - -test(function constructor() { - assert.ok(file instanceof EventEmitter); - assert.strictEqual(file.size, 0); - assert.strictEqual(file.path, null); - assert.strictEqual(file.name, null); - assert.strictEqual(file.type, null); - assert.strictEqual(file.lastModifiedDate, null); - - assert.strictEqual(file._writeStream, null); - - (function testSetProperties() { - var file2 = new File({foo: 'bar'}); - assert.equal(file2.foo, 'bar'); - })(); -}); - -test(function open() { - var WRITE_STREAM; - file.path = '/foo'; - - gently.expect(WriteStreamStub, 'new', function (path) { - WRITE_STREAM = this; - assert.strictEqual(path, file.path); - }); - - file.open(); - assert.strictEqual(file._writeStream, WRITE_STREAM); -}); - -test(function write() { - var BUFFER = {length: 10}, - CB_STUB, - CB = function() { - CB_STUB.apply(this, arguments); - }; - - file._writeStream = {}; - - gently.expect(file._writeStream, 'write', function (buffer, cb) { - assert.strictEqual(buffer, BUFFER); - - gently.expect(file, 'emit', function (event, bytesWritten) { - assert.ok(file.lastModifiedDate instanceof Date); - assert.equal(event, 'progress'); - assert.equal(bytesWritten, file.size); - }); - - CB_STUB = gently.expect(function writeCb() { - assert.equal(file.size, 10); - }); - - cb(); - - gently.expect(file, 'emit', function (event, bytesWritten) { - assert.equal(event, 'progress'); - assert.equal(bytesWritten, file.size); - }); - - CB_STUB = gently.expect(function writeCb() { - assert.equal(file.size, 20); - }); - - cb(); - }); - - file.write(BUFFER, CB); -}); - -test(function end() { - var CB_STUB, - CB = function() { - CB_STUB.apply(this, arguments); - }; - - file._writeStream = {}; - - gently.expect(file._writeStream, 'end', function (cb) { - gently.expect(file, 'emit', function (event) { - assert.equal(event, 'end'); - }); - - CB_STUB = gently.expect(function endCb() { - }); - - cb(); - }); - - file.end(CB); -}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js deleted file mode 100644 index b64df8b..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +++ /dev/null @@ -1,726 +0,0 @@ -var common = require('../common'); -var MultipartParserStub = GENTLY.stub('./multipart_parser', 'MultipartParser'), - QuerystringParserStub = GENTLY.stub('./querystring_parser', 'QuerystringParser'), - EventEmitterStub = GENTLY.stub('events', 'EventEmitter'), - FileStub = GENTLY.stub('./file'); - -var formidable = require(common.lib + '/index'), - IncomingForm = formidable.IncomingForm, - events = require('events'), - fs = require('fs'), - path = require('path'), - Buffer = require('buffer').Buffer, - fixtures = require(TEST_FIXTURES + '/multipart'), - form, - gently; - -function test(test) { - gently = new Gently(); - gently.expect(EventEmitterStub, 'call'); - form = new IncomingForm(); - test(); - gently.verify(test.name); -} - -test(function constructor() { - assert.strictEqual(form.error, null); - assert.strictEqual(form.ended, false); - assert.strictEqual(form.type, null); - assert.strictEqual(form.headers, null); - assert.strictEqual(form.keepExtensions, false); - assert.strictEqual(form.uploadDir, '/tmp'); - assert.strictEqual(form.encoding, 'utf-8'); - assert.strictEqual(form.bytesReceived, null); - assert.strictEqual(form.bytesExpected, null); - assert.strictEqual(form.maxFieldsSize, 2 * 1024 * 1024); - assert.strictEqual(form._parser, null); - assert.strictEqual(form._flushing, 0); - assert.strictEqual(form._fieldsSize, 0); - assert.ok(form instanceof EventEmitterStub); - assert.equal(form.constructor.name, 'IncomingForm'); - - (function testSimpleConstructor() { - gently.expect(EventEmitterStub, 'call'); - var form = IncomingForm(); - assert.ok(form instanceof IncomingForm); - })(); - - (function testSimpleConstructorShortcut() { - gently.expect(EventEmitterStub, 'call'); - var form = formidable(); - assert.ok(form instanceof IncomingForm); - })(); -}); - -test(function parse() { - var REQ = {headers: {}} - , emit = {}; - - gently.expect(form, 'writeHeaders', function(headers) { - assert.strictEqual(headers, REQ.headers); - }); - - var events = ['error', 'aborted', 'data', 'end']; - gently.expect(REQ, 'on', events.length, function(event, fn) { - assert.equal(event, events.shift()); - emit[event] = fn; - return this; - }); - - form.parse(REQ); - - (function testPause() { - gently.expect(REQ, 'pause'); - assert.strictEqual(form.pause(), true); - })(); - - (function testPauseCriticalException() { - form.ended = false; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'pause', function() { - throw ERR; - }); - - gently.expect(form, '_error', function(err) { - assert.strictEqual(err, ERR); - }); - - assert.strictEqual(form.pause(), false); - })(); - - (function testPauseHarmlessException() { - form.ended = true; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'pause', function() { - throw ERR; - }); - - assert.strictEqual(form.pause(), false); - })(); - - (function testResume() { - gently.expect(REQ, 'resume'); - assert.strictEqual(form.resume(), true); - })(); - - (function testResumeCriticalException() { - form.ended = false; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'resume', function() { - throw ERR; - }); - - gently.expect(form, '_error', function(err) { - assert.strictEqual(err, ERR); - }); - - assert.strictEqual(form.resume(), false); - })(); - - (function testResumeHarmlessException() { - form.ended = true; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'resume', function() { - throw ERR; - }); - - assert.strictEqual(form.resume(), false); - })(); - - (function testEmitError() { - var ERR = new Error('something bad happened'); - gently.expect(form, '_error',function(err) { - assert.strictEqual(err, ERR); - }); - emit.error(ERR); - })(); - - (function testEmitAborted() { - gently.expect(form, 'emit',function(event) { - assert.equal(event, 'aborted'); - }); - - emit.aborted(); - })(); - - - (function testEmitData() { - var BUFFER = [1, 2, 3]; - gently.expect(form, 'write', function(buffer) { - assert.strictEqual(buffer, BUFFER); - }); - emit.data(BUFFER); - })(); - - (function testEmitEnd() { - form._parser = {}; - - (function testWithError() { - var ERR = new Error('haha'); - gently.expect(form._parser, 'end', function() { - return ERR; - }); - - gently.expect(form, '_error', function(err) { - assert.strictEqual(err, ERR); - }); - - emit.end(); - })(); - - (function testWithoutError() { - gently.expect(form._parser, 'end'); - emit.end(); - })(); - - (function testAfterError() { - form.error = true; - emit.end(); - })(); - })(); - - (function testWithCallback() { - gently.expect(EventEmitterStub, 'call'); - var form = new IncomingForm(), - REQ = {headers: {}}, - parseCalled = 0; - - gently.expect(form, 'writeHeaders'); - gently.expect(REQ, 'on', 4, function() { - return this; - }); - - gently.expect(form, 'on', 4, function(event, fn) { - if (event == 'field') { - fn('field1', 'foo'); - fn('field1', 'bar'); - fn('field2', 'nice'); - } - - if (event == 'file') { - fn('file1', '1'); - fn('file1', '2'); - fn('file2', '3'); - } - - if (event == 'end') { - fn(); - } - return this; - }); - - form.parse(REQ, gently.expect(function parseCbOk(err, fields, files) { - assert.deepEqual(fields, {field1: 'bar', field2: 'nice'}); - assert.deepEqual(files, {file1: '2', file2: '3'}); - })); - - gently.expect(form, 'writeHeaders'); - gently.expect(REQ, 'on', 4, function() { - return this; - }); - - var ERR = new Error('test'); - gently.expect(form, 'on', 3, function(event, fn) { - if (event == 'field') { - fn('foo', 'bar'); - } - - if (event == 'error') { - fn(ERR); - gently.expect(form, 'on'); - } - return this; - }); - - form.parse(REQ, gently.expect(function parseCbErr(err, fields, files) { - assert.strictEqual(err, ERR); - assert.deepEqual(fields, {foo: 'bar'}); - })); - })(); -}); - -test(function pause() { - assert.strictEqual(form.pause(), false); -}); - -test(function resume() { - assert.strictEqual(form.resume(), false); -}); - - -test(function writeHeaders() { - var HEADERS = {}; - gently.expect(form, '_parseContentLength'); - gently.expect(form, '_parseContentType'); - - form.writeHeaders(HEADERS); - assert.strictEqual(form.headers, HEADERS); -}); - -test(function write() { - var parser = {}, - BUFFER = [1, 2, 3]; - - form._parser = parser; - form.bytesExpected = 523423; - - (function testBasic() { - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, BUFFER.length); - assert.equal(bytesExpected, form.bytesExpected); - }); - - gently.expect(parser, 'write', function(buffer) { - assert.strictEqual(buffer, BUFFER); - return buffer.length; - }); - - assert.equal(form.write(BUFFER), BUFFER.length); - assert.equal(form.bytesReceived, BUFFER.length); - })(); - - (function testParserError() { - gently.expect(form, 'emit'); - - gently.expect(parser, 'write', function(buffer) { - assert.strictEqual(buffer, BUFFER); - return buffer.length - 1; - }); - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/parser error/i)); - }); - - assert.equal(form.write(BUFFER), BUFFER.length - 1); - assert.equal(form.bytesReceived, BUFFER.length + BUFFER.length); - })(); - - (function testUninitialized() { - delete form._parser; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/unintialized parser/i)); - }); - form.write(BUFFER); - })(); -}); - -test(function parseContentType() { - var HEADERS = {}; - - form.headers = {'content-type': 'application/x-www-form-urlencoded'}; - gently.expect(form, '_initUrlencoded'); - form._parseContentType(); - - // accept anything that has 'urlencoded' in it - form.headers = {'content-type': 'broken-client/urlencoded-stupid'}; - gently.expect(form, '_initUrlencoded'); - form._parseContentType(); - - var BOUNDARY = '---------------------------57814261102167618332366269'; - form.headers = {'content-type': 'multipart/form-data; boundary='+BOUNDARY}; - - gently.expect(form, '_initMultipart', function(boundary) { - assert.equal(boundary, BOUNDARY); - }); - form._parseContentType(); - - (function testQuotedBoundary() { - form.headers = {'content-type': 'multipart/form-data; boundary="' + BOUNDARY + '"'}; - - gently.expect(form, '_initMultipart', function(boundary) { - assert.equal(boundary, BOUNDARY); - }); - form._parseContentType(); - })(); - - (function testNoBoundary() { - form.headers = {'content-type': 'multipart/form-data'}; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/no multipart boundary/i)); - }); - form._parseContentType(); - })(); - - (function testNoContentType() { - form.headers = {}; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/no content-type/i)); - }); - form._parseContentType(); - })(); - - (function testUnknownContentType() { - form.headers = {'content-type': 'invalid'}; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/unknown content-type/i)); - }); - form._parseContentType(); - })(); -}); - -test(function parseContentLength() { - var HEADERS = {}; - - form.headers = {}; - form._parseContentLength(); - assert.strictEqual(form.bytesReceived, null); - assert.strictEqual(form.bytesExpected, null); - - form.headers['content-length'] = '8'; - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, 0); - assert.equal(bytesExpected, 8); - }); - form._parseContentLength(); - assert.strictEqual(form.bytesReceived, 0); - assert.strictEqual(form.bytesExpected, 8); - - // JS can be evil, lets make sure we are not - form.headers['content-length'] = '08'; - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, 0); - assert.equal(bytesExpected, 8); - }); - form._parseContentLength(); - assert.strictEqual(form.bytesExpected, 8); -}); - -test(function _initMultipart() { - var BOUNDARY = '123', - PARSER; - - gently.expect(MultipartParserStub, 'new', function() { - PARSER = this; - }); - - gently.expect(MultipartParserStub.prototype, 'initWithBoundary', function(boundary) { - assert.equal(boundary, BOUNDARY); - }); - - form._initMultipart(BOUNDARY); - assert.equal(form.type, 'multipart'); - assert.strictEqual(form._parser, PARSER); - - (function testRegularField() { - var PART; - gently.expect(EventEmitterStub, 'new', function() { - PART = this; - }); - - gently.expect(form, 'onPart', function(part) { - assert.strictEqual(part, PART); - assert.deepEqual - ( part.headers - , { 'content-disposition': 'form-data; name="field1"' - , 'foo': 'bar' - } - ); - assert.equal(part.name, 'field1'); - - var strings = ['hello', ' world']; - gently.expect(part, 'emit', 2, function(event, b) { - assert.equal(event, 'data'); - assert.equal(b.toString(), strings.shift()); - }); - - gently.expect(part, 'emit', function(event, b) { - assert.equal(event, 'end'); - }); - }); - - PARSER.onPartBegin(); - PARSER.onHeaderField(new Buffer('content-disposition'), 0, 10); - PARSER.onHeaderField(new Buffer('content-disposition'), 10, 19); - PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 0, 14); - PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 14, 24); - PARSER.onHeaderEnd(); - PARSER.onHeaderField(new Buffer('foo'), 0, 3); - PARSER.onHeaderValue(new Buffer('bar'), 0, 3); - PARSER.onHeaderEnd(); - PARSER.onHeadersEnd(); - PARSER.onPartData(new Buffer('hello world'), 0, 5); - PARSER.onPartData(new Buffer('hello world'), 5, 11); - PARSER.onPartEnd(); - })(); - - (function testFileField() { - var PART; - gently.expect(EventEmitterStub, 'new', function() { - PART = this; - }); - - gently.expect(form, 'onPart', function(part) { - assert.deepEqual - ( part.headers - , { 'content-disposition': 'form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"' - , 'content-type': 'text/plain' - } - ); - assert.equal(part.name, 'field2'); - assert.equal(part.filename, 'Sun"et.jpg'); - assert.equal(part.mime, 'text/plain'); - - gently.expect(part, 'emit', function(event, b) { - assert.equal(event, 'data'); - assert.equal(b.toString(), '... contents of file1.txt ...'); - }); - - gently.expect(part, 'emit', function(event, b) { - assert.equal(event, 'end'); - }); - }); - - PARSER.onPartBegin(); - PARSER.onHeaderField(new Buffer('content-disposition'), 0, 19); - PARSER.onHeaderValue(new Buffer('form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"'), 0, 85); - PARSER.onHeaderEnd(); - PARSER.onHeaderField(new Buffer('Content-Type'), 0, 12); - PARSER.onHeaderValue(new Buffer('text/plain'), 0, 10); - PARSER.onHeaderEnd(); - PARSER.onHeadersEnd(); - PARSER.onPartData(new Buffer('... contents of file1.txt ...'), 0, 29); - PARSER.onPartEnd(); - })(); - - (function testEnd() { - gently.expect(form, '_maybeEnd'); - PARSER.onEnd(); - assert.ok(form.ended); - })(); -}); - -test(function _fileName() { - // TODO - return; -}); - -test(function _initUrlencoded() { - var PARSER; - - gently.expect(QuerystringParserStub, 'new', function() { - PARSER = this; - }); - - form._initUrlencoded(); - assert.equal(form.type, 'urlencoded'); - assert.strictEqual(form._parser, PARSER); - - (function testOnField() { - var KEY = 'KEY', VAL = 'VAL'; - gently.expect(form, 'emit', function(field, key, val) { - assert.equal(field, 'field'); - assert.equal(key, KEY); - assert.equal(val, VAL); - }); - - PARSER.onField(KEY, VAL); - })(); - - (function testOnEnd() { - gently.expect(form, '_maybeEnd'); - - PARSER.onEnd(); - assert.equal(form.ended, true); - })(); -}); - -test(function _error() { - var ERR = new Error('bla'); - - gently.expect(form, 'pause'); - gently.expect(form, 'emit', function(event, err) { - assert.equal(event, 'error'); - assert.strictEqual(err, ERR); - }); - - form._error(ERR); - assert.strictEqual(form.error, ERR); - - // make sure _error only does its thing once - form._error(ERR); -}); - -test(function onPart() { - var PART = {}; - gently.expect(form, 'handlePart', function(part) { - assert.strictEqual(part, PART); - }); - - form.onPart(PART); -}); - -test(function handlePart() { - (function testUtf8Field() { - var PART = new events.EventEmitter(); - PART.name = 'my_field'; - - gently.expect(form, 'emit', function(event, field, value) { - assert.equal(event, 'field'); - assert.equal(field, 'my_field'); - assert.equal(value, 'hello world: €'); - }); - - form.handlePart(PART); - PART.emit('data', new Buffer('hello')); - PART.emit('data', new Buffer(' world: ')); - PART.emit('data', new Buffer([0xE2])); - PART.emit('data', new Buffer([0x82, 0xAC])); - PART.emit('end'); - })(); - - (function testBinaryField() { - var PART = new events.EventEmitter(); - PART.name = 'my_field2'; - - gently.expect(form, 'emit', function(event, field, value) { - assert.equal(event, 'field'); - assert.equal(field, 'my_field2'); - assert.equal(value, 'hello world: '+new Buffer([0xE2, 0x82, 0xAC]).toString('binary')); - }); - - form.encoding = 'binary'; - form.handlePart(PART); - PART.emit('data', new Buffer('hello')); - PART.emit('data', new Buffer(' world: ')); - PART.emit('data', new Buffer([0xE2])); - PART.emit('data', new Buffer([0x82, 0xAC])); - PART.emit('end'); - })(); - - (function testFieldSize() { - form.maxFieldsSize = 8; - var PART = new events.EventEmitter(); - PART.name = 'my_field'; - - gently.expect(form, '_error', function(err) { - assert.equal(err.message, 'maxFieldsSize exceeded, received 9 bytes of field data'); - }); - - form.handlePart(PART); - form._fieldsSize = 1; - PART.emit('data', new Buffer(7)); - PART.emit('data', new Buffer(1)); - })(); - - (function testFilePart() { - var PART = new events.EventEmitter(), - FILE = new events.EventEmitter(), - PATH = '/foo/bar'; - - PART.name = 'my_file'; - PART.filename = 'sweet.txt'; - PART.mime = 'sweet.txt'; - - gently.expect(form, '_uploadPath', function(filename) { - assert.equal(filename, PART.filename); - return PATH; - }); - - gently.expect(FileStub, 'new', function(properties) { - assert.equal(properties.path, PATH); - assert.equal(properties.name, PART.filename); - assert.equal(properties.type, PART.mime); - FILE = this; - - gently.expect(form, 'emit', function (event, field, file) { - assert.equal(event, 'fileBegin'); - assert.strictEqual(field, PART.name); - assert.strictEqual(file, FILE); - }); - - gently.expect(FILE, 'open'); - }); - - form.handlePart(PART); - assert.equal(form._flushing, 1); - - var BUFFER; - gently.expect(form, 'pause'); - gently.expect(FILE, 'write', function(buffer, cb) { - assert.strictEqual(buffer, BUFFER); - gently.expect(form, 'resume'); - // @todo handle cb(new Err) - cb(); - }); - - PART.emit('data', BUFFER = new Buffer('test')); - - gently.expect(FILE, 'end', function(cb) { - gently.expect(form, 'emit', function(event, field, file) { - assert.equal(event, 'file'); - assert.strictEqual(file, FILE); - }); - - gently.expect(form, '_maybeEnd'); - - cb(); - assert.equal(form._flushing, 0); - }); - - PART.emit('end'); - })(); -}); - -test(function _uploadPath() { - (function testUniqueId() { - var UUID_A, UUID_B; - gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) { - assert.equal(uploadDir, form.uploadDir); - UUID_A = uuid; - }); - form._uploadPath(); - - gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) { - UUID_B = uuid; - }); - form._uploadPath(); - - assert.notEqual(UUID_A, UUID_B); - })(); - - (function testFileExtension() { - form.keepExtensions = true; - var FILENAME = 'foo.jpg', - EXT = '.bar'; - - gently.expect(GENTLY.hijacked.path, 'extname', function(filename) { - assert.equal(filename, FILENAME); - gently.restore(path, 'extname'); - - return EXT; - }); - - gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, name) { - assert.equal(path.extname(name), EXT); - }); - form._uploadPath(FILENAME); - })(); -}); - -test(function _maybeEnd() { - gently.expect(form, 'emit', 0); - form._maybeEnd(); - - form.ended = true; - form._flushing = 1; - form._maybeEnd(); - - gently.expect(form, 'emit', function(event) { - assert.equal(event, 'end'); - }); - - form.ended = true; - form._flushing = 0; - form._maybeEnd(); -}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js deleted file mode 100644 index d8dc968..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +++ /dev/null @@ -1,50 +0,0 @@ -var common = require('../common'); -var multipartParser = require(common.lib + '/multipart_parser'), - MultipartParser = multipartParser.MultipartParser, - events = require('events'), - Buffer = require('buffer').Buffer, - parser; - -function test(test) { - parser = new MultipartParser(); - test(); -} - -test(function constructor() { - assert.equal(parser.boundary, null); - assert.equal(parser.state, 0); - assert.equal(parser.flags, 0); - assert.equal(parser.boundaryChars, null); - assert.equal(parser.index, null); - assert.equal(parser.lookbehind, null); - assert.equal(parser.constructor.name, 'MultipartParser'); -}); - -test(function initWithBoundary() { - var boundary = 'abc'; - parser.initWithBoundary(boundary); - assert.deepEqual(Array.prototype.slice.call(parser.boundary), [13, 10, 45, 45, 97, 98, 99]); - assert.equal(parser.state, multipartParser.START); - - assert.deepEqual(parser.boundaryChars, {10: true, 13: true, 45: true, 97: true, 98: true, 99: true}); -}); - -test(function parserError() { - var boundary = 'abc', - buffer = new Buffer(5); - - parser.initWithBoundary(boundary); - buffer.write('--ad', 'ascii', 0); - assert.equal(parser.write(buffer), 3); -}); - -test(function end() { - (function testError() { - assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly: ' + parser.explain()); - })(); - - (function testRegular() { - parser.state = multipartParser.END; - assert.strictEqual(parser.end(), undefined); - })(); -}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js deleted file mode 100644 index 54d3e2d..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +++ /dev/null @@ -1,45 +0,0 @@ -var common = require('../common'); -var QuerystringParser = require(common.lib + '/querystring_parser').QuerystringParser, - Buffer = require('buffer').Buffer, - gently, - parser; - -function test(test) { - gently = new Gently(); - parser = new QuerystringParser(); - test(); - gently.verify(test.name); -} - -test(function constructor() { - assert.equal(parser.buffer, ''); - assert.equal(parser.constructor.name, 'QuerystringParser'); -}); - -test(function write() { - var a = new Buffer('a=1'); - assert.equal(parser.write(a), a.length); - - var b = new Buffer('&b=2'); - parser.write(b); - assert.equal(parser.buffer, a + b); -}); - -test(function end() { - var FIELDS = {a: ['b', {c: 'd'}], e: 'f'}; - - gently.expect(GENTLY.hijacked.querystring, 'parse', function(str) { - assert.equal(str, parser.buffer); - return FIELDS; - }); - - gently.expect(parser, 'onField', Object.keys(FIELDS).length, function(key, val) { - assert.deepEqual(FIELDS[key], val); - }); - - gently.expect(parser, 'onEnd'); - - parser.buffer = 'my buffer'; - parser.end(); - assert.equal(parser.buffer, ''); -}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js deleted file mode 100644 index fcfdb94..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +++ /dev/null @@ -1,72 +0,0 @@ -var common = require('../common'); -var BOUNDARY = '---------------------------10102754414578508781458777923', - FIXTURE = TEST_FIXTURES+'/multi_video.upload', - fs = require('fs'), - util = require(common.lib + '/util'), - http = require('http'), - formidable = require(common.lib + '/index'), - server = http.createServer(); - -server.on('request', function(req, res) { - var form = new formidable.IncomingForm(), - uploads = {}; - - form.uploadDir = TEST_TMP; - form.parse(req); - - form - .on('fileBegin', function(field, file) { - assert.equal(field, 'upload'); - - var tracker = {file: file, progress: [], ended: false}; - uploads[file.filename] = tracker; - file - .on('progress', function(bytesReceived) { - tracker.progress.push(bytesReceived); - assert.equal(bytesReceived, file.length); - }) - .on('end', function() { - tracker.ended = true; - }); - }) - .on('field', function(field, value) { - assert.equal(field, 'title'); - assert.equal(value, ''); - }) - .on('file', function(field, file) { - assert.equal(field, 'upload'); - assert.strictEqual(uploads[file.filename].file, file); - }) - .on('end', function() { - assert.ok(uploads['shortest_video.flv']); - assert.ok(uploads['shortest_video.flv'].ended); - assert.ok(uploads['shortest_video.flv'].progress.length > 3); - assert.equal(uploads['shortest_video.flv'].progress.slice(-1), uploads['shortest_video.flv'].file.length); - assert.ok(uploads['shortest_video.mp4']); - assert.ok(uploads['shortest_video.mp4'].ended); - assert.ok(uploads['shortest_video.mp4'].progress.length > 3); - - server.close(); - res.writeHead(200); - res.end('good'); - }); -}); - -server.listen(TEST_PORT, function() { - var client = http.createClient(TEST_PORT), - stat = fs.statSync(FIXTURE), - headers = { - 'content-type': 'multipart/form-data; boundary='+BOUNDARY, - 'content-length': stat.size, - } - request = client.request('POST', '/', headers), - fixture = new fs.ReadStream(FIXTURE); - - fixture - .on('data', function(b) { - request.write(b); - }) - .on('end', function() { - request.end(); - }); -}); diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js deleted file mode 100755 index 50b2361..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('urun')(__dirname) diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/tmp/.empty b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/tmp/.empty deleted file mode 100644 index e69de29..0000000 diff --git a/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/.test-incoming-form.js.un~ b/usb_auth/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/.test-incoming-form.js.un~ deleted file mode 100644 index 4002e6d77c8c5034e28b755dd5e4df04a088bafc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 61302 zcmeI5+m9T_b%)oKD3O*(ij+jsA}KX5((GE~$Xeb+QWRGdO_RE;ZqeFFoKVBvUUIG7 zndQt5FJ@>-3ymHdnP>ijapoKy6j`bXWKOzB<*XtE*=wX6AnLjrOU|zYMK<|Ip|98@~E0-}?IB ze*3lWuRhUu|Ghu>z3+bZy&tc6_w$`~|9I}}LqkI+Bt4vowR*k0yU@%p^;@&U`PGHJ zS))1G9c_#plP!)&+A8T|lD;AdBiA%Ee)Hwyck=1>p>yBlQ?XS==Kk^#%lEMKV=-41 z3(5Wu6d1pG=8qkYp`jltw>#uG`y_#4&*fG(TgZD0+3{?$GdI_1H>X>@g_pap&vvf3 z;_%3^gYP($Y|p-GU}T-Mgi@8LnWN+<{JyBHZU;70-(`ng9HD3>a)ff1X7h<+rR?XMiaj@K;UCg- zO8F&5HPzG0h+m7kr5JSNt!HfI7N_c`m5M;m486w3xLJC~|T8IN`*9{s0FF)0pq z7{lMrw#B(-+80iDx^n}+E}d`2e|&CQK5vXP?dF9STVJHs755W6%4^&L)=`hQjo z4(W-hn;g?!y%i8^T=(NUeYRZ7R^9+x!b{*(mYR8~q*qmyzAVeGES>&eF7-GNj7kF2 zdLpvnM!PkaH}+=NJv6rXxFmcNqpI>y37XTS{vXsO7Q)mWC<6_Z<*xS3-&tsiV?Q4{ zZ(}pyum+5)vTV_M@M_lyJa_-gIx)bq&YePni6jw*nhKM$11PzL`S%tk*x2x(B+%WF zWjDOrvHD&~YEVn0RE^j?gw%H|DRmr3sWX9OojDV5f!y7=CTB9r)G4B_Iuqq8XZo&1 z#0K<^hb1kJLs;YDkVVnSA-4102Dgz!%bnom)@(o55g%A>pgM1G|9yceSbN2 z8(}xy?J$I}h#Q>llcYv%bhD}ZR7GO)5N_{VZW@cI&q)~RJ4e85H0J^|oGt~8MwHsc z5K#YYL2<3pu!F1Gojf}8s6eyHoC?@VA4`3qQKn8Y1l12LDm+K!2i02F7s_y{Uc2CP zzd04y=?-ZO(g;(l7|m-dBO=Z7xr}hs5jezR`b84UjU%G@DQEC^X z@ompCo=r&L(ax_ddYmzMv<$Kb%_)L2d7u#_su+#%jvM8ZUC3-UX9KlF$_Nrwj3%YG z(qP$QP6cFyEGb$vqSP*iVER`Zf^hFfwD_bXLXgc_*5InvIGR;l(168c9W_9*ce
    IVtEJ4-oRCMdZ2qdgi16PSGAyQdt<|{^o^gAUz%K<$i);+?qH*hs15iX`dKtzbK5JW$;Ui6q8 zZCKJNN!&3VE~Z88J~urxn~%%nsO-wj!bO>cexX0htn`bmZfkNO@AhQURK+b7G&4zR zkfwTP$pKY~nt2G_A6dFMmda0{zb)gzat2!_zR6f&W4hC6E?iw`aHSht@>UY#iOsSl z49~UR%FpDjsk}R^HH?hNYfD;1Id}zi{9Y}S!Y3sqA6G?U@{m^WKeiQ&$k85`bW##N zexTaN`|Z3p*_zL%vP=EW0<$7396Xc#cS%wMGj%&l4z5bn%u&)giR89?S=W!>JUe93 z;#DgDZ5({=+OAj!*D6W}hx%?wYP5)bl9Gd~A~CroZ_Bn7thTLSuN(>q|0Xi&~-Z~@m@LZnL6%u$lA660}&mM63j9?A9toC;i41J*?hgMvOvf73EDT)b~kJ zqeX0%lzLcIBqk4O1>0>a(5X_ig5`TyKLcr~?;Exw>w1b9i2gD#MKkoWqF{EDoPz+WF%*nw~cTPTRgsD{wVK=-SJM&rvWZcY1e0!A*_y?^MhkzX9S5VhOiq6j0_>;X8Zdyf?6UK zg~#k1O-egMusm%l1{s*r%rhfO?P3U~PcC&R1{%S@ZStAwnP=x)eo|@HYENaYsi_&h zTcS0a_4?=cU3625tM9C-_qZfA(3g(}(x`~aQZo<1z1QN#(^P&QqkX`WyaUB_wF0nA zHm{mMo;{v5j>$JybdK*j-|Fsi^U$AMeja*JpUgZjXQAsi%+NgCR2we{O^1QC)H`@V zqOy?Y(zMNmv2DgPiGt`In$^8SFQ1#4?96uB)qMaEPe@V&u#S?Z(KS`2ZXN>lQx+=z zr1CSIUfBm6i=UBNR8c<7hx(W#HChCtdC9d^k(fNB6&$p!K!>~;L%_B7SG#t9Vfv}T zOJmjk4asNC$&X3798FKxc%w|6VhGu%ELogN<;TBwR?RtoZ1<7F`=1vJfUTo zYjC0p(P7!(|Kr^h&EwOO)Mz?8C2_7P@J56f3u!K6wz*_-v|W;DF3WetfI2Nn4TylF zPe|YpA;v<$owVSPevc%;={P1xKEtv%Z~@m@>WWo~nmI~p_q*GaZCCtU6(XJju;WK` zQw#MolGJDsk4Z{BtSS3YPC-0d-cA8V~`Ou_C!IDnwWaxYHIK z((^tR;IxMY$@46G0~c_eB}A%3%^W4QhvkhpE!!UUGgXL=`Hgpew8IL}e?gKOErZv@ zoTb*FO4Q6lTEiLJ8gN#XpPp8o7A!Ba>3*N*~$<`r`~U{haAv5OI=Rxt$C*^sUfEU!u$_oo4}@|C;P6?#?bW+9kf zb(mHaKd;BM2bF)VKWg>VKlzYJwjb6u-fO}Cy04RrromOwjo+r`fFuzX(i~c@Ijk<4 z13?RS=`;(2&;-ay8-X*fm|iOEAS z{knB1q^CbqhjKrL>VD>1KXDT?{S^>cKV{AjkU+kZb;-w2A;Lo7{l-#w*2mUxqrf+; zdtBi8X>&rLOTK0Vi7M8@74B=m`n)+oKqg-^f`Xb?w>h$YZv#pz|)H&NTyi!1}-XF!*cR3RERJh=qVz~Rfzt|`WFt#hP<(cf63Pu zEPvn8n4W3p%`ePfIKlT9$k!JP!dFn{lGMQL2Hsea(5fso^ANP(v}jk$f$oxYhy%J2 zQ()*CU@u-v6HqS&-89SIz)F1%XF{p6)XYmIy{a(52wh!SLf5~xD3^lU&d31COt_fq zO!a5;fj5He0=0SrCkJ+2LPDsr)XYmIy{ez^^?=Zo1>xT;hj51(+$kr`EM*9@i@s(u zcsj>rAu&XS2!r7kzkjK!EKg{i!th&F4EdZLwpB4?z)rl-b+~uPMjQoWhcR|I+n(&q z&9pC^mggYiz_KvcX*bI@FylWy$8(a#NYid!)XI}c*Ae?#cT#Js*UP&)6RWJXSX=DI z32;If~nTL@5jwAc= zB9vQ7_UXlB>6)4XdARtI>%mN<;bjnm^eyubfScBnMlp>jwTmH$zvmF&Qy|8>nDL;_ zyA{NXM=`-%4r79A)|?(Fsbe$il82%~goWVy2Z!(8Y7adg;h`mCn9iC10^TsbpLK~b zDnwYRq|`xqo3HD#mL*L5FUNRYHRI>185eUqgZko3&9?P3VM|914&S6@mu-+C!E59fh($($S@f#>cZ zQzvVbsZ$Jq_u>N%-hI{Z9;$%HF!kUr6kuIR^ZxvR2|#BFpej)_2cR24mK;^}DmkI+ z$8WxPb!p$J@^cp|Uq7=nkZk~PbU+YdJxOZNfFeRgcB7atW;9!pzMMS$q8FsSse0<7N;UQBpcw6_@f_IY|2}m ztyvlNo82peMDzLNLOxYSHDK#YQUfUm+{}uE5fvh=R8s1oyu;T8MpqV$*B!=<)joJD zMhQtPFoNxhubd2|9Pl9)5=K;run>&zIEb%b8y&`mTp>$O1ld(dv<(cL9N1Yx zs7ln#=^yoR5vpo=Ld)Wbzi2yDHrg-gkR*Mu4w7pudjl8O#q?lZ6^Y4fAsUqp zNd(E4C8>c6UrkYqDiV{|Lc~DIF^=jHf#hwLy@88unBbeD7DR}#5Jbi6D*nk3-hmfA zEs3b*HqUvNiCPBptIPX4n7$)P?QJP=kQA|~A~AUgJ$IVZd3Aq33cHKz(s7`nl@6s{O$ z>J&lpnBNgq-J4sIPe|Iu`th4DAF|;J8xgADgnBIm$uF?%4O}>C3RhH-n7kGu23Vfq zs6Jc)$yZqR1}?U7fq(KMm8E7Lg6N3#BD@1HIw6U0<;02xS$h5XyxWvs^6{x&YpO9) z1}xSIrB+9r!)#?CQAULb3!(h9qrAPi-r-n>*JTT|JkerF-iTJ5QB8DFD+(P8XZRwiKyJ2g&wO_Qs&- zqmu5G %s', req.method, req.url, socket.filename); - - req.on('end', function() { - if (req.url !== '/') { - res.end(JSON.stringify({ - method: req.method, - url: req.url, - filename: socket.filename, - })); - return; - } - - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - }); -}); - -server.on('connection', function(socket) { - connections++; - - socket.id = connections; - socket.filename = 'connection-' + socket.id + '.http'; - socket.file = fs.createWriteStream(socket.filename); - socket.pipe(socket.file); - - console.log('--> %s', socket.filename); - socket.on('close', function() { - console.log('<-- %s', socket.filename); - }); -}); - -var port = process.env.PORT || 8080; -server.listen(port, function() { - console.log('Recording connections on port %s', port); -}); diff --git a/usb_auth/node_modules/express/node_modules/connect/package.json b/usb_auth/node_modules/express/node_modules/connect/package.json deleted file mode 100644 index f9c43d5..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "connect", - "version": "1.8.5", - "description": "High performance middleware framework", - "keywords": ["framework", "web", "middleware", "connect", "rack"], - "repository": "git://github.com/senchalabs/connect.git", - "author": "TJ Holowaychuk (http://tjholowaychuk.com)", - "repository": "git://github.com/senchalabs/connect", - "dependencies": { - "qs": ">= 0.4.0", - "mime": ">= 0.0.1", - "formidable": "1.0.x" - }, - "devDependencies": { - "expresso": "0.9.2", - "koala": "0.1.2", - "less": "1.1.1", - "sass": "0.5.0", - "markdown": "0.2.1", - "ejs": "0.4.3", - "should": "0.3.2" - }, - "main": "index", - "engines": { "node": ">= 0.4.1 < 0.7.0" } -} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/connect/test.js b/usb_auth/node_modules/express/node_modules/connect/test.js deleted file mode 100644 index a1e1d55..0000000 --- a/usb_auth/node_modules/express/node_modules/connect/test.js +++ /dev/null @@ -1,52 +0,0 @@ - -var connect = require('./') - , http = require('http') - , RedisStore = require('connect-redis')(connect); - -var app = connect(); -app.use(connect.cookieParser('fucj')); -app.use(connect.session({store:new RedisStore})); -app.use(function(req, res, next){ - req.session.views = (req.session.views || 0) + 1; - res.writeHead(200, {"Content-Type": "text/plain"}); - res.end("You've viewed this page "+req.session.views+" times."); -}) - -http.createServer(app).listen(3000); - - -// var set = RedisStore.prototype.set; -// -// function slow(sid){ -// console.log('%s saving', sid); -// var args = arguments; -// setTimeout(function(self){ -// console.log('%s saved', sid); -// set.apply(self, args); -// }, 2000, this); -// }; -// -// http.createServer(connect() -// .use(connect.logger('dev')) -// .use(connect.cookieParser('keyboard cat')) -// .use(connect.session({ store: new RedisStore })) -// .use(function(req, res, next){ -// var sess = req.session; -// switch (req.url) { -// case '/foo.js': -// console.log('%s foo.js sid', sess.id); -// RedisStore.prototype.set = set; -// res.end('data'); -// break; -// default: -// console.log('%s html sid', sess.id); -// RedisStore.prototype.set = slow; -// res.setHeader('Content-Type', 'html'); -// res.write(''); -// setTimeout(function(){ -// res.end(''); -// }, 1000); -// } -// })).listen(3000); -// -// console.log('port 3000'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mime/LICENSE b/usb_auth/node_modules/express/node_modules/mime/LICENSE deleted file mode 100644 index 451fc45..0000000 --- a/usb_auth/node_modules/express/node_modules/mime/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/usb_auth/node_modules/express/node_modules/mime/README.md b/usb_auth/node_modules/express/node_modules/mime/README.md deleted file mode 100644 index a157de1..0000000 --- a/usb_auth/node_modules/express/node_modules/mime/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# mime - -Support for mapping between file extensions and MIME types. This module uses the latest version of the Apache "mime.types" file (maps over 620 types to 800+ extensions). It is also trivially easy to add your own types and extensions, should you need to do that. - -## Install - -Install with [npm](http://github.com/isaacs/npm): - - npm install mime - -## API - Queries - -### mime.lookup(path) -Get the mime type associated with a file. This is method is case-insensitive. Everything in path up to and including the last '/' or '.' is ignored, so you can pass it paths, filenames, or extensions, like so: - - var mime = require('mime'); - - mime.lookup('/path/to/file.txt'); // => 'text/plain' - mime.lookup('file.txt'); // => 'text/plain' - mime.lookup('.txt'); // => 'text/plain' - mime.lookup('htm'); // => 'text/html' - -### mime.extension(type) - lookup the default extension for type - - mime.extension('text/html'); // => 'html' - mime.extension('application/octet-stream'); // => 'bin' - -### mime.charsets.lookup() - map mime-type to charset - - mime.charsets.lookup('text/plain'); // => 'UTF-8' - -(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) - -## API - Customizing - -The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/bentomas/node-mime/wiki/Requesting-New-Types). -### mime.define() - Add custom mime/extension mappings - - mime.define({ - 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], - 'application/x-my-type': ['x-mt', 'x-mtt'], - // etc ... - }); - - mime.lookup('x-sft'); // => 'text/x-some-format' - mime.extension('text/x-some-format'); // => 'x-sf' - -### mime.load(filepath) - Load mappings from an Apache ".types" format file - - mime.load('./my_project.types'); diff --git a/usb_auth/node_modules/express/node_modules/mime/mime.js b/usb_auth/node_modules/express/node_modules/mime/mime.js deleted file mode 100644 index 5fac753..0000000 --- a/usb_auth/node_modules/express/node_modules/mime/mime.js +++ /dev/null @@ -1,92 +0,0 @@ -var path = require('path'), - fs = require('fs'); - -var mime = module.exports = { - /** Map of extension to mime type */ - types: {}, - - /** Map of mime type to extension */ - extensions :{}, - - /** - * Define mimetype -> extension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * @param map (Object) type definitions - */ - define: function(map) { - for (var type in map) { - var exts = map[type]; - - for (var i = 0; i < exts.length; i++) { - mime.types[exts[i]] = type; - } - - // Default extension is the first one we encounter - if (!mime.extensions[type]) { - mime.extensions[type] = exts[0]; - } - } - }, - - /** - * Load an Apache2-style ".types" file - * - * This may be called multiple times (it's expected). Where files declare - * overlapping types/extensions, the last file wins. - * - * @param file (String) path of file to load. - */ - load: function(file) { - // Read file and split into lines - var map = {}, - content = fs.readFileSync(file, 'ascii'), - lines = content.split(/[\r\n]+/); - - lines.forEach(function(line, lineno) { - // Clean up whitespace/comments, and split into fields - var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); - map[fields.shift()] = fields; - }); - - mime.define(map); - }, - - /** - * Lookup a mime type based on extension - */ - lookup: function(path, fallback) { - var ext = path.replace(/.*[\.\/]/, '').toLowerCase(); - return mime.types[ext] || fallback || mime.default_type; - }, - - /** - * Return file extension associated with a mime type - */ - extension: function(mimeType) { - return mime.extensions[mimeType]; - }, - - /** - * Lookup a charset based on mime type. - */ - charsets: { - lookup: function (mimeType, fallback) { - // Assume text types are utf8. Modify mime logic as needed. - return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; - } - } -}; - -// Load our local copy of -// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -mime.load(path.join(__dirname, 'types/mime.types')); - -// Overlay enhancements submitted by the node.js community -mime.load(path.join(__dirname, 'types/node.types')); - -// Set the default type -mime.default_type = mime.types.bin; diff --git a/usb_auth/node_modules/express/node_modules/mime/package.json b/usb_auth/node_modules/express/node_modules/mime/package.json deleted file mode 100644 index 85277b0..0000000 --- a/usb_auth/node_modules/express/node_modules/mime/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "author": { - "name": "Robert Kieffer", - "url": "http://github.com/broofa", - "email": "robert@broofa.com" - }, - "contributors": [ - { - "name": "Benjamin Thomas", - "url": "http://github.com/bentomas", - "email": "benjamin@benjaminthomas.org" - } - ], - "dependencies": {}, - "description": "A comprehensive library for mime-type mapping", - "devDependencies": {"async_testing": ""}, - "keywords": ["util", "mime"], - "main": "mime.js", - "name": "mime", - "repository": {"url": "http://github.com/bentomas/node-mime", "type": "git"}, - "version": "1.2.4" -} diff --git a/usb_auth/node_modules/express/node_modules/mime/test.js b/usb_auth/node_modules/express/node_modules/mime/test.js deleted file mode 100644 index b904895..0000000 --- a/usb_auth/node_modules/express/node_modules/mime/test.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Requires the async_testing module - * - * Usage: node test.js - */ -var mime = require('./mime'); -exports["test mime lookup"] = function(test) { - // easy - test.equal('text/plain', mime.lookup('text.txt')); - - // hidden file or multiple periods - test.equal('text/plain', mime.lookup('.text.txt')); - - // just an extension - test.equal('text/plain', mime.lookup('.txt')); - - // just an extension without a dot - test.equal('text/plain', mime.lookup('txt')); - - // default - test.equal('application/octet-stream', mime.lookup('text.nope')); - - // fallback - test.equal('fallback', mime.lookup('text.fallback', 'fallback')); - - test.finish(); -}; - -exports["test extension lookup"] = function(test) { - // easy - test.equal('txt', mime.extension(mime.types.text)); - test.equal('html', mime.extension(mime.types.htm)); - test.equal('bin', mime.extension('application/octet-stream')); - - test.finish(); -}; - -exports["test mime lookup uppercase"] = function(test) { - // easy - test.equal('text/plain', mime.lookup('TEXT.TXT')); - - // just an extension - test.equal('text/plain', mime.lookup('.TXT')); - - // just an extension without a dot - test.equal('text/plain', mime.lookup('TXT')); - - // default - test.equal('application/octet-stream', mime.lookup('TEXT.NOPE')); - - // fallback - test.equal('fallback', mime.lookup('TEXT.FALLBACK', 'fallback')); - - test.finish(); -}; - -exports["test custom types"] = function(test) { - test.equal('application/octet-stream', mime.lookup('file.buffer')); - test.equal('audio/mp4', mime.lookup('file.m4a')); - - test.finish(); -}; - -exports["test charset lookup"] = function(test) { - // easy - test.equal('UTF-8', mime.charsets.lookup('text/plain')); - - // none - test.ok(typeof mime.charsets.lookup(mime.types.js) == 'undefined'); - - // fallback - test.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); - - test.finish(); -}; - -if (module == require.main) { - require('async_testing').run(__filename, process.ARGV); -} diff --git a/usb_auth/node_modules/express/node_modules/mime/types/mime.types b/usb_auth/node_modules/express/node_modules/mime/types/mime.types deleted file mode 100644 index 6a90929..0000000 --- a/usb_auth/node_modules/express/node_modules/mime/types/mime.types +++ /dev/null @@ -1,1479 +0,0 @@ -# This file maps Internet media types to unique file extension(s). -# Although created for httpd, this file is used by many software systems -# and has been placed in the public domain for unlimited redisribution. -# -# The table below contains both registered and (common) unregistered types. -# A type that has no unique extension can be ignored -- they are listed -# here to guide configurations toward known types and to make it easier to -# identify "new" types. File extensions are also commonly used to indicate -# content languages and encodings, so choose them carefully. -# -# Internet media types should be registered as described in RFC 4288. -# The registry is at . -# -# MIME type (lowercased) Extensions -# ============================================ ========== -# application/1d-interleaved-parityfec -# application/3gpp-ims+xml -# application/activemessage -application/andrew-inset ez -# application/applefile -application/applixware aw -application/atom+xml atom -application/atomcat+xml atomcat -# application/atomicmail -application/atomsvc+xml atomsvc -# application/auth-policy+xml -# application/batch-smtp -# application/beep+xml -# application/cals-1840 -application/ccxml+xml ccxml -application/cdmi-capability cdmia -application/cdmi-container cdmic -application/cdmi-domain cdmid -application/cdmi-object cdmio -application/cdmi-queue cdmiq -# application/cea-2018+xml -# application/cellml+xml -# application/cfw -# application/cnrp+xml -# application/commonground -# application/conference-info+xml -# application/cpl+xml -# application/csta+xml -# application/cstadata+xml -application/cu-seeme cu -# application/cybercash -application/davmount+xml davmount -# application/dca-rft -# application/dec-dx -# application/dialog-info+xml -# application/dicom -# application/dns -# application/dskpp+xml -application/dssc+der dssc -application/dssc+xml xdssc -# application/dvcs -application/ecmascript ecma -# application/edi-consent -# application/edi-x12 -# application/edifact -application/emma+xml emma -# application/epp+xml -application/epub+zip epub -# application/eshop -# application/example -application/exi exi -# application/fastinfoset -# application/fastsoap -# application/fits -application/font-tdpfr pfr -# application/framework-attributes+xml -# application/h224 -# application/held+xml -# application/http -application/hyperstudio stk -# application/ibe-key-request+xml -# application/ibe-pkg-reply+xml -# application/ibe-pp-data -# application/iges -# application/im-iscomposing+xml -# application/index -# application/index.cmd -# application/index.obj -# application/index.response -# application/index.vnd -# application/iotp -application/ipfix ipfix -# application/ipp -# application/isup -application/java-archive jar -application/java-serialized-object ser -application/java-vm class -application/javascript js -application/json json -# application/kpml-request+xml -# application/kpml-response+xml -application/lost+xml lostxml -application/mac-binhex40 hqx -application/mac-compactpro cpt -# application/macwriteii -application/mads+xml mads -application/marc mrc -application/marcxml+xml mrcx -application/mathematica ma nb mb -# application/mathml-content+xml -# application/mathml-presentation+xml -application/mathml+xml mathml -# application/mbms-associated-procedure-description+xml -# application/mbms-deregister+xml -# application/mbms-envelope+xml -# application/mbms-msk+xml -# application/mbms-msk-response+xml -# application/mbms-protection-description+xml -# application/mbms-reception-report+xml -# application/mbms-register+xml -# application/mbms-register-response+xml -# application/mbms-user-service-description+xml -application/mbox mbox -# application/media_control+xml -application/mediaservercontrol+xml mscml -application/metalink4+xml meta4 -application/mets+xml mets -# application/mikey -application/mods+xml mods -# application/moss-keys -# application/moss-signature -# application/mosskey-data -# application/mosskey-request -application/mp21 m21 mp21 -application/mp4 mp4s -# application/mpeg4-generic -# application/mpeg4-iod -# application/mpeg4-iod-xmt -# application/msc-ivr+xml -# application/msc-mixer+xml -application/msword doc dot -application/mxf mxf -# application/nasdata -# application/news-checkgroups -# application/news-groupinfo -# application/news-transmission -# application/nss -# application/ocsp-request -# application/ocsp-response -application/octet-stream bin dms lha lrf lzh so iso dmg dist distz pkg bpk dump elc deploy -application/oda oda -application/oebps-package+xml opf -application/ogg ogx -application/onenote onetoc onetoc2 onetmp onepkg -# application/parityfec -application/patch-ops-error+xml xer -application/pdf pdf -application/pgp-encrypted pgp -# application/pgp-keys -application/pgp-signature asc sig -application/pics-rules prf -# application/pidf+xml -# application/pidf-diff+xml -application/pkcs10 p10 -application/pkcs7-mime p7m p7c -application/pkcs7-signature p7s -application/pkcs8 p8 -application/pkix-attr-cert ac -application/pkix-cert cer -application/pkix-crl crl -application/pkix-pkipath pkipath -application/pkixcmp pki -application/pls+xml pls -# application/poc-settings+xml -application/postscript ai eps ps -# application/prs.alvestrand.titrax-sheet -application/prs.cww cww -# application/prs.nprend -# application/prs.plucker -# application/prs.rdf-xml-crypt -# application/prs.xsf+xml -application/pskc+xml pskcxml -# application/qsig -application/rdf+xml rdf -application/reginfo+xml rif -application/relax-ng-compact-syntax rnc -# application/remote-printing -application/resource-lists+xml rl -application/resource-lists-diff+xml rld -# application/riscos -# application/rlmi+xml -application/rls-services+xml rs -application/rsd+xml rsd -application/rss+xml rss -application/rtf rtf -# application/rtx -# application/samlassertion+xml -# application/samlmetadata+xml -application/sbml+xml sbml -application/scvp-cv-request scq -application/scvp-cv-response scs -application/scvp-vp-request spq -application/scvp-vp-response spp -application/sdp sdp -# application/set-payment -application/set-payment-initiation setpay -# application/set-registration -application/set-registration-initiation setreg -# application/sgml -# application/sgml-open-catalog -application/shf+xml shf -# application/sieve -# application/simple-filter+xml -# application/simple-message-summary -# application/simplesymbolcontainer -# application/slate -# application/smil -application/smil+xml smi smil -# application/soap+fastinfoset -# application/soap+xml -application/sparql-query rq -application/sparql-results+xml srx -# application/spirits-event+xml -application/srgs gram -application/srgs+xml grxml -application/sru+xml sru -application/ssml+xml ssml -# application/tamp-apex-update -# application/tamp-apex-update-confirm -# application/tamp-community-update -# application/tamp-community-update-confirm -# application/tamp-error -# application/tamp-sequence-adjust -# application/tamp-sequence-adjust-confirm -# application/tamp-status-query -# application/tamp-status-response -# application/tamp-update -# application/tamp-update-confirm -application/tei+xml tei teicorpus -application/thraud+xml tfi -# application/timestamp-query -# application/timestamp-reply -application/timestamped-data tsd -# application/tve-trigger -# application/ulpfec -# application/vemmi -# application/vividence.scriptfile -# application/vnd.3gpp.bsf+xml -application/vnd.3gpp.pic-bw-large plb -application/vnd.3gpp.pic-bw-small psb -application/vnd.3gpp.pic-bw-var pvb -# application/vnd.3gpp.sms -# application/vnd.3gpp2.bcmcsinfo+xml -# application/vnd.3gpp2.sms -application/vnd.3gpp2.tcap tcap -application/vnd.3m.post-it-notes pwn -application/vnd.accpac.simply.aso aso -application/vnd.accpac.simply.imp imp -application/vnd.acucobol acu -application/vnd.acucorp atc acutc -application/vnd.adobe.air-application-installer-package+zip air -application/vnd.adobe.fxp fxp fxpl -# application/vnd.adobe.partial-upload -application/vnd.adobe.xdp+xml xdp -application/vnd.adobe.xfdf xfdf -# application/vnd.aether.imp -# application/vnd.ah-barcode -application/vnd.ahead.space ahead -application/vnd.airzip.filesecure.azf azf -application/vnd.airzip.filesecure.azs azs -application/vnd.amazon.ebook azw -application/vnd.americandynamics.acc acc -application/vnd.amiga.ami ami -# application/vnd.amundsen.maze+xml -application/vnd.android.package-archive apk -application/vnd.anser-web-certificate-issue-initiation cii -application/vnd.anser-web-funds-transfer-initiation fti -application/vnd.antix.game-component atx -application/vnd.apple.installer+xml mpkg -application/vnd.apple.mpegurl m3u8 -# application/vnd.arastra.swi -application/vnd.aristanetworks.swi swi -application/vnd.audiograph aep -# application/vnd.autopackage -# application/vnd.avistar+xml -application/vnd.blueice.multipass mpm -# application/vnd.bluetooth.ep.oob -application/vnd.bmi bmi -application/vnd.businessobjects rep -# application/vnd.cab-jscript -# application/vnd.canon-cpdl -# application/vnd.canon-lips -# application/vnd.cendio.thinlinc.clientconf -application/vnd.chemdraw+xml cdxml -application/vnd.chipnuts.karaoke-mmd mmd -application/vnd.cinderella cdy -# application/vnd.cirpack.isdn-ext -application/vnd.claymore cla -application/vnd.cloanto.rp9 rp9 -application/vnd.clonk.c4group c4g c4d c4f c4p c4u -application/vnd.cluetrust.cartomobile-config c11amc -application/vnd.cluetrust.cartomobile-config-pkg c11amz -# application/vnd.commerce-battelle -application/vnd.commonspace csp -application/vnd.contact.cmsg cdbcmsg -application/vnd.cosmocaller cmc -application/vnd.crick.clicker clkx -application/vnd.crick.clicker.keyboard clkk -application/vnd.crick.clicker.palette clkp -application/vnd.crick.clicker.template clkt -application/vnd.crick.clicker.wordbank clkw -application/vnd.criticaltools.wbs+xml wbs -application/vnd.ctc-posml pml -# application/vnd.ctct.ws+xml -# application/vnd.cups-pdf -# application/vnd.cups-postscript -application/vnd.cups-ppd ppd -# application/vnd.cups-raster -# application/vnd.cups-raw -application/vnd.curl.car car -application/vnd.curl.pcurl pcurl -# application/vnd.cybank -application/vnd.data-vision.rdz rdz -application/vnd.dece.data uvf uvvf uvd uvvd -application/vnd.dece.ttml+xml uvt uvvt -application/vnd.dece.unspecified uvx uvvx -application/vnd.denovo.fcselayout-link fe_launch -# application/vnd.dir-bi.plate-dl-nosuffix -application/vnd.dna dna -application/vnd.dolby.mlp mlp -# application/vnd.dolby.mobile.1 -# application/vnd.dolby.mobile.2 -application/vnd.dpgraph dpg -application/vnd.dreamfactory dfac -application/vnd.dvb.ait ait -# application/vnd.dvb.dvbj -# application/vnd.dvb.esgcontainer -# application/vnd.dvb.ipdcdftnotifaccess -# application/vnd.dvb.ipdcesgaccess -# application/vnd.dvb.ipdcesgaccess2 -# application/vnd.dvb.ipdcesgpdd -# application/vnd.dvb.ipdcroaming -# application/vnd.dvb.iptv.alfec-base -# application/vnd.dvb.iptv.alfec-enhancement -# application/vnd.dvb.notif-aggregate-root+xml -# application/vnd.dvb.notif-container+xml -# application/vnd.dvb.notif-generic+xml -# application/vnd.dvb.notif-ia-msglist+xml -# application/vnd.dvb.notif-ia-registration-request+xml -# application/vnd.dvb.notif-ia-registration-response+xml -# application/vnd.dvb.notif-init+xml -# application/vnd.dvb.pfr -application/vnd.dvb.service svc -# application/vnd.dxr -application/vnd.dynageo geo -# application/vnd.easykaraoke.cdgdownload -# application/vnd.ecdis-update -application/vnd.ecowin.chart mag -# application/vnd.ecowin.filerequest -# application/vnd.ecowin.fileupdate -# application/vnd.ecowin.series -# application/vnd.ecowin.seriesrequest -# application/vnd.ecowin.seriesupdate -# application/vnd.emclient.accessrequest+xml -application/vnd.enliven nml -application/vnd.epson.esf esf -application/vnd.epson.msf msf -application/vnd.epson.quickanime qam -application/vnd.epson.salt slt -application/vnd.epson.ssf ssf -# application/vnd.ericsson.quickcall -application/vnd.eszigno3+xml es3 et3 -# application/vnd.etsi.aoc+xml -# application/vnd.etsi.cug+xml -# application/vnd.etsi.iptvcommand+xml -# application/vnd.etsi.iptvdiscovery+xml -# application/vnd.etsi.iptvprofile+xml -# application/vnd.etsi.iptvsad-bc+xml -# application/vnd.etsi.iptvsad-cod+xml -# application/vnd.etsi.iptvsad-npvr+xml -# application/vnd.etsi.iptvservice+xml -# application/vnd.etsi.iptvsync+xml -# application/vnd.etsi.iptvueprofile+xml -# application/vnd.etsi.mcid+xml -# application/vnd.etsi.overload-control-policy-dataset+xml -# application/vnd.etsi.sci+xml -# application/vnd.etsi.simservs+xml -# application/vnd.etsi.tsl+xml -# application/vnd.etsi.tsl.der -# application/vnd.eudora.data -application/vnd.ezpix-album ez2 -application/vnd.ezpix-package ez3 -# application/vnd.f-secure.mobile -application/vnd.fdf fdf -application/vnd.fdsn.mseed mseed -application/vnd.fdsn.seed seed dataless -# application/vnd.ffsns -# application/vnd.fints -application/vnd.flographit gph -application/vnd.fluxtime.clip ftc -# application/vnd.font-fontforge-sfd -application/vnd.framemaker fm frame maker book -application/vnd.frogans.fnc fnc -application/vnd.frogans.ltf ltf -application/vnd.fsc.weblaunch fsc -application/vnd.fujitsu.oasys oas -application/vnd.fujitsu.oasys2 oa2 -application/vnd.fujitsu.oasys3 oa3 -application/vnd.fujitsu.oasysgp fg5 -application/vnd.fujitsu.oasysprs bh2 -# application/vnd.fujixerox.art-ex -# application/vnd.fujixerox.art4 -# application/vnd.fujixerox.hbpl -application/vnd.fujixerox.ddd ddd -application/vnd.fujixerox.docuworks xdw -application/vnd.fujixerox.docuworks.binder xbd -# application/vnd.fut-misnet -application/vnd.fuzzysheet fzs -application/vnd.genomatix.tuxedo txd -# application/vnd.geocube+xml -application/vnd.geogebra.file ggb -application/vnd.geogebra.tool ggt -application/vnd.geometry-explorer gex gre -application/vnd.geonext gxt -application/vnd.geoplan g2w -application/vnd.geospace g3w -# application/vnd.globalplatform.card-content-mgt -# application/vnd.globalplatform.card-content-mgt-response -application/vnd.gmx gmx -application/vnd.google-earth.kml+xml kml -application/vnd.google-earth.kmz kmz -application/vnd.grafeq gqf gqs -# application/vnd.gridmp -application/vnd.groove-account gac -application/vnd.groove-help ghf -application/vnd.groove-identity-message gim -application/vnd.groove-injector grv -application/vnd.groove-tool-message gtm -application/vnd.groove-tool-template tpl -application/vnd.groove-vcard vcg -application/vnd.hal+xml hal -application/vnd.handheld-entertainment+xml zmm -application/vnd.hbci hbci -# application/vnd.hcl-bireports -application/vnd.hhe.lesson-player les -application/vnd.hp-hpgl hpgl -application/vnd.hp-hpid hpid -application/vnd.hp-hps hps -application/vnd.hp-jlyt jlt -application/vnd.hp-pcl pcl -application/vnd.hp-pclxl pclxl -# application/vnd.httphone -application/vnd.hydrostatix.sof-data sfd-hdstx -application/vnd.hzn-3d-crossword x3d -# application/vnd.ibm.afplinedata -# application/vnd.ibm.electronic-media -application/vnd.ibm.minipay mpy -application/vnd.ibm.modcap afp listafp list3820 -application/vnd.ibm.rights-management irm -application/vnd.ibm.secure-container sc -application/vnd.iccprofile icc icm -application/vnd.igloader igl -application/vnd.immervision-ivp ivp -application/vnd.immervision-ivu ivu -# application/vnd.informedcontrol.rms+xml -# application/vnd.informix-visionary -# application/vnd.infotech.project -# application/vnd.infotech.project+xml -application/vnd.insors.igm igm -application/vnd.intercon.formnet xpw xpx -application/vnd.intergeo i2g -# application/vnd.intertrust.digibox -# application/vnd.intertrust.nncp -application/vnd.intu.qbo qbo -application/vnd.intu.qfx qfx -# application/vnd.iptc.g2.conceptitem+xml -# application/vnd.iptc.g2.knowledgeitem+xml -# application/vnd.iptc.g2.newsitem+xml -# application/vnd.iptc.g2.packageitem+xml -application/vnd.ipunplugged.rcprofile rcprofile -application/vnd.irepository.package+xml irp -application/vnd.is-xpr xpr -application/vnd.isac.fcs fcs -application/vnd.jam jam -# application/vnd.japannet-directory-service -# application/vnd.japannet-jpnstore-wakeup -# application/vnd.japannet-payment-wakeup -# application/vnd.japannet-registration -# application/vnd.japannet-registration-wakeup -# application/vnd.japannet-setstore-wakeup -# application/vnd.japannet-verification -# application/vnd.japannet-verification-wakeup -application/vnd.jcp.javame.midlet-rms rms -application/vnd.jisp jisp -application/vnd.joost.joda-archive joda -application/vnd.kahootz ktz ktr -application/vnd.kde.karbon karbon -application/vnd.kde.kchart chrt -application/vnd.kde.kformula kfo -application/vnd.kde.kivio flw -application/vnd.kde.kontour kon -application/vnd.kde.kpresenter kpr kpt -application/vnd.kde.kspread ksp -application/vnd.kde.kword kwd kwt -application/vnd.kenameaapp htke -application/vnd.kidspiration kia -application/vnd.kinar kne knp -application/vnd.koan skp skd skt skm -application/vnd.kodak-descriptor sse -application/vnd.las.las+xml lasxml -# application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop lbd -application/vnd.llamagraphics.life-balance.exchange+xml lbe -application/vnd.lotus-1-2-3 123 -application/vnd.lotus-approach apr -application/vnd.lotus-freelance pre -application/vnd.lotus-notes nsf -application/vnd.lotus-organizer org -application/vnd.lotus-screencam scm -application/vnd.lotus-wordpro lwp -application/vnd.macports.portpkg portpkg -# application/vnd.marlin.drm.actiontoken+xml -# application/vnd.marlin.drm.conftoken+xml -# application/vnd.marlin.drm.license+xml -# application/vnd.marlin.drm.mdcf -application/vnd.mcd mcd -application/vnd.medcalcdata mc1 -application/vnd.mediastation.cdkey cdkey -# application/vnd.meridian-slingshot -application/vnd.mfer mwf -application/vnd.mfmp mfm -application/vnd.micrografx.flo flo -application/vnd.micrografx.igx igx -application/vnd.mif mif -# application/vnd.minisoft-hp3000-save -# application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf daf -application/vnd.mobius.dis dis -application/vnd.mobius.mbk mbk -application/vnd.mobius.mqy mqy -application/vnd.mobius.msl msl -application/vnd.mobius.plc plc -application/vnd.mobius.txf txf -application/vnd.mophun.application mpn -application/vnd.mophun.certificate mpc -# application/vnd.motorola.flexsuite -# application/vnd.motorola.flexsuite.adsi -# application/vnd.motorola.flexsuite.fis -# application/vnd.motorola.flexsuite.gotap -# application/vnd.motorola.flexsuite.kmr -# application/vnd.motorola.flexsuite.ttc -# application/vnd.motorola.flexsuite.wem -# application/vnd.motorola.iprm -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry cil -# application/vnd.ms-asf -application/vnd.ms-cab-compressed cab -application/vnd.ms-excel xls xlm xla xlc xlt xlw -application/vnd.ms-excel.addin.macroenabled.12 xlam -application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb -application/vnd.ms-excel.sheet.macroenabled.12 xlsm -application/vnd.ms-excel.template.macroenabled.12 xltm -application/vnd.ms-fontobject eot -application/vnd.ms-htmlhelp chm -application/vnd.ms-ims ims -application/vnd.ms-lrm lrm -# application/vnd.ms-office.activex+xml -application/vnd.ms-officetheme thmx -application/vnd.ms-pki.seccat cat -application/vnd.ms-pki.stl stl -# application/vnd.ms-playready.initiator+xml -application/vnd.ms-powerpoint ppt pps pot -application/vnd.ms-powerpoint.addin.macroenabled.12 ppam -application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm -application/vnd.ms-powerpoint.slide.macroenabled.12 sldm -application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm -application/vnd.ms-powerpoint.template.macroenabled.12 potm -application/vnd.ms-project mpp mpt -# application/vnd.ms-tnef -# application/vnd.ms-wmdrm.lic-chlg-req -# application/vnd.ms-wmdrm.lic-resp -# application/vnd.ms-wmdrm.meter-chlg-req -# application/vnd.ms-wmdrm.meter-resp -application/vnd.ms-word.document.macroenabled.12 docm -application/vnd.ms-word.template.macroenabled.12 dotm -application/vnd.ms-works wps wks wcm wdb -application/vnd.ms-wpl wpl -application/vnd.ms-xpsdocument xps -application/vnd.mseq mseq -# application/vnd.msign -# application/vnd.multiad.creator -# application/vnd.multiad.creator.cif -# application/vnd.music-niff -application/vnd.musician mus -application/vnd.muvee.style msty -# application/vnd.ncd.control -# application/vnd.ncd.reference -# application/vnd.nervana -# application/vnd.netfpx -application/vnd.neurolanguage.nlu nlu -application/vnd.noblenet-directory nnd -application/vnd.noblenet-sealer nns -application/vnd.noblenet-web nnw -# application/vnd.nokia.catalogs -# application/vnd.nokia.conml+wbxml -# application/vnd.nokia.conml+xml -# application/vnd.nokia.isds-radio-presets -# application/vnd.nokia.iptv.config+xml -# application/vnd.nokia.landmark+wbxml -# application/vnd.nokia.landmark+xml -# application/vnd.nokia.landmarkcollection+xml -# application/vnd.nokia.n-gage.ac+xml -application/vnd.nokia.n-gage.data ngdat -application/vnd.nokia.n-gage.symbian.install n-gage -# application/vnd.nokia.ncd -# application/vnd.nokia.pcd+wbxml -# application/vnd.nokia.pcd+xml -application/vnd.nokia.radio-preset rpst -application/vnd.nokia.radio-presets rpss -application/vnd.novadigm.edm edm -application/vnd.novadigm.edx edx -application/vnd.novadigm.ext ext -# application/vnd.ntt-local.file-transfer -# application/vnd.ntt-local.sip-ta_remote -# application/vnd.ntt-local.sip-ta_tcp_stream -application/vnd.oasis.opendocument.chart odc -application/vnd.oasis.opendocument.chart-template otc -application/vnd.oasis.opendocument.database odb -application/vnd.oasis.opendocument.formula odf -application/vnd.oasis.opendocument.formula-template odft -application/vnd.oasis.opendocument.graphics odg -application/vnd.oasis.opendocument.graphics-template otg -application/vnd.oasis.opendocument.image odi -application/vnd.oasis.opendocument.image-template oti -application/vnd.oasis.opendocument.presentation odp -application/vnd.oasis.opendocument.presentation-template otp -application/vnd.oasis.opendocument.spreadsheet ods -application/vnd.oasis.opendocument.spreadsheet-template ots -application/vnd.oasis.opendocument.text odt -application/vnd.oasis.opendocument.text-master odm -application/vnd.oasis.opendocument.text-template ott -application/vnd.oasis.opendocument.text-web oth -# application/vnd.obn -# application/vnd.oipf.contentaccessdownload+xml -# application/vnd.oipf.contentaccessstreaming+xml -# application/vnd.oipf.cspg-hexbinary -# application/vnd.oipf.dae.svg+xml -# application/vnd.oipf.dae.xhtml+xml -# application/vnd.oipf.mippvcontrolmessage+xml -# application/vnd.oipf.pae.gem -# application/vnd.oipf.spdiscovery+xml -# application/vnd.oipf.spdlist+xml -# application/vnd.oipf.ueprofile+xml -# application/vnd.oipf.userprofile+xml -application/vnd.olpc-sugar xo -# application/vnd.oma-scws-config -# application/vnd.oma-scws-http-request -# application/vnd.oma-scws-http-response -# application/vnd.oma.bcast.associated-procedure-parameter+xml -# application/vnd.oma.bcast.drm-trigger+xml -# application/vnd.oma.bcast.imd+xml -# application/vnd.oma.bcast.ltkm -# application/vnd.oma.bcast.notification+xml -# application/vnd.oma.bcast.provisioningtrigger -# application/vnd.oma.bcast.sgboot -# application/vnd.oma.bcast.sgdd+xml -# application/vnd.oma.bcast.sgdu -# application/vnd.oma.bcast.simple-symbol-container -# application/vnd.oma.bcast.smartcard-trigger+xml -# application/vnd.oma.bcast.sprov+xml -# application/vnd.oma.bcast.stkm -# application/vnd.oma.cab-address-book+xml -# application/vnd.oma.cab-pcc+xml -# application/vnd.oma.dcd -# application/vnd.oma.dcdc -application/vnd.oma.dd2+xml dd2 -# application/vnd.oma.drm.risd+xml -# application/vnd.oma.group-usage-list+xml -# application/vnd.oma.poc.detailed-progress-report+xml -# application/vnd.oma.poc.final-report+xml -# application/vnd.oma.poc.groups+xml -# application/vnd.oma.poc.invocation-descriptor+xml -# application/vnd.oma.poc.optimized-progress-report+xml -# application/vnd.oma.push -# application/vnd.oma.scidm.messages+xml -# application/vnd.oma.xcap-directory+xml -# application/vnd.omads-email+xml -# application/vnd.omads-file+xml -# application/vnd.omads-folder+xml -# application/vnd.omaloc-supl-init -application/vnd.openofficeorg.extension oxt -# application/vnd.openxmlformats-officedocument.custom-properties+xml -# application/vnd.openxmlformats-officedocument.customxmlproperties+xml -# application/vnd.openxmlformats-officedocument.drawing+xml -# application/vnd.openxmlformats-officedocument.drawingml.chart+xml -# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml -# application/vnd.openxmlformats-officedocument.extended-properties+xml -# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml -# application/vnd.openxmlformats-officedocument.presentationml.comments+xml -# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml -application/vnd.openxmlformats-officedocument.presentationml.presentation pptx -# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml -application/vnd.openxmlformats-officedocument.presentationml.slide sldx -# application/vnd.openxmlformats-officedocument.presentationml.slide+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml -application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx -# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml -# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml -# application/vnd.openxmlformats-officedocument.presentationml.tags+xml -application/vnd.openxmlformats-officedocument.presentationml.template potx -# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx -# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml -# application/vnd.openxmlformats-officedocument.theme+xml -# application/vnd.openxmlformats-officedocument.themeoverride+xml -# application/vnd.openxmlformats-officedocument.vmldrawing -# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.document docx -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx -# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml -# application/vnd.openxmlformats-package.core-properties+xml -# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml -# application/vnd.openxmlformats-package.relationships+xml -# application/vnd.quobject-quoxdocument -# application/vnd.osa.netdeploy -application/vnd.osgeo.mapguide.package mgp -# application/vnd.osgi.bundle -application/vnd.osgi.dp dp -# application/vnd.otps.ct-kip+xml -application/vnd.palm pdb pqa oprc -# application/vnd.paos.xml -application/vnd.pawaafile paw -application/vnd.pg.format str -application/vnd.pg.osasli ei6 -# application/vnd.piaccess.application-licence -application/vnd.picsel efif -application/vnd.pmi.widget wg -# application/vnd.poc.group-advertisement+xml -application/vnd.pocketlearn plf -application/vnd.powerbuilder6 pbd -# application/vnd.powerbuilder6-s -# application/vnd.powerbuilder7 -# application/vnd.powerbuilder7-s -# application/vnd.powerbuilder75 -# application/vnd.powerbuilder75-s -# application/vnd.preminet -application/vnd.previewsystems.box box -application/vnd.proteus.magazine mgz -application/vnd.publishare-delta-tree qps -application/vnd.pvi.ptid1 ptid -# application/vnd.pwg-multiplexed -# application/vnd.pwg-xhtml-print+xml -# application/vnd.qualcomm.brew-app-res -application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb -# application/vnd.radisys.moml+xml -# application/vnd.radisys.msml+xml -# application/vnd.radisys.msml-audit+xml -# application/vnd.radisys.msml-audit-conf+xml -# application/vnd.radisys.msml-audit-conn+xml -# application/vnd.radisys.msml-audit-dialog+xml -# application/vnd.radisys.msml-audit-stream+xml -# application/vnd.radisys.msml-conf+xml -# application/vnd.radisys.msml-dialog+xml -# application/vnd.radisys.msml-dialog-base+xml -# application/vnd.radisys.msml-dialog-fax-detect+xml -# application/vnd.radisys.msml-dialog-fax-sendrecv+xml -# application/vnd.radisys.msml-dialog-group+xml -# application/vnd.radisys.msml-dialog-speech+xml -# application/vnd.radisys.msml-dialog-transform+xml -# application/vnd.rainstor.data -# application/vnd.rapid -application/vnd.realvnc.bed bed -application/vnd.recordare.musicxml mxl -application/vnd.recordare.musicxml+xml musicxml -# application/vnd.renlearn.rlprint -application/vnd.rig.cryptonote cryptonote -application/vnd.rim.cod cod -application/vnd.rn-realmedia rm -application/vnd.route66.link66+xml link66 -# application/vnd.ruckus.download -# application/vnd.s3sms -application/vnd.sailingtracker.track st -# application/vnd.sbm.cid -# application/vnd.sbm.mid2 -# application/vnd.scribus -# application/vnd.sealed.3df -# application/vnd.sealed.csf -# application/vnd.sealed.doc -# application/vnd.sealed.eml -# application/vnd.sealed.mht -# application/vnd.sealed.net -# application/vnd.sealed.ppt -# application/vnd.sealed.tiff -# application/vnd.sealed.xls -# application/vnd.sealedmedia.softseal.html -# application/vnd.sealedmedia.softseal.pdf -application/vnd.seemail see -application/vnd.sema sema -application/vnd.semd semd -application/vnd.semf semf -application/vnd.shana.informed.formdata ifm -application/vnd.shana.informed.formtemplate itp -application/vnd.shana.informed.interchange iif -application/vnd.shana.informed.package ipk -application/vnd.simtech-mindmapper twd twds -application/vnd.smaf mmf -# application/vnd.smart.notebook -application/vnd.smart.teacher teacher -# application/vnd.software602.filler.form+xml -# application/vnd.software602.filler.form-xml-zip -application/vnd.solent.sdkm+xml sdkm sdkd -application/vnd.spotfire.dxp dxp -application/vnd.spotfire.sfs sfs -# application/vnd.sss-cod -# application/vnd.sss-dtf -# application/vnd.sss-ntf -application/vnd.stardivision.calc sdc -application/vnd.stardivision.draw sda -application/vnd.stardivision.impress sdd -application/vnd.stardivision.math smf -application/vnd.stardivision.writer sdw vor -application/vnd.stardivision.writer-global sgl -application/vnd.stepmania.stepchart sm -# application/vnd.street-stream -application/vnd.sun.xml.calc sxc -application/vnd.sun.xml.calc.template stc -application/vnd.sun.xml.draw sxd -application/vnd.sun.xml.draw.template std -application/vnd.sun.xml.impress sxi -application/vnd.sun.xml.impress.template sti -application/vnd.sun.xml.math sxm -application/vnd.sun.xml.writer sxw -application/vnd.sun.xml.writer.global sxg -application/vnd.sun.xml.writer.template stw -# application/vnd.sun.wadl+xml -application/vnd.sus-calendar sus susp -application/vnd.svd svd -# application/vnd.swiftview-ics -application/vnd.symbian.install sis sisx -application/vnd.syncml+xml xsm -application/vnd.syncml.dm+wbxml bdm -application/vnd.syncml.dm+xml xdm -# application/vnd.syncml.dm.notification -# application/vnd.syncml.ds.notification -application/vnd.tao.intent-module-archive tao -application/vnd.tmobile-livetv tmo -application/vnd.trid.tpt tpt -application/vnd.triscape.mxs mxs -application/vnd.trueapp tra -# application/vnd.truedoc -# application/vnd.ubisoft.webplayer -application/vnd.ufdl ufd ufdl -application/vnd.uiq.theme utz -application/vnd.umajin umj -application/vnd.unity unityweb -application/vnd.uoml+xml uoml -# application/vnd.uplanet.alert -# application/vnd.uplanet.alert-wbxml -# application/vnd.uplanet.bearer-choice -# application/vnd.uplanet.bearer-choice-wbxml -# application/vnd.uplanet.cacheop -# application/vnd.uplanet.cacheop-wbxml -# application/vnd.uplanet.channel -# application/vnd.uplanet.channel-wbxml -# application/vnd.uplanet.list -# application/vnd.uplanet.list-wbxml -# application/vnd.uplanet.listcmd -# application/vnd.uplanet.listcmd-wbxml -# application/vnd.uplanet.signal -application/vnd.vcx vcx -# application/vnd.vd-study -# application/vnd.vectorworks -# application/vnd.verimatrix.vcas -# application/vnd.vidsoft.vidconference -application/vnd.visio vsd vst vss vsw -application/vnd.visionary vis -# application/vnd.vividence.scriptfile -application/vnd.vsf vsf -# application/vnd.wap.sic -# application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo wtb -# application/vnd.wfa.wsc -# application/vnd.wmc -# application/vnd.wmf.bootstrap -# application/vnd.wolfram.mathematica -# application/vnd.wolfram.mathematica.package -application/vnd.wolfram.player nbp -application/vnd.wordperfect wpd -application/vnd.wqd wqd -# application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf stf -# application/vnd.wv.csp+wbxml -# application/vnd.wv.csp+xml -# application/vnd.wv.ssp+xml -application/vnd.xara xar -application/vnd.xfdl xfdl -# application/vnd.xfdl.webform -# application/vnd.xmi+xml -# application/vnd.xmpie.cpkg -# application/vnd.xmpie.dpkg -# application/vnd.xmpie.plan -# application/vnd.xmpie.ppkg -# application/vnd.xmpie.xlim -application/vnd.yamaha.hv-dic hvd -application/vnd.yamaha.hv-script hvs -application/vnd.yamaha.hv-voice hvp -application/vnd.yamaha.openscoreformat osf -application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg -# application/vnd.yamaha.remote-setup -application/vnd.yamaha.smaf-audio saf -application/vnd.yamaha.smaf-phrase spf -# application/vnd.yamaha.tunnel-udpencap -application/vnd.yellowriver-custom-menu cmp -application/vnd.zul zir zirz -application/vnd.zzazz.deck+xml zaz -application/voicexml+xml vxml -# application/vq-rtcpxr -# application/watcherinfo+xml -# application/whoispp-query -# application/whoispp-response -application/widget wgt -application/winhlp hlp -# application/wita -# application/wordperfect5.1 -application/wsdl+xml wsdl -application/wspolicy+xml wspolicy -application/x-7z-compressed 7z -application/x-abiword abw -application/x-ace-compressed ace -application/x-authorware-bin aab x32 u32 vox -application/x-authorware-map aam -application/x-authorware-seg aas -application/x-bcpio bcpio -application/x-bittorrent torrent -application/x-bzip bz -application/x-bzip2 bz2 boz -application/x-cdlink vcd -application/x-chat chat -application/x-chess-pgn pgn -# application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-debian-package deb udeb -application/x-director dir dcr dxr cst cct cxt w3d fgd swa -application/x-doom wad -application/x-dtbncx+xml ncx -application/x-dtbook+xml dtb -application/x-dtbresource+xml res -application/x-dvi dvi -application/x-font-bdf bdf -# application/x-font-dos -# application/x-font-framemaker -application/x-font-ghostscript gsf -# application/x-font-libgrx -application/x-font-linux-psf psf -application/x-font-otf otf -application/x-font-pcf pcf -application/x-font-snf snf -# application/x-font-speedo -# application/x-font-sunos-news -application/x-font-ttf ttf ttc -application/x-font-type1 pfa pfb pfm afm -application/x-font-woff woff -# application/x-font-vfont -application/x-futuresplash spl -application/x-gnumeric gnumeric -application/x-gtar gtar -# application/x-gzip -application/x-hdf hdf -application/x-java-jnlp-file jnlp -application/x-latex latex -application/x-mobipocket-ebook prc mobi -application/x-ms-application application -application/x-ms-wmd wmd -application/x-ms-wmz wmz -application/x-ms-xbap xbap -application/x-msaccess mdb -application/x-msbinder obd -application/x-mscardfile crd -application/x-msclip clp -application/x-msdownload exe dll com bat msi -application/x-msmediaview mvb m13 m14 -application/x-msmetafile wmf -application/x-msmoney mny -application/x-mspublisher pub -application/x-msschedule scd -application/x-msterminal trm -application/x-mswrite wri -application/x-netcdf nc cdf -application/x-pkcs12 p12 pfx -application/x-pkcs7-certificates p7b spc -application/x-pkcs7-certreqresp p7r -application/x-rar-compressed rar -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-silverlight-app xap -application/x-stuffit sit -application/x-stuffitx sitx -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-tex-tfm tfm -application/x-texinfo texinfo texi -application/x-ustar ustar -application/x-wais-source src -application/x-x509-ca-cert der crt -application/x-xfig fig -application/x-xpinstall xpi -# application/x400-bp -# application/xcap-att+xml -# application/xcap-caps+xml -application/xcap-diff+xml xdf -# application/xcap-el+xml -# application/xcap-error+xml -# application/xcap-ns+xml -# application/xcon-conference-info-diff+xml -# application/xcon-conference-info+xml -application/xenc+xml xenc -application/xhtml+xml xhtml xht -# application/xhtml-voice+xml -application/xml xml xsl -application/xml-dtd dtd -# application/xml-external-parsed-entity -# application/xmpp+xml -application/xop+xml xop -application/xslt+xml xslt -application/xspf+xml xspf -application/xv+xml mxml xhvml xvml xvm -application/yang yang -application/yin+xml yin -application/zip zip -# audio/1d-interleaved-parityfec -# audio/32kadpcm -# audio/3gpp -# audio/3gpp2 -# audio/ac3 -audio/adpcm adp -# audio/amr -# audio/amr-wb -# audio/amr-wb+ -# audio/asc -# audio/atrac-advanced-lossless -# audio/atrac-x -# audio/atrac3 -audio/basic au snd -# audio/bv16 -# audio/bv32 -# audio/clearmode -# audio/cn -# audio/dat12 -# audio/dls -# audio/dsr-es201108 -# audio/dsr-es202050 -# audio/dsr-es202211 -# audio/dsr-es202212 -# audio/dvi4 -# audio/eac3 -# audio/evrc -# audio/evrc-qcp -# audio/evrc0 -# audio/evrc1 -# audio/evrcb -# audio/evrcb0 -# audio/evrcb1 -# audio/evrcwb -# audio/evrcwb0 -# audio/evrcwb1 -# audio/example -# audio/g719 -# audio/g722 -# audio/g7221 -# audio/g723 -# audio/g726-16 -# audio/g726-24 -# audio/g726-32 -# audio/g726-40 -# audio/g728 -# audio/g729 -# audio/g7291 -# audio/g729d -# audio/g729e -# audio/gsm -# audio/gsm-efr -# audio/gsm-hr-08 -# audio/ilbc -# audio/l16 -# audio/l20 -# audio/l24 -# audio/l8 -# audio/lpc -audio/midi mid midi kar rmi -# audio/mobile-xmf -audio/mp4 mp4a -# audio/mp4a-latm -# audio/mpa -# audio/mpa-robust -audio/mpeg mpga mp2 mp2a mp3 m2a m3a -# audio/mpeg4-generic -audio/ogg oga ogg spx -# audio/parityfec -# audio/pcma -# audio/pcma-wb -# audio/pcmu-wb -# audio/pcmu -# audio/prs.sid -# audio/qcelp -# audio/red -# audio/rtp-enc-aescm128 -# audio/rtp-midi -# audio/rtx -# audio/smv -# audio/smv0 -# audio/smv-qcp -# audio/sp-midi -# audio/speex -# audio/t140c -# audio/t38 -# audio/telephone-event -# audio/tone -# audio/uemclip -# audio/ulpfec -# audio/vdvi -# audio/vmr-wb -# audio/vnd.3gpp.iufp -# audio/vnd.4sb -# audio/vnd.audiokoz -# audio/vnd.celp -# audio/vnd.cisco.nse -# audio/vnd.cmles.radio-events -# audio/vnd.cns.anp1 -# audio/vnd.cns.inf1 -audio/vnd.dece.audio uva uvva -audio/vnd.digital-winds eol -# audio/vnd.dlna.adts -# audio/vnd.dolby.heaac.1 -# audio/vnd.dolby.heaac.2 -# audio/vnd.dolby.mlp -# audio/vnd.dolby.mps -# audio/vnd.dolby.pl2 -# audio/vnd.dolby.pl2x -# audio/vnd.dolby.pl2z -# audio/vnd.dolby.pulse.1 -audio/vnd.dra dra -audio/vnd.dts dts -audio/vnd.dts.hd dtshd -# audio/vnd.everad.plj -# audio/vnd.hns.audio -audio/vnd.lucent.voice lvp -audio/vnd.ms-playready.media.pya pya -# audio/vnd.nokia.mobile-xmf -# audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 ecelp4800 -audio/vnd.nuera.ecelp7470 ecelp7470 -audio/vnd.nuera.ecelp9600 ecelp9600 -# audio/vnd.octel.sbc -# audio/vnd.qcelp -# audio/vnd.rhetorex.32kadpcm -audio/vnd.rip rip -# audio/vnd.sealedmedia.softseal.mpeg -# audio/vnd.vmx.cvsd -# audio/vorbis -# audio/vorbis-config -audio/webm weba -audio/x-aac aac -audio/x-aiff aif aiff aifc -audio/x-mpegurl m3u -audio/x-ms-wax wax -audio/x-ms-wma wma -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin rmp -audio/x-wav wav -chemical/x-cdx cdx -chemical/x-cif cif -chemical/x-cmdf cmdf -chemical/x-cml cml -chemical/x-csml csml -# chemical/x-pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -# image/example -# image/fits -image/g3fax g3 -image/gif gif -image/ief ief -# image/jp2 -image/jpeg jpeg jpg jpe -# image/jpm -# image/jpx -image/ktx ktx -# image/naplps -image/png png -image/prs.btif btif -# image/prs.pti -image/svg+xml svg svgz -# image/t38 -image/tiff tiff tif -# image/tiff-fx -image/vnd.adobe.photoshop psd -# image/vnd.cns.inf2 -image/vnd.dece.graphic uvi uvvi uvg uvvg -image/vnd.dvb.subtitle sub -image/vnd.djvu djvu djv -image/vnd.dwg dwg -image/vnd.dxf dxf -image/vnd.fastbidsheet fbs -image/vnd.fpx fpx -image/vnd.fst fst -image/vnd.fujixerox.edmics-mmr mmr -image/vnd.fujixerox.edmics-rlc rlc -# image/vnd.globalgraphics.pgb -# image/vnd.microsoft.icon -# image/vnd.mix -image/vnd.ms-modi mdi -image/vnd.net-fpx npx -# image/vnd.radiance -# image/vnd.sealed.png -# image/vnd.sealedmedia.softseal.gif -# image/vnd.sealedmedia.softseal.jpg -# image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff xif -image/webp webp -image/x-cmu-raster ras -image/x-cmx cmx -image/x-freehand fh fhc fh4 fh5 fh7 -image/x-icon ico -image/x-pcx pcx -image/x-pict pic pct -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -# message/cpim -# message/delivery-status -# message/disposition-notification -# message/example -# message/external-body -# message/feedback-report -# message/global -# message/global-delivery-status -# message/global-disposition-notification -# message/global-headers -# message/http -# message/imdn+xml -# message/news -# message/partial -message/rfc822 eml mime -# message/s-http -# message/sip -# message/sipfrag -# message/tracking-status -# message/vnd.si.simp -# model/example -model/iges igs iges -model/mesh msh mesh silo -model/vnd.collada+xml dae -model/vnd.dwf dwf -# model/vnd.flatland.3dml -model/vnd.gdl gdl -# model/vnd.gs-gdl -# model/vnd.gs.gdl -model/vnd.gtw gtw -# model/vnd.moml+xml -model/vnd.mts mts -# model/vnd.parasolid.transmit.binary -# model/vnd.parasolid.transmit.text -model/vnd.vtu vtu -model/vrml wrl vrml -# multipart/alternative -# multipart/appledouble -# multipart/byteranges -# multipart/digest -# multipart/encrypted -# multipart/example -# multipart/form-data -# multipart/header-set -# multipart/mixed -# multipart/parallel -# multipart/related -# multipart/report -# multipart/signed -# multipart/voice-message -# text/1d-interleaved-parityfec -text/calendar ics ifb -text/css css -text/csv csv -# text/directory -# text/dns -# text/ecmascript -# text/enriched -# text/example -text/html html htm -# text/javascript -text/n3 n3 -# text/parityfec -text/plain txt text conf def list log in -# text/prs.fallenstein.rst -text/prs.lines.tag dsc -# text/vnd.radisys.msml-basic-layout -# text/red -# text/rfc822-headers -text/richtext rtx -# text/rtf -# text/rtp-enc-aescm128 -# text/rtx -text/sgml sgml sgm -# text/t140 -text/tab-separated-values tsv -text/troff t tr roff man me ms -text/turtle ttl -# text/ulpfec -text/uri-list uri uris urls -# text/vnd.abc -text/vnd.curl curl -text/vnd.curl.dcurl dcurl -text/vnd.curl.scurl scurl -text/vnd.curl.mcurl mcurl -# text/vnd.dmclientscript -# text/vnd.esmertec.theme-descriptor -text/vnd.fly fly -text/vnd.fmi.flexstor flx -text/vnd.graphviz gv -text/vnd.in3d.3dml 3dml -text/vnd.in3d.spot spot -# text/vnd.iptc.newsml -# text/vnd.iptc.nitf -# text/vnd.latex-z -# text/vnd.motorola.reflex -# text/vnd.ms-mediapackage -# text/vnd.net2phone.commcenter.command -# text/vnd.si.uricatalogue -text/vnd.sun.j2me.app-descriptor jad -# text/vnd.trolltech.linguist -# text/vnd.wap.si -# text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-asm s asm -text/x-c c cc cxx cpp h hh dic -text/x-fortran f for f77 f90 -text/x-pascal p pas -text/x-java-source java -text/x-setext etx -text/x-uuencode uu -text/x-vcalendar vcs -text/x-vcard vcf -# text/xml -# text/xml-external-parsed-entity -# video/1d-interleaved-parityfec -video/3gpp 3gp -# video/3gpp-tt -video/3gpp2 3g2 -# video/bmpeg -# video/bt656 -# video/celb -# video/dv -# video/example -video/h261 h261 -video/h263 h263 -# video/h263-1998 -# video/h263-2000 -video/h264 h264 -# video/h264-rcdo -# video/h264-svc -video/jpeg jpgv -# video/jpeg2000 -video/jpm jpm jpgm -video/mj2 mj2 mjp2 -# video/mp1s -# video/mp2p -# video/mp2t -video/mp4 mp4 mp4v mpg4 -# video/mp4v-es -video/mpeg mpeg mpg mpe m1v m2v -# video/mpeg4-generic -# video/mpv -# video/nv -video/ogg ogv -# video/parityfec -# video/pointer -video/quicktime qt mov -# video/raw -# video/rtp-enc-aescm128 -# video/rtx -# video/smpte292m -# video/ulpfec -# video/vc1 -# video/vnd.cctv -video/vnd.dece.hd uvh uvvh -video/vnd.dece.mobile uvm uvvm -# video/vnd.dece.mp4 -video/vnd.dece.pd uvp uvvp -video/vnd.dece.sd uvs uvvs -video/vnd.dece.video uvv uvvv -# video/vnd.directv.mpeg -# video/vnd.directv.mpeg-tts -# video/vnd.dlna.mpeg-tts -video/vnd.fvt fvt -# video/vnd.hns.video -# video/vnd.iptvforum.1dparityfec-1010 -# video/vnd.iptvforum.1dparityfec-2005 -# video/vnd.iptvforum.2dparityfec-1010 -# video/vnd.iptvforum.2dparityfec-2005 -# video/vnd.iptvforum.ttsavc -# video/vnd.iptvforum.ttsmpeg2 -# video/vnd.motorola.video -# video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.ms-playready.media.pyv pyv -# video/vnd.nokia.interleaved-multimedia -# video/vnd.nokia.videovoip -# video/vnd.objectvideo -# video/vnd.sealed.mpeg1 -# video/vnd.sealed.mpeg4 -# video/vnd.sealed.swf -# video/vnd.sealedmedia.softseal.mov -video/vnd.uvvu.mp4 uvu uvvu -video/vnd.vivo viv -video/webm webm -video/x-f4v f4v -video/x-fli fli -video/x-flv flv -video/x-m4v m4v -video/x-ms-asf asf asx -video/x-ms-wm wm -video/x-ms-wmv wmv -video/x-ms-wmx wmx -video/x-ms-wvx wvx -video/x-msvideo avi -video/x-sgi-movie movie -x-conference/x-cooltalk ice diff --git a/usb_auth/node_modules/express/node_modules/mime/types/node.types b/usb_auth/node_modules/express/node_modules/mime/types/node.types deleted file mode 100644 index fdabaa4..0000000 --- a/usb_auth/node_modules/express/node_modules/mime/types/node.types +++ /dev/null @@ -1,43 +0,0 @@ -# What: Google Chrome Extension -# Why: To allow apps to (work) be served with the right content type header. -# http://codereview.chromium.org/2830017 -# Added by: niftylettuce -application/x-chrome-extension crx - -# What: OTF Message Silencer -# Why: To silence the "Resource interpreted as font but transferred with MIME -# type font/otf" message that occurs in Google Chrome -# Added by: niftylettuce -font/opentype otf - -# What: HTC support -# Why: To properly render .htc files such as CSS3PIE -# Added by: niftylettuce -text/x-component htc - -# What: HTML5 application cache manifest -# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps -# per https://developer.mozilla.org/en/offline_resources_in_firefox -# Added by: louisremi -text/cache-manifest appcache manifest - -# What: node binary buffer format -# Why: semi-standard extension w/in the node community -# Added by: tootallnate -application/octet-stream buffer - -# What: The "protected" MP-4 formats used by iTunes. -# Why: Required for streaming music to browsers (?) -# Added by: broofa -application/mp4 m4p -audio/mp4 m4a - -# What: Music playlist format (http://en.wikipedia.org/wiki/M3U) -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -application/x-mpegURL m3u8 - -# What: Video format, Part of RFC1890 -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -video/MP2T ts diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.orig b/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.orig deleted file mode 100644 index 9303c34..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.orig +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.rej b/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.rej deleted file mode 100644 index 69244ff..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/.gitignore.rej +++ /dev/null @@ -1,5 +0,0 @@ ---- /dev/null -+++ .gitignore -@@ -0,0 +1,2 @@ -+node_modules/ -+npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/.npmignore b/usb_auth/node_modules/express/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/LICENSE b/usb_auth/node_modules/express/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/README.markdown b/usb_auth/node_modules/express/node_modules/mkdirp/README.markdown deleted file mode 100644 index b4dd75f..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/README.markdown +++ /dev/null @@ -1,54 +0,0 @@ -mkdirp -====== - -Like `mkdir -p`, but in node.js! - -example -======= - -pow.js ------- - var mkdirp = require('mkdirp'); - - mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') - }); - -Output - pow! - -And now /tmp/foo/bar/baz exists, huzzah! - -methods -======= - -var mkdirp = require('mkdirp'); - -mkdirp(dir, mode, cb) ---------------------- - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -mkdirp.sync(dir, mode) ----------------------- - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -install -======= - -With [npm](http://npmjs.org) do: - - npm install mkdirp - -license -======= - -MIT/X11 diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js b/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.orig b/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.orig deleted file mode 100644 index 7741462..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.rej b/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.rej deleted file mode 100644 index 81e7f43..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +++ /dev/null @@ -1,19 +0,0 @@ ---- examples/pow.js -+++ examples/pow.js -@@ -1,6 +1,15 @@ --var mkdirp = require('mkdirp').mkdirp; -+var mkdirp = require('../').mkdirp, -+ mkdirpSync = require('../').mkdirpSync; - - mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') - }); -+ -+try { -+ mkdirpSync('/tmp/bar/foo/baz', 0755); -+ console.log('double pow!'); -+} -+catch (ex) { -+ console.log(ex); -+} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/index.js b/usb_auth/node_modules/express/node_modules/mkdirp/index.js deleted file mode 100644 index 25f43ad..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/index.js +++ /dev/null @@ -1,79 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) return cb(); - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er) { - if (er) cb(er); - else mkdirP(p, mode, cb); - }); - break; - - case 'EEXIST': - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original EEXIST be the failure reason. - if (er2 || !stat.isDirectory()) cb(er) - else cb(); - }); - break; - - default: - cb(er); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode) - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - var err1 = sync(path.dirname(p), mode) - if (err1) throw err1; - else return sync(p, mode); - break; - - case 'EEXIST' : - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0 - } - if (!stat.isDirectory()) throw err0; - else return null; - break; - default : - throw err0 - break; - } - } - - return null; -}; diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/package.json b/usb_auth/node_modules/express/node_modules/mkdirp/package.json deleted file mode 100644 index 1bf9ac7..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name" : "mkdirp", - "description" : "Recursively mkdir, like `mkdir -p`", - "version" : "0.3.0", - "author" : "James Halliday (http://substack.net)", - "main" : "./index", - "keywords" : [ - "mkdir", - "directory" - ], - "repository" : { - "type" : "git", - "url" : "http://github.com/substack/node-mkdirp.git" - }, - "scripts" : { - "test" : "tap test/*.js" - }, - "devDependencies" : { - "tap" : "0.0.x" - }, - "license" : "MIT/X11", - "engines": { "node": "*" } -} diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/chmod.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/clobber.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/mkdirp.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/perm.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/perm_sync.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/race.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/rel.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/sync.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/sync.js deleted file mode 100644 index e0e389d..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file, 0755); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/umask.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/usb_auth/node_modules/express/node_modules/mkdirp/test/umask_sync.js b/usb_auth/node_modules/express/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 83cba56..0000000 --- a/usb_auth/node_modules/express/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/usb_auth/node_modules/express/node_modules/qs/.gitmodules b/usb_auth/node_modules/express/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31da..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "support/expresso"] - path = support/expresso - url = git://github.com/visionmedia/expresso.git -[submodule "support/should"] - path = support/should - url = git://github.com/visionmedia/should.js.git diff --git a/usb_auth/node_modules/express/node_modules/qs/.npmignore b/usb_auth/node_modules/express/node_modules/qs/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/usb_auth/node_modules/express/node_modules/qs/.travis.yml b/usb_auth/node_modules/express/node_modules/qs/.travis.yml deleted file mode 100644 index 2c0a8f6..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.4 \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/History.md b/usb_auth/node_modules/express/node_modules/qs/History.md deleted file mode 100644 index 3eaf7df..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/History.md +++ /dev/null @@ -1,73 +0,0 @@ - -0.4.2 / 2012-02-08 -================== - - * Fixed: ensure objects are created when appropriate not arrays [aheckmann] - -0.4.1 / 2012-01-26 -================== - - * Fixed stringify()ing numbers. Closes #23 - -0.4.0 / 2011-11-21 -================== - - * Allow parsing of an existing object (for `bodyParser()`) [jackyz] - * Replaced expresso with mocha - -0.3.2 / 2011-11-08 -================== - - * Fixed global variable leak - -0.3.1 / 2011-08-17 -================== - - * Added `try/catch` around malformed uri components - * Add test coverage for Array native method bleed-though - -0.3.0 / 2011-07-19 -================== - - * Allow `array[index]` and `object[property]` syntaxes [Aria Stewart] - -0.2.0 / 2011-06-29 -================== - - * Added `qs.stringify()` [Cory Forsyth] - -0.1.0 / 2011-04-13 -================== - - * Added jQuery-ish array support - -0.0.7 / 2011-03-13 -================== - - * Fixed; handle empty string and `== null` in `qs.parse()` [dmit] - allows for convenient `qs.parse(url.parse(str).query)` - -0.0.6 / 2011-02-14 -================== - - * Fixed; support for implicit arrays - -0.0.4 / 2011-02-09 -================== - - * Fixed `+` as a space - -0.0.3 / 2011-02-08 -================== - - * Fixed case when right-hand value contains "]" - -0.0.2 / 2011-02-07 -================== - - * Fixed "=" presence in key - -0.0.1 / 2011-02-07 -================== - - * Initial release \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/Makefile b/usb_auth/node_modules/express/node_modules/qs/Makefile deleted file mode 100644 index e4df837..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @./node_modules/.bin/mocha - -.PHONY: test \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/Readme.md b/usb_auth/node_modules/express/node_modules/qs/Readme.md deleted file mode 100644 index db0d145..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/Readme.md +++ /dev/null @@ -1,54 +0,0 @@ -# node-querystring - - query string parser for node supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. - -## Installation - - $ npm install qs - -## Examples - -```js -var qs = require('qs'); - -qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); -// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } - -qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) -// => user[name]=Tobi&user[email]=tobi%40learnboost.com -``` - -## Testing - -Install dev dependencies: - - $ npm install -d - -and execute: - - $ make test - -## License - -(The MIT License) - -Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/benchmark.js b/usb_auth/node_modules/express/node_modules/qs/benchmark.js deleted file mode 100644 index 97e2c93..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/benchmark.js +++ /dev/null @@ -1,17 +0,0 @@ - -var qs = require('./'); - -var times = 100000 - , start = new Date - , n = times; - -console.log('times: %d', times); - -while (n--) qs.parse('foo=bar'); -console.log('simple: %dms', new Date - start); - -var start = new Date - , n = times; - -while (n--) qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); -console.log('nested: %dms', new Date - start); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/examples.js b/usb_auth/node_modules/express/node_modules/qs/examples.js deleted file mode 100644 index 27617b7..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/examples.js +++ /dev/null @@ -1,51 +0,0 @@ - -/** - * Module dependencies. - */ - -var qs = require('./'); - -var obj = qs.parse('foo'); -console.log(obj) - -var obj = qs.parse('foo=bar=baz'); -console.log(obj) - -var obj = qs.parse('users[]'); -console.log(obj) - -var obj = qs.parse('name=tj&email=tj@vision-media.ca'); -console.log(obj) - -var obj = qs.parse('users[]=tj&users[]=tobi&users[]=jane'); -console.log(obj) - -var obj = qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); -console.log(obj) - -var obj = qs.parse('users[][name][first]=tj&users[][name][last]=holowaychuk'); -console.log(obj) - -var obj = qs.parse('a=a&a=b&a=c'); -console.log(obj) - -var obj = qs.parse('user[tj]=tj&user[tj]=TJ'); -console.log(obj) - -var obj = qs.parse('user[names]=tj&user[names]=TJ&user[names]=Tyler'); -console.log(obj) - -var obj = qs.parse('user[name][first]=tj&user[name][first]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[1]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[foo]=TJ'); -console.log(obj) - -var str = qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}); -console.log(str); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/index.js b/usb_auth/node_modules/express/node_modules/qs/index.js deleted file mode 100644 index d177d20..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/querystring'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/lib/querystring.js b/usb_auth/node_modules/express/node_modules/qs/lib/querystring.js deleted file mode 100644 index 6c72712..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/lib/querystring.js +++ /dev/null @@ -1,264 +0,0 @@ - -/*! - * querystring - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Library version. - */ - -exports.version = '0.4.2'; - -/** - * Object#toString() ref for stringify(). - */ - -var toString = Object.prototype.toString; - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = {}; - var t = {}; - for (var i in parent[key]) t[i] = parent[key][i]; - parent[key] = t; - return t; -} - -function parse(parts, parent, key, val) { - var part = parts.shift(); - // end - if (!part) { - if (Array.isArray(parent[key])) { - parent[key].push(val); - } else if ('object' == typeof parent[key]) { - parent[key] = val; - } else if ('undefined' == typeof parent[key]) { - parent[key] = val; - } else { - parent[key] = [parent[key], val]; - } - // array - } else { - var obj = parent[key] = parent[key] || []; - if (']' == part) { - if (Array.isArray(obj)) { - if ('' != val) obj.push(val); - } else if ('object' == typeof obj) { - obj[Object.keys(obj).length] = val; - } else { - obj = parent[key] = [parent[key], val]; - } - // prop - } else if (~part.indexOf(']')) { - part = part.substr(0, part.length - 1); - if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - // key - } else { - if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - } - } -} - -/** - * Merge parent key/val pair. - */ - -function merge(parent, key, val){ - if (~key.indexOf(']')) { - var parts = key.split('[') - , len = parts.length - , last = len - 1; - parse(parts, parent, 'base', val); - // optimize - } else { - if (!isint.test(key) && Array.isArray(parent.base)) { - var t = {}; - for (var k in parent.base) t[k] = parent.base[k]; - parent.base = t; - } - set(parent.base, key, val); - } - - return parent; -} - -/** - * Parse the given obj. - */ - -function parseObject(obj){ - var ret = { base: {} }; - Object.keys(obj).forEach(function(name){ - merge(ret, name, obj[name]); - }); - return ret.base; -} - -/** - * Parse the given str. - */ - -function parseString(str){ - return String(str) - .split('&') - .reduce(function(ret, pair){ - try{ - pair = decodeURIComponent(pair.replace(/\+/g, ' ')); - } catch(e) { - // ignore - } - - var eql = pair.indexOf('=') - , brace = lastBraceInKey(pair) - , key = pair.substr(0, brace || eql) - , val = pair.substr(brace || eql, pair.length) - , val = val.substr(val.indexOf('=') + 1, val.length); - - // ?foo - if ('' == key) key = pair, val = ''; - - return merge(ret, key, val); - }, { base: {} }).base; -} - -/** - * Parse the given query `str` or `obj`, returning an object. - * - * @param {String} str | {Object} obj - * @return {Object} - * @api public - */ - -exports.parse = function(str){ - if (null == str || '' == str) return {}; - return 'object' == typeof str - ? parseObject(str) - : parseString(str); -}; - -/** - * Turn the given `obj` into a query string - * - * @param {Object} obj - * @return {String} - * @api public - */ - -var stringify = exports.stringify = function(obj, prefix) { - if (Array.isArray(obj)) { - return stringifyArray(obj, prefix); - } else if ('[object Object]' == toString.call(obj)) { - return stringifyObject(obj, prefix); - } else if ('string' == typeof obj) { - return stringifyString(obj, prefix); - } else { - return prefix + '=' + obj; - } -}; - -/** - * Stringify the given `str`. - * - * @param {String} str - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyString(str, prefix) { - if (!prefix) throw new TypeError('stringify expects an object'); - return prefix + '=' + encodeURIComponent(str); -} - -/** - * Stringify the given `arr`. - * - * @param {Array} arr - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyArray(arr, prefix) { - var ret = []; - if (!prefix) throw new TypeError('stringify expects an object'); - for (var i = 0; i < arr.length; i++) { - ret.push(stringify(arr[i], prefix + '[]')); - } - return ret.join('&'); -} - -/** - * Stringify the given `obj`. - * - * @param {Object} obj - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyObject(obj, prefix) { - var ret = [] - , keys = Object.keys(obj) - , key; - - for (var i = 0, len = keys.length; i < len; ++i) { - key = keys[i]; - ret.push(stringify(obj[key], prefix - ? prefix + '[' + encodeURIComponent(key) + ']' - : encodeURIComponent(key))); - } - - return ret.join('&'); -} - -/** - * Set `obj`'s `key` to `val` respecting - * the weird and wonderful syntax of a qs, - * where "foo=bar&foo=baz" becomes an array. - * - * @param {Object} obj - * @param {String} key - * @param {String} val - * @api private - */ - -function set(obj, key, val) { - var v = obj[key]; - if (undefined === v) { - obj[key] = val; - } else if (Array.isArray(v)) { - v.push(val); - } else { - obj[key] = [v, val]; - } -} - -/** - * Locate last brace in `str` within the key. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function lastBraceInKey(str) { - var len = str.length - , brace - , c; - for (var i = 0; i < len; ++i) { - c = str[i]; - if (']' == c) brace = false; - if ('[' == c) brace = true; - if ('=' == c && !brace) return i; - } -} diff --git a/usb_auth/node_modules/express/node_modules/qs/package.json b/usb_auth/node_modules/express/node_modules/qs/package.json deleted file mode 100644 index 68dd5a6..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.4.2", - "repository": { - "type" : "git", - "url" : "git://github.com/visionmedia/node-querystring.git" - }, - "devDependencies": { - "mocha": "*" - , "should": "*" - }, - "author": "TJ Holowaychuk (http://tjholowaychuk.com)", - "main": "index", - "engines": { "node": "*" } -} \ No newline at end of file diff --git a/usb_auth/node_modules/express/node_modules/qs/test/mocha.opts b/usb_auth/node_modules/express/node_modules/qs/test/mocha.opts deleted file mode 100644 index 521cbb2..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/test/mocha.opts +++ /dev/null @@ -1,2 +0,0 @@ ---require should ---ui exports diff --git a/usb_auth/node_modules/express/node_modules/qs/test/parse.js b/usb_auth/node_modules/express/node_modules/qs/test/parse.js deleted file mode 100644 index f219e27..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/test/parse.js +++ /dev/null @@ -1,167 +0,0 @@ - -/** - * Module dependencies. - */ - -var qs = require('../'); - -module.exports = { - 'test basics': function(){ - qs.parse('0=foo').should.eql({ '0': 'foo' }); - - qs.parse('foo=c++') - .should.eql({ foo: 'c ' }); - - qs.parse('a[>=]=23') - .should.eql({ a: { '>=': '23' }}); - - qs.parse('a[<=>]==23') - .should.eql({ a: { '<=>': '=23' }}); - - qs.parse('a[==]=23') - .should.eql({ a: { '==': '23' }}); - - qs.parse('foo') - .should.eql({ foo: '' }); - - qs.parse('foo=bar') - .should.eql({ foo: 'bar' }); - - qs.parse('foo%3Dbar=baz') - .should.eql({ foo: 'bar=baz' }); - - qs.parse(' foo = bar = baz ') - .should.eql({ ' foo ': ' bar = baz ' }); - - qs.parse('foo=bar=baz') - .should.eql({ foo: 'bar=baz' }); - - qs.parse('foo=bar&bar=baz') - .should.eql({ foo: 'bar', bar: 'baz' }); - - qs.parse('foo=bar&baz') - .should.eql({ foo: 'bar', baz: '' }); - - qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World') - .should.eql({ - cht: 'p3' - , chd: 't:60,40' - , chs: '250x100' - , chl: 'Hello|World' - }); - }, - - 'test nesting': function(){ - qs.parse('ops[>=]=25') - .should.eql({ ops: { '>=': '25' }}); - - qs.parse('user[name]=tj') - .should.eql({ user: { name: 'tj' }}); - - qs.parse('user[name][first]=tj&user[name][last]=holowaychuk') - .should.eql({ user: { name: { first: 'tj', last: 'holowaychuk' }}}); - }, - - 'test escaping': function(){ - qs.parse('foo=foo%20bar') - .should.eql({ foo: 'foo bar' }); - }, - - 'test arrays': function(){ - qs.parse('images[]') - .should.eql({ images: [] }); - - qs.parse('user[]=tj') - .should.eql({ user: ['tj'] }); - - qs.parse('user[]=tj&user[]=tobi&user[]=jane') - .should.eql({ user: ['tj', 'tobi', 'jane'] }); - - qs.parse('user[names][]=tj&user[names][]=tyler') - .should.eql({ user: { names: ['tj', 'tyler'] }}); - - qs.parse('user[names][]=tj&user[names][]=tyler&user[email]=tj@vision-media.ca') - .should.eql({ user: { names: ['tj', 'tyler'], email: 'tj@vision-media.ca' }}); - - qs.parse('items=a&items=b') - .should.eql({ items: ['a', 'b'] }); - - qs.parse('user[names]=tj&user[names]=holowaychuk&user[names]=TJ') - .should.eql({ user: { names: ['tj', 'holowaychuk', 'TJ'] }}); - - qs.parse('user[name][first]=tj&user[name][first]=TJ') - .should.eql({ user: { name: { first: ['tj', 'TJ'] }}}); - - var o = qs.parse('existing[fcbaebfecc][name][last]=tj') - o.should.eql({ existing: { 'fcbaebfecc': { name: { last: 'tj' }}}}) - Array.isArray(o.existing).should.be.false; - }, - - 'test right-hand brackets': function(){ - qs.parse('pets=["tobi"]') - .should.eql({ pets: '["tobi"]' }); - - qs.parse('operators=[">=", "<="]') - .should.eql({ operators: '[">=", "<="]' }); - - qs.parse('op[>=]=[1,2,3]') - .should.eql({ op: { '>=': '[1,2,3]' }}); - - qs.parse('op[>=]=[1,2,3]&op[=]=[[[[1]]]]') - .should.eql({ op: { '>=': '[1,2,3]', '=': '[[[[1]]]]' }}); - }, - - 'test duplicates': function(){ - qs.parse('items=bar&items=baz&items=raz') - .should.eql({ items: ['bar', 'baz', 'raz'] }); - }, - - 'test empty': function(){ - qs.parse('').should.eql({}); - qs.parse(undefined).should.eql({}); - qs.parse(null).should.eql({}); - }, - - 'test arrays with indexes': function(){ - qs.parse('foo[0]=bar&foo[1]=baz').should.eql({ foo: ['bar', 'baz'] }); - qs.parse('foo[1]=bar&foo[0]=baz').should.eql({ foo: ['baz', 'bar'] }); - qs.parse('foo[base64]=RAWR').should.eql({ foo: { base64: 'RAWR' }}); - qs.parse('foo[64base]=RAWR').should.eql({ foo: { '64base': 'RAWR' }}); - }, - - 'test arrays becoming objects': function(){ - qs.parse('foo[0]=bar&foo[bad]=baz').should.eql({ foo: { 0: "bar", bad: "baz" }}); - qs.parse('foo[bad]=baz&foo[0]=bar').should.eql({ foo: { 0: "bar", bad: "baz" }}); - }, - - 'test bleed-through of Array native properties/methods': function(){ - Array.prototype.protoProperty = true; - Array.prototype.protoFunction = function () {}; - qs.parse('foo=bar').should.eql({ foo: 'bar' }); - }, - - 'test malformed uri': function(){ - qs.parse('{%:%}').should.eql({ '{%:%}': '' }); - qs.parse('foo=%:%}').should.eql({ 'foo': '%:%}' }); - }, - - 'test semi-parsed': function(){ - qs.parse({ 'user[name]': 'tobi' }) - .should.eql({ user: { name: 'tobi' }}); - - qs.parse({ 'user[name]': 'tobi', 'user[email][main]': 'tobi@lb.com' }) - .should.eql({ user: { name: 'tobi', email: { main: 'tobi@lb.com' } }}); - } - - // 'test complex': function(){ - // qs.parse('users[][name][first]=tj&users[foo]=bar') - // .should.eql({ - // users: [ { name: 'tj' }, { name: 'tobi' }, { foo: 'bar' }] - // }); - // - // qs.parse('users[][name][first]=tj&users[][name][first]=tobi') - // .should.eql({ - // users: [ { name: 'tj' }, { name: 'tobi' }] - // }); - // } -}; diff --git a/usb_auth/node_modules/express/node_modules/qs/test/stringify.js b/usb_auth/node_modules/express/node_modules/qs/test/stringify.js deleted file mode 100644 index c2195cb..0000000 --- a/usb_auth/node_modules/express/node_modules/qs/test/stringify.js +++ /dev/null @@ -1,103 +0,0 @@ - -/** - * Module dependencies. - */ - -var qs = require('../') - , should = require('should') - , str_identities = { - 'basics': [ - { str: 'foo=bar', obj: {'foo' : 'bar'}}, - { str: 'foo=%22bar%22', obj: {'foo' : '\"bar\"'}}, - { str: 'foo=', obj: {'foo': ''}}, - { str: 'foo=1&bar=2', obj: {'foo' : '1', 'bar' : '2'}}, - { str: 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', obj: {'my weird field': "q1!2\"'w$5&7/z8)?"}}, - { str: 'foo%3Dbaz=bar', obj: {'foo=baz': 'bar'}}, - { str: 'foo=bar&bar=baz', obj: {foo: 'bar', bar: 'baz'}} - ], - 'escaping': [ - { str: 'foo=foo%20bar', obj: {foo: 'foo bar'}}, - { str: 'cht=p3&chd=t%3A60%2C40&chs=250x100&chl=Hello%7CWorld', obj: { - cht: 'p3' - , chd: 't:60,40' - , chs: '250x100' - , chl: 'Hello|World' - }} - ], - 'nested': [ - { str: 'foo[]=bar&foo[]=quux', obj: {'foo' : ['bar', 'quux']}}, - { str: 'foo[]=bar', obj: {foo: ['bar']}}, - { str: 'foo[]=1&foo[]=2', obj: {'foo' : ['1', '2']}}, - { str: 'foo=bar&baz[]=1&baz[]=2&baz[]=3', obj: {'foo' : 'bar', 'baz' : ['1', '2', '3']}}, - { str: 'foo[]=bar&baz[]=1&baz[]=2&baz[]=3', obj: {'foo' : ['bar'], 'baz' : ['1', '2', '3']}}, - { str: 'x[y][z]=1', obj: {'x' : {'y' : {'z' : '1'}}}}, - { str: 'x[y][z][]=1', obj: {'x' : {'y' : {'z' : ['1']}}}}, - { str: 'x[y][z]=2', obj: {'x' : {'y' : {'z' : '2'}}}}, - { str: 'x[y][z][]=1&x[y][z][]=2', obj: {'x' : {'y' : {'z' : ['1', '2']}}}}, - { str: 'x[y][][z]=1', obj: {'x' : {'y' : [{'z' : '1'}]}}}, - { str: 'x[y][][z][]=1', obj: {'x' : {'y' : [{'z' : ['1']}]}}}, - { str: 'x[y][][z]=1&x[y][][w]=2', obj: {'x' : {'y' : [{'z' : '1', 'w' : '2'}]}}}, - { str: 'x[y][][v][w]=1', obj: {'x' : {'y' : [{'v' : {'w' : '1'}}]}}}, - { str: 'x[y][][z]=1&x[y][][v][w]=2', obj: {'x' : {'y' : [{'z' : '1', 'v' : {'w' : '2'}}]}}}, - { str: 'x[y][][z]=1&x[y][][z]=2', obj: {'x' : {'y' : [{'z' : '1'}, {'z' : '2'}]}}}, - { str: 'x[y][][z]=1&x[y][][w]=a&x[y][][z]=2&x[y][][w]=3', obj: {'x' : {'y' : [{'z' : '1', 'w' : 'a'}, {'z' : '2', 'w' : '3'}]}}}, - { str: 'user[name][first]=tj&user[name][last]=holowaychuk', obj: { user: { name: { first: 'tj', last: 'holowaychuk' }}}} - ], - 'errors': [ - { obj: 'foo=bar', message: 'stringify expects an object' }, - { obj: ['foo', 'bar'], message: 'stringify expects an object' } - ], - 'numbers': [ - { str: 'limit[]=1&limit[]=2&limit[]=3', obj: { limit: [1, 2, '3'] }}, - { str: 'limit=1', obj: { limit: 1 }} - ] - }; - - -// Assert error -function err(fn, msg){ - var err; - try { - fn(); - } catch (e) { - should.equal(e.message, msg); - return; - } - throw new Error('no exception thrown, expected "' + msg + '"'); -} - -function test(type) { - var str, obj; - for (var i = 0; i < str_identities[type].length; i++) { - str = str_identities[type][i].str; - obj = str_identities[type][i].obj; - qs.stringify(obj).should.eql(str); - } -} - -module.exports = { - 'test basics': function() { - test('basics'); - }, - - 'test escaping': function() { - test('escaping'); - }, - - 'test nested': function() { - test('nested'); - }, - - 'test numbers': function(){ - test('numbers'); - }, - - 'test errors': function() { - var obj, message; - for (var i = 0; i < str_identities['errors'].length; i++) { - message = str_identities['errors'][i].message; - obj = str_identities['errors'][i].obj; - err(function(){ qs.stringify(obj) }, message); - } - } -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/package.json b/usb_auth/node_modules/express/package.json deleted file mode 100644 index 6675674..0000000 --- a/usb_auth/node_modules/express/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "express", - "description": "Sinatra inspired web development framework", - "version": "2.5.8", - "author": "TJ Holowaychuk ", - "contributors": [ - { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, - { "name": "Aaron Heckmann", "email": "aaron.heckmann+github@gmail.com" }, - { "name": "Ciaran Jessup", "email": "ciaranj@gmail.com" }, - { "name": "Guillermo Rauch", "email": "rauchg@gmail.com" } - ], - "dependencies": { - "connect": "1.x", - "mime": "1.2.4", - "qs": "0.4.x", - "mkdirp": "0.3.0" - }, - "devDependencies": { - "connect-form": "0.2.1", - "ejs": "0.4.2", - "expresso": "0.9.2", - "hamljs": "0.6.x", - "jade": "0.16.2", - "stylus": "0.13.0", - "should": "0.3.2", - "express-messages": "0.0.2", - "node-markdown": ">= 0.0.1", - "connect-redis": ">= 0.0.1" - }, - "keywords": ["framework", "sinatra", "web", "rest", "restful"], - "repository": "git://github.com/visionmedia/express", - "main": "index", - "bin": { "express": "./bin/express" }, - "scripts": { - "test": "make test", - "prepublish" : "npm prune" - }, - "engines": { "node": ">= 0.4.1 < 0.7.0" } -} \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/app.js b/usb_auth/node_modules/express/testing/foo/app.js deleted file mode 100644 index 7574676..0000000 --- a/usb_auth/node_modules/express/testing/foo/app.js +++ /dev/null @@ -1,35 +0,0 @@ - -/** - * Module dependencies. - */ - -var express = require('express') - , routes = require('./routes') - -var app = module.exports = express.createServer(); - -// Configuration - -app.configure(function(){ - app.set('views', __dirname + '/views'); - app.set('view engine', 'jade'); - app.use(express.bodyParser()); - app.use(express.methodOverride()); - app.use(app.router); - app.use(express.static(__dirname + '/public')); -}); - -app.configure('development', function(){ - app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); -}); - -app.configure('production', function(){ - app.use(express.errorHandler()); -}); - -// Routes - -app.get('/', routes.index); - -app.listen(3000); -console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); diff --git a/usb_auth/node_modules/express/testing/foo/package.json b/usb_auth/node_modules/express/testing/foo/package.json deleted file mode 100644 index dd54123..0000000 --- a/usb_auth/node_modules/express/testing/foo/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "application-name" - , "version": "0.0.1" - , "private": true - , "dependencies": { - "express": "2.5.0" - , "jade": ">= 0.0.1" - } -} \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/public/stylesheets/style.css b/usb_auth/node_modules/express/testing/foo/public/stylesheets/style.css deleted file mode 100644 index 30e047d..0000000 --- a/usb_auth/node_modules/express/testing/foo/public/stylesheets/style.css +++ /dev/null @@ -1,8 +0,0 @@ -body { - padding: 50px; - font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; -} - -a { - color: #00B7FF; -} \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/routes/index.js b/usb_auth/node_modules/express/testing/foo/routes/index.js deleted file mode 100644 index 0b2205c..0000000 --- a/usb_auth/node_modules/express/testing/foo/routes/index.js +++ /dev/null @@ -1,10 +0,0 @@ - -/* - * GET home page. - */ - -exports.index = function(req, res){ - res.writeHead(200); - req.doesnotexist(); - // res.render('index', { title: 'Express' }) -}; \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/views/index.jade b/usb_auth/node_modules/express/testing/foo/views/index.jade deleted file mode 100644 index c9c35fa..0000000 --- a/usb_auth/node_modules/express/testing/foo/views/index.jade +++ /dev/null @@ -1,2 +0,0 @@ -h1= title -p Welcome to #{title} \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/foo/views/layout.jade b/usb_auth/node_modules/express/testing/foo/views/layout.jade deleted file mode 100644 index 1a36941..0000000 --- a/usb_auth/node_modules/express/testing/foo/views/layout.jade +++ /dev/null @@ -1,6 +0,0 @@ -!!! -html - head - title= title - link(rel='stylesheet', href='/stylesheets/style.css') - body!= body \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/index.js b/usb_auth/node_modules/express/testing/index.js deleted file mode 100644 index 3c5185d..0000000 --- a/usb_auth/node_modules/express/testing/index.js +++ /dev/null @@ -1,43 +0,0 @@ - -/** - * Module dependencies. - */ - -var express = require('../') - , http = require('http') - , connect = require('connect'); - -var app = express.createServer(); - -app.get('/', function(req, res){ - req.foo(); - res.send('test'); -}); - -// app.set('views', __dirname + '/views'); -// app.set('view engine', 'jade'); -// -// app.configure(function(){ -// app.use(function(req, res, next){ -// debugger -// res.write('first'); -// console.error('first'); -// next(); -// }); -// -// app.use(app.router); -// -// app.use(function(req, res, next){ -// console.error('last'); -// res.end('last'); -// }); -// }); -// -// app.get('/', function(req, res, next){ -// console.error('middle'); -// res.write(' route '); -// next(); -// }); - -app.listen(3000); -console.log('listening on port 3000'); \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/public/test.txt b/usb_auth/node_modules/express/testing/public/test.txt deleted file mode 100644 index cb9a165..0000000 --- a/usb_auth/node_modules/express/testing/public/test.txt +++ /dev/null @@ -1,2971 +0,0 @@ -foo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -bazfoo -bar -baz \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/page.html b/usb_auth/node_modules/express/testing/views/page.html deleted file mode 100644 index 4ff9827..0000000 --- a/usb_auth/node_modules/express/testing/views/page.html +++ /dev/null @@ -1 +0,0 @@ -p register test \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/page.jade b/usb_auth/node_modules/express/testing/views/page.jade deleted file mode 100644 index 9c3f888..0000000 --- a/usb_auth/node_modules/express/testing/views/page.jade +++ /dev/null @@ -1,3 +0,0 @@ -html - body - h1 test \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/test.md b/usb_auth/node_modules/express/testing/views/test.md deleted file mode 100644 index 9139ff4..0000000 --- a/usb_auth/node_modules/express/testing/views/test.md +++ /dev/null @@ -1 +0,0 @@ -testing _some_ markdown \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/user/index.jade b/usb_auth/node_modules/express/testing/views/user/index.jade deleted file mode 100644 index 1b66a4f..0000000 --- a/usb_auth/node_modules/express/testing/views/user/index.jade +++ /dev/null @@ -1 +0,0 @@ -p user page \ No newline at end of file diff --git a/usb_auth/node_modules/express/testing/views/user/list.jade b/usb_auth/node_modules/express/testing/views/user/list.jade deleted file mode 100644 index ed2b471..0000000 --- a/usb_auth/node_modules/express/testing/views/user/list.jade +++ /dev/null @@ -1 +0,0 @@ -p user list page \ No newline at end of file diff --git a/usb_auth/node_modules/jade/.npmignore b/usb_auth/node_modules/jade/.npmignore deleted file mode 100644 index 5eb48f0..0000000 --- a/usb_auth/node_modules/jade/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -lib-cov -testing -node_modules diff --git a/usb_auth/node_modules/jade/LICENSE b/usb_auth/node_modules/jade/LICENSE deleted file mode 100644 index 8ad0e0d..0000000 --- a/usb_auth/node_modules/jade/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2009-2010 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/jade/bin/jade b/usb_auth/node_modules/jade/bin/jade deleted file mode 100755 index fd4122c..0000000 --- a/usb_auth/node_modules/jade/bin/jade +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var fs = require('fs') - , program = require('commander') - , path = require('path') - , basename = path.basename - , dirname = path.dirname - , resolve = path.resolve - , join = path.join - , mkdirp = require('mkdirp') - , jade = require('../'); - -// jade options - -var options = {}; - -// options - -program - .version(jade.version) - .usage('[options] [dir|file ...]') - .option('-o, --obj ', 'javascript options object') - .option('-O, --out ', 'output the compiled html to ') - .option('-p, --path ', 'filename used to resolve includes') - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' # translate jade the templates dir'); - console.log(' $ jade templates'); - console.log(''); - console.log(' # create {foo,bar}.html'); - console.log(' $ jade {foo,bar}.jade'); - console.log(''); - console.log(' # jade over stdio'); - console.log(' $ jade < my.jade > my.html'); - console.log(''); - console.log(' # jade over stdio'); - console.log(' $ echo "h1 Jade!" | jade'); - console.log(''); - console.log(' # foo, bar dirs rendering to /tmp'); - console.log(' $ jade foo bar --out /tmp '); - console.log(''); -}); - -program.parse(process.argv); - -// options given, parse them - -if (program.obj) options = eval('(' + program.obj + ')'); - -// filename - -if (program.path) options.filename = program.path; - -// left-over args are file paths - -var files = program.args; - -// compile files - -if (files.length) { - console.log(); - files.forEach(renderFile); - process.on('exit', console.log); -// stdio -} else { - stdin(); -} - -/** - * Compile from stdin. - */ - -function stdin() { - var buf = ''; - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(chunk){ buf += chunk; }); - process.stdin.on('end', function(){ - var fn = jade.compile(buf, options); - process.stdout.write(fn(options)); - }).resume(); -} - -/** - * Process the given path, compiling the jade files found. - * Always walk the subdirectories. - */ - -function renderFile(path) { - var re = /\.jade$/; - fs.lstat(path, function(err, stat) { - if (err) throw err; - // Found jade file - if (stat.isFile() && re.test(path)) { - fs.readFile(path, 'utf8', function(err, str){ - if (err) throw err; - options.filename = path; - var fn = jade.compile(str, options); - path = path.replace(re, '.html'); - if (program.out) path = join(program.out, basename(path)); - var dir = resolve(dirname(path)); - mkdirp(dir, 0755, function(err){ - if (err) throw err; - fs.writeFile(path, fn(options), function(err){ - if (err) throw err; - console.log(' \033[90mrendered \033[36m%s\033[0m', path); - }); - }); - }); - // Found directory - } else if (stat.isDirectory()) { - fs.readdir(path, function(err, files) { - if (err) throw err; - files.map(function(filename) { - return path + '/' + filename; - }).forEach(renderFile); - }); - } - }); -} diff --git a/usb_auth/node_modules/jade/index.js b/usb_auth/node_modules/jade/index.js deleted file mode 100644 index 857e431..0000000 --- a/usb_auth/node_modules/jade/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/jade'); \ No newline at end of file diff --git a/usb_auth/node_modules/jade/jade.js b/usb_auth/node_modules/jade/jade.js deleted file mode 100644 index 22072f1..0000000 --- a/usb_auth/node_modules/jade/jade.js +++ /dev/null @@ -1,3140 +0,0 @@ -(function() { - -// CommonJS require() - -function require(p){ - var path = require.resolve(p) - , mod = require.modules[path]; - if (!mod) throw new Error('failed to require "' + p + '"'); - if (!mod.exports) { - mod.exports = {}; - mod.call(mod.exports, mod, mod.exports, require.relative(path)); - } - return mod.exports; - } - -require.modules = {}; - -require.resolve = function (path){ - var orig = path - , reg = path + '.js' - , index = path + '/index.js'; - return require.modules[reg] && reg - || require.modules[index] && index - || orig; - }; - -require.register = function (path, fn){ - require.modules[path] = fn; - }; - -require.relative = function (parent) { - return function(p){ - if ('.' != p[0]) return require(p); - - var path = parent.split('/') - , segs = p.split('/'); - path.pop(); - - for (var i = 0; i < segs.length; i++) { - var seg = segs[i]; - if ('..' == seg) path.pop(); - else if ('.' != seg) path.push(seg); - } - - return require(path.join('/')); - }; - }; - - -require.register("compiler.js", function(module, exports, require){ - -/*! - * Jade - Compiler - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var nodes = require('./nodes') - , filters = require('./filters') - , doctypes = require('./doctypes') - , selfClosing = require('./self-closing') - , inlineTags = require('./inline-tags') - , utils = require('./utils'); - - - if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } - } - - if (!String.prototype.trimLeft) { - String.prototype.trimLeft = function(){ - return this.replace(/^\s+/, ''); - } - } - - - -/** - * Initialize `Compiler` with the given `node`. - * - * @param {Node} node - * @param {Object} options - * @api public - */ - -var Compiler = module.exports = function Compiler(node, options) { - this.options = options = options || {}; - this.node = node; - this.hasCompiledDoctype = false; - this.hasCompiledTag = false; - this.pp = options.pretty || false; - this.debug = false !== options.compileDebug; - this.indents = 0; - if (options.doctype) this.setDoctype(options.doctype); -}; - -/** - * Compiler prototype. - */ - -Compiler.prototype = { - - /** - * Compile parse tree to JavaScript. - * - * @api public - */ - - compile: function(){ - this.buf = ['var interp;']; - this.lastBufferedIdx = -1 - this.visit(this.node); - return this.buf.join('\n'); - }, - - /** - * Sets the default doctype `name`. Sets terse mode to `true` when - * html 5 is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {string} name - * @api public - */ - - setDoctype: function(name){ - var doctype = doctypes[(name || 'default').toLowerCase()]; - doctype = doctype || ''; - this.doctype = doctype; - this.terse = '5' == name || 'html' == name; - this.xml = 0 == this.doctype.indexOf('" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {Doctype} doctype - * @api public - */ - - visitDoctype: function(doctype){ - if (doctype && (doctype.val || !this.doctype)) { - this.setDoctype(doctype.val || 'default'); - } - - if (this.doctype) this.buffer(this.doctype); - this.hasCompiledDoctype = true; - }, - - /** - * Visit `mixin`, generating a function that - * may be called within the template. - * - * @param {Mixin} mixin - * @api public - */ - - visitMixin: function(mixin){ - var name = mixin.name.replace(/-/g, '_') + '_mixin' - , args = mixin.args || ''; - - if (mixin.block) { - this.buf.push('var ' + name + ' = function(' + args + '){'); - this.visit(mixin.block); - this.buf.push('}'); - } else { - this.buf.push(name + '(' + args + ');'); - } - }, - - /** - * Visit `tag` buffering tag markup, generating - * attributes, visiting the `tag`'s code and block. - * - * @param {Tag} tag - * @api public - */ - - visitTag: function(tag){ - this.indents++; - var name = tag.name; - - if (!this.hasCompiledTag) { - if (!this.hasCompiledDoctype && 'html' == name) { - this.visitDoctype(); - } - this.hasCompiledTag = true; - } - - // pretty print - if (this.pp && inlineTags.indexOf(name) == -1) { - this.buffer('\\n' + Array(this.indents).join(' ')); - } - - if (~selfClosing.indexOf(name) && !this.xml) { - this.buffer('<' + name); - this.visitAttributes(tag.attrs); - this.terse - ? this.buffer('>') - : this.buffer('/>'); - } else { - // Optimize attributes buffering - if (tag.attrs.length) { - this.buffer('<' + name); - if (tag.attrs.length) this.visitAttributes(tag.attrs); - this.buffer('>'); - } else { - this.buffer('<' + name + '>'); - } - if (tag.code) this.visitCode(tag.code); - if (tag.text) this.buffer(utils.text(tag.text.nodes[0].trimLeft())); - this.escape = 'pre' == tag.name; - this.visit(tag.block); - - // pretty print - if (this.pp && !~inlineTags.indexOf(name) && !tag.textOnly) { - this.buffer('\\n' + Array(this.indents).join(' ')); - } - - this.buffer(''); - } - this.indents--; - }, - - /** - * Visit `filter`, throwing when the filter does not exist. - * - * @param {Filter} filter - * @api public - */ - - visitFilter: function(filter){ - var fn = filters[filter.name]; - - // unknown filter - if (!fn) { - if (filter.isASTFilter) { - throw new Error('unknown ast filter "' + filter.name + ':"'); - } else { - throw new Error('unknown filter ":' + filter.name + '"'); - } - } - if (filter.isASTFilter) { - this.buf.push(fn(filter.block, this, filter.attrs)); - } else { - var text = filter.block.nodes.join(''); - this.buffer(utils.text(fn(text, filter.attrs))); - } - }, - - /** - * Visit `text` node. - * - * @param {Text} text - * @api public - */ - - visitText: function(text){ - text = utils.text(text.nodes.join('')); - if (this.escape) text = escape(text); - this.buffer(text); - this.buffer('\\n'); - }, - - /** - * Visit a `comment`, only buffering when the buffer flag is set. - * - * @param {Comment} comment - * @api public - */ - - visitComment: function(comment){ - if (!comment.buffer) return; - if (this.pp) this.buffer('\\n' + Array(this.indents + 1).join(' ')); - this.buffer(''); - }, - - /** - * Visit a `BlockComment`. - * - * @param {Comment} comment - * @api public - */ - - visitBlockComment: function(comment){ - if (!comment.buffer) return; - if (0 == comment.val.trim().indexOf('if')) { - this.buffer(''); - } else { - this.buffer(''); - } - }, - - /** - * Visit `code`, respecting buffer / escape flags. - * If the code is followed by a block, wrap it in - * a self-calling function. - * - * @param {Code} code - * @api public - */ - - visitCode: function(code){ - // Wrap code blocks with {}. - // we only wrap unbuffered code blocks ATM - // since they are usually flow control - - // Buffer code - if (code.buffer) { - var val = code.val.trimLeft(); - this.buf.push('var __val__ = ' + val); - val = 'null == __val__ ? "" : __val__'; - if (code.escape) val = 'escape(' + val + ')'; - this.buf.push("buf.push(" + val + ");"); - } else { - this.buf.push(code.val); - } - - // Block support - if (code.block) { - if (!code.buffer) this.buf.push('{'); - this.visit(code.block); - if (!code.buffer) this.buf.push('}'); - } - }, - - /** - * Visit `each` block. - * - * @param {Each} each - * @api public - */ - - visitEach: function(each){ - this.buf.push('' - + '// iterate ' + each.obj + '\n' - + '(function(){\n' - + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' - + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push('' - + ' }\n' - + ' } else {\n' - + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' - + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push(' }\n'); - - this.buf.push(' }\n }\n}).call(this);\n'); - }, - - /** - * Visit `attrs`. - * - * @param {Array} attrs - * @api public - */ - - visitAttributes: function(attrs){ - var buf = [] - , classes = []; - - if (this.terse) buf.push('terse: true'); - - attrs.forEach(function(attr){ - if (attr.name == 'class') { - classes.push('(' + attr.val + ')'); - } else { - var pair = "'" + attr.name + "':(" + attr.val + ')'; - buf.push(pair); - } - }); - - if (classes.length) { - classes = classes.join(" + ' ' + "); - buf.push("class: " + classes); - } - - buf = buf.join(', ').replace('class:', '"class":'); - - this.buf.push("buf.push(attrs({ " + buf + " }));"); - } -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} - -}); // module: compiler.js - -require.register("doctypes.js", function(module, exports, require){ - -/*! - * Jade - doctypes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - '5': '' - , 'xml': '' - , 'default': '' - , 'transitional': '' - , 'strict': '' - , 'frameset': '' - , '1.1': '' - , 'basic': '' - , 'mobile': '' -}; -}); // module: doctypes.js - -require.register("filters.js", function(module, exports, require){ - -/*! - * Jade - filters - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - - /** - * Wrap text with CDATA block. - */ - - cdata: function(str){ - return ''; - }, - - /** - * Transform sass to css, wrapped in style tags. - */ - - sass: function(str){ - str = str.replace(/\\n/g, '\n'); - var sass = require('sass').render(str).replace(/\n/g, '\\n'); - return ''; - }, - - /** - * Transform stylus to css, wrapped in style tags. - */ - - stylus: function(str, options){ - var ret; - str = str.replace(/\\n/g, '\n'); - var stylus = require('stylus'); - stylus(str, options).render(function(err, css){ - if (err) throw err; - ret = css.replace(/\n/g, '\\n'); - }); - return ''; - }, - - /** - * Transform less to css, wrapped in style tags. - */ - - less: function(str){ - var ret; - str = str.replace(/\\n/g, '\n'); - require('less').render(str, function(err, css){ - if (err) throw err; - ret = ''; - }); - return ret; - }, - - /** - * Transform markdown to html. - */ - - markdown: function(str){ - var md; - - // support markdown / discount - try { - md = require('markdown'); - } catch (err){ - try { - md = require('discount'); - } catch (err) { - try { - md = require('markdown-js'); - } catch (err) { - try { - md = require('marked'); - } catch (err) { - throw new - Error('Cannot find markdown library, install markdown, discount, or marked.'); - } - } - } - } - - str = str.replace(/\\n/g, '\n'); - return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); - }, - - /** - * Transform coffeescript to javascript. - */ - - coffeescript: function(str){ - str = str.replace(/\\n/g, '\n'); - var js = require('coffee-script').compile(str).replace(/\n/g, '\\n'); - return ''; - } -}; - -}); // module: filters.js - -require.register("inline-tags.js", function(module, exports, require){ - -/*! - * Jade - inline tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'a' - , 'abbr' - , 'acronym' - , 'b' - , 'br' - , 'code' - , 'em' - , 'font' - , 'i' - , 'img' - , 'ins' - , 'kbd' - , 'map' - , 'samp' - , 'small' - , 'span' - , 'strong' - , 'sub' - , 'sup' -]; -}); // module: inline-tags.js - -require.register("jade.js", function(module, exports, require){ -/*! - * Jade - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Parser = require('./parser') - , Lexer = require('./lexer') - , Compiler = require('./compiler') - , runtime = require('./runtime') - -/** - * Library version. - */ - -exports.version = '0.20.1'; - -/** - * Expose self closing tags. - */ - -exports.selfClosing = require('./self-closing'); - -/** - * Default supported doctypes. - */ - -exports.doctypes = require('./doctypes'); - -/** - * Text filters. - */ - -exports.filters = require('./filters'); - -/** - * Utilities. - */ - -exports.utils = require('./utils'); - -/** - * Expose `Compiler`. - */ - -exports.Compiler = Compiler; - -/** - * Expose `Parser`. - */ - -exports.Parser = Parser; - -/** - * Expose `Lexer`. - */ - -exports.Lexer = Lexer; - -/** - * Nodes. - */ - -exports.nodes = require('./nodes'); - -/** - * Jade runtime helpers. - */ - -exports.runtime = runtime; - -/** - * Template function cache. - */ - -exports.cache = {}; - -/** - * Parse the given `str` of jade and return a function body. - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api private - */ - -function parse(str, options){ - try { - // Parse - var parser = new Parser(str, options.filename, options); - - // Compile - var compiler = new (options.compiler || Compiler)(parser.parse(), options) - , js = compiler.compile(); - - // Debug compiler - if (options.debug) { - console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); - } - - return '' - + 'var buf = [];\n' - + (options.self - ? 'var self = locals || {};\n' + js - : 'with (locals || {}) {\n' + js + '\n}\n') - + 'return buf.join("");'; - } catch (err) { - parser = parser.context(); - runtime.rethrow(err, parser.filename, parser.lexer.lineno); - } -} - -/** - * Compile a `Function` representation of the given jade `str`. - * - * Options: - * - * - `compileDebug` when `false` debugging code is stripped from the compiled template - * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` - * for use with the Jade client-side runtime.js - * - * @param {String} str - * @param {Options} options - * @return {Function} - * @api public - */ - -exports.compile = function(str, options){ - var options = options || {} - , client = options.client - , filename = options.filename - ? JSON.stringify(options.filename) - : 'undefined' - , fn; - - if (options.compileDebug !== false) { - fn = [ - 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' - , 'try {' - , parse(String(str), options) - , '} catch (err) {' - , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' - , '}' - ].join('\n'); - } else { - fn = parse(String(str), options); - } - - if (client) { - fn = 'var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n' + fn; - } - - fn = new Function('locals, attrs, escape, rethrow', fn); - - if (client) return fn; - - return function(locals){ - return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow); - }; -}; - -/** - * Render the given `str` of jade and invoke - * the callback `fn(err, str)`. - * - * Options: - * - * - `cache` enable template caching - * - `filename` filename required for `include` / `extends` and caching - * - * @param {String} str - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -exports.render = function(str, options, fn){ - // swap args - if ('function' == typeof options) { - fn = options, options = {}; - } - - // cache requires .filename - if (options.cache && !options.filename) { - return fn(new Error('the "filename" option is required for caching')); - } - - try { - var path = options.filename; - var tmpl = options.cache - ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) - : exports.compile(str, options); - fn(null, tmpl(options)); - } catch (err) { - fn(err); - } -}; - -/** - * Render a Jade file at the given `path` and callback `fn(err, str)`. - * - * @param {String} path - * @param {Object|Function} options or callback - * @param {Function} fn - * @api public - */ - -exports.renderFile = function(path, options, fn){ - var key = path + ':string'; - - if ('function' == typeof options) { - fn = options, options = {}; - } - - try { - options.filename = path; - var str = options.cache - ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) - : fs.readFileSync(path, 'utf8'); - exports.render(str, options, fn); - } catch (err) { - fn(err); - } -}; - -/** - * Express support. - */ - -exports.__express = exports.renderFile; - -}); // module: jade.js - -require.register("lexer.js", function(module, exports, require){ - -/*! - * Jade - Lexer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize `Lexer` with the given `str`. - * - * Options: - * - * - `colons` allow colons for attr delimiters - * - * @param {String} str - * @param {Object} options - * @api private - */ - -var Lexer = module.exports = function Lexer(str, options) { - options = options || {}; - this.input = str.replace(/\r\n|\r/g, '\n'); - this.colons = options.colons; - this.deferredTokens = []; - this.lastIndents = 0; - this.lineno = 1; - this.stash = []; - this.indentStack = []; - this.indentRe = null; - this.pipeless = false; -}; - -/** - * Lexer prototype. - */ - -Lexer.prototype = { - - /** - * Construct a token with the given `type` and `val`. - * - * @param {String} type - * @param {String} val - * @return {Object} - * @api private - */ - - tok: function(type, val){ - return { - type: type - , line: this.lineno - , val: val - } - }, - - /** - * Consume the given `len` of input. - * - * @param {Number} len - * @api private - */ - - consume: function(len){ - this.input = this.input.substr(len); - }, - - /** - * Scan for `type` with the given `regexp`. - * - * @param {String} type - * @param {RegExp} regexp - * @return {Object} - * @api private - */ - - scan: function(regexp, type){ - var captures; - if (captures = regexp.exec(this.input)) { - this.consume(captures[0].length); - return this.tok(type, captures[1]); - } - }, - - /** - * Defer the given `tok`. - * - * @param {Object} tok - * @api private - */ - - defer: function(tok){ - this.deferredTokens.push(tok); - }, - - /** - * Lookahead `n` tokens. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - var fetch = n - this.stash.length; - while (fetch-- > 0) this.stash.push(this.next()); - return this.stash[--n]; - }, - - /** - * Return the indexOf `start` / `end` delimiters. - * - * @param {String} start - * @param {String} end - * @return {Number} - * @api private - */ - - indexOfDelimiters: function(start, end){ - var str = this.input - , nstart = 0 - , nend = 0 - , pos = 0; - for (var i = 0, len = str.length; i < len; ++i) { - if (start == str[i]) { - ++nstart; - } else if (end == str[i]) { - if (++nend == nstart) { - pos = i; - break; - } - } - } - return pos; - }, - - /** - * Stashed token. - */ - - stashed: function() { - return this.stash.length - && this.stash.shift(); - }, - - /** - * Deferred token. - */ - - deferred: function() { - return this.deferredTokens.length - && this.deferredTokens.shift(); - }, - - /** - * end-of-source. - */ - - eos: function() { - if (this.input.length) return; - if (this.indentStack.length) { - this.indentStack.shift(); - return this.tok('outdent'); - } else { - return this.tok('eos'); - } - }, - - /** - * Comment. - */ - - comment: function() { - var captures; - if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('comment', captures[2]); - tok.buffer = '-' != captures[1]; - return tok; - } - }, - - /** - * Tag. - */ - - tag: function() { - var captures; - if (captures = /^(\w[-:\w]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok, name = captures[1]; - if (':' == name[name.length - 1]) { - name = name.slice(0, -1); - tok = this.tok('tag', name); - this.defer(this.tok(':')); - while (' ' == this.input[0]) this.input = this.input.substr(1); - } else { - tok = this.tok('tag', name); - } - return tok; - } - }, - - /** - * Filter. - */ - - filter: function() { - return this.scan(/^:(\w+)/, 'filter'); - }, - - /** - * Doctype. - */ - - doctype: function() { - return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); - }, - - /** - * Id. - */ - - id: function() { - return this.scan(/^#([\w-]+)/, 'id'); - }, - - /** - * Class. - */ - - className: function() { - return this.scan(/^\.([\w-]+)/, 'class'); - }, - - /** - * Text. - */ - - text: function() { - return this.scan(/^(?:\| ?)?([^\n]+)/, 'text'); - }, - - /** - * Extends. - */ - - extends: function() { - return this.scan(/^extends +([^\n]+)/, 'extends'); - }, - - /** - * Block prepend. - */ - - prepend: function() { - var captures; - if (captures = /^prepend +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'prepend' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block append. - */ - - append: function() { - var captures; - if (captures = /^append +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'append' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block. - */ - - block: function() { - var captures; - if (captures = /^block +(?:(prepend|append) +)?([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = captures[1] || 'replace' - , name = captures[2] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Yield. - */ - - yield: function() { - return this.scan(/^yield */, 'yield'); - }, - - /** - * Include. - */ - - include: function() { - return this.scan(/^include +([^\n]+)/, 'include'); - }, - - /** - * Case. - */ - - case: function() { - return this.scan(/^case +([^\n]+)/, 'case'); - }, - - /** - * When. - */ - - when: function() { - return this.scan(/^when +([^:\n]+)/, 'when'); - }, - - /** - * Default. - */ - - default: function() { - return this.scan(/^default */, 'default'); - }, - - /** - * Assignment. - */ - - assignment: function() { - var captures; - if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { - this.consume(captures[0].length); - var name = captures[1] - , val = captures[2]; - return this.tok('code', 'var ' + name + ' = (' + val + ');'); - } - }, - - /** - * Mixin. - */ - - mixin: function(){ - var captures; - if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('mixin', captures[1]); - tok.args = captures[2]; - return tok; - } - }, - - /** - * Conditional. - */ - - conditional: function() { - var captures; - if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var type = captures[1] - , js = captures[2]; - - switch (type) { - case 'if': js = 'if (' + js + ')'; break; - case 'unless': js = 'if (!(' + js + '))'; break; - case 'else if': js = 'else if (' + js + ')'; break; - case 'else': js = 'else'; break; - } - - return this.tok('code', js); - } - }, - - /** - * While. - */ - - while: function() { - var captures; - if (captures = /^while +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('code', 'while (' + captures[1] + ')'); - } - }, - - /** - * Each. - */ - - each: function() { - var captures; - if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('each', captures[1]); - tok.key = captures[2] || '$index'; - tok.code = captures[3]; - return tok; - } - }, - - /** - * Code. - */ - - code: function() { - var captures; - if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var flags = captures[1]; - captures[1] = captures[2]; - var tok = this.tok('code', captures[1]); - tok.escape = flags[0] === '='; - tok.buffer = flags[0] === '=' || flags[1] === '='; - return tok; - } - }, - - /** - * Attributes. - */ - - attrs: function() { - if ('(' == this.input[0]) { - var index = this.indexOfDelimiters('(', ')') - , str = this.input.substr(1, index-1) - , tok = this.tok('attrs') - , len = str.length - , colons = this.colons - , states = ['key'] - , key = '' - , val = '' - , quote - , c; - - function state(){ - return states[states.length - 1]; - } - - function interpolate(attr) { - return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ - return quote + " + (" + expr + ") + " + quote; - }); - } - - this.consume(index + 1); - tok.attrs = {}; - - function parse(c) { - var real = c; - // TODO: remove when people fix ":" - if (colons && ':' == c) c = '='; - switch (c) { - case ',': - case '\n': - switch (state()) { - case 'expr': - case 'array': - case 'string': - case 'object': - val += c; - break; - default: - states.push('key'); - val = val.trim(); - key = key.trim(); - if ('' == key) return; - tok.attrs[key.replace(/^['"]|['"]$/g, '')] = '' == val - ? true - : interpolate(val); - key = val = ''; - } - break; - case '=': - switch (state()) { - case 'key char': - key += real; - break; - case 'val': - case 'expr': - case 'array': - case 'string': - case 'object': - val += real; - break; - default: - states.push('val'); - } - break; - case '(': - if ('val' == state() - || 'expr' == state()) states.push('expr'); - val += c; - break; - case ')': - if ('expr' == state() - || 'val' == state()) states.pop(); - val += c; - break; - case '{': - if ('val' == state()) states.push('object'); - val += c; - break; - case '}': - if ('object' == state()) states.pop(); - val += c; - break; - case '[': - if ('val' == state()) states.push('array'); - val += c; - break; - case ']': - if ('array' == state()) states.pop(); - val += c; - break; - case '"': - case "'": - switch (state()) { - case 'key': - states.push('key char'); - break; - case 'key char': - states.pop(); - break; - case 'string': - if (c == quote) states.pop(); - val += c; - break; - default: - states.push('string'); - val += c; - quote = c; - } - break; - case '': - break; - default: - switch (state()) { - case 'key': - case 'key char': - key += c; - break; - default: - val += c; - } - } - } - - for (var i = 0; i < len; ++i) { - parse(str[i]); - } - - parse(','); - - return tok; - } - }, - - /** - * Indent | Outdent | Newline. - */ - - indent: function() { - var captures, re; - - // established regexp - if (this.indentRe) { - captures = this.indentRe.exec(this.input); - // determine regexp - } else { - // tabs - re = /^\n(\t*) */; - captures = re.exec(this.input); - - // spaces - if (captures && !captures[1].length) { - re = /^\n( *)/; - captures = re.exec(this.input); - } - - // established - if (captures && captures[1].length) this.indentRe = re; - } - - if (captures) { - var tok - , indents = captures[1].length; - - ++this.lineno; - this.consume(indents + 1); - - if (' ' == this.input[0] || '\t' == this.input[0]) { - throw new Error('Invalid indentation, you can use tabs or spaces but not both'); - } - - // blank line - if ('\n' == this.input[0]) return this.tok('newline'); - - // outdent - if (this.indentStack.length && indents < this.indentStack[0]) { - while (this.indentStack.length && this.indentStack[0] > indents) { - this.stash.push(this.tok('outdent')); - this.indentStack.shift(); - } - tok = this.stash.pop(); - // indent - } else if (indents && indents != this.indentStack[0]) { - this.indentStack.unshift(indents); - tok = this.tok('indent', indents); - // newline - } else { - tok = this.tok('newline'); - } - - return tok; - } - }, - - /** - * Pipe-less text consumed only when - * pipeless is true; - */ - - pipelessText: function() { - if (this.pipeless) { - if ('\n' == this.input[0]) return; - var i = this.input.indexOf('\n'); - if (-1 == i) i = this.input.length; - var str = this.input.substr(0, i); - this.consume(str.length); - return this.tok('text', str); - } - }, - - /** - * ':' - */ - - colon: function() { - return this.scan(/^: */, ':'); - }, - - /** - * Return the next token object, or those - * previously stashed by lookahead. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.stashed() - || this.next(); - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - next: function() { - return this.deferred() - || this.eos() - || this.pipelessText() - || this.yield() - || this.doctype() - || this.case() - || this.when() - || this.default() - || this.extends() - || this.append() - || this.prepend() - || this.block() - || this.include() - || this.mixin() - || this.conditional() - || this.each() - || this.while() - || this.assignment() - || this.tag() - || this.filter() - || this.code() - || this.id() - || this.className() - || this.attrs() - || this.indent() - || this.comment() - || this.colon() - || this.text(); - } -}; - -}); // module: lexer.js - -require.register("nodes/block-comment.js", function(module, exports, require){ - -/*! - * Jade - nodes - BlockComment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `BlockComment` with the given `block`. - * - * @param {String} val - * @param {Block} block - * @param {Boolean} buffer - * @api public - */ - -var BlockComment = module.exports = function BlockComment(val, block, buffer) { - this.block = block; - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -BlockComment.prototype = new Node; -BlockComment.prototype.constructor = BlockComment; - -}); // module: nodes/block-comment.js - -require.register("nodes/block.js", function(module, exports, require){ - -/*! - * Jade - nodes - Block - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Block` with an optional `node`. - * - * @param {Node} node - * @api public - */ - -var Block = module.exports = function Block(node){ - this.nodes = []; - if (node) this.push(node); -}; - -/** - * Inherit from `Node`. - */ - -Block.prototype = new Node; -Block.prototype.constructor = Block; - - -/** - * Replace the nodes in `other` with the nodes - * in `this` block. - * - * @param {Block} other - * @api private - */ - -Block.prototype.replace = function(other){ - other.nodes = this.nodes; -}; - -/** - * Pust the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.push = function(node){ - return this.nodes.push(node); -}; - -/** - * Check if this block is empty. - * - * @return {Boolean} - * @api public - */ - -Block.prototype.isEmpty = function(){ - return 0 == this.nodes.length; -}; - -/** - * Unshift the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.unshift = function(node){ - return this.nodes.unshift(node); -}; - -/** - * Return the "last" block, or the first `yield` node. - * - * @return {Block} - * @api private - */ - -Block.prototype.includeBlock = function(){ - var ret = this - , node; - - for (var i = 0, len = this.nodes.length; i < len; ++i) { - node = this.nodes[i]; - if (node.yield) return node; - else if (node.textOnly) continue; - else if (node.includeBlock) ret = node.includeBlock(); - else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); - } - - return ret; -}; - - -}); // module: nodes/block.js - -require.register("nodes/case.js", function(module, exports, require){ - -/*! - * Jade - nodes - Case - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Case` with `expr`. - * - * @param {String} expr - * @api public - */ - -var Case = exports = module.exports = function Case(expr, block){ - this.expr = expr; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Case.prototype = new Node; -Case.prototype.constructor = Case; - - -var When = exports.When = function When(expr, block){ - this.expr = expr; - this.block = block; - this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -When.prototype = new Node; -When.prototype.constructor = When; - - - -}); // module: nodes/case.js - -require.register("nodes/code.js", function(module, exports, require){ - -/*! - * Jade - nodes - Code - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Code` node with the given code `val`. - * Code may also be optionally buffered and escaped. - * - * @param {String} val - * @param {Boolean} buffer - * @param {Boolean} escape - * @api public - */ - -var Code = module.exports = function Code(val, buffer, escape) { - this.val = val; - this.buffer = buffer; - this.escape = escape; - if (val.match(/^ *else/)) this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -Code.prototype = new Node; -Code.prototype.constructor = Code; - -}); // module: nodes/code.js - -require.register("nodes/comment.js", function(module, exports, require){ - -/*! - * Jade - nodes - Comment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Comment` with the given `val`, optionally `buffer`, - * otherwise the comment may render in the output. - * - * @param {String} val - * @param {Boolean} buffer - * @api public - */ - -var Comment = module.exports = function Comment(val, buffer) { - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -Comment.prototype = new Node; -Comment.prototype.constructor = Comment; - -}); // module: nodes/comment.js - -require.register("nodes/doctype.js", function(module, exports, require){ - -/*! - * Jade - nodes - Doctype - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Doctype` with the given `val`. - * - * @param {String} val - * @api public - */ - -var Doctype = module.exports = function Doctype(val) { - this.val = val; -}; - -/** - * Inherit from `Node`. - */ - -Doctype.prototype = new Node; -Doctype.prototype.constructor = Doctype; - -}); // module: nodes/doctype.js - -require.register("nodes/each.js", function(module, exports, require){ - -/*! - * Jade - nodes - Each - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize an `Each` node, representing iteration - * - * @param {String} obj - * @param {String} val - * @param {String} key - * @param {Block} block - * @api public - */ - -var Each = module.exports = function Each(obj, val, key, block) { - this.obj = obj; - this.val = val; - this.key = key; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Each.prototype = new Node; -Each.prototype.constructor = Each; - -}); // module: nodes/each.js - -require.register("nodes/filter.js", function(module, exports, require){ - -/*! - * Jade - nodes - Filter - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node') - , Block = require('./block'); - -/** - * Initialize a `Filter` node with the given - * filter `name` and `block`. - * - * @param {String} name - * @param {Block|Node} block - * @api public - */ - -var Filter = module.exports = function Filter(name, block, attrs) { - this.name = name; - this.block = block; - this.attrs = attrs; - this.isASTFilter = block instanceof Block; -}; - -/** - * Inherit from `Node`. - */ - -Filter.prototype = new Node; -Filter.prototype.constructor = Filter; - -}); // module: nodes/filter.js - -require.register("nodes/index.js", function(module, exports, require){ - -/*! - * Jade - nodes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -exports.Node = require('./node'); -exports.Tag = require('./tag'); -exports.Code = require('./code'); -exports.Each = require('./each'); -exports.Case = require('./case'); -exports.Text = require('./text'); -exports.Block = require('./block'); -exports.Mixin = require('./mixin'); -exports.Filter = require('./filter'); -exports.Comment = require('./comment'); -exports.Literal = require('./literal'); -exports.BlockComment = require('./block-comment'); -exports.Doctype = require('./doctype'); - -}); // module: nodes/index.js - -require.register("nodes/literal.js", function(module, exports, require){ - -/*! - * Jade - nodes - Literal - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Literal` node with the given `str. - * - * @param {String} str - * @api public - */ - -var Literal = module.exports = function Literal(str) { - this.str = str - .replace(/\n/g, "\\n") - .replace(/'/g, "\\'"); -}; - -/** - * Inherit from `Node`. - */ - -Literal.prototype = new Node; -Literal.prototype.constructor = Literal; - - -}); // module: nodes/literal.js - -require.register("nodes/mixin.js", function(module, exports, require){ - -/*! - * Jade - nodes - Mixin - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Mixin` with `name` and `block`. - * - * @param {String} name - * @param {String} args - * @param {Block} block - * @api public - */ - -var Mixin = module.exports = function Mixin(name, args, block){ - this.name = name; - this.args = args; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Mixin.prototype = new Node; -Mixin.prototype.constructor = Mixin; - - - -}); // module: nodes/mixin.js - -require.register("nodes/node.js", function(module, exports, require){ - -/*! - * Jade - nodes - Node - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize a `Node`. - * - * @api public - */ - -var Node = module.exports = function Node(){}; -}); // module: nodes/node.js - -require.register("nodes/tag.js", function(module, exports, require){ - -/*! - * Jade - nodes - Tag - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'), - Block = require('./block'); - -/** - * Initialize a `Tag` node with the given tag `name` and optional `block`. - * - * @param {String} name - * @param {Block} block - * @api public - */ - -var Tag = module.exports = function Tag(name, block) { - this.name = name; - this.attrs = []; - this.block = block || new Block; -}; - -/** - * Inherit from `Node`. - */ - -Tag.prototype = new Node; -Tag.prototype.constructor = Tag; - - -/** - * Set attribute `name` to `val`, keep in mind these become - * part of a raw js object literal, so to quote a value you must - * '"quote me"', otherwise or example 'user.name' is literal JavaScript. - * - * @param {String} name - * @param {String} val - * @return {Tag} for chaining - * @api public - */ - -Tag.prototype.setAttribute = function(name, val){ - this.attrs.push({ name: name, val: val }); - return this; -}; - -/** - * Remove attribute `name` when present. - * - * @param {String} name - * @api public - */ - -Tag.prototype.removeAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - delete this.attrs[i]; - } - } -}; - -/** - * Get attribute value by `name`. - * - * @param {String} name - * @return {String} - * @api public - */ - -Tag.prototype.getAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - return this.attrs[i].val; - } - } -}; - -}); // module: nodes/tag.js - -require.register("nodes/text.js", function(module, exports, require){ - -/*! - * Jade - nodes - Text - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Text` node with optional `line`. - * - * @param {String} line - * @api public - */ - -var Text = module.exports = function Text(line) { - this.nodes = []; - if ('string' == typeof line) this.push(line); -}; - -/** - * Inherit from `Node`. - */ - -Text.prototype = new Node; -Text.prototype.constructor = Text; - - -/** - * Push the given `node.` - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Text.prototype.push = function(node){ - return this.nodes.push(node); -}; - -}); // module: nodes/text.js - -require.register("parser.js", function(module, exports, require){ - -/*! - * Jade - Parser - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Lexer = require('./lexer') - , nodes = require('./nodes'); - -/** - * Initialize `Parser` with the given input `str` and `filename`. - * - * @param {String} str - * @param {String} filename - * @param {Object} options - * @api public - */ - -var Parser = exports = module.exports = function Parser(str, filename, options){ - this.input = str; - this.lexer = new Lexer(str, options); - this.filename = filename; - this.blocks = {}; - this.options = options; - this.contexts = [this]; -}; - -/** - * Tags that may not contain tags. - */ - -var textOnly = exports.textOnly = ['script', 'style']; - -/** - * Parser prototype. - */ - -Parser.prototype = { - - /** - * Push `parser` onto the context stack, - * or pop and return a `Parser`. - */ - - context: function(parser){ - if (parser) { - this.contexts.push(parser); - } else { - return this.contexts.pop(); - } - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.lexer.advance(); - }, - - /** - * Skip `n` tokens. - * - * @param {Number} n - * @api private - */ - - skip: function(n){ - while (n--) this.advance(); - }, - - /** - * Single token lookahead. - * - * @return {Object} - * @api private - */ - - peek: function() { - return this.lookahead(1); - }, - - /** - * Return lexer lineno. - * - * @return {Number} - * @api private - */ - - line: function() { - return this.lexer.lineno; - }, - - /** - * `n` token lookahead. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - return this.lexer.lookahead(n); - }, - - /** - * Parse input returning a string of js for evaluation. - * - * @return {String} - * @api public - */ - - parse: function(){ - var block = new nodes.Block, parser; - block.line = this.line(); - - while ('eos' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - - if (parser = this.extending) { - this.context(parser); - var ast = parser.parse(); - this.context(); - return ast; - } - - return block; - }, - - /** - * Expect the given type, or throw an exception. - * - * @param {String} type - * @api private - */ - - expect: function(type){ - if (this.peek().type === type) { - return this.advance(); - } else { - throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); - } - }, - - /** - * Accept the given `type`. - * - * @param {String} type - * @api private - */ - - accept: function(type){ - if (this.peek().type === type) { - return this.advance(); - } - }, - - /** - * tag - * | doctype - * | mixin - * | include - * | filter - * | comment - * | text - * | each - * | code - * | yield - * | id - * | class - */ - - parseExpr: function(){ - switch (this.peek().type) { - case 'tag': - return this.parseTag(); - case 'mixin': - return this.parseMixin(); - case 'block': - return this.parseBlock(); - case 'case': - return this.parseCase(); - case 'when': - return this.parseWhen(); - case 'default': - return this.parseDefault(); - case 'extends': - return this.parseExtends(); - case 'include': - return this.parseInclude(); - case 'doctype': - return this.parseDoctype(); - case 'filter': - return this.parseFilter(); - case 'comment': - return this.parseComment(); - case 'text': - return this.parseText(); - case 'each': - return this.parseEach(); - case 'code': - return this.parseCode(); - case 'yield': - this.advance(); - var block = new nodes.Block; - block.yield = true; - return block; - case 'id': - case 'class': - var tok = this.advance(); - this.lexer.defer(this.lexer.tok('tag', 'div')); - this.lexer.defer(tok); - return this.parseExpr(); - default: - throw new Error('unexpected token "' + this.peek().type + '"'); - } - }, - - /** - * Text - */ - - parseText: function(){ - var tok = this.expect('text') - , node = new nodes.Text(tok.val); - node.line = this.line(); - return node; - }, - - /** - * ':' expr - * | block - */ - - parseBlockExpansion: function(){ - if (':' == this.peek().type) { - this.advance(); - return new nodes.Block(this.parseExpr()); - } else { - return this.block(); - } - }, - - /** - * case - */ - - parseCase: function(){ - var val = this.expect('case').val - , node = new nodes.Case(val); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * when - */ - - parseWhen: function(){ - var val = this.expect('when').val - return new nodes.Case.When(val, this.parseBlockExpansion()); - }, - - /** - * default - */ - - parseDefault: function(){ - this.expect('default'); - return new nodes.Case.When('default', this.parseBlockExpansion()); - }, - - /** - * code - */ - - parseCode: function(){ - var tok = this.expect('code') - , node = new nodes.Code(tok.val, tok.buffer, tok.escape) - , block - , i = 1; - node.line = this.line(); - while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; - block = 'indent' == this.lookahead(i).type; - if (block) { - this.skip(i-1); - node.block = this.block(); - } - return node; - }, - - /** - * comment - */ - - parseComment: function(){ - var tok = this.expect('comment') - , node; - - if ('indent' == this.peek().type) { - node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); - } else { - node = new nodes.Comment(tok.val, tok.buffer); - } - - node.line = this.line(); - return node; - }, - - /** - * doctype - */ - - parseDoctype: function(){ - var tok = this.expect('doctype') - , node = new nodes.Doctype(tok.val); - node.line = this.line(); - return node; - }, - - /** - * filter attrs? text-block - */ - - parseFilter: function(){ - var block - , tok = this.expect('filter') - , attrs = this.accept('attrs'); - - this.lexer.pipeless = true; - block = this.parseTextBlock(); - this.lexer.pipeless = false; - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * tag ':' attrs? block - */ - - parseASTFilter: function(){ - var block - , tok = this.expect('tag') - , attrs = this.accept('attrs'); - - this.expect(':'); - block = this.block(); - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * each block - */ - - parseEach: function(){ - var tok = this.expect('each') - , node = new nodes.Each(tok.code, tok.val, tok.key); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * 'extends' name - */ - - parseExtends: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - if (!this.filename) - throw new Error('the "filename" option is required to extend templates'); - - var path = this.expect('extends').val.trim() - , dir = dirname(this.filename); - - var path = join(dir, path + '.jade') - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - parser.blocks = this.blocks; - parser.contexts = this.contexts; - this.extending = parser; - - // TODO: null node - return new nodes.Literal(''); - }, - - /** - * 'block' name block - */ - - parseBlock: function(){ - var block = this.expect('block') - , mode = block.mode - , name = block.val.trim(); - - block = 'indent' == this.peek().type - ? this.block() - : new nodes.Block(new nodes.Literal('')); - - var prev = this.blocks[name]; - - if (prev) { - switch (prev.mode) { - case 'append': - block.nodes = block.nodes.concat(prev.nodes); - prev = block; - break; - case 'prepend': - block.nodes = prev.nodes.concat(block.nodes); - prev = block; - break; - } - } - - block.mode = mode; - return this.blocks[name] = prev || block; - }, - - /** - * include block? - */ - - parseInclude: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - var path = this.expect('include').val.trim() - , dir = dirname(this.filename); - - if (!this.filename) - throw new Error('the "filename" option is required to use includes'); - - // no extension - if (!~basename(path).indexOf('.')) { - path += '.jade'; - } - - // non-jade - if ('.jade' != path.substr(-5)) { - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8'); - return new nodes.Literal(str); - } - - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - this.context(parser); - var ast = parser.parse(); - this.context(); - ast.filename = path; - - if ('indent' == this.peek().type) { - ast.includeBlock().push(this.block()); - } - - return ast; - }, - - /** - * mixin block - */ - - parseMixin: function(){ - var tok = this.expect('mixin') - , name = tok.val - , args = tok.args; - var block = 'indent' == this.peek().type - ? this.block() - : null; - return new nodes.Mixin(name, args, block); - }, - - /** - * indent (text | newline)* outdent - */ - - parseTextBlock: function(){ - var text = new nodes.Text; - text.line = this.line(); - var spaces = this.expect('indent').val; - if (null == this._spaces) this._spaces = spaces; - var indent = Array(spaces - this._spaces + 1).join(' '); - while ('outdent' != this.peek().type) { - switch (this.peek().type) { - case 'newline': - text.push('\\n'); - this.advance(); - break; - case 'indent': - text.push('\\n'); - this.parseTextBlock().nodes.forEach(function(node){ - text.push(node); - }); - text.push('\\n'); - break; - default: - text.push(indent + this.advance().val); - } - } - - if (spaces == this._spaces) this._spaces = null; - this.expect('outdent'); - return text; - }, - - /** - * indent expr* outdent - */ - - block: function(){ - var block = new nodes.Block; - block.line = this.line(); - this.expect('indent'); - while ('outdent' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - this.expect('outdent'); - return block; - }, - - /** - * tag (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseTag: function(){ - // ast-filter look-ahead - var i = 2; - if ('attrs' == this.lookahead(i).type) ++i; - if (':' == this.lookahead(i).type) { - if ('indent' == this.lookahead(++i).type) { - return this.parseASTFilter(); - } - } - - var name = this.advance().val - , tag = new nodes.Tag(name) - , dot; - - tag.line = this.line(); - - // (attrs | class | id)* - out: - while (true) { - switch (this.peek().type) { - case 'id': - case 'class': - var tok = this.advance(); - tag.setAttribute(tok.type, "'" + tok.val + "'"); - continue; - case 'attrs': - var obj = this.advance().attrs - , names = Object.keys(obj); - for (var i = 0, len = names.length; i < len; ++i) { - var name = names[i] - , val = obj[name]; - tag.setAttribute(name, val); - } - continue; - default: - break out; - } - } - - // check immediate '.' - if ('.' == this.peek().val) { - dot = tag.textOnly = true; - this.advance(); - } - - // (text | code | ':')? - switch (this.peek().type) { - case 'text': - tag.text = this.parseText(); - break; - case 'code': - tag.code = this.parseCode(); - break; - case ':': - this.advance(); - tag.block = new nodes.Block; - tag.block.push(this.parseTag()); - break; - } - - // newline* - while ('newline' == this.peek().type) this.advance(); - - tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); - - // script special-case - if ('script' == tag.name) { - var type = tag.getAttribute('type'); - if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { - tag.textOnly = false; - } - } - - // block? - if ('indent' == this.peek().type) { - if (tag.textOnly) { - this.lexer.pipeless = true; - tag.block = this.parseTextBlock(); - this.lexer.pipeless = false; - } else { - var block = this.block(); - if (tag.block) { - for (var i = 0, len = block.nodes.length; i < len; ++i) { - tag.block.push(block.nodes[i]); - } - } else { - tag.block = block; - } - } - } - - return tag; - } -}; - -}); // module: parser.js - -require.register("runtime.js", function(module, exports, require){ - -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj){ - var buf = [] - , terse = obj.terse; - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else { - buf.push(key + '="' + exports.escape(val) + '"'); - } - } - } - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; - -}); // module: runtime.js - -require.register("self-closing.js", function(module, exports, require){ - -/*! - * Jade - self closing tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'meta' - , 'img' - , 'link' - , 'input' - , 'area' - , 'base' - , 'col' - , 'br' - , 'hr' -]; -}); // module: self-closing.js - -require.register("utils.js", function(module, exports, require){ - -/*! - * Jade - utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Convert interpolation in the given string to JavaScript. - * - * @param {String} str - * @return {String} - * @api private - */ - -var interpolate = exports.interpolate = function(str){ - return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ - return escape - ? str - : "' + " - + ('!' == flag ? '' : 'escape') - + "((interp = " + code.replace(/\\'/g, "'") - + ") == null ? '' : interp) + '"; - }); -}; - -/** - * Escape single quotes in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -var escape = exports.escape = function(str) { - return str.replace(/'/g, "\\'"); -}; - -/** - * Interpolate, and escape the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.text = function(str){ - return interpolate(escape(str)); -}; -}); // module: utils.js - -window.jade = require("jade"); -})(); diff --git a/usb_auth/node_modules/jade/jade.min.js b/usb_auth/node_modules/jade/jade.min.js deleted file mode 100644 index ace59ff..0000000 --- a/usb_auth/node_modules/jade/jade.min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){function require(p){var path=require.resolve(p),mod=require.modules[path];if(!mod)throw new Error('failed to require "'+p+'"');return mod.exports||(mod.exports={},mod.call(mod.exports,mod,mod.exports,require.relative(path))),mod.exports}require.modules={},require.resolve=function(path){var orig=path,reg=path+".js",index=path+"/index.js";return require.modules[reg]&®||require.modules[index]&&index||orig},require.register=function(path,fn){require.modules[path]=fn},require.relative=function(parent){return function(p){if("."!=p[0])return require(p);var path=parent.split("/"),segs=p.split("/");path.pop();for(var i=0;i",this.doctype=doctype,this.terse="5"==name||"html"==name,this.xml=0==this.doctype.indexOf(""):this.buffer("/>")):(tag.attrs.length?(this.buffer("<"+name),tag.attrs.length&&this.visitAttributes(tag.attrs),this.buffer(">")):this.buffer("<"+name+">"),tag.code&&this.visitCode(tag.code),tag.text&&this.buffer(utils.text(tag.text.nodes[0].trimLeft())),this.escape="pre"==tag.name,this.visit(tag.block),this.pp&&!~inlineTags.indexOf(name)&&!tag.textOnly&&this.buffer("\\n"+Array(this.indents).join(" ")),this.buffer("")),this.indents--},visitFilter:function(filter){var fn=filters[filter.name];if(!fn)throw filter.isASTFilter?new Error('unknown ast filter "'+filter.name+':"'):new Error('unknown filter ":'+filter.name+'"');if(filter.isASTFilter)this.buf.push(fn(filter.block,this,filter.attrs));else{var text=filter.block.nodes.join("");this.buffer(utils.text(fn(text,filter.attrs)))}},visitText:function(text){text=utils.text(text.nodes.join("")),this.escape&&(text=escape(text)),this.buffer(text),this.buffer("\\n")},visitComment:function(comment){if(!comment.buffer)return;this.pp&&this.buffer("\\n"+Array(this.indents+1).join(" ")),this.buffer("")},visitBlockComment:function(comment){if(!comment.buffer)return;0==comment.val.trim().indexOf("if")?(this.buffer("")):(this.buffer(""))},visitCode:function(code){if(code.buffer){var val=code.val.trimLeft();this.buf.push("var __val__ = "+val),val='null == __val__ ? "" : __val__',code.escape&&(val="escape("+val+")"),this.buf.push("buf.push("+val+");")}else this.buf.push(code.val);code.block&&(code.buffer||this.buf.push("{"),this.visit(code.block),code.buffer||this.buf.push("}"))},visitEach:function(each){this.buf.push("// iterate "+each.obj+"\n"+"(function(){\n"+" if ('number' == typeof "+each.obj+".length) {\n"+" for (var "+each.key+" = 0, $$l = "+each.obj+".length; "+each.key+" < $$l; "+each.key+"++) {\n"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n } else {\n for (var "+each.key+" in "+each.obj+") {\n"+" if ("+each.obj+".hasOwnProperty("+each.key+")){"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n"),this.buf.push(" }\n }\n}).call(this);\n")},visitAttributes:function(attrs){var buf=[],classes=[];this.terse&&buf.push("terse: true"),attrs.forEach(function(attr){if(attr.name=="class")classes.push("("+attr.val+")");else{var pair="'"+attr.name+"':("+attr.val+")";buf.push(pair)}}),classes.length&&(classes=classes.join(" + ' ' + "),buf.push("class: "+classes)),buf=buf.join(", ").replace("class:",'"class":'),this.buf.push("buf.push(attrs({ "+buf+" }));")}};function escape(html){return String(html).replace(/&(?!\w+;)/g,"&").replace(//g,">").replace(/"/g,""")}}),require.register("doctypes.js",function(module,exports,require){module.exports={5:"",xml:'',"default":'',transitional:'',strict:'',frameset:'',1.1:'',basic:'',mobile:''}}),require.register("filters.js",function(module,exports,require){module.exports={cdata:function(str){return""},sass:function(str){str=str.replace(/\\n/g,"\n");var sass=require("sass").render(str).replace(/\n/g,"\\n");return'"},stylus:function(str,options){var ret;str=str.replace(/\\n/g,"\n");var stylus=require("stylus");return stylus(str,options).render(function(err,css){if(err)throw err;ret=css.replace(/\n/g,"\\n")}),'"},less:function(str){var ret;return str=str.replace(/\\n/g,"\n"),require("less").render(str,function(err,css){if(err)throw err;ret='"}),ret},markdown:function(str){var md;try{md=require("markdown")}catch(err){try{md=require("discount")}catch(err){try{md=require("markdown-js")}catch(err){try{md=require("marked")}catch(err){throw new Error("Cannot find markdown library, install markdown, discount, or marked.")}}}}return str=str.replace(/\\n/g,"\n"),md.parse(str).replace(/\n/g,"\\n").replace(/'/g,"'")},coffeescript:function(str){str=str.replace(/\\n/g,"\n");var js=require("coffee-script").compile(str).replace(/\n/g,"\\n");return'"}}}),require.register("inline-tags.js",function(module,exports,require){module.exports=["a","abbr","acronym","b","br","code","em","font","i","img","ins","kbd","map","samp","small","span","strong","sub","sup"]}),require.register("jade.js",function(module,exports,require){var Parser=require("./parser"),Lexer=require("./lexer"),Compiler=require("./compiler"),runtime=require("./runtime");exports.version="0.20.1",exports.selfClosing=require("./self-closing"),exports.doctypes=require("./doctypes"),exports.filters=require("./filters"),exports.utils=require("./utils"),exports.Compiler=Compiler,exports.Parser=Parser,exports.Lexer=Lexer,exports.nodes=require("./nodes"),exports.runtime=runtime,exports.cache={};function parse(str,options){try{var parser=new Parser(str,options.filename,options),compiler=new(options.compiler||Compiler)(parser.parse(),options),js=compiler.compile();return options.debug&&console.error("\nCompiled Function:\n\n%s",js.replace(/^/gm," ")),"var buf = [];\n"+(options.self?"var self = locals || {};\n"+js:"with (locals || {}) {\n"+js+"\n}\n")+'return buf.join("");'}catch(err){parser=parser.context(),runtime.rethrow(err,parser.filename,parser.lexer.lineno)}}exports.compile=function(str,options){var options=options||{},client=options.client,filename=options.filename?JSON.stringify(options.filename):"undefined",fn;return options.compileDebug!==!1?fn=["var __jade = [{ lineno: 1, filename: "+filename+" }];","try {",parse(String(str),options),"} catch (err) {"," rethrow(err, __jade[0].filename, __jade[0].lineno);","}"].join("\n"):fn=parse(String(str),options),client&&(fn="var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n"+fn),fn=new Function("locals, attrs, escape, rethrow",fn),client?fn:function(locals){return fn(locals,runtime.attrs,runtime.escape,runtime.rethrow)}},exports.render=function(str,options,fn){"function"==typeof options&&(fn=options,options={});if(options.cache&&!options.filename)return fn(new Error('the "filename" option is required for caching'));try{var path=options.filename,tmpl=options.cache?exports.cache[path]||(exports.cache[path]=exports.compile(str,options)):exports.compile(str,options);fn(null,tmpl(options))}catch(err){fn(err)}},exports.renderFile=function(path,options,fn){var key=path+":string";"function"==typeof options&&(fn=options,options={});try{options.filename=path;var str=options.cache?exports.cache[key]||(exports.cache[key]=fs.readFileSync(path,"utf8")):fs.readFileSync(path,"utf8");exports.render(str,options,fn)}catch(err){fn(err)}},exports.__express=exports.renderFile}),require.register("lexer.js",function(module,exports,require){var Lexer=module.exports=function(str,options){options=options||{},this.input=str.replace(/\r\n|\r/g,"\n"),this.colons=options.colons,this.deferredTokens=[],this.lastIndents=0,this.lineno=1,this.stash=[],this.indentStack=[],this.indentRe=null,this.pipeless=!1};Lexer.prototype={tok:function(type,val){return{type:type,line:this.lineno,val:val}},consume:function(len){this.input=this.input.substr(len)},scan:function(regexp,type){var captures;if(captures=regexp.exec(this.input))return this.consume(captures[0].length),this.tok(type,captures[1])},defer:function(tok){this.deferredTokens.push(tok)},lookahead:function(n){var fetch=n-this.stash.length;while(fetch-->0)this.stash.push(this.next());return this.stash[--n]},indexOfDelimiters:function(start,end){var str=this.input,nstart=0,nend=0,pos=0;for(var i=0,len=str.length;iindents)this.stash.push(this.tok("outdent")),this.indentStack.shift();tok=this.stash.pop()}else indents&&indents!=this.indentStack[0]?(this.indentStack.unshift(indents),tok=this.tok("indent",indents)):tok=this.tok("newline");return tok}},pipelessText:function(){if(this.pipeless){if("\n"==this.input[0])return;var i=this.input.indexOf("\n");-1==i&&(i=this.input.length);var str=this.input.substr(0,i);return this.consume(str.length),this.tok("text",str)}},colon:function(){return this.scan(/^: */,":")},advance:function(){return this.stashed()||this.next()},next:function(){return this.deferred()||this.eos()||this.pipelessText()||this.yield()||this.doctype()||this.case()||this.when()||this.default()||this.extends()||this.append()||this.prepend()||this.block()||this.include()||this.mixin()||this.conditional()||this.each()||this.while()||this.assignment()||this.tag()||this.filter()||this.code()||this.id()||this.className()||this.attrs()||this.indent()||this.comment()||this.colon()||this.text()}}}),require.register("nodes/block-comment.js",function(module,exports,require){var Node=require("./node"),BlockComment=module.exports=function(val,block,buffer){this.block=block,this.val=val,this.buffer=buffer};BlockComment.prototype=new Node,BlockComment.prototype.constructor=BlockComment}),require.register("nodes/block.js",function(module,exports,require){var Node=require("./node"),Block=module.exports=function(node){this.nodes=[],node&&this.push(node)};Block.prototype=new Node,Block.prototype.constructor=Block,Block.prototype.replace=function(other){other.nodes=this.nodes},Block.prototype.push=function(node){return this.nodes.push(node)},Block.prototype.isEmpty=function(){return 0==this.nodes.length},Block.prototype.unshift=function(node){return this.nodes.unshift(node)},Block.prototype.includeBlock=function(){var ret=this,node;for(var i=0,len=this.nodes.length;i/g,">").replace(/"/g,""")},exports.rethrow=function(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err}}),require.register("self-closing.js",function(module,exports,require){module.exports=["meta","img","link","input","area","base","col","br","hr"]}),require.register("utils.js",function(module,exports,require){var interpolate=exports.interpolate=function(str){return str.replace(/(\\)?([#!]){(.*?)}/g,function(str,escape,flag,code){return escape?str:"' + "+("!"==flag?"":"escape")+"((interp = "+code.replace(/\\'/g,"'")+") == null ? '' : interp) + '"})},escape=exports.escape=function(str){return str.replace(/'/g,"\\'")};exports.text=function(str){return interpolate(escape(str))}}),window.jade=require("jade")})(); \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/compiler.js b/usb_auth/node_modules/jade/lib/compiler.js deleted file mode 100644 index 5459da8..0000000 --- a/usb_auth/node_modules/jade/lib/compiler.js +++ /dev/null @@ -1,503 +0,0 @@ - -/*! - * Jade - Compiler - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var nodes = require('./nodes') - , filters = require('./filters') - , doctypes = require('./doctypes') - , selfClosing = require('./self-closing') - , inlineTags = require('./inline-tags') - , utils = require('./utils'); - -// if browser -// -// if (!Object.keys) { -// Object.keys = function(obj){ -// var arr = []; -// for (var key in obj) { -// if (obj.hasOwnProperty(key)) { -// arr.push(key); -// } -// } -// return arr; -// } -// } -// -// if (!String.prototype.trimLeft) { -// String.prototype.trimLeft = function(){ -// return this.replace(/^\s+/, ''); -// } -// } -// -// end - - -/** - * Initialize `Compiler` with the given `node`. - * - * @param {Node} node - * @param {Object} options - * @api public - */ - -var Compiler = module.exports = function Compiler(node, options) { - this.options = options = options || {}; - this.node = node; - this.hasCompiledDoctype = false; - this.hasCompiledTag = false; - this.pp = options.pretty || false; - this.debug = false !== options.compileDebug; - this.indents = 0; - if (options.doctype) this.setDoctype(options.doctype); -}; - -/** - * Compiler prototype. - */ - -Compiler.prototype = { - - /** - * Compile parse tree to JavaScript. - * - * @api public - */ - - compile: function(){ - this.buf = ['var interp;']; - this.lastBufferedIdx = -1 - this.visit(this.node); - return this.buf.join('\n'); - }, - - /** - * Sets the default doctype `name`. Sets terse mode to `true` when - * html 5 is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {string} name - * @api public - */ - - setDoctype: function(name){ - var doctype = doctypes[(name || 'default').toLowerCase()]; - doctype = doctype || ''; - this.doctype = doctype; - this.terse = '5' == name || 'html' == name; - this.xml = 0 == this.doctype.indexOf('" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {Doctype} doctype - * @api public - */ - - visitDoctype: function(doctype){ - if (doctype && (doctype.val || !this.doctype)) { - this.setDoctype(doctype.val || 'default'); - } - - if (this.doctype) this.buffer(this.doctype); - this.hasCompiledDoctype = true; - }, - - /** - * Visit `mixin`, generating a function that - * may be called within the template. - * - * @param {Mixin} mixin - * @api public - */ - - visitMixin: function(mixin){ - var name = mixin.name.replace(/-/g, '_') + '_mixin' - , args = mixin.args || ''; - - if (mixin.block) { - this.buf.push('var ' + name + ' = function(' + args + '){'); - this.visit(mixin.block); - this.buf.push('}'); - } else { - this.buf.push(name + '(' + args + ');'); - } - }, - - /** - * Visit `tag` buffering tag markup, generating - * attributes, visiting the `tag`'s code and block. - * - * @param {Tag} tag - * @api public - */ - - visitTag: function(tag){ - this.indents++; - var name = tag.name; - - if (!this.hasCompiledTag) { - if (!this.hasCompiledDoctype && 'html' == name) { - this.visitDoctype(); - } - this.hasCompiledTag = true; - } - - // pretty print - if (this.pp && inlineTags.indexOf(name) == -1) { - this.buffer('\\n' + Array(this.indents).join(' ')); - } - - if (~selfClosing.indexOf(name) && !this.xml) { - this.buffer('<' + name); - this.visitAttributes(tag.attrs); - this.terse - ? this.buffer('>') - : this.buffer('/>'); - } else { - // Optimize attributes buffering - if (tag.attrs.length) { - this.buffer('<' + name); - if (tag.attrs.length) this.visitAttributes(tag.attrs); - this.buffer('>'); - } else { - this.buffer('<' + name + '>'); - } - if (tag.code) this.visitCode(tag.code); - if (tag.text) this.buffer(utils.text(tag.text.nodes[0].trimLeft())); - this.escape = 'pre' == tag.name; - this.visit(tag.block); - - // pretty print - if (this.pp && !~inlineTags.indexOf(name) && !tag.textOnly) { - this.buffer('\\n' + Array(this.indents).join(' ')); - } - - this.buffer(''); - } - this.indents--; - }, - - /** - * Visit `filter`, throwing when the filter does not exist. - * - * @param {Filter} filter - * @api public - */ - - visitFilter: function(filter){ - var fn = filters[filter.name]; - - // unknown filter - if (!fn) { - if (filter.isASTFilter) { - throw new Error('unknown ast filter "' + filter.name + ':"'); - } else { - throw new Error('unknown filter ":' + filter.name + '"'); - } - } - if (filter.isASTFilter) { - this.buf.push(fn(filter.block, this, filter.attrs)); - } else { - var text = filter.block.nodes.join(''); - filter.attrs = filter.attrs || {}; - filter.attrs.filename = this.options.filename; - this.buffer(utils.text(fn(text, filter.attrs))); - } - }, - - /** - * Visit `text` node. - * - * @param {Text} text - * @api public - */ - - visitText: function(text){ - text = utils.text(text.nodes.join('')); - if (this.escape) text = escape(text); - this.buffer(text); - this.buffer('\\n'); - }, - - /** - * Visit a `comment`, only buffering when the buffer flag is set. - * - * @param {Comment} comment - * @api public - */ - - visitComment: function(comment){ - if (!comment.buffer) return; - if (this.pp) this.buffer('\\n' + Array(this.indents + 1).join(' ')); - this.buffer(''); - }, - - /** - * Visit a `BlockComment`. - * - * @param {Comment} comment - * @api public - */ - - visitBlockComment: function(comment){ - if (!comment.buffer) return; - if (0 == comment.val.trim().indexOf('if')) { - this.buffer(''); - } else { - this.buffer(''); - } - }, - - /** - * Visit `code`, respecting buffer / escape flags. - * If the code is followed by a block, wrap it in - * a self-calling function. - * - * @param {Code} code - * @api public - */ - - visitCode: function(code){ - // Wrap code blocks with {}. - // we only wrap unbuffered code blocks ATM - // since they are usually flow control - - // Buffer code - if (code.buffer) { - var val = code.val.trimLeft(); - this.buf.push('var __val__ = ' + val); - val = 'null == __val__ ? "" : __val__'; - if (code.escape) val = 'escape(' + val + ')'; - this.buf.push("buf.push(" + val + ");"); - } else { - this.buf.push(code.val); - } - - // Block support - if (code.block) { - if (!code.buffer) this.buf.push('{'); - this.visit(code.block); - if (!code.buffer) this.buf.push('}'); - } - }, - - /** - * Visit `each` block. - * - * @param {Each} each - * @api public - */ - - visitEach: function(each){ - this.buf.push('' - + '// iterate ' + each.obj + '\n' - + '(function(){\n' - + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' - + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push('' - + ' }\n' - + ' } else {\n' - + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' - // if browser - // + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' - // end - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - // if browser - // this.buf.push(' }\n'); - // end - - this.buf.push(' }\n }\n}).call(this);\n'); - }, - - /** - * Visit `attrs`. - * - * @param {Array} attrs - * @api public - */ - - visitAttributes: function(attrs){ - var buf = [] - , classes = []; - - if (this.terse) buf.push('terse: true'); - - attrs.forEach(function(attr){ - if (attr.name == 'class') { - classes.push('(' + attr.val + ')'); - } else { - var pair = "'" + attr.name + "':(" + attr.val + ')'; - buf.push(pair); - } - }); - - if (classes.length) { - classes = classes.join(" + ' ' + "); - buf.push("class: " + classes); - } - - buf = buf.join(', ').replace('class:', '"class":'); - - this.buf.push("buf.push(attrs({ " + buf + " }));"); - } -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} diff --git a/usb_auth/node_modules/jade/lib/doctypes.js b/usb_auth/node_modules/jade/lib/doctypes.js deleted file mode 100644 index feeb560..0000000 --- a/usb_auth/node_modules/jade/lib/doctypes.js +++ /dev/null @@ -1,18 +0,0 @@ - -/*! - * Jade - doctypes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - '5': '' - , 'xml': '' - , 'default': '' - , 'transitional': '' - , 'strict': '' - , 'frameset': '' - , '1.1': '' - , 'basic': '' - , 'mobile': '' -}; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/filters.js b/usb_auth/node_modules/jade/lib/filters.js deleted file mode 100644 index a7e1bef..0000000 --- a/usb_auth/node_modules/jade/lib/filters.js +++ /dev/null @@ -1,97 +0,0 @@ - -/*! - * Jade - filters - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - - /** - * Wrap text with CDATA block. - */ - - cdata: function(str){ - return ''; - }, - - /** - * Transform sass to css, wrapped in style tags. - */ - - sass: function(str){ - str = str.replace(/\\n/g, '\n'); - var sass = require('sass').render(str).replace(/\n/g, '\\n'); - return ''; - }, - - /** - * Transform stylus to css, wrapped in style tags. - */ - - stylus: function(str, options){ - var ret; - str = str.replace(/\\n/g, '\n'); - var stylus = require('stylus'); - stylus(str, options).render(function(err, css){ - if (err) throw err; - ret = css.replace(/\n/g, '\\n'); - }); - return ''; - }, - - /** - * Transform less to css, wrapped in style tags. - */ - - less: function(str){ - var ret; - str = str.replace(/\\n/g, '\n'); - require('less').render(str, function(err, css){ - if (err) throw err; - ret = ''; - }); - return ret; - }, - - /** - * Transform markdown to html. - */ - - markdown: function(str){ - var md; - - // support markdown / discount - try { - md = require('markdown'); - } catch (err){ - try { - md = require('discount'); - } catch (err) { - try { - md = require('markdown-js'); - } catch (err) { - try { - md = require('marked'); - } catch (err) { - throw new - Error('Cannot find markdown library, install markdown, discount, or marked.'); - } - } - } - } - - str = str.replace(/\\n/g, '\n'); - return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); - }, - - /** - * Transform coffeescript to javascript. - */ - - coffeescript: function(str){ - str = str.replace(/\\n/g, '\n'); - var js = require('coffee-script').compile(str).replace(/\n/g, '\\n'); - return ''; - } -}; diff --git a/usb_auth/node_modules/jade/lib/index.js b/usb_auth/node_modules/jade/lib/index.js deleted file mode 120000 index 6a783c2..0000000 --- a/usb_auth/node_modules/jade/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -jade.js \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/inline-tags.js b/usb_auth/node_modules/jade/lib/inline-tags.js deleted file mode 100644 index 491de0b..0000000 --- a/usb_auth/node_modules/jade/lib/inline-tags.js +++ /dev/null @@ -1,28 +0,0 @@ - -/*! - * Jade - inline tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'a' - , 'abbr' - , 'acronym' - , 'b' - , 'br' - , 'code' - , 'em' - , 'font' - , 'i' - , 'img' - , 'ins' - , 'kbd' - , 'map' - , 'samp' - , 'small' - , 'span' - , 'strong' - , 'sub' - , 'sup' -]; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/jade.js b/usb_auth/node_modules/jade/lib/jade.js deleted file mode 100644 index 9312cf7..0000000 --- a/usb_auth/node_modules/jade/lib/jade.js +++ /dev/null @@ -1,237 +0,0 @@ -/*! - * Jade - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Parser = require('./parser') - , Lexer = require('./lexer') - , Compiler = require('./compiler') - , runtime = require('./runtime') -// if node - , fs = require('fs'); -// end - -/** - * Library version. - */ - -exports.version = '0.20.3'; - -/** - * Expose self closing tags. - */ - -exports.selfClosing = require('./self-closing'); - -/** - * Default supported doctypes. - */ - -exports.doctypes = require('./doctypes'); - -/** - * Text filters. - */ - -exports.filters = require('./filters'); - -/** - * Utilities. - */ - -exports.utils = require('./utils'); - -/** - * Expose `Compiler`. - */ - -exports.Compiler = Compiler; - -/** - * Expose `Parser`. - */ - -exports.Parser = Parser; - -/** - * Expose `Lexer`. - */ - -exports.Lexer = Lexer; - -/** - * Nodes. - */ - -exports.nodes = require('./nodes'); - -/** - * Jade runtime helpers. - */ - -exports.runtime = runtime; - -/** - * Template function cache. - */ - -exports.cache = {}; - -/** - * Parse the given `str` of jade and return a function body. - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api private - */ - -function parse(str, options){ - try { - // Parse - var parser = new Parser(str, options.filename, options); - - // Compile - var compiler = new (options.compiler || Compiler)(parser.parse(), options) - , js = compiler.compile(); - - // Debug compiler - if (options.debug) { - console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); - } - - return '' - + 'var buf = [];\n' - + (options.self - ? 'var self = locals || {};\n' + js - : 'with (locals || {}) {\n' + js + '\n}\n') - + 'return buf.join("");'; - } catch (err) { - parser = parser.context(); - runtime.rethrow(err, parser.filename, parser.lexer.lineno); - } -} - -/** - * Compile a `Function` representation of the given jade `str`. - * - * Options: - * - * - `compileDebug` when `false` debugging code is stripped from the compiled template - * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` - * for use with the Jade client-side runtime.js - * - * @param {String} str - * @param {Options} options - * @return {Function} - * @api public - */ - -exports.compile = function(str, options){ - var options = options || {} - , client = options.client - , filename = options.filename - ? JSON.stringify(options.filename) - : 'undefined' - , fn; - - if (options.compileDebug !== false) { - fn = [ - 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' - , 'try {' - , parse(String(str), options) - , '} catch (err) {' - , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' - , '}' - ].join('\n'); - } else { - fn = parse(String(str), options); - } - - if (client) { - fn = 'var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n' + fn; - } - - fn = new Function('locals, attrs, escape, rethrow', fn); - - if (client) return fn; - - return function(locals){ - return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow); - }; -}; - -/** - * Render the given `str` of jade and invoke - * the callback `fn(err, str)`. - * - * Options: - * - * - `cache` enable template caching - * - `filename` filename required for `include` / `extends` and caching - * - * @param {String} str - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -exports.render = function(str, options, fn){ - // swap args - if ('function' == typeof options) { - fn = options, options = {}; - } - - // cache requires .filename - if (options.cache && !options.filename) { - return fn(new Error('the "filename" option is required for caching')); - } - - try { - var path = options.filename; - var tmpl = options.cache - ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) - : exports.compile(str, options); - fn(null, tmpl(options)); - } catch (err) { - fn(err); - } -}; - -/** - * Render a Jade file at the given `path` and callback `fn(err, str)`. - * - * @param {String} path - * @param {Object|Function} options or callback - * @param {Function} fn - * @api public - */ - -exports.renderFile = function(path, options, fn){ - var key = path + ':string'; - - if ('function' == typeof options) { - fn = options, options = {}; - } - - try { - options.filename = path; - var str = options.cache - ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) - : fs.readFileSync(path, 'utf8'); - exports.render(str, options, fn); - } catch (err) { - fn(err); - } -}; - -/** - * Express support. - */ - -exports.__express = exports.renderFile; diff --git a/usb_auth/node_modules/jade/lib/lexer.js b/usb_auth/node_modules/jade/lib/lexer.js deleted file mode 100644 index aac94f5..0000000 --- a/usb_auth/node_modules/jade/lib/lexer.js +++ /dev/null @@ -1,707 +0,0 @@ - -/*! - * Jade - Lexer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize `Lexer` with the given `str`. - * - * Options: - * - * - `colons` allow colons for attr delimiters - * - * @param {String} str - * @param {Object} options - * @api private - */ - -var Lexer = module.exports = function Lexer(str, options) { - options = options || {}; - this.input = str.replace(/\r\n|\r/g, '\n'); - this.colons = options.colons; - this.deferredTokens = []; - this.lastIndents = 0; - this.lineno = 1; - this.stash = []; - this.indentStack = []; - this.indentRe = null; - this.pipeless = false; -}; - -/** - * Lexer prototype. - */ - -Lexer.prototype = { - - /** - * Construct a token with the given `type` and `val`. - * - * @param {String} type - * @param {String} val - * @return {Object} - * @api private - */ - - tok: function(type, val){ - return { - type: type - , line: this.lineno - , val: val - } - }, - - /** - * Consume the given `len` of input. - * - * @param {Number} len - * @api private - */ - - consume: function(len){ - this.input = this.input.substr(len); - }, - - /** - * Scan for `type` with the given `regexp`. - * - * @param {String} type - * @param {RegExp} regexp - * @return {Object} - * @api private - */ - - scan: function(regexp, type){ - var captures; - if (captures = regexp.exec(this.input)) { - this.consume(captures[0].length); - return this.tok(type, captures[1]); - } - }, - - /** - * Defer the given `tok`. - * - * @param {Object} tok - * @api private - */ - - defer: function(tok){ - this.deferredTokens.push(tok); - }, - - /** - * Lookahead `n` tokens. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - var fetch = n - this.stash.length; - while (fetch-- > 0) this.stash.push(this.next()); - return this.stash[--n]; - }, - - /** - * Return the indexOf `start` / `end` delimiters. - * - * @param {String} start - * @param {String} end - * @return {Number} - * @api private - */ - - indexOfDelimiters: function(start, end){ - var str = this.input - , nstart = 0 - , nend = 0 - , pos = 0; - for (var i = 0, len = str.length; i < len; ++i) { - if (start == str[i]) { - ++nstart; - } else if (end == str[i]) { - if (++nend == nstart) { - pos = i; - break; - } - } - } - return pos; - }, - - /** - * Stashed token. - */ - - stashed: function() { - return this.stash.length - && this.stash.shift(); - }, - - /** - * Deferred token. - */ - - deferred: function() { - return this.deferredTokens.length - && this.deferredTokens.shift(); - }, - - /** - * end-of-source. - */ - - eos: function() { - if (this.input.length) return; - if (this.indentStack.length) { - this.indentStack.shift(); - return this.tok('outdent'); - } else { - return this.tok('eos'); - } - }, - - /** - * Comment. - */ - - comment: function() { - var captures; - if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('comment', captures[2]); - tok.buffer = '-' != captures[1]; - return tok; - } - }, - - /** - * Tag. - */ - - tag: function() { - var captures; - if (captures = /^(\w[-:\w]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok, name = captures[1]; - if (':' == name[name.length - 1]) { - name = name.slice(0, -1); - tok = this.tok('tag', name); - this.defer(this.tok(':')); - while (' ' == this.input[0]) this.input = this.input.substr(1); - } else { - tok = this.tok('tag', name); - } - return tok; - } - }, - - /** - * Filter. - */ - - filter: function() { - return this.scan(/^:(\w+)/, 'filter'); - }, - - /** - * Doctype. - */ - - doctype: function() { - return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); - }, - - /** - * Id. - */ - - id: function() { - return this.scan(/^#([\w-]+)/, 'id'); - }, - - /** - * Class. - */ - - className: function() { - return this.scan(/^\.([\w-]+)/, 'class'); - }, - - /** - * Text. - */ - - text: function() { - return this.scan(/^(?:\| ?)?([^\n]+)/, 'text'); - }, - - /** - * Extends. - */ - - extends: function() { - return this.scan(/^extends +([^\n]+)/, 'extends'); - }, - - /** - * Block prepend. - */ - - prepend: function() { - var captures; - if (captures = /^prepend +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'prepend' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block append. - */ - - append: function() { - var captures; - if (captures = /^append +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'append' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block. - */ - - block: function() { - var captures; - if (captures = /^block +(?:(prepend|append) +)?([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = captures[1] || 'replace' - , name = captures[2] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Yield. - */ - - yield: function() { - return this.scan(/^yield */, 'yield'); - }, - - /** - * Include. - */ - - include: function() { - return this.scan(/^include +([^\n]+)/, 'include'); - }, - - /** - * Case. - */ - - case: function() { - return this.scan(/^case +([^\n]+)/, 'case'); - }, - - /** - * When. - */ - - when: function() { - return this.scan(/^when +([^:\n]+)/, 'when'); - }, - - /** - * Default. - */ - - default: function() { - return this.scan(/^default */, 'default'); - }, - - /** - * Assignment. - */ - - assignment: function() { - var captures; - if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { - this.consume(captures[0].length); - var name = captures[1] - , val = captures[2]; - return this.tok('code', 'var ' + name + ' = (' + val + ');'); - } - }, - - /** - * Mixin. - */ - - mixin: function(){ - var captures; - if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('mixin', captures[1]); - tok.args = captures[2]; - return tok; - } - }, - - /** - * Conditional. - */ - - conditional: function() { - var captures; - if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var type = captures[1] - , js = captures[2]; - - switch (type) { - case 'if': js = 'if (' + js + ')'; break; - case 'unless': js = 'if (!(' + js + '))'; break; - case 'else if': js = 'else if (' + js + ')'; break; - case 'else': js = 'else'; break; - } - - return this.tok('code', js); - } - }, - - /** - * While. - */ - - while: function() { - var captures; - if (captures = /^while +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('code', 'while (' + captures[1] + ')'); - } - }, - - /** - * Each. - */ - - each: function() { - var captures; - if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('each', captures[1]); - tok.key = captures[2] || '$index'; - tok.code = captures[3]; - return tok; - } - }, - - /** - * Code. - */ - - code: function() { - var captures; - if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var flags = captures[1]; - captures[1] = captures[2]; - var tok = this.tok('code', captures[1]); - tok.escape = flags[0] === '='; - tok.buffer = flags[0] === '=' || flags[1] === '='; - return tok; - } - }, - - /** - * Attributes. - */ - - attrs: function() { - if ('(' == this.input[0]) { - var index = this.indexOfDelimiters('(', ')') - , str = this.input.substr(1, index-1) - , tok = this.tok('attrs') - , len = str.length - , colons = this.colons - , states = ['key'] - , key = '' - , val = '' - , quote - , c; - - function state(){ - return states[states.length - 1]; - } - - function interpolate(attr) { - return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ - return quote + " + (" + expr + ") + " + quote; - }); - } - - this.consume(index + 1); - tok.attrs = {}; - - function parse(c) { - var real = c; - // TODO: remove when people fix ":" - if (colons && ':' == c) c = '='; - switch (c) { - case ',': - case '\n': - switch (state()) { - case 'expr': - case 'array': - case 'string': - case 'object': - val += c; - break; - default: - states.push('key'); - val = val.trim(); - key = key.trim(); - if ('' == key) return; - tok.attrs[key.replace(/^['"]|['"]$/g, '')] = '' == val - ? true - : interpolate(val); - key = val = ''; - } - break; - case '=': - switch (state()) { - case 'key char': - key += real; - break; - case 'val': - case 'expr': - case 'array': - case 'string': - case 'object': - val += real; - break; - default: - states.push('val'); - } - break; - case '(': - if ('val' == state() - || 'expr' == state()) states.push('expr'); - val += c; - break; - case ')': - if ('expr' == state() - || 'val' == state()) states.pop(); - val += c; - break; - case '{': - if ('val' == state()) states.push('object'); - val += c; - break; - case '}': - if ('object' == state()) states.pop(); - val += c; - break; - case '[': - if ('val' == state()) states.push('array'); - val += c; - break; - case ']': - if ('array' == state()) states.pop(); - val += c; - break; - case '"': - case "'": - switch (state()) { - case 'key': - states.push('key char'); - break; - case 'key char': - states.pop(); - break; - case 'string': - if (c == quote) states.pop(); - val += c; - break; - default: - states.push('string'); - val += c; - quote = c; - } - break; - case '': - break; - default: - switch (state()) { - case 'key': - case 'key char': - key += c; - break; - default: - val += c; - } - } - } - - for (var i = 0; i < len; ++i) { - parse(str[i]); - } - - parse(','); - - return tok; - } - }, - - /** - * Indent | Outdent | Newline. - */ - - indent: function() { - var captures, re; - - // established regexp - if (this.indentRe) { - captures = this.indentRe.exec(this.input); - // determine regexp - } else { - // tabs - re = /^\n(\t*) */; - captures = re.exec(this.input); - - // spaces - if (captures && !captures[1].length) { - re = /^\n( *)/; - captures = re.exec(this.input); - } - - // established - if (captures && captures[1].length) this.indentRe = re; - } - - if (captures) { - var tok - , indents = captures[1].length; - - ++this.lineno; - this.consume(indents + 1); - - if (' ' == this.input[0] || '\t' == this.input[0]) { - throw new Error('Invalid indentation, you can use tabs or spaces but not both'); - } - - // blank line - if ('\n' == this.input[0]) return this.tok('newline'); - - // outdent - if (this.indentStack.length && indents < this.indentStack[0]) { - while (this.indentStack.length && this.indentStack[0] > indents) { - this.stash.push(this.tok('outdent')); - this.indentStack.shift(); - } - tok = this.stash.pop(); - // indent - } else if (indents && indents != this.indentStack[0]) { - this.indentStack.unshift(indents); - tok = this.tok('indent', indents); - // newline - } else { - tok = this.tok('newline'); - } - - return tok; - } - }, - - /** - * Pipe-less text consumed only when - * pipeless is true; - */ - - pipelessText: function() { - if (this.pipeless) { - if ('\n' == this.input[0]) return; - var i = this.input.indexOf('\n'); - if (-1 == i) i = this.input.length; - var str = this.input.substr(0, i); - this.consume(str.length); - return this.tok('text', str); - } - }, - - /** - * ':' - */ - - colon: function() { - return this.scan(/^: */, ':'); - }, - - /** - * Return the next token object, or those - * previously stashed by lookahead. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.stashed() - || this.next(); - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - next: function() { - return this.deferred() - || this.eos() - || this.pipelessText() - || this.yield() - || this.doctype() - || this.case() - || this.when() - || this.default() - || this.extends() - || this.append() - || this.prepend() - || this.block() - || this.include() - || this.mixin() - || this.conditional() - || this.each() - || this.while() - || this.assignment() - || this.tag() - || this.filter() - || this.code() - || this.id() - || this.className() - || this.attrs() - || this.indent() - || this.comment() - || this.colon() - || this.text(); - } -}; diff --git a/usb_auth/node_modules/jade/lib/nodes/block-comment.js b/usb_auth/node_modules/jade/lib/nodes/block-comment.js deleted file mode 100644 index 4f41e4a..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/block-comment.js +++ /dev/null @@ -1,33 +0,0 @@ - -/*! - * Jade - nodes - BlockComment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `BlockComment` with the given `block`. - * - * @param {String} val - * @param {Block} block - * @param {Boolean} buffer - * @api public - */ - -var BlockComment = module.exports = function BlockComment(val, block, buffer) { - this.block = block; - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -BlockComment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/block.js b/usb_auth/node_modules/jade/lib/nodes/block.js deleted file mode 100644 index db63c77..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/block.js +++ /dev/null @@ -1,100 +0,0 @@ - -/*! - * Jade - nodes - Block - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Block` with an optional `node`. - * - * @param {Node} node - * @api public - */ - -var Block = module.exports = function Block(node){ - this.nodes = []; - if (node) this.push(node); -}; - -/** - * Inherit from `Node`. - */ - -Block.prototype.__proto__ = Node.prototype; - -/** - * Replace the nodes in `other` with the nodes - * in `this` block. - * - * @param {Block} other - * @api private - */ - -Block.prototype.replace = function(other){ - other.nodes = this.nodes; -}; - -/** - * Pust the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.push = function(node){ - return this.nodes.push(node); -}; - -/** - * Check if this block is empty. - * - * @return {Boolean} - * @api public - */ - -Block.prototype.isEmpty = function(){ - return 0 == this.nodes.length; -}; - -/** - * Unshift the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.unshift = function(node){ - return this.nodes.unshift(node); -}; - -/** - * Return the "last" block, or the first `yield` node. - * - * @return {Block} - * @api private - */ - -Block.prototype.includeBlock = function(){ - var ret = this - , node; - - for (var i = 0, len = this.nodes.length; i < len; ++i) { - node = this.nodes[i]; - if (node.yield) return node; - else if (node.textOnly) continue; - else if (node.includeBlock) ret = node.includeBlock(); - else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); - } - - return ret; -}; - diff --git a/usb_auth/node_modules/jade/lib/nodes/case.js b/usb_auth/node_modules/jade/lib/nodes/case.js deleted file mode 100644 index 08ff033..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/case.js +++ /dev/null @@ -1,43 +0,0 @@ - -/*! - * Jade - nodes - Case - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Case` with `expr`. - * - * @param {String} expr - * @api public - */ - -var Case = exports = module.exports = function Case(expr, block){ - this.expr = expr; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Case.prototype.__proto__ = Node.prototype; - -var When = exports.When = function When(expr, block){ - this.expr = expr; - this.block = block; - this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -When.prototype.__proto__ = Node.prototype; - diff --git a/usb_auth/node_modules/jade/lib/nodes/code.js b/usb_auth/node_modules/jade/lib/nodes/code.js deleted file mode 100644 index babc675..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/code.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Code - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Code` node with the given code `val`. - * Code may also be optionally buffered and escaped. - * - * @param {String} val - * @param {Boolean} buffer - * @param {Boolean} escape - * @api public - */ - -var Code = module.exports = function Code(val, buffer, escape) { - this.val = val; - this.buffer = buffer; - this.escape = escape; - if (val.match(/^ *else/)) this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -Code.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/comment.js b/usb_auth/node_modules/jade/lib/nodes/comment.js deleted file mode 100644 index 2e1469e..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/comment.js +++ /dev/null @@ -1,32 +0,0 @@ - -/*! - * Jade - nodes - Comment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Comment` with the given `val`, optionally `buffer`, - * otherwise the comment may render in the output. - * - * @param {String} val - * @param {Boolean} buffer - * @api public - */ - -var Comment = module.exports = function Comment(val, buffer) { - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -Comment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/doctype.js b/usb_auth/node_modules/jade/lib/nodes/doctype.js deleted file mode 100644 index b8f33e5..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/doctype.js +++ /dev/null @@ -1,29 +0,0 @@ - -/*! - * Jade - nodes - Doctype - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Doctype` with the given `val`. - * - * @param {String} val - * @api public - */ - -var Doctype = module.exports = function Doctype(val) { - this.val = val; -}; - -/** - * Inherit from `Node`. - */ - -Doctype.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/each.js b/usb_auth/node_modules/jade/lib/nodes/each.js deleted file mode 100644 index f54101f..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/each.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Each - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize an `Each` node, representing iteration - * - * @param {String} obj - * @param {String} val - * @param {String} key - * @param {Block} block - * @api public - */ - -var Each = module.exports = function Each(obj, val, key, block) { - this.obj = obj; - this.val = val; - this.key = key; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Each.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/filter.js b/usb_auth/node_modules/jade/lib/nodes/filter.js deleted file mode 100644 index 5a0a237..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/filter.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Filter - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node') - , Block = require('./block'); - -/** - * Initialize a `Filter` node with the given - * filter `name` and `block`. - * - * @param {String} name - * @param {Block|Node} block - * @api public - */ - -var Filter = module.exports = function Filter(name, block, attrs) { - this.name = name; - this.block = block; - this.attrs = attrs; - this.isASTFilter = block instanceof Block; -}; - -/** - * Inherit from `Node`. - */ - -Filter.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/index.js b/usb_auth/node_modules/jade/lib/nodes/index.js deleted file mode 100644 index 386ad2f..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/index.js +++ /dev/null @@ -1,20 +0,0 @@ - -/*! - * Jade - nodes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -exports.Node = require('./node'); -exports.Tag = require('./tag'); -exports.Code = require('./code'); -exports.Each = require('./each'); -exports.Case = require('./case'); -exports.Text = require('./text'); -exports.Block = require('./block'); -exports.Mixin = require('./mixin'); -exports.Filter = require('./filter'); -exports.Comment = require('./comment'); -exports.Literal = require('./literal'); -exports.BlockComment = require('./block-comment'); -exports.Doctype = require('./doctype'); diff --git a/usb_auth/node_modules/jade/lib/nodes/literal.js b/usb_auth/node_modules/jade/lib/nodes/literal.js deleted file mode 100644 index 3ddab65..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/literal.js +++ /dev/null @@ -1,31 +0,0 @@ - -/*! - * Jade - nodes - Literal - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Literal` node with the given `str. - * - * @param {String} str - * @api public - */ - -var Literal = module.exports = function Literal(str) { - this.str = str - .replace(/\n/g, "\\n") - .replace(/'/g, "\\'"); -}; - -/** - * Inherit from `Node`. - */ - -Literal.prototype.__proto__ = Node.prototype; diff --git a/usb_auth/node_modules/jade/lib/nodes/mixin.js b/usb_auth/node_modules/jade/lib/nodes/mixin.js deleted file mode 100644 index f007c84..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/mixin.js +++ /dev/null @@ -1,34 +0,0 @@ - -/*! - * Jade - nodes - Mixin - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Mixin` with `name` and `block`. - * - * @param {String} name - * @param {String} args - * @param {Block} block - * @api public - */ - -var Mixin = module.exports = function Mixin(name, args, block){ - this.name = name; - this.args = args; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Mixin.prototype.__proto__ = Node.prototype; - diff --git a/usb_auth/node_modules/jade/lib/nodes/node.js b/usb_auth/node_modules/jade/lib/nodes/node.js deleted file mode 100644 index 0669e67..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/node.js +++ /dev/null @@ -1,14 +0,0 @@ - -/*! - * Jade - nodes - Node - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize a `Node`. - * - * @api public - */ - -var Node = module.exports = function Node(){}; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/nodes/tag.js b/usb_auth/node_modules/jade/lib/nodes/tag.js deleted file mode 100644 index 35993c9..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/tag.js +++ /dev/null @@ -1,80 +0,0 @@ - -/*! - * Jade - nodes - Tag - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'), - Block = require('./block'); - -/** - * Initialize a `Tag` node with the given tag `name` and optional `block`. - * - * @param {String} name - * @param {Block} block - * @api public - */ - -var Tag = module.exports = function Tag(name, block) { - this.name = name; - this.attrs = []; - this.block = block || new Block; -}; - -/** - * Inherit from `Node`. - */ - -Tag.prototype.__proto__ = Node.prototype; - -/** - * Set attribute `name` to `val`, keep in mind these become - * part of a raw js object literal, so to quote a value you must - * '"quote me"', otherwise or example 'user.name' is literal JavaScript. - * - * @param {String} name - * @param {String} val - * @return {Tag} for chaining - * @api public - */ - -Tag.prototype.setAttribute = function(name, val){ - this.attrs.push({ name: name, val: val }); - return this; -}; - -/** - * Remove attribute `name` when present. - * - * @param {String} name - * @api public - */ - -Tag.prototype.removeAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - delete this.attrs[i]; - } - } -}; - -/** - * Get attribute value by `name`. - * - * @param {String} name - * @return {String} - * @api public - */ - -Tag.prototype.getAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - return this.attrs[i].val; - } - } -}; diff --git a/usb_auth/node_modules/jade/lib/nodes/text.js b/usb_auth/node_modules/jade/lib/nodes/text.js deleted file mode 100644 index 3baff4b..0000000 --- a/usb_auth/node_modules/jade/lib/nodes/text.js +++ /dev/null @@ -1,42 +0,0 @@ - -/*! - * Jade - nodes - Text - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Text` node with optional `line`. - * - * @param {String} line - * @api public - */ - -var Text = module.exports = function Text(line) { - this.nodes = []; - if ('string' == typeof line) this.push(line); -}; - -/** - * Inherit from `Node`. - */ - -Text.prototype.__proto__ = Node.prototype; - -/** - * Push the given `node.` - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Text.prototype.push = function(node){ - return this.nodes.push(node); -}; diff --git a/usb_auth/node_modules/jade/lib/parser.js b/usb_auth/node_modules/jade/lib/parser.js deleted file mode 100644 index 3dcfb57..0000000 --- a/usb_auth/node_modules/jade/lib/parser.js +++ /dev/null @@ -1,651 +0,0 @@ - -/*! - * Jade - Parser - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Lexer = require('./lexer') - , nodes = require('./nodes'); - -/** - * Initialize `Parser` with the given input `str` and `filename`. - * - * @param {String} str - * @param {String} filename - * @param {Object} options - * @api public - */ - -var Parser = exports = module.exports = function Parser(str, filename, options){ - this.input = str; - this.lexer = new Lexer(str, options); - this.filename = filename; - this.blocks = {}; - this.options = options; - this.contexts = [this]; -}; - -/** - * Tags that may not contain tags. - */ - -var textOnly = exports.textOnly = ['script', 'style']; - -/** - * Parser prototype. - */ - -Parser.prototype = { - - /** - * Push `parser` onto the context stack, - * or pop and return a `Parser`. - */ - - context: function(parser){ - if (parser) { - this.contexts.push(parser); - } else { - return this.contexts.pop(); - } - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.lexer.advance(); - }, - - /** - * Skip `n` tokens. - * - * @param {Number} n - * @api private - */ - - skip: function(n){ - while (n--) this.advance(); - }, - - /** - * Single token lookahead. - * - * @return {Object} - * @api private - */ - - peek: function() { - return this.lookahead(1); - }, - - /** - * Return lexer lineno. - * - * @return {Number} - * @api private - */ - - line: function() { - return this.lexer.lineno; - }, - - /** - * `n` token lookahead. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - return this.lexer.lookahead(n); - }, - - /** - * Parse input returning a string of js for evaluation. - * - * @return {String} - * @api public - */ - - parse: function(){ - var block = new nodes.Block, parser; - block.line = this.line(); - - while ('eos' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - - if (parser = this.extending) { - this.context(parser); - var ast = parser.parse(); - this.context(); - return ast; - } - - return block; - }, - - /** - * Expect the given type, or throw an exception. - * - * @param {String} type - * @api private - */ - - expect: function(type){ - if (this.peek().type === type) { - return this.advance(); - } else { - throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); - } - }, - - /** - * Accept the given `type`. - * - * @param {String} type - * @api private - */ - - accept: function(type){ - if (this.peek().type === type) { - return this.advance(); - } - }, - - /** - * tag - * | doctype - * | mixin - * | include - * | filter - * | comment - * | text - * | each - * | code - * | yield - * | id - * | class - */ - - parseExpr: function(){ - switch (this.peek().type) { - case 'tag': - return this.parseTag(); - case 'mixin': - return this.parseMixin(); - case 'block': - return this.parseBlock(); - case 'case': - return this.parseCase(); - case 'when': - return this.parseWhen(); - case 'default': - return this.parseDefault(); - case 'extends': - return this.parseExtends(); - case 'include': - return this.parseInclude(); - case 'doctype': - return this.parseDoctype(); - case 'filter': - return this.parseFilter(); - case 'comment': - return this.parseComment(); - case 'text': - return this.parseText(); - case 'each': - return this.parseEach(); - case 'code': - return this.parseCode(); - case 'yield': - this.advance(); - var block = new nodes.Block; - block.yield = true; - return block; - case 'id': - case 'class': - var tok = this.advance(); - this.lexer.defer(this.lexer.tok('tag', 'div')); - this.lexer.defer(tok); - return this.parseExpr(); - default: - throw new Error('unexpected token "' + this.peek().type + '"'); - } - }, - - /** - * Text - */ - - parseText: function(){ - var tok = this.expect('text') - , node = new nodes.Text(tok.val); - node.line = this.line(); - return node; - }, - - /** - * ':' expr - * | block - */ - - parseBlockExpansion: function(){ - if (':' == this.peek().type) { - this.advance(); - return new nodes.Block(this.parseExpr()); - } else { - return this.block(); - } - }, - - /** - * case - */ - - parseCase: function(){ - var val = this.expect('case').val - , node = new nodes.Case(val); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * when - */ - - parseWhen: function(){ - var val = this.expect('when').val - return new nodes.Case.When(val, this.parseBlockExpansion()); - }, - - /** - * default - */ - - parseDefault: function(){ - this.expect('default'); - return new nodes.Case.When('default', this.parseBlockExpansion()); - }, - - /** - * code - */ - - parseCode: function(){ - var tok = this.expect('code') - , node = new nodes.Code(tok.val, tok.buffer, tok.escape) - , block - , i = 1; - node.line = this.line(); - while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; - block = 'indent' == this.lookahead(i).type; - if (block) { - this.skip(i-1); - node.block = this.block(); - } - return node; - }, - - /** - * comment - */ - - parseComment: function(){ - var tok = this.expect('comment') - , node; - - if ('indent' == this.peek().type) { - node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); - } else { - node = new nodes.Comment(tok.val, tok.buffer); - } - - node.line = this.line(); - return node; - }, - - /** - * doctype - */ - - parseDoctype: function(){ - var tok = this.expect('doctype') - , node = new nodes.Doctype(tok.val); - node.line = this.line(); - return node; - }, - - /** - * filter attrs? text-block - */ - - parseFilter: function(){ - var block - , tok = this.expect('filter') - , attrs = this.accept('attrs'); - - this.lexer.pipeless = true; - block = this.parseTextBlock(); - this.lexer.pipeless = false; - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * tag ':' attrs? block - */ - - parseASTFilter: function(){ - var block - , tok = this.expect('tag') - , attrs = this.accept('attrs'); - - this.expect(':'); - block = this.block(); - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * each block - */ - - parseEach: function(){ - var tok = this.expect('each') - , node = new nodes.Each(tok.code, tok.val, tok.key); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * 'extends' name - */ - - parseExtends: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - if (!this.filename) - throw new Error('the "filename" option is required to extend templates'); - - var path = this.expect('extends').val.trim() - , dir = dirname(this.filename); - - var path = join(dir, path + '.jade') - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - parser.blocks = this.blocks; - parser.contexts = this.contexts; - this.extending = parser; - - // TODO: null node - return new nodes.Literal(''); - }, - - /** - * 'block' name block - */ - - parseBlock: function(){ - var block = this.expect('block') - , mode = block.mode - , name = block.val.trim(); - - block = 'indent' == this.peek().type - ? this.block() - : new nodes.Block(new nodes.Literal('')); - - var prev = this.blocks[name]; - - if (prev) { - switch (prev.mode) { - case 'append': - block.nodes = block.nodes.concat(prev.nodes); - prev = block; - break; - case 'prepend': - block.nodes = prev.nodes.concat(block.nodes); - prev = block; - break; - } - } - - block.mode = mode; - return this.blocks[name] = prev || block; - }, - - /** - * include block? - */ - - parseInclude: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - var path = this.expect('include').val.trim() - , dir = dirname(this.filename); - - if (!this.filename) - throw new Error('the "filename" option is required to use includes'); - - // no extension - if (!~basename(path).indexOf('.')) { - path += '.jade'; - } - - // non-jade - if ('.jade' != path.substr(-5)) { - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8'); - return new nodes.Literal(str); - } - - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - this.context(parser); - var ast = parser.parse(); - this.context(); - ast.filename = path; - - if ('indent' == this.peek().type) { - ast.includeBlock().push(this.block()); - } - - return ast; - }, - - /** - * mixin block - */ - - parseMixin: function(){ - var tok = this.expect('mixin') - , name = tok.val - , args = tok.args; - var block = 'indent' == this.peek().type - ? this.block() - : null; - return new nodes.Mixin(name, args, block); - }, - - /** - * indent (text | newline)* outdent - */ - - parseTextBlock: function(){ - var text = new nodes.Text; - text.line = this.line(); - var spaces = this.expect('indent').val; - if (null == this._spaces) this._spaces = spaces; - var indent = Array(spaces - this._spaces + 1).join(' '); - while ('outdent' != this.peek().type) { - switch (this.peek().type) { - case 'newline': - text.push('\\n'); - this.advance(); - break; - case 'indent': - text.push('\\n'); - this.parseTextBlock().nodes.forEach(function(node){ - text.push(node); - }); - text.push('\\n'); - break; - default: - text.push(indent + this.advance().val); - } - } - - if (spaces == this._spaces) this._spaces = null; - this.expect('outdent'); - return text; - }, - - /** - * indent expr* outdent - */ - - block: function(){ - var block = new nodes.Block; - block.line = this.line(); - this.expect('indent'); - while ('outdent' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - this.expect('outdent'); - return block; - }, - - /** - * tag (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseTag: function(){ - // ast-filter look-ahead - var i = 2; - if ('attrs' == this.lookahead(i).type) ++i; - if (':' == this.lookahead(i).type) { - if ('indent' == this.lookahead(++i).type) { - return this.parseASTFilter(); - } - } - - var name = this.advance().val - , tag = new nodes.Tag(name) - , dot; - - tag.line = this.line(); - - // (attrs | class | id)* - out: - while (true) { - switch (this.peek().type) { - case 'id': - case 'class': - var tok = this.advance(); - tag.setAttribute(tok.type, "'" + tok.val + "'"); - continue; - case 'attrs': - var obj = this.advance().attrs - , names = Object.keys(obj); - for (var i = 0, len = names.length; i < len; ++i) { - var name = names[i] - , val = obj[name]; - tag.setAttribute(name, val); - } - continue; - default: - break out; - } - } - - // check immediate '.' - if ('.' == this.peek().val) { - dot = tag.textOnly = true; - this.advance(); - } - - // (text | code | ':')? - switch (this.peek().type) { - case 'text': - tag.text = this.parseText(); - break; - case 'code': - tag.code = this.parseCode(); - break; - case ':': - this.advance(); - tag.block = new nodes.Block; - tag.block.push(this.parseTag()); - break; - } - - // newline* - while ('newline' == this.peek().type) this.advance(); - - tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); - - // script special-case - if ('script' == tag.name) { - var type = tag.getAttribute('type'); - if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { - tag.textOnly = false; - } - } - - // block? - if ('indent' == this.peek().type) { - if (tag.textOnly) { - this.lexer.pipeless = true; - tag.block = this.parseTextBlock(); - this.lexer.pipeless = false; - } else { - var block = this.block(); - if (tag.block) { - for (var i = 0, len = block.nodes.length; i < len; ++i) { - tag.block.push(block.nodes[i]); - } - } else { - tag.block = block; - } - } - } - - return tag; - } -}; diff --git a/usb_auth/node_modules/jade/lib/runtime.js b/usb_auth/node_modules/jade/lib/runtime.js deleted file mode 100644 index 7b357ca..0000000 --- a/usb_auth/node_modules/jade/lib/runtime.js +++ /dev/null @@ -1,118 +0,0 @@ - -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj){ - var buf = [] - , terse = obj.terse; - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else { - buf.push(key + '="' + exports.escape(val) + '"'); - } - } - } - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; diff --git a/usb_auth/node_modules/jade/lib/self-closing.js b/usb_auth/node_modules/jade/lib/self-closing.js deleted file mode 100644 index 293e7f8..0000000 --- a/usb_auth/node_modules/jade/lib/self-closing.js +++ /dev/null @@ -1,18 +0,0 @@ - -/*! - * Jade - self closing tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'meta' - , 'img' - , 'link' - , 'input' - , 'area' - , 'base' - , 'col' - , 'br' - , 'hr' -]; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/lib/utils.js b/usb_auth/node_modules/jade/lib/utils.js deleted file mode 100644 index ff46d02..0000000 --- a/usb_auth/node_modules/jade/lib/utils.js +++ /dev/null @@ -1,49 +0,0 @@ - -/*! - * Jade - utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Convert interpolation in the given string to JavaScript. - * - * @param {String} str - * @return {String} - * @api private - */ - -var interpolate = exports.interpolate = function(str){ - return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ - return escape - ? str - : "' + " - + ('!' == flag ? '' : 'escape') - + "((interp = " + code.replace(/\\'/g, "'") - + ") == null ? '' : interp) + '"; - }); -}; - -/** - * Escape single quotes in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -var escape = exports.escape = function(str) { - return str.replace(/'/g, "\\'"); -}; - -/** - * Interpolate, and escape the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.text = function(str){ - return interpolate(escape(str)); -}; \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/commander/.npmignore b/usb_auth/node_modules/jade/node_modules/commander/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/usb_auth/node_modules/jade/node_modules/commander/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/usb_auth/node_modules/jade/node_modules/commander/.travis.yml b/usb_auth/node_modules/jade/node_modules/commander/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/usb_auth/node_modules/jade/node_modules/commander/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/usb_auth/node_modules/jade/node_modules/commander/History.md b/usb_auth/node_modules/jade/node_modules/commander/History.md deleted file mode 100644 index 66c6894..0000000 --- a/usb_auth/node_modules/jade/node_modules/commander/History.md +++ /dev/null @@ -1,99 +0,0 @@ - -0.5.2 / 2012-01-17 -================== - - * Added support for 0.7.x - -0.5.1 / 2011-12-20 -================== - - * Fixed `password()` for recent nodes. Closes #36 - -0.5.0 / 2011-12-04 -================== - - * Added sub-command option support [itay] - -0.4.3 / 2011-12-04 -================== - - * Fixed custom help ordering. Closes #32 - -0.4.2 / 2011-11-24 -================== - - * Added travis support - * Fixed: line-buffered input automatically trimmed. Closes #31 - -0.4.1 / 2011-11-18 -================== - - * Removed listening for "close" on --help - -0.4.0 / 2011-11-15 -================== - - * Added support for `--`. Closes #24 - -0.3.3 / 2011-11-14 -================== - - * Fixed: wait for close event when writing help info [Jerry Hamlet] - -0.3.2 / 2011-11-01 -================== - - * Fixed long flag definitions with values [felixge] - -0.3.1 / 2011-10-31 -================== - - * Changed `--version` short flag to `-V` from `-v` - * Changed `.version()` so it's configurable [felixge] - -0.3.0 / 2011-10-31 -================== - - * Added support for long flags only. Closes #18 - -0.2.1 / 2011-10-24 -================== - - * "node": ">= 0.4.x < 0.7.0". Closes #20 - -0.2.0 / 2011-09-26 -================== - - * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] - -0.1.0 / 2011-08-24 -================== - - * Added support for custom `--help` output - -0.0.5 / 2011-08-18 -================== - - * Changed: when the user enters nothing prompt for password again - * Fixed issue with passwords beginning with numbers [NuckChorris] - -0.0.4 / 2011-08-15 -================== - - * Fixed `Commander#args` - -0.0.3 / 2011-08-15 -================== - - * Added default option value support - -0.0.2 / 2011-08-15 -================== - - * Added mask support to `Command#password(str[, mask], fn)` - * Added `Command#password(str, fn)` - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/usb_auth/node_modules/jade/node_modules/commander/Makefile b/usb_auth/node_modules/jade/node_modules/commander/Makefile deleted file mode 100644 index 0074625..0000000 --- a/usb_auth/node_modules/jade/node_modules/commander/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -TESTS = $(shell find test/test.*.js) - -test: - @./test/run $(TESTS) - -.PHONY: test \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/commander/Readme.md b/usb_auth/node_modules/jade/node_modules/commander/Readme.md deleted file mode 100644 index 2efbe7a..0000000 --- a/usb_auth/node_modules/jade/node_modules/commander/Readme.md +++ /dev/null @@ -1,263 +0,0 @@ - -# Commander.js - - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). - - [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) - -## Installation - - $ npm install commander - -## Option parsing - - Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander'); - -program - .version('0.0.1') - .option('-p, --peppers', 'Add peppers') - .option('-P, --pineapple', 'Add pineapple') - .option('-b, --bbq', 'Add bbq sauce') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - .parse(process.argv); - -console.log('you ordered a pizza with:'); -if (program.peppers) console.log(' - peppers'); -if (program.pineapple) console.log(' - pineappe'); -if (program.bbq) console.log(' - bbq'); -console.log(' - %s cheese', program.cheese); -``` - - Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -``` - $ ./examples/pizza --help - - Usage: pizza [options] - - Options: - - -v, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineappe - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese [marble] - -h, --help output usage information - -``` - -## Coercion - -```js -function range(val) { - return val.split('..').map(Number); -} - -function list(val) { - return val.split(','); -} - -program - .version('0.0.1') - .usage('[options] ') - .option('-i, --integer ', 'An integer argument', parseInt) - .option('-f, --float ', 'A float argument', parseFloat) - .option('-r, --range ..', 'A range', range) - .option('-l, --list ', 'A list', list) - .option('-o, --optional [value]', 'An optional value') - .parse(process.argv); - -console.log(' int: %j', program.integer); -console.log(' float: %j', program.float); -console.log(' optional: %j', program.optional); -program.range = program.range || []; -console.log(' range: %j..%j', program.range[0], program.range[1]); -console.log(' list: %j', program.list); -console.log(' args: %j', program.args); -``` - -## Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviours, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('../'); - -function list(val) { - return val.split(',').map(Number); -} - -program - .version('0.0.1') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); - console.log(''); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -yielding the following help output: - -``` - -Usage: custom-help [options] - -Options: - - -h, --help output usage information - -v, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - - $ custom-help --help - $ custom-help -h - -``` - -## .prompt(msg, fn) - - Single-line prompt: - -```js -program.prompt('name: ', function(name){ - console.log('hi %s', name); -}); -``` - - Multi-line prompt: - -```js -program.prompt('description:', function(name){ - console.log('hi %s', name); -}); -``` - - Coercion: - -```js -program.prompt('Age: ', Number, function(age){ - console.log('age: %j', age); -}); -``` - -```js -program.prompt('Birthdate: ', Date, function(date){ - console.log('date: %s', date); -}); -``` - -## .password(msg[, mask], fn) - -Prompt for password without echoing: - -```js -program.password('Password: ', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -Prompt for password with mask char "*": - -```js -program.password('Password: ', '*', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -## .confirm(msg, fn) - - Confirm with the given `msg`: - -```js -program.confirm('continue? ', function(ok){ - console.log(' got %j', ok); -}); -``` - -## .choose(list, fn) - - Let the user choose from a `list`: - -```js -var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - -console.log('Choose the coolest pet:'); -program.choose(list, function(i){ - console.log('you chose %d "%s"', i, list[i]); -}); -``` - -## Links - - - [API documentation](http://visionmedia.github.com/commander.js/) - - [ascii tables](https://github.com/LearnBoost/cli-table) - - [progress bars](https://github.com/visionmedia/node-progress) - - [more progress bars](https://github.com/substack/node-multimeter) - - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) - -## License - -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/commander/index.js b/usb_auth/node_modules/jade/node_modules/commander/index.js deleted file mode 100644 index 06ec1e4..0000000 --- a/usb_auth/node_modules/jade/node_modules/commander/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/commander'); \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/commander/lib/commander.js b/usb_auth/node_modules/jade/node_modules/commander/lib/commander.js deleted file mode 100644 index b9cbd5d..0000000 --- a/usb_auth/node_modules/jade/node_modules/commander/lib/commander.js +++ /dev/null @@ -1,992 +0,0 @@ - -/*! - * commander - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , path = require('path') - , tty = require('tty') - , basename = path.basename; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command; - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function(){ - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg){ - return arg == this.short - || arg == this.long; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this.args = []; - this.name = name; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Command.prototype.__proto__ = EventEmitter.prototype; - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name){ - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - return cmd; -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args){ - if (!args.length) return; - var self = this; - args.forEach(function(arg){ - switch (arg[0]) { - case '<': - self.args.push({ required: true, name: arg.slice(1, -1) }); - break; - case '[': - self.args.push({ required: false, name: arg.slice(1, -1) }); - break; - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn){ - var self = this; - this.parent.on(this.name, function(args, unknown){ - // Parse any so-far unknown options - unknown = unknown || []; - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - self.args.forEach(function(arg, i){ - if (arg.required && null == args[i]) { - self.missingArgument(arg.name); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self.args.length) { - args[self.args.length] = self; - } else { - args.push(self); - } - - fn.apply(this, args); - }); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to false - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => true - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue){ - var self = this - , option = new Option(flags, description) - , oname = option.name() - , name = camelcase(oname); - - // default as 3rd arg - if ('function' != typeof fn) defaultValue = fn, fn = null; - - // preassign default value only for --no-*, [optional], or - if (false == option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (false == option.bool) defaultValue = true; - // preassign only if we have a default - if (undefined !== defaultValue) self[name] = defaultValue; - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function(val){ - // coercion - if (null != val && fn) val = fn(val); - - // unassigned or bool - if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { - // if no value, bool true, and we have a default, then use it! - if (null == val) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (null !== val) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv){ - // store raw args - this.rawArgs = argv; - - // guess name - if (!this.name) this.name = basename(argv[1]); - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - this.args = parsed.args; - return this.parseArgs(this.args, parsed.unknown); -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args){ - var ret = [] - , arg; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { - arg.slice(1).split('').forEach(function(c){ - ret.push('-' + c); - }); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown){ - var cmds = this.commands - , len = cmds.length - , name; - - if (args.length) { - name = args[0]; - if (this.listeners(name).length) { - this.emit(args.shift(), args, unknown); - } else { - this.emit('*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg){ - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv){ - var args = [] - , len = argv.length - , literal - , option - , arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if ('--' == arg) { - literal = true; - continue; - } - - if (literal) { - args.push(arg); - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (null == arg) return this.optionMissingArgument(option); - if ('-' == arg[0]) return this.optionMissingArgument(option, arg); - this.emit(option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i+1]; - if (null == arg || '-' == arg[0]) { - arg = null; - } else { - ++i; - } - this.emit(option.name(), arg); - // bool - } else { - this.emit(option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && '-' == arg[0]) { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if (argv[i+1] && '-' != argv[i+1][0]) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name){ - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag){ - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag){ - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags){ - if (0 == arguments.length) return this._version; - this._version = str; - flags = flags || '-V, --version'; - this.option(flags, 'output the version number'); - this.on('version', function(){ - console.log(str); - process.exit(0); - }); - return this; -}; - -/** - * Set the description `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str){ - if (0 == arguments.length) return this._description; - this._description = str; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str){ - var args = this.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }); - - var usage = '[options' - + (this.commands.length ? '] [command' : '') - + ']' - + (this.args.length ? ' ' + args : ''); - if (0 == arguments.length) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function(){ - return this.options.reduce(function(max, option){ - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function(){ - var width = this.largestOptionLength(); - - // Prepend the help information - return [pad('-h, --help', width) + ' ' + 'output usage information'] - .concat(this.options.map(function(option){ - return pad(option.flags, width) - + ' ' + option.description; - })) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function(){ - if (!this.commands.length) return ''; - return [ - '' - , ' Commands:' - , '' - , this.commands.map(function(cmd){ - var args = cmd.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }).join(' '); - - return cmd.name - + (cmd.options.length - ? ' [options]' - : '') + ' ' + args - + (cmd.description() - ? '\n' + cmd.description() - : ''); - }).join('\n\n').replace(/^/gm, ' ') - , '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function(){ - return [ - '' - , ' Usage: ' + this.name + ' ' + this.usage() - , '' + this.commandHelp() - , ' Options:' - , '' - , '' + this.optionHelp().replace(/^/gm, ' ') - , '' - , '' - ].join('\n'); -}; - -/** - * Prompt for a `Number`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForNumber = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseNumber(val){ - val = Number(val); - if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber); - fn(val); - }); -}; - -/** - * Prompt for a `Date`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForDate = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseDate(val){ - val = new Date(val); - if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate); - fn(val); - }); -}; - -/** - * Single-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptSingleLine = function(str, fn){ - if ('function' == typeof arguments[2]) { - return this['promptFor' + (fn.name || fn)](str, arguments[2]); - } - - process.stdout.write(str); - process.stdin.setEncoding('utf8'); - process.stdin.once('data', function(val){ - fn(val.trim()); - }).resume(); -}; - -/** - * Multi-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptMultiLine = function(str, fn){ - var buf = []; - console.log(str); - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(val){ - if ('\n' == val || '\r\n' == val) { - process.stdin.removeAllListeners('data'); - fn(buf.join('\n')); - } else { - buf.push(val.trimRight()); - } - }).resume(); -}; - -/** - * Prompt `str` and callback `fn(val)` - * - * Commander supports single-line and multi-line prompts. - * To issue a single-line prompt simply add white-space - * to the end of `str`, something like "name: ", whereas - * for a multi-line prompt omit this "description:". - * - * - * Examples: - * - * program.prompt('Username: ', function(name){ - * console.log('hi %s', name); - * }); - * - * program.prompt('Description:', function(desc){ - * console.log('description was "%s"', desc.trim()); - * }); - * - * @param {String} str - * @param {Function} fn - * @api public - */ - -Command.prototype.prompt = function(str, fn){ - if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments); - this.promptMultiLine(str, fn); -}; - -/** - * Prompt for password with `str`, `mask` char and callback `fn(val)`. - * - * The mask string defaults to '', aka no output is - * written while typing, you may want to use "*" etc. - * - * Examples: - * - * program.password('Password: ', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * program.password('Password: ', '*', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {String} mask - * @param {Function} fn - * @api public - */ - -Command.prototype.password = function(str, mask, fn){ - var self = this - , buf = ''; - - // default mask - if ('function' == typeof mask) { - fn = mask; - mask = ''; - } - - process.stdin.resume(); - tty.setRawMode(true); - process.stdout.write(str); - - // keypress - process.stdin.on('keypress', function(c, key){ - if (key && 'enter' == key.name) { - console.log(); - process.stdin.removeAllListeners('keypress'); - tty.setRawMode(false); - if (!buf.trim().length) return self.password(str, mask, fn); - fn(buf); - return; - } - - if (key && key.ctrl && 'c' == key.name) { - console.log('%s', buf); - process.exit(); - } - - process.stdout.write(mask); - buf += c; - }).resume(); -}; - -/** - * Confirmation prompt with `str` and callback `fn(bool)` - * - * Examples: - * - * program.confirm('continue? ', function(ok){ - * console.log(' got %j', ok); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {Function} fn - * @api public - */ - - -Command.prototype.confirm = function(str, fn){ - var self = this; - this.prompt(str, function(ok){ - if (!ok.trim()) { - return self.confirm(str, fn); - } - fn(parseBool(ok)); - }); -}; - -/** - * Choice prompt with `list` of items and callback `fn(index, item)` - * - * Examples: - * - * var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - * - * console.log('Choose the coolest pet:'); - * program.choose(list, function(i){ - * console.log('you chose %d "%s"', i, list[i]); - * process.stdin.destroy(); - * }); - * - * @param {Array} list - * @param {Function} fn - * @api public - */ - -Command.prototype.choose = function(list, fn){ - var self = this; - - list.forEach(function(item, i){ - console.log(' %d) %s', i + 1, item); - }); - - function again() { - self.prompt(' : ', function(val){ - val = parseInt(val, 10) - 1; - if (null == list[val]) { - again(); - } else { - fn(val, list[val]); - } - }); - } - - again(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word){ - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Parse a boolean `str`. - * - * @param {String} str - * @return {Boolean} - * @api private - */ - -function parseBool(str) { - return /^y|yes|ok|true$/i.test(str); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] == '--help' || options[i] == '-h') { - process.stdout.write(cmd.helpInformation()); - cmd.emit('--help'); - process.exit(0); - } - } -} diff --git a/usb_auth/node_modules/jade/node_modules/commander/package.json b/usb_auth/node_modules/jade/node_modules/commander/package.json deleted file mode 100644 index 724ba47..0000000 --- a/usb_auth/node_modules/jade/node_modules/commander/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "commander" - , "version": "0.5.2" - , "description": "the complete solution for node.js command-line programs" - , "keywords": ["command", "option", "parser", "prompt", "stdin"] - , "author": "TJ Holowaychuk " - , "repository": { "type": "git", "url": "https://github.com/visionmedia/commander.js.git" } - , "dependencies": {} - , "devDependencies": { "should": ">= 0.0.1" } - , "scripts": { "test": "make test" } - , "main": "index" - , "engines": { "node": ">= 0.4.x < 0.8.0" } -} \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.orig b/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.orig deleted file mode 100644 index 9303c34..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.orig +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.rej b/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.rej deleted file mode 100644 index 69244ff..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/.gitignore.rej +++ /dev/null @@ -1,5 +0,0 @@ ---- /dev/null -+++ .gitignore -@@ -0,0 +1,2 @@ -+node_modules/ -+npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/.npmignore b/usb_auth/node_modules/jade/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/LICENSE b/usb_auth/node_modules/jade/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/README.markdown b/usb_auth/node_modules/jade/node_modules/mkdirp/README.markdown deleted file mode 100644 index b4dd75f..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/README.markdown +++ /dev/null @@ -1,54 +0,0 @@ -mkdirp -====== - -Like `mkdir -p`, but in node.js! - -example -======= - -pow.js ------- - var mkdirp = require('mkdirp'); - - mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') - }); - -Output - pow! - -And now /tmp/foo/bar/baz exists, huzzah! - -methods -======= - -var mkdirp = require('mkdirp'); - -mkdirp(dir, mode, cb) ---------------------- - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -mkdirp.sync(dir, mode) ----------------------- - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -install -======= - -With [npm](http://npmjs.org) do: - - npm install mkdirp - -license -======= - -MIT/X11 diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js b/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig b/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig deleted file mode 100644 index 7741462..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej b/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej deleted file mode 100644 index 81e7f43..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej +++ /dev/null @@ -1,19 +0,0 @@ ---- examples/pow.js -+++ examples/pow.js -@@ -1,6 +1,15 @@ --var mkdirp = require('mkdirp').mkdirp; -+var mkdirp = require('../').mkdirp, -+ mkdirpSync = require('../').mkdirpSync; - - mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') - }); -+ -+try { -+ mkdirpSync('/tmp/bar/foo/baz', 0755); -+ console.log('double pow!'); -+} -+catch (ex) { -+ console.log(ex); -+} \ No newline at end of file diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/index.js b/usb_auth/node_modules/jade/node_modules/mkdirp/index.js deleted file mode 100644 index 25f43ad..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/index.js +++ /dev/null @@ -1,79 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) return cb(); - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er) { - if (er) cb(er); - else mkdirP(p, mode, cb); - }); - break; - - case 'EEXIST': - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original EEXIST be the failure reason. - if (er2 || !stat.isDirectory()) cb(er) - else cb(); - }); - break; - - default: - cb(er); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode) - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - var err1 = sync(path.dirname(p), mode) - if (err1) throw err1; - else return sync(p, mode); - break; - - case 'EEXIST' : - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0 - } - if (!stat.isDirectory()) throw err0; - else return null; - break; - default : - throw err0 - break; - } - } - - return null; -}; diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/package.json b/usb_auth/node_modules/jade/node_modules/mkdirp/package.json deleted file mode 100644 index 1bf9ac7..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name" : "mkdirp", - "description" : "Recursively mkdir, like `mkdir -p`", - "version" : "0.3.0", - "author" : "James Halliday (http://substack.net)", - "main" : "./index", - "keywords" : [ - "mkdir", - "directory" - ], - "repository" : { - "type" : "git", - "url" : "http://github.com/substack/node-mkdirp.git" - }, - "scripts" : { - "test" : "tap test/*.js" - }, - "devDependencies" : { - "tap" : "0.0.x" - }, - "license" : "MIT/X11", - "engines": { "node": "*" } -} diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/chmod.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/clobber.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/mkdirp.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm_sync.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/race.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/rel.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/sync.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/sync.js deleted file mode 100644 index e0e389d..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file, 0755); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask_sync.js b/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 83cba56..0000000 --- a/usb_auth/node_modules/jade/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/usb_auth/node_modules/jade/package.json b/usb_auth/node_modules/jade/package.json deleted file mode 100644 index a32e8e8..0000000 --- a/usb_auth/node_modules/jade/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "jade", - "description": "Jade template engine", - "version": "0.20.3", - "author": "TJ Holowaychuk ", - "repository": "git://github.com/visionmedia/jade", - "main": "./index.js", - "bin": { "jade": "./bin/jade" }, - "dependencies": { - "commander": "0.5.x", - "mkdirp": ">= 0.0.7" - }, - "devDependencies": { - "mocha": "*", - "coffee-script": ">= 0.0.1", - "markdown": ">= 0.0.1", - "stylus": ">= 0.0.1", - "uubench": "0.0.1", - "uglify-js": ">= 1.0.7" - }, - "scripts" : { "prepublish" : "npm prune" }, - "engines": { "node": ">= 0.1.98" } -} diff --git a/usb_auth/node_modules/jade/runtime.js b/usb_auth/node_modules/jade/runtime.js deleted file mode 100644 index 39f8a28..0000000 --- a/usb_auth/node_modules/jade/runtime.js +++ /dev/null @@ -1,123 +0,0 @@ - -var jade = (function(exports){ -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj){ - var buf = [] - , terse = obj.terse; - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else { - buf.push(key + '="' + exports.escape(val) + '"'); - } - } - } - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; - - return exports; - -})({}); \ No newline at end of file diff --git a/usb_auth/node_modules/jade/runtime.min.js b/usb_auth/node_modules/jade/runtime.min.js deleted file mode 100644 index 8c19a98..0000000 --- a/usb_auth/node_modules/jade/runtime.min.js +++ /dev/null @@ -1 +0,0 @@ -var jade=function(exports){return Array.isArray||(Array.isArray=function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}),Object.keys||(Object.keys=function(obj){var arr=[];for(var key in obj)obj.hasOwnProperty(key)&&arr.push(key);return arr}),exports.attrs=function(obj){var buf=[],terse=obj.terse;delete obj.terse;var keys=Object.keys(obj),len=keys.length;if(len){buf.push("");for(var i=0;i/g,">").replace(/"/g,""")},exports.rethrow=function(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err},exports}({}) \ No newline at end of file diff --git a/usb_auth/package.json b/usb_auth/package.json deleted file mode 100644 index 6f61ed5..0000000 --- a/usb_auth/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "usb_auth" - , "version": "0.1" - , "private": true - , "dependencies": { - "express": "2.5.8" - , "jade": ">= 0.0.1" - } -} diff --git a/usb_auth/routes/index.js b/usb_auth/routes/index.js deleted file mode 100644 index 24b0b97..0000000 --- a/usb_auth/routes/index.js +++ /dev/null @@ -1,28 +0,0 @@ -var url = require('url'); -var fs = require('fs'); -var http = require('http'); - -/* - * GET users. - */ -exports.user = function(req, res){ - var urlString = url.parse(req.url, true).query; - var logFile = fs.openSync('./log.txt', 'a+'); - if (urlString.action == 'login') { - fs.writeSync(logFile, 'User logged in on device ' + urlString.device + ' with token ' + urlString.token + '\n', null); - var prefServer = { - host: 'localhost', - port: 8000, - path: '/user' + urlString.token - }; - http.get(prefServer, function (res) { - // Do nothing. - }).on('error', function (e) { - console.log('Cannot connect to preferences server.'); - }); - } else if (urlString.action == 'logout') { - fs.writeSync(logFile, 'User logged out from device ' + urlString.device + '\n', null); - } - fs.close(logFile); - res.render('index', { title: 'See log file for detailed info about the request.\n' }) -}; diff --git a/usb_auth/usb_test.sh b/usb_auth/usb_test.sh index 655d120..6af1130 100755 --- a/usb_auth/usb_test.sh +++ b/usb_auth/usb_test.sh @@ -9,8 +9,11 @@ if [ $1 -eq 1 ]; then done loc=`mount | grep $2 |cut -d " " -f 3` # The location where the USB disk drive is mounted. token=`cat $loc/token.txt` # The token that identifies the user. - curl http://localhost:3000/user?action=login\&device=$2\&token=$token # A call to the Node.js server + echo "User logged in on device $2 with token ${token}." >> log.txt + curl http://localhost:3000/user/$token # A call to the preferences server + # curl http://localhost:3000/user/$token/login # A call to the Flow Manager else # USB disk drive is removed. - curl http://localhost:3000/user?action=logout\&device=$2 + echo "User logged out from device $2." >> log.txt + # curl http://localhost:3000/user/$token/logout # A call to the Flow Manager fi diff --git a/usb_auth/views/index.jade b/usb_auth/views/index.jade deleted file mode 100644 index fbb28d1..0000000 --- a/usb_auth/views/index.jade +++ /dev/null @@ -1 +0,0 @@ -h1= title diff --git a/usb_auth/views/layout.jade b/usb_auth/views/layout.jade deleted file mode 100644 index 1e785a3..0000000 --- a/usb_auth/views/layout.jade +++ /dev/null @@ -1,5 +0,0 @@ -!!! -html - head - title= title - body!= body From 7dba799bfee6b2c41d28565aa32dce6cdd69bd98 Mon Sep 17 00:00:00 2001 From: boyan Date: Tue, 21 Feb 2012 17:16:59 +0200 Subject: [PATCH 008/319] Added a local hash for device locations and user tokens. Thus multiple users are supported. --- usb_auth/usb_test.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/usb_auth/usb_test.sh b/usb_auth/usb_test.sh index 6af1130..0bf6baf 100755 --- a/usb_auth/usb_test.sh +++ b/usb_auth/usb_test.sh @@ -7,13 +7,15 @@ if [ $1 -eq 1 ]; then retries=$[$retries+1] sleep 1 done - loc=`mount | grep $2 |cut -d " " -f 3` # The location where the USB disk drive is mounted. - token=`cat $loc/token.txt` # The token that identifies the user. + + mountLocation=`mount | grep $2 |cut -d " " -f 3` + token=`cat $mountLocation/token.txt` echo "User logged in on device $2 with token ${token}." >> log.txt - curl http://localhost:3000/user/$token # A call to the preferences server - # curl http://localhost:3000/user/$token/login # A call to the Flow Manager + echo $2:$token >> users.txt # Keep the location and token in a users file. + curl http://localhost:3000/user/$token else # USB disk drive is removed. - echo "User logged out from device $2." >> log.txt - # curl http://localhost:3000/user/$token/logout # A call to the Flow Manager + token=`grep $2 < users.txt | cut -d ":" -f 2` + sed -ie "\|^$2|d" users.txt # Remove entry from the users file + echo "User logged out from device $2 with token ${token}." >> log.txt fi From 9df473da65a90293e0b97ad78ecdf2363659e11e Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 2 Apr 2012 10:49:56 -0400 Subject: [PATCH 009/319] Directory restructuring. --- {usb_auth => usbDriveListener}/80-local.rules | 0 {usb_auth => usbDriveListener}/README | 0 .../usb_test.sh => usbDriveListener/bin/handleUserDeviceEvent.sh | 0 {usb_auth => usbDriveListener/bin}/trigger.sh | 0 usb_auth/token.txt => usbDriveListener/tests/.gpii-user-token.txt | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {usb_auth => usbDriveListener}/80-local.rules (100%) rename {usb_auth => usbDriveListener}/README (100%) rename usb_auth/usb_test.sh => usbDriveListener/bin/handleUserDeviceEvent.sh (100%) rename {usb_auth => usbDriveListener/bin}/trigger.sh (100%) rename usb_auth/token.txt => usbDriveListener/tests/.gpii-user-token.txt (100%) diff --git a/usb_auth/80-local.rules b/usbDriveListener/80-local.rules similarity index 100% rename from usb_auth/80-local.rules rename to usbDriveListener/80-local.rules diff --git a/usb_auth/README b/usbDriveListener/README similarity index 100% rename from usb_auth/README rename to usbDriveListener/README diff --git a/usb_auth/usb_test.sh b/usbDriveListener/bin/handleUserDeviceEvent.sh similarity index 100% rename from usb_auth/usb_test.sh rename to usbDriveListener/bin/handleUserDeviceEvent.sh diff --git a/usb_auth/trigger.sh b/usbDriveListener/bin/trigger.sh similarity index 100% rename from usb_auth/trigger.sh rename to usbDriveListener/bin/trigger.sh diff --git a/usb_auth/token.txt b/usbDriveListener/tests/.gpii-user-token.txt similarity index 100% rename from usb_auth/token.txt rename to usbDriveListener/tests/.gpii-user-token.txt From 59d322aa9fc675ffdcd052d1b7256e2da38a8bc5 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 2 Apr 2012 10:52:41 -0400 Subject: [PATCH 010/319] Updated LICENSE and README files appropriately. --- LICENSE.txt | 5 +++-- README | 11 +++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index fda9113..a90784e 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,6 @@ -Copyright (c) 2012, OCAD University -Copyright (c) 2012, Steven Githens +Copyright 2012, OCAD University +Copyright 2012, Steven Githens +Copyright 2012, Astea Solutions All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README b/README index a16c080..5115618 100644 --- a/README +++ b/README @@ -1,7 +1,6 @@ -This repository contains GPII-related prototypes, created as a part of the Cloud4All project. For more information, please visit: -http://gpii.net/ -http://wiki.gpii.net/ -http://cordis.europa.eu/fetch?CALLER=PROJ_ICT&ACTION=D&DOC=5&CAT=PROJ&QUERY=013516d86760:1ec6:217fdf0e&RCN=101353 +This repository contains all of the platform-specific code required to run the GPII Personalization Framework on Linux with GNOME. -The following projects can be found in the repository: -usb_auth - User authentication with a USB stick and a token. Linux prototype. +The following components can be found in the repository: + +* usbDriveListener: a UserListener implementation that will detect a USB drive with an anonymous GPII user token installed on it +* gSettingsBridge: a Node.js module for accessing the gSettings API via JavaScript within a Node application From 729ccc90c5c54853ff13a65d17caacd980311882 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 2 Apr 2012 11:06:58 -0400 Subject: [PATCH 011/319] Updated installation and USB Listener scripts to remove hard-coded paths. Added correct calls to /login and /logout in handleUserDeviceEvent.sh. Updated sample user token to correspond with our test preferences profile. --- build.sh | 29 ++++++++++++++++++- usbDriveListener/80-local.rules | 4 +-- usbDriveListener/bin/handleUserDeviceEvent.sh | 13 +++++---- usbDriveListener/bin/trigger.sh | 6 ++-- usbDriveListener/tests/.gpii-user-token.txt | 2 +- 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index d1a24f4..48f6b39 100755 --- a/build.sh +++ b/build.sh @@ -3,9 +3,12 @@ node_modules="../node_modules" universal="../node_modules/universal" repoURL="git://github.com/GPII/universal.git" +usbListenerDir="./usbDriveListener" +gpiiInstallDir="/usr/local/gpii" +gpiiStateDir="/var/lib/gpii" # Clone the necessary GPII framework dependencies from Git. - +# TODO: Deal with cut and pastage for directory creation logic. if [ -d $node_modules ]; then echo "$node_modules already exists" else @@ -24,3 +27,27 @@ fi # Compile the GSettings C++ Bridge cd node_modules/gsettingsBridge/nodegsettings node-waf configure build + + +# Create standard directory structure for GPII. +# Note: everything below here must be run as root, since we're installing ourselves centrally. +if [ -d $gpiiInstallDir ]; then + echo "$gpiiInstallDir already exists" +else + echo "$gpiiInstallDir does not exist" + echo "creating $gpiiInstallDir" + mkdir -p "$gpiiInstallDir" +fi + +if [ -d $gpiiStateDir ]; then + echo "$gpiiStateDir already exists" +else + echo "$gpiiStateDir does not exist" + echo "creating $gpiiStateDir" + mkdir -p "$gpiiStateDir" +fi + +# Install the USB Drive User Listener +# TODO: We should install the entire GPII in /usr/local/gpii, not just the USB Listener +cp -r "$usbListenerDir/bin" "$gpiiInstallDir/bin" +cp "$usbListenerDir/80-local.rules" /etc/udev/rules.d/ diff --git a/usbDriveListener/80-local.rules b/usbDriveListener/80-local.rules index 22340e1..790cafd 100644 --- a/usbDriveListener/80-local.rules +++ b/usbDriveListener/80-local.rules @@ -1,2 +1,2 @@ -KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/home/boyan/repos/gpiistack/usb_auth/trigger.sh 1 /dev/%k" -KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/home/boyan/repos/gpiistack/usb_auth/trigger.sh 0 /dev/%k" +KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/usr/local/gpii/bin/trigger.sh 1 /dev/%k" +KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/usr/local/gpii/bin/trigger.sh 0 /dev/%k" diff --git a/usbDriveListener/bin/handleUserDeviceEvent.sh b/usbDriveListener/bin/handleUserDeviceEvent.sh index 0bf6baf..fa75498 100755 --- a/usbDriveListener/bin/handleUserDeviceEvent.sh +++ b/usbDriveListener/bin/handleUserDeviceEvent.sh @@ -1,4 +1,6 @@ #!/bin/sh +usersFilePath="/var/lib/gpii/users.txt" + if [ $1 -eq 1 ]; then # USB disk drive is added. retries=0 @@ -9,13 +11,14 @@ if [ $1 -eq 1 ]; then done mountLocation=`mount | grep $2 |cut -d " " -f 3` - token=`cat $mountLocation/token.txt` + token=`cat $mountLocation/.gpii-user-token.txt` echo "User logged in on device $2 with token ${token}." >> log.txt - echo $2:$token >> users.txt # Keep the location and token in a users file. - curl http://localhost:3000/user/$token + echo $2:$token >> "$usersFilePath" # Keep the location and token in a users file. + curl http://localhost:3000/user/$token/login else # USB disk drive is removed. - token=`grep $2 < users.txt | cut -d ":" -f 2` - sed -ie "\|^$2|d" users.txt # Remove entry from the users file + curl http://localhost:3000/user/$token/logout + token=`grep $2 < "$usersFilePath" | cut -d ":" -f 2` + sed -ie "\|^$2|d" "$usersFilePath" # Remove entry from the users file echo "User logged out from device $2 with token ${token}." >> log.txt fi diff --git a/usbDriveListener/bin/trigger.sh b/usbDriveListener/bin/trigger.sh index 92fff5c..dcbc0ab 100755 --- a/usbDriveListener/bin/trigger.sh +++ b/usbDriveListener/bin/trigger.sh @@ -1,5 +1,7 @@ #!/bin/sh # This is a workaround for correct udev script execution. # There should be a way to avoid using a intermediate file. -cd /home/boyan/repos/gpiistack/usb_auth -./usb_test.sh $1 $2 & exit + +gpiiBinPath="/usr/local/gpii/bin" + +"$gpiiBinPath/handleUserDeviceEvent.sh" $1 $2 & exit diff --git a/usbDriveListener/tests/.gpii-user-token.txt b/usbDriveListener/tests/.gpii-user-token.txt index fc62ad5..d800886 100644 --- a/usbDriveListener/tests/.gpii-user-token.txt +++ b/usbDriveListener/tests/.gpii-user-token.txt @@ -1 +1 @@ -intergalacticSheepherder +123 \ No newline at end of file From d813ebbaba107308de59dad3ba4eef07274571c4 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 2 Apr 2012 11:23:21 -0400 Subject: [PATCH 012/319] Updated license headers in all code files. Updated USB Listener instructions in README. --- build.sh | 10 ++++++++++ gpii.js | 12 ++++++++++++ start.sh | 10 ++++++++++ usbDriveListener/README | 12 +++++------- usbDriveListener/bin/handleUserDeviceEvent.sh | 11 +++++++++++ usbDriveListener/bin/trigger.sh | 11 +++++++++++ 6 files changed, 59 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index 48f6b39..fd05833 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,15 @@ #!/bin/sh +# GPII Linux Build Script +# +# Copyright 2012 OCAD University +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# You may obtain a copy of the License at +# https://github.com/gpii/universal/LICENSE.txt + node_modules="../node_modules" universal="../node_modules/universal" repoURL="git://github.com/GPII/universal.git" diff --git a/gpii.js b/gpii.js index 0efa30a..1c81375 100644 --- a/gpii.js +++ b/gpii.js @@ -1,3 +1,15 @@ +/*! +GPII Linux Personalization Framework Node.js Bootstrap + +Copyright 2012 OCAD University + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"); diff --git a/start.sh b/start.sh index 7959162..02d6425 100755 --- a/start.sh +++ b/start.sh @@ -1,5 +1,15 @@ #!/bin/sh +# GPII Linux Startup Script +# +# Copyright 2012 OCAD University +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# You may obtain a copy of the License at +# https://github.com/gpii/universal/LICENSE.txt + fileName="gpii.js" # Build and install the GPII diff --git a/usbDriveListener/README b/usbDriveListener/README index d71fe42..03ef21a 100644 --- a/usbDriveListener/README +++ b/usbDriveListener/README @@ -1,8 +1,6 @@ Usage instructions: -1. Change the path in the '80-local.rules' and 'trigger.sh' to the folder where the corresponding files are located on your machine. -2. Copy '80-local.rules' to /etc/udev/rules.d (you will need admin privileges). -3. Run 'app.js' using Node.js server. -4. Copy 'token.txt' to a USB flash disk. -5. Add/remove the USB disc and observe the output in 'log.txt' in the same folder. - -Tested on Fedora 16 with Gnome 3.2.2.1 +1. Make sure you've built the Linux repository by running ../build.sh +2. Prepare a USB stick with a Linux-readable file system +3. Copy tests/.gpii-user-token.txt to the root level of your USB stick +4. Start the Flow Manager by running ../start.sh +5. Add/remove the USB stick and watch your settings change! diff --git a/usbDriveListener/bin/handleUserDeviceEvent.sh b/usbDriveListener/bin/handleUserDeviceEvent.sh index fa75498..8ef0ab3 100755 --- a/usbDriveListener/bin/handleUserDeviceEvent.sh +++ b/usbDriveListener/bin/handleUserDeviceEvent.sh @@ -1,4 +1,15 @@ #!/bin/sh + +# GPII Linux USB Drive User Listener +# +# Copyright 2012 Astea Solutions +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# You may obtain a copy of the License at +# https://github.com/gpii/universal/LICENSE.txt + usersFilePath="/var/lib/gpii/users.txt" if [ $1 -eq 1 ]; then diff --git a/usbDriveListener/bin/trigger.sh b/usbDriveListener/bin/trigger.sh index dcbc0ab..863e477 100755 --- a/usbDriveListener/bin/trigger.sh +++ b/usbDriveListener/bin/trigger.sh @@ -1,4 +1,15 @@ #!/bin/sh + +# GPII Linux USB Drive User Listener +# +# Copyright 2012 Astea Solutions +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# You may obtain a copy of the License at +# https://github.com/gpii/universal/LICENSE.txt + # This is a workaround for correct udev script execution. # There should be a way to avoid using a intermediate file. From 023676edfa74c8c89591cec17dc0b96e0fb77f27 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 2 Apr 2012 12:14:50 -0400 Subject: [PATCH 013/319] End-to-end working personalization on Linux. Updates build script to (temporarily) pull from Yura's fork. Introduces a new clean script. Refactors handleUserDeviceEvent to store logs in /var/lib/gpii --- build.sh | 12 +++++----- clean.sh | 24 +++++++++++++++++++ usbDriveListener/bin/handleUserDeviceEvent.sh | 9 +++---- 3 files changed, 35 insertions(+), 10 deletions(-) create mode 100755 clean.sh diff --git a/build.sh b/build.sh index fd05833..aa70e56 100755 --- a/build.sh +++ b/build.sh @@ -12,7 +12,7 @@ node_modules="../node_modules" universal="../node_modules/universal" -repoURL="git://github.com/GPII/universal.git" +repoURL="git://github.com/yzen/universal.git" # TODO: Change this back to the GPII project repo as soon as Yura's pull request is in. usbListenerDir="./usbDriveListener" gpiiInstallDir="/usr/local/gpii" gpiiStateDir="/var/lib/gpii" @@ -37,7 +37,7 @@ fi # Compile the GSettings C++ Bridge cd node_modules/gsettingsBridge/nodegsettings node-waf configure build - +cd ../../.. # Create standard directory structure for GPII. # Note: everything below here must be run as root, since we're installing ourselves centrally. @@ -46,7 +46,7 @@ if [ -d $gpiiInstallDir ]; then else echo "$gpiiInstallDir does not exist" echo "creating $gpiiInstallDir" - mkdir -p "$gpiiInstallDir" + sudo mkdir -p "$gpiiInstallDir" fi if [ -d $gpiiStateDir ]; then @@ -54,10 +54,10 @@ if [ -d $gpiiStateDir ]; then else echo "$gpiiStateDir does not exist" echo "creating $gpiiStateDir" - mkdir -p "$gpiiStateDir" + sudo mkdir -p "$gpiiStateDir" fi # Install the USB Drive User Listener # TODO: We should install the entire GPII in /usr/local/gpii, not just the USB Listener -cp -r "$usbListenerDir/bin" "$gpiiInstallDir/bin" -cp "$usbListenerDir/80-local.rules" /etc/udev/rules.d/ +sudo cp -r "$usbListenerDir/bin" "$gpiiInstallDir/bin" +sudo cp "$usbListenerDir/80-local.rules" /etc/udev/rules.d/ diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000..ba91fe3 --- /dev/null +++ b/clean.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# GPII Linux Clean Script +# +# Copyright 2012 OCAD University +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# You may obtain a copy of the License at +# https://github.com/gpii/universal/LICENSE.txt + +cd node_modules/gsettingsBridge/nodegsettings +node-waf clean +rm -rf build +rm .lock-wscript +cd ../../.. + +sudo rm -rf /usr/local/gpii +sudo rm -rf /var/lib/gpii + +# TODO: It seems extremely dangerous to go around deleting the node_modules directory we installed, +# in case the developer has unpushed modifications in there. +# rm -rf ../node_modules diff --git a/usbDriveListener/bin/handleUserDeviceEvent.sh b/usbDriveListener/bin/handleUserDeviceEvent.sh index 8ef0ab3..ff99a74 100755 --- a/usbDriveListener/bin/handleUserDeviceEvent.sh +++ b/usbDriveListener/bin/handleUserDeviceEvent.sh @@ -11,6 +11,7 @@ # https://github.com/gpii/universal/LICENSE.txt usersFilePath="/var/lib/gpii/users.txt" +logFilePath="/var/lib/gpii/log.txt" if [ $1 -eq 1 ]; then # USB disk drive is added. @@ -23,13 +24,13 @@ if [ $1 -eq 1 ]; then mountLocation=`mount | grep $2 |cut -d " " -f 3` token=`cat $mountLocation/.gpii-user-token.txt` - echo "User logged in on device $2 with token ${token}." >> log.txt + echo "User logged in on device $2 with token ${token}." >> "$logFilePath" echo $2:$token >> "$usersFilePath" # Keep the location and token in a users file. - curl http://localhost:3000/user/$token/login + curl http://localhost:8081/user/$token/login else # USB disk drive is removed. - curl http://localhost:3000/user/$token/logout + curl http://localhost:8081/user/$token/logout token=`grep $2 < "$usersFilePath" | cut -d ":" -f 2` sed -ie "\|^$2|d" "$usersFilePath" # Remove entry from the users file - echo "User logged out from device $2 with token ${token}." >> log.txt + echo "User logged out from device $2 with token ${token}." >> "$logFilePath" fi From 6f210a10e12fc929557bbc89e24bd6ba33acef09 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 2 Apr 2012 13:48:55 -0400 Subject: [PATCH 014/319] Renamed our udev rules to be more descriptive and less likely to overlap. --- build.sh | 2 +- usbDriveListener/{80-local.rules => 80-gpii.rules} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename usbDriveListener/{80-local.rules => 80-gpii.rules} (100%) diff --git a/build.sh b/build.sh index aa70e56..f3c9782 100755 --- a/build.sh +++ b/build.sh @@ -60,4 +60,4 @@ fi # Install the USB Drive User Listener # TODO: We should install the entire GPII in /usr/local/gpii, not just the USB Listener sudo cp -r "$usbListenerDir/bin" "$gpiiInstallDir/bin" -sudo cp "$usbListenerDir/80-local.rules" /etc/udev/rules.d/ +sudo cp "$usbListenerDir/80-gpii.rules" /etc/udev/rules.d/ diff --git a/usbDriveListener/80-local.rules b/usbDriveListener/80-gpii.rules similarity index 100% rename from usbDriveListener/80-local.rules rename to usbDriveListener/80-gpii.rules From c05590cc80264904177fb84144a33ce00098ddb3 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Tue, 3 Apr 2012 10:08:55 -0400 Subject: [PATCH 015/319] Fixed bug in handleUserDeviceEvent.sh preventing logout from working correctly. Thanks to Kasper for pointing out the fix. --- usbDriveListener/bin/handleUserDeviceEvent.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usbDriveListener/bin/handleUserDeviceEvent.sh b/usbDriveListener/bin/handleUserDeviceEvent.sh index ff99a74..2d9bc54 100755 --- a/usbDriveListener/bin/handleUserDeviceEvent.sh +++ b/usbDriveListener/bin/handleUserDeviceEvent.sh @@ -29,8 +29,8 @@ if [ $1 -eq 1 ]; then curl http://localhost:8081/user/$token/login else # USB disk drive is removed. - curl http://localhost:8081/user/$token/logout token=`grep $2 < "$usersFilePath" | cut -d ":" -f 2` + curl http://localhost:8081/user/$token/logout sed -ie "\|^$2|d" "$usersFilePath" # Remove entry from the users file echo "User logged out from device $2 with token ${token}." >> "$logFilePath" fi From 625b6eaf8e27dbc8b3bcf248a7ba2f7eef1dd40b Mon Sep 17 00:00:00 2001 From: Boyan Sheytanov Date: Mon, 9 Apr 2012 14:54:33 +0300 Subject: [PATCH 016/319] Minor changes to the build and clean scripts --- build.sh | 16 ++++++++-------- clean.sh | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index f3c9782..5452a48 100755 --- a/build.sh +++ b/build.sh @@ -12,7 +12,7 @@ node_modules="../node_modules" universal="../node_modules/universal" -repoURL="git://github.com/yzen/universal.git" # TODO: Change this back to the GPII project repo as soon as Yura's pull request is in. +repoURL="git://github.com/GPII/universal.git" usbListenerDir="./usbDriveListener" gpiiInstallDir="/usr/local/gpii" gpiiStateDir="/var/lib/gpii" @@ -20,14 +20,14 @@ gpiiStateDir="/var/lib/gpii" # Clone the necessary GPII framework dependencies from Git. # TODO: Deal with cut and pastage for directory creation logic. if [ -d $node_modules ]; then - echo "$node_modules already exists" + echo "$node_modules already exists" else echo "$node_modules does not exist" echo "creating $node_modules" - mkdir -p "$node_modules" + mkdir -p "$node_modules" fi if [ -d $universal ]; then - echo "$universal already exists" + echo "$universal already exists" else echo "$universal does not exist" echo "cloning universal" @@ -42,19 +42,19 @@ cd ../../.. # Create standard directory structure for GPII. # Note: everything below here must be run as root, since we're installing ourselves centrally. if [ -d $gpiiInstallDir ]; then - echo "$gpiiInstallDir already exists" + echo "$gpiiInstallDir already exists" else echo "$gpiiInstallDir does not exist" echo "creating $gpiiInstallDir" - sudo mkdir -p "$gpiiInstallDir" + sudo mkdir -p "$gpiiInstallDir" fi if [ -d $gpiiStateDir ]; then - echo "$gpiiStateDir already exists" + echo "$gpiiStateDir already exists" else echo "$gpiiStateDir does not exist" echo "creating $gpiiStateDir" - sudo mkdir -p "$gpiiStateDir" + sudo mkdir -p "$gpiiStateDir" fi # Install the USB Drive User Listener diff --git a/clean.sh b/clean.sh index ba91fe3..633f602 100755 --- a/clean.sh +++ b/clean.sh @@ -18,6 +18,7 @@ cd ../../.. sudo rm -rf /usr/local/gpii sudo rm -rf /var/lib/gpii +sudo rm -f /etc/udev/rules.d/80-gpii.rules # TODO: It seems extremely dangerous to go around deleting the node_modules directory we installed, # in case the developer has unpushed modifications in there. From 31218df5130f80413fd67c16ccee162dd2212ef4 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Wed, 25 Apr 2012 00:16:11 -0400 Subject: [PATCH 017/319] Fixing up payload returns so they are cloned objects and not modifying the original object. Fixing GET payload to match wiki spec for both partially filled and null schema requests. Adding a test file for GET payloads --- .../gsettingsBridge/gsettings_bridge.js | 23 ++++++++++++------- .../tests/data/gmag-get-test.json | 17 ++++++++++++++ 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 node_modules/gsettingsBridge/tests/data/gmag-get-test.json diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index d132176..f721b78 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -25,26 +25,33 @@ https://github.com/gpii/universal/LICENSE.txt gpii.gsettings = gpii.gsettings || {}; gpii.gsettings.get = function(settingsarray) { - var togo = settings; // TODO deep clone this - for (var i = 0; i < settingsarray.length; i++) { - var settings = settingsarray[i]; + var togo = fluid.copy(settingsarray); + for (var i = 0; i < togo.length; i++) { + var settings = togo[i]; for (var schemaId in settings) { + if (settings[schemaId] === null) { + var keys = nodeGSettings.get_gsetting_keys(schemaId); + settings[schemaId] = {}; + for (var k = 0; k < keys.length; k++) { + var key = keys[k]; + settings[schemaId][key] = nodeGSettings.get_gsetting(schemaId,key); + } + } for (var settingKey in settings[schemaId]) { settings[schemaId][settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); } } } - return settings; + return togo; }; gpii.gsettings.set = function(settingsarray) { - var togo = settingsarray; //TODO deep clone this - for (var i = 0; i < settingsarray.length; i++) { - var settings = settingsarray[i]; + var togo = fluid.copy(settingsarray); + for (var i = 0; i < togo.length; i++) { + var settings = togo[i]; for (var schemaId in settings) { for (var settingKey in settings[schemaId].settings) { var value = settings[schemaId].settings[settingKey]; - //util.puts("Going to set: "+schemaId+" : "+settingKey+" : "+value+"\n"); var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey); nodeGSettings.set_gsetting(schemaId,settingKey,value); settings[schemaId].settings[settingKey] = { diff --git a/node_modules/gsettingsBridge/tests/data/gmag-get-test.json b/node_modules/gsettingsBridge/tests/data/gmag-get-test.json new file mode 100644 index 0000000..f706c1e --- /dev/null +++ b/node_modules/gsettingsBridge/tests/data/gmag-get-test.json @@ -0,0 +1,17 @@ +[{ + "org.gnome.desktop.a11y.magnifier": { + "cross-hairs-clip": null, + "cross-hairs-color": null, + "cross-hairs-length": null, + "cross-hairs-opacity": null, + "cross-hairs-thickness": null, + "lens-mode": null, + "mag-factor": null, + "mouse-tracking": null, + "screen-position": null, + "scroll-at-edges": null, + "show-cross-hairs": null + } +}, { + "org.gnome.desktop.a11y.keyboard": null +}] \ No newline at end of file From b2834c656c2b20f060a426cc1d3d3e0b7815fc24 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Wed, 25 Apr 2012 00:20:02 -0400 Subject: [PATCH 018/319] Fixing if/else branch --- node_modules/gsettingsBridge/gsettings_bridge.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index f721b78..778764c 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -37,8 +37,10 @@ https://github.com/gpii/universal/LICENSE.txt settings[schemaId][key] = nodeGSettings.get_gsetting(schemaId,key); } } - for (var settingKey in settings[schemaId]) { - settings[schemaId][settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); + else { + for (var settingKey in settings[schemaId]) { + settings[schemaId][settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); + } } } } From 0cf9681d3048ea76edfc01e78e0919dc2fbafb8e Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Tue, 8 May 2012 01:04:34 -0400 Subject: [PATCH 019/319] Updating to new payloads with schemas in the option blocks. --- .../gsettingsBridge/gsettings_bridge.js | 55 +++++++++++-------- ...ome.builtin.magnification.example-GET.json | 21 +++++++ ...m.gnome.builtin.magnification.example.json | 23 ++++++++ 3 files changed, 76 insertions(+), 23 deletions(-) create mode 100644 node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json create mode 100644 node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index 778764c..7195836 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -26,20 +26,25 @@ https://github.com/gpii/universal/LICENSE.txt gpii.gsettings.get = function(settingsarray) { var togo = fluid.copy(settingsarray); - for (var i = 0; i < togo.length; i++) { - var settings = togo[i]; - for (var schemaId in settings) { - if (settings[schemaId] === null) { - var keys = nodeGSettings.get_gsetting_keys(schemaId); - settings[schemaId] = {}; - for (var k = 0; k < keys.length; k++) { - var key = keys[k]; - settings[schemaId][key] = nodeGSettings.get_gsetting(schemaId,key); + for (var i = 0; i < togo.length; i++) { + var app = togo[i]; + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var schemaId = app[appId][j].options.schema; + var settings = app[appId][j].settings; + if (settings === null) { + var keys = nodeGSettings.get_gsetting_keys(schemaId); + app[appId][j].settings = {}; + for (var k = 0; k < keys.length; k++) { + var key = keys[k]; + app[appId][j].settings[key] = nodeGSettings.get_gsetting(schemaId,key); + } } - } - else { - for (var settingKey in settings[schemaId]) { - settings[schemaId][settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); + else { + for (var settingKey in settings) { + settings[settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); + } + } } } @@ -50,16 +55,20 @@ https://github.com/gpii/universal/LICENSE.txt gpii.gsettings.set = function(settingsarray) { var togo = fluid.copy(settingsarray); for (var i = 0; i < togo.length; i++) { - var settings = togo[i]; - for (var schemaId in settings) { - for (var settingKey in settings[schemaId].settings) { - var value = settings[schemaId].settings[settingKey]; - var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey); - nodeGSettings.set_gsetting(schemaId,settingKey,value); - settings[schemaId].settings[settingKey] = { - "oldValue": oldValue, - "newValue": value - }; + var app = togo[i]; + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var schemaId = app[appId][j].options.schema; + var settings = app[appId][j].settings; + for (var settingKey in settings) { + var value = settings[settingKey]; + var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey); + nodeGSettings.set_gsetting(schemaId,settingKey,value); + settings[settingKey] = { + "oldValue": oldValue, + "newValue": value + }; + } } } } diff --git a/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json b/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json new file mode 100644 index 0000000..caf2558 --- /dev/null +++ b/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json @@ -0,0 +1,21 @@ +[ + { + "com.gnome.builtin.magnification": [ + { + "settings": { + "cross-hairs-clip": false, + "cross-hairs-color": "#ff0020" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + } + }, + { + "settings": null, + "options": { + "schema": "org.gnome.desktop.a11y.mouse" + } + } + ] + } +] \ No newline at end of file diff --git a/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json b/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json new file mode 100644 index 0000000..8331cb1 --- /dev/null +++ b/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json @@ -0,0 +1,23 @@ +[ + { + "com.gnome.builtin.magnification": [ + { + "settings": { + "cross-hairs-clip": true, + "cross-hairs-color": "#ff0020" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + } + }, + { + "settings": { + "dwell-threshold": 11 + }, + "options": { + "schema": "org.gnome.desktop.a11y.mouse" + } + } + ] + } +] \ No newline at end of file From 7bf60007938399b4ef9c670c6afd78e42b0553c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 10 May 2012 13:12:27 +0200 Subject: [PATCH 020/319] Removing config.h include from nodegsettings.cc --- node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index f45e84f..13ebc8c 100644 --- a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -13,7 +13,6 @@ You may obtain a copy of the License at #include #include -#include #include using namespace v8; From 706f880ce6c5b88d28dfcd011dc12ed2347fd306 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sun, 13 May 2012 19:56:50 -0400 Subject: [PATCH 021/319] Kasper's fix for USB drives with spaces in their names. --- usbDriveListener/bin/handleUserDeviceEvent.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usbDriveListener/bin/handleUserDeviceEvent.sh b/usbDriveListener/bin/handleUserDeviceEvent.sh index 2d9bc54..16d649b 100755 --- a/usbDriveListener/bin/handleUserDeviceEvent.sh +++ b/usbDriveListener/bin/handleUserDeviceEvent.sh @@ -22,8 +22,8 @@ if [ $1 -eq 1 ]; then sleep 1 done - mountLocation=`mount | grep $2 |cut -d " " -f 3` - token=`cat $mountLocation/.gpii-user-token.txt` + mountLocation=`mount | grep $2 | sed -e "s#/[^ ]\+ [^ ]\+ \(.*\) type.*#\1#"` + token=`cat "$mountLocation/.gpii-user-token.txt"` echo "User logged in on device $2 with token ${token}." >> "$logFilePath" echo $2:$token >> "$usersFilePath" # Keep the location and token in a users file. curl http://localhost:8081/user/$token/login From 3ba3a13cabd013072652f9d7a132adf76ee9746a Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sun, 13 May 2012 20:10:58 -0400 Subject: [PATCH 022/319] Kasper's fix to gsettingsBridge for new payload structure without array wrapper. --- .../gsettingsBridge/gsettings_bridge.js | 68 +++++++++---------- ...ome.builtin.magnification.example-GET.json | 38 +++++------ ...m.gnome.builtin.magnification.example.json | 42 ++++++------ .../tests/data/gmag-get-test.json | 4 +- .../gsettingsBridge/tests/data/gmag-orig.json | 4 +- .../tests/data/gmag-test1.json | 4 +- 6 files changed, 75 insertions(+), 85 deletions(-) diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index 7195836..6c72071 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -25,54 +25,48 @@ https://github.com/gpii/universal/LICENSE.txt gpii.gsettings = gpii.gsettings || {}; gpii.gsettings.get = function(settingsarray) { - var togo = fluid.copy(settingsarray); - for (var i = 0; i < togo.length; i++) { - var app = togo[i]; - for (var appId in app) { - for (var j = 0; j < app[appId].length; j++) { - var schemaId = app[appId][j].options.schema; - var settings = app[appId][j].settings; - if (settings === null) { - var keys = nodeGSettings.get_gsetting_keys(schemaId); - app[appId][j].settings = {}; - for (var k = 0; k < keys.length; k++) { - var key = keys[k]; - app[appId][j].settings[key] = nodeGSettings.get_gsetting(schemaId,key); - } + var app = fluid.copy(settingsarray); + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var schemaId = app[appId][j].options.schema; + var settings = app[appId][j].settings; + if (settings === null) { + var keys = nodeGSettings.get_gsetting_keys(schemaId); + app[appId][j].settings = {}; + for (var k = 0; k < keys.length; k++) { + var key = keys[k]; + app[appId][j].settings[key] = nodeGSettings.get_gsetting(schemaId,key); } - else { - for (var settingKey in settings) { - settings[settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); - } - + } + else { + for (var settingKey in settings) { + settings[settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); } + } } } - return togo; + return app; }; gpii.gsettings.set = function(settingsarray) { - var togo = fluid.copy(settingsarray); - for (var i = 0; i < togo.length; i++) { - var app = togo[i]; - for (var appId in app) { - for (var j = 0; j < app[appId].length; j++) { - var schemaId = app[appId][j].options.schema; - var settings = app[appId][j].settings; - for (var settingKey in settings) { - var value = settings[settingKey]; - var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey); - nodeGSettings.set_gsetting(schemaId,settingKey,value); - settings[settingKey] = { - "oldValue": oldValue, - "newValue": value - }; - } + var app = fluid.copy(settingsarray); + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var schemaId = app[appId][j].options.schema; + var settings = app[appId][j].settings; + for (var settingKey in settings) { + var value = settings[settingKey]; + var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey); + nodeGSettings.set_gsetting(schemaId,settingKey,value); + settings[settingKey] = { + "oldValue": oldValue, + "newValue": value + }; } } } - return togo; + return app; } })(); \ No newline at end of file diff --git a/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json b/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json index caf2558..805d6e2 100644 --- a/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json +++ b/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json @@ -1,21 +1,19 @@ -[ - { - "com.gnome.builtin.magnification": [ - { - "settings": { - "cross-hairs-clip": false, - "cross-hairs-color": "#ff0020" - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - } - }, - { - "settings": null, - "options": { - "schema": "org.gnome.desktop.a11y.mouse" - } +{ + "com.gnome.builtin.magnification": [ + { + "settings": { + "cross-hairs-clip": false, + "cross-hairs-color": "#ff0020" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" } - ] - } -] \ No newline at end of file + }, + { + "settings": null, + "options": { + "schema": "org.gnome.desktop.a11y.mouse" + } + } + ] +} diff --git a/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json b/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json index 8331cb1..f9037ab 100644 --- a/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json +++ b/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json @@ -1,23 +1,21 @@ -[ - { - "com.gnome.builtin.magnification": [ - { - "settings": { - "cross-hairs-clip": true, - "cross-hairs-color": "#ff0020" - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - } - }, - { - "settings": { - "dwell-threshold": 11 - }, - "options": { - "schema": "org.gnome.desktop.a11y.mouse" - } +{ + "com.gnome.builtin.magnification": [ + { + "settings": { + "cross-hairs-clip": true, + "cross-hairs-color": "#ff0020" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" } - ] - } -] \ No newline at end of file + }, + { + "settings": { + "dwell-threshold": 11 + }, + "options": { + "schema": "org.gnome.desktop.a11y.mouse" + } + } + ] +} diff --git a/node_modules/gsettingsBridge/tests/data/gmag-get-test.json b/node_modules/gsettingsBridge/tests/data/gmag-get-test.json index f706c1e..4f616d1 100644 --- a/node_modules/gsettingsBridge/tests/data/gmag-get-test.json +++ b/node_modules/gsettingsBridge/tests/data/gmag-get-test.json @@ -1,4 +1,4 @@ -[{ +{ "org.gnome.desktop.a11y.magnifier": { "cross-hairs-clip": null, "cross-hairs-color": null, @@ -14,4 +14,4 @@ } }, { "org.gnome.desktop.a11y.keyboard": null -}] \ No newline at end of file +} \ No newline at end of file diff --git a/node_modules/gsettingsBridge/tests/data/gmag-orig.json b/node_modules/gsettingsBridge/tests/data/gmag-orig.json index b5d6f3f..44067fa 100644 --- a/node_modules/gsettingsBridge/tests/data/gmag-orig.json +++ b/node_modules/gsettingsBridge/tests/data/gmag-orig.json @@ -1,4 +1,4 @@ -[{ +{ "org.gnome.desktop.a11y.magnifier": { "settings": { "cross-hairs-clip": false, @@ -16,4 +16,4 @@ "options": { } } -}] \ No newline at end of file +} \ No newline at end of file diff --git a/node_modules/gsettingsBridge/tests/data/gmag-test1.json b/node_modules/gsettingsBridge/tests/data/gmag-test1.json index 7caf4df..6e35c59 100644 --- a/node_modules/gsettingsBridge/tests/data/gmag-test1.json +++ b/node_modules/gsettingsBridge/tests/data/gmag-test1.json @@ -1,4 +1,4 @@ -[{ +{ "org.gnome.desktop.a11y.magnifier": { "cross-hairs-clip": false, "cross-hairs-color": "#ff0000", @@ -12,4 +12,4 @@ "scroll-at-edges": false, "show-cross-hairs": false } -}] \ No newline at end of file +} \ No newline at end of file From 160f4ef83b599c0d36a3d86976e49a3414593465 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Thu, 17 May 2012 10:19:49 -0400 Subject: [PATCH 023/319] Merge branch 'master', remote-tracking branch 'upstream/master' * upstream/master: Kasper's fix for USB drives with spaces in their names. * master: From a8b6cf1c5a2484034399e37352b8812d8400cc83 Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Tue, 28 Aug 2012 11:26:41 -0400 Subject: [PATCH 024/319] GPII-30: Updated the way the flowManager is started from the linux repo --- gpii.js | 5 ++++- start.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gpii.js b/gpii.js index 1c81375..2619c99 100644 --- a/gpii.js +++ b/gpii.js @@ -15,4 +15,7 @@ var fluid = require("universal"), fluid.require("gsettingsBridge", require); -gpii.flowManager(); \ No newline at end of file +gpii.config.makeConfigLoader({ + nodeEnv: gpii.config.getNodeEnv(), + configPath: gpii.config.getConfigPath() +}); \ No newline at end of file diff --git a/start.sh b/start.sh index 02d6425..690a08f 100755 --- a/start.sh +++ b/start.sh @@ -16,4 +16,4 @@ fileName="gpii.js" ./build.sh # Start the Flow Manager -node "$fileName" +node "$fileName" $1 \ No newline at end of file From 1bd1cb0c12c411e5d1cf815dbec8635c78b166f2 Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Tue, 28 Aug 2012 15:44:45 -0400 Subject: [PATCH 025/319] GPII-30: Updating gpii.js and removing start.sh --- gpii.js | 2 +- start.sh | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100755 start.sh diff --git a/gpii.js b/gpii.js index 2619c99..6d5010f 100644 --- a/gpii.js +++ b/gpii.js @@ -17,5 +17,5 @@ fluid.require("gsettingsBridge", require); gpii.config.makeConfigLoader({ nodeEnv: gpii.config.getNodeEnv(), - configPath: gpii.config.getConfigPath() + configPath: gpii.config.getConfigPath() || "../node_modules/universal/gpii/node_modules/flowManager/configs"; }); \ No newline at end of file diff --git a/start.sh b/start.sh deleted file mode 100755 index 690a08f..0000000 --- a/start.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# GPII Linux Startup Script -# -# Copyright 2012 OCAD University -# -# Licensed under the New BSD license. You may not use this file except in -# compliance with this License. -# -# You may obtain a copy of the License at -# https://github.com/gpii/universal/LICENSE.txt - -fileName="gpii.js" - -# Build and install the GPII -./build.sh - -# Start the Flow Manager -node "$fileName" $1 \ No newline at end of file From e98ccdc2d132ae37df33216bc0198a0a05113e5d Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Tue, 28 Aug 2012 15:46:34 -0400 Subject: [PATCH 026/319] GPII-30: fixing a type in gpii.js --- gpii.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpii.js b/gpii.js index 6d5010f..680cbb4 100644 --- a/gpii.js +++ b/gpii.js @@ -17,5 +17,5 @@ fluid.require("gsettingsBridge", require); gpii.config.makeConfigLoader({ nodeEnv: gpii.config.getNodeEnv(), - configPath: gpii.config.getConfigPath() || "../node_modules/universal/gpii/node_modules/flowManager/configs"; + configPath: gpii.config.getConfigPath() || "../node_modules/universal/gpii/node_modules/flowManager/configs" }); \ No newline at end of file From 2b869164c320f29a17971c30cf17dbcbcf04ff9d Mon Sep 17 00:00:00 2001 From: kaspermarkus Date: Mon, 24 Sep 2012 18:32:00 +0200 Subject: [PATCH 027/319] GPII-35: Added single get and single set function to gsettings bridge and made the set function useable as a lifecycle action --- .../gsettingsBridge/gsettings_bridge.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index 6c72071..cf1b249 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -11,7 +11,6 @@ https://github.com/gpii/universal/LICENSE.txt */ (function () { - "use strict"; var fluid = require("universal"); @@ -24,6 +23,23 @@ https://github.com/gpii/universal/LICENSE.txt gpii.gsettings = gpii.gsettings || {}; + fluid.defaults("gpii.gsettings.setSingleKey", { + gradeNames: "fluid.function", + argumentMap: { + schemaId: 0, + key: 1, + value: 2 + } + }); + + gpii.gsettings.getSingleKey = function(schemaId, key) { + return nodeGSettings.get_gsetting(schemaId,key); + }; + + gpii.gsettings.setSingleKey = function(schemaId, key, value) { + nodeGSettings.set_gsetting(schemaId, key, value); + }; + gpii.gsettings.get = function(settingsarray) { var app = fluid.copy(settingsarray); for (var appId in app) { From 26eccd070c94dd05a4315be012cb3909eab78b3e Mon Sep 17 00:00:00 2001 From: kaspermarkus Date: Tue, 25 Sep 2012 12:39:33 +0200 Subject: [PATCH 028/319] GPII-22: Added basic tests, gsettings schema file and a script to run everything.. currently experiencing issues due to issues with the jqunit framework not allowing running several synchronous tests --- .../net.gpii.testing.gsettings.gschema.xml | 121 +++++++++++ .../gsettingsBridge/tests/gsettingsTests.js | 198 ++++++++++++++++++ .../gsettingsBridge/tests/runUnitTests.sh | 24 +++ 3 files changed, 343 insertions(+) create mode 100644 node_modules/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml create mode 100644 node_modules/gsettingsBridge/tests/gsettingsTests.js create mode 100755 node_modules/gsettingsBridge/tests/runUnitTests.sh diff --git a/node_modules/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml b/node_modules/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml new file mode 100644 index 0000000..5b3da3b --- /dev/null +++ b/node_modules/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml @@ -0,0 +1,121 @@ + + + + + + 5.0 + + double numbers + Any number between 0.1 and 100 - used for testing with the gpii + + + false + Boolean settings + Test field - true or false - used for testing with the gpii + + + "abcdefg" + String settings + Any string - used for testing with the gpii + + + + + + 5.0 + + double numbers + Any number between 0.1 and 100 - used for testing with the gpii + + + false + Boolean settings + Test field - true or false - used for testing with the gpii + + + "abcdefg" + String settings + Any string - used for testing with the gpii + + + + + + 5.0 + + double numbers + Any number between 0.1 and 100 - used for testing with the gpii + + + false + Boolean settings + Test field - true or false - used for testing with the gpii + + + "abcdefg" + String settings + Any string - used for testing with the gpii + + + + + + 5.0 + + double numbers + Any number between 0.1 and 100 - used for testing with the gpii + + + false + Boolean settings + Test field - true or false - used for testing with the gpii + + + "abcdefg" + String settings + Any string - used for testing with the gpii + + + + + + 987.61 + + double numbers + Any number between 0.1 and 100 - used for testing with the gpii + + + "hello world" + String settings + Any string - used for testing with the gpii + + + + + + + 5.0 + + double numbers + Any number between 0.1 and 100 - used for testing with the gpii + + + false + Boolean settings + Test field - true or false - used for testing with the gpii + + + "abcdefg" + String settings + Any string - used for testing with the gpii + + + + + + "hello world" + String settings + Any string - used for testing with the gpii + + + \ No newline at end of file diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/node_modules/gsettingsBridge/tests/gsettingsTests.js new file mode 100644 index 0000000..d0580e1 --- /dev/null +++ b/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -0,0 +1,198 @@ +/*! +XML Settings Handler Tests + +Copyright 2012 Raising the Floor - International + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +/*global console*/ + +(function () { + // This loads universal. + var fluid = require("universal"), + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("jqUnit"), + child_process = require("child_process"); + + fluid.require("gsettingsBridge", require); + + var gsettingsHandlerTests = gpii.tests.testEnvironment(); + + var put1 = { + request: { + "putreq": [ + { + settings: { + "double-setting": 3.1, + "boolean-setting": true, + "string-setting": "here i am" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set1" + } + } + ] + }, + expected: { + "putreq": [ + { + settings: { + "double-setting": { "oldValue": 5.0, "newValue": 3.1 }, + "boolean-setting": { "oldValue": false, "newValue": true }, + "string-setting": { "oldValue": "abcdefg", "newValue": "here i am" } + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set1" + } + } + ] + } + }; + + var put2 = { + request: { + "putreq": [ + { + settings: { + "double-setting": 3.2, + "boolean-setting": true, + "string-setting": "here i amma" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set2" + } + }, { + settings: { + "other-double-setting": 123.0, + "other-string-setting": "congratulations" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set3" + } + } + ] + }, + expected: { + "putreq": [ + { + settings: { + "double-setting": { "oldValue": 5, "newValue": 3.2}, + "boolean-setting": { "oldValue": false, "newValue": true }, + "string-setting": { "oldValue": "abcdefg", "newValue": "here i amma" } + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set2" + } + }, { + settings: { + "other-double-setting": { "oldValue": 987.61, "newValue": 123.0 }, + "other-string-setting": { "oldValue": "hello world", "newValue": "congratulations" } + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set3" + } + } + ] + } + }; + + var get1 = { + request: { + "putreq": [ + { + settings: { + "double-setting": null, + "boolean-setting": null, + "string-setting": null + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get1" + } + }, { + settings: { + "other-string-setting": null + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get2" + } + } + ] + }, + expected: { + "putreq": [ + { + settings: { + "double-setting": 5.0, + "boolean-setting": false, + "string-setting": "abcdefg" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get1" + } + }, { + settings: { + "other-string-setting": "hello world" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get2" + } + } + ] + } + }; + + jqUnit.module("Gsettings Handler Tests"); + + gsettingsHandlerTests.test("Getting single keys via gsettings handler", function() { + //First check reading single keys ... the default values: + jqUnit.assertEquals("Checking 'double' key", 5.0, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "double-setting")); + jqUnit.assertEquals("Checking 'boolean' key", false, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); + jqUnit.assertEquals("Checking 'string' key", "abcdefg", + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); + }); + + + gsettingsHandlerTests.test("Setting single keys via gsettings handler", function() { + //set and check double value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "double-setting", 6.789); + jqUnit.assertEquals("Checking 'double' key", 6.789, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "double-setting")); + //set and check boolean value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting", true); + jqUnit.assertEquals("Checking 'boolean' key", true, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting")); + //set and check string value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); + jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); + }); + + gsettingsHandlerTests.test("Setting multiple keys", function () { + var response = gpii.gsettings.set(put1.request); + console.log(JSON.stringify(response)); + jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put1.expected, response); + //reset the schema + gpii.gsettings.set(put1.reset); + }); + + gsettingsHandlerTests.test("Setting multiple keys in mutltiple schemas", function () { + var response = gpii.gsettings.set(put2.request); + jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put2.expected, response); + //reset the schema + gpii.gsettings.set(put2.reset); + }); + + gsettingsHandlerTests.test("Getting multiple keys in mutltiple schemas", function () { + var response = gpii.gsettings.get(get1.request); + console.log(JSON.stringify(response)); + console.log("EXPECTED: "+JSON.stringify(get1.expected)); + jqUnit.assertDeepEq("The values should be set and expected payload returned: ", get1.expected, response); + }); +}()); \ No newline at end of file diff --git a/node_modules/gsettingsBridge/tests/runUnitTests.sh b/node_modules/gsettingsBridge/tests/runUnitTests.sh new file mode 100755 index 0000000..4066e10 --- /dev/null +++ b/node_modules/gsettingsBridge/tests/runUnitTests.sh @@ -0,0 +1,24 @@ +#!/bin/bash +LOC="/usr/share/glib-2.0/schemas" + +# Copy schemas to global location and compile them +sudo cp data/net.gpii.testing.gsettings.gschema.xml $LOC +sudo glib-compile-schemas $LOC + +gsettings reset-recursively net.gpii.testing.gsettings.single-get +gsettings reset-recursively net.gpii.testing.gsettings.single-set +gsettings reset-recursively net.gpii.testing.gsettings.multi-get1 +gsettings reset-recursively net.gpii.testing.gsettings.multi-get2 +gsettings reset-recursively net.gpii.testing.gsettings.multi-set1 +gsettings reset-recursively net.gpii.testing.gsettings.multi-set2 +gsettings reset-recursively net.gpii.testing.gsettings.multi-set3 + +#Run the tests: +node gsettingsTests.js + +#Delete the schemas when done and recompile: +sudo rm "$LOC/net.gpii.testing.gsettings.gschema.xml" +sudo glib-compile-schemas $LOC + + + From c52bdec32856d75dedcbba3ac985b51c52a9fe14 Mon Sep 17 00:00:00 2001 From: kaspermarkus Date: Tue, 2 Oct 2012 12:15:47 +0200 Subject: [PATCH 029/319] GPII-22: Added test for having a settings block null. Also ensured that it works with the new test framework in universal comitted with GPII-36 --- .../gsettingsBridge/tests/gsettingsTests.js | 143 +++++++++++++----- 1 file changed, 102 insertions(+), 41 deletions(-) diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/node_modules/gsettingsBridge/tests/gsettingsTests.js index d0580e1..99d0913 100644 --- a/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -10,15 +10,15 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ -/*global console*/ +/*global console, __dirname, setTimeout, require */ (function () { // This loads universal. var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("jqUnit"), - child_process = require("child_process"); + jqUnit = fluid.require("jqUnit"); + fluid.require(__dirname+"/../../../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js", require); fluid.require("gsettingsBridge", require); var gsettingsHandlerTests = gpii.tests.testEnvironment(); @@ -103,7 +103,7 @@ https://github.com/gpii/universal/LICENSE.txt var get1 = { request: { - "putreq": [ + "getreq": [ { settings: { "double-setting": null, @@ -124,7 +124,48 @@ https://github.com/gpii/universal/LICENSE.txt ] }, expected: { - "putreq": [ + "getreq": [ + { + settings: { + "double-setting": 5.0, + "boolean-setting": false, + "string-setting": "abcdefg" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get1" + } + }, { + settings: { + "other-string-setting": "hello world" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get2" + } + } + ] + } + }; + + var get2 = { + request: { + "getreq": [ + { + settings: null, + options: { + schema: "net.gpii.testing.gsettings.multi-get1" + } + }, { + settings: { + "other-string-setting": null + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get2" + } + } + ] + }, + expected: { + "getreq": [ { settings: { "double-setting": 5.0, @@ -148,51 +189,71 @@ https://github.com/gpii/universal/LICENSE.txt jqUnit.module("Gsettings Handler Tests"); - gsettingsHandlerTests.test("Getting single keys via gsettings handler", function() { + gsettingsHandlerTests.asyncTest("Getting single keys via gsettings handler", function() { + setTimeout(function() { //First check reading single keys ... the default values: - jqUnit.assertEquals("Checking 'double' key", 5.0, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "double-setting")); - jqUnit.assertEquals("Checking 'boolean' key", false, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); - jqUnit.assertEquals("Checking 'string' key", "abcdefg", - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); + jqUnit.assertEquals("Checking 'double' key", 5.0, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "double-setting")); + jqUnit.assertEquals("Checking 'boolean' key", false, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); + jqUnit.assertEquals("Checking 'string' key", "abcdefg", + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); + jqUnit.start(); + }, 10); }); - gsettingsHandlerTests.test("Setting single keys via gsettings handler", function() { - //set and check double value - gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "double-setting", 6.789); - jqUnit.assertEquals("Checking 'double' key", 6.789, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "double-setting")); - //set and check boolean value - gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting", true); - jqUnit.assertEquals("Checking 'boolean' key", true, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting")); - //set and check string value - gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); - jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); + gsettingsHandlerTests.asyncTest("Setting single keys via gsettings handler", function() { + setTimeout(function() { + //set and check double value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "double-setting", 6.789); + jqUnit.assertEquals("Checking 'double' key", 6.789, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "double-setting")); + //set and check boolean value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting", true); + jqUnit.assertEquals("Checking 'boolean' key", true, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting")); + //set and check string value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); + jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); + jqUnit.start(); + }, 10); + }); + + gsettingsHandlerTests.asyncTest("Setting multiple keys", function () { + setTimeout(function() { + var response = gpii.gsettings.set(put1.request); + jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put1.expected, response); + //reset the schema + gpii.gsettings.set(put1.reset); + jqUnit.start(); + }, 10); }); - gsettingsHandlerTests.test("Setting multiple keys", function () { - var response = gpii.gsettings.set(put1.request); - console.log(JSON.stringify(response)); - jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put1.expected, response); - //reset the schema - gpii.gsettings.set(put1.reset); + gsettingsHandlerTests.asyncTest("Setting multiple keys in multiple schemas", function () { + setTimeout(function() { + var response = gpii.gsettings.set(put2.request); + jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put2.expected, response); + //reset the schema + gpii.gsettings.set(put2.reset); + jqUnit.start(); + }, 10); }); - gsettingsHandlerTests.test("Setting multiple keys in mutltiple schemas", function () { - var response = gpii.gsettings.set(put2.request); - jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put2.expected, response); - //reset the schema - gpii.gsettings.set(put2.reset); + gsettingsHandlerTests.asyncTest("Getting multiple keys in multiple schemas", function () { + setTimeout(function() { + var response = gpii.gsettings.get(get1.request); + jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get1.expected, response); + jqUnit.start(); + }, 10); }); - gsettingsHandlerTests.test("Getting multiple keys in mutltiple schemas", function () { - var response = gpii.gsettings.get(get1.request); - console.log(JSON.stringify(response)); - console.log("EXPECTED: "+JSON.stringify(get1.expected)); - jqUnit.assertDeepEq("The values should be set and expected payload returned: ", get1.expected, response); + gsettingsHandlerTests.asyncTest("Getting multiple keys with settings block as null", function () { + setTimeout(function() { + var response = gpii.gsettings.get(get2.request); + jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get2.expected, response); + jqUnit.start(); + }, 10); }); }()); \ No newline at end of file From 5c7f437d17cc08339fa154391c054482460b21b4 Mon Sep 17 00:00:00 2001 From: kaspermarkus Date: Thu, 18 Oct 2012 02:14:48 +0200 Subject: [PATCH 030/319] GPII-22: Removed outdated reset calls from unit tests, ensured that tests will run even if schemas already exist --- node_modules/gsettingsBridge/tests/gsettingsTests.js | 4 ---- node_modules/gsettingsBridge/tests/runUnitTests.sh | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/node_modules/gsettingsBridge/tests/gsettingsTests.js index 99d0913..857ee70 100644 --- a/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -225,8 +225,6 @@ https://github.com/gpii/universal/LICENSE.txt setTimeout(function() { var response = gpii.gsettings.set(put1.request); jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put1.expected, response); - //reset the schema - gpii.gsettings.set(put1.reset); jqUnit.start(); }, 10); }); @@ -235,8 +233,6 @@ https://github.com/gpii/universal/LICENSE.txt setTimeout(function() { var response = gpii.gsettings.set(put2.request); jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put2.expected, response); - //reset the schema - gpii.gsettings.set(put2.reset); jqUnit.start(); }, 10); }); diff --git a/node_modules/gsettingsBridge/tests/runUnitTests.sh b/node_modules/gsettingsBridge/tests/runUnitTests.sh index 4066e10..45bb241 100755 --- a/node_modules/gsettingsBridge/tests/runUnitTests.sh +++ b/node_modules/gsettingsBridge/tests/runUnitTests.sh @@ -5,6 +5,7 @@ LOC="/usr/share/glib-2.0/schemas" sudo cp data/net.gpii.testing.gsettings.gschema.xml $LOC sudo glib-compile-schemas $LOC +# Make sure they are reset in case they already existed gsettings reset-recursively net.gpii.testing.gsettings.single-get gsettings reset-recursively net.gpii.testing.gsettings.single-set gsettings reset-recursively net.gpii.testing.gsettings.multi-get1 From 9cd78bea1cad14be55aee44ad1b3e4d8fe5d5383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 23 Oct 2012 19:10:46 +0200 Subject: [PATCH 031/319] [linux] Fix for issue #GPII-48 * Unable to run linux solution (due to gsettings handler) Node.js removed node-waf building support in favour of node-gyp. see http://github.com/joyent/node/issues/3475 --- .../gsettingsBridge/nodegsettings/binding.gyp | 11 +++++++++++ .../gsettingsBridge/nodegsettings/wscript | 19 ------------------- 2 files changed, 11 insertions(+), 19 deletions(-) create mode 100644 node_modules/gsettingsBridge/nodegsettings/binding.gyp delete mode 100644 node_modules/gsettingsBridge/nodegsettings/wscript diff --git a/node_modules/gsettingsBridge/nodegsettings/binding.gyp b/node_modules/gsettingsBridge/nodegsettings/binding.gyp new file mode 100644 index 0000000..8657074 --- /dev/null +++ b/node_modules/gsettingsBridge/nodegsettings/binding.gyp @@ -0,0 +1,11 @@ +{ + "targets": [ + { + "target_name": "nodegsettings", + "sources": ["nodegsettings.cc"], + "libraries": [" Date: Wed, 24 Oct 2012 12:27:31 +0200 Subject: [PATCH 032/319] Updating build.sh and clean.sh to use node-gyp --- build.sh | 2 +- clean.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 5452a48..e8d843e 100755 --- a/build.sh +++ b/build.sh @@ -36,7 +36,7 @@ fi # Compile the GSettings C++ Bridge cd node_modules/gsettingsBridge/nodegsettings -node-waf configure build +node-gyp configure build cd ../../.. # Create standard directory structure for GPII. diff --git a/clean.sh b/clean.sh index 633f602..d27be4d 100755 --- a/clean.sh +++ b/clean.sh @@ -11,9 +11,8 @@ # https://github.com/gpii/universal/LICENSE.txt cd node_modules/gsettingsBridge/nodegsettings -node-waf clean +node-gyp clean rm -rf build -rm .lock-wscript cd ../../.. sudo rm -rf /usr/local/gpii From a2b2ee76e0916cea26772a7476e2ea3ff0c9585f Mon Sep 17 00:00:00 2001 From: kaspermarkus Date: Thu, 15 Nov 2012 20:52:23 +0100 Subject: [PATCH 033/319] GPII-35: Added fluid.defaults for the single get function as well as the single set function --- node_modules/gsettingsBridge/gsettings_bridge.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index cf1b249..4999f02 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -32,6 +32,14 @@ https://github.com/gpii/universal/LICENSE.txt } }); + fluid.defaults("gpii.gsettings.getSingleKey", { + gradeNames: "fluid.function", + argumentMap: { + schemaId: 0, + key: 1 + } + }); + gpii.gsettings.getSingleKey = function(schemaId, key) { return nodeGSettings.get_gsetting(schemaId,key); }; From e4af54967183b76dcfe96add21c331c51d0851a9 Mon Sep 17 00:00:00 2001 From: kaspermarkus Date: Fri, 16 Nov 2012 02:33:10 +0100 Subject: [PATCH 034/319] GPII-50: updated gpii.js to match windows version.. Readded start.sh, but without the build command being part of it (this was a bit akward to the the root requirement --- gpii.js | 6 ++++-- start.sh | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 start.sh diff --git a/gpii.js b/gpii.js index 680cbb4..e5ce680 100644 --- a/gpii.js +++ b/gpii.js @@ -10,12 +10,14 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ +/*global __dirname */ + var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"); fluid.require("gsettingsBridge", require); gpii.config.makeConfigLoader({ - nodeEnv: gpii.config.getNodeEnv(), - configPath: gpii.config.getConfigPath() || "../node_modules/universal/gpii/node_modules/flowManager/configs" + nodeEnv: gpii.config.getNodeEnv("fm.ps.sr.dr.mm.os.development"), + configPath: gpii.config.getConfigPath() || "../node_modules/universal/gpii/configs" }); \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..22871e4 --- /dev/null +++ b/start.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# GPII Linux Startup Script +# +# Copyright 2012 OCAD University +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# You may obtain a copy of the License at +# https://github.com/gpii/universal/LICENSE.txt + +fileName="gpii.js" + +# Start the Flow Manager +node "$fileName" $1 \ No newline at end of file From b7720f56e8ccaf95f311f4a2688260535bf7a3ab Mon Sep 17 00:00:00 2001 From: kaspermarkus Date: Fri, 16 Nov 2012 02:37:02 +0100 Subject: [PATCH 035/319] GPII-50: removed unused global __dirname declaration --- gpii.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/gpii.js b/gpii.js index e5ce680..4280439 100644 --- a/gpii.js +++ b/gpii.js @@ -10,8 +10,6 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ -/*global __dirname */ - var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"); From 6830aac6428ee93e41ebcfceee1268d92b81f201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 17 Jan 2013 15:43:58 +0100 Subject: [PATCH 036/319] Fix for issue GPII-8 GSettingsHandler appears to core dump when trying to set a non-existent key in a schema (see http://issues.gpii.net/browse/GPII-8) The problem is that Gio.Settings segfaults when requesting a non-existent key from a gsettings schema. This fix checks if the setting matches with the gsettings schema before each set/get. --- node_modules/gsettingsBridge/gsettings_bridge.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index 4999f02..2c3a7ef 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -54,8 +54,9 @@ https://github.com/gpii/universal/LICENSE.txt for (var j = 0; j < app[appId].length; j++) { var schemaId = app[appId][j].options.schema; var settings = app[appId][j].settings; + var keys = nodeGSettings.get_gsetting_keys(schemaId); + if (settings === null) { - var keys = nodeGSettings.get_gsetting_keys(schemaId); app[appId][j].settings = {}; for (var k = 0; k < keys.length; k++) { var key = keys[k]; @@ -64,6 +65,7 @@ https://github.com/gpii/universal/LICENSE.txt } else { for (var settingKey in settings) { + if (keys.indexOf(settingKey) == -1) continue; settings[settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); } @@ -79,7 +81,10 @@ https://github.com/gpii/universal/LICENSE.txt for (var j = 0; j < app[appId].length; j++) { var schemaId = app[appId][j].options.schema; var settings = app[appId][j].settings; + var keys = nodeGSettings.get_gsetting_keys(schemaId); + for (var settingKey in settings) { + if (keys.indexOf(settingKey) == -1) continue; var value = settings[settingKey]; var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey); nodeGSettings.set_gsetting(schemaId,settingKey,value); @@ -93,4 +98,4 @@ https://github.com/gpii/universal/LICENSE.txt return app; } -})(); \ No newline at end of file +})(); From 560b1e79a8e4a9867941e70592361af0a9426587 Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Wed, 6 Mar 2013 12:34:55 -0500 Subject: [PATCH 037/319] GPII-91: updating build script to run 'npm install' in addition to cloning universal. --- build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index e8d843e..6c7b1fe 100755 --- a/build.sh +++ b/build.sh @@ -10,9 +10,10 @@ # You may obtain a copy of the License at # https://github.com/gpii/universal/LICENSE.txt +currentDirName=${PWD##*/} node_modules="../node_modules" universal="../node_modules/universal" -repoURL="git://github.com/GPII/universal.git" +repoURL="git://github.com/GPII/universal.git" usbListenerDir="./usbDriveListener" gpiiInstallDir="/usr/local/gpii" gpiiStateDir="/var/lib/gpii" @@ -32,6 +33,10 @@ else echo "$universal does not exist" echo "cloning universal" git clone "$repoURL" "$universal" + cd $universal + npm install + cd ../../ + cd $currentDirName fi # Compile the GSettings C++ Bridge From 47184807e99610440544c099567868bf687551de Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Tue, 12 Mar 2013 18:41:11 -0400 Subject: [PATCH 038/319] GPII-91: simplified build.sh according to @kaspermarkus's comments --- build.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 6c7b1fe..97ce9b0 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ # You may obtain a copy of the License at # https://github.com/gpii/universal/LICENSE.txt -currentDirName=${PWD##*/} +currentDir=`pwd` node_modules="../node_modules" universal="../node_modules/universal" repoURL="git://github.com/GPII/universal.git" @@ -35,8 +35,7 @@ else git clone "$repoURL" "$universal" cd $universal npm install - cd ../../ - cd $currentDirName + cd $currentDir fi # Compile the GSettings C++ Bridge From 65fbae59238541cfc33c606beed43d96d7362060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Sat, 23 Mar 2013 01:41:53 +0100 Subject: [PATCH 039/319] Avoid USB drive event handler from getting more than one mount points see http://issues.gpii.net/browse/GPII-95 --- usbDriveListener/bin/handleUserDeviceEvent.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usbDriveListener/bin/handleUserDeviceEvent.sh b/usbDriveListener/bin/handleUserDeviceEvent.sh index 16d649b..79a6ba1 100755 --- a/usbDriveListener/bin/handleUserDeviceEvent.sh +++ b/usbDriveListener/bin/handleUserDeviceEvent.sh @@ -22,7 +22,7 @@ if [ $1 -eq 1 ]; then sleep 1 done - mountLocation=`mount | grep $2 | sed -e "s#/[^ ]\+ [^ ]\+ \(.*\) type.*#\1#"` + mountLocation=`mount | grep $2 | sed -e "s#/[^ ]\+ [^ ]\+ \(.*\) type.*#\1#" | head -n 1` token=`cat "$mountLocation/.gpii-user-token.txt"` echo "User logged in on device $2 with token ${token}." >> "$logFilePath" echo $2:$token >> "$usersFilePath" # Keep the location and token in a users file. From 2d85ec08b3d597e8ce2b646eb855af051cd3e247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 18 Jan 2013 03:53:14 +0100 Subject: [PATCH 040/319] Adding the GPII Orca Settings Handler --- gpii.js | 3 +- node_modules/orca/index.js | 18 ++++ node_modules/orca/orcaSettingsHandler.js | 100 +++++++++++++++++++++++ node_modules/orca/package.json | 19 +++++ 4 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 node_modules/orca/index.js create mode 100644 node_modules/orca/orcaSettingsHandler.js create mode 100644 node_modules/orca/package.json diff --git a/gpii.js b/gpii.js index 4280439..306770f 100644 --- a/gpii.js +++ b/gpii.js @@ -14,8 +14,9 @@ var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"); fluid.require("gsettingsBridge", require); +fluid.require("orca", require); gpii.config.makeConfigLoader({ nodeEnv: gpii.config.getNodeEnv("fm.ps.sr.dr.mm.os.development"), configPath: gpii.config.getConfigPath() || "../node_modules/universal/gpii/configs" -}); \ No newline at end of file +}); diff --git a/node_modules/orca/index.js b/node_modules/orca/index.js new file mode 100644 index 0000000..d2dfff4 --- /dev/null +++ b/node_modules/orca/index.js @@ -0,0 +1,18 @@ +/*! + * GPII Orca Settings Handler + * + * Copyright 2013 Emergya + * Author Javier Hernández + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/gpii/universal/LICENSE.txt + * */ + +var fluid = require("universal"); + +var loader = fluid.getLoader(__dirname); + +loader.require("./orcaSettingsHandler.js"); diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js new file mode 100644 index 0000000..bc9711b --- /dev/null +++ b/node_modules/orca/orcaSettingsHandler.js @@ -0,0 +1,100 @@ +/*! + * GPII Orca Settings Handler + * + * Copyright 2013 Emergya + * Author Javier Hernández + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/gpii/universal/LICENSE.txt + * */ + +(function () { + "use strict"; + + var fluid = require("universal"); + var gpii = fluid.registerNamespace("gpii"); + var fs = require('fs'); + var spawn = require('child_process').spawn; + + var ORCA_ARGS = ["--disable", "speech", + "--disable", "braille", + "--disable", "braille-monitor", + "--disable", "main-window", + "--disable", "splash-window"]; + + var PROFILE_SKEL = { + "profile": ["Default", "default"], + "pronunciations": {}, + "keybindings": {} + }; + + var homeDir = process.env.HOME; + + var orcaSettingsFile = "".concat(homeDir, + '/', + '.local/share/orca/user-settings.conf'); + + fluid.registerNamespace("gpii.launch"); + + gpii.orca = gpii.orca || {}; + + + function wait(millis) { + var date = new Date(); + var curDate = null; + + do { curDate = new Date(); } + while(curDate-date < millis); + } + + function getJSONFromFile(file) { + return JSON.parse(fs.readFileSync(file, 'utf8')); + } + + function createProfile(profile) { + var string = JSON.stringify(PROFILE_SKEL) + return JSON.parse(string.replace(/[D|d]+efault/g, profile)); + } + + function addCustomSettings (settings, profile) { + for (var k in settings) { + profile[k] = settings[k]; + }; + return profile; + } + + gpii.orca.set = function(settingsarray) { + var app = fluid.copy(settingsarray); + + var settings = app["org.gnome.orca"][0].settings; + var user = app["org.gnome.orca"][0].options.user; + + fluid.log("orcaSettingsHandler: User ", user, + " has requested these following settings: ", settings); + + if (!fs.existsSync(orcaSettingsFile)) { + var orcaSpawn = spawn('orca', ORCA_ARGS); + + while(!fs.existsSync(orcaSettingsFile)) { + wait(500); + }; + + orcaSpawn.kill('SIGKILL'); + }; + + var userSettings = getJSONFromFile(orcaSettingsFile); + var newProfile = createProfile(user); + + var customizedProfile = addCustomSettings(settings, newProfile); + userSettings.profiles[user] = customizedProfile; + + fs.writeFileSync(orcaSettingsFile, + JSON.stringify(userSettings, null, 4)); + + return app; + } + +})(); diff --git a/node_modules/orca/package.json b/node_modules/orca/package.json new file mode 100644 index 0000000..872bcc1 --- /dev/null +++ b/node_modules/orca/package.json @@ -0,0 +1,19 @@ +{ + "name": "orca", + "description": "GPII Orca Settings Handler", + "version": "0.1", + "author": "Javier Hernández", + "bugs": "http://wiki.gpii.net/index.php/Main_Page", + "homepage": "http://gpii.net/", + "dependencies": {}, + "licenses": [ + { + "type": "BSD-3-Clause", + "url": "http://www.opensource.org/licenses/BSD-3-Clause" + } + ], + "keywords": ["gpii", "accessibility", "settings", "fluid"], + "repository": "git://github.com:GPII/linux.git", + "main": "./index.js", + "engines": { "node" : ">=0.1.9" } +} From 5909117ee06f7019d99af10566a8aa8bc7ddde88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 18 Jan 2013 12:44:32 +0100 Subject: [PATCH 041/319] Setting startingProfile in user-settings.conf --- node_modules/orca/orcaSettingsHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index bc9711b..2994f4a 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -87,9 +87,10 @@ var userSettings = getJSONFromFile(orcaSettingsFile); var newProfile = createProfile(user); - var customizedProfile = addCustomSettings(settings, newProfile); + userSettings.profiles[user] = customizedProfile; + userSettings.general.startingProfile = [user, user]; fs.writeFileSync(orcaSettingsFile, JSON.stringify(userSettings, null, 4)); From 64d3cab2d72ec67cd397f4b74f9a3843008c7fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Sat, 19 Jan 2013 03:33:18 +0100 Subject: [PATCH 042/319] Use XDG_DATA_HOME if exists or use the default one see http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html --- node_modules/orca/orcaSettingsHandler.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 2994f4a..8fadd21 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -31,11 +31,9 @@ "keybindings": {} }; - var homeDir = process.env.HOME; - - var orcaSettingsFile = "".concat(homeDir, - '/', - '.local/share/orca/user-settings.conf'); + var HOME = process.env.HOME; + var XDG_DATA_HOME = process.env.XDG_DATA_HOME || HOME + "/.local/share"; + var orcaSettingsFile = XDG_DATA_HOME + "/orca/user-settings.conf"; fluid.registerNamespace("gpii.launch"); From 210fcb207ab2330c5ecdc477f93e0971ace076ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Sat, 19 Jan 2013 03:44:38 +0100 Subject: [PATCH 043/319] code-style: homogenizing the use of quotes --- node_modules/orca/orcaSettingsHandler.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 8fadd21..8f66c74 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -16,8 +16,8 @@ var fluid = require("universal"); var gpii = fluid.registerNamespace("gpii"); - var fs = require('fs'); - var spawn = require('child_process').spawn; + var fs = require("fs"); + var spawn = require("child_process").spawn; var ORCA_ARGS = ["--disable", "speech", "--disable", "braille", @@ -49,7 +49,7 @@ } function getJSONFromFile(file) { - return JSON.parse(fs.readFileSync(file, 'utf8')); + return JSON.parse(fs.readFileSync(file, "utf8")); } function createProfile(profile) { @@ -74,13 +74,13 @@ " has requested these following settings: ", settings); if (!fs.existsSync(orcaSettingsFile)) { - var orcaSpawn = spawn('orca', ORCA_ARGS); + var orcaSpawn = spawn("orca", ORCA_ARGS); while(!fs.existsSync(orcaSettingsFile)) { wait(500); }; - orcaSpawn.kill('SIGKILL'); + orcaSpawn.kill("SIGKILL"); }; var userSettings = getJSONFromFile(orcaSettingsFile); From 93c78e4623f232e84554fe22a999ee7a1d0cb89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 26 Feb 2013 13:58:38 +0100 Subject: [PATCH 044/319] Adding support for nested JSON objects --- node_modules/orca/orcaSettingsHandler.js | 50 ++++++++++++++---------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 8f66c74..9946cf9 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -19,18 +19,29 @@ var fs = require("fs"); var spawn = require("child_process").spawn; + // TODO: When FLUID-4852 is fixed, remove these definitions + var getParser = { + parser: { + parse: fluid.pathUtil.parseEL, + compose: fluid.pathUtil.composePath + }, + strategies: [fluid.model.defaultFetchStrategy] + }; + + var setParser = { + parser: { + parse: fluid.pathUtil.parseEL, + compose: fluid.pathUtil.composePath + }, + strategies: [fluid.model.defaultFetchStrategy, fluid.model.defaultCreatorStrategy] + }; + var ORCA_ARGS = ["--disable", "speech", "--disable", "braille", "--disable", "braille-monitor", "--disable", "main-window", "--disable", "splash-window"]; - var PROFILE_SKEL = { - "profile": ["Default", "default"], - "pronunciations": {}, - "keybindings": {} - }; - var HOME = process.env.HOME; var XDG_DATA_HOME = process.env.XDG_DATA_HOME || HOME + "/.local/share"; var orcaSettingsFile = XDG_DATA_HOME + "/orca/user-settings.conf"; @@ -39,7 +50,6 @@ gpii.orca = gpii.orca || {}; - function wait(millis) { var date = new Date(); var curDate = null; @@ -52,18 +62,6 @@ return JSON.parse(fs.readFileSync(file, "utf8")); } - function createProfile(profile) { - var string = JSON.stringify(PROFILE_SKEL) - return JSON.parse(string.replace(/[D|d]+efault/g, profile)); - } - - function addCustomSettings (settings, profile) { - for (var k in settings) { - profile[k] = settings[k]; - }; - return profile; - } - gpii.orca.set = function(settingsarray) { var app = fluid.copy(settingsarray); @@ -84,8 +82,18 @@ }; var userSettings = getJSONFromFile(orcaSettingsFile); - var newProfile = createProfile(user); - var customizedProfile = addCustomSettings(settings, newProfile); + var customizedProfile = fluid.copy(userSettings.general); + + // Apply settings + // + for (var k in settings) { + fluid.set(customizedProfile, k, settings[k], setParser); + } + // Set profile id + // + customizedProfile.profile = customizedProfile.activeProfile = + customizedProfile.startingProfile = + [user, user]; userSettings.profiles[user] = customizedProfile; userSettings.general.startingProfile = [user, user]; From b7b87d4833367cbf0d51d2d9333cdcdfc18d4b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 8 Mar 2013 11:47:41 +0100 Subject: [PATCH 045/319] Now we're restore settings properly --- node_modules/orca/orcaSettingsHandler.js | 69 +++++++++++++++++------- 1 file changed, 49 insertions(+), 20 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 9946cf9..b1426b1 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -61,15 +61,14 @@ function getJSONFromFile(file) { return JSON.parse(fs.readFileSync(file, "utf8")); } - + gpii.orca.set = function(settingsarray) { var app = fluid.copy(settingsarray); var settings = app["org.gnome.orca"][0].settings; - var user = app["org.gnome.orca"][0].options.user; - - fluid.log("orcaSettingsHandler: User ", user, - " has requested these following settings: ", settings); + var options = app["org.gnome.orca"][0].options; + var user = options.user; + var newSettingsResponse = {}; if (!fs.existsSync(orcaSettingsFile)) { var orcaSpawn = spawn("orca", ORCA_ARGS); @@ -82,26 +81,56 @@ }; var userSettings = getJSONFromFile(orcaSettingsFile); + var defaultProfiles = fluid.copy(userSettings.profiles); + var defaultStartingProfile = fluid.copy(userSettings.general.startingProfile); var customizedProfile = fluid.copy(userSettings.general); - // Apply settings - // - for (var k in settings) { - fluid.set(customizedProfile, k, settings[k], setParser); - } - // Set profile id - // - customizedProfile.profile = customizedProfile.activeProfile = - customizedProfile.startingProfile = - [user, user]; - - userSettings.profiles[user] = customizedProfile; - userSettings.general.startingProfile = [user, user]; + if ("profiles" in settings) { + // Then, we're running restoreSettings + // + userSettings.profiles = settings["profiles"]; + userSettings.general.startingProfile = settings["general.startingProfile"]; + } else { + // We're running setSettings + // + fluid.log("orcaSettingsHandler: User ", user, + " has requested these following settings: ", settings); + + // Apply settings + // + for (var k in settings) { + fluid.set(customizedProfile, k, settings[k], setParser); + } + + // Set profile id + // + customizedProfile.profile = customizedProfile.activeProfile = + customizedProfile.startingProfile = + [user, user]; + + userSettings.profiles[user] = customizedProfile; + userSettings.general.startingProfile = [user, user]; + }; - fs.writeFileSync(orcaSettingsFile, + // Write config file + // + fs.writeFileSync(orcaSettingsFile, JSON.stringify(userSettings, null, 4)); - return app; + newSettingsResponse = { + "profiles": { + "oldValue": defaultProfiles, + "newValue": userSettings.profiles + }, + "general.startingProfile": { + "oldValue": defaultStartingProfile, + "newValue": [user, user] + } + }; + + return { 'org.gnome.orca' : [{"options": options, + "settings": newSettingsResponse}] + }; } })(); From 8216b6c4c242880a9051e85822306cedf3516983 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Mon, 8 Apr 2013 22:35:33 -0400 Subject: [PATCH 046/319] GPII-8 Adding unit test for fix. --- .../gsettingsBridge/tests/gsettingsTests.js | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/node_modules/gsettingsBridge/tests/gsettingsTests.js index 857ee70..f47a684 100644 --- a/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -186,6 +186,24 @@ https://github.com/gpii/universal/LICENSE.txt ] } }; + + // http://issues.gpii.net/browse/GPII-8 + var gpii8 = { + request: { + "putreq": [ + { + settings: { + "double-setting-doesnt-exist": 3.1, + "boolean-setting": true, + "string-setting": "here i am" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set1" + } + } + ] + } + }; jqUnit.module("Gsettings Handler Tests"); @@ -252,4 +270,13 @@ https://github.com/gpii/universal/LICENSE.txt jqUnit.start(); }, 10); }); -}()); \ No newline at end of file + + gsettingsHandlerTests.asyncTest("GPII-8 Not core dumping on a non-existent key", function () { + setTimeout(function() { + var response = gpii.gsettings.set(gpii8.request); + jqUnit.assertEquals("Didn't core dump. ", true,true); + jqUnit.start(); + }, 10); + }); + +}()); From 1974513d48a9b7ed775d86e8a18f766057552967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 20 May 2013 21:55:48 +0200 Subject: [PATCH 047/319] GPII-78: USB Listener for Linux is unresponsive see JIRA: http://issues.gpii.net/browse/GPII-78 Removed the "partition number" restriction from the GPII's udev rule. --- usbDriveListener/80-gpii.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usbDriveListener/80-gpii.rules b/usbDriveListener/80-gpii.rules index 790cafd..d4d5289 100644 --- a/usbDriveListener/80-gpii.rules +++ b/usbDriveListener/80-gpii.rules @@ -1,2 +1,2 @@ -KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/usr/local/gpii/bin/trigger.sh 1 /dev/%k" -KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/usr/local/gpii/bin/trigger.sh 0 /dev/%k" +KERNEL=="sd[a-z]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/usr/local/gpii/bin/trigger.sh 1 /dev/%k" +KERNEL=="sd[a-z]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/usr/local/gpii/bin/trigger.sh 0 /dev/%k" From 55c520445b3003a8da391e2ab51e8c9d19fb7403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 20 Jun 2013 18:23:56 +0200 Subject: [PATCH 048/319] Using path.resolve to build paths --- node_modules/orca/orcaSettingsHandler.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index b1426b1..f5f6ec4 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -18,6 +18,7 @@ var gpii = fluid.registerNamespace("gpii"); var fs = require("fs"); var spawn = require("child_process").spawn; + var path = require("path"); // TODO: When FLUID-4852 is fixed, remove these definitions var getParser = { @@ -43,8 +44,8 @@ "--disable", "splash-window"]; var HOME = process.env.HOME; - var XDG_DATA_HOME = process.env.XDG_DATA_HOME || HOME + "/.local/share"; - var orcaSettingsFile = XDG_DATA_HOME + "/orca/user-settings.conf"; + var XDG_DATA_HOME = process.env.XDG_DATA_HOME || path.resolve(HOME, ".local/share"); + var orcaSettingsFile = path.resolve(XDG_DATA_HOME, "orca/user-settings.conf"); fluid.registerNamespace("gpii.launch"); From 86dc002be6637bea9d535f19b0a677943a3bd45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 20 Jun 2013 18:30:59 +0200 Subject: [PATCH 049/319] Using fluid.registerNamespace for setting gpii.orca --- node_modules/orca/orcaSettingsHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index f5f6ec4..762079e 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -49,7 +49,7 @@ fluid.registerNamespace("gpii.launch"); - gpii.orca = gpii.orca || {}; + gpii.orca = fluid.registerNamespace("gpii.orca"); function wait(millis) { var date = new Date(); From 5e147e36e257d037f2778acf06c897c89c20ab1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 21 Jun 2013 13:24:07 +0200 Subject: [PATCH 050/319] Code cleanup --- node_modules/orca/orcaSettingsHandler.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 762079e..2fcd66c 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -69,7 +69,6 @@ var settings = app["org.gnome.orca"][0].settings; var options = app["org.gnome.orca"][0].options; var user = options.user; - var newSettingsResponse = {}; if (!fs.existsSync(orcaSettingsFile)) { var orcaSpawn = spawn("orca", ORCA_ARGS); @@ -79,7 +78,7 @@ }; orcaSpawn.kill("SIGKILL"); - }; + } var userSettings = getJSONFromFile(orcaSettingsFile); var defaultProfiles = fluid.copy(userSettings.profiles); @@ -87,38 +86,28 @@ var customizedProfile = fluid.copy(userSettings.general); if ("profiles" in settings) { - // Then, we're running restoreSettings - // userSettings.profiles = settings["profiles"]; userSettings.general.startingProfile = settings["general.startingProfile"]; } else { - // We're running setSettings - // fluid.log("orcaSettingsHandler: User ", user, " has requested these following settings: ", settings); - // Apply settings - // for (var k in settings) { fluid.set(customizedProfile, k, settings[k], setParser); } - // Set profile id - // customizedProfile.profile = customizedProfile.activeProfile = customizedProfile.startingProfile = [user, user]; userSettings.profiles[user] = customizedProfile; userSettings.general.startingProfile = [user, user]; - }; + } - // Write config file - // fs.writeFileSync(orcaSettingsFile, JSON.stringify(userSettings, null, 4)); - newSettingsResponse = { + var newSettingsResponse = { "profiles": { "oldValue": defaultProfiles, "newValue": userSettings.profiles @@ -132,6 +121,6 @@ return { 'org.gnome.orca' : [{"options": options, "settings": newSettingsResponse}] }; - } + }; })(); From bdc078d09032c901ad1d7ebe8c833a77c8eb8795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 21 Jun 2013 14:17:23 +0200 Subject: [PATCH 051/319] Code cleanup --- node_modules/orca/orcaSettingsHandler.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 2fcd66c..6120e76 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -48,8 +48,7 @@ var orcaSettingsFile = path.resolve(XDG_DATA_HOME, "orca/user-settings.conf"); fluid.registerNamespace("gpii.launch"); - - gpii.orca = fluid.registerNamespace("gpii.orca"); + fluid.registerNamespace("gpii.orca"); function wait(millis) { var date = new Date(); From 015f6d827f436fd8b7637c6e35633d8633e9dc70 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Tue, 16 Jul 2013 20:49:48 +0200 Subject: [PATCH 052/319] GPII-20: integration tests sketching --- tests/integrationTesting.js | 363 ++++++++++++++++++ .../setup1/configs/development-config.json | 23 ++ 2 files changed, 386 insertions(+) create mode 100644 tests/integrationTesting.js create mode 100644 tests/integrationTests/setup1/configs/development-config.json diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js new file mode 100644 index 0000000..a682174 --- /dev/null +++ b/tests/integrationTesting.js @@ -0,0 +1,363 @@ +/*! + +Integration Testing + +Copyright 2013 Raising the Floor - International + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +/*global require */ + +// var integrationTestsJSON = { +// "sammy": { +// "initialState": [ +// { +// "type": "gpii.gsettings.get", +// "data": [ +// { +// "options": { +// "schema": "org.gnome.desktop.a11y.magnifier" +// }, +// "settings": { +// "mag-factor": 2.5, +// "mouse-tracking": "none", +// "show-cross-hairs": true +// } +// }, +// { +// "options": { +// "schema": "org.gnome.desktop.interface" +// }, +// "settings": { +// "text-scaling-factor": 1 +// } +// } +// ] +// } +// ], +// "loggedInState": [ +// { +// "type": "gpii.gsettings.get", +// "data": [ +// { +// "options": { +// "schema": "org.gnome.desktop.a11y.applications" +// }, +// "settings": { +// "screen-magnifier-enabled": true +// } +// }, +// { +// "options": { +// "schema": "org.gnome.desktop.a11y.magnifier" +// }, +// "settings": { +// "mag-factor": 2.0, +// "mouse-tracking": "centered", +// "show-cross-hairs": true +// } +// }, +// { +// "options": { +// "schema": "org.gnome.desktop.interface" +// }, +// "settings": { +// "text-scaling-factor": 2 +// } +// } +// ] +// } +// ] +// } + + + +var tests = [ + { + name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", + token: "MikelVargas", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "slowkeys-delay": { init: 100, expect: 400 }, + "slowkeys-enable": { init: false, expect: true }, + "bouncekeys-delay": { init: 100, expect: 200 }, + "mousekeys-enable": { init: false, expect: true }, + "stickykeys-enable": { init: false, expect: true }, + "bouncekeys-enable": { init: false, expect: true }, + "mousekeys-max-speed": { init: 250, expect: 850 }, + "mousekeys-init-delay": { init: 110, expect: 120 }, + "mousekeys-accel-time": { init: 300, expect: 800 }, + }, + "options": { + "schema": "org.gnome.desktop.a11y.keyboard" + } + }] + } + } + } +]; + +(function () { + "strict"; + + // This loads universal. + var fluid = require("universal"), + http = require("http"), + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("jqUnit"); + + //require("testFramework"); + require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); + //require("settingsHandlers"); + require("gsettingsBridge"); + var integrationTesting = gpii.tests.testEnvironment(); + + jqUnit.module("Integration Testing"); + + var currentTest = tests[0]; + + /* + * Sets the settings given in the json paramater. The content of the json passed + * is the values to set in a format similar to the content of 'initialState' + */ + var initSettings = function (handler, payload) { + payload = fluid.copy(payload); + + var initPayload = fluid.transform(payload, function (data) { + return fluid.transform(data, function (handlerEntry) { + var settings = handlerEntry.settings; + + var initSettingsBlock = fluid.transform(settings, function (setting) { + return setting.init; + }); + return { options: handlerEntry.options, settings: initSettingsBlock }; + }); + }); + + var gottentSettings = fluid.invokeGlobalFunction(handler+".set", [initPayload]); + console.log(JSON.stringify(gottentSettings)); + }; + + integrationTesting.asyncTest("Integration Tester", function () { + //set initial settings + initSettings("gpii.gsettings", currentTest.settingsHandlers["gpii.gsettings"]); + + //start up server + gpii.config.makeConfigLoader({ + "nodeEnv": "development-config", + "configPath": __dirname+"/integrationTests/setup1/configs" + }); + fluid.log("SERVER STARTED"); + + //log user in: + http.get({ + host: "localhost", + port: 8081, + path: "/user/"+currentTest.token+"/login" + }, function(response) { + var data = ""; + fluid.log("Callback from use login called"); + + response.on("data", function (chunk) { + fluid.log("Response from server: " + chunk); + data += chunk; + }); + response.on("close", function(err) { + if (err) { + jqUnit.assertFalse("Got an error on login: " + err.message, true); + jqUnit.start(); + } + fluid.log("Connection to the server was closed"); + }); + response.on("end", function() { + fluid.log("Connection to server ended"); + jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+currentTest.token+" was successfully logged in."), -1); + http.get({ + host: "localhost", + port: 8081, + path: "/user/"+currentTest.token+"/logout" + }); + jqUnit.start(); + }); + }).on('error', function(err) { + fluid.log("Got error: " + err.message); + jqUnit.start(); + }); + }); + // integrationTesting.test("Integration Tester", function () { + // fluid.log("Integration Testing started"); + // //start up server + // gpii.flowManager(); + + // //set initial settings: + + // gpii.config.makeConfigLoader({ + // nodeEnv: gpii.config.getNodeEnv("fm.ps.sr.dr.mm.os.development"), + // configPath: gpii.config.getConfigPath() || "../node_modules/universal/gpii/configs" + // }); + // }); + +// /* +// * Sets the settings given in the json paramater. The content of the json passed +// * is the values to set in a format similar to the content of 'initialState' +// */ +// var setSettings = function (json) { +// //go through each of the settings +// fluid.each(json, function (handlerBlock, handlerIndex) { +// var args = {}; +// args.setting = handlerBlock.data; +// var setter = handlerBlock.type.substr(0, handlerBlock.type.indexOf(".get"))+".set"; +// fluid.invokeGlobalFunction(setter, [args]); +// }); +// }; + +// /* +// * Checks the settings given in the json paramater. The content of the json passed +// * should contain the expected value, and they should be in the format of the contant +// * of 'initialState' +// */ +// var checkSettings = function (expected, description) { +// //go through each of the settings +// fluid.each(expected, function (handlerBlock, handlerIndex) { +// //first get the settings from the system +// var args = {}; +// args.checking = handlerBlock.data; +// var response = fluid.invokeGlobalFunction(handlerBlock.type, [args]); +// //check that these corresponds to the one we anted to set:s +// jqUnit.assertDeepEq("Settings should match: " + description, handlerBlock.data, response.checking); +// }); +// }; + +// var addRESTTest = function(token, action, onEnd) { +// //test login with token +// integrationTester.asyncTest("Test "+token+" "+action, function () { +// http.get({ +// host: "localhost", +// port: 8081, +// path: "/user/"+token+"/"+action +// }, function(response) { +// var data = ""; +// fluid.log("Callback from use "+action+" called"); + +// response.on("data", function (chunk) { +// fluid.log("Response from server: " + chunk); +// data += chunk; +// }); +// response.on("close", function(err) { +// if (err) { +// jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); +// jqUnit.start(); +// } +// fluid.log("Connection to the server was closed"); +// }); +// response.on("end", function() { +// fluid.log("Connection to server ended"); +// onEnd(data); +// }); +// }).on('error', function(err) { +// fluid.log("Got error: " + err.message); +// jqUnit.start(); +// }); +// }); +// }; + +// gpii.flowManager(); +// var tokenQueue = Object.keys(integrationTestsJSON); + +// var testNextToken = function() { +// if (tokenQueue.length === 0) { +// return; +// } + +// var token = tokenQueue.pop(); +// var json = integrationTestsJSON[token]; + +// //Setup and check an initial known state: +// //Made asynchronous due to qunit bug that doesn't allow synchronous tests +// integrationTester.asyncTest("Set up initial state", function() { +// setSettings(json.initialState); +// setTimeout(function() { +// checkSettings(json.initialState, token + " profile initial state"); +// jqUnit.start(); +// }, 1); +// }); + +// //test login: +// addRESTTest(token, "login", function (data) { +// jqUnit.assertNotEquals("Successful login message returned", data.indexOf("User was successfully logged in."), -1); +// setTimeout(function() { +// checkSettings(json.loggedInState, token + " logged in."); +// //test logout: +// addRESTTest(token, "logout", function (data) { +// jqUnit.assertNotEquals("Successful logout message returned", data.indexOf("successfully logged out."), -1); +// setTimeout(function() { +// checkSettings(json.initialState, token + " back to initial state"); +// //let the system know we're ready for another test: +// testNextToken(); +// jqUnit.start(); +// }, 1000); +// }); +// jqUnit.start(); +// }, 1000); +// }); +// }; + +// testNextToken(); +// }()); + // Integration test pseudo code: + // test A: { + // name: "Screenreader user on windows", + // config: "path.to.config.file", + // token: "", + // settingsHandlers: [{ + // type: "without get/set part", + // options: { options to pass the handler }, + // settings: { + // Setting1: { + // init: { "initial value" }, + // expect: { "assert value after login" } + // }, + // ..., + // SettingN: ... + // }, + // }], + // Processes: [{ + // checkRunning: { + // command: "...", + // grep: "..." + // } + // }] + // } + // } + // For each test TestX: + // For each settings handler SH in TestX + // For each setting listed in expected section of SH + // get the current value -> save + // On (All settings gathered) + // Start GPII + // On (GPII started) + // HTTP GET: localhost:8081/user//login + // On (on user logged in) + // For each settings handler SH in TestX + // For each setting listed in expected section of SH + // check that the setting = expected + // For each expected process + // Check running processes, compare to expected + // HTTP GET: localhost:8081/user//logout + // On (User logged out) + // For each settings handler SH in TestX + // For each setting listed in expected section of SH + // check that the setting = original setting + // For each expected process + // check it's not running + // Shut down GPII + // On (GPII shut down) + // send signal that next test can be launched +})(); \ No newline at end of file diff --git a/tests/integrationTests/setup1/configs/development-config.json b/tests/integrationTests/setup1/configs/development-config.json new file mode 100644 index 0000000..519fcd9 --- /dev/null +++ b/tests/integrationTests/setup1/configs/development-config.json @@ -0,0 +1,23 @@ +{ + "typeName": "flowManager.preferencesServer.solutionsRegistry.deviceReporter.matchMaker.ontologyServer.development", + "options": { + "gradeNames": ["autoInit", "fluid.littleComponent"], + "components": { + "server": { + "type": "gpii.server", + "options": { + "logging": true, + "port": 8081 + } + } + } + }, + "includes": [ + "../../../../../node_modules/universal/gpii/node_modules/deviceReporter/configs/development.json", + "../../../../../node_modules/universal/gpii/node_modules/flowManager/configs/development.json", + "../../../../../node_modules/universal/gpii/node_modules/matchMaker/configs/development.json", + "../../../../../node_modules/universal/gpii/node_modules/ontologyServer/configs/development.json", + "../../../../../node_modules/universal/gpii/node_modules/preferencesServer/configs/development.json", + "../../../../../node_modules/universal/gpii/node_modules/solutionsRegistry/configs/development.json" + ] +} \ No newline at end of file From c44b1e9bac3ad7f225986cd272af731e52ce60cf Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Wed, 17 Jul 2013 10:10:07 +0200 Subject: [PATCH 053/319] GPII-20: Simple test for MikelVargas now running... Currently only checks settings handlers --- tests/integrationTesting.js | 341 ++++++++---------------------------- 1 file changed, 76 insertions(+), 265 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index a682174..4c976bc 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -13,70 +13,6 @@ https://github.com/gpii/universal/LICENSE.txt /*global require */ -// var integrationTestsJSON = { -// "sammy": { -// "initialState": [ -// { -// "type": "gpii.gsettings.get", -// "data": [ -// { -// "options": { -// "schema": "org.gnome.desktop.a11y.magnifier" -// }, -// "settings": { -// "mag-factor": 2.5, -// "mouse-tracking": "none", -// "show-cross-hairs": true -// } -// }, -// { -// "options": { -// "schema": "org.gnome.desktop.interface" -// }, -// "settings": { -// "text-scaling-factor": 1 -// } -// } -// ] -// } -// ], -// "loggedInState": [ -// { -// "type": "gpii.gsettings.get", -// "data": [ -// { -// "options": { -// "schema": "org.gnome.desktop.a11y.applications" -// }, -// "settings": { -// "screen-magnifier-enabled": true -// } -// }, -// { -// "options": { -// "schema": "org.gnome.desktop.a11y.magnifier" -// }, -// "settings": { -// "mag-factor": 2.0, -// "mouse-tracking": "centered", -// "show-cross-hairs": true -// } -// }, -// { -// "options": { -// "schema": "org.gnome.desktop.interface" -// }, -// "settings": { -// "text-scaling-factor": 2 -// } -// } -// ] -// } -// ] -// } - - - var tests = [ { name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", @@ -115,55 +51,65 @@ var tests = [ //require("testFramework"); require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); - //require("settingsHandlers"); require("gsettingsBridge"); + var integrationTesting = gpii.tests.testEnvironment(); jqUnit.module("Integration Testing"); var currentTest = tests[0]; + var extractPayloads = function (test) { + var settingsHandlers = test.settingsHandlers; + var payloads = { + init: fluid.copy(settingsHandlers), + get: fluid.copy(settingsHandlers), + expect: fluid.copy(settingsHandlers) + }; + + fluid.each(settingsHandlers, function (handlerBlock, handlerID) { + fluid.each(handlerBlock, function (hbArray, hbHeader) { + fluid.each(hbArray, function (handlerEntry, index) { + var settings = handlerEntry.settings; + var initBlock = {}; + var getBlock = {}; + var expectBlock = {}; + + fluid.each(settings, function (val, key) { + initBlock[key] = val.init; + getBlock[key] = null; + expectBlock[key] = val.expect; + }); + + payloads.init[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: initBlock }; + payloads.get[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: getBlock }; + payloads.expect[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: expectBlock }; + }); + }); + }); + return payloads; + }; + /* * Sets the settings given in the json paramater. The content of the json passed * is the values to set in a format similar to the content of 'initialState' */ - var initSettings = function (handler, payload) { - payload = fluid.copy(payload); - - var initPayload = fluid.transform(payload, function (data) { - return fluid.transform(data, function (handlerEntry) { - var settings = handlerEntry.settings; - - var initSettingsBlock = fluid.transform(settings, function (setting) { - return setting.init; - }); - return { options: handlerEntry.options, settings: initSettingsBlock }; - }); + var callHandlers = function (payload, action) { + var ret = {}; + fluid.each(payload, function (handlerBlock, handlerID) { + ret[handlerID]=fluid.invokeGlobalFunction(handlerID+"."+action, [handlerBlock]); }); - - var gottentSettings = fluid.invokeGlobalFunction(handler+".set", [initPayload]); - console.log(JSON.stringify(gottentSettings)); + return ret; }; - integrationTesting.asyncTest("Integration Tester", function () { - //set initial settings - initSettings("gpii.gsettings", currentTest.settingsHandlers["gpii.gsettings"]); - - //start up server - gpii.config.makeConfigLoader({ - "nodeEnv": "development-config", - "configPath": __dirname+"/integrationTests/setup1/configs" - }); - fluid.log("SERVER STARTED"); - - //log user in: + var addRESTTest = function(token, action, onEnd) { http.get({ host: "localhost", port: 8081, - path: "/user/"+currentTest.token+"/login" + path: "/user/"+token+"/"+action }, function(response) { var data = ""; - fluid.log("Callback from use login called"); + fluid.log("Callback from "+action+" called"); response.on("data", function (chunk) { fluid.log("Response from server: " + chunk); @@ -171,193 +117,58 @@ var tests = [ }); response.on("close", function(err) { if (err) { - jqUnit.assertFalse("Got an error on login: " + err.message, true); + jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); jqUnit.start(); } fluid.log("Connection to the server was closed"); }); response.on("end", function() { fluid.log("Connection to server ended"); - jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+currentTest.token+" was successfully logged in."), -1); - http.get({ - host: "localhost", - port: 8081, - path: "/user/"+currentTest.token+"/logout" - }); - jqUnit.start(); + onEnd(data); }); }).on('error', function(err) { fluid.log("Got error: " + err.message); jqUnit.start(); }); - }); - // integrationTesting.test("Integration Tester", function () { - // fluid.log("Integration Testing started"); - // //start up server - // gpii.flowManager(); - - // //set initial settings: - - // gpii.config.makeConfigLoader({ - // nodeEnv: gpii.config.getNodeEnv("fm.ps.sr.dr.mm.os.development"), - // configPath: gpii.config.getConfigPath() || "../node_modules/universal/gpii/configs" - // }); - // }); - -// /* -// * Sets the settings given in the json paramater. The content of the json passed -// * is the values to set in a format similar to the content of 'initialState' -// */ -// var setSettings = function (json) { -// //go through each of the settings -// fluid.each(json, function (handlerBlock, handlerIndex) { -// var args = {}; -// args.setting = handlerBlock.data; -// var setter = handlerBlock.type.substr(0, handlerBlock.type.indexOf(".get"))+".set"; -// fluid.invokeGlobalFunction(setter, [args]); -// }); -// }; - -// /* -// * Checks the settings given in the json paramater. The content of the json passed -// * should contain the expected value, and they should be in the format of the contant -// * of 'initialState' -// */ -// var checkSettings = function (expected, description) { -// //go through each of the settings -// fluid.each(expected, function (handlerBlock, handlerIndex) { -// //first get the settings from the system -// var args = {}; -// args.checking = handlerBlock.data; -// var response = fluid.invokeGlobalFunction(handlerBlock.type, [args]); -// //check that these corresponds to the one we anted to set:s -// jqUnit.assertDeepEq("Settings should match: " + description, handlerBlock.data, response.checking); -// }); -// }; + }; + + integrationTesting.asyncTest("Integration Tester", function () { + //extract the payloads we need from test: + var payloads = extractPayloads(currentTest); -// var addRESTTest = function(token, action, onEnd) { -// //test login with token -// integrationTester.asyncTest("Test "+token+" "+action, function () { -// http.get({ -// host: "localhost", -// port: 8081, -// path: "/user/"+token+"/"+action -// }, function(response) { -// var data = ""; -// fluid.log("Callback from use "+action+" called"); + //set initial settings + callHandlers(payloads.init, "set"); + //and check that they are properly set + var returned = callHandlers(payloads.get, "get"); + jqUnit.assertDeepEq("Checking that initial settings are properly set", returned, payloads.init); -// response.on("data", function (chunk) { -// fluid.log("Response from server: " + chunk); -// data += chunk; -// }); -// response.on("close", function(err) { -// if (err) { -// jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); -// jqUnit.start(); -// } -// fluid.log("Connection to the server was closed"); -// }); -// response.on("end", function() { -// fluid.log("Connection to server ended"); -// onEnd(data); -// }); -// }).on('error', function(err) { -// fluid.log("Got error: " + err.message); -// jqUnit.start(); -// }); -// }); -// }; + //start up server + var currentGpii = gpii.config.makeConfigLoader({ + "nodeEnv": "development-config", + "configPath": __dirname+"/integrationTests/setup1/configs" + }); + fluid.log("SERVER STARTED"); -// gpii.flowManager(); -// var tokenQueue = Object.keys(integrationTestsJSON); - -// var testNextToken = function() { -// if (tokenQueue.length === 0) { -// return; -// } + currentGpii.server.flowManager.lifecycleManager.events.configurationApplied.addListener(function () { + var returned = callHandlers(payloads.get, "get"); + jqUnit.assertDeepEq("Checking that settings are properly set", returned, payloads.expect); + //log out + addRESTTest(currentTest.token, "logout", function(data) { + jqUnit.assertNotEquals("Successful logout message returned", data.indexOf("successfully logged out."), -1); + console.log("So far, so good"); + jqUnit.start(); + }); + }); -// var token = tokenQueue.pop(); -// var json = integrationTestsJSON[token]; + currentGpii.server.flowManager.lifecycleManager.events.configurationRemoved.addListener(function () { + var returned = callHandlers(payloads.get, "get"); + jqUnit.assertDeepEq("Checking that settings are properly restored", returned, payloads.init); + }); -// //Setup and check an initial known state: -// //Made asynchronous due to qunit bug that doesn't allow synchronous tests -// integrationTester.asyncTest("Set up initial state", function() { -// setSettings(json.initialState); -// setTimeout(function() { -// checkSettings(json.initialState, token + " profile initial state"); -// jqUnit.start(); -// }, 1); -// }); + addRESTTest(currentTest.token, "login", function (data) { + jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); + }); -// //test login: -// addRESTTest(token, "login", function (data) { -// jqUnit.assertNotEquals("Successful login message returned", data.indexOf("User was successfully logged in."), -1); -// setTimeout(function() { -// checkSettings(json.loggedInState, token + " logged in."); -// //test logout: -// addRESTTest(token, "logout", function (data) { -// jqUnit.assertNotEquals("Successful logout message returned", data.indexOf("successfully logged out."), -1); -// setTimeout(function() { -// checkSettings(json.initialState, token + " back to initial state"); -// //let the system know we're ready for another test: -// testNextToken(); -// jqUnit.start(); -// }, 1000); -// }); -// jqUnit.start(); -// }, 1000); -// }); -// }; + }); -// testNextToken(); -// }()); - // Integration test pseudo code: - // test A: { - // name: "Screenreader user on windows", - // config: "path.to.config.file", - // token: "", - // settingsHandlers: [{ - // type: "without get/set part", - // options: { options to pass the handler }, - // settings: { - // Setting1: { - // init: { "initial value" }, - // expect: { "assert value after login" } - // }, - // ..., - // SettingN: ... - // }, - // }], - // Processes: [{ - // checkRunning: { - // command: "...", - // grep: "..." - // } - // }] - // } - // } - // For each test TestX: - // For each settings handler SH in TestX - // For each setting listed in expected section of SH - // get the current value -> save - // On (All settings gathered) - // Start GPII - // On (GPII started) - // HTTP GET: localhost:8081/user//login - // On (on user logged in) - // For each settings handler SH in TestX - // For each setting listed in expected section of SH - // check that the setting = expected - // For each expected process - // Check running processes, compare to expected - // HTTP GET: localhost:8081/user//logout - // On (User logged out) - // For each settings handler SH in TestX - // For each setting listed in expected section of SH - // check that the setting = original setting - // For each expected process - // check it's not running - // Shut down GPII - // On (GPII shut down) - // send signal that next test can be launched })(); \ No newline at end of file From 9040434c1cc634f8f91b9e86dc12f9b340de2044 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Wed, 17 Jul 2013 10:25:35 +0200 Subject: [PATCH 054/319] GPII-20: Small steps toward checking processes --- tests/integrationTesting.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index 4c976bc..840aff7 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -36,7 +36,13 @@ var tests = [ } }] } - } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", + expect: "true" + } + ]; } ]; @@ -102,6 +108,12 @@ var tests = [ return ret; }; + var checkProcesses = function (payload, expectProcess) { + fluid.each(payload, function (processBlock, index) { + + }); + }; + var addRESTTest = function(token, action, onEnd) { http.get({ host: "localhost", From fdfe301c91997d541814066685023ccfa6e64a06 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Wed, 17 Jul 2013 16:57:03 +0200 Subject: [PATCH 055/319] GPII-20: moving towards IOC using infusion --- tests/integrationTesting.js | 346 ++++++++++++++++++++---------------- 1 file changed, 191 insertions(+), 155 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index 840aff7..6b4ce3b 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -11,176 +11,212 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ -/*global require */ - -var tests = [ - { - name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", - token: "MikelVargas", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "slowkeys-delay": { init: 100, expect: 400 }, - "slowkeys-enable": { init: false, expect: true }, - "bouncekeys-delay": { init: 100, expect: 200 }, - "mousekeys-enable": { init: false, expect: true }, - "stickykeys-enable": { init: false, expect: true }, - "bouncekeys-enable": { init: false, expect: true }, - "mousekeys-max-speed": { init: 250, expect: 850 }, - "mousekeys-init-delay": { init: 110, expect: 120 }, - "mousekeys-accel-time": { init: 300, expect: 800 }, - }, - "options": { - "schema": "org.gnome.desktop.a11y.keyboard" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", - expect: "true" - } - ]; - } -]; +/*global require, console */ + +// var tests = [ +// { +// name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", +// token: "MikelVargas", +// settingsHandlers: { +// "gpii.gsettings": { +// "data": [{ +// "settings": { +// "slowkeys-delay": { init: 100, expect: 400 }, +// "slowkeys-enable": { init: false, expect: true }, +// "bouncekeys-delay": { init: 100, expect: 200 }, +// "mousekeys-enable": { init: false, expect: true }, +// "stickykeys-enable": { init: false, expect: true }, +// "bouncekeys-enable": { init: false, expect: true }, +// "mousekeys-max-speed": { init: 250, expect: 850 }, +// "mousekeys-init-delay": { init: 110, expect: 120 }, +// "mousekeys-accel-time": { init: 300, expect: 800 }, +// }, +// "options": { +// "schema": "org.gnome.desktop.a11y.keyboard" +// } +// }] +// } +// }, +// processes: [ +// { +// command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", +// expect: "true" +// } +// ] +// } +// ]; (function () { - "strict"; + "use strict"; // This loads universal. var fluid = require("universal"), - http = require("http"), - gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("jqUnit"); + //http = require("http"), + gpii = fluid.registerNamespace("gpii"); + //jqUnit = fluid.require("jqUnit"); //require("testFramework"); require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); require("gsettingsBridge"); - var integrationTesting = gpii.tests.testEnvironment(); + fluid.defaults("gpii.integrationTesting.testEnv", { + gradeNames: ["fluid.test.testEnvironment", "autoInit"], + components: { + // gpiiServer: { + // type: "gpii.server" + // }, + integrationTests: { + type: "gpii.integrationTesting.integrationTests" + } + } + }); - jqUnit.module("Integration Testing"); - - var currentTest = tests[0]; - - var extractPayloads = function (test) { - var settingsHandlers = test.settingsHandlers; - var payloads = { - init: fluid.copy(settingsHandlers), - get: fluid.copy(settingsHandlers), - expect: fluid.copy(settingsHandlers) - }; - - fluid.each(settingsHandlers, function (handlerBlock, handlerID) { - fluid.each(handlerBlock, function (hbArray, hbHeader) { - fluid.each(hbArray, function (handlerEntry, index) { - var settings = handlerEntry.settings; - var initBlock = {}; - var getBlock = {}; - var expectBlock = {}; - - fluid.each(settings, function (val, key) { - initBlock[key] = val.init; - getBlock[key] = null; - expectBlock[key] = val.expect; - }); - - payloads.init[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: initBlock }; - payloads.get[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: getBlock }; - payloads.expect[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: expectBlock }; - }); - }); - }); - return payloads; - }; + fluid.defaults("gpii.integrationTesting.integrationTests", { + gradeNames: ["fluid.test.testCaseHolder", "autoInit"], + testCases: [ { + name: "Full configuration process", + tests: [{ + name: "Config process", + expect: 1, + sequence: [ { + func: "gpii.integrationTesting.initSettings", + args: [ "{integrationTests}"] + } + ] + } + ] + }] + }); - /* - * Sets the settings given in the json paramater. The content of the json passed - * is the values to set in a format similar to the content of 'initialState' - */ - var callHandlers = function (payload, action) { - var ret = {}; - fluid.each(payload, function (handlerBlock, handlerID) { - ret[handlerID]=fluid.invokeGlobalFunction(handlerID+"."+action, [handlerBlock]); - }); - return ret; - }; + gpii.integrationTesting.initSettings = function (a, b) { + console.log(a); + console.log(b); - var checkProcesses = function (payload, expectProcess) { - fluid.each(payload, function (processBlock, index) { - - }); }; - var addRESTTest = function(token, action, onEnd) { - http.get({ - host: "localhost", - port: 8081, - path: "/user/"+token+"/"+action - }, function(response) { - var data = ""; - fluid.log("Callback from "+action+" called"); - - response.on("data", function (chunk) { - fluid.log("Response from server: " + chunk); - data += chunk; - }); - response.on("close", function(err) { - if (err) { - jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); - jqUnit.start(); - } - fluid.log("Connection to the server was closed"); - }); - response.on("end", function() { - fluid.log("Connection to server ended"); - onEnd(data); - }); - }).on('error', function(err) { - fluid.log("Got error: " + err.message); - jqUnit.start(); - }); - }; - - integrationTesting.asyncTest("Integration Tester", function () { - //extract the payloads we need from test: - var payloads = extractPayloads(currentTest); - - //set initial settings - callHandlers(payloads.init, "set"); - //and check that they are properly set - var returned = callHandlers(payloads.get, "get"); - jqUnit.assertDeepEq("Checking that initial settings are properly set", returned, payloads.init); - - //start up server - var currentGpii = gpii.config.makeConfigLoader({ - "nodeEnv": "development-config", - "configPath": __dirname+"/integrationTests/setup1/configs" - }); - fluid.log("SERVER STARTED"); - - currentGpii.server.flowManager.lifecycleManager.events.configurationApplied.addListener(function () { - var returned = callHandlers(payloads.get, "get"); - jqUnit.assertDeepEq("Checking that settings are properly set", returned, payloads.expect); - //log out - addRESTTest(currentTest.token, "logout", function(data) { - jqUnit.assertNotEquals("Successful logout message returned", data.indexOf("successfully logged out."), -1); - console.log("So far, so good"); - jqUnit.start(); - }); - }); - - currentGpii.server.flowManager.lifecycleManager.events.configurationRemoved.addListener(function () { - var returned = callHandlers(payloads.get, "get"); - jqUnit.assertDeepEq("Checking that settings are properly restored", returned, payloads.init); - }); - - addRESTTest(currentTest.token, "login", function (data) { - jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); - }); - }); + // var integrationTesting = gpii.tests.testEnvironment(); + + // jqUnit.module("Integration Testing"); + + // var currentTest = tests[0]; + + // var extractPayloads = function (test) { + // var settingsHandlers = test.settingsHandlers; + // var payloads = { + // init: fluid.copy(settingsHandlers), + // get: fluid.copy(settingsHandlers), + // expect: fluid.copy(settingsHandlers) + // }; + + // fluid.each(settingsHandlers, function (handlerBlock, handlerID) { + // fluid.each(handlerBlock, function (hbArray, hbHeader) { + // fluid.each(hbArray, function (handlerEntry, index) { + // var settings = handlerEntry.settings; + // var initBlock = {}; + // var getBlock = {}; + // var expectBlock = {}; + + // fluid.each(settings, function (val, key) { + // initBlock[key] = val.init; + // getBlock[key] = null; + // expectBlock[key] = val.expect; + // }); + + // payloads.init[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: initBlock }; + // payloads.get[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: getBlock }; + // payloads.expect[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: expectBlock }; + // }); + // }); + // }); + // return payloads; + // }; + + // /* + // * Sets the settings given in the json paramater. The content of the json passed + // * is the values to set in a format similar to the content of 'initialState' + // */ + // var callHandlers = function (payload, action) { + // var ret = {}; + // fluid.each(payload, function (handlerBlock, handlerID) { + // ret[handlerID]=fluid.invokeGlobalFunction(handlerID+"."+action, [handlerBlock]); + // }); + // return ret; + // }; + + // var checkProcesses = function (payload, expectProcess) { + // fluid.each(payload, function (processBlock, index) { + + // }); + // }; + + // var addRESTTest = function(token, action, onEnd) { + // http.get({ + // host: "localhost", + // port: 8081, + // path: "/user/"+token+"/"+action + // }, function(response) { + // var data = ""; + // fluid.log("Callback from "+action+" called"); + + // response.on("data", function (chunk) { + // fluid.log("Response from server: " + chunk); + // data += chunk; + // }); + // response.on("close", function(err) { + // if (err) { + // jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); + // jqUnit.start(); + // } + // fluid.log("Connection to the server was closed"); + // }); + // response.on("end", function() { + // fluid.log("Connection to server ended"); + // onEnd(data); + // }); + // }).on('error', function(err) { + // fluid.log("Got error: " + err.message); + // jqUnit.start(); + // }); + // }; + + // integrationTesting.asyncTest("Integration Tester", function () { + // //extract the payloads we need from test: + // var payloads = extractPayloads(currentTest); + + // //set initial settings + // callHandlers(payloads.init, "set"); + // //and check that they are properly set + // var returned = callHandlers(payloads.get, "get"); + // jqUnit.assertDeepEq("Checking that initial settings are properly set", returned, payloads.init); + + // //start up server + // var currentGpii = gpii.config.makeConfigLoader({ + // "nodeEnv": "development-config", + // "configPath": __dirname+"/integrationTests/setup1/configs" + // }); + // fluid.log("SERVER STARTED"); + + // currentGpii.server.flowManager.lifecycleManager.events.configurationApplied.addListener(function () { + // var returned = callHandlers(payloads.get, "get"); + // jqUnit.assertDeepEq("Checking that settings are properly set", returned, payloads.expect); + // //log out + // addRESTTest(currentTest.token, "logout", function(data) { + // jqUnit.assertNotEquals("Successful logout message returned", data.indexOf("successfully logged out."), -1); + // console.log("So far, so good"); + // jqUnit.start(); + // }); + // }); + + // currentGpii.server.flowManager.lifecycleManager.events.configurationRemoved.addListener(function () { + // var returned = callHandlers(payloads.get, "get"); + // jqUnit.assertDeepEq("Checking that settings are properly restored", returned, payloads.init); + // }); + + // addRESTTest(currentTest.token, "login", function (data) { + // jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); + // }); + + // }); })(); \ No newline at end of file From 409612047dac1d79393430b802fa713ca9b48949 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Thu, 18 Jul 2013 22:21:28 +0200 Subject: [PATCH 056/319] GPII-20: Sketch for moving stuff to IOC framework.. pushing for questions to antranig --- tests/integrationTesting2.js | 157 +++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 tests/integrationTesting2.js diff --git a/tests/integrationTesting2.js b/tests/integrationTesting2.js new file mode 100644 index 0000000..f0c9030 --- /dev/null +++ b/tests/integrationTesting2.js @@ -0,0 +1,157 @@ +/* + +GPII Integration Testing + +Copyright 2013 Raising the Floor International + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt + +*/ + +var testDefs = [ + { + name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "MikelVargas", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "slowkeys-delay": 400, + "slowkeys-enable": true, + "bouncekeys-delay": 200, + "mousekeys-enable": true, + "stickykeys-enable": true, + "bouncekeys-enable": true, + "mousekeys-max-speed": 850, + "mousekeys-init-delay": 120, + "mousekeys-accel-time": 800 + }, + "options": { + "schema": "org.gnome.desktop.a11y.keyboard" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", + expect: "true" + } + ] + } +]; + +(function () { + "use strict"; + var fluid = require("universal"), + http = require("http"), + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("jqUnit"); + + require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); + require("gsettingsBridge"); + /** Testing environment - holds both fixtures as well as components under test, exposes global test driver **/ + + fluid.registerNamespace("gpii.integrationTesting"); + + fluid.registerNamespace("fluid.tests"); + + fluid.defaults("gpii.integrationTesting.testEnv", { + gradeNames: ["fluid.test.testEnvironment", "autoInit"], + components: { + gpiiServer: { + type: "gpii.server" + }, + integrationTests: { + type: "gpii.integrationTesting.tests" + } + } + }); + + /** Test Case Holder - holds declarative representation of test cases **/ + + fluid.defaults("gpii.integrationTesting.tests", { + gradeNames: ["fluid.test.testCaseHolder", "autoInit"], + testDefs: testDefs[0], + gpii: null, + settingsStore: {}, + modules: [ /* declarative specification of tests */ { + name: "Cat test case", + tests: [ + { + name: "Config process", + expect: 1, + sequence: [ { + func: "gpii.integrationTesting.initSettings", + args: [ "{integrationTests}.options.testDefs", "{integrationTests}.options.settingsStore" ] + }, { + func: "gpii.integrationTesting.login", + args: [ "{integrationTests}.options.testDefs" ] + } + ] + }] + }] + }); + + gpii.integrationTesting.tests.preInit = function (that) { + that.options.gpii = gpii.config.makeConfigLoader(that.options.testDefs.gpiiConfig); + }; + + gpii.integrationTesting.login = function (testDef) { + http.get({ + host: "localhost", + port: 8081, + path: "/user/"+testDef.token+"/login" + }, function(response) { + var data = ""; + + response.on("data", function (chunk) { + data += chunk; + }); + response.on("close", function(err) { + if (err) { + jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); + // jqUnit.start(); + } + fluid.log("Connection to the server was closed"); + }); + response.on("end", function() { + jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); + }); + }).on('error', function(err) { + fluid.log("Got error: " + err.message); + }); + }; + + /* + * Sets the settings given in the json paramater. The content of the json passed + * is the values to set in a format similar to the content of 'initialState' + */ + gpii.integrationTesting.getSettings = function (payload) { + var ret = {}; + fluid.each(payload, function (handlerBlock, handlerID) { + ret[handlerID]=fluid.invokeGlobalFunction(handlerID+".get", [handlerBlock]); + }); + return ret; + }; + + gpii.integrationTesting.initSettings = function (testDef, settingsStore) { + settingsStore.orig = gpii.integrationTesting.getSettings(testDef.settingsHandlers); + }; + + fluid.tests.testTests = function () { + fluid.test.runTests([ + "gpii.integrationTesting.testEnv" + ]); + }; + + fluid.tests.testTests(); +})(); \ No newline at end of file From c2c9a96cc61bf03657677c439787e21c2e6ef461 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Mon, 22 Jul 2013 19:57:36 +0200 Subject: [PATCH 057/319] GPII-20: stuck on an issue with listeners and events --- tests/integrationTesting.js | 15 ++++--- tests/integrationTesting2.js | 86 +++++++++++++++++++++++------------- 2 files changed, 65 insertions(+), 36 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index 6b4ce3b..fe64c62 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -52,8 +52,8 @@ https://github.com/gpii/universal/LICENSE.txt // This loads universal. var fluid = require("universal"), //http = require("http"), - gpii = fluid.registerNamespace("gpii"); - //jqUnit = fluid.require("jqUnit"); + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("jqUnit"); //require("testFramework"); require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); @@ -73,14 +73,14 @@ https://github.com/gpii/universal/LICENSE.txt fluid.defaults("gpii.integrationTesting.integrationTests", { gradeNames: ["fluid.test.testCaseHolder", "autoInit"], - testCases: [ { + components: [ { name: "Full configuration process", tests: [{ name: "Config process", expect: 1, sequence: [ { func: "gpii.integrationTesting.initSettings", - args: [ "{integrationTests}"] + args: [ ""] } ] } @@ -88,12 +88,15 @@ https://github.com/gpii/universal/LICENSE.txt }] }); - gpii.integrationTesting.initSettings = function (a, b) { - console.log(a); + gpii.integrationTesting.initSettings = function () { + //sconsole.log(a); console.log(b); }; + fluid.test.runTests([ + "gpii.integrationTesting.testEnv" + ]); // var integrationTesting = gpii.tests.testEnvironment(); diff --git a/tests/integrationTesting2.js b/tests/integrationTesting2.js index f0c9030..eb6f477 100644 --- a/tests/integrationTesting2.js +++ b/tests/integrationTesting2.js @@ -64,11 +64,54 @@ var testDefs = [ fluid.registerNamespace("fluid.tests"); + + fluid.defaults("gpii.integrationTesting.httpReq", { + gradeNames: ["fluid.littleComponent", "autoInit"], + postInitFunction: "gpii.integrationTesting.httpReq.postInit", + events: { + onLogin: null, + onLogout: null + } + }); + + + gpii.integrationTesting.httpReq.postInit = function (that) { + that.login = function (token) { + that.call(token, "login", that.events.onLogin.fire); + } + + that.call = function (token, action, callback) { + http.get({ + host: "localhost", + port: 8081, + path: "/user/"+token+"/"+action + }, function(response) { + var data = ""; + + response.on("data", function (chunk) { + data += chunk; + }); + response.on("close", function(err) { + if (err) { + jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); + // jqUnit.start(); + } + fluid.log("Connection to the server was closed"); + }); + response.on("end", function() { + callback(data) + }); + }).on('error', function(err) { + jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); + }); + }; + }; + fluid.defaults("gpii.integrationTesting.testEnv", { gradeNames: ["fluid.test.testEnvironment", "autoInit"], components: { - gpiiServer: { - type: "gpii.server" + httpReq: { + type: "gpii.integrationTesting.httpReq" }, integrationTests: { type: "gpii.integrationTesting.tests" @@ -88,13 +131,16 @@ var testDefs = [ tests: [ { name: "Config process", - expect: 1, + expect: 2, sequence: [ { func: "gpii.integrationTesting.initSettings", args: [ "{integrationTests}.options.testDefs", "{integrationTests}.options.settingsStore" ] }, { func: "gpii.integrationTesting.login", - args: [ "{integrationTests}.options.testDefs" ] + args: [ "{httpReq}", "{integrationTests}.options.testDefs.token" ] + }, { + listener: "gpii.integrationTesting.loginListen", + event: "{httpReq}.events.onLogin" } ] }] @@ -105,31 +151,6 @@ var testDefs = [ that.options.gpii = gpii.config.makeConfigLoader(that.options.testDefs.gpiiConfig); }; - gpii.integrationTesting.login = function (testDef) { - http.get({ - host: "localhost", - port: 8081, - path: "/user/"+testDef.token+"/login" - }, function(response) { - var data = ""; - - response.on("data", function (chunk) { - data += chunk; - }); - response.on("close", function(err) { - if (err) { - jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); - // jqUnit.start(); - } - fluid.log("Connection to the server was closed"); - }); - response.on("end", function() { - jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); - }); - }).on('error', function(err) { - fluid.log("Got error: " + err.message); - }); - }; /* * Sets the settings given in the json paramater. The content of the json passed @@ -146,7 +167,12 @@ var testDefs = [ gpii.integrationTesting.initSettings = function (testDef, settingsStore) { settingsStore.orig = gpii.integrationTesting.getSettings(testDef.settingsHandlers); }; - + gpii.integrationTesting.login = function (httpReq, token) { + httpReq.login(token); + } + gpii.integrationTesting.loginListen = function (data) { + jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); + } fluid.tests.testTests = function () { fluid.test.runTests([ "gpii.integrationTesting.testEnv" From bd1e3975cd7cf3d2c423535f6857b1ae74eda9c5 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Mon, 22 Jul 2013 23:34:21 +0200 Subject: [PATCH 058/319] GPII-20: First pass at a working single test --- tests/integrationTesting2.js | 58 ++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/tests/integrationTesting2.js b/tests/integrationTesting2.js index eb6f477..c2ca128 100644 --- a/tests/integrationTesting2.js +++ b/tests/integrationTesting2.js @@ -58,7 +58,6 @@ var testDefs = [ require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); require("gsettingsBridge"); - /** Testing environment - holds both fixtures as well as components under test, exposes global test driver **/ fluid.registerNamespace("gpii.integrationTesting"); @@ -66,8 +65,7 @@ var testDefs = [ fluid.defaults("gpii.integrationTesting.httpReq", { - gradeNames: ["fluid.littleComponent", "autoInit"], - postInitFunction: "gpii.integrationTesting.httpReq.postInit", + gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], events: { onLogin: null, onLogout: null @@ -75,11 +73,13 @@ var testDefs = [ }); - gpii.integrationTesting.httpReq.postInit = function (that) { + gpii.integrationTesting.httpReq.preInit = function (that) { that.login = function (token) { that.call(token, "login", that.events.onLogin.fire); } - + that.logout = function (token) { + that.call(token, "logout", that.events.onLogout.fire); + } that.call = function (token, action, callback) { http.get({ host: "localhost", @@ -99,7 +99,7 @@ var testDefs = [ fluid.log("Connection to the server was closed"); }); response.on("end", function() { - callback(data) + callback(data, token); }); }).on('error', function(err) { jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); @@ -119,28 +119,38 @@ var testDefs = [ } }); - /** Test Case Holder - holds declarative representation of test cases **/ - fluid.defaults("gpii.integrationTesting.tests", { gradeNames: ["fluid.test.testCaseHolder", "autoInit"], testDefs: testDefs[0], gpii: null, settingsStore: {}, - modules: [ /* declarative specification of tests */ { - name: "Cat test case", + modules: [ { + name: "Full login/logout cycle", tests: [ { name: "Config process", - expect: 2, + expect: 4, sequence: [ { func: "gpii.integrationTesting.initSettings", args: [ "{integrationTests}.options.testDefs", "{integrationTests}.options.settingsStore" ] }, { - func: "gpii.integrationTesting.login", - args: [ "{httpReq}", "{integrationTests}.options.testDefs.token" ] + func: "{httpReq}.login", + args: [ "{integrationTests}.options.testDefs.token" ] }, { - listener: "gpii.integrationTesting.loginListen", + listener: "gpii.integrationTesting.loginRequestListen", event: "{httpReq}.events.onLogin" + }, { + func: "gpii.integrationTesting.checkConfiguration", + args: [ "{integrationTests}.options.testDefs"] + }, { + func: "{httpReq}.logout", + args: [ "{integrationTests}.options.testDefs.token" ] + }, { + listener: "gpii.integrationTesting.logoutRequestListen", + event: "{httpReq}.events.onLogout" + }, { + func: "gpii.integrationTesting.checkResetConfiguration", + args: [ "{integrationTests}.options.testDefs", "{integrationTests}.options.settingsStore"] } ] }] @@ -167,12 +177,22 @@ var testDefs = [ gpii.integrationTesting.initSettings = function (testDef, settingsStore) { settingsStore.orig = gpii.integrationTesting.getSettings(testDef.settingsHandlers); }; - gpii.integrationTesting.login = function (httpReq, token) { - httpReq.login(token); - } - gpii.integrationTesting.loginListen = function (data) { + gpii.integrationTesting.loginRequestListen = function (data, token) { jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); - } + }; + gpii.integrationTesting.checkConfiguration = function (testDef) { + var config = gpii.integrationTesting.getSettings(testDef.settingsHandlers); + jqUnit.assertDeepEq("Checking that settings are set", config, testDef.settingsHandlers); + //TODO check processes + }; + gpii.integrationTesting.logoutRequestListen = function (data, token) { + jqUnit.assertNotEquals("Successful logout message returned "+data, data.indexOf("User with token "+token+" was successfully logged out."), -1); + }; + gpii.integrationTesting.checkResetConfiguration = function (testDef, settingsStore) { + var currentSettings = gpii.integrationTesting.getSettings(testDef.settingsHandlers); + jqUnit.assertDeepEq("Checking that settings are properly reset", currentSettings, settingsStore.orig); + //TODO check processes + }; fluid.tests.testTests = function () { fluid.test.runTests([ "gpii.integrationTesting.testEnv" From 08be5e5b39c30520e4cf7110703a449ee0024a7f Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Tue, 23 Jul 2013 01:13:28 +0200 Subject: [PATCH 059/319] GPII-20: Now checking processes as well --- tests/integrationTesting2.js | 43 +++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/tests/integrationTesting2.js b/tests/integrationTesting2.js index c2ca128..391bbd4 100644 --- a/tests/integrationTesting2.js +++ b/tests/integrationTesting2.js @@ -54,7 +54,8 @@ var testDefs = [ var fluid = require("universal"), http = require("http"), gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("jqUnit"); + jqUnit = fluid.require("jqUnit"), + child_process = require('child_process'); require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); require("gsettingsBridge"); @@ -63,6 +64,28 @@ var testDefs = [ fluid.registerNamespace("fluid.tests"); + fluid.defaults("gpii.integrationTesting.exec", { + gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], + events: { + onExit: null, + } + }); + + gpii.integrationTesting.exec.preInit = function (that) { + that.exec = function (processSpec) { + var output = ""; + var cp = child_process.exec(processSpec.command); + cp.stdout.on("data", function (data) { + output += data; + }); + cp.on("exit", function (exitCode) { + that.events.onExit.fire(exitCode, output, processSpec); + }); + cp.on("error", function (err) { + jqUnit.assertFalse("Got an error on exec... " + err.message, true); + }); + } + } fluid.defaults("gpii.integrationTesting.httpReq", { gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], @@ -72,7 +95,6 @@ var testDefs = [ } }); - gpii.integrationTesting.httpReq.preInit = function (that) { that.login = function (token) { that.call(token, "login", that.events.onLogin.fire); @@ -113,6 +135,9 @@ var testDefs = [ httpReq: { type: "gpii.integrationTesting.httpReq" }, + exec: { + type: "gpii.integrationTesting.exec" + }, integrationTests: { type: "gpii.integrationTesting.tests" } @@ -129,7 +154,7 @@ var testDefs = [ tests: [ { name: "Config process", - expect: 4, + expect: 5, sequence: [ { func: "gpii.integrationTesting.initSettings", args: [ "{integrationTests}.options.testDefs", "{integrationTests}.options.settingsStore" ] @@ -142,6 +167,12 @@ var testDefs = [ }, { func: "gpii.integrationTesting.checkConfiguration", args: [ "{integrationTests}.options.testDefs"] + }, { + func: "{exec}.exec", + args: [ "{integrationTests}.options.testDefs.processes.0"] + }, { + listener: "gpii.integrationTesting.onExecExit", + event: "{exec}.events.onExit" }, { func: "{httpReq}.logout", args: [ "{integrationTests}.options.testDefs.token" ] @@ -185,6 +216,12 @@ var testDefs = [ jqUnit.assertDeepEq("Checking that settings are set", config, testDef.settingsHandlers); //TODO check processes }; + gpii.integrationTesting.onExecExit = function (exitCode, output, processSpec) { + jqUnit.assertEquals("Checking that the process "+processSpec.command+" is running", output.trim(), processSpec.expect); + // var config = gpii.integrationTesting.getSettings(testDef.settingsHandlers); + // jqUnit.assertDeepEq("Checking that settings are set", config, testDef.settingsHandlers); + //TODO check processes + }; gpii.integrationTesting.logoutRequestListen = function (data, token) { jqUnit.assertNotEquals("Successful logout message returned "+data, data.indexOf("User with token "+token+" was successfully logged out."), -1); }; From 9efb9d0d5bb1ee8255140ee7f5fc4365dda189e5 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Fri, 26 Jul 2013 14:24:32 +0200 Subject: [PATCH 060/319] GPII-20: first steps in creating the GPII server properly --- tests/integrationTesting2.js | 104 ++++++++++++++++++++++++----------- 1 file changed, 71 insertions(+), 33 deletions(-) diff --git a/tests/integrationTesting2.js b/tests/integrationTesting2.js index 391bbd4..cd3147a 100644 --- a/tests/integrationTesting2.js +++ b/tests/integrationTesting2.js @@ -12,6 +12,7 @@ https://github.com/gpii/universal/LICENSE.txt */ +/*global __dirname, require*/ var testDefs = [ { name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", @@ -67,7 +68,7 @@ var testDefs = [ fluid.defaults("gpii.integrationTesting.exec", { gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], events: { - onExit: null, + onExit: null } }); @@ -84,8 +85,8 @@ var testDefs = [ cp.on("error", function (err) { jqUnit.assertFalse("Got an error on exec... " + err.message, true); }); - } - } + }; + }; fluid.defaults("gpii.integrationTesting.httpReq", { gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], @@ -98,10 +99,10 @@ var testDefs = [ gpii.integrationTesting.httpReq.preInit = function (that) { that.login = function (token) { that.call(token, "login", that.events.onLogin.fire); - } + }; that.logout = function (token) { that.call(token, "logout", that.events.onLogout.fire); - } + }; that.call = function (token, action, callback) { http.get({ host: "localhost", @@ -144,55 +145,97 @@ var testDefs = [ } }); - fluid.defaults("gpii.integrationTesting.tests", { - gradeNames: ["fluid.test.testCaseHolder", "autoInit"], - testDefs: testDefs[0], - gpii: null, - settingsStore: {}, - modules: [ { - name: "Full login/logout cycle", - tests: [ - { - name: "Config process", - expect: 5, + gpii.integrationTesting.buildTestFixtures = function (testDefs) { + var testFixtures = []; + + fluid.each(testDefs, function (testDef, index) { + var processes = testDef.processes; + var testDefRef = "{integrationTests}.options.testDefs." + index; + var testFixture = { + name: testDef.name, + expect: 4 + testDef.processes.length, sequence: [ { func: "gpii.integrationTesting.initSettings", - args: [ "{integrationTests}.options.testDefs", "{integrationTests}.options.settingsStore" ] + args: [ testDefRef, "{integrationTests}.options.settingsStore" ] }, { func: "{httpReq}.login", - args: [ "{integrationTests}.options.testDefs.token" ] + args: [ testDefRef + ".token" ] }, { listener: "gpii.integrationTesting.loginRequestListen", event: "{httpReq}.events.onLogin" }, { func: "gpii.integrationTesting.checkConfiguration", - args: [ "{integrationTests}.options.testDefs"] - }, { + args: [ testDefRef ] + }] + }; + fluid.each(processes, function (process, pindex) { + testFixture.sequence.push({ func: "{exec}.exec", - args: [ "{integrationTests}.options.testDefs.processes.0"] + args: [ testDefRef + ".processes." + pindex] }, { listener: "gpii.integrationTesting.onExecExit", event: "{exec}.events.onExit" - }, { + }); + }); + + testFixture.sequence.push({ func: "{httpReq}.logout", - args: [ "{integrationTests}.options.testDefs.token" ] + args: [ testDefRef + ".token" ] }, { listener: "gpii.integrationTesting.logoutRequestListen", event: "{httpReq}.events.onLogout" }, { func: "gpii.integrationTesting.checkResetConfiguration", - args: [ "{integrationTests}.options.testDefs", "{integrationTests}.options.settingsStore"] - } - ] - }] + args: [ testDefRef, "{integrationTests}.options.settingsStore"] + }); + + testFixtures.push(testFixture); + }); + return testFixtures; + }; + + fluid.defaults("gpii.integrationTesting.tests.server", { + gradeNames: ["autoInit", "{that}.buildServerGrade"], + invokers: { + buildServerGrade: { + funcName: "fluid.identity", + "args": "{gpii.integrationTesting.tests}.options.componentName" + } + } + }); + + gpii.integrationTesting.tests.server.preInit = function (that) { + that.buildServerGrade = function (a) { + console.log(a); + return a; + } + } + + fluid.defaults("gpii.integrationTesting.tests", { + gradeNames: ["fluid.test.testCaseHolder", "autoInit"], + testDefs: testDefs, + gpii: null, + settingsStore: {}, + components: { + gpii: { + type: "gpii.integrationTesting.tests.server", + createOnEvent: "createServer" + } + }, + modules: [ { + name: "Full login/logout cycle", + tests: gpii.integrationTesting.buildTestFixtures(testDefs) }] }); gpii.integrationTesting.tests.preInit = function (that) { - that.options.gpii = gpii.config.makeConfigLoader(that.options.testDefs.gpiiConfig); + that.options.gpii = gpii.config.makeConfigLoader(that.options.testDefs[0].gpiiConfig); }; + + + /* * Sets the settings given in the json paramater. The content of the json passed * is the values to set in a format similar to the content of 'initialState' @@ -214,13 +257,9 @@ var testDefs = [ gpii.integrationTesting.checkConfiguration = function (testDef) { var config = gpii.integrationTesting.getSettings(testDef.settingsHandlers); jqUnit.assertDeepEq("Checking that settings are set", config, testDef.settingsHandlers); - //TODO check processes }; gpii.integrationTesting.onExecExit = function (exitCode, output, processSpec) { jqUnit.assertEquals("Checking that the process "+processSpec.command+" is running", output.trim(), processSpec.expect); - // var config = gpii.integrationTesting.getSettings(testDef.settingsHandlers); - // jqUnit.assertDeepEq("Checking that settings are set", config, testDef.settingsHandlers); - //TODO check processes }; gpii.integrationTesting.logoutRequestListen = function (data, token) { jqUnit.assertNotEquals("Successful logout message returned "+data, data.indexOf("User with token "+token+" was successfully logged out."), -1); @@ -228,7 +267,6 @@ var testDefs = [ gpii.integrationTesting.checkResetConfiguration = function (testDef, settingsStore) { var currentSettings = gpii.integrationTesting.getSettings(testDef.settingsHandlers); jqUnit.assertDeepEq("Checking that settings are properly reset", currentSettings, settingsStore.orig); - //TODO check processes }; fluid.tests.testTests = function () { fluid.test.runTests([ From 6e7352f75d1529b5d853cd651357f001eae79906 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Fri, 26 Jul 2013 16:19:55 +0200 Subject: [PATCH 061/319] GPII-20: committing for yura to look at it --- tests/integrationTesting2.js | 49 ++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/tests/integrationTesting2.js b/tests/integrationTesting2.js index cd3147a..a93b88a 100644 --- a/tests/integrationTesting2.js +++ b/tests/integrationTesting2.js @@ -151,10 +151,17 @@ var testDefs = [ fluid.each(testDefs, function (testDef, index) { var processes = testDef.processes; var testDefRef = "{integrationTests}.options.testDefs." + index; + //First add common steps, ie: + //Storing state, start server, logging in and checking that configuration is set var testFixture = { name: testDef.name, + //number of asserts is 4 + number of checks for running processes expect: 4 + testDef.processes.length, sequence: [ { + func: "gpii.integrationTesting.startServer", + args: [ testDefRef, "{integrationTests}" ] + }, + { func: "gpii.integrationTesting.initSettings", args: [ testDefRef, "{integrationTests}.options.settingsStore" ] }, { @@ -168,6 +175,7 @@ var testDefs = [ args: [ testDefRef ] }] }; + //For each process, run the command, then check that we get the expected output fluid.each(processes, function (process, pindex) { testFixture.sequence.push({ func: "{exec}.exec", @@ -177,7 +185,8 @@ var testDefs = [ event: "{exec}.events.onExit" }); }); - + //Back to the common steps: + //Logout, check that configuration is properly restored testFixture.sequence.push({ func: "{httpReq}.logout", args: [ testDefRef + ".token" ] @@ -185,7 +194,7 @@ var testDefs = [ listener: "gpii.integrationTesting.logoutRequestListen", event: "{httpReq}.events.onLogout" }, { - func: "gpii.integrationTesting.checkResetConfiguration", + func: "gpii.integrationTesting.checkRestoredConfiguration", args: [ testDefRef, "{integrationTests}.options.settingsStore"] }); @@ -195,24 +204,29 @@ var testDefs = [ }; fluid.defaults("gpii.integrationTesting.tests.server", { - gradeNames: ["autoInit", "{that}.buildServerGrade"], + gradeNames: ["autoInit", "fluid.littleComponent", "{that}.buildServerGrade"], invokers: { buildServerGrade: { - funcName: "fluid.identity", - "args": "{gpii.integrationTesting.tests}.options.componentName" + funcName: "gpii.integrationTesting.tester", + "args": [ "{gpii.integrationTesting.tests}", "{that}", "{gpii.integrationTesting.tests}.componentName" ] } } }); - gpii.integrationTesting.tests.server.preInit = function (that) { - that.buildServerGrade = function (a) { - console.log(a); - return a; - } + gpii.integrationTesting.tester = function (a, b, c) { + console.log(a); + var b = a; } + // gpii.integrationTesting.tests.server.preInit = function (that) { + // that.buildServerGrade = function (a) { + // console.log(a); + // return a; + // } + // } + fluid.defaults("gpii.integrationTesting.tests", { - gradeNames: ["fluid.test.testCaseHolder", "autoInit"], + gradeNames: ["fluid.test.testCaseHolder", "fluid.eventedComponent", "autoInit"], testDefs: testDefs, gpii: null, settingsStore: {}, @@ -222,6 +236,9 @@ var testDefs = [ createOnEvent: "createServer" } }, + events: { + createServer: null + }, modules: [ { name: "Full login/logout cycle", tests: gpii.integrationTesting.buildTestFixtures(testDefs) @@ -229,7 +246,7 @@ var testDefs = [ }); gpii.integrationTesting.tests.preInit = function (that) { - that.options.gpii = gpii.config.makeConfigLoader(that.options.testDefs[0].gpiiConfig); + //that.options.gpii = gpii.config.makeConfigLoader(that.options.testDefs[0].gpiiConfig); }; @@ -248,6 +265,12 @@ var testDefs = [ return ret; }; + gpii.integrationTesting.startServer = function (testDef, tests) { + var componentName = gpii.config.createDefaults(testDef.gpiiConfig); + tests.events.createServer.fire(componentName); + var a = 'lkjasdf'; + + }; gpii.integrationTesting.initSettings = function (testDef, settingsStore) { settingsStore.orig = gpii.integrationTesting.getSettings(testDef.settingsHandlers); }; @@ -264,7 +287,7 @@ var testDefs = [ gpii.integrationTesting.logoutRequestListen = function (data, token) { jqUnit.assertNotEquals("Successful logout message returned "+data, data.indexOf("User with token "+token+" was successfully logged out."), -1); }; - gpii.integrationTesting.checkResetConfiguration = function (testDef, settingsStore) { + gpii.integrationTesting.checkRestoredConfiguration = function (testDef, settingsStore) { var currentSettings = gpii.integrationTesting.getSettings(testDef.settingsHandlers); jqUnit.assertDeepEq("Checking that settings are properly reset", currentSettings, settingsStore.orig); }; From 556e927bfc3b9ddd447ad28bb5c4be3075b36b57 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Mon, 29 Jul 2013 02:36:35 +0200 Subject: [PATCH 062/319] GPII-20: Added an extra tests.. server still not starting/stopping properly due to an issue with clearComponent --- tests/integrationTesting.js | 478 +++++++++++++++++++++-------------- tests/integrationTesting2.js | 301 ---------------------- 2 files changed, 290 insertions(+), 489 deletions(-) delete mode 100644 tests/integrationTesting2.js diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index fe64c62..7c5ca7b 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -1,8 +1,8 @@ -/*! +/* -Integration Testing +GPII Integration Testing -Copyright 2013 Raising the Floor - International +Copyright 2013 Raising the Floor International Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -11,215 +11,317 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ -/*global require, console */ - -// var tests = [ -// { -// name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", -// token: "MikelVargas", -// settingsHandlers: { -// "gpii.gsettings": { -// "data": [{ -// "settings": { -// "slowkeys-delay": { init: 100, expect: 400 }, -// "slowkeys-enable": { init: false, expect: true }, -// "bouncekeys-delay": { init: 100, expect: 200 }, -// "mousekeys-enable": { init: false, expect: true }, -// "stickykeys-enable": { init: false, expect: true }, -// "bouncekeys-enable": { init: false, expect: true }, -// "mousekeys-max-speed": { init: 250, expect: 850 }, -// "mousekeys-init-delay": { init: 110, expect: 120 }, -// "mousekeys-accel-time": { init: 300, expect: 800 }, -// }, -// "options": { -// "schema": "org.gnome.desktop.a11y.keyboard" -// } -// }] -// } -// }, -// processes: [ -// { -// command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", -// expect: "true" -// } -// ] -// } -// ]; +/*global __dirname, require*/ +var testDefs = [ + { + name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "MikelVargas", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "slowkeys-delay": 400, + "slowkeys-enable": true, + "bouncekeys-delay": 200, + "mousekeys-enable": true, + "stickykeys-enable": true, + "bouncekeys-enable": true, + "mousekeys-max-speed": 850, + "mousekeys-init-delay": 120, + "mousekeys-accel-time": 800 + }, + "options": { + "schema": "org.gnome.desktop.a11y.keyboard" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", + expect: "true" + } + ] + }, + { + name: "Testing Sammy using Flat matchmaker", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "sammy", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 2, + "mouse-tracking": "centered" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + } + }, { + "settings": { + "text-scaling-factor":1 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + } ] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + expect: "true" + } + ] + } +]; (function () { "use strict"; - - // This loads universal. var fluid = require("universal"), - //http = require("http"), + http = require("http"), gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("jqUnit"); + jqUnit = fluid.require("jqUnit"), + child_process = require('child_process'); - //require("testFramework"); require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); require("gsettingsBridge"); + fluid.registerNamespace("gpii.integrationTesting"); + + fluid.registerNamespace("fluid.tests"); + + fluid.defaults("gpii.integrationTesting.exec", { + gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], + events: { + onExit: null + } + }); + + gpii.integrationTesting.exec.preInit = function (that) { + that.exec = function (processSpec) { + var output = ""; + var cp = child_process.exec(processSpec.command); + cp.stdout.on("data", function (data) { + output += data; + }); + cp.on("exit", function (exitCode) { + that.events.onExit.fire(exitCode, output, processSpec); + }); + cp.on("error", function (err) { + jqUnit.assertFalse("Got an error on exec... " + err.message, true); + }); + }; + }; + + fluid.defaults("gpii.integrationTesting.httpReq", { + gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], + events: { + onLogin: null, + onLogout: null + } + }); + + gpii.integrationTesting.httpReq.preInit = function (that) { + that.login = function (token) { + that.call(token, "login", that.events.onLogin.fire); + }; + that.logout = function (token) { + that.call(token, "logout", that.events.onLogout.fire); + }; + that.call = function (token, action, callback) { + http.get({ + host: "localhost", + port: 8081, + path: "/user/"+token+"/"+action + }, function(response) { + var data = ""; + + response.on("data", function (chunk) { + data += chunk; + }); + response.on("close", function(err) { + if (err) { + jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); + // jqUnit.start(); + } + fluid.log("Connection to the server was closed"); + }); + response.on("end", function() { + callback(data, token); + }); + }).on('error', function(err) { + jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); + }); + }; + }; + fluid.defaults("gpii.integrationTesting.testEnv", { gradeNames: ["fluid.test.testEnvironment", "autoInit"], components: { - // gpiiServer: { - // type: "gpii.server" - // }, + httpReq: { + type: "gpii.integrationTesting.httpReq" + }, + exec: { + type: "gpii.integrationTesting.exec" + }, integrationTests: { - type: "gpii.integrationTesting.integrationTests" + type: "gpii.integrationTesting.tests" } } }); - fluid.defaults("gpii.integrationTesting.integrationTests", { - gradeNames: ["fluid.test.testCaseHolder", "autoInit"], - components: [ { - name: "Full configuration process", - tests: [{ - name: "Config process", - expect: 1, + gpii.integrationTesting.buildTestFixtures = function (testDefs) { + var testFixtures = []; + + fluid.each(testDefs, function (testDef, index) { + var processes = testDef.processes; + var testDefRef = "{integrationTests}.options.testDefs." + index; + //First add common steps, ie: + //Storing state, start server, logging in and checking that configuration is set + var testFixture = { + name: testDef.name, + //number of asserts is 4 + number of checks for running processes + expect: 4 + testDef.processes.length, sequence: [ { + func: "gpii.integrationTesting.startServer", + args: [ testDefRef, "{integrationTests}" ] + }, { func: "gpii.integrationTesting.initSettings", - args: [ ""] - } - ] - } - ] - }] - }); - - gpii.integrationTesting.initSettings = function () { - //sconsole.log(a); - console.log(b); + args: [ testDefRef, "{integrationTests}.options.settingsStore" ] + }, { + func: "{httpReq}.login", + args: [ testDefRef + ".token" ] + }, { + listener: "gpii.integrationTesting.loginRequestListen", + event: "{httpReq}.events.onLogin" + }, { + func: "gpii.integrationTesting.checkConfiguration", + args: [ testDefRef ] + }] + }; + //For each process, run the command, then check that we get the expected output + fluid.each(processes, function (process, pindex) { + testFixture.sequence.push({ + func: "{exec}.exec", + args: [ testDefRef + ".processes." + pindex] + }, { + listener: "gpii.integrationTesting.onExecExit", + event: "{exec}.events.onExit" + }); + }); + //Back to the common steps: + //Logout, check that configuration is properly restored + testFixture.sequence.push({ + func: "{httpReq}.logout", + args: [ testDefRef + ".token" ] + }, { + listener: "gpii.integrationTesting.logoutRequestListen", + event: "{httpReq}.events.onLogout" + }, { + func: "gpii.integrationTesting.checkRestoredConfiguration", + args: [ testDefRef, "{integrationTests}.options.settingsStore"] + }, { + func: "gpii.integrationTesting.stopServer", + args: [ "{integrationTests}" ] + }); + testFixtures.push(testFixture); + }); + return testFixtures; }; - fluid.test.runTests([ - "gpii.integrationTesting.testEnv" - ]); + fluid.defaults("gpii.integrationTesting.tests.server", { + gradeNames: ["autoInit", "fluid.littleComponent", "{that}.buildServerGrade"], + invokers: { + buildServerGrade: { + funcName: "fluid.identity", + "args": [ "{gpii.integrationTesting.tests}.componentName" ] + } + } + }); - // var integrationTesting = gpii.tests.testEnvironment(); + gpii.integrationTesting.tester = function (a, b, c) { + console.log(a); + var b = a; + } - // jqUnit.module("Integration Testing"); - - // var currentTest = tests[0]; - - // var extractPayloads = function (test) { - // var settingsHandlers = test.settingsHandlers; - // var payloads = { - // init: fluid.copy(settingsHandlers), - // get: fluid.copy(settingsHandlers), - // expect: fluid.copy(settingsHandlers) - // }; - - // fluid.each(settingsHandlers, function (handlerBlock, handlerID) { - // fluid.each(handlerBlock, function (hbArray, hbHeader) { - // fluid.each(hbArray, function (handlerEntry, index) { - // var settings = handlerEntry.settings; - // var initBlock = {}; - // var getBlock = {}; - // var expectBlock = {}; - - // fluid.each(settings, function (val, key) { - // initBlock[key] = val.init; - // getBlock[key] = null; - // expectBlock[key] = val.expect; - // }); - - // payloads.init[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: initBlock }; - // payloads.get[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: getBlock }; - // payloads.expect[handlerID][hbHeader][index] = { options: handlerEntry.options, settings: expectBlock }; - // }); - // }); - // }); - // return payloads; - // }; - - // /* - // * Sets the settings given in the json paramater. The content of the json passed - // * is the values to set in a format similar to the content of 'initialState' - // */ - // var callHandlers = function (payload, action) { - // var ret = {}; - // fluid.each(payload, function (handlerBlock, handlerID) { - // ret[handlerID]=fluid.invokeGlobalFunction(handlerID+"."+action, [handlerBlock]); - // }); - // return ret; - // }; - - // var checkProcesses = function (payload, expectProcess) { - // fluid.each(payload, function (processBlock, index) { - - // }); - // }; - - // var addRESTTest = function(token, action, onEnd) { - // http.get({ - // host: "localhost", - // port: 8081, - // path: "/user/"+token+"/"+action - // }, function(response) { - // var data = ""; - // fluid.log("Callback from "+action+" called"); - - // response.on("data", function (chunk) { - // fluid.log("Response from server: " + chunk); - // data += chunk; - // }); - // response.on("close", function(err) { - // if (err) { - // jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); - // jqUnit.start(); - // } - // fluid.log("Connection to the server was closed"); - // }); - // response.on("end", function() { - // fluid.log("Connection to server ended"); - // onEnd(data); - // }); - // }).on('error', function(err) { - // fluid.log("Got error: " + err.message); - // jqUnit.start(); - // }); - // }; + fluid.defaults("gpii.integrationTesting.tests", { + gradeNames: ["fluid.test.testCaseHolder", "fluid.eventedComponent", "autoInit"], + testDefs: testDefs, + gpii: null, + settingsStore: {}, + components: { + gpii: { + type: "gpii.integrationTesting.tests.server", + createOnEvent: "createServer" + } + }, + events: { + createServer: null + }, + modules: [ { + name: "Full login/logout cycle", + tests: gpii.integrationTesting.buildTestFixtures(testDefs) + }] + }); - // integrationTesting.asyncTest("Integration Tester", function () { - // //extract the payloads we need from test: - // var payloads = extractPayloads(currentTest); - - // //set initial settings - // callHandlers(payloads.init, "set"); - // //and check that they are properly set - // var returned = callHandlers(payloads.get, "get"); - // jqUnit.assertDeepEq("Checking that initial settings are properly set", returned, payloads.init); - - // //start up server - // var currentGpii = gpii.config.makeConfigLoader({ - // "nodeEnv": "development-config", - // "configPath": __dirname+"/integrationTests/setup1/configs" - // }); - // fluid.log("SERVER STARTED"); - - // currentGpii.server.flowManager.lifecycleManager.events.configurationApplied.addListener(function () { - // var returned = callHandlers(payloads.get, "get"); - // jqUnit.assertDeepEq("Checking that settings are properly set", returned, payloads.expect); - // //log out - // addRESTTest(currentTest.token, "logout", function(data) { - // jqUnit.assertNotEquals("Successful logout message returned", data.indexOf("successfully logged out."), -1); - // console.log("So far, so good"); - // jqUnit.start(); - // }); - // }); - - // currentGpii.server.flowManager.lifecycleManager.events.configurationRemoved.addListener(function () { - // var returned = callHandlers(payloads.get, "get"); - // jqUnit.assertDeepEq("Checking that settings are properly restored", returned, payloads.init); - // }); - - // addRESTTest(currentTest.token, "login", function (data) { - // jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); - // }); - - // }); + /* + * Sets the settings given in the json paramater. The content of the json passed + * is the values to set in a format similar to the content of 'initialState' + */ + gpii.integrationTesting.getSettings = function (payload) { + var ret = {}; + fluid.each(payload, function (handlerBlock, handlerID) { + ret[handlerID]=fluid.invokeGlobalFunction(handlerID+".get", [handlerBlock]); + }); + return ret; + }; + + gpii.integrationTesting.startServer = function (testDef, tests) { + //TODO: remove once server is properly stopped + if (testDef.token === "MikelVargas") { + tests.componentName = gpii.config.createDefaults(testDef.gpiiConfig); + tests.events.createServer.fire(); + } + }; + gpii.integrationTesting.initSettings = function (testDef, settingsStore) { + settingsStore.orig = gpii.integrationTesting.getSettings(testDef.settingsHandlers); + }; + gpii.integrationTesting.loginRequestListen = function (data, token) { + jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); + }; + gpii.integrationTesting.checkConfiguration = function (testDef) { + var config = gpii.integrationTesting.getSettings(testDef.settingsHandlers); + jqUnit.assertDeepEq("Checking that settings are set", config, testDef.settingsHandlers); + }; + gpii.integrationTesting.onExecExit = function (exitCode, output, processSpec) { + jqUnit.assertEquals("Checking that the process "+processSpec.command+" is running", output.trim(), processSpec.expect); + }; + gpii.integrationTesting.logoutRequestListen = function (data, token) { + jqUnit.assertNotEquals("Successful logout message returned "+data, data.indexOf("User with token "+token+" was successfully logged out."), -1); + }; + gpii.integrationTesting.checkRestoredConfiguration = function (testDef, settingsStore) { + var currentSettings = gpii.integrationTesting.getSettings(testDef.settingsHandlers); + jqUnit.assertDeepEq("Checking that settings are properly reset", currentSettings, settingsStore.orig); + }; + gpii.integrationTesting.stopServer = function (tests) { + // var instantiator = fluid.getInstantiator(tests.gpii); + // instantiator.clearComponent(tests.gpii, "server"); + // var a = tests; + }; + fluid.tests.testTests = function () { + fluid.test.runTests([ + "gpii.integrationTesting.testEnv" + ]); + }; + fluid.tests.testTests(); })(); \ No newline at end of file diff --git a/tests/integrationTesting2.js b/tests/integrationTesting2.js deleted file mode 100644 index a93b88a..0000000 --- a/tests/integrationTesting2.js +++ /dev/null @@ -1,301 +0,0 @@ -/* - -GPII Integration Testing - -Copyright 2013 Raising the Floor International - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt - -*/ - -/*global __dirname, require*/ -var testDefs = [ - { - name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "MikelVargas", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "slowkeys-delay": 400, - "slowkeys-enable": true, - "bouncekeys-delay": 200, - "mousekeys-enable": true, - "stickykeys-enable": true, - "bouncekeys-enable": true, - "mousekeys-max-speed": 850, - "mousekeys-init-delay": 120, - "mousekeys-accel-time": 800 - }, - "options": { - "schema": "org.gnome.desktop.a11y.keyboard" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", - expect: "true" - } - ] - } -]; - -(function () { - "use strict"; - var fluid = require("universal"), - http = require("http"), - gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("jqUnit"), - child_process = require('child_process'); - - require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); - require("gsettingsBridge"); - - fluid.registerNamespace("gpii.integrationTesting"); - - fluid.registerNamespace("fluid.tests"); - - fluid.defaults("gpii.integrationTesting.exec", { - gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], - events: { - onExit: null - } - }); - - gpii.integrationTesting.exec.preInit = function (that) { - that.exec = function (processSpec) { - var output = ""; - var cp = child_process.exec(processSpec.command); - cp.stdout.on("data", function (data) { - output += data; - }); - cp.on("exit", function (exitCode) { - that.events.onExit.fire(exitCode, output, processSpec); - }); - cp.on("error", function (err) { - jqUnit.assertFalse("Got an error on exec... " + err.message, true); - }); - }; - }; - - fluid.defaults("gpii.integrationTesting.httpReq", { - gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], - events: { - onLogin: null, - onLogout: null - } - }); - - gpii.integrationTesting.httpReq.preInit = function (that) { - that.login = function (token) { - that.call(token, "login", that.events.onLogin.fire); - }; - that.logout = function (token) { - that.call(token, "logout", that.events.onLogout.fire); - }; - that.call = function (token, action, callback) { - http.get({ - host: "localhost", - port: 8081, - path: "/user/"+token+"/"+action - }, function(response) { - var data = ""; - - response.on("data", function (chunk) { - data += chunk; - }); - response.on("close", function(err) { - if (err) { - jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); - // jqUnit.start(); - } - fluid.log("Connection to the server was closed"); - }); - response.on("end", function() { - callback(data, token); - }); - }).on('error', function(err) { - jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); - }); - }; - }; - - fluid.defaults("gpii.integrationTesting.testEnv", { - gradeNames: ["fluid.test.testEnvironment", "autoInit"], - components: { - httpReq: { - type: "gpii.integrationTesting.httpReq" - }, - exec: { - type: "gpii.integrationTesting.exec" - }, - integrationTests: { - type: "gpii.integrationTesting.tests" - } - } - }); - - gpii.integrationTesting.buildTestFixtures = function (testDefs) { - var testFixtures = []; - - fluid.each(testDefs, function (testDef, index) { - var processes = testDef.processes; - var testDefRef = "{integrationTests}.options.testDefs." + index; - //First add common steps, ie: - //Storing state, start server, logging in and checking that configuration is set - var testFixture = { - name: testDef.name, - //number of asserts is 4 + number of checks for running processes - expect: 4 + testDef.processes.length, - sequence: [ { - func: "gpii.integrationTesting.startServer", - args: [ testDefRef, "{integrationTests}" ] - }, - { - func: "gpii.integrationTesting.initSettings", - args: [ testDefRef, "{integrationTests}.options.settingsStore" ] - }, { - func: "{httpReq}.login", - args: [ testDefRef + ".token" ] - }, { - listener: "gpii.integrationTesting.loginRequestListen", - event: "{httpReq}.events.onLogin" - }, { - func: "gpii.integrationTesting.checkConfiguration", - args: [ testDefRef ] - }] - }; - //For each process, run the command, then check that we get the expected output - fluid.each(processes, function (process, pindex) { - testFixture.sequence.push({ - func: "{exec}.exec", - args: [ testDefRef + ".processes." + pindex] - }, { - listener: "gpii.integrationTesting.onExecExit", - event: "{exec}.events.onExit" - }); - }); - //Back to the common steps: - //Logout, check that configuration is properly restored - testFixture.sequence.push({ - func: "{httpReq}.logout", - args: [ testDefRef + ".token" ] - }, { - listener: "gpii.integrationTesting.logoutRequestListen", - event: "{httpReq}.events.onLogout" - }, { - func: "gpii.integrationTesting.checkRestoredConfiguration", - args: [ testDefRef, "{integrationTests}.options.settingsStore"] - }); - - testFixtures.push(testFixture); - }); - return testFixtures; - }; - - fluid.defaults("gpii.integrationTesting.tests.server", { - gradeNames: ["autoInit", "fluid.littleComponent", "{that}.buildServerGrade"], - invokers: { - buildServerGrade: { - funcName: "gpii.integrationTesting.tester", - "args": [ "{gpii.integrationTesting.tests}", "{that}", "{gpii.integrationTesting.tests}.componentName" ] - } - } - }); - - gpii.integrationTesting.tester = function (a, b, c) { - console.log(a); - var b = a; - } - - // gpii.integrationTesting.tests.server.preInit = function (that) { - // that.buildServerGrade = function (a) { - // console.log(a); - // return a; - // } - // } - - fluid.defaults("gpii.integrationTesting.tests", { - gradeNames: ["fluid.test.testCaseHolder", "fluid.eventedComponent", "autoInit"], - testDefs: testDefs, - gpii: null, - settingsStore: {}, - components: { - gpii: { - type: "gpii.integrationTesting.tests.server", - createOnEvent: "createServer" - } - }, - events: { - createServer: null - }, - modules: [ { - name: "Full login/logout cycle", - tests: gpii.integrationTesting.buildTestFixtures(testDefs) - }] - }); - - gpii.integrationTesting.tests.preInit = function (that) { - //that.options.gpii = gpii.config.makeConfigLoader(that.options.testDefs[0].gpiiConfig); - }; - - - - - - /* - * Sets the settings given in the json paramater. The content of the json passed - * is the values to set in a format similar to the content of 'initialState' - */ - gpii.integrationTesting.getSettings = function (payload) { - var ret = {}; - fluid.each(payload, function (handlerBlock, handlerID) { - ret[handlerID]=fluid.invokeGlobalFunction(handlerID+".get", [handlerBlock]); - }); - return ret; - }; - - gpii.integrationTesting.startServer = function (testDef, tests) { - var componentName = gpii.config.createDefaults(testDef.gpiiConfig); - tests.events.createServer.fire(componentName); - var a = 'lkjasdf'; - - }; - gpii.integrationTesting.initSettings = function (testDef, settingsStore) { - settingsStore.orig = gpii.integrationTesting.getSettings(testDef.settingsHandlers); - }; - gpii.integrationTesting.loginRequestListen = function (data, token) { - jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); - }; - gpii.integrationTesting.checkConfiguration = function (testDef) { - var config = gpii.integrationTesting.getSettings(testDef.settingsHandlers); - jqUnit.assertDeepEq("Checking that settings are set", config, testDef.settingsHandlers); - }; - gpii.integrationTesting.onExecExit = function (exitCode, output, processSpec) { - jqUnit.assertEquals("Checking that the process "+processSpec.command+" is running", output.trim(), processSpec.expect); - }; - gpii.integrationTesting.logoutRequestListen = function (data, token) { - jqUnit.assertNotEquals("Successful logout message returned "+data, data.indexOf("User with token "+token+" was successfully logged out."), -1); - }; - gpii.integrationTesting.checkRestoredConfiguration = function (testDef, settingsStore) { - var currentSettings = gpii.integrationTesting.getSettings(testDef.settingsHandlers); - jqUnit.assertDeepEq("Checking that settings are properly reset", currentSettings, settingsStore.orig); - }; - fluid.tests.testTests = function () { - fluid.test.runTests([ - "gpii.integrationTesting.testEnv" - ]); - }; - - fluid.tests.testTests(); -})(); \ No newline at end of file From 5bae9d2eabac3e9d62107c395784ff2f9bedceb9 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Mon, 29 Jul 2013 04:20:20 +0200 Subject: [PATCH 063/319] GPII-20: moved integration framework to universal --- tests/integrationTesting.js | 207 +----------------------------------- 1 file changed, 4 insertions(+), 203 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index 7c5ca7b..35a444f 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -86,177 +86,22 @@ var testDefs = [ (function () { "use strict"; var fluid = require("universal"), - http = require("http"), gpii = fluid.registerNamespace("gpii"), jqUnit = fluid.require("jqUnit"), child_process = require('child_process'); - require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); require("gsettingsBridge"); - fluid.registerNamespace("gpii.integrationTesting"); + fluid.registerNamespace("gpii.integrationTesting.linux"); fluid.registerNamespace("fluid.tests"); - fluid.defaults("gpii.integrationTesting.exec", { - gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], - events: { - onExit: null - } - }); - - gpii.integrationTesting.exec.preInit = function (that) { - that.exec = function (processSpec) { - var output = ""; - var cp = child_process.exec(processSpec.command); - cp.stdout.on("data", function (data) { - output += data; - }); - cp.on("exit", function (exitCode) { - that.events.onExit.fire(exitCode, output, processSpec); - }); - cp.on("error", function (err) { - jqUnit.assertFalse("Got an error on exec... " + err.message, true); - }); - }; - }; - - fluid.defaults("gpii.integrationTesting.httpReq", { - gradeNames: ["fluid.littleComponent", "autoInit", "fluid.eventedComponent"], - events: { - onLogin: null, - onLogout: null - } - }); - - gpii.integrationTesting.httpReq.preInit = function (that) { - that.login = function (token) { - that.call(token, "login", that.events.onLogin.fire); - }; - that.logout = function (token) { - that.call(token, "logout", that.events.onLogout.fire); - }; - that.call = function (token, action, callback) { - http.get({ - host: "localhost", - port: 8081, - path: "/user/"+token+"/"+action - }, function(response) { - var data = ""; - - response.on("data", function (chunk) { - data += chunk; - }); - response.on("close", function(err) { - if (err) { - jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); - // jqUnit.start(); - } - fluid.log("Connection to the server was closed"); - }); - response.on("end", function() { - callback(data, token); - }); - }).on('error', function(err) { - jqUnit.assertFalse("Got an error on "+action+": " + err.message, true); - }); - }; - }; - - fluid.defaults("gpii.integrationTesting.testEnv", { - gradeNames: ["fluid.test.testEnvironment", "autoInit"], - components: { - httpReq: { - type: "gpii.integrationTesting.httpReq" - }, - exec: { - type: "gpii.integrationTesting.exec" - }, - integrationTests: { - type: "gpii.integrationTesting.tests" - } - } - }); - - gpii.integrationTesting.buildTestFixtures = function (testDefs) { - var testFixtures = []; - - fluid.each(testDefs, function (testDef, index) { - var processes = testDef.processes; - var testDefRef = "{integrationTests}.options.testDefs." + index; - //First add common steps, ie: - //Storing state, start server, logging in and checking that configuration is set - var testFixture = { - name: testDef.name, - //number of asserts is 4 + number of checks for running processes - expect: 4 + testDef.processes.length, - sequence: [ { - func: "gpii.integrationTesting.startServer", - args: [ testDefRef, "{integrationTests}" ] - }, { - func: "gpii.integrationTesting.initSettings", - args: [ testDefRef, "{integrationTests}.options.settingsStore" ] - }, { - func: "{httpReq}.login", - args: [ testDefRef + ".token" ] - }, { - listener: "gpii.integrationTesting.loginRequestListen", - event: "{httpReq}.events.onLogin" - }, { - func: "gpii.integrationTesting.checkConfiguration", - args: [ testDefRef ] - }] - }; - //For each process, run the command, then check that we get the expected output - fluid.each(processes, function (process, pindex) { - testFixture.sequence.push({ - func: "{exec}.exec", - args: [ testDefRef + ".processes." + pindex] - }, { - listener: "gpii.integrationTesting.onExecExit", - event: "{exec}.events.onExit" - }); - }); - //Back to the common steps: - //Logout, check that configuration is properly restored - testFixture.sequence.push({ - func: "{httpReq}.logout", - args: [ testDefRef + ".token" ] - }, { - listener: "gpii.integrationTesting.logoutRequestListen", - event: "{httpReq}.events.onLogout" - }, { - func: "gpii.integrationTesting.checkRestoredConfiguration", - args: [ testDefRef, "{integrationTests}.options.settingsStore"] - }, { - func: "gpii.integrationTesting.stopServer", - args: [ "{integrationTests}" ] - }); - - testFixtures.push(testFixture); - }); - return testFixtures; - }; - - fluid.defaults("gpii.integrationTesting.tests.server", { - gradeNames: ["autoInit", "fluid.littleComponent", "{that}.buildServerGrade"], - invokers: { - buildServerGrade: { - funcName: "fluid.identity", - "args": [ "{gpii.integrationTesting.tests}.componentName" ] - } - } - }); - - gpii.integrationTesting.tester = function (a, b, c) { - console.log(a); - var b = a; - } + require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); + require("../../node_modules/universal/gpii/node_modules/testFramework/integrationTesting.js"); fluid.defaults("gpii.integrationTesting.tests", { gradeNames: ["fluid.test.testCaseHolder", "fluid.eventedComponent", "autoInit"], testDefs: testDefs, - gpii: null, settingsStore: {}, components: { gpii: { @@ -271,52 +116,8 @@ var testDefs = [ name: "Full login/logout cycle", tests: gpii.integrationTesting.buildTestFixtures(testDefs) }] - }); + }); - /* - * Sets the settings given in the json paramater. The content of the json passed - * is the values to set in a format similar to the content of 'initialState' - */ - gpii.integrationTesting.getSettings = function (payload) { - var ret = {}; - fluid.each(payload, function (handlerBlock, handlerID) { - ret[handlerID]=fluid.invokeGlobalFunction(handlerID+".get", [handlerBlock]); - }); - return ret; - }; - - gpii.integrationTesting.startServer = function (testDef, tests) { - //TODO: remove once server is properly stopped - if (testDef.token === "MikelVargas") { - tests.componentName = gpii.config.createDefaults(testDef.gpiiConfig); - tests.events.createServer.fire(); - } - }; - gpii.integrationTesting.initSettings = function (testDef, settingsStore) { - settingsStore.orig = gpii.integrationTesting.getSettings(testDef.settingsHandlers); - }; - gpii.integrationTesting.loginRequestListen = function (data, token) { - jqUnit.assertNotEquals("Successful login message returned "+data, data.indexOf("User with token "+token+" was successfully logged in."), -1); - }; - gpii.integrationTesting.checkConfiguration = function (testDef) { - var config = gpii.integrationTesting.getSettings(testDef.settingsHandlers); - jqUnit.assertDeepEq("Checking that settings are set", config, testDef.settingsHandlers); - }; - gpii.integrationTesting.onExecExit = function (exitCode, output, processSpec) { - jqUnit.assertEquals("Checking that the process "+processSpec.command+" is running", output.trim(), processSpec.expect); - }; - gpii.integrationTesting.logoutRequestListen = function (data, token) { - jqUnit.assertNotEquals("Successful logout message returned "+data, data.indexOf("User with token "+token+" was successfully logged out."), -1); - }; - gpii.integrationTesting.checkRestoredConfiguration = function (testDef, settingsStore) { - var currentSettings = gpii.integrationTesting.getSettings(testDef.settingsHandlers); - jqUnit.assertDeepEq("Checking that settings are properly reset", currentSettings, settingsStore.orig); - }; - gpii.integrationTesting.stopServer = function (tests) { - // var instantiator = fluid.getInstantiator(tests.gpii); - // instantiator.clearComponent(tests.gpii, "server"); - // var a = tests; - }; fluid.tests.testTests = function () { fluid.test.runTests([ "gpii.integrationTesting.testEnv" From 18b2ce2388e8d633f64ab5afae0b503ae2ed4640 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Mon, 29 Jul 2013 04:28:01 +0200 Subject: [PATCH 064/319] GPII-20: Cleaner loading of testframework --- tests/integrationTesting.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index 35a444f..c4abb84 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -92,12 +92,9 @@ var testDefs = [ require("gsettingsBridge"); - fluid.registerNamespace("gpii.integrationTesting.linux"); - fluid.registerNamespace("fluid.tests"); - require("../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js"); - require("../../node_modules/universal/gpii/node_modules/testFramework/integrationTesting.js"); + require("../../node_modules/universal/gpii/node_modules/testFramework/index.js"); fluid.defaults("gpii.integrationTesting.tests", { gradeNames: ["fluid.test.testCaseHolder", "fluid.eventedComponent", "autoInit"], From ce8bef749d4dc9213853f3712ad49ab6e888b0c9 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Thu, 1 Aug 2013 15:07:05 +0200 Subject: [PATCH 065/319] GPII-20: JSlinted and ready for review --- tests/integrationTesting.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index c4abb84..2650277 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -86,10 +86,8 @@ var testDefs = [ (function () { "use strict"; var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("jqUnit"), - child_process = require('child_process'); - + gpii = fluid.registerNamespace("gpii"); + require("gsettingsBridge"); fluid.registerNamespace("fluid.tests"); From 398b456ec6289ccfa1a7a65c609477ae285b540f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 9 Aug 2013 09:35:06 +0200 Subject: [PATCH 066/319] rc and sync working version of the Orca Settings Handler - Using gpii.getJSONFromFileSync - Simplifying some stuff - Code clean up --- node_modules/orca/orcaSettingsHandler.js | 51 ++++++++++++------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 6120e76..1155adc 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -58,47 +58,31 @@ while(curDate-date < millis); } - function getJSONFromFile(file) { - return JSON.parse(fs.readFileSync(file, "utf8")); - } - - gpii.orca.set = function(settingsarray) { - var app = fluid.copy(settingsarray); - + function applySettings(app) { var settings = app["org.gnome.orca"][0].settings; var options = app["org.gnome.orca"][0].options; var user = options.user; - if (!fs.existsSync(orcaSettingsFile)) { - var orcaSpawn = spawn("orca", ORCA_ARGS); - - while(!fs.existsSync(orcaSettingsFile)) { - wait(500); - }; - - orcaSpawn.kill("SIGKILL"); - } - - var userSettings = getJSONFromFile(orcaSettingsFile); + var userSettings = gpii.getJSONFromFileSync(orcaSettingsFile); var defaultProfiles = fluid.copy(userSettings.profiles); var defaultStartingProfile = fluid.copy(userSettings.general.startingProfile); var customizedProfile = fluid.copy(userSettings.general); if ("profiles" in settings) { - userSettings.profiles = settings["profiles"]; + userSettings.profiles = settings.profiles; userSettings.general.startingProfile = settings["general.startingProfile"]; } else { - fluid.log("orcaSettingsHandler: User ", user, + fluid.log("orcaSettingsHandler: User ", user, " has requested these following settings: ", settings); for (var k in settings) { fluid.set(customizedProfile, k, settings[k], setParser); } - + customizedProfile.profile = customizedProfile.activeProfile = customizedProfile.startingProfile = [user, user]; - + userSettings.profiles[user] = customizedProfile; userSettings.general.startingProfile = [user, user]; } @@ -117,9 +101,26 @@ } }; - return { 'org.gnome.orca' : [{"options": options, - "settings": newSettingsResponse}] - }; + return { "options": options, "settings": newSettingsResponse}; + } + + gpii.orca.set = function (profile) { + var returnObj = fluid.copy(profile); + + var exists = fs.existsSync(orcaSettingsFile); + if (!exists) { + var orcaSpawn = spawn("orca", ORCA_ARGS); + while(!fs.existsSync(orcaSettingsFile)) { + wait(500); + } + orcaSpawn.kill("SIGKILL"); + } + + var returnValue = applySettings(profile); + returnObj['org.gnome.orca'][0].options = returnValue.options; + returnObj['org.gnome.orca'][0].settings = returnValue.settings; + + return returnObj; }; })(); From 07adb87615ca4adf63b049e1b9bcdedb270cd038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 9 Aug 2013 13:25:16 +0200 Subject: [PATCH 067/319] Adding some unit tests --- .../orca/test/orcaSettingsHandlerTests.js | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 node_modules/orca/test/orcaSettingsHandlerTests.js diff --git a/node_modules/orca/test/orcaSettingsHandlerTests.js b/node_modules/orca/test/orcaSettingsHandlerTests.js new file mode 100644 index 0000000..288851b --- /dev/null +++ b/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -0,0 +1,82 @@ +/*! +Orca Settings Handler Tests + +Copyright 2013 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +var fluid = require("universal"), + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("jqUnit"), + fs = require("fs"); + var orcaSettingsHandler = require("../orcaSettingsHandler"); + var orca = fluid.registerNamespace("gpii.orca"); + +jqUnit.module("OrcaSettingsHandler Module"); + +jqUnit.test("Running tests for Orca Settings Handler", function () { + jqUnit.expect(10); + + var payload = { + "org.gnome.orca": [{ + options: { + "user": "test1" + }, + settings: { + "enableBraille": true, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "voices.default.rate": 100, + "enableTutorialMessages": false, + "voices.default.family": { "locale": "es", "name": "spanish-latin-american" }, + "verbalizePunctuationStyle": 0 + } + }] + }; + + var returnPayload = orca.set(payload); + + // Check if profile exists + // + jqUnit.assertTrue("Profile 'test1' exists", returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1); + + // Check if 'test1' is the default starting profile + // + actual = returnPayload["org.gnome.orca"][0].settings["general.startingProfile"].newValue; + jqUnit.assertDeepEq("'test1' is the new starting profile", ['test1', 'test1'], actual); + + // Check for specific one-to-one settings from the payload + // + for (var setting in ["enableBraille", "enableEchoByWord", "enableEchoByCharacter", "enableTutorialMessages", "verbalizePunctuationStyle"]) { + jqUnit.assertDeepEq("Checking " + setting + " setting", + payload["org.gnome.orca"][0].settings[setting], + returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1[setting]); + } + + // Check for voices' stuff + // + jqUnit.assertDeepEq("Checking for voices.default.rate setting", + payload["org.gnome.orca"][0].settings["voices.default.rate"], + returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices.default.rate); + + jqUnit.assertDeepEq("Checking for voices.default.family setting", + payload["org.gnome.orca"][0].settings["voices.default.family"], + returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices.default.family); + + // Let's simulate a logout and restore the settings file into its initial state + // + var newPayload = fluid.copy(payload); + newPayload['org.gnome.orca'][0].settings.profiles = returnPayload["org.gnome.orca"][0].settings.profiles.oldValue; + newPayload['org.gnome.orca'][0].settings['general.startingProfile'] = returnPayload["org.gnome.orca"][0].settings["general.startingProfile"].oldValue; + var newReturnPayload = orca.set(newPayload); + + // Check if 'test1' profile has been removed successfully + // + jqUnit.assertFalse("Profile 'test1' does not exists", newReturnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1); + +}); From 9b6f7a9dc59770aaf584c87a68a35ef777133209 Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Tue, 13 Aug 2013 11:13:35 -0400 Subject: [PATCH 068/319] GPII-116: added support for kettle. --- gpii.js | 8 +-- .../gsettingsBridge/gsettings_bridge.js | 5 +- .../gsettingsBridge/tests/gsettingsTests.js | 58 +++++++++---------- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/gpii.js b/gpii.js index 4280439..6024849 100644 --- a/gpii.js +++ b/gpii.js @@ -11,11 +11,11 @@ https://github.com/gpii/universal/LICENSE.txt */ var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"); + kettle = fluid.registerNamespace("kettle"); fluid.require("gsettingsBridge", require); -gpii.config.makeConfigLoader({ - nodeEnv: gpii.config.getNodeEnv("fm.ps.sr.dr.mm.os.development"), - configPath: gpii.config.getConfigPath() || "../node_modules/universal/gpii/configs" +kettle.config.makeConfigLoader({ + nodeEnv: kettle.config.getNodeEnv("fm.ps.sr.dr.mm.os.development"), + configPath: kettle.config.getConfigPath() || "../node_modules/universal/gpii/configs" }); \ No newline at end of file diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index 2c3a7ef..0ed0d2b 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -20,8 +20,7 @@ https://github.com/gpii/universal/LICENSE.txt var nodeGSettings = require("./nodegsettings/build/Release/nodegsettings.node"); fluid.registerNamespace("gpii.launch"); - - gpii.gsettings = gpii.gsettings || {}; + fluid.registerNamespace("gpii.gsettings"); fluid.defaults("gpii.gsettings.setSingleKey", { gradeNames: "fluid.function", @@ -47,7 +46,7 @@ https://github.com/gpii/universal/LICENSE.txt gpii.gsettings.setSingleKey = function(schemaId, key, value) { nodeGSettings.set_gsetting(schemaId, key, value); }; - + gpii.gsettings.get = function(settingsarray) { var app = fluid.copy(settingsarray); for (var appId in app) { diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/node_modules/gsettingsBridge/tests/gsettingsTests.js index f47a684..30e81bf 100644 --- a/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -21,8 +21,6 @@ https://github.com/gpii/universal/LICENSE.txt fluid.require(__dirname+"/../../../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js", require); fluid.require("gsettingsBridge", require); - var gsettingsHandlerTests = gpii.tests.testEnvironment(); - var put1 = { request: { "putreq": [ @@ -33,7 +31,7 @@ https://github.com/gpii/universal/LICENSE.txt "string-setting": "here i am" }, options: { - schema: "net.gpii.testing.gsettings.multi-set1" + schema: "net.gpii.testing.gsettings.multi-set1" } } ] @@ -47,9 +45,9 @@ https://github.com/gpii/universal/LICENSE.txt "string-setting": { "oldValue": "abcdefg", "newValue": "here i am" } }, options: { - schema: "net.gpii.testing.gsettings.multi-set1" + schema: "net.gpii.testing.gsettings.multi-set1" } - } + } ] } }; @@ -64,7 +62,7 @@ https://github.com/gpii/universal/LICENSE.txt "string-setting": "here i amma" }, options: { - schema: "net.gpii.testing.gsettings.multi-set2" + schema: "net.gpii.testing.gsettings.multi-set2" } }, { settings: { @@ -86,7 +84,7 @@ https://github.com/gpii/universal/LICENSE.txt "string-setting": { "oldValue": "abcdefg", "newValue": "here i amma" } }, options: { - schema: "net.gpii.testing.gsettings.multi-set2" + schema: "net.gpii.testing.gsettings.multi-set2" } }, { settings: { @@ -111,7 +109,7 @@ https://github.com/gpii/universal/LICENSE.txt "string-setting": null }, options: { - schema: "net.gpii.testing.gsettings.multi-get1" + schema: "net.gpii.testing.gsettings.multi-get1" } }, { settings: { @@ -132,7 +130,7 @@ https://github.com/gpii/universal/LICENSE.txt "string-setting": "abcdefg" }, options: { - schema: "net.gpii.testing.gsettings.multi-get1" + schema: "net.gpii.testing.gsettings.multi-get1" } }, { settings: { @@ -142,7 +140,7 @@ https://github.com/gpii/universal/LICENSE.txt schema: "net.gpii.testing.gsettings.multi-get2" } } - ] + ] } }; @@ -152,7 +150,7 @@ https://github.com/gpii/universal/LICENSE.txt { settings: null, options: { - schema: "net.gpii.testing.gsettings.multi-get1" + schema: "net.gpii.testing.gsettings.multi-get1" } }, { settings: { @@ -173,7 +171,7 @@ https://github.com/gpii/universal/LICENSE.txt "string-setting": "abcdefg" }, options: { - schema: "net.gpii.testing.gsettings.multi-get1" + schema: "net.gpii.testing.gsettings.multi-get1" } }, { settings: { @@ -183,7 +181,7 @@ https://github.com/gpii/universal/LICENSE.txt schema: "net.gpii.testing.gsettings.multi-get2" } } - ] + ] } }; @@ -204,42 +202,42 @@ https://github.com/gpii/universal/LICENSE.txt ] } }; - - jqUnit.module("Gsettings Handler Tests"); - gsettingsHandlerTests.asyncTest("Getting single keys via gsettings handler", function() { + jqUnit.module("Gsettings Handler Tests"); + + jqUnit.asyncTest("Getting single keys via gsettings handler", function() { setTimeout(function() { //First check reading single keys ... the default values: - jqUnit.assertEquals("Checking 'double' key", 5.0, + jqUnit.assertEquals("Checking 'double' key", 5.0, gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "double-setting")); - jqUnit.assertEquals("Checking 'boolean' key", false, + jqUnit.assertEquals("Checking 'boolean' key", false, gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); - jqUnit.assertEquals("Checking 'string' key", "abcdefg", + jqUnit.assertEquals("Checking 'string' key", "abcdefg", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); jqUnit.start(); - }, 10); + }, 10); }); - gsettingsHandlerTests.asyncTest("Setting single keys via gsettings handler", function() { + jqUnit.asyncTest("Setting single keys via gsettings handler", function() { setTimeout(function() { //set and check double value gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "double-setting", 6.789); - jqUnit.assertEquals("Checking 'double' key", 6.789, + jqUnit.assertEquals("Checking 'double' key", 6.789, gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "double-setting")); //set and check boolean value gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting", true); - jqUnit.assertEquals("Checking 'boolean' key", true, + jqUnit.assertEquals("Checking 'boolean' key", true, gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting")); //set and check string value gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); - jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", + jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); jqUnit.start(); - }, 10); + }, 10); }); - gsettingsHandlerTests.asyncTest("Setting multiple keys", function () { + jqUnit.asyncTest("Setting multiple keys", function () { setTimeout(function() { var response = gpii.gsettings.set(put1.request); jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put1.expected, response); @@ -247,7 +245,7 @@ https://github.com/gpii/universal/LICENSE.txt }, 10); }); - gsettingsHandlerTests.asyncTest("Setting multiple keys in multiple schemas", function () { + jqUnit.asyncTest("Setting multiple keys in multiple schemas", function () { setTimeout(function() { var response = gpii.gsettings.set(put2.request); jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put2.expected, response); @@ -255,7 +253,7 @@ https://github.com/gpii/universal/LICENSE.txt }, 10); }); - gsettingsHandlerTests.asyncTest("Getting multiple keys in multiple schemas", function () { + jqUnit.asyncTest("Getting multiple keys in multiple schemas", function () { setTimeout(function() { var response = gpii.gsettings.get(get1.request); jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get1.expected, response); @@ -263,7 +261,7 @@ https://github.com/gpii/universal/LICENSE.txt }, 10); }); - gsettingsHandlerTests.asyncTest("Getting multiple keys with settings block as null", function () { + jqUnit.asyncTest("Getting multiple keys with settings block as null", function () { setTimeout(function() { var response = gpii.gsettings.get(get2.request); jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get2.expected, response); @@ -271,7 +269,7 @@ https://github.com/gpii/universal/LICENSE.txt }, 10); }); - gsettingsHandlerTests.asyncTest("GPII-8 Not core dumping on a non-existent key", function () { + jqUnit.asyncTest("GPII-8 Not core dumping on a non-existent key", function () { setTimeout(function() { var response = gpii.gsettings.set(gpii8.request); jqUnit.assertEquals("Didn't core dump. ", true,true); From 2a17c3e36b09308c6f5deb48fba6eb4b686bee83 Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Tue, 13 Aug 2013 12:21:06 -0400 Subject: [PATCH 069/319] GPII-116: updated tests. gsettings tests use depricated setting paths. need to be updated. --- node_modules/gsettingsBridge/tests/tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/gsettingsBridge/tests/tests.js b/node_modules/gsettingsBridge/tests/tests.js index 629d553..6e01f4f 100644 --- a/node_modules/gsettingsBridge/tests/tests.js +++ b/node_modules/gsettingsBridge/tests/tests.js @@ -1,4 +1,4 @@ -var gsettings = require("./gsettings_bridge"); +var gsettings = require("../gsettings_bridge.js"); var util = require("util"); var fs = require('fs'); From e9ab7b7c07285850a3e9ea845a34d47c55044e9b Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Thu, 15 Aug 2013 15:41:21 -0400 Subject: [PATCH 070/319] GPII-116: removed deprectaed test framework. --- node_modules/gsettingsBridge/tests/gsettingsTests.js | 1 - 1 file changed, 1 deletion(-) diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/node_modules/gsettingsBridge/tests/gsettingsTests.js index 30e81bf..db8b1db 100644 --- a/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -18,7 +18,6 @@ https://github.com/gpii/universal/LICENSE.txt gpii = fluid.registerNamespace("gpii"), jqUnit = fluid.require("jqUnit"); - fluid.require(__dirname+"/../../../../node_modules/universal/gpii/node_modules/testFramework/gpiiTests.js", require); fluid.require("gsettingsBridge", require); var put1 = { From f6291fcadd9dd4a8a3a51fa5438bea526f0105bc Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Fri, 16 Aug 2013 11:56:45 +0200 Subject: [PATCH 071/319] GPII-116: Changed all gsettings tests to be synchronous as opposed to async.. The async was a work-around due to a bug in jqunit --- .../gsettingsBridge/tests/gsettingsTests.js | 91 +++++++------------ 1 file changed, 35 insertions(+), 56 deletions(-) diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/node_modules/gsettingsBridge/tests/gsettingsTests.js index db8b1db..fef88fa 100644 --- a/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -204,76 +204,55 @@ https://github.com/gpii/universal/LICENSE.txt jqUnit.module("Gsettings Handler Tests"); - jqUnit.asyncTest("Getting single keys via gsettings handler", function() { - setTimeout(function() { + jqUnit.test("Getting single keys via gsettings handler", function() { //First check reading single keys ... the default values: - jqUnit.assertEquals("Checking 'double' key", 5.0, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "double-setting")); - jqUnit.assertEquals("Checking 'boolean' key", false, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); - jqUnit.assertEquals("Checking 'string' key", "abcdefg", - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); - jqUnit.start(); - }, 10); + jqUnit.assertEquals("Checking 'double' key", 5.0, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "double-setting")); + jqUnit.assertEquals("Checking 'boolean' key", false, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); + jqUnit.assertEquals("Checking 'string' key", "abcdefg", + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); }); - jqUnit.asyncTest("Setting single keys via gsettings handler", function() { - setTimeout(function() { - //set and check double value - gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "double-setting", 6.789); - jqUnit.assertEquals("Checking 'double' key", 6.789, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "double-setting")); - //set and check boolean value - gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting", true); - jqUnit.assertEquals("Checking 'boolean' key", true, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting")); - //set and check string value - gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); - jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); - jqUnit.start(); - }, 10); + jqUnit.test("Setting single keys via gsettings handler", function() { + //set and check double value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "double-setting", 6.789); + jqUnit.assertEquals("Checking 'double' key", 6.789, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "double-setting")); + //set and check boolean value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting", true); + jqUnit.assertEquals("Checking 'boolean' key", true, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting")); + //set and check string value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); + jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); }); - jqUnit.asyncTest("Setting multiple keys", function () { - setTimeout(function() { - var response = gpii.gsettings.set(put1.request); - jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put1.expected, response); - jqUnit.start(); - }, 10); + jqUnit.test("Setting multiple keys", function () { + var response = gpii.gsettings.set(put1.request); + jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put1.expected, response); }); - jqUnit.asyncTest("Setting multiple keys in multiple schemas", function () { - setTimeout(function() { - var response = gpii.gsettings.set(put2.request); - jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put2.expected, response); - jqUnit.start(); - }, 10); + jqUnit.test("Setting multiple keys in multiple schemas", function () { + var response = gpii.gsettings.set(put2.request); + jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put2.expected, response); }); - jqUnit.asyncTest("Getting multiple keys in multiple schemas", function () { - setTimeout(function() { - var response = gpii.gsettings.get(get1.request); - jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get1.expected, response); - jqUnit.start(); - }, 10); + jqUnit.test("Getting multiple keys in multiple schemas", function () { + var response = gpii.gsettings.get(get1.request); + jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get1.expected, response); }); - jqUnit.asyncTest("Getting multiple keys with settings block as null", function () { - setTimeout(function() { - var response = gpii.gsettings.get(get2.request); - jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get2.expected, response); - jqUnit.start(); - }, 10); + jqUnit.test("Getting multiple keys with settings block as null", function () { + var response = gpii.gsettings.get(get2.request); + jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get2.expected, response); }); - jqUnit.asyncTest("GPII-8 Not core dumping on a non-existent key", function () { - setTimeout(function() { - var response = gpii.gsettings.set(gpii8.request); - jqUnit.assertEquals("Didn't core dump. ", true,true); - jqUnit.start(); - }, 10); + jqUnit.test("GPII-8 Not core dumping on a non-existent key", function () { + var response = gpii.gsettings.set(gpii8.request); + jqUnit.assertEquals("Didn't core dump. ", true,true); }); }()); From ffa0915551d6f2580e7f261bd2980272e451d8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 19 Aug 2013 16:57:19 +0200 Subject: [PATCH 072/319] Using require to load user-settings.conf JSON file Removing old gpii.utils.getJSONFromFile, see: * https://github.com/GPII/universal/issues/128 * https://github.com/joyent/node/issues/6073 --- node_modules/orca/orcaSettingsHandler.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 1155adc..3b998ac 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -20,6 +20,11 @@ var spawn = require("child_process").spawn; var path = require("path"); + // Workaround to load orca's user-settings.conf file according to + // comments on https://github.com/joyent/node/issues/6073 + // + require.extensions['.conf'] = require.extensions['.json']; + // TODO: When FLUID-4852 is fixed, remove these definitions var getParser = { parser: { @@ -63,7 +68,7 @@ var options = app["org.gnome.orca"][0].options; var user = options.user; - var userSettings = gpii.getJSONFromFileSync(orcaSettingsFile); + var userSettings = require(orcaSettingsFile); var defaultProfiles = fluid.copy(userSettings.profiles); var defaultStartingProfile = fluid.copy(userSettings.general.startingProfile); var customizedProfile = fluid.copy(userSettings.general); From d22ea24a4c1e1920e5f196c6ca61f67c916c3edc Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Wed, 21 Aug 2013 17:49:43 +0200 Subject: [PATCH 073/319] GPII-20: Did last updates required for it to work with Kettle --- tests/integrationTesting.js | 2 +- tests/integrationTests/setup1/configs/development-config.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index 2650277..2629d53 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -92,7 +92,7 @@ var testDefs = [ fluid.registerNamespace("fluid.tests"); - require("../../node_modules/universal/gpii/node_modules/testFramework/index.js"); + require(__dirname+"/../../node_modules/universal/tests/IntegrationTests.js"); fluid.defaults("gpii.integrationTesting.tests", { gradeNames: ["fluid.test.testCaseHolder", "fluid.eventedComponent", "autoInit"], diff --git a/tests/integrationTests/setup1/configs/development-config.json b/tests/integrationTests/setup1/configs/development-config.json index 519fcd9..5ccec66 100644 --- a/tests/integrationTests/setup1/configs/development-config.json +++ b/tests/integrationTests/setup1/configs/development-config.json @@ -4,7 +4,7 @@ "gradeNames": ["autoInit", "fluid.littleComponent"], "components": { "server": { - "type": "gpii.server", + "type": "kettle.server", "options": { "logging": true, "port": 8081 From a384f31f5f8871f2cabb350313ae93d56a4eaaae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 22 Aug 2013 19:06:39 +0200 Subject: [PATCH 074/319] Addressing latest comments from Yura and Antranig [List of changes] * Replacing setParser with fluid.model.escapedSetConfig * Using just "var curDate" * Adding an explanation and a warning regarding the "while loop" blocking issue and its risks * Adding a max wait time to not block the main loop and return an error if required --- node_modules/orca/orcaSettingsHandler.js | 54 +++++++++++++++--------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 3b998ac..ab563c2 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -25,23 +25,6 @@ // require.extensions['.conf'] = require.extensions['.json']; - // TODO: When FLUID-4852 is fixed, remove these definitions - var getParser = { - parser: { - parse: fluid.pathUtil.parseEL, - compose: fluid.pathUtil.composePath - }, - strategies: [fluid.model.defaultFetchStrategy] - }; - - var setParser = { - parser: { - parse: fluid.pathUtil.parseEL, - compose: fluid.pathUtil.composePath - }, - strategies: [fluid.model.defaultFetchStrategy, fluid.model.defaultCreatorStrategy] - }; - var ORCA_ARGS = ["--disable", "speech", "--disable", "braille", "--disable", "braille-monitor", @@ -55,9 +38,26 @@ fluid.registerNamespace("gpii.launch"); fluid.registerNamespace("gpii.orca"); + // TODO: Remove this method and all the blocking stuff. + // (see https://github.com/GPII/linux/pull/16) + // + // This setting handler has to be converted to an asynchronous as soon as + // the lifecycle manager can handle asynchronous actions. + // + // The reason for this blocking code is because we need a mechanism to know + // when the Orca's settings file has been created. + // + // The blocking "while loop" is where this method is used and is a big + // stability risk to the system, since it blocks the node event loop + // possibly indefinitely. + // + // Once we can make this setting handler to be asynchronous, we can use + // fs.watch or any other similar asynchronous approaches to know + // when the orca settings file is being created. + // function wait(millis) { var date = new Date(); - var curDate = null; + var curDate; do { curDate = new Date(); } while(curDate-date < millis); @@ -81,7 +81,7 @@ " has requested these following settings: ", settings); for (var k in settings) { - fluid.set(customizedProfile, k, settings[k], setParser); + fluid.set(customizedProfile, k, settings[k], fluid.model.escapedSetConfig); } customizedProfile.profile = customizedProfile.activeProfile = @@ -115,10 +115,26 @@ var exists = fs.existsSync(orcaSettingsFile); if (!exists) { var orcaSpawn = spawn("orca", ORCA_ARGS); + var pass = 0; + var maxPass = 10; + var err; + while(!fs.existsSync(orcaSettingsFile)) { + if (pass == maxPass) { + err = "Time limit exceeded [" + maxPass*500 + + "ms] for creating Orca's configuration file"; + break; + } wait(500); + pass++; } + orcaSpawn.kill("SIGKILL"); + if (err) { + fluid.fail(err); + fluid.log(err); + return; + } } var returnValue = applySettings(profile); From 13b75679536e5706585643305bd5edab39ae4acd Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Fri, 23 Aug 2013 10:45:30 -0400 Subject: [PATCH 075/319] GPII-89: minor clean up of orca settings handler comments/ --- node_modules/orca/index.js | 4 ++-- node_modules/orca/orcaSettingsHandler.js | 10 +++++----- node_modules/orca/package.json | 2 +- .../orca/test/orcaSettingsHandlerTests.js | 17 +++++++++-------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/node_modules/orca/index.js b/node_modules/orca/index.js index d2dfff4..96647cb 100644 --- a/node_modules/orca/index.js +++ b/node_modules/orca/index.js @@ -1,4 +1,4 @@ -/*! +/** * GPII Orca Settings Handler * * Copyright 2013 Emergya @@ -9,7 +9,7 @@ * * You may obtain a copy of the License at * https://github.com/gpii/universal/LICENSE.txt - * */ + */ var fluid = require("universal"); diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index ab563c2..a5abbff 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -1,4 +1,4 @@ -/*! +/** * GPII Orca Settings Handler * * Copyright 2013 Emergya @@ -9,7 +9,7 @@ * * You may obtain a copy of the License at * https://github.com/gpii/universal/LICENSE.txt - * */ + */ (function () { "use strict"; @@ -43,7 +43,7 @@ // // This setting handler has to be converted to an asynchronous as soon as // the lifecycle manager can handle asynchronous actions. - // + // // The reason for this blocking code is because we need a mechanism to know // when the Orca's settings file has been created. // @@ -58,7 +58,7 @@ function wait(millis) { var date = new Date(); var curDate; - + do { curDate = new Date(); } while(curDate-date < millis); } @@ -130,7 +130,7 @@ } orcaSpawn.kill("SIGKILL"); - if (err) { + if (err) { fluid.fail(err); fluid.log(err); return; diff --git a/node_modules/orca/package.json b/node_modules/orca/package.json index 872bcc1..c396833 100644 --- a/node_modules/orca/package.json +++ b/node_modules/orca/package.json @@ -1,7 +1,7 @@ { "name": "orca", "description": "GPII Orca Settings Handler", - "version": "0.1", + "version": "0.1.0", "author": "Javier Hernández", "bugs": "http://wiki.gpii.net/index.php/Main_Page", "homepage": "http://gpii.net/", diff --git a/node_modules/orca/test/orcaSettingsHandlerTests.js b/node_modules/orca/test/orcaSettingsHandlerTests.js index 288851b..958f1ea 100644 --- a/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -1,4 +1,4 @@ -/*! +/* Orca Settings Handler Tests Copyright 2013 Emergya @@ -14,8 +14,9 @@ var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"), jqUnit = fluid.require("jqUnit"), fs = require("fs"); - var orcaSettingsHandler = require("../orcaSettingsHandler"); - var orca = fluid.registerNamespace("gpii.orca"); + +require("orcaSettingsHandler"); +var orca = fluid.registerNamespace("gpii.orca"); jqUnit.module("OrcaSettingsHandler Module"); @@ -23,7 +24,7 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { jqUnit.expect(10); var payload = { - "org.gnome.orca": [{ + "org.gnome.orca": [{ options: { "user": "test1" }, @@ -43,7 +44,7 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { // Check if profile exists // - jqUnit.assertTrue("Profile 'test1' exists", returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1); + jqUnit.assertTrue("Profile 'test1' exists", returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1); // Check if 'test1' is the default starting profile // @@ -61,11 +62,11 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { // Check for voices' stuff // jqUnit.assertDeepEq("Checking for voices.default.rate setting", - payload["org.gnome.orca"][0].settings["voices.default.rate"], + payload["org.gnome.orca"][0].settings["voices.default.rate"], returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices.default.rate); jqUnit.assertDeepEq("Checking for voices.default.family setting", - payload["org.gnome.orca"][0].settings["voices.default.family"], + payload["org.gnome.orca"][0].settings["voices.default.family"], returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices.default.family); // Let's simulate a logout and restore the settings file into its initial state @@ -77,6 +78,6 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { // Check if 'test1' profile has been removed successfully // - jqUnit.assertFalse("Profile 'test1' does not exists", newReturnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1); + jqUnit.assertFalse("Profile 'test1' does not exists", newReturnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1); }); From ddd283e48fd9deff7b799201170c6aad18f4592f Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Fri, 23 Aug 2013 11:13:16 -0400 Subject: [PATCH 076/319] GPII-89: updated orca tests. --- node_modules/orca/test/orcaSettingsHandlerTests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/orca/test/orcaSettingsHandlerTests.js b/node_modules/orca/test/orcaSettingsHandlerTests.js index 958f1ea..905bbca 100644 --- a/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -15,7 +15,7 @@ var fluid = require("universal"), jqUnit = fluid.require("jqUnit"), fs = require("fs"); -require("orcaSettingsHandler"); +require("orca"); var orca = fluid.registerNamespace("gpii.orca"); jqUnit.module("OrcaSettingsHandler Module"); From 4225aab80674710b6d01391120ce6c797955d0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 28 Aug 2013 11:53:58 +0200 Subject: [PATCH 077/319] GPII-182: Removing call to g_type_init g_type_init function has been deprecated since glib version 2.36, see: https://developer.gnome.org/gobject/stable/gobject-Type-Information.html#g-type-init --- node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index 13ebc8c..1924364 100644 --- a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -118,7 +118,6 @@ Handle set_gsetting(const Arguments& args) { } void init(Handle target) { - g_type_init(); // Initialize gobject system target->Set(String::NewSymbol("set_gsetting"), FunctionTemplate::New(set_gsetting)->GetFunction()); target->Set(String::NewSymbol("get_gsetting"), From 1b4f73834061533cf6a8da0fba2ee51d3423611d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 28 Aug 2013 12:05:08 +0200 Subject: [PATCH 078/319] GPII-182: Declare variant and type just once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change fixes the "variable ‘type’ set but not used" warning --- node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index 1924364..716f069 100644 --- a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -75,6 +75,8 @@ Handle get_gsetting(const Arguments& args) { Handle set_gsetting(const Arguments& args) { HandleScope scope; GSettings *settings; + GVariant* variant; + const GVariantType* type; char schema[1024]; char key[1024]; bool status = false; @@ -86,8 +88,6 @@ Handle set_gsetting(const Arguments& args) { status = g_settings_set_boolean(settings,key,args[2]->BooleanValue()); } else if (args[2]->IsNumber()) { - GVariant* variant; - const GVariantType* type; variant = g_settings_get_value(settings,key); type = g_variant_get_type(variant); if (g_variant_type_equal(type,G_VARIANT_TYPE_DOUBLE)) { @@ -102,8 +102,6 @@ Handle set_gsetting(const Arguments& args) { } } else if (args[2]->IsString()) { - GVariant* variant; - const GVariantType* type; char val[1024]; variant = g_settings_get_value(settings,key); type = g_variant_get_type(variant); From 1e6e4b456d021afe9aa24c1976f4bd21030ed2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 28 Aug 2013 12:10:57 +0200 Subject: [PATCH 079/319] GPII-182: Add a return value to get_gsetting function This change fixes the "control reaches end of non-void function" warning --- node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index 716f069..04c9ce8 100644 --- a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -68,6 +68,7 @@ Handle get_gsetting(const Arguments& args) { else { g_print("The type is %s\n", g_variant_type_peek_string(type)); ThrowException(Exception::Error(String::New("Need to implement reading that value type"))); + return scope.Close(Undefined()); } } From bc793442680c7dd83c2cbf18aabeff97b7dbf921 Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Fri, 6 Sep 2013 11:29:52 -0400 Subject: [PATCH 080/319] GPII-190: updated the default config name. --- gpii.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpii.js b/gpii.js index 0b3e6bd..455410d 100644 --- a/gpii.js +++ b/gpii.js @@ -17,6 +17,6 @@ fluid.require("gsettingsBridge", require); fluid.require("orca", require); kettle.config.makeConfigLoader({ - nodeEnv: kettle.config.getNodeEnv("fm.ps.sr.dr.mm.os.development"), + nodeEnv: kettle.config.getNodeEnv("fm.ps.sr.dr.mm.os.lms.development"), configPath: kettle.config.getConfigPath() || "../node_modules/universal/gpii/configs" }); From a2fe8464e6722b1536d1f9ec188d93a36efde6ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 27 Aug 2013 18:01:42 +0200 Subject: [PATCH 081/319] GPII-20: Adding a first integration test for the Orca settings handler --- tests/integrationTesting.js | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index 2629d53..a674845 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -80,6 +80,36 @@ var testDefs = [ expect: "true" } ] + }, + { + name: "Testing orca1 using Flat matchmaker", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "orca1", + settingsHandlers: { + "gpii.orca": { + "data": [{ + "settings": { + "sayAllStyle": 0, + "enableSpeech": true, + "enableBraille": true, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + 'voices.default.rate': 90.9090909090909, + "enableTutorialMessages": false, + 'voices.default.family': { "locale": 'es', "name": 'spanish-latin-american' }, + "verbalizePunctuationStyle": 0 + }, + "options": { + "user": "orca1" + } + } ] + } + }, + processes: [ + ] } ]; @@ -89,6 +119,7 @@ var testDefs = [ gpii = fluid.registerNamespace("gpii"); require("gsettingsBridge"); + require("orca"); fluid.registerNamespace("fluid.tests"); @@ -112,7 +143,7 @@ var testDefs = [ tests: gpii.integrationTesting.buildTestFixtures(testDefs) }] }); - + fluid.tests.testTests = function () { fluid.test.runTests([ "gpii.integrationTesting.testEnv" @@ -120,4 +151,4 @@ var testDefs = [ }; fluid.tests.testTests(); -})(); \ No newline at end of file +})(); From 48cd586d5154b359b565ca28732893f01692f77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 30 Aug 2013 12:47:09 +0200 Subject: [PATCH 082/319] GPII-20: Add integration tests for the Flat matchmaker [Added NP sets] * os_common * screenreader_common Both "MikelVargas" and "sammy" NP sets have been commented, so they aren't being tested. --- tests/integrationTesting.js | 155 ++++++++++++++++++++++++------------ 1 file changed, 102 insertions(+), 53 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index a674845..bdfeeb4 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -13,65 +13,103 @@ https://github.com/gpii/universal/LICENSE.txt /*global __dirname, require*/ var testDefs = [ +// { +// name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", +// gpiiConfig: { +// nodeEnv: "development-config", +// configPath: __dirname+"/integrationTests/setup1/configs" +// }, +// token: "MikelVargas", +// settingsHandlers: { +// "gpii.gsettings": { +// "data": [{ +// "settings": { +// "slowkeys-delay": 400, +// "slowkeys-enable": true, +// "bouncekeys-delay": 200, +// "mousekeys-enable": true, +// "stickykeys-enable": true, +// "bouncekeys-enable": true, +// "mousekeys-max-speed": 850, +// "mousekeys-init-delay": 120, +// "mousekeys-accel-time": 800 +// }, +// "options": { +// "schema": "org.gnome.desktop.a11y.keyboard" +// } +// }] +// } +// }, +// processes: [ +// { +// command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", +// expect: "true" +// } +// ] +// }, +// { +// name: "Testing Sammy using Flat matchmaker", +// gpiiConfig: { +// nodeEnv: "development-config", +// configPath: __dirname+"/integrationTests/setup1/configs" +// }, +// token: "sammy", +// settingsHandlers: { +// "gpii.gsettings": { +// "data": [{ +// "settings": { +// "mag-factor": 2, +// "mouse-tracking": "centered" +// }, +// "options": { +// "schema": "org.gnome.desktop.a11y.magnifier" +// } +// }, { +// "settings": { +// "text-scaling-factor":1 +// }, +// "options": { +// "schema": "org.gnome.desktop.interface" +// } +// } ] +// } +// }, +// processes: [ +// { +// command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", +// expect: "true" +// } +// ] +// }, { - name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", + name: "Testing os_common using Flat matchmaker", gpiiConfig: { nodeEnv: "development-config", configPath: __dirname+"/integrationTests/setup1/configs" }, - token: "MikelVargas", + token: "os_common", settingsHandlers: { "gpii.gsettings": { "data": [{ "settings": { - "slowkeys-delay": 400, - "slowkeys-enable": true, - "bouncekeys-delay": 200, - "mousekeys-enable": true, - "stickykeys-enable": true, - "bouncekeys-enable": true, - "mousekeys-max-speed": 850, - "mousekeys-init-delay": 120, - "mousekeys-accel-time": 800 + "mag-factor": 1.5, + "screen-position": "full-screen", + "show-cross-hairs": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" }, - "options": { - "schema": "org.gnome.desktop.a11y.keyboard" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", - expect: "true" - } - ] - }, - { - name: "Testing Sammy using Flat matchmaker", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "sammy", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ + } , { "settings": { - "mag-factor": 2, - "mouse-tracking": "centered" - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - } - }, { - "settings": { - "text-scaling-factor":1 + "gtk-theme": "HighContrast", + "icon-theme": "HighContrast", + "text-scaling-factor": 1.0, + "cursor-size": 41 }, "options": { "schema": "org.gnome.desktop.interface" } - } ] + }] } }, processes: [ @@ -82,28 +120,39 @@ var testDefs = [ ] }, { - name: "Testing orca1 using Flat matchmaker", + name: "Testing screenreader_common using Flat matchmaker", gpiiConfig: { nodeEnv: "development-config", configPath: __dirname+"/integrationTests/setup1/configs" }, - token: "orca1", + token: "screenreader_common", settingsHandlers: { "gpii.orca": { "data": [{ "settings": { - "sayAllStyle": 0, - "enableSpeech": true, - "enableBraille": true, + "sayAllStyle": 1, "enableEchoByWord": true, "enableEchoByCharacter": false, - 'voices.default.rate': 90.9090909090909, "enableTutorialMessages": false, - 'voices.default.family': { "locale": 'es', "name": 'spanish-latin-american' }, - "verbalizePunctuationStyle": 0 + "verbalizePunctuationStyle": 0, + "enableSpeech": true, + "voices" : { + "default" : { + "established": false, + "rate": 102.27272727272727, + "family": { + "locale": "en", + "name": "en-westindies" + }, + + }, + "uppercase": { "average-pitch": 5.6 }, + "system": { "established": false }, + "hyperlink": { "established": false } + } }, "options": { - "user": "orca1" + "user": "screenreader_common" } } ] } From 5a0d146fc7c4a0f3e94c9465aba813162f3d8d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 2 Sep 2013 16:23:46 +0200 Subject: [PATCH 083/319] GPII-20: Setting average-pitch expected value to 7 Updating average-pitch's value according to Orca's default see: https://git.gnome.org/browse/orca/commit/?id=3ead40a2befb04cbd25f9edf96b6c94de285a1c9 --- tests/integrationTesting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index bdfeeb4..dc84d5f 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -146,7 +146,7 @@ var testDefs = [ }, }, - "uppercase": { "average-pitch": 5.6 }, + "uppercase": { "average-pitch": 7 }, "system": { "established": false }, "hyperlink": { "established": false } } From b7a5c6850b2a18e14ef5859da3edd02f88ffef11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 5 Sep 2013 18:53:15 +0200 Subject: [PATCH 084/319] GPII-20: Adding remaining NP sets for integration testing [NP sets for integration testing] * os_gnome * os_win7 * screenreader_orca * screenreader_nvda Uncommenting "MikelVargas" and "sammy" NP sets --- tests/integrationTesting.js | 290 +++++++++++++++++++++++++++--------- 1 file changed, 221 insertions(+), 69 deletions(-) diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js index dc84d5f..dcff27a 100644 --- a/tests/integrationTesting.js +++ b/tests/integrationTesting.js @@ -13,74 +13,74 @@ https://github.com/gpii/universal/LICENSE.txt /*global __dirname, require*/ var testDefs = [ -// { -// name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", -// gpiiConfig: { -// nodeEnv: "development-config", -// configPath: __dirname+"/integrationTests/setup1/configs" -// }, -// token: "MikelVargas", -// settingsHandlers: { -// "gpii.gsettings": { -// "data": [{ -// "settings": { -// "slowkeys-delay": 400, -// "slowkeys-enable": true, -// "bouncekeys-delay": 200, -// "mousekeys-enable": true, -// "stickykeys-enable": true, -// "bouncekeys-enable": true, -// "mousekeys-max-speed": 850, -// "mousekeys-init-delay": 120, -// "mousekeys-accel-time": 800 -// }, -// "options": { -// "schema": "org.gnome.desktop.a11y.keyboard" -// } -// }] -// } -// }, -// processes: [ -// { -// command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", -// expect: "true" -// } -// ] -// }, -// { -// name: "Testing Sammy using Flat matchmaker", -// gpiiConfig: { -// nodeEnv: "development-config", -// configPath: __dirname+"/integrationTests/setup1/configs" -// }, -// token: "sammy", -// settingsHandlers: { -// "gpii.gsettings": { -// "data": [{ -// "settings": { -// "mag-factor": 2, -// "mouse-tracking": "centered" -// }, -// "options": { -// "schema": "org.gnome.desktop.a11y.magnifier" -// } -// }, { -// "settings": { -// "text-scaling-factor":1 -// }, -// "options": { -// "schema": "org.gnome.desktop.interface" -// } -// } ] -// } -// }, -// processes: [ -// { -// command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", -// expect: "true" -// } -// ] -// }, + { + name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "MikelVargas", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "slowkeys-delay": 400, + "slowkeys-enable": true, + "bouncekeys-delay": 200, + "mousekeys-enable": true, + "stickykeys-enable": true, + "bouncekeys-enable": true, + "mousekeys-max-speed": 850, + "mousekeys-init-delay": 120, + "mousekeys-accel-time": 800 + }, + "options": { + "schema": "org.gnome.desktop.a11y.keyboard" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", + expect: "true" + } + ] + }, + { + name: "Testing Sammy using Flat matchmaker", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "sammy", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 2, + "mouse-tracking": "centered" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + } + }, { + "settings": { + "text-scaling-factor":1 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + } ] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + expect: "true" + } + ] + }, { name: "Testing os_common using Flat matchmaker", gpiiConfig: { @@ -103,7 +103,79 @@ var testDefs = [ "settings": { "gtk-theme": "HighContrast", "icon-theme": "HighContrast", - "text-scaling-factor": 1.0, + "text-scaling-factor": 0.75, + "cursor-size": 41 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + expect: "true" + } + ] + }, + { + name: "Testing os_gnome using Flat matchmaker", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "os_gnome", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen", + "show-cross-hairs": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + }, + } , { + "settings": { + "text-scaling-factor": 0.75, + "cursor-size": 90 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + expect: "true" + } + ] + }, + { + name: "Testing os_win7 using Flat matchmaker", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "os_win7", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + }, + } , { + "settings": { + "gtk-theme":"HighContrast", + "icon-theme":"HighContrast", "cursor-size": 41 }, "options": { @@ -159,6 +231,86 @@ var testDefs = [ }, processes: [ ] + }, + { + name: "Testing screenreader_orca using Flat matchmaker", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "screenreader_orca", + settingsHandlers: { + "gpii.orca": { + "data": [{ + "settings": { + "sayAllStyle": 1, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "enableTutorialMessages": false, + "verbalizePunctuationStyle": 0, + "voices" : { + "default" : { + "established": false, + "rate": 102.27272727272727, + "family": { + "locale": "en", + "name": "en-westindies" + }, + + }, + "uppercase": { "average-pitch": 7 }, + "system": { "established": false }, + "hyperlink": { "established": false } + } + }, + "options": { + "user": "screenreader_orca" + } + } ] + } + }, + processes: [ + ] + }, + { + name: "Testing screenreader_nvda using Flat matchmaker", + gpiiConfig: { + nodeEnv: "development-config", + configPath: __dirname+"/integrationTests/setup1/configs" + }, + token: "screenreader_nvda", + settingsHandlers: { + "gpii.orca": { + "data": [{ + "settings": { + "sayAllStyle": 1, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "enableTutorialMessages": false, + "verbalizePunctuationStyle": 0, + "voices" : { + "default" : { + "established": false, + "rate": 102.27272727272727, + "family": { + "locale": "en", + "name": "en-westindies" + }, + + }, + "uppercase": { "average-pitch": 7 }, + "system": { "established": false }, + "hyperlink": { "established": false } + } + }, + "options": { + "user": "screenreader_nvda" + } + }] + } + }, + processes: [ + ] } ]; From 7b743765207ea47d0b45e36c1cb7b86a96c92477 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Sat, 14 Sep 2013 19:39:23 +0200 Subject: [PATCH 085/319] GPII-20: First steps at updating linux acceptance testing to work with framework changes in universal --- tests/AcceptanceTests.js | 318 ++++++++++++++++ .../setup1/configs/development-config.json | 5 + tests/integrationTesting.js | 355 ------------------ .../setup1/configs/development-config.json | 23 -- 4 files changed, 323 insertions(+), 378 deletions(-) create mode 100644 tests/AcceptanceTests.js create mode 100644 tests/acceptanceTests/setup1/configs/development-config.json delete mode 100644 tests/integrationTesting.js delete mode 100644 tests/integrationTests/setup1/configs/development-config.json diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js new file mode 100644 index 0000000..0248c5f --- /dev/null +++ b/tests/AcceptanceTests.js @@ -0,0 +1,318 @@ +/* + +GPII acceptance Testing + +Copyright 2013 Raising the Floor International + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +/*global __dirname, require*/ + +"use strict"; +var fluid = require("universal"), + path = require("path"), + gpii = fluid.registerNamespace("gpii"); + +require("gsettingsBridge"); +require("orca"); + +fluid.registerNamespace("fluid.tests"); + +require(__dirname+"/../../node_modules/universal/tests/AcceptanceTests.js"); + +var configPath = path.resolve(__dirname, "./acceptanceTests/setup1/configs"); +var gpiiConfig = { + nodeEnv: "development-config", + configPath: configPath +}; + +var testDefs = [ + // { + // name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", + // gpiiConfig: gpiiConfig, + // token: "MikelVargas", + // settingsHandlers: { + // "gpii.gsettings": { + // "data": [{ + // "settings": { + // "slowkeys-delay": 400, + // "slowkeys-enable": true, + // "bouncekeys-delay": 200, + // "mousekeys-enable": true, + // "stickykeys-enable": true, + // "bouncekeys-enable": true, + // "mousekeys-max-speed": 850, + // "mousekeys-init-delay": 120, + // "mousekeys-accel-time": 800 + // }, + // "options": { + // "schema": "org.gnome.desktop.a11y.keyboard" + // } + // }] + // } + // }, + // processes: [ + // { + // command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", + // expectConfigured: "true", + // expectRestored: "false" + // } + // ] + // }, + // { + // name: "Testing Sammy using Flat matchmaker", + // gpiiConfig: gpiiConfig, + // token: "sammy", + // settingsHandlers: { + // "gpii.gsettings": { + // "data": [{ + // "settings": { + // "mag-factor": 2, + // "mouse-tracking": "centered" + // }, + // "options": { + // "schema": "org.gnome.desktop.a11y.magnifier" + // } + // }, { + // "settings": { + // "text-scaling-factor":1 + // }, + // "options": { + // "schema": "org.gnome.desktop.interface" + // } + // } ] + // } + // }, + // processes: [ + // { + // command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + // expectConfigured: "true", + // expectRestored: "false" + // } + // ] + // }, + // { + // name: "Testing os_common using Flat matchmaker", + // gpiiConfig: gpiiConfig, + // token: "os_common", + // settingsHandlers: { + // "gpii.gsettings": { + // "data": [{ + // "settings": { + // "mag-factor": 1.5, + // "screen-position": "full-screen", + // "show-cross-hairs": false + // }, + // "options": { + // "schema": "org.gnome.desktop.a11y.magnifier" + // }, + // } , { + // "settings": { + // "gtk-theme": "HighContrast", + // "icon-theme": "HighContrast", + // "text-scaling-factor": 0.75, + // "cursor-size": 41 + // }, + // "options": { + // "schema": "org.gnome.desktop.interface" + // } + // }] + // } + // }, + // processes: [ + // { + // command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + // expectConfigured: "true", + // expectRestored: "false" + // } + // ] + // }, + // { + // name: "Testing os_gnome using Flat matchmaker", + // gpiiConfig: gpiiConfig, + // token: "os_gnome", + // settingsHandlers: { + // "gpii.gsettings": { + // "data": [{ + // "settings": { + // "mag-factor": 1.5, + // "screen-position": "full-screen", + // "show-cross-hairs": false + // }, + // "options": { + // "schema": "org.gnome.desktop.a11y.magnifier" + // }, + // } , { + // "settings": { + // "text-scaling-factor": 0.75, + // "cursor-size": 90 + // }, + // "options": { + // "schema": "org.gnome.desktop.interface" + // } + // }] + // } + // }, + // processes: [ + // { + // command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + // expectConfigured: "true", + // expectRestored: "false" + // } + // ] + // }, + // { + // name: "Testing os_win7 using Flat matchmaker", + // gpiiConfig: gpiiConfig, + // token: "os_win7", + // settingsHandlers: { + // "gpii.gsettings": { + // "data": [{ + // "settings": { + // "mag-factor": 1.5, + // "screen-position": "full-screen" + // }, + // "options": { + // "schema": "org.gnome.desktop.a11y.magnifier" + // }, + // } , { + // "settings": { + // "gtk-theme":"HighContrast", + // "icon-theme":"HighContrast", + // "cursor-size": 41 + // }, + // "options": { + // "schema": "org.gnome.desktop.interface" + // } + // }] + // } + // }, + // processes: [ + // { + // command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + // expectConfigured: "true", + // expectRestored: "false" + // } + // ] + // }, + // { + // name: "Testing screenreader_common using Flat matchmaker", + // gpiiConfig: gpiiConfig, + // token: "screenreader_common", + // settingsHandlers: { + // "gpii.orca": { + // "data": [{ + // "settings": { + // "sayAllStyle": 1, + // "enableEchoByWord": true, + // "enableEchoByCharacter": false, + // "enableTutorialMessages": false, + // "verbalizePunctuationStyle": 0, + // "enableSpeech": true, + // "voices" : { + // "default" : { + // "established": false, + // "rate": 102.27272727272727, + // "family": { + // "locale": "en", + // "name": "en-westindies" + // }, + + // }, + // "uppercase": { "average-pitch": 7 }, + // "system": { "established": false }, + // "hyperlink": { "established": false } + // } + // }, + // "options": { + // "user": "screenreader_common" + // } + // } ] + // } + // }, + // processes: [ + // ] + // }, + { + name: "Testing screenreader_orca using Flat matchmaker", + gpiiConfig: gpiiConfig, + token: "screenreader_orca", + settingsHandlers: { + "gpii.orca": { + "data": [{ + "settings": { + "sayAllStyle": 1, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "enableTutorialMessages": false, + "verbalizePunctuationStyle": 0, + "voices" : { + "default" : { + "established": false, + "rate": 102.27272727272727, + "family": { + "locale": "en", + "name": "en-westindies" + }, + + }, + "uppercase": { "average-pitch": 7 }, + "system": { "established": false }, + "hyperlink": { "established": false } + } + }, + "options": { + "user": "screenreader_orca" + } + } ] + } + }, + processes: [ + ] + } + // , + // { + // name: "Testing screenreader_nvda using Flat matchmaker", + // gpiiConfig: gpiiConfig, + // token: "screenreader_nvda", + // settingsHandlers: { + // "gpii.orca": { + // "data": [{ + // "settings": { + // "sayAllStyle": 1, + // "enableEchoByWord": true, + // "enableEchoByCharacter": false, + // "enableTutorialMessages": false, + // "verbalizePunctuationStyle": 0, + // "voices" : { + // "default" : { + // "established": false, + // "rate": 102.27272727272727, + // "family": { + // "locale": "en", + // "name": "en-westindies" + // }, + + // }, + // "uppercase": { "average-pitch": 7 }, + // "system": { "established": false }, + // "hyperlink": { "established": false } + // } + // }, + // "options": { + // "user": "screenreader_nvda" + // } + // }] + // } + // }, + // processes: [ + // ] + // } +]; + +gpii.acceptanceTesting.buildTests(testDefs, gpiiConfig); diff --git a/tests/acceptanceTests/setup1/configs/development-config.json b/tests/acceptanceTests/setup1/configs/development-config.json new file mode 100644 index 0000000..b761bdf --- /dev/null +++ b/tests/acceptanceTests/setup1/configs/development-config.json @@ -0,0 +1,5 @@ +{ + "includes": [ + "../../../../../node_modules/universal/gpii/configs/fm.ps.sr.dr.mm.os.development.json" + ] +} \ No newline at end of file diff --git a/tests/integrationTesting.js b/tests/integrationTesting.js deleted file mode 100644 index dcff27a..0000000 --- a/tests/integrationTesting.js +++ /dev/null @@ -1,355 +0,0 @@ -/* - -GPII Integration Testing - -Copyright 2013 Raising the Floor International - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ - -/*global __dirname, require*/ -var testDefs = [ - { - name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "MikelVargas", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "slowkeys-delay": 400, - "slowkeys-enable": true, - "bouncekeys-delay": 200, - "mousekeys-enable": true, - "stickykeys-enable": true, - "bouncekeys-enable": true, - "mousekeys-max-speed": 850, - "mousekeys-init-delay": 120, - "mousekeys-accel-time": 800 - }, - "options": { - "schema": "org.gnome.desktop.a11y.keyboard" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", - expect: "true" - } - ] - }, - { - name: "Testing Sammy using Flat matchmaker", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "sammy", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "mag-factor": 2, - "mouse-tracking": "centered" - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - } - }, { - "settings": { - "text-scaling-factor":1 - }, - "options": { - "schema": "org.gnome.desktop.interface" - } - } ] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - expect: "true" - } - ] - }, - { - name: "Testing os_common using Flat matchmaker", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "os_common", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "mag-factor": 1.5, - "screen-position": "full-screen", - "show-cross-hairs": false - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - }, - } , { - "settings": { - "gtk-theme": "HighContrast", - "icon-theme": "HighContrast", - "text-scaling-factor": 0.75, - "cursor-size": 41 - }, - "options": { - "schema": "org.gnome.desktop.interface" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - expect: "true" - } - ] - }, - { - name: "Testing os_gnome using Flat matchmaker", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "os_gnome", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "mag-factor": 1.5, - "screen-position": "full-screen", - "show-cross-hairs": false - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - }, - } , { - "settings": { - "text-scaling-factor": 0.75, - "cursor-size": 90 - }, - "options": { - "schema": "org.gnome.desktop.interface" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - expect: "true" - } - ] - }, - { - name: "Testing os_win7 using Flat matchmaker", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "os_win7", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "mag-factor": 1.5, - "screen-position": "full-screen" - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - }, - } , { - "settings": { - "gtk-theme":"HighContrast", - "icon-theme":"HighContrast", - "cursor-size": 41 - }, - "options": { - "schema": "org.gnome.desktop.interface" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - expect: "true" - } - ] - }, - { - name: "Testing screenreader_common using Flat matchmaker", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "screenreader_common", - settingsHandlers: { - "gpii.orca": { - "data": [{ - "settings": { - "sayAllStyle": 1, - "enableEchoByWord": true, - "enableEchoByCharacter": false, - "enableTutorialMessages": false, - "verbalizePunctuationStyle": 0, - "enableSpeech": true, - "voices" : { - "default" : { - "established": false, - "rate": 102.27272727272727, - "family": { - "locale": "en", - "name": "en-westindies" - }, - - }, - "uppercase": { "average-pitch": 7 }, - "system": { "established": false }, - "hyperlink": { "established": false } - } - }, - "options": { - "user": "screenreader_common" - } - } ] - } - }, - processes: [ - ] - }, - { - name: "Testing screenreader_orca using Flat matchmaker", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "screenreader_orca", - settingsHandlers: { - "gpii.orca": { - "data": [{ - "settings": { - "sayAllStyle": 1, - "enableEchoByWord": true, - "enableEchoByCharacter": false, - "enableTutorialMessages": false, - "verbalizePunctuationStyle": 0, - "voices" : { - "default" : { - "established": false, - "rate": 102.27272727272727, - "family": { - "locale": "en", - "name": "en-westindies" - }, - - }, - "uppercase": { "average-pitch": 7 }, - "system": { "established": false }, - "hyperlink": { "established": false } - } - }, - "options": { - "user": "screenreader_orca" - } - } ] - } - }, - processes: [ - ] - }, - { - name: "Testing screenreader_nvda using Flat matchmaker", - gpiiConfig: { - nodeEnv: "development-config", - configPath: __dirname+"/integrationTests/setup1/configs" - }, - token: "screenreader_nvda", - settingsHandlers: { - "gpii.orca": { - "data": [{ - "settings": { - "sayAllStyle": 1, - "enableEchoByWord": true, - "enableEchoByCharacter": false, - "enableTutorialMessages": false, - "verbalizePunctuationStyle": 0, - "voices" : { - "default" : { - "established": false, - "rate": 102.27272727272727, - "family": { - "locale": "en", - "name": "en-westindies" - }, - - }, - "uppercase": { "average-pitch": 7 }, - "system": { "established": false }, - "hyperlink": { "established": false } - } - }, - "options": { - "user": "screenreader_nvda" - } - }] - } - }, - processes: [ - ] - } -]; - -(function () { - "use strict"; - var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"); - - require("gsettingsBridge"); - require("orca"); - - fluid.registerNamespace("fluid.tests"); - - require(__dirname+"/../../node_modules/universal/tests/IntegrationTests.js"); - - fluid.defaults("gpii.integrationTesting.tests", { - gradeNames: ["fluid.test.testCaseHolder", "fluid.eventedComponent", "autoInit"], - testDefs: testDefs, - settingsStore: {}, - components: { - gpii: { - type: "gpii.integrationTesting.tests.server", - createOnEvent: "createServer" - } - }, - events: { - createServer: null - }, - modules: [ { - name: "Full login/logout cycle", - tests: gpii.integrationTesting.buildTestFixtures(testDefs) - }] - }); - - fluid.tests.testTests = function () { - fluid.test.runTests([ - "gpii.integrationTesting.testEnv" - ]); - }; - - fluid.tests.testTests(); -})(); diff --git a/tests/integrationTests/setup1/configs/development-config.json b/tests/integrationTests/setup1/configs/development-config.json deleted file mode 100644 index 5ccec66..0000000 --- a/tests/integrationTests/setup1/configs/development-config.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "typeName": "flowManager.preferencesServer.solutionsRegistry.deviceReporter.matchMaker.ontologyServer.development", - "options": { - "gradeNames": ["autoInit", "fluid.littleComponent"], - "components": { - "server": { - "type": "kettle.server", - "options": { - "logging": true, - "port": 8081 - } - } - } - }, - "includes": [ - "../../../../../node_modules/universal/gpii/node_modules/deviceReporter/configs/development.json", - "../../../../../node_modules/universal/gpii/node_modules/flowManager/configs/development.json", - "../../../../../node_modules/universal/gpii/node_modules/matchMaker/configs/development.json", - "../../../../../node_modules/universal/gpii/node_modules/ontologyServer/configs/development.json", - "../../../../../node_modules/universal/gpii/node_modules/preferencesServer/configs/development.json", - "../../../../../node_modules/universal/gpii/node_modules/solutionsRegistry/configs/development.json" - ] -} \ No newline at end of file From 49810001b965bbce7e2876c25a5b3f2984da275f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Sat, 14 Sep 2013 23:39:13 +0200 Subject: [PATCH 086/319] GPII-20: Finishing with linux's AcceptanceTesting [changes] * Updating sammy's scaling-factor expected value * Adding 'processes' for Orca-related tests * Leaving all the users nncommented --- tests/AcceptanceTests.js | 503 ++++++++++++++++++++------------------- 1 file changed, 258 insertions(+), 245 deletions(-) diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index 0248c5f..875c715 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -32,212 +32,217 @@ var gpiiConfig = { }; var testDefs = [ - // { - // name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", - // gpiiConfig: gpiiConfig, - // token: "MikelVargas", - // settingsHandlers: { - // "gpii.gsettings": { - // "data": [{ - // "settings": { - // "slowkeys-delay": 400, - // "slowkeys-enable": true, - // "bouncekeys-delay": 200, - // "mousekeys-enable": true, - // "stickykeys-enable": true, - // "bouncekeys-enable": true, - // "mousekeys-max-speed": 850, - // "mousekeys-init-delay": 120, - // "mousekeys-accel-time": 800 - // }, - // "options": { - // "schema": "org.gnome.desktop.a11y.keyboard" - // } - // }] - // } - // }, - // processes: [ - // { - // command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", - // expectConfigured: "true", - // expectRestored: "false" - // } - // ] - // }, - // { - // name: "Testing Sammy using Flat matchmaker", - // gpiiConfig: gpiiConfig, - // token: "sammy", - // settingsHandlers: { - // "gpii.gsettings": { - // "data": [{ - // "settings": { - // "mag-factor": 2, - // "mouse-tracking": "centered" - // }, - // "options": { - // "schema": "org.gnome.desktop.a11y.magnifier" - // } - // }, { - // "settings": { - // "text-scaling-factor":1 - // }, - // "options": { - // "schema": "org.gnome.desktop.interface" - // } - // } ] - // } - // }, - // processes: [ - // { - // command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - // expectConfigured: "true", - // expectRestored: "false" - // } - // ] - // }, - // { - // name: "Testing os_common using Flat matchmaker", - // gpiiConfig: gpiiConfig, - // token: "os_common", - // settingsHandlers: { - // "gpii.gsettings": { - // "data": [{ - // "settings": { - // "mag-factor": 1.5, - // "screen-position": "full-screen", - // "show-cross-hairs": false - // }, - // "options": { - // "schema": "org.gnome.desktop.a11y.magnifier" - // }, - // } , { - // "settings": { - // "gtk-theme": "HighContrast", - // "icon-theme": "HighContrast", - // "text-scaling-factor": 0.75, - // "cursor-size": 41 - // }, - // "options": { - // "schema": "org.gnome.desktop.interface" - // } - // }] - // } - // }, - // processes: [ - // { - // command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - // expectConfigured: "true", - // expectRestored: "false" - // } - // ] - // }, - // { - // name: "Testing os_gnome using Flat matchmaker", - // gpiiConfig: gpiiConfig, - // token: "os_gnome", - // settingsHandlers: { - // "gpii.gsettings": { - // "data": [{ - // "settings": { - // "mag-factor": 1.5, - // "screen-position": "full-screen", - // "show-cross-hairs": false - // }, - // "options": { - // "schema": "org.gnome.desktop.a11y.magnifier" - // }, - // } , { - // "settings": { - // "text-scaling-factor": 0.75, - // "cursor-size": 90 - // }, - // "options": { - // "schema": "org.gnome.desktop.interface" - // } - // }] - // } - // }, - // processes: [ - // { - // command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - // expectConfigured: "true", - // expectRestored: "false" - // } - // ] - // }, - // { - // name: "Testing os_win7 using Flat matchmaker", - // gpiiConfig: gpiiConfig, - // token: "os_win7", - // settingsHandlers: { - // "gpii.gsettings": { - // "data": [{ - // "settings": { - // "mag-factor": 1.5, - // "screen-position": "full-screen" - // }, - // "options": { - // "schema": "org.gnome.desktop.a11y.magnifier" - // }, - // } , { - // "settings": { - // "gtk-theme":"HighContrast", - // "icon-theme":"HighContrast", - // "cursor-size": 41 - // }, - // "options": { - // "schema": "org.gnome.desktop.interface" - // } - // }] - // } - // }, - // processes: [ - // { - // command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - // expectConfigured: "true", - // expectRestored: "false" - // } - // ] - // }, - // { - // name: "Testing screenreader_common using Flat matchmaker", - // gpiiConfig: gpiiConfig, - // token: "screenreader_common", - // settingsHandlers: { - // "gpii.orca": { - // "data": [{ - // "settings": { - // "sayAllStyle": 1, - // "enableEchoByWord": true, - // "enableEchoByCharacter": false, - // "enableTutorialMessages": false, - // "verbalizePunctuationStyle": 0, - // "enableSpeech": true, - // "voices" : { - // "default" : { - // "established": false, - // "rate": 102.27272727272727, - // "family": { - // "locale": "en", - // "name": "en-westindies" - // }, + { + name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", + gpiiConfig: gpiiConfig, + token: "MikelVargas", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "slowkeys-delay": 400, + "slowkeys-enable": true, + "bouncekeys-delay": 200, + "mousekeys-enable": true, + "stickykeys-enable": true, + "bouncekeys-enable": true, + "mousekeys-max-speed": 850, + "mousekeys-init-delay": 120, + "mousekeys-accel-time": 800 + }, + "options": { + "schema": "org.gnome.desktop.a11y.keyboard" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", + expectConfigured: "true", + expectRestored: "false" + } + ] + }, + { + name: "Testing Sammy using Flat matchmaker", + gpiiConfig: gpiiConfig, + token: "sammy", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 2, + "mouse-tracking": "centered" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + } + }, { + "settings": { + "text-scaling-factor": 2 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + } ] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + expectConfigured: "true", + expectRestored: "false" + } + ] + }, + { + name: "Testing os_common using Flat matchmaker", + gpiiConfig: gpiiConfig, + token: "os_common", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen", + "show-cross-hairs": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + }, + } , { + "settings": { + "gtk-theme": "HighContrast", + "icon-theme": "HighContrast", + "text-scaling-factor": 0.75, + "cursor-size": 41 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + expectConfigured: "true", + expectRestored: "false" + } + ] + }, + { + name: "Testing os_gnome using Flat matchmaker", + gpiiConfig: gpiiConfig, + token: "os_gnome", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen", + "show-cross-hairs": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + }, + } , { + "settings": { + "text-scaling-factor": 0.75, + "cursor-size": 90 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + expectConfigured: "true", + expectRestored: "false" + } + ] + }, + { + name: "Testing os_win7 using Flat matchmaker", + gpiiConfig: gpiiConfig, + token: "os_win7", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + }, + } , { + "settings": { + "gtk-theme":"HighContrast", + "icon-theme":"HighContrast", + "cursor-size": 41 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + expectConfigured: "true", + expectRestored: "false" + } + ] + }, + { + name: "Testing screenreader_common using Flat matchmaker", + gpiiConfig: gpiiConfig, + token: "screenreader_common", + settingsHandlers: { + "gpii.orca": { + "data": [{ + "settings": { + "sayAllStyle": 1, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "enableTutorialMessages": false, + "verbalizePunctuationStyle": 0, + "enableSpeech": true, + "voices" : { + "default" : { + "established": false, + "rate": 102.27272727272727, + "family": { + "locale": "en", + "name": "en-westindies" + }, - // }, - // "uppercase": { "average-pitch": 7 }, - // "system": { "established": false }, - // "hyperlink": { "established": false } - // } - // }, - // "options": { - // "user": "screenreader_common" - // } - // } ] - // } - // }, - // processes: [ - // ] - // }, + }, + "uppercase": { "average-pitch": 7 }, + "system": { "established": false }, + "hyperlink": { "established": false } + } + }, + "options": { + "user": "screenreader_common" + } + } ] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", + expectConfigured: "true", + expectRestored: "false" + } + ] + }, { name: "Testing screenreader_orca using Flat matchmaker", gpiiConfig: gpiiConfig, @@ -258,8 +263,7 @@ var testDefs = [ "family": { "locale": "en", "name": "en-westindies" - }, - + } }, "uppercase": { "average-pitch": 7 }, "system": { "established": false }, @@ -273,46 +277,55 @@ var testDefs = [ } }, processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", + expectConfigured: "true", + expectRestored: "false" + } ] - } - // , - // { - // name: "Testing screenreader_nvda using Flat matchmaker", - // gpiiConfig: gpiiConfig, - // token: "screenreader_nvda", - // settingsHandlers: { - // "gpii.orca": { - // "data": [{ - // "settings": { - // "sayAllStyle": 1, - // "enableEchoByWord": true, - // "enableEchoByCharacter": false, - // "enableTutorialMessages": false, - // "verbalizePunctuationStyle": 0, - // "voices" : { - // "default" : { - // "established": false, - // "rate": 102.27272727272727, - // "family": { - // "locale": "en", - // "name": "en-westindies" - // }, + }, + { + name: "Testing screenreader_nvda using Flat matchmaker", + gpiiConfig: gpiiConfig, + token: "screenreader_nvda", + settingsHandlers: { + "gpii.orca": { + "data": [{ + "settings": { + "sayAllStyle": 1, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "enableTutorialMessages": false, + "verbalizePunctuationStyle": 0, + "voices" : { + "default" : { + "established": false, + "rate": 102.27272727272727, + "family": { + "locale": "en", + "name": "en-westindies" + }, - // }, - // "uppercase": { "average-pitch": 7 }, - // "system": { "established": false }, - // "hyperlink": { "established": false } - // } - // }, - // "options": { - // "user": "screenreader_nvda" - // } - // }] - // } - // }, - // processes: [ - // ] - // } + }, + "uppercase": { "average-pitch": 7 }, + "system": { "established": false }, + "hyperlink": { "established": false } + } + }, + "options": { + "user": "screenreader_nvda" + } + }] + } + }, + processes: [ + { + command: "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", + expectConfigured: "true", + expectRestored: "false" + } + ] + } ]; gpii.acceptanceTesting.buildTests(testDefs, gpiiConfig); From 677b3c763d497825677231b6c13902e268523197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 27 Aug 2013 17:43:33 +0200 Subject: [PATCH 087/319] GPII-177: Adding get function to the Orca settings handler We need to implement a get function in the Orca setting handler before adding integration tests for the Orca Screen Reader. --- node_modules/orca/orcaSettingsHandler.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index a5abbff..2d812e4 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -109,6 +109,29 @@ return { "options": options, "settings": newSettingsResponse}; } + gpii.orca.get = function (payload) { + var app = fluid.copy(payload); + + var settings = app["data"][0].settings; + var options = app["data"][0].options; + var user = options.user; + + var newSettingsResponse = {}; + var userRequestedSettings = settings; + var userSettings = require(orcaSettingsFile); + var currentSettings = userSettings.profiles[userSettings.general.startingProfile[1]]; + + fluid.each(userRequestedSettings, function (settingVal, settingKey) { + var value = fluid.get(currentSettings, settingKey, + fluid.model.escapedGetConfig); + newSettingsResponse[settingKey] = value; + }); + + app["data"][0].settings = newSettingsResponse; + + return app; + }; + gpii.orca.set = function (profile) { var returnObj = fluid.copy(profile); From 370314360da5795147ea8d2e1fdca1274608f4b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 30 Aug 2013 11:55:09 +0200 Subject: [PATCH 088/319] GPII-177: Update GSettings Settings Handler according to the new API * Remove "options" block from "get" and "set" return payloads * Update gsettingsBridge tests --- .../gsettingsBridge/gsettings_bridge.js | 9 +++++--- .../gsettingsBridge/tests/gsettingsTests.js | 21 ------------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index 0ed0d2b..2dcdb98 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -56,10 +56,10 @@ https://github.com/gpii/universal/LICENSE.txt var keys = nodeGSettings.get_gsetting_keys(schemaId); if (settings === null) { - app[appId][j].settings = {}; + settings = {}; for (var k = 0; k < keys.length; k++) { var key = keys[k]; - app[appId][j].settings[key] = nodeGSettings.get_gsetting(schemaId,key); + settings[key] = nodeGSettings.get_gsetting(schemaId,key); } } else { @@ -67,8 +67,9 @@ https://github.com/gpii/universal/LICENSE.txt if (keys.indexOf(settingKey) == -1) continue; settings[settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); } - } + var noOptions = { settings: settings }; + app[appId][j] = noOptions; } } return app; @@ -92,6 +93,8 @@ https://github.com/gpii/universal/LICENSE.txt "newValue": value }; } + var noOptions = { settings: settings}; + app[appId][j] = noOptions; } } return app; diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/node_modules/gsettingsBridge/tests/gsettingsTests.js index fef88fa..6c0670d 100644 --- a/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -42,9 +42,6 @@ https://github.com/gpii/universal/LICENSE.txt "double-setting": { "oldValue": 5.0, "newValue": 3.1 }, "boolean-setting": { "oldValue": false, "newValue": true }, "string-setting": { "oldValue": "abcdefg", "newValue": "here i am" } - }, - options: { - schema: "net.gpii.testing.gsettings.multi-set1" } } ] @@ -81,17 +78,11 @@ https://github.com/gpii/universal/LICENSE.txt "double-setting": { "oldValue": 5, "newValue": 3.2}, "boolean-setting": { "oldValue": false, "newValue": true }, "string-setting": { "oldValue": "abcdefg", "newValue": "here i amma" } - }, - options: { - schema: "net.gpii.testing.gsettings.multi-set2" } }, { settings: { "other-double-setting": { "oldValue": 987.61, "newValue": 123.0 }, "other-string-setting": { "oldValue": "hello world", "newValue": "congratulations" } - }, - options: { - schema: "net.gpii.testing.gsettings.multi-set3" } } ] @@ -127,16 +118,10 @@ https://github.com/gpii/universal/LICENSE.txt "double-setting": 5.0, "boolean-setting": false, "string-setting": "abcdefg" - }, - options: { - schema: "net.gpii.testing.gsettings.multi-get1" } }, { settings: { "other-string-setting": "hello world" - }, - options: { - schema: "net.gpii.testing.gsettings.multi-get2" } } ] @@ -169,15 +154,9 @@ https://github.com/gpii/universal/LICENSE.txt "boolean-setting": false, "string-setting": "abcdefg" }, - options: { - schema: "net.gpii.testing.gsettings.multi-get1" - } }, { settings: { "other-string-setting": "hello world" - }, - options: { - schema: "net.gpii.testing.gsettings.multi-get2" } } ] From 17ccb0c871c6cec409a08172c6d01ee8af73ba22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 30 Aug 2013 12:41:06 +0200 Subject: [PATCH 089/319] GPII-177: Update Orca Settings Handler according to the new API Remove "options" block from "get" and "set" return payloads --- node_modules/orca/orcaSettingsHandler.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 2d812e4..98904e8 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -106,7 +106,7 @@ } }; - return { "options": options, "settings": newSettingsResponse}; + return { "settings": newSettingsResponse}; } gpii.orca.get = function (payload) { @@ -127,7 +127,8 @@ newSettingsResponse[settingKey] = value; }); - app["data"][0].settings = newSettingsResponse; + var noOptions = {settings: newSettingsResponse} + app["data"][0] = noOptions; return app; }; @@ -161,8 +162,7 @@ } var returnValue = applySettings(profile); - returnObj['org.gnome.orca'][0].options = returnValue.options; - returnObj['org.gnome.orca'][0].settings = returnValue.settings; + returnObj['org.gnome.orca'][0] = returnValue; return returnObj; }; From 792c34888d2067198aae7e1c1c90516490ffad36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Sun, 15 Sep 2013 20:06:04 +0200 Subject: [PATCH 090/319] GPII-177: Cleaning up code based up on Yura's comments [changes] * Adding space between args on gsettingsBridge * Using fluid.get and fluid.set when possible * Adding PROFILE_ID constant --- .../gsettingsBridge/gsettings_bridge.js | 2 +- node_modules/orca/orcaSettingsHandler.js | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index 2dcdb98..d60347f 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -59,7 +59,7 @@ https://github.com/gpii/universal/LICENSE.txt settings = {}; for (var k = 0; k < keys.length; k++) { var key = keys[k]; - settings[key] = nodeGSettings.get_gsetting(schemaId,key); + settings[key] = nodeGSettings.get_gsetting(schemaId, key); } } else { diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 98904e8..1995d76 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -35,6 +35,17 @@ var XDG_DATA_HOME = process.env.XDG_DATA_HOME || path.resolve(HOME, ".local/share"); var orcaSettingsFile = path.resolve(XDG_DATA_HOME, "orca/user-settings.conf"); + // When Orca is referencing a profile in a setting, it uses an array + // containing the profile's name and id. + // ie: startingProfile: ["Default", "default"] + // + // But profiles are stored in the 'profiles' section as an object, + // which main key equals to the profile's id. As we need to retrieve a + // specific profile under 'profiles' section, we need to get the second + // value (the id) from the array. + // + var PROFILE_ID = 1; + fluid.registerNamespace("gpii.launch"); fluid.registerNamespace("gpii.orca"); @@ -112,14 +123,14 @@ gpii.orca.get = function (payload) { var app = fluid.copy(payload); - var settings = app["data"][0].settings; - var options = app["data"][0].options; + var settings = fluid.get(app["data"][0], settings); + var options = fluid.get(app["data"][0], options); var user = options.user; var newSettingsResponse = {}; var userRequestedSettings = settings; var userSettings = require(orcaSettingsFile); - var currentSettings = userSettings.profiles[userSettings.general.startingProfile[1]]; + var currentSettings = userSettings.profiles[userSettings.general.startingProfile[PROFILE_ID]]; fluid.each(userRequestedSettings, function (settingVal, settingKey) { var value = fluid.get(currentSettings, settingKey, @@ -163,6 +174,7 @@ var returnValue = applySettings(profile); returnObj['org.gnome.orca'][0] = returnValue; + fluid.set(returnObj['org.gnome.orca'], [0], returnValue); return returnObj; }; From 2367a51cc1cba1f687eba636623b4e8f333626bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Sun, 15 Sep 2013 20:15:56 +0200 Subject: [PATCH 091/319] GPII-177: Missing change from the latest commit --- node_modules/orca/orcaSettingsHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index 1995d76..eae10c9 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -173,7 +173,6 @@ } var returnValue = applySettings(profile); - returnObj['org.gnome.orca'][0] = returnValue; fluid.set(returnObj['org.gnome.orca'], [0], returnValue); return returnObj; From 828ec99a944d266ac8055c4883188d620a8061e9 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Sun, 15 Sep 2013 20:41:02 +0200 Subject: [PATCH 092/319] GPII-20: renamed buildTests to runTests according to changes in universal --- tests/AcceptanceTests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index 875c715..658b7cd 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -328,4 +328,4 @@ var testDefs = [ } ]; -gpii.acceptanceTesting.buildTests(testDefs, gpiiConfig); +gpii.acceptanceTesting.runTests(testDefs, gpiiConfig); From b02d1fb6734e45b7f97bd4f8d1f3179a43e055e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 16 Sep 2013 20:37:23 +0200 Subject: [PATCH 093/319] GPII-177: Updated install script to checkout v0.2 of universal --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 97ce9b0..c41bdd0 100755 --- a/build.sh +++ b/build.sh @@ -32,7 +32,7 @@ if [ -d $universal ]; then else echo "$universal does not exist" echo "cloning universal" - git clone "$repoURL" "$universal" + git clone "$repoURL" -b v0.2 "$universal" cd $universal npm install cd $currentDir From 977a15e5d14a08f51f4eda8fe896abbe8d222016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 16 Sep 2013 20:42:49 +0200 Subject: [PATCH 094/319] GPII-177: Addressing last comment from Yura about fluid.set --- node_modules/orca/orcaSettingsHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index eae10c9..fa15635 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -173,7 +173,7 @@ } var returnValue = applySettings(profile); - fluid.set(returnObj['org.gnome.orca'], [0], returnValue); + fluid.set(returnObj, ['org.gnome.orca', 0], returnValue); return returnObj; }; From d5655787b3ece3ef90c63f493199d5171e9d6de3 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Mon, 16 Sep 2013 22:28:45 +0200 Subject: [PATCH 095/319] GPII-20: Removed whitespace --- tests/AcceptanceTests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index 658b7cd..9f4f4ca 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -17,7 +17,7 @@ https://github.com/gpii/universal/LICENSE.txt var fluid = require("universal"), path = require("path"), gpii = fluid.registerNamespace("gpii"); - + require("gsettingsBridge"); require("orca"); From 097433a66e8dc6eb1f33b58ac00f14ca6b617740 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Mon, 16 Sep 2013 22:57:13 +0200 Subject: [PATCH 096/319] GPII-20: Removed whitespace --- tests/AcceptanceTests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index 9f4f4ca..ed28448 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -23,7 +23,7 @@ require("orca"); fluid.registerNamespace("fluid.tests"); -require(__dirname+"/../../node_modules/universal/tests/AcceptanceTests.js"); +require(__dirname + "/../../node_modules/universal/tests/AcceptanceTests.js"); var configPath = path.resolve(__dirname, "./acceptanceTests/setup1/configs"); var gpiiConfig = { From 28eeeed5de9c070bce86048e8b4ca32719c1f034 Mon Sep 17 00:00:00 2001 From: Kasper Markus Date: Tue, 17 Sep 2013 01:20:52 +0200 Subject: [PATCH 097/319] GPII-20: Updated reference to universal config as required by changes in GPII-190 --- tests/acceptanceTests/setup1/configs/development-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptanceTests/setup1/configs/development-config.json b/tests/acceptanceTests/setup1/configs/development-config.json index b761bdf..a9c666c 100644 --- a/tests/acceptanceTests/setup1/configs/development-config.json +++ b/tests/acceptanceTests/setup1/configs/development-config.json @@ -1,5 +1,5 @@ { "includes": [ - "../../../../../node_modules/universal/gpii/configs/fm.ps.sr.dr.mm.os.development.json" + "../../../../../node_modules/universal/gpii/configs/fm.ps.sr.dr.mm.os.lms.development.json" ] } \ No newline at end of file From e61b32d4a4cd5fe846aaebaf52e439abee12d8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 17 Sep 2013 14:10:56 +0200 Subject: [PATCH 098/319] GPII-177: Fixing an issue related to fluid.get call --- node_modules/orca/orcaSettingsHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index fa15635..a3667b9 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -123,8 +123,8 @@ gpii.orca.get = function (payload) { var app = fluid.copy(payload); - var settings = fluid.get(app["data"][0], settings); - var options = fluid.get(app["data"][0], options); + var settings = fluid.get(app, "data.0.settings"); + var options = fluid.get(app, "data.0.options"); var user = options.user; var newSettingsResponse = {}; From 03f0b2222fc74f213421a6140434ef1e7c5fbff0 Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Tue, 8 Oct 2013 13:34:55 -0400 Subject: [PATCH 099/319] NOJIRA: reverting the build script to point to universal master. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index c41bdd0..97ce9b0 100755 --- a/build.sh +++ b/build.sh @@ -32,7 +32,7 @@ if [ -d $universal ]; then else echo "$universal does not exist" echo "cloning universal" - git clone "$repoURL" -b v0.2 "$universal" + git clone "$repoURL" "$universal" cd $universal npm install cd $currentDir From 0106d7a6a79b466800a31da9da5b74faf61a4167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 18 Oct 2013 01:24:23 +0200 Subject: [PATCH 100/319] GPII-259 Initial source code of the Xrandr Node.js [Includig] - Adding the add-on structure. - A brief demonstration of how this add-on should be used is included into nodexrandr_tests.js file. - Adding a getDisplays method. It returns some information about the displays. - Adding a getBrightness method. It returns the current brigthness value. - Adding a setBrightness method. It sets the brigthness level. - Adding a dummy setScreenResolution method. Still requires some work. --- node_modules/xrandr/index.js | 17 + node_modules/xrandr/nodexrandr/binding.gyp | 11 + node_modules/xrandr/nodexrandr/nodexrandr.cc | 351 ++++++++++++++++++ .../xrandr/nodexrandr/nodexrandr_tests.js | 18 + node_modules/xrandr/package.json | 19 + node_modules/xrandr/xrandr_bridge.js | 0 6 files changed, 416 insertions(+) create mode 100644 node_modules/xrandr/index.js create mode 100644 node_modules/xrandr/nodexrandr/binding.gyp create mode 100644 node_modules/xrandr/nodexrandr/nodexrandr.cc create mode 100644 node_modules/xrandr/nodexrandr/nodexrandr_tests.js create mode 100644 node_modules/xrandr/package.json create mode 100644 node_modules/xrandr/xrandr_bridge.js diff --git a/node_modules/xrandr/index.js b/node_modules/xrandr/index.js new file mode 100644 index 0000000..ab7f722 --- /dev/null +++ b/node_modules/xrandr/index.js @@ -0,0 +1,17 @@ +/*! +GPII Node.js Xrandr Bridge + +Copyright 2013 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +var fluid = require("universal"); + +var loader = fluid.getLoader(__dirname); + +loader.require("./xrandr_bridge.js"); diff --git a/node_modules/xrandr/nodexrandr/binding.gyp b/node_modules/xrandr/nodexrandr/binding.gyp new file mode 100644 index 0000000..c8b6271 --- /dev/null +++ b/node_modules/xrandr/nodexrandr/binding.gyp @@ -0,0 +1,11 @@ +{ + "targets": [ + { + "target_name": "nodexrandr", + "sources": ["nodexrandr.cc"], + "libraries": [" +#include + +#include +#include +#include +#include +#include +#include +#include +#include /* we share subpixel information */ +#include +#include +#include +#include +#define __STDC_FORMAT_MACROS +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +using namespace v8; +using namespace std; + +typedef enum _name_kind { + name_none = 0, + name_string = (1 << 0), + name_xid = (1 << 1), + name_index = (1 << 2), + name_preferred = (1 << 3), +} name_kind_t; + + +typedef struct { + name_kind_t kind; + char *string; + XID xid; + int index; +} name_t; + +static void +init_name (name_t *name) +{ + name->kind = name_none; +} + +static void +set_name_xid (name_t *name, XID xid) +{ + name->kind |= name_xid; + name->xid = xid; +} + +static double +mode_refresh (XRRModeInfo *mode_info) +{ + double rate; + unsigned int vTotal = mode_info->vTotal; + + if (mode_info->modeFlags & RR_DoubleScan) { + /* doublescan doubles the number of lines */ + vTotal *= 2; + } + + if (mode_info->modeFlags & RR_Interlace) { + /* interlace splits the frame into two fields */ + /* the field rate is what is typically reported by monitors */ + vTotal /= 2; + } + + if (mode_info->hTotal && vTotal) + rate = ((double) mode_info->dotClock / + ((double) mode_info->hTotal * (double) vTotal)); + else + rate = 0; + return rate; +} + +static XRRModeInfo * +find_mode (name_t *name, double refresh, XRRScreenResources *res) +{ + int m; + XRRModeInfo *best = NULL; + double bestDist = 0; + + for (m = 0; m < res->nmode; m++) + { + XRRModeInfo *mode = &res->modes[m]; + if ((name->kind & name_xid) && name->xid == mode->id) + { + best = mode; + break; + } + if ((name->kind & name_string) && !strcmp (name->string, mode->name)) + { + double dist; + + if (refresh) + dist = fabs (mode_refresh (mode) - refresh); + else + dist = 0; + if (!best || dist < bestDist) + { + bestDist = dist; + best = mode; + } + } + } + return best; +} + + +static XRRModeInfo * +find_mode_by_xid (RRMode mode, XRRScreenResources *res) +{ + name_t mode_name; + + init_name (&mode_name); + set_name_xid (&mode_name, mode); + return find_mode (&mode_name, 0, res); +} + +Handle getDisplays(const Arguments& args) { + HandleScope scope; + + Display *dpy; + Window root; + XRRScreenResources *res; + XRRScreenConfiguration *sc; + + v8::Handle result = v8::Array::New(); + + char *display_name = NULL; + int screen = -1; + + dpy = XOpenDisplay (display_name); + if (dpy == NULL) { + fprintf (stderr, "Can't open display %s\n", XDisplayName(display_name)); + exit (1); + } + if (screen < 0) + screen = DefaultScreen (dpy); + if (screen >= ScreenCount (dpy)) { + fprintf (stderr, "Invalid screen number %d (display has %d)\n", + screen, ScreenCount (dpy)); + exit (1); + } + + root = RootWindow (dpy, screen); + + // get current resolution + // + sc = XRRGetScreenInfo (dpy, root); + Rotation current_rotation; + SizeID current_size; + XRRScreenSize *sizes; + int nsize; + current_size = XRRConfigCurrentConfiguration (sc, ¤t_rotation); + sizes = XRRConfigSizes(sc, &nsize); + + v8::Handle resolution_object = v8::Object::New(); + + res = XRRGetScreenResourcesCurrent (dpy, root); + for (int i=0; inoutput; i++) { + XRROutputInfo *output_info; + + output_info = XRRGetOutputInfo(dpy, res, res->outputs[i]); + v8::Handle output = v8::Object::New(); + + output->Set(String::New("name"), String::New(output_info->name)); + switch (output_info->connection) { + case RR_Connected: + output->Set(String::New("status"), String::New("connected")); + + resolution_object->Set(String::New("width"), + Integer::New(sizes[current_size].width)); + resolution_object->Set(String::New("height"), + Integer::New(sizes[current_size].height)); + + resolution_object->Set(String::New("mwidth"), + Integer::New(sizes[current_size].mwidth)); + resolution_object->Set(String::New("mheight"), + Integer::New(sizes[current_size].mheight)); + + output->Set(String::New("resolution"), resolution_object); + + break; + case RR_Disconnected: + output->Set(String::New("status"), String::New("disconnected")); + + break; + } + + v8::Handle available_resolutions = v8::Array::New(); + for (int j=0; jnmode; j++) { + char *resolution; + XRRModeInfo *mode = find_mode_by_xid (output_info->modes[j], res); + asprintf(&resolution, "%dx%d", mode->width, mode->height); + available_resolutions->Set(j,String::New(resolution)); + } + output->Set(String::New("available_resolutions"), + available_resolutions); + + result->Set(i,output); + } + + return scope.Close(result); +} + +Handle getBrightness(const Arguments& args) { + HandleScope scope; + Display *dpy; + static Atom backlight; + int screen = 0, o = 0; + Window root; + XRRScreenResources *resources; + RROutput output; + XRRPropertyInfo *info; + double min, max; + + dpy = XOpenDisplay(NULL); + backlight = XInternAtom (dpy, "Backlight", True); + root = RootWindow(dpy, screen); + resources = XRRGetScreenResources(dpy, root); + output = resources->outputs[o]; + + unsigned char *prop; + int actual_format; + unsigned long nitems, bytes_after; + Atom actual_type; + + XRRGetOutputProperty (dpy, output, backlight, + 0, 100, False, False, + AnyPropertyType, + &actual_type, &actual_format, + &nitems, &bytes_after, &prop); + + + + info = XRRQueryOutputProperty(dpy, output, backlight); + + const int32_t *val = (const int32_t *) prop; + char backlight_value[11]; + snprintf( backlight_value, sizeof backlight_value, "%" PRId32, *val); + + min = info->values[0]; + max = info->values[1]; + + v8::Handle result = v8::Object::New(); + result->Set(String::New("value"), Int32::New(*val)); + result->Set(String::New("max"), Number::New(max)); + result->Set(String::New("min"), Number::New(min)); + + return scope.Close(result); +} + +Handle setBrightness(const Arguments& args) { + HandleScope scope; + Display *dpy; + static Atom backlight; + int screen = 0, o = 0; + Window root; + XRRScreenResources *resources; + RROutput output; + XRRPropertyInfo *info; + double min, max; + long value; + float argValue; + argValue = args[0]->ToNumber()->Value(); + + dpy = XOpenDisplay(NULL); + backlight = XInternAtom (dpy, "Backlight", True); + root = RootWindow(dpy, screen); + resources = XRRGetScreenResources(dpy, root); + output = resources->outputs[o]; + info = XRRQueryOutputProperty(dpy, output, backlight); + min = info->values[0]; + max = info->values[1]; + XFree(info); // Don't need this anymore + XRRFreeScreenResources(resources); // or this + +// value = argValue * (max - min) + min; + value = argValue; + + if (value>max) { + value = max; + } else if (value setScreenResolution(const Arguments& args) { + HandleScope scope; + + Display *dpy; + Window root; + + int width, height, width_mm, height_mm; + + width = args[0]->ToInteger()->Value(); + height = args[1]->ToInteger()->Value(); + width_mm = args[2]->ToInteger()->Value(); + height_mm = args[3]->ToInteger()->Value(); + + char *display_name = NULL; + int screen = -1; + + dpy = XOpenDisplay (display_name); + if (dpy == NULL) { + fprintf (stderr, "Can't open display %s\n", XDisplayName(display_name)); + exit (1); + } + if (screen < 0) + screen = DefaultScreen (dpy); + if (screen >= ScreenCount (dpy)) { + fprintf (stderr, "Invalid screen number %d (display has %d)\n", + screen, ScreenCount (dpy)); + exit (1); + } + + root = RootWindow (dpy, screen); + + printf("x, y, x_m, y_m = %d, %d, %d, %d", width, height, width_mm, height_mm); + + XRRSetScreenSize (dpy, root, width, height, + width_mm, height_mm); + + return scope.Close(Boolean::New(True)); +} + +void init(Handle target) { + target->Set(String::NewSymbol("getDisplays"), + FunctionTemplate::New(getDisplays)->GetFunction()); + target->Set(String::NewSymbol("getBrightness"), + FunctionTemplate::New(getBrightness)->GetFunction()); + target->Set(String::NewSymbol("setBrightness"), + FunctionTemplate::New(setBrightness)->GetFunction()); + target->Set(String::NewSymbol("setScreenResolution"), + FunctionTemplate::New(setScreenResolution)->GetFunction()); +} +NODE_MODULE(nodexrandr, init) diff --git a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js new file mode 100644 index 0000000..4d3de38 --- /dev/null +++ b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +var xrandr = require('./build/Release/nodexrandr.node'); + +var r1 = xrandr.getDisplays(); +console.log("getDisplays = " + JSON.stringify(r1, null, 2)); + +var r2 = xrandr.getBrightness(); +console.log("getBrightness = " + JSON.stringify(r2, null, 2)); + +xrandr.setBrightness(10); + +r3 = xrandr.getBrightness(); +console.log("getBrightness = " + JSON.stringify(r3, null, 2)); + +xrandr.setBrightness(r2.value); +r4 = xrandr.getBrightness(); +console.log("getBrightness = " + JSON.stringify(r4, null, 2)); diff --git a/node_modules/xrandr/package.json b/node_modules/xrandr/package.json new file mode 100644 index 0000000..560f704 --- /dev/null +++ b/node_modules/xrandr/package.json @@ -0,0 +1,19 @@ +{ + "name": "xrandrBridge", + "description": "The xrandrBridge is a Node.js implementation of Xrandr.", + "version": "0.1", + "author": "Javier Hernández", + "bugs": "http://wiki.gpii.net/index.php/Main_Page", + "homepage": "http://gpii.net/", + "dependencies": {}, + "licenses": [ + { + "type": "BSD-3-Clause", + "url": "http://www.opensource.org/licenses/BSD-3-Clause" + } + ], + "keywords": ["gpii", "accessibility", "settings", "fluid"], + "repository": "git://github.com:GPII/linux.git", + "main": "./index.js", + "engines": { "node" : ">=0.1.9" } +} diff --git a/node_modules/xrandr/xrandr_bridge.js b/node_modules/xrandr/xrandr_bridge.js new file mode 100644 index 0000000..e69de29 From cdce8e653edf5f91bf58006317127ce0c9783913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 18 Oct 2013 01:30:18 +0200 Subject: [PATCH 101/319] GPII-259: Implementing setScreenResolution method --- node_modules/xrandr/nodexrandr/nodexrandr.cc | 94 ++++++++++++++----- .../xrandr/nodexrandr/nodexrandr_tests.js | 15 ++- 2 files changed, 84 insertions(+), 25 deletions(-) diff --git a/node_modules/xrandr/nodexrandr/nodexrandr.cc b/node_modules/xrandr/nodexrandr/nodexrandr.cc index 79084ac..b5a33c8 100644 --- a/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -112,7 +112,6 @@ find_mode (name_t *name, double refresh, XRRScreenResources *res) return best; } - static XRRModeInfo * find_mode_by_xid (RRMode mode, XRRScreenResources *res) { @@ -301,39 +300,88 @@ Handle setBrightness(const Arguments& args) { Handle setScreenResolution(const Arguments& args) { HandleScope scope; - Display *dpy; - Window root; - int width, height, width_mm, height_mm; + int width = args[0]->ToInteger()->Value(); + int height = args[1]->ToInteger()->Value(); - width = args[0]->ToInteger()->Value(); - height = args[1]->ToInteger()->Value(); - width_mm = args[2]->ToInteger()->Value(); - height_mm = args[3]->ToInteger()->Value(); + Rotation rotation = 1; + int reflection = 0; - char *display_name = NULL; - int screen = -1; + char *displayname = NULL; + + dpy = XOpenDisplay (displayname); - dpy = XOpenDisplay (display_name); if (dpy == NULL) { - fprintf (stderr, "Can't open display %s\n", XDisplayName(display_name)); - exit (1); + printf ("Cannot open display %s\n", displayname) ; + return scope.Close(Boolean::New(False)); } - if (screen < 0) - screen = DefaultScreen (dpy); - if (screen >= ScreenCount (dpy)) { - fprintf (stderr, "Invalid screen number %d (display has %d)\n", - screen, ScreenCount (dpy)); - exit (1); + + int screen = DefaultScreen (dpy); + Window root = RootWindow (dpy, screen); + + XSelectInput (dpy, root, StructureNotifyMask); + XRRSelectInput (dpy, root, RRScreenChangeNotifyMask); + int eventbase; + int errorbase; + XRRQueryExtension(dpy, &eventbase, &errorbase); + + XRRScreenConfiguration *sc = XRRGetScreenInfo (dpy, root); + if (sc == NULL) { + printf ("Cannot get screen info\n"); + return scope.Close(Boolean::New(False)); } - root = RootWindow (dpy, screen); + int nsize; + XRRScreenSize *sizes = XRRConfigSizes(sc, &nsize); + int sizeindex = 0; + + while (sizeindex < nsize) { + if (sizes[sizeindex].width == width && + sizes[sizeindex].height == height) + break; + sizeindex++; + } - printf("x, y, x_m, y_m = %d, %d, %d, %d", width, height, width_mm, height_mm); + if (sizeindex >= nsize) { + printf ("%dx%d resolution not available\n", width, height); + return scope.Close(Boolean::New(False)); + } - XRRSetScreenSize (dpy, root, width, height, - width_mm, height_mm); + Status status = XRRSetScreenConfig (dpy, sc, + DefaultRootWindow (dpy), + (SizeID) sizeindex, + (Rotation) (rotation | reflection), + CurrentTime); + + XEvent event; + bool rcvdrrnotify = false; + bool rcvdconfignotify = false; + + if (status == RRSetConfigSuccess) { + while (1) { + XNextEvent(dpy, (XEvent *) &event); + //printf ("Event received, type = %d\n", event.type); + XRRUpdateConfiguration (&event) ; + switch (event.type - eventbase) { + case RRScreenChangeNotify: + rcvdrrnotify = true; + break; + default: + if (event.type == ConfigureNotify) { + //printf("Rcvd ConfigureNotify Event!\n"); + rcvdconfignotify = true; + } else { + //printf("unknown event = %d!\n", event.type); + } + break; + } + + if (rcvdrrnotify && rcvdrrnotify) { + break; + } + } + } return scope.Close(Boolean::New(True)); } diff --git a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index 4d3de38..882a7fa 100644 --- a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -10,9 +10,20 @@ console.log("getBrightness = " + JSON.stringify(r2, null, 2)); xrandr.setBrightness(10); -r3 = xrandr.getBrightness(); +var r3 = xrandr.getBrightness(); console.log("getBrightness = " + JSON.stringify(r3, null, 2)); xrandr.setBrightness(r2.value); -r4 = xrandr.getBrightness(); +var r4 = xrandr.getBrightness(); console.log("getBrightness = " + JSON.stringify(r4, null, 2)); + +var width = r1[0].resolution.width +var height = r1[0].resolution.height + +xrandr.setScreenResolution(800,600); +var r5 = xrandr.getDisplays(); +console.log("getDisplays = " + JSON.stringify(r5, null, 2)); + +xrandr.setScreenResolution(width,height); +var r6 = xrandr.getDisplays(); +console.log("getDisplays = " + JSON.stringify(r6, null, 2)); From 9317980d8e3fc508265801176307f81bd0554035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 18 Oct 2013 01:34:10 +0200 Subject: [PATCH 102/319] GPII-259: Adding jqUnit tests for the Xrandr bridge --- .../xrandr/nodexrandr/nodexrandr_tests.js | 82 ++++++++++++++----- 1 file changed, 62 insertions(+), 20 deletions(-) diff --git a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index 882a7fa..7340639 100644 --- a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -1,29 +1,71 @@ -#!/usr/bin/env node +/* +GPII Xrandr Bridge Tests -var xrandr = require('./build/Release/nodexrandr.node'); +Copyright 2013 Emergya -var r1 = xrandr.getDisplays(); -console.log("getDisplays = " + JSON.stringify(r1, null, 2)); +Licensed under the New BSD license. You may not use this file except in +compliance with this License. -var r2 = xrandr.getBrightness(); -console.log("getBrightness = " + JSON.stringify(r2, null, 2)); +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ -xrandr.setBrightness(10); +var fluid = require("universal"), + jqUnit = fluid.require("jqUnit"), + xrandr = require("./build/Release/nodexrandr.node"); -var r3 = xrandr.getBrightness(); -console.log("getBrightness = " + JSON.stringify(r3, null, 2)); +jqUnit.module("GPII Xrandr Module"); -xrandr.setBrightness(r2.value); -var r4 = xrandr.getBrightness(); -console.log("getBrightness = " + JSON.stringify(r4, null, 2)); +jqUnit.test("Running tests for Xrandr Bridge", function () { + jqUnit.expect(12); -var width = r1[0].resolution.width -var height = r1[0].resolution.height + // Check if all required methods are available through the Xrandr Bridge + // + methods = ["getBrightness", "setBrightness", "getDisplays", "setScreenResolution"]; + for (var method in methods) { + jqUnit.assertTrue("Checking availability of method '" + method + "'", + (methods[method] in xrandr)); + } -xrandr.setScreenResolution(800,600); -var r5 = xrandr.getDisplays(); -console.log("getDisplays = " + JSON.stringify(r5, null, 2)); + var brightness = xrandr.getBrightness().value; -xrandr.setScreenResolution(width,height); -var r6 = xrandr.getDisplays(); -console.log("getDisplays = " + JSON.stringify(r6, null, 2)); + // Check getBrightness and setBrightness methods + // + jqUnit.assertTrue("Checking that 'setBrightness' method is callable", + xrandr.setBrightness(1)); + + jqUnit.assertTrue("'getBrightness' is callable", + xrandr.getBrightness()); + + jqUnit.assertDeepEq("'getBrightness' returns a expected value" + + " and 'setBrightness' worked as expected", + xrandr.getBrightness().value, 1); + + // Restore brightness to its previous value + // + xrandr.setBrightness(brightness); + + jqUnit.assertDeepEq("Brightness is restored to its previous value", + xrandr.getBrightness().value, brightness); + + // Check getDisplays and setScreenResolution methods + // + jqUnit.assertTrue("Checking that 'getDisplays' method is callable", + xrandr.getDisplays()); + + var resolution = xrandr.getDisplays()[0].resolution; + + jqUnit.assertTrue("Checking that 'setScreenSize' is callable", + xrandr.setScreenResolution(800, 600)); + + jqUnit.assertDeepEq("Checking that 'setScreenSize' sets the resolution", + xrandr.getDisplays()[0].resolution, + {width: 800, height: 600, mwidth: resolution.mwidth, + mheight: resolution.mheight}); + + xrandr.setScreenResolution(resolution.width, resolution.height); + jqUnit.assertDeepEq("Checking that 'setScreenSize' sets the resolution", + xrandr.getDisplays()[0].resolution, + resolution); + +}); From b30c37023fae81904e7857796be707a91278ddfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 18 Oct 2013 01:36:05 +0200 Subject: [PATCH 103/319] GPII-259: Creating an Xrandr Settings Handler [changes] - Adding: - gpii.xrandr.getBrightness - gpii.xrandr.getScreenResolution - gpii.xrandr.setBrightness - gpii.xrandr.setScreenResolution --- node_modules/xrandr/xrandr_bridge.js | 155 +++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/node_modules/xrandr/xrandr_bridge.js b/node_modules/xrandr/xrandr_bridge.js index e69de29..200d907 100644 --- a/node_modules/xrandr/xrandr_bridge.js +++ b/node_modules/xrandr/xrandr_bridge.js @@ -0,0 +1,155 @@ +/*! +GPII Node.js Xrandr Bridge + +Copyright 2013 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +(function () { + "use strict"; + + var fluid = require("universal"); + var gpii = fluid.registerNamespace("gpii"); + var xrandr = require("./nodexrandr/build/Release/nodexrandr.node"); + + fluid.registerNamespace("gpii.xrandr"); + + fluid.defaults("gpii.xrandr.getBrightness", { + gradeNames: "fluid.function", + argumentMap: { + } + }); + + fluid.defaults("gpii.xrandr.getScreenResolution", { + gradeNames: "fluid.function", + argumentMap: { + } + }); + + fluid.defaults("gpii.xrandr.setBrightness", { + gradeNames: "fluid.function", + argumentMap: { + value: 0 + } + }); + + fluid.defaults("gpii.xrandr.setScreenResolution", { + gradeNames: "fluid.function", + argumentMap: { + value: 0, + } + }); + + gpii.xrandr.getBrightness = function(){ + return xrandr.getBrightness().value; + }; + + gpii.xrandr.getScreenResolution = function(){ + var displayInfo = xrandr.getDisplays(); + for (var i=0; i Date: Fri, 18 Oct 2013 01:38:50 +0200 Subject: [PATCH 104/319] GPII-259: Adding the xrandr module to be loaded at start --- gpii.js | 1 + 1 file changed, 1 insertion(+) diff --git a/gpii.js b/gpii.js index 455410d..fb83078 100644 --- a/gpii.js +++ b/gpii.js @@ -15,6 +15,7 @@ var fluid = require("universal"), fluid.require("gsettingsBridge", require); fluid.require("orca", require); +fluid.require("xrandr", require); kettle.config.makeConfigLoader({ nodeEnv: kettle.config.getNodeEnv("fm.ps.sr.dr.mm.os.lms.development"), From c0aa3f594b12d542752e4e804105cfa39b0de8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 18 Oct 2013 02:28:13 +0200 Subject: [PATCH 105/319] GPII-259: Adding a few jqUnit tests for the Xrandr Settings Handler --- .../xrandr/test/xrandrSettingsHandlerTests.js | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 node_modules/xrandr/test/xrandrSettingsHandlerTests.js diff --git a/node_modules/xrandr/test/xrandrSettingsHandlerTests.js b/node_modules/xrandr/test/xrandrSettingsHandlerTests.js new file mode 100644 index 0000000..56a4d28 --- /dev/null +++ b/node_modules/xrandr/test/xrandrSettingsHandlerTests.js @@ -0,0 +1,70 @@ +/* +GPII Xrandr Settings Handler Tests + +Copyright 2013 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +var fluid = require("universal"), + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("jqUnit"); + +require("xrandr"); +xrandr = fluid.registerNamespace("gpii.xrandr"); + +jqUnit.module("GPII Xrandr Module"); + +jqUnit.test("Running tests for Xrandr Bridge", function () { + jqUnit.expect(10); + + // Check if all required methods are available through the Xrandr Settings Handler + // + methods = ["getBrightness", "getScreenResolution", "setBrightness", + "setScreenResolution", "get", "set"]; + for (var method in methods) { + jqUnit.assertTrue("Checking availability of method '" + method + "'", + (methods[method] in xrandr)); + } + + var payload = { + "org.freedesktop.xrandr": [{ + settings: { + "screen-resolution": {"width": 800, "height": 600}, + "screen-brightness": 1 + } + }] + }; + + var returnPayload = xrandr.set(payload); + + jqUnit.assertDeepEq("The resolution is being setted well", + returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].newValue, + payload["org.freedesktop.xrandr"][0].settings["screen-resolution"]); + + jqUnit.assertDeepEq("The brightness is being setted well", + returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].newValue, + payload["org.freedesktop.xrandr"][0].settings["screen-brightness"]); + + var newPayload = fluid.copy(payload); + newPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"] = + returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].oldValue; + newPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"] = + returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].oldValue; + + lastPayload = xrandr.set(newPayload); + + jqUnit.assertDeepEq("The resolution is being restored well", + returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].oldValue, + lastPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].newValue); + + jqUnit.assertDeepEq("The brightness is being setted well", + returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].oldValue, + lastPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].newValue); + + +}); From cce816404281887d99236bd5c0abf924c6d8fd3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 21 Oct 2013 10:10:43 +0200 Subject: [PATCH 106/319] GPII-259: Include the Xrandr add-on into the build system --- build.sh | 5 +++++ clean.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/build.sh b/build.sh index 97ce9b0..15776b5 100755 --- a/build.sh +++ b/build.sh @@ -43,6 +43,11 @@ cd node_modules/gsettingsBridge/nodegsettings node-gyp configure build cd ../../.. +# Compile the Xrandr C++ Bridge +cd node_modules/xrandr/nodexrandr +node-gyp configure build +cd ../../.. + # Create standard directory structure for GPII. # Note: everything below here must be run as root, since we're installing ourselves centrally. if [ -d $gpiiInstallDir ]; then diff --git a/clean.sh b/clean.sh index d27be4d..b51fa10 100755 --- a/clean.sh +++ b/clean.sh @@ -15,6 +15,11 @@ node-gyp clean rm -rf build cd ../../.. +cd node_modules/xrandr/nodexrandr +node-gyp clean +rm -rf build +cd ../../.. + sudo rm -rf /usr/local/gpii sudo rm -rf /var/lib/gpii sudo rm -f /etc/udev/rules.d/80-gpii.rules From f8b760163644dac014df4b6234a6a8cd4f126e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 23 Oct 2013 01:02:36 +0200 Subject: [PATCH 107/319] GPII-259: Code cleanup --- node_modules/xrandr/nodexrandr/nodexrandr.cc | 62 +++++++++---------- .../xrandr/nodexrandr/nodexrandr_tests.js | 4 +- .../xrandr/test/xrandrSettingsHandlerTests.js | 19 +++--- node_modules/xrandr/xrandr_bridge.js | 7 +-- 4 files changed, 44 insertions(+), 48 deletions(-) diff --git a/node_modules/xrandr/nodexrandr/nodexrandr.cc b/node_modules/xrandr/nodexrandr/nodexrandr.cc index b5a33c8..daff26b 100644 --- a/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -8,7 +8,7 @@ #include #include #include -#include /* we share subpixel information */ +#include #include #include #include @@ -33,7 +33,6 @@ typedef enum _name_kind { name_preferred = (1 << 3), } name_kind_t; - typedef struct { name_kind_t kind; char *string; @@ -70,7 +69,7 @@ mode_refresh (XRRModeInfo *mode_info) /* the field rate is what is typically reported by monitors */ vTotal /= 2; } - + if (mode_info->hTotal && vTotal) rate = ((double) mode_info->dotClock / ((double) mode_info->hTotal * (double) vTotal)); @@ -89,25 +88,25 @@ find_mode (name_t *name, double refresh, XRRScreenResources *res) for (m = 0; m < res->nmode; m++) { XRRModeInfo *mode = &res->modes[m]; - if ((name->kind & name_xid) && name->xid == mode->id) - { - best = mode; - break; - } - if ((name->kind & name_string) && !strcmp (name->string, mode->name)) - { - double dist; - - if (refresh) - dist = fabs (mode_refresh (mode) - refresh); - else - dist = 0; - if (!best || dist < bestDist) - { - bestDist = dist; - best = mode; - } - } + if ((name->kind & name_xid) && name->xid == mode->id) + { + best = mode; + break; + } + if ((name->kind & name_string) && !strcmp (name->string, mode->name)) + { + double dist; + + if (refresh) + dist = fabs (mode_refresh (mode) - refresh); + else + dist = 0; + if (!best || dist < bestDist) + { + bestDist = dist; + best = mode; + } + } } return best; } @@ -144,7 +143,7 @@ Handle getDisplays(const Arguments& args) { screen = DefaultScreen (dpy); if (screen >= ScreenCount (dpy)) { fprintf (stderr, "Invalid screen number %d (display has %d)\n", - screen, ScreenCount (dpy)); + screen, ScreenCount (dpy)); exit (1); } @@ -172,24 +171,22 @@ Handle getDisplays(const Arguments& args) { output->Set(String::New("name"), String::New(output_info->name)); switch (output_info->connection) { case RR_Connected: - output->Set(String::New("status"), String::New("connected")); + output->Set(String::New("status"), String::New("connected")); resolution_object->Set(String::New("width"), - Integer::New(sizes[current_size].width)); + Integer::New(sizes[current_size].width)); resolution_object->Set(String::New("height"), - Integer::New(sizes[current_size].height)); + Integer::New(sizes[current_size].height)); resolution_object->Set(String::New("mwidth"), - Integer::New(sizes[current_size].mwidth)); + Integer::New(sizes[current_size].mwidth)); resolution_object->Set(String::New("mheight"), - Integer::New(sizes[current_size].mheight)); + Integer::New(sizes[current_size].mheight)); output->Set(String::New("resolution"), resolution_object); - break; case RR_Disconnected: output->Set(String::New("status"), String::New("disconnected")); - break; } @@ -237,8 +234,6 @@ Handle getBrightness(const Arguments& args) { &actual_type, &actual_format, &nitems, &bytes_after, &prop); - - info = XRRQueryOutputProperty(dpy, output, backlight); const int32_t *val = (const int32_t *) prop; @@ -281,7 +276,6 @@ Handle setBrightness(const Arguments& args) { XFree(info); // Don't need this anymore XRRFreeScreenResources(resources); // or this -// value = argValue * (max - min) + min; value = argValue; if (value>max) { @@ -313,7 +307,7 @@ Handle setScreenResolution(const Arguments& args) { dpy = XOpenDisplay (displayname); if (dpy == NULL) { - printf ("Cannot open display %s\n", displayname) ; + printf ("Cannot open display %s\n", displayname); return scope.Close(Boolean::New(False)); } diff --git a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index 7340639..ef8abb5 100644 --- a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -21,7 +21,9 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { // Check if all required methods are available through the Xrandr Bridge // - methods = ["getBrightness", "setBrightness", "getDisplays", "setScreenResolution"]; + methods = ["getBrightness", "setBrightness", + "getDisplays", "setScreenResolution"]; + for (var method in methods) { jqUnit.assertTrue("Checking availability of method '" + method + "'", (methods[method] in xrandr)); diff --git a/node_modules/xrandr/test/xrandrSettingsHandlerTests.js b/node_modules/xrandr/test/xrandrSettingsHandlerTests.js index 56a4d28..be0bc88 100644 --- a/node_modules/xrandr/test/xrandrSettingsHandlerTests.js +++ b/node_modules/xrandr/test/xrandrSettingsHandlerTests.js @@ -22,7 +22,8 @@ jqUnit.module("GPII Xrandr Module"); jqUnit.test("Running tests for Xrandr Bridge", function () { jqUnit.expect(10); - // Check if all required methods are available through the Xrandr Settings Handler + // Check if all required methods are available through the + // Xrandr Settings Handler. // methods = ["getBrightness", "getScreenResolution", "setBrightness", "setScreenResolution", "get", "set"]; @@ -43,12 +44,12 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { var returnPayload = xrandr.set(payload); jqUnit.assertDeepEq("The resolution is being setted well", - returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].newValue, - payload["org.freedesktop.xrandr"][0].settings["screen-resolution"]); + returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].newValue, + payload["org.freedesktop.xrandr"][0].settings["screen-resolution"]); jqUnit.assertDeepEq("The brightness is being setted well", - returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].newValue, - payload["org.freedesktop.xrandr"][0].settings["screen-brightness"]); + returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].newValue, + payload["org.freedesktop.xrandr"][0].settings["screen-brightness"]); var newPayload = fluid.copy(payload); newPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"] = @@ -59,12 +60,12 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { lastPayload = xrandr.set(newPayload); jqUnit.assertDeepEq("The resolution is being restored well", - returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].oldValue, - lastPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].newValue); + returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].oldValue, + lastPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].newValue); jqUnit.assertDeepEq("The brightness is being setted well", - returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].oldValue, - lastPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].newValue); + returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].oldValue, + lastPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].newValue); }); diff --git a/node_modules/xrandr/xrandr_bridge.js b/node_modules/xrandr/xrandr_bridge.js index 200d907..eedd0f0 100644 --- a/node_modules/xrandr/xrandr_bridge.js +++ b/node_modules/xrandr/xrandr_bridge.js @@ -57,7 +57,7 @@ https://github.com/gpii/universal/LICENSE.txt } } - return { + return { width: displayInfo[i].resolution.width, height: displayInfo[i].resolution.height }; @@ -80,7 +80,6 @@ https://github.com/gpii/universal/LICENSE.txt var app = fluid.copy(settingsarray); for (var appId in app) { for (var j = 0; j < app[appId].length; j++) { - var schemaId = app[appId][j].options.schema; var settings = app[appId][j].settings; var keys = ['screen-brightness', 'screen-resolution']; @@ -108,7 +107,7 @@ https://github.com/gpii/universal/LICENSE.txt var err = "Invalid key: " + settingKey; fluid.fail(err); fluid.log(err); - } + } } } var noOptions = { settings: settings }; @@ -135,7 +134,7 @@ https://github.com/gpii/universal/LICENSE.txt oldValue = gpii.xrandr.getScreenResolution(); gpii.xrandr.setScreenResolution(value); } else { - var err = "Invalid key: " + settingKey; + var err = "Invalid key: " + settingKey; fluid.fail(err); fluid.log(err); } From 85339b1a795a3c5ad3ca01622d3eefb1e40fd755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 28 Oct 2013 17:46:20 +0100 Subject: [PATCH 108/319] GPII-343: Adding a Node.js bridge to call ALSA [changes] * Adding both methods to get and set the master volume * Adding binding.gyp * Adding some tests at add-on level --- node_modules/alsa/nodealsa/binding.gyp | 11 +++ node_modules/alsa/nodealsa/nodealsa.cc | 75 ++++++++++++++++++++ node_modules/alsa/nodealsa/nodealsa_tests.js | 44 ++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 node_modules/alsa/nodealsa/binding.gyp create mode 100644 node_modules/alsa/nodealsa/nodealsa.cc create mode 100644 node_modules/alsa/nodealsa/nodealsa_tests.js diff --git a/node_modules/alsa/nodealsa/binding.gyp b/node_modules/alsa/nodealsa/binding.gyp new file mode 100644 index 0000000..bbe2afb --- /dev/null +++ b/node_modules/alsa/nodealsa/binding.gyp @@ -0,0 +1,11 @@ +{ + "targets": [ + { + "target_name": "nodealsa", + "sources": ["nodealsa.cc"], + "libraries": [" +#include + +#include +#include + +using namespace v8; + +Handle getSystemVolume(const Arguments& args) { + HandleScope scope; + + long min, max; + snd_mixer_t *handle; + snd_mixer_selem_id_t *sid; + const char *card = "default"; + const char *selem_name = "Master"; + + snd_mixer_open(&handle, 0); + snd_mixer_attach(handle, card); + snd_mixer_selem_register(handle, NULL, NULL); + snd_mixer_load(handle); + + snd_mixer_selem_id_alloca(&sid); + snd_mixer_selem_id_set_index(sid, 0); + snd_mixer_selem_id_set_name(sid, selem_name); + snd_mixer_elem_t* elem = snd_mixer_find_selem(handle, sid); + + snd_mixer_selem_get_playback_volume_range(elem, &min, &max); + + long curr; + int volume; + + snd_mixer_selem_get_playback_volume(elem,(snd_mixer_selem_channel_id_t) 0, &curr); + volume = curr * 100 / max; + + snd_mixer_close(handle); + + return scope.Close(Integer::New(volume)); +} + +Handle setSystemVolume(const Arguments& args) { + HandleScope scope; + + long min, max; + snd_mixer_t *handle; + snd_mixer_selem_id_t *sid; + const char *card = "default"; + const char *selem_name = "Master"; + int volume = args[0]->ToInteger()->Value(); + + snd_mixer_open(&handle, 0); + snd_mixer_attach(handle, card); + snd_mixer_selem_register(handle, NULL, NULL); + snd_mixer_load(handle); + + snd_mixer_selem_id_alloca(&sid); + snd_mixer_selem_id_set_index(sid, 0); + snd_mixer_selem_id_set_name(sid, selem_name); + snd_mixer_elem_t* elem = snd_mixer_find_selem(handle, sid); + + snd_mixer_selem_get_playback_volume_range(elem, &min, &max); + snd_mixer_selem_set_playback_volume_all(elem, volume * max / 100); + + snd_mixer_close(handle); + + return scope.Close(Boolean::New("True")); +} + +void init(Handle target) { + target->Set(String::NewSymbol("getSystemVolume"), + FunctionTemplate::New(getSystemVolume)->GetFunction()); + target->Set(String::NewSymbol("setSystemVolume"), + FunctionTemplate::New(setSystemVolume)->GetFunction()); +} +NODE_MODULE(nodealsa, init) diff --git a/node_modules/alsa/nodealsa/nodealsa_tests.js b/node_modules/alsa/nodealsa/nodealsa_tests.js new file mode 100644 index 0000000..09bc83f --- /dev/null +++ b/node_modules/alsa/nodealsa/nodealsa_tests.js @@ -0,0 +1,44 @@ +/* +GPII Node.js ALSA Volume Bridge + +Copyright 2013 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +var fluid = require("universal"), + jqUnit = fluid.require("jqUnit"), + alsa = require("./build/Release/nodealsa.node"); + +jqUnit.module("GPII ALSA Volume Bridge"); + +jqUnit.test("Running tests for ALSA bindings", function () { + jqUnit.expect(4); + + // Check if all required methods are available + // + methods = ["getSystemVolume", "setSystemVolume"]; + + for (var method in methods) { + jqUnit.assertTrue("Checking availability of method '" + method + "'", + (methods[method] in alsa)); + } + + var volume = alsa.getSystemVolume(); + + jqUnit.assertTrue("Checking 'setSystemVolume' method", + alsa.setSystemVolume(0)); + + jqUnit.assertDeepEq("'getSystemVolume' returns a expected value" + + " and 'setSystemVolume' worked as expected", + alsa.getSystemVolume(), 0); + + // Restore the volume to its previous value + // + alsa.setSystemVolume(volume); + +}); From 4d8745a03168722f31e39ccaabfffd70eaa6a482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 28 Oct 2013 17:49:47 +0100 Subject: [PATCH 109/319] GPII-343: Adding a Settings Handler for ALSA [changes] * Adding package.json * Adding a Settings Handler which uses the Node.js ALSA volume bridge * Adding tests for the ALSA Settings Handler --- node_modules/alsa/alsa_bridge.js | 87 +++++++++++++++++++ node_modules/alsa/index.js | 17 ++++ node_modules/alsa/package.json | 19 ++++ .../alsa/test/alsaSettingsHandlerTests.js | 57 ++++++++++++ 4 files changed, 180 insertions(+) create mode 100644 node_modules/alsa/alsa_bridge.js create mode 100644 node_modules/alsa/index.js create mode 100644 node_modules/alsa/package.json create mode 100644 node_modules/alsa/test/alsaSettingsHandlerTests.js diff --git a/node_modules/alsa/alsa_bridge.js b/node_modules/alsa/alsa_bridge.js new file mode 100644 index 0000000..4924551 --- /dev/null +++ b/node_modules/alsa/alsa_bridge.js @@ -0,0 +1,87 @@ +/*! +GPII Node.js ALSA Volume Bridge + +Copyright 2013 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +(function () { + "use strict"; + + var fluid = require("universal"); + var gpii = fluid.registerNamespace("gpii"); + var alsa = require("./nodealsa/build/Release/nodealsa.node"); + + fluid.registerNamespace("gpii.alsa"); + + fluid.defaults("gpii.alsa.getSystemVolume", { + gradeNames: "fluid.function", + argumentMap: { + } + }); + + fluid.defaults("gpii.alsa.setSystemVolume", { + gradeNames: "fluid.function", + argumentMap: { + value: 0 + } + }); + + fluid.defaults("gpii.alsa.get", { + gradeNames: "fluid.function", + argumentMap: { + payload: 0 + } + }); + + fluid.defaults("gpii.alsa.set", { + gradeNames: "fluid.function", + argumentMap: { + payload: 0 + } + }); + + gpii.alsa.getSystemVolume = function(){ + return alsa.getSystemVolume(); + }; + + gpii.alsa.setSystemVolume = function(value){ + return alsa.setSystemVolume(value); + }; + + gpii.alsa.get = function (payload){ + var app = fluid.copy(payload); + var settings = fluid.copy(app, "data.0.settings"); + + var newSettingsResponse = {masterVolume: gpii.alsa.getSystemVolume()}; + var noOptions = {settings: newSettingsResponse}; + app["data"][0] = noOptions; + + return app; + }; + + gpii.alsa.set = function (payload){ + var app = fluid.copy(payload); + var settings = app['org.alsa-project'][0].settings; + + var oldValue = alsa.getSystemVolume(); + alsa.setSystemVolume(settings['masterVolume']); + + var newSettingsResponse = {}; + newSettingsResponse['masterVolume'] = { + "oldValue": oldValue, + "newValue": settings['masterVolume'] + }; + + var noOptions = {settings: newSettingsResponse}; + fluid.set(app, ['org.alsa-project', 0], noOptions); + + return app; + }; + +})(); diff --git a/node_modules/alsa/index.js b/node_modules/alsa/index.js new file mode 100644 index 0000000..26b45a5 --- /dev/null +++ b/node_modules/alsa/index.js @@ -0,0 +1,17 @@ +/*! +GPII Node.js ALSA Volume Bridge + +Copyright 2013 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +var fluid = require("universal"); + +var loader = fluid.getLoader(__dirname); + +loader.require("./alsa_bridge.js"); diff --git a/node_modules/alsa/package.json b/node_modules/alsa/package.json new file mode 100644 index 0000000..9d401df --- /dev/null +++ b/node_modules/alsa/package.json @@ -0,0 +1,19 @@ +{ + "name": "alsaBridge", + "description": "alsaBridge is a Node.js bridge to deal with system volumes.", + "version": "0.1", + "author": "Javier Hernández", + "bugs": "http://wiki.gpii.net/index.php/Main_Page", + "homepage": "http://gpii.net/", + "dependencies": {}, + "licenses": [ + { + "type": "BSD-3-Clause", + "url": "http://www.opensource.org/licenses/BSD-3-Clause" + } + ], + "keywords": ["gpii", "accessibility", "settings", "fluid"], + "repository": "git://github.com:GPII/linux.git", + "main": "./index.js", + "engines": { "node" : ">=0.1.9" } +} diff --git a/node_modules/alsa/test/alsaSettingsHandlerTests.js b/node_modules/alsa/test/alsaSettingsHandlerTests.js new file mode 100644 index 0000000..58c3a70 --- /dev/null +++ b/node_modules/alsa/test/alsaSettingsHandlerTests.js @@ -0,0 +1,57 @@ +/* +GPII Node.js ALSA Volume Bridge + +Copyright 2013 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +var fluid = require("universal"), + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("jqUnit"); + +require("alsa"); +alsa = fluid.registerNamespace("gpii.alsa"); + +jqUnit.module("GPII Node.js ALSA Volume Bridge"); + +jqUnit.test("Running tests for ALSA Settings Handler", function () { + jqUnit.expect(6); + + // Check if all required methods are available through the + // ALSA Settings Handler. + // + methods = ["getSystemVolume", "setSystemVolume", "get", "set"]; + for (var method in methods) { + jqUnit.assertTrue("Checking availability of method '" + method + "'", + (methods[method] in alsa)); + } + + var payload = { + "org.alsa-project": [{ + settings: { + "masterVolume": 1 + } + }] + }; + + var returnPayload = alsa.set(payload); + + jqUnit.assertDeepEq("The system volume is being setted well", + returnPayload["org.alsa-project"][0].settings["masterVolume"].newValue, + payload["org.alsa-project"][0].settings["masterVolume"]); + + var newPayload = fluid.copy(payload); + newPayload["org.alsa-project"][0].settings["masterVolume"] = + returnPayload["org.alsa-project"][0].settings["masterVolume"].oldValue; + + lastPayload = alsa.set(newPayload); + + jqUnit.assertDeepEq("The system volume is being restored well", + returnPayload["org.alsa-project"][0].settings["masterVolume"].oldValue, + lastPayload["org.alsa-project"][0].settings["masterVolume"].newValue); +}); From ca6576fe53f30fb12cf193ab9605023bcb6b13ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 28 Oct 2013 18:31:36 +0100 Subject: [PATCH 110/319] GPII-343: Adding the new ALSA stuff into the GPII [changes] * Add alsa into both build and clean processes * Add alsa into Linux's index.js in order to be loaded by the framework at start time --- build.sh | 5 +++++ clean.sh | 5 +++++ gpii.js | 1 + 3 files changed, 11 insertions(+) diff --git a/build.sh b/build.sh index 97ce9b0..35d5dc7 100755 --- a/build.sh +++ b/build.sh @@ -43,6 +43,11 @@ cd node_modules/gsettingsBridge/nodegsettings node-gyp configure build cd ../../.. +# Compile the GSettings C++ Bridge +cd node_modules/alsa/nodealsa +node-gyp configure build +cd ../../.. + # Create standard directory structure for GPII. # Note: everything below here must be run as root, since we're installing ourselves centrally. if [ -d $gpiiInstallDir ]; then diff --git a/clean.sh b/clean.sh index d27be4d..55f862a 100755 --- a/clean.sh +++ b/clean.sh @@ -15,6 +15,11 @@ node-gyp clean rm -rf build cd ../../.. +cd node_modules/alsa/nodealsa +node-gyp clean +rm -rf build +cd ../../.. + sudo rm -rf /usr/local/gpii sudo rm -rf /var/lib/gpii sudo rm -f /etc/udev/rules.d/80-gpii.rules diff --git a/gpii.js b/gpii.js index 455410d..1275331 100644 --- a/gpii.js +++ b/gpii.js @@ -15,6 +15,7 @@ var fluid = require("universal"), fluid.require("gsettingsBridge", require); fluid.require("orca", require); +fluid.require("alsa", require); kettle.config.makeConfigLoader({ nodeEnv: kettle.config.getNodeEnv("fm.ps.sr.dr.mm.os.lms.development"), From 177ed55eb3603455333f8e352f7482184a590914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 14 Nov 2013 15:14:12 +0100 Subject: [PATCH 111/319] GPII-343: In build.sh, update the comment for ALSA --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 35d5dc7..9e81485 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,7 @@ cd node_modules/gsettingsBridge/nodegsettings node-gyp configure build cd ../../.. -# Compile the GSettings C++ Bridge +# Compile the ALSA C++ Bridge cd node_modules/alsa/nodealsa node-gyp configure build cd ../../.. From 714a5f9d0d69b6b94445be7f8278ff9fc7083a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 14 Nov 2013 21:52:08 +0100 Subject: [PATCH 112/319] GPII-343: Setting max and min values for volume range This change will avoid errors while transforming values, no need to round numbers, etc. --- node_modules/alsa/nodealsa/nodealsa.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/node_modules/alsa/nodealsa/nodealsa.cc b/node_modules/alsa/nodealsa/nodealsa.cc index 9002ddb..e92973d 100644 --- a/node_modules/alsa/nodealsa/nodealsa.cc +++ b/node_modules/alsa/nodealsa/nodealsa.cc @@ -2,6 +2,7 @@ #include #include +#include #include using namespace v8; @@ -9,7 +10,6 @@ using namespace v8; Handle getSystemVolume(const Arguments& args) { HandleScope scope; - long min, max; snd_mixer_t *handle; snd_mixer_selem_id_t *sid; const char *card = "default"; @@ -25,28 +25,25 @@ Handle getSystemVolume(const Arguments& args) { snd_mixer_selem_id_set_name(sid, selem_name); snd_mixer_elem_t* elem = snd_mixer_find_selem(handle, sid); - snd_mixer_selem_get_playback_volume_range(elem, &min, &max); + snd_mixer_selem_set_playback_volume_range(elem, 0, 100); long curr; - int volume; snd_mixer_selem_get_playback_volume(elem,(snd_mixer_selem_channel_id_t) 0, &curr); - volume = curr * 100 / max; snd_mixer_close(handle); - return scope.Close(Integer::New(volume)); + return scope.Close(Number::New(curr)); } Handle setSystemVolume(const Arguments& args) { HandleScope scope; - long min, max; snd_mixer_t *handle; snd_mixer_selem_id_t *sid; const char *card = "default"; const char *selem_name = "Master"; - int volume = args[0]->ToInteger()->Value(); + long volume = args[0]->ToNumber()->Value(); snd_mixer_open(&handle, 0); snd_mixer_attach(handle, card); @@ -58,8 +55,9 @@ Handle setSystemVolume(const Arguments& args) { snd_mixer_selem_id_set_name(sid, selem_name); snd_mixer_elem_t* elem = snd_mixer_find_selem(handle, sid); - snd_mixer_selem_get_playback_volume_range(elem, &min, &max); - snd_mixer_selem_set_playback_volume_all(elem, volume * max / 100); + snd_mixer_selem_set_playback_volume_range(elem, 0, 100); + + snd_mixer_selem_set_playback_volume_all(elem, volume); snd_mixer_close(handle); From 5341d6b2a1596916b4ec23a6503c5c95bbd68274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 15 Nov 2013 08:32:30 +0100 Subject: [PATCH 113/319] GPII-308: Updating AcceptanceTests for 2nd pilots * Adding GNOME Orca's gain and average-pitch settings * Adding ALSA's masterVolume setting --- tests/AcceptanceTests.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index ed28448..088dc52 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -20,6 +20,7 @@ var fluid = require("universal"), require("gsettingsBridge"); require("orca"); +require("alsa"); fluid.registerNamespace("fluid.tests"); @@ -122,6 +123,13 @@ var testDefs = [ "schema": "org.gnome.desktop.interface" } }] + }, + "gpii.alsa": { + "data": [{ + "settings": { + "masterVolume": 50 + } + }] } }, processes: [ @@ -218,6 +226,8 @@ var testDefs = [ "default" : { "established": false, "rate": 102.27272727272727, + "average-pitch": 1.5, + "gain": 7.5, "family": { "locale": "en", "name": "en-westindies" @@ -260,6 +270,8 @@ var testDefs = [ "default" : { "established": false, "rate": 102.27272727272727, + "average-pitch": 1.5, + "gain": 7.5, "family": { "locale": "en", "name": "en-westindies" From 9cdf347a0c309ec477b9bfe10464ade77e72fc69 Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Tue, 3 Dec 2013 10:57:08 -0500 Subject: [PATCH 114/319] GPII-75: updated acceptance tests to the latest kettle test utils. --- tests/AcceptanceTests.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index ed28448..0b24853 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -16,14 +16,13 @@ https://github.com/gpii/universal/LICENSE.txt "use strict"; var fluid = require("universal"), path = require("path"), + kettle = fluid.registerNamespace("kettle"), gpii = fluid.registerNamespace("gpii"); require("gsettingsBridge"); require("orca"); -fluid.registerNamespace("fluid.tests"); - -require(__dirname + "/../../node_modules/universal/tests/AcceptanceTests.js"); +fluid.require("universal/tests/AcceptanceTests", require); var configPath = path.resolve(__dirname, "./acceptanceTests/setup1/configs"); var gpiiConfig = { @@ -34,7 +33,7 @@ var gpiiConfig = { var testDefs = [ { name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", - gpiiConfig: gpiiConfig, + config: gpiiConfig, token: "MikelVargas", settingsHandlers: { "gpii.gsettings": { @@ -66,7 +65,7 @@ var testDefs = [ }, { name: "Testing Sammy using Flat matchmaker", - gpiiConfig: gpiiConfig, + config: gpiiConfig, token: "sammy", settingsHandlers: { "gpii.gsettings": { @@ -98,7 +97,7 @@ var testDefs = [ }, { name: "Testing os_common using Flat matchmaker", - gpiiConfig: gpiiConfig, + config: gpiiConfig, token: "os_common", settingsHandlers: { "gpii.gsettings": { @@ -134,7 +133,7 @@ var testDefs = [ }, { name: "Testing os_gnome using Flat matchmaker", - gpiiConfig: gpiiConfig, + config: gpiiConfig, token: "os_gnome", settingsHandlers: { "gpii.gsettings": { @@ -168,7 +167,7 @@ var testDefs = [ }, { name: "Testing os_win7 using Flat matchmaker", - gpiiConfig: gpiiConfig, + config: gpiiConfig, token: "os_win7", settingsHandlers: { "gpii.gsettings": { @@ -202,7 +201,7 @@ var testDefs = [ }, { name: "Testing screenreader_common using Flat matchmaker", - gpiiConfig: gpiiConfig, + config: gpiiConfig, token: "screenreader_common", settingsHandlers: { "gpii.orca": { @@ -245,7 +244,7 @@ var testDefs = [ }, { name: "Testing screenreader_orca using Flat matchmaker", - gpiiConfig: gpiiConfig, + config: gpiiConfig, token: "screenreader_orca", settingsHandlers: { "gpii.orca": { @@ -286,7 +285,7 @@ var testDefs = [ }, { name: "Testing screenreader_nvda using Flat matchmaker", - gpiiConfig: gpiiConfig, + config: gpiiConfig, token: "screenreader_nvda", settingsHandlers: { "gpii.orca": { @@ -328,4 +327,6 @@ var testDefs = [ } ]; -gpii.acceptanceTesting.runTests(testDefs, gpiiConfig); + +testDefs = gpii.acceptanceTesting.buildTests(testDefs); +module.exports = kettle.tests.bootstrap(testDefs); From 6aeac9d9309f12100731c906465de3405741a767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 26 Dec 2013 17:05:11 +0100 Subject: [PATCH 115/319] GPII-491: Add the new included modules into README --- README | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README b/README index 5115618..398866a 100644 --- a/README +++ b/README @@ -1,6 +1,13 @@ -This repository contains all of the platform-specific code required to run the GPII Personalization Framework on Linux with GNOME. +GNU/Linux +========= + +This repository contains all of the platform-specific code required to run the GPII Personalization Framework on GNU/Linux with GNOME. The following components can be found in the repository: * usbDriveListener: a UserListener implementation that will detect a USB drive with an anonymous GPII user token installed on it * gSettingsBridge: a Node.js module for accessing the gSettings API via JavaScript within a Node application +* orca: a Node.js module for dealing with GNOME Orca's settings +* alsa: a Node.js module for accessing the ALSA API via JavaScript within a Node application to interact with system's volume +* xrandr: a Node.js module for accessing the XRandr API via JavaScript within a Node application. This module is used for setting the resolution and the screen brightness. + From 24e84764c20e6145c1837552da0aae2c699ed0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 21 Jan 2014 16:39:56 +0100 Subject: [PATCH 116/319] GPII-308: Moving alsa settings from os_common to os_gnome NP set --- tests/AcceptanceTests.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index bc34cbd..8e18f38 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -122,13 +122,6 @@ var testDefs = [ "schema": "org.gnome.desktop.interface" } }] - }, - "gpii.alsa": { - "data": [{ - "settings": { - "masterVolume": 50 - } - }] } }, processes: [ @@ -163,6 +156,13 @@ var testDefs = [ "schema": "org.gnome.desktop.interface" } }] + }, + "gpii.alsa": { + "data": [{ + "settings": { + "masterVolume": 50 + } + }] } }, processes: [ From 3e8b0ad8940a7723b69d24c92b825e4f3deb9261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 23 Jan 2014 16:36:53 +0100 Subject: [PATCH 117/319] GPII-545: Adding the new GPII usb user listener code The new GPII usb user listener is now a standalone application. It covers all the workflow that we need by itself, from detecting the device to trigger the login/logout processes. Since the user listener now is standalone, it should be installed in any well-known 'bin' folder by the system, this is, a 'bin' folder which is included into $PATH environment variable. Also, we are providing a '.desktop' file for the users to run it easily in the same way they launch any other application from the system. --- usbDriveListener/gpii-usb-user-listener | 102 ++++++++++++++++++ .../gpii-usb-user-listener.desktop | 6 ++ 2 files changed, 108 insertions(+) create mode 100755 usbDriveListener/gpii-usb-user-listener create mode 100644 usbDriveListener/gpii-usb-user-listener.desktop diff --git a/usbDriveListener/gpii-usb-user-listener b/usbDriveListener/gpii-usb-user-listener new file mode 100755 index 0000000..d061414 --- /dev/null +++ b/usbDriveListener/gpii-usb-user-listener @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# GPII Linux USB Drive User Listener +# +# Copyright 2014 Emergya +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# You may obtain a copy of the License at +# https://github.com/gpii/universal/LICENSE.txt + +from gi.repository import GUdev +from gi.repository import GLib + +from socket import error as socket_error +import errno +import httplib2 +import logging +import os +import subprocess +import time + +LOG_FILEPATH = '/var/lib/gpii/log.txt' +TOKEN_FILE = '.gpii-user-token.txt' +MAX_TIMEOUT = 5 + +class UserListener: + def __init__(self): + self.c = GUdev.Client(subsystems=['block']) + self.c.connect('uevent', self.callback) + self.gpii_token = '' + + self.log = logging.getLogger("gpii") + hdlr = logging.FileHandler(LOG_FILEPATH) + formatter = logging.Formatter('%(message)s') + hdlr.setFormatter(formatter) + self.log.addHandler(hdlr) + self.log.setLevel(logging.DEBUG) + + def callback(self, client, ev, device): + if ev == 'add' and device.get_devtype() == 'partition': + device_name = device.get_name() + mount_point = '' + + command_line = "mount | grep " + device_name + " | awk '{print $3}'" + + mount_point = subprocess.check_output(command_line, shell=True) + + timeout = 0 + while (timeout != MAX_TIMEOUT): + timeout += 1 + mount_point = subprocess.check_output(command_line, \ + shell=True).split('\n')[0] + if mount_point: break + time.sleep(1) + + if mount_point: + gpii_token_filepath = os.path.join(mount_point, TOKEN_FILE) + if os.path.exists(gpii_token_filepath): + gpii_token_file = open(gpii_token_filepath, 'r') + self.gpii_token = gpii_token_file.read().split('\n')[0] + gpii_token_file.close() + self.gpii_login() + elif ev == 'remove' \ + and device.get_devtype() == 'partition' \ + and self.gpii_token: + self.gpii_logout() + + def gpii_login(self): + h = httplib2.Http() + try: + resp, content = h.request("http://localhost:8081/user/%s/login" % \ + (self.gpii_token,)) + if resp.status == 200: + print content + self.log.info(content); + except socket_error, e: + print e + + def gpii_logout(self): + h = httplib2.Http() + try: + resp, content = h.request("http://localhost:8081/user/%s/logout" % \ + (self.gpii_token,)) + if resp.status == 200: + print content + self.log.info(content); + except socket_error, e: + print e + +if __name__=='__main__': + listener = UserListener() + main_loop = GLib.MainLoop() + try: + print "\nStarting the GPII USB Drive User Listener" + main_loop.run() + except KeyboardInterrupt: + print "\nStopping the GPII USB Drive User Listener" + except Exception: + raise diff --git a/usbDriveListener/gpii-usb-user-listener.desktop b/usbDriveListener/gpii-usb-user-listener.desktop new file mode 100644 index 0000000..e36d303 --- /dev/null +++ b/usbDriveListener/gpii-usb-user-listener.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Categories=System; +Type=Application +Name=GPII USB Drive User Listener +Exec=gpii-usb-user-listener +Terminal=true From 9b7c20da98379f5c5dc24d7480767d8c725b948a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 23 Jan 2014 16:47:48 +0100 Subject: [PATCH 118/319] GPII-545: Updating build.sh according to the new GPII usb user listener --- build.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index d2dc8e3..d5c06cc 100755 --- a/build.sh +++ b/build.sh @@ -15,7 +15,6 @@ node_modules="../node_modules" universal="../node_modules/universal" repoURL="git://github.com/GPII/universal.git" usbListenerDir="./usbDriveListener" -gpiiInstallDir="/usr/local/gpii" gpiiStateDir="/var/lib/gpii" # Clone the necessary GPII framework dependencies from Git. @@ -55,23 +54,17 @@ cd ../../.. # Create standard directory structure for GPII. # Note: everything below here must be run as root, since we're installing ourselves centrally. -if [ -d $gpiiInstallDir ]; then - echo "$gpiiInstallDir already exists" -else - echo "$gpiiInstallDir does not exist" - echo "creating $gpiiInstallDir" - sudo mkdir -p "$gpiiInstallDir" -fi - if [ -d $gpiiStateDir ]; then echo "$gpiiStateDir already exists" else echo "$gpiiStateDir does not exist" echo "creating $gpiiStateDir" sudo mkdir -p "$gpiiStateDir" + sudo touch "$gpiiStateDir/log.txt" + sudo chmod a+rw "$gpiiStateDir/log.txt" fi # Install the USB Drive User Listener # TODO: We should install the entire GPII in /usr/local/gpii, not just the USB Listener -sudo cp -r "$usbListenerDir/bin" "$gpiiInstallDir/bin" -sudo cp "$usbListenerDir/80-gpii.rules" /etc/udev/rules.d/ +sudo cp "$usbListenerDir/gpii-usb-user-listener" /usr/bin/ +sudo cp "$usbListenerDir/gpii-usb-user-listener.desktop" /usr/share/applications/ From 17f62a5ca660e9a003aa1f3b60acc7299637f0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 23 Jan 2014 16:50:47 +0100 Subject: [PATCH 119/319] GPII-545: Removing old GPII usb user listener-related stuff --- usbDriveListener/80-gpii.rules | 2 -- usbDriveListener/bin/handleUserDeviceEvent.sh | 36 ------------------- usbDriveListener/bin/trigger.sh | 18 ---------- 3 files changed, 56 deletions(-) delete mode 100644 usbDriveListener/80-gpii.rules delete mode 100755 usbDriveListener/bin/handleUserDeviceEvent.sh delete mode 100755 usbDriveListener/bin/trigger.sh diff --git a/usbDriveListener/80-gpii.rules b/usbDriveListener/80-gpii.rules deleted file mode 100644 index d4d5289..0000000 --- a/usbDriveListener/80-gpii.rules +++ /dev/null @@ -1,2 +0,0 @@ -KERNEL=="sd[a-z]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/usr/local/gpii/bin/trigger.sh 1 /dev/%k" -KERNEL=="sd[a-z]", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/usr/local/gpii/bin/trigger.sh 0 /dev/%k" diff --git a/usbDriveListener/bin/handleUserDeviceEvent.sh b/usbDriveListener/bin/handleUserDeviceEvent.sh deleted file mode 100755 index 79a6ba1..0000000 --- a/usbDriveListener/bin/handleUserDeviceEvent.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -# GPII Linux USB Drive User Listener -# -# Copyright 2012 Astea Solutions -# -# Licensed under the New BSD license. You may not use this file except in -# compliance with this License. -# -# You may obtain a copy of the License at -# https://github.com/gpii/universal/LICENSE.txt - -usersFilePath="/var/lib/gpii/users.txt" -logFilePath="/var/lib/gpii/log.txt" - -if [ $1 -eq 1 ]; then - # USB disk drive is added. - retries=0 - # Wait for drive to be mounted. There should be a better solution using nautilus. - until [[ `mount | grep $2` || $retries -ge 5 ]]; do - retries=$[$retries+1] - sleep 1 - done - - mountLocation=`mount | grep $2 | sed -e "s#/[^ ]\+ [^ ]\+ \(.*\) type.*#\1#" | head -n 1` - token=`cat "$mountLocation/.gpii-user-token.txt"` - echo "User logged in on device $2 with token ${token}." >> "$logFilePath" - echo $2:$token >> "$usersFilePath" # Keep the location and token in a users file. - curl http://localhost:8081/user/$token/login -else - # USB disk drive is removed. - token=`grep $2 < "$usersFilePath" | cut -d ":" -f 2` - curl http://localhost:8081/user/$token/logout - sed -ie "\|^$2|d" "$usersFilePath" # Remove entry from the users file - echo "User logged out from device $2 with token ${token}." >> "$logFilePath" -fi diff --git a/usbDriveListener/bin/trigger.sh b/usbDriveListener/bin/trigger.sh deleted file mode 100755 index 863e477..0000000 --- a/usbDriveListener/bin/trigger.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# GPII Linux USB Drive User Listener -# -# Copyright 2012 Astea Solutions -# -# Licensed under the New BSD license. You may not use this file except in -# compliance with this License. -# -# You may obtain a copy of the License at -# https://github.com/gpii/universal/LICENSE.txt - -# This is a workaround for correct udev script execution. -# There should be a way to avoid using a intermediate file. - -gpiiBinPath="/usr/local/gpii/bin" - -"$gpiiBinPath/handleUserDeviceEvent.sh" $1 $2 & exit From 060fee25c7924118747a99d0ba5b7e317308e9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 23 Jan 2014 16:52:23 +0100 Subject: [PATCH 120/319] GPII-545: Updating README according to the new GPII usb user listener Removing tests/.gpii-user-token.txt. I don't think much people is using this now since '123' N&P set doesn't exist anymore in testData/preferences folder of the universal repo and nobody noticed it. --- usbDriveListener/README | 24 ++++++++++++++++++--- usbDriveListener/tests/.gpii-user-token.txt | 1 - 2 files changed, 21 insertions(+), 4 deletions(-) delete mode 100644 usbDriveListener/tests/.gpii-user-token.txt diff --git a/usbDriveListener/README b/usbDriveListener/README index 03ef21a..222e030 100644 --- a/usbDriveListener/README +++ b/usbDriveListener/README @@ -1,6 +1,24 @@ +GPII Linux USB Drive User Listener +================================== + +The **GPII Linux USB Drive User Listener** is a standalone application which +looks for new filesystems on the system such as USB drives, SD cards, etc. +When a new filesystem has been added the application will look for a valid +token on the partition, if the token exists it will trigger the login process +into the GPII. + +If you've installed the GPII you can run the user listener in the same way you +launch any other application from the system, but also, you can run the user +listener yourself by typying _gpii-usb-user-listener_. + +If you still haven't installed it, you can run it from the source code just by +typing _./gpii-usb-user-listener_ but you should make sure that you have write +access to _/var/lib/gpii/log.txt_ + Usage instructions: -1. Make sure you've built the Linux repository by running ../build.sh -2. Prepare a USB stick with a Linux-readable file system -3. Copy tests/.gpii-user-token.txt to the root level of your USB stick +1. Prepare a USB stick with a popular readable file system +2. Create a file _.gpii-user-token.txt_ (with a valid token on it) in the top +level of your USB stick +3. Start the **GPII Linux USB Drive User Listener** 4. Start the Flow Manager by running ../start.sh 5. Add/remove the USB stick and watch your settings change! diff --git a/usbDriveListener/tests/.gpii-user-token.txt b/usbDriveListener/tests/.gpii-user-token.txt deleted file mode 100644 index d800886..0000000 --- a/usbDriveListener/tests/.gpii-user-token.txt +++ /dev/null @@ -1 +0,0 @@ -123 \ No newline at end of file From be2ca39d73baa813ab75c5b001eb925685ced148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 24 Jan 2014 09:17:44 +0100 Subject: [PATCH 121/319] GPII-545: Renaming README file as README.md --- usbDriveListener/{README => README.md} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename usbDriveListener/{README => README.md} (95%) diff --git a/usbDriveListener/README b/usbDriveListener/README.md similarity index 95% rename from usbDriveListener/README rename to usbDriveListener/README.md index 222e030..797feaa 100644 --- a/usbDriveListener/README +++ b/usbDriveListener/README.md @@ -16,9 +16,10 @@ typing _./gpii-usb-user-listener_ but you should make sure that you have write access to _/var/lib/gpii/log.txt_ Usage instructions: + 1. Prepare a USB stick with a popular readable file system 2. Create a file _.gpii-user-token.txt_ (with a valid token on it) in the top level of your USB stick 3. Start the **GPII Linux USB Drive User Listener** -4. Start the Flow Manager by running ../start.sh +4. Start the Flow Manager by running _start.sh_ 5. Add/remove the USB stick and watch your settings change! From 67f7f58b64a7a373f19e2d1728038dd30df56bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 7 Feb 2014 16:36:38 +0100 Subject: [PATCH 122/319] GPII-571: Adding AcceptanceTests_include.js --- .../AcceptanceTests_include.js | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/acceptanceTests/AcceptanceTests_include.js diff --git a/tests/acceptanceTests/AcceptanceTests_include.js b/tests/acceptanceTests/AcceptanceTests_include.js new file mode 100644 index 0000000..827ebe2 --- /dev/null +++ b/tests/acceptanceTests/AcceptanceTests_include.js @@ -0,0 +1,41 @@ +/* + * + * GPII Acceptance Testing + * + * Copyright 2014 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/gpii/universal/LICENSE.txt + * */ + +/*global __dirname, require*/ + +"use strict"; +var fluid = require("universal"), + path = require("path"), + kettle = fluid.registerNamespace("kettle"), + gpii = fluid.registerNamespace("gpii"); + +fluid.registerNamespace("gpii.acceptanceTesting.linux"); + +fluid.require("../../node_modules/gsettingsBridge", require); +fluid.require("../../node_modules/orca", require); +fluid.require("../../node_modules/alsa", require); +fluid.require("../../node_modules/xrandr", require); + +fluid.require("universal/tests/AcceptanceTests", require); + +gpii.acceptanceTesting.linux.runTests = function (configFile, testDefs) { + var gpiiConfig = { + nodeEnv: configFile, + configPath: path.resolve(__dirname, "./configs") + }; + fluid.each(testDefs, function (testDef) { + testDef.config = gpiiConfig; + }); + testDefs = gpii.acceptanceTesting.buildTests(testDefs); + module.exports = kettle.tests.bootstrap(testDefs); +} From 4fa87f3c84964b2e12743d9cfa55f49c9b4d8f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 7 Feb 2014 16:38:45 +0100 Subject: [PATCH 123/319] GPII-571: Splitting up orca-related acceptance tests Adding tests for screenreader_common, screenreader_nvda and screenreader_orca and deleting them from old AcceptanceTests.js. --- tests/AcceptanceTests.js | 130 --------------- tests/acceptanceTests/AcceptanceTests_orca.js | 157 ++++++++++++++++++ .../acceptanceTests/AcceptanceTests_orca.txt | 6 + .../acceptanceTests/configs/orca_config.json | 21 +++ tests/acceptanceTests/configs/orca_config.txt | 8 + 5 files changed, 192 insertions(+), 130 deletions(-) create mode 100644 tests/acceptanceTests/AcceptanceTests_orca.js create mode 100644 tests/acceptanceTests/AcceptanceTests_orca.txt create mode 100644 tests/acceptanceTests/configs/orca_config.json create mode 100644 tests/acceptanceTests/configs/orca_config.txt diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index 8e18f38..de54b21 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -206,136 +206,6 @@ var testDefs = [ expectRestored: "false" } ] - }, - { - name: "Testing screenreader_common using Flat matchmaker", - config: gpiiConfig, - token: "screenreader_common", - settingsHandlers: { - "gpii.orca": { - "data": [{ - "settings": { - "sayAllStyle": 1, - "enableEchoByWord": true, - "enableEchoByCharacter": false, - "enableTutorialMessages": false, - "verbalizePunctuationStyle": 0, - "enableSpeech": true, - "voices" : { - "default" : { - "established": false, - "rate": 102.27272727272727, - "average-pitch": 1.5, - "gain": 7.5, - "family": { - "locale": "en", - "name": "en-westindies" - }, - - }, - "uppercase": { "average-pitch": 7 }, - "system": { "established": false }, - "hyperlink": { "established": false } - } - }, - "options": { - "user": "screenreader_common" - } - } ] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", - expectConfigured: "true", - expectRestored: "false" - } - ] - }, - { - name: "Testing screenreader_orca using Flat matchmaker", - config: gpiiConfig, - token: "screenreader_orca", - settingsHandlers: { - "gpii.orca": { - "data": [{ - "settings": { - "sayAllStyle": 1, - "enableEchoByWord": true, - "enableEchoByCharacter": false, - "enableTutorialMessages": false, - "verbalizePunctuationStyle": 0, - "voices" : { - "default" : { - "established": false, - "rate": 102.27272727272727, - "average-pitch": 1.5, - "gain": 7.5, - "family": { - "locale": "en", - "name": "en-westindies" - } - }, - "uppercase": { "average-pitch": 7 }, - "system": { "established": false }, - "hyperlink": { "established": false } - } - }, - "options": { - "user": "screenreader_orca" - } - } ] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", - expectConfigured: "true", - expectRestored: "false" - } - ] - }, - { - name: "Testing screenreader_nvda using Flat matchmaker", - config: gpiiConfig, - token: "screenreader_nvda", - settingsHandlers: { - "gpii.orca": { - "data": [{ - "settings": { - "sayAllStyle": 1, - "enableEchoByWord": true, - "enableEchoByCharacter": false, - "enableTutorialMessages": false, - "verbalizePunctuationStyle": 0, - "voices" : { - "default" : { - "established": false, - "rate": 102.27272727272727, - "family": { - "locale": "en", - "name": "en-westindies" - }, - - }, - "uppercase": { "average-pitch": 7 }, - "system": { "established": false }, - "hyperlink": { "established": false } - } - }, - "options": { - "user": "screenreader_nvda" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", - expectConfigured: "true", - expectRestored: "false" - } - ] } ]; diff --git a/tests/acceptanceTests/AcceptanceTests_orca.js b/tests/acceptanceTests/AcceptanceTests_orca.js new file mode 100644 index 0000000..fb6e13b --- /dev/null +++ b/tests/acceptanceTests/AcceptanceTests_orca.js @@ -0,0 +1,157 @@ +/* + +GPII Acceptance Testing + +Copyright 2014 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +/*global require,process*/ + +"use strict"; +var fluid = require("universal"), + path = require("path"), + gpii = fluid.registerNamespace("gpii"); + +fluid.require("./AcceptanceTests_include", require); + +var testDefs = [ + { + name: "Testing screenreader_common using Flat matchmaker", + token: "screenreader_common", + settingsHandlers: { + "gpii.orca": { + "data": [ + { + "settings": { + "sayAllStyle": 1, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "enableTutorialMessages": false, + "verbalizePunctuationStyle": 0, + "enableSpeech": true, + "voices" : { + "default" : { + "established": false, + "rate": 102.27272727272727, + "average-pitch": 1.5, + "gain": 7.5, + "family": { + "locale": "en", + "name": "en-westindies" + } + }, + "uppercase": { "average-pitch": 7 }, + "system": { "established": false }, + "hyperlink": { "established": false } + } + }, + "options": { + "user": "screenreader_common" + } + } + ] + } + }, + processes: [ + { + "command": "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", + "expectConfigured": "true", + "expectRestored": "false" + } + ] + }, + { + name: "Testing screenreader_orca using Flat matchmaker", + token: "screenreader_orca", + settingsHandlers: { + "gpii.orca": { + "data": [ + { + "settings": { + "sayAllStyle": 1, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "enableTutorialMessages": false, + "verbalizePunctuationStyle": 0, + "voices" : { + "default" : { + "established": false, + "rate": 102.27272727272727, + "average-pitch": 1.5, + "gain": 7.5, + "family": { + "locale": "en", + "name": "en-westindies" + } + }, + "uppercase": { "average-pitch": 7 }, + "system": { "established": false }, + "hyperlink": { "established": false } + } + }, + "options": { + "user": "screenreader_orca" + } + } + ] + } + }, + processes: [ + { + "command": "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", + "expectConfigured": "true", + "expectRestored": "false" + } + ] + }, + { + name: "Testing screenreader_nvda using Flat matchmaker", + token: "screenreader_nvda", + settingsHandlers: { + "gpii.orca": { + "data": [ + { + "settings": { + "sayAllStyle": 1, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "enableTutorialMessages": false, + "verbalizePunctuationStyle": 0, + "voices" : { + "default" : { + "established": false, + "rate": 102.27272727272727, + "family": { + "locale": "en", + "name": "en-westindies" + } + }, + "uppercase": { "average-pitch": 7 }, + "system": { "established": false }, + "hyperlink": { "established": false } + } + }, + "options": { + "user": "screenreader_nvda" + } + } + ] + } + }, + processes: [ + { + "command": "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", + "expectConfigured": "true", + "expectRestored": "false" + } + ] + } +]; + +gpii.acceptanceTesting.linux.runTests("orca_config", testDefs); diff --git a/tests/acceptanceTests/AcceptanceTests_orca.txt b/tests/acceptanceTests/AcceptanceTests_orca.txt new file mode 100644 index 0000000..cb1aa3c --- /dev/null +++ b/tests/acceptanceTests/AcceptanceTests_orca.txt @@ -0,0 +1,6 @@ +AcceptanceTests_orca.js + +Descriptions: + +This will run the acceptance tests for GNOME Orca screen reader. +It uses 3 NP sets: screenreader_orca, screenreader_nvda and screenreader_common. diff --git a/tests/acceptanceTests/configs/orca_config.json b/tests/acceptanceTests/configs/orca_config.json new file mode 100644 index 0000000..8897edd --- /dev/null +++ b/tests/acceptanceTests/configs/orca_config.json @@ -0,0 +1,21 @@ +{ + "typeName": "acceptanceTests.orca", + "options": { + "components": { + "server": { + "options": { + "components": { + "deviceReporter": { + "options": { + "installedSolutionsUrl": "file://%root/../../../testData/deviceReporter/acceptanceTests/orca.json" + } + } + } + } + } + } + }, + "includes": [ + "../../../../node_modules/universal/tests/acceptanceTests/configs/localInstall.json" + ] +} diff --git a/tests/acceptanceTests/configs/orca_config.txt b/tests/acceptanceTests/configs/orca_config.txt new file mode 100644 index 0000000..c8c82d5 --- /dev/null +++ b/tests/acceptanceTests/configs/orca_config.txt @@ -0,0 +1,8 @@ +This configuration file is used by the for acceptance test: AcceptanceTests_orca.js. + +It includes to the basic localInstall setup for acceptance tests (modifying the +preferences folder used), which in turn includes the standard development +config file (running GPII locally, using development setup). + +This config sets the device reporter file to be 'orca.json', which will report +Orca as being installed on the system. From f99690b4020ddffca0e98b1ee03028947b3de51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 7 Feb 2014 17:10:36 +0100 Subject: [PATCH 124/319] GPII-571: Splitting up linux builtin-related acceptance tests Adding tests for os_common, os_win7 and os_gnome and deleting them from old AcceptanceTests.js. --- tests/AcceptanceTests.js | 111 --------------- .../AcceptanceTests_builtIn.js | 134 ++++++++++++++++++ .../AcceptanceTests_builtIn.txt | 10 ++ .../configs/builtIn_config.json | 21 +++ .../configs/builtIn_config.txt | 8 ++ 5 files changed, 173 insertions(+), 111 deletions(-) create mode 100644 tests/acceptanceTests/AcceptanceTests_builtIn.js create mode 100644 tests/acceptanceTests/AcceptanceTests_builtIn.txt create mode 100644 tests/acceptanceTests/configs/builtIn_config.json create mode 100644 tests/acceptanceTests/configs/builtIn_config.txt diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index de54b21..22e378b 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -95,117 +95,6 @@ var testDefs = [ expectRestored: "false" } ] - }, - { - name: "Testing os_common using Flat matchmaker", - config: gpiiConfig, - token: "os_common", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "mag-factor": 1.5, - "screen-position": "full-screen", - "show-cross-hairs": false - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - }, - } , { - "settings": { - "gtk-theme": "HighContrast", - "icon-theme": "HighContrast", - "text-scaling-factor": 0.75, - "cursor-size": 41 - }, - "options": { - "schema": "org.gnome.desktop.interface" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - expectConfigured: "true", - expectRestored: "false" - } - ] - }, - { - name: "Testing os_gnome using Flat matchmaker", - config: gpiiConfig, - token: "os_gnome", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "mag-factor": 1.5, - "screen-position": "full-screen", - "show-cross-hairs": false - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - }, - } , { - "settings": { - "text-scaling-factor": 0.75, - "cursor-size": 90 - }, - "options": { - "schema": "org.gnome.desktop.interface" - } - }] - }, - "gpii.alsa": { - "data": [{ - "settings": { - "masterVolume": 50 - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - expectConfigured: "true", - expectRestored: "false" - } - ] - }, - { - name: "Testing os_win7 using Flat matchmaker", - config: gpiiConfig, - token: "os_win7", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "mag-factor": 1.5, - "screen-position": "full-screen" - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - }, - } , { - "settings": { - "gtk-theme":"HighContrast", - "icon-theme":"HighContrast", - "cursor-size": 41 - }, - "options": { - "schema": "org.gnome.desktop.interface" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - expectConfigured: "true", - expectRestored: "false" - } - ] } ]; diff --git a/tests/acceptanceTests/AcceptanceTests_builtIn.js b/tests/acceptanceTests/AcceptanceTests_builtIn.js new file mode 100644 index 0000000..4ebf71d --- /dev/null +++ b/tests/acceptanceTests/AcceptanceTests_builtIn.js @@ -0,0 +1,134 @@ +/* + +GPII Acceptance Testing + +Copyright 2014 Emergya + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +/*global require,process*/ + +"use strict"; +var fluid = require("universal"), + path = require("path"), + gpii = fluid.registerNamespace("gpii"); + +fluid.require("./AcceptanceTests_include", require); + +var testDefs = [ + { + name: "Testing os_common using Flat matchmaker", + token: "os_common", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen", + "show-cross-hairs": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + }, + } , { + "settings": { + "gtk-theme": "HighContrast", + "icon-theme": "HighContrast", + "text-scaling-factor": 0.75, + "cursor-size": 41 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + } + }, + processes: [ + { + "command": "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + "expectConfigured": "true", + "expectRestored": "false" + } + ] + }, + { + name: "Testing os_gnome using Flat matchmaker", + token: "os_gnome", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen", + "show-cross-hairs": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + }, + } , { + "settings": { + "text-scaling-factor": 0.75, + "cursor-size": 90 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + }, + "gpii.alsa": { + "data": [{ + "settings": { + "masterVolume": 50 + } + }] + } + }, + processes: [ + { + "command": "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + "expectConfigured": "true", + "expectRestored": "false" + } + ] + }, + { + name: "Testing os_win7 using Flat matchmaker", + token: "os_win7", + settingsHandlers: { + "gpii.gsettings": { + "data": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + }, + } , { + "settings": { + "gtk-theme":"HighContrast", + "icon-theme":"HighContrast", + "cursor-size": 41 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + } + }, + processes: [ + { + "command": "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", + "expectConfigured": "true", + "expectRestored": "false" + } + ] + } +]; + +gpii.acceptanceTesting.linux.runTests("builtIn_config", testDefs); diff --git a/tests/acceptanceTests/AcceptanceTests_builtIn.txt b/tests/acceptanceTests/AcceptanceTests_builtIn.txt new file mode 100644 index 0000000..a96fa27 --- /dev/null +++ b/tests/acceptanceTests/AcceptanceTests_builtIn.txt @@ -0,0 +1,10 @@ +AcceptanceTests_builtIn.js + +Description: + +This tests the built in functionality of GNU/Linux+GNOME, incl. magnifier, +onscreen keyboard, etc. It tests the system using three NP sets: + (1) os_common: common terms compatible with windows built in settings + (2) os_win7: application specific windows settings + (3) os_gnome: application specific gnome settings + diff --git a/tests/acceptanceTests/configs/builtIn_config.json b/tests/acceptanceTests/configs/builtIn_config.json new file mode 100644 index 0000000..8c1494a --- /dev/null +++ b/tests/acceptanceTests/configs/builtIn_config.json @@ -0,0 +1,21 @@ +{ + "typeName": "acceptanceTests.builtIn", + "options": { + "components": { + "server": { + "options": { + "components": { + "deviceReporter": { + "options": { + "installedSolutionsUrl": "file://%root/../../../testData/deviceReporter/acceptanceTests/linux_builtIn.json" + } + } + } + } + } + } + }, + "includes": [ + "../../../../node_modules/universal/tests/acceptanceTests/configs/localInstall.json" + ] +} diff --git a/tests/acceptanceTests/configs/builtIn_config.txt b/tests/acceptanceTests/configs/builtIn_config.txt new file mode 100644 index 0000000..da7edb4 --- /dev/null +++ b/tests/acceptanceTests/configs/builtIn_config.txt @@ -0,0 +1,8 @@ +This config file is used by the for acceptance test: AcceptanceTests_builtIn.js. + +It includes to the basic localInstall setup for acceptance tests (modifying the +preferences folder used), which in turn includes the standard development +config file (running GPII locally, using development setup). + +This config sets the device reporter file to be 'linux_builtIn.json', which will +report only the standard built in solutions as installed. From add38326f6335bafa42e563b8f2be415c42635a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 7 Feb 2014 17:20:43 +0100 Subject: [PATCH 125/319] GPII-571: Removing remaining stuff from old AcceptanceTests --- tests/AcceptanceTests.js | 103 ------------------ .../setup1/configs/development-config.json | 5 - 2 files changed, 108 deletions(-) delete mode 100644 tests/AcceptanceTests.js delete mode 100644 tests/acceptanceTests/setup1/configs/development-config.json diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js deleted file mode 100644 index 22e378b..0000000 --- a/tests/AcceptanceTests.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - -GPII acceptance Testing - -Copyright 2013 Raising the Floor International - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ - -/*global __dirname, require*/ - -"use strict"; -var fluid = require("universal"), - path = require("path"), - kettle = fluid.registerNamespace("kettle"), - gpii = fluid.registerNamespace("gpii"); - -require("gsettingsBridge"); -require("orca"); -require("alsa"); - -fluid.require("universal/tests/AcceptanceTests", require); - -var configPath = path.resolve(__dirname, "./acceptanceTests/setup1/configs"); -var gpiiConfig = { - nodeEnv: "development-config", - configPath: configPath -}; - -var testDefs = [ - { - name: "Testing Mikel Vargas using Flat matchmaker (onscreen keyboard)", - config: gpiiConfig, - token: "MikelVargas", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "slowkeys-delay": 400, - "slowkeys-enable": true, - "bouncekeys-delay": 200, - "mousekeys-enable": true, - "stickykeys-enable": true, - "bouncekeys-enable": true, - "mousekeys-max-speed": 850, - "mousekeys-init-delay": 120, - "mousekeys-accel-time": 800 - }, - "options": { - "schema": "org.gnome.desktop.a11y.keyboard" - } - }] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled", - expectConfigured: "true", - expectRestored: "false" - } - ] - }, - { - name: "Testing Sammy using Flat matchmaker", - config: gpiiConfig, - token: "sammy", - settingsHandlers: { - "gpii.gsettings": { - "data": [{ - "settings": { - "mag-factor": 2, - "mouse-tracking": "centered" - }, - "options": { - "schema": "org.gnome.desktop.a11y.magnifier" - } - }, { - "settings": { - "text-scaling-factor": 2 - }, - "options": { - "schema": "org.gnome.desktop.interface" - } - } ] - } - }, - processes: [ - { - command: "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - expectConfigured: "true", - expectRestored: "false" - } - ] - } -]; - - -testDefs = gpii.acceptanceTesting.buildTests(testDefs); -module.exports = kettle.tests.bootstrap(testDefs); diff --git a/tests/acceptanceTests/setup1/configs/development-config.json b/tests/acceptanceTests/setup1/configs/development-config.json deleted file mode 100644 index a9c666c..0000000 --- a/tests/acceptanceTests/setup1/configs/development-config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "includes": [ - "../../../../../node_modules/universal/gpii/configs/fm.ps.sr.dr.mm.os.lms.development.json" - ] -} \ No newline at end of file From aa2f3fd88c5ebeeddf12653de8ae5c44bb9523d4 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Mon, 29 Oct 2012 19:40:01 -0400 Subject: [PATCH 126/319] Tests using packagekit glib wrapper --- .../nodepackagekit/nodepackagekit.cc | 95 +++++++++++++++++++ .../nodepackagekit/nodepackagekit_test.js | 21 ++++ .../packagekit/nodepackagekit/wscript | 20 ++++ 3 files changed, 136 insertions(+) create mode 100644 node_modules/packagekit/nodepackagekit/nodepackagekit.cc create mode 100644 node_modules/packagekit/nodepackagekit/nodepackagekit_test.js create mode 100644 node_modules/packagekit/nodepackagekit/wscript diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc new file mode 100644 index 0000000..f13e0dc --- /dev/null +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -0,0 +1,95 @@ +/* +GPII Node.js GSettings Bridge + +Copyright 2012 Steven Githens + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ +#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE 1 + +#include +#include +#include +//#include +#include + +using namespace v8; + +static void +pk_print_package (PkPackage *package, gpointer data) { + gchar *printable = NULL; + gchar *printable_pad = NULL; + gchar *package_id = NULL; + gchar *summary = NULL; + gchar *info_pad = NULL; + gchar **split = NULL; + PkInfoEnum info; + + /* get data */ + g_object_get (package, + "info", &info, + "package-id", &package_id, + "summary", &summary, + NULL); + + /* ignore finished */ + // if (info == PK_INFO_ENUM_FINISHED) + // goto out; + + /* split */ + // split = pk_package_id_split (package_id); + // if (split == NULL) + // goto out; + + /* make these all the same length */ + // info_pad = pk_strpad (pk_info_enum_to_localised_past (info), 12); + + /* create printable */ + printable = pk_package_id_to_printable (package_id); + g_print("%s\n", printable); + /* don't pretty print */ + // if (!is_console) { + // g_print ("%s %s\n", info_pad, printable); + // goto out; + // } + + /* pad the name-version */ + // printable_pad = pk_strpad (printable, 40); + // g_print ("%s\t%s\t%s\n", info_pad, printable_pad, summary); + // out: + // /* free all the data */ + // g_free (printable); + // g_free (printable_pad); + // g_free (info_pad); + // g_strfreev (split); +} + +Handle packagekit_hello(const Arguments& args) { + HandleScope scope; + PkClient *client; + PkResults *results; + GPtrArray *array; + PkPackageSack *sack; + char *names[] = {"gnome"}; + GPtrArray *message_array; + client = pk_client_new(); + results = pk_client_search_names(client,PK_FILTER_ENUM_FREE,names,NULL,NULL,NULL,NULL); + message_array = pk_results_get_message_array(results); + sack = pk_results_get_package_sack(results); + pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); + array = pk_package_sack_get_array(sack); + g_ptr_array_foreach(array,(GFunc) pk_print_package, NULL); + return scope.Close(String::New("Hello World Package Kit w/ PkClient")); +} + +void init(Handle target) { + g_type_init(); // Initialize gobject system + target->Set(String::NewSymbol("packagekit_hello"), + FunctionTemplate::New(packagekit_hello)->GetFunction()); +} +NODE_MODULE(nodepackagekit, init) + diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js new file mode 100644 index 0000000..4900093 --- /dev/null +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -0,0 +1,21 @@ +/*! +GPII Node.js GSettings Bridge + +Copyright 2012 Steven Githens + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +var util = require('util'); +var assert = require('assert'); +var exec = require('child_process').exec; + +var packagekit = require('./build/Release/nodepackagekit.node'); + +util.puts("Going to try the package Kit!"); +util.puts(packagekit.packagekit_hello()); +util.puts("Done trying the package kit!"); diff --git a/node_modules/packagekit/nodepackagekit/wscript b/node_modules/packagekit/nodepackagekit/wscript new file mode 100644 index 0000000..b27b40e --- /dev/null +++ b/node_modules/packagekit/nodepackagekit/wscript @@ -0,0 +1,20 @@ +srcdir = '.' +blddir = 'build' +VERSION = '0.0.1' + +def set_options(opt): + opt.tool_options('compiler_cxx') + +def configure(conf): + conf.check_tool('compiler_cxx') + conf.check_tool('node_addon') + conf.check_cfg(package='gtk+-3.0', uselib_store='GTK', args='--cflags --libs') + conf.check_cfg(package='gio-2.0', uselib_store='GIO', args='--cflags --libs') + conf.check_cfg(package='glib-2.0', uselib_store='GLIB', args='--cflags --libs') + conf.check_cfg(package='packagekit-glib2', uselib_store='GLIB_PK', args='--cflags --libs') + +def build(bld): + obj = bld.new_task_gen('cxx', 'shlib', 'node_addon') + obj.target = 'nodepackagekit' + obj.source = 'nodepackagekit.cc' + obj.uselib = "GLIB GTK GIO GLIB_PK" \ No newline at end of file From 5973c69ab901b0aa8321768ccea3b0997eafb7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 30 Sep 2013 18:21:10 +0200 Subject: [PATCH 127/319] packagekitBridge: Initial implementation [changes] * Removing old example code * Adding searchPackage, installPackage and removePackage methods * Updating tests --- .../nodepackagekit/nodepackagekit.cc | 162 +++++++++++------- .../nodepackagekit/nodepackagekit_test.js | 9 +- 2 files changed, 101 insertions(+), 70 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index f13e0dc..46ad09d 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -1,7 +1,8 @@ /* -GPII Node.js GSettings Bridge +GPII Node.js PackageKit Bridge Copyright 2012 Steven Githens +Copyright 2013 Emergya Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -14,82 +15,117 @@ You may obtain a copy of the License at #include #include #include -//#include #include +#include using namespace v8; -static void -pk_print_package (PkPackage *package, gpointer data) { - gchar *printable = NULL; - gchar *printable_pad = NULL; - gchar *package_id = NULL; - gchar *summary = NULL; - gchar *info_pad = NULL; - gchar **split = NULL; - PkInfoEnum info; - - /* get data */ - g_object_get (package, - "info", &info, - "package-id", &package_id, - "summary", &summary, - NULL); - - /* ignore finished */ - // if (info == PK_INFO_ENUM_FINISHED) - // goto out; - - /* split */ - // split = pk_package_id_split (package_id); - // if (split == NULL) - // goto out; - - /* make these all the same length */ - // info_pad = pk_strpad (pk_info_enum_to_localised_past (info), 12); - - /* create printable */ - printable = pk_package_id_to_printable (package_id); - g_print("%s\n", printable); - /* don't pretty print */ - // if (!is_console) { - // g_print ("%s %s\n", info_pad, printable); - // goto out; - // } - - /* pad the name-version */ - // printable_pad = pk_strpad (printable, 40); - // g_print ("%s\t%s\t%s\n", info_pad, printable_pad, summary); - // out: - // /* free all the data */ - // g_free (printable); - // g_free (printable_pad); - // g_free (info_pad); - // g_strfreev (split); -} - -Handle packagekit_hello(const Arguments& args) { +/** + * searchPackage: + * + * Should take as arguments: + * name: Name of the package, aka: search criteria (str) + * Returns: Array of packages matching the search criteria + */ +Handle searchPackage(const Arguments& args) { HandleScope scope; - PkClient *client; - PkResults *results; + PkClient *client = NULL; + PkResults *results = NULL; GPtrArray *array; - PkPackageSack *sack; - char *names[] = {"gnome"}; - GPtrArray *message_array; + PkPackageSack *sack = NULL; + char name[1024]; + args[0]->ToString()->WriteAscii(name); + gchar *names[] = {name}; + GError *err = NULL; + v8::Handle result = v8::Array::New(); + client = pk_client_new(); - results = pk_client_search_names(client,PK_FILTER_ENUM_FREE,names,NULL,NULL,NULL,NULL); - message_array = pk_results_get_message_array(results); + results = pk_client_search_names(client, PK_INFO_ENUM_INSTALLED | + PK_INFO_ENUM_AVAILABLE, names, + NULL, NULL, NULL, &err); + sack = pk_results_get_package_sack(results); pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); array = pk_package_sack_get_array(sack); - g_ptr_array_foreach(array,(GFunc) pk_print_package, NULL); - return scope.Close(String::New("Hello World Package Kit w/ PkClient")); + + for (unsigned int i=0; ilen; i++) { + PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); + + v8::Handle pac = v8::Object::New(); + pac->Set(String::New("id"), String::New(pk_package_get_id(package))); + pac->Set(String::New("name"), String::New(pk_package_get_name(package))); + pac->Set(String::New("version"), + String::New(pk_package_get_version(package))); + pac->Set(String::New("data"), String::New(pk_package_get_data(package))); + + result->Set(i,pac); + } + + if (results != NULL) + g_object_unref (results); + if (sack != NULL) + g_object_unref (sack); + + return scope.Close(result); +} + +/** + * installPackage: + * + * Should take as arguments: + * name: Name of the package (str) + * Returns: true | false (bool) + */ +Handle installPackage(const Arguments& args) { + HandleScope scope; + PkTask *task; + GError *err = NULL; + char name[1024]; + args[0]->ToString()->WriteUtf8(name); + gchar **package_ids = NULL; + + task = pk_task_new(); + package_ids = pk_package_ids_from_id (name); + pk_task_install_packages_sync(task, package_ids, NULL, NULL, NULL, &err); + + g_strfreev (package_ids); + + + return scope.Close(String::New("'installPackage' dummy method")); +} + +/** + * removePackage: + * + * Should take as arguments: + * name: Name of the package (str) + * Returns: true | false (bool) + */ +Handle removePackage(const Arguments& args) { + HandleScope scope; + PkTask *task; + GError *err = NULL; + char name[1024]; + args[0]->ToString()->WriteUtf8(name); + gchar **package_ids = NULL; + + task = pk_task_new(); + package_ids = pk_package_ids_from_id (name); + pk_task_remove_packages_sync(task, package_ids, TRUE, FALSE, NULL, NULL, NULL, &err); + + g_strfreev (package_ids); + + return scope.Close(String::New("'removePackage' dummy method")); } void init(Handle target) { g_type_init(); // Initialize gobject system - target->Set(String::NewSymbol("packagekit_hello"), - FunctionTemplate::New(packagekit_hello)->GetFunction()); + target->Set(String::NewSymbol("searchPackage"), + FunctionTemplate::New(searchPackage)->GetFunction()); + target->Set(String::NewSymbol("installPackage"), + FunctionTemplate::New(installPackage)->GetFunction()); + target->Set(String::NewSymbol("removePackage"), + FunctionTemplate::New(removePackage)->GetFunction()); } NODE_MODULE(nodepackagekit, init) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 4900093..6cda3a0 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -10,12 +10,7 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ -var util = require('util'); -var assert = require('assert'); -var exec = require('child_process').exec; - var packagekit = require('./build/Release/nodepackagekit.node'); -util.puts("Going to try the package Kit!"); -util.puts(packagekit.packagekit_hello()); -util.puts("Done trying the package kit!"); +var p = packagekit.searchPackage("orca"); +console.log(JSON.stringify(p, null, 2)); From 6b50eb878ec69e01f75a1429d891d1dcfdd55473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 30 Sep 2013 18:23:56 +0200 Subject: [PATCH 128/319] packagekitBridge: Updating build [changes] * Drop wscript * Include binding.gyp --- .../packagekit/nodepackagekit/binding.gyp | 11 ++++++++++ .../packagekit/nodepackagekit/wscript | 20 ------------------- 2 files changed, 11 insertions(+), 20 deletions(-) create mode 100644 node_modules/packagekit/nodepackagekit/binding.gyp delete mode 100644 node_modules/packagekit/nodepackagekit/wscript diff --git a/node_modules/packagekit/nodepackagekit/binding.gyp b/node_modules/packagekit/nodepackagekit/binding.gyp new file mode 100644 index 0000000..981609d --- /dev/null +++ b/node_modules/packagekit/nodepackagekit/binding.gyp @@ -0,0 +1,11 @@ +{ + "targets": [ + { + "target_name": "nodepackagekit", + "sources": ["nodepackagekit.cc"], + "libraries": [" Date: Mon, 30 Sep 2013 18:33:02 +0200 Subject: [PATCH 129/319] packagekitBridge: Return boolean from both install and remove methods --- node_modules/packagekit/nodepackagekit/nodepackagekit.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 46ad09d..17e3462 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -91,7 +91,7 @@ Handle installPackage(const Arguments& args) { g_strfreev (package_ids); - return scope.Close(String::New("'installPackage' dummy method")); + return scope.Close(True()); } /** @@ -115,7 +115,7 @@ Handle removePackage(const Arguments& args) { g_strfreev (package_ids); - return scope.Close(String::New("'removePackage' dummy method")); + return scope.Close(True()); } void init(Handle target) { From 21f2521e5b04ee526d03ced6684ae078268634ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 2 Oct 2013 01:42:37 +0200 Subject: [PATCH 130/319] packagekitBridge: Adding progress callback on PackageKit's transactions --- .../nodepackagekit/nodepackagekit.cc | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 17e3462..c4a36bc 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -20,6 +20,34 @@ You may obtain a copy of the License at using namespace v8; +/* Set DEBUG to TRUE in order to see the transactions' progress + * TODO: Allow switching DEBUG value from Node.js side + */ +static gboolean DEBUG = FALSE; + +static gchar TAG[] = "[nodePackagekit]"; + +static void +progressCallback(PkProgress *progress, PkProgressType type) { + if (!DEBUG) return; + PkStatusEnum status; + gint percentage; + gboolean allow_cancel; + + g_object_get(progress, + "status", &status, + "percentage", &percentage, + "allow-cancel", &allow_cancel, + NULL); + + if (type == PK_PROGRESS_TYPE_STATUS) { + printf ("%s Transaction status: %s\n", TAG, pk_status_enum_to_string (status)); + } else if (type == PK_PROGRESS_TYPE_PERCENTAGE) { + if (percentage > 0) + printf ("%s Current percentage: %d%%\n", TAG, percentage); + } +} + /** * searchPackage: * @@ -41,8 +69,8 @@ Handle searchPackage(const Arguments& args) { client = pk_client_new(); results = pk_client_search_names(client, PK_INFO_ENUM_INSTALLED | - PK_INFO_ENUM_AVAILABLE, names, - NULL, NULL, NULL, &err); + PK_INFO_ENUM_AVAILABLE, names, NULL, + (PkProgressCallback) progressCallback, NULL, &err); sack = pk_results_get_package_sack(results); pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); @@ -86,7 +114,10 @@ Handle installPackage(const Arguments& args) { task = pk_task_new(); package_ids = pk_package_ids_from_id (name); - pk_task_install_packages_sync(task, package_ids, NULL, NULL, NULL, &err); + + pk_task_install_packages_sync(task, package_ids, NULL, + (PkProgressCallback) progressCallback, + NULL, &err); g_strfreev (package_ids); @@ -111,7 +142,10 @@ Handle removePackage(const Arguments& args) { task = pk_task_new(); package_ids = pk_package_ids_from_id (name); - pk_task_remove_packages_sync(task, package_ids, TRUE, FALSE, NULL, NULL, NULL, &err); + + pk_task_remove_packages_sync(task, package_ids, TRUE, FALSE, NULL, + (PkProgressCallback) progressCallback, + NULL, &err); g_strfreev (package_ids); From 501921ea7d0372dca0972646785eac842ac725f4 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 2 Oct 2013 16:14:04 -0400 Subject: [PATCH 131/319] Added unit tests for the node packagekit add-on. --- .../nodepackagekit/nodepackagekit_test.js | 50 +++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 6cda3a0..7e3630a 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -1,7 +1,7 @@ /*! -GPII Node.js GSettings Bridge +GPII Node.js PackageKit Bridge -Copyright 2012 Steven Githens +Copyright 2013 Inclusive Design Research Centre, OCAD University Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -10,7 +10,49 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ +var assert = require('assert'); var packagekit = require('./build/Release/nodepackagekit.node'); -var p = packagekit.searchPackage("orca"); -console.log(JSON.stringify(p, null, 2)); +var testSearchPackage = function() { + var pkg = packagekit.searchPackage ('tuxguitar'); + assert.notEqual (pkg.length, 0, "No package for tuxguitar was found during search"); + var name = pkg[0].id.indexOf ("tuxguitar"); + assert.notEqual (name, -1, "tuxguitar package not found, found " + pkg[0].id + " instead"); +}; + +// Assume that machine is clean -- no tuxguitar package installed (see TODO +// below). +var testNotInstalledAtStart = function() { + var pkg = packagekit.searchPackage ('tuxguitar'); + assert.notEqual (pkg.length, 0, "No package for tuxguitar was found"); + + // TODO: This tests that the package is not installed, but it's not really + // an error if it's there. + var notInstalled = pkg[0].data.indexOf ('installed'); + assert.equal (notInstalled, -1, "Package tuxguitar is installed, data property is: '" + pkg[0].data + "'"); +}; + +var testInstallPackage = function() { + var pkg = packagekit.searchPackage ('tuxguitar'); + assert.notEqual (pkg.length, 0, "No package for tuxguitar; cannot install"); + + packagekit.installPackage (pkg[0].id); + pkg = packagekit.searchPackage ('tuxguitar'); + var installed = pkg[0].data.indexOf ('installed'); + assert.notEqual (installed, -1, "Package tuxguitar failed to install, data property is: '" + pkg[0].data + "'"); +}; + +var testRemovePackage = function() { + var pkg = packagekit.searchPackage ('tuxguitar'); + assert.notEqual (pkg.length, 0, "No package for tuxguitar; cannot remove"); + + packagekit.removePackage (pkg[0].id); + pkg = packagekit.searchPackage ('tuxguitar'); + var removed = pkg[0].data.indexOf ('installed'); + assert.equal (removed, -1, "Failed to remove tuxguitar package, data property is: '" + pkg[0].data + "'"); +}; + +testSearchPackage(); +testNotInstalledAtStart(); // needed? +testInstallPackage(); +testRemovePackage(); From cf2c312b4969b6aebbf717f7102c3b939e58200f Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Fri, 4 Oct 2013 16:55:17 -0400 Subject: [PATCH 132/319] Added unit tests for the node packagekit add-on -- jqUnit version. --- .../nodepackagekit/nodepackagekit_test.js | 68 +++++++++++-------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 7e3630a..2043c91 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -1,6 +1,7 @@ /*! GPII Node.js PackageKit Bridge +Copyright 2012 Steven Githens Copyright 2013 Inclusive Design Research Centre, OCAD University Licensed under the New BSD license. You may not use this file except in @@ -10,49 +11,56 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ -var assert = require('assert'); -var packagekit = require('./build/Release/nodepackagekit.node'); +var fluid = require ('universal'), + jqUnit = fluid.require ('jqUnit'), + packagekit = require('./build/Release/nodepackagekit.node'); -var testSearchPackage = function() { +jqUnit.module ('PackageKit Bridge node add-on module'); + +jqUnit.test ("Testing PackageKit Bridge", function() { + console.log ("Testing searchPackage() for 'tuxguitar'"); var pkg = packagekit.searchPackage ('tuxguitar'); - assert.notEqual (pkg.length, 0, "No package for tuxguitar was found during search"); + jqUnit.assertNotEquals ("No package for tuxguitar was found during search", + 0, pkg.length); var name = pkg[0].id.indexOf ("tuxguitar"); - assert.notEqual (name, -1, "tuxguitar package not found, found " + pkg[0].id + " instead"); -}; + jqUnit.assertNotEquals ("No tuxguitar package found, found " + + pkg[0].id + " instead", + -1, name); -// Assume that machine is clean -- no tuxguitar package installed (see TODO -// below). -var testNotInstalledAtStart = function() { - var pkg = packagekit.searchPackage ('tuxguitar'); - assert.notEqual (pkg.length, 0, "No package for tuxguitar was found"); + console.log ("Checking that tuxguitar package is not installed"); + pkg = packagekit.searchPackage ('tuxguitar'); + jqUnit.assertNotEquals ("No package for tuxguitar found", 0, pkg.length); - // TODO: This tests that the package is not installed, but it's not really - // an error if it's there. + // TODO: This tests that tuxguitar is not installed, but it's not really + // an error if it's there. For now, manually remove tuxguitar + // before running tests. var notInstalled = pkg[0].data.indexOf ('installed'); - assert.equal (notInstalled, -1, "Package tuxguitar is installed, data property is: '" + pkg[0].data + "'"); -}; + jqUnit.assertEquals ("Package tuxguitar is installed, data property is: '" + + pkg[0].data + "'", + -1, notInstalled); -var testInstallPackage = function() { - var pkg = packagekit.searchPackage ('tuxguitar'); - assert.notEqual (pkg.length, 0, "No package for tuxguitar; cannot install"); + console.log ("Testing installPackage()"); + pkg = packagekit.searchPackage ('tuxguitar'); + jqUnit.assertNotEquals ("No package tuxguitar available; cannot install", + 0, pkg.length); packagekit.installPackage (pkg[0].id); pkg = packagekit.searchPackage ('tuxguitar'); var installed = pkg[0].data.indexOf ('installed'); - assert.notEqual (installed, -1, "Package tuxguitar failed to install, data property is: '" + pkg[0].data + "'"); -}; + jqUnit.assertNotEquals ("Failure installing tuxguitar, data property is: '" + + pkg[0].data + "'", + -1, installed); -var testRemovePackage = function() { - var pkg = packagekit.searchPackage ('tuxguitar'); - assert.notEqual (pkg.length, 0, "No package for tuxguitar; cannot remove"); + console.log ("Testing removePackage()"); + pkg = packagekit.searchPackage ('tuxguitar'); + jqUnit.assertNotEquals ("No package tuxguitar installed; cannot remove", + 0, pkg.length); packagekit.removePackage (pkg[0].id); pkg = packagekit.searchPackage ('tuxguitar'); var removed = pkg[0].data.indexOf ('installed'); - assert.equal (removed, -1, "Failed to remove tuxguitar package, data property is: '" + pkg[0].data + "'"); -}; - -testSearchPackage(); -testNotInstalledAtStart(); // needed? -testInstallPackage(); -testRemovePackage(); + jqUnit.assertEquals ( + "Failed to remove tuxguitar package, data property is: '" + + pkg[0].data + "'", + -1, removed); +}); From f04181381f50be98c92a28d95ee59ac76a9fa08f Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 22 Oct 2013 13:48:54 -0400 Subject: [PATCH 133/319] Added ability to use package kit filters with the searchPackage() function. See: http://www.packagekit.org/gtk-doc/introduction-ideas-filters.html --- .../nodepackagekit/nodepackagekit.cc | 26 ++++++-- .../nodepackagekit/nodepackagekit_test.js | 63 +++++++++++++------ 2 files changed, 65 insertions(+), 24 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index c4a36bc..c452e89 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -12,6 +12,7 @@ You may obtain a copy of the License at */ #define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE 1 +#include #include #include #include @@ -52,7 +53,10 @@ progressCallback(PkProgress *progress, PkProgressType type) { * searchPackage: * * Should take as arguments: - * name: Name of the package, aka: search criteria (str) + * name: Name of the package, aka: search criteria (str) + * filters: Filters for the search as a string, e.g. "~devel;basename". See: + * http://www.packagekit.org/gtk-doc/introduction-ideas-filters.html + * Special case: the "none" filter = installed or available. * Returns: Array of packages matching the search criteria */ Handle searchPackage(const Arguments& args) { @@ -62,15 +66,25 @@ Handle searchPackage(const Arguments& args) { GPtrArray *array; PkPackageSack *sack = NULL; char name[1024]; - args[0]->ToString()->WriteAscii(name); - gchar *names[] = {name}; + char filters[256]; + PkBitfield filtersBitField; GError *err = NULL; v8::Handle result = v8::Array::New(); + args[0]->ToString()->WriteAscii(name); + gchar *names[] = {name}; + if (args.Length() > 1) { + args[1]->ToString()->WriteAscii(filters); + } + else { + strcpy(filters, "none"); + } + filtersBitField = pk_filter_bitfield_from_string (filters); + client = pk_client_new(); - results = pk_client_search_names(client, PK_INFO_ENUM_INSTALLED | - PK_INFO_ENUM_AVAILABLE, names, NULL, - (PkProgressCallback) progressCallback, NULL, &err); + results = pk_client_search_names (client, filtersBitField, + names, NULL, + (PkProgressCallback) progressCallback, NULL, &err); sack = pk_results_get_package_sack(results); pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 2043c91..70f1181 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -18,8 +18,21 @@ var fluid = require ('universal'), jqUnit.module ('PackageKit Bridge node add-on module'); jqUnit.test ("Testing PackageKit Bridge", function() { - console.log ("Testing searchPackage() for 'tuxguitar'"); + + // *** searchPackage() tests *** + + console.log ("Testing searchPackage() for 'tuxguitar' with implicit 'none' " + + "filter, meaning installed or available"); var pkg = packagekit.searchPackage ('tuxguitar'); + jqUnit.assertNotEquals ("No package for tuxguitar was found during search", + 0, pkg.length); + var name = pkg[0].id.indexOf ('tuxguitar'); + jqUnit.assertNotEquals ("No tuxguitar package found, found " + + pkg[0].id + " instead", + -1, name); + + console.log ("Testing searchPackage() for 'tuxguitar' with explicit 'none' filter"); + var pkg = packagekit.searchPackage ('tuxguitar', 'none'); jqUnit.assertNotEquals ("No package for tuxguitar was found during search", 0, pkg.length); var name = pkg[0].id.indexOf ("tuxguitar"); @@ -38,29 +51,43 @@ jqUnit.test ("Testing PackageKit Bridge", function() { jqUnit.assertEquals ("Package tuxguitar is installed, data property is: '" + pkg[0].data + "'", -1, notInstalled); + + // Use "~installed" filter to check that tuxguitar is not installed. Then + // use the "installed" filter. In the former case, the size of the + // returned array of package ids should be one, and, in the latter, should + // be zero. + pkg = packagekit.searchPackage ('tuxguitar', '~installed'); + jqUnit.assertEquals ("Package tuxguitar is installed, " + + "size of package id list is not one: '" + + pkg.length, + 1, pkg.length); + + pkg = packagekit.searchPackage ('tuxguitar', 'installed'); + jqUnit.assertEquals ("Package tuxguitar is not installed, " + + "size of package id list is not zero: '" + + pkg.length, + 0, pkg.length); + + // *** installPackage() tests *** console.log ("Testing installPackage()"); - pkg = packagekit.searchPackage ('tuxguitar'); - jqUnit.assertNotEquals ("No package tuxguitar available; cannot install", - 0, pkg.length); + pkg = packagekit.searchPackage ('tuxguitar', '~installed'); + jqUnit.assertEquals ("No package tuxguitar available; cannot install", + 1, pkg.length); packagekit.installPackage (pkg[0].id); - pkg = packagekit.searchPackage ('tuxguitar'); - var installed = pkg[0].data.indexOf ('installed'); - jqUnit.assertNotEquals ("Failure installing tuxguitar, data property is: '" - + pkg[0].data + "'", - -1, installed); + pkg = packagekit.searchPackage ('tuxguitar', 'installed'); + jqUnit.assertEquals ("Failure installing package tuxguitar, ", + 1, pkg.length); + + // *** removePackage() tests *** console.log ("Testing removePackage()"); - pkg = packagekit.searchPackage ('tuxguitar'); - jqUnit.assertNotEquals ("No package tuxguitar installed; cannot remove", - 0, pkg.length); + pkg = packagekit.searchPackage ('tuxguitar', 'installed'); + jqUnit.assertEquals ("No package tuxguitar installed; cannot remove", + 1, pkg.length); packagekit.removePackage (pkg[0].id); - pkg = packagekit.searchPackage ('tuxguitar'); - var removed = pkg[0].data.indexOf ('installed'); - jqUnit.assertEquals ( - "Failed to remove tuxguitar package, data property is: '" + - pkg[0].data + "'", - -1, removed); + pkg = packagekit.searchPackage ('tuxguitar', '~installed'); + jqUnit.assertEquals ("Failed to remove tuxguitar package", 1, pkg.length); }); From 014584f9f1ad7a017a3dd574fa627ebc8edf19d9 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 12 Nov 2013 16:38:07 -0500 Subject: [PATCH 134/319] Demo of using linus 'find' command with the node packagekit add-on. --- .../packagekit/nodepackagekit/findSearchPk.js | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 node_modules/packagekit/nodepackagekit/findSearchPk.js diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js new file mode 100644 index 0000000..fac3185 --- /dev/null +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -0,0 +1,141 @@ +/*! +GPII Node.js find + serach packages + +Copyright 2013 Inclusive Design Research Centre, OCAD University + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt + +Author: Joseph Scheuhammer. +*/ + +/* +Command line: node findSearchPk.js . +For example: node findSearchPk.js orca + +This takes a two step approach to determine whether the named software is +available on the system. The first step involves using the linux 'find' +command to search for the given software. The second step uses PackageKit's +search facility. + +The find command is used to search the directories listed in the PATH +environment variable. There are two outcomes: + +1. The software is not found. This is taken to mean that the software is not +installed on the system. + +2. The software is found in one of the PATH directories. This is taken to mean +that the software is installed. + +In summary, the first step uses the find command to determine if the software +is installed. + +For the first outcome, the process continues and uses PackageKit's search +facility. In this case, a filter is used that indicates to search for +not-installed packages. The result will either report the repository from +which the software can be installed and its version number; or, that no +repository contains the software. + +In the second case, PackageKit's search facility is used at least once, and +possibly twice. On the first pass, a filter is used that indicates to search +for installed packages. If, on this first pass, the search returns an object +showing what is installed, then no further action is taken. However, if it +returns nothing, then search is done a second time using an not-installed +filter. That may return what is available to install. + +The end result is: +1. Package information as to what is installed on the system. +2. Package information as to what is availalbe to be installed. +3. No package information. + +Issues: +- when the find command finds the software, but PackageKit knows nothing about +it, it is impossible (?) to determine the version of the software. + +- while many linux commands support a "--version" option*, the output is not +consistent: +-- the format of the version string is not standardized. +-- some commands write the version string to stdout; some to stderr. +-- some GUI applications require GTK (or some other toolkit) in order to launch. + +*note: the "--version" option is supposed to launch a bare-bones variant of the +command, report the version, and quit. + +The end result is an (array of) objects each containning a package id, a version +number, whether the package is installed, and the associated repository. This +demo simply prints the version of the first package found. + +*/ + +var packagekit = require('./build/Release/nodepackagekit.node'); + +var lookingFor = process.argv[2]; +if (lookingFor !== undefined) { + var findArgs = process.env.PATH.split (':'); + findArgs.push (process.env.HOME); + findArgs.push ('-name'); + findArgs.push (lookingFor); + findArgs.push ('-print'); + + // Record the files found by 'find'. + var whatFound = []; + var packages = []; + function onStdout (data) { + var found = data.toString().split ('\n'); + found.forEach (function (value, index, array) { + if (value.length > 0) + whatFound.push (value); + }); + } + + // Handle 'find' on close event -- invoke packagekit.searchPackage(). + function onClose (code) { + console.log ("'find' found " + whatFound); + + if (whatFound.length == 0) + searchNotInstalled(); + else { + searchInstalled(); + if (packages.length == 0) + searchNotInstalled(); + } + if (packages.length > 0) { + console.log ("Version of '" + lookingFor + "' found: " + + packages[0].version); + } + else { + console.log ("No package found"); + } + } + + // Use package kit add-on to get version of the software. + // - searchNotInstalled() is used when 'find' found nothing. + // - searchInstalled() is used when 'find' found something. + function searchNotInstalled() { + packages = packagekit.searchPackage (lookingFor, '~installed;basename'); + } + + function searchInstalled() { + packages = packagekit.searchPackage (lookingFor, 'installed;basename'); + } + + // Run 'find' + var spawn = require ('child_process').spawn, + find = spawn ('find', findArgs); + + find.stdout.on ('data', onStdout); + +// find.stderr.on ('data', function (data) { +// console.log('stderr: ' + data); +// }); + + find.on ('close', onClose); + + find.on ('error', function (err) { + console.log ('child process : ' + err); + }); +} + From aa716f570c531b182e26161588a32392396c5740 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Mon, 18 Nov 2013 14:56:51 -0500 Subject: [PATCH 135/319] Added capability to update packages using the packagekit node add-on -- added method updatePackage(). Updated unit tests as appropriate. --- .../nodepackagekit/nodepackagekit.cc | 31 ++++++++++++++++++- .../nodepackagekit/nodepackagekit_test.js | 27 ++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index c452e89..ac947c5 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -115,7 +115,7 @@ Handle searchPackage(const Arguments& args) { * installPackage: * * Should take as arguments: - * name: Name of the package (str) + * name: The package id (str). * Returns: true | false (bool) */ Handle installPackage(const Arguments& args) { @@ -139,6 +139,33 @@ Handle installPackage(const Arguments& args) { return scope.Close(True()); } +/** + * updatePackage: + * + * Should take as arguments: + * name: The package id (str). + * Returns: true | false (bool) + */ +Handle updatePackage(const Arguments& args) { + HandleScope scope; + PkTask *task; + GError *err = NULL; + char name[1024]; + args[0]->ToString()->WriteUtf8(name); + gchar **package_ids = NULL; + + task = pk_task_new(); + package_ids = pk_package_ids_from_id (name); + + pk_task_update_packages_sync (task, package_ids, NULL, + (PkProgressCallback) progressCallback, + NULL, &err); + + g_strfreev (package_ids); + + return scope.Close(True()); +} + /** * removePackage: * @@ -172,6 +199,8 @@ void init(Handle target) { FunctionTemplate::New(searchPackage)->GetFunction()); target->Set(String::NewSymbol("installPackage"), FunctionTemplate::New(installPackage)->GetFunction()); + target->Set(String::NewSymbol("updatePackage"), + FunctionTemplate::New(installPackage)->GetFunction()); target->Set(String::NewSymbol("removePackage"), FunctionTemplate::New(removePackage)->GetFunction()); } diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 70f1181..8d12c29 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -90,4 +90,31 @@ jqUnit.test ("Testing PackageKit Bridge", function() { packagekit.removePackage (pkg[0].id); pkg = packagekit.searchPackage ('tuxguitar', '~installed'); jqUnit.assertEquals ("Failed to remove tuxguitar package", 1, pkg.length); + + // *** updatePackage() tests *** + + console.log ("Testing updatePackage()"); + + // The package ids of an old and newer version of 'vorbis-tools'. + // TODO: JS: While the following check against two version of + // 'vorbis-tools' works on Fedora-19, it may not work on all distros; hence, + // the check that searchPackage() finds the two verions. If so, the test is + // run; otherwise no test is run. Need to find a better package with + // multiple versions that can be used for the test. + var oldVorbis = '1:1.4.0-8.fc19'; + var newVorbis = '1:1.4.0-10.fc19'; + pkg = packagekit.searchPackage ('vorbis-tools'); + if (pkg.length == 2) { + if (pkg[0].version == oldVorbis && pkg[1].version == newVorbis && + pkg[1].data.indexOf('updates') != -1) { + + packagekit.updatePackage (pkg[1].id); + var currentPkgs = packagekit.searchPackage ('vorbis-tools', 'installed'); + jqUnit.assertEquals ("Failed to update to " + newVorbis, + currentPkgs[0].version, newVorbis); + + // Restore to previous. + packagekit.removePackage(currentPkgs[0].id); + } + } }); From 4a41817f1709bd80ab19b9460cbe9e6f90690b3d Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Mon, 18 Nov 2013 15:13:22 -0500 Subject: [PATCH 136/319] Added 'type' option to find command to search only for regular files, and, generally, improved the output to make it more apparent what was found. Removed commented out code (stderr output). --- .../packagekit/nodepackagekit/findSearchPk.js | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js index fac3185..c7df28b 100644 --- a/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -70,20 +70,20 @@ demo simply prints the version of the first package found. */ -var packagekit = require('./build/Release/nodepackagekit.node'); +var packagekit = require ('./build/Release/nodepackagekit.node'); var lookingFor = process.argv[2]; if (lookingFor !== undefined) { var findArgs = process.env.PATH.split (':'); findArgs.push (process.env.HOME); - findArgs.push ('-name'); - findArgs.push (lookingFor); + findArgs.push ('-name'); findArgs.push (lookingFor); + findArgs.push ('-type'); findArgs.push ('f'); // only regular files. findArgs.push ('-print'); // Record the files found by 'find'. var whatFound = []; var packages = []; - function onStdout (data) { + function onFindStdout (data) { var found = data.toString().split ('\n'); found.forEach (function (value, index, array) { if (value.length > 0) @@ -92,8 +92,9 @@ if (lookingFor !== undefined) { } // Handle 'find' on close event -- invoke packagekit.searchPackage(). - function onClose (code) { - console.log ("'find' found " + whatFound); + function onFindClose (code) { + console.log ("'find' found " + + ( whatFound.length == 0 ? "nothing" : whatFound )); if (whatFound.length == 0) searchNotInstalled(); @@ -103,8 +104,10 @@ if (lookingFor !== undefined) { searchNotInstalled(); } if (packages.length > 0) { - console.log ("Version of '" + lookingFor + "' found: " + - packages[0].version); + console.log ("Packages:") + console.log ("["); + packages.forEach (printPackage); + console.log ("]"); } else { console.log ("No package found"); @@ -126,16 +129,23 @@ if (lookingFor !== undefined) { var spawn = require ('child_process').spawn, find = spawn ('find', findArgs); - find.stdout.on ('data', onStdout); + find.stdout.on ('data', onFindStdout); -// find.stderr.on ('data', function (data) { -// console.log('stderr: ' + data); -// }); - - find.on ('close', onClose); + find.on ('close', onFindClose); find.on ('error', function (err) { console.log ('child process : ' + err); }); -} + function printPackage (value, index, array) { + var pkg = array[index]; + var closeBrace = " }"; + if (index == array.length-1) + closeBrace += ","; + console.log (" { id: " + pkg.id); + console.log (" name: " + pkg.name); + console.log (" version: " + pkg.version); + console.log (" data: " + pkg.data); + console.log (closeBrace); + } +} From a00b92d6be251cdf9b47cfb818a36cb0702f9cfc Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 10 Dec 2013 10:17:49 -0500 Subject: [PATCH 137/319] Added searchFiles() that, given a path(s) to a file, calls packagekit's "search files" function that returns package package information on the path(s). Also added utility handleFiltersArgumen() that is shared by searchFiles() and searchPackage(). --- .../nodepackagekit/nodepackagekit.cc | 79 +++++++++++++++++-- .../nodepackagekit/nodepackagekit_test.js | 20 +++++ 2 files changed, 91 insertions(+), 8 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index ac947c5..08a6176 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -49,6 +49,19 @@ progressCallback(PkProgress *progress, PkProgressType type) { } } +static PkBitfield +handleFiltersArgument (const Arguments& args) { + char filters[256]; + + if (args.Length() > 1) { + args[1]->ToString()->WriteAscii (filters); + } + else { + strcpy (filters, "none"); + } + return pk_filter_bitfield_from_string (filters); +} + /** * searchPackage: * @@ -66,20 +79,13 @@ Handle searchPackage(const Arguments& args) { GPtrArray *array; PkPackageSack *sack = NULL; char name[1024]; - char filters[256]; PkBitfield filtersBitField; GError *err = NULL; v8::Handle result = v8::Array::New(); args[0]->ToString()->WriteAscii(name); gchar *names[] = {name}; - if (args.Length() > 1) { - args[1]->ToString()->WriteAscii(filters); - } - else { - strcpy(filters, "none"); - } - filtersBitField = pk_filter_bitfield_from_string (filters); + filtersBitField = handleFiltersArgument (args); client = pk_client_new(); results = pk_client_search_names (client, filtersBitField, @@ -111,6 +117,61 @@ Handle searchPackage(const Arguments& args) { return scope.Close(result); } +/** + * searchFiles: + * + * Should take as arguments: + * name: Path name associated with package, e.g., "/usr/bin/orca". + * filters: Filters for the search as a string, e.g. "~devel;basename". See: + * http://www.packagekit.org/gtk-doc/introduction-ideas-filters.html + * Special case: the "none" filter = installed or available. + * Returns: Array of packages matching the search criteria. + */ +Handle searchFiles (const Arguments& args) { + HandleScope scope; + PkClient *client = NULL; + PkResults *results = NULL; + GPtrArray *array; + PkPackageSack *sack = NULL; + char pathName[1024]; + PkBitfield filtersBitField; + GError *err = NULL; + v8::Handle result = v8::Array::New(); + + args[0]->ToString()->WriteAscii(pathName); + gchar *pathNames[] = {pathName}; + filtersBitField = handleFiltersArgument (args); + + client = pk_client_new(); + results = pk_client_search_files (client, filtersBitField, + pathNames, NULL, + (PkProgressCallback) progressCallback, NULL, &err); + + sack = pk_results_get_package_sack(results); + pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); + array = pk_package_sack_get_array(sack); + + for (unsigned int i=0; ilen; i++) { + PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); + + v8::Handle pac = v8::Object::New(); + pac->Set(String::New("id"), String::New(pk_package_get_id(package))); + pac->Set(String::New("name"), String::New(pk_package_get_name(package))); + pac->Set(String::New("version"), + String::New(pk_package_get_version(package))); + pac->Set(String::New("data"), String::New(pk_package_get_data(package))); + + result->Set(i,pac); + } + + if (results != NULL) + g_object_unref (results); + if (sack != NULL) + g_object_unref (sack); + + return scope.Close(result); +} + /** * installPackage: * @@ -197,6 +258,8 @@ void init(Handle target) { g_type_init(); // Initialize gobject system target->Set(String::NewSymbol("searchPackage"), FunctionTemplate::New(searchPackage)->GetFunction()); + target->Set(String::NewSymbol("searchFiles"), + FunctionTemplate::New(searchFiles)->GetFunction()); target->Set(String::NewSymbol("installPackage"), FunctionTemplate::New(installPackage)->GetFunction()); target->Set(String::NewSymbol("updatePackage"), diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 8d12c29..54faaf0 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -68,6 +68,26 @@ jqUnit.test ("Testing PackageKit Bridge", function() { pkg.length, 0, pkg.length); + // *** searchFiles() test *** + + console.log ("Testing searchFiles() for '/usr/bin/tuxguitar'"); + + // The searchFiles() function expects the full path name where the package + // would be installed, even it if is not installed. The presumed use of + // searchFiles() is after a prior "find" shell command that has found the + // file on the system and returns the path where it was found. Even so, + // "find" does not return the version number. Pass the path to + // searchFiles() in order to get the full package information, including the + // version number. If "find" did *not* return anything (an empty path), + // then use the searchPackage() function instead. + var pkg = packagekit.searchFiles ('/usr/bin/tuxguitar'); + jqUnit.assertNotEquals ("No package for tuxguitar was found during search", + 0, pkg.length); + var name = pkg[0].id.indexOf ('tuxguitar'); + jqUnit.assertNotEquals ("No tuxguitar package found, found " + + pkg[0].id + " instead", + -1, name); + // *** installPackage() tests *** console.log ("Testing installPackage()"); From 673346d529aecd7a8ef6a38bbdbf66b2f1800b70 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 10 Dec 2013 11:51:54 -0500 Subject: [PATCH 138/319] Modified the find + search-package-kit demo (aka findSearchPk.js) to make use of the new searchFiles() function of the packagekit add-on. --- .../packagekit/nodepackagekit/findSearchPk.js | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js index c7df28b..b8f8f0a 100644 --- a/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -33,40 +33,45 @@ that the software is installed. In summary, the first step uses the find command to determine if the software is installed. -For the first outcome, the process continues and uses PackageKit's search -facility. In this case, a filter is used that indicates to search for +For the first outcome, the process continues and uses the packagekit node +add-on's searchPackage(), with a filter that indicates to search for not-installed packages. The result will either report the repository from -which the software can be installed and its version number; or, that no -repository contains the software. - -In the second case, PackageKit's search facility is used at least once, and -possibly twice. On the first pass, a filter is used that indicates to search -for installed packages. If, on this first pass, the search returns an object -showing what is installed, then no further action is taken. However, if it -returns nothing, then search is done a second time using an not-installed -filter. That may return what is available to install. +which the software can be installed, or, that no repository contains the +software. If found in a repository, the package id, version number, etc. is +returned. + +In the second case, the add-on's searchFiles() function is used with the given +path, and fetches the information about the package for that path. If that +fails to discover anything, the add-on's searchPackage() is used at least once, +and possibly twice. The first attempt employs a filter that indicates to search +for installed packages. If this search returns information about a package, +then no further action is taken. But, if it returns nothing, then +searchPackage() is done a second time using an not-installed filter. That may +return what is available to install. The end result is: 1. Package information as to what is installed on the system. -2. Package information as to what is availalbe to be installed. -3. No package information. +2. Package information as to what is avaialable to be installed. +3. A combination of 1. and 2. if there is the package is installed, and there is +an update available for installation. +4. No package information. Issues: - when the find command finds the software, but PackageKit knows nothing about -it, it is impossible (?) to determine the version of the software. - +it, it is impossible (?) to determine the version of the software: - while many linux commands support a "--version" option*, the output is not consistent: -- the format of the version string is not standardized. -- some commands write the version string to stdout; some to stderr. -- some GUI applications require GTK (or some other toolkit) in order to launch. -*note: the "--version" option is supposed to launch a bare-bones variant of the -command, report the version, and quit. +*note: the "--version" option is supposed to launch a a minimal convfiguration +of the software, report the version, and quit. -The end result is an (array of) objects each containning a package id, a version -number, whether the package is installed, and the associated repository. This -demo simply prints the version of the first package found. +The end result of this script is an (array of) objects each containning a +package id, a version number, whether the package is installed, and the +associated repository. This demo prints the package information of all +packages found. */ @@ -122,7 +127,10 @@ if (lookingFor !== undefined) { } function searchInstalled() { - packages = packagekit.searchPackage (lookingFor, 'installed;basename'); + packages = packagekit.searchFiles (lookingFor); + if (packages.length == 0) { + packages = packagekit.searchPackage (lookingFor, 'installed;basename'); + } } // Run 'find' From 4e42551137cebe403f30777ab92d701b520a7cae Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Thu, 12 Dec 2013 15:30:09 -0500 Subject: [PATCH 139/319] Fixed bug in call to searchFiles(). It now bases the search on what the "find" command returned, not on the input to the find command. Also, improved the name of the array containing the paths found by the find command. --- node_modules/packagekit/nodepackagekit/findSearchPk.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js index b8f8f0a..ce1ccb3 100644 --- a/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -86,22 +86,22 @@ if (lookingFor !== undefined) { findArgs.push ('-print'); // Record the files found by 'find'. - var whatFound = []; + var whatFindFound = []; var packages = []; function onFindStdout (data) { var found = data.toString().split ('\n'); found.forEach (function (value, index, array) { if (value.length > 0) - whatFound.push (value); + whatFindFound.push (value); }); } // Handle 'find' on close event -- invoke packagekit.searchPackage(). function onFindClose (code) { console.log ("'find' found " + - ( whatFound.length == 0 ? "nothing" : whatFound )); + ( whatFindFound.length == 0 ? "nothing" : whatFindFound )); - if (whatFound.length == 0) + if (whatFindFound.length == 0) searchNotInstalled(); else { searchInstalled(); @@ -127,7 +127,7 @@ if (lookingFor !== undefined) { } function searchInstalled() { - packages = packagekit.searchFiles (lookingFor); + packages = packagekit.searchFiles (whatFindFound); if (packages.length == 0) { packages = packagekit.searchPackage (lookingFor, 'installed;basename'); } From 1120b4eb2264db5790ace204060f368404df78b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 17 Mar 2014 20:09:19 +0100 Subject: [PATCH 140/319] Cleaning up code --- .../packagekit/nodepackagekit/findSearchPk.js | 18 +++++++++--------- .../nodepackagekit/nodepackagekit.cc | 7 +++---- .../nodepackagekit/nodepackagekit_test.js | 5 +++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js index ce1ccb3..b17835d 100644 --- a/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -45,7 +45,7 @@ path, and fetches the information about the package for that path. If that fails to discover anything, the add-on's searchPackage() is used at least once, and possibly twice. The first attempt employs a filter that indicates to search for installed packages. If this search returns information about a package, -then no further action is taken. But, if it returns nothing, then +then no further action is taken. But, if it returns nothing, then searchPackage() is done a second time using an not-installed filter. That may return what is available to install. @@ -76,14 +76,14 @@ packages found. */ var packagekit = require ('./build/Release/nodepackagekit.node'); - + var lookingFor = process.argv[2]; if (lookingFor !== undefined) { var findArgs = process.env.PATH.split (':'); findArgs.push (process.env.HOME); findArgs.push ('-name'); findArgs.push (lookingFor); findArgs.push ('-type'); findArgs.push ('f'); // only regular files. - findArgs.push ('-print'); + findArgs.push ('-print'); // Record the files found by 'find'. var whatFindFound = []; @@ -95,12 +95,12 @@ if (lookingFor !== undefined) { whatFindFound.push (value); }); } - + // Handle 'find' on close event -- invoke packagekit.searchPackage(). function onFindClose (code) { console.log ("'find' found " + ( whatFindFound.length == 0 ? "nothing" : whatFindFound )); - + if (whatFindFound.length == 0) searchNotInstalled(); else { @@ -118,14 +118,14 @@ if (lookingFor !== undefined) { console.log ("No package found"); } } - + // Use package kit add-on to get version of the software. // - searchNotInstalled() is used when 'find' found nothing. // - searchInstalled() is used when 'find' found something. function searchNotInstalled() { packages = packagekit.searchPackage (lookingFor, '~installed;basename'); } - + function searchInstalled() { packages = packagekit.searchFiles (whatFindFound); if (packages.length == 0) { @@ -133,10 +133,10 @@ if (lookingFor !== undefined) { } } - // Run 'find' + // Run 'find' var spawn = require ('child_process').spawn, find = spawn ('find', findArgs); - + find.stdout.on ('data', onFindStdout); find.on ('close', onFindClose); diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 08a6176..68e096b 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -44,7 +44,7 @@ progressCallback(PkProgress *progress, PkProgressType type) { if (type == PK_PROGRESS_TYPE_STATUS) { printf ("%s Transaction status: %s\n", TAG, pk_status_enum_to_string (status)); } else if (type == PK_PROGRESS_TYPE_PERCENTAGE) { - if (percentage > 0) + if (percentage > 0) printf ("%s Current percentage: %d%%\n", TAG, percentage); } } @@ -195,8 +195,7 @@ Handle installPackage(const Arguments& args) { NULL, &err); g_strfreev (package_ids); - - + return scope.Close(True()); } @@ -250,7 +249,7 @@ Handle removePackage(const Arguments& args) { NULL, &err); g_strfreev (package_ids); - + return scope.Close(True()); } diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 54faaf0..a316317 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -3,6 +3,7 @@ GPII Node.js PackageKit Bridge Copyright 2012 Steven Githens Copyright 2013 Inclusive Design Research Centre, OCAD University +Copyright 2013, 2014 Emergya Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -51,7 +52,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { jqUnit.assertEquals ("Package tuxguitar is installed, data property is: '" + pkg[0].data + "'", -1, notInstalled); - + // Use "~installed" filter to check that tuxguitar is not installed. Then // use the "installed" filter. In the former case, the size of the // returned array of package ids should be one, and, in the latter, should @@ -61,7 +62,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { "size of package id list is not one: '" + pkg.length, 1, pkg.length); - + pkg = packagekit.searchPackage ('tuxguitar', 'installed'); jqUnit.assertEquals ("Package tuxguitar is not installed, " + "size of package id list is not zero: '" + From 3678757696d82b109c28d5a480637a4f7ecd904d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 18 Mar 2014 20:53:45 +0100 Subject: [PATCH 141/319] Allocating sizeof(name) when declaring names This change fixes a segfault in openSUSE, which is not reproducible in Fedora. --- node_modules/packagekit/nodepackagekit/nodepackagekit.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 68e096b..cb78bde 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -84,7 +84,8 @@ Handle searchPackage(const Arguments& args) { v8::Handle result = v8::Array::New(); args[0]->ToString()->WriteAscii(name); - gchar *names[] = {name}; + gchar *names[sizeof(name)] = {name}; + filtersBitField = handleFiltersArgument (args); client = pk_client_new(); @@ -139,7 +140,7 @@ Handle searchFiles (const Arguments& args) { v8::Handle result = v8::Array::New(); args[0]->ToString()->WriteAscii(pathName); - gchar *pathNames[] = {pathName}; + gchar *pathNames[sizeof(pathName)] = {pathName}; filtersBitField = handleFiltersArgument (args); client = pk_client_new(); From f7c52f0a78d3b088127596558e3d660bdb4c0978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 18 Mar 2014 20:59:22 +0100 Subject: [PATCH 142/319] Collect arguments as utf8 strings --- node_modules/packagekit/nodepackagekit/nodepackagekit.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index cb78bde..1441c1b 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -54,7 +54,7 @@ handleFiltersArgument (const Arguments& args) { char filters[256]; if (args.Length() > 1) { - args[1]->ToString()->WriteAscii (filters); + args[1]->ToString()->WriteUtf8 (filters); } else { strcpy (filters, "none"); @@ -83,7 +83,7 @@ Handle searchPackage(const Arguments& args) { GError *err = NULL; v8::Handle result = v8::Array::New(); - args[0]->ToString()->WriteAscii(name); + args[0]->ToString()->WriteUtf8(name); gchar *names[sizeof(name)] = {name}; filtersBitField = handleFiltersArgument (args); @@ -139,7 +139,7 @@ Handle searchFiles (const Arguments& args) { GError *err = NULL; v8::Handle result = v8::Array::New(); - args[0]->ToString()->WriteAscii(pathName); + args[0]->ToString()->WriteUtf8(pathName); gchar *pathNames[sizeof(pathName)] = {pathName}; filtersBitField = handleFiltersArgument (args); From 852645ea8e254c317daf8938f3ad3e1db9905b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 18 Mar 2014 21:01:08 +0100 Subject: [PATCH 143/319] Removing g_type_init since it is being deprecated --- node_modules/packagekit/nodepackagekit/nodepackagekit.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 1441c1b..5963b85 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -255,7 +255,6 @@ Handle removePackage(const Arguments& args) { } void init(Handle target) { - g_type_init(); // Initialize gobject system target->Set(String::NewSymbol("searchPackage"), FunctionTemplate::New(searchPackage)->GetFunction()); target->Set(String::NewSymbol("searchFiles"), From cc2c59d1132286f38d90ba8a00da05c3416cfd2e Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 19 Mar 2014 13:36:22 -0400 Subject: [PATCH 144/319] Added getPackages() function to nodepackagekit add-on. The getPackages() function takes a filter as input and returns a list of packages that match that filter. For example, the filter '~installed', results in a list of all the packages not installed but available. - added getPackages() to nodepackagekit.cc. - modified internal handleFiltersArgument() to take an index arg. - added unit test for getPackages(). - modified the updatePackage() unit test. - generally cleaned up unit tests. --- .../nodepackagekit/nodepackagekit.cc | 67 ++++++++- .../nodepackagekit/nodepackagekit_test.js | 137 +++++++++++------- 2 files changed, 145 insertions(+), 59 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 5963b85..0c8c01e 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -3,6 +3,7 @@ GPII Node.js PackageKit Bridge Copyright 2012 Steven Githens Copyright 2013 Emergya +Copyright 2013, 2014 Inclusive Design Research Centre, OCAD University Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -50,11 +51,11 @@ progressCallback(PkProgress *progress, PkProgressType type) { } static PkBitfield -handleFiltersArgument (const Arguments& args) { +handleFiltersArgument (const Arguments& args, const int filterIndex) { char filters[256]; - if (args.Length() > 1) { - args[1]->ToString()->WriteUtf8 (filters); + if (args.Length() > filterIndex) { + args[filterIndex]->ToString()->WriteUtf8 (filters); } else { strcpy (filters, "none"); @@ -86,7 +87,7 @@ Handle searchPackage(const Arguments& args) { args[0]->ToString()->WriteUtf8(name); gchar *names[sizeof(name)] = {name}; - filtersBitField = handleFiltersArgument (args); + filtersBitField = handleFiltersArgument (args, 1); client = pk_client_new(); results = pk_client_search_names (client, filtersBitField, @@ -141,7 +142,7 @@ Handle searchFiles (const Arguments& args) { args[0]->ToString()->WriteUtf8(pathName); gchar *pathNames[sizeof(pathName)] = {pathName}; - filtersBitField = handleFiltersArgument (args); + filtersBitField = handleFiltersArgument (args, 1); client = pk_client_new(); results = pk_client_search_files (client, filtersBitField, @@ -173,6 +174,60 @@ Handle searchFiles (const Arguments& args) { return scope.Close(result); } +/** + * getPackages: + * + * Should take as arguments: + * filters: Filters for list of packages to return, e.g. "installed" or + * "~installed", or "~devel;basename". + * See: + * http://www.packagekit.org/gtk-doc/introduction-ideas-filters.html + * Special case: the "none" filter = installed or available, which + * means every possible package. If no argument is passed, this + * assumes the "none" filter. + * Returns: Array of packages matching the filters. + */ +Handle getPackages(const Arguments& args) { + HandleScope scope; + PkClient *client = NULL; + PkResults *results = NULL; + GPtrArray *array; + PkPackageSack *sack = NULL; + PkBitfield filtersBitField; + GError *err = NULL; + v8::Handle result = v8::Array::New(); + + filtersBitField = handleFiltersArgument (args, 0); + client = pk_client_new(); + results = pk_client_get_packages (client, filtersBitField, + NULL, (PkProgressCallback) progressCallback, + NULL, &err); + + sack = pk_results_get_package_sack(results); + pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); + array = pk_package_sack_get_array(sack); + + for (unsigned int i=0; ilen; i++) { + PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); + + v8::Handle pac = v8::Object::New(); + pac->Set(String::New("id"), String::New(pk_package_get_id(package))); + pac->Set(String::New("name"), String::New(pk_package_get_name(package))); + pac->Set(String::New("version"), + String::New(pk_package_get_version(package))); + pac->Set(String::New("data"), String::New(pk_package_get_data(package))); + + result->Set(i,pac); + } + + if (results != NULL) + g_object_unref (results); + if (sack != NULL) + g_object_unref (sack); + + return scope.Close(result); +} + /** * installPackage: * @@ -259,6 +314,8 @@ void init(Handle target) { FunctionTemplate::New(searchPackage)->GetFunction()); target->Set(String::NewSymbol("searchFiles"), FunctionTemplate::New(searchFiles)->GetFunction()); + target->Set(String::NewSymbol("getPackages"), + FunctionTemplate::New(getPackages)->GetFunction()); target->Set(String::NewSymbol("installPackage"), FunctionTemplate::New(installPackage)->GetFunction()); target->Set(String::NewSymbol("updatePackage"), diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index a316317..4e92981 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -2,7 +2,7 @@ GPII Node.js PackageKit Bridge Copyright 2012 Steven Githens -Copyright 2013 Inclusive Design Research Centre, OCAD University +Copyright 2013, 2014 Inclusive Design Research Centre, OCAD University Copyright 2013, 2014 Emergya Licensed under the New BSD license. You may not use this file except in @@ -24,50 +24,50 @@ jqUnit.test ("Testing PackageKit Bridge", function() { console.log ("Testing searchPackage() for 'tuxguitar' with implicit 'none' " + "filter, meaning installed or available"); - var pkg = packagekit.searchPackage ('tuxguitar'); + var pkgs = packagekit.searchPackage ('tuxguitar'); jqUnit.assertNotEquals ("No package for tuxguitar was found during search", - 0, pkg.length); - var name = pkg[0].id.indexOf ('tuxguitar'); + 0, pkgs.length); + var name = pkgs[0].id.indexOf ('tuxguitar'); jqUnit.assertNotEquals ("No tuxguitar package found, found " + - pkg[0].id + " instead", + pkgs[0].id + " instead", -1, name); console.log ("Testing searchPackage() for 'tuxguitar' with explicit 'none' filter"); - var pkg = packagekit.searchPackage ('tuxguitar', 'none'); + pkgs = packagekit.searchPackage ('tuxguitar', 'none'); jqUnit.assertNotEquals ("No package for tuxguitar was found during search", - 0, pkg.length); - var name = pkg[0].id.indexOf ("tuxguitar"); + 0, pkgs.length); + name = pkgs[0].id.indexOf ("tuxguitar"); jqUnit.assertNotEquals ("No tuxguitar package found, found " + - pkg[0].id + " instead", + pkgs[0].id + " instead", -1, name); console.log ("Checking that tuxguitar package is not installed"); - pkg = packagekit.searchPackage ('tuxguitar'); - jqUnit.assertNotEquals ("No package for tuxguitar found", 0, pkg.length); + pkgs = packagekit.searchPackage ('tuxguitar'); + jqUnit.assertNotEquals ("No package for tuxguitar found", 0, pkgs.length); // TODO: This tests that tuxguitar is not installed, but it's not really // an error if it's there. For now, manually remove tuxguitar // before running tests. - var notInstalled = pkg[0].data.indexOf ('installed'); + var notInstalled = pkgs[0].data.indexOf ('installed'); jqUnit.assertEquals ("Package tuxguitar is installed, data property is: '" + - pkg[0].data + "'", + pkgs[0].data + "'", -1, notInstalled); // Use "~installed" filter to check that tuxguitar is not installed. Then // use the "installed" filter. In the former case, the size of the // returned array of package ids should be one, and, in the latter, should // be zero. - pkg = packagekit.searchPackage ('tuxguitar', '~installed'); + pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); jqUnit.assertEquals ("Package tuxguitar is installed, " + "size of package id list is not one: '" + - pkg.length, - 1, pkg.length); + pkgs.length, + 1, pkgs.length); - pkg = packagekit.searchPackage ('tuxguitar', 'installed'); + pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); jqUnit.assertEquals ("Package tuxguitar is not installed, " + "size of package id list is not zero: '" + - pkg.length, - 0, pkg.length); + pkgs.length, + 0, pkgs.length); // *** searchFiles() test *** @@ -81,61 +81,90 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // searchFiles() in order to get the full package information, including the // version number. If "find" did *not* return anything (an empty path), // then use the searchPackage() function instead. - var pkg = packagekit.searchFiles ('/usr/bin/tuxguitar'); + pkgs = packagekit.searchFiles ('/usr/bin/tuxguitar'); jqUnit.assertNotEquals ("No package for tuxguitar was found during search", - 0, pkg.length); - var name = pkg[0].id.indexOf ('tuxguitar'); + 0, pkgs.length); + name = pkgs[0].id.indexOf ('tuxguitar'); jqUnit.assertNotEquals ("No tuxguitar package found, found " + - pkg[0].id + " instead", + pkgs[0].id + " instead", -1, name); // *** installPackage() tests *** - console.log ("Testing installPackage()"); - pkg = packagekit.searchPackage ('tuxguitar', '~installed'); + console.log ("Testing installPackage() -- installing tuxguitar"); + pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); jqUnit.assertEquals ("No package tuxguitar available; cannot install", - 1, pkg.length); + 1, pkgs.length); - packagekit.installPackage (pkg[0].id); - pkg = packagekit.searchPackage ('tuxguitar', 'installed'); + packagekit.installPackage (pkgs[0].id); + pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); jqUnit.assertEquals ("Failure installing package tuxguitar, ", - 1, pkg.length); + 1, pkgs.length); // *** removePackage() tests *** - console.log ("Testing removePackage()"); - pkg = packagekit.searchPackage ('tuxguitar', 'installed'); + console.log ("Testing removePackage() -- removing tuxguitar"); + pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); jqUnit.assertEquals ("No package tuxguitar installed; cannot remove", - 1, pkg.length); - - packagekit.removePackage (pkg[0].id); - pkg = packagekit.searchPackage ('tuxguitar', '~installed'); - jqUnit.assertEquals ("Failed to remove tuxguitar package", 1, pkg.length); + 1, pkgs.length); + + packagekit.removePackage (pkgs[0].id); + pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); + jqUnit.assertEquals ("Failed to remove tuxguitar package", 1, pkgs.length); + + // *** getPackages() tests *** + + // Assuming 'tuxguitar' was removed (just above), use getPackages() to + // retrieve a list of the 'installed' packages. The tuxguitar package + // should not appear in this list. + console.log ("Testing getPackages() of installed and not-installed packages"); + var tuxguitarPkg = pkgs[0]; + var installedPkgs = packagekit.getPackages ('installed'); + var installedIndex = -1; + for (var i = 0; i < installedPkgs.length; i++) { + if (installedPkgs[i].name == tuxguitarPkg.name) { + installedIndex = i; + break; + } + } + jqUnit.assertEquals ("Found tuxguitar in installed packages", -1, installedIndex); + + // Use getPackages() to retrieve a list of the '~installed' packages. The + // The tuxguitar package should appear in this list. + var availablePkgs = packagekit.getPackages ('~installed'); + var availableIndex = -1; + for (i = 0; i < availablePkgs.length; i++) { + if (availablePkgs[i].name == tuxguitarPkg.name) { + availableIndex = i; + break; + } + } + jqUnit.assertNotEquals ("Did not find tuxguitar in available packages", -1, availableIndex); // *** updatePackage() tests *** - console.log ("Testing updatePackage()"); + console.log ("Testing updatePackage() with 'emacspeak'"); - // The package ids of an old and newer version of 'vorbis-tools'. + // The package ids of an old and newer version of 'emacspeak'. // TODO: JS: While the following check against two version of - // 'vorbis-tools' works on Fedora-19, it may not work on all distros; hence, - // the check that searchPackage() finds the two verions. If so, the test is - // run; otherwise no test is run. Need to find a better package with - // multiple versions that can be used for the test. - var oldVorbis = '1:1.4.0-8.fc19'; - var newVorbis = '1:1.4.0-10.fc19'; - pkg = packagekit.searchPackage ('vorbis-tools'); - if (pkg.length == 2) { - if (pkg[0].version == oldVorbis && pkg[1].version == newVorbis && - pkg[1].data.indexOf('updates') != -1) { - - packagekit.updatePackage (pkg[1].id); - var currentPkgs = packagekit.searchPackage ('vorbis-tools', 'installed'); - jqUnit.assertEquals ("Failed to update to " + newVorbis, - currentPkgs[0].version, newVorbis); + // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, + // the check that searchPackage() finds the two versions. If so, the test is + // run; otherwise no test is run. Need to find a better way to find + // multiple versions of a package to test against. + var oldEmacspeak = '38.0-5.fc20'; + var newEmacspeak = '39.0-1.fc20'; + pkgs = packagekit.searchPackage ('emacspseak'); + if (pkgs.length == 2) { + if (pkgs[0].version == oldEmacspeak && pkg[1].version == newEmacspeak && + pkgs[1].data.indexOf('updates') != -1) { + + packagekit.updatePackage (pkgs[1].id); + var currentPkgs = packagekit.searchPackage ('emacspseak', 'installed'); + jqUnit.assertEquals ("Failed to update to " + newEmacspeak, + currentPkgs[0].version, newEmacspeak); // Restore to previous. - packagekit.removePackage(currentPkgs[0].id); + packagekit.removePackage (currentPkgs[0].id); } } }); From 3c6608ba7e7ae9aceb575644cd8f8eead40d5949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 21 Mar 2014 15:13:30 +0100 Subject: [PATCH 145/319] Adding initial implementation of PackageKit's Device Reporter * Adding required index.js and package.json files * Adding a get method to the Device Reporter implementation; get method returns the following structure: { "provider": "device reporter id" "data": "available data (pkgs)" } --- node_modules/packagekit/index.js | 17 +++++++++ node_modules/packagekit/package.json | 19 ++++++++++ .../packagekit/packageKitDeviceReporter.js | 38 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 node_modules/packagekit/index.js create mode 100644 node_modules/packagekit/package.json create mode 100644 node_modules/packagekit/packageKitDeviceReporter.js diff --git a/node_modules/packagekit/index.js b/node_modules/packagekit/index.js new file mode 100644 index 0000000..bc53e80 --- /dev/null +++ b/node_modules/packagekit/index.js @@ -0,0 +1,17 @@ +/** + * GPII PackageKit Device Reporter + * + * Copyright 2014 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/gpii/universal/LICENSE.txt + */ + +var fluid = require("universal"); + +var loader = fluid.getLoader(__dirname); + +loader.require("./packageKitDeviceReporter.js"); diff --git a/node_modules/packagekit/package.json b/node_modules/packagekit/package.json new file mode 100644 index 0000000..b208318 --- /dev/null +++ b/node_modules/packagekit/package.json @@ -0,0 +1,19 @@ +{ + "name": "packageKitBridge", + "description": "The packageKitBridge is a Node.js add-on of PackageKit.", + "version": "0.1", + "author": "Javier Hernández", + "bugs": "http://wiki.gpii.net/index.php/Main_Page", + "homepage": "http://gpii.net/", + "dependencies": {}, + "licenses": [ + { + "type": "BSD-3-Clause", + "url": "http://www.opensource.org/licenses/BSD-3-Clause" + } + ], + "keywords": ["gpii", "accessibility", "devices", "fluid"], + "repository": "git://github.com:GPII/linux.git", + "main": "./index.js", + "engines": { "node" : ">=0.1.9" } +} diff --git a/node_modules/packagekit/packageKitDeviceReporter.js b/node_modules/packagekit/packageKitDeviceReporter.js new file mode 100644 index 0000000..9e3de91 --- /dev/null +++ b/node_modules/packagekit/packageKitDeviceReporter.js @@ -0,0 +1,38 @@ +/** + * GPII PackageKit Device Reporter + * + * Copyright 2014 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/gpii/universal/LICENSE.txt + */ + +(function () { + "use strict"; + + var GPII_PACKAGE_KIT = "gpii.packageKit"; + + var fluid = require("universal"); + var gpii = fluid.registerNamespace("gpii"); + var packageKit = require("./nodepackagekit/build/Release/nodepackagekit.node"); + + fluid.registerNamespace("gpii.packageKit"); + + fluid.defaults("gpii.packageKit.get", { + gradeNames: "fluid.function", + argumentMap: { + filters: 0 + } + }); + + gpii.packageKit.get = function(filters) { + return { + "provider": GPII_PACKAGE_KIT, + "data": packageKit.getPackages(filters) + }; + }; + +})(); From be8e627ac47153434b739be067f11efc64a2fe8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 21 Mar 2014 15:23:05 +0100 Subject: [PATCH 146/319] Adding a few tests to the PackageKit's Device Reporter --- .../packagekit/test/packageKitTests.js | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 node_modules/packagekit/test/packageKitTests.js diff --git a/node_modules/packagekit/test/packageKitTests.js b/node_modules/packagekit/test/packageKitTests.js new file mode 100644 index 0000000..cbc29d4 --- /dev/null +++ b/node_modules/packagekit/test/packageKitTests.js @@ -0,0 +1,40 @@ +/* + * GPII PackageKit Device Reporter Tests + * + * Copyright 2014 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/gpii/universal/LICENSE.txt + */ + +var fluid = require("universal"), + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("jqUnit"); + +require("packagekit"); +packageKit = fluid.registerNamespace("gpii.packageKit"); + +jqUnit.module("GPII PackageKit Module"); + +jqUnit.test("Running tests for PackageKit Device Reporter", function () { + jqUnit.expect(3); + + // Check that the bridge is loaded and required methods are available + // + methods = ["get"]; + for (var method in methods) { + jqUnit.assertTrue("Checking availability of method '" + method + "'", + (methods[method] in packageKit)); + } + + jqUnit.assertDeepEq("Checking that 'get' report both 'provider' and 'data'", + Object.keys(gpii.packageKit.get("installed")), + Object.keys({"provider": null, "data": null})); + + jqUnit.assertTrue("Checking that 'get' report installed packages", + (gpii.packageKit.get("installed").data.length > 0)); + +}); From 90f3530d7de65905704e1757fe47cea0833db2f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 21 Mar 2014 15:38:55 +0100 Subject: [PATCH 147/319] Cleaning up code from whitespaces --- node_modules/packagekit/packageKitDeviceReporter.js | 8 ++++---- node_modules/packagekit/test/packageKitTests.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/node_modules/packagekit/packageKitDeviceReporter.js b/node_modules/packagekit/packageKitDeviceReporter.js index 9e3de91..1b42bc8 100644 --- a/node_modules/packagekit/packageKitDeviceReporter.js +++ b/node_modules/packagekit/packageKitDeviceReporter.js @@ -1,11 +1,11 @@ /** * GPII PackageKit Device Reporter - * + * * Copyright 2014 Emergya - * + * * Licensed under the New BSD license. You may not use this file except in * compliance with this License. - * + * * You may obtain a copy of the License at * https://github.com/gpii/universal/LICENSE.txt */ @@ -30,7 +30,7 @@ gpii.packageKit.get = function(filters) { return { - "provider": GPII_PACKAGE_KIT, + "provider": GPII_PACKAGE_KIT, "data": packageKit.getPackages(filters) }; }; diff --git a/node_modules/packagekit/test/packageKitTests.js b/node_modules/packagekit/test/packageKitTests.js index cbc29d4..5284456 100644 --- a/node_modules/packagekit/test/packageKitTests.js +++ b/node_modules/packagekit/test/packageKitTests.js @@ -1,4 +1,4 @@ -/* +/** * GPII PackageKit Device Reporter Tests * * Copyright 2014 Emergya From 5c77727220e041b250dce8e33fb2b2de3b862a29 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Tue, 22 Apr 2014 20:19:40 -0400 Subject: [PATCH 148/319] GPII-88 Initial gruntfile and package.json for linux --- Gruntfile.js | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 Gruntfile.js create mode 100644 package.json diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..6a681aa --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,52 @@ +module.exports = function(grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON("package.json"), + shell: { + compileGSettings: { + options: { + stdout: true, + stderr: true, + execOptions: { + cwd: "node_modules/gsettingsBridge/nodegsettings" + } + }, + command: function() { + return "node-gyp configure build"; + } + }, + compileAlsaBridge: { + options: { + stdout: true, + stderr: true, + execOptions: { + cwd: "node_modules/alsa/nodealsa" + } + }, + command: function() { + return "node-gyp configure build"; + } + }, + compileXrandrBridge: { + options: { + stdout: true, + stderr: true, + execOptions: { + cwd: "node_modules/xrandr/nodexrandr" + } + }, + command: function() { + return "node-gyp configure build"; + } + }, + } + }); + + grunt.loadNpmTasks("grunt-gpii"); + + grunt.registerTask('buildall', "Build the entire GPII", function() { + grunt.task.run("gpiiUniversal"); + grunt.task.run("shell:compileGSettings"); + grunt.task.run("shell:compileAlsaBridge"); + grunt.task.run("shell:compileXrandrBridge"); + }); +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..c9d75cf --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "gpii-linux", + "description": "Components of the GPII personalization infrastructure for use on linux", + "version": "0.0.1", + "author": "GPII", + "bugs": "http://wiki.gpii.net/index.php/Main_Page", + "homepage": "http://gpii.net/", + "dependencies": {}, + "devDependencies": { + "grunt": "~0.4.4", + "grunt-shell": "0.6.4", + "grunt-gpii": "git://github.com/sgithens/grunt-gpii.git" + }, + "licenses": [ + { + "type": "BSD-3-Clause", + "url": "http://www.opensource.org/licenses/BSD-3-Clause" + } + ], + "keywords": [ + "gpii", + "accessibility", + "settings", + "fluid", + "IoC", + "Inversion of Control", + "configuration", + "evented" + ], + "repository": "git://github.com/GPII/linux.git", + "main": "./gpii/index.js", + "engines": { + "node": ">=0.1.9" + } +} From 5462c5ab9c5e9b0d4da9f2d9de3d7b09e95aa2b4 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Tue, 22 Apr 2014 21:22:17 -0400 Subject: [PATCH 149/319] GPII-88 Bumping our submodule versions from 0.1 to 0.1.0 because the npm install needed for grunt is choking on those with semver --- node_modules/alsa/package.json | 2 +- node_modules/gsettingsBridge/package.json | 4 ++-- node_modules/linux/package.json | 4 ++-- node_modules/xrandr/package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/node_modules/alsa/package.json b/node_modules/alsa/package.json index 9d401df..b69e524 100644 --- a/node_modules/alsa/package.json +++ b/node_modules/alsa/package.json @@ -1,7 +1,7 @@ { "name": "alsaBridge", "description": "alsaBridge is a Node.js bridge to deal with system volumes.", - "version": "0.1", + "version": "0.1.0", "author": "Javier Hernández", "bugs": "http://wiki.gpii.net/index.php/Main_Page", "homepage": "http://gpii.net/", diff --git a/node_modules/gsettingsBridge/package.json b/node_modules/gsettingsBridge/package.json index f91b663..ffa71b2 100644 --- a/node_modules/gsettingsBridge/package.json +++ b/node_modules/gsettingsBridge/package.json @@ -1,7 +1,7 @@ { "name": "gsettingsBridge", "description": "The GPII gsettingsBridge is a Node.js bridge to GNOME's native GSettings API.", - "version": "0.1", + "version": "0.1.0", "author": "Steve Githens", "bugs": "http://wiki.gpii.net/index.php/Main_Page", "homepage": "http://gpii.net/", @@ -16,4 +16,4 @@ "repository": "git://github.com:GPII/linux.git", "main": "./index.js", "engines": { "node" : ">=0.1.9" } -} \ No newline at end of file +} diff --git a/node_modules/linux/package.json b/node_modules/linux/package.json index 485379f..5cace75 100644 --- a/node_modules/linux/package.json +++ b/node_modules/linux/package.json @@ -1,7 +1,7 @@ { "name": "linux", "description": "Linux specific launch handlers and settings handlers.", - "version": "0.1", + "version": "0.1.0", "author": "GPII", "bugs": "http://wiki.gpii.net/index.php/Main_Page", "homepage": "http://gpii.net/", @@ -16,4 +16,4 @@ "repository": "git://github.com:GPII/linux.git", "main": "./index.js", "engines": { "node" : ">=0.1.9" } -} \ No newline at end of file +} diff --git a/node_modules/xrandr/package.json b/node_modules/xrandr/package.json index 560f704..db36442 100644 --- a/node_modules/xrandr/package.json +++ b/node_modules/xrandr/package.json @@ -1,7 +1,7 @@ { "name": "xrandrBridge", "description": "The xrandrBridge is a Node.js implementation of Xrandr.", - "version": "0.1", + "version": "0.1.0", "author": "Javier Hernández", "bugs": "http://wiki.gpii.net/index.php/Main_Page", "homepage": "http://gpii.net/", From e660dad96ef1a810f291405b7134e6e5a08b5a8d Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Fri, 25 Apr 2014 20:17:49 -0400 Subject: [PATCH 150/319] GPII-88 condensing compile section with a helper function to create the grunt init config for each grunt-shell task --- Gruntfile.js | 54 ++++++++++++++++++---------------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 6a681aa..a4e2663 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,43 +1,25 @@ module.exports = function(grunt) { + function nodeGypCompileShell(dir) { + return { + options: { + stdout: true, + stderr: true, + execOptions: { + cwd: dir + } + }, + command: function() { + return "node-gyp configure build"; + } + } + } + grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), shell: { - compileGSettings: { - options: { - stdout: true, - stderr: true, - execOptions: { - cwd: "node_modules/gsettingsBridge/nodegsettings" - } - }, - command: function() { - return "node-gyp configure build"; - } - }, - compileAlsaBridge: { - options: { - stdout: true, - stderr: true, - execOptions: { - cwd: "node_modules/alsa/nodealsa" - } - }, - command: function() { - return "node-gyp configure build"; - } - }, - compileXrandrBridge: { - options: { - stdout: true, - stderr: true, - execOptions: { - cwd: "node_modules/xrandr/nodexrandr" - } - }, - command: function() { - return "node-gyp configure build"; - } - }, + compileGSettings: nodeGypCompileShell("node_modules/gsettingsBridge/nodegsettings"), + compileAlsaBridge: nodeGypCompileShell("node_modules/alsa/nodealsa"), + compileXrandrBridge: nodeGypCompileShell("node_modules/xrandr/nodexrandr") } }); From 66b3b980b50fae406e24acb08a6f1de598b79750 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Sat, 26 Apr 2014 10:01:04 -0400 Subject: [PATCH 151/319] GPII-88 added clean and start targets for linux. --- Gruntfile.js | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index a4e2663..c6f6365 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,24 +11,61 @@ module.exports = function(grunt) { command: function() { return "node-gyp configure build"; } - } - } + }; + }; + + function nodeGypCleanShell(dir) { + return { + options: { + stdout: true, + stderr: true, + execOptions: { + cwd: dir + } + }, + command: function() { + return "node-gyp clean"; + } + }; + }; grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), shell: { compileGSettings: nodeGypCompileShell("node_modules/gsettingsBridge/nodegsettings"), + cleanGSettings: nodeGypCleanShell("node_modules/gsettingsBridge/nodegsettings"), compileAlsaBridge: nodeGypCompileShell("node_modules/alsa/nodealsa"), - compileXrandrBridge: nodeGypCompileShell("node_modules/xrandr/nodexrandr") + cleanAlsaBridge: nodeGypCleanShell("node_modules/alsa/nodealsa"), + compileXrandrBridge: nodeGypCompileShell("node_modules/xrandr/nodexrandr"), + cleanXrandrBridge: nodeGypCleanShell("node_modules/xrandr/nodexrandr"), + startGpii: { + options: { + stdout: true, + stderr: true + }, + command: function() { + return "node gpii.js"; + } + } } }); grunt.loadNpmTasks("grunt-gpii"); - grunt.registerTask('buildall', "Build the entire GPII", function() { + grunt.registerTask('build', "Build the entire GPII", function() { grunt.task.run("gpiiUniversal"); grunt.task.run("shell:compileGSettings"); grunt.task.run("shell:compileAlsaBridge"); grunt.task.run("shell:compileXrandrBridge"); }); + + grunt.registerTask("clean", "Clean the GPII binaries and uninstall", function() { + grunt.task.run("shell:cleanGSettings"); + grunt.task.run("shell:cleanAlsaBridge"); + grunt.task.run("shell:cleanXrandrBridge"); + }); + + grunt.registerTask("start", "Start the GPII", function() { + grunt.task.run("shell:startGpii"); + }); }; From 3b590d4a4c1520a8f4966a128fe3834748ee746c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 25 Apr 2014 18:24:00 +0200 Subject: [PATCH 152/319] Destroy the client after every usage This patch should fix the random segmentation fault when using the packagekit's node module. --- .../packagekit/nodepackagekit/nodepackagekit.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 0c8c01e..03f38fa 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -112,9 +112,11 @@ Handle searchPackage(const Arguments& args) { } if (results != NULL) - g_object_unref (results); + g_object_unref (results); if (sack != NULL) - g_object_unref (sack); + g_object_unref (sack); + if (client != NULL) + g_object_unref (client); return scope.Close(result); } @@ -167,9 +169,11 @@ Handle searchFiles (const Arguments& args) { } if (results != NULL) - g_object_unref (results); + g_object_unref (results); if (sack != NULL) - g_object_unref (sack); + g_object_unref (sack); + if (client != NULL) + g_object_unref (client); return scope.Close(result); } @@ -224,6 +228,8 @@ Handle getPackages(const Arguments& args) { g_object_unref (results); if (sack != NULL) g_object_unref (sack); + if (client != NULL) + g_object_unref (client); return scope.Close(result); } From 0aba487c89b7b3ae0e8ea924f87dc778f52f4bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 30 Apr 2014 17:48:38 +0200 Subject: [PATCH 153/319] Replacing 'provider' with 'id' --- node_modules/packagekit/packageKitDeviceReporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/packagekit/packageKitDeviceReporter.js b/node_modules/packagekit/packageKitDeviceReporter.js index 1b42bc8..475060a 100644 --- a/node_modules/packagekit/packageKitDeviceReporter.js +++ b/node_modules/packagekit/packageKitDeviceReporter.js @@ -30,7 +30,7 @@ gpii.packageKit.get = function(filters) { return { - "provider": GPII_PACKAGE_KIT, + "id": GPII_PACKAGE_KIT, "data": packageKit.getPackages(filters) }; }; From 1edf3aa7b9b16327ab90de9e29f764185edd2eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 30 Apr 2014 17:50:12 +0200 Subject: [PATCH 154/319] Adding packagekit node module at start-up time --- gpii.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gpii.js b/gpii.js index 511a94e..1e835ef 100644 --- a/gpii.js +++ b/gpii.js @@ -13,11 +13,17 @@ https://github.com/gpii/universal/LICENSE.txt var fluid = require("universal"), kettle = fluid.registerNamespace("kettle"); +// Settings Handlers +// fluid.require("gsettingsBridge", require); fluid.require("orca", require); fluid.require("alsa", require); fluid.require("xrandr", require); +// Device Reporters +// +fluid.require("packagekit", require); + kettle.config.makeConfigLoader({ nodeEnv: kettle.config.getNodeEnv("fm.ps.sr.dr.mm.os.lms.development"), configPath: kettle.config.getConfigPath() || "../node_modules/universal/gpii/configs" From 626d96333bffa711715f7b17d27a5f1d0af504f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 30 Apr 2014 17:51:21 +0200 Subject: [PATCH 155/319] Initialize packageKit data at load time --- node_modules/packagekit/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/node_modules/packagekit/index.js b/node_modules/packagekit/index.js index bc53e80..9c1b69e 100644 --- a/node_modules/packagekit/index.js +++ b/node_modules/packagekit/index.js @@ -15,3 +15,12 @@ var fluid = require("universal"); var loader = fluid.getLoader(__dirname); loader.require("./packageKitDeviceReporter.js"); + +// Initialize the Device Reporter's installedPackagesCache at the very +// beginning and avoid a delay when a user is logging in into the system. +// +gpii = fluid.registerNamespace("gpii"); +fluid.registerNamespace("gpii.packageKit"); + +var packageKit = require("./nodepackagekit/build/Release/nodepackagekit.node"); +gpii.packageKit.installedPackagesCache = packageKit.getPackages("installed;~devel"); From 1074ebd62abc85595ecb9aaf488d82192cf775ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 30 Apr 2014 17:52:39 +0200 Subject: [PATCH 156/319] Adding 'find' method to packageKit's device reporter plugin --- node_modules/packagekit/packageKitDeviceReporter.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/node_modules/packagekit/packageKitDeviceReporter.js b/node_modules/packagekit/packageKitDeviceReporter.js index 475060a..ffc02c5 100644 --- a/node_modules/packagekit/packageKitDeviceReporter.js +++ b/node_modules/packagekit/packageKitDeviceReporter.js @@ -35,4 +35,17 @@ }; }; + fluid.defaults("gpii.packageKit.find", { + gradeNames: "fluid.function", + argumentMap: { + name: 0 + } + }); + + gpii.packageKit.find = function(name) { + return gpii.packageKit.installedPackagesCache.some(function (pkg) { + return pkg.name == name; + }); + }; + })(); From 0959c366bc87a8a5b398ac5a44ef60bebe844a49 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Wed, 30 Apr 2014 20:10:50 -0400 Subject: [PATCH 157/319] GPII-88 Added license, (un)install tasks, and deprecated warnings. --- Gruntfile.js | 45 ++++++++++++++++++++++++++++++++++++++++++++- build.sh | 4 ++++ clean.sh | 4 ++++ start.sh | 6 +++++- 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index c6f6365..65103c9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,18 @@ +/*! +GPII Linux Personalization Framework Node.js Bootstrap + +Copyright 2014 RFT-US + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + module.exports = function(grunt) { + var usbListenerDir = "./usbDriveListener"; + function nodeGypCompileShell(dir) { return { options: { @@ -38,6 +52,27 @@ module.exports = function(grunt) { cleanAlsaBridge: nodeGypCleanShell("node_modules/alsa/nodealsa"), compileXrandrBridge: nodeGypCompileShell("node_modules/xrandr/nodexrandr"), cleanXrandrBridge: nodeGypCleanShell("node_modules/xrandr/nodexrandr"), + installUsbLib: { + options: { + stdout: true, + stderr: true + }, + command: [ + "sudo cp " + usbListenerDir + "/gpii-usb-user-listener /usr/bin/", + "sudo cp " + usbListenerDir + + "/gpii-usb-user-listener.desktop /usr/share/applications/" + ].join("&&") + }, + uninstallUsbLib: { + options: { + stdout: true, + stderr: true + }, + command: [ + "sudo rm /usr/bin/gpii-usb-user-listener", + "sudo rm /usr/share/applications/gpii-usb-user-listener.desktop" + ].join("&&") + }, startGpii: { options: { stdout: true, @@ -52,7 +87,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks("grunt-gpii"); - grunt.registerTask('build', "Build the entire GPII", function() { + grunt.registerTask("build", "Build the entire GPII", function() { grunt.task.run("gpiiUniversal"); grunt.task.run("shell:compileGSettings"); grunt.task.run("shell:compileAlsaBridge"); @@ -68,4 +103,12 @@ module.exports = function(grunt) { grunt.registerTask("start", "Start the GPII", function() { grunt.task.run("shell:startGpii"); }); + + grunt.registerTask("install", "Install system level GPII Components", function() { + grunt.task.run("shell:installUsbLib"); + }); + + grunt.registerTask("uninstall", "Uninstall system level GPII Components", function() { + grunt.task.run("shell:uninstallUsbLib"); + }); }; diff --git a/build.sh b/build.sh index d5c06cc..5ada533 100755 --- a/build.sh +++ b/build.sh @@ -10,6 +10,8 @@ # You may obtain a copy of the License at # https://github.com/gpii/universal/LICENSE.txt +echo "This script is deprecated and will be removed in a future release. Please look at using our new grunt tasks." + currentDir=`pwd` node_modules="../node_modules" universal="../node_modules/universal" @@ -68,3 +70,5 @@ fi # TODO: We should install the entire GPII in /usr/local/gpii, not just the USB Listener sudo cp "$usbListenerDir/gpii-usb-user-listener" /usr/bin/ sudo cp "$usbListenerDir/gpii-usb-user-listener.desktop" /usr/share/applications/ + +echo "This script is deprecated and will be removed in a future release. Please look at using our new grunt tasks." diff --git a/clean.sh b/clean.sh index 33ce3d0..3ec362d 100755 --- a/clean.sh +++ b/clean.sh @@ -10,6 +10,8 @@ # You may obtain a copy of the License at # https://github.com/gpii/universal/LICENSE.txt +echo "This script is deprecated and will be removed in a future release. Please look at using our new grunt tasks." + cd node_modules/gsettingsBridge/nodegsettings node-gyp clean rm -rf build @@ -32,3 +34,5 @@ sudo rm -f /etc/udev/rules.d/80-gpii.rules # TODO: It seems extremely dangerous to go around deleting the node_modules directory we installed, # in case the developer has unpushed modifications in there. # rm -rf ../node_modules + +echo "This script is deprecated and will be removed in a future release. Please look at using our new grunt tasks." diff --git a/start.sh b/start.sh index 22871e4..206f052 100755 --- a/start.sh +++ b/start.sh @@ -10,7 +10,11 @@ # You may obtain a copy of the License at # https://github.com/gpii/universal/LICENSE.txt +echo "This script is deprecated and will be removed in a future release. Please look at using our new grunt tasks." + fileName="gpii.js" # Start the Flow Manager -node "$fileName" $1 \ No newline at end of file +node "$fileName" $1 + +echo "This script is deprecated and will be removed in a future release. Please look at using our new grunt tasks." From 9cea040e21aca9ff6cdef140a51abdc0ba472683 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Wed, 30 Apr 2014 20:24:09 -0400 Subject: [PATCH 158/319] GPII-88 Updating Readme --- README | 13 ------------- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 13 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index 398866a..0000000 --- a/README +++ /dev/null @@ -1,13 +0,0 @@ -GNU/Linux -========= - -This repository contains all of the platform-specific code required to run the GPII Personalization Framework on GNU/Linux with GNOME. - -The following components can be found in the repository: - -* usbDriveListener: a UserListener implementation that will detect a USB drive with an anonymous GPII user token installed on it -* gSettingsBridge: a Node.js module for accessing the gSettings API via JavaScript within a Node application -* orca: a Node.js module for dealing with GNOME Orca's settings -* alsa: a Node.js module for accessing the ALSA API via JavaScript within a Node application to interact with system's volume -* xrandr: a Node.js module for accessing the XRandr API via JavaScript within a Node application. This module is used for setting the resolution and the screen brightness. - diff --git a/README.md b/README.md new file mode 100644 index 0000000..2649378 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# GNU/Linux + +This repository contains all of the platform-specific code required to run the GPII Personalization Framework on GNU/Linux with GNOME. + +The following components can be found in the repository: + +* usbDriveListener: a UserListener implementation that will detect a USB drive + with an anonymous GPII user token installed on it +* gSettingsBridge: a Node.js module for accessing the gSettings API via + JavaScript within a Node application +* orca: a Node.js module for dealing with GNOME Orca's settings +* alsa: a Node.js module for accessing the ALSA API via JavaScript within a + Node application to interact with system's volume +* xrandr: a Node.js module for accessing the XRandr API via JavaScript within + a Node application. This module is used for setting the resolution and the + screen brightness. + +# Building, Installing, and Running + +We use the grunt task system to perform our build operations. If you don't +have grunt installed yet you can do so with: + + npm install -g grunt-cli + +To fetch our core universal dependencies and build the linux specific plugins +run + + grunt build + +To clean the plugin binaries use + + grunt clean + +You can start the GPII local server on port 8080 using: + + grunt start + +To install and uninstall the listener components use the following. Note that +this may prompt you for sudo access. + + grunt install + grunt uninstall From 11743203386d86f537ff6d5bf737267fcdeb1d5b Mon Sep 17 00:00:00 2001 From: sgithens Date: Wed, 30 Apr 2014 23:04:05 -0400 Subject: [PATCH 159/319] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 2649378..3d84eb2 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,13 @@ To fetch our core universal dependencies and build the linux specific plugins run grunt build + +Because the history of the universal repository is quite large, it can take a +long time to clone (and sometimes will fail depending on the network). To +check it out faster for testing use the fastClone option. Note however, you +will need the regular build in order to commit code and push on universal. + + grunt build --fastClone To clean the plugin binaries use From b900797c10660435961fddf5dc4c6e523f4365da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 14 May 2014 01:05:23 +0200 Subject: [PATCH 160/319] Do not use constants - strings are enough --- node_modules/packagekit/packageKitDeviceReporter.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/node_modules/packagekit/packageKitDeviceReporter.js b/node_modules/packagekit/packageKitDeviceReporter.js index ffc02c5..d1ff291 100644 --- a/node_modules/packagekit/packageKitDeviceReporter.js +++ b/node_modules/packagekit/packageKitDeviceReporter.js @@ -13,8 +13,6 @@ (function () { "use strict"; - var GPII_PACKAGE_KIT = "gpii.packageKit"; - var fluid = require("universal"); var gpii = fluid.registerNamespace("gpii"); var packageKit = require("./nodepackagekit/build/Release/nodepackagekit.node"); @@ -30,7 +28,7 @@ gpii.packageKit.get = function(filters) { return { - "id": GPII_PACKAGE_KIT, + "id": "gpii.packageKit", "data": packageKit.getPackages(filters) }; }; From d69cbbc61688818ec4a6baf0aa92f142d247379e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 14 May 2014 01:08:12 +0200 Subject: [PATCH 161/319] Also evaluate that the object has the same type --- node_modules/packagekit/packageKitDeviceReporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/packagekit/packageKitDeviceReporter.js b/node_modules/packagekit/packageKitDeviceReporter.js index d1ff291..09b9437 100644 --- a/node_modules/packagekit/packageKitDeviceReporter.js +++ b/node_modules/packagekit/packageKitDeviceReporter.js @@ -42,7 +42,7 @@ gpii.packageKit.find = function(name) { return gpii.packageKit.installedPackagesCache.some(function (pkg) { - return pkg.name == name; + return pkg.name === name; }); }; From e4f0a4682dfb52f1eb44948597afb868c2bee8ce Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Tue, 13 May 2014 21:22:07 -0400 Subject: [PATCH 162/319] GPII-88 moving grunt-gpii dep from sgithens repo to gpii repo. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c9d75cf..29b8a59 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "devDependencies": { "grunt": "~0.4.4", "grunt-shell": "0.6.4", - "grunt-gpii": "git://github.com/sgithens/grunt-gpii.git" + "grunt-gpii": "git://github.com/gpii/grunt-gpii.git" }, "licenses": [ { From 8a18502d1763205cf6834210a4c32e21dddbd5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 14 May 2014 03:34:00 +0200 Subject: [PATCH 163/319] Removing fixed-size variables --- .../nodepackagekit/nodepackagekit.cc | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 03f38fa..c9b19bf 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -29,6 +29,15 @@ static gboolean DEBUG = FALSE; static gchar TAG[] = "[nodePackagekit]"; +static gchar * +utf8StringFromValue(v8::Handle value) +{ + v8::Local string = value->ToString(); + gchar *buffer = g_new(gchar, string->Utf8Length()); + string->WriteUtf8(buffer); + return buffer; +} + static void progressCallback(PkProgress *progress, PkProgressType type) { if (!DEBUG) return; @@ -52,13 +61,13 @@ progressCallback(PkProgress *progress, PkProgressType type) { static PkBitfield handleFiltersArgument (const Arguments& args, const int filterIndex) { - char filters[256]; + gchar *filters = NULL; if (args.Length() > filterIndex) { - args[filterIndex]->ToString()->WriteUtf8 (filters); + filters = utf8StringFromValue(args[filterIndex]); } else { - strcpy (filters, "none"); + filters = (gchar *) "none"; } return pk_filter_bitfield_from_string (filters); } @@ -79,12 +88,12 @@ Handle searchPackage(const Arguments& args) { PkResults *results = NULL; GPtrArray *array; PkPackageSack *sack = NULL; - char name[1024]; + gchar *name = NULL; PkBitfield filtersBitField; GError *err = NULL; v8::Handle result = v8::Array::New(); - args[0]->ToString()->WriteUtf8(name); + name = utf8StringFromValue(args[0]); gchar *names[sizeof(name)] = {name}; filtersBitField = handleFiltersArgument (args, 1); @@ -137,12 +146,12 @@ Handle searchFiles (const Arguments& args) { PkResults *results = NULL; GPtrArray *array; PkPackageSack *sack = NULL; - char pathName[1024]; + gchar *pathName = NULL; PkBitfield filtersBitField; GError *err = NULL; v8::Handle result = v8::Array::New(); - args[0]->ToString()->WriteUtf8(pathName); + pathName = utf8StringFromValue(args[0]); gchar *pathNames[sizeof(pathName)] = {pathName}; filtersBitField = handleFiltersArgument (args, 1); @@ -245,8 +254,9 @@ Handle installPackage(const Arguments& args) { HandleScope scope; PkTask *task; GError *err = NULL; - char name[1024]; - args[0]->ToString()->WriteUtf8(name); + gchar *name = NULL; + + name = utf8StringFromValue(args[0]); gchar **package_ids = NULL; task = pk_task_new(); @@ -272,8 +282,9 @@ Handle updatePackage(const Arguments& args) { HandleScope scope; PkTask *task; GError *err = NULL; - char name[1024]; - args[0]->ToString()->WriteUtf8(name); + gchar *name = NULL; + + name = utf8StringFromValue(args[0]); gchar **package_ids = NULL; task = pk_task_new(); @@ -299,8 +310,8 @@ Handle removePackage(const Arguments& args) { HandleScope scope; PkTask *task; GError *err = NULL; - char name[1024]; - args[0]->ToString()->WriteUtf8(name); + gchar *name = NULL; + name = utf8StringFromValue(args[0]); gchar **package_ids = NULL; task = pk_task_new(); From 9d0e7c0c2512379ae0dec215c6e92aed18a100c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 14 May 2014 03:39:14 +0200 Subject: [PATCH 164/319] Update some tests to evaluate that the object has the same type --- .../packagekit/nodepackagekit/nodepackagekit_test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 4e92981..2416d27 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -122,7 +122,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { var installedPkgs = packagekit.getPackages ('installed'); var installedIndex = -1; for (var i = 0; i < installedPkgs.length; i++) { - if (installedPkgs[i].name == tuxguitarPkg.name) { + if (installedPkgs[i].name === tuxguitarPkg.name) { installedIndex = i; break; } @@ -134,7 +134,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { var availablePkgs = packagekit.getPackages ('~installed'); var availableIndex = -1; for (i = 0; i < availablePkgs.length; i++) { - if (availablePkgs[i].name == tuxguitarPkg.name) { + if (availablePkgs[i].name === tuxguitarPkg.name) { availableIndex = i; break; } @@ -154,7 +154,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { var oldEmacspeak = '38.0-5.fc20'; var newEmacspeak = '39.0-1.fc20'; pkgs = packagekit.searchPackage ('emacspseak'); - if (pkgs.length == 2) { + if (pkgs.length === 2) { if (pkgs[0].version == oldEmacspeak && pkg[1].version == newEmacspeak && pkgs[1].data.indexOf('updates') != -1) { From 9c358ccc651dfd5d1f8a06d14ffa0d288d8de406 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 14 May 2014 15:50:05 -0400 Subject: [PATCH 165/319] Replaced function printPackage() with single call to JSON.stringify(). --- .../packagekit/nodepackagekit/findSearchPk.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js index b17835d..70a4790 100644 --- a/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -109,10 +109,7 @@ if (lookingFor !== undefined) { searchNotInstalled(); } if (packages.length > 0) { - console.log ("Packages:") - console.log ("["); - packages.forEach (printPackage); - console.log ("]"); + console.log (JSON.stringify (packages, null, ' ')); } else { console.log ("No package found"); @@ -144,16 +141,4 @@ if (lookingFor !== undefined) { find.on ('error', function (err) { console.log ('child process : ' + err); }); - - function printPackage (value, index, array) { - var pkg = array[index]; - var closeBrace = " }"; - if (index == array.length-1) - closeBrace += ","; - console.log (" { id: " + pkg.id); - console.log (" name: " + pkg.name); - console.log (" version: " + pkg.version); - console.log (" data: " + pkg.data); - console.log (closeBrace); - } } From 6ec43e50cdf6befbf791c591e3b71ca55a208386 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 14 May 2014 15:54:32 -0400 Subject: [PATCH 166/319] Fixed typo: "search" instead of "serach". --- node_modules/packagekit/nodepackagekit/findSearchPk.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js index 70a4790..f6ccd9c 100644 --- a/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -1,5 +1,5 @@ /*! -GPII Node.js find + serach packages +GPII Node.js find + search packages Copyright 2013 Inclusive Design Research Centre, OCAD University From 0ff2b20590e2c3458b35ebf0c796ef3c592dc6d3 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Thu, 15 May 2014 12:32:37 -0400 Subject: [PATCH 167/319] Ran jshint on findSearchPk.js and modified accordingly. Added fluid infusion's .jshintrc file to the project. --- .jshintrc | 33 +++++ .../packagekit/nodepackagekit/findSearchPk.js | 118 ++++++++++-------- 2 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 .jshintrc diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..073e5b9 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,33 @@ +{ + "bitwise": false, + "camelcase": false, + "curly": true, + "eqeqeq": true, + "es3": true, + "forin": false, + "freeze": true, + "immed": true, + "indent": 4, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": false, + "nonbsp": true, + "nonew": true, + "plusplus": false, + "quotmark": "double", + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + + "maxerr": 1000, + + "browser": true, + "jquery": true, + "worker": true, + + "globals": { + "fluid_1_5": true + } +} diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js index f6ccd9c..4d9fbe9 100644 --- a/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -75,70 +75,82 @@ packages found. */ -var packagekit = require ('./build/Release/nodepackagekit.node'); - +/* global require, process, console */ + +var packagekit = require ("./build/Release/nodepackagekit.node"); + var lookingFor = process.argv[2]; -if (lookingFor !== undefined) { - var findArgs = process.env.PATH.split (':'); - findArgs.push (process.env.HOME); - findArgs.push ('-name'); findArgs.push (lookingFor); - findArgs.push ('-type'); findArgs.push ('f'); // only regular files. - findArgs.push ('-print'); - - // Record the files found by 'find'. - var whatFindFound = []; - var packages = []; - function onFindStdout (data) { - var found = data.toString().split ('\n'); - found.forEach (function (value, index, array) { - if (value.length > 0) - whatFindFound.push (value); - }); + +// Record the files found by 'find', and possibly related packages. +var whatFindFound = []; +var packages = []; + +// Use package kit add-on to get version of the software. +// - searchNotInstalled() is used when 'find' found nothing. +// - searchInstalled() is used when 'find' found something. +function searchNotInstalled() { + "use strict"; + packages = packagekit.searchPackage (lookingFor, "~installed;basename"); +} + +function searchInstalled() { + "use strict"; + packages = packagekit.searchFiles (whatFindFound); + if (packages.length === 0) { + packages = packagekit.searchPackage (lookingFor, "installed;basename"); } - - // Handle 'find' on close event -- invoke packagekit.searchPackage(). - function onFindClose (code) { - console.log ("'find' found " + - ( whatFindFound.length == 0 ? "nothing" : whatFindFound )); - - if (whatFindFound.length == 0) +} + +// Handle 'find' on close event -- invoke packagekit.searchPackage(). +function onFindClose() { + "use strict"; + console.log ("'find' found " + + ( whatFindFound.length === 0 ? "nothing" : whatFindFound )); + + if (whatFindFound.length === 0) { + searchNotInstalled(); + } + else { + searchInstalled(); + if (packages.length === 0) { searchNotInstalled(); - else { - searchInstalled(); - if (packages.length == 0) - searchNotInstalled(); - } - if (packages.length > 0) { - console.log (JSON.stringify (packages, null, ' ')); - } - else { - console.log ("No package found"); } } - - // Use package kit add-on to get version of the software. - // - searchNotInstalled() is used when 'find' found nothing. - // - searchInstalled() is used when 'find' found something. - function searchNotInstalled() { - packages = packagekit.searchPackage (lookingFor, '~installed;basename'); + if (packages.length > 0) { + console.log (JSON.stringify (packages, null, " ")); } - - function searchInstalled() { - packages = packagekit.searchFiles (whatFindFound); - if (packages.length == 0) { - packages = packagekit.searchPackage (lookingFor, 'installed;basename'); - } + else { + console.log ("No package found"); } +} + +function onFindStdout (data) { + "use strict"; + var found = data.toString().split ("\n"); + found.forEach (function (value) { + if (value.length > 0) { + whatFindFound.push (value); + } + }); +} + +if (lookingFor !== undefined) { + var findArgs = process.env.PATH.split (":"); + findArgs.push (process.env.HOME); + findArgs.push ("-name"); findArgs.push (lookingFor); + findArgs.push ("-type"); findArgs.push ("f"); // only regular files. + findArgs.push ("-print"); // Run 'find' - var spawn = require ('child_process').spawn, - find = spawn ('find', findArgs); + var spawn = require ("child_process").spawn, + find = spawn ("find", findArgs); - find.stdout.on ('data', onFindStdout); + find.stdout.on ("data", onFindStdout); - find.on ('close', onFindClose); + find.on ("close", onFindClose); - find.on ('error', function (err) { - console.log ('child process : ' + err); + find.on ("error", function (err) { + "use strict"; + console.log ("child process : " + err); }); } From 922f0f78eb212bb6826537600a11a7d87b326dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Sun, 22 Jun 2014 20:10:35 +0200 Subject: [PATCH 168/319] Guarding against buffer overruns as Antranig suggested on his review --- .../nodepackagekit/nodepackagekit.cc | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index c9b19bf..e4be827 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -13,12 +13,12 @@ You may obtain a copy of the License at */ #define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE 1 -#include #include #include #include #include #include +#include using namespace v8; @@ -29,7 +29,7 @@ static gboolean DEBUG = FALSE; static gchar TAG[] = "[nodePackagekit]"; -static gchar * +static std::basic_string utf8StringFromValue(v8::Handle value) { v8::Local string = value->ToString(); @@ -61,7 +61,7 @@ progressCallback(PkProgress *progress, PkProgressType type) { static PkBitfield handleFiltersArgument (const Arguments& args, const int filterIndex) { - gchar *filters = NULL; + std::basic_string filters; if (args.Length() > filterIndex) { filters = utf8StringFromValue(args[filterIndex]); @@ -69,7 +69,7 @@ handleFiltersArgument (const Arguments& args, const int filterIndex) { else { filters = (gchar *) "none"; } - return pk_filter_bitfield_from_string (filters); + return pk_filter_bitfield_from_string (filters.c_str()); } /** @@ -88,13 +88,13 @@ Handle searchPackage(const Arguments& args) { PkResults *results = NULL; GPtrArray *array; PkPackageSack *sack = NULL; - gchar *name = NULL; + std::basic_string name; PkBitfield filtersBitField; GError *err = NULL; v8::Handle result = v8::Array::New(); name = utf8StringFromValue(args[0]); - gchar *names[sizeof(name)] = {name}; + gchar *names[sizeof(name)] = {&name[0]}; filtersBitField = handleFiltersArgument (args, 1); @@ -146,13 +146,13 @@ Handle searchFiles (const Arguments& args) { PkResults *results = NULL; GPtrArray *array; PkPackageSack *sack = NULL; - gchar *pathName = NULL; + std::basic_string pathName; PkBitfield filtersBitField; GError *err = NULL; v8::Handle result = v8::Array::New(); pathName = utf8StringFromValue(args[0]); - gchar *pathNames[sizeof(pathName)] = {pathName}; + gchar *pathNames[sizeof(pathName)] = {&pathName[0]}; filtersBitField = handleFiltersArgument (args, 1); client = pk_client_new(); @@ -254,13 +254,14 @@ Handle installPackage(const Arguments& args) { HandleScope scope; PkTask *task; GError *err = NULL; - gchar *name = NULL; + std::basic_string name; name = utf8StringFromValue(args[0]); + gchar **package_ids = NULL; task = pk_task_new(); - package_ids = pk_package_ids_from_id (name); + package_ids = pk_package_ids_from_id (name.c_str()); pk_task_install_packages_sync(task, package_ids, NULL, (PkProgressCallback) progressCallback, @@ -282,13 +283,13 @@ Handle updatePackage(const Arguments& args) { HandleScope scope; PkTask *task; GError *err = NULL; - gchar *name = NULL; + std::basic_string name; name = utf8StringFromValue(args[0]); gchar **package_ids = NULL; task = pk_task_new(); - package_ids = pk_package_ids_from_id (name); + package_ids = pk_package_ids_from_id (name.c_str()); pk_task_update_packages_sync (task, package_ids, NULL, (PkProgressCallback) progressCallback, @@ -310,12 +311,11 @@ Handle removePackage(const Arguments& args) { HandleScope scope; PkTask *task; GError *err = NULL; - gchar *name = NULL; - name = utf8StringFromValue(args[0]); + std::basic_string name = utf8StringFromValue(args[0]); gchar **package_ids = NULL; task = pk_task_new(); - package_ids = pk_package_ids_from_id (name); + package_ids = pk_package_ids_from_id (name.c_str()); pk_task_remove_packages_sync(task, package_ids, TRUE, FALSE, NULL, (PkProgressCallback) progressCallback, From 0642c3a8e189c857ea07ba572a1e3c138ec2cac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Sun, 22 Jun 2014 20:12:33 +0200 Subject: [PATCH 169/319] Splitting tests into module and device reporter dedicated tests --- node_modules/packagekit/test/all-tests.js | 29 ++++++++++++++ .../test/packageKitDeviceReporterTests.js | 40 +++++++++++++++++++ ...geKitTests.js => packageKitModuleTests.js} | 9 ++--- 3 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 node_modules/packagekit/test/all-tests.js create mode 100644 node_modules/packagekit/test/packageKitDeviceReporterTests.js rename node_modules/packagekit/test/{packageKitTests.js => packageKitModuleTests.js} (84%) diff --git a/node_modules/packagekit/test/all-tests.js b/node_modules/packagekit/test/all-tests.js new file mode 100644 index 0000000..898a5e1 --- /dev/null +++ b/node_modules/packagekit/test/all-tests.js @@ -0,0 +1,29 @@ +/** + * GPII PackageKit Device Reporter Tests + * + * Copyright 2014 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/gpii/universal/LICENSE.txt + */ + +var fluid = require("universal"); + kettle = fluid.require("kettle"); + +fluid.require("kettle/test/utils/js/KettleTestUtils"); + +kettle.tests.allTests = true; + +var testIncludes = [ + "./packageKitModuleTests.js", + "./packageKitDeviceReporterTests.js" +]; + +var tests = []; + +fluid.each(testIncludes, function (path) { + tests = tests.concat(fluid.require(path, require)); +}); diff --git a/node_modules/packagekit/test/packageKitDeviceReporterTests.js b/node_modules/packagekit/test/packageKitDeviceReporterTests.js new file mode 100644 index 0000000..435be54 --- /dev/null +++ b/node_modules/packagekit/test/packageKitDeviceReporterTests.js @@ -0,0 +1,40 @@ +/** + * GPII PackageKit Device Reporter Tests + * + * Copyright 2014 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/gpii/universal/LICENSE.txt + */ + +var fluid = require("universal"), + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("jqUnit"); + +require("packagekit"); +packageKit = fluid.registerNamespace("gpii.packageKit"); + +jqUnit.module("GPII PackageKit Device Reporter"); + +jqUnit.test("Running tests for PackageKit Device Reporter", function () { + jqUnit.expect(2); + + // mock-up of installedPackagesCache + // + gpii.packageKit.installedPackagesCache = [ + { + "id": "foo_id", + "name": "foo", + "version": "foo_version", + "data": "installed" + } + ] + + jqUnit.assertTrue("Check the availability of 'foo' through 'find' method", + gpii.packageKit.find("foo")); + + jqUnit.assertFalse("Look for 'fooo' package", gpii.packageKit.find("fooo")); +}); diff --git a/node_modules/packagekit/test/packageKitTests.js b/node_modules/packagekit/test/packageKitModuleTests.js similarity index 84% rename from node_modules/packagekit/test/packageKitTests.js rename to node_modules/packagekit/test/packageKitModuleTests.js index 5284456..4315cfa 100644 --- a/node_modules/packagekit/test/packageKitTests.js +++ b/node_modules/packagekit/test/packageKitModuleTests.js @@ -20,21 +20,20 @@ packageKit = fluid.registerNamespace("gpii.packageKit"); jqUnit.module("GPII PackageKit Module"); jqUnit.test("Running tests for PackageKit Device Reporter", function () { - jqUnit.expect(3); + jqUnit.expect(4); // Check that the bridge is loaded and required methods are available // - methods = ["get"]; + methods = ["get", "find"]; for (var method in methods) { jqUnit.assertTrue("Checking availability of method '" + method + "'", (methods[method] in packageKit)); } - jqUnit.assertDeepEq("Checking that 'get' report both 'provider' and 'data'", + jqUnit.assertDeepEq("Checking that 'get' reports both 'id' and 'data'", Object.keys(gpii.packageKit.get("installed")), - Object.keys({"provider": null, "data": null})); + Object.keys({"id": null, "data": null})); jqUnit.assertTrue("Checking that 'get' report installed packages", (gpii.packageKit.get("installed").data.length > 0)); - }); From ae854f1f37e2590b3525f8e2660203d0185bf39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 23 Jun 2014 00:35:59 +0200 Subject: [PATCH 170/319] Provide a unique method to 'install', 'update' and 'remove' packages installPackage, removePackage and updatePackage methods have been replaced by performAction method. It receives the action to be performed (either 'install', 'remove' or 'update') and the package's id. --- .../nodepackagekit/nodepackagekit.cc | 94 +++++-------------- 1 file changed, 25 insertions(+), 69 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index e4be827..6af5853 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -244,82 +244,42 @@ Handle getPackages(const Arguments& args) { } /** - * installPackage: + * performAction: * * Should take as arguments: - * name: The package id (str). + * action: action to perform, either 'install', 'update' or 'remove' (str) + * name: id of the package (str) * Returns: true | false (bool) */ -Handle installPackage(const Arguments& args) { +Handle performAction(const Arguments& args) { HandleScope scope; PkTask *task; GError *err = NULL; - std::basic_string name; - - name = utf8StringFromValue(args[0]); - - gchar **package_ids = NULL; - - task = pk_task_new(); - package_ids = pk_package_ids_from_id (name.c_str()); - - pk_task_install_packages_sync(task, package_ids, NULL, - (PkProgressCallback) progressCallback, - NULL, &err); - - g_strfreev (package_ids); - - return scope.Close(True()); -} - -/** - * updatePackage: - * - * Should take as arguments: - * name: The package id (str). - * Returns: true | false (bool) - */ -Handle updatePackage(const Arguments& args) { - HandleScope scope; - PkTask *task; - GError *err = NULL; - std::basic_string name; + std::basic_string action = utf8StringFromValue(args[0]); + std::basic_string name = utf8StringFromValue(args[1]); - name = utf8StringFromValue(args[0]); gchar **package_ids = NULL; task = pk_task_new(); package_ids = pk_package_ids_from_id (name.c_str()); - pk_task_update_packages_sync (task, package_ids, NULL, - (PkProgressCallback) progressCallback, - NULL, &err); - - g_strfreev (package_ids); - - return scope.Close(True()); -} - -/** - * removePackage: - * - * Should take as arguments: - * name: Name of the package (str) - * Returns: true | false (bool) - */ -Handle removePackage(const Arguments& args) { - HandleScope scope; - PkTask *task; - GError *err = NULL; - std::basic_string name = utf8StringFromValue(args[0]); - gchar **package_ids = NULL; - - task = pk_task_new(); - package_ids = pk_package_ids_from_id (name.c_str()); - - pk_task_remove_packages_sync(task, package_ids, TRUE, FALSE, NULL, - (PkProgressCallback) progressCallback, - NULL, &err); + if (action == "install") { + pk_task_install_packages_sync(task, package_ids, NULL, + (PkProgressCallback) progressCallback, + NULL, &err); + } else if (action == "update") { + pk_task_update_packages_sync(task, package_ids, NULL, + (PkProgressCallback) progressCallback, + NULL, &err); + } else if (action == "remove") { + pk_task_remove_packages_sync(task, package_ids, TRUE, FALSE, NULL, + (PkProgressCallback) progressCallback, + NULL, &err); + } else { + ThrowException(Exception::Error(String::New( + "You have to provide the action to be performed, either 'install'," + "'update' or 'remove'"))); + } g_strfreev (package_ids); @@ -333,12 +293,8 @@ void init(Handle target) { FunctionTemplate::New(searchFiles)->GetFunction()); target->Set(String::NewSymbol("getPackages"), FunctionTemplate::New(getPackages)->GetFunction()); - target->Set(String::NewSymbol("installPackage"), - FunctionTemplate::New(installPackage)->GetFunction()); - target->Set(String::NewSymbol("updatePackage"), - FunctionTemplate::New(installPackage)->GetFunction()); - target->Set(String::NewSymbol("removePackage"), - FunctionTemplate::New(removePackage)->GetFunction()); + target->Set(String::NewSymbol("performAction"), + FunctionTemplate::New(performAction)->GetFunction()); } NODE_MODULE(nodepackagekit, init) From ed8fea7be863b089a44203871c526131472431b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 23 Jun 2014 00:42:29 +0200 Subject: [PATCH 171/319] Updating native add-on tests according to the latest changes on it --- .../nodepackagekit/nodepackagekit_test.js | 64 ++++++++++--------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 2416d27..5857462 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -58,10 +58,10 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // returned array of package ids should be one, and, in the latter, should // be zero. pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); - jqUnit.assertEquals ("Package tuxguitar is installed, " + + jqUnit.assertNotEquals ("Package tuxguitar is installed, " + "size of package id list is not one: '" + pkgs.length, - 1, pkgs.length); + 0, pkgs.length); pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); jqUnit.assertEquals ("Package tuxguitar is not installed, " + @@ -93,10 +93,10 @@ jqUnit.test ("Testing PackageKit Bridge", function() { console.log ("Testing installPackage() -- installing tuxguitar"); pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); - jqUnit.assertEquals ("No package tuxguitar available; cannot install", - 1, pkgs.length); + jqUnit.assertFalse ("No package tuxguitar available; cannot install", + 0, pkgs.length); - packagekit.installPackage (pkgs[0].id); + packagekit.performAction('install', pkgs[0].id); pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); jqUnit.assertEquals ("Failure installing package tuxguitar, ", 1, pkgs.length); @@ -108,9 +108,9 @@ jqUnit.test ("Testing PackageKit Bridge", function() { jqUnit.assertEquals ("No package tuxguitar installed; cannot remove", 1, pkgs.length); - packagekit.removePackage (pkgs[0].id); + packagekit.performAction('remove', pkgs[0].id); pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); - jqUnit.assertEquals ("Failed to remove tuxguitar package", 1, pkgs.length); + jqUnit.assertFalse ("Failed to remove tuxguitar package", 0, pkgs.length); // *** getPackages() tests *** @@ -142,29 +142,31 @@ jqUnit.test ("Testing PackageKit Bridge", function() { jqUnit.assertNotEquals ("Did not find tuxguitar in available packages", -1, availableIndex); // *** updatePackage() tests *** + // TODO: Needs to be re-added + +// console.log ("Testing updatePackage() with 'emacspeak'"); +// +// // The package ids of an old and newer version of 'emacspeak'. +// // TODO: JS: While the following check against two version of +// // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, +// // the check that searchPackage() finds the two versions. If so, the test is +// // run; otherwise no test is run. Need to find a better way to find +// // multiple versions of a package to test against. +// var oldEmacspeak = '38.0-5.fc20'; +// var newEmacspeak = '39.0-1.fc20'; +// pkgs = packagekit.searchPackage ('emacspseak'); +// if (pkgs.length === 2) { +// if (pkgs[0].version == oldEmacspeak && pkg[1].version == newEmacspeak && +// pkgs[1].data.indexOf('updates') != -1) { +// +// packagekit.updatePackage (pkgs[1].id); +// var currentPkgs = packagekit.searchPackage ('emacspseak', 'installed'); +// jqUnit.assertEquals ("Failed to update to " + newEmacspeak, +// currentPkgs[0].version, newEmacspeak); +// +// // Restore to previous. +// packagekit.removePackage (currentPkgs[0].id); +// } +// } - console.log ("Testing updatePackage() with 'emacspeak'"); - - // The package ids of an old and newer version of 'emacspeak'. - // TODO: JS: While the following check against two version of - // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, - // the check that searchPackage() finds the two versions. If so, the test is - // run; otherwise no test is run. Need to find a better way to find - // multiple versions of a package to test against. - var oldEmacspeak = '38.0-5.fc20'; - var newEmacspeak = '39.0-1.fc20'; - pkgs = packagekit.searchPackage ('emacspseak'); - if (pkgs.length === 2) { - if (pkgs[0].version == oldEmacspeak && pkg[1].version == newEmacspeak && - pkgs[1].data.indexOf('updates') != -1) { - - packagekit.updatePackage (pkgs[1].id); - var currentPkgs = packagekit.searchPackage ('emacspseak', 'installed'); - jqUnit.assertEquals ("Failed to update to " + newEmacspeak, - currentPkgs[0].version, newEmacspeak); - - // Restore to previous. - packagekit.removePackage (currentPkgs[0].id); - } - } }); From 3c613cfebb4092399a4257fc122d30e2a3f16232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 23 Jun 2014 15:49:29 +0300 Subject: [PATCH 172/319] GPII-88: Added missing usbDriveUserListener related grunt tasks Added the creation and deletion of /var/lib/gpii folder. Cleaned up the code from extra whitespaces. --- Gruntfile.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 65103c9..23563a3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -23,10 +23,10 @@ module.exports = function(grunt) { } }, command: function() { - return "node-gyp configure build"; + return "node-gyp configure build"; } }; - }; + }; function nodeGypCleanShell(dir) { return { @@ -59,8 +59,9 @@ module.exports = function(grunt) { }, command: [ "sudo cp " + usbListenerDir + "/gpii-usb-user-listener /usr/bin/", - "sudo cp " + usbListenerDir + - "/gpii-usb-user-listener.desktop /usr/share/applications/" + "sudo cp " + usbListenerDir + + "/gpii-usb-user-listener.desktop /usr/share/applications/", + "sudo mkdir /var/lib/gpii" ].join("&&") }, uninstallUsbLib: { @@ -70,7 +71,8 @@ module.exports = function(grunt) { }, command: [ "sudo rm /usr/bin/gpii-usb-user-listener", - "sudo rm /usr/share/applications/gpii-usb-user-listener.desktop" + "sudo rm /usr/share/applications/gpii-usb-user-listener.desktop", + "sudo rm -f /var/lib/gpii" ].join("&&") }, startGpii: { @@ -89,16 +91,18 @@ module.exports = function(grunt) { grunt.registerTask("build", "Build the entire GPII", function() { grunt.task.run("gpiiUniversal"); - grunt.task.run("shell:compileGSettings"); - grunt.task.run("shell:compileAlsaBridge"); - grunt.task.run("shell:compileXrandrBridge"); + grunt.task.run("shell:compileGSettings"); + grunt.task.run("shell:compileAlsaBridge"); + grunt.task.run("shell:compileXrandrBridge"); + grunt.task.run("shell:installUsbLib"); }); grunt.registerTask("clean", "Clean the GPII binaries and uninstall", function() { grunt.task.run("shell:cleanGSettings"); grunt.task.run("shell:cleanAlsaBridge"); grunt.task.run("shell:cleanXrandrBridge"); - }); + grunt.task.run("shell:uninstallUsbLib"); + }); grunt.registerTask("start", "Start the GPII", function() { grunt.task.run("shell:startGpii"); From c2593db526596e315348799939e180d868d9e786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 24 Jun 2014 09:02:32 +0300 Subject: [PATCH 173/319] Fixing typo --- node_modules/packagekit/nodepackagekit/findSearchPk.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js index 4d9fbe9..354dcb1 100644 --- a/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -51,7 +51,7 @@ return what is available to install. The end result is: 1. Package information as to what is installed on the system. -2. Package information as to what is avaialable to be installed. +2. Package information as to what is available to be installed. 3. A combination of 1. and 2. if there is the package is installed, and there is an update available for installation. 4. No package information. From 9628e788136648a47f7a95583c0d750c70e81652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 24 Jun 2014 09:49:32 +0300 Subject: [PATCH 174/319] Adding a reminder to improve the initialisation process --- node_modules/packagekit/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node_modules/packagekit/index.js b/node_modules/packagekit/index.js index 9c1b69e..74ca83d 100644 --- a/node_modules/packagekit/index.js +++ b/node_modules/packagekit/index.js @@ -18,6 +18,8 @@ loader.require("./packageKitDeviceReporter.js"); // Initialize the Device Reporter's installedPackagesCache at the very // beginning and avoid a delay when a user is logging in into the system. +// Right now this is provisional, so we have to re-think how to initialize it +// in a smarter way. http://issues.gpii.net/browse/GPII-851 // gpii = fluid.registerNamespace("gpii"); fluid.registerNamespace("gpii.packageKit"); From fea0c267d9bf7448d85c01ee40d088f9da7eba5a Mon Sep 17 00:00:00 2001 From: kaspermarkus Date: Wed, 25 Jun 2014 20:10:02 +0300 Subject: [PATCH 175/319] GPII-679: Updated license header files for all source codes as well as the general LICENCE file of the repo --- LICENSE.txt | 23 ++++++++------ build.sh | 7 ++++- clean.sh | 7 ++++- gpii.js | 26 +++++++++------- node_modules/alsa/alsa_bridge.js | 26 +++++++++------- node_modules/alsa/index.js | 26 +++++++++------- node_modules/alsa/nodealsa/nodealsa.cc | 16 ++++++++++ node_modules/alsa/nodealsa/nodealsa_tests.js | 24 ++++++++------- .../gsettingsBridge/gsettings_bridge.js | 26 +++++++++------- node_modules/gsettingsBridge/index.js | 26 +++++++++------- .../nodegsettings/nodegsettings.cc | 27 ++++++++++------- .../nodegsettings/nodegsettings_tests.js | 30 +++++++++++-------- .../gsettingsBridge/tests/gsettingsTests.js | 26 +++++++++------- .../gsettingsBridge/tests/runUnitTests.sh | 14 +++++++++ node_modules/gsettingsBridge/tests/tests.js | 18 ++++++++++- node_modules/orca/index.js | 8 +++-- node_modules/orca/orcaSettingsHandler.js | 10 +++++-- .../orca/test/orcaSettingsHandlerTests.js | 24 ++++++++------- node_modules/xrandr/index.js | 26 +++++++++------- node_modules/xrandr/nodexrandr/nodexrandr.cc | 16 ++++++++++ .../xrandr/nodexrandr/nodexrandr_tests.js | 26 +++++++++------- .../xrandr/test/xrandrSettingsHandlerTests.js | 24 ++++++++------- node_modules/xrandr/xrandr_bridge.js | 26 +++++++++------- start.sh | 6 +++- tests/AcceptanceTests.js | 25 +++++++++------- usbDriveListener/bin/handleUserDeviceEvent.sh | 7 ++++- usbDriveListener/bin/trigger.sh | 6 +++- 27 files changed, 342 insertions(+), 184 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index a90784e..c7445c2 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,18 +1,23 @@ -Copyright 2012, OCAD University -Copyright 2012, Steven Githens -Copyright 2012, Astea Solutions +All modules are Copyright 2014 Raising the Floor - International except +where noted otherwise in the code itself, or if the modules reside in a +separate directory, they may contain explicit declarations of copyright +in both the LICENSE file in the directory in which they reside and in the +code itself. No external contributions are allowed under licenses which are +fundamentally incompatible with the BSD or Apache licenses that the GPII is +distributed under. + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of OCAD University nor the names of its contributors may - be used to endorse or promote products derived from this software without + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of OCAD University nor the names of its contributors may + be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" diff --git a/build.sh b/build.sh index d2dc8e3..0cda1c8 100755 --- a/build.sh +++ b/build.sh @@ -7,8 +7,13 @@ # Licensed under the New BSD license. You may not use this file except in # compliance with this License. # +# The research leading to these results has received funding from the European Union's +# Seventh Framework Programme (FP7/2007-2013) +# under grant agreement no. 289016. +# # You may obtain a copy of the License at -# https://github.com/gpii/universal/LICENSE.txt +# https://github.com/GPII/universal/blob/master/LICENSE.txt + currentDir=`pwd` node_modules="../node_modules" diff --git a/clean.sh b/clean.sh index 33ce3d0..d718f07 100755 --- a/clean.sh +++ b/clean.sh @@ -7,8 +7,13 @@ # Licensed under the New BSD license. You may not use this file except in # compliance with this License. # +# The research leading to these results has received funding from the European Union's +# Seventh Framework Programme (FP7/2007-2013) +# under grant agreement no. 289016. +# # You may obtain a copy of the License at -# https://github.com/gpii/universal/LICENSE.txt +# https://github.com/GPII/universal/blob/master/LICENSE.txt + cd node_modules/gsettingsBridge/nodegsettings node-gyp clean diff --git a/gpii.js b/gpii.js index 511a94e..df9343c 100644 --- a/gpii.js +++ b/gpii.js @@ -1,14 +1,18 @@ -/*! -GPII Linux Personalization Framework Node.js Bootstrap - -Copyright 2012 OCAD University - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ +/* + * GPII Linux Personalization Framework Node.js Bootstrap + * + * Copyright 2012 OCAD University + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ var fluid = require("universal"), kettle = fluid.registerNamespace("kettle"); diff --git a/node_modules/alsa/alsa_bridge.js b/node_modules/alsa/alsa_bridge.js index 4924551..c85f082 100644 --- a/node_modules/alsa/alsa_bridge.js +++ b/node_modules/alsa/alsa_bridge.js @@ -1,14 +1,18 @@ -/*! -GPII Node.js ALSA Volume Bridge - -Copyright 2013 Emergya - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ +/* + * GPII Node.js ALSA Volume Bridge + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ (function () { "use strict"; diff --git a/node_modules/alsa/index.js b/node_modules/alsa/index.js index 26b45a5..0fb0654 100644 --- a/node_modules/alsa/index.js +++ b/node_modules/alsa/index.js @@ -1,14 +1,18 @@ -/*! -GPII Node.js ALSA Volume Bridge - -Copyright 2013 Emergya - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ +/* + * GPII Node.js ALSA Volume Bridge + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ var fluid = require("universal"); diff --git a/node_modules/alsa/nodealsa/nodealsa.cc b/node_modules/alsa/nodealsa/nodealsa.cc index e92973d..8b0552a 100644 --- a/node_modules/alsa/nodealsa/nodealsa.cc +++ b/node_modules/alsa/nodealsa/nodealsa.cc @@ -1,3 +1,19 @@ +/* + * GPII Node.js Alsa bridge + * + * Copyright 2012 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ + #include #include diff --git a/node_modules/alsa/nodealsa/nodealsa_tests.js b/node_modules/alsa/nodealsa/nodealsa_tests.js index 09bc83f..507190a 100644 --- a/node_modules/alsa/nodealsa/nodealsa_tests.js +++ b/node_modules/alsa/nodealsa/nodealsa_tests.js @@ -1,14 +1,18 @@ /* -GPII Node.js ALSA Volume Bridge - -Copyright 2013 Emergya - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ + * GPII Node.js ALSA Volume Bridge + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ var fluid = require("universal"), jqUnit = fluid.require("jqUnit"), diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/node_modules/gsettingsBridge/gsettings_bridge.js index d60347f..82e8c14 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/node_modules/gsettingsBridge/gsettings_bridge.js @@ -1,14 +1,18 @@ -/*! -GPII Node.js GSettings Bridge - -Copyright 2012 Steven Githens - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ +/* + * GPII Node.js GSettings Bridge + * + * Copyright 2012 Steven Githens + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ (function () { "use strict"; diff --git a/node_modules/gsettingsBridge/index.js b/node_modules/gsettingsBridge/index.js index c03d2d6..7ae5f70 100644 --- a/node_modules/gsettingsBridge/index.js +++ b/node_modules/gsettingsBridge/index.js @@ -1,14 +1,18 @@ -/*! -GPII Node.js GSettings Bridge - -Copyright 2012 Steven Githens - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ +/* + * GPII Node.js GSettings Bridge + * + * Copyright 2012 Steven Githens + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ var fluid = require("universal"); diff --git a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index 04c9ce8..09a0593 100644 --- a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -1,14 +1,19 @@ /* -GPII Node.js GSettings Bridge + * GPII Node.js GSettings Bridge + * + * Copyright 2012 Steven Githens + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ -Copyright 2012 Steven Githens - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ #include #include @@ -49,7 +54,7 @@ Handle get_gsetting(const Arguments& args) { args[1]->ToString()->WriteAscii(key); GVariant* variant; const GVariantType* type; - + variant = g_settings_get_value(settings,key); type = g_variant_get_type(variant); @@ -85,7 +90,7 @@ Handle set_gsetting(const Arguments& args) { args[0]->ToString()->WriteAscii(schema); settings = g_settings_new(schema); args[1]->ToString()->WriteAscii(key); - if (args[2]->IsBoolean()) { + if (args[2]->IsBoolean()) { status = g_settings_set_boolean(settings,key,args[2]->BooleanValue()); } else if (args[2]->IsNumber()) { diff --git a/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js b/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js index 4b1d9c0..de220e5 100644 --- a/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js +++ b/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js @@ -1,14 +1,18 @@ -/*! -GPII Node.js GSettings Bridge - -Copyright 2012 Steven Githens - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ +/* + * GPII Node.js GSettings Bridge + * + * Copyright 2012 Steven Githens + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ var util = require('util'); var assert = require('assert'); @@ -81,9 +85,9 @@ var testStuff = function() { util.puts("Ok: " + keys[i]); } util.puts("Done Testing Stuff"); -} +} -testStuff(); +testStuff(); /* Run test functions */ testBooleanValues(); diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/node_modules/gsettingsBridge/tests/gsettingsTests.js index 6c0670d..e78ab25 100644 --- a/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -1,14 +1,18 @@ -/*! -XML Settings Handler Tests - -Copyright 2012 Raising the Floor - International - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ +/* + * XML Settings Handler Tests + * + * Copyright 2012 Raising the Floor - International + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ /*global console, __dirname, setTimeout, require */ diff --git a/node_modules/gsettingsBridge/tests/runUnitTests.sh b/node_modules/gsettingsBridge/tests/runUnitTests.sh index 45bb241..88fc557 100755 --- a/node_modules/gsettingsBridge/tests/runUnitTests.sh +++ b/node_modules/gsettingsBridge/tests/runUnitTests.sh @@ -1,3 +1,17 @@ +# Unit test runner for gsettings bridge +# +# Copyright 2012 Emergya +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# The research leading to these results has received funding from the European Union's +# Seventh Framework Programme (FP7/2007-2013) +# under grant agreement no. 289016. +# +# You may obtain a copy of the License at +# https://github.com/GPII/universal/blob/master/LICENSE.txt + #!/bin/bash LOC="/usr/share/glib-2.0/schemas" diff --git a/node_modules/gsettingsBridge/tests/tests.js b/node_modules/gsettingsBridge/tests/tests.js index 6e01f4f..d40465f 100644 --- a/node_modules/gsettingsBridge/tests/tests.js +++ b/node_modules/gsettingsBridge/tests/tests.js @@ -1,4 +1,20 @@ -var gsettings = require("../gsettings_bridge.js"); +/* + * GPII GSettingsbridge tests + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ + + var gsettings = require("../gsettings_bridge.js"); var util = require("util"); var fs = require('fs'); diff --git a/node_modules/orca/index.js b/node_modules/orca/index.js index 96647cb..8c2cacc 100644 --- a/node_modules/orca/index.js +++ b/node_modules/orca/index.js @@ -1,4 +1,4 @@ -/** +/* * GPII Orca Settings Handler * * Copyright 2013 Emergya @@ -7,8 +7,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * * You may obtain a copy of the License at - * https://github.com/gpii/universal/LICENSE.txt + * https://github.com/GPII/universal/blob/master/LICENSE.txt */ var fluid = require("universal"); diff --git a/node_modules/orca/orcaSettingsHandler.js b/node_modules/orca/orcaSettingsHandler.js index a3667b9..8d9968c 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/node_modules/orca/orcaSettingsHandler.js @@ -1,4 +1,4 @@ -/** +/* * GPII Orca Settings Handler * * Copyright 2013 Emergya @@ -7,8 +7,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * * You may obtain a copy of the License at - * https://github.com/gpii/universal/LICENSE.txt + * https://github.com/GPII/universal/blob/master/LICENSE.txt */ (function () { @@ -43,7 +47,7 @@ // which main key equals to the profile's id. As we need to retrieve a // specific profile under 'profiles' section, we need to get the second // value (the id) from the array. - // + // var PROFILE_ID = 1; fluid.registerNamespace("gpii.launch"); diff --git a/node_modules/orca/test/orcaSettingsHandlerTests.js b/node_modules/orca/test/orcaSettingsHandlerTests.js index 905bbca..4a18209 100644 --- a/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -1,14 +1,18 @@ /* -Orca Settings Handler Tests - -Copyright 2013 Emergya - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ + * Orca Settings Handler Tests + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"), diff --git a/node_modules/xrandr/index.js b/node_modules/xrandr/index.js index ab7f722..b8d9c41 100644 --- a/node_modules/xrandr/index.js +++ b/node_modules/xrandr/index.js @@ -1,14 +1,18 @@ -/*! -GPII Node.js Xrandr Bridge - -Copyright 2013 Emergya - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ +/* + * GPII Node.js Xrandr Bridge + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ var fluid = require("universal"); diff --git a/node_modules/xrandr/nodexrandr/nodexrandr.cc b/node_modules/xrandr/nodexrandr/nodexrandr.cc index daff26b..39bd470 100644 --- a/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -1,3 +1,19 @@ +/* + * GPII Xrandr Bridge Tests + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ + #include #include diff --git a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index ef8abb5..52777f9 100644 --- a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -1,14 +1,18 @@ /* -GPII Xrandr Bridge Tests - -Copyright 2013 Emergya - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ + * GPII Xrandr Bridge Tests + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ var fluid = require("universal"), jqUnit = fluid.require("jqUnit"), @@ -46,7 +50,7 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { // Restore brightness to its previous value // xrandr.setBrightness(brightness); - + jqUnit.assertDeepEq("Brightness is restored to its previous value", xrandr.getBrightness().value, brightness); diff --git a/node_modules/xrandr/test/xrandrSettingsHandlerTests.js b/node_modules/xrandr/test/xrandrSettingsHandlerTests.js index be0bc88..bf82ca2 100644 --- a/node_modules/xrandr/test/xrandrSettingsHandlerTests.js +++ b/node_modules/xrandr/test/xrandrSettingsHandlerTests.js @@ -1,14 +1,18 @@ /* -GPII Xrandr Settings Handler Tests - -Copyright 2013 Emergya - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ + * GPII Xrandr Settings Handler Tests + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"), diff --git a/node_modules/xrandr/xrandr_bridge.js b/node_modules/xrandr/xrandr_bridge.js index eedd0f0..0e39947 100644 --- a/node_modules/xrandr/xrandr_bridge.js +++ b/node_modules/xrandr/xrandr_bridge.js @@ -1,14 +1,18 @@ -/*! -GPII Node.js Xrandr Bridge - -Copyright 2013 Emergya - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ +/* + * GPII Node.js Xrandr Bridge + * + * Copyright 2013 Emergya + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ (function () { "use strict"; diff --git a/start.sh b/start.sh index 22871e4..eaacfba 100755 --- a/start.sh +++ b/start.sh @@ -7,8 +7,12 @@ # Licensed under the New BSD license. You may not use this file except in # compliance with this License. # +# The research leading to these results has received funding from the European Union's +# Seventh Framework Programme (FP7/2007-2013) +# under grant agreement no. 289016. +# # You may obtain a copy of the License at -# https://github.com/gpii/universal/LICENSE.txt +# https://github.com/GPII/universal/blob/master/LICENSE.txt fileName="gpii.js" diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index 0b24853..4786872 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -1,15 +1,18 @@ /* - -GPII acceptance Testing - -Copyright 2013 Raising the Floor International - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt -*/ + * GPII acceptance Testing + * + * Copyright 2013 Raising the Floor International + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ /*global __dirname, require*/ diff --git a/usbDriveListener/bin/handleUserDeviceEvent.sh b/usbDriveListener/bin/handleUserDeviceEvent.sh index 79a6ba1..e79a06b 100755 --- a/usbDriveListener/bin/handleUserDeviceEvent.sh +++ b/usbDriveListener/bin/handleUserDeviceEvent.sh @@ -7,8 +7,13 @@ # Licensed under the New BSD license. You may not use this file except in # compliance with this License. # +# The research leading to these results has received funding from the European Union's +# Seventh Framework Programme (FP7/2007-2013) +# under grant agreement no. 289016. +# # You may obtain a copy of the License at -# https://github.com/gpii/universal/LICENSE.txt +# https://github.com/GPII/universal/blob/master/LICENSE.txt + usersFilePath="/var/lib/gpii/users.txt" logFilePath="/var/lib/gpii/log.txt" diff --git a/usbDriveListener/bin/trigger.sh b/usbDriveListener/bin/trigger.sh index 863e477..cb0ca77 100755 --- a/usbDriveListener/bin/trigger.sh +++ b/usbDriveListener/bin/trigger.sh @@ -7,8 +7,12 @@ # Licensed under the New BSD license. You may not use this file except in # compliance with this License. # +# The research leading to these results has received funding from the European Union's +# Seventh Framework Programme (FP7/2007-2013) +# under grant agreement no. 289016. +# # You may obtain a copy of the License at -# https://github.com/gpii/universal/LICENSE.txt +# https://github.com/GPII/universal/blob/master/LICENSE.txt # This is a workaround for correct udev script execution. # There should be a way to avoid using a intermediate file. From c5fae6e9aac8da4fc8b852907d789347d456e147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 2 Jul 2014 16:15:36 +0200 Subject: [PATCH 176/319] Replacing wrong assertFalses with assertNotEquals --- node_modules/packagekit/nodepackagekit/nodepackagekit_test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 5857462..c3786bf 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -93,7 +93,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { console.log ("Testing installPackage() -- installing tuxguitar"); pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); - jqUnit.assertFalse ("No package tuxguitar available; cannot install", + jqUnit.assertNotEquals ("No package tuxguitar available; cannot install", 0, pkgs.length); packagekit.performAction('install', pkgs[0].id); @@ -110,7 +110,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { packagekit.performAction('remove', pkgs[0].id); pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); - jqUnit.assertFalse ("Failed to remove tuxguitar package", 0, pkgs.length); + jqUnit.assertNotEquals ("Failed to remove tuxguitar package", 0, pkgs.length); // *** getPackages() tests *** From 76def8c4ef6fe5b5fa671f6285536f440770a428 Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Fri, 11 Jul 2014 21:03:45 +0100 Subject: [PATCH 177/319] GPII-88: Linting and fixes to README --- Gruntfile.js | 20 ++++++++++---------- README.md | 2 +- package.json | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 23563a3..6b06e1b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,7 +1,7 @@ /*! GPII Linux Personalization Framework Node.js Bootstrap -Copyright 2014 RFT-US +Copyright 2014 RTF-US Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -13,7 +13,7 @@ https://github.com/gpii/universal/LICENSE.txt module.exports = function(grunt) { var usbListenerDir = "./usbDriveListener"; - function nodeGypCompileShell(dir) { + function nodeGypCompileShell (dir) { return { options: { stdout: true, @@ -26,9 +26,9 @@ module.exports = function(grunt) { return "node-gyp configure build"; } }; - }; + } - function nodeGypCleanShell(dir) { + function nodeGypCleanShell (dir) { return { options: { stdout: true, @@ -41,7 +41,7 @@ module.exports = function(grunt) { return "node-gyp clean"; } }; - }; + } grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), @@ -89,7 +89,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks("grunt-gpii"); - grunt.registerTask("build", "Build the entire GPII", function() { + grunt.registerTask("build", "Build the entire GPII", function () { grunt.task.run("gpiiUniversal"); grunt.task.run("shell:compileGSettings"); grunt.task.run("shell:compileAlsaBridge"); @@ -97,22 +97,22 @@ module.exports = function(grunt) { grunt.task.run("shell:installUsbLib"); }); - grunt.registerTask("clean", "Clean the GPII binaries and uninstall", function() { + grunt.registerTask("clean", "Clean the GPII binaries and uninstall", function () { grunt.task.run("shell:cleanGSettings"); grunt.task.run("shell:cleanAlsaBridge"); grunt.task.run("shell:cleanXrandrBridge"); grunt.task.run("shell:uninstallUsbLib"); }); - grunt.registerTask("start", "Start the GPII", function() { + grunt.registerTask("start", "Start the GPII", function () { grunt.task.run("shell:startGpii"); }); - grunt.registerTask("install", "Install system level GPII Components", function() { + grunt.registerTask("install", "Install system level GPII Components", function () { grunt.task.run("shell:installUsbLib"); }); - grunt.registerTask("uninstall", "Uninstall system level GPII Components", function() { + grunt.registerTask("uninstall", "Uninstall system level GPII Components", function () { grunt.task.run("shell:uninstallUsbLib"); }); }; diff --git a/README.md b/README.md index 3d84eb2..8d18d80 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ have grunt installed yet you can do so with: To fetch our core universal dependencies and build the linux specific plugins run - + npm install grunt build Because the history of the universal repository is quite large, it can take a diff --git a/package.json b/package.json index 29b8a59..b0ffc7d 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "gpii-linux", - "description": "Components of the GPII personalization infrastructure for use on linux", + "description": "Components of the GPII personalization infrastructure for use on Linux", "version": "0.0.1", "author": "GPII", - "bugs": "http://wiki.gpii.net/index.php/Main_Page", + "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", "dependencies": {}, "devDependencies": { @@ -30,6 +30,6 @@ "repository": "git://github.com/GPII/linux.git", "main": "./gpii/index.js", "engines": { - "node": ">=0.1.9" + "node": ">=0.6.0" } } From f886121766e5a0c153540a0a9eebf9983adfe612 Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Fri, 11 Jul 2014 21:07:16 +0100 Subject: [PATCH 178/319] Removed spurious "linux" submodule --- node_modules/linux/index.js | 5 ----- node_modules/linux/package.json | 19 ------------------- node_modules/linux/src/gpii.linux.js | 14 -------------- 3 files changed, 38 deletions(-) delete mode 100644 node_modules/linux/index.js delete mode 100644 node_modules/linux/package.json delete mode 100644 node_modules/linux/src/gpii.linux.js diff --git a/node_modules/linux/index.js b/node_modules/linux/index.js deleted file mode 100644 index 840acd1..0000000 --- a/node_modules/linux/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var fluid = require("universal"); - -var loader = fluid.getLoader(__dirname); - -loader.require("./src/gpii.linux.js"); \ No newline at end of file diff --git a/node_modules/linux/package.json b/node_modules/linux/package.json deleted file mode 100644 index 5cace75..0000000 --- a/node_modules/linux/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "linux", - "description": "Linux specific launch handlers and settings handlers.", - "version": "0.1.0", - "author": "GPII", - "bugs": "http://wiki.gpii.net/index.php/Main_Page", - "homepage": "http://gpii.net/", - "dependencies": {}, - "licenses": [ - { - "type": "BSD-3-Clause", - "url": "http://www.opensource.org/licenses/BSD-3-Clause" - } - ], - "keywords": ["gpii", "accessibility", "settings", "fluid", "IoC", "Inversion of Control", "configuration", "evented"], - "repository": "git://github.com:GPII/linux.git", - "main": "./index.js", - "engines": { "node" : ">=0.1.9" } -} diff --git a/node_modules/linux/src/gpii.linux.js b/node_modules/linux/src/gpii.linux.js deleted file mode 100644 index 5b44655..0000000 --- a/node_modules/linux/src/gpii.linux.js +++ /dev/null @@ -1,14 +0,0 @@ -(function () { - - "use strict"; - - var fluid = require("universal"); - var gpii = fluid.registerNamespace("gpii"); - - fluid.registerNamespace("gpii.launch"); - - gpii.launch.gsettings = function () { - fluid.log("Success"); - }; - -})(); \ No newline at end of file From 90e17d38be8ce0e6a7dbc8c971c753aac5bba245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 15 Jul 2014 19:06:32 +0200 Subject: [PATCH 179/319] Keep the global state of the system unchanged after running the tests --- .../test/packageKitDeviceReporterTests.js | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/node_modules/packagekit/test/packageKitDeviceReporterTests.js b/node_modules/packagekit/test/packageKitDeviceReporterTests.js index 435be54..3bb3e63 100644 --- a/node_modules/packagekit/test/packageKitDeviceReporterTests.js +++ b/node_modules/packagekit/test/packageKitDeviceReporterTests.js @@ -15,26 +15,32 @@ var fluid = require("universal"), jqUnit = fluid.require("jqUnit"); require("packagekit"); -packageKit = fluid.registerNamespace("gpii.packageKit"); +fluid.registerNamespace("gpii.packageKit"); -jqUnit.module("GPII PackageKit Device Reporter"); +jqUnit.module("GPII PackageKit Device Reporter", { + setup: function() { + // mock-up of installedPackagesCache + // + gpii.packageKit.installedPackagesCache = [ + { + "id": "foo_id", + "name": "foo", + "version": "foo_version", + "data": "installed" + } + ]; + }, + teardown: function() { + gpii.packageKit.installedPackagesCache = gpii.packageKit.get("installed;~devel"); + } +}); jqUnit.test("Running tests for PackageKit Device Reporter", function () { jqUnit.expect(2); - // mock-up of installedPackagesCache - // - gpii.packageKit.installedPackagesCache = [ - { - "id": "foo_id", - "name": "foo", - "version": "foo_version", - "data": "installed" - } - ] - jqUnit.assertTrue("Check the availability of 'foo' through 'find' method", gpii.packageKit.find("foo")); jqUnit.assertFalse("Look for 'fooo' package", gpii.packageKit.find("fooo")); }); + From 204e9fe39c591d9a70da53583f150ae359501ecd Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 15 Jul 2014 16:44:45 -0400 Subject: [PATCH 180/319] Made tests conditional on the installed status of tuxguitar. Reworked the tests to check whether tuxguitar is installed. Based on that check, did not run tests that depend on it being installed, and printed a message on the console advertising that fact. Added back the updatePackage() test since that check was already being made. --- .../nodepackagekit/nodepackagekit_test.js | 168 ++++++++++-------- 1 file changed, 92 insertions(+), 76 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index c3786bf..c605218 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -22,6 +22,8 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // *** searchPackage() tests *** + // Test whether tuxguitar is installed OR available, using implicit and + // explicit 'none' filter. console.log ("Testing searchPackage() for 'tuxguitar' with implicit 'none' " + "filter, meaning installed or available"); var pkgs = packagekit.searchPackage ('tuxguitar'); @@ -41,38 +43,42 @@ jqUnit.test ("Testing PackageKit Bridge", function() { pkgs[0].id + " instead", -1, name); - console.log ("Checking that tuxguitar package is not installed"); - pkgs = packagekit.searchPackage ('tuxguitar'); - jqUnit.assertNotEquals ("No package for tuxguitar found", 0, pkgs.length); - - // TODO: This tests that tuxguitar is not installed, but it's not really - // an error if it's there. For now, manually remove tuxguitar - // before running tests. - var notInstalled = pkgs[0].data.indexOf ('installed'); - jqUnit.assertEquals ("Package tuxguitar is installed, data property is: '" + - pkgs[0].data + "'", - -1, notInstalled); + // Assumption: tuxguitar is not installed. + // If it is installed, don't run the test (it will fail), but say so on the + // console, and recommend that it be removed manually before running tests. + if (pkgs[0].data.indexOf ('installed') != -1) { + console.log ("Package 'tuxguitar' is installed; will not run test that it is not installed --"); + console.log ("Please manually remove tuxguitar to run this test."); + } + else { + console.log ("Testing that tuxguitar package is not installed"); + pkgs = packagekit.searchPackage ('tuxguitar'); + jqUnit.assertNotEquals ("No package for tuxguitar found", 0, pkgs.length); + + var notInstalled = pkgs[0].data.indexOf ('installed'); + jqUnit.assertEquals ("Package tuxguitar is installed, data property is: '" + + pkgs[0].data + "'", + -1, notInstalled); - // Use "~installed" filter to check that tuxguitar is not installed. Then - // use the "installed" filter. In the former case, the size of the - // returned array of package ids should be one, and, in the latter, should - // be zero. - pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); - jqUnit.assertNotEquals ("Package tuxguitar is installed, " + - "size of package id list is not one: '" + - pkgs.length, - 0, pkgs.length); + // Use "~installed" filter to check that tuxguitar is not installed. Then + // use the "installed" filter. In the former case, the size of the + // returned array of package ids should be one, and, in the latter, should + // be zero. + pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); + jqUnit.assertNotEquals ("Package tuxguitar is installed, " + + "size of package id list is not one: '" + + pkgs.length, + 0, pkgs.length); - pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); - jqUnit.assertEquals ("Package tuxguitar is not installed, " + - "size of package id list is not zero: '" + - pkgs.length, - 0, pkgs.length); + pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); + jqUnit.assertEquals ("Package tuxguitar is not installed, " + + "size of package id list is not zero: '" + + pkgs.length, + 0, pkgs.length); + } // *** searchFiles() test *** - console.log ("Testing searchFiles() for '/usr/bin/tuxguitar'"); - // The searchFiles() function expects the full path name where the package // would be installed, even it if is not installed. The presumed use of // searchFiles() is after a prior "find" shell command that has found the @@ -81,6 +87,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // searchFiles() in order to get the full package information, including the // version number. If "find" did *not* return anything (an empty path), // then use the searchPackage() function instead. + console.log ("Testing searchFiles() for '/usr/bin/tuxguitar'"); pkgs = packagekit.searchFiles ('/usr/bin/tuxguitar'); jqUnit.assertNotEquals ("No package for tuxguitar was found during search", 0, pkgs.length); @@ -89,21 +96,24 @@ jqUnit.test ("Testing PackageKit Bridge", function() { pkgs[0].id + " instead", -1, name); - // *** installPackage() tests *** - - console.log ("Testing installPackage() -- installing tuxguitar"); - pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); - jqUnit.assertNotEquals ("No package tuxguitar available; cannot install", - 0, pkgs.length); - - packagekit.performAction('install', pkgs[0].id); - pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); - jqUnit.assertEquals ("Failure installing package tuxguitar, ", - 1, pkgs.length); + // *** performAction() tests *** - // *** removePackage() tests *** + // Assumption: tuxguitar is not installed. + // If it is installed, don't run the test (it will fail), but say so on the + // console, and recommend that it be removed manually before running tests. + if (pkgs[0].data.indexOf ('installed') != -1) { + console.log ("Package 'tuxguitar' is installed; will not run test for installing it --"); + console.log ("Please manually remove tuxguitar to run this test."); + } + else { + console.log ("Testing performAction ('install') -- install tuxguitar"); + packagekit.performAction('install', pkgs[0].id); + pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); + jqUnit.assertEquals ("Failure installing package tuxguitar, ", + 1, pkgs.length); + } - console.log ("Testing removePackage() -- removing tuxguitar"); + console.log ("Testing performAction('remove') -- removing tuxguitar"); pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); jqUnit.assertEquals ("No package tuxguitar installed; cannot remove", 1, pkgs.length); @@ -114,11 +124,10 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // *** getPackages() tests *** - // Assuming 'tuxguitar' was removed (just above), use getPackages() to - // retrieve a list of the 'installed' packages. The tuxguitar package - // should not appear in this list. - console.log ("Testing getPackages() of installed and not-installed packages"); + console.log ("Testing getPackages() comparing tuxguitar against installed and available packages"); + pkgs = packagekit.searchPackage ('tuxguitar'); var tuxguitarPkg = pkgs[0]; + var installedPkgs = packagekit.getPackages ('installed'); var installedIndex = -1; for (var i = 0; i < installedPkgs.length; i++) { @@ -127,46 +136,53 @@ jqUnit.test ("Testing PackageKit Bridge", function() { break; } } - jqUnit.assertEquals ("Found tuxguitar in installed packages", -1, installedIndex); - - // Use getPackages() to retrieve a list of the '~installed' packages. The - // The tuxguitar package should appear in this list. var availablePkgs = packagekit.getPackages ('~installed'); var availableIndex = -1; - for (i = 0; i < availablePkgs.length; i++) { + for (var i = 0; i < availablePkgs.length; i++) { if (availablePkgs[i].name === tuxguitarPkg.name) { availableIndex = i; break; } } - jqUnit.assertNotEquals ("Did not find tuxguitar in available packages", -1, availableIndex); + + // Depending on whether tuxguitar is installed on not, check that it appears + // correctly in the installed or available lists. + if (tuxguitarPkg.data.indexOf ('installed') != -1) { + jqUnit.assertNotEquals ("Did not find tuxguitar in installed packages", -1, installedIndex); + jqUnit.assertEquals ("Found tuxguitar in the available packages", -1, availableIndex); + } + else { + jqUnit.assertEquals ("Found tuxguitar in installed packages", -1, installedIndex); + jqUnit.assertNotEquals ("Did not find tuxguitar in the available packages", -1, availableIndex); + } // *** updatePackage() tests *** - // TODO: Needs to be re-added - -// console.log ("Testing updatePackage() with 'emacspeak'"); -// -// // The package ids of an old and newer version of 'emacspeak'. -// // TODO: JS: While the following check against two version of -// // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, -// // the check that searchPackage() finds the two versions. If so, the test is -// // run; otherwise no test is run. Need to find a better way to find -// // multiple versions of a package to test against. -// var oldEmacspeak = '38.0-5.fc20'; -// var newEmacspeak = '39.0-1.fc20'; -// pkgs = packagekit.searchPackage ('emacspseak'); -// if (pkgs.length === 2) { -// if (pkgs[0].version == oldEmacspeak && pkg[1].version == newEmacspeak && -// pkgs[1].data.indexOf('updates') != -1) { -// -// packagekit.updatePackage (pkgs[1].id); -// var currentPkgs = packagekit.searchPackage ('emacspseak', 'installed'); -// jqUnit.assertEquals ("Failed to update to " + newEmacspeak, -// currentPkgs[0].version, newEmacspeak); -// -// // Restore to previous. -// packagekit.removePackage (currentPkgs[0].id); -// } -// } + + console.log ("Testing updatePackage() with 'emacspeak'"); + + // The package ids of an old and newer version of 'emacspeak'. + // TODO: JS: While the following check against two version of + // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, + // the check that searchPackage() finds the two versions. If so, the test is + // run; otherwise no test is run. Need to find a better way to find + // multiple versions of a package to test against. + var oldEmacspeak = '38.0-5.fc20'; + var newEmacspeak = '39.0-1.fc20'; + pkgs = packagekit.searchPackage ('emacspseak'); + if (pkgs.length === 2 && + (pkgs[0].version === oldEmacspeak && pkg[1].version === newEmacspeak && + pkgs[1].data.indexOf('updates') != -1)) { + + packagekit.updatePackage (pkgs[1].id); + var currentPkgs = packagekit.searchPackage ('emacspseak', 'installed'); + jqUnit.assertEquals ("Failed to update to " + newEmacspeak, + currentPkgs[0].version, newEmacspeak); + + // Restore to previous. + packagekit.removePackage (currentPkgs[0].id); + } + else { + console.log ("Cannot test update of emacspeak since there are no updates"); + } }); From 2d35544e223c9760aba80c918a11a9e80ded44bc Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 16 Jul 2014 10:37:03 -0400 Subject: [PATCH 181/319] Made tests conditional on the installed status of tuxguitar (II). Checked that tuxguitar is in fact installed prior to running the 'remove' test. If not installed, prints a message on the console to that effect, and does not run the 'remove' test. --- .../nodepackagekit/nodepackagekit_test.js | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index c605218..4fcee82 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -20,6 +20,10 @@ jqUnit.module ('PackageKit Bridge node add-on module'); jqUnit.test ("Testing PackageKit Bridge", function() { + function isInstalled(pkg) { + return pkg.data.indexOf ('installed') != -1; + } + // *** searchPackage() tests *** // Test whether tuxguitar is installed OR available, using implicit and @@ -46,7 +50,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // Assumption: tuxguitar is not installed. // If it is installed, don't run the test (it will fail), but say so on the // console, and recommend that it be removed manually before running tests. - if (pkgs[0].data.indexOf ('installed') != -1) { + if (isInstalled (pkgs[0])) { console.log ("Package 'tuxguitar' is installed; will not run test that it is not installed --"); console.log ("Please manually remove tuxguitar to run this test."); } @@ -101,7 +105,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // Assumption: tuxguitar is not installed. // If it is installed, don't run the test (it will fail), but say so on the // console, and recommend that it be removed manually before running tests. - if (pkgs[0].data.indexOf ('installed') != -1) { + if (isInstalled (pkgs[0])) { console.log ("Package 'tuxguitar' is installed; will not run test for installing it --"); console.log ("Please manually remove tuxguitar to run this test."); } @@ -113,14 +117,24 @@ jqUnit.test ("Testing PackageKit Bridge", function() { 1, pkgs.length); } - console.log ("Testing performAction('remove') -- removing tuxguitar"); - pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); - jqUnit.assertEquals ("No package tuxguitar installed; cannot remove", - 1, pkgs.length); + // Assumption: tuxguitar is installed. + // If it is not installed, don't run the 'remove' test (it will fail), but + // say so on the console. - packagekit.performAction('remove', pkgs[0].id); - pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); - jqUnit.assertNotEquals ("Failed to remove tuxguitar package", 0, pkgs.length); + if (!isInstalled (pkgs[0])) { + console.log ("Package 'tuxguitar' is not installed; will not run test for removing it -- "); + console.log ("The 'install' test must have failed"); + } + else { + console.log ("Testing performAction('remove') -- removing tuxguitar"); + pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); + jqUnit.assertEquals ("No package tuxguitar installed; cannot remove", + 1, pkgs.length); + + packagekit.performAction('remove', pkgs[0].id); + pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); + jqUnit.assertNotEquals ("Failed to remove tuxguitar package", 0, pkgs.length); + } // *** getPackages() tests *** @@ -147,7 +161,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // Depending on whether tuxguitar is installed on not, check that it appears // correctly in the installed or available lists. - if (tuxguitarPkg.data.indexOf ('installed') != -1) { + if (isInstalled (tuxguitarPkg)) { jqUnit.assertNotEquals ("Did not find tuxguitar in installed packages", -1, installedIndex); jqUnit.assertEquals ("Found tuxguitar in the available packages", -1, availableIndex); } From 34a7860973fe730d0bdde56a7451e9651c7960a4 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 16 Jul 2014 16:33:54 -0400 Subject: [PATCH 182/319] Fixed jshint errors. --- .../nodepackagekit/nodepackagekit_test.js | 65 ++++++++++--------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 4fcee82..4a50264 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -12,16 +12,21 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ -var fluid = require ('universal'), - jqUnit = fluid.require ('jqUnit'), - packagekit = require('./build/Release/nodepackagekit.node'); +/*global require, console*/ +/*jshint globalstrict: true */ -jqUnit.module ('PackageKit Bridge node add-on module'); +"use strict"; + +var fluid = require ("universal"), + jqUnit = fluid.require ("jqUnit"), + packagekit = require("./build/Release/nodepackagekit.node"); + +jqUnit.module ("PackageKit Bridge node add-on module"); jqUnit.test ("Testing PackageKit Bridge", function() { function isInstalled(pkg) { - return pkg.data.indexOf ('installed') != -1; + return pkg.data.indexOf ("installed") !== -1; } // *** searchPackage() tests *** @@ -30,16 +35,16 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // explicit 'none' filter. console.log ("Testing searchPackage() for 'tuxguitar' with implicit 'none' " + "filter, meaning installed or available"); - var pkgs = packagekit.searchPackage ('tuxguitar'); + var pkgs = packagekit.searchPackage ("tuxguitar"); jqUnit.assertNotEquals ("No package for tuxguitar was found during search", 0, pkgs.length); - var name = pkgs[0].id.indexOf ('tuxguitar'); + var name = pkgs[0].id.indexOf ("tuxguitar"); jqUnit.assertNotEquals ("No tuxguitar package found, found " + pkgs[0].id + " instead", -1, name); console.log ("Testing searchPackage() for 'tuxguitar' with explicit 'none' filter"); - pkgs = packagekit.searchPackage ('tuxguitar', 'none'); + pkgs = packagekit.searchPackage ("tuxguitar", "none"); jqUnit.assertNotEquals ("No package for tuxguitar was found during search", 0, pkgs.length); name = pkgs[0].id.indexOf ("tuxguitar"); @@ -56,10 +61,10 @@ jqUnit.test ("Testing PackageKit Bridge", function() { } else { console.log ("Testing that tuxguitar package is not installed"); - pkgs = packagekit.searchPackage ('tuxguitar'); + pkgs = packagekit.searchPackage ("tuxguitar"); jqUnit.assertNotEquals ("No package for tuxguitar found", 0, pkgs.length); - var notInstalled = pkgs[0].data.indexOf ('installed'); + var notInstalled = pkgs[0].data.indexOf ("installed"); jqUnit.assertEquals ("Package tuxguitar is installed, data property is: '" + pkgs[0].data + "'", -1, notInstalled); @@ -68,15 +73,15 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // use the "installed" filter. In the former case, the size of the // returned array of package ids should be one, and, in the latter, should // be zero. - pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); + pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); jqUnit.assertNotEquals ("Package tuxguitar is installed, " + "size of package id list is not one: '" + pkgs.length, 0, pkgs.length); - pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); + pkgs = packagekit.searchPackage ("tuxguitar", "installed"); jqUnit.assertEquals ("Package tuxguitar is not installed, " + - "size of package id list is not zero: '" + + "size of package id list is not zero: " + pkgs.length, 0, pkgs.length); } @@ -92,10 +97,10 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // version number. If "find" did *not* return anything (an empty path), // then use the searchPackage() function instead. console.log ("Testing searchFiles() for '/usr/bin/tuxguitar'"); - pkgs = packagekit.searchFiles ('/usr/bin/tuxguitar'); + pkgs = packagekit.searchFiles ("/usr/bin/tuxguitar"); jqUnit.assertNotEquals ("No package for tuxguitar was found during search", 0, pkgs.length); - name = pkgs[0].id.indexOf ('tuxguitar'); + name = pkgs[0].id.indexOf ("tuxguitar"); jqUnit.assertNotEquals ("No tuxguitar package found, found " + pkgs[0].id + " instead", -1, name); @@ -111,8 +116,8 @@ jqUnit.test ("Testing PackageKit Bridge", function() { } else { console.log ("Testing performAction ('install') -- install tuxguitar"); - packagekit.performAction('install', pkgs[0].id); - pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); + packagekit.performAction("install", pkgs[0].id); + pkgs = packagekit.searchPackage ("tuxguitar", "installed"); jqUnit.assertEquals ("Failure installing package tuxguitar, ", 1, pkgs.length); } @@ -127,22 +132,22 @@ jqUnit.test ("Testing PackageKit Bridge", function() { } else { console.log ("Testing performAction('remove') -- removing tuxguitar"); - pkgs = packagekit.searchPackage ('tuxguitar', 'installed'); + pkgs = packagekit.searchPackage ("tuxguitar", "installed"); jqUnit.assertEquals ("No package tuxguitar installed; cannot remove", 1, pkgs.length); - packagekit.performAction('remove', pkgs[0].id); - pkgs = packagekit.searchPackage ('tuxguitar', '~installed'); + packagekit.performAction("remove", pkgs[0].id); + pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); jqUnit.assertNotEquals ("Failed to remove tuxguitar package", 0, pkgs.length); } // *** getPackages() tests *** console.log ("Testing getPackages() comparing tuxguitar against installed and available packages"); - pkgs = packagekit.searchPackage ('tuxguitar'); + pkgs = packagekit.searchPackage ("tuxguitar"); var tuxguitarPkg = pkgs[0]; - var installedPkgs = packagekit.getPackages ('installed'); + var installedPkgs = packagekit.getPackages ("installed"); var installedIndex = -1; for (var i = 0; i < installedPkgs.length; i++) { if (installedPkgs[i].name === tuxguitarPkg.name) { @@ -150,9 +155,9 @@ jqUnit.test ("Testing PackageKit Bridge", function() { break; } } - var availablePkgs = packagekit.getPackages ('~installed'); + var availablePkgs = packagekit.getPackages ("~installed"); var availableIndex = -1; - for (var i = 0; i < availablePkgs.length; i++) { + for (i = 0; i < availablePkgs.length; i++) { if (availablePkgs[i].name === tuxguitarPkg.name) { availableIndex = i; break; @@ -180,15 +185,15 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // the check that searchPackage() finds the two versions. If so, the test is // run; otherwise no test is run. Need to find a better way to find // multiple versions of a package to test against. - var oldEmacspeak = '38.0-5.fc20'; - var newEmacspeak = '39.0-1.fc20'; - pkgs = packagekit.searchPackage ('emacspseak'); + var oldEmacspeak = "38.0-5.fc20"; + var newEmacspeak = "39.0-1.fc20"; + pkgs = packagekit.searchPackage ("emacspseak"); if (pkgs.length === 2 && - (pkgs[0].version === oldEmacspeak && pkg[1].version === newEmacspeak && - pkgs[1].data.indexOf('updates') != -1)) { + (pkgs[0].version === oldEmacspeak && pkgs[1].version === newEmacspeak && + pkgs[1].data.indexOf("updates") !== -1)) { packagekit.updatePackage (pkgs[1].id); - var currentPkgs = packagekit.searchPackage ('emacspseak', 'installed'); + var currentPkgs = packagekit.searchPackage ("emacspseak", "installed"); jqUnit.assertEquals ("Failed to update to " + newEmacspeak, currentPkgs[0].version, newEmacspeak); From 295d6f067cb6e08183155fb7226cc59cfc8ee492 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 22 Jul 2014 12:48:04 -0400 Subject: [PATCH 183/319] Tests require fewer assumptions about initial conditions. Used 'glib2' for searchPackage() test and '/usr/bin/ls' for searchFiles() test since they exist and are installed. Modified searchPackage() "installed" vs. "~installed" tests basing them on whether tuxguitar is installed or not. Rearranged and general cleanup. --- .../nodepackagekit/nodepackagekit_test.js | 226 +++++++++--------- 1 file changed, 113 insertions(+), 113 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 4a50264..63061a3 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -25,98 +25,130 @@ jqUnit.module ("PackageKit Bridge node add-on module"); jqUnit.test ("Testing PackageKit Bridge", function() { - function isInstalled(pkg) { - return pkg.data.indexOf ("installed") !== -1; + function isInstalled (pkg) { + return (!!pkg && (pkg.data.indexOf ("installed") !== -1)); } - // *** searchPackage() tests *** + function findGlib2 (aPkg) { + return aPkg.name === "glib2"; + } + + function findNamedPackage (name, pkgArray) { + var thePkg = null; + pkgArray.some (function (aPkg) { + if (aPkg.name === name) { + thePkg = aPkg; + return true; + } + else { + return false; + } + }); + return thePkg; + } + + // *** searchPackage() tests implicit and explicit 'none' filter *** - // Test whether tuxguitar is installed OR available, using implicit and - // explicit 'none' filter. - console.log ("Testing searchPackage() for 'tuxguitar' with implicit 'none' " + - "filter, meaning installed or available"); - var pkgs = packagekit.searchPackage ("tuxguitar"); - jqUnit.assertNotEquals ("No package for tuxguitar was found during search", + // Test whether glib2 is installed OR available, using implicit and + // explicit 'none' filter. Packagekit-glib -- the code this add-on + // invokes -- itself depends on glib2. It must be installed, if this is + // running. + console.log ("Testing searchPackage() of 'glib2' with implicit 'none' " + + "filter, meaning installed or available."); + var pkgs = packagekit.searchPackage ("glib2"); + jqUnit.assertNotEquals ("No package for glib2 was found during search", 0, pkgs.length); - var name = pkgs[0].id.indexOf ("tuxguitar"); - jqUnit.assertNotEquals ("No tuxguitar package found, found " + - pkgs[0].id + " instead", - -1, name); - - console.log ("Testing searchPackage() for 'tuxguitar' with explicit 'none' filter"); - pkgs = packagekit.searchPackage ("tuxguitar", "none"); - jqUnit.assertNotEquals ("No package for tuxguitar was found during search", + var found = pkgs.some (findGlib2); + jqUnit.assertTrue ("No package 'glib2' found", found); + + console.log ("Testing searchPackage() of 'glib2', explicit 'none' filter."); + pkgs = packagekit.searchPackage ("glib2", "none"); + jqUnit.assertNotEquals ("No package for glib2 was found during search", 0, pkgs.length); - name = pkgs[0].id.indexOf ("tuxguitar"); - jqUnit.assertNotEquals ("No tuxguitar package found, found " + - pkgs[0].id + " instead", - -1, name); + found = pkgs.some (findGlib2); + jqUnit.assertTrue ("No package 'glib2' found", found); - // Assumption: tuxguitar is not installed. - // If it is installed, don't run the test (it will fail), but say so on the - // console, and recommend that it be removed manually before running tests. - if (isInstalled (pkgs[0])) { - console.log ("Package 'tuxguitar' is installed; will not run test that it is not installed --"); - console.log ("Please manually remove tuxguitar to run this test."); + // *** searchFiles() test *** + + // The searchFiles() function expects the full path name where the package + // would be installed, even it if is not installed. Check using the common + // utility 'ls'. + console.log ("Testing searchFiles() for '/usr/bin/ls'."); + pkgs = packagekit.searchFiles ("/usr/bin/ls"); + jqUnit.assertNotEquals ("No package for 'ls' was found during search", + 0, pkgs.length); + + // *** searchPackage() tests with "installed" and "~installed" filters *** + + // Test the "installed" vs. "~installed" filters with regards to 'tuxguitar', + // and the array of packages returned by searchPackage() using the filters. + console.log ("Testing searchPackage() with 'tuxguitar' comparing " + + "installed vs. available filters."); + + // Get the tuxguitar package, whether installed or not. + pkgs = packagekit.searchPackage ("tuxguitar"); + var tuxguitarPkg = findNamedPackage ("tuxguitar", pkgs); + + var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); + var installed = (findNamedPackage ("tuxguitar", installedPkgs) !== null); + + var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); + var available = (findNamedPackage ("tuxguitar", availablePkgs) !== null); + + // Depending on whether tuxguitar is installed on not, check that it appears + // correctly in the installed or available lists. + if (isInstalled (tuxguitarPkg)) { + jqUnit.assertTrue ("Did not find tuxguitar in installed packages", + installed); + jqUnit.assertFalse ("Found tuxguitar in available packages", + available); } else { - console.log ("Testing that tuxguitar package is not installed"); - pkgs = packagekit.searchPackage ("tuxguitar"); - jqUnit.assertNotEquals ("No package for tuxguitar found", 0, pkgs.length); - - var notInstalled = pkgs[0].data.indexOf ("installed"); - jqUnit.assertEquals ("Package tuxguitar is installed, data property is: '" + - pkgs[0].data + "'", - -1, notInstalled); - - // Use "~installed" filter to check that tuxguitar is not installed. Then - // use the "installed" filter. In the former case, the size of the - // returned array of package ids should be one, and, in the latter, should - // be zero. - pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - jqUnit.assertNotEquals ("Package tuxguitar is installed, " + - "size of package id list is not one: '" + - pkgs.length, - 0, pkgs.length); - - pkgs = packagekit.searchPackage ("tuxguitar", "installed"); - jqUnit.assertEquals ("Package tuxguitar is not installed, " + - "size of package id list is not zero: " + - pkgs.length, - 0, pkgs.length); + jqUnit.assertFalse ("Found tuxguitar in installed packages", + installed); + jqUnit.assertTrue ("Did not find tuxguitar in available packages", + available); } - // *** searchFiles() test *** + // *** getPackages() tests *** + console.log ("Testing getPackages() with tuxguitar comparing " + + "installed vs. available filters."); + console.log (" Note: this will take some time."); - // The searchFiles() function expects the full path name where the package - // would be installed, even it if is not installed. The presumed use of - // searchFiles() is after a prior "find" shell command that has found the - // file on the system and returns the path where it was found. Even so, - // "find" does not return the version number. Pass the path to - // searchFiles() in order to get the full package information, including the - // version number. If "find" did *not* return anything (an empty path), - // then use the searchPackage() function instead. - console.log ("Testing searchFiles() for '/usr/bin/tuxguitar'"); - pkgs = packagekit.searchFiles ("/usr/bin/tuxguitar"); - jqUnit.assertNotEquals ("No package for tuxguitar was found during search", - 0, pkgs.length); - name = pkgs[0].id.indexOf ("tuxguitar"); - jqUnit.assertNotEquals ("No tuxguitar package found, found " + - pkgs[0].id + " instead", - -1, name); + installedPkgs = packagekit.getPackages ("installed"); + installed = (findNamedPackage ("tuxguitar", installedPkgs) !== null); + + availablePkgs = packagekit.getPackages ("~installed"); + available = (findNamedPackage ("tuxguitar", availablePkgs) !== null); + + // Depending on whether tuxguitar is installed on not, check that it appears + // correctly in the installed or available lists. + if (isInstalled (tuxguitarPkg)) { + jqUnit.assertTrue ("Did not find tuxguitar in installed packages", + installed); + jqUnit.assertFalse ("Found tuxguitar in available packages", + available); + } + else { + jqUnit.assertFalse ("Found tuxguitar in installed packages", + installed); + jqUnit.assertTrue ("Did not find tuxguitar in available packages", + available); + } // *** performAction() tests *** // Assumption: tuxguitar is not installed. // If it is installed, don't run the test (it will fail), but say so on the // console, and recommend that it be removed manually before running tests. - if (isInstalled (pkgs[0])) { - console.log ("Package 'tuxguitar' is installed; will not run test for installing it --"); + if (isInstalled (tuxguitarPkg)) { + console.log ("Package 'tuxguitar' is installed; will not run test for " + + "installing it --"); console.log ("Please manually remove tuxguitar to run this test."); } else { console.log ("Testing performAction ('install') -- install tuxguitar"); - packagekit.performAction("install", pkgs[0].id); + packagekit.performAction("install", tuxguitarPkg.id); pkgs = packagekit.searchPackage ("tuxguitar", "installed"); jqUnit.assertEquals ("Failure installing package tuxguitar, ", 1, pkgs.length); @@ -125,54 +157,23 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // Assumption: tuxguitar is installed. // If it is not installed, don't run the 'remove' test (it will fail), but // say so on the console. - - if (!isInstalled (pkgs[0])) { - console.log ("Package 'tuxguitar' is not installed; will not run test for removing it -- "); + pkgs = packagekit.searchPackage ("tuxguitar"); + tuxguitarPkg = pkgs[0]; + if (!isInstalled (tuxguitarPkg)) { + console.log ("Package 'tuxguitar' is not installed; will not run test " + + "for removing it -- "); console.log ("The 'install' test must have failed"); } else { - console.log ("Testing performAction('remove') -- removing tuxguitar"); + console.log ("Testing performAction ('remove') -- removing tuxguitar"); pkgs = packagekit.searchPackage ("tuxguitar", "installed"); jqUnit.assertEquals ("No package tuxguitar installed; cannot remove", 1, pkgs.length); - packagekit.performAction("remove", pkgs[0].id); + packagekit.performAction("remove", tuxguitarPkg.id); pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - jqUnit.assertNotEquals ("Failed to remove tuxguitar package", 0, pkgs.length); - } - - // *** getPackages() tests *** - - console.log ("Testing getPackages() comparing tuxguitar against installed and available packages"); - pkgs = packagekit.searchPackage ("tuxguitar"); - var tuxguitarPkg = pkgs[0]; - - var installedPkgs = packagekit.getPackages ("installed"); - var installedIndex = -1; - for (var i = 0; i < installedPkgs.length; i++) { - if (installedPkgs[i].name === tuxguitarPkg.name) { - installedIndex = i; - break; - } - } - var availablePkgs = packagekit.getPackages ("~installed"); - var availableIndex = -1; - for (i = 0; i < availablePkgs.length; i++) { - if (availablePkgs[i].name === tuxguitarPkg.name) { - availableIndex = i; - break; - } - } - - // Depending on whether tuxguitar is installed on not, check that it appears - // correctly in the installed or available lists. - if (isInstalled (tuxguitarPkg)) { - jqUnit.assertNotEquals ("Did not find tuxguitar in installed packages", -1, installedIndex); - jqUnit.assertEquals ("Found tuxguitar in the available packages", -1, availableIndex); - } - else { - jqUnit.assertEquals ("Found tuxguitar in installed packages", -1, installedIndex); - jqUnit.assertNotEquals ("Did not find tuxguitar in the available packages", -1, availableIndex); + jqUnit.assertNotEquals ("Failed to remove tuxguitar package", + 0, pkgs.length); } // *** updatePackage() tests *** @@ -201,7 +202,6 @@ jqUnit.test ("Testing PackageKit Bridge", function() { packagekit.removePackage (currentPkgs[0].id); } else { - console.log ("Cannot test update of emacspeak since there are no updates"); + console.log ("Cannot test update of emacspeak as there are no updates"); } - }); From 54e7dc7799103fe26e0fed2be6e308d1a43ff65b Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 23 Jul 2014 15:57:01 -0400 Subject: [PATCH 184/319] Improved nodepackagekit implementation and unit tests. - nodpackagekit.cc: Retrieves architecture info from the package id and stores it in the new "arch" field of the package JS objecgts. - nodepakagekit_test.js: Uses "arch" field to match package across the install/remove tests. Also, made the assertX() messages more generic. --- .../nodepackagekit/nodepackagekit.cc | 51 ++++---- .../nodepackagekit/nodepackagekit_test.js | 117 +++++++++--------- 2 files changed, 85 insertions(+), 83 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 6af5853..b187331 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -72,6 +72,21 @@ handleFiltersArgument (const Arguments& args, const int filterIndex) { return pk_filter_bitfield_from_string (filters.c_str()); } +static v8::Handle +makePac (PkPackage *package) { + v8::Handle pac = v8::Object::New(); + + pac->Set(String::New("id"), String::New(pk_package_get_id (package))); + pac->Set(String::New("name"), String::New(pk_package_get_name (package))); + pac->Set(String::New("version"), + String::New (pk_package_get_version(package))); + pac->Set(String::New("arch"), + String::New (pk_package_get_arch(package))); + pac->Set(String::New("data"), String::New (pk_package_get_data(package))); + return (pac); +} + + /** * searchPackage: * @@ -91,6 +106,7 @@ Handle searchPackage(const Arguments& args) { std::basic_string name; PkBitfield filtersBitField; GError *err = NULL; + v8::Handle pac; v8::Handle result = v8::Array::New(); name = utf8StringFromValue(args[0]); @@ -109,15 +125,8 @@ Handle searchPackage(const Arguments& args) { for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - - v8::Handle pac = v8::Object::New(); - pac->Set(String::New("id"), String::New(pk_package_get_id(package))); - pac->Set(String::New("name"), String::New(pk_package_get_name(package))); - pac->Set(String::New("version"), - String::New(pk_package_get_version(package))); - pac->Set(String::New("data"), String::New(pk_package_get_data(package))); - - result->Set(i,pac); + pac = makePac (package); + result->Set (i,pac); } if (results != NULL) @@ -149,6 +158,7 @@ Handle searchFiles (const Arguments& args) { std::basic_string pathName; PkBitfield filtersBitField; GError *err = NULL; + v8::Handle pac; v8::Handle result = v8::Array::New(); pathName = utf8StringFromValue(args[0]); @@ -166,15 +176,8 @@ Handle searchFiles (const Arguments& args) { for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - - v8::Handle pac = v8::Object::New(); - pac->Set(String::New("id"), String::New(pk_package_get_id(package))); - pac->Set(String::New("name"), String::New(pk_package_get_name(package))); - pac->Set(String::New("version"), - String::New(pk_package_get_version(package))); - pac->Set(String::New("data"), String::New(pk_package_get_data(package))); - - result->Set(i,pac); + pac = makePac (package); + result->Set (i,pac); } if (results != NULL) @@ -208,6 +211,7 @@ Handle getPackages(const Arguments& args) { PkPackageSack *sack = NULL; PkBitfield filtersBitField; GError *err = NULL; + v8::Handle pac; v8::Handle result = v8::Array::New(); filtersBitField = handleFiltersArgument (args, 0); @@ -222,15 +226,8 @@ Handle getPackages(const Arguments& args) { for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - - v8::Handle pac = v8::Object::New(); - pac->Set(String::New("id"), String::New(pk_package_get_id(package))); - pac->Set(String::New("name"), String::New(pk_package_get_name(package))); - pac->Set(String::New("version"), - String::New(pk_package_get_version(package))); - pac->Set(String::New("data"), String::New(pk_package_get_data(package))); - - result->Set(i,pac); + pac = makePac (package); + result->Set (i,pac); } if (results != NULL) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 63061a3..721165b 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -33,7 +33,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { return aPkg.name === "glib2"; } - function findNamedPackage (name, pkgArray) { + function findPackageByName (name, pkgArray) { var thePkg = null; pkgArray.some (function (aPkg) { if (aPkg.name === name) { @@ -47,6 +47,23 @@ jqUnit.test ("Testing PackageKit Bridge", function() { return thePkg; } + // Return the package that matches name, version, and architecture. + function matchPackage (pkg, pkgList) { + var thePkg = null; + pkgList.some (function (aPkg) { + if (aPkg.name === pkg.name && + aPkg.version === pkg.version && + aPkg.arch === pkg.arch) { + thePkg = aPkg; + return true; + } + else { + return false; + } + }); + return thePkg; + } + // *** searchPackage() tests implicit and explicit 'none' filter *** // Test whether glib2 is installed OR available, using implicit and @@ -56,17 +73,12 @@ jqUnit.test ("Testing PackageKit Bridge", function() { console.log ("Testing searchPackage() of 'glib2' with implicit 'none' " + "filter, meaning installed or available."); var pkgs = packagekit.searchPackage ("glib2"); - jqUnit.assertNotEquals ("No package for glib2 was found during search", - 0, pkgs.length); var found = pkgs.some (findGlib2); - jqUnit.assertTrue ("No package 'glib2' found", found); + jqUnit.assertTrue ("Search 'glib2', implicit 'none' filter", found); console.log ("Testing searchPackage() of 'glib2', explicit 'none' filter."); pkgs = packagekit.searchPackage ("glib2", "none"); - jqUnit.assertNotEquals ("No package for glib2 was found during search", - 0, pkgs.length); - found = pkgs.some (findGlib2); - jqUnit.assertTrue ("No package 'glib2' found", found); + jqUnit.assertTrue ("Search 'glib2', explicit 'none' filter", found); // *** searchFiles() test *** @@ -75,7 +87,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // utility 'ls'. console.log ("Testing searchFiles() for '/usr/bin/ls'."); pkgs = packagekit.searchFiles ("/usr/bin/ls"); - jqUnit.assertNotEquals ("No package for 'ls' was found during search", + jqUnit.assertNotEquals ("Search file '/usr/bin/ls', implicit 'none' filter", 0, pkgs.length); // *** searchPackage() tests with "installed" and "~installed" filters *** @@ -87,26 +99,26 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // Get the tuxguitar package, whether installed or not. pkgs = packagekit.searchPackage ("tuxguitar"); - var tuxguitarPkg = findNamedPackage ("tuxguitar", pkgs); + var tuxguitarPkg = findPackageByName ("tuxguitar", pkgs); var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); - var installed = (findNamedPackage ("tuxguitar", installedPkgs) !== null); + var installed = (findPackageByName ("tuxguitar", installedPkgs) !== null); var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - var available = (findNamedPackage ("tuxguitar", availablePkgs) !== null); + var available = (findPackageByName ("tuxguitar", availablePkgs) !== null); // Depending on whether tuxguitar is installed on not, check that it appears // correctly in the installed or available lists. if (isInstalled (tuxguitarPkg)) { - jqUnit.assertTrue ("Did not find tuxguitar in installed packages", + jqUnit.assertTrue ("Search 'tuxguitar' in installed packages list", installed); - jqUnit.assertFalse ("Found tuxguitar in available packages", + jqUnit.assertFalse ("Search 'tuxguitar' not in available packages list", available); } else { - jqUnit.assertFalse ("Found tuxguitar in installed packages", + jqUnit.assertFalse ("Search 'tuxguitar' not in installed packages list", installed); - jqUnit.assertTrue ("Did not find tuxguitar in available packages", + jqUnit.assertTrue ("Search 'tuxguitar' is in available packages list", available); } @@ -116,64 +128,57 @@ jqUnit.test ("Testing PackageKit Bridge", function() { console.log (" Note: this will take some time."); installedPkgs = packagekit.getPackages ("installed"); - installed = (findNamedPackage ("tuxguitar", installedPkgs) !== null); + installed = (findPackageByName ("tuxguitar", installedPkgs) !== null); availablePkgs = packagekit.getPackages ("~installed"); - available = (findNamedPackage ("tuxguitar", availablePkgs) !== null); + available = (findPackageByName ("tuxguitar", availablePkgs) !== null); // Depending on whether tuxguitar is installed on not, check that it appears // correctly in the installed or available lists. if (isInstalled (tuxguitarPkg)) { - jqUnit.assertTrue ("Did not find tuxguitar in installed packages", + jqUnit.assertTrue ("Get 'tuxguitar' is in installed packages list", installed); - jqUnit.assertFalse ("Found tuxguitar in available packages", + jqUnit.assertFalse ("Get 'tuxguitar' is not in available packages list", available); } else { - jqUnit.assertFalse ("Found tuxguitar in installed packages", + jqUnit.assertFalse ("Get 'tuxguitar' is not in installed packages list", installed); - jqUnit.assertTrue ("Did not find tuxguitar in available packages", + jqUnit.assertTrue ("Get 'tuxguitar' is in available packages list", available); } // *** performAction() tests *** - // Assumption: tuxguitar is not installed. - // If it is installed, don't run the test (it will fail), but say so on the - // console, and recommend that it be removed manually before running tests. + // Using the tuxguitar package: If it's installed, test removing it and + // then (re)install it ... + var aPkg = null; if (isInstalled (tuxguitarPkg)) { - console.log ("Package 'tuxguitar' is installed; will not run test for " + - "installing it --"); - console.log ("Please manually remove tuxguitar to run this test."); - } - else { - console.log ("Testing performAction ('install') -- install tuxguitar"); - packagekit.performAction("install", tuxguitarPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "installed"); - jqUnit.assertEquals ("Failure installing package tuxguitar, ", - 1, pkgs.length); - } - - // Assumption: tuxguitar is installed. - // If it is not installed, don't run the 'remove' test (it will fail), but - // say so on the console. - pkgs = packagekit.searchPackage ("tuxguitar"); - tuxguitarPkg = pkgs[0]; - if (!isInstalled (tuxguitarPkg)) { - console.log ("Package 'tuxguitar' is not installed; will not run test " + - "for removing it -- "); - console.log ("The 'install' test must have failed"); + console.log ("Testing performAction ('remove') -- removing tuxguitar"); + packagekit.performAction ("remove", tuxguitarPkg.id); + pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); + aPkg = matchPackage (tuxguitarPkg, pkgs); + jqUnit.assertNotNull ("Temove tuxguitar package", aPkg); + + console.log ("Testing performAction ('install') -- install tuxguitar"); + packagekit.performAction ("install", aPkg.id); + pkgs = packagekit.searchPackage ("tuxguitar", "installed"); + aPkg = matchPackage (tuxguitarPkg, pkgs); + jqUnit.assertNotNull ("Install tuxguitar package", aPkg); } + // ...if it isn't installed, test installing it and then removing it. else { - console.log ("Testing performAction ('remove') -- removing tuxguitar"); - pkgs = packagekit.searchPackage ("tuxguitar", "installed"); - jqUnit.assertEquals ("No package tuxguitar installed; cannot remove", - 1, pkgs.length); - - packagekit.performAction("remove", tuxguitarPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - jqUnit.assertNotEquals ("Failed to remove tuxguitar package", - 0, pkgs.length); + console.log ("Testing performAction ('install') -- install tuxguitar"); + packagekit.performAction ("install", tuxguitarPkg.id); + pkgs = packagekit.searchPackage ("tuxguitar", "installed"); + aPkg = matchPackage (tuxguitarPkg, pkgs); + jqUnit.assertNotNull ("Install package tuxguitar, ", aPkg); + + console.log ("Testing performAction ('remove') -- removing tuxguitar"); + packagekit.performAction ("remove", aPkg.id); + pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); + aPkg = matchPackage (tuxguitarPkg, pkgs); + jqUnit.assertNotNull ("Remove tuxguitar package", aPkg); } // *** updatePackage() tests *** @@ -195,7 +200,7 @@ jqUnit.test ("Testing PackageKit Bridge", function() { packagekit.updatePackage (pkgs[1].id); var currentPkgs = packagekit.searchPackage ("emacspseak", "installed"); - jqUnit.assertEquals ("Failed to update to " + newEmacspeak, + jqUnit.assertEquals ("Updating to " + newEmacspeak, currentPkgs[0].version, newEmacspeak); // Restore to previous. From 2096dc0740efa746469c225c796f2f733c0e46e0 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 23 Jul 2014 16:44:52 -0400 Subject: [PATCH 185/319] Fixed searchPackage() and getPackages() tests. Used new "arch" field to insure that the package that is checked for in the 'installed' or 'available' lists takes the architecture information into account. --- .../nodepackagekit/nodepackagekit_test.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 721165b..22747fd 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -102,10 +102,12 @@ jqUnit.test ("Testing PackageKit Bridge", function() { var tuxguitarPkg = findPackageByName ("tuxguitar", pkgs); var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); - var installed = (findPackageByName ("tuxguitar", installedPkgs) !== null); + var aPkg = matchPackage (tuxguitarPkg, installedPkgs); + var installed = (aPkg !== null); var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - var available = (findPackageByName ("tuxguitar", availablePkgs) !== null); + aPkg = matchPackage (tuxguitarPkg, availablePkgs); + var available = (aPkg !== null); // Depending on whether tuxguitar is installed on not, check that it appears // correctly in the installed or available lists. @@ -128,10 +130,12 @@ jqUnit.test ("Testing PackageKit Bridge", function() { console.log (" Note: this will take some time."); installedPkgs = packagekit.getPackages ("installed"); - installed = (findPackageByName ("tuxguitar", installedPkgs) !== null); + aPkg = matchPackage (tuxguitarPkg, installedPkgs); + installed = (aPkg !== null); availablePkgs = packagekit.getPackages ("~installed"); - available = (findPackageByName ("tuxguitar", availablePkgs) !== null); + aPkg = matchPackage (tuxguitarPkg, availablePkgs); + available = (aPkg !== null); // Depending on whether tuxguitar is installed on not, check that it appears // correctly in the installed or available lists. @@ -152,13 +156,13 @@ jqUnit.test ("Testing PackageKit Bridge", function() { // Using the tuxguitar package: If it's installed, test removing it and // then (re)install it ... - var aPkg = null; + aPkg = null; if (isInstalled (tuxguitarPkg)) { console.log ("Testing performAction ('remove') -- removing tuxguitar"); packagekit.performAction ("remove", tuxguitarPkg.id); pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); aPkg = matchPackage (tuxguitarPkg, pkgs); - jqUnit.assertNotNull ("Temove tuxguitar package", aPkg); + jqUnit.assertNotNull ("Remove tuxguitar package", aPkg); console.log ("Testing performAction ('install') -- install tuxguitar"); packagekit.performAction ("install", aPkg.id); From 383a0b085a6db1d50ba7f1634fa089edc32fa72b Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Fri, 25 Jul 2014 14:56:38 -0400 Subject: [PATCH 186/319] Modified to address comments (Antranig). - Moved "use strict"; to top and wrapped the code in a closure. - Namespaced the test utility functions. - Used fluid.find() for finding and returning a package by name, or by (name, version, architecture). - Replaced console messages with individual jqUnit.test() fixtures. --- .../packagekit/nodepackagekit/findSearchPk.js | 144 +++---- .../nodepackagekit/nodepackagekit_test.js | 398 +++++++++--------- 2 files changed, 271 insertions(+), 271 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/node_modules/packagekit/nodepackagekit/findSearchPk.js index 354dcb1..5ed4578 100644 --- a/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -1,7 +1,7 @@ /*! GPII Node.js find + search packages -Copyright 2013 Inclusive Design Research Centre, OCAD University +Copyright 2013-2014 Inclusive Design Research Centre, OCAD University Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -77,80 +77,80 @@ packages found. /* global require, process, console */ -var packagekit = require ("./build/Release/nodepackagekit.node"); - -var lookingFor = process.argv[2]; - -// Record the files found by 'find', and possibly related packages. -var whatFindFound = []; -var packages = []; - -// Use package kit add-on to get version of the software. -// - searchNotInstalled() is used when 'find' found nothing. -// - searchInstalled() is used when 'find' found something. -function searchNotInstalled() { - "use strict"; - packages = packagekit.searchPackage (lookingFor, "~installed;basename"); -} - -function searchInstalled() { - "use strict"; - packages = packagekit.searchFiles (whatFindFound); - if (packages.length === 0) { - packages = packagekit.searchPackage (lookingFor, "installed;basename"); - } -} - -// Handle 'find' on close event -- invoke packagekit.searchPackage(). -function onFindClose() { - "use strict"; - console.log ("'find' found " + - ( whatFindFound.length === 0 ? "nothing" : whatFindFound )); - - if (whatFindFound.length === 0) { - searchNotInstalled(); - } - else { - searchInstalled(); - if (packages.length === 0) { - searchNotInstalled(); +(function() { + + "use strict"; + + var packagekit = require ("./build/Release/nodepackagekit.node"); + + var lookingFor = process.argv[2]; + + // Record the files found by 'find', and possibly related packages. + var whatFindFound = []; + var packages = []; + + // Use package kit add-on to get version of the software. + // - searchNotInstalled() is used when 'find' found nothing. + // - searchInstalled() is used when 'find' found something. + function searchNotInstalled() { + packages = packagekit.searchPackage (lookingFor, "~installed;basename"); + } + + function searchInstalled() { + packages = packagekit.searchFiles (whatFindFound); + if (packages.length === 0) { + packages = packagekit.searchPackage (lookingFor, "installed;basename"); + } } - } - if (packages.length > 0) { - console.log (JSON.stringify (packages, null, " ")); - } - else { - console.log ("No package found"); - } -} - -function onFindStdout (data) { - "use strict"; - var found = data.toString().split ("\n"); - found.forEach (function (value) { - if (value.length > 0) { - whatFindFound.push (value); + + // Handle 'find' on close event -- invoke packagekit.searchPackage(). + function onFindClose() { + console.log ("'find' found " + + ( whatFindFound.length === 0 ? "nothing" : whatFindFound )); + + if (whatFindFound.length === 0) { + searchNotInstalled(); + } + else { + searchInstalled(); + if (packages.length === 0) { + searchNotInstalled(); + } + } + if (packages.length > 0) { + console.log (JSON.stringify (packages, null, " ")); + } + else { + console.log ("No package found"); + } } - }); -} -if (lookingFor !== undefined) { - var findArgs = process.env.PATH.split (":"); - findArgs.push (process.env.HOME); - findArgs.push ("-name"); findArgs.push (lookingFor); - findArgs.push ("-type"); findArgs.push ("f"); // only regular files. - findArgs.push ("-print"); + function onFindStdout (data) { + var found = data.toString().split ("\n"); + found.forEach (function (value) { + if (value.length > 0) { + whatFindFound.push (value); + } + }); + } - // Run 'find' - var spawn = require ("child_process").spawn, - find = spawn ("find", findArgs); - - find.stdout.on ("data", onFindStdout); + if (lookingFor !== undefined) { + var findArgs = process.env.PATH.split (":"); + findArgs.push (process.env.HOME); + findArgs.push ("-name"); findArgs.push (lookingFor); + findArgs.push ("-type"); findArgs.push ("f"); // only regular files. + findArgs.push ("-print"); - find.on ("close", onFindClose); + // Run 'find' + var spawn = require ("child_process").spawn, + find = spawn ("find", findArgs); - find.on ("error", function (err) { - "use strict"; - console.log ("child process : " + err); - }); -} + find.stdout.on ("data", onFindStdout); + + find.on ("close", onFindClose); + + find.on ("error", function (err) { + console.log ("child process : " + err); + }); + } +}()); diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 22747fd..709b638 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -12,205 +12,205 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ -/*global require, console*/ -/*jshint globalstrict: true */ - -"use strict"; +/*global require*/ var fluid = require ("universal"), jqUnit = fluid.require ("jqUnit"), - packagekit = require("./build/Release/nodepackagekit.node"); - -jqUnit.module ("PackageKit Bridge node add-on module"); - -jqUnit.test ("Testing PackageKit Bridge", function() { - - function isInstalled (pkg) { - return (!!pkg && (pkg.data.indexOf ("installed") !== -1)); - } - - function findGlib2 (aPkg) { - return aPkg.name === "glib2"; - } - - function findPackageByName (name, pkgArray) { - var thePkg = null; - pkgArray.some (function (aPkg) { - if (aPkg.name === name) { - thePkg = aPkg; - return true; - } - else { - return false; - } - }); - return thePkg; - } - - // Return the package that matches name, version, and architecture. - function matchPackage (pkg, pkgList) { - var thePkg = null; - pkgList.some (function (aPkg) { - if (aPkg.name === pkg.name && - aPkg.version === pkg.version && - aPkg.arch === pkg.arch) { - thePkg = aPkg; - return true; - } - else { - return false; - } - }); - return thePkg; - } - - // *** searchPackage() tests implicit and explicit 'none' filter *** - - // Test whether glib2 is installed OR available, using implicit and - // explicit 'none' filter. Packagekit-glib -- the code this add-on - // invokes -- itself depends on glib2. It must be installed, if this is - // running. - console.log ("Testing searchPackage() of 'glib2' with implicit 'none' " + - "filter, meaning installed or available."); - var pkgs = packagekit.searchPackage ("glib2"); - var found = pkgs.some (findGlib2); - jqUnit.assertTrue ("Search 'glib2', implicit 'none' filter", found); - - console.log ("Testing searchPackage() of 'glib2', explicit 'none' filter."); - pkgs = packagekit.searchPackage ("glib2", "none"); - jqUnit.assertTrue ("Search 'glib2', explicit 'none' filter", found); - - // *** searchFiles() test *** - - // The searchFiles() function expects the full path name where the package - // would be installed, even it if is not installed. Check using the common - // utility 'ls'. - console.log ("Testing searchFiles() for '/usr/bin/ls'."); - pkgs = packagekit.searchFiles ("/usr/bin/ls"); - jqUnit.assertNotEquals ("Search file '/usr/bin/ls', implicit 'none' filter", - 0, pkgs.length); - - // *** searchPackage() tests with "installed" and "~installed" filters *** - - // Test the "installed" vs. "~installed" filters with regards to 'tuxguitar', - // and the array of packages returned by searchPackage() using the filters. - console.log ("Testing searchPackage() with 'tuxguitar' comparing " + - "installed vs. available filters."); - - // Get the tuxguitar package, whether installed or not. - pkgs = packagekit.searchPackage ("tuxguitar"); - var tuxguitarPkg = findPackageByName ("tuxguitar", pkgs); - - var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); - var aPkg = matchPackage (tuxguitarPkg, installedPkgs); - var installed = (aPkg !== null); - - var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - aPkg = matchPackage (tuxguitarPkg, availablePkgs); - var available = (aPkg !== null); - - // Depending on whether tuxguitar is installed on not, check that it appears - // correctly in the installed or available lists. - if (isInstalled (tuxguitarPkg)) { - jqUnit.assertTrue ("Search 'tuxguitar' in installed packages list", - installed); - jqUnit.assertFalse ("Search 'tuxguitar' not in available packages list", - available); - } - else { - jqUnit.assertFalse ("Search 'tuxguitar' not in installed packages list", - installed); - jqUnit.assertTrue ("Search 'tuxguitar' is in available packages list", - available); - } - - // *** getPackages() tests *** - console.log ("Testing getPackages() with tuxguitar comparing " + - "installed vs. available filters."); - console.log (" Note: this will take some time."); - - installedPkgs = packagekit.getPackages ("installed"); - aPkg = matchPackage (tuxguitarPkg, installedPkgs); - installed = (aPkg !== null); - - availablePkgs = packagekit.getPackages ("~installed"); - aPkg = matchPackage (tuxguitarPkg, availablePkgs); - available = (aPkg !== null); - - // Depending on whether tuxguitar is installed on not, check that it appears - // correctly in the installed or available lists. - if (isInstalled (tuxguitarPkg)) { - jqUnit.assertTrue ("Get 'tuxguitar' is in installed packages list", - installed); - jqUnit.assertFalse ("Get 'tuxguitar' is not in available packages list", - available); - } - else { - jqUnit.assertFalse ("Get 'tuxguitar' is not in installed packages list", - installed); - jqUnit.assertTrue ("Get 'tuxguitar' is in available packages list", - available); - } - - // *** performAction() tests *** - - // Using the tuxguitar package: If it's installed, test removing it and - // then (re)install it ... - aPkg = null; - if (isInstalled (tuxguitarPkg)) { - console.log ("Testing performAction ('remove') -- removing tuxguitar"); - packagekit.performAction ("remove", tuxguitarPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - aPkg = matchPackage (tuxguitarPkg, pkgs); - jqUnit.assertNotNull ("Remove tuxguitar package", aPkg); - - console.log ("Testing performAction ('install') -- install tuxguitar"); - packagekit.performAction ("install", aPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "installed"); - aPkg = matchPackage (tuxguitarPkg, pkgs); - jqUnit.assertNotNull ("Install tuxguitar package", aPkg); - } - // ...if it isn't installed, test installing it and then removing it. - else { - console.log ("Testing performAction ('install') -- install tuxguitar"); - packagekit.performAction ("install", tuxguitarPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "installed"); - aPkg = matchPackage (tuxguitarPkg, pkgs); - jqUnit.assertNotNull ("Install package tuxguitar, ", aPkg); - - console.log ("Testing performAction ('remove') -- removing tuxguitar"); - packagekit.performAction ("remove", aPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - aPkg = matchPackage (tuxguitarPkg, pkgs); - jqUnit.assertNotNull ("Remove tuxguitar package", aPkg); - } - - // *** updatePackage() tests *** - - console.log ("Testing updatePackage() with 'emacspeak'"); - - // The package ids of an old and newer version of 'emacspeak'. - // TODO: JS: While the following check against two version of - // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, - // the check that searchPackage() finds the two versions. If so, the test is - // run; otherwise no test is run. Need to find a better way to find - // multiple versions of a package to test against. - var oldEmacspeak = "38.0-5.fc20"; - var newEmacspeak = "39.0-1.fc20"; - pkgs = packagekit.searchPackage ("emacspseak"); - if (pkgs.length === 2 && - (pkgs[0].version === oldEmacspeak && pkgs[1].version === newEmacspeak && - pkgs[1].data.indexOf("updates") !== -1)) { - - packagekit.updatePackage (pkgs[1].id); - var currentPkgs = packagekit.searchPackage ("emacspseak", "installed"); - jqUnit.assertEquals ("Updating to " + newEmacspeak, - currentPkgs[0].version, newEmacspeak); - - // Restore to previous. - packagekit.removePackage (currentPkgs[0].id); - } - else { - console.log ("Cannot test update of emacspeak as there are no updates"); - } -}); + packagekit = require ("./build/Release/nodepackagekit.node"); + +(function() { + + "use strict"; + + var pkTests = fluid.registerNamespace ("gpii.tests.packageKit"); + + pkTests.isInstalled = function (pkg) { + return (!!pkg && (pkg.data.indexOf ("installed") !== -1)); + }; + + pkTests.findGlib2 = function (aPkg) { + return aPkg.name === "glib2"; + }; + + pkTests.findPackageByName = function (name, pkgArray) { + return fluid.find (pkgArray, function (aPkg) { + if (aPkg.name === name) { + return aPkg; + } + }, null); + }; + + // Return the package that matches name, version, and architecture. + pkTests.getMatchingPackage = function (pkg, pkgList) { + return fluid.find (pkgList, function (aPkg) { + if (aPkg.name === pkg.name && + aPkg.version === pkg.version && + aPkg.arch === pkg.arch) { + return aPkg; + } + }, null); + }; + + jqUnit.module ("PackageKit Bridge node add-on module"); + + jqUnit.test ( + "Test searchPackage() of 'glib2' with implicit 'none' filter, meaning " + + "installed or available.", function() { + + // Packagekit-glib -- the code this add-on invokes -- itself depends on + // glib2. It must be installed, if this is running. + var pkgs = packagekit.searchPackage ("glib2"); + var found = pkgs.some (pkTests.findGlib2); + jqUnit.assertTrue ("Search 'glib2', implicit 'none' filter", found); + }); + + jqUnit.test ( + "Test searchPackage() 'glib2' with explicit 'none' filter.", function() { + + var pkgs = packagekit.searchPackage ("glib2", "none"); + var found = pkgs.some (pkTests.findGlib2); + jqUnit.assertTrue ("Search 'glib2', explicit 'none' filter", found); + }); + + jqUnit.test ("Test searchFiles() for '/usr/bin/ls'.", function() { + + // The searchFiles() function expects the full path name where the package + // would be installed, even it if is not installed. Check using the + // common utility 'ls'. + var pkgs = packagekit.searchFiles ("/usr/bin/ls"); + jqUnit.assertNotEquals ( + "Search file '/usr/bin/ls', implicit 'none' filter", 0, pkgs.length + ); + jqUnit.assertTrue ("'ls' is installed", pkTests.isInstalled (pkgs[0])); + }); + + jqUnit.test ("Test searchPackage() with 'tuxguitar' comparing installed " + + "vs. available filters.", function() { + + // Test the "installed" vs. "~installed" filters with regards to + // 'tuxguitar', and the array of packages returned by searchPackage() + // using the filters. Use the tuxguitar package, whether installed or + // not, to test against the two arrays. + var pkgs = packagekit.searchPackage ("tuxguitar"); + var tuxguitarPkg = pkTests.findPackageByName ("tuxguitar", pkgs); + var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); + var matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, installedPkgs); + var installed = (matchPkg !== null); + + var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); + matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, availablePkgs); + var available = (matchPkg !== null); + + // Depending on whether tuxguitar is installed on not, check that it + // appears correctly in the installed or available lists. + if (pkTests.isInstalled (tuxguitarPkg)) { + jqUnit.assertTrue ("Search 'tuxguitar' in installed packages list", + installed); + jqUnit.assertFalse ("Search 'tuxguitar' not in available packages " + + "list", available); + } + else { + jqUnit.assertFalse ("Search 'tuxguitar' not in installed packages " + + "list", installed); + jqUnit.assertTrue ("Search 'tuxguitar' is in available packages list", + available); + } + }); + + jqUnit.test ("Test getPackages() with tuxguitar comparing installed vs. " + + "available filters.", function() { + + var pkgs = packagekit.searchPackage ("tuxguitar"); + var tuxguitarPkg = pkTests.findPackageByName ("tuxguitar", pkgs); + var installedPkgs = packagekit.getPackages ("installed"); + var matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, installedPkgs); + var installed = (matchPkg !== null); + + var availablePkgs = packagekit.getPackages ("~installed"); + matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, availablePkgs); + var available = (matchPkg !== null); + + // Depending on whether tuxguitar is installed on not, check that it + // appears correctly in the installed or available lists. + if (pkTests.isInstalled (tuxguitarPkg)) { + jqUnit.assertTrue ("Get 'tuxguitar' is in installed packages list", + installed); + jqUnit.assertFalse ("Get 'tuxguitar' is not in available packages " + + "list", available); + } + else { + jqUnit.assertFalse ("Get 'tuxguitar' is not in installed packages " + + "list", installed); + jqUnit.assertTrue ("Get 'tuxguitar' is in available packages list", + available); + } + }); + + jqUnit.test ("Test performAction(): 'install' and 'remove' tuxguitar." + + " The order depends on whether tuxguitar is currently " + + "installed.", function() { + + // GPII-880: The 'remove' action requires an administrator password. + // Packagekit invokes PolKit authentication, putting up a dialog to + // capture aforesaid password. This needs to be automated. + + // Using the tuxguitar package: If it's installed, test removing it and + // then (re)install it ... + var pkgs = packagekit.searchPackage ("tuxguitar"); + var tuxguitarPkg = pkTests.findPackageByName ("tuxguitar", pkgs); + var matchPkg = null; + if (pkTests.isInstalled (tuxguitarPkg)) { + packagekit.performAction ("remove", tuxguitarPkg.id); + pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); + matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, pkgs); + jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); + + packagekit.performAction ("install", matchPkg.id); + pkgs = packagekit.searchPackage ("tuxguitar", "installed"); + matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, pkgs); + jqUnit.assertNotNull ("Install tuxguitar package", matchPkg); + } + // ...if it isn't installed, test installing it and then removing it. + else { + packagekit.performAction ("install", tuxguitarPkg.id); + pkgs = packagekit.searchPackage ("tuxguitar", "installed"); + matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, pkgs); + jqUnit.assertNotNull ("Install package tuxguitar, ", matchPkg); + + packagekit.performAction ("remove", matchPkg.id); + pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); + matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, pkgs); + jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); + } + }); + + jqUnit.test ("Test updatePackage(): with 'emacspeak'", function() { + + // The package ids of an old and newer version of 'emacspeak'. + // TODO: JS: While the following check against two version of + // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, + // the check that searchPackage() finds the two versions. If so, the test + // is run; otherwise no test is run. Need to find a better way to find + // multiple versions of a package to test against. + var oldEmacspeak = "38.0-5.fc20"; + var newEmacspeak = "39.0-1.fc20"; + var pkgs = packagekit.searchPackage ("emacspseak"); + if (pkgs.length === 2 && + (pkgs[0].version === oldEmacspeak && + pkgs[1].version === newEmacspeak && + pkgs[1].data.indexOf("updates") !== -1)) { + + packagekit.updatePackage (pkgs[1].id); + var currentPkgs = packagekit.searchPackage ("emacspseak","installed"); + jqUnit.assertEquals ("Updating to " + newEmacspeak, + currentPkgs[0].version, newEmacspeak); + + // Restore to previous. + packagekit.removePackage (currentPkgs[0].id); + } + else { + jqUnit.assertTrue ("Cannot test update of emacspeak as there are no " + + "updates", true); + } + }); +}()); From 1b32f2743d43513e4d0041b16a87425092d89ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 28 Jul 2014 12:05:19 +0200 Subject: [PATCH 187/319] Fixing reversed arguments in assertDeepEq comparison Also, expressing expected keys as an array --- node_modules/packagekit/test/packageKitModuleTests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/packagekit/test/packageKitModuleTests.js b/node_modules/packagekit/test/packageKitModuleTests.js index 4315cfa..fc18f7a 100644 --- a/node_modules/packagekit/test/packageKitModuleTests.js +++ b/node_modules/packagekit/test/packageKitModuleTests.js @@ -31,8 +31,8 @@ jqUnit.test("Running tests for PackageKit Device Reporter", function () { } jqUnit.assertDeepEq("Checking that 'get' reports both 'id' and 'data'", - Object.keys(gpii.packageKit.get("installed")), - Object.keys({"id": null, "data": null})); + ["id", "data"], + Object.keys(gpii.packageKit.get("installed"))); jqUnit.assertTrue("Checking that 'get' report installed packages", (gpii.packageKit.get("installed").data.length > 0)); From e1721db23fb3df8cb7484acfbd57b6786db0498b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 28 Jul 2014 12:25:51 +0200 Subject: [PATCH 188/319] Improving package.json file * Bumping engines to 0.8 according to https://github.com/joyent/node/wiki/api-changes-between-v0.6-and-v0.8 * Setting version to 0.1.0 --- node_modules/packagekit/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/packagekit/package.json b/node_modules/packagekit/package.json index b208318..4b9e10b 100644 --- a/node_modules/packagekit/package.json +++ b/node_modules/packagekit/package.json @@ -1,7 +1,7 @@ { "name": "packageKitBridge", "description": "The packageKitBridge is a Node.js add-on of PackageKit.", - "version": "0.1", + "version": "0.1.0", "author": "Javier Hernández", "bugs": "http://wiki.gpii.net/index.php/Main_Page", "homepage": "http://gpii.net/", @@ -15,5 +15,5 @@ "keywords": ["gpii", "accessibility", "devices", "fluid"], "repository": "git://github.com:GPII/linux.git", "main": "./index.js", - "engines": { "node" : ">=0.1.9" } + "engines": { "node" : ">=0.8" } } From ceda39198f25abde323a07c87282d857ecad4ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 28 Jul 2014 12:52:49 +0200 Subject: [PATCH 189/319] Adding grunt build support for packageKit's add-on --- Gruntfile.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index 6b06e1b..bcf9f1c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,6 +2,7 @@ GPII Linux Personalization Framework Node.js Bootstrap Copyright 2014 RTF-US +Copyright 2014 Emergya Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -52,6 +53,8 @@ module.exports = function(grunt) { cleanAlsaBridge: nodeGypCleanShell("node_modules/alsa/nodealsa"), compileXrandrBridge: nodeGypCompileShell("node_modules/xrandr/nodexrandr"), cleanXrandrBridge: nodeGypCleanShell("node_modules/xrandr/nodexrandr"), + compilePackageKitBridge: nodeGypCompileShell("node_modules/packagekit/nodepackagekit"), + cleanPackageKitBridge: nodeGypCleanShell("node_modules/packagekit/nodepackagekit"), installUsbLib: { options: { stdout: true, @@ -94,6 +97,7 @@ module.exports = function(grunt) { grunt.task.run("shell:compileGSettings"); grunt.task.run("shell:compileAlsaBridge"); grunt.task.run("shell:compileXrandrBridge"); + grunt.task.run("shell:compilePackageKitBridge"); grunt.task.run("shell:installUsbLib"); }); @@ -101,6 +105,7 @@ module.exports = function(grunt) { grunt.task.run("shell:cleanGSettings"); grunt.task.run("shell:cleanAlsaBridge"); grunt.task.run("shell:cleanXrandrBridge"); + grunt.task.run("shell:cleanPackageKitBridge"); grunt.task.run("shell:uninstallUsbLib"); }); From 95fd30c30d82cc9105fb98d40cbd72feb67370f5 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 29 Jul 2014 16:33:10 -0400 Subject: [PATCH 190/319] Added intialization. Added functions for initializing various test fixtures, and modified those fixtures as appropriate. --- .../nodepackagekit/nodepackagekit_test.js | 115 ++++++++++-------- 1 file changed, 63 insertions(+), 52 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 709b638..65947bd 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -51,6 +51,62 @@ var fluid = require ("universal"), }, null); }; + pkTests.initTuxguitar = function() { + pkTests.tuxguitar = { + pkgList: [], + pkg: null, + inInstalledList: false, + inAvailableList: false + }; + var pkgs = packagekit.searchPackage ("tuxguitar"); + pkTests.tuxguitar.pkgList = pkgs; + pkTests.tuxguitar.pkg = pkTests.findPackageByName ("tuxguitar", pkgs); + return pkTests.tuxguitar; + }; + + pkTests.isTuxguitarInList = function (pkgList) { + var tuxguitar = pkTests.tuxguitar; + var matchPkg = pkTests.getMatchingPackage (tuxguitar.pkg, pkgList); + return (matchPkg !== null); + }; + + pkTests.initSearchTest = function() { + var tuxguitar = pkTests.initTuxguitar(); + var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); + tuxguitar.inInstalledList = pkTests.isTuxguitarInList (installedPkgs); + var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); + tuxguitar.inAvailableList = pkTests.isTuxguitarInList (availablePkgs); + return tuxguitar; + }; + + pkTests.initGetTest = function() { + var tuxguitar = pkTests.initTuxguitar(); + var installedPkgs = packagekit.getPackages ("installed"); + tuxguitar.inInstalledList = pkTests.isTuxguitarInList (installedPkgs); + var availablePkgs = packagekit.getPackages ("~installed"); + tuxguitar.inAvailableList = pkTests.isTuxguitarInList (availablePkgs); + return tuxguitar; + }; + + pkTests.runInstalledVsAvailableTests = function (msg) { + var tuxguitar = pkTests.tuxguitar; + + // Depending on whether tuxguitar is installed on not, check that it + // appears correctly in the installed or available lists. + if (pkTests.isInstalled (tuxguitar.pkg)) { + jqUnit.assertTrue (msg + " 'tuxguitar' in installed packages list", + tuxguitar.inInstalledList); + jqUnit.assertFalse (msg + " 'tuxguitar' not in available packages " + + "list", tuxguitar.inAvailableList); + } + else { + jqUnit.assertFalse (msg + " 'tuxguitar' not in installed packages " + + "list", tuxguitar.inInstalledList); + jqUnit.assertTrue (msg + " 'tuxguitar' is in available packages list", + tuxguitar.inAvailableList); + } + }; + jqUnit.module ("PackageKit Bridge node add-on module"); jqUnit.test ( @@ -91,62 +147,17 @@ var fluid = require ("universal"), // 'tuxguitar', and the array of packages returned by searchPackage() // using the filters. Use the tuxguitar package, whether installed or // not, to test against the two arrays. - var pkgs = packagekit.searchPackage ("tuxguitar"); - var tuxguitarPkg = pkTests.findPackageByName ("tuxguitar", pkgs); - var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); - var matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, installedPkgs); - var installed = (matchPkg !== null); - - var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, availablePkgs); - var available = (matchPkg !== null); - - // Depending on whether tuxguitar is installed on not, check that it - // appears correctly in the installed or available lists. - if (pkTests.isInstalled (tuxguitarPkg)) { - jqUnit.assertTrue ("Search 'tuxguitar' in installed packages list", - installed); - jqUnit.assertFalse ("Search 'tuxguitar' not in available packages " + - "list", available); - } - else { - jqUnit.assertFalse ("Search 'tuxguitar' not in installed packages " + - "list", installed); - jqUnit.assertTrue ("Search 'tuxguitar' is in available packages list", - available); - } + pkTests.initSearchTest(); + pkTests.runInstalledVsAvailableTests ("Search"); }); jqUnit.test ("Test getPackages() with tuxguitar comparing installed vs. " + "available filters.", function() { - - var pkgs = packagekit.searchPackage ("tuxguitar"); - var tuxguitarPkg = pkTests.findPackageByName ("tuxguitar", pkgs); - var installedPkgs = packagekit.getPackages ("installed"); - var matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, installedPkgs); - var installed = (matchPkg !== null); - - var availablePkgs = packagekit.getPackages ("~installed"); - matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, availablePkgs); - var available = (matchPkg !== null); - - // Depending on whether tuxguitar is installed on not, check that it - // appears correctly in the installed or available lists. - if (pkTests.isInstalled (tuxguitarPkg)) { - jqUnit.assertTrue ("Get 'tuxguitar' is in installed packages list", - installed); - jqUnit.assertFalse ("Get 'tuxguitar' is not in available packages " + - "list", available); - } - else { - jqUnit.assertFalse ("Get 'tuxguitar' is not in installed packages " + - "list", installed); - jqUnit.assertTrue ("Get 'tuxguitar' is in available packages list", - available); - } + pkTests.initGetTest(); + pkTests.runInstalledVsAvailableTests ("Get"); }); - jqUnit.test ("Test performAction(): 'install' and 'remove' tuxguitar." + + jqUnit.test ("Test performAction(): 'install' and 'remove' tuxguitar." + " The order depends on whether tuxguitar is currently " + "installed.", function() { @@ -159,8 +170,8 @@ var fluid = require ("universal"), var pkgs = packagekit.searchPackage ("tuxguitar"); var tuxguitarPkg = pkTests.findPackageByName ("tuxguitar", pkgs); var matchPkg = null; - if (pkTests.isInstalled (tuxguitarPkg)) { - packagekit.performAction ("remove", tuxguitarPkg.id); + if (pkTests.isInstalled (pkTests.tuxguitarPkg)) { + packagekit.performAction ("remove", pkTests.tuxguitarPkg.id); pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, pkgs); jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); From cb1fe7543bbc619f7b59341e1acb37ae18506592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 30 Jul 2014 12:47:04 +0200 Subject: [PATCH 191/319] Saving and restoring the value of installedPackagesCache --- node_modules/packagekit/test/packageKitDeviceReporterTests.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node_modules/packagekit/test/packageKitDeviceReporterTests.js b/node_modules/packagekit/test/packageKitDeviceReporterTests.js index 3bb3e63..e5745fe 100644 --- a/node_modules/packagekit/test/packageKitDeviceReporterTests.js +++ b/node_modules/packagekit/test/packageKitDeviceReporterTests.js @@ -17,6 +17,8 @@ var fluid = require("universal"), require("packagekit"); fluid.registerNamespace("gpii.packageKit"); +var originalCache = fluid.copy(gpii.packageKit.installedPackagesCache); + jqUnit.module("GPII PackageKit Device Reporter", { setup: function() { // mock-up of installedPackagesCache @@ -31,7 +33,7 @@ jqUnit.module("GPII PackageKit Device Reporter", { ]; }, teardown: function() { - gpii.packageKit.installedPackagesCache = gpii.packageKit.get("installed;~devel"); + gpii.packageKit.installedPackagesCache = originalCache; } }); From 03ca0479f60f3d67435c0197445a984cc7ecf646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 30 Jul 2014 12:50:08 +0200 Subject: [PATCH 192/319] Removing unused variable --- node_modules/packagekit/test/packageKitModuleTests.js | 1 - 1 file changed, 1 deletion(-) diff --git a/node_modules/packagekit/test/packageKitModuleTests.js b/node_modules/packagekit/test/packageKitModuleTests.js index fc18f7a..d6a6096 100644 --- a/node_modules/packagekit/test/packageKitModuleTests.js +++ b/node_modules/packagekit/test/packageKitModuleTests.js @@ -11,7 +11,6 @@ */ var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"), jqUnit = fluid.require("jqUnit"); require("packagekit"); From b4a27e2f93a37fc5ea635535181454e604d5bdaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 30 Jul 2014 13:03:44 +0200 Subject: [PATCH 193/319] jshint: Declaring variable 'methods' --- node_modules/packagekit/test/packageKitModuleTests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/packagekit/test/packageKitModuleTests.js b/node_modules/packagekit/test/packageKitModuleTests.js index d6a6096..407d940 100644 --- a/node_modules/packagekit/test/packageKitModuleTests.js +++ b/node_modules/packagekit/test/packageKitModuleTests.js @@ -23,7 +23,7 @@ jqUnit.test("Running tests for PackageKit Device Reporter", function () { // Check that the bridge is loaded and required methods are available // - methods = ["get", "find"]; + var methods = ["get", "find"]; for (var method in methods) { jqUnit.assertTrue("Checking availability of method '" + method + "'", (methods[method] in packageKit)); From 49b0945cf44da7849048d01225b7afa09de7152e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 30 Jul 2014 13:06:51 +0200 Subject: [PATCH 194/319] jshint: Updating infusion's version in .jshintrc --- .jshintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jshintrc b/.jshintrc index 073e5b9..602de57 100644 --- a/.jshintrc +++ b/.jshintrc @@ -28,6 +28,6 @@ "worker": true, "globals": { - "fluid_1_5": true + "fluid_2_0": true } } From 31c0b7007b1ee31c3023d04a9a17756f6f76f511 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 30 Jul 2014 10:04:24 -0400 Subject: [PATCH 195/319] Added helper functions for the install/remove test fixture. --- .../nodepackagekit/nodepackagekit_test.js | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 65947bd..c893bfc 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -107,6 +107,12 @@ var fluid = require ("universal"), } }; + pkTests.searchForMatch = function (searchFilter) { + var tuxguitar = pkTests.tuxguitar; + var pkgs = packagekit.searchPackage ("tuxguitar", searchFilter); + return pkTests.getMatchingPackage (tuxguitar.pkg, pkgs); + }; + jqUnit.module ("PackageKit Bridge node add-on module"); jqUnit.test ( @@ -167,30 +173,25 @@ var fluid = require ("universal"), // Using the tuxguitar package: If it's installed, test removing it and // then (re)install it ... - var pkgs = packagekit.searchPackage ("tuxguitar"); - var tuxguitarPkg = pkTests.findPackageByName ("tuxguitar", pkgs); + var tuxguitar = pkTests.initTuxguitar(); var matchPkg = null; - if (pkTests.isInstalled (pkTests.tuxguitarPkg)) { - packagekit.performAction ("remove", pkTests.tuxguitarPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, pkgs); + if (pkTests.isInstalled (tuxguitar.pkg)) { + packagekit.performAction ("remove", tuxguitar.pkg.id); + matchPkg = pkTests.searchForMatch ("~installed"); jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); packagekit.performAction ("install", matchPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "installed"); - matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, pkgs); + matchPkg = pkTests.searchForMatch ("installed"); jqUnit.assertNotNull ("Install tuxguitar package", matchPkg); } // ...if it isn't installed, test installing it and then removing it. else { - packagekit.performAction ("install", tuxguitarPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "installed"); - matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, pkgs); + packagekit.performAction ("install", tuxguitar.pkg.id); + matchPkg = pkTests.searchForMatch ("installed"); jqUnit.assertNotNull ("Install package tuxguitar, ", matchPkg); packagekit.performAction ("remove", matchPkg.id); - pkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - matchPkg = pkTests.getMatchingPackage (tuxguitarPkg, pkgs); + matchPkg = pkTests.searchForMatch ("~installed"); jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); } }); From c18a556270616d9162e213ff35d0accf251a62d9 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 30 Jul 2014 12:53:35 -0400 Subject: [PATCH 196/319] Further modularized the install/remove test fixture. --- .../nodepackagekit/nodepackagekit_test.js | 80 +++++++++++-------- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index c893bfc..ef42bf4 100644 --- a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -52,20 +52,19 @@ var fluid = require ("universal"), }; pkTests.initTuxguitar = function() { - pkTests.tuxguitar = { + var tuxguitar = { pkgList: [], pkg: null, inInstalledList: false, inAvailableList: false }; var pkgs = packagekit.searchPackage ("tuxguitar"); - pkTests.tuxguitar.pkgList = pkgs; - pkTests.tuxguitar.pkg = pkTests.findPackageByName ("tuxguitar", pkgs); - return pkTests.tuxguitar; + tuxguitar.pkgList = pkgs; + tuxguitar.pkg = pkTests.findPackageByName ("tuxguitar", pkgs); + return tuxguitar; }; - pkTests.isTuxguitarInList = function (pkgList) { - var tuxguitar = pkTests.tuxguitar; + pkTests.isTuxguitarInList = function (tuxguitar, pkgList) { var matchPkg = pkTests.getMatchingPackage (tuxguitar.pkg, pkgList); return (matchPkg !== null); }; @@ -73,24 +72,26 @@ var fluid = require ("universal"), pkTests.initSearchTest = function() { var tuxguitar = pkTests.initTuxguitar(); var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); - tuxguitar.inInstalledList = pkTests.isTuxguitarInList (installedPkgs); + tuxguitar.inInstalledList = + pkTests.isTuxguitarInList (tuxguitar, installedPkgs); var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - tuxguitar.inAvailableList = pkTests.isTuxguitarInList (availablePkgs); + tuxguitar.inAvailableList = + pkTests.isTuxguitarInList (tuxguitar, availablePkgs); return tuxguitar; }; pkTests.initGetTest = function() { var tuxguitar = pkTests.initTuxguitar(); var installedPkgs = packagekit.getPackages ("installed"); - tuxguitar.inInstalledList = pkTests.isTuxguitarInList (installedPkgs); + tuxguitar.inInstalledList = + pkTests.isTuxguitarInList (tuxguitar, installedPkgs); var availablePkgs = packagekit.getPackages ("~installed"); - tuxguitar.inAvailableList = pkTests.isTuxguitarInList (availablePkgs); + tuxguitar.inAvailableList = + pkTests.isTuxguitarInList (tuxguitar, availablePkgs); return tuxguitar; }; - pkTests.runInstalledVsAvailableTests = function (msg) { - var tuxguitar = pkTests.tuxguitar; - + pkTests.runInstalledVsAvailableTests = function (tuxguitar, msg) { // Depending on whether tuxguitar is installed on not, check that it // appears correctly in the installed or available lists. if (pkTests.isInstalled (tuxguitar.pkg)) { @@ -107,12 +108,31 @@ var fluid = require ("universal"), } }; - pkTests.searchForMatch = function (searchFilter) { - var tuxguitar = pkTests.tuxguitar; + pkTests.searchForMatch = function (tuxguitar, searchFilter) { var pkgs = packagekit.searchPackage ("tuxguitar", searchFilter); return pkTests.getMatchingPackage (tuxguitar.pkg, pkgs); }; + pkTests.testRemovePackage = function (tuxguitar, matchPkg) { + var id = ( matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); + + // GPII-880: The 'remove' action requires an administrator password. + // Packagekit invokes PolKit authentication, putting up a dialog to + // capture aforesaid password. This needs to be automated. + packagekit.performAction ("remove", id); + matchPkg = pkTests.searchForMatch (tuxguitar, "~installed"); + jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); + return matchPkg; + }; + + pkTests.testInstallPackage = function (tuxguitar, matchPkg) { + var id = ( matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); + packagekit.performAction ("install", id); + matchPkg = pkTests.searchForMatch (tuxguitar, "installed"); + jqUnit.assertNotNull ("Install tuxguitar package", matchPkg); + return matchPkg; + }; + jqUnit.module ("PackageKit Bridge node add-on module"); jqUnit.test ( @@ -153,46 +173,36 @@ var fluid = require ("universal"), // 'tuxguitar', and the array of packages returned by searchPackage() // using the filters. Use the tuxguitar package, whether installed or // not, to test against the two arrays. - pkTests.initSearchTest(); - pkTests.runInstalledVsAvailableTests ("Search"); + var tuxguitar = pkTests.initSearchTest(); + pkTests.runInstalledVsAvailableTests (tuxguitar, "Search"); }); jqUnit.test ("Test getPackages() with tuxguitar comparing installed vs. " + "available filters.", function() { - pkTests.initGetTest(); - pkTests.runInstalledVsAvailableTests ("Get"); + var tuxguitar = pkTests.initGetTest(); + pkTests.runInstalledVsAvailableTests (tuxguitar, "Get"); }); jqUnit.test ("Test performAction(): 'install' and 'remove' tuxguitar." + " The order depends on whether tuxguitar is currently " + "installed.", function() { - // GPII-880: The 'remove' action requires an administrator password. + // GPII-880: The 'remove' test requires an administrator password. // Packagekit invokes PolKit authentication, putting up a dialog to // capture aforesaid password. This needs to be automated. // Using the tuxguitar package: If it's installed, test removing it and // then (re)install it ... + var matchPkg; var tuxguitar = pkTests.initTuxguitar(); - var matchPkg = null; if (pkTests.isInstalled (tuxguitar.pkg)) { - packagekit.performAction ("remove", tuxguitar.pkg.id); - matchPkg = pkTests.searchForMatch ("~installed"); - jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); - - packagekit.performAction ("install", matchPkg.id); - matchPkg = pkTests.searchForMatch ("installed"); - jqUnit.assertNotNull ("Install tuxguitar package", matchPkg); + matchPkg = pkTests.testRemovePackage (tuxguitar, null); + pkTests.testInstallPackage (tuxguitar, matchPkg); } // ...if it isn't installed, test installing it and then removing it. else { - packagekit.performAction ("install", tuxguitar.pkg.id); - matchPkg = pkTests.searchForMatch ("installed"); - jqUnit.assertNotNull ("Install package tuxguitar, ", matchPkg); - - packagekit.performAction ("remove", matchPkg.id); - matchPkg = pkTests.searchForMatch ("~installed"); - jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); + matchPkg = pkTests.testInstallPackage (tuxguitar, null); + pkTests.testRemovePackage (tuxguitar, matchPkg); } }); From e552d6dbba81e4844a5c0781e5a59de550e105b6 Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Mon, 4 Aug 2014 19:05:33 +0100 Subject: [PATCH 197/319] GPII-872: Linting tasks and fixes for Linux repository. Rationalised layout to match that of other repositories, with our own code in "gpii" directory. Updated for latest grunt-gpii --- .jshintrc | 31 ++++++ Gruntfile.js | 78 ++++++-------- gpii.js | 8 +- {node_modules => gpii}/alsa/alsa_bridge.js | 17 ++- {node_modules => gpii}/alsa/index.js | 0 .../alsa/nodealsa/binding.gyp | 0 .../alsa/nodealsa/nodealsa.cc | 0 .../alsa/nodealsa/nodealsa_tests.js | 4 +- {node_modules => gpii}/alsa/package.json | 0 .../alsa/test/alsaSettingsHandlerTests.js | 21 ++-- .../gsettingsBridge/README.md | 0 .../gsettingsBridge/gsettings_bridge.js | 12 ++- .../gsettingsBridge/index.js | 0 .../gsettingsBridge/nodegsettings/binding.gyp | 0 .../nodegsettings/nodegsettings.cc | 0 .../nodegsettings/nodegsettings_tests.js | 95 +++++++++++++++++ .../gsettingsBridge/package.json | 0 ...ome.builtin.magnification.example-GET.json | 0 ...m.gnome.builtin.magnification.example.json | 0 .../gsettingsBridge/tests/data/gmag-orig.json | 0 .../tests/data/gmag-test1.json | 0 .../net.gpii.testing.gsettings.gschema.xml | 0 .../gsettingsBridge/tests/gsettingsTests.js | 27 ++--- .../gsettingsBridge/tests/runUnitTests.sh | 0 .../gsettingsBridge/tests/tests.js | 15 ++- {node_modules => gpii}/orca/index.js | 0 .../orca/orcaSettingsHandler.js | 20 ++-- {node_modules => gpii}/orca/package.json | 0 .../orca/test/orcaSettingsHandlerTests.js | 24 ++--- {node_modules => gpii}/xrandr/index.js | 0 .../xrandr/nodexrandr/binding.gyp | 0 .../xrandr/nodexrandr/nodexrandr.cc | 0 .../xrandr/nodexrandr/nodexrandr_tests.js | 4 +- {node_modules => gpii}/xrandr/package.json | 0 .../xrandr/test/xrandrSettingsHandlerTests.js | 9 +- .../xrandr/xrandr_bridge.js | 81 +++++++------- .../nodegsettings/nodegsettings_tests.js | 100 ------------------ .../tests/data/gmag-get-test.json | 17 --- package.json | 4 +- .../AcceptanceTests_builtIn.js | 31 +++--- .../AcceptanceTests_include.js | 14 +-- tests/acceptanceTests/AcceptanceTests_orca.js | 7 +- 42 files changed, 311 insertions(+), 308 deletions(-) create mode 100644 .jshintrc rename {node_modules => gpii}/alsa/alsa_bridge.js (80%) rename {node_modules => gpii}/alsa/index.js (100%) rename {node_modules => gpii}/alsa/nodealsa/binding.gyp (100%) rename {node_modules => gpii}/alsa/nodealsa/nodealsa.cc (100%) rename {node_modules => gpii}/alsa/nodealsa/nodealsa_tests.js (94%) rename {node_modules => gpii}/alsa/package.json (100%) rename {node_modules => gpii}/alsa/test/alsaSettingsHandlerTests.js (63%) rename {node_modules => gpii}/gsettingsBridge/README.md (100%) rename {node_modules => gpii}/gsettingsBridge/gsettings_bridge.js (92%) rename {node_modules => gpii}/gsettingsBridge/index.js (100%) rename {node_modules => gpii}/gsettingsBridge/nodegsettings/binding.gyp (100%) rename {node_modules => gpii}/gsettingsBridge/nodegsettings/nodegsettings.cc (100%) create mode 100644 gpii/gsettingsBridge/nodegsettings/nodegsettings_tests.js rename {node_modules => gpii}/gsettingsBridge/package.json (100%) rename {node_modules => gpii}/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json (100%) rename {node_modules => gpii}/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json (100%) rename {node_modules => gpii}/gsettingsBridge/tests/data/gmag-orig.json (100%) rename {node_modules => gpii}/gsettingsBridge/tests/data/gmag-test1.json (100%) rename {node_modules => gpii}/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml (100%) rename {node_modules => gpii}/gsettingsBridge/tests/gsettingsTests.js (93%) rename {node_modules => gpii}/gsettingsBridge/tests/runUnitTests.sh (100%) rename {node_modules => gpii}/gsettingsBridge/tests/tests.js (61%) rename {node_modules => gpii}/orca/index.js (100%) rename {node_modules => gpii}/orca/orcaSettingsHandler.js (91%) rename {node_modules => gpii}/orca/package.json (100%) rename {node_modules => gpii}/orca/test/orcaSettingsHandlerTests.js (83%) rename {node_modules => gpii}/xrandr/index.js (100%) rename {node_modules => gpii}/xrandr/nodexrandr/binding.gyp (100%) rename {node_modules => gpii}/xrandr/nodexrandr/nodexrandr.cc (100%) rename {node_modules => gpii}/xrandr/nodexrandr/nodexrandr_tests.js (97%) rename {node_modules => gpii}/xrandr/package.json (100%) rename {node_modules => gpii}/xrandr/test/xrandrSettingsHandlerTests.js (92%) rename {node_modules => gpii}/xrandr/xrandr_bridge.js (60%) delete mode 100644 node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js delete mode 100644 node_modules/gsettingsBridge/tests/data/gmag-get-test.json diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..9d62e08 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,31 @@ +{ + "bitwise": false, + "camelcase": false, + "curly": true, + "eqeqeq": true, + "es3": true, + "forin": false, + "freeze": true, + "immed": true, + "indent": 4, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": false, + "nonbsp": true, + "nonew": true, + "plusplus": false, + "quotmark": "double", + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + + "maxerr": 1000, + + "node": true, + + "globals": { + "fluid_1_5": true + } +} diff --git a/Gruntfile.js b/Gruntfile.js index 6b06e1b..f083d24 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -10,53 +10,51 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; + module.exports = function(grunt) { - var usbListenerDir = "./usbDriveListener"; - function nodeGypCompileShell (dir) { + grunt.loadNpmTasks("grunt-contrib-jshint"); + grunt.loadNpmTasks("grunt-jsonlint"); + grunt.loadNpmTasks("grunt-gpii"); + + var usbListenerDir = "./usbDriveListener"; + + function nodeGypShell (cmd, cwd) { return { options: { - stdout: true, - stderr: true, execOptions: { - cwd: dir + cwd: cwd } }, - command: function() { - return "node-gyp configure build"; - } + command: cmd }; } - function nodeGypCleanShell (dir) { - return { + grunt.initConfig({ + jshint: { + src: ["gpii/**/*.js", "tests/**/*.js"], + buildScripts: ["Gruntfile.js"], + options: { + jshintrc: true + } + }, + jsonlint: { + src: ["gpii/**/*.json", "tests/**/*.json"] + }, + shell: { options: { stdout: true, stderr: true, - execOptions: { - cwd: dir - } + failOnError: true }, - command: function() { - return "node-gyp clean"; - } - }; - } - - grunt.initConfig({ - pkg: grunt.file.readJSON("package.json"), - shell: { - compileGSettings: nodeGypCompileShell("node_modules/gsettingsBridge/nodegsettings"), - cleanGSettings: nodeGypCleanShell("node_modules/gsettingsBridge/nodegsettings"), - compileAlsaBridge: nodeGypCompileShell("node_modules/alsa/nodealsa"), - cleanAlsaBridge: nodeGypCleanShell("node_modules/alsa/nodealsa"), - compileXrandrBridge: nodeGypCompileShell("node_modules/xrandr/nodexrandr"), - cleanXrandrBridge: nodeGypCleanShell("node_modules/xrandr/nodexrandr"), + compileGSettings: nodeGypShell("node-gyp configure build", "node_modules/gsettingsBridge/nodegsettings"), + cleanGSettings: nodeGypShell("node-gyp clean", "node_modules/gsettingsBridge/nodegsettings"), + compileAlsaBridge: nodeGypShell("node-gyp configure build", "node_modules/alsa/nodealsa"), + cleanAlsaBridge: nodeGypShell("node-gyp clean", "node_modules/alsa/nodealsa"), + compileXrandrBridge: nodeGypShell("node-gyp configure build", "node_modules/xrandr/nodexrandr"), + cleanXrandrBridge: nodeGypShell("node-gyp clean", "node_modules/xrandr/nodexrandr"), installUsbLib: { - options: { - stdout: true, - stderr: true - }, command: [ "sudo cp " + usbListenerDir + "/gpii-usb-user-listener /usr/bin/", "sudo cp " + usbListenerDir + @@ -65,10 +63,6 @@ module.exports = function(grunt) { ].join("&&") }, uninstallUsbLib: { - options: { - stdout: true, - stderr: true - }, command: [ "sudo rm /usr/bin/gpii-usb-user-listener", "sudo rm /usr/share/applications/gpii-usb-user-listener.desktop", @@ -76,21 +70,13 @@ module.exports = function(grunt) { ].join("&&") }, startGpii: { - options: { - stdout: true, - stderr: true - }, - command: function() { - return "node gpii.js"; - } + command: "node gpii.js" } } }); - grunt.loadNpmTasks("grunt-gpii"); - grunt.registerTask("build", "Build the entire GPII", function () { - grunt.task.run("gpiiUniversal"); + grunt.task.run("gpii-universal"); grunt.task.run("shell:compileGSettings"); grunt.task.run("shell:compileAlsaBridge"); grunt.task.run("shell:compileXrandrBridge"); diff --git a/gpii.js b/gpii.js index 511a94e..1fd89bd 100644 --- a/gpii.js +++ b/gpii.js @@ -13,10 +13,10 @@ https://github.com/gpii/universal/LICENSE.txt var fluid = require("universal"), kettle = fluid.registerNamespace("kettle"); -fluid.require("gsettingsBridge", require); -fluid.require("orca", require); -fluid.require("alsa", require); -fluid.require("xrandr", require); +fluid.require("./gpii/node_modules/gsettingsBridge", require); +fluid.require("./gpii/node_modules/orca", require); +fluid.require("./gpii/node_modules/alsa", require); +fluid.require("./gpii/node_modules/xrandr", require); kettle.config.makeConfigLoader({ nodeEnv: kettle.config.getNodeEnv("fm.ps.sr.dr.mm.os.lms.development"), diff --git a/node_modules/alsa/alsa_bridge.js b/gpii/alsa/alsa_bridge.js similarity index 80% rename from node_modules/alsa/alsa_bridge.js rename to gpii/alsa/alsa_bridge.js index 4924551..c72ba80 100644 --- a/node_modules/alsa/alsa_bridge.js +++ b/gpii/alsa/alsa_bridge.js @@ -56,30 +56,29 @@ https://github.com/gpii/universal/LICENSE.txt gpii.alsa.get = function (payload){ var app = fluid.copy(payload); - var settings = fluid.copy(app, "data.0.settings"); var newSettingsResponse = {masterVolume: gpii.alsa.getSystemVolume()}; var noOptions = {settings: newSettingsResponse}; - app["data"][0] = noOptions; + app.data[0] = noOptions; return app; }; gpii.alsa.set = function (payload){ var app = fluid.copy(payload); - var settings = app['org.alsa-project'][0].settings; + var settings = app["org.alsa-project"][0].settings; var oldValue = alsa.getSystemVolume(); - alsa.setSystemVolume(settings['masterVolume']); + alsa.setSystemVolume(settings.masterVolume); var newSettingsResponse = {}; - newSettingsResponse['masterVolume'] = { - "oldValue": oldValue, - "newValue": settings['masterVolume'] - }; + newSettingsResponse.masterVolume = { + "oldValue": oldValue, + "newValue": settings.masterVolume + }; var noOptions = {settings: newSettingsResponse}; - fluid.set(app, ['org.alsa-project', 0], noOptions); + fluid.set(app, ["org.alsa-project", 0], noOptions); return app; }; diff --git a/node_modules/alsa/index.js b/gpii/alsa/index.js similarity index 100% rename from node_modules/alsa/index.js rename to gpii/alsa/index.js diff --git a/node_modules/alsa/nodealsa/binding.gyp b/gpii/alsa/nodealsa/binding.gyp similarity index 100% rename from node_modules/alsa/nodealsa/binding.gyp rename to gpii/alsa/nodealsa/binding.gyp diff --git a/node_modules/alsa/nodealsa/nodealsa.cc b/gpii/alsa/nodealsa/nodealsa.cc similarity index 100% rename from node_modules/alsa/nodealsa/nodealsa.cc rename to gpii/alsa/nodealsa/nodealsa.cc diff --git a/node_modules/alsa/nodealsa/nodealsa_tests.js b/gpii/alsa/nodealsa/nodealsa_tests.js similarity index 94% rename from node_modules/alsa/nodealsa/nodealsa_tests.js rename to gpii/alsa/nodealsa/nodealsa_tests.js index 09bc83f..eaeac00 100644 --- a/node_modules/alsa/nodealsa/nodealsa_tests.js +++ b/gpii/alsa/nodealsa/nodealsa_tests.js @@ -10,6 +10,8 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; + var fluid = require("universal"), jqUnit = fluid.require("jqUnit"), alsa = require("./build/Release/nodealsa.node"); @@ -21,7 +23,7 @@ jqUnit.test("Running tests for ALSA bindings", function () { // Check if all required methods are available // - methods = ["getSystemVolume", "setSystemVolume"]; + var methods = ["getSystemVolume", "setSystemVolume"]; for (var method in methods) { jqUnit.assertTrue("Checking availability of method '" + method + "'", diff --git a/node_modules/alsa/package.json b/gpii/alsa/package.json similarity index 100% rename from node_modules/alsa/package.json rename to gpii/alsa/package.json diff --git a/node_modules/alsa/test/alsaSettingsHandlerTests.js b/gpii/alsa/test/alsaSettingsHandlerTests.js similarity index 63% rename from node_modules/alsa/test/alsaSettingsHandlerTests.js rename to gpii/alsa/test/alsaSettingsHandlerTests.js index 58c3a70..c33347b 100644 --- a/node_modules/alsa/test/alsaSettingsHandlerTests.js +++ b/gpii/alsa/test/alsaSettingsHandlerTests.js @@ -10,12 +10,13 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; + var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"), jqUnit = fluid.require("jqUnit"); require("alsa"); -alsa = fluid.registerNamespace("gpii.alsa"); +var alsa = fluid.registerNamespace("gpii.alsa"); jqUnit.module("GPII Node.js ALSA Volume Bridge"); @@ -25,7 +26,7 @@ jqUnit.test("Running tests for ALSA Settings Handler", function () { // Check if all required methods are available through the // ALSA Settings Handler. // - methods = ["getSystemVolume", "setSystemVolume", "get", "set"]; + var methods = ["getSystemVolume", "setSystemVolume", "get", "set"]; for (var method in methods) { jqUnit.assertTrue("Checking availability of method '" + method + "'", (methods[method] in alsa)); @@ -42,16 +43,16 @@ jqUnit.test("Running tests for ALSA Settings Handler", function () { var returnPayload = alsa.set(payload); jqUnit.assertDeepEq("The system volume is being setted well", - returnPayload["org.alsa-project"][0].settings["masterVolume"].newValue, - payload["org.alsa-project"][0].settings["masterVolume"]); + returnPayload["org.alsa-project"][0].settings.masterVolume.newValue, + payload["org.alsa-project"][0].settings.masterVolume); var newPayload = fluid.copy(payload); - newPayload["org.alsa-project"][0].settings["masterVolume"] = - returnPayload["org.alsa-project"][0].settings["masterVolume"].oldValue; + newPayload["org.alsa-project"][0].settingsmasterVolume = + returnPayload["org.alsa-project"][0].settingsmasterVolume.oldValue; - lastPayload = alsa.set(newPayload); + var lastPayload = alsa.set(newPayload); jqUnit.assertDeepEq("The system volume is being restored well", - returnPayload["org.alsa-project"][0].settings["masterVolume"].oldValue, - lastPayload["org.alsa-project"][0].settings["masterVolume"].newValue); + returnPayload["org.alsa-project"][0].settings.masterVolume.oldValue, + lastPayload["org.alsa-project"][0].settings.masterVolume.newValue); }); diff --git a/node_modules/gsettingsBridge/README.md b/gpii/gsettingsBridge/README.md similarity index 100% rename from node_modules/gsettingsBridge/README.md rename to gpii/gsettingsBridge/README.md diff --git a/node_modules/gsettingsBridge/gsettings_bridge.js b/gpii/gsettingsBridge/gsettings_bridge.js similarity index 92% rename from node_modules/gsettingsBridge/gsettings_bridge.js rename to gpii/gsettingsBridge/gsettings_bridge.js index d60347f..b364cd0 100644 --- a/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/gpii/gsettingsBridge/gsettings_bridge.js @@ -15,8 +15,6 @@ https://github.com/gpii/universal/LICENSE.txt var fluid = require("universal"); var gpii = fluid.registerNamespace("gpii"); - var exec = require("child_process").exec; - var util = require("util"); var nodeGSettings = require("./nodegsettings/build/Release/nodegsettings.node"); fluid.registerNamespace("gpii.launch"); @@ -64,7 +62,9 @@ https://github.com/gpii/universal/LICENSE.txt } else { for (var settingKey in settings) { - if (keys.indexOf(settingKey) == -1) continue; + if (keys.indexOf(settingKey) === -1) { + continue; + } settings[settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); } } @@ -84,7 +84,9 @@ https://github.com/gpii/universal/LICENSE.txt var keys = nodeGSettings.get_gsetting_keys(schemaId); for (var settingKey in settings) { - if (keys.indexOf(settingKey) == -1) continue; + if (keys.indexOf(settingKey) === -1) { + continue; + } var value = settings[settingKey]; var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey); nodeGSettings.set_gsetting(schemaId,settingKey,value); @@ -98,6 +100,6 @@ https://github.com/gpii/universal/LICENSE.txt } } return app; - } + }; })(); diff --git a/node_modules/gsettingsBridge/index.js b/gpii/gsettingsBridge/index.js similarity index 100% rename from node_modules/gsettingsBridge/index.js rename to gpii/gsettingsBridge/index.js diff --git a/node_modules/gsettingsBridge/nodegsettings/binding.gyp b/gpii/gsettingsBridge/nodegsettings/binding.gyp similarity index 100% rename from node_modules/gsettingsBridge/nodegsettings/binding.gyp rename to gpii/gsettingsBridge/nodegsettings/binding.gyp diff --git a/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/gpii/gsettingsBridge/nodegsettings/nodegsettings.cc similarity index 100% rename from node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc rename to gpii/gsettingsBridge/nodegsettings/nodegsettings.cc diff --git a/gpii/gsettingsBridge/nodegsettings/nodegsettings_tests.js b/gpii/gsettingsBridge/nodegsettings/nodegsettings_tests.js new file mode 100644 index 0000000..93298b8 --- /dev/null +++ b/gpii/gsettingsBridge/nodegsettings/nodegsettings_tests.js @@ -0,0 +1,95 @@ +/*! +GPII Node.js GSettings Bridge + +Copyright 2012 Steven Githens + +Licensed under the New BSD license. You may not use this file except in +compliance with this License. + +You may obtain a copy of the License at +https://github.com/gpii/universal/LICENSE.txt +*/ + +"use strict"; + +var util = require("util"); +var assert = require("assert"); +var gsettings = require("./build/Release/nodegsettings.node"); + +/* Common variables for all tests */ +var keyScreenmag = "org.gnome.desktop.a11y.magnifier"; + +/* Test getting and setting boolean values */ + +var testBooleanValues = function () { + var ret = gsettings.set_gsetting(keyScreenmag, "show-cross-hairs", true); + assert.ok(ret); + ret = gsettings.set_gsetting(keyScreenmag, "show-cross-hairs", false); + assert.ok(ret); + + // Todo need to set up an event for these assertions, they run too fast, + // and get the old value from gsettings before it's propagated. + // exec('gsettings get '+keyScreenmag+' show-cross-hairs', function(res, out, err) { + // testBooleanValuesCallback1 = true; + // assert.equal('true\n', out); + // }); + + // exec('gsettings get '+keyScreenmag+' show-cross-hairs', function(res, out, err) { + // testBooleanValuesCallback2 = true; + // assert.equal('false\n', out); + // }); + +}; + +var testDecimalValues = function () { + var ret = gsettings.set_gsetting(keyScreenmag, "mag-factor", 3.0); + assert.ok(ret); + var ret2 = gsettings.set_gsetting(keyScreenmag, "mag-factor", 5.3); + assert.ok(ret2); +}; + +var testStringToEnumValues = function () { + var ret = gsettings.set_gsetting(keyScreenmag, "screen-position", "left-half"); + assert.ok(ret); +}; + +var testIntegerValues = function () { + var ret = gsettings.set_gsetting(keyScreenmag, "cross-hairs-thickness", 7); + assert.ok(ret); +}; + +/* Test Reading Values */ +var testReadingDoubleValues = function () { + var ret = gsettings.get_gsetting(keyScreenmag, "mag-factor"); + util.puts("The mag-factor is: " + ret); +}; + +var testReadingIntegerValues = function () { + var ret = gsettings.get_gsetting(keyScreenmag, "cross-hairs-thickness"); + util.puts("The cross hairs thickness is: " + ret); +}; + +var testReadingStringValues = function () { + var ret = gsettings.get_gsetting(keyScreenmag, "screen-position"); + util.puts("The screen-position is: " + ret); +}; + +var testStuff = function () { + util.puts("Testing Stuff"); + var keys = gsettings.get_gsetting_keys(keyScreenmag); + for (var i = 0; i < keys.length; i++) { + util.puts("Ok: " + keys[i]); + } + util.puts("Done Testing Stuff"); +}; + +testStuff(); + +/* Run test functions */ +testBooleanValues(); +testDecimalValues(); +testStringToEnumValues(); +testIntegerValues(); +testReadingDoubleValues(); +testReadingIntegerValues(); +testReadingStringValues(); diff --git a/node_modules/gsettingsBridge/package.json b/gpii/gsettingsBridge/package.json similarity index 100% rename from node_modules/gsettingsBridge/package.json rename to gpii/gsettingsBridge/package.json diff --git a/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json b/gpii/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json similarity index 100% rename from node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json rename to gpii/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json diff --git a/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json b/gpii/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json similarity index 100% rename from node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json rename to gpii/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json diff --git a/node_modules/gsettingsBridge/tests/data/gmag-orig.json b/gpii/gsettingsBridge/tests/data/gmag-orig.json similarity index 100% rename from node_modules/gsettingsBridge/tests/data/gmag-orig.json rename to gpii/gsettingsBridge/tests/data/gmag-orig.json diff --git a/node_modules/gsettingsBridge/tests/data/gmag-test1.json b/gpii/gsettingsBridge/tests/data/gmag-test1.json similarity index 100% rename from node_modules/gsettingsBridge/tests/data/gmag-test1.json rename to gpii/gsettingsBridge/tests/data/gmag-test1.json diff --git a/node_modules/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml b/gpii/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml similarity index 100% rename from node_modules/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml rename to gpii/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml diff --git a/node_modules/gsettingsBridge/tests/gsettingsTests.js b/gpii/gsettingsBridge/tests/gsettingsTests.js similarity index 93% rename from node_modules/gsettingsBridge/tests/gsettingsTests.js rename to gpii/gsettingsBridge/tests/gsettingsTests.js index 6c0670d..33d9b94 100644 --- a/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/gpii/gsettingsBridge/tests/gsettingsTests.js @@ -10,10 +10,11 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ -/*global console, __dirname, setTimeout, require */ +/*global require */ + +"use strict"; (function () { - // This loads universal. var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"), jqUnit = fluid.require("jqUnit"); @@ -153,7 +154,7 @@ https://github.com/gpii/universal/LICENSE.txt "double-setting": 5.0, "boolean-setting": false, "string-setting": "abcdefg" - }, + } }, { settings: { "other-string-setting": "hello world" @@ -183,27 +184,27 @@ https://github.com/gpii/universal/LICENSE.txt jqUnit.module("Gsettings Handler Tests"); - jqUnit.test("Getting single keys via gsettings handler", function() { - //First check reading single keys ... the default values: - jqUnit.assertEquals("Checking 'double' key", 5.0, + jqUnit.test("Getting single keys via gsettings handler", function () { + // First check reading single keys ... the default values: + jqUnit.assertEquals("Checking 'double' key", 5.0, gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "double-setting")); - jqUnit.assertEquals("Checking 'boolean' key", false, + jqUnit.assertEquals("Checking 'boolean' key", false, gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); - jqUnit.assertEquals("Checking 'string' key", "abcdefg", + jqUnit.assertEquals("Checking 'string' key", "abcdefg", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); }); - jqUnit.test("Setting single keys via gsettings handler", function() { - //set and check double value + jqUnit.test("Setting single keys via gsettings handler", function () { + // set and check double value gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "double-setting", 6.789); jqUnit.assertEquals("Checking 'double' key", 6.789, gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "double-setting")); - //set and check boolean value + // set and check boolean value gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting", true); jqUnit.assertEquals("Checking 'boolean' key", true, gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting")); - //set and check string value + // set and check string value gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); @@ -231,7 +232,7 @@ https://github.com/gpii/universal/LICENSE.txt jqUnit.test("GPII-8 Not core dumping on a non-existent key", function () { var response = gpii.gsettings.set(gpii8.request); - jqUnit.assertEquals("Didn't core dump. ", true,true); + jqUnit.assertValue("Didn't core dump.", response); }); }()); diff --git a/node_modules/gsettingsBridge/tests/runUnitTests.sh b/gpii/gsettingsBridge/tests/runUnitTests.sh similarity index 100% rename from node_modules/gsettingsBridge/tests/runUnitTests.sh rename to gpii/gsettingsBridge/tests/runUnitTests.sh diff --git a/node_modules/gsettingsBridge/tests/tests.js b/gpii/gsettingsBridge/tests/tests.js similarity index 61% rename from node_modules/gsettingsBridge/tests/tests.js rename to gpii/gsettingsBridge/tests/tests.js index 6e01f4f..ccce352 100644 --- a/node_modules/gsettingsBridge/tests/tests.js +++ b/gpii/gsettingsBridge/tests/tests.js @@ -1,16 +1,21 @@ +"use strict"; + var gsettings = require("../gsettings_bridge.js"); var util = require("util"); -var fs = require('fs'); +var fs = require("fs"); -var test1 = function() { - fs.readFile('data/gmag-orig.json', function(error,data) { +// TODO: Why is this commented out? +/* +var test1 = function () { + fs.readFile("data/gmag-orig.json", function (error, data) { var settings = JSON.parse(data); util.puts(JSON.stringify(gsettings.setSettings(settings))); }); }; +*/ -var test2 = function() { - fs.readFile('data/gmag-test1.json', function(error,data) { +var test2 = function () { + fs.readFile("data/gmag-test1.json", function (error, data) { var settings = JSON.parse(data); util.puts(JSON.stringify(gsettings.getSettings(settings))); }); diff --git a/node_modules/orca/index.js b/gpii/orca/index.js similarity index 100% rename from node_modules/orca/index.js rename to gpii/orca/index.js diff --git a/node_modules/orca/orcaSettingsHandler.js b/gpii/orca/orcaSettingsHandler.js similarity index 91% rename from node_modules/orca/orcaSettingsHandler.js rename to gpii/orca/orcaSettingsHandler.js index a3667b9..b22266e 100644 --- a/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/orca/orcaSettingsHandler.js @@ -16,14 +16,14 @@ var fluid = require("universal"); var gpii = fluid.registerNamespace("gpii"); - var fs = require("fs"); var spawn = require("child_process").spawn; + var fs = require("fs"); var path = require("path"); // Workaround to load orca's user-settings.conf file according to // comments on https://github.com/joyent/node/issues/6073 // - require.extensions['.conf'] = require.extensions['.json']; + require.extensions[".conf"] = require.extensions[".json"]; var ORCA_ARGS = ["--disable", "speech", "--disable", "braille", @@ -71,7 +71,7 @@ var curDate; do { curDate = new Date(); } - while(curDate-date < millis); + while (curDate-date < millis); } function applySettings(app) { @@ -92,7 +92,7 @@ " has requested these following settings: ", settings); for (var k in settings) { - fluid.set(customizedProfile, k, settings[k], fluid.model.escapedSetConfig); + fluid.set(customizedProfile, k, settings[k], fluid.model.escapedSetConfig); } customizedProfile.profile = customizedProfile.activeProfile = @@ -124,8 +124,6 @@ var app = fluid.copy(payload); var settings = fluid.get(app, "data.0.settings"); - var options = fluid.get(app, "data.0.options"); - var user = options.user; var newSettingsResponse = {}; var userRequestedSettings = settings; @@ -138,8 +136,8 @@ newSettingsResponse[settingKey] = value; }); - var noOptions = {settings: newSettingsResponse} - app["data"][0] = noOptions; + var noOptions = {settings: newSettingsResponse}; + app.data[0] = noOptions; return app; }; @@ -154,8 +152,8 @@ var maxPass = 10; var err; - while(!fs.existsSync(orcaSettingsFile)) { - if (pass == maxPass) { + while (!fs.existsSync(orcaSettingsFile)) { + if (pass === maxPass) { err = "Time limit exceeded [" + maxPass*500 + "ms] for creating Orca's configuration file"; break; @@ -173,7 +171,7 @@ } var returnValue = applySettings(profile); - fluid.set(returnObj, ['org.gnome.orca', 0], returnValue); + fluid.set(returnObj, ["org.gnome.orca", 0], returnValue); return returnObj; }; diff --git a/node_modules/orca/package.json b/gpii/orca/package.json similarity index 100% rename from node_modules/orca/package.json rename to gpii/orca/package.json diff --git a/node_modules/orca/test/orcaSettingsHandlerTests.js b/gpii/orca/test/orcaSettingsHandlerTests.js similarity index 83% rename from node_modules/orca/test/orcaSettingsHandlerTests.js rename to gpii/orca/test/orcaSettingsHandlerTests.js index 905bbca..4267a9f 100644 --- a/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/gpii/orca/test/orcaSettingsHandlerTests.js @@ -10,10 +10,10 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; + var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("jqUnit"), - fs = require("fs"); + jqUnit = fluid.require("jqUnit"); require("orca"); var orca = fluid.registerNamespace("gpii.orca"); @@ -43,16 +43,16 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { var returnPayload = orca.set(payload); // Check if profile exists - // + jqUnit.assertTrue("Profile 'test1' exists", returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1); // Check if 'test1' is the default starting profile - // - actual = returnPayload["org.gnome.orca"][0].settings["general.startingProfile"].newValue; - jqUnit.assertDeepEq("'test1' is the new starting profile", ['test1', 'test1'], actual); + + var actual = returnPayload["org.gnome.orca"][0].settings["general.startingProfile"].newValue; + jqUnit.assertDeepEq("'test1' is the new starting profile", ["test1", "test1"], actual); // Check for specific one-to-one settings from the payload - // + for (var setting in ["enableBraille", "enableEchoByWord", "enableEchoByCharacter", "enableTutorialMessages", "verbalizePunctuationStyle"]) { jqUnit.assertDeepEq("Checking " + setting + " setting", payload["org.gnome.orca"][0].settings[setting], @@ -63,17 +63,17 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { // jqUnit.assertDeepEq("Checking for voices.default.rate setting", payload["org.gnome.orca"][0].settings["voices.default.rate"], - returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices.default.rate); + returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices["default"].rate); jqUnit.assertDeepEq("Checking for voices.default.family setting", payload["org.gnome.orca"][0].settings["voices.default.family"], - returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices.default.family); + returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices["default"].family); // Let's simulate a logout and restore the settings file into its initial state // var newPayload = fluid.copy(payload); - newPayload['org.gnome.orca'][0].settings.profiles = returnPayload["org.gnome.orca"][0].settings.profiles.oldValue; - newPayload['org.gnome.orca'][0].settings['general.startingProfile'] = returnPayload["org.gnome.orca"][0].settings["general.startingProfile"].oldValue; + newPayload["org.gnome.orca"][0].settings.profiles = returnPayload["org.gnome.orca"][0].settings.profiles.oldValue; + newPayload["org.gnome.orca"][0].settings["general.startingProfile"] = returnPayload["org.gnome.orca"][0].settings["general.startingProfile"].oldValue; var newReturnPayload = orca.set(newPayload); // Check if 'test1' profile has been removed successfully diff --git a/node_modules/xrandr/index.js b/gpii/xrandr/index.js similarity index 100% rename from node_modules/xrandr/index.js rename to gpii/xrandr/index.js diff --git a/node_modules/xrandr/nodexrandr/binding.gyp b/gpii/xrandr/nodexrandr/binding.gyp similarity index 100% rename from node_modules/xrandr/nodexrandr/binding.gyp rename to gpii/xrandr/nodexrandr/binding.gyp diff --git a/node_modules/xrandr/nodexrandr/nodexrandr.cc b/gpii/xrandr/nodexrandr/nodexrandr.cc similarity index 100% rename from node_modules/xrandr/nodexrandr/nodexrandr.cc rename to gpii/xrandr/nodexrandr/nodexrandr.cc diff --git a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/gpii/xrandr/nodexrandr/nodexrandr_tests.js similarity index 97% rename from node_modules/xrandr/nodexrandr/nodexrandr_tests.js rename to gpii/xrandr/nodexrandr/nodexrandr_tests.js index ef8abb5..cc9d70b 100644 --- a/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/gpii/xrandr/nodexrandr/nodexrandr_tests.js @@ -10,6 +10,8 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; + var fluid = require("universal"), jqUnit = fluid.require("jqUnit"), xrandr = require("./build/Release/nodexrandr.node"); @@ -21,7 +23,7 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { // Check if all required methods are available through the Xrandr Bridge // - methods = ["getBrightness", "setBrightness", + var methods = ["getBrightness", "setBrightness", "getDisplays", "setScreenResolution"]; for (var method in methods) { diff --git a/node_modules/xrandr/package.json b/gpii/xrandr/package.json similarity index 100% rename from node_modules/xrandr/package.json rename to gpii/xrandr/package.json diff --git a/node_modules/xrandr/test/xrandrSettingsHandlerTests.js b/gpii/xrandr/test/xrandrSettingsHandlerTests.js similarity index 92% rename from node_modules/xrandr/test/xrandrSettingsHandlerTests.js rename to gpii/xrandr/test/xrandrSettingsHandlerTests.js index be0bc88..2e6d0c9 100644 --- a/node_modules/xrandr/test/xrandrSettingsHandlerTests.js +++ b/gpii/xrandr/test/xrandrSettingsHandlerTests.js @@ -10,12 +10,13 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; + var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"), jqUnit = fluid.require("jqUnit"); require("xrandr"); -xrandr = fluid.registerNamespace("gpii.xrandr"); +var xrandr = fluid.registerNamespace("gpii.xrandr"); jqUnit.module("GPII Xrandr Module"); @@ -25,7 +26,7 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { // Check if all required methods are available through the // Xrandr Settings Handler. // - methods = ["getBrightness", "getScreenResolution", "setBrightness", + var methods = ["getBrightness", "getScreenResolution", "setBrightness", "setScreenResolution", "get", "set"]; for (var method in methods) { jqUnit.assertTrue("Checking availability of method '" + method + "'", @@ -57,7 +58,7 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { newPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"] = returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].oldValue; - lastPayload = xrandr.set(newPayload); + var lastPayload = xrandr.set(newPayload); jqUnit.assertDeepEq("The resolution is being restored well", returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].oldValue, diff --git a/node_modules/xrandr/xrandr_bridge.js b/gpii/xrandr/xrandr_bridge.js similarity index 60% rename from node_modules/xrandr/xrandr_bridge.js rename to gpii/xrandr/xrandr_bridge.js index eedd0f0..4216fb9 100644 --- a/node_modules/xrandr/xrandr_bridge.js +++ b/gpii/xrandr/xrandr_bridge.js @@ -41,18 +41,18 @@ https://github.com/gpii/universal/LICENSE.txt fluid.defaults("gpii.xrandr.setScreenResolution", { gradeNames: "fluid.function", argumentMap: { - value: 0, + value: 0 } }); - gpii.xrandr.getBrightness = function(){ + gpii.xrandr.getBrightness = function () { return xrandr.getBrightness().value; }; - gpii.xrandr.getScreenResolution = function(){ + gpii.xrandr.getScreenResolution = function () { var displayInfo = xrandr.getDisplays(); for (var i=0; i Date: Tue, 5 Aug 2014 21:53:22 +0100 Subject: [PATCH 198/319] GPII-872: Corrected Gruntfile and directory layout --- Gruntfile.js | 13 +++++++------ gpii/{ => node_modules}/alsa/alsa_bridge.js | 0 gpii/{ => node_modules}/alsa/index.js | 0 gpii/{ => node_modules}/alsa/nodealsa/binding.gyp | 0 gpii/{ => node_modules}/alsa/nodealsa/nodealsa.cc | 0 .../alsa/nodealsa/nodealsa_tests.js | 0 gpii/{ => node_modules}/alsa/package.json | 0 .../alsa/test/alsaSettingsHandlerTests.js | 0 gpii/{ => node_modules}/gsettingsBridge/README.md | 0 .../gsettingsBridge/gsettings_bridge.js | 0 gpii/{ => node_modules}/gsettingsBridge/index.js | 0 .../gsettingsBridge/nodegsettings/binding.gyp | 0 .../gsettingsBridge/nodegsettings/nodegsettings.cc | 0 .../nodegsettings/nodegsettings_tests.js | 0 .../{ => node_modules}/gsettingsBridge/package.json | 0 ...com.gnome.builtin.magnification.example-GET.json | 0 .../com.gnome.builtin.magnification.example.json | 0 .../gsettingsBridge/tests/data/gmag-orig.json | 0 .../gsettingsBridge/tests/data/gmag-test1.json | 0 .../data/net.gpii.testing.gsettings.gschema.xml | 0 .../gsettingsBridge/tests/gsettingsTests.js | 0 .../gsettingsBridge/tests/runUnitTests.sh | 0 .../gsettingsBridge/tests/tests.js | 0 gpii/{ => node_modules}/orca/index.js | 0 gpii/{ => node_modules}/orca/orcaSettingsHandler.js | 0 gpii/{ => node_modules}/orca/package.json | 0 .../orca/test/orcaSettingsHandlerTests.js | 0 gpii/{ => node_modules}/xrandr/index.js | 0 .../xrandr/nodexrandr/binding.gyp | 0 .../xrandr/nodexrandr/nodexrandr.cc | 0 .../xrandr/nodexrandr/nodexrandr_tests.js | 0 gpii/{ => node_modules}/xrandr/package.json | 0 .../xrandr/test/xrandrSettingsHandlerTests.js | 0 gpii/{ => node_modules}/xrandr/xrandr_bridge.js | 0 34 files changed, 7 insertions(+), 6 deletions(-) rename gpii/{ => node_modules}/alsa/alsa_bridge.js (100%) rename gpii/{ => node_modules}/alsa/index.js (100%) rename gpii/{ => node_modules}/alsa/nodealsa/binding.gyp (100%) rename gpii/{ => node_modules}/alsa/nodealsa/nodealsa.cc (100%) rename gpii/{ => node_modules}/alsa/nodealsa/nodealsa_tests.js (100%) rename gpii/{ => node_modules}/alsa/package.json (100%) rename gpii/{ => node_modules}/alsa/test/alsaSettingsHandlerTests.js (100%) rename gpii/{ => node_modules}/gsettingsBridge/README.md (100%) rename gpii/{ => node_modules}/gsettingsBridge/gsettings_bridge.js (100%) rename gpii/{ => node_modules}/gsettingsBridge/index.js (100%) rename gpii/{ => node_modules}/gsettingsBridge/nodegsettings/binding.gyp (100%) rename gpii/{ => node_modules}/gsettingsBridge/nodegsettings/nodegsettings.cc (100%) rename gpii/{ => node_modules}/gsettingsBridge/nodegsettings/nodegsettings_tests.js (100%) rename gpii/{ => node_modules}/gsettingsBridge/package.json (100%) rename gpii/{ => node_modules}/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json (100%) rename gpii/{ => node_modules}/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json (100%) rename gpii/{ => node_modules}/gsettingsBridge/tests/data/gmag-orig.json (100%) rename gpii/{ => node_modules}/gsettingsBridge/tests/data/gmag-test1.json (100%) rename gpii/{ => node_modules}/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml (100%) rename gpii/{ => node_modules}/gsettingsBridge/tests/gsettingsTests.js (100%) rename gpii/{ => node_modules}/gsettingsBridge/tests/runUnitTests.sh (100%) rename gpii/{ => node_modules}/gsettingsBridge/tests/tests.js (100%) rename gpii/{ => node_modules}/orca/index.js (100%) rename gpii/{ => node_modules}/orca/orcaSettingsHandler.js (100%) rename gpii/{ => node_modules}/orca/package.json (100%) rename gpii/{ => node_modules}/orca/test/orcaSettingsHandlerTests.js (100%) rename gpii/{ => node_modules}/xrandr/index.js (100%) rename gpii/{ => node_modules}/xrandr/nodexrandr/binding.gyp (100%) rename gpii/{ => node_modules}/xrandr/nodexrandr/nodexrandr.cc (100%) rename gpii/{ => node_modules}/xrandr/nodexrandr/nodexrandr_tests.js (100%) rename gpii/{ => node_modules}/xrandr/package.json (100%) rename gpii/{ => node_modules}/xrandr/test/xrandrSettingsHandlerTests.js (100%) rename gpii/{ => node_modules}/xrandr/xrandr_bridge.js (100%) diff --git a/Gruntfile.js b/Gruntfile.js index f083d24..8dec63a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,6 +14,7 @@ https://github.com/gpii/universal/LICENSE.txt module.exports = function(grunt) { + grunt.loadNpmTasks("grunt-shell"); grunt.loadNpmTasks("grunt-contrib-jshint"); grunt.loadNpmTasks("grunt-jsonlint"); grunt.loadNpmTasks("grunt-gpii"); @@ -48,12 +49,12 @@ module.exports = function(grunt) { stderr: true, failOnError: true }, - compileGSettings: nodeGypShell("node-gyp configure build", "node_modules/gsettingsBridge/nodegsettings"), - cleanGSettings: nodeGypShell("node-gyp clean", "node_modules/gsettingsBridge/nodegsettings"), - compileAlsaBridge: nodeGypShell("node-gyp configure build", "node_modules/alsa/nodealsa"), - cleanAlsaBridge: nodeGypShell("node-gyp clean", "node_modules/alsa/nodealsa"), - compileXrandrBridge: nodeGypShell("node-gyp configure build", "node_modules/xrandr/nodexrandr"), - cleanXrandrBridge: nodeGypShell("node-gyp clean", "node_modules/xrandr/nodexrandr"), + compileGSettings: nodeGypShell("node-gyp configure build", "gpii/node_modules/gsettingsBridge/nodegsettings"), + cleanGSettings: nodeGypShell("node-gyp clean", "gpii/node_modules/gsettingsBridge/nodegsettings"), + compileAlsaBridge: nodeGypShell("node-gyp configure build", "gpii/node_modules/alsa/nodealsa"), + cleanAlsaBridge: nodeGypShell("node-gyp clean", "gpii/node_modules/alsa/nodealsa"), + compileXrandrBridge: nodeGypShell("node-gyp configure build", "gpii/node_modules/xrandr/nodexrandr"), + cleanXrandrBridge: nodeGypShell("node-gyp clean", "gpii/node_modules/xrandr/nodexrandr"), installUsbLib: { command: [ "sudo cp " + usbListenerDir + "/gpii-usb-user-listener /usr/bin/", diff --git a/gpii/alsa/alsa_bridge.js b/gpii/node_modules/alsa/alsa_bridge.js similarity index 100% rename from gpii/alsa/alsa_bridge.js rename to gpii/node_modules/alsa/alsa_bridge.js diff --git a/gpii/alsa/index.js b/gpii/node_modules/alsa/index.js similarity index 100% rename from gpii/alsa/index.js rename to gpii/node_modules/alsa/index.js diff --git a/gpii/alsa/nodealsa/binding.gyp b/gpii/node_modules/alsa/nodealsa/binding.gyp similarity index 100% rename from gpii/alsa/nodealsa/binding.gyp rename to gpii/node_modules/alsa/nodealsa/binding.gyp diff --git a/gpii/alsa/nodealsa/nodealsa.cc b/gpii/node_modules/alsa/nodealsa/nodealsa.cc similarity index 100% rename from gpii/alsa/nodealsa/nodealsa.cc rename to gpii/node_modules/alsa/nodealsa/nodealsa.cc diff --git a/gpii/alsa/nodealsa/nodealsa_tests.js b/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js similarity index 100% rename from gpii/alsa/nodealsa/nodealsa_tests.js rename to gpii/node_modules/alsa/nodealsa/nodealsa_tests.js diff --git a/gpii/alsa/package.json b/gpii/node_modules/alsa/package.json similarity index 100% rename from gpii/alsa/package.json rename to gpii/node_modules/alsa/package.json diff --git a/gpii/alsa/test/alsaSettingsHandlerTests.js b/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js similarity index 100% rename from gpii/alsa/test/alsaSettingsHandlerTests.js rename to gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js diff --git a/gpii/gsettingsBridge/README.md b/gpii/node_modules/gsettingsBridge/README.md similarity index 100% rename from gpii/gsettingsBridge/README.md rename to gpii/node_modules/gsettingsBridge/README.md diff --git a/gpii/gsettingsBridge/gsettings_bridge.js b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js similarity index 100% rename from gpii/gsettingsBridge/gsettings_bridge.js rename to gpii/node_modules/gsettingsBridge/gsettings_bridge.js diff --git a/gpii/gsettingsBridge/index.js b/gpii/node_modules/gsettingsBridge/index.js similarity index 100% rename from gpii/gsettingsBridge/index.js rename to gpii/node_modules/gsettingsBridge/index.js diff --git a/gpii/gsettingsBridge/nodegsettings/binding.gyp b/gpii/node_modules/gsettingsBridge/nodegsettings/binding.gyp similarity index 100% rename from gpii/gsettingsBridge/nodegsettings/binding.gyp rename to gpii/node_modules/gsettingsBridge/nodegsettings/binding.gyp diff --git a/gpii/gsettingsBridge/nodegsettings/nodegsettings.cc b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc similarity index 100% rename from gpii/gsettingsBridge/nodegsettings/nodegsettings.cc rename to gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc diff --git a/gpii/gsettingsBridge/nodegsettings/nodegsettings_tests.js b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js similarity index 100% rename from gpii/gsettingsBridge/nodegsettings/nodegsettings_tests.js rename to gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js diff --git a/gpii/gsettingsBridge/package.json b/gpii/node_modules/gsettingsBridge/package.json similarity index 100% rename from gpii/gsettingsBridge/package.json rename to gpii/node_modules/gsettingsBridge/package.json diff --git a/gpii/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json b/gpii/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json similarity index 100% rename from gpii/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json rename to gpii/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example-GET.json diff --git a/gpii/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json b/gpii/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json similarity index 100% rename from gpii/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json rename to gpii/node_modules/gsettingsBridge/tests/data/com.gnome.builtin.magnification.example.json diff --git a/gpii/gsettingsBridge/tests/data/gmag-orig.json b/gpii/node_modules/gsettingsBridge/tests/data/gmag-orig.json similarity index 100% rename from gpii/gsettingsBridge/tests/data/gmag-orig.json rename to gpii/node_modules/gsettingsBridge/tests/data/gmag-orig.json diff --git a/gpii/gsettingsBridge/tests/data/gmag-test1.json b/gpii/node_modules/gsettingsBridge/tests/data/gmag-test1.json similarity index 100% rename from gpii/gsettingsBridge/tests/data/gmag-test1.json rename to gpii/node_modules/gsettingsBridge/tests/data/gmag-test1.json diff --git a/gpii/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml b/gpii/node_modules/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml similarity index 100% rename from gpii/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml rename to gpii/node_modules/gsettingsBridge/tests/data/net.gpii.testing.gsettings.gschema.xml diff --git a/gpii/gsettingsBridge/tests/gsettingsTests.js b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js similarity index 100% rename from gpii/gsettingsBridge/tests/gsettingsTests.js rename to gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js diff --git a/gpii/gsettingsBridge/tests/runUnitTests.sh b/gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh similarity index 100% rename from gpii/gsettingsBridge/tests/runUnitTests.sh rename to gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh diff --git a/gpii/gsettingsBridge/tests/tests.js b/gpii/node_modules/gsettingsBridge/tests/tests.js similarity index 100% rename from gpii/gsettingsBridge/tests/tests.js rename to gpii/node_modules/gsettingsBridge/tests/tests.js diff --git a/gpii/orca/index.js b/gpii/node_modules/orca/index.js similarity index 100% rename from gpii/orca/index.js rename to gpii/node_modules/orca/index.js diff --git a/gpii/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js similarity index 100% rename from gpii/orca/orcaSettingsHandler.js rename to gpii/node_modules/orca/orcaSettingsHandler.js diff --git a/gpii/orca/package.json b/gpii/node_modules/orca/package.json similarity index 100% rename from gpii/orca/package.json rename to gpii/node_modules/orca/package.json diff --git a/gpii/orca/test/orcaSettingsHandlerTests.js b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js similarity index 100% rename from gpii/orca/test/orcaSettingsHandlerTests.js rename to gpii/node_modules/orca/test/orcaSettingsHandlerTests.js diff --git a/gpii/xrandr/index.js b/gpii/node_modules/xrandr/index.js similarity index 100% rename from gpii/xrandr/index.js rename to gpii/node_modules/xrandr/index.js diff --git a/gpii/xrandr/nodexrandr/binding.gyp b/gpii/node_modules/xrandr/nodexrandr/binding.gyp similarity index 100% rename from gpii/xrandr/nodexrandr/binding.gyp rename to gpii/node_modules/xrandr/nodexrandr/binding.gyp diff --git a/gpii/xrandr/nodexrandr/nodexrandr.cc b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc similarity index 100% rename from gpii/xrandr/nodexrandr/nodexrandr.cc rename to gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc diff --git a/gpii/xrandr/nodexrandr/nodexrandr_tests.js b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js similarity index 100% rename from gpii/xrandr/nodexrandr/nodexrandr_tests.js rename to gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js diff --git a/gpii/xrandr/package.json b/gpii/node_modules/xrandr/package.json similarity index 100% rename from gpii/xrandr/package.json rename to gpii/node_modules/xrandr/package.json diff --git a/gpii/xrandr/test/xrandrSettingsHandlerTests.js b/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js similarity index 100% rename from gpii/xrandr/test/xrandrSettingsHandlerTests.js rename to gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js diff --git a/gpii/xrandr/xrandr_bridge.js b/gpii/node_modules/xrandr/xrandr_bridge.js similarity index 100% rename from gpii/xrandr/xrandr_bridge.js rename to gpii/node_modules/xrandr/xrandr_bridge.js From bc593a22f69c7ffdd5743572cdb0c00022b5e03a Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Sun, 10 Aug 2014 12:58:15 -0400 Subject: [PATCH 199/319] GPII-872 Putting package.json ref back to GPII from amb26 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 146fe6e..37b0fca 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "grunt-shell": "0.6.4", "grunt-contrib-jshint": "~0.9.0", "grunt-jsonlint": "1.0.4", - "grunt-gpii": "git://github.com/amb26/grunt-gpii.git#a1ec3cba74de0a481a921be2985f7bb443364bfb" + "grunt-gpii": "git://github.com/GPII/grunt-gpii.git#a4aca06cbaf7523eb1af56ed65ce6bd30b8ec325" }, "licenses": [ { From 0339dab2214f2b3ed13091b5a45ec76056f38cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 11 Aug 2014 18:40:10 +0200 Subject: [PATCH 200/319] Moving packagekit module into gpii folder --- {node_modules => gpii/node_modules}/packagekit/index.js | 0 .../node_modules}/packagekit/nodepackagekit/binding.gyp | 0 .../node_modules}/packagekit/nodepackagekit/findSearchPk.js | 0 .../node_modules}/packagekit/nodepackagekit/nodepackagekit.cc | 0 .../packagekit/nodepackagekit/nodepackagekit_test.js | 0 {node_modules => gpii/node_modules}/packagekit/package.json | 0 .../node_modules}/packagekit/packageKitDeviceReporter.js | 0 {node_modules => gpii/node_modules}/packagekit/test/all-tests.js | 0 .../packagekit/test/packageKitDeviceReporterTests.js | 0 .../node_modules}/packagekit/test/packageKitModuleTests.js | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename {node_modules => gpii/node_modules}/packagekit/index.js (100%) rename {node_modules => gpii/node_modules}/packagekit/nodepackagekit/binding.gyp (100%) rename {node_modules => gpii/node_modules}/packagekit/nodepackagekit/findSearchPk.js (100%) rename {node_modules => gpii/node_modules}/packagekit/nodepackagekit/nodepackagekit.cc (100%) rename {node_modules => gpii/node_modules}/packagekit/nodepackagekit/nodepackagekit_test.js (100%) rename {node_modules => gpii/node_modules}/packagekit/package.json (100%) rename {node_modules => gpii/node_modules}/packagekit/packageKitDeviceReporter.js (100%) rename {node_modules => gpii/node_modules}/packagekit/test/all-tests.js (100%) rename {node_modules => gpii/node_modules}/packagekit/test/packageKitDeviceReporterTests.js (100%) rename {node_modules => gpii/node_modules}/packagekit/test/packageKitModuleTests.js (100%) diff --git a/node_modules/packagekit/index.js b/gpii/node_modules/packagekit/index.js similarity index 100% rename from node_modules/packagekit/index.js rename to gpii/node_modules/packagekit/index.js diff --git a/node_modules/packagekit/nodepackagekit/binding.gyp b/gpii/node_modules/packagekit/nodepackagekit/binding.gyp similarity index 100% rename from node_modules/packagekit/nodepackagekit/binding.gyp rename to gpii/node_modules/packagekit/nodepackagekit/binding.gyp diff --git a/node_modules/packagekit/nodepackagekit/findSearchPk.js b/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js similarity index 100% rename from node_modules/packagekit/nodepackagekit/findSearchPk.js rename to gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc similarity index 100% rename from node_modules/packagekit/nodepackagekit/nodepackagekit.cc rename to gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc diff --git a/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js similarity index 100% rename from node_modules/packagekit/nodepackagekit/nodepackagekit_test.js rename to gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js diff --git a/node_modules/packagekit/package.json b/gpii/node_modules/packagekit/package.json similarity index 100% rename from node_modules/packagekit/package.json rename to gpii/node_modules/packagekit/package.json diff --git a/node_modules/packagekit/packageKitDeviceReporter.js b/gpii/node_modules/packagekit/packageKitDeviceReporter.js similarity index 100% rename from node_modules/packagekit/packageKitDeviceReporter.js rename to gpii/node_modules/packagekit/packageKitDeviceReporter.js diff --git a/node_modules/packagekit/test/all-tests.js b/gpii/node_modules/packagekit/test/all-tests.js similarity index 100% rename from node_modules/packagekit/test/all-tests.js rename to gpii/node_modules/packagekit/test/all-tests.js diff --git a/node_modules/packagekit/test/packageKitDeviceReporterTests.js b/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js similarity index 100% rename from node_modules/packagekit/test/packageKitDeviceReporterTests.js rename to gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js diff --git a/node_modules/packagekit/test/packageKitModuleTests.js b/gpii/node_modules/packagekit/test/packageKitModuleTests.js similarity index 100% rename from node_modules/packagekit/test/packageKitModuleTests.js rename to gpii/node_modules/packagekit/test/packageKitModuleTests.js From 30dd35bebc41d4f8d1ddb1a594a18f48c539f98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 11 Aug 2014 20:17:53 +0200 Subject: [PATCH 201/319] Linting packageKit module --- gpii/node_modules/packagekit/index.js | 2 +- .../packagekit/nodepackagekit/findSearchPk.js | 84 ++-- .../nodepackagekit/nodepackagekit_test.js | 426 +++++++++--------- .../node_modules/packagekit/test/all-tests.js | 3 +- .../test/packageKitDeviceReporterTests.js | 1 + .../packagekit/test/packageKitModuleTests.js | 5 +- 6 files changed, 264 insertions(+), 257 deletions(-) diff --git a/gpii/node_modules/packagekit/index.js b/gpii/node_modules/packagekit/index.js index 74ca83d..d019e0e 100644 --- a/gpii/node_modules/packagekit/index.js +++ b/gpii/node_modules/packagekit/index.js @@ -21,7 +21,7 @@ loader.require("./packageKitDeviceReporter.js"); // Right now this is provisional, so we have to re-think how to initialize it // in a smarter way. http://issues.gpii.net/browse/GPII-851 // -gpii = fluid.registerNamespace("gpii"); +var gpii = fluid.registerNamespace("gpii"); fluid.registerNamespace("gpii.packageKit"); var packageKit = require("./nodepackagekit/build/Release/nodepackagekit.node"); diff --git a/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js b/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js index 5ed4578..6df3963 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -93,64 +93,66 @@ packages found. // - searchNotInstalled() is used when 'find' found nothing. // - searchInstalled() is used when 'find' found something. function searchNotInstalled() { - packages = packagekit.searchPackage (lookingFor, "~installed;basename"); + packages = packagekit.searchPackage (lookingFor, "~installed;basename"); } function searchInstalled() { - packages = packagekit.searchFiles (whatFindFound); - if (packages.length === 0) { - packages = packagekit.searchPackage (lookingFor, "installed;basename"); - } + packages = packagekit.searchFiles (whatFindFound); + if (packages.length === 0) { + packages = packagekit.searchPackage (lookingFor, "installed;basename"); + } } // Handle 'find' on close event -- invoke packagekit.searchPackage(). function onFindClose() { - console.log ("'find' found " + - ( whatFindFound.length === 0 ? "nothing" : whatFindFound )); - - if (whatFindFound.length === 0) { - searchNotInstalled(); - } - else { - searchInstalled(); - if (packages.length === 0) { - searchNotInstalled(); + console.log ("'find' found " + + ( whatFindFound.length === 0 ? "nothing" : whatFindFound )); + + if (whatFindFound.length === 0) { + searchNotInstalled(); + } + else { + searchInstalled(); + if (packages.length === 0) { + searchNotInstalled(); + } + } + if (packages.length > 0) { + console.log (JSON.stringify (packages, null, " ")); + } + else { + console.log ("No package found"); } - } - if (packages.length > 0) { - console.log (JSON.stringify (packages, null, " ")); - } - else { - console.log ("No package found"); - } } function onFindStdout (data) { - var found = data.toString().split ("\n"); - found.forEach (function (value) { - if (value.length > 0) { - whatFindFound.push (value); - } - }); + var found = data.toString().split ("\n"); + found.forEach (function (value) { + if (value.length > 0) { + whatFindFound.push (value); + } + }); } if (lookingFor !== undefined) { - var findArgs = process.env.PATH.split (":"); - findArgs.push (process.env.HOME); - findArgs.push ("-name"); findArgs.push (lookingFor); - findArgs.push ("-type"); findArgs.push ("f"); // only regular files. - findArgs.push ("-print"); + var findArgs = process.env.PATH.split (":"); + findArgs.push (process.env.HOME); + findArgs.push ("-name"); + findArgs.push (lookingFor); + findArgs.push ("-type"); + findArgs.push ("f"); // only regular files. + findArgs.push ("-print"); - // Run 'find' - var spawn = require ("child_process").spawn, - find = spawn ("find", findArgs); + // Run 'find' + var spawn = require ("child_process").spawn, + find = spawn ("find", findArgs); - find.stdout.on ("data", onFindStdout); + find.stdout.on ("data", onFindStdout); - find.on ("close", onFindClose); + find.on ("close", onFindClose); - find.on ("error", function (err) { - console.log ("child process : " + err); - }); + find.on ("error", function (err) { + console.log ("child process : " + err); + }); } }()); diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index ef42bf4..e399d5d 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -20,219 +20,219 @@ var fluid = require ("universal"), (function() { - "use strict"; - - var pkTests = fluid.registerNamespace ("gpii.tests.packageKit"); - - pkTests.isInstalled = function (pkg) { - return (!!pkg && (pkg.data.indexOf ("installed") !== -1)); - }; - - pkTests.findGlib2 = function (aPkg) { - return aPkg.name === "glib2"; - }; - - pkTests.findPackageByName = function (name, pkgArray) { - return fluid.find (pkgArray, function (aPkg) { - if (aPkg.name === name) { - return aPkg; - } - }, null); - }; - - // Return the package that matches name, version, and architecture. - pkTests.getMatchingPackage = function (pkg, pkgList) { - return fluid.find (pkgList, function (aPkg) { - if (aPkg.name === pkg.name && - aPkg.version === pkg.version && - aPkg.arch === pkg.arch) { - return aPkg; - } - }, null); - }; - - pkTests.initTuxguitar = function() { - var tuxguitar = { - pkgList: [], - pkg: null, - inInstalledList: false, - inAvailableList: false - }; - var pkgs = packagekit.searchPackage ("tuxguitar"); - tuxguitar.pkgList = pkgs; - tuxguitar.pkg = pkTests.findPackageByName ("tuxguitar", pkgs); - return tuxguitar; - }; - - pkTests.isTuxguitarInList = function (tuxguitar, pkgList) { - var matchPkg = pkTests.getMatchingPackage (tuxguitar.pkg, pkgList); - return (matchPkg !== null); - }; - - pkTests.initSearchTest = function() { - var tuxguitar = pkTests.initTuxguitar(); - var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); - tuxguitar.inInstalledList = - pkTests.isTuxguitarInList (tuxguitar, installedPkgs); - var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - tuxguitar.inAvailableList = - pkTests.isTuxguitarInList (tuxguitar, availablePkgs); - return tuxguitar; - }; - - pkTests.initGetTest = function() { - var tuxguitar = pkTests.initTuxguitar(); - var installedPkgs = packagekit.getPackages ("installed"); - tuxguitar.inInstalledList = + "use strict"; + + var pkTests = fluid.registerNamespace ("gpii.tests.packageKit"); + + pkTests.isInstalled = function (pkg) { + return (!!pkg && (pkg.data.indexOf ("installed") !== -1)); + }; + + pkTests.findGlib2 = function (aPkg) { + return aPkg.name === "glib2"; + }; + + pkTests.findPackageByName = function (name, pkgArray) { + return fluid.find (pkgArray, function (aPkg) { + if (aPkg.name === name) { + return aPkg; + } + }, null); + }; + + // Return the package that matches name, version, and architecture. + pkTests.getMatchingPackage = function (pkg, pkgList) { + return fluid.find (pkgList, function (aPkg) { + if (aPkg.name === pkg.name && + aPkg.version === pkg.version && + aPkg.arch === pkg.arch) { + return aPkg; + } + }, null); + }; + + pkTests.initTuxguitar = function() { + var tuxguitar = { + pkgList: [], + pkg: null, + inInstalledList: false, + inAvailableList: false + }; + var pkgs = packagekit.searchPackage ("tuxguitar"); + tuxguitar.pkgList = pkgs; + tuxguitar.pkg = pkTests.findPackageByName ("tuxguitar", pkgs); + return tuxguitar; + }; + + pkTests.isTuxguitarInList = function (tuxguitar, pkgList) { + var matchPkg = pkTests.getMatchingPackage (tuxguitar.pkg, pkgList); + return (matchPkg !== null); + }; + + pkTests.initSearchTest = function() { + var tuxguitar = pkTests.initTuxguitar(); + var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); + tuxguitar.inInstalledList = pkTests.isTuxguitarInList (tuxguitar, installedPkgs); - var availablePkgs = packagekit.getPackages ("~installed"); - tuxguitar.inAvailableList = + var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); + tuxguitar.inAvailableList = pkTests.isTuxguitarInList (tuxguitar, availablePkgs); - return tuxguitar; - }; - - pkTests.runInstalledVsAvailableTests = function (tuxguitar, msg) { - // Depending on whether tuxguitar is installed on not, check that it - // appears correctly in the installed or available lists. - if (pkTests.isInstalled (tuxguitar.pkg)) { - jqUnit.assertTrue (msg + " 'tuxguitar' in installed packages list", - tuxguitar.inInstalledList); - jqUnit.assertFalse (msg + " 'tuxguitar' not in available packages " + - "list", tuxguitar.inAvailableList); - } - else { - jqUnit.assertFalse (msg + " 'tuxguitar' not in installed packages " + - "list", tuxguitar.inInstalledList); - jqUnit.assertTrue (msg + " 'tuxguitar' is in available packages list", - tuxguitar.inAvailableList); - } - }; - - pkTests.searchForMatch = function (tuxguitar, searchFilter) { - var pkgs = packagekit.searchPackage ("tuxguitar", searchFilter); - return pkTests.getMatchingPackage (tuxguitar.pkg, pkgs); - }; - - pkTests.testRemovePackage = function (tuxguitar, matchPkg) { - var id = ( matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); - - // GPII-880: The 'remove' action requires an administrator password. - // Packagekit invokes PolKit authentication, putting up a dialog to - // capture aforesaid password. This needs to be automated. - packagekit.performAction ("remove", id); - matchPkg = pkTests.searchForMatch (tuxguitar, "~installed"); - jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); - return matchPkg; - }; - - pkTests.testInstallPackage = function (tuxguitar, matchPkg) { - var id = ( matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); - packagekit.performAction ("install", id); - matchPkg = pkTests.searchForMatch (tuxguitar, "installed"); - jqUnit.assertNotNull ("Install tuxguitar package", matchPkg); - return matchPkg; - }; - - jqUnit.module ("PackageKit Bridge node add-on module"); - - jqUnit.test ( - "Test searchPackage() of 'glib2' with implicit 'none' filter, meaning " + - "installed or available.", function() { - - // Packagekit-glib -- the code this add-on invokes -- itself depends on - // glib2. It must be installed, if this is running. - var pkgs = packagekit.searchPackage ("glib2"); - var found = pkgs.some (pkTests.findGlib2); - jqUnit.assertTrue ("Search 'glib2', implicit 'none' filter", found); - }); - - jqUnit.test ( - "Test searchPackage() 'glib2' with explicit 'none' filter.", function() { - - var pkgs = packagekit.searchPackage ("glib2", "none"); - var found = pkgs.some (pkTests.findGlib2); - jqUnit.assertTrue ("Search 'glib2', explicit 'none' filter", found); - }); - - jqUnit.test ("Test searchFiles() for '/usr/bin/ls'.", function() { - - // The searchFiles() function expects the full path name where the package - // would be installed, even it if is not installed. Check using the - // common utility 'ls'. - var pkgs = packagekit.searchFiles ("/usr/bin/ls"); - jqUnit.assertNotEquals ( - "Search file '/usr/bin/ls', implicit 'none' filter", 0, pkgs.length - ); - jqUnit.assertTrue ("'ls' is installed", pkTests.isInstalled (pkgs[0])); - }); - - jqUnit.test ("Test searchPackage() with 'tuxguitar' comparing installed " + - "vs. available filters.", function() { - - // Test the "installed" vs. "~installed" filters with regards to - // 'tuxguitar', and the array of packages returned by searchPackage() - // using the filters. Use the tuxguitar package, whether installed or - // not, to test against the two arrays. - var tuxguitar = pkTests.initSearchTest(); - pkTests.runInstalledVsAvailableTests (tuxguitar, "Search"); - }); - - jqUnit.test ("Test getPackages() with tuxguitar comparing installed vs. " + - "available filters.", function() { - var tuxguitar = pkTests.initGetTest(); - pkTests.runInstalledVsAvailableTests (tuxguitar, "Get"); - }); - - jqUnit.test ("Test performAction(): 'install' and 'remove' tuxguitar." + - " The order depends on whether tuxguitar is currently " + - "installed.", function() { - - // GPII-880: The 'remove' test requires an administrator password. - // Packagekit invokes PolKit authentication, putting up a dialog to - // capture aforesaid password. This needs to be automated. - - // Using the tuxguitar package: If it's installed, test removing it and - // then (re)install it ... - var matchPkg; - var tuxguitar = pkTests.initTuxguitar(); - if (pkTests.isInstalled (tuxguitar.pkg)) { - matchPkg = pkTests.testRemovePackage (tuxguitar, null); - pkTests.testInstallPackage (tuxguitar, matchPkg); - } - // ...if it isn't installed, test installing it and then removing it. - else { - matchPkg = pkTests.testInstallPackage (tuxguitar, null); - pkTests.testRemovePackage (tuxguitar, matchPkg); - } - }); - - jqUnit.test ("Test updatePackage(): with 'emacspeak'", function() { - - // The package ids of an old and newer version of 'emacspeak'. - // TODO: JS: While the following check against two version of - // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, - // the check that searchPackage() finds the two versions. If so, the test - // is run; otherwise no test is run. Need to find a better way to find - // multiple versions of a package to test against. - var oldEmacspeak = "38.0-5.fc20"; - var newEmacspeak = "39.0-1.fc20"; - var pkgs = packagekit.searchPackage ("emacspseak"); - if (pkgs.length === 2 && - (pkgs[0].version === oldEmacspeak && - pkgs[1].version === newEmacspeak && - pkgs[1].data.indexOf("updates") !== -1)) { - - packagekit.updatePackage (pkgs[1].id); - var currentPkgs = packagekit.searchPackage ("emacspseak","installed"); - jqUnit.assertEquals ("Updating to " + newEmacspeak, - currentPkgs[0].version, newEmacspeak); - - // Restore to previous. - packagekit.removePackage (currentPkgs[0].id); - } - else { - jqUnit.assertTrue ("Cannot test update of emacspeak as there are no " + - "updates", true); - } - }); + return tuxguitar; + }; + + pkTests.initGetTest = function() { + var tuxguitar = pkTests.initTuxguitar(); + var installedPkgs = packagekit.getPackages ("installed"); + tuxguitar.inInstalledList = + pkTests.isTuxguitarInList (tuxguitar, installedPkgs); + var availablePkgs = packagekit.getPackages ("~installed"); + tuxguitar.inAvailableList = + pkTests.isTuxguitarInList (tuxguitar, availablePkgs); + return tuxguitar; + }; + + pkTests.runInstalledVsAvailableTests = function (tuxguitar, msg) { + // Depending on whether tuxguitar is installed on not, check that it + // appears correctly in the installed or available lists. + if (pkTests.isInstalled (tuxguitar.pkg)) { + jqUnit.assertTrue (msg + " 'tuxguitar' in installed packages list", + tuxguitar.inInstalledList); + jqUnit.assertFalse (msg + " 'tuxguitar' not in available packages " + + "list", tuxguitar.inAvailableList); + } + else { + jqUnit.assertFalse (msg + " 'tuxguitar' not in installed packages " + + "list", tuxguitar.inInstalledList); + jqUnit.assertTrue (msg + " 'tuxguitar' is in available packages list", + tuxguitar.inAvailableList); + } + }; + + pkTests.searchForMatch = function (tuxguitar, searchFilter) { + var pkgs = packagekit.searchPackage ("tuxguitar", searchFilter); + return pkTests.getMatchingPackage (tuxguitar.pkg, pkgs); + }; + + pkTests.testRemovePackage = function (tuxguitar, matchPkg) { + var id = ( matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); + + // GPII-880: The 'remove' action requires an administrator password. + // Packagekit invokes PolKit authentication, putting up a dialog to + // capture aforesaid password. This needs to be automated. + packagekit.performAction ("remove", id); + matchPkg = pkTests.searchForMatch (tuxguitar, "~installed"); + jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); + return matchPkg; + }; + + pkTests.testInstallPackage = function (tuxguitar, matchPkg) { + var id = ( matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); + packagekit.performAction ("install", id); + matchPkg = pkTests.searchForMatch (tuxguitar, "installed"); + jqUnit.assertNotNull ("Install tuxguitar package", matchPkg); + return matchPkg; + }; + + jqUnit.module ("PackageKit Bridge node add-on module"); + + jqUnit.test ( + "Test searchPackage() of 'glib2' with implicit 'none' filter, meaning " + + "installed or available.", function() { + + // Packagekit-glib -- the code this add-on invokes -- itself depends on + // glib2. It must be installed, if this is running. + var pkgs = packagekit.searchPackage ("glib2"); + var found = pkgs.some (pkTests.findGlib2); + jqUnit.assertTrue ("Search 'glib2', implicit 'none' filter", found); + }); + + jqUnit.test ( + "Test searchPackage() 'glib2' with explicit 'none' filter.", function() { + + var pkgs = packagekit.searchPackage ("glib2", "none"); + var found = pkgs.some (pkTests.findGlib2); + jqUnit.assertTrue ("Search 'glib2', explicit 'none' filter", found); + }); + + jqUnit.test ("Test searchFiles() for '/usr/bin/ls'.", function() { + + // The searchFiles() function expects the full path name where the package + // would be installed, even it if is not installed. Check using the + // common utility 'ls'. + var pkgs = packagekit.searchFiles ("/usr/bin/ls"); + jqUnit.assertNotEquals ( + "Search file '/usr/bin/ls', implicit 'none' filter", 0, pkgs.length + ); + jqUnit.assertTrue ("'ls' is installed", pkTests.isInstalled (pkgs[0])); + }); + + jqUnit.test ("Test searchPackage() with 'tuxguitar' comparing installed " + + "vs. available filters.", function() { + + // Test the "installed" vs. "~installed" filters with regards to + // 'tuxguitar', and the array of packages returned by searchPackage() + // using the filters. Use the tuxguitar package, whether installed or + // not, to test against the two arrays. + var tuxguitar = pkTests.initSearchTest(); + pkTests.runInstalledVsAvailableTests (tuxguitar, "Search"); + }); + + jqUnit.test ("Test getPackages() with tuxguitar comparing installed vs. " + + "available filters.", function() { + var tuxguitar = pkTests.initGetTest(); + pkTests.runInstalledVsAvailableTests (tuxguitar, "Get"); + }); + + jqUnit.test ("Test performAction(): 'install' and 'remove' tuxguitar." + + " The order depends on whether tuxguitar is currently " + + "installed.", function() { + + // GPII-880: The 'remove' test requires an administrator password. + // Packagekit invokes PolKit authentication, putting up a dialog to + // capture aforesaid password. This needs to be automated. + + // Using the tuxguitar package: If it's installed, test removing it and + // then (re)install it ... + var matchPkg; + var tuxguitar = pkTests.initTuxguitar(); + if (pkTests.isInstalled (tuxguitar.pkg)) { + matchPkg = pkTests.testRemovePackage (tuxguitar, null); + pkTests.testInstallPackage (tuxguitar, matchPkg); + } + // ...if it isn't installed, test installing it and then removing it. + else { + matchPkg = pkTests.testInstallPackage (tuxguitar, null); + pkTests.testRemovePackage (tuxguitar, matchPkg); + } + }); + + jqUnit.test ("Test updatePackage(): with 'emacspeak'", function() { + + // The package ids of an old and newer version of 'emacspeak'. + // TODO: JS: While the following check against two version of + // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, + // the check that searchPackage() finds the two versions. If so, the test + // is run; otherwise no test is run. Need to find a better way to find + // multiple versions of a package to test against. + var oldEmacspeak = "38.0-5.fc20"; + var newEmacspeak = "39.0-1.fc20"; + var pkgs = packagekit.searchPackage ("emacspseak"); + if (pkgs.length === 2 && + (pkgs[0].version === oldEmacspeak && + pkgs[1].version === newEmacspeak && + pkgs[1].data.indexOf("updates") !== -1)) { + + packagekit.updatePackage (pkgs[1].id); + var currentPkgs = packagekit.searchPackage ("emacspseak","installed"); + jqUnit.assertEquals ("Updating to " + newEmacspeak, + currentPkgs[0].version, newEmacspeak); + + // Restore to previous. + packagekit.removePackage (currentPkgs[0].id); + } + else { + jqUnit.assertTrue ("Cannot test update of emacspeak as there are no " + + "updates", true); + } + }); }()); diff --git a/gpii/node_modules/packagekit/test/all-tests.js b/gpii/node_modules/packagekit/test/all-tests.js index 898a5e1..b944e90 100644 --- a/gpii/node_modules/packagekit/test/all-tests.js +++ b/gpii/node_modules/packagekit/test/all-tests.js @@ -9,8 +9,9 @@ * You may obtain a copy of the License at * https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; -var fluid = require("universal"); +var fluid = require("universal"), kettle = fluid.require("kettle"); fluid.require("kettle/test/utils/js/KettleTestUtils"); diff --git a/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js b/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js index e5745fe..c9b9a98 100644 --- a/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js +++ b/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js @@ -9,6 +9,7 @@ * You may obtain a copy of the License at * https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"), diff --git a/gpii/node_modules/packagekit/test/packageKitModuleTests.js b/gpii/node_modules/packagekit/test/packageKitModuleTests.js index 407d940..37ca370 100644 --- a/gpii/node_modules/packagekit/test/packageKitModuleTests.js +++ b/gpii/node_modules/packagekit/test/packageKitModuleTests.js @@ -9,12 +9,15 @@ * You may obtain a copy of the License at * https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; var fluid = require("universal"), jqUnit = fluid.require("jqUnit"); require("packagekit"); -packageKit = fluid.registerNamespace("gpii.packageKit"); + +var gpii = fluid.registerNamespace("gpii"); +var packageKit = fluid.registerNamespace("gpii.packageKit"); jqUnit.module("GPII PackageKit Module"); From f7e743f3d3be414eb012faeadb2f721394d708bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 14 Aug 2014 14:26:37 +0200 Subject: [PATCH 202/319] GPII-904: Fixing a typo that breaks alsaSettingsHandlerTests.js --- gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js b/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js index c33347b..8a4ed1d 100644 --- a/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js +++ b/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js @@ -47,8 +47,8 @@ jqUnit.test("Running tests for ALSA Settings Handler", function () { payload["org.alsa-project"][0].settings.masterVolume); var newPayload = fluid.copy(payload); - newPayload["org.alsa-project"][0].settingsmasterVolume = - returnPayload["org.alsa-project"][0].settingsmasterVolume.oldValue; + newPayload["org.alsa-project"][0].settings.masterVolume = + returnPayload["org.alsa-project"][0].settings.masterVolume.oldValue; var lastPayload = alsa.set(newPayload); From 839f7cfe1faa30bc580de54eb03bfe9de20c350b Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Thu, 21 Aug 2014 13:20:34 -0400 Subject: [PATCH 203/319] GPII-920: Modify USB lib grunt tasks to handle non-fatal errors gracefully. Added -p flag to mkdir command so as to not fail if the directory already exists (installUsbLib). Added -r flag to rm of /var/lib/gpii directory to handle non-empty directory (uninstallUsbLib). --- Gruntfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 8dec63a..3c94efd 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -60,14 +60,14 @@ module.exports = function(grunt) { "sudo cp " + usbListenerDir + "/gpii-usb-user-listener /usr/bin/", "sudo cp " + usbListenerDir + "/gpii-usb-user-listener.desktop /usr/share/applications/", - "sudo mkdir /var/lib/gpii" + "sudo mkdir -p /var/lib/gpii" ].join("&&") }, uninstallUsbLib: { command: [ "sudo rm /usr/bin/gpii-usb-user-listener", "sudo rm /usr/share/applications/gpii-usb-user-listener.desktop", - "sudo rm -f /var/lib/gpii" + "sudo rm -f -r /var/lib/gpii" ].join("&&") }, startGpii: { From c3125a8a4184de859b98277e7f1e5d581b9363d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 7 Nov 2014 17:50:34 +0100 Subject: [PATCH 204/319] GPII-1001: Changing the way Orca settings handler operated Before, we were creating profiles to store our new settings. As of today, the settings handler will store the settings on the current profile. In this way, we can be coherent in our get/set payloads. --- gpii/node_modules/orca/orcaSettingsHandler.js | 60 +++++++------------ 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index b22266e..6b6f56c 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -77,67 +77,53 @@ function applySettings(app) { var settings = app["org.gnome.orca"][0].settings; var options = app["org.gnome.orca"][0].options; - var user = options.user; var userSettings = require(orcaSettingsFile); - var defaultProfiles = fluid.copy(userSettings.profiles); - var defaultStartingProfile = fluid.copy(userSettings.general.startingProfile); - var customizedProfile = fluid.copy(userSettings.general); - - if ("profiles" in settings) { - userSettings.profiles = settings.profiles; - userSettings.general.startingProfile = settings["general.startingProfile"]; - } else { - fluid.log("orcaSettingsHandler: User ", user, - " has requested these following settings: ", settings); - - for (var k in settings) { - fluid.set(customizedProfile, k, settings[k], fluid.model.escapedSetConfig); - } + var generalSettings = userSettings.general; + var currentSettingsInProfile = userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]]; - customizedProfile.profile = customizedProfile.activeProfile = - customizedProfile.startingProfile = - [user, user]; + var newSettingsResponse = {}; + fluid.each(settings, function (settingVal, settingKey) { + var value = fluid.get(currentSettingsInProfile, settingKey, + fluid.model.escapedGetConfig); - userSettings.profiles[user] = customizedProfile; - userSettings.general.startingProfile = [user, user]; - } + newSettingsResponse[settingKey] = { + "oldValue": value, + "newValue": settingVal + }; + + fluid.set(currentSettingsInProfile, settingKey, settings[settingKey], + fluid.model.escapedSetConfig); + }); + + userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]] = currentSettingsInProfile; fs.writeFileSync(orcaSettingsFile, JSON.stringify(userSettings, null, 4)); - var newSettingsResponse = { - "profiles": { - "oldValue": defaultProfiles, - "newValue": userSettings.profiles - }, - "general.startingProfile": { - "oldValue": defaultStartingProfile, - "newValue": [user, user] - } - }; - - return { "settings": newSettingsResponse}; + return { "settings": newSettingsResponse }; } gpii.orca.get = function (payload) { var app = fluid.copy(payload); - var settings = fluid.get(app, "data.0.settings"); + var settings = fluid.get(app["org.gnome.orca"], "0.settings"); var newSettingsResponse = {}; var userRequestedSettings = settings; var userSettings = require(orcaSettingsFile); - var currentSettings = userSettings.profiles[userSettings.general.startingProfile[PROFILE_ID]]; + var generalSettings = userSettings.general; + var currentSettingsInProfile = userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]]; fluid.each(userRequestedSettings, function (settingVal, settingKey) { - var value = fluid.get(currentSettings, settingKey, + var value = fluid.get(currentSettingsInProfile, settingKey, fluid.model.escapedGetConfig); + newSettingsResponse[settingKey] = value; }); var noOptions = {settings: newSettingsResponse}; - app.data[0] = noOptions; + app["org.gnome.orca"][0] = noOptions; return app; }; From 37249ab38357ac3cde7dc7320a86d415b6b0291e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 7 Nov 2014 17:53:11 +0100 Subject: [PATCH 205/319] GPII-1001: Updating orca's settings handler tests Now we're testing both get and set methods. --- .../orca/test/orcaSettingsHandlerTests.js | 72 ++++++++----------- 1 file changed, 29 insertions(+), 43 deletions(-) diff --git a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js index 4267a9f..37b3583 100644 --- a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -21,14 +21,26 @@ var orca = fluid.registerNamespace("gpii.orca"); jqUnit.module("OrcaSettingsHandler Module"); jqUnit.test("Running tests for Orca Settings Handler", function () { - jqUnit.expect(10); - var payload = { + var getPayload = { "org.gnome.orca": [{ - options: { - "user": "test1" - }, - settings: { + "settings": { + "enableBraille": null, + "enableEchoByWord": null, + "enableEchoByCharacter": null, + "voices.default.rate": null, + "enableTutorialMessages": null, + "voices.default.family": null, + "verbalizePunctuationStyle": null + } + }] + }; + var defaultSettingsPayload = orca.get(getPayload); + jqUnit.assertTrue("orca.get is returning a valid Object", defaultSettingsPayload); + + var setPayload = { + "org.gnome.orca": [{ + "settings": { "enableBraille": true, "enableEchoByWord": true, "enableEchoByCharacter": false, @@ -40,44 +52,18 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { }] }; - var returnPayload = orca.set(payload); - - // Check if profile exists - - jqUnit.assertTrue("Profile 'test1' exists", returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1); - - // Check if 'test1' is the default starting profile - - var actual = returnPayload["org.gnome.orca"][0].settings["general.startingProfile"].newValue; - jqUnit.assertDeepEq("'test1' is the new starting profile", ["test1", "test1"], actual); - - // Check for specific one-to-one settings from the payload - - for (var setting in ["enableBraille", "enableEchoByWord", "enableEchoByCharacter", "enableTutorialMessages", "verbalizePunctuationStyle"]) { - jqUnit.assertDeepEq("Checking " + setting + " setting", - payload["org.gnome.orca"][0].settings[setting], - returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1[setting]); - } - - // Check for voices' stuff - // - jqUnit.assertDeepEq("Checking for voices.default.rate setting", - payload["org.gnome.orca"][0].settings["voices.default.rate"], - returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices["default"].rate); - - jqUnit.assertDeepEq("Checking for voices.default.family setting", - payload["org.gnome.orca"][0].settings["voices.default.family"], - returnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1.voices["default"].family); + var returnPayload = orca.set(setPayload); + var settings = fluid.copy(returnPayload["org.gnome.orca"][0].settings); + fluid.each(settings, function (v, k) { + var expectedValue = setPayload["org.gnome.orca"][0].settings[k]; + jqUnit.assertDeepEq("Setting " + k + " is being set well", expectedValue, v["newValue"]); + }); - // Let's simulate a logout and restore the settings file into its initial state - // - var newPayload = fluid.copy(payload); - newPayload["org.gnome.orca"][0].settings.profiles = returnPayload["org.gnome.orca"][0].settings.profiles.oldValue; - newPayload["org.gnome.orca"][0].settings["general.startingProfile"] = returnPayload["org.gnome.orca"][0].settings["general.startingProfile"].oldValue; - var newReturnPayload = orca.set(newPayload); + var returnGetPayload = orca.get(getPayload); + jqUnit.assertDeepEq("Get payload is as expected after updating the settings", returnGetPayload, setPayload); - // Check if 'test1' profile has been removed successfully - // - jqUnit.assertFalse("Profile 'test1' does not exists", newReturnPayload["org.gnome.orca"][0].settings.profiles.newValue.test1); + var restoreReturnPayload = orca.set(defaultSettingsPayload); + var currentSettingsPayload = orca.get(getPayload); + jqUnit.assertDeepEq("Settings are being restored well", currentSettingsPayload, defaultSettingsPayload); }); From ab4c40716d103a7be4ad0e080f26d91afea5fc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 7 Nov 2014 18:46:19 +0100 Subject: [PATCH 206/319] GPII-1001: Avoid the use of JSON.stringify to strip the content values out when writing the file. By using this infusion shorthand, we are avoiding the corruption of orca's settings file when dealing with non-existant requested settings. --- gpii/node_modules/orca/orcaSettingsHandler.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 6b6f56c..da0762f 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -82,13 +82,25 @@ var generalSettings = userSettings.general; var currentSettingsInProfile = userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]]; + var applier = fluid.makeChangeApplier(currentSettingsInProfile, { + resolverGetConfig: fluid.model.escapedGetConfig, + resolverSetConfig: fluid.model.escapedSetConfig + }); + var newSettingsResponse = {}; fluid.each(settings, function (settingVal, settingKey) { - var value = fluid.get(currentSettingsInProfile, settingKey, + var oldValue = fluid.get(currentSettingsInProfile, settingKey, fluid.model.escapedGetConfig); + var change = { + path: settingKey, + value: settingVal + }; + change.type = settingVal === undefined ? "DELETE" : "ADD"; + applier.fireChangeRequest(change); + newSettingsResponse[settingKey] = { - "oldValue": value, + "oldValue": oldValue, "newValue": settingVal }; From 528515b277d873ec6f8f67d48e7afa371f0e985c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Sat, 8 Nov 2014 11:46:00 +0100 Subject: [PATCH 207/319] GPII-1001: Testing the full get/set flow with non-exixtent values --- .../orca/test/orcaSettingsHandlerTests.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js index 37b3583..c95c9e6 100644 --- a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -22,6 +22,8 @@ jqUnit.module("OrcaSettingsHandler Module"); jqUnit.test("Running tests for Orca Settings Handler", function () { + // Complete get/set flow + // var getPayload = { "org.gnome.orca": [{ "settings": { @@ -66,4 +68,40 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { var currentSettingsPayload = orca.get(getPayload); jqUnit.assertDeepEq("Settings are being restored well", currentSettingsPayload, defaultSettingsPayload); + // Complete get/set flow with non-existent settings. + // + var getPayload2 = { + "org.gnome.orca": [{ + "settings": { + "foo": null, + "cat.name": null, + "cat.age": null + } + }] + }; + + var defaultSettingsPayload2 = orca.get(getPayload2); + + var setPayload2 = { + "org.gnome.orca": [{ + "settings": { + "foo": "bar", + "cat.name": "CATTT", + "cat.age": 3 + } + }] + }; + + var returnPayload2 = orca.set(setPayload2); + var settings = fluid.copy(returnPayload2["org.gnome.orca"][0].settings); + fluid.each(settings, function (v, k) { + var expectedValue = setPayload2["org.gnome.orca"][0].settings[k]; + jqUnit.assertDeepEq("Non-existent setting " + k + " is being set well", expectedValue, v["newValue"]); + }); + + // Restore the settings + var restoreReturnPayload2 = orca.set(defaultSettingsPayload2); + var currentSettingsPayload2 = orca.get(getPayload2); + jqUnit.assertDeepEq("Non-existent settings are being restored well", currentSettingsPayload2, defaultSettingsPayload2); + }); From 9473886a8862e8dc94835c91eda867426e4f655d Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Sat, 8 Nov 2014 18:49:50 +0000 Subject: [PATCH 208/319] GPII-434: Added driver file and readme omitted from previous commit --- index.js | 13 +++++++++++-- tests/README.txt | 7 +++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 06c8c7c..f62cda2 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -/* + /* * GPII Linux Personalization Framework Node.js Index * * Copyright 2012 OCAD University @@ -13,4 +13,13 @@ * * You may obtain a copy of the License at * https://github.com/GPII/universal/blob/master/LICENSE.txt - */ \ No newline at end of file + */ + +var fluid = require("universal"); + +fluid.module.register("gpii-linux", __dirname, require); + +fluid.require("./gpii/node_modules/gsettingsBridge", require); +fluid.require("./gpii/node_modules/orca", require); +fluid.require("./gpii/node_modules/alsa", require); +fluid.require("./gpii/node_modules/xrandr", require); diff --git a/tests/README.txt b/tests/README.txt index d77926a..726925d 100644 --- a/tests/README.txt +++ b/tests/README.txt @@ -15,12 +15,11 @@ directory of the GPII universal project checked out as part of the current build In order to filter only a subset of the available suites, you can supply extra command line arguments which will be checked as substrings of the test suite files. -For example, to run only the suites testing built-in adaptations of windows, run +For example, to run only the suites testing built-in adaptations of Linux, run node AcceptanceTests.js builtIn -Or to run only the tests for the NVDA screenreader, run +Or to run only the tests for the orca screenreader, run - node AcceptanceTests.js nvda - + node AcceptanceTests.js orca \ No newline at end of file From 0fa45d9e1907bdc9cddc3bf22178e00eeea9bd00 Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Sat, 8 Nov 2014 19:30:31 +0000 Subject: [PATCH 209/319] GPII-434: Notation on broken tests --- gpii/node_modules/gsettingsBridge/tests/tests.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gpii/node_modules/gsettingsBridge/tests/tests.js b/gpii/node_modules/gsettingsBridge/tests/tests.js index f59a469..fc530ce 100644 --- a/gpii/node_modules/gsettingsBridge/tests/tests.js +++ b/gpii/node_modules/gsettingsBridge/tests/tests.js @@ -15,6 +15,8 @@ */ "use strict"; +// TODO: These tests look like old junk and have not run in a while - we should probably delete them + var gsettings = require("../gsettings_bridge.js"); var util = require("util"); var fs = require("fs"); From 28629c0d7238f552e1e6ff8484c0b0cbf7ac7675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 10 Nov 2014 02:06:25 +0100 Subject: [PATCH 210/319] GPII-1001: Handle more than just one solution entries Updating tests according to new changes in the settings handler. Also, adding a complete get/set test flow with multiple solutions. --- gpii/node_modules/orca/orcaSettingsHandler.js | 36 ++++----- .../orca/test/orcaSettingsHandlerTests.js | 75 ++++++++++++++----- 2 files changed, 75 insertions(+), 36 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index da0762f..a173134 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -75,11 +75,9 @@ } function applySettings(app) { - var settings = app["org.gnome.orca"][0].settings; - var options = app["org.gnome.orca"][0].options; + var settings = app.settings; var userSettings = require(orcaSettingsFile); - var generalSettings = userSettings.general; var currentSettingsInProfile = userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]]; var applier = fluid.makeChangeApplier(currentSettingsInProfile, { @@ -113,34 +111,28 @@ fs.writeFileSync(orcaSettingsFile, JSON.stringify(userSettings, null, 4)); - return { "settings": newSettingsResponse }; + return newSettingsResponse; } - gpii.orca.get = function (payload) { + gpii.orca.getImpl = function (payload) { var app = fluid.copy(payload); - var settings = fluid.get(app["org.gnome.orca"], "0.settings"); + var settings = app.settings; var newSettingsResponse = {}; - var userRequestedSettings = settings; var userSettings = require(orcaSettingsFile); - var generalSettings = userSettings.general; var currentSettingsInProfile = userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]]; - fluid.each(userRequestedSettings, function (settingVal, settingKey) { + newSettingsResponse = fluid.transform(settings, function (settingVal, settingKey) { var value = fluid.get(currentSettingsInProfile, settingKey, fluid.model.escapedGetConfig); - - newSettingsResponse[settingKey] = value; + return value; }); - var noOptions = {settings: newSettingsResponse}; - app["org.gnome.orca"][0] = noOptions; - - return app; + return newSettingsResponse; }; - gpii.orca.set = function (profile) { + gpii.orca.setImpl = function (profile) { var returnObj = fluid.copy(profile); var exists = fs.existsSync(orcaSettingsFile); @@ -169,9 +161,17 @@ } var returnValue = applySettings(profile); - fluid.set(returnObj, ["org.gnome.orca", 0], returnValue); + returnObj = returnValue; + + return returnValue; + }; + + gpii.orca.get = function (payload) { + return gpii.settingsHandlers.invokeSettingsHandler(gpii.orca.getImpl, payload); + }; - return returnObj; + gpii.orca.set = function (payload) { + return gpii.settingsHandlers.invokeSettingsHandler(gpii.orca.setImpl, payload); }; })(); diff --git a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js index c95c9e6..6fd797a 100644 --- a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -1,7 +1,7 @@ /* Orca Settings Handler Tests -Copyright 2013 Emergya +Copyright 2013, 2014 Emergya Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -16,6 +16,7 @@ var fluid = require("universal"), jqUnit = fluid.require("jqUnit"); require("orca"); +var gpii = fluid.registerNamespace("gpii"); var orca = fluid.registerNamespace("gpii.orca"); jqUnit.module("OrcaSettingsHandler Module"); @@ -37,7 +38,7 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { } }] }; - var defaultSettingsPayload = orca.get(getPayload); + var defaultSettingsPayload = gpii.resolveSync(orca.get(getPayload)); jqUnit.assertTrue("orca.get is returning a valid Object", defaultSettingsPayload); var setPayload = { @@ -54,24 +55,25 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { }] }; - var returnPayload = orca.set(setPayload); - var settings = fluid.copy(returnPayload["org.gnome.orca"][0].settings); + var returnPayload = gpii.resolveSync(orca.set(setPayload)); + var settings = returnPayload["org.gnome.orca"][0].settings; + fluid.each(settings, function (v, k) { var expectedValue = setPayload["org.gnome.orca"][0].settings[k]; - jqUnit.assertDeepEq("Setting " + k + " is being set well", expectedValue, v["newValue"]); + jqUnit.assertDeepEq("Setting " + k + " is being set well", expectedValue, v.newValue); }); - var returnGetPayload = orca.get(getPayload); + var returnGetPayload = gpii.resolveSync(orca.get(getPayload)); jqUnit.assertDeepEq("Get payload is as expected after updating the settings", returnGetPayload, setPayload); - var restoreReturnPayload = orca.set(defaultSettingsPayload); - var currentSettingsPayload = orca.get(getPayload); + orca.set(defaultSettingsPayload); + var currentSettingsPayload = gpii.resolveSync(orca.get(getPayload)); jqUnit.assertDeepEq("Settings are being restored well", currentSettingsPayload, defaultSettingsPayload); // Complete get/set flow with non-existent settings. // var getPayload2 = { - "org.gnome.orca": [{ + "data": [{ "settings": { "foo": null, "cat.name": null, @@ -80,10 +82,10 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { }] }; - var defaultSettingsPayload2 = orca.get(getPayload2); + var defaultSettingsPayload2 = gpii.resolveSync(orca.get(getPayload2)); var setPayload2 = { - "org.gnome.orca": [{ + "data": [{ "settings": { "foo": "bar", "cat.name": "CATTT", @@ -92,16 +94,53 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { }] }; - var returnPayload2 = orca.set(setPayload2); - var settings = fluid.copy(returnPayload2["org.gnome.orca"][0].settings); - fluid.each(settings, function (v, k) { - var expectedValue = setPayload2["org.gnome.orca"][0].settings[k]; - jqUnit.assertDeepEq("Non-existent setting " + k + " is being set well", expectedValue, v["newValue"]); + var returnPayload2 = gpii.resolveSync(orca.set(setPayload2)); + var settings2 = fluid.copy(returnPayload2.data[0].settings); + fluid.each(settings2, function (v, k) { + var expectedValue = setPayload2.data[0].settings[k]; + jqUnit.assertDeepEq("Non-existent setting " + k + " is being set well", expectedValue, v.newValue); }); // Restore the settings - var restoreReturnPayload2 = orca.set(defaultSettingsPayload2); - var currentSettingsPayload2 = orca.get(getPayload2); + orca.set(defaultSettingsPayload2); + var currentSettingsPayload2 = gpii.resolveSync(orca.get(getPayload2)); jqUnit.assertDeepEq("Non-existent settings are being restored well", currentSettingsPayload2, defaultSettingsPayload2); + // Complete get/set flow with multiple solution entries. + // + var getPayload3 = { + "data": [{ + "settings": { + "foo": null + } + }], + "otherData": [{ + "settings": { + "john": null + } + }] + }; + + var defaultSettingsPayload3 = gpii.resolveSync(orca.get(getPayload3)); + + var setPayload3 = { + "data": [{ + "settings": { + "foo": "bar" + } + }], + "otherData": [{ + "settings": { + "john": "doe" + } + }] + }; + + orca.set(setPayload3); + + // Restore the settings + orca.set(defaultSettingsPayload3); + var currentSettingsPayload3 = gpii.resolveSync(orca.get(getPayload3)); + jqUnit.assertDeepEq("Non-existent settings are being restored well", currentSettingsPayload3, defaultSettingsPayload3); + }); From 57b5376c5a0e518ddfb8c4f9609f4639a39b283d Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Mon, 10 Nov 2014 16:33:52 +0000 Subject: [PATCH 211/319] GPII-434: Added top-level driver for all settings handler tests (with XRANDR commented out) --- tests/UnitTests.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 tests/UnitTests.sh diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh new file mode 100755 index 0000000..dc93e3e --- /dev/null +++ b/tests/UnitTests.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# GPII Unit Tests for Linux +# +# Copyright 2014 Lucendo Development Ltd. +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# The research leading to these results has received funding from the European Union's +# Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016. +# +# You may obtain a copy of the License at +# https://github.com/gpii/universal/LICENSE.txt + +node ../gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js +../gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh +node ../gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js +node ../gpii/node_modules/orca/test/orcaSettingsHandlerTests.js + +# These XRANDR tests crash out on my system (AMB - Fedora 19 64-bit in VMWare Workstation 10.0.1 on Windows 7 64-bit) +# node ../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +# node ../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js From b5eea10e6ede5414a76b3bfcbd47bf06ecfddf2c Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Mon, 10 Nov 2014 16:42:04 +0000 Subject: [PATCH 212/319] GPII-434: Second attempt at Unit Tests driver - gsettings test must be run from its own directory --- tests/UnitTests.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh index dc93e3e..7e979a7 100755 --- a/tests/UnitTests.sh +++ b/tests/UnitTests.sh @@ -13,10 +13,22 @@ # You may obtain a copy of the License at # https://github.com/gpii/universal/LICENSE.txt -node ../gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js -../gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh -node ../gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js -node ../gpii/node_modules/orca/test/orcaSettingsHandlerTests.js +pushd +cd ../gpii/node_modules/alsa/test +node alsaSettingsHandlerTests.js +popd + +pushd +cd ../gpii/node_modules/gsettingsBridge/tests +./runUnitTests.sh +cd ../nodegsettings +node .//nodegsettings_tests.js +popd + +pushd +cd ../gpii/node_modules/orca/test +node orcaSettingsHandlerTests.js +popd # These XRANDR tests crash out on my system (AMB - Fedora 19 64-bit in VMWare Workstation 10.0.1 on Windows 7 64-bit) # node ../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js From e7fffe3bcb02e71cefdc78258e490c7f20ae5ffc Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Mon, 10 Nov 2014 16:44:18 +0000 Subject: [PATCH 213/319] GPII-434: pushd requires an argument --- tests/UnitTests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh index 7e979a7..7ad1a0b 100755 --- a/tests/UnitTests.sh +++ b/tests/UnitTests.sh @@ -13,19 +13,19 @@ # You may obtain a copy of the License at # https://github.com/gpii/universal/LICENSE.txt -pushd +pushd . cd ../gpii/node_modules/alsa/test node alsaSettingsHandlerTests.js popd -pushd +pushd . cd ../gpii/node_modules/gsettingsBridge/tests ./runUnitTests.sh cd ../nodegsettings node .//nodegsettings_tests.js popd -pushd +pushd . cd ../gpii/node_modules/orca/test node orcaSettingsHandlerTests.js popd From 69b7db57c565ba8f9d7066b01c9a0a0b09435f8f Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 25 Nov 2014 13:36:51 -0500 Subject: [PATCH 214/319] GPII-1025: Move creation of GPII log directory to grunt task. Copied commands from build.sh to Gruntfile.js that (1) touch the GPII log file and (2) change its permissions to allow anyone to read and write it. These operations are now part of the "installUsbLib" task. --- Gruntfile.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index 3c94efd..2b693f7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -61,6 +61,8 @@ module.exports = function(grunt) { "sudo cp " + usbListenerDir + "/gpii-usb-user-listener.desktop /usr/share/applications/", "sudo mkdir -p /var/lib/gpii" + "sudo touch /var/lib/gpii/log.txt", + "sudo chmod a+rw /var/lib/gpii/log.txt" ].join("&&") }, uninstallUsbLib: { From 77d27688814a059be8eb986b532898d6d86c3ffc Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 26 Nov 2014 10:41:28 -0500 Subject: [PATCH 215/319] GPII-1025: Fixed typo. --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 2b693f7..14708b3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -60,7 +60,7 @@ module.exports = function(grunt) { "sudo cp " + usbListenerDir + "/gpii-usb-user-listener /usr/bin/", "sudo cp " + usbListenerDir + "/gpii-usb-user-listener.desktop /usr/share/applications/", - "sudo mkdir -p /var/lib/gpii" + "sudo mkdir -p /var/lib/gpii", "sudo touch /var/lib/gpii/log.txt", "sudo chmod a+rw /var/lib/gpii/log.txt" ].join("&&") From 44ddec71e046d8fdf4011c0261cc7b6ac620ce15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 27 Nov 2014 16:12:22 +0100 Subject: [PATCH 216/319] GPII-1027: Fix ALSA's implementation of get method --- gpii/node_modules/alsa/alsa_bridge.js | 32 +++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/gpii/node_modules/alsa/alsa_bridge.js b/gpii/node_modules/alsa/alsa_bridge.js index e27026b..64bff68 100644 --- a/gpii/node_modules/alsa/alsa_bridge.js +++ b/gpii/node_modules/alsa/alsa_bridge.js @@ -58,13 +58,37 @@ return alsa.setSystemVolume(value); }; + gpii.alsa.allSettings = { + masterVolume: { + get: "gpii.alsa.getSystemVolume", + set: "gpii.alsa.setSystemVolume" + } + }; + + gpii.alsa.getImpl = function (settingsRequest) { + settingsRequest = settingsRequest || gpii.alsa.allSettings; + var settings = fluid.transform(settingsRequest, function (value, key) { + var funcEntry = gpii.alsa.allSettings[key]; + if (funcEntry) { + return fluid.invokeGlobalFunction(funcEntry.get); + } else { + fluid.fail("Invalid key to ALSA settings handler - " + + key + " - valid choices are " + JSON.stringify(fluid.keys(gpii.alsa.allSettings))); + } + }); + return settings; + }; + gpii.alsa.get = function (payload){ var app = fluid.copy(payload); + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var settings = gpii.alsa.getImpl(app[appId][j].settings); - var newSettingsResponse = {masterVolume: gpii.alsa.getSystemVolume()}; - var noOptions = {settings: newSettingsResponse}; - app.data[0] = noOptions; - + var noOptions = { settings: settings }; + app[appId][j] = noOptions; + } + } return app; }; From 32cd7b2288589ac11121fdf58fb11ee525624f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 27 Nov 2014 16:35:35 +0100 Subject: [PATCH 217/319] GPII-1026: Removing support for XRandR's brightness setting --- .../xrandr/nodexrandr/nodexrandr.cc | 90 ------------------- .../xrandr/nodexrandr/nodexrandr_tests.js | 27 +----- .../xrandr/test/xrandrSettingsHandlerTests.js | 20 +---- gpii/node_modules/xrandr/xrandr_bridge.js | 30 +------ 4 files changed, 4 insertions(+), 163 deletions(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc index 39bd470..d214a7b 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -222,92 +222,6 @@ Handle getDisplays(const Arguments& args) { return scope.Close(result); } -Handle getBrightness(const Arguments& args) { - HandleScope scope; - Display *dpy; - static Atom backlight; - int screen = 0, o = 0; - Window root; - XRRScreenResources *resources; - RROutput output; - XRRPropertyInfo *info; - double min, max; - - dpy = XOpenDisplay(NULL); - backlight = XInternAtom (dpy, "Backlight", True); - root = RootWindow(dpy, screen); - resources = XRRGetScreenResources(dpy, root); - output = resources->outputs[o]; - - unsigned char *prop; - int actual_format; - unsigned long nitems, bytes_after; - Atom actual_type; - - XRRGetOutputProperty (dpy, output, backlight, - 0, 100, False, False, - AnyPropertyType, - &actual_type, &actual_format, - &nitems, &bytes_after, &prop); - - info = XRRQueryOutputProperty(dpy, output, backlight); - - const int32_t *val = (const int32_t *) prop; - char backlight_value[11]; - snprintf( backlight_value, sizeof backlight_value, "%" PRId32, *val); - - min = info->values[0]; - max = info->values[1]; - - v8::Handle result = v8::Object::New(); - result->Set(String::New("value"), Int32::New(*val)); - result->Set(String::New("max"), Number::New(max)); - result->Set(String::New("min"), Number::New(min)); - - return scope.Close(result); -} - -Handle setBrightness(const Arguments& args) { - HandleScope scope; - Display *dpy; - static Atom backlight; - int screen = 0, o = 0; - Window root; - XRRScreenResources *resources; - RROutput output; - XRRPropertyInfo *info; - double min, max; - long value; - float argValue; - argValue = args[0]->ToNumber()->Value(); - - dpy = XOpenDisplay(NULL); - backlight = XInternAtom (dpy, "Backlight", True); - root = RootWindow(dpy, screen); - resources = XRRGetScreenResources(dpy, root); - output = resources->outputs[o]; - info = XRRQueryOutputProperty(dpy, output, backlight); - min = info->values[0]; - max = info->values[1]; - XFree(info); // Don't need this anymore - XRRFreeScreenResources(resources); // or this - - value = argValue; - - if (value>max) { - value = max; - } else if (value setScreenResolution(const Arguments& args) { HandleScope scope; Display *dpy; @@ -399,10 +313,6 @@ Handle setScreenResolution(const Arguments& args) { void init(Handle target) { target->Set(String::NewSymbol("getDisplays"), FunctionTemplate::New(getDisplays)->GetFunction()); - target->Set(String::NewSymbol("getBrightness"), - FunctionTemplate::New(getBrightness)->GetFunction()); - target->Set(String::NewSymbol("setBrightness"), - FunctionTemplate::New(setBrightness)->GetFunction()); target->Set(String::NewSymbol("setScreenResolution"), FunctionTemplate::New(setScreenResolution)->GetFunction()); } diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index 3f1ca5f..3ca803d 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -23,39 +23,15 @@ var fluid = require("universal"), jqUnit.module("GPII Xrandr Module"); jqUnit.test("Running tests for Xrandr Bridge", function () { - jqUnit.expect(12); - // Check if all required methods are available through the Xrandr Bridge // - var methods = ["getBrightness", "setBrightness", - "getDisplays", "setScreenResolution"]; + var methods = ["getDisplays", "setScreenResolution"]; for (var method in methods) { jqUnit.assertTrue("Checking availability of method '" + method + "'", (methods[method] in xrandr)); } - var brightness = xrandr.getBrightness().value; - - // Check getBrightness and setBrightness methods - // - jqUnit.assertTrue("Checking that 'setBrightness' method is callable", - xrandr.setBrightness(1)); - - jqUnit.assertTrue("'getBrightness' is callable", - xrandr.getBrightness()); - - jqUnit.assertDeepEq("'getBrightness' returns a expected value" + - " and 'setBrightness' worked as expected", - xrandr.getBrightness().value, 1); - - // Restore brightness to its previous value - // - xrandr.setBrightness(brightness); - - jqUnit.assertDeepEq("Brightness is restored to its previous value", - xrandr.getBrightness().value, brightness); - // Check getDisplays and setScreenResolution methods // jqUnit.assertTrue("Checking that 'getDisplays' method is callable", @@ -75,5 +51,4 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { jqUnit.assertDeepEq("Checking that 'setScreenSize' sets the resolution", xrandr.getDisplays()[0].resolution, resolution); - }); diff --git a/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js b/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js index 50ca87d..2ec47c3 100644 --- a/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js +++ b/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js @@ -25,13 +25,10 @@ var xrandr = fluid.registerNamespace("gpii.xrandr"); jqUnit.module("GPII Xrandr Module"); jqUnit.test("Running tests for Xrandr Bridge", function () { - jqUnit.expect(10); - // Check if all required methods are available through the // Xrandr Settings Handler. // - var methods = ["getBrightness", "getScreenResolution", "setBrightness", - "setScreenResolution", "get", "set"]; + var methods = ["getScreenResolution", "setScreenResolution", "get", "set"]; for (var method in methods) { jqUnit.assertTrue("Checking availability of method '" + method + "'", (methods[method] in xrandr)); @@ -40,8 +37,7 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { var payload = { "org.freedesktop.xrandr": [{ settings: { - "screen-resolution": {"width": 800, "height": 600}, - "screen-brightness": 1 + "screen-resolution": {"width": 800, "height": 600} } }] }; @@ -52,25 +48,13 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].newValue, payload["org.freedesktop.xrandr"][0].settings["screen-resolution"]); - jqUnit.assertDeepEq("The brightness is being setted well", - returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].newValue, - payload["org.freedesktop.xrandr"][0].settings["screen-brightness"]); - var newPayload = fluid.copy(payload); newPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"] = returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].oldValue; - newPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"] = - returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].oldValue; var lastPayload = xrandr.set(newPayload); jqUnit.assertDeepEq("The resolution is being restored well", returnPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].oldValue, lastPayload["org.freedesktop.xrandr"][0].settings["screen-resolution"].newValue); - - jqUnit.assertDeepEq("The brightness is being setted well", - returnPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].oldValue, - lastPayload["org.freedesktop.xrandr"][0].settings["screen-brightness"].newValue); - - }); diff --git a/gpii/node_modules/xrandr/xrandr_bridge.js b/gpii/node_modules/xrandr/xrandr_bridge.js index 0a90994..f52fcd3 100644 --- a/gpii/node_modules/xrandr/xrandr_bridge.js +++ b/gpii/node_modules/xrandr/xrandr_bridge.js @@ -23,25 +23,12 @@ fluid.registerNamespace("gpii.xrandr"); - fluid.defaults("gpii.xrandr.getBrightness", { - gradeNames: "fluid.function", - argumentMap: { - } - }); - fluid.defaults("gpii.xrandr.getScreenResolution", { gradeNames: "fluid.function", argumentMap: { } }); - fluid.defaults("gpii.xrandr.setBrightness", { - gradeNames: "fluid.function", - argumentMap: { - value: 0 - } - }); - fluid.defaults("gpii.xrandr.setScreenResolution", { gradeNames: "fluid.function", argumentMap: { @@ -49,10 +36,6 @@ } }); - gpii.xrandr.getBrightness = function () { - return xrandr.getBrightness().value; - }; - gpii.xrandr.getScreenResolution = function () { var displayInfo = xrandr.getDisplays(); for (var i=0; i Date: Thu, 27 Nov 2014 16:36:21 +0100 Subject: [PATCH 218/319] GPII-1026: Enable XRandR's tests in UnitTests.sh --- tests/UnitTests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh index 7ad1a0b..499cc3c 100755 --- a/tests/UnitTests.sh +++ b/tests/UnitTests.sh @@ -31,5 +31,5 @@ node orcaSettingsHandlerTests.js popd # These XRANDR tests crash out on my system (AMB - Fedora 19 64-bit in VMWare Workstation 10.0.1 on Windows 7 64-bit) -# node ../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js -# node ../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js +node ../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +node ../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js From 8dc9f82833954e60ba73bc2caf0be6c845fd6212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 27 Nov 2014 16:50:47 +0100 Subject: [PATCH 219/319] GPII-1026: Fixing the implementation of XRandR's 'get' method --- gpii/node_modules/xrandr/xrandr_bridge.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gpii/node_modules/xrandr/xrandr_bridge.js b/gpii/node_modules/xrandr/xrandr_bridge.js index f52fcd3..7ebe744 100644 --- a/gpii/node_modules/xrandr/xrandr_bridge.js +++ b/gpii/node_modules/xrandr/xrandr_bridge.js @@ -68,10 +68,10 @@ gpii.xrandr.getImpl = function (settingsRequest) { settingsRequest = settingsRequest || gpii.xrandr.allSettings; - var settings = fluid.transform(settingsRequest, function (key) { + var settings = fluid.transform(settingsRequest, function (value, key) { var funcEntry = gpii.xrandr.allSettings[key]; if (funcEntry) { - return fluid.invokeGlobalFunction(funcEntry.set); + return fluid.invokeGlobalFunction(funcEntry.get); } else { fluid.fail("Invalid key to Xrandr settings handler - " + key + " - valid choices are " + JSON.stringify(fluid.keys(gpii.xrandr.allSettings))); From ed7907b1479a3d521d8f1524d20e2c0d765c6555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 28 Nov 2014 10:46:55 +0100 Subject: [PATCH 220/319] GPII-1027: Adding a TODO in relation to GPII-1028 --- gpii/node_modules/alsa/alsa_bridge.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gpii/node_modules/alsa/alsa_bridge.js b/gpii/node_modules/alsa/alsa_bridge.js index 64bff68..c4493a2 100644 --- a/gpii/node_modules/alsa/alsa_bridge.js +++ b/gpii/node_modules/alsa/alsa_bridge.js @@ -58,6 +58,12 @@ return alsa.setSystemVolume(value); }; + // TODO: http://issues.gpii.net/browse/GPII-1028 + // This mechanism has been literaly copied/pasted from XRandR's settings + // handler, which looks like a good approach to deal with this kind of + // settings handler. The use of this approach should be consolidated + // as an utility inside the GPII. + // gpii.alsa.allSettings = { masterVolume: { get: "gpii.alsa.getSystemVolume", From b8512ee1736060e41ecaae86530c7ee68b5bd272 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Thu, 4 Dec 2014 13:46:52 -0500 Subject: [PATCH 221/319] GPII-1032: Modified uninstallUsbLib grunt task (linux). Modified the 'rm' commands that delete the "gpii-usb-user-listener" python script and the "gpii-usb-user-listener.desktop" file to ignore non-existent file errors. This is done by using the '-f' option. --- Gruntfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 14708b3..2319b7f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -67,8 +67,8 @@ module.exports = function(grunt) { }, uninstallUsbLib: { command: [ - "sudo rm /usr/bin/gpii-usb-user-listener", - "sudo rm /usr/share/applications/gpii-usb-user-listener.desktop", + "sudo rm -f /usr/bin/gpii-usb-user-listener", + "sudo rm -f /usr/share/applications/gpii-usb-user-listener.desktop", "sudo rm -f -r /var/lib/gpii" ].join("&&") }, From a5d7622d0d27974f73b7c753fb2ae121ac7801a0 Mon Sep 17 00:00:00 2001 From: kaspermarkus Date: Wed, 10 Dec 2014 01:45:51 +0100 Subject: [PATCH 222/319] GPII-1041: Updated the .jshintrc entry and jshinted everything --- .jshintrc | 1 + Gruntfile.js | 8 ++++---- gpii/node_modules/alsa/alsa_bridge.js | 8 ++++---- .../gsettingsBridge/gsettings_bridge.js | 16 ++++++++-------- gpii/node_modules/orca/orcaSettingsHandler.js | 4 ++-- gpii/node_modules/xrandr/xrandr_bridge.js | 6 +++--- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.jshintrc b/.jshintrc index 9d62e08..49d9c2a 100644 --- a/.jshintrc +++ b/.jshintrc @@ -20,6 +20,7 @@ "unused": true, "strict": true, "trailing": true, + "white": true, "maxerr": 1000, diff --git a/Gruntfile.js b/Gruntfile.js index 14708b3..33e71da 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -12,16 +12,16 @@ https://github.com/gpii/universal/LICENSE.txt "use strict"; -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.loadNpmTasks("grunt-shell"); grunt.loadNpmTasks("grunt-contrib-jshint"); grunt.loadNpmTasks("grunt-jsonlint"); grunt.loadNpmTasks("grunt-gpii"); - + var usbListenerDir = "./usbDriveListener"; - - function nodeGypShell (cmd, cwd) { + + function nodeGypShell(cmd, cwd) { return { options: { execOptions: { diff --git a/gpii/node_modules/alsa/alsa_bridge.js b/gpii/node_modules/alsa/alsa_bridge.js index c4493a2..c671508 100644 --- a/gpii/node_modules/alsa/alsa_bridge.js +++ b/gpii/node_modules/alsa/alsa_bridge.js @@ -50,11 +50,11 @@ } }); - gpii.alsa.getSystemVolume = function(){ + gpii.alsa.getSystemVolume = function () { return alsa.getSystemVolume(); }; - gpii.alsa.setSystemVolume = function(value){ + gpii.alsa.setSystemVolume = function (value) { return alsa.setSystemVolume(value); }; @@ -85,7 +85,7 @@ return settings; }; - gpii.alsa.get = function (payload){ + gpii.alsa.get = function (payload) { var app = fluid.copy(payload); for (var appId in app) { for (var j = 0; j < app[appId].length; j++) { @@ -98,7 +98,7 @@ return app; }; - gpii.alsa.set = function (payload){ + gpii.alsa.set = function (payload) { var app = fluid.copy(payload); var settings = app["org.alsa-project"][0].settings; diff --git a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js index 20adf32..379147c 100644 --- a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js @@ -41,15 +41,15 @@ } }); - gpii.gsettings.getSingleKey = function(schemaId, key) { - return nodeGSettings.get_gsetting(schemaId,key); + gpii.gsettings.getSingleKey = function (schemaId, key) { + return nodeGSettings.get_gsetting(schemaId, key); }; - gpii.gsettings.setSingleKey = function(schemaId, key, value) { + gpii.gsettings.setSingleKey = function (schemaId, key, value) { nodeGSettings.set_gsetting(schemaId, key, value); }; - gpii.gsettings.get = function(settingsarray) { + gpii.gsettings.get = function (settingsarray) { var app = fluid.copy(settingsarray); for (var appId in app) { for (var j = 0; j < app[appId].length; j++) { @@ -69,7 +69,7 @@ if (keys.indexOf(settingKey) === -1) { continue; } - settings[settingKey] = nodeGSettings.get_gsetting(schemaId,settingKey); + settings[settingKey] = nodeGSettings.get_gsetting(schemaId, settingKey); } } var noOptions = { settings: settings }; @@ -79,7 +79,7 @@ return app; }; - gpii.gsettings.set = function(settingsarray) { + gpii.gsettings.set = function (settingsarray) { var app = fluid.copy(settingsarray); for (var appId in app) { for (var j = 0; j < app[appId].length; j++) { @@ -92,8 +92,8 @@ continue; } var value = settings[settingKey]; - var oldValue = nodeGSettings.get_gsetting(schemaId,settingKey); - nodeGSettings.set_gsetting(schemaId,settingKey,value); + var oldValue = nodeGSettings.get_gsetting(schemaId, settingKey); + nodeGSettings.set_gsetting(schemaId, settingKey, value); settings[settingKey] = { "oldValue": oldValue, "newValue": value diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 6941c91..d254e61 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -75,7 +75,7 @@ var curDate; do { curDate = new Date(); } - while (curDate-date < millis); + while (curDate - date < millis); } function applySettings(app) { @@ -148,7 +148,7 @@ while (!fs.existsSync(orcaSettingsFile)) { if (pass === maxPass) { - err = "Time limit exceeded [" + maxPass*500 + + err = "Time limit exceeded [" + maxPass * 500 + "ms] for creating Orca's configuration file"; break; } diff --git a/gpii/node_modules/xrandr/xrandr_bridge.js b/gpii/node_modules/xrandr/xrandr_bridge.js index 7ebe744..10c4d5c 100644 --- a/gpii/node_modules/xrandr/xrandr_bridge.js +++ b/gpii/node_modules/xrandr/xrandr_bridge.js @@ -38,7 +38,7 @@ gpii.xrandr.getScreenResolution = function () { var displayInfo = xrandr.getDisplays(); - for (var i=0; i Date: Tue, 9 Dec 2014 16:40:05 -0500 Subject: [PATCH 223/319] GPII-413/GPII-434: Modified testing files due to Fireball merge. - gpii.js and index.js: moved the fluid.require()s of the node add-ons, including the one for packagekit (device reporter) from gpii.js to index.js, - gpii/node_modules/packagekit/test/all-tests.js: now uses kettle.loadTestingSupport() and removes kettle.test.allTests boolean, - tests/UnitTests.sh: added the packagekit node add-on tests. --- gpii.js | 3 ++- gpii/node_modules/packagekit/test/all-tests.js | 4 +--- tests/UnitTests.sh | 7 +++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gpii.js b/gpii.js index e414978..33d1512 100644 --- a/gpii.js +++ b/gpii.js @@ -17,7 +17,8 @@ var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"); + gpii = fluid.registerNamespace("gpii"), + kettle = fluid.registerNamespace("kettle"); require("./index.js"); diff --git a/gpii/node_modules/packagekit/test/all-tests.js b/gpii/node_modules/packagekit/test/all-tests.js index b944e90..f5e88b9 100644 --- a/gpii/node_modules/packagekit/test/all-tests.js +++ b/gpii/node_modules/packagekit/test/all-tests.js @@ -14,9 +14,7 @@ var fluid = require("universal"), kettle = fluid.require("kettle"); -fluid.require("kettle/test/utils/js/KettleTestUtils"); - -kettle.tests.allTests = true; +kettle.loadTestingSupport(); var testIncludes = [ "./packageKitModuleTests.js", diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh index 499cc3c..4209d89 100755 --- a/tests/UnitTests.sh +++ b/tests/UnitTests.sh @@ -30,6 +30,13 @@ cd ../gpii/node_modules/orca/test node orcaSettingsHandlerTests.js popd +pushd . +cd ../gpii/node_modules/packagekit/test/ +node .//all-tests.js +cd ../nodepackagekit +node nodepackagekit_test.js +popd + # These XRANDR tests crash out on my system (AMB - Fedora 19 64-bit in VMWare Workstation 10.0.1 on Windows 7 64-bit) node ../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js node ../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js From b131fdec0343e73dd6e2b2fb3af6978bc40fa3a6 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Fri, 23 Jan 2015 16:22:21 -0500 Subject: [PATCH 224/319] GPII-1081: Fedora 21 PackageKit node add-on unit test failure. As per v1.0.3 of PackageKit, added pkTests.availableNotInstalled() to check if the package list returned using the "~installed" filter includes an already installed package, and ignores that package if found. Used by the "search" and "get" tests. This is backward compatible with the way the previous version of PackageKit worked (v0.8.17), so the tests continue to work with that version as well. --- .../nodepackagekit/nodepackagekit_test.js | 66 +++++++++++++------ 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index e399d5d..2bbd09d 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -69,26 +69,50 @@ var fluid = require ("universal"), return (matchPkg !== null); }; + // GPII-1081: compensate for change in PackageKit between v0.8.17 and + // v1.0.3. In the later version, even when installed, the same package + // appears in the list of available packages. In v0.8.17 it did not. + // + pkTests.availableNotInstalled = function (tuxguitar, availablePkgs) { + var isAvailable = pkTests.isTuxguitarInList (tuxguitar, availablePkgs); + if (tuxguitar.inInstalledList && isAvailable) { + var installedMatchesAvailablePkg = + pkTests.getMatchingPackage (tuxguitar.pkg, availablePkgs); + + if (installedMatchesAvailablePkg !== null) { + tuxguitar.inAvailableList = false; + } + else { + tuxguitar.inAvailableList = true; + } + } + else { + tuxguitar.inAvailableList = isAvailable; + } + }; + pkTests.initSearchTest = function() { - var tuxguitar = pkTests.initTuxguitar(); - var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); - tuxguitar.inInstalledList = - pkTests.isTuxguitarInList (tuxguitar, installedPkgs); - var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - tuxguitar.inAvailableList = - pkTests.isTuxguitarInList (tuxguitar, availablePkgs); - return tuxguitar; + var tuxguitar = pkTests.initTuxguitar(); + var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); + tuxguitar.inInstalledList = + pkTests.isTuxguitarInList (tuxguitar, installedPkgs); + + var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); + pkTests.availableNotInstalled (tuxguitar, availablePkgs); + + return tuxguitar; }; pkTests.initGetTest = function() { - var tuxguitar = pkTests.initTuxguitar(); - var installedPkgs = packagekit.getPackages ("installed"); - tuxguitar.inInstalledList = - pkTests.isTuxguitarInList (tuxguitar, installedPkgs); - var availablePkgs = packagekit.getPackages ("~installed"); - tuxguitar.inAvailableList = - pkTests.isTuxguitarInList (tuxguitar, availablePkgs); - return tuxguitar; + var tuxguitar = pkTests.initTuxguitar(); + var installedPkgs = packagekit.getPackages ("installed"); + tuxguitar.inInstalledList = + pkTests.isTuxguitarInList (tuxguitar, installedPkgs); + + var availablePkgs = packagekit.getPackages ("~installed"); + pkTests.availableNotInstalled (tuxguitar, availablePkgs); + + return tuxguitar; }; pkTests.runInstalledVsAvailableTests = function (tuxguitar, msg) { @@ -187,12 +211,12 @@ var fluid = require ("universal"), " The order depends on whether tuxguitar is currently " + "installed.", function() { - // GPII-880: The 'remove' test requires an administrator password. - // Packagekit invokes PolKit authentication, putting up a dialog to - // capture aforesaid password. This needs to be automated. + // GPII-880: The 'remove' test requires an administrator password. + // Packagekit invokes PolKit authentication, putting up a dialog to + // capture aforesaid password. This needs to be automated. - // Using the tuxguitar package: If it's installed, test removing it and - // then (re)install it ... + // Using the tuxguitar package: If it's installed, test removing it and + // then (re)install it ... var matchPkg; var tuxguitar = pkTests.initTuxguitar(); if (pkTests.isInstalled (tuxguitar.pkg)) { From b28e99212e4c7cc803f210c066e0124d72c8b72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 7 Apr 2015 18:47:14 +0200 Subject: [PATCH 225/319] NOJIRA: Updated the version of grunt-gpii More info here: https://github.com/GPII/universal/commit/8fc28448bd80e8946b3dbaf26876da619a632373 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 37b0fca..4fc0a62 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "grunt-shell": "0.6.4", "grunt-contrib-jshint": "~0.9.0", "grunt-jsonlint": "1.0.4", - "grunt-gpii": "git://github.com/GPII/grunt-gpii.git#a4aca06cbaf7523eb1af56ed65ce6bd30b8ec325" + "grunt-gpii": "git://github.com/GPII/grunt-gpii.git#ec8412064e107febb120f0b7437d403453b40d2d" }, "licenses": [ { From b8d0e9bc896e118d3701cbcc5535977f5ad9aaf7 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Thu, 16 Apr 2015 16:21:11 -0400 Subject: [PATCH 226/319] GPII-1137: Remove "grunt start" from source and documentation. Removed "start" task from Gruntfile.js. Replaced "grunt start" with "node gpii.js" in README.md. --- Gruntfile.js | 7 ------- README.md | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index eaa3dc0..0a1932f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -71,9 +71,6 @@ module.exports = function (grunt) { "sudo rm -f /usr/share/applications/gpii-usb-user-listener.desktop", "sudo rm -f -r /var/lib/gpii" ].join("&&") - }, - startGpii: { - command: "node gpii.js" } } }); @@ -93,10 +90,6 @@ module.exports = function (grunt) { grunt.task.run("shell:uninstallUsbLib"); }); - grunt.registerTask("start", "Start the GPII", function () { - grunt.task.run("shell:startGpii"); - }); - grunt.registerTask("install", "Install system level GPII Components", function () { grunt.task.run("shell:installUsbLib"); }); diff --git a/README.md b/README.md index 8d18d80..1f6c62c 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ To clean the plugin binaries use You can start the GPII local server on port 8080 using: - grunt start + node gpii.js To install and uninstall the listener components use the following. Note that this may prompt you for sudo access. From fe26cf6324ed6bd889a96cf36a4ab2f6c620622e Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Mon, 25 May 2015 12:51:54 -0400 Subject: [PATCH 227/319] GPII-1168: Check for second resolution before running xrandr test. Checks the display's available resolutions for one that differs from the current, and, only if a different one is found, runs the xrandr.setScreenResolution() tests. --- .../xrandr/nodexrandr/nodexrandr_tests.js | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index 3ca803d..ada27e8 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -20,6 +20,18 @@ var fluid = require("universal"), jqUnit = fluid.require("jqUnit"), xrandr = require("./build/Release/nodexrandr.node"); +var convert = fluid.registerNamespace("gpii.tests.xrandr.convert"); +convert.toString = function (size) { + return size.width + "x" + size.height; +}; +convert.toSize = function (sizeString) { + var wPos = sizeString.indexOf("x"); + return { + width: parseInt(sizeString.substring(0, wPos), 10), + height: parseInt(sizeString.substring(wPos + 1), 10) + }; +}; + jqUnit.module("GPII Xrandr Module"); jqUnit.test("Running tests for Xrandr Bridge", function () { @@ -37,18 +49,34 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { jqUnit.assertTrue("Checking that 'getDisplays' method is callable", xrandr.getDisplays()); - var resolution = xrandr.getDisplays()[0].resolution; + // Get the current resolution, and see if there is a different available + // resolution. + // + var display = xrandr.getDisplays()[0]; + var resolution0 = convert.toString(display.resolution); + var newResolution = fluid.find(display.available_resolutions, function (aResolution) { + if (resolution0 !== aResolution) { + return (convert.toSize(aResolution)); + } + }, null); + + if (newResolution !== null) { + var oldResolution = display.resolution; - jqUnit.assertTrue("Checking that 'setScreenSize' is callable", - xrandr.setScreenResolution(800, 600)); + jqUnit.assertTrue("Checking that 'setScreenSize' is callable", + xrandr.setScreenResolution( + newResolution.width, newResolution.height)); - jqUnit.assertDeepEq("Checking that 'setScreenSize' sets the resolution", - xrandr.getDisplays()[0].resolution, - {width: 800, height: 600, mwidth: resolution.mwidth, - mheight: resolution.mheight}); + jqUnit.assertDeepEq("Checking that 'setScreenSize' sets the resolution", + xrandr.getDisplays()[0].resolution, + {width: newResolution.width, + height: newResolution.height, + mwidth: oldResolution.mwidth, + mheight: oldResolution.mheight}); - xrandr.setScreenResolution(resolution.width, resolution.height); - jqUnit.assertDeepEq("Checking that 'setScreenSize' sets the resolution", - xrandr.getDisplays()[0].resolution, - resolution); + xrandr.setScreenResolution(oldResolution.width, oldResolution.height); + jqUnit.assertDeepEq("Checking that 'setScreenSize' sets the resolution", + xrandr.getDisplays()[0].resolution, + oldResolution); + } }); From f41c93815e28f96a861fbeedd38ba156d8b71f9f Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 27 May 2015 16:13:59 -0400 Subject: [PATCH 228/319] GPII-1168: Fix to nodexrandr add-on. Fixed check for ConfigureNotify event (code was checking only for RRScreenChangeNotify event). --- gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc index d214a7b..46ced73 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -301,7 +301,7 @@ Handle setScreenResolution(const Arguments& args) { break; } - if (rcvdrrnotify && rcvdrrnotify) { + if (rcvdrrnotify && rcvdconfignotify) { break; } } From f8abf9a6489a00cb01733c91a9aad525ebaf0686 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Thu, 28 May 2015 15:32:59 -0400 Subject: [PATCH 229/319] GPII-1168: Fixes to nodexrandr add-on setScreenResolution(). Based on the latest source code for the xrandr command line utility, modified nodexrander.cc setScreenResolution(): - Ignore when passed resolution is same as current resolution. - Properly dispose of the XRRScreenConfiguration structure. - Handle RRSetConfigFailed (return false). - Handle XEvents more efficiently. Also, updated the unit tests to check that setsetScreenResolution() correctly returns false. --- .../xrandr/nodexrandr/nodexrandr.cc | 79 ++++++++++--------- .../xrandr/nodexrandr/nodexrandr_tests.js | 15 +++- 2 files changed, 52 insertions(+), 42 deletions(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc index 46ced73..4baf508 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -235,31 +235,34 @@ Handle setScreenResolution(const Arguments& args) { char *displayname = NULL; dpy = XOpenDisplay (displayname); - if (dpy == NULL) { printf ("Cannot open display %s\n", displayname); - return scope.Close(Boolean::New(False)); + return scope.Close (Boolean::New(False)); } int screen = DefaultScreen (dpy); Window root = RootWindow (dpy, screen); - - XSelectInput (dpy, root, StructureNotifyMask); - XRRSelectInput (dpy, root, RRScreenChangeNotifyMask); int eventbase; int errorbase; - XRRQueryExtension(dpy, &eventbase, &errorbase); - + if (!XRRQueryExtension(dpy, &eventbase, &errorbase)) { + printf ("RandR extension missing\n"); + return scope.Close (Boolean::New(False)); + } XRRScreenConfiguration *sc = XRRGetScreenInfo (dpy, root); if (sc == NULL) { printf ("Cannot get screen info\n"); - return scope.Close(Boolean::New(False)); + return scope.Close (Boolean::New(False)); } + XSelectInput (dpy, root, StructureNotifyMask); + XRRSelectInput (dpy, root, RRScreenChangeNotifyMask); + + Rotation current_rotation; + SizeID current_size; + current_size = XRRConfigCurrentConfiguration (sc, ¤t_rotation); int nsize; XRRScreenSize *sizes = XRRConfigSizes(sc, &nsize); - int sizeindex = 0; - + SizeID sizeindex = 0; while (sizeindex < nsize) { if (sizes[sizeindex].width == width && sizes[sizeindex].height == height) @@ -269,44 +272,42 @@ Handle setScreenResolution(const Arguments& args) { if (sizeindex >= nsize) { printf ("%dx%d resolution not available\n", width, height); - return scope.Close(Boolean::New(False)); + XRRFreeScreenConfigInfo (sc); + return scope.Close (Boolean::New(False)); } Status status = XRRSetScreenConfig (dpy, sc, DefaultRootWindow (dpy), - (SizeID) sizeindex, + sizeindex, (Rotation) (rotation | reflection), CurrentTime); - - XEvent event; - bool rcvdrrnotify = false; - bool rcvdconfignotify = false; - - if (status == RRSetConfigSuccess) { - while (1) { - XNextEvent(dpy, (XEvent *) &event); - //printf ("Event received, type = %d\n", event.type); - XRRUpdateConfiguration (&event) ; - switch (event.type - eventbase) { - case RRScreenChangeNotify: - rcvdrrnotify = true; - break; - default: - if (event.type == ConfigureNotify) { - //printf("Rcvd ConfigureNotify Event!\n"); - rcvdconfignotify = true; - } else { - //printf("unknown event = %d!\n", event.type); - } - break; - } - - if (rcvdrrnotify && rcvdconfignotify) { - break; + if (status == RRSetConfigFailed) { + printf ("Failed to change the screen resolution.\n"); + XRRFreeScreenConfigInfo (sc); + return scope.Close (Boolean::New(False)); + } + else { // status == RRSetConfigSuccess + if (sizeindex != current_size) { + XEvent event; + bool rcvdrrnotify = false; + while (!rcvdrrnotify) { + XNextEvent(dpy, (XEvent *) &event); + //printf ("Event received, type = %d\n", event.type); + XRRUpdateConfiguration (&event) ; + switch (event.type - eventbase) { + case RRScreenChangeNotify: + rcvdrrnotify = true; + break; + default: + if (event.type != ConfigureNotify) { + printf("unknown event = %d!\n", event.type); + } + break; + } } } } - + XRRFreeScreenConfigInfo (sc); return scope.Close(Boolean::New(True)); } diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index ada27e8..4210758 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -49,17 +49,26 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { jqUnit.assertTrue("Checking that 'getDisplays' method is callable", xrandr.getDisplays()); - // Get the current resolution, and see if there is a different available - // resolution. + // Get the current resolution. Use a value below its minimum size to check + // that setScreenResolution() correctly returns false (can't set an + // impossible resolution). // var display = xrandr.getDisplays()[0]; + jqUnit.assertFalse ("Checking 'setScreenResolution' with impossible size", + xrandr.setScreenResolution( + display.resolution.mwidth - 1, + display.resolution.mheight - 1) + ); + + // Convert the current resolution to a string, and see if there is a + // different available resolution to test setScreenResolution(). + // var resolution0 = convert.toString(display.resolution); var newResolution = fluid.find(display.available_resolutions, function (aResolution) { if (resolution0 !== aResolution) { return (convert.toSize(aResolution)); } }, null); - if (newResolution !== null) { var oldResolution = display.resolution; From 9a97df931576c393b6bc3700a913fbb3fa7db030 Mon Sep 17 00:00:00 2001 From: Steven Githens Date: Fri, 3 Jul 2015 01:21:03 +0200 Subject: [PATCH 230/319] Update README.md NOJIRA Fixing npm install code escaped blocks. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1f6c62c..6fe7cf4 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ have grunt installed yet you can do so with: To fetch our core universal dependencies and build the linux specific plugins run + npm install grunt build From 16236265224b1fcaa74753fb3fef9deb583d50e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 29 Jul 2015 13:07:09 +0200 Subject: [PATCH 231/319] GPII-1168: post-merge lint * gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js --- gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index 4210758..7e79870 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -54,11 +54,10 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { // impossible resolution). // var display = xrandr.getDisplays()[0]; - jqUnit.assertFalse ("Checking 'setScreenResolution' with impossible size", - xrandr.setScreenResolution( - display.resolution.mwidth - 1, - display.resolution.mheight - 1) - ); + jqUnit.assertFalse("Checking 'setScreenResolution' with impossible size", + xrandr.setScreenResolution( + display.resolution.mwidth - 1, + display.resolution.mheight - 1)); // Convert the current resolution to a string, and see if there is a // different available resolution to test setScreenResolution(). From a333005de419ad9dd4d85fef8211acc02ab8b91e Mon Sep 17 00:00:00 2001 From: Avtar Gill Date: Fri, 2 Oct 2015 14:56:57 +0000 Subject: [PATCH 232/319] GPII-1289: Makes UnitTests.sh return non-zero exit code on failures --- tests/UnitTests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh index 4209d89..89c3342 100755 --- a/tests/UnitTests.sh +++ b/tests/UnitTests.sh @@ -13,6 +13,8 @@ # You may obtain a copy of the License at # https://github.com/gpii/universal/LICENSE.txt +set -e + pushd . cd ../gpii/node_modules/alsa/test node alsaSettingsHandlerTests.js From 6e1eace844fe5c0be3174b02f5c63494c4bd11ef Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 4 Nov 2015 11:16:52 -0500 Subject: [PATCH 233/319] NOJIRA: Fixed jslint errors in packagekit implementation. --- .../packagekit/nodepackagekit/findSearchPk.js | 52 ++--- .../nodepackagekit/nodepackagekit_test.js | 192 +++++++++--------- .../packagekit/packageKitDeviceReporter.js | 4 +- .../test/packageKitDeviceReporterTests.js | 4 +- 4 files changed, 126 insertions(+), 126 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js b/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js index 6df3963..bfadc4c 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -77,11 +77,11 @@ packages found. /* global require, process, console */ -(function() { +(function () { "use strict"; - var packagekit = require ("./build/Release/nodepackagekit.node"); + var packagekit = require("./build/Release/nodepackagekit.node"); var lookingFor = process.argv[2]; @@ -93,20 +93,20 @@ packages found. // - searchNotInstalled() is used when 'find' found nothing. // - searchInstalled() is used when 'find' found something. function searchNotInstalled() { - packages = packagekit.searchPackage (lookingFor, "~installed;basename"); + packages = packagekit.searchPackage(lookingFor, "~installed;basename"); } function searchInstalled() { - packages = packagekit.searchFiles (whatFindFound); + packages = packagekit.searchFiles(whatFindFound); if (packages.length === 0) { - packages = packagekit.searchPackage (lookingFor, "installed;basename"); + packages = packagekit.searchPackage(lookingFor, "installed;basename"); } } // Handle 'find' on close event -- invoke packagekit.searchPackage(). function onFindClose() { - console.log ("'find' found " + - ( whatFindFound.length === 0 ? "nothing" : whatFindFound )); + console.log("'find' found " + + (whatFindFound.length === 0 ? "nothing" : whatFindFound)); if (whatFindFound.length === 0) { searchNotInstalled(); @@ -118,41 +118,41 @@ packages found. } } if (packages.length > 0) { - console.log (JSON.stringify (packages, null, " ")); + console.log(JSON.stringify(packages, null, " ")); } else { - console.log ("No package found"); + console.log("No package found"); } } - function onFindStdout (data) { - var found = data.toString().split ("\n"); - found.forEach (function (value) { + function onFindStdout(data) { + var found = data.toString().split("\n"); + found.forEach(function (value) { if (value.length > 0) { - whatFindFound.push (value); + whatFindFound.push(value); } }); } if (lookingFor !== undefined) { - var findArgs = process.env.PATH.split (":"); - findArgs.push (process.env.HOME); - findArgs.push ("-name"); - findArgs.push (lookingFor); - findArgs.push ("-type"); - findArgs.push ("f"); // only regular files. - findArgs.push ("-print"); + var findArgs = process.env.PATH.split(":"); + findArgs.push(process.env.HOME); + findArgs.push("-name"); + findArgs.push(lookingFor); + findArgs.push("-type"); + findArgs.push("f"); // only regular files. + findArgs.push("-print"); // Run 'find' - var spawn = require ("child_process").spawn, - find = spawn ("find", findArgs); + var spawn = require("child_process").spawn, + find = spawn("find", findArgs); - find.stdout.on ("data", onFindStdout); + find.stdout.on("data", onFindStdout); - find.on ("close", onFindClose); + find.on("close", onFindClose); - find.on ("error", function (err) { - console.log ("child process : " + err); + find.on("error", function (err) { + console.log("child process : " + err); }); } }()); diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 2bbd09d..bab8f11 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -14,18 +14,18 @@ https://github.com/gpii/universal/LICENSE.txt /*global require*/ -var fluid = require ("universal"), - jqUnit = fluid.require ("jqUnit"), - packagekit = require ("./build/Release/nodepackagekit.node"); +var fluid = require("universal"), + jqUnit = fluid.require("jqUnit"), + packagekit = require("./build/Release/nodepackagekit.node"); -(function() { +(function () { "use strict"; - var pkTests = fluid.registerNamespace ("gpii.tests.packageKit"); + var pkTests = fluid.registerNamespace("gpii.tests.packageKit"); pkTests.isInstalled = function (pkg) { - return (!!pkg && (pkg.data.indexOf ("installed") !== -1)); + return (!!pkg && (pkg.data.indexOf("installed") !== -1)); }; pkTests.findGlib2 = function (aPkg) { @@ -33,7 +33,7 @@ var fluid = require ("universal"), }; pkTests.findPackageByName = function (name, pkgArray) { - return fluid.find (pkgArray, function (aPkg) { + return fluid.find(pkgArray, function (aPkg) { if (aPkg.name === name) { return aPkg; } @@ -42,7 +42,7 @@ var fluid = require ("universal"), // Return the package that matches name, version, and architecture. pkTests.getMatchingPackage = function (pkg, pkgList) { - return fluid.find (pkgList, function (aPkg) { + return fluid.find(pkgList, function (aPkg) { if (aPkg.name === pkg.name && aPkg.version === pkg.version && aPkg.arch === pkg.arch) { @@ -51,21 +51,21 @@ var fluid = require ("universal"), }, null); }; - pkTests.initTuxguitar = function() { + pkTests.initTuxguitar = function () { var tuxguitar = { pkgList: [], pkg: null, inInstalledList: false, inAvailableList: false }; - var pkgs = packagekit.searchPackage ("tuxguitar"); + var pkgs = packagekit.searchPackage("tuxguitar"); tuxguitar.pkgList = pkgs; - tuxguitar.pkg = pkTests.findPackageByName ("tuxguitar", pkgs); + tuxguitar.pkg = pkTests.findPackageByName("tuxguitar", pkgs); return tuxguitar; }; pkTests.isTuxguitarInList = function (tuxguitar, pkgList) { - var matchPkg = pkTests.getMatchingPackage (tuxguitar.pkg, pkgList); + var matchPkg = pkTests.getMatchingPackage(tuxguitar.pkg, pkgList); return (matchPkg !== null); }; @@ -74,142 +74,142 @@ var fluid = require ("universal"), // appears in the list of available packages. In v0.8.17 it did not. // pkTests.availableNotInstalled = function (tuxguitar, availablePkgs) { - var isAvailable = pkTests.isTuxguitarInList (tuxguitar, availablePkgs); - if (tuxguitar.inInstalledList && isAvailable) { - var installedMatchesAvailablePkg = - pkTests.getMatchingPackage (tuxguitar.pkg, availablePkgs); + var isAvailable = pkTests.isTuxguitarInList(tuxguitar, availablePkgs); + if (tuxguitar.inInstalledList && isAvailable) { + var installedMatchesAvailablePkg = + pkTests.getMatchingPackage(tuxguitar.pkg, availablePkgs); - if (installedMatchesAvailablePkg !== null) { - tuxguitar.inAvailableList = false; + if (installedMatchesAvailablePkg !== null) { + tuxguitar.inAvailableList = false; + } + else { + tuxguitar.inAvailableList = true; + } } else { - tuxguitar.inAvailableList = true; + tuxguitar.inAvailableList = isAvailable; } - } - else { - tuxguitar.inAvailableList = isAvailable; - } }; - pkTests.initSearchTest = function() { - var tuxguitar = pkTests.initTuxguitar(); - var installedPkgs = packagekit.searchPackage ("tuxguitar", "installed"); - tuxguitar.inInstalledList = - pkTests.isTuxguitarInList (tuxguitar, installedPkgs); + pkTests.initSearchTest = function () { + var tuxguitar = pkTests.initTuxguitar(); + var installedPkgs = packagekit.searchPackage("tuxguitar", "installed"); + tuxguitar.inInstalledList = + pkTests.isTuxguitarInList(tuxguitar, installedPkgs); - var availablePkgs = packagekit.searchPackage ("tuxguitar", "~installed"); - pkTests.availableNotInstalled (tuxguitar, availablePkgs); + var availablePkgs = packagekit.searchPackage("tuxguitar", "~installed"); + pkTests.availableNotInstalled(tuxguitar, availablePkgs); - return tuxguitar; + return tuxguitar; }; - pkTests.initGetTest = function() { - var tuxguitar = pkTests.initTuxguitar(); - var installedPkgs = packagekit.getPackages ("installed"); - tuxguitar.inInstalledList = - pkTests.isTuxguitarInList (tuxguitar, installedPkgs); + pkTests.initGetTest = function () { + var tuxguitar = pkTests.initTuxguitar(); + var installedPkgs = packagekit.getPackages("installed"); + tuxguitar.inInstalledList = + pkTests.isTuxguitarInList(tuxguitar, installedPkgs); - var availablePkgs = packagekit.getPackages ("~installed"); - pkTests.availableNotInstalled (tuxguitar, availablePkgs); + var availablePkgs = packagekit.getPackages("~installed"); + pkTests.availableNotInstalled(tuxguitar, availablePkgs); - return tuxguitar; + return tuxguitar; }; pkTests.runInstalledVsAvailableTests = function (tuxguitar, msg) { // Depending on whether tuxguitar is installed on not, check that it // appears correctly in the installed or available lists. - if (pkTests.isInstalled (tuxguitar.pkg)) { - jqUnit.assertTrue (msg + " 'tuxguitar' in installed packages list", - tuxguitar.inInstalledList); - jqUnit.assertFalse (msg + " 'tuxguitar' not in available packages " + - "list", tuxguitar.inAvailableList); + if (pkTests.isInstalled(tuxguitar.pkg)) { + jqUnit.assertTrue(msg + " 'tuxguitar' in installed packages list", + tuxguitar.inInstalledList); + jqUnit.assertFalse(msg + " 'tuxguitar' not in available packages " + + "list", tuxguitar.inAvailableList); } else { - jqUnit.assertFalse (msg + " 'tuxguitar' not in installed packages " + - "list", tuxguitar.inInstalledList); - jqUnit.assertTrue (msg + " 'tuxguitar' is in available packages list", - tuxguitar.inAvailableList); + jqUnit.assertFalse(msg + " 'tuxguitar' not in installed packages " + + "list", tuxguitar.inInstalledList); + jqUnit.assertTrue(msg + " 'tuxguitar' is in available packages list", + tuxguitar.inAvailableList); } }; pkTests.searchForMatch = function (tuxguitar, searchFilter) { - var pkgs = packagekit.searchPackage ("tuxguitar", searchFilter); - return pkTests.getMatchingPackage (tuxguitar.pkg, pkgs); + var pkgs = packagekit.searchPackage("tuxguitar", searchFilter); + return pkTests.getMatchingPackage(tuxguitar.pkg, pkgs); }; pkTests.testRemovePackage = function (tuxguitar, matchPkg) { - var id = ( matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); + var id = (matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); // GPII-880: The 'remove' action requires an administrator password. // Packagekit invokes PolKit authentication, putting up a dialog to // capture aforesaid password. This needs to be automated. - packagekit.performAction ("remove", id); - matchPkg = pkTests.searchForMatch (tuxguitar, "~installed"); - jqUnit.assertNotNull ("Remove tuxguitar package", matchPkg); + packagekit.performAction("remove", id); + matchPkg = pkTests.searchForMatch(tuxguitar, "~installed"); + jqUnit.assertNotNull("Remove tuxguitar package", matchPkg); return matchPkg; }; pkTests.testInstallPackage = function (tuxguitar, matchPkg) { - var id = ( matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); - packagekit.performAction ("install", id); - matchPkg = pkTests.searchForMatch (tuxguitar, "installed"); - jqUnit.assertNotNull ("Install tuxguitar package", matchPkg); + var id = (matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); + packagekit.performAction("install", id); + matchPkg = pkTests.searchForMatch(tuxguitar, "installed"); + jqUnit.assertNotNull("Install tuxguitar package", matchPkg); return matchPkg; }; - jqUnit.module ("PackageKit Bridge node add-on module"); + jqUnit.module("PackageKit Bridge node add-on module"); - jqUnit.test ( + jqUnit.test( "Test searchPackage() of 'glib2' with implicit 'none' filter, meaning " + - "installed or available.", function() { + "installed or available.", function () { // Packagekit-glib -- the code this add-on invokes -- itself depends on // glib2. It must be installed, if this is running. - var pkgs = packagekit.searchPackage ("glib2"); - var found = pkgs.some (pkTests.findGlib2); - jqUnit.assertTrue ("Search 'glib2', implicit 'none' filter", found); + var pkgs = packagekit.searchPackage("glib2"); + var found = pkgs.some(pkTests.findGlib2); + jqUnit.assertTrue("Search 'glib2', implicit 'none' filter", found); }); - jqUnit.test ( - "Test searchPackage() 'glib2' with explicit 'none' filter.", function() { + jqUnit.test( + "Test searchPackage() 'glib2' with explicit 'none' filter.", function () { - var pkgs = packagekit.searchPackage ("glib2", "none"); - var found = pkgs.some (pkTests.findGlib2); - jqUnit.assertTrue ("Search 'glib2', explicit 'none' filter", found); + var pkgs = packagekit.searchPackage("glib2", "none"); + var found = pkgs.some(pkTests.findGlib2); + jqUnit.assertTrue("Search 'glib2', explicit 'none' filter", found); }); - jqUnit.test ("Test searchFiles() for '/usr/bin/ls'.", function() { + jqUnit.test("Test searchFiles() for '/usr/bin/ls'.", function () { // The searchFiles() function expects the full path name where the package // would be installed, even it if is not installed. Check using the // common utility 'ls'. - var pkgs = packagekit.searchFiles ("/usr/bin/ls"); - jqUnit.assertNotEquals ( + var pkgs = packagekit.searchFiles("/usr/bin/ls"); + jqUnit.assertNotEquals( "Search file '/usr/bin/ls', implicit 'none' filter", 0, pkgs.length ); - jqUnit.assertTrue ("'ls' is installed", pkTests.isInstalled (pkgs[0])); + jqUnit.assertTrue("'ls' is installed", pkTests.isInstalled(pkgs[0])); }); - jqUnit.test ("Test searchPackage() with 'tuxguitar' comparing installed " + - "vs. available filters.", function() { + jqUnit.test("Test searchPackage() with 'tuxguitar' comparing installed " + + "vs. available filters.", function () { // Test the "installed" vs. "~installed" filters with regards to // 'tuxguitar', and the array of packages returned by searchPackage() // using the filters. Use the tuxguitar package, whether installed or // not, to test against the two arrays. var tuxguitar = pkTests.initSearchTest(); - pkTests.runInstalledVsAvailableTests (tuxguitar, "Search"); + pkTests.runInstalledVsAvailableTests(tuxguitar, "Search"); }); - jqUnit.test ("Test getPackages() with tuxguitar comparing installed vs. " + - "available filters.", function() { + jqUnit.test("Test getPackages() with tuxguitar comparing installed vs. " + + "available filters.", function () { var tuxguitar = pkTests.initGetTest(); - pkTests.runInstalledVsAvailableTests (tuxguitar, "Get"); + pkTests.runInstalledVsAvailableTests(tuxguitar, "Get"); }); - jqUnit.test ("Test performAction(): 'install' and 'remove' tuxguitar." + - " The order depends on whether tuxguitar is currently " + - "installed.", function() { + jqUnit.test("Test performAction(): 'install' and 'remove' tuxguitar." + + " The order depends on whether tuxguitar is currently " + + "installed.", function () { // GPII-880: The 'remove' test requires an administrator password. // Packagekit invokes PolKit authentication, putting up a dialog to @@ -219,18 +219,18 @@ var fluid = require ("universal"), // then (re)install it ... var matchPkg; var tuxguitar = pkTests.initTuxguitar(); - if (pkTests.isInstalled (tuxguitar.pkg)) { - matchPkg = pkTests.testRemovePackage (tuxguitar, null); - pkTests.testInstallPackage (tuxguitar, matchPkg); + if (pkTests.isInstalled(tuxguitar.pkg)) { + matchPkg = pkTests.testRemovePackage(tuxguitar, null); + pkTests.testInstallPackage(tuxguitar, matchPkg); } // ...if it isn't installed, test installing it and then removing it. else { - matchPkg = pkTests.testInstallPackage (tuxguitar, null); - pkTests.testRemovePackage (tuxguitar, matchPkg); + matchPkg = pkTests.testInstallPackage(tuxguitar, null); + pkTests.testRemovePackage(tuxguitar, matchPkg); } }); - jqUnit.test ("Test updatePackage(): with 'emacspeak'", function() { + jqUnit.test("Test updatePackage(): with 'emacspeak'", function () { // The package ids of an old and newer version of 'emacspeak'. // TODO: JS: While the following check against two version of @@ -240,23 +240,23 @@ var fluid = require ("universal"), // multiple versions of a package to test against. var oldEmacspeak = "38.0-5.fc20"; var newEmacspeak = "39.0-1.fc20"; - var pkgs = packagekit.searchPackage ("emacspseak"); + var pkgs = packagekit.searchPackage("emacspseak"); if (pkgs.length === 2 && (pkgs[0].version === oldEmacspeak && pkgs[1].version === newEmacspeak && pkgs[1].data.indexOf("updates") !== -1)) { - packagekit.updatePackage (pkgs[1].id); - var currentPkgs = packagekit.searchPackage ("emacspseak","installed"); - jqUnit.assertEquals ("Updating to " + newEmacspeak, - currentPkgs[0].version, newEmacspeak); + packagekit.updatePackage(pkgs[1].id); + var currentPkgs = packagekit.searchPackage("emacspseak", "installed"); + jqUnit.assertEquals("Updating to " + newEmacspeak, + currentPkgs[0].version, newEmacspeak); // Restore to previous. - packagekit.removePackage (currentPkgs[0].id); + packagekit.removePackage(currentPkgs[0].id); } else { - jqUnit.assertTrue ("Cannot test update of emacspeak as there are no " + - "updates", true); + jqUnit.assertTrue("Cannot test update of emacspeak as there are no " + + "updates", true); } }); }()); diff --git a/gpii/node_modules/packagekit/packageKitDeviceReporter.js b/gpii/node_modules/packagekit/packageKitDeviceReporter.js index 09b9437..e71d4b6 100644 --- a/gpii/node_modules/packagekit/packageKitDeviceReporter.js +++ b/gpii/node_modules/packagekit/packageKitDeviceReporter.js @@ -26,7 +26,7 @@ } }); - gpii.packageKit.get = function(filters) { + gpii.packageKit.get = function (filters) { return { "id": "gpii.packageKit", "data": packageKit.getPackages(filters) @@ -40,7 +40,7 @@ } }); - gpii.packageKit.find = function(name) { + gpii.packageKit.find = function (name) { return gpii.packageKit.installedPackagesCache.some(function (pkg) { return pkg.name === name; }); diff --git a/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js b/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js index c9b9a98..cc497c4 100644 --- a/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js +++ b/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js @@ -21,7 +21,7 @@ fluid.registerNamespace("gpii.packageKit"); var originalCache = fluid.copy(gpii.packageKit.installedPackagesCache); jqUnit.module("GPII PackageKit Device Reporter", { - setup: function() { + setup: function () { // mock-up of installedPackagesCache // gpii.packageKit.installedPackagesCache = [ @@ -33,7 +33,7 @@ jqUnit.module("GPII PackageKit Device Reporter", { } ]; }, - teardown: function() { + teardown: function () { gpii.packageKit.installedPackagesCache = originalCache; } }); From 0c413391012ad2cc3a6070140591775e37d58030 Mon Sep 17 00:00:00 2001 From: Avtar Gill Date: Tue, 17 Nov 2015 19:37:41 -0500 Subject: [PATCH 234/319] GPII-1258: Automates the provisioning of Fedora VMs --- .gitignore | 6 +++ Gruntfile.js | 28 +++++++++++- README.md | 35 +++++++++++++++ Vagrantfile | 82 +++++++++++++++++++++++++++++++++++ provisioning/playbook.yml | 11 +++++ provisioning/requirements.yml | 8 ++++ provisioning/vars.yml | 51 ++++++++++++++++++++++ 7 files changed, 219 insertions(+), 2 deletions(-) create mode 100644 Vagrantfile create mode 100644 provisioning/playbook.yml create mode 100644 provisioning/requirements.yml create mode 100644 provisioning/vars.yml diff --git a/.gitignore b/.gitignore index 42d1f89..715caa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ node_modules/gsettingsBridge/nodegsettings/.lock-wscript node_modules/gsettingsBridge/nodegsettings/build +gpii/node_modules/alsa/nodealsa/build +gpii/node_modules/gsettingsBridge/nodegsettings/build +gpii/node_modules/packagekit/nodepackagekit/build +gpii/node_modules/xrandr/nodexrandr/build +node_modules +.vagrant diff --git a/Gruntfile.js b/Gruntfile.js index 034d8e4..29ec07b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -23,7 +23,7 @@ module.exports = function (grunt) { var usbListenerDir = "./usbDriveListener"; var gypCompileCmd = "node-gyp configure build"; var gypCleanCmd = "node-gyp clean"; - + function nodeGypShell(cmd, cwd) { return { options: { @@ -50,7 +50,12 @@ module.exports = function (grunt) { options: { stdout: true, stderr: true, - failOnError: true + failOnError: true, + // A large maxBuffer value is required for the 'runAcceptanceTests' task otherwise + // a 'stdout maxBuffer exceeded' warning is generated. + execOptions: { + maxBuffer: 1000 * 1024 + } }, compileGSettings: nodeGypShell(gypCompileCmd, "gpii/node_modules/gsettingsBridge/nodegsettings"), cleanGSettings: nodeGypShell(gypCleanCmd, "gpii/node_modules/gsettingsBridge/nodegsettings"), @@ -76,6 +81,12 @@ module.exports = function (grunt) { "sudo rm -f /usr/share/applications/gpii-usb-user-listener.desktop", "sudo rm -f -r /var/lib/gpii" ].join("&&") + }, + runAcceptanceTests: { + command: "vagrant ssh -c 'DISPLAY=:0 node /home/vagrant/sync/tests/AcceptanceTests.js'" + }, + runUnitTests: { + command: "vagrant ssh -c 'cd /home/vagrant/sync/tests/; DISPLAY=:0 ./UnitTests.sh'" } } }); @@ -104,4 +115,17 @@ module.exports = function (grunt) { grunt.registerTask("uninstall", "Uninstall system level GPII Components", function () { grunt.task.run("shell:uninstallUsbLib"); }); + + grunt.registerTask("unit-tests", "Run GPII unit tests", function () { + grunt.task.run("shell:runUnitTests"); + }); + + grunt.registerTask("acceptance-tests", "Run GPII acceptance tests", function () { + grunt.task.run("shell:runAcceptanceTests"); + }); + + grunt.registerTask("tests", "Run GPII unit and acceptance tests", function () { + grunt.task.run("shell:runUnitTests"); + grunt.task.run("shell:runAcceptanceTests"); + }); }; diff --git a/README.md b/README.md index 6fe7cf4..8842d3f 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,38 @@ this may prompt you for sudo access. grunt install grunt uninstall + +# Setting Up a Virtual Machine + +This repository contains content that will allow you to automatically provision a development VM. A [Vagrantfile](http://docs.vagrantup.com/v2/vagrantfile/) is provided that downloads a [Fedora Vagrant box](https://github.com/idi-ops/packer-fedora), starts a VM, and deploys the GPII Framework on it. + +The ``provisioning`` directory contains these files: + +* ``playbook.yml`` - an [Ansible playbook](http://docs.ansible.com/ansible/playbooks.html) that orchestrates the provisioning process +* ``requirements.yml`` - specifies the [Ansible roles](http://docs.ansible.com/ansible/playbooks_roles.html) that the playbook requires +* ``vars.yml`` - a list of variables used by the playbook + +## Requirements + +Please ensure that the [QI Development Environments software requirements](https://github.com/GPII/qi-development-environments/blob/master/README.md#requirements) have been met. You will additionally need the following on your host operating system: + +* [grunt-cli](https://github.com/gruntjs/grunt-cli) +* At least 2GB of available storage space + +## Getting Started + +In order to create a new VM you will need to issue the following command: + + vagrant up + +By default the VM will use two processor cores and 2GB of RAM. Two environment variables can be passed to the ``vagrant up`` command to allocate more cores (``VM_CPUS=2``) and RAM (``VM_RAM=2048``). If this is your first time setting up this VM then the 2GB Fedora Vagrant box will be downloaded. + +Once the box has been downloaded the provisioning process will ensure that project dependencies have been met and then the ``npm install`` and ``grunt --force build`` commands will be executed. If you reboot the VM the provisioner will not run again. However, you can use ``vagrant provision`` to trigger that process at any time. + +To run tests you can use the ``grunt tests`` target which will run unit and acceptance tests in the VM and report the results in your terminal. Or you could use ``grunt unit-tests`` and/or ``grunt acceptance-tests`` separately. + +You can stop the VM using ``vagrant halt`` or delete it altogether using ``vagrant destroy``. + +## Notes + +The entire Git working directory will be mounted at the ``/home/vagrant/sync`` path in the VM and bidirectionally synced with the host operating system. This means build artifacts created by processes in the VM will be exposed to the host. It will be safer if you commit to running build tasks such as ``npm install`` or ``grunt build`` in the VM and not attempt that on the host. diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..e4ed5e2 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,82 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +require 'yaml' + +ansible_vars = YAML.load_file("provisioning/vars.yml") + +app_name = ansible_vars["nodejs_app_name"] + +app_directory = ansible_vars["nodejs_app_install_dir"] + +app_start_script = ansible_vars["nodejs_app_start_script"] + +# Check for the existence of the 'VM_HOST_TCP_PORT' environment variable. If it +# doesn't exist and 'nodejs_app_tcp_port' is defined in vars.yml then use that +# port. Failing that use defaults provided in this file. +host_tcp_port = ENV["VM_HOST_TCP_PORT"] || ansible_vars["nodejs_app_tcp_port"] || 8081 +guest_tcp_port = ansible_vars["nodejs_app_tcp_port"] || 8081 + +# By default this VM will use 2 processor cores and 2GB of RAM. The 'VM_CPUS' and +# "VM_RAM" environment variables can be used to change that behaviour. +cpus = ENV["VM_CPUS"] || 2 +ram = ENV["VM_RAM"] || 2048 + +Vagrant.configure(2) do |config| + + config.vm.box = "inclusivedesign/fedora22" + + # Your working directory will be synced to /home/vagrant/sync in the VM. + config.vm.synced_folder ".", "#{app_directory}" + + # List additional directories to sync to the VM in your "Vagrantfile.local" file + # using the following format: + # config.vm.synced_folder "../path/on/your/host/os/your-project", "/home/vagrant/sync/your-project" + + if File.exist? "Vagrantfile.local" + instance_eval File.read("Vagrantfile.local"), "Vagrantfile.local" + end + + # Port forwarding takes place here. The 'guest' port is used inside the VM + # whereas the 'host' port is used by your host operating system. + config.vm.network "forwarded_port", guest: guest_tcp_port, host: host_tcp_port, protocol: "tcp", + auto_correct: true + + # Port 19531 is needed so logs can be viewed using systemd-journal-gateway + #config.vm.network "forwarded_port", guest: 19531, host: 19531, protocol: "tcp", + # auto_correct: true + + config.vm.hostname = app_name + + config.vm.provider :virtualbox do |vm| + vm.customize ["modifyvm", :id, "--memory", ram] + vm.customize ["modifyvm", :id, "--cpus", cpus] + vm.customize ["modifyvm", :id, "--vram", "128"] + vm.customize ["modifyvm", :id, "--accelerate3d", "on"] + vm.customize ["modifyvm", :id, "--audio", "null", "--audiocontroller", "ac97"] + vm.customize ["modifyvm", :id, "--ioapic", "on"] + vm.customize ["setextradata", "global", "GUI/SuppressMessages", "all"] + end + + config.vm.provision "shell", inline: <<-SHELL + sudo ansible-galaxy install -fr /home/vagrant/sync/provisioning/requirements.yml + sudo PYTHONUNBUFFERED=1 ansible-playbook /home/vagrant/sync/provisioning/playbook.yml --tags="install,configure" + SHELL + + # Using config.vm.hostname to set the hostname on Fedora VMs seems to remove the string + # "localhost" from the first line of /etc/hosts. This script reinserts it if it's missing. + # https://github.com/mitchellh/vagrant/pull/6203 + config.vm.provision "shell", + inline: "/usr/local/bin/edit-hosts.sh", + run: "always" + + # http://serverfault.com/a/725051 + #config.vm.provision "shell", + # inline: "sudo systemctl restart #{app_name}.service", + # run: "always" + + #config.vm.provision "shell", + # inline: "sudo systemctl restart systemd-journal-gatewayd.service", + # run: "always" + +end diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml new file mode 100644 index 0000000..dd8663e --- /dev/null +++ b/provisioning/playbook.yml @@ -0,0 +1,11 @@ +--- +- hosts: localhost + user: root + + vars_files: + - vars.yml + + roles: + - facts + - nodejs + - gpii-framework diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml new file mode 100644 index 0000000..152e605 --- /dev/null +++ b/provisioning/requirements.yml @@ -0,0 +1,8 @@ +- src: https://github.com/idi-ops/ansible-facts + name: facts + +- src: https://github.com/idi-ops/ansible-nodejs + name: nodejs + +- src: https://github.com/gpii-ops/ansible-gpii-framework + name: gpii-framework diff --git a/provisioning/vars.yml b/provisioning/vars.yml new file mode 100644 index 0000000..9f35671 --- /dev/null +++ b/provisioning/vars.yml @@ -0,0 +1,51 @@ +--- +# Please refer to https://github.com/idi-ops/ansible-nodejs/blob/master/defaults/main.yml +# for documentation related to these variables + +nodejs_app_name: gpii-linux-framework + +nodejs_app_git_repo: https://github.com/gpii/linux.git + +nodejs_app_git_branch: master + +# Node.js version required by application (supported versions: 0.10.36*, 0.10.40, 4.1.1) +nodejs_version: 0.10.40 + +# If a specific npm version is needed, specify it here +#nodejs_npm_version: 1.4.28 + +nodejs_app_rpm_packages: + - orca + - glib2-devel + - PackageKit-glib-devel + - json-glib-devel + - libXrandr-devel + - libXrender-devel + - libX11-devel + - xorg-x11-proto-devel + - alsa-lib-devel + - tuxguitar + - v8 + - v8-devel + - libstdc++ + - gcc-c++ + - gyp + - http-parser + - http-parser-devel + - libstdc++-devel + - libuv + - libuv-devel + +nodejs_app_npm_packages: + - node-gyp + +nodejs_app_commands: + - npm install + - grunt --force build + +nodejs_app_start_script: gpii.js + +nodejs_app_install_dir: /home/vagrant/sync + +nodejs_app_git_clone: false + From 5c8e65733ebd05f2ba0398fcd401333df0158319 Mon Sep 17 00:00:00 2001 From: Avtar Gill Date: Tue, 17 Nov 2015 19:46:38 -0500 Subject: [PATCH 235/319] GPII-1258: Removes unnecessary variables --- provisioning/vars.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/provisioning/vars.yml b/provisioning/vars.yml index 9f35671..afd2bbe 100644 --- a/provisioning/vars.yml +++ b/provisioning/vars.yml @@ -4,10 +4,6 @@ nodejs_app_name: gpii-linux-framework -nodejs_app_git_repo: https://github.com/gpii/linux.git - -nodejs_app_git_branch: master - # Node.js version required by application (supported versions: 0.10.36*, 0.10.40, 4.1.1) nodejs_version: 0.10.40 From 183f6f957ba8258db8c2ae50a2112ea691eaa699 Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Fri, 4 Dec 2015 00:29:49 +0000 Subject: [PATCH 236/319] GPII-1318: Updating references to node-jqunit for change in package name, dependencies for node 4.2.x --- .../alsa/nodealsa/nodealsa_tests.js | 2 +- .../alsa/test/alsaSettingsHandlerTests.js | 2 +- .../gsettingsBridge/tests/gsettingsTests.js | 4 +- .../orca/test/orcaSettingsHandlerTests.js | 2 +- .../nodepackagekit/nodepackagekit_test.js | 2 +- .../test/packageKitDeviceReporterTests.js | 2 +- .../packagekit/test/packageKitModuleTests.js | 2 +- .../xrandr/nodexrandr/nodexrandr_tests.js | 2 +- .../xrandr/test/xrandrSettingsHandlerTests.js | 2 +- index.js | 10 +-- package.json | 63 +++++++++---------- 11 files changed, 44 insertions(+), 49 deletions(-) diff --git a/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js b/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js index cafcc24..595c4d4 100644 --- a/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js +++ b/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js @@ -17,7 +17,7 @@ "use strict"; var fluid = require("universal"), - jqUnit = fluid.require("jqUnit"), + jqUnit = fluid.require("node-jqunit"), alsa = require("./build/Release/nodealsa.node"); jqUnit.module("GPII ALSA Volume Bridge"); diff --git a/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js b/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js index 8a4ed1d..c556d8f 100644 --- a/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js +++ b/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js @@ -13,7 +13,7 @@ https://github.com/gpii/universal/LICENSE.txt "use strict"; var fluid = require("universal"), - jqUnit = fluid.require("jqUnit"); + jqUnit = fluid.require("node-jqunit"); require("alsa"); var alsa = fluid.registerNamespace("gpii.alsa"); diff --git a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js index 8a31a9d..c4b28a3 100644 --- a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -21,9 +21,9 @@ (function () { var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("jqUnit"); + jqUnit = fluid.require("node-jqunit"); - fluid.require("gsettingsBridge", require); + require("gsettingsBridge"); var put1 = { request: { diff --git a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js index 19bda45..68d9b4e 100644 --- a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -17,7 +17,7 @@ "use strict"; var fluid = require("universal"), - jqUnit = fluid.require("jqUnit"); + jqUnit = fluid.require("node-jqunit"); require("orca"); var gpii = fluid.registerNamespace("gpii"); diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 2bbd09d..70b2675 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -15,7 +15,7 @@ https://github.com/gpii/universal/LICENSE.txt /*global require*/ var fluid = require ("universal"), - jqUnit = fluid.require ("jqUnit"), + jqUnit = fluid.require ("node-jqunit"), packagekit = require ("./build/Release/nodepackagekit.node"); (function() { diff --git a/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js b/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js index c9b9a98..aba96a0 100644 --- a/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js +++ b/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js @@ -13,7 +13,7 @@ var fluid = require("universal"), gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("jqUnit"); + jqUnit = fluid.require("node-jqunit"); require("packagekit"); fluid.registerNamespace("gpii.packageKit"); diff --git a/gpii/node_modules/packagekit/test/packageKitModuleTests.js b/gpii/node_modules/packagekit/test/packageKitModuleTests.js index 37ca370..e36bd88 100644 --- a/gpii/node_modules/packagekit/test/packageKitModuleTests.js +++ b/gpii/node_modules/packagekit/test/packageKitModuleTests.js @@ -12,7 +12,7 @@ "use strict"; var fluid = require("universal"), - jqUnit = fluid.require("jqUnit"); + jqUnit = fluid.require("node-jqunit"); require("packagekit"); diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index 7e79870..63612f7 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -17,7 +17,7 @@ "use strict"; var fluid = require("universal"), - jqUnit = fluid.require("jqUnit"), + jqUnit = fluid.require("node-jqunit"), xrandr = require("./build/Release/nodexrandr.node"); var convert = fluid.registerNamespace("gpii.tests.xrandr.convert"); diff --git a/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js b/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js index 2ec47c3..a6d1a9d 100644 --- a/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js +++ b/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js @@ -17,7 +17,7 @@ "use strict"; var fluid = require("universal"), - jqUnit = fluid.require("jqUnit"); + jqUnit = fluid.require("node-jqunit"); require("xrandr"); var xrandr = fluid.registerNamespace("gpii.xrandr"); diff --git a/index.js b/index.js index 5350ca3..6e6114e 100644 --- a/index.js +++ b/index.js @@ -21,11 +21,11 @@ fluid.module.register("gpii-linux", __dirname, require); // Settings Handlers // -fluid.require("./gpii/node_modules/gsettingsBridge", require); -fluid.require("./gpii/node_modules/orca", require); -fluid.require("./gpii/node_modules/alsa", require); -fluid.require("./gpii/node_modules/xrandr", require); +require("./gpii/node_modules/gsettingsBridge"); +require("./gpii/node_modules/orca"); +require("./gpii/node_modules/alsa"); +require("./gpii/node_modules/xrandr"); // Device Reporters // -fluid.require("./gpii/node_modules/packagekit", require); +require("./gpii/node_modules/packagekit"); diff --git a/package.json b/package.json index 4fc0a62..51fea6f 100644 --- a/package.json +++ b/package.json @@ -1,37 +1,32 @@ { - "name": "gpii-linux", - "description": "Components of the GPII personalization infrastructure for use on Linux", - "version": "0.0.1", - "author": "GPII", - "bugs": "http://issues.gpii.net/browse/GPII", - "homepage": "http://gpii.net/", - "dependencies": {}, - "devDependencies": { - "grunt": "~0.4.4", - "grunt-shell": "0.6.4", - "grunt-contrib-jshint": "~0.9.0", - "grunt-jsonlint": "1.0.4", - "grunt-gpii": "git://github.com/GPII/grunt-gpii.git#ec8412064e107febb120f0b7437d403453b40d2d" - }, - "licenses": [ - { - "type": "BSD-3-Clause", - "url": "http://www.opensource.org/licenses/BSD-3-Clause" + "name": "gpii-linux", + "description": "Components of the GPII personalization infrastructure for use on Linux", + "version": "1.0.0", + "author": "GPII", + "bugs": "http://issues.gpii.net/browse/GPII", + "homepage": "http://gpii.net/", + "dependencies": {}, + "devDependencies": { + "grunt": "~0.4.5", + "grunt-shell": "0.6.4", + "grunt-contrib-jshint": "~0.9.0", + "grunt-jsonlint": "1.0.4", + "grunt-gpii": "git://github.com/GPII/grunt-gpii.git#ec8412064e107febb120f0b7437d403453b40d2d" + }, + "license" : "BSD-3-Clause", + "keywords": [ + "gpii", + "accessibility", + "settings", + "fluid", + "IoC", + "Inversion of Control", + "configuration", + "evented" + ], + "repository": "git://github.com/GPII/linux.git", + "main": "./gpii/index.js", + "engines": { + "node": ">=4.2.1" } - ], - "keywords": [ - "gpii", - "accessibility", - "settings", - "fluid", - "IoC", - "Inversion of Control", - "configuration", - "evented" - ], - "repository": "git://github.com/GPII/linux.git", - "main": "./gpii/index.js", - "engines": { - "node": ">=0.6.0" - } } From 95496174b600865844c41f1980b881b46f886476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 7 Dec 2015 19:47:13 +0100 Subject: [PATCH 237/319] GPII-1526: Add nan as a devDependency --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 51fea6f..0aab046 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,10 @@ "grunt-shell": "0.6.4", "grunt-contrib-jshint": "~0.9.0", "grunt-jsonlint": "1.0.4", - "grunt-gpii": "git://github.com/GPII/grunt-gpii.git#ec8412064e107febb120f0b7437d403453b40d2d" + "grunt-gpii": "git://github.com/GPII/grunt-gpii.git#ec8412064e107febb120f0b7437d403453b40d2d", + "nan": "^2.1.0" }, - "license" : "BSD-3-Clause", + "license" : "BSD-3-Clause", "keywords": [ "gpii", "accessibility", From 3e8d6451196c091d6dac558525377393183af448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 7 Dec 2015 19:49:45 +0100 Subject: [PATCH 238/319] GPII-1526: Poting gsettings addon to Nan --- .../gsettingsBridge/nodegsettings/binding.gyp | 3 + .../nodegsettings/nodegsettings.cc | 115 +++++++++--------- 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/binding.gyp b/gpii/node_modules/gsettingsBridge/nodegsettings/binding.gyp index 8657074..d681b24 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/binding.gyp +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/binding.gyp @@ -3,6 +3,9 @@ { "target_name": "nodegsettings", "sources": ["nodegsettings.cc"], + "include_dirs" : [ + " -#include - +#include #include using namespace v8; +using v8::FunctionTemplate; +using v8::Handle; +using v8::Isolate; +using v8::Object; +using v8::String; +using Nan::GetFunction; +using Nan::New; +using Nan::Set; +using Nan::ThrowError; -Handle get_gsetting_keys(const Arguments& args) { - HandleScope scope; +NAN_METHOD(get_gsetting_keys) { + Isolate *isolate = info.GetIsolate(); GSettings *settings; - char schema[1024]; gchar ** keys; gint i; gint size = 0; - args[0]->ToString()->WriteAscii(schema); - settings = g_settings_new(schema); + Local schema = info[0].As(); + settings = g_settings_new(*String::Utf8Value(schema)); keys = g_settings_list_keys(settings); for (i = 0; keys[i]; i++) { size++; // Figure out how to do this in 1 loop } - Handle togo; - togo = Array::New(size); + Handle togo = Array::New(isolate, size); for (i = 0; keys[i]; i++) { - togo->Set(i,String::New(keys[i])); + togo->Set(i,String::NewFromUtf8(isolate, keys[i])); } - return scope.Close(togo); + info.GetReturnValue().Set(togo); } -/* Should take schema and key */ -Handle get_gsetting(const Arguments& args) { - HandleScope scope; +///* Should take schema and key */ +NAN_METHOD(get_gsetting) { + Isolate *isolate = info.GetIsolate(); GSettings *settings; - char schema[1024]; - char key[1024]; - args[0]->ToString()->WriteAscii(schema); - settings = g_settings_new(schema); - args[1]->ToString()->WriteAscii(key); + Local schema = info[0].As(); + Local key = info[1].As(); + settings = g_settings_new(*String::Utf8Value(schema)); GVariant* variant; const GVariantType* type; - variant = g_settings_get_value(settings,key); + variant = g_settings_get_value(settings,*String::Utf8Value(key)); type = g_variant_get_type(variant); if (g_variant_type_equal(type,G_VARIANT_TYPE_DOUBLE)) { - return scope.Close(Number::New(g_variant_get_double(variant))); + info.GetReturnValue().Set(Number::New(isolate, g_variant_get_double(variant))); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_INT32)) { - return scope.Close(Int32::New(g_variant_get_int32(variant))); + info.GetReturnValue().Set(Int32::New(isolate, g_variant_get_int32(variant))); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_STRING)) { - return scope.Close(String::New(g_variant_get_string(variant,NULL))); + info.GetReturnValue().Set(String::NewFromUtf8(isolate, g_variant_get_string(variant,NULL))); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_BOOLEAN)) { - return scope.Close(Boolean::New(g_variant_get_boolean(variant))); + info.GetReturnValue().Set(Boolean::New(isolate, g_variant_get_boolean(variant))); } else { g_print("The type is %s\n", g_variant_type_peek_string(type)); - ThrowException(Exception::Error(String::New("Need to implement reading that value type"))); - return scope.Close(Undefined()); + ThrowError(String::NewFromUtf8(isolate,"Need to implement reading that value type")); + info.GetReturnValue().Set(Undefined(isolate)); } } -/* Should take schema, key, and value */ -Handle set_gsetting(const Arguments& args) { - HandleScope scope; +///* Should take schema, key, and value */ +NAN_METHOD(set_gsetting) { + Isolate *isolate = info.GetIsolate(); GSettings *settings; GVariant* variant; const GVariantType* type; - char schema[1024]; - char key[1024]; + Local schema = info[0].As(); + Local key = info[1].As(); bool status = false; - args[0]->ToString()->WriteAscii(schema); - settings = g_settings_new(schema); - args[1]->ToString()->WriteAscii(key); - if (args[2]->IsBoolean()) { - status = g_settings_set_boolean(settings,key,args[2]->BooleanValue()); + settings = g_settings_new(*String::Utf8Value(schema)); + if (info[2]->IsBoolean()) { + status = g_settings_set_boolean(settings,*String::Utf8Value(key),info[2]->BooleanValue()); } - else if (args[2]->IsNumber()) { - variant = g_settings_get_value(settings,key); + else if (info[2]->IsNumber()) { + variant = g_settings_get_value(settings,*String::Utf8Value(key)); type = g_variant_get_type(variant); if (g_variant_type_equal(type,G_VARIANT_TYPE_DOUBLE)) { - status = g_settings_set_double(settings,key,args[2]->ToNumber()->Value()); + status = g_settings_set_double(settings,*String::Utf8Value(key),info[2]->ToNumber()->Value()); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_INT32)) { - status = g_settings_set_int(settings,key,args[2]->ToInt32()->Value()); + status = g_settings_set_int(settings,*String::Utf8Value(key),info[2]->ToInt32()->Value()); } else { g_print("The type is %s\n", g_variant_type_peek_string(type)); - ThrowException(Exception::Error(String::New("We haven't implemented this number type yet!"))); + ThrowError(String::NewFromUtf8(isolate, "We haven't implemented this number type yet!")); } } - else if (args[2]->IsString()) { - char val[1024]; - variant = g_settings_get_value(settings,key); + else if (info[2]->IsString()) { + Local val = info[2].As(); + variant = g_settings_get_value(settings,*String::Utf8Value(key)); type = g_variant_get_type(variant); - args[2]->ToString()->WriteAscii(val); - status = g_settings_set_string(settings,key,val); + status = g_settings_set_string(settings,*String::Utf8Value(key),*String::Utf8Value(val)); } else { - ThrowException(Exception::Error(String::New("We haven't implemented this type yet!"))); + ThrowError(String::NewFromUtf8(isolate, "We haven't implemented this type yet!")); } g_settings_sync(); - return scope.Close(Boolean::New(status)); + info.GetReturnValue().Set(Boolean::New(isolate, status)); } -void init(Handle target) { - target->Set(String::NewSymbol("set_gsetting"), - FunctionTemplate::New(set_gsetting)->GetFunction()); - target->Set(String::NewSymbol("get_gsetting"), - FunctionTemplate::New(get_gsetting)->GetFunction()); - target->Set(String::NewSymbol("get_gsetting_keys"), - FunctionTemplate::New(get_gsetting_keys)->GetFunction()); +NAN_MODULE_INIT(init) { + Nan::Set(target, New("set_gsetting").ToLocalChecked(), + GetFunction(New(set_gsetting)).ToLocalChecked()); + Nan::Set(target, New("get_gsetting").ToLocalChecked(), + GetFunction(New(get_gsetting)).ToLocalChecked()); + Nan::Set(target, New("get_gsetting_keys").ToLocalChecked(), + GetFunction(New(get_gsetting_keys)).ToLocalChecked()); } -NODE_MODULE(nodegsettings, init) +NODE_MODULE(nodegsettings, init) From 90cc2a429fa47c5b9c6386794124565510ab18eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 7 Dec 2015 19:50:28 +0100 Subject: [PATCH 239/319] GPII-1526: Removed useless tests.js file under gsettingsBridge folder --- .../gsettingsBridge/tests/tests.js | 45 ------------------- 1 file changed, 45 deletions(-) delete mode 100644 gpii/node_modules/gsettingsBridge/tests/tests.js diff --git a/gpii/node_modules/gsettingsBridge/tests/tests.js b/gpii/node_modules/gsettingsBridge/tests/tests.js deleted file mode 100644 index fc530ce..0000000 --- a/gpii/node_modules/gsettingsBridge/tests/tests.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * GPII GSettingsbridge tests - * - * Copyright 2013 Emergya - * - * Licensed under the New BSD license. You may not use this file except in - * compliance with this License. - * - * The research leading to these results has received funding from the European Union's - * Seventh Framework Programme (FP7/2007-2013) - * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt - */ -"use strict"; - -// TODO: These tests look like old junk and have not run in a while - we should probably delete them - -var gsettings = require("../gsettings_bridge.js"); -var util = require("util"); -var fs = require("fs"); - -// TODO: Why is this commented out? -/* -var test1 = function () { - fs.readFile("data/gmag-orig.json", function (error, data) { - var settings = JSON.parse(data); - util.puts(JSON.stringify(gsettings.setSettings(settings))); - }); -}; -*/ - -var test2 = function () { - fs.readFile("data/gmag-test1.json", function (error, data) { - var settings = JSON.parse(data); - util.puts(JSON.stringify(gsettings.getSettings(settings))); - }); -}; - -util.puts("Ok testing..."); -util.puts(JSON.stringify(gsettings)); -//test1(); -test2(); -util.puts("Done"); \ No newline at end of file From 3336d29051c2440fc994312c6807af3a8a646efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 7 Dec 2015 20:06:51 +0100 Subject: [PATCH 240/319] GPII-1526: Ported ALSA addon to nan --- gpii/node_modules/alsa/nodealsa/binding.gyp | 3 ++ gpii/node_modules/alsa/nodealsa/nodealsa.cc | 37 ++++++++++++--------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/gpii/node_modules/alsa/nodealsa/binding.gyp b/gpii/node_modules/alsa/nodealsa/binding.gyp index bbe2afb..3270839 100644 --- a/gpii/node_modules/alsa/nodealsa/binding.gyp +++ b/gpii/node_modules/alsa/nodealsa/binding.gyp @@ -3,6 +3,9 @@ { "target_name": "nodealsa", "sources": ["nodealsa.cc"], + "include_dirs" : [ + " -#include - +#include #include #include #include using namespace v8; +using v8::FunctionTemplate; +using v8::Handle; +using v8::Object; +using v8::String; +using Nan::GetFunction; +using Nan::New; +using Nan::Set; +using Nan::ThrowError; -Handle getSystemVolume(const Arguments& args) { - HandleScope scope; +NAN_METHOD(getSystemVolume) { snd_mixer_t *handle; snd_mixer_selem_id_t *sid; const char *card = "default"; @@ -49,17 +55,15 @@ Handle getSystemVolume(const Arguments& args) { snd_mixer_close(handle); - return scope.Close(Number::New(curr)); + info.GetReturnValue().Set(Number::New(info.GetIsolate(), curr)); } -Handle setSystemVolume(const Arguments& args) { - HandleScope scope; - +NAN_METHOD(setSystemVolume) { snd_mixer_t *handle; snd_mixer_selem_id_t *sid; const char *card = "default"; const char *selem_name = "Master"; - long volume = args[0]->ToNumber()->Value(); + long volume = info[0]->ToNumber()->Value(); snd_mixer_open(&handle, 0); snd_mixer_attach(handle, card); @@ -77,13 +81,14 @@ Handle setSystemVolume(const Arguments& args) { snd_mixer_close(handle); - return scope.Close(Boolean::New("True")); + info.GetReturnValue().Set(Boolean::New(info.GetIsolate(), "True")); } -void init(Handle target) { - target->Set(String::NewSymbol("getSystemVolume"), - FunctionTemplate::New(getSystemVolume)->GetFunction()); - target->Set(String::NewSymbol("setSystemVolume"), - FunctionTemplate::New(setSystemVolume)->GetFunction()); +NAN_MODULE_INIT(init) { + Nan::Set(target, New("setSystemVolume").ToLocalChecked(), + GetFunction(New(setSystemVolume)).ToLocalChecked()); + Nan::Set(target, New("getSystemVolume").ToLocalChecked(), + GetFunction(New(getSystemVolume)).ToLocalChecked()); } + NODE_MODULE(nodealsa, init) From a39071a6a0711da3e26e8875e3698b71d13bc641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 8 Dec 2015 01:45:54 +0100 Subject: [PATCH 241/319] GPII-1526: Ported XRandR addon to nan --- .../xrandr/nodexrandr/binding.gyp | 3 + .../xrandr/nodexrandr/nodexrandr.cc | 90 ++++++++++--------- 2 files changed, 53 insertions(+), 40 deletions(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/binding.gyp b/gpii/node_modules/xrandr/nodexrandr/binding.gyp index c8b6271..5e659ad 100644 --- a/gpii/node_modules/xrandr/nodexrandr/binding.gyp +++ b/gpii/node_modules/xrandr/nodexrandr/binding.gyp @@ -3,6 +3,9 @@ { "target_name": "nodexrandr", "sources": ["nodexrandr.cc"], + "include_dirs" : [ + " -#include +#include #include #include @@ -39,6 +39,15 @@ #endif using namespace v8; +using v8::FunctionTemplate; +using v8::Handle; +using v8::Isolate; +using v8::Object; +using v8::String; +using Nan::GetFunction; +using Nan::New; +using Nan::Set; + using namespace std; typedef enum _name_kind { @@ -137,15 +146,14 @@ find_mode_by_xid (RRMode mode, XRRScreenResources *res) return find_mode (&mode_name, 0, res); } -Handle getDisplays(const Arguments& args) { - HandleScope scope; - +NAN_METHOD(getDisplays) { Display *dpy; Window root; XRRScreenResources *res; XRRScreenConfiguration *sc; - v8::Handle result = v8::Array::New(); + Isolate *isolate = info.GetIsolate(); + Handle result = Array::New(isolate); char *display_name = NULL; int screen = -1; @@ -175,59 +183,61 @@ Handle getDisplays(const Arguments& args) { current_size = XRRConfigCurrentConfiguration (sc, ¤t_rotation); sizes = XRRConfigSizes(sc, &nsize); - v8::Handle resolution_object = v8::Object::New(); + Handle resolution_object = Object::New(isolate); res = XRRGetScreenResourcesCurrent (dpy, root); for (int i=0; inoutput; i++) { XRROutputInfo *output_info; output_info = XRRGetOutputInfo(dpy, res, res->outputs[i]); - v8::Handle output = v8::Object::New(); + Handle output = Object::New(isolate); - output->Set(String::New("name"), String::New(output_info->name)); + output->Set(String::NewFromUtf8(isolate, "name"), + String::NewFromUtf8(isolate, output_info->name)); switch (output_info->connection) { case RR_Connected: - output->Set(String::New("status"), String::New("connected")); + output->Set(String::NewFromUtf8(isolate, "status"), + String::NewFromUtf8(isolate, "connected")); - resolution_object->Set(String::New("width"), - Integer::New(sizes[current_size].width)); - resolution_object->Set(String::New("height"), - Integer::New(sizes[current_size].height)); + resolution_object->Set(String::NewFromUtf8(isolate, "width"), + Integer::New(isolate, sizes[current_size].width)); + resolution_object->Set(String::NewFromUtf8(isolate, "height"), + Integer::New(isolate, sizes[current_size].height)); - resolution_object->Set(String::New("mwidth"), - Integer::New(sizes[current_size].mwidth)); - resolution_object->Set(String::New("mheight"), - Integer::New(sizes[current_size].mheight)); + resolution_object->Set(String::NewFromUtf8(isolate, "mwidth"), + Integer::New(isolate, sizes[current_size].mwidth)); + resolution_object->Set(String::NewFromUtf8(isolate, "mheight"), + Integer::New(isolate, sizes[current_size].mheight)); - output->Set(String::New("resolution"), resolution_object); + output->Set(String::NewFromUtf8(isolate, "resolution"), resolution_object); break; case RR_Disconnected: - output->Set(String::New("status"), String::New("disconnected")); + output->Set(String::NewFromUtf8(isolate, "status"), String::NewFromUtf8(isolate, "disconnected")); break; } - v8::Handle available_resolutions = v8::Array::New(); + Handle available_resolutions = Array::New(isolate); for (int j=0; jnmode; j++) { char *resolution; XRRModeInfo *mode = find_mode_by_xid (output_info->modes[j], res); asprintf(&resolution, "%dx%d", mode->width, mode->height); - available_resolutions->Set(j,String::New(resolution)); + available_resolutions->Set(j,String::NewFromUtf8(isolate, resolution)); } - output->Set(String::New("available_resolutions"), + output->Set(String::NewFromUtf8(isolate, "available_resolutions"), available_resolutions); result->Set(i,output); } - return scope.Close(result); + info.GetReturnValue().Set(result); } -Handle setScreenResolution(const Arguments& args) { - HandleScope scope; +NAN_METHOD(setScreenResolution) { Display *dpy; + Isolate *isolate = info.GetIsolate(); - int width = args[0]->ToInteger()->Value(); - int height = args[1]->ToInteger()->Value(); + int width = info[0]->ToInteger()->Value(); + int height = info[1]->ToInteger()->Value(); Rotation rotation = 1; int reflection = 0; @@ -237,7 +247,7 @@ Handle setScreenResolution(const Arguments& args) { dpy = XOpenDisplay (displayname); if (dpy == NULL) { printf ("Cannot open display %s\n", displayname); - return scope.Close (Boolean::New(False)); + return info.GetReturnValue().Set(Boolean::New(isolate, False)); } int screen = DefaultScreen (dpy); @@ -246,12 +256,12 @@ Handle setScreenResolution(const Arguments& args) { int errorbase; if (!XRRQueryExtension(dpy, &eventbase, &errorbase)) { printf ("RandR extension missing\n"); - return scope.Close (Boolean::New(False)); + return info.GetReturnValue().Set(Boolean::New(isolate, False)); } XRRScreenConfiguration *sc = XRRGetScreenInfo (dpy, root); if (sc == NULL) { printf ("Cannot get screen info\n"); - return scope.Close (Boolean::New(False)); + return info.GetReturnValue().Set(Boolean::New(isolate, False)); } XSelectInput (dpy, root, StructureNotifyMask); XRRSelectInput (dpy, root, RRScreenChangeNotifyMask); @@ -273,7 +283,7 @@ Handle setScreenResolution(const Arguments& args) { if (sizeindex >= nsize) { printf ("%dx%d resolution not available\n", width, height); XRRFreeScreenConfigInfo (sc); - return scope.Close (Boolean::New(False)); + return info.GetReturnValue().Set(Boolean::New(isolate, False)); } Status status = XRRSetScreenConfig (dpy, sc, @@ -284,7 +294,7 @@ Handle setScreenResolution(const Arguments& args) { if (status == RRSetConfigFailed) { printf ("Failed to change the screen resolution.\n"); XRRFreeScreenConfigInfo (sc); - return scope.Close (Boolean::New(False)); + return info.GetReturnValue().Set(Boolean::New(isolate, False)); } else { // status == RRSetConfigSuccess if (sizeindex != current_size) { @@ -308,13 +318,13 @@ Handle setScreenResolution(const Arguments& args) { } } XRRFreeScreenConfigInfo (sc); - return scope.Close(Boolean::New(True)); + info.GetReturnValue().Set(Boolean::New(isolate, True)); } -void init(Handle target) { - target->Set(String::NewSymbol("getDisplays"), - FunctionTemplate::New(getDisplays)->GetFunction()); - target->Set(String::NewSymbol("setScreenResolution"), - FunctionTemplate::New(setScreenResolution)->GetFunction()); +NAN_MODULE_INIT(init) { + Nan::Set(target, New("getDisplays").ToLocalChecked(), + GetFunction(New(getDisplays)).ToLocalChecked()); + Nan::Set(target, New("setScreenResolution").ToLocalChecked(), + GetFunction(New(setScreenResolution)).ToLocalChecked()); } NODE_MODULE(nodexrandr, init) From 9730ffd919b7fdeafca21a7874667b7c6f666a7d Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 8 Dec 2015 15:45:52 -0500 Subject: [PATCH 242/319] GPII-1526: Ported PackageKit addon to nan. --- .../packagekit/nodepackagekit/binding.gyp | 1 + .../nodepackagekit/nodepackagekit.cc | 211 ++++++++++-------- 2 files changed, 119 insertions(+), 93 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/binding.gyp b/gpii/node_modules/packagekit/nodepackagekit/binding.gyp index 981609d..1db4405 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/binding.gyp +++ b/gpii/node_modules/packagekit/nodepackagekit/binding.gyp @@ -3,6 +3,7 @@ { "target_name": "nodepackagekit", "sources": ["nodepackagekit.cc"], + "include_dirs": [" -#include +#include #include #include #include #include using namespace v8; +using v8::FunctionTemplate; +using v8::Handle; +using v8::Object; +using v8::String; +using v8::Value; +using Nan::GetFunction; +using Nan::New; +using Nan::Set; +using Nan::ThrowError; /* Set DEBUG to TRUE in order to see the transactions' progress * TODO: Allow switching DEBUG value from Node.js side @@ -30,12 +38,10 @@ static gboolean DEBUG = FALSE; static gchar TAG[] = "[nodePackagekit]"; static std::basic_string -utf8StringFromValue(v8::Handle value) +utf8StringFromValue(Handle value) { - v8::Local string = value->ToString(); - gchar *buffer = g_new(gchar, string->Utf8Length()); - string->WriteUtf8(buffer); - return buffer; + Local string = value.As(); + return (*String::Utf8Value(string)); } static void @@ -60,7 +66,7 @@ progressCallback(PkProgress *progress, PkProgressType type) { } static PkBitfield -handleFiltersArgument (const Arguments& args, const int filterIndex) { +handleFiltersArgument (const Nan::FunctionCallbackInfo& args, const int filterIndex) { std::basic_string filters; if (args.Length() > filterIndex) { @@ -72,21 +78,28 @@ handleFiltersArgument (const Arguments& args, const int filterIndex) { return pk_filter_bitfield_from_string (filters.c_str()); } -static v8::Handle -makePac (PkPackage *package) { - v8::Handle pac = v8::Object::New(); - - pac->Set(String::New("id"), String::New(pk_package_get_id (package))); - pac->Set(String::New("name"), String::New(pk_package_get_name (package))); - pac->Set(String::New("version"), - String::New (pk_package_get_version(package))); - pac->Set(String::New("arch"), - String::New (pk_package_get_arch(package))); - pac->Set(String::New("data"), String::New (pk_package_get_data(package))); +static Handle +makePac (PkPackage *package, Isolate *isolate) { + Handle pac = Nan::New(); + + pac->Set(String::NewFromUtf8 (isolate, "id"), + String::NewFromUtf8 (isolate, pk_package_get_id (package))); + + pac->Set(String::NewFromUtf8 (isolate, "name"), + String::NewFromUtf8 (isolate, pk_package_get_name (package))); + + pac->Set(String::NewFromUtf8 (isolate, "version"), + String::NewFromUtf8 (isolate, pk_package_get_version (package))); + + pac->Set(String::NewFromUtf8 (isolate, "arch"), + String::NewFromUtf8 (isolate, pk_package_get_arch (package))); + + pac->Set(String::NewFromUtf8 (isolate, "data"), + String::NewFromUtf8 (isolate, pk_package_get_data (package))); + return (pac); } - /** * searchPackage: * @@ -97,46 +110,48 @@ makePac (PkPackage *package) { * Special case: the "none" filter = installed or available. * Returns: Array of packages matching the search criteria */ -Handle searchPackage(const Arguments& args) { - HandleScope scope; +NAN_METHOD(searchPackage) { + Isolate *isolate = info.GetIsolate(); PkClient *client = NULL; - PkResults *results = NULL; + PkResults *pkResults = NULL; GPtrArray *array; PkPackageSack *sack = NULL; std::basic_string name; PkBitfield filtersBitField; GError *err = NULL; - v8::Handle pac; - v8::Handle result = v8::Array::New(); + Handle pac; + Handle result; - name = utf8StringFromValue(args[0]); + name = utf8StringFromValue(info[0]); gchar *names[sizeof(name)] = {&name[0]}; - filtersBitField = handleFiltersArgument (args, 1); + filtersBitField = handleFiltersArgument (info, 1); client = pk_client_new(); - results = pk_client_search_names (client, filtersBitField, - names, NULL, - (PkProgressCallback) progressCallback, NULL, &err); - - sack = pk_results_get_package_sack(results); - pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); - array = pk_package_sack_get_array(sack); - + pkResults = pk_client_search_names ( + client, filtersBitField, names, NULL, + (PkProgressCallback) progressCallback, NULL, &err + ); + + sack = pk_results_get_package_sack(pkResults); + pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); + array = pk_package_sack_get_array (sack); + + result = Array::New(isolate, array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - pac = makePac (package); - result->Set (i,pac); + pac = makePac (package, isolate); + result->Set (i, pac); } - if (results != NULL) - g_object_unref (results); + if (pkResults != NULL) + g_object_unref (pkResults); if (sack != NULL) g_object_unref (sack); if (client != NULL) g_object_unref (client); - return scope.Close(result); + info.GetReturnValue().Set(result); } /** @@ -149,45 +164,47 @@ Handle searchPackage(const Arguments& args) { * Special case: the "none" filter = installed or available. * Returns: Array of packages matching the search criteria. */ -Handle searchFiles (const Arguments& args) { - HandleScope scope; +NAN_METHOD(searchFiles) { + Isolate *isolate = info.GetIsolate(); PkClient *client = NULL; - PkResults *results = NULL; + PkResults *pkResults = NULL; GPtrArray *array; PkPackageSack *sack = NULL; std::basic_string pathName; PkBitfield filtersBitField; GError *err = NULL; - v8::Handle pac; - v8::Handle result = v8::Array::New(); + Handle pac; + Handle result; - pathName = utf8StringFromValue(args[0]); + pathName = utf8StringFromValue (info[0]); gchar *pathNames[sizeof(pathName)] = {&pathName[0]}; - filtersBitField = handleFiltersArgument (args, 1); + filtersBitField = handleFiltersArgument (info, 1); client = pk_client_new(); - results = pk_client_search_files (client, filtersBitField, - pathNames, NULL, - (PkProgressCallback) progressCallback, NULL, &err); + pkResults = pk_client_search_files ( + client, filtersBitField, pathNames, NULL, + (PkProgressCallback) progressCallback, NULL, &err + ); - sack = pk_results_get_package_sack(results); - pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); - array = pk_package_sack_get_array(sack); + sack = pk_results_get_package_sack(pkResults); + pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); + array = pk_package_sack_get_array (sack); + result = Array::New (isolate, array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - pac = makePac (package); + pac = makePac (package, isolate); result->Set (i,pac); } - if (results != NULL) - g_object_unref (results); + if (pkResults != NULL) + g_object_unref (pkResults); if (sack != NULL) g_object_unref (sack); if (client != NULL) g_object_unref (client); - return scope.Close(result); + info.GetReturnValue().Set (result); } /** @@ -203,41 +220,44 @@ Handle searchFiles (const Arguments& args) { * assumes the "none" filter. * Returns: Array of packages matching the filters. */ -Handle getPackages(const Arguments& args) { - HandleScope scope; +NAN_METHOD(getPackages) { + Isolate *isolate = info.GetIsolate(); PkClient *client = NULL; - PkResults *results = NULL; + PkResults *pkResults = NULL; GPtrArray *array; PkPackageSack *sack = NULL; PkBitfield filtersBitField; GError *err = NULL; - v8::Handle pac; - v8::Handle result = v8::Array::New(); + Handle pac; + Handle result; - filtersBitField = handleFiltersArgument (args, 0); + filtersBitField = handleFiltersArgument (info, 0); client = pk_client_new(); - results = pk_client_get_packages (client, filtersBitField, - NULL, (PkProgressCallback) progressCallback, - NULL, &err); + pkResults = pk_client_get_packages ( + client, filtersBitField, NULL, (PkProgressCallback) progressCallback, NULL, + &err + ); + + sack = pk_results_get_package_sack (pkResults); + pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); + array = pk_package_sack_get_array (sack); - sack = pk_results_get_package_sack(results); - pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); - array = pk_package_sack_get_array(sack); + result = Array::New(isolate, array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - pac = makePac (package); + pac = makePac (package, isolate); result->Set (i,pac); } - if (results != NULL) - g_object_unref (results); + if (pkResults != NULL) + g_object_unref (pkResults); if (sack != NULL) g_object_unref (sack); if (client != NULL) g_object_unref (client); - return scope.Close(result); + info.GetReturnValue().Set(result); } /** @@ -248,12 +268,12 @@ Handle getPackages(const Arguments& args) { * name: id of the package (str) * Returns: true | false (bool) */ -Handle performAction(const Arguments& args) { - HandleScope scope; +NAN_METHOD(performAction) { + Isolate *isolate = info.GetIsolate(); PkTask *task; GError *err = NULL; - std::basic_string action = utf8StringFromValue(args[0]); - std::basic_string name = utf8StringFromValue(args[1]); + std::basic_string action = utf8StringFromValue(info[0]); + std::basic_string name = utf8StringFromValue(info[1]); gchar **package_ids = NULL; @@ -261,37 +281,42 @@ Handle performAction(const Arguments& args) { package_ids = pk_package_ids_from_id (name.c_str()); if (action == "install") { - pk_task_install_packages_sync(task, package_ids, NULL, + pk_task_install_packages_sync (task, package_ids, NULL, (PkProgressCallback) progressCallback, NULL, &err); } else if (action == "update") { - pk_task_update_packages_sync(task, package_ids, NULL, + pk_task_update_packages_sync (task, package_ids, NULL, (PkProgressCallback) progressCallback, NULL, &err); } else if (action == "remove") { - pk_task_remove_packages_sync(task, package_ids, TRUE, FALSE, NULL, + pk_task_remove_packages_sync (task, package_ids, TRUE, FALSE, NULL, (PkProgressCallback) progressCallback, NULL, &err); } else { - ThrowException(Exception::Error(String::New( + ThrowError(String::NewFromUtf8( + isolate, "You have to provide the action to be performed, either 'install'," - "'update' or 'remove'"))); + "'update' or 'remove'")); } g_strfreev (package_ids); - return scope.Close(True()); + info.GetReturnValue().Set(Boolean::New(isolate, True)); } -void init(Handle target) { - target->Set(String::NewSymbol("searchPackage"), - FunctionTemplate::New(searchPackage)->GetFunction()); - target->Set(String::NewSymbol("searchFiles"), - FunctionTemplate::New(searchFiles)->GetFunction()); - target->Set(String::NewSymbol("getPackages"), - FunctionTemplate::New(getPackages)->GetFunction()); - target->Set(String::NewSymbol("performAction"), - FunctionTemplate::New(performAction)->GetFunction()); +NAN_MODULE_INIT(init) { + Nan::Set (target, New("searchPackage").ToLocalChecked(), + GetFunction (New(searchPackage)).ToLocalChecked()); + + Nan::Set (target, New("searchFiles").ToLocalChecked(), + GetFunction (New(searchFiles)).ToLocalChecked()); + + Nan::Set (target, New("getPackages").ToLocalChecked(), + GetFunction (New(getPackages)).ToLocalChecked()); + + Nan::Set (target, New("performAction").ToLocalChecked(), + GetFunction (New(performAction)).ToLocalChecked()); } + NODE_MODULE(nodepackagekit, init) From 02f28c06738d7de00ad0889147e1c4df1baac066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 9 Dec 2015 02:17:44 +0100 Subject: [PATCH 243/319] GPII-1526: Freeing some g_objects --- .../nodegsettings/nodegsettings.cc | 28 +++++++++++++------ .../nodepackagekit/nodepackagekit.cc | 14 ++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index 6823165..ee2c3f4 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -39,6 +39,7 @@ NAN_METHOD(get_gsetting_keys) { Local schema = info[0].As(); settings = g_settings_new(*String::Utf8Value(schema)); keys = g_settings_list_keys(settings); + for (i = 0; keys[i]; i++) { size++; // Figure out how to do this in 1 loop } @@ -46,6 +47,10 @@ NAN_METHOD(get_gsetting_keys) { for (i = 0; keys[i]; i++) { togo->Set(i,String::NewFromUtf8(isolate, keys[i])); } + + g_free(keys); + g_clear_object(&settings); + info.GetReturnValue().Set(togo); } @@ -59,7 +64,7 @@ NAN_METHOD(get_gsetting) { GVariant* variant; const GVariantType* type; - variant = g_settings_get_value(settings,*String::Utf8Value(key)); + variant = g_settings_get_value(settings, *String::Utf8Value(key)); type = g_variant_get_type(variant); if (g_variant_type_equal(type,G_VARIANT_TYPE_DOUBLE)) { @@ -76,9 +81,12 @@ NAN_METHOD(get_gsetting) { } else { g_print("The type is %s\n", g_variant_type_peek_string(type)); - ThrowError(String::NewFromUtf8(isolate,"Need to implement reading that value type")); + ThrowError(String::NewFromUtf8(isolate, "Need to implement reading that value type")); info.GetReturnValue().Set(Undefined(isolate)); } + + g_clear_object(&settings); + g_variant_unref(variant); } ///* Should take schema, key, and value */ @@ -93,32 +101,36 @@ NAN_METHOD(set_gsetting) { settings = g_settings_new(*String::Utf8Value(schema)); if (info[2]->IsBoolean()) { - status = g_settings_set_boolean(settings,*String::Utf8Value(key),info[2]->BooleanValue()); + status = g_settings_set_boolean(settings, *String::Utf8Value(key), info[2]->BooleanValue()); } else if (info[2]->IsNumber()) { - variant = g_settings_get_value(settings,*String::Utf8Value(key)); + variant = g_settings_get_value(settings, *String::Utf8Value(key)); type = g_variant_get_type(variant); if (g_variant_type_equal(type,G_VARIANT_TYPE_DOUBLE)) { - status = g_settings_set_double(settings,*String::Utf8Value(key),info[2]->ToNumber()->Value()); + status = g_settings_set_double(settings, *String::Utf8Value(key), info[2]->ToNumber()->Value()); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_INT32)) { - status = g_settings_set_int(settings,*String::Utf8Value(key),info[2]->ToInt32()->Value()); + status = g_settings_set_int(settings, *String::Utf8Value(key), info[2]->ToInt32()->Value()); } else { g_print("The type is %s\n", g_variant_type_peek_string(type)); ThrowError(String::NewFromUtf8(isolate, "We haven't implemented this number type yet!")); } + g_variant_unref(variant); } else if (info[2]->IsString()) { Local val = info[2].As(); - variant = g_settings_get_value(settings,*String::Utf8Value(key)); + variant = g_settings_get_value(settings, *String::Utf8Value(key)); type = g_variant_get_type(variant); - status = g_settings_set_string(settings,*String::Utf8Value(key),*String::Utf8Value(val)); + status = g_settings_set_string(settings, *String::Utf8Value(key), *String::Utf8Value(val)); + g_variant_unref(variant); } else { ThrowError(String::NewFromUtf8(isolate, "We haven't implemented this type yet!")); } g_settings_sync(); + g_clear_object(&settings); + info.GetReturnValue().Set(Boolean::New(isolate, status)); } diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 7f00eba..1d53759 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -150,6 +150,10 @@ NAN_METHOD(searchPackage) { g_object_unref (sack); if (client != NULL) g_object_unref (client); + if (array != NULL) + g_ptr_array_unref(array); + if (err != NULL) + g_clear_error(&err); info.GetReturnValue().Set(result); } @@ -203,6 +207,10 @@ NAN_METHOD(searchFiles) { g_object_unref (sack); if (client != NULL) g_object_unref (client); + if (array != NULL) + g_ptr_array_unref(array); + if (err != NULL) + g_clear_error(&err); info.GetReturnValue().Set (result); } @@ -256,6 +264,10 @@ NAN_METHOD(getPackages) { g_object_unref (sack); if (client != NULL) g_object_unref (client); + if (array != NULL) + g_ptr_array_unref(array); + if (err != NULL) + g_clear_error(&err); info.GetReturnValue().Set(result); } @@ -300,6 +312,8 @@ NAN_METHOD(performAction) { } g_strfreev (package_ids); + if (err != NULL) + g_clear_error(&err); info.GetReturnValue().Set(Boolean::New(isolate, True)); } From e751a749e7e596ed82a3fbffdb9f03db048e8b6a Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 9 Dec 2015 09:19:12 -0500 Subject: [PATCH 244/319] GPII-1526: Ported PackageKit addon to nan. Used g_clear_object() instead of the conditional g_object_unref(). Cleaned up white space. --- .../nodepackagekit/nodepackagekit.cc | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 7f00eba..9a57571 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -136,20 +136,16 @@ NAN_METHOD(searchPackage) { sack = pk_results_get_package_sack(pkResults); pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); array = pk_package_sack_get_array (sack); - + result = Array::New(isolate, array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); pac = makePac (package, isolate); result->Set (i, pac); } - - if (pkResults != NULL) - g_object_unref (pkResults); - if (sack != NULL) - g_object_unref (sack); - if (client != NULL) - g_object_unref (client); + g_clear_object (&pkResults); + g_clear_object (&sack); + g_clear_object (&client); info.GetReturnValue().Set(result); } @@ -196,13 +192,9 @@ NAN_METHOD(searchFiles) { pac = makePac (package, isolate); result->Set (i,pac); } - - if (pkResults != NULL) - g_object_unref (pkResults); - if (sack != NULL) - g_object_unref (sack); - if (client != NULL) - g_object_unref (client); + g_clear_object (&pkResults); + g_clear_object (&sack); + g_clear_object (&client); info.GetReturnValue().Set (result); } @@ -249,13 +241,9 @@ NAN_METHOD(getPackages) { pac = makePac (package, isolate); result->Set (i,pac); } - - if (pkResults != NULL) - g_object_unref (pkResults); - if (sack != NULL) - g_object_unref (sack); - if (client != NULL) - g_object_unref (client); + g_clear_object (&pkResults); + g_clear_object (&sack); + g_clear_object (&client); info.GetReturnValue().Set(result); } @@ -298,7 +286,6 @@ NAN_METHOD(performAction) { "You have to provide the action to be performed, either 'install'," "'update' or 'remove'")); } - g_strfreev (package_ids); info.GetReturnValue().Set(Boolean::New(isolate, True)); From d832f0e7673d2926af480b93aa8f917962c103b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 9 Dec 2015 16:54:15 +0100 Subject: [PATCH 245/319] GPII-1526: Updated reference to universal in AcceptanceTests.js --- tests/AcceptanceTests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index 36fa3fa..f2694a0 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -25,7 +25,7 @@ fluid.registerNamespace("gpii.acceptanceTesting.linux"); require("../index.js"); -var baseDir = fluid.module.resolvePath("${universal}/tests/"); -var windowsFiles = fluid.require("${universal}/tests/platform/index-linux.js"); +var baseDir = fluid.module.resolvePath("%universal/tests/"); +var linuxFiles = fluid.require("%universal/tests/platform/index-linux.js"); -gpii.test.runSuitesWithFiltering(windowsFiles, baseDir, ["gpii.test.acceptance.testCaseHolder"]); +gpii.test.runSuitesWithFiltering(linuxFiles, baseDir, ["gpii.test.acceptance.testCaseHolder"]); From b9d6154c2a01e400e142bd6e7e95c25ba9fd9711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 9 Dec 2015 17:25:51 +0100 Subject: [PATCH 246/319] GPII-1526: Replace fluid's makeChangeApplier with makeHolderChangeApplier --- gpii/node_modules/orca/orcaSettingsHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index d254e61..e0806b7 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -84,7 +84,7 @@ var userSettings = require(orcaSettingsFile); var currentSettingsInProfile = userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]]; - var applier = fluid.makeChangeApplier(currentSettingsInProfile, { + var applier = fluid.makeHolderChangeApplier(currentSettingsInProfile, { resolverGetConfig: fluid.model.escapedGetConfig, resolverSetConfig: fluid.model.escapedSetConfig }); From 6edd7f335b4d342e01dad9b18e8032e5e1135949 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Fri, 11 Dec 2015 12:03:03 -0500 Subject: [PATCH 247/319] GPII-1526: Port of PackageKit addon to nan. Modified ut8StringFromValue() to use Nan string functions. Addresses amb26's comment: https://github.com/amb26/linux/pull/2/#discussion_r47282147 --- .../packagekit/nodepackagekit/nodepackagekit.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 969c46e..eb7c239 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -38,10 +38,14 @@ static gboolean DEBUG = FALSE; static gchar TAG[] = "[nodePackagekit]"; static std::basic_string -utf8StringFromValue(Handle value) +utf8StringFromValue (Handle value) { - Local string = value.As(); - return (*String::Utf8Value(string)); + std::basic_string result; + Nan::Utf8String nanUtf8 (value); + if (nanUtf8.length() != 0) { + result.append (*nanUtf8); + } + return (result); } static void @@ -124,7 +128,6 @@ NAN_METHOD(searchPackage) { name = utf8StringFromValue(info[0]); gchar *names[sizeof(name)] = {&name[0]}; - filtersBitField = handleFiltersArgument (info, 1); client = pk_client_new(); From e6c6119119ebd0ca96a22a9108ff202095f576eb Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Fri, 11 Dec 2015 16:40:00 -0500 Subject: [PATCH 248/319] GPII-1526: PackageKit nan port: strings. Modified makePac() to eliminate using Isolate object for string construction. Addresses amb26's comment: https://github.com/amb26/linux/pull/2/#discussion_r47279041 --- .../nodepackagekit/nodepackagekit.cc | 62 ++++++++++++------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index eb7c239..9172b22 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -83,23 +83,41 @@ handleFiltersArgument (const Nan::FunctionCallbackInfo& args, const i } static Handle -makePac (PkPackage *package, Isolate *isolate) { +makePac (PkPackage *package) { Handle pac = Nan::New(); - - pac->Set(String::NewFromUtf8 (isolate, "id"), - String::NewFromUtf8 (isolate, pk_package_get_id (package))); - - pac->Set(String::NewFromUtf8 (isolate, "name"), - String::NewFromUtf8 (isolate, pk_package_get_name (package))); - - pac->Set(String::NewFromUtf8 (isolate, "version"), - String::NewFromUtf8 (isolate, pk_package_get_version (package))); - - pac->Set(String::NewFromUtf8 (isolate, "arch"), - String::NewFromUtf8 (isolate, pk_package_get_arch (package))); - - pac->Set(String::NewFromUtf8 (isolate, "data"), - String::NewFromUtf8 (isolate, pk_package_get_data (package))); + Handle key; + Handle value; + const gchar *pkString; + + pkString = "id"; + key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pkString = pk_package_get_id (package); + value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pac->Set (key, value); + + pkString = "name"; + key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pkString = pk_package_get_name (package); + value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pac->Set (key, value); + + pkString = "version"; + key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pkString = pk_package_get_version (package); + value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pac->Set (key, value); + + pkString = "arch"; + key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pkString = pk_package_get_arch (package); + value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pac->Set (key, value); + + pkString = "data"; + key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pkString = pk_package_get_data (package); + value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pac->Set (key, value); return (pac); } @@ -143,7 +161,7 @@ NAN_METHOD(searchPackage) { result = Array::New(isolate, array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - pac = makePac (package, isolate); + pac = makePac (package); result->Set (i, pac); } @@ -155,7 +173,7 @@ NAN_METHOD(searchPackage) { if (err != NULL) g_clear_error(&err); - info.GetReturnValue().Set(result); + info.GetReturnValue().Set (result); } /** @@ -197,7 +215,7 @@ NAN_METHOD(searchFiles) { result = Array::New (isolate, array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - pac = makePac (package, isolate); + pac = makePac (package); result->Set (i,pac); } g_clear_object (&pkResults); @@ -250,7 +268,7 @@ NAN_METHOD(getPackages) { for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - pac = makePac (package, isolate); + pac = makePac (package); result->Set (i,pac); } g_clear_object (&pkResults); @@ -261,7 +279,7 @@ NAN_METHOD(getPackages) { if (err != NULL) g_clear_error(&err); - info.GetReturnValue().Set(result); + info.GetReturnValue().Set (result); } /** @@ -306,7 +324,7 @@ NAN_METHOD(performAction) { if (err != NULL) g_clear_error(&err); - info.GetReturnValue().Set(Boolean::New(isolate, True)); + info.GetReturnValue().Set (Boolean::New(isolate, True)); } NAN_MODULE_INIT(init) { From d43caeb508de1da580c72a6372cae07de5cf2366 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Fri, 11 Dec 2015 17:01:22 -0500 Subject: [PATCH 249/319] GPII-1526: PackageKit nan port: Isolate Reomved usage of Isolate with respect to allocating a v8 Array and Boolean. --- .../packagekit/nodepackagekit/nodepackagekit.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 9172b22..c84b36d 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -133,7 +133,6 @@ makePac (PkPackage *package) { * Returns: Array of packages matching the search criteria */ NAN_METHOD(searchPackage) { - Isolate *isolate = info.GetIsolate(); PkClient *client = NULL; PkResults *pkResults = NULL; GPtrArray *array; @@ -158,7 +157,7 @@ NAN_METHOD(searchPackage) { pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); array = pk_package_sack_get_array (sack); - result = Array::New(isolate, array->len); + result = Nan::New(array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); pac = makePac (package); @@ -187,7 +186,6 @@ NAN_METHOD(searchPackage) { * Returns: Array of packages matching the search criteria. */ NAN_METHOD(searchFiles) { - Isolate *isolate = info.GetIsolate(); PkClient *client = NULL; PkResults *pkResults = NULL; GPtrArray *array; @@ -212,7 +210,7 @@ NAN_METHOD(searchFiles) { pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); array = pk_package_sack_get_array (sack); - result = Array::New (isolate, array->len); + result = Nan::New(array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); pac = makePac (package); @@ -243,7 +241,6 @@ NAN_METHOD(searchFiles) { * Returns: Array of packages matching the filters. */ NAN_METHOD(getPackages) { - Isolate *isolate = info.GetIsolate(); PkClient *client = NULL; PkResults *pkResults = NULL; GPtrArray *array; @@ -264,7 +261,7 @@ NAN_METHOD(getPackages) { pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); array = pk_package_sack_get_array (sack); - result = Array::New(isolate, array->len); + result = Nan::New(array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); @@ -324,7 +321,7 @@ NAN_METHOD(performAction) { if (err != NULL) g_clear_error(&err); - info.GetReturnValue().Set (Boolean::New(isolate, True)); + info.GetReturnValue().Set (Nan::True()); } NAN_MODULE_INIT(init) { From fbd1b7138c7a7813b05594acce3c67be35fdd888 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Mon, 14 Dec 2015 11:00:13 -0500 Subject: [PATCH 250/319] GPII-1526: PackageKit nan port. Modified makePac() to use a loop to get various properties of an individual package. --- .../nodepackagekit/nodepackagekit.cc | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index c84b36d..40b46d9 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -37,6 +37,11 @@ static gboolean DEBUG = FALSE; static gchar TAG[] = "[nodePackagekit]"; +typedef struct { + const gchar* property; + const gchar* (*accessFunc)(PkPackage *package); +} PkitPropAccess; + static std::basic_string utf8StringFromValue (Handle value) { @@ -89,36 +94,25 @@ makePac (PkPackage *package) { Handle value; const gchar *pkString; - pkString = "id"; - key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pkString = pk_package_get_id (package); - value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pac->Set (key, value); - - pkString = "name"; - key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pkString = pk_package_get_name (package); - value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pac->Set (key, value); - - pkString = "version"; - key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pkString = pk_package_get_version (package); - value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pac->Set (key, value); - - pkString = "arch"; - key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pkString = pk_package_get_arch (package); - value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pac->Set (key, value); - - pkString = "data"; - key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pkString = pk_package_get_data (package); - value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pac->Set (key, value); - + PkitPropAccess propAccess[] = { + { "id", pk_package_get_id }, + { "name", pk_package_get_name }, + { "version", pk_package_get_version }, + { "arch", pk_package_get_arch }, + { "data", pk_package_get_data }, + { NULL, NULL } + }; + + PkitPropAccess aPropAccess = propAccess[0]; + for (int i = 1; aPropAccess.property != NULL; i++) { + pkString = aPropAccess.property; + key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pkString = (aPropAccess.accessFunc) (package); + value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); + pac->Set (key, value); + + aPropAccess = propAccess[i]; + } return (pac); } From f9b7c7a1b40f9cc733b1d29a41d087f28c2c7929 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Mon, 14 Dec 2015 11:59:33 -0500 Subject: [PATCH 251/319] GPII-1526: PackageKit nan port: Remove Isolate. Removed use of Isolate by the ThrowError() within performAction(). Added unit test of this ThrowError() by calling performAction() such that it fails. Addresses amb26's comment: https://github.com/amb26/linux/pull/2/#discussion_r47279041 --- .../nodepackagekit/nodepackagekit.cc | 9 ++++---- .../nodepackagekit/nodepackagekit_test.js | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 40b46d9..99980c7 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -282,7 +282,6 @@ NAN_METHOD(getPackages) { * Returns: true | false (bool) */ NAN_METHOD(performAction) { - Isolate *isolate = info.GetIsolate(); PkTask *task; GError *err = NULL; std::basic_string action = utf8StringFromValue(info[0]); @@ -306,11 +305,11 @@ NAN_METHOD(performAction) { (PkProgressCallback) progressCallback, NULL, &err); } else { - ThrowError(String::NewFromUtf8( - isolate, - "You have to provide the action to be performed, either 'install'," - "'update' or 'remove'")); + ThrowError( + "You have to provide the action to be performed, either 'install', " + "'update' or 'remove'"); } + g_clear_object (&task); g_strfreev (package_ids); if (err != NULL) g_clear_error(&err); diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 46053db..b3f7a69 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -155,6 +155,17 @@ var fluid = require("universal"), return matchPkg; }; + pkTests.testPerformActionFailure = function() { + var errMsg = "No Error Message"; + try { + packagekit.performAction("foo", "bar"); + } + catch(error) { + errMsg = error.message; + } + return errMsg; + }; + jqUnit.module("PackageKit Bridge node add-on module"); jqUnit.test( @@ -228,6 +239,16 @@ var fluid = require("universal"), } }); + jqUnit.test("Test performAction() with invalid argments", function() { + var errorMessage = pkTests.testPerformActionFailure(); + jqUnit.assertEquals( + "Result of ThrowError():", + "You have to provide the action to be performed, either " + + "'install', 'update' or 'remove'", + errorMessage + ); + }); + jqUnit.test("Test updatePackage(): with 'emacspeak'", function () { // The package ids of an old and newer version of 'emacspeak'. From 5e025f718f81132230d127f6d761846d555f4cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 15 Dec 2015 03:04:57 +0100 Subject: [PATCH 252/319] GPII-1526: Removed Isolate Also, updated the code to use Local handles when possible. --- gpii/node_modules/alsa/nodealsa/nodealsa.cc | 5 +- .../nodegsettings/nodegsettings.cc | 43 ++++++------- .../xrandr/nodexrandr/nodexrandr.cc | 63 +++++++++---------- 3 files changed, 55 insertions(+), 56 deletions(-) diff --git a/gpii/node_modules/alsa/nodealsa/nodealsa.cc b/gpii/node_modules/alsa/nodealsa/nodealsa.cc index 70dd915..4bd32a4 100644 --- a/gpii/node_modules/alsa/nodealsa/nodealsa.cc +++ b/gpii/node_modules/alsa/nodealsa/nodealsa.cc @@ -22,7 +22,6 @@ using namespace v8; using v8::FunctionTemplate; -using v8::Handle; using v8::Object; using v8::String; using Nan::GetFunction; @@ -55,7 +54,7 @@ NAN_METHOD(getSystemVolume) { snd_mixer_close(handle); - info.GetReturnValue().Set(Number::New(info.GetIsolate(), curr)); + info.GetReturnValue().Set(New(curr)); } NAN_METHOD(setSystemVolume) { @@ -81,7 +80,7 @@ NAN_METHOD(setSystemVolume) { snd_mixer_close(handle); - info.GetReturnValue().Set(Boolean::New(info.GetIsolate(), "True")); + info.GetReturnValue().Set(Nan::True()); } NAN_MODULE_INIT(init) { diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index ee2c3f4..2810621 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -21,19 +21,18 @@ using namespace v8; using v8::FunctionTemplate; -using v8::Handle; -using v8::Isolate; +using v8::Local; using v8::Object; using v8::String; +using Nan::Encode; using Nan::GetFunction; using Nan::New; using Nan::Set; using Nan::ThrowError; NAN_METHOD(get_gsetting_keys) { - Isolate *isolate = info.GetIsolate(); GSettings *settings; - gchar ** keys; + gchar **keys; gint i; gint size = 0; Local schema = info[0].As(); @@ -43,9 +42,9 @@ NAN_METHOD(get_gsetting_keys) { for (i = 0; keys[i]; i++) { size++; // Figure out how to do this in 1 loop } - Handle togo = Array::New(isolate, size); + Local togo = New(size); for (i = 0; keys[i]; i++) { - togo->Set(i,String::NewFromUtf8(isolate, keys[i])); + togo->Set(i, Nan::Encode(keys[i], strlen(keys[i]), Nan::UTF8)); } g_free(keys); @@ -56,7 +55,6 @@ NAN_METHOD(get_gsetting_keys) { ///* Should take schema and key */ NAN_METHOD(get_gsetting) { - Isolate *isolate = info.GetIsolate(); GSettings *settings; Local schema = info[0].As(); Local key = info[1].As(); @@ -68,21 +66,21 @@ NAN_METHOD(get_gsetting) { type = g_variant_get_type(variant); if (g_variant_type_equal(type,G_VARIANT_TYPE_DOUBLE)) { - info.GetReturnValue().Set(Number::New(isolate, g_variant_get_double(variant))); + info.GetReturnValue().Set(New(g_variant_get_double(variant))); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_INT32)) { - info.GetReturnValue().Set(Int32::New(isolate, g_variant_get_int32(variant))); + info.GetReturnValue().Set(New(g_variant_get_int32(variant))); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_STRING)) { - info.GetReturnValue().Set(String::NewFromUtf8(isolate, g_variant_get_string(variant,NULL))); + info.GetReturnValue().Set(New(g_variant_get_string(variant,NULL)).ToLocalChecked()); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_BOOLEAN)) { - info.GetReturnValue().Set(Boolean::New(isolate, g_variant_get_boolean(variant))); + info.GetReturnValue().Set(New(g_variant_get_boolean(variant))); } else { g_print("The type is %s\n", g_variant_type_peek_string(type)); - ThrowError(String::NewFromUtf8(isolate, "Need to implement reading that value type")); - info.GetReturnValue().Set(Undefined(isolate)); + ThrowError(New("Need to implement reading that value type").ToLocalChecked()); + info.GetReturnValue().Set(Nan::False()); } g_clear_object(&settings); @@ -91,7 +89,6 @@ NAN_METHOD(get_gsetting) { ///* Should take schema, key, and value */ NAN_METHOD(set_gsetting) { - Isolate *isolate = info.GetIsolate(); GSettings *settings; GVariant* variant; const GVariantType* type; @@ -101,20 +98,23 @@ NAN_METHOD(set_gsetting) { settings = g_settings_new(*String::Utf8Value(schema)); if (info[2]->IsBoolean()) { - status = g_settings_set_boolean(settings, *String::Utf8Value(key), info[2]->BooleanValue()); + status = g_settings_set_boolean(settings, *String::Utf8Value(key), + info[2]->BooleanValue()); } else if (info[2]->IsNumber()) { variant = g_settings_get_value(settings, *String::Utf8Value(key)); type = g_variant_get_type(variant); if (g_variant_type_equal(type,G_VARIANT_TYPE_DOUBLE)) { - status = g_settings_set_double(settings, *String::Utf8Value(key), info[2]->ToNumber()->Value()); + status = g_settings_set_double(settings, *String::Utf8Value(key), + info[2]->ToNumber()->Value()); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_INT32)) { - status = g_settings_set_int(settings, *String::Utf8Value(key), info[2]->ToInt32()->Value()); + status = g_settings_set_int(settings, *String::Utf8Value(key), + info[2]->ToInt32()->Value()); } else { g_print("The type is %s\n", g_variant_type_peek_string(type)); - ThrowError(String::NewFromUtf8(isolate, "We haven't implemented this number type yet!")); + ThrowError(New("We haven't implemented this number type yet!").ToLocalChecked()); } g_variant_unref(variant); } @@ -122,16 +122,17 @@ NAN_METHOD(set_gsetting) { Local val = info[2].As(); variant = g_settings_get_value(settings, *String::Utf8Value(key)); type = g_variant_get_type(variant); - status = g_settings_set_string(settings, *String::Utf8Value(key), *String::Utf8Value(val)); + status = g_settings_set_string(settings, *String::Utf8Value(key), + *String::Utf8Value(val)); g_variant_unref(variant); } else { - ThrowError(String::NewFromUtf8(isolate, "We haven't implemented this type yet!")); + ThrowError(New("We haven't implemented this type yet!").ToLocalChecked()); } g_settings_sync(); g_clear_object(&settings); - info.GetReturnValue().Set(Boolean::New(isolate, status)); + info.GetReturnValue().Set(New(status)); } NAN_MODULE_INIT(init) { diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc index 013a4db..0da6912 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -40,10 +40,8 @@ using namespace v8; using v8::FunctionTemplate; -using v8::Handle; -using v8::Isolate; +using v8::Local; using v8::Object; -using v8::String; using Nan::GetFunction; using Nan::New; using Nan::Set; @@ -152,8 +150,7 @@ NAN_METHOD(getDisplays) { XRRScreenResources *res; XRRScreenConfiguration *sc; - Isolate *isolate = info.GetIsolate(); - Handle result = Array::New(isolate); + Local result = New(); char *display_name = NULL; int screen = -1; @@ -183,48 +180,51 @@ NAN_METHOD(getDisplays) { current_size = XRRConfigCurrentConfiguration (sc, ¤t_rotation); sizes = XRRConfigSizes(sc, &nsize); - Handle resolution_object = Object::New(isolate); + Local resolution_object = New(); res = XRRGetScreenResourcesCurrent (dpy, root); for (int i=0; inoutput; i++) { XRROutputInfo *output_info; output_info = XRRGetOutputInfo(dpy, res, res->outputs[i]); - Handle output = Object::New(isolate); + Local output = New(); - output->Set(String::NewFromUtf8(isolate, "name"), - String::NewFromUtf8(isolate, output_info->name)); + output->Set(New("name").ToLocalChecked(), + New(output_info->name).ToLocalChecked()); switch (output_info->connection) { case RR_Connected: - output->Set(String::NewFromUtf8(isolate, "status"), - String::NewFromUtf8(isolate, "connected")); + output->Set(New("status").ToLocalChecked(), + New("connected").ToLocalChecked()); - resolution_object->Set(String::NewFromUtf8(isolate, "width"), - Integer::New(isolate, sizes[current_size].width)); - resolution_object->Set(String::NewFromUtf8(isolate, "height"), - Integer::New(isolate, sizes[current_size].height)); + resolution_object->Set(New("width").ToLocalChecked(), + New(sizes[current_size].width)); + resolution_object->Set(New("height").ToLocalChecked(), + New(sizes[current_size].height)); - resolution_object->Set(String::NewFromUtf8(isolate, "mwidth"), - Integer::New(isolate, sizes[current_size].mwidth)); - resolution_object->Set(String::NewFromUtf8(isolate, "mheight"), - Integer::New(isolate, sizes[current_size].mheight)); + resolution_object->Set(New("mwidth").ToLocalChecked(), + New(sizes[current_size].mwidth)); + resolution_object->Set(New("mheight").ToLocalChecked(), + New(sizes[current_size].mheight)); - output->Set(String::NewFromUtf8(isolate, "resolution"), resolution_object); + output->Set(New("resolution").ToLocalChecked(), resolution_object); break; case RR_Disconnected: - output->Set(String::NewFromUtf8(isolate, "status"), String::NewFromUtf8(isolate, "disconnected")); + output->Set(New("status").ToLocalChecked(), + New("disconnected").ToLocalChecked()); break; } - Handle available_resolutions = Array::New(isolate); + Local available_resolutions = New(); for (int j=0; jnmode; j++) { char *resolution; XRRModeInfo *mode = find_mode_by_xid (output_info->modes[j], res); asprintf(&resolution, "%dx%d", mode->width, mode->height); - available_resolutions->Set(j,String::NewFromUtf8(isolate, resolution)); + available_resolutions->Set(j, Nan::Encode(resolution, + strlen(resolution), + Nan::UTF8)); } - output->Set(String::NewFromUtf8(isolate, "available_resolutions"), - available_resolutions); + output->Set(New("available_resolutions").ToLocalChecked(), + available_resolutions); result->Set(i,output); } @@ -234,7 +234,6 @@ NAN_METHOD(getDisplays) { NAN_METHOD(setScreenResolution) { Display *dpy; - Isolate *isolate = info.GetIsolate(); int width = info[0]->ToInteger()->Value(); int height = info[1]->ToInteger()->Value(); @@ -247,7 +246,7 @@ NAN_METHOD(setScreenResolution) { dpy = XOpenDisplay (displayname); if (dpy == NULL) { printf ("Cannot open display %s\n", displayname); - return info.GetReturnValue().Set(Boolean::New(isolate, False)); + return info.GetReturnValue().Set(New(False)); } int screen = DefaultScreen (dpy); @@ -256,12 +255,12 @@ NAN_METHOD(setScreenResolution) { int errorbase; if (!XRRQueryExtension(dpy, &eventbase, &errorbase)) { printf ("RandR extension missing\n"); - return info.GetReturnValue().Set(Boolean::New(isolate, False)); + return info.GetReturnValue().Set(New(False)); } XRRScreenConfiguration *sc = XRRGetScreenInfo (dpy, root); if (sc == NULL) { printf ("Cannot get screen info\n"); - return info.GetReturnValue().Set(Boolean::New(isolate, False)); + return info.GetReturnValue().Set(New(False)); } XSelectInput (dpy, root, StructureNotifyMask); XRRSelectInput (dpy, root, RRScreenChangeNotifyMask); @@ -283,7 +282,7 @@ NAN_METHOD(setScreenResolution) { if (sizeindex >= nsize) { printf ("%dx%d resolution not available\n", width, height); XRRFreeScreenConfigInfo (sc); - return info.GetReturnValue().Set(Boolean::New(isolate, False)); + return info.GetReturnValue().Set(New(False)); } Status status = XRRSetScreenConfig (dpy, sc, @@ -294,7 +293,7 @@ NAN_METHOD(setScreenResolution) { if (status == RRSetConfigFailed) { printf ("Failed to change the screen resolution.\n"); XRRFreeScreenConfigInfo (sc); - return info.GetReturnValue().Set(Boolean::New(isolate, False)); + return info.GetReturnValue().Set(New(False)); } else { // status == RRSetConfigSuccess if (sizeindex != current_size) { @@ -318,7 +317,7 @@ NAN_METHOD(setScreenResolution) { } } XRRFreeScreenConfigInfo (sc); - info.GetReturnValue().Set(Boolean::New(isolate, True)); + info.GetReturnValue().Set(New(True)); } NAN_MODULE_INIT(init) { From 6dd8caf7366958b362991971c380e14a5c7bccd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 15 Dec 2015 03:12:28 +0100 Subject: [PATCH 253/319] GPII-1526: Use console.log instead of the deprecated util.puts --- .../nodegsettings/nodegsettings_tests.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js index c06a27e..94ab805 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js @@ -16,7 +16,6 @@ "use strict"; -var util = require("util"); var assert = require("assert"); var gsettings = require("./build/Release/nodegsettings.node"); @@ -65,26 +64,26 @@ var testIntegerValues = function () { /* Test Reading Values */ var testReadingDoubleValues = function () { var ret = gsettings.get_gsetting(keyScreenmag, "mag-factor"); - util.puts("The mag-factor is: " + ret); + console.log("The mag-factor is: " + ret); }; var testReadingIntegerValues = function () { var ret = gsettings.get_gsetting(keyScreenmag, "cross-hairs-thickness"); - util.puts("The cross hairs thickness is: " + ret); + console.log("The cross hairs thickness is: " + ret); }; var testReadingStringValues = function () { var ret = gsettings.get_gsetting(keyScreenmag, "screen-position"); - util.puts("The screen-position is: " + ret); + console.log("The screen-position is: " + ret); }; var testStuff = function () { - util.puts("Testing Stuff"); + console.log("Testing Stuff"); var keys = gsettings.get_gsetting_keys(keyScreenmag); for (var i = 0; i < keys.length; i++) { - util.puts("Ok: " + keys[i]); + console.log("Ok: " + keys[i]); } - util.puts("Done Testing Stuff"); + console.log("Done Testing Stuff"); }; testStuff(); From a9ee8266145807d74eed5116ba1c47429362af6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 15 Dec 2015 14:06:58 +0100 Subject: [PATCH 254/319] GPII-1526: Reworked orca's settingsHandler Updating tests to ensure that we're leaving the settings file as it was. Removed the auto-creation of the Orca's config file. --- gpii/node_modules/orca/orcaSettingsHandler.js | 191 +++++++----------- .../orca/test/orcaSettingsHandlerTests.js | 14 ++ 2 files changed, 88 insertions(+), 117 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index e0806b7..59a40ee 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -1,8 +1,8 @@ /* * GPII Orca Settings Handler * - * Copyright 2013 Emergya - * Author Javier Hernández + * Copyright 2013-2015 Emergya + * Copyright 2015 RtF-US * * Licensed under the New BSD license. You may not use this file except in * compliance with this License. @@ -20,21 +20,9 @@ var fluid = require("universal"); var gpii = fluid.registerNamespace("gpii"); - var spawn = require("child_process").spawn; var fs = require("fs"); var path = require("path"); - // Workaround to load orca's user-settings.conf file according to - // comments on https://github.com/joyent/node/issues/6073 - // - require.extensions[".conf"] = require.extensions[".json"]; - - var ORCA_ARGS = ["--disable", "speech", - "--disable", "braille", - "--disable", "braille-monitor", - "--disable", "main-window", - "--disable", "splash-window"]; - var HOME = process.env.HOME; var XDG_DATA_HOME = process.env.XDG_DATA_HOME || path.resolve(HOME, ".local/share"); var orcaSettingsFile = path.resolve(XDG_DATA_HOME, "orca/user-settings.conf"); @@ -53,129 +41,98 @@ fluid.registerNamespace("gpii.launch"); fluid.registerNamespace("gpii.orca"); - // TODO: Remove this method and all the blocking stuff. - // (see https://github.com/GPII/linux/pull/16) - // - // This setting handler has to be converted to an asynchronous as soon as - // the lifecycle manager can handle asynchronous actions. - // - // The reason for this blocking code is because we need a mechanism to know - // when the Orca's settings file has been created. - // - // The blocking "while loop" is where this method is used and is a big - // stability risk to the system, since it blocks the node event loop - // possibly indefinitely. - // - // Once we can make this setting handler to be asynchronous, we can use - // fs.watch or any other similar asynchronous approaches to know - // when the orca settings file is being created. - // - function wait(millis) { - var date = new Date(); - var curDate; - - do { curDate = new Date(); } - while (curDate - date < millis); - } - - function applySettings(app) { - var settings = app.settings; - - var userSettings = require(orcaSettingsFile); - var currentSettingsInProfile = userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]]; - - var applier = fluid.makeHolderChangeApplier(currentSettingsInProfile, { + fluid.defaults("gpii.orca.settingsHandler", { + gradeNames: ["fluid.modelComponent"], + changeApplierOptions: { resolverGetConfig: fluid.model.escapedGetConfig, resolverSetConfig: fluid.model.escapedSetConfig - }); - - var newSettingsResponse = {}; - fluid.each(settings, function (settingVal, settingKey) { - var oldValue = fluid.get(currentSettingsInProfile, settingKey, - fluid.model.escapedGetConfig); + }, + model: { + settings: {} + }, + invokers: { + get: { + funcName: "gpii.orca.settingsHandler.get", + args: ["{that}", "{arguments}.0"] + }, + set: { + funcName: "gpii.orca.settingsHandler.set", + args: ["{that}", "{arguments}.0"] + }, + getImpl: { + funcName: "gpii.orca.settingsHandler.getImpl", + args: ["{that}", "{arguments}.0"] + }, + setImpl: { + funcName: "gpii.orca.settingsHandler.setImpl", + args: ["{that}", "{arguments}.0"] + } + }, + listeners: { + onCreate: { + funcName: "gpii.orca.settingsHandler.onCreate", + args: ["{that}"] + } + } + }); - var change = { - path: settingKey, - value: settingVal - }; - change.type = settingVal === undefined ? "DELETE" : "ADD"; - applier.fireChangeRequest(change); + gpii.orca.settingsHandler.onCreate = function (that) { + var userSettings = fs.readFileSync(orcaSettingsFile); + that.applier.change("settings", JSON.parse(userSettings)); + }; - newSettingsResponse[settingKey] = { - "oldValue": oldValue, - "newValue": settingVal - }; + gpii.orca.settingsHandler.getImpl = function (that, payload) { + var profile = that.model.settings.general.activeProfile[PROFILE_ID]; - fluid.set(currentSettingsInProfile, settingKey, settings[settingKey], - fluid.model.escapedSetConfig); + var results = fluid.transform(payload.settings, function (value, key) { + var currentValue = fluid.get(that.model.settings, ["profiles", profile, key]); + return currentValue; }); - userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]] = currentSettingsInProfile; + return results; + }; - fs.writeFileSync(orcaSettingsFile, - JSON.stringify(userSettings, null, 4)); + gpii.orca.settingsHandler.setImpl = function (that, payload) { + var profile = that.model.settings.general.activeProfile[PROFILE_ID]; - return newSettingsResponse; - } + var results = fluid.transform(payload.settings, function (value, key) { + var oldValue = fluid.get(that.model.settings, ["profiles", profile, key]); + var type; - gpii.orca.getImpl = function (payload) { - var app = fluid.copy(payload); + if (oldValue === undefined) { + type = "ADD"; + } else if (value === undefined) { + type = "DELETE"; + } else { + type = null; + } - var settings = app.settings; + that.applier.change(["settings", "profiles", profile, key], value, type); - var newSettingsResponse = {}; - var userSettings = require(orcaSettingsFile); - var currentSettingsInProfile = userSettings.profiles[userSettings.general.activeProfile[PROFILE_ID]]; + var newValue = fluid.get(that.model.settings, ["profiles", profile, key]); - newSettingsResponse = fluid.transform(settings, function (settingVal, settingKey) { - var value = fluid.get(currentSettingsInProfile, settingKey, - fluid.model.escapedGetConfig); - return value; + return { + oldValue: oldValue, + newValue: newValue + }; }); - return newSettingsResponse; + return results; }; - gpii.orca.setImpl = function (profile) { - var returnObj = fluid.copy(profile); - - var exists = fs.existsSync(orcaSettingsFile); - if (!exists) { - var orcaSpawn = spawn("orca", ORCA_ARGS); - var pass = 0; - var maxPass = 10; - var err; - - while (!fs.existsSync(orcaSettingsFile)) { - if (pass === maxPass) { - err = "Time limit exceeded [" + maxPass * 500 + - "ms] for creating Orca's configuration file"; - break; - } - wait(500); - pass++; - } - - orcaSpawn.kill("SIGKILL"); - if (err) { - fluid.fail(err); - fluid.log(err); - return; - } - } - - var returnValue = applySettings(profile); - returnObj = returnValue; - - return returnValue; + gpii.orca.settingsHandler.get = function (that, payload) { + return gpii.settingsHandlers.invokeSettingsHandler(that.getImpl, payload); }; - gpii.orca.get = function (payload) { - return gpii.settingsHandlers.invokeSettingsHandler(gpii.orca.getImpl, payload); + gpii.orca.settingsHandler.set = function (that, payload) { + var results = gpii.settingsHandlers.invokeSettingsHandler(that.setImpl, payload); + fs.writeFileSync(orcaSettingsFile, JSON.stringify(that.model.settings, null, 4)); + return results; }; - gpii.orca.set = function (payload) { - return gpii.settingsHandlers.invokeSettingsHandler(gpii.orca.setImpl, payload); - }; + var orcaSettingsHandler = gpii.orca.settingsHandler(); + + gpii.orca.get = orcaSettingsHandler.get; + gpii.orca.set = orcaSettingsHandler.set; })(); diff --git a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js index 68d9b4e..16ba93c 100644 --- a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -2,6 +2,7 @@ * Orca Settings Handler Tests * * Copyright 2013, 2014 Emergya + * Copyright 2015 RtF-US * * Licensed under the New BSD license. You may not use this file except in * compliance with this License. @@ -17,6 +18,8 @@ "use strict"; var fluid = require("universal"), + fs = require("fs"), + path = require("path"), jqUnit = fluid.require("node-jqunit"); require("orca"); @@ -110,6 +113,17 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { var currentSettingsPayload2 = gpii.resolveSync(orca.get(getPayload2)); jqUnit.assertDeepEq("Non-existent settings are being restored well", currentSettingsPayload2, defaultSettingsPayload2); + // Check that 'foo' and 'cat' are removed properly from Orca's config file + var HOME = process.env.HOME; + var XDG_DATA_HOME = process.env.XDG_DATA_HOME || path.resolve(HOME, ".local/share"); + var orcaSettingsFile = path.resolve(XDG_DATA_HOME, "orca/user-settings.conf"); + + var content = JSON.parse(fs.readFileSync(orcaSettingsFile)); + var profile = content.general.activeProfile[1]; + var settings = content.profiles[profile]; + jqUnit.assertFalse("No 'foo' setting in Orca's config file", settings.hasOwnProperty("foo")); + jqUnit.assertFalse("No 'cat' setting in Orca's config file", settings.hasOwnProperty("cat")); + // Complete get/set flow with multiple solution entries. // var getPayload3 = { From 7165ad43998c808c0c2d6570819ede64d3e96c3e Mon Sep 17 00:00:00 2001 From: Avtar Gill Date: Wed, 23 Dec 2015 13:49:14 -0500 Subject: [PATCH 255/319] GPII-1258: Clarifies docs related to running tests --- README.md | 2 +- provisioning/vars.yml | 4 ++++ tests/UnitTests.sh | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8842d3f..2add2ee 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ By default the VM will use two processor cores and 2GB of RAM. Two environment v Once the box has been downloaded the provisioning process will ensure that project dependencies have been met and then the ``npm install`` and ``grunt --force build`` commands will be executed. If you reboot the VM the provisioner will not run again. However, you can use ``vagrant provision`` to trigger that process at any time. -To run tests you can use the ``grunt tests`` target which will run unit and acceptance tests in the VM and report the results in your terminal. Or you could use ``grunt unit-tests`` and/or ``grunt acceptance-tests`` separately. +To run tests you can use the ``grunt tests`` command on your host which will run unit and acceptance tests in the VM. Or you could use ``grunt unit-tests`` and/or ``grunt acceptance-tests`` separately. You can stop the VM using ``vagrant halt`` or delete it altogether using ``vagrant destroy``. diff --git a/provisioning/vars.yml b/provisioning/vars.yml index afd2bbe..9f35671 100644 --- a/provisioning/vars.yml +++ b/provisioning/vars.yml @@ -4,6 +4,10 @@ nodejs_app_name: gpii-linux-framework +nodejs_app_git_repo: https://github.com/gpii/linux.git + +nodejs_app_git_branch: master + # Node.js version required by application (supported versions: 0.10.36*, 0.10.40, 4.1.1) nodejs_version: 0.10.40 diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh index 89c3342..4209d89 100755 --- a/tests/UnitTests.sh +++ b/tests/UnitTests.sh @@ -13,8 +13,6 @@ # You may obtain a copy of the License at # https://github.com/gpii/universal/LICENSE.txt -set -e - pushd . cd ../gpii/node_modules/alsa/test node alsaSettingsHandlerTests.js From c2aa7c021dd247c03331cbec30e2eb40e1cb7902 Mon Sep 17 00:00:00 2001 From: Avtar Gill Date: Wed, 23 Dec 2015 13:49:35 -0500 Subject: [PATCH 256/319] GPII-1258: Removes nonessential comments --- Vagrantfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index e4ed5e2..9795f85 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -70,13 +70,4 @@ Vagrant.configure(2) do |config| inline: "/usr/local/bin/edit-hosts.sh", run: "always" - # http://serverfault.com/a/725051 - #config.vm.provision "shell", - # inline: "sudo systemctl restart #{app_name}.service", - # run: "always" - - #config.vm.provision "shell", - # inline: "sudo systemctl restart systemd-journal-gatewayd.service", - # run: "always" - end From a6f633c58e54b27c7f9ad4edb0e42e69d65ec36b Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Thu, 11 Feb 2016 13:29:12 -0200 Subject: [PATCH 257/319] GPII-1564 - Update version of Node.js due to security issues --- provisioning/vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/vars.yml b/provisioning/vars.yml index 9f35671..61b5abc 100644 --- a/provisioning/vars.yml +++ b/provisioning/vars.yml @@ -9,7 +9,7 @@ nodejs_app_git_repo: https://github.com/gpii/linux.git nodejs_app_git_branch: master # Node.js version required by application (supported versions: 0.10.36*, 0.10.40, 4.1.1) -nodejs_version: 0.10.40 +nodejs_version: 0.10.42 # If a specific npm version is needed, specify it here #nodejs_npm_version: 1.4.28 From 4225991f805a4016866ae384059aa264beb23444 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Thu, 14 Apr 2016 13:30:22 -0400 Subject: [PATCH 258/319] GPII-1526: PackageKit nan port: response to Antranig's review. - Removed all 'using' statements. - Removed all spaces after function names. - Removed parentheses from 'return' statements. See: https://github.com/amb26/linux/pull/2/#discussion_r47279041 --- .../nodepackagekit/nodepackagekit.cc | 159 ++++++++---------- 1 file changed, 74 insertions(+), 85 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 99980c7..b4f24f0 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -19,17 +19,6 @@ You may obtain a copy of the License at #include #include -using namespace v8; -using v8::FunctionTemplate; -using v8::Handle; -using v8::Object; -using v8::String; -using v8::Value; -using Nan::GetFunction; -using Nan::New; -using Nan::Set; -using Nan::ThrowError; - /* Set DEBUG to TRUE in order to see the transactions' progress * TODO: Allow switching DEBUG value from Node.js side */ @@ -43,14 +32,14 @@ typedef struct { } PkitPropAccess; static std::basic_string -utf8StringFromValue (Handle value) +utf8StringFromValue(v8::Handle value) { std::basic_string result; - Nan::Utf8String nanUtf8 (value); + Nan::Utf8String nanUtf8(value); if (nanUtf8.length() != 0) { - result.append (*nanUtf8); + result.append(*nanUtf8); } - return (result); + return result; } static void @@ -67,15 +56,15 @@ progressCallback(PkProgress *progress, PkProgressType type) { NULL); if (type == PK_PROGRESS_TYPE_STATUS) { - printf ("%s Transaction status: %s\n", TAG, pk_status_enum_to_string (status)); + printf("%s Transaction status: %s\n", TAG, pk_status_enum_to_string(status)); } else if (type == PK_PROGRESS_TYPE_PERCENTAGE) { if (percentage > 0) - printf ("%s Current percentage: %d%%\n", TAG, percentage); + printf("%s Current percentage: %d%%\n", TAG, percentage); } } static PkBitfield -handleFiltersArgument (const Nan::FunctionCallbackInfo& args, const int filterIndex) { +handleFiltersArgument(const Nan::FunctionCallbackInfo& args, const int filterIndex) { std::basic_string filters; if (args.Length() > filterIndex) { @@ -84,14 +73,14 @@ handleFiltersArgument (const Nan::FunctionCallbackInfo& args, const i else { filters = (gchar *) "none"; } - return pk_filter_bitfield_from_string (filters.c_str()); + return pk_filter_bitfield_from_string(filters.c_str()); } -static Handle -makePac (PkPackage *package) { - Handle pac = Nan::New(); - Handle key; - Handle value; +static v8::Handle +makePac(PkPackage *package) { + v8::Handle pac = Nan::New(); + v8::Handle key; + v8::Handle value; const gchar *pkString; PkitPropAccess propAccess[] = { @@ -106,14 +95,14 @@ makePac (PkPackage *package) { PkitPropAccess aPropAccess = propAccess[0]; for (int i = 1; aPropAccess.property != NULL; i++) { pkString = aPropAccess.property; - key = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pkString = (aPropAccess.accessFunc) (package); - value = Nan::Encode (pkString, strlen (pkString), Nan::UTF8); - pac->Set (key, value); + key = Nan::Encode(pkString, strlen(pkString), Nan::UTF8); + pkString = (aPropAccess.accessFunc)(package); + value = Nan::Encode(pkString, strlen(pkString), Nan::UTF8); + pac->Set(key, value); aPropAccess = propAccess[i]; } - return (pac); + return pac; } /** @@ -134,39 +123,39 @@ NAN_METHOD(searchPackage) { std::basic_string name; PkBitfield filtersBitField; GError *err = NULL; - Handle pac; - Handle result; + v8::Handle pac; + v8::Handle result; name = utf8StringFromValue(info[0]); gchar *names[sizeof(name)] = {&name[0]}; - filtersBitField = handleFiltersArgument (info, 1); + filtersBitField = handleFiltersArgument(info, 1); client = pk_client_new(); - pkResults = pk_client_search_names ( + pkResults = pk_client_search_names( client, filtersBitField, names, NULL, (PkProgressCallback) progressCallback, NULL, &err ); sack = pk_results_get_package_sack(pkResults); - pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); - array = pk_package_sack_get_array (sack); + pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); + array = pk_package_sack_get_array(sack); - result = Nan::New(array->len); + result = Nan::New(array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - pac = makePac (package); - result->Set (i, pac); + pac = makePac(package); + result->Set(i, pac); } - g_clear_object (&pkResults); - g_clear_object (&sack); - g_clear_object (&client); + g_clear_object(&pkResults); + g_clear_object(&sack); + g_clear_object(&client); if (array != NULL) g_ptr_array_unref(array); if (err != NULL) g_clear_error(&err); - info.GetReturnValue().Set (result); + info.GetReturnValue().Set(result); } /** @@ -187,38 +176,38 @@ NAN_METHOD(searchFiles) { std::basic_string pathName; PkBitfield filtersBitField; GError *err = NULL; - Handle pac; - Handle result; + v8::Handle pac; + v8::Handle result; - pathName = utf8StringFromValue (info[0]); + pathName = utf8StringFromValue(info[0]); gchar *pathNames[sizeof(pathName)] = {&pathName[0]}; - filtersBitField = handleFiltersArgument (info, 1); + filtersBitField = handleFiltersArgument(info, 1); client = pk_client_new(); - pkResults = pk_client_search_files ( + pkResults = pk_client_search_files( client, filtersBitField, pathNames, NULL, (PkProgressCallback) progressCallback, NULL, &err ); sack = pk_results_get_package_sack(pkResults); - pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); - array = pk_package_sack_get_array (sack); + pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); + array = pk_package_sack_get_array(sack); - result = Nan::New(array->len); + result = Nan::New(array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - pac = makePac (package); - result->Set (i,pac); + pac = makePac(package); + result->Set(i,pac); } - g_clear_object (&pkResults); - g_clear_object (&sack); - g_clear_object (&client); + g_clear_object(&pkResults); + g_clear_object(&sack); + g_clear_object(&client); if (array != NULL) g_ptr_array_unref(array); if (err != NULL) g_clear_error(&err); - info.GetReturnValue().Set (result); + info.GetReturnValue().Set(result); } /** @@ -241,36 +230,36 @@ NAN_METHOD(getPackages) { PkPackageSack *sack = NULL; PkBitfield filtersBitField; GError *err = NULL; - Handle pac; - Handle result; + v8::Handle pac; + v8::Handle result; - filtersBitField = handleFiltersArgument (info, 0); + filtersBitField = handleFiltersArgument(info, 0); client = pk_client_new(); - pkResults = pk_client_get_packages ( + pkResults = pk_client_get_packages( client, filtersBitField, NULL, (PkProgressCallback) progressCallback, NULL, &err ); - sack = pk_results_get_package_sack (pkResults); - pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); - array = pk_package_sack_get_array (sack); + sack = pk_results_get_package_sack(pkResults); + pk_package_sack_sort(sack, PK_PACKAGE_SACK_SORT_TYPE_NAME); + array = pk_package_sack_get_array(sack); - result = Nan::New(array->len); + result = Nan::New(array->len); for (unsigned int i=0; ilen; i++) { PkPackage *package = (PkPackage *) g_ptr_array_index(array, i); - pac = makePac (package); - result->Set (i,pac); + pac = makePac(package); + result->Set(i,pac); } - g_clear_object (&pkResults); - g_clear_object (&sack); - g_clear_object (&client); + g_clear_object(&pkResults); + g_clear_object(&sack); + g_clear_object(&client); if (array != NULL) g_ptr_array_unref(array); if (err != NULL) g_clear_error(&err); - info.GetReturnValue().Set (result); + info.GetReturnValue().Set(result); } /** @@ -290,45 +279,45 @@ NAN_METHOD(performAction) { gchar **package_ids = NULL; task = pk_task_new(); - package_ids = pk_package_ids_from_id (name.c_str()); + package_ids = pk_package_ids_from_id(name.c_str()); if (action == "install") { - pk_task_install_packages_sync (task, package_ids, NULL, + pk_task_install_packages_sync(task, package_ids, NULL, (PkProgressCallback) progressCallback, NULL, &err); } else if (action == "update") { - pk_task_update_packages_sync (task, package_ids, NULL, + pk_task_update_packages_sync(task, package_ids, NULL, (PkProgressCallback) progressCallback, NULL, &err); } else if (action == "remove") { - pk_task_remove_packages_sync (task, package_ids, TRUE, FALSE, NULL, + pk_task_remove_packages_sync(task, package_ids, TRUE, FALSE, NULL, (PkProgressCallback) progressCallback, NULL, &err); } else { - ThrowError( + Nan::ThrowError( "You have to provide the action to be performed, either 'install', " "'update' or 'remove'"); } - g_clear_object (&task); + g_clear_object(&task); g_strfreev (package_ids); if (err != NULL) g_clear_error(&err); - info.GetReturnValue().Set (Nan::True()); + info.GetReturnValue().Set(Nan::True()); } NAN_MODULE_INIT(init) { - Nan::Set (target, New("searchPackage").ToLocalChecked(), - GetFunction (New(searchPackage)).ToLocalChecked()); + Nan::Set(target, Nan::New("searchPackage").ToLocalChecked(), + Nan::GetFunction(Nan::New(searchPackage)).ToLocalChecked()); - Nan::Set (target, New("searchFiles").ToLocalChecked(), - GetFunction (New(searchFiles)).ToLocalChecked()); + Nan::Set(target, Nan::New("searchFiles").ToLocalChecked(), + Nan::GetFunction(Nan::New(searchFiles)).ToLocalChecked()); - Nan::Set (target, New("getPackages").ToLocalChecked(), - GetFunction (New(getPackages)).ToLocalChecked()); + Nan::Set(target, Nan::New("getPackages").ToLocalChecked(), + Nan::GetFunction(Nan::New(getPackages)).ToLocalChecked()); - Nan::Set (target, New("performAction").ToLocalChecked(), - GetFunction (New(performAction)).ToLocalChecked()); + Nan::Set(target, Nan::New("performAction").ToLocalChecked(), + Nan::GetFunction(Nan::New(performAction)).ToLocalChecked()); } NODE_MODULE(nodepackagekit, init) From 1b3844f9292b59e052e057a085dcf3b0aa3bf407 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Thu, 14 Apr 2016 16:05:24 -0400 Subject: [PATCH 259/319] GPII-1526: XRandr nan port: addressing Antranig's review. - Removed all 'using' statements. - Removed all spaces after function names. See: https://github.com/amb26/linux/pull/2/#discussion_r47279041 --- .../xrandr/nodexrandr/nodexrandr.cc | 162 ++++++++---------- 1 file changed, 76 insertions(+), 86 deletions(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc index 0da6912..4802c80 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -38,16 +38,6 @@ #include "config.h" #endif -using namespace v8; -using v8::FunctionTemplate; -using v8::Local; -using v8::Object; -using Nan::GetFunction; -using Nan::New; -using Nan::Set; - -using namespace std; - typedef enum _name_kind { name_none = 0, name_string = (1 << 0), @@ -60,24 +50,24 @@ typedef struct { name_kind_t kind; char *string; XID xid; - int index; + int index; } name_t; static void -init_name (name_t *name) +init_name(name_t *name) { name->kind = name_none; } static void -set_name_xid (name_t *name, XID xid) +set_name_xid(name_t *name, XID xid) { name->kind |= name_xid; name->xid = xid; } static double -mode_refresh (XRRModeInfo *mode_info) +mode_refresh(XRRModeInfo *mode_info) { double rate; unsigned int vTotal = mode_info->vTotal; @@ -102,7 +92,7 @@ mode_refresh (XRRModeInfo *mode_info) } static XRRModeInfo * -find_mode (name_t *name, double refresh, XRRScreenResources *res) +find_mode(name_t *name, double refresh, XRRScreenResources *res) { int m; XRRModeInfo *best = NULL; @@ -116,12 +106,12 @@ find_mode (name_t *name, double refresh, XRRScreenResources *res) best = mode; break; } - if ((name->kind & name_string) && !strcmp (name->string, mode->name)) + if ((name->kind & name_string) && !strcmp(name->string, mode->name)) { double dist; if (refresh) - dist = fabs (mode_refresh (mode) - refresh); + dist = fabs(mode_refresh(mode) - refresh); else dist = 0; if (!best || dist < bestDist) @@ -135,13 +125,13 @@ find_mode (name_t *name, double refresh, XRRScreenResources *res) } static XRRModeInfo * -find_mode_by_xid (RRMode mode, XRRScreenResources *res) +find_mode_by_xid(RRMode mode, XRRScreenResources *res) { name_t mode_name; - init_name (&mode_name); - set_name_xid (&mode_name, mode); - return find_mode (&mode_name, 0, res); + init_name(&mode_name); + set_name_xid(&mode_name, mode); + return find_mode(&mode_name, 0, res); } NAN_METHOD(getDisplays) { @@ -150,80 +140,80 @@ NAN_METHOD(getDisplays) { XRRScreenResources *res; XRRScreenConfiguration *sc; - Local result = New(); + v8::Local result = Nan::New(); char *display_name = NULL; int screen = -1; - dpy = XOpenDisplay (display_name); + dpy = XOpenDisplay(display_name); if (dpy == NULL) { - fprintf (stderr, "Can't open display %s\n", XDisplayName(display_name)); - exit (1); + fprintf(stderr, "Can't open display %s\n", XDisplayName(display_name)); + exit(1); } if (screen < 0) - screen = DefaultScreen (dpy); - if (screen >= ScreenCount (dpy)) { - fprintf (stderr, "Invalid screen number %d (display has %d)\n", - screen, ScreenCount (dpy)); - exit (1); + screen = DefaultScreen(dpy); + if (screen >= ScreenCount(dpy)) { + fprintf(stderr, "Invalid screen number %d (display has %d)\n", + screen, ScreenCount(dpy)); + exit(1); } - root = RootWindow (dpy, screen); + root = RootWindow(dpy, screen); // get current resolution // - sc = XRRGetScreenInfo (dpy, root); + sc = XRRGetScreenInfo(dpy, root); Rotation current_rotation; SizeID current_size; XRRScreenSize *sizes; int nsize; - current_size = XRRConfigCurrentConfiguration (sc, ¤t_rotation); + current_size = XRRConfigCurrentConfiguration(sc, ¤t_rotation); sizes = XRRConfigSizes(sc, &nsize); - Local resolution_object = New(); + v8::Local resolution_object = Nan::New(); - res = XRRGetScreenResourcesCurrent (dpy, root); + res = XRRGetScreenResourcesCurrent(dpy, root); for (int i=0; inoutput; i++) { XRROutputInfo *output_info; output_info = XRRGetOutputInfo(dpy, res, res->outputs[i]); - Local output = New(); + v8::Local output = Nan::New(); - output->Set(New("name").ToLocalChecked(), - New(output_info->name).ToLocalChecked()); + output->Set(Nan::New("name").ToLocalChecked(), + Nan::New(output_info->name).ToLocalChecked()); switch (output_info->connection) { case RR_Connected: - output->Set(New("status").ToLocalChecked(), - New("connected").ToLocalChecked()); + output->Set(Nan::New("status").ToLocalChecked(), + Nan::New("connected").ToLocalChecked()); - resolution_object->Set(New("width").ToLocalChecked(), - New(sizes[current_size].width)); - resolution_object->Set(New("height").ToLocalChecked(), - New(sizes[current_size].height)); + resolution_object->Set(Nan::New("width").ToLocalChecked(), + Nan::New(sizes[current_size].width)); + resolution_object->Set(Nan::New("height").ToLocalChecked(), + Nan::New(sizes[current_size].height)); - resolution_object->Set(New("mwidth").ToLocalChecked(), - New(sizes[current_size].mwidth)); - resolution_object->Set(New("mheight").ToLocalChecked(), - New(sizes[current_size].mheight)); + resolution_object->Set(Nan::New("mwidth").ToLocalChecked(), + Nan::New(sizes[current_size].mwidth)); + resolution_object->Set(Nan::New("mheight").ToLocalChecked(), + Nan::New(sizes[current_size].mheight)); - output->Set(New("resolution").ToLocalChecked(), resolution_object); + output->Set(Nan::New("resolution").ToLocalChecked(), resolution_object); break; case RR_Disconnected: - output->Set(New("status").ToLocalChecked(), - New("disconnected").ToLocalChecked()); + output->Set(Nan::New("status").ToLocalChecked(), + Nan::New("disconnected").ToLocalChecked()); break; } - Local available_resolutions = New(); + v8::Local available_resolutions = Nan::New(); for (int j=0; jnmode; j++) { char *resolution; - XRRModeInfo *mode = find_mode_by_xid (output_info->modes[j], res); + XRRModeInfo *mode = find_mode_by_xid(output_info->modes[j], res); asprintf(&resolution, "%dx%d", mode->width, mode->height); available_resolutions->Set(j, Nan::Encode(resolution, strlen(resolution), Nan::UTF8)); } - output->Set(New("available_resolutions").ToLocalChecked(), + output->Set(Nan::New("available_resolutions").ToLocalChecked(), available_resolutions); result->Set(i,output); @@ -243,31 +233,31 @@ NAN_METHOD(setScreenResolution) { char *displayname = NULL; - dpy = XOpenDisplay (displayname); + dpy = XOpenDisplay(displayname); if (dpy == NULL) { - printf ("Cannot open display %s\n", displayname); - return info.GetReturnValue().Set(New(False)); + printf("Cannot open display %s\n", displayname); + return info.GetReturnValue().Set(Nan::New(False)); } - int screen = DefaultScreen (dpy); - Window root = RootWindow (dpy, screen); + int screen = DefaultScreen(dpy); + Window root = RootWindow(dpy, screen); int eventbase; int errorbase; if (!XRRQueryExtension(dpy, &eventbase, &errorbase)) { - printf ("RandR extension missing\n"); - return info.GetReturnValue().Set(New(False)); + printf("RandR extension missing\n"); + return info.GetReturnValue().Set(Nan::New(False)); } - XRRScreenConfiguration *sc = XRRGetScreenInfo (dpy, root); + XRRScreenConfiguration *sc = XRRGetScreenInfo(dpy, root); if (sc == NULL) { - printf ("Cannot get screen info\n"); - return info.GetReturnValue().Set(New(False)); + printf("Cannot get screen info\n"); + return info.GetReturnValue().Set(Nan::New(False)); } - XSelectInput (dpy, root, StructureNotifyMask); - XRRSelectInput (dpy, root, RRScreenChangeNotifyMask); + XSelectInput(dpy, root, StructureNotifyMask); + XRRSelectInput(dpy, root, RRScreenChangeNotifyMask); Rotation current_rotation; SizeID current_size; - current_size = XRRConfigCurrentConfiguration (sc, ¤t_rotation); + current_size = XRRConfigCurrentConfiguration(sc, ¤t_rotation); int nsize; XRRScreenSize *sizes = XRRConfigSizes(sc, &nsize); @@ -280,20 +270,20 @@ NAN_METHOD(setScreenResolution) { } if (sizeindex >= nsize) { - printf ("%dx%d resolution not available\n", width, height); - XRRFreeScreenConfigInfo (sc); - return info.GetReturnValue().Set(New(False)); + printf("%dx%d resolution not available\n", width, height); + XRRFreeScreenConfigInfo(sc); + return info.GetReturnValue().Set(Nan::New(False)); } - Status status = XRRSetScreenConfig (dpy, sc, - DefaultRootWindow (dpy), - sizeindex, - (Rotation) (rotation | reflection), - CurrentTime); + Status status = XRRSetScreenConfig(dpy, sc, + DefaultRootWindow(dpy), + sizeindex, + (Rotation) (rotation | reflection), + CurrentTime); if (status == RRSetConfigFailed) { - printf ("Failed to change the screen resolution.\n"); - XRRFreeScreenConfigInfo (sc); - return info.GetReturnValue().Set(New(False)); + printf("Failed to change the screen resolution.\n"); + XRRFreeScreenConfigInfo(sc); + return info.GetReturnValue().Set(Nan::New(False)); } else { // status == RRSetConfigSuccess if (sizeindex != current_size) { @@ -301,8 +291,8 @@ NAN_METHOD(setScreenResolution) { bool rcvdrrnotify = false; while (!rcvdrrnotify) { XNextEvent(dpy, (XEvent *) &event); - //printf ("Event received, type = %d\n", event.type); - XRRUpdateConfiguration (&event) ; + //printf("Event received, type = %d\n", event.type); + XRRUpdateConfiguration(&event) ; switch (event.type - eventbase) { case RRScreenChangeNotify: rcvdrrnotify = true; @@ -316,14 +306,14 @@ NAN_METHOD(setScreenResolution) { } } } - XRRFreeScreenConfigInfo (sc); - info.GetReturnValue().Set(New(True)); + XRRFreeScreenConfigInfo(sc); + info.GetReturnValue().Set(Nan::New(True)); } NAN_MODULE_INIT(init) { - Nan::Set(target, New("getDisplays").ToLocalChecked(), - GetFunction(New(getDisplays)).ToLocalChecked()); - Nan::Set(target, New("setScreenResolution").ToLocalChecked(), - GetFunction(New(setScreenResolution)).ToLocalChecked()); + Nan::Set(target, Nan::New("getDisplays").ToLocalChecked(), + Nan::GetFunction(Nan::New(getDisplays)).ToLocalChecked()); + Nan::Set(target, Nan::New("setScreenResolution").ToLocalChecked(), + Nan::GetFunction(Nan::New(setScreenResolution)).ToLocalChecked()); } NODE_MODULE(nodexrandr, init) From ba1520ed9e5f16ccde624e936001515710e7e922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 15 Apr 2016 17:39:32 +0200 Subject: [PATCH 260/319] GPII-1526: Removed "using" statements --- .../nodegsettings/nodegsettings.cc | 76 ++++++++----------- 1 file changed, 32 insertions(+), 44 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index 2810621..61b29c9 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -19,30 +19,19 @@ #include #include -using namespace v8; -using v8::FunctionTemplate; -using v8::Local; -using v8::Object; -using v8::String; -using Nan::Encode; -using Nan::GetFunction; -using Nan::New; -using Nan::Set; -using Nan::ThrowError; - NAN_METHOD(get_gsetting_keys) { GSettings *settings; gchar **keys; gint i; gint size = 0; - Local schema = info[0].As(); - settings = g_settings_new(*String::Utf8Value(schema)); + v8::Local schema = info[0].As(); + settings = g_settings_new(*v8::String::Utf8Value(schema)); keys = g_settings_list_keys(settings); for (i = 0; keys[i]; i++) { size++; // Figure out how to do this in 1 loop } - Local togo = New(size); + v8::Local togo = Nan::New(size); for (i = 0; keys[i]; i++) { togo->Set(i, Nan::Encode(keys[i], strlen(keys[i]), Nan::UTF8)); } @@ -56,31 +45,30 @@ NAN_METHOD(get_gsetting_keys) { ///* Should take schema and key */ NAN_METHOD(get_gsetting) { GSettings *settings; - Local schema = info[0].As(); - Local key = info[1].As(); - settings = g_settings_new(*String::Utf8Value(schema)); + v8::Local schema = info[0].As(); + v8::Local key = info[1].As(); + settings = g_settings_new(*v8::String::Utf8Value(schema)); GVariant* variant; const GVariantType* type; - variant = g_settings_get_value(settings, *String::Utf8Value(key)); + variant = g_settings_get_value(settings, *v8::String::Utf8Value(key)); type = g_variant_get_type(variant); if (g_variant_type_equal(type,G_VARIANT_TYPE_DOUBLE)) { - info.GetReturnValue().Set(New(g_variant_get_double(variant))); + info.GetReturnValue().Set(Nan::New(g_variant_get_double(variant))); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_INT32)) { - info.GetReturnValue().Set(New(g_variant_get_int32(variant))); + info.GetReturnValue().Set(Nan::New(g_variant_get_int32(variant))); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_STRING)) { - info.GetReturnValue().Set(New(g_variant_get_string(variant,NULL)).ToLocalChecked()); + info.GetReturnValue().Set(Nan::New(g_variant_get_string(variant,NULL)).ToLocalChecked()); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_BOOLEAN)) { - info.GetReturnValue().Set(New(g_variant_get_boolean(variant))); + info.GetReturnValue().Set(Nan::New(g_variant_get_boolean(variant))); } else { g_print("The type is %s\n", g_variant_type_peek_string(type)); - ThrowError(New("Need to implement reading that value type").ToLocalChecked()); - info.GetReturnValue().Set(Nan::False()); + Nan::ThrowError(Nan::New("Need to implement reading that value type").ToLocalChecked()); } g_clear_object(&settings); @@ -92,56 +80,56 @@ NAN_METHOD(set_gsetting) { GSettings *settings; GVariant* variant; const GVariantType* type; - Local schema = info[0].As(); - Local key = info[1].As(); + v8::Local schema = info[0].As(); + v8::Local key = info[1].As(); bool status = false; - settings = g_settings_new(*String::Utf8Value(schema)); + settings = g_settings_new(*v8::String::Utf8Value(schema)); if (info[2]->IsBoolean()) { - status = g_settings_set_boolean(settings, *String::Utf8Value(key), + status = g_settings_set_boolean(settings, *v8::String::Utf8Value(key), info[2]->BooleanValue()); } else if (info[2]->IsNumber()) { - variant = g_settings_get_value(settings, *String::Utf8Value(key)); + variant = g_settings_get_value(settings, *v8::String::Utf8Value(key)); type = g_variant_get_type(variant); if (g_variant_type_equal(type,G_VARIANT_TYPE_DOUBLE)) { - status = g_settings_set_double(settings, *String::Utf8Value(key), + status = g_settings_set_double(settings, *v8::String::Utf8Value(key), info[2]->ToNumber()->Value()); } else if (g_variant_type_equal(type,G_VARIANT_TYPE_INT32)) { - status = g_settings_set_int(settings, *String::Utf8Value(key), + status = g_settings_set_int(settings, *v8::String::Utf8Value(key), info[2]->ToInt32()->Value()); } else { g_print("The type is %s\n", g_variant_type_peek_string(type)); - ThrowError(New("We haven't implemented this number type yet!").ToLocalChecked()); + Nan::ThrowError(Nan::New("We haven't implemented this number type yet!").ToLocalChecked()); } g_variant_unref(variant); } else if (info[2]->IsString()) { - Local val = info[2].As(); - variant = g_settings_get_value(settings, *String::Utf8Value(key)); + v8::Local val = info[2].As(); + variant = g_settings_get_value(settings, *v8::String::Utf8Value(key)); type = g_variant_get_type(variant); - status = g_settings_set_string(settings, *String::Utf8Value(key), - *String::Utf8Value(val)); + status = g_settings_set_string(settings, *v8::String::Utf8Value(key), + *v8::String::Utf8Value(val)); g_variant_unref(variant); } else { - ThrowError(New("We haven't implemented this type yet!").ToLocalChecked()); + Nan::ThrowError(Nan::New("We haven't implemented this type yet!").ToLocalChecked()); } g_settings_sync(); g_clear_object(&settings); - info.GetReturnValue().Set(New(status)); + info.GetReturnValue().Set(Nan::New(status)); } NAN_MODULE_INIT(init) { - Nan::Set(target, New("set_gsetting").ToLocalChecked(), - GetFunction(New(set_gsetting)).ToLocalChecked()); - Nan::Set(target, New("get_gsetting").ToLocalChecked(), - GetFunction(New(get_gsetting)).ToLocalChecked()); - Nan::Set(target, New("get_gsetting_keys").ToLocalChecked(), - GetFunction(New(get_gsetting_keys)).ToLocalChecked()); + Nan::Set(target, Nan::New("set_gsetting").ToLocalChecked(), + Nan::GetFunction(Nan::New(set_gsetting)).ToLocalChecked()); + Nan::Set(target, Nan::New("get_gsetting").ToLocalChecked(), + Nan::GetFunction(Nan::New(get_gsetting)).ToLocalChecked()); + Nan::Set(target, Nan::New("get_gsetting_keys").ToLocalChecked(), + Nan::GetFunction(Nan::New(get_gsetting_keys)).ToLocalChecked()); } NODE_MODULE(nodegsettings, init) From 8f7f480e03dc154a9fa230029d02f176c480a59e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 15 Apr 2016 18:20:07 +0200 Subject: [PATCH 261/319] GPII-1526: Deprecated g_settings_list_keys Using g_settings_schema_list_keys as suggested in the documentation. See: * https://bugzilla.gnome.org/show_bug.cgi?id=740308 * https://developer.gnome.org/gio/2.46/GSettings.html#g-settings-list-keys --- .../gsettingsBridge/nodegsettings/nodegsettings.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index 61b29c9..22914d1 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -21,12 +21,15 @@ NAN_METHOD(get_gsetting_keys) { GSettings *settings; + GSettingsSchema *gschema; gchar **keys; gint i; gint size = 0; v8::Local schema = info[0].As(); settings = g_settings_new(*v8::String::Utf8Value(schema)); - keys = g_settings_list_keys(settings); + + g_object_get(settings, "settings-schema", &gschema, NULL); + keys = g_settings_schema_list_keys(gschema); for (i = 0; keys[i]; i++) { size++; // Figure out how to do this in 1 loop @@ -37,7 +40,8 @@ NAN_METHOD(get_gsetting_keys) { } g_free(keys); - g_clear_object(&settings); + g_settings_schema_unref(gschema); + g_object_unref(settings); info.GetReturnValue().Set(togo); } From e21ea2371f8db7849011f28c6ec263bedee34846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 18 Apr 2016 19:10:34 +0200 Subject: [PATCH 262/319] GPII-1526: Added some asserts to nodegsettings_tests.js --- .../nodegsettings/nodegsettings_tests.js | 62 ++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js index 94ab805..c5b1ccf 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js @@ -25,9 +25,16 @@ var keyScreenmag = "org.gnome.desktop.a11y.magnifier"; /* Test getting and setting boolean values */ var testBooleanValues = function () { + var original = gsettings.get_gsetting(keyScreenmag, "show-cross-hairs"); + assert.deepEqual(typeof(original), "boolean", "We got a boolean as expected"); + var ret = gsettings.set_gsetting(keyScreenmag, "show-cross-hairs", true); assert.ok(ret); - ret = gsettings.set_gsetting(keyScreenmag, "show-cross-hairs", false); + + var actual = gsettings.get_gsetting(keyScreenmag, "show-cross-hairs"); + assert.deepStrictEqual(actual, true, "We can set boolean values"); + + ret = gsettings.set_gsetting(keyScreenmag, "show-cross-hairs", original); assert.ok(ret); // Todo need to set up an event for these assertions, they run too fast, @@ -45,54 +52,53 @@ var testBooleanValues = function () { }; var testDecimalValues = function () { + var original = gsettings.get_gsetting(keyScreenmag, "mag-factor"); var ret = gsettings.set_gsetting(keyScreenmag, "mag-factor", 3.0); assert.ok(ret); + + var actual = gsettings.get_gsetting(keyScreenmag, "mag-factor"); + assert.deepStrictEqual(actual, 3.0, "We can set decimal values"); + var ret2 = gsettings.set_gsetting(keyScreenmag, "mag-factor", 5.3); assert.ok(ret2); + actual = gsettings.get_gsetting(keyScreenmag, "mag-factor"); + assert.deepStrictEqual(actual, 5.3, "We can set decimal values"); + + var ret3 = gsettings.set_gsetting(keyScreenmag, "mag-factor", original); + assert.ok(ret3); }; -var testStringToEnumValues = function () { +var testStringValues = function () { + var original = gsettings.get_gsetting(keyScreenmag, "screen-position"); var ret = gsettings.set_gsetting(keyScreenmag, "screen-position", "left-half"); assert.ok(ret); + var actual = gsettings.get_gsetting(keyScreenmag, "screen-position"); + assert.deepStrictEqual(actual, "left-half", "We can set string values"); + var ret2 = gsettings.set_gsetting(keyScreenmag, "screen-position", original); + assert.ok(ret2); }; var testIntegerValues = function () { + var original = gsettings.get_gsetting(keyScreenmag, "cross-hairs-thickness"); var ret = gsettings.set_gsetting(keyScreenmag, "cross-hairs-thickness", 7); assert.ok(ret); + var actual = gsettings.get_gsetting(keyScreenmag, "cross-hairs-thickness"); + assert.deepStrictEqual(actual, 7, "We can set integer values"); + var ret2 = gsettings.set_gsetting(keyScreenmag, "cross-hairs-thickness", original); + assert.ok(ret2); }; -/* Test Reading Values */ -var testReadingDoubleValues = function () { - var ret = gsettings.get_gsetting(keyScreenmag, "mag-factor"); - console.log("The mag-factor is: " + ret); -}; - -var testReadingIntegerValues = function () { - var ret = gsettings.get_gsetting(keyScreenmag, "cross-hairs-thickness"); - console.log("The cross hairs thickness is: " + ret); -}; - -var testReadingStringValues = function () { - var ret = gsettings.get_gsetting(keyScreenmag, "screen-position"); - console.log("The screen-position is: " + ret); -}; - -var testStuff = function () { - console.log("Testing Stuff"); +var testListKeys = function () { var keys = gsettings.get_gsetting_keys(keyScreenmag); + assert.ok(Array.isArray(keys)); for (var i = 0; i < keys.length; i++) { - console.log("Ok: " + keys[i]); + assert.ok("string", typeof(keys[i])); } - console.log("Done Testing Stuff"); }; -testStuff(); - /* Run test functions */ testBooleanValues(); testDecimalValues(); -testStringToEnumValues(); +testStringValues(); testIntegerValues(); -testReadingDoubleValues(); -testReadingIntegerValues(); -testReadingStringValues(); +testListKeys(); From cd5adc0112698045ffeedbc900eae3c75d50fde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 18 Apr 2016 19:41:36 +0200 Subject: [PATCH 263/319] GPII-1526: Addressing some more comments from Antranig --- gpii/node_modules/orca/orcaSettingsHandler.js | 11 +---------- .../orca/test/orcaSettingsHandlerTests.js | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 59a40ee..0f952e4 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -97,16 +97,7 @@ var results = fluid.transform(payload.settings, function (value, key) { var oldValue = fluid.get(that.model.settings, ["profiles", profile, key]); - var type; - - if (oldValue === undefined) { - type = "ADD"; - } else if (value === undefined) { - type = "DELETE"; - } else { - type = null; - } - + var type = value === undefined ? "DELETE" : "ADD"; that.applier.change(["settings", "profiles", profile, key], value, type); var newValue = fluid.get(that.model.settings, ["profiles", profile, key]); diff --git a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js index 16ba93c..6862287 100644 --- a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -120,7 +120,7 @@ jqUnit.test("Running tests for Orca Settings Handler", function () { var content = JSON.parse(fs.readFileSync(orcaSettingsFile)); var profile = content.general.activeProfile[1]; - var settings = content.profiles[profile]; + settings = content.profiles[profile]; jqUnit.assertFalse("No 'foo' setting in Orca's config file", settings.hasOwnProperty("foo")); jqUnit.assertFalse("No 'cat' setting in Orca's config file", settings.hasOwnProperty("cat")); From 8836ae2e0349660ac920abc3b8ba8227b100324f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 19 Apr 2016 02:49:07 +0200 Subject: [PATCH 264/319] GPII-1526: Added a promise-based approach to make Orca configurable By configurable we understand that the Orca settings file exists and that we have read/write access to it. --- gpii/node_modules/orca/orcaSettingsHandler.js | 57 ++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 0f952e4..3996cb1 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -21,12 +21,19 @@ var fluid = require("universal"); var gpii = fluid.registerNamespace("gpii"); var fs = require("fs"); + var spawn = require("child_process").spawn; var path = require("path"); var HOME = process.env.HOME; var XDG_DATA_HOME = process.env.XDG_DATA_HOME || path.resolve(HOME, ".local/share"); var orcaSettingsFile = path.resolve(XDG_DATA_HOME, "orca/user-settings.conf"); + var ORCA_ARGS = ["--disable", "speech", + "--disable", "braille", + "--disable", "braille-monitor", + "--disable", "main-window", + "--disable", "splash-window"]; + // When Orca is referencing a profile in a setting, it uses an array // containing the profile's name and id. // ie: startingProfile: ["Default", "default"] @@ -38,6 +45,14 @@ // var PROFILE_ID = 1; + function wait(millis) { + var date = new Date(); + var curDate; + + do { curDate = new Date(); } + while (curDate - date < millis); + } + fluid.registerNamespace("gpii.launch"); fluid.registerNamespace("gpii.orca"); @@ -76,9 +91,47 @@ } }); + gpii.orca.settingsHandler.makeConfigurable = function () { + var orcaSpawn = spawn("orca", ORCA_ARGS); + var pass = 0; + var maxPass = 10; + var err; + + while (!fs.existsSync(orcaSettingsFile)) { + if (pass === maxPass) { + err = "Time limit exceeded [" + maxPass * 500 + + "ms] for creating Orca's configuration file"; + break; + } + wait(500); + pass++; + } + + orcaSpawn.kill("SIGKILL"); + return err; + }; + gpii.orca.settingsHandler.onCreate = function (that) { - var userSettings = fs.readFileSync(orcaSettingsFile); - that.applier.change("settings", JSON.parse(userSettings)); + var togo = fluid.promise(); + var exists = fs.existsSync(orcaSettingsFile); + var initModel = function () { + var userSettings = fs.readFileSync(orcaSettingsFile); + that.applier.change("settings", JSON.parse(userSettings)); + }; + + if (exists) { + togo = initModel(); + } else { + var err = gpii.orca.settingsHandler.makeConfigurable(); + if (err) { + togo.reject(err); + fluid.fail(err); + } else { + initModel(); + togo.resolve(); + } + } + return togo; }; gpii.orca.settingsHandler.getImpl = function (that, payload) { From a92fd4a0bab5d769ccf4bd81b309a687957851ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 19 Apr 2016 03:10:22 +0200 Subject: [PATCH 265/319] GPII-1526: Removing "using" statements from ALSA's add-on --- gpii/node_modules/alsa/nodealsa/nodealsa.cc | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/gpii/node_modules/alsa/nodealsa/nodealsa.cc b/gpii/node_modules/alsa/nodealsa/nodealsa.cc index 4bd32a4..d885eae 100644 --- a/gpii/node_modules/alsa/nodealsa/nodealsa.cc +++ b/gpii/node_modules/alsa/nodealsa/nodealsa.cc @@ -20,16 +20,6 @@ #include #include -using namespace v8; -using v8::FunctionTemplate; -using v8::Object; -using v8::String; -using Nan::GetFunction; -using Nan::New; -using Nan::Set; -using Nan::ThrowError; - - NAN_METHOD(getSystemVolume) { snd_mixer_t *handle; snd_mixer_selem_id_t *sid; @@ -54,7 +44,7 @@ NAN_METHOD(getSystemVolume) { snd_mixer_close(handle); - info.GetReturnValue().Set(New(curr)); + info.GetReturnValue().Set(Nan::New(curr)); } NAN_METHOD(setSystemVolume) { @@ -84,10 +74,10 @@ NAN_METHOD(setSystemVolume) { } NAN_MODULE_INIT(init) { - Nan::Set(target, New("setSystemVolume").ToLocalChecked(), - GetFunction(New(setSystemVolume)).ToLocalChecked()); - Nan::Set(target, New("getSystemVolume").ToLocalChecked(), - GetFunction(New(getSystemVolume)).ToLocalChecked()); + Nan::Set(target, Nan::New("setSystemVolume").ToLocalChecked(), + Nan::GetFunction(Nan::New(setSystemVolume)).ToLocalChecked()); + Nan::Set(target, Nan::New("getSystemVolume").ToLocalChecked(), + Nan::GetFunction(Nan::New(getSystemVolume)).ToLocalChecked()); } NODE_MODULE(nodealsa, init) From fd0592239d2f77a3eefda7547e3f5e244bdfd466 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 19 Apr 2016 13:56:18 -0400 Subject: [PATCH 266/319] GPII-1526: PackageKit nan port: added comment re: NanUtf8 strings. Adding comment about avoiding NULL. https://github.com/amb26/linux/pull/2#discussion_r60114798 --- .../packagekit/nodepackagekit/nodepackagekit.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index b4f24f0..17c3b89 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -36,6 +36,12 @@ utf8StringFromValue(v8::Handle value) { std::basic_string result; Nan::Utf8String nanUtf8(value); + + // According to the Nan documentation, if the conversion to Nan::Utf8String + // fails, then the '*' operator gives a NULL result and not the empty + // string. However, its length() method returns zero. To avoid NULL, check + // the length, and if zero, skip. + // https://github.com/nodejs/nan/blob/master/doc/v8_misc.md#nanutf8string if (nanUtf8.length() != 0) { result.append(*nanUtf8); } From c60a90faa64773f50322195dfec1f972ffa1b091 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 20 Apr 2016 11:28:44 -0400 Subject: [PATCH 267/319] GPII-1526: XRandr nan port: throws errors instead of exit(). Modified getDisplays() to throw an error if the code fails to get the display or its screen. Also, minor code corrections. https://github.com/amb26/linux/pull/2#issuecomment-210550789 --- .../xrandr/nodexrandr/nodexrandr.cc | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc index 4802c80..58cec7f 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -136,26 +136,27 @@ find_mode_by_xid(RRMode mode, XRRScreenResources *res) NAN_METHOD(getDisplays) { Display *dpy; - Window root; + char *display_name; + int screen; + char screenNumber[8]; + Window root; XRRScreenResources *res; XRRScreenConfiguration *sc; - + std::basic_string errMsg; v8::Local result = Nan::New(); - char *display_name = NULL; - int screen = -1; - + // Get default display name. + display_name = XDisplayName(NULL); dpy = XOpenDisplay(display_name); if (dpy == NULL) { - fprintf(stderr, "Can't open display %s\n", XDisplayName(display_name)); - exit(1); + errMsg.append("Can't open display ").append(display_name); + Nan::ThrowError(errMsg.c_str()); } - if (screen < 0) - screen = DefaultScreen(dpy); + screen = DefaultScreen(dpy); if (screen >= ScreenCount(dpy)) { - fprintf(stderr, "Invalid screen number %d (display has %d)\n", - screen, ScreenCount(dpy)); - exit(1); + sprintf(screenNumber, "%d", screen); + errMsg.append("Invalid screen number (display has ").append(screenNumber).append(")"); + Nan::ThrowError(errMsg.c_str()); } root = RootWindow(dpy, screen); From 072c1745a3b7f28b78f3307326dc6b6cc53d27f8 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Mon, 25 Apr 2016 12:17:59 -0400 Subject: [PATCH 268/319] GPII-1526: PackageKit nan port: freed data structures. Modified performAction(): For unsupported actions, free and NULL-ify allocated data structures prior to throwing an error. https://github.com/amb26/linux/pull/2#discussion_r60930273 --- .../packagekit/nodepackagekit/nodepackagekit.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 17c3b89..7d4e6fb 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -300,12 +300,16 @@ NAN_METHOD(performAction) { (PkProgressCallback) progressCallback, NULL, &err); } else { + g_clear_object(&task); + task = NULL; + g_strfreev(package_ids); + package_ids = NULL; Nan::ThrowError( "You have to provide the action to be performed, either 'install', " "'update' or 'remove'"); } g_clear_object(&task); - g_strfreev (package_ids); + g_strfreev(package_ids); if (err != NULL) g_clear_error(&err); From 138c49da6b4f1e6d8af39c50a9070f3790c382a9 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 27 Apr 2016 11:43:01 -0400 Subject: [PATCH 269/319] GPII-1526: Xrandr add-on nan port: improved unit test. The test of setting the screen resolution to impossible dimensions was erroneously using the physical size of the display as the impossible resolution. Changed to simply use a resolution of (-1 ,-1). https://github.com/amb26/linux/pull/2 --- gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index 63612f7..cacc60d 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -55,9 +55,7 @@ jqUnit.test("Running tests for Xrandr Bridge", function () { // var display = xrandr.getDisplays()[0]; jqUnit.assertFalse("Checking 'setScreenResolution' with impossible size", - xrandr.setScreenResolution( - display.resolution.mwidth - 1, - display.resolution.mheight - 1)); + xrandr.setScreenResolution(-1, -1)); // Convert the current resolution to a string, and see if there is a // different available resolution to test setScreenResolution(). From a52700cceba3c624ed4bc0f8ed2349e339b6e841 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 27 Apr 2016 16:16:04 -0400 Subject: [PATCH 270/319] GPII-1526: Xrandr add-on nan port: fixed memory leak. --- gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc index 58cec7f..069ed37 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -206,13 +206,15 @@ NAN_METHOD(getDisplays) { } v8::Local available_resolutions = Nan::New(); + char *resolution; for (int j=0; jnmode; j++) { - char *resolution; XRRModeInfo *mode = find_mode_by_xid(output_info->modes[j], res); asprintf(&resolution, "%dx%d", mode->width, mode->height); available_resolutions->Set(j, Nan::Encode(resolution, strlen(resolution), Nan::UTF8)); + free(resolution); + resolution = NULL; } output->Set(Nan::New("available_resolutions").ToLocalChecked(), available_resolutions); From a58f21789e6a785849cc0e6baa3ec1a9e10f8546 Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 2 May 2016 16:13:18 -0400 Subject: [PATCH 271/319] GPII-1526: Fixed lint errors in nodepackagekit unit tests. --- .../packagekit/nodepackagekit/nodepackagekit_test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index b3f7a69..5903c4e 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -155,12 +155,12 @@ var fluid = require("universal"), return matchPkg; }; - pkTests.testPerformActionFailure = function() { + pkTests.testPerformActionFailure = function () { var errMsg = "No Error Message"; try { packagekit.performAction("foo", "bar"); } - catch(error) { + catch (error) { errMsg = error.message; } return errMsg; @@ -239,7 +239,7 @@ var fluid = require("universal"), } }); - jqUnit.test("Test performAction() with invalid argments", function() { + jqUnit.test("Test performAction() with invalid argments", function () { var errorMessage = pkTests.testPerformActionFailure(); jqUnit.assertEquals( "Result of ThrowError():", From 79732b5609a20a2df1111892d863148e7b97515f Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 4 May 2016 10:31:55 -0400 Subject: [PATCH 272/319] GPII-1774: Display progress for PackageKit node add-on. Set DEBUG flag to true so that progress is printed always. Also, tweaked progressCallback() to tidy up its output, and to flush stdout to ensure that the percentages are printed immediately. --- .../packagekit/nodepackagekit/nodepackagekit.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc index 7d4e6fb..a4dd66e 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit.cc @@ -22,7 +22,7 @@ You may obtain a copy of the License at /* Set DEBUG to TRUE in order to see the transactions' progress * TODO: Allow switching DEBUG value from Node.js side */ -static gboolean DEBUG = FALSE; +static gboolean DEBUG = TRUE; static gchar TAG[] = "[nodePackagekit]"; @@ -55,6 +55,8 @@ progressCallback(PkProgress *progress, PkProgressType type) { gint percentage; gboolean allow_cancel; + static gboolean extranewline = FALSE; + g_object_get(progress, "status", &status, "percentage", &percentage, @@ -62,10 +64,17 @@ progressCallback(PkProgress *progress, PkProgressType type) { NULL); if (type == PK_PROGRESS_TYPE_STATUS) { + if (extranewline == TRUE) { + printf("\n"); + extranewline = FALSE; + } printf("%s Transaction status: %s\n", TAG, pk_status_enum_to_string(status)); } else if (type == PK_PROGRESS_TYPE_PERCENTAGE) { - if (percentage > 0) - printf("%s Current percentage: %d%%\n", TAG, percentage); + if (percentage > 0) { + printf(" %d%% ", percentage); + fflush(stdout); + extranewline = TRUE; + } } } From b249205a1640eaac39a3c68808e9edfba8c4309a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 6 May 2016 02:01:11 +0200 Subject: [PATCH 273/319] GPII-1526: Orca's get/set methods now return promises --- gpii/node_modules/orca/orcaSettingsHandler.js | 101 +++++++++++------- 1 file changed, 62 insertions(+), 39 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 3996cb1..05f49e7 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -2,7 +2,7 @@ * GPII Orca Settings Handler * * Copyright 2013-2015 Emergya - * Copyright 2015 RtF-US + * Copyright 2015-2016 RtF-US * * Licensed under the New BSD license. You may not use this file except in * compliance with this License. @@ -81,16 +81,20 @@ setImpl: { funcName: "gpii.orca.settingsHandler.setImpl", args: ["{that}", "{arguments}.0"] - } - }, - listeners: { - onCreate: { - funcName: "gpii.orca.settingsHandler.onCreate", - args: ["{that}"] + }, + readSettingsFile: { + funcName: "gpii.orca.settingsHandler.readSettingsFile", + args: "{that}" } } }); + gpii.orca.settingsHandler.readSettingsFile = function (that) { + var userSettings = fs.readFileSync(orcaSettingsFile); + that.applier.change("settings", {}); + that.applier.change("settings", JSON.parse(userSettings)); + }; + gpii.orca.settingsHandler.makeConfigurable = function () { var orcaSpawn = spawn("orca", ORCA_ARGS); var pass = 0; @@ -111,57 +115,78 @@ return err; }; - gpii.orca.settingsHandler.onCreate = function (that) { - var togo = fluid.promise(); + gpii.orca.settingsHandler.getImpl = function (that, payload) { + var togo; var exists = fs.existsSync(orcaSettingsFile); - var initModel = function () { - var userSettings = fs.readFileSync(orcaSettingsFile); - that.applier.change("settings", JSON.parse(userSettings)); + + var getSettings = function () { + that.readSettingsFile(); + var profile = that.model.settings.general.activeProfile[PROFILE_ID]; + var results = fluid.transform(payload.settings, function (value, key) { + var currentValue = fluid.get(that.model.settings, ["profiles", profile, key]); + return currentValue; + }); + + return results; }; if (exists) { - togo = initModel(); + togo = getSettings(); } else { + togo = fluid.promise(); var err = gpii.orca.settingsHandler.makeConfigurable(); if (err) { togo.reject(err); fluid.fail(err); } else { - initModel(); - togo.resolve(); + var results = getSettings(); + togo.resolve(results); } } + return togo; }; - gpii.orca.settingsHandler.getImpl = function (that, payload) { - var profile = that.model.settings.general.activeProfile[PROFILE_ID]; + gpii.orca.settingsHandler.setImpl = function (that, payload) { + var togo; + var exists = fs.existsSync(orcaSettingsFile); - var results = fluid.transform(payload.settings, function (value, key) { - var currentValue = fluid.get(that.model.settings, ["profiles", profile, key]); - return currentValue; - }); + var setSettings = function () { + that.readSettingsFile(); + var profile = that.model.settings.general.activeProfile[PROFILE_ID]; - return results; - }; + var results = fluid.transform(payload.settings, function (value, key) { + var oldValue = fluid.get(that.model.settings, ["profiles", profile, key]); + var type = value === undefined ? "DELETE" : "ADD"; + that.applier.change(["settings", "profiles", profile, key], value, type); - gpii.orca.settingsHandler.setImpl = function (that, payload) { - var profile = that.model.settings.general.activeProfile[PROFILE_ID]; + var newValue = fluid.get(that.model.settings, ["profiles", profile, key]); - var results = fluid.transform(payload.settings, function (value, key) { - var oldValue = fluid.get(that.model.settings, ["profiles", profile, key]); - var type = value === undefined ? "DELETE" : "ADD"; - that.applier.change(["settings", "profiles", profile, key], value, type); + return { + oldValue: oldValue, + newValue: newValue + }; + }); - var newValue = fluid.get(that.model.settings, ["profiles", profile, key]); + fs.writeFileSync(orcaSettingsFile, JSON.stringify(that.model.settings, null, 4)); + return results; + }; - return { - oldValue: oldValue, - newValue: newValue - }; - }); + if (exists) { + togo = setSettings(); + } else { + togo = fluid.promise(); + var err = gpii.orca.settingsHandler.makeConfigurable(); + if (err) { + togo.reject(err); + fluid.fail(err); + } else { + var results = setSettings(); + togo.resolve(results); + } + } - return results; + return togo; }; gpii.orca.settingsHandler.get = function (that, payload) { @@ -169,9 +194,7 @@ }; gpii.orca.settingsHandler.set = function (that, payload) { - var results = gpii.settingsHandlers.invokeSettingsHandler(that.setImpl, payload); - fs.writeFileSync(orcaSettingsFile, JSON.stringify(that.model.settings, null, 4)); - return results; + return gpii.settingsHandlers.invokeSettingsHandler(that.setImpl, payload); }; var orcaSettingsHandler = gpii.orca.settingsHandler(); From 8870197f24ba8fedcf3b31442e4840e5da2048d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 6 May 2016 13:53:37 +0200 Subject: [PATCH 274/319] GPII-1526: Added try/catch blocks in case orca settings handler fails --- gpii/node_modules/orca/orcaSettingsHandler.js | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 05f49e7..28086f5 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -116,7 +116,7 @@ }; gpii.orca.settingsHandler.getImpl = function (that, payload) { - var togo; + var togo = fluid.promise(); var exists = fs.existsSync(orcaSettingsFile); var getSettings = function () { @@ -131,16 +131,22 @@ }; if (exists) { - togo = getSettings(); + try { + togo = getSettings(); + } catch (err) { + togo.reject("Couldn't get settings: " + err); + } } else { - togo = fluid.promise(); var err = gpii.orca.settingsHandler.makeConfigurable(); if (err) { togo.reject(err); - fluid.fail(err); } else { - var results = getSettings(); - togo.resolve(results); + try { + var results = getSettings(); + togo.resolve(results); + } catch (err) { + togo.reject("Couldn't get settings: " + err); + } } } @@ -148,7 +154,7 @@ }; gpii.orca.settingsHandler.setImpl = function (that, payload) { - var togo; + var togo = fluid.promise(); var exists = fs.existsSync(orcaSettingsFile); var setSettings = function () { @@ -173,16 +179,22 @@ }; if (exists) { - togo = setSettings(); + try { + togo = setSettings(); + } catch (err) { + togo.reject("Couldn't set settings: " + err); + } } else { - togo = fluid.promise(); var err = gpii.orca.settingsHandler.makeConfigurable(); if (err) { togo.reject(err); - fluid.fail(err); } else { - var results = setSettings(); - togo.resolve(results); + try { + var results = setSettings(); + togo.resolve(results); + } catch (err) { + togo.reject("Couldn't set settings: " + err); + } } } From f62ed1baeea6605a0317535e82d68548f9db81fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Mon, 16 May 2016 11:12:14 +0200 Subject: [PATCH 275/319] GPII-1526: WIP promise-based orca settings handler --- gpii/node_modules/orca/orcaSettingsHandler.js | 183 +++++++++++------- 1 file changed, 112 insertions(+), 71 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 28086f5..63f67bd 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -53,7 +53,6 @@ while (curDate - date < millis); } - fluid.registerNamespace("gpii.launch"); fluid.registerNamespace("gpii.orca"); fluid.defaults("gpii.orca.settingsHandler", { @@ -82,85 +81,120 @@ funcName: "gpii.orca.settingsHandler.setImpl", args: ["{that}", "{arguments}.0"] }, - readSettingsFile: { - funcName: "gpii.orca.settingsHandler.readSettingsFile", + getSettings: { + funcName: "gpii.orca.settingsHandler.getSettings", + args: ["{that}", "{arguments}.0", "{arguments}.1"] + }, + setSettings: { + funcName: "gpii.orca.settingsHandler.setSettings", + args: ["{that}", "{arguments}.0"] + }, + makeConfigurable: { + funcName: "gpii.orca.settingsHandler.makeConfigurable", + args: "{that}" + }, + loadSettings: { + funcName: "gpii.orca.settingsHandler.loadSettings", args: "{that}" } } }); - gpii.orca.settingsHandler.readSettingsFile = function (that) { - var userSettings = fs.readFileSync(orcaSettingsFile); - that.applier.change("settings", {}); - that.applier.change("settings", JSON.parse(userSettings)); + gpii.orca.settingsHandler.loadSettings = function (that) { + var togo = fluid.promise(); + // + var performRead = function () { + try { + var userSettings = fs.readFileSync(orcaSettingsFile); + that.applier.change("settings", {}); + that.applier.change("settings", JSON.parse(userSettings)); + togo.resolve(); + } catch (err) { + var rej = { + isError: true, + message: "Unable to read Orca settings file: " + err + }; + togo.reject(rej); + } + }; + + try { + fs.statSync(orcaSettingsFile); + performRead(); + } catch (err) { + var makeConfigurable = that.makeConfigurable(); + makeConfigurable.then(function () { + performRead(); + }, function (err) { + togo.reject(err); + }); + } + + return togo; }; - gpii.orca.settingsHandler.makeConfigurable = function () { + gpii.orca.settingsHandler.makeConfigurable = function (that) { + var togo = fluid.promise(); + var orcaSpawn = spawn("orca", ORCA_ARGS); var pass = 0; var maxPass = 10; var err; - while (!fs.existsSync(orcaSettingsFile)) { + var resolvePromise = function () { + orcaSpawn.kill("SIGKILL"); + togo.resolve(); + }; + + var checkIfFileGetsCreated = function () { + pass++; if (pass === maxPass) { - err = "Time limit exceeded [" + maxPass * 500 + - "ms] for creating Orca's configuration file"; - break; + orcaSpawn.kill("SIGKILL"); + var err = "Time limit exceeded [" + maxPass * 500 + + "ms] for creating Orca's configuration file"; + var rej = { + isError: true, + message: err + }; + togo.reject(rej); + } else { + try { + fs.statSync(orcaSettingsFile); + resolvePromise(); + } catch (err) { + gpii.invokeLater(checkIfFileGetsCreated, 500); + }; } - wait(500); - pass++; - } + }; - orcaSpawn.kill("SIGKILL"); - return err; + gpii.invokeLater(checkIfFileGetsCreated, 500); + return togo; }; - gpii.orca.settingsHandler.getImpl = function (that, payload) { + gpii.orca.settingsHandler.getSettings = function (that, payload) { var togo = fluid.promise(); - var exists = fs.existsSync(orcaSettingsFile); - var getSettings = function () { - that.readSettingsFile(); + var loadSettings = that.loadSettings(); + loadSettings.then(function () { var profile = that.model.settings.general.activeProfile[PROFILE_ID]; var results = fluid.transform(payload.settings, function (value, key) { var currentValue = fluid.get(that.model.settings, ["profiles", profile, key]); return currentValue; }); - - return results; - }; - - if (exists) { - try { - togo = getSettings(); - } catch (err) { - togo.reject("Couldn't get settings: " + err); - } - } else { - var err = gpii.orca.settingsHandler.makeConfigurable(); - if (err) { - togo.reject(err); - } else { - try { - var results = getSettings(); - togo.resolve(results); - } catch (err) { - togo.reject("Couldn't get settings: " + err); - } - } - } + togo.resolve(results); + }, function (err) { + togo.reject(err); + }); return togo; }; - gpii.orca.settingsHandler.setImpl = function (that, payload) { + gpii.orca.settingsHandler.setSettings = function (that, payload) { var togo = fluid.promise(); - var exists = fs.existsSync(orcaSettingsFile); - var setSettings = function () { - that.readSettingsFile(); + var loadSettings = that.loadSettings(); + loadSettings.then(function () { var profile = that.model.settings.general.activeProfile[PROFILE_ID]; - var results = fluid.transform(payload.settings, function (value, key) { var oldValue = fluid.get(that.model.settings, ["profiles", profile, key]); var type = value === undefined ? "DELETE" : "ADD"; @@ -173,30 +207,37 @@ newValue: newValue }; }); - fs.writeFileSync(orcaSettingsFile, JSON.stringify(that.model.settings, null, 4)); - return results; - }; + togo.resolve(results); + }, function (err) { + togo.reject(err); + }); - if (exists) { - try { - togo = setSettings(); - } catch (err) { - togo.reject("Couldn't set settings: " + err); - } - } else { - var err = gpii.orca.settingsHandler.makeConfigurable(); - if (err) { - togo.reject(err); - } else { - try { - var results = setSettings(); - togo.resolve(results); - } catch (err) { - togo.reject("Couldn't set settings: " + err); - } - } - } + return togo; + }; + + gpii.orca.settingsHandler.getImpl = function (that, payload) { + var togo = fluid.promise(); + + var getSettings = that.getSettings(payload); + getSettings.then(function (results) { + togo.resolve(results); + }, function (err) { + togo.reject(err); + }); + + return togo; + }; + + gpii.orca.settingsHandler.setImpl = function (that, payload) { + var togo = fluid.promise(); + + var setSettings = that.setSettings(payload); + setSettings.then(function (results) { + togo.resolve(results); + }, function (err) { + togo.reject(err); + }); return togo; }; From a01ca2119bc805b445542af17b62f899f4b61cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 17 May 2016 19:09:04 +0200 Subject: [PATCH 276/319] GPII-1526: Addressed last comments from Antranig wrt Orca --- gpii/node_modules/orca/orcaSettingsHandler.js | 98 +++++-------------- 1 file changed, 27 insertions(+), 71 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 63f67bd..42152c1 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -45,25 +45,10 @@ // var PROFILE_ID = 1; - function wait(millis) { - var date = new Date(); - var curDate; - - do { curDate = new Date(); } - while (curDate - date < millis); - } - fluid.registerNamespace("gpii.orca"); fluid.defaults("gpii.orca.settingsHandler", { - gradeNames: ["fluid.modelComponent"], - changeApplierOptions: { - resolverGetConfig: fluid.model.escapedGetConfig, - resolverSetConfig: fluid.model.escapedSetConfig - }, - model: { - settings: {} - }, + gradeNames: ["fluid.component"], invokers: { get: { funcName: "gpii.orca.settingsHandler.get", @@ -90,8 +75,7 @@ args: ["{that}", "{arguments}.0"] }, makeConfigurable: { - funcName: "gpii.orca.settingsHandler.makeConfigurable", - args: "{that}" + funcName: "gpii.orca.settingsHandler.makeConfigurable" }, loadSettings: { funcName: "gpii.orca.settingsHandler.loadSettings", @@ -102,13 +86,11 @@ gpii.orca.settingsHandler.loadSettings = function (that) { var togo = fluid.promise(); - // + var performRead = function () { try { var userSettings = fs.readFileSync(orcaSettingsFile); - that.applier.change("settings", {}); - that.applier.change("settings", JSON.parse(userSettings)); - togo.resolve(); + togo.resolve(JSON.parse(userSettings)); } catch (err) { var rej = { isError: true, @@ -133,37 +115,32 @@ return togo; }; - gpii.orca.settingsHandler.makeConfigurable = function (that) { + gpii.orca.settingsHandler.makeConfigurable = function () { var togo = fluid.promise(); var orcaSpawn = spawn("orca", ORCA_ARGS); var pass = 0; var maxPass = 10; - var err; - - var resolvePromise = function () { - orcaSpawn.kill("SIGKILL"); - togo.resolve(); - }; var checkIfFileGetsCreated = function () { pass++; if (pass === maxPass) { - orcaSpawn.kill("SIGKILL"); - var err = "Time limit exceeded [" + maxPass * 500 + - "ms] for creating Orca's configuration file"; - var rej = { - isError: true, - message: err - }; - togo.reject(rej); + orcaSpawn.kill("SIGKILL"); + var err = "Time limit exceeded [" + maxPass * 500 + + "ms] for creating Orca's configuration file"; + var rej = { + isError: true, + message: err + }; + togo.reject(rej); } else { try { fs.statSync(orcaSettingsFile); - resolvePromise(); + orcaSpawn.kill("SIGKILL"); + togo.resolve(); } catch (err) { gpii.invokeLater(checkIfFileGetsCreated, 500); - }; + } } }; @@ -175,10 +152,10 @@ var togo = fluid.promise(); var loadSettings = that.loadSettings(); - loadSettings.then(function () { - var profile = that.model.settings.general.activeProfile[PROFILE_ID]; + loadSettings.then(function (userSettings) { + var profile = userSettings.general.activeProfile[PROFILE_ID]; var results = fluid.transform(payload.settings, function (value, key) { - var currentValue = fluid.get(that.model.settings, ["profiles", profile, key]); + var currentValue = fluid.get(userSettings, ["profiles", profile, key]); return currentValue; }); togo.resolve(results); @@ -193,21 +170,18 @@ var togo = fluid.promise(); var loadSettings = that.loadSettings(); - loadSettings.then(function () { - var profile = that.model.settings.general.activeProfile[PROFILE_ID]; + loadSettings.then(function (userSettings) { + var profile = userSettings.general.activeProfile[PROFILE_ID]; var results = fluid.transform(payload.settings, function (value, key) { - var oldValue = fluid.get(that.model.settings, ["profiles", profile, key]); - var type = value === undefined ? "DELETE" : "ADD"; - that.applier.change(["settings", "profiles", profile, key], value, type); - - var newValue = fluid.get(that.model.settings, ["profiles", profile, key]); - + var oldValue = fluid.get(userSettings, ["profiles", profile, key]); + fluid.set(userSettings, ["profiles", profile, key], value); + var newValue = fluid.get(userSettings, ["profiles", profile, key]); return { oldValue: oldValue, newValue: newValue }; }); - fs.writeFileSync(orcaSettingsFile, JSON.stringify(that.model.settings, null, 4)); + fs.writeFileSync(orcaSettingsFile, JSON.stringify(userSettings, null, 4)); togo.resolve(results); }, function (err) { togo.reject(err); @@ -217,29 +191,11 @@ }; gpii.orca.settingsHandler.getImpl = function (that, payload) { - var togo = fluid.promise(); - - var getSettings = that.getSettings(payload); - getSettings.then(function (results) { - togo.resolve(results); - }, function (err) { - togo.reject(err); - }); - - return togo; + return that.getSettings(payload); }; gpii.orca.settingsHandler.setImpl = function (that, payload) { - var togo = fluid.promise(); - - var setSettings = that.setSettings(payload); - setSettings.then(function (results) { - togo.resolve(results); - }, function (err) { - togo.reject(err); - }); - - return togo; + return that.setSettings(payload); }; gpii.orca.settingsHandler.get = function (that, payload) { From 1968794a8e331273bdf84249bd7289563f14a6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Tue, 17 May 2016 19:50:19 +0200 Subject: [PATCH 277/319] GPII-1526: Use promise.map instead of .then when calling loadSettings --- gpii/node_modules/orca/orcaSettingsHandler.js | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 42152c1..157593f 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -149,28 +149,20 @@ }; gpii.orca.settingsHandler.getSettings = function (that, payload) { - var togo = fluid.promise(); - var loadSettings = that.loadSettings(); - loadSettings.then(function (userSettings) { + return fluid.promise.map(loadSettings, function (userSettings) { var profile = userSettings.general.activeProfile[PROFILE_ID]; var results = fluid.transform(payload.settings, function (value, key) { var currentValue = fluid.get(userSettings, ["profiles", profile, key]); return currentValue; }); - togo.resolve(results); - }, function (err) { - togo.reject(err); + return results; }); - - return togo; }; gpii.orca.settingsHandler.setSettings = function (that, payload) { - var togo = fluid.promise(); - var loadSettings = that.loadSettings(); - loadSettings.then(function (userSettings) { + return fluid.promise.map(loadSettings, function (userSettings) { var profile = userSettings.general.activeProfile[PROFILE_ID]; var results = fluid.transform(payload.settings, function (value, key) { var oldValue = fluid.get(userSettings, ["profiles", profile, key]); @@ -182,12 +174,8 @@ }; }); fs.writeFileSync(orcaSettingsFile, JSON.stringify(userSettings, null, 4)); - togo.resolve(results); - }, function (err) { - togo.reject(err); + return results; }); - - return togo; }; gpii.orca.settingsHandler.getImpl = function (that, payload) { From e0dbb4fe36369a613b0afe2d91b64278e57685ea Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Wed, 18 May 2016 03:56:26 +0100 Subject: [PATCH 278/319] GPII-1318: Updating .gitignore --- .gitignore | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 42d1f89..74764a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ -node_modules/gsettingsBridge/nodegsettings/.lock-wscript -node_modules/gsettingsBridge/nodegsettings/build +gpii/node_modules/alsa/nodealsa/build/ +gpii/node_modules/gsettingsBridge/nodegsettings/build/ +gpii/node_modules/packagekit/nodepackagekit/build/ +gpii/node_modules/xrandr/nodexrandr/build/ +node_modules/ From 7cf62f510e42007fbc5df0d0b22b9476af51dc9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 19 May 2016 12:54:54 +0200 Subject: [PATCH 279/319] GPII-1801: Reworked orcaSettingsHandlerTests --- .../orca/test/orcaSettingsHandlerTests.js | 243 ++++++++---------- gpii/node_modules/orca/test/payloads.json | 45 ++++ 2 files changed, 156 insertions(+), 132 deletions(-) create mode 100644 gpii/node_modules/orca/test/payloads.json diff --git a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js index 6862287..dd14ec6 100644 --- a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -2,7 +2,7 @@ * Orca Settings Handler Tests * * Copyright 2013, 2014 Emergya - * Copyright 2015 RtF-US + * Copyright 2015, 2016 RtF-US * * Licensed under the New BSD license. You may not use this file except in * compliance with this License. @@ -18,147 +18,126 @@ "use strict"; var fluid = require("universal"), - fs = require("fs"), - path = require("path"), jqUnit = fluid.require("node-jqunit"); require("orca"); var gpii = fluid.registerNamespace("gpii"); -var orca = fluid.registerNamespace("gpii.orca"); -jqUnit.module("OrcaSettingsHandler Module"); - -jqUnit.test("Running tests for Orca Settings Handler", function () { - - // Complete get/set flow - // - var getPayload = { - "org.gnome.orca": [{ - "settings": { - "enableBraille": null, - "enableEchoByWord": null, - "enableEchoByCharacter": null, - "voices.default.rate": null, - "enableTutorialMessages": null, - "voices.default.family": null, - "verbalizePunctuationStyle": null - } - }] - }; - var defaultSettingsPayload = gpii.resolveSync(orca.get(getPayload)); - jqUnit.assertTrue("orca.get is returning a valid Object", defaultSettingsPayload); +fluid.defaults("gpii.test.orca", { + gradeNames: ["fluid.test.testEnvironment"], + components: { + tester: { + type: "gpii.test.orca.tester" + } + } +}); - var setPayload = { - "org.gnome.orca": [{ - "settings": { - "enableBraille": true, - "enableEchoByWord": true, - "enableEchoByCharacter": false, - "voices.default.rate": 100, - "enableTutorialMessages": false, - "voices.default.family": { "locale": "es", "name": "spanish-latin-american" }, - "verbalizePunctuationStyle": 0 - } +fluid.defaults("gpii.test.orca.tester", { + gradeNames: ["fluid.test.testCaseHolder"], + payloads: null, + originalSettings: null, + components: { + orcaSettingsHandler: { + type: "gpii.orca.settingsHandler" + } + }, + events: { + onGetReturnPayload: null, + onSetReturnPayload: null + }, + listeners: { + onCreate: { + funcName: "gpii.test.orca.tester.populate", + args: ["{that}"] + } + }, + modules: [{ + name: "Orca Settings Handler Tests", + tests: [{ + //expect: 13, + name: "Get/Set tests", + sequence: [{ // Check that we can retrieve settings + func: "gpii.test.orca.get", + args: ["{tester}", "{tester}.payloads.getPayload"] + }, { + listener: "gpii.test.orca.checkGetPayload", + event: "{that}.events.onGetReturnPayload", + args: ["{that}", "{arguments}.0"] + }, { // Check that set returns the expected payload + func: "gpii.test.orca.set", + args: ["{tester}", "{tester}.payloads.setPayload"] + }, { + listener: "gpii.test.orca.checkSetPayload", + event: "{that}.events.onSetReturnPayload", + args: ["{arguments}.0", "{tester}.payloads.setPayload"] + }, { // Check that settings are applied + func: "gpii.test.orca.get", + args: ["{tester}", "{tester}.payloads.getPayload"] + }, { + listener: "gpii.test.orca.checkActualSettings", + event: "{that}.events.onGetReturnPayload", + args: ["{arguments}.0", "{tester}.payloads.setPayload"] + }, { // Restore to the initial settings and check returned payload + func: "gpii.test.orca.set", + args: ["{tester}", "{tester}.originalSettings"] + }, { + listener: "gpii.test.orca.checkSetPayload", + event: "{that}.events.onSetReturnPayload", + args: ["{arguments}.0", "{tester}.originalSettings"] + }, { // Check that settings are back to its original values + func: "gpii.test.orca.get", + args: ["{tester}", "{tester}.payloads.getPayload"] + }, { + listener: "gpii.test.orca.checkActualSettings", + event: "{that}.events.onGetReturnPayload", + args: ["{arguments}.0", "{tester}.originalSettings"] + }] }] - }; + }] +}); - var returnPayload = gpii.resolveSync(orca.set(setPayload)); - var settings = returnPayload["org.gnome.orca"][0].settings; +gpii.test.orca.tester.populate = function (that) { + that.payloads = require(__dirname + "/payloads.json"); +}; - fluid.each(settings, function (v, k) { - var expectedValue = setPayload["org.gnome.orca"][0].settings[k]; - jqUnit.assertDeepEq("Setting " + k + " is being set well", expectedValue, v.newValue); +gpii.test.orca.get = function (that, payload) { + var getPromise = that.orcaSettingsHandler.get(payload); + getPromise.then(function (results) { + that.events.onGetReturnPayload.fire(results); + }, function (err) { + fluid.fail(err); }); - - var returnGetPayload = gpii.resolveSync(orca.get(getPayload)); - jqUnit.assertDeepEq("Get payload is as expected after updating the settings", returnGetPayload, setPayload); - - orca.set(defaultSettingsPayload); - var currentSettingsPayload = gpii.resolveSync(orca.get(getPayload)); - jqUnit.assertDeepEq("Settings are being restored well", currentSettingsPayload, defaultSettingsPayload); - - // Complete get/set flow with non-existent settings. - // - var getPayload2 = { - "data": [{ - "settings": { - "foo": null, - "cat.name": null, - "cat.age": null - } - }] - }; - - var defaultSettingsPayload2 = gpii.resolveSync(orca.get(getPayload2)); - - var setPayload2 = { - "data": [{ - "settings": { - "foo": "bar", - "cat.name": "CATTT", - "cat.age": 3 - } - }] - }; - - var returnPayload2 = gpii.resolveSync(orca.set(setPayload2)); - var settings2 = fluid.copy(returnPayload2.data[0].settings); - fluid.each(settings2, function (v, k) { - var expectedValue = setPayload2.data[0].settings[k]; - jqUnit.assertDeepEq("Non-existent setting " + k + " is being set well", expectedValue, v.newValue); +}; + +gpii.test.orca.set = function (that, payload) { + var setPromise = that.orcaSettingsHandler.set(payload); + setPromise.then(function (results) { + that.events.onSetReturnPayload.fire(results); + }, function (err) { + fluid.fail(err); }); +}; + +gpii.test.orca.checkGetPayload = function (that, results) { + that.originalSettings = results; + jqUnit.assertTrue("We can get settings from orca settings file", + (typeof(results) === "object")); +}; + +gpii.test.orca.checkSetPayload = function (results, payload) { + fluid.each(results, function (solution, solutionId) { + var settings = results[solutionId][0].settings; + fluid.each(settings, function (v, k) { + var expectedValue = payload[solutionId][0].settings[k]; + jqUnit.assertDeepEq("Setting " + k + " is being set well", + expectedValue, v.newValue); + }); + }); +}; - // Restore the settings - orca.set(defaultSettingsPayload2); - var currentSettingsPayload2 = gpii.resolveSync(orca.get(getPayload2)); - jqUnit.assertDeepEq("Non-existent settings are being restored well", currentSettingsPayload2, defaultSettingsPayload2); - - // Check that 'foo' and 'cat' are removed properly from Orca's config file - var HOME = process.env.HOME; - var XDG_DATA_HOME = process.env.XDG_DATA_HOME || path.resolve(HOME, ".local/share"); - var orcaSettingsFile = path.resolve(XDG_DATA_HOME, "orca/user-settings.conf"); - - var content = JSON.parse(fs.readFileSync(orcaSettingsFile)); - var profile = content.general.activeProfile[1]; - settings = content.profiles[profile]; - jqUnit.assertFalse("No 'foo' setting in Orca's config file", settings.hasOwnProperty("foo")); - jqUnit.assertFalse("No 'cat' setting in Orca's config file", settings.hasOwnProperty("cat")); - - // Complete get/set flow with multiple solution entries. - // - var getPayload3 = { - "data": [{ - "settings": { - "foo": null - } - }], - "otherData": [{ - "settings": { - "john": null - } - }] - }; - - var defaultSettingsPayload3 = gpii.resolveSync(orca.get(getPayload3)); - - var setPayload3 = { - "data": [{ - "settings": { - "foo": "bar" - } - }], - "otherData": [{ - "settings": { - "john": "doe" - } - }] - }; - - orca.set(setPayload3); - - // Restore the settings - orca.set(defaultSettingsPayload3); - var currentSettingsPayload3 = gpii.resolveSync(orca.get(getPayload3)); - jqUnit.assertDeepEq("Non-existent settings are being restored well", currentSettingsPayload3, defaultSettingsPayload3); +gpii.test.orca.checkActualSettings = function (results, expected) { + jqUnit.assertDeepEq("Orca config file contains the expected settings", + expected, results); +}; -}); +gpii.test.orca(); diff --git a/gpii/node_modules/orca/test/payloads.json b/gpii/node_modules/orca/test/payloads.json new file mode 100644 index 0000000..0896fda --- /dev/null +++ b/gpii/node_modules/orca/test/payloads.json @@ -0,0 +1,45 @@ +{ + "getPayload": { + "dataPayload1": [{ + "settings": { + "enableBraille": null, + "enableEchoByWord": null, + "enableEchoByCharacter": null, + "voices.default.rate": null, + "enableTutorialMessages": null, + "voices.default.family": null, + "verbalizePunctuationStyle": null + } + }], + "dataPayload2": [{ + "settings": { + "foo": null, + "cat.name": null, + "cat.age": null + } + }] + }, + "setPayload": { + "dataPayload1": [{ + "settings": { + "enableBraille": true, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "voices.default.rate": 100, + "enableTutorialMessages": false, + "voices.default.family": { + "locale": "es", + "name": "spanish-latin-american" + }, + "verbalizePunctuationStyle": 0 + } + }], + "dataPayload2": [{ + "settings": { + "foo": "bar", + "cat.name": "CATTT", + "cat.age": 3 + } + }] + } +} From b10977555476879f39209db0ed20ba319ee9c45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 19 May 2016 12:56:15 +0200 Subject: [PATCH 280/319] GPII-1801: Stop ignoring gpii/node_modules in .gitignore .gitignore was ignoring every file under gpii/node_modules that is not part of the current repository. When adding new files, they weren't shown under "Untracked files". --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 74764a8..dc9bd6a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ +/.vagrant/ gpii/node_modules/alsa/nodealsa/build/ gpii/node_modules/gsettingsBridge/nodegsettings/build/ gpii/node_modules/packagekit/nodepackagekit/build/ gpii/node_modules/xrandr/nodexrandr/build/ -node_modules/ +/node_modules/ From 7b0b7eb2103dc58cc6691fb57bb75fb19f32be65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 19 May 2016 12:59:27 +0200 Subject: [PATCH 281/319] GPII-1801: Removed "tests" folder from jsonlint task It was used before the acceptance tests definitions were moved into the universal repository, so it doesn't make sense to keep it here anymore. --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 034d8e4..39cd7fd 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -44,7 +44,7 @@ module.exports = function (grunt) { } }, jsonlint: { - src: ["gpii/**/*.json", "tests/**/*.json"] + src: ["gpii/**/*.json"] }, shell: { options: { From 0d94819ab4dd3a4cd5f79569e735ae6a5863a886 Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Thu, 26 May 2016 23:33:12 +0100 Subject: [PATCH 282/319] GPII-1318: "Blind" commit to fix drift in Infusion due to removal of unnecessary utility fluid.getLoader --- gpii/node_modules/alsa/index.js | 6 +----- gpii/node_modules/gsettingsBridge/index.js | 6 +----- gpii/node_modules/packagekit/index.js | 4 +--- gpii/node_modules/xrandr/index.js | 6 +----- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/gpii/node_modules/alsa/index.js b/gpii/node_modules/alsa/index.js index 0fb0654..840a7fd 100644 --- a/gpii/node_modules/alsa/index.js +++ b/gpii/node_modules/alsa/index.js @@ -14,8 +14,4 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ -var fluid = require("universal"); - -var loader = fluid.getLoader(__dirname); - -loader.require("./alsa_bridge.js"); +require("./alsa_bridge.js"); diff --git a/gpii/node_modules/gsettingsBridge/index.js b/gpii/node_modules/gsettingsBridge/index.js index 7ae5f70..632ede7 100644 --- a/gpii/node_modules/gsettingsBridge/index.js +++ b/gpii/node_modules/gsettingsBridge/index.js @@ -14,8 +14,4 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ -var fluid = require("universal"); - -var loader = fluid.getLoader(__dirname); - -loader.require("./gsettings_bridge.js"); \ No newline at end of file +require("./gsettings_bridge.js"); \ No newline at end of file diff --git a/gpii/node_modules/packagekit/index.js b/gpii/node_modules/packagekit/index.js index d019e0e..7d248e0 100644 --- a/gpii/node_modules/packagekit/index.js +++ b/gpii/node_modules/packagekit/index.js @@ -12,9 +12,7 @@ var fluid = require("universal"); -var loader = fluid.getLoader(__dirname); - -loader.require("./packageKitDeviceReporter.js"); +require("./packageKitDeviceReporter.js"); // Initialize the Device Reporter's installedPackagesCache at the very // beginning and avoid a delay when a user is logging in into the system. diff --git a/gpii/node_modules/xrandr/index.js b/gpii/node_modules/xrandr/index.js index b8d9c41..f120d37 100644 --- a/gpii/node_modules/xrandr/index.js +++ b/gpii/node_modules/xrandr/index.js @@ -14,8 +14,4 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ -var fluid = require("universal"); - -var loader = fluid.getLoader(__dirname); - -loader.require("./xrandr_bridge.js"); +require("./xrandr_bridge.js"); From dfb0d227a27371512fdd9fcb323ccc10c2c41595 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Thu, 26 May 2016 18:35:44 -0400 Subject: [PATCH 283/319] GPII-1318: Updates Vagrant scripts to latest Node LTS. --- provisioning/vars.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/provisioning/vars.yml b/provisioning/vars.yml index 61b5abc..779dd32 100644 --- a/provisioning/vars.yml +++ b/provisioning/vars.yml @@ -8,8 +8,8 @@ nodejs_app_git_repo: https://github.com/gpii/linux.git nodejs_app_git_branch: master -# Node.js version required by application (supported versions: 0.10.36*, 0.10.40, 4.1.1) -nodejs_version: 0.10.42 +# Currently Node.js LTS (4.x or "Argon") is required by the GPII +nodejs_branch: lts # If a specific npm version is needed, specify it here #nodejs_npm_version: 1.4.28 @@ -33,7 +33,7 @@ nodejs_app_rpm_packages: - http-parser - http-parser-devel - libstdc++-devel - - libuv + - libuv - libuv-devel nodejs_app_npm_packages: @@ -48,4 +48,3 @@ nodejs_app_start_script: gpii.js nodejs_app_install_dir: /home/vagrant/sync nodejs_app_git_clone: false - From f0f5610dd61060f93c545f75d44b117b4fd55cfe Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Thu, 26 May 2016 19:21:45 -0400 Subject: [PATCH 284/319] GPII-1318: Updates vagrant provisioner to Fedora 23. Removes one last stray fluid.getLoader() call. --- Vagrantfile | 2 +- gpii/node_modules/orca/index.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 9795f85..85af431 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,7 +24,7 @@ ram = ENV["VM_RAM"] || 2048 Vagrant.configure(2) do |config| - config.vm.box = "inclusivedesign/fedora22" + config.vm.box = "inclusivedesign/fedora23" # Your working directory will be synced to /home/vagrant/sync in the VM. config.vm.synced_folder ".", "#{app_directory}" diff --git a/gpii/node_modules/orca/index.js b/gpii/node_modules/orca/index.js index 8c2cacc..eb8ab8f 100644 --- a/gpii/node_modules/orca/index.js +++ b/gpii/node_modules/orca/index.js @@ -15,8 +15,4 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ -var fluid = require("universal"); - -var loader = fluid.getLoader(__dirname); - -loader.require("./orcaSettingsHandler.js"); +require("./orcaSettingsHandler.js"); From 474dde9f9173fcb12a308ce5b0eeb7bdcf3b57fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Fri, 27 May 2016 13:40:30 +0200 Subject: [PATCH 285/319] GPII-1813: Add a dedicated grunt task for cleaning/building native addons --- Gruntfile.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9587e08..9fb6c77 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -93,18 +93,26 @@ module.exports = function (grunt) { grunt.registerTask("build", "Build the entire GPII", function () { grunt.task.run("gpii-universal"); + grunt.task.run("build-addons"); + grunt.task.run("shell:installUsbLib"); + }); + + grunt.registerTask("build-addons", "Build the native addons", function () { grunt.task.run("shell:compileGSettings"); grunt.task.run("shell:compileAlsaBridge"); grunt.task.run("shell:compileXrandrBridge"); grunt.task.run("shell:compilePackageKitBridge"); - grunt.task.run("shell:installUsbLib"); }); - grunt.registerTask("clean", "Clean the GPII binaries and uninstall", function () { + grunt.registerTask("clean-addons", "Clean the native addons", function () { grunt.task.run("shell:cleanGSettings"); grunt.task.run("shell:cleanAlsaBridge"); grunt.task.run("shell:cleanXrandrBridge"); grunt.task.run("shell:cleanPackageKitBridge"); + }); + + grunt.registerTask("clean", "Clean the GPII binaries and uninstall", function () { + grunt.task.run("clean-addons"); grunt.task.run("shell:uninstallUsbLib"); }); From cc5f51df5a798f1e71a9e99878982652fab6d143 Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Fri, 17 Jun 2016 19:13:05 +0100 Subject: [PATCH 286/319] GPII-1848: Removing dependence on grunt-gpii, updating to grunt 1.x toolchain, moving from JSHint to ESLint --- .eslintrc.json | 75 +++ .jshintrc | 32 -- Gruntfile.js | 16 +- gpii.js | 4 +- gpii/node_modules/alsa/alsa_bridge.js | 183 ++++--- gpii/node_modules/alsa/index.js | 2 + .../gsettingsBridge/gsettings_bridge.js | 147 +++-- gpii/node_modules/gsettingsBridge/index.js | 4 +- .../gsettingsBridge/tests/gsettingsTests.js | 423 ++++++++------- gpii/node_modules/orca/index.js | 2 + gpii/node_modules/orca/orcaSettingsHandler.js | 327 ++++++------ gpii/node_modules/packagekit/index.js | 2 + .../packagekit/nodepackagekit/findSearchPk.js | 129 +++-- .../nodepackagekit/nodepackagekit_test.js | 504 +++++++++--------- .../packagekit/packageKitDeviceReporter.js | 58 +- gpii/node_modules/xrandr/index.js | 2 + gpii/node_modules/xrandr/xrandr_bridge.js | 188 ++++--- index.js | 4 +- package.json | 15 +- 19 files changed, 1073 insertions(+), 1044 deletions(-) create mode 100644 .eslintrc.json delete mode 100644 .jshintrc diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..4466f21 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,75 @@ +{ + "env": { + "node": true + }, + "rules": { + "block-scoped-var": "error", + "comma-style": [ + "error", + "last" + ], + "curly": [ + "error", + "all" + ], + "dot-notation": [ + "error", + { + "allowKeywords": false + } + ], + "eol-last": "error", + "eqeqeq": [ + "error", + "allow-null" + ], + "indent": ["error", 4], + "new-cap": ["error", { "properties": false }], + "no-caller": "error", + "no-cond-assign": [ + "error", + "except-parens" + ], + "no-debugger": "error", + "no-empty": ["error", {"allowEmptyCatch": true}], + "no-eval": "error", + "no-extend-native": "error", + "no-irregular-whitespace": "error", + "no-iterator": "error", + "no-loop-func": "error", + "no-multi-str": "error", + "no-new": "error", + "no-proto": "error", + "no-script-url": "error", + "no-sequences": "error", + "no-trailing-spaces": "error", + "no-undef": "error", + "no-unused-vars": "error", + "no-with": "error", + "quotes": [ + "error", + "double" + ], + "semi": [ + "error", + "always" + ], + "space-before-blocks": ["error", "always"], + "space-before-function-paren": ["error", {"anonymous": "always", "named": "never"}], + "space-infix-ops": "error", + "space-unary-ops": [ + "error", { + "words": true, + "nonwords": false, + "overrides": { + "typeof": false + } + }], + "strict": ["error", "safe"], + "valid-typeof": "error", + "wrap-iife": [ + "error", + "inside" + ] + } +} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 49d9c2a..0000000 --- a/.jshintrc +++ /dev/null @@ -1,32 +0,0 @@ -{ - "bitwise": false, - "camelcase": false, - "curly": true, - "eqeqeq": true, - "es3": true, - "forin": false, - "freeze": true, - "immed": true, - "indent": 4, - "latedef": true, - "newcap": true, - "noarg": true, - "noempty": false, - "nonbsp": true, - "nonew": true, - "plusplus": false, - "quotmark": "double", - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - "white": true, - - "maxerr": 1000, - - "node": true, - - "globals": { - "fluid_1_5": true - } -} diff --git a/Gruntfile.js b/Gruntfile.js index 9fb6c77..cad60b3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,10 +15,9 @@ https://github.com/gpii/universal/LICENSE.txt module.exports = function (grunt) { - grunt.loadNpmTasks("grunt-shell"); - grunt.loadNpmTasks("grunt-contrib-jshint"); grunt.loadNpmTasks("grunt-jsonlint"); - grunt.loadNpmTasks("grunt-gpii"); + grunt.loadNpmTasks("grunt-shell"); + grunt.loadNpmTasks("fluid-grunt-eslint"); var usbListenerDir = "./usbDriveListener"; var gypCompileCmd = "node-gyp configure build"; @@ -35,13 +34,11 @@ module.exports = function (grunt) { }; } + grunt.registerTask("lint", "Apply eslint and jsonlint", ["eslint", "jsonlint"]); + grunt.initConfig({ - jshint: { - src: ["gpii/**/*.js", "tests/**/*.js"], - buildScripts: ["Gruntfile.js"], - options: { - jshintrc: true - } + eslint: { + src: ["./gpii/**/*.js", "./tests/**/*.js", "./*.js"] }, jsonlint: { src: ["gpii/**/*.json"] @@ -92,7 +89,6 @@ module.exports = function (grunt) { }); grunt.registerTask("build", "Build the entire GPII", function () { - grunt.task.run("gpii-universal"); grunt.task.run("build-addons"); grunt.task.run("shell:installUsbLib"); }); diff --git a/gpii.js b/gpii.js index 33d1512..4b6b8b6 100644 --- a/gpii.js +++ b/gpii.js @@ -15,10 +15,10 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ +"use strict"; var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"), - kettle = fluid.registerNamespace("kettle"); + gpii = fluid.registerNamespace("gpii"); require("./index.js"); diff --git a/gpii/node_modules/alsa/alsa_bridge.js b/gpii/node_modules/alsa/alsa_bridge.js index c671508..0011990 100644 --- a/gpii/node_modules/alsa/alsa_bridge.js +++ b/gpii/node_modules/alsa/alsa_bridge.js @@ -14,107 +14,104 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ -(function () { - "use strict"; - - var fluid = require("universal"); - var gpii = fluid.registerNamespace("gpii"); - var alsa = require("./nodealsa/build/Release/nodealsa.node"); - - fluid.registerNamespace("gpii.alsa"); - - fluid.defaults("gpii.alsa.getSystemVolume", { - gradeNames: "fluid.function", - argumentMap: { - } - }); - - fluid.defaults("gpii.alsa.setSystemVolume", { - gradeNames: "fluid.function", - argumentMap: { - value: 0 +"use strict"; + +var fluid = require("universal"); +var gpii = fluid.registerNamespace("gpii"); +var alsa = require("./nodealsa/build/Release/nodealsa.node"); + +fluid.registerNamespace("gpii.alsa"); + +fluid.defaults("gpii.alsa.getSystemVolume", { + gradeNames: "fluid.function", + argumentMap: { + } +}); + +fluid.defaults("gpii.alsa.setSystemVolume", { + gradeNames: "fluid.function", + argumentMap: { + value: 0 + } +}); + +fluid.defaults("gpii.alsa.get", { + gradeNames: "fluid.function", + argumentMap: { + payload: 0 + } +}); + +fluid.defaults("gpii.alsa.set", { + gradeNames: "fluid.function", + argumentMap: { + payload: 0 + } +}); + +gpii.alsa.getSystemVolume = function () { + return alsa.getSystemVolume(); +}; + +gpii.alsa.setSystemVolume = function (value) { + return alsa.setSystemVolume(value); +}; + +// TODO: http://issues.gpii.net/browse/GPII-1028 +// This mechanism has been literaly copied/pasted from XRandR's settings +// handler, which looks like a good approach to deal with this kind of +// settings handler. The use of this approach should be consolidated +// as an utility inside the GPII. +// +gpii.alsa.allSettings = { + masterVolume: { + get: "gpii.alsa.getSystemVolume", + set: "gpii.alsa.setSystemVolume" + } +}; + +gpii.alsa.getImpl = function (settingsRequest) { + settingsRequest = settingsRequest || gpii.alsa.allSettings; + var settings = fluid.transform(settingsRequest, function (value, key) { + var funcEntry = gpii.alsa.allSettings[key]; + if (funcEntry) { + return fluid.invokeGlobalFunction(funcEntry.get); + } else { + fluid.fail("Invalid key to ALSA settings handler - " + + key + " - valid choices are " + JSON.stringify(fluid.keys(gpii.alsa.allSettings))); } }); + return settings; +}; - fluid.defaults("gpii.alsa.get", { - gradeNames: "fluid.function", - argumentMap: { - payload: 0 - } - }); +gpii.alsa.get = function (payload) { + var app = fluid.copy(payload); + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var settings = gpii.alsa.getImpl(app[appId][j].settings); - fluid.defaults("gpii.alsa.set", { - gradeNames: "fluid.function", - argumentMap: { - payload: 0 + var noOptions = { settings: settings }; + app[appId][j] = noOptions; } - }); + } + return app; +}; - gpii.alsa.getSystemVolume = function () { - return alsa.getSystemVolume(); - }; +gpii.alsa.set = function (payload) { + var app = fluid.copy(payload); + var settings = app["org.alsa-project"][0].settings; - gpii.alsa.setSystemVolume = function (value) { - return alsa.setSystemVolume(value); - }; + var oldValue = alsa.getSystemVolume(); + alsa.setSystemVolume(settings.masterVolume); - // TODO: http://issues.gpii.net/browse/GPII-1028 - // This mechanism has been literaly copied/pasted from XRandR's settings - // handler, which looks like a good approach to deal with this kind of - // settings handler. The use of this approach should be consolidated - // as an utility inside the GPII. - // - gpii.alsa.allSettings = { - masterVolume: { - get: "gpii.alsa.getSystemVolume", - set: "gpii.alsa.setSystemVolume" - } + var newSettingsResponse = {}; + newSettingsResponse.masterVolume = { + "oldValue": oldValue, + "newValue": settings.masterVolume }; - gpii.alsa.getImpl = function (settingsRequest) { - settingsRequest = settingsRequest || gpii.alsa.allSettings; - var settings = fluid.transform(settingsRequest, function (value, key) { - var funcEntry = gpii.alsa.allSettings[key]; - if (funcEntry) { - return fluid.invokeGlobalFunction(funcEntry.get); - } else { - fluid.fail("Invalid key to ALSA settings handler - " + - key + " - valid choices are " + JSON.stringify(fluid.keys(gpii.alsa.allSettings))); - } - }); - return settings; - }; - - gpii.alsa.get = function (payload) { - var app = fluid.copy(payload); - for (var appId in app) { - for (var j = 0; j < app[appId].length; j++) { - var settings = gpii.alsa.getImpl(app[appId][j].settings); - - var noOptions = { settings: settings }; - app[appId][j] = noOptions; - } - } - return app; - }; - - gpii.alsa.set = function (payload) { - var app = fluid.copy(payload); - var settings = app["org.alsa-project"][0].settings; - - var oldValue = alsa.getSystemVolume(); - alsa.setSystemVolume(settings.masterVolume); - - var newSettingsResponse = {}; - newSettingsResponse.masterVolume = { - "oldValue": oldValue, - "newValue": settings.masterVolume - }; - - var noOptions = {settings: newSettingsResponse}; - fluid.set(app, ["org.alsa-project", 0], noOptions); - - return app; - }; + var noOptions = {settings: newSettingsResponse}; + fluid.set(app, ["org.alsa-project", 0], noOptions); -})(); + return app; +}; diff --git a/gpii/node_modules/alsa/index.js b/gpii/node_modules/alsa/index.js index 840a7fd..2a6bb55 100644 --- a/gpii/node_modules/alsa/index.js +++ b/gpii/node_modules/alsa/index.js @@ -14,4 +14,6 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ +"use strict"; + require("./alsa_bridge.js"); diff --git a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js index 379147c..f70225e 100644 --- a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js @@ -14,96 +14,93 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ -(function () { - "use strict"; +"use strict"; - var fluid = require("universal"); - var gpii = fluid.registerNamespace("gpii"); - var nodeGSettings = require("./nodegsettings/build/Release/nodegsettings.node"); +var fluid = require("universal"); +var gpii = fluid.registerNamespace("gpii"); +var nodeGSettings = require("./nodegsettings/build/Release/nodegsettings.node"); - fluid.registerNamespace("gpii.launch"); - fluid.registerNamespace("gpii.gsettings"); +fluid.registerNamespace("gpii.launch"); +fluid.registerNamespace("gpii.gsettings"); - fluid.defaults("gpii.gsettings.setSingleKey", { - gradeNames: "fluid.function", - argumentMap: { - schemaId: 0, - key: 1, - value: 2 - } - }); +fluid.defaults("gpii.gsettings.setSingleKey", { + gradeNames: "fluid.function", + argumentMap: { + schemaId: 0, + key: 1, + value: 2 + } +}); - fluid.defaults("gpii.gsettings.getSingleKey", { - gradeNames: "fluid.function", - argumentMap: { - schemaId: 0, - key: 1 - } - }); +fluid.defaults("gpii.gsettings.getSingleKey", { + gradeNames: "fluid.function", + argumentMap: { + schemaId: 0, + key: 1 + } +}); - gpii.gsettings.getSingleKey = function (schemaId, key) { - return nodeGSettings.get_gsetting(schemaId, key); - }; +gpii.gsettings.getSingleKey = function (schemaId, key) { + return nodeGSettings.get_gsetting(schemaId, key); +}; - gpii.gsettings.setSingleKey = function (schemaId, key, value) { - nodeGSettings.set_gsetting(schemaId, key, value); - }; +gpii.gsettings.setSingleKey = function (schemaId, key, value) { + nodeGSettings.set_gsetting(schemaId, key, value); +}; - gpii.gsettings.get = function (settingsarray) { - var app = fluid.copy(settingsarray); - for (var appId in app) { - for (var j = 0; j < app[appId].length; j++) { - var schemaId = app[appId][j].options.schema; - var settings = app[appId][j].settings; - var keys = nodeGSettings.get_gsetting_keys(schemaId); +gpii.gsettings.get = function (settingsarray) { + var app = fluid.copy(settingsarray); + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var schemaId = app[appId][j].options.schema; + var settings = app[appId][j].settings; + var keys = nodeGSettings.get_gsetting_keys(schemaId); - if (settings === null) { - settings = {}; - for (var k = 0; k < keys.length; k++) { - var key = keys[k]; - settings[key] = nodeGSettings.get_gsetting(schemaId, key); - } + if (settings === null) { + settings = {}; + for (var k = 0; k < keys.length; k++) { + var key = keys[k]; + settings[key] = nodeGSettings.get_gsetting(schemaId, key); } - else { - for (var settingKey in settings) { - if (keys.indexOf(settingKey) === -1) { - continue; - } - settings[settingKey] = nodeGSettings.get_gsetting(schemaId, settingKey); - } - } - var noOptions = { settings: settings }; - app[appId][j] = noOptions; } - } - return app; - }; - - gpii.gsettings.set = function (settingsarray) { - var app = fluid.copy(settingsarray); - for (var appId in app) { - for (var j = 0; j < app[appId].length; j++) { - var schemaId = app[appId][j].options.schema; - var settings = app[appId][j].settings; - var keys = nodeGSettings.get_gsetting_keys(schemaId); - + else { for (var settingKey in settings) { if (keys.indexOf(settingKey) === -1) { continue; } - var value = settings[settingKey]; - var oldValue = nodeGSettings.get_gsetting(schemaId, settingKey); - nodeGSettings.set_gsetting(schemaId, settingKey, value); - settings[settingKey] = { - "oldValue": oldValue, - "newValue": value - }; + settings[settingKey] = nodeGSettings.get_gsetting(schemaId, settingKey); } - var noOptions = { settings: settings}; - app[appId][j] = noOptions; } + var noOptions = { settings: settings }; + app[appId][j] = noOptions; } - return app; - }; + } + return app; +}; + +gpii.gsettings.set = function (settingsarray) { + var app = fluid.copy(settingsarray); + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var schemaId = app[appId][j].options.schema; + var settings = app[appId][j].settings; + var keys = nodeGSettings.get_gsetting_keys(schemaId); -})(); + for (var settingKey in settings) { + if (keys.indexOf(settingKey) === -1) { + continue; + } + var value = settings[settingKey]; + var oldValue = nodeGSettings.get_gsetting(schemaId, settingKey); + nodeGSettings.set_gsetting(schemaId, settingKey, value); + settings[settingKey] = { + "oldValue": oldValue, + "newValue": value + }; + } + var noOptions = { settings: settings}; + app[appId][j] = noOptions; + } + } + return app; +}; diff --git a/gpii/node_modules/gsettingsBridge/index.js b/gpii/node_modules/gsettingsBridge/index.js index 632ede7..692a449 100644 --- a/gpii/node_modules/gsettingsBridge/index.js +++ b/gpii/node_modules/gsettingsBridge/index.js @@ -14,4 +14,6 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ -require("./gsettings_bridge.js"); \ No newline at end of file +"use strict"; + +require("./gsettings_bridge.js"); diff --git a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js index 8e9d345..f5e875a 100644 --- a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -16,225 +16,222 @@ "use strict"; -(function () { - var fluid = require("universal"), - gpii = fluid.registerNamespace("gpii"), - jqUnit = fluid.require("node-jqunit"); - - require("gsettingsBridge"); - - var put1 = { - request: { - "putreq": [ - { - settings: { - "double-setting": 3.1, - "boolean-setting": true, - "string-setting": "here i am" - }, - options: { - schema: "net.gpii.testing.gsettings.multi-set1" - } +var fluid = require("universal"), + gpii = fluid.registerNamespace("gpii"), + jqUnit = fluid.require("node-jqunit"); + +require("gsettingsBridge"); + +var put1 = { + request: { + "putreq": [ + { + settings: { + "double-setting": 3.1, + "boolean-setting": true, + "string-setting": "here i am" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set1" } - ] - }, - expected: { - "putreq": [ - { - settings: { - "double-setting": { "oldValue": 5.0, "newValue": 3.1 }, - "boolean-setting": { "oldValue": false, "newValue": true }, - "string-setting": { "oldValue": "abcdefg", "newValue": "here i am" } - } + } + ] + }, + expected: { + "putreq": [ + { + settings: { + "double-setting": { "oldValue": 5.0, "newValue": 3.1 }, + "boolean-setting": { "oldValue": false, "newValue": true }, + "string-setting": { "oldValue": "abcdefg", "newValue": "here i am" } } - ] - } - }; - - var put2 = { - request: { - "putreq": [ - { - settings: { - "double-setting": 3.2, - "boolean-setting": true, - "string-setting": "here i amma" - }, - options: { - schema: "net.gpii.testing.gsettings.multi-set2" - } - }, { - settings: { - "other-double-setting": 123.0, - "other-string-setting": "congratulations" - }, - options: { - schema: "net.gpii.testing.gsettings.multi-set3" - } + } + ] + } +}; + +var put2 = { + request: { + "putreq": [ + { + settings: { + "double-setting": 3.2, + "boolean-setting": true, + "string-setting": "here i amma" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set2" } - ] - }, - expected: { - "putreq": [ - { - settings: { - "double-setting": { "oldValue": 5, "newValue": 3.2}, - "boolean-setting": { "oldValue": false, "newValue": true }, - "string-setting": { "oldValue": "abcdefg", "newValue": "here i amma" } - } - }, { - settings: { - "other-double-setting": { "oldValue": 987.61, "newValue": 123.0 }, - "other-string-setting": { "oldValue": "hello world", "newValue": "congratulations" } - } + }, { + settings: { + "other-double-setting": 123.0, + "other-string-setting": "congratulations" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set3" } - ] - } - }; - - var get1 = { - request: { - "getreq": [ - { - settings: { - "double-setting": null, - "boolean-setting": null, - "string-setting": null - }, - options: { - schema: "net.gpii.testing.gsettings.multi-get1" - } - }, { - settings: { - "other-string-setting": null - }, - options: { - schema: "net.gpii.testing.gsettings.multi-get2" - } + } + ] + }, + expected: { + "putreq": [ + { + settings: { + "double-setting": { "oldValue": 5, "newValue": 3.2}, + "boolean-setting": { "oldValue": false, "newValue": true }, + "string-setting": { "oldValue": "abcdefg", "newValue": "here i amma" } } - ] - }, - expected: { - "getreq": [ - { - settings: { - "double-setting": 5.0, - "boolean-setting": false, - "string-setting": "abcdefg" - } - }, { - settings: { - "other-string-setting": "hello world" - } + }, { + settings: { + "other-double-setting": { "oldValue": 987.61, "newValue": 123.0 }, + "other-string-setting": { "oldValue": "hello world", "newValue": "congratulations" } } - ] - } - }; - - var get2 = { - request: { - "getreq": [ - { - settings: null, - options: { - schema: "net.gpii.testing.gsettings.multi-get1" - } - }, { - settings: { - "other-string-setting": null - }, - options: { - schema: "net.gpii.testing.gsettings.multi-get2" - } + } + ] + } +}; + +var get1 = { + request: { + "getreq": [ + { + settings: { + "double-setting": null, + "boolean-setting": null, + "string-setting": null + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get1" } - ] - }, - expected: { - "getreq": [ - { - settings: { - "double-setting": 5.0, - "boolean-setting": false, - "string-setting": "abcdefg" - } - }, { - settings: { - "other-string-setting": "hello world" - } + }, { + settings: { + "other-string-setting": null + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get2" } - ] - } - }; - - // http://issues.gpii.net/browse/GPII-8 - var gpii8 = { - request: { - "putreq": [ - { - settings: { - "double-setting-doesnt-exist": 3.1, - "boolean-setting": true, - "string-setting": "here i am" - }, - options: { - schema: "net.gpii.testing.gsettings.multi-set1" - } + } + ] + }, + expected: { + "getreq": [ + { + settings: { + "double-setting": 5.0, + "boolean-setting": false, + "string-setting": "abcdefg" } - ] - } - }; - - jqUnit.module("Gsettings Handler Tests"); - - jqUnit.test("Getting single keys via gsettings handler", function () { - // First check reading single keys ... the default values: - jqUnit.assertEquals("Checking 'double' key", 5.0, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "double-setting")); - jqUnit.assertEquals("Checking 'boolean' key", false, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); - jqUnit.assertEquals("Checking 'string' key", "abcdefg", - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); - }); - - - jqUnit.test("Setting single keys via gsettings handler", function () { - // set and check double value - gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "double-setting", 6.789); - jqUnit.assertEquals("Checking 'double' key", 6.789, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "double-setting")); - // set and check boolean value - gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting", true); - jqUnit.assertEquals("Checking 'boolean' key", true, - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting")); - // set and check string value - gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); - jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", - gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); - }); - - jqUnit.test("Setting multiple keys", function () { - var response = gpii.gsettings.set(put1.request); - jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put1.expected, response); - }); - - jqUnit.test("Setting multiple keys in multiple schemas", function () { - var response = gpii.gsettings.set(put2.request); - jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put2.expected, response); - }); - - jqUnit.test("Getting multiple keys in multiple schemas", function () { - var response = gpii.gsettings.get(get1.request); - jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get1.expected, response); - }); - - jqUnit.test("Getting multiple keys with settings block as null", function () { - var response = gpii.gsettings.get(get2.request); - jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get2.expected, response); - }); - - jqUnit.test("GPII-8 Not core dumping on a non-existent key", function () { - var response = gpii.gsettings.set(gpii8.request); - jqUnit.assertValue("Didn't core dump.", response); - }); - -}()); + }, { + settings: { + "other-string-setting": "hello world" + } + } + ] + } +}; + +var get2 = { + request: { + "getreq": [ + { + settings: null, + options: { + schema: "net.gpii.testing.gsettings.multi-get1" + } + }, { + settings: { + "other-string-setting": null + }, + options: { + schema: "net.gpii.testing.gsettings.multi-get2" + } + } + ] + }, + expected: { + "getreq": [ + { + settings: { + "double-setting": 5.0, + "boolean-setting": false, + "string-setting": "abcdefg" + } + }, { + settings: { + "other-string-setting": "hello world" + } + } + ] + } +}; + +// http://issues.gpii.net/browse/GPII-8 +var gpii8 = { + request: { + "putreq": [ + { + settings: { + "double-setting-doesnt-exist": 3.1, + "boolean-setting": true, + "string-setting": "here i am" + }, + options: { + schema: "net.gpii.testing.gsettings.multi-set1" + } + } + ] + } +}; + +jqUnit.module("Gsettings Handler Tests"); + +jqUnit.test("Getting single keys via gsettings handler", function () { + // First check reading single keys ... the default values: + jqUnit.assertEquals("Checking 'double' key", 5.0, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "double-setting")); + jqUnit.assertEquals("Checking 'boolean' key", false, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); + jqUnit.assertEquals("Checking 'string' key", "abcdefg", + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); +}); + + +jqUnit.test("Setting single keys via gsettings handler", function () { + // set and check double value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "double-setting", 6.789); + jqUnit.assertEquals("Checking 'double' key", 6.789, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "double-setting")); + // set and check boolean value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting", true); + jqUnit.assertEquals("Checking 'boolean' key", true, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "boolean-setting")); + // set and check string value + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); + jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); +}); + +jqUnit.test("Setting multiple keys", function () { + var response = gpii.gsettings.set(put1.request); + jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put1.expected, response); +}); + +jqUnit.test("Setting multiple keys in multiple schemas", function () { + var response = gpii.gsettings.set(put2.request); + jqUnit.assertDeepEq("The values should be set and expected payload returned: ", put2.expected, response); +}); + +jqUnit.test("Getting multiple keys in multiple schemas", function () { + var response = gpii.gsettings.get(get1.request); + jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get1.expected, response); +}); + +jqUnit.test("Getting multiple keys with settings block as null", function () { + var response = gpii.gsettings.get(get2.request); + jqUnit.assertDeepEq("The correct values is expected in the returned payload: ", get2.expected, response); +}); + +jqUnit.test("GPII-8 Not core dumping on a non-existent key", function () { + var response = gpii.gsettings.set(gpii8.request); + jqUnit.assertValue("Didn't core dump.", response); +}); diff --git a/gpii/node_modules/orca/index.js b/gpii/node_modules/orca/index.js index eb8ab8f..07055cf 100644 --- a/gpii/node_modules/orca/index.js +++ b/gpii/node_modules/orca/index.js @@ -15,4 +15,6 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ +"use strict"; + require("./orcaSettingsHandler.js"); diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 157593f..ad65e71 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -15,188 +15,187 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ -(function () { - "use strict"; - - var fluid = require("universal"); - var gpii = fluid.registerNamespace("gpii"); - var fs = require("fs"); - var spawn = require("child_process").spawn; - var path = require("path"); - - var HOME = process.env.HOME; - var XDG_DATA_HOME = process.env.XDG_DATA_HOME || path.resolve(HOME, ".local/share"); - var orcaSettingsFile = path.resolve(XDG_DATA_HOME, "orca/user-settings.conf"); - - var ORCA_ARGS = ["--disable", "speech", - "--disable", "braille", - "--disable", "braille-monitor", - "--disable", "main-window", - "--disable", "splash-window"]; - - // When Orca is referencing a profile in a setting, it uses an array - // containing the profile's name and id. - // ie: startingProfile: ["Default", "default"] - // - // But profiles are stored in the 'profiles' section as an object, - // which main key equals to the profile's id. As we need to retrieve a - // specific profile under 'profiles' section, we need to get the second - // value (the id) from the array. - // - var PROFILE_ID = 1; - - fluid.registerNamespace("gpii.orca"); - - fluid.defaults("gpii.orca.settingsHandler", { - gradeNames: ["fluid.component"], - invokers: { - get: { - funcName: "gpii.orca.settingsHandler.get", - args: ["{that}", "{arguments}.0"] - }, - set: { - funcName: "gpii.orca.settingsHandler.set", - args: ["{that}", "{arguments}.0"] - }, - getImpl: { - funcName: "gpii.orca.settingsHandler.getImpl", - args: ["{that}", "{arguments}.0"] - }, - setImpl: { - funcName: "gpii.orca.settingsHandler.setImpl", - args: ["{that}", "{arguments}.0"] - }, - getSettings: { - funcName: "gpii.orca.settingsHandler.getSettings", - args: ["{that}", "{arguments}.0", "{arguments}.1"] - }, - setSettings: { - funcName: "gpii.orca.settingsHandler.setSettings", - args: ["{that}", "{arguments}.0"] - }, - makeConfigurable: { - funcName: "gpii.orca.settingsHandler.makeConfigurable" - }, - loadSettings: { - funcName: "gpii.orca.settingsHandler.loadSettings", - args: "{that}" - } - } - }); - gpii.orca.settingsHandler.loadSettings = function (that) { - var togo = fluid.promise(); +"use strict"; + +var fluid = require("universal"); +var gpii = fluid.registerNamespace("gpii"); +var fs = require("fs"); +var spawn = require("child_process").spawn; +var path = require("path"); + +var HOME = process.env.HOME; +var XDG_DATA_HOME = process.env.XDG_DATA_HOME || path.resolve(HOME, ".local/share"); +var orcaSettingsFile = path.resolve(XDG_DATA_HOME, "orca/user-settings.conf"); + +var ORCA_ARGS = ["--disable", "speech", + "--disable", "braille", + "--disable", "braille-monitor", + "--disable", "main-window", + "--disable", "splash-window"]; + +// When Orca is referencing a profile in a setting, it uses an array +// containing the profile's name and id. +// ie: startingProfile: ["Default", "default"] +// +// But profiles are stored in the 'profiles' section as an object, +// which main key equals to the profile's id. As we need to retrieve a +// specific profile under 'profiles' section, we need to get the second +// value (the id) from the array. +// +var PROFILE_ID = 1; + +fluid.registerNamespace("gpii.orca"); + +fluid.defaults("gpii.orca.settingsHandler", { + gradeNames: ["fluid.component"], + invokers: { + get: { + funcName: "gpii.orca.settingsHandler.get", + args: ["{that}", "{arguments}.0"] + }, + set: { + funcName: "gpii.orca.settingsHandler.set", + args: ["{that}", "{arguments}.0"] + }, + getImpl: { + funcName: "gpii.orca.settingsHandler.getImpl", + args: ["{that}", "{arguments}.0"] + }, + setImpl: { + funcName: "gpii.orca.settingsHandler.setImpl", + args: ["{that}", "{arguments}.0"] + }, + getSettings: { + funcName: "gpii.orca.settingsHandler.getSettings", + args: ["{that}", "{arguments}.0", "{arguments}.1"] + }, + setSettings: { + funcName: "gpii.orca.settingsHandler.setSettings", + args: ["{that}", "{arguments}.0"] + }, + makeConfigurable: { + funcName: "gpii.orca.settingsHandler.makeConfigurable" + }, + loadSettings: { + funcName: "gpii.orca.settingsHandler.loadSettings", + args: "{that}" + } + } +}); - var performRead = function () { - try { - var userSettings = fs.readFileSync(orcaSettingsFile); - togo.resolve(JSON.parse(userSettings)); - } catch (err) { - var rej = { - isError: true, - message: "Unable to read Orca settings file: " + err - }; - togo.reject(rej); - } - }; +gpii.orca.settingsHandler.loadSettings = function (that) { + var togo = fluid.promise(); + var performRead = function () { try { - fs.statSync(orcaSettingsFile); - performRead(); + var userSettings = fs.readFileSync(orcaSettingsFile); + togo.resolve(JSON.parse(userSettings)); } catch (err) { - var makeConfigurable = that.makeConfigurable(); - makeConfigurable.then(function () { - performRead(); - }, function (err) { - togo.reject(err); - }); + var rej = { + isError: true, + message: "Unable to read Orca settings file: " + err + }; + togo.reject(rej); } - - return togo; }; - gpii.orca.settingsHandler.makeConfigurable = function () { - var togo = fluid.promise(); - - var orcaSpawn = spawn("orca", ORCA_ARGS); - var pass = 0; - var maxPass = 10; - - var checkIfFileGetsCreated = function () { - pass++; - if (pass === maxPass) { + try { + fs.statSync(orcaSettingsFile); + performRead(); + } catch (err) { + var makeConfigurable = that.makeConfigurable(); + makeConfigurable.then(function () { + performRead(); + }, function (err) { + togo.reject(err); + }); + } + + return togo; +}; + +gpii.orca.settingsHandler.makeConfigurable = function () { + var togo = fluid.promise(); + + var orcaSpawn = spawn("orca", ORCA_ARGS); + var pass = 0; + var maxPass = 10; + + var checkIfFileGetsCreated = function () { + pass++; + if (pass === maxPass) { + orcaSpawn.kill("SIGKILL"); + var err = "Time limit exceeded [" + maxPass * 500 + + "ms] for creating Orca's configuration file"; + var rej = { + isError: true, + message: err + }; + togo.reject(rej); + } else { + try { + fs.statSync(orcaSettingsFile); orcaSpawn.kill("SIGKILL"); - var err = "Time limit exceeded [" + maxPass * 500 + - "ms] for creating Orca's configuration file"; - var rej = { - isError: true, - message: err - }; - togo.reject(rej); - } else { - try { - fs.statSync(orcaSettingsFile); - orcaSpawn.kill("SIGKILL"); - togo.resolve(); - } catch (err) { - gpii.invokeLater(checkIfFileGetsCreated, 500); - } + togo.resolve(); + } catch (err) { + gpii.invokeLater(checkIfFileGetsCreated, 500); } - }; - - gpii.invokeLater(checkIfFileGetsCreated, 500); - return togo; + } }; - gpii.orca.settingsHandler.getSettings = function (that, payload) { - var loadSettings = that.loadSettings(); - return fluid.promise.map(loadSettings, function (userSettings) { - var profile = userSettings.general.activeProfile[PROFILE_ID]; - var results = fluid.transform(payload.settings, function (value, key) { - var currentValue = fluid.get(userSettings, ["profiles", profile, key]); - return currentValue; - }); - return results; + gpii.invokeLater(checkIfFileGetsCreated, 500); + return togo; +}; + +gpii.orca.settingsHandler.getSettings = function (that, payload) { + var loadSettings = that.loadSettings(); + return fluid.promise.map(loadSettings, function (userSettings) { + var profile = userSettings.general.activeProfile[PROFILE_ID]; + var results = fluid.transform(payload.settings, function (value, key) { + var currentValue = fluid.get(userSettings, ["profiles", profile, key]); + return currentValue; }); - }; - - gpii.orca.settingsHandler.setSettings = function (that, payload) { - var loadSettings = that.loadSettings(); - return fluid.promise.map(loadSettings, function (userSettings) { - var profile = userSettings.general.activeProfile[PROFILE_ID]; - var results = fluid.transform(payload.settings, function (value, key) { - var oldValue = fluid.get(userSettings, ["profiles", profile, key]); - fluid.set(userSettings, ["profiles", profile, key], value); - var newValue = fluid.get(userSettings, ["profiles", profile, key]); - return { - oldValue: oldValue, - newValue: newValue - }; - }); - fs.writeFileSync(orcaSettingsFile, JSON.stringify(userSettings, null, 4)); - return results; + return results; + }); +}; + +gpii.orca.settingsHandler.setSettings = function (that, payload) { + var loadSettings = that.loadSettings(); + return fluid.promise.map(loadSettings, function (userSettings) { + var profile = userSettings.general.activeProfile[PROFILE_ID]; + var results = fluid.transform(payload.settings, function (value, key) { + var oldValue = fluid.get(userSettings, ["profiles", profile, key]); + fluid.set(userSettings, ["profiles", profile, key], value); + var newValue = fluid.get(userSettings, ["profiles", profile, key]); + return { + oldValue: oldValue, + newValue: newValue + }; }); - }; + fs.writeFileSync(orcaSettingsFile, JSON.stringify(userSettings, null, 4)); + return results; + }); +}; - gpii.orca.settingsHandler.getImpl = function (that, payload) { - return that.getSettings(payload); - }; +gpii.orca.settingsHandler.getImpl = function (that, payload) { + return that.getSettings(payload); +}; - gpii.orca.settingsHandler.setImpl = function (that, payload) { - return that.setSettings(payload); - }; +gpii.orca.settingsHandler.setImpl = function (that, payload) { + return that.setSettings(payload); +}; - gpii.orca.settingsHandler.get = function (that, payload) { - return gpii.settingsHandlers.invokeSettingsHandler(that.getImpl, payload); - }; +gpii.orca.settingsHandler.get = function (that, payload) { + return gpii.settingsHandlers.invokeSettingsHandler(that.getImpl, payload); +}; - gpii.orca.settingsHandler.set = function (that, payload) { - return gpii.settingsHandlers.invokeSettingsHandler(that.setImpl, payload); - }; +gpii.orca.settingsHandler.set = function (that, payload) { + return gpii.settingsHandlers.invokeSettingsHandler(that.setImpl, payload); +}; - var orcaSettingsHandler = gpii.orca.settingsHandler(); +var orcaSettingsHandler = gpii.orca.settingsHandler(); - gpii.orca.get = orcaSettingsHandler.get; - gpii.orca.set = orcaSettingsHandler.set; +gpii.orca.get = orcaSettingsHandler.get; +gpii.orca.set = orcaSettingsHandler.set; -})(); diff --git a/gpii/node_modules/packagekit/index.js b/gpii/node_modules/packagekit/index.js index 7d248e0..a614152 100644 --- a/gpii/node_modules/packagekit/index.js +++ b/gpii/node_modules/packagekit/index.js @@ -10,6 +10,8 @@ * https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; + var fluid = require("universal"); require("./packageKitDeviceReporter.js"); diff --git a/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js b/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js index 753ae6a..7cf7f7b 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js +++ b/gpii/node_modules/packagekit/nodepackagekit/findSearchPk.js @@ -75,82 +75,79 @@ packages found. */ -(function () { +"use strict"; - "use strict"; +var packagekit = require("./build/Release/nodepackagekit.node"); - var packagekit = require("./build/Release/nodepackagekit.node"); +var lookingFor = process.argv[2]; - var lookingFor = process.argv[2]; +// Record the files found by 'find', and possibly related packages. +var whatFindFound = []; +var packages = []; - // Record the files found by 'find', and possibly related packages. - var whatFindFound = []; - var packages = []; +// Use package kit add-on to get version of the software. +// - searchNotInstalled() is used when 'find' found nothing. +// - searchInstalled() is used when 'find' found something. +function searchNotInstalled() { + packages = packagekit.searchPackage(lookingFor, "~installed;basename"); +} - // Use package kit add-on to get version of the software. - // - searchNotInstalled() is used when 'find' found nothing. - // - searchInstalled() is used when 'find' found something. - function searchNotInstalled() { - packages = packagekit.searchPackage(lookingFor, "~installed;basename"); +function searchInstalled() { + packages = packagekit.searchFiles(whatFindFound); + if (packages.length === 0) { + packages = packagekit.searchPackage(lookingFor, "installed;basename"); } +} - function searchInstalled() { - packages = packagekit.searchFiles(whatFindFound); - if (packages.length === 0) { - packages = packagekit.searchPackage(lookingFor, "installed;basename"); - } - } +// Handle 'find' on close event -- invoke packagekit.searchPackage(). +function onFindClose() { + console.log("'find' found " + + (whatFindFound.length === 0 ? "nothing" : whatFindFound)); - // Handle 'find' on close event -- invoke packagekit.searchPackage(). - function onFindClose() { - console.log("'find' found " + - (whatFindFound.length === 0 ? "nothing" : whatFindFound)); - - if (whatFindFound.length === 0) { + if (whatFindFound.length === 0) { + searchNotInstalled(); + } + else { + searchInstalled(); + if (packages.length === 0) { searchNotInstalled(); } - else { - searchInstalled(); - if (packages.length === 0) { - searchNotInstalled(); - } - } - if (packages.length > 0) { - console.log(JSON.stringify(packages, null, " ")); - } - else { - console.log("No package found"); - } } - - function onFindStdout(data) { - var found = data.toString().split("\n"); - found.forEach(function (value) { - if (value.length > 0) { - whatFindFound.push(value); - } - }); + if (packages.length > 0) { + console.log(JSON.stringify(packages, null, " ")); } - - if (lookingFor !== undefined) { - var findArgs = process.env.PATH.split(":"); - findArgs.push(process.env.HOME); - findArgs.push("-name"); - findArgs.push(lookingFor); - findArgs.push("-type"); - findArgs.push("f"); // only regular files. - findArgs.push("-print"); - - // Run 'find' - var spawn = require("child_process").spawn, - find = spawn("find", findArgs); - - find.stdout.on("data", onFindStdout); - - find.on("close", onFindClose); - - find.on("error", function (err) { - console.log("child process : " + err); - }); + else { + console.log("No package found"); } -}()); +} + +function onFindStdout(data) { + var found = data.toString().split("\n"); + found.forEach(function (value) { + if (value.length > 0) { + whatFindFound.push(value); + } + }); +} + +if (lookingFor !== undefined) { + var findArgs = process.env.PATH.split(":"); + findArgs.push(process.env.HOME); + findArgs.push("-name"); + findArgs.push(lookingFor); + findArgs.push("-type"); + findArgs.push("f"); // only regular files. + findArgs.push("-print"); + + // Run 'find' + var spawn = require("child_process").spawn, + find = spawn("find", findArgs); + + find.stdout.on("data", onFindStdout); + + find.on("close", onFindClose); + + find.on("error", function (err) { + console.log("child process : " + err); + }); +} diff --git a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js index 5903c4e..df58763 100644 --- a/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js +++ b/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js @@ -12,270 +12,266 @@ You may obtain a copy of the License at https://github.com/gpii/universal/LICENSE.txt */ +"use strict"; + var fluid = require("universal"), jqUnit = fluid.require("node-jqunit"), + gpii = fluid.registerNamespace("gpii"), packagekit = require("./build/Release/nodepackagekit.node"); -(function () { - - "use strict"; - - var pkTests = fluid.registerNamespace("gpii.tests.packageKit"); - - pkTests.isInstalled = function (pkg) { - return (!!pkg && (pkg.data.indexOf("installed") !== -1)); - }; - - pkTests.findGlib2 = function (aPkg) { - return aPkg.name === "glib2"; - }; - - pkTests.findPackageByName = function (name, pkgArray) { - return fluid.find(pkgArray, function (aPkg) { - if (aPkg.name === name) { - return aPkg; - } - }, null); - }; - - // Return the package that matches name, version, and architecture. - pkTests.getMatchingPackage = function (pkg, pkgList) { - return fluid.find(pkgList, function (aPkg) { - if (aPkg.name === pkg.name && - aPkg.version === pkg.version && - aPkg.arch === pkg.arch) { - return aPkg; - } - }, null); - }; - - pkTests.initTuxguitar = function () { - var tuxguitar = { - pkgList: [], - pkg: null, - inInstalledList: false, - inAvailableList: false - }; - var pkgs = packagekit.searchPackage("tuxguitar"); - tuxguitar.pkgList = pkgs; - tuxguitar.pkg = pkTests.findPackageByName("tuxguitar", pkgs); - return tuxguitar; - }; - - pkTests.isTuxguitarInList = function (tuxguitar, pkgList) { - var matchPkg = pkTests.getMatchingPackage(tuxguitar.pkg, pkgList); - return (matchPkg !== null); - }; - - // GPII-1081: compensate for change in PackageKit between v0.8.17 and - // v1.0.3. In the later version, even when installed, the same package - // appears in the list of available packages. In v0.8.17 it did not. - // - pkTests.availableNotInstalled = function (tuxguitar, availablePkgs) { - var isAvailable = pkTests.isTuxguitarInList(tuxguitar, availablePkgs); - if (tuxguitar.inInstalledList && isAvailable) { - var installedMatchesAvailablePkg = - pkTests.getMatchingPackage(tuxguitar.pkg, availablePkgs); - - if (installedMatchesAvailablePkg !== null) { - tuxguitar.inAvailableList = false; - } - else { - tuxguitar.inAvailableList = true; - } - } - else { - tuxguitar.inAvailableList = isAvailable; - } - }; - - pkTests.initSearchTest = function () { - var tuxguitar = pkTests.initTuxguitar(); - var installedPkgs = packagekit.searchPackage("tuxguitar", "installed"); - tuxguitar.inInstalledList = - pkTests.isTuxguitarInList(tuxguitar, installedPkgs); +fluid.registerNamespace("gpii.tests.packageKit"); - var availablePkgs = packagekit.searchPackage("tuxguitar", "~installed"); - pkTests.availableNotInstalled(tuxguitar, availablePkgs); +gpii.tests.packageKit.isInstalled = function (pkg) { + return (!!pkg && (pkg.data.indexOf("installed") !== -1)); +}; - return tuxguitar; - }; - - pkTests.initGetTest = function () { - var tuxguitar = pkTests.initTuxguitar(); - var installedPkgs = packagekit.getPackages("installed"); - tuxguitar.inInstalledList = - pkTests.isTuxguitarInList(tuxguitar, installedPkgs); - - var availablePkgs = packagekit.getPackages("~installed"); - pkTests.availableNotInstalled(tuxguitar, availablePkgs); +gpii.tests.packageKit.findGlib2 = function (aPkg) { + return aPkg.name === "glib2"; +}; - return tuxguitar; - }; - - pkTests.runInstalledVsAvailableTests = function (tuxguitar, msg) { - // Depending on whether tuxguitar is installed on not, check that it - // appears correctly in the installed or available lists. - if (pkTests.isInstalled(tuxguitar.pkg)) { - jqUnit.assertTrue(msg + " 'tuxguitar' in installed packages list", - tuxguitar.inInstalledList); - jqUnit.assertFalse(msg + " 'tuxguitar' not in available packages " + - "list", tuxguitar.inAvailableList); +gpii.tests.packageKit.findPackageByName = function (name, pkgArray) { + return fluid.find(pkgArray, function (aPkg) { + if (aPkg.name === name) { + return aPkg; } - else { - jqUnit.assertFalse(msg + " 'tuxguitar' not in installed packages " + - "list", tuxguitar.inInstalledList); - jqUnit.assertTrue(msg + " 'tuxguitar' is in available packages list", - tuxguitar.inAvailableList); + }, null); +}; + +// Return the package that matches name, version, and architecture. +gpii.tests.packageKit.getMatchingPackage = function (pkg, pkgList) { + return fluid.find(pkgList, function (aPkg) { + if (aPkg.name === pkg.name && + aPkg.version === pkg.version && + aPkg.arch === pkg.arch) { + return aPkg; } + }, null); +}; + +gpii.tests.packageKit.initTuxguitar = function () { + var tuxguitar = { + pkgList: [], + pkg: null, + inInstalledList: false, + inAvailableList: false }; - - pkTests.searchForMatch = function (tuxguitar, searchFilter) { - var pkgs = packagekit.searchPackage("tuxguitar", searchFilter); - return pkTests.getMatchingPackage(tuxguitar.pkg, pkgs); - }; - - pkTests.testRemovePackage = function (tuxguitar, matchPkg) { - var id = (matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); - - // GPII-880: The 'remove' action requires an administrator password. - // Packagekit invokes PolKit authentication, putting up a dialog to - // capture aforesaid password. This needs to be automated. - packagekit.performAction("remove", id); - matchPkg = pkTests.searchForMatch(tuxguitar, "~installed"); - jqUnit.assertNotNull("Remove tuxguitar package", matchPkg); - return matchPkg; - }; - - pkTests.testInstallPackage = function (tuxguitar, matchPkg) { - var id = (matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); - packagekit.performAction("install", id); - matchPkg = pkTests.searchForMatch(tuxguitar, "installed"); - jqUnit.assertNotNull("Install tuxguitar package", matchPkg); - return matchPkg; - }; - - pkTests.testPerformActionFailure = function () { - var errMsg = "No Error Message"; - try { - packagekit.performAction("foo", "bar"); - } - catch (error) { - errMsg = error.message; - } - return errMsg; - }; - - jqUnit.module("PackageKit Bridge node add-on module"); - - jqUnit.test( - "Test searchPackage() of 'glib2' with implicit 'none' filter, meaning " + - "installed or available.", function () { - - // Packagekit-glib -- the code this add-on invokes -- itself depends on - // glib2. It must be installed, if this is running. - var pkgs = packagekit.searchPackage("glib2"); - var found = pkgs.some(pkTests.findGlib2); - jqUnit.assertTrue("Search 'glib2', implicit 'none' filter", found); - }); - - jqUnit.test( - "Test searchPackage() 'glib2' with explicit 'none' filter.", function () { - - var pkgs = packagekit.searchPackage("glib2", "none"); - var found = pkgs.some(pkTests.findGlib2); - jqUnit.assertTrue("Search 'glib2', explicit 'none' filter", found); - }); - - jqUnit.test("Test searchFiles() for '/usr/bin/ls'.", function () { - - // The searchFiles() function expects the full path name where the package - // would be installed, even it if is not installed. Check using the - // common utility 'ls'. - var pkgs = packagekit.searchFiles("/usr/bin/ls"); - jqUnit.assertNotEquals( - "Search file '/usr/bin/ls', implicit 'none' filter", 0, pkgs.length - ); - jqUnit.assertTrue("'ls' is installed", pkTests.isInstalled(pkgs[0])); - }); - - jqUnit.test("Test searchPackage() with 'tuxguitar' comparing installed " + - "vs. available filters.", function () { - - // Test the "installed" vs. "~installed" filters with regards to - // 'tuxguitar', and the array of packages returned by searchPackage() - // using the filters. Use the tuxguitar package, whether installed or - // not, to test against the two arrays. - var tuxguitar = pkTests.initSearchTest(); - pkTests.runInstalledVsAvailableTests(tuxguitar, "Search"); - }); - - jqUnit.test("Test getPackages() with tuxguitar comparing installed vs. " + - "available filters.", function () { - var tuxguitar = pkTests.initGetTest(); - pkTests.runInstalledVsAvailableTests(tuxguitar, "Get"); - }); - - jqUnit.test("Test performAction(): 'install' and 'remove' tuxguitar." + - " The order depends on whether tuxguitar is currently " + - "installed.", function () { - - // GPII-880: The 'remove' test requires an administrator password. - // Packagekit invokes PolKit authentication, putting up a dialog to - // capture aforesaid password. This needs to be automated. - - // Using the tuxguitar package: If it's installed, test removing it and - // then (re)install it ... - var matchPkg; - var tuxguitar = pkTests.initTuxguitar(); - if (pkTests.isInstalled(tuxguitar.pkg)) { - matchPkg = pkTests.testRemovePackage(tuxguitar, null); - pkTests.testInstallPackage(tuxguitar, matchPkg); - } - // ...if it isn't installed, test installing it and then removing it. - else { - matchPkg = pkTests.testInstallPackage(tuxguitar, null); - pkTests.testRemovePackage(tuxguitar, matchPkg); - } - }); - - jqUnit.test("Test performAction() with invalid argments", function () { - var errorMessage = pkTests.testPerformActionFailure(); - jqUnit.assertEquals( - "Result of ThrowError():", - "You have to provide the action to be performed, either " + - "'install', 'update' or 'remove'", - errorMessage - ); - }); - - jqUnit.test("Test updatePackage(): with 'emacspeak'", function () { - - // The package ids of an old and newer version of 'emacspeak'. - // TODO: JS: While the following check against two version of - // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, - // the check that searchPackage() finds the two versions. If so, the test - // is run; otherwise no test is run. Need to find a better way to find - // multiple versions of a package to test against. - var oldEmacspeak = "38.0-5.fc20"; - var newEmacspeak = "39.0-1.fc20"; - var pkgs = packagekit.searchPackage("emacspseak"); - if (pkgs.length === 2 && - (pkgs[0].version === oldEmacspeak && - pkgs[1].version === newEmacspeak && - pkgs[1].data.indexOf("updates") !== -1)) { - - packagekit.updatePackage(pkgs[1].id); - var currentPkgs = packagekit.searchPackage("emacspseak", "installed"); - jqUnit.assertEquals("Updating to " + newEmacspeak, - currentPkgs[0].version, newEmacspeak); - - // Restore to previous. - packagekit.removePackage(currentPkgs[0].id); + var pkgs = packagekit.searchPackage("tuxguitar"); + tuxguitar.pkgList = pkgs; + tuxguitar.pkg = gpii.tests.packageKit.findPackageByName("tuxguitar", pkgs); + return tuxguitar; +}; + +gpii.tests.packageKit.isTuxguitarInList = function (tuxguitar, pkgList) { + var matchPkg = gpii.tests.packageKit.getMatchingPackage(tuxguitar.pkg, pkgList); + return (matchPkg !== null); +}; + +// GPII-1081: compensate for change in PackageKit between v0.8.17 and +// v1.0.3. In the later version, even when installed, the same package +// appears in the list of available packages. In v0.8.17 it did not. +// +gpii.tests.packageKit.availableNotInstalled = function (tuxguitar, availablePkgs) { + var isAvailable = gpii.tests.packageKit.isTuxguitarInList(tuxguitar, availablePkgs); + if (tuxguitar.inInstalledList && isAvailable) { + var installedMatchesAvailablePkg = + gpii.tests.packageKit.getMatchingPackage(tuxguitar.pkg, availablePkgs); + + if (installedMatchesAvailablePkg !== null) { + tuxguitar.inAvailableList = false; } else { - jqUnit.assertTrue("Cannot test update of emacspeak as there are no " + - "updates", true); + tuxguitar.inAvailableList = true; } - }); -}()); + } + else { + tuxguitar.inAvailableList = isAvailable; + } +}; + +gpii.tests.packageKit.initSearchTest = function () { + var tuxguitar = gpii.tests.packageKit.initTuxguitar(); + var installedPkgs = packagekit.searchPackage("tuxguitar", "installed"); + tuxguitar.inInstalledList = + gpii.tests.packageKit.isTuxguitarInList(tuxguitar, installedPkgs); + + var availablePkgs = packagekit.searchPackage("tuxguitar", "~installed"); + gpii.tests.packageKit.availableNotInstalled(tuxguitar, availablePkgs); + + return tuxguitar; +}; + +gpii.tests.packageKit.initGetTest = function () { + var tuxguitar = gpii.tests.packageKit.initTuxguitar(); + var installedPkgs = packagekit.getPackages("installed"); + tuxguitar.inInstalledList = + gpii.tests.packageKit.isTuxguitarInList(tuxguitar, installedPkgs); + + var availablePkgs = packagekit.getPackages("~installed"); + gpii.tests.packageKit.availableNotInstalled(tuxguitar, availablePkgs); + + return tuxguitar; +}; + +gpii.tests.packageKit.runInstalledVsAvailableTests = function (tuxguitar, msg) { + // Depending on whether tuxguitar is installed on not, check that it + // appears correctly in the installed or available lists. + if (gpii.tests.packageKit.isInstalled(tuxguitar.pkg)) { + jqUnit.assertTrue(msg + " 'tuxguitar' in installed packages list", + tuxguitar.inInstalledList); + jqUnit.assertFalse(msg + " 'tuxguitar' not in available packages " + + "list", tuxguitar.inAvailableList); + } + else { + jqUnit.assertFalse(msg + " 'tuxguitar' not in installed packages " + + "list", tuxguitar.inInstalledList); + jqUnit.assertTrue(msg + " 'tuxguitar' is in available packages list", + tuxguitar.inAvailableList); + } +}; + +gpii.tests.packageKit.searchForMatch = function (tuxguitar, searchFilter) { + var pkgs = packagekit.searchPackage("tuxguitar", searchFilter); + return gpii.tests.packageKit.getMatchingPackage(tuxguitar.pkg, pkgs); +}; + +gpii.tests.packageKit.testRemovePackage = function (tuxguitar, matchPkg) { + var id = (matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); + + // GPII-880: The 'remove' action requires an administrator password. + // Packagekit invokes PolKit authentication, putting up a dialog to + // capture aforesaid password. This needs to be automated. + packagekit.performAction("remove", id); + matchPkg = gpii.tests.packageKit.searchForMatch(tuxguitar, "~installed"); + jqUnit.assertNotNull("Remove tuxguitar package", matchPkg); + return matchPkg; +}; + +gpii.tests.packageKit.testInstallPackage = function (tuxguitar, matchPkg) { + var id = (matchPkg !== null ? matchPkg.id : tuxguitar.pkg.id); + packagekit.performAction("install", id); + matchPkg = gpii.tests.packageKit.searchForMatch(tuxguitar, "installed"); + jqUnit.assertNotNull("Install tuxguitar package", matchPkg); + return matchPkg; +}; + +gpii.tests.packageKit.testPerformActionFailure = function () { + var errMsg = "No Error Message"; + try { + packagekit.performAction("foo", "bar"); + } + catch (error) { + errMsg = error.message; + } + return errMsg; +}; + +jqUnit.module("PackageKit Bridge node add-on module"); + +jqUnit.test( + "Test searchPackage() of 'glib2' with implicit 'none' filter, meaning " + + "installed or available.", function () { + + // Packagekit-glib -- the code this add-on invokes -- itself depends on + // glib2. It must be installed, if this is running. + var pkgs = packagekit.searchPackage("glib2"); + var found = pkgs.some(gpii.tests.packageKit.findGlib2); + jqUnit.assertTrue("Search 'glib2', implicit 'none' filter", found); +}); + +jqUnit.test("Test searchPackage() 'glib2' with explicit 'none' filter.", function () { + var pkgs = packagekit.searchPackage("glib2", "none"); + var found = pkgs.some(gpii.tests.packageKit.findGlib2); + jqUnit.assertTrue("Search 'glib2', explicit 'none' filter", found); +}); + +jqUnit.test("Test searchFiles() for '/usr/bin/ls'.", function () { + + // The searchFiles() function expects the full path name where the package + // would be installed, even it if is not installed. Check using the + // common utility 'ls'. + var pkgs = packagekit.searchFiles("/usr/bin/ls"); + jqUnit.assertNotEquals( + "Search file '/usr/bin/ls', implicit 'none' filter", 0, pkgs.length + ); + jqUnit.assertTrue("'ls' is installed", gpii.tests.packageKit.isInstalled(pkgs[0])); +}); + +jqUnit.test("Test searchPackage() with 'tuxguitar' comparing installed " + + "vs. available filters.", function () { + + // Test the "installed" vs. "~installed" filters with regards to + // 'tuxguitar', and the array of packages returned by searchPackage() + // using the filters. Use the tuxguitar package, whether installed or + // not, to test against the two arrays. + var tuxguitar = gpii.tests.packageKit.initSearchTest(); + gpii.tests.packageKit.runInstalledVsAvailableTests(tuxguitar, "Search"); +}); + +jqUnit.test("Test getPackages() with tuxguitar comparing installed vs. " + + "available filters.", function () { + var tuxguitar = gpii.tests.packageKit.initGetTest(); + gpii.tests.packageKit.runInstalledVsAvailableTests(tuxguitar, "Get"); +}); + +jqUnit.test("Test performAction(): 'install' and 'remove' tuxguitar." + + " The order depends on whether tuxguitar is currently " + + "installed.", function () { + + // GPII-880: The 'remove' test requires an administrator password. + // Packagekit invokes PolKit authentication, putting up a dialog to + // capture aforesaid password. This needs to be automated. + + // Using the tuxguitar package: If it's installed, test removing it and + // then (re)install it ... + var matchPkg; + var tuxguitar = gpii.tests.packageKit.initTuxguitar(); + if (gpii.tests.packageKit.isInstalled(tuxguitar.pkg)) { + matchPkg = gpii.tests.packageKit.testRemovePackage(tuxguitar, null); + gpii.tests.packageKit.testInstallPackage(tuxguitar, matchPkg); + } + // ...if it isn't installed, test installing it and then removing it. + else { + matchPkg = gpii.tests.packageKit.testInstallPackage(tuxguitar, null); + gpii.tests.packageKit.testRemovePackage(tuxguitar, matchPkg); + } +}); + +jqUnit.test("Test performAction() with invalid argments", function () { + var errorMessage = gpii.tests.packageKit.testPerformActionFailure(); + jqUnit.assertEquals( + "Result of ThrowError():", + "You have to provide the action to be performed, either " + + "'install', 'update' or 'remove'", + errorMessage + ); +}); + +jqUnit.test("Test updatePackage(): with 'emacspeak'", function () { + + // The package ids of an old and newer version of 'emacspeak'. + // TODO: JS: While the following check against two version of + // 'emacspeak' works on Fedora-20, it may not work on all distros; hence, + // the check that searchPackage() finds the two versions. If so, the test + // is run; otherwise no test is run. Need to find a better way to find + // multiple versions of a package to test against. + var oldEmacspeak = "38.0-5.fc20"; + var newEmacspeak = "39.0-1.fc20"; + var pkgs = packagekit.searchPackage("emacspseak"); + if (pkgs.length === 2 && + (pkgs[0].version === oldEmacspeak && + pkgs[1].version === newEmacspeak && + pkgs[1].data.indexOf("updates") !== -1)) { + + packagekit.updatePackage(pkgs[1].id); + var currentPkgs = packagekit.searchPackage("emacspseak", "installed"); + jqUnit.assertEquals("Updating to " + newEmacspeak, + currentPkgs[0].version, newEmacspeak); + + // Restore to previous. + packagekit.removePackage(currentPkgs[0].id); + } + else { + jqUnit.assertTrue("Cannot test update of emacspeak as there are no " + + "updates", true); + } +}); diff --git a/gpii/node_modules/packagekit/packageKitDeviceReporter.js b/gpii/node_modules/packagekit/packageKitDeviceReporter.js index e71d4b6..9ee2cf0 100644 --- a/gpii/node_modules/packagekit/packageKitDeviceReporter.js +++ b/gpii/node_modules/packagekit/packageKitDeviceReporter.js @@ -10,40 +10,38 @@ * https://github.com/gpii/universal/LICENSE.txt */ -(function () { - "use strict"; +"use strict"; - var fluid = require("universal"); - var gpii = fluid.registerNamespace("gpii"); - var packageKit = require("./nodepackagekit/build/Release/nodepackagekit.node"); +var fluid = require("universal"); +var gpii = fluid.registerNamespace("gpii"); +var packageKit = require("./nodepackagekit/build/Release/nodepackagekit.node"); - fluid.registerNamespace("gpii.packageKit"); +fluid.registerNamespace("gpii.packageKit"); - fluid.defaults("gpii.packageKit.get", { - gradeNames: "fluid.function", - argumentMap: { - filters: 0 - } - }); +fluid.defaults("gpii.packageKit.get", { + gradeNames: "fluid.function", + argumentMap: { + filters: 0 + } +}); - gpii.packageKit.get = function (filters) { - return { - "id": "gpii.packageKit", - "data": packageKit.getPackages(filters) - }; +gpii.packageKit.get = function (filters) { + return { + "id": "gpii.packageKit", + "data": packageKit.getPackages(filters) }; - - fluid.defaults("gpii.packageKit.find", { - gradeNames: "fluid.function", - argumentMap: { - name: 0 - } +}; + +fluid.defaults("gpii.packageKit.find", { + gradeNames: "fluid.function", + argumentMap: { + name: 0 + } +}); + +gpii.packageKit.find = function (name) { + return gpii.packageKit.installedPackagesCache.some(function (pkg) { + return pkg.name === name; }); +}; - gpii.packageKit.find = function (name) { - return gpii.packageKit.installedPackagesCache.some(function (pkg) { - return pkg.name === name; - }); - }; - -})(); diff --git a/gpii/node_modules/xrandr/index.js b/gpii/node_modules/xrandr/index.js index f120d37..2247284 100644 --- a/gpii/node_modules/xrandr/index.js +++ b/gpii/node_modules/xrandr/index.js @@ -14,4 +14,6 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ +"use strict"; + require("./xrandr_bridge.js"); diff --git a/gpii/node_modules/xrandr/xrandr_bridge.js b/gpii/node_modules/xrandr/xrandr_bridge.js index 10c4d5c..1ff6240 100644 --- a/gpii/node_modules/xrandr/xrandr_bridge.js +++ b/gpii/node_modules/xrandr/xrandr_bridge.js @@ -14,114 +14,110 @@ * https://github.com/GPII/universal/blob/master/LICENSE.txt */ -(function () { - "use strict"; - var fluid = require("universal"); - var gpii = fluid.registerNamespace("gpii"); - var xrandr = require("./nodexrandr/build/Release/nodexrandr.node"); +"use strict"; - fluid.registerNamespace("gpii.xrandr"); +var fluid = require("universal"); +var gpii = fluid.registerNamespace("gpii"); +var xrandr = require("./nodexrandr/build/Release/nodexrandr.node"); - fluid.defaults("gpii.xrandr.getScreenResolution", { - gradeNames: "fluid.function", - argumentMap: { - } - }); +fluid.registerNamespace("gpii.xrandr"); - fluid.defaults("gpii.xrandr.setScreenResolution", { - gradeNames: "fluid.function", - argumentMap: { - value: 0 - } - }); +fluid.defaults("gpii.xrandr.getScreenResolution", { + gradeNames: "fluid.function", + argumentMap: { + } +}); - gpii.xrandr.getScreenResolution = function () { - var displayInfo = xrandr.getDisplays(); - for (var i = 0; i < displayInfo.length; i++) { - if (displayInfo[i].status === "connected") { - break; - } - } +fluid.defaults("gpii.xrandr.setScreenResolution", { + gradeNames: "fluid.function", + argumentMap: { + value: 0 + } +}); - return { - width: displayInfo[i].resolution.width, - height: displayInfo[i].resolution.height - }; - }; +gpii.xrandr.getScreenResolution = function () { + var displayInfo = xrandr.getDisplays(); + var connectedDisplay = fluid.find_if(displayInfo, function (display) { + return display.status === "connected"; + }, displayInfo[0]); - gpii.xrandr.setScreenResolution = function (value) { - var current = gpii.xrandr.getScreenResolution(); - if (JSON.stringify(value) === JSON.stringify(current)) { - return true; - } else { - return xrandr.setScreenResolution(value.width, value.height); - } + return { + width: connectedDisplay.resolution.width, + height: connectedDisplay.resolution.height }; - - gpii.xrandr.allSettings = { - "screen-resolution": { - get: "gpii.xrandr.getScreenResolution", - set: "gpii.xrandr.setScreenResolution" +}; + +gpii.xrandr.setScreenResolution = function (value) { + var current = gpii.xrandr.getScreenResolution(); + if (JSON.stringify(value) === JSON.stringify(current)) { + return true; + } else { + return xrandr.setScreenResolution(value.width, value.height); + } +}; + +gpii.xrandr.allSettings = { + "screen-resolution": { + get: "gpii.xrandr.getScreenResolution", + set: "gpii.xrandr.setScreenResolution" + } +}; + +gpii.xrandr.getImpl = function (settingsRequest) { + settingsRequest = settingsRequest || gpii.xrandr.allSettings; + var settings = fluid.transform(settingsRequest, function (value, key) { + var funcEntry = gpii.xrandr.allSettings[key]; + if (funcEntry) { + return fluid.invokeGlobalFunction(funcEntry.get); + } else { + fluid.fail("Invalid key to Xrandr settings handler - " + + key + " - valid choices are " + JSON.stringify(fluid.keys(gpii.xrandr.allSettings))); } - }; - - gpii.xrandr.getImpl = function (settingsRequest) { - settingsRequest = settingsRequest || gpii.xrandr.allSettings; - var settings = fluid.transform(settingsRequest, function (value, key) { - var funcEntry = gpii.xrandr.allSettings[key]; - if (funcEntry) { - return fluid.invokeGlobalFunction(funcEntry.get); - } else { - fluid.fail("Invalid key to Xrandr settings handler - " + - key + " - valid choices are " + JSON.stringify(fluid.keys(gpii.xrandr.allSettings))); - } - }); - return settings; - }; + }); + return settings; +}; - gpii.xrandr.get = function (settingsarray) { - var app = fluid.copy(settingsarray); - for (var appId in app) { - for (var j = 0; j < app[appId].length; j++) { - var settings = gpii.xrandr.getImpl(app[appId][j].settings); +gpii.xrandr.get = function (settingsarray) { + var app = fluid.copy(settingsarray); + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var settings = gpii.xrandr.getImpl(app[appId][j].settings); - var noOptions = { settings: settings }; - app[appId][j] = noOptions; - } + var noOptions = { settings: settings }; + app[appId][j] = noOptions; } - return app; - }; - - gpii.xrandr.set = function (settingsarray) { - var app = fluid.copy(settingsarray); - for (var appId in app) { - for (var j = 0; j < app[appId].length; j++) { - var settings = app[appId][j].settings; - - for (var settingKey in settings) { - var value = settings[settingKey]; - - var oldValue; - if (settingKey === "screen-resolution") { - oldValue = gpii.xrandr.getScreenResolution(); - gpii.xrandr.setScreenResolution(value); - } else { - var err = "Invalid key: " + settingKey; - fluid.fail(err); - fluid.log(err); - } - - settings[settingKey] = { - "oldValue": oldValue, - "newValue": value - }; + } + return app; +}; + +gpii.xrandr.set = function (settingsarray) { + var app = fluid.copy(settingsarray); + for (var appId in app) { + for (var j = 0; j < app[appId].length; j++) { + var settings = app[appId][j].settings; + + for (var settingKey in settings) { + var value = settings[settingKey]; + + var oldValue; + if (settingKey === "screen-resolution") { + oldValue = gpii.xrandr.getScreenResolution(); + gpii.xrandr.setScreenResolution(value); + } else { + var err = "Invalid key: " + settingKey; + fluid.fail(err); + fluid.log(err); } - var noOptions = { settings: settings}; - app[appId][j] = noOptions; + + settings[settingKey] = { + "oldValue": oldValue, + "newValue": value + }; } + var noOptions = { settings: settings}; + app[appId][j] = noOptions; } - return app; - }; - -})(); + } + return app; +}; diff --git a/index.js b/index.js index 6e6114e..46e50c9 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,9 @@ * You may obtain a copy of the License at * https://github.com/GPII/universal/blob/master/LICENSE.txt */ - + +"use strict"; + var fluid = require("universal"); fluid.module.register("gpii-linux", __dirname, require); diff --git a/package.json b/package.json index 0aab046..5b984b5 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,19 @@ { "name": "gpii-linux", "description": "Components of the GPII personalization infrastructure for use on Linux", - "version": "1.0.0", + "version": "0.3.0", "author": "GPII", "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", - "dependencies": {}, + "dependencies": { + "universal": "git://github.com/GPII/universal.git#c7ed823d5a7271e544820593b6b8ed045777b7d8" + }, "devDependencies": { - "grunt": "~0.4.5", - "grunt-shell": "0.6.4", - "grunt-contrib-jshint": "~0.9.0", + "grunt": "1.0.1", + "fluid-grunt-eslint": "18.1.1", "grunt-jsonlint": "1.0.4", - "grunt-gpii": "git://github.com/GPII/grunt-gpii.git#ec8412064e107febb120f0b7437d403453b40d2d", - "nan": "^2.1.0" + "grunt-shell": "1.3.0", + "nan": "2.1.0" }, "license" : "BSD-3-Clause", "keywords": [ From b3d1b1b50e0f21eacc6c3b86d032aea52ff95207 Mon Sep 17 00:00:00 2001 From: cstrobbe Date: Tue, 21 Jun 2016 13:00:32 +0200 Subject: [PATCH 287/319] GPII-679: licence URLs & EU ack. Some licence URLs did not work or pointed to the universal repo. Also, it makes more sense to put the EU funding acknowledgement below the licence URL. --- Gruntfile.js | 2 +- gpii.js | 6 ++--- gpii/node_modules/alsa/alsa_bridge.js | 6 ++--- gpii/node_modules/alsa/nodealsa/nodealsa.cc | 6 ++--- .../alsa/nodealsa/nodealsa_tests.js | 6 ++--- .../alsa/test/alsaSettingsHandlerTests.js | 22 +++++++++++-------- .../gsettingsBridge/gsettings_bridge.js | 6 ++--- gpii/node_modules/gsettingsBridge/index.js | 6 ++--- .../nodegsettings/nodegsettings.cc | 6 ++--- .../nodegsettings/nodegsettings_tests.js | 6 ++--- .../gsettingsBridge/tests/gsettingsTests.js | 6 ++--- .../gsettingsBridge/tests/runUnitTests.sh | 6 ++--- gpii/node_modules/orca/index.js | 6 ++--- gpii/node_modules/orca/orcaSettingsHandler.js | 6 ++--- .../orca/test/orcaSettingsHandlerTests.js | 6 ++--- gpii/node_modules/packagekit/index.js | 6 ++++- .../packagekit/packageKitDeviceReporter.js | 6 ++++- .../test/packageKitDeviceReporterTests.js | 6 ++++- .../packagekit/test/packageKitModuleTests.js | 6 ++++- gpii/node_modules/xrandr/index.js | 6 ++--- .../xrandr/nodexrandr/nodexrandr.cc | 6 ++--- .../xrandr/nodexrandr/nodexrandr_tests.js | 6 ++--- .../xrandr/test/xrandrSettingsHandlerTests.js | 6 ++--- gpii/node_modules/xrandr/xrandr_bridge.js | 6 ++--- index.js | 10 ++++----- tests/AcceptanceTests.js | 6 ++--- tests/UnitTests.sh | 6 ++--- usbDriveListener/gpii-usb-user-listener | 6 ++--- 28 files changed, 102 insertions(+), 82 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9fb6c77..e198a15 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,7 +8,7 @@ Licensed under the New BSD license. You may not use this file except in compliance with this License. You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt +https://github.com/GPII/linux/blob/master/LICENSE.txt */ "use strict"; diff --git a/gpii.js b/gpii.js index 33d1512..8f31db7 100644 --- a/gpii.js +++ b/gpii.js @@ -7,12 +7,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ diff --git a/gpii/node_modules/alsa/alsa_bridge.js b/gpii/node_modules/alsa/alsa_bridge.js index c671508..cdd295f 100644 --- a/gpii/node_modules/alsa/alsa_bridge.js +++ b/gpii/node_modules/alsa/alsa_bridge.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ (function () { diff --git a/gpii/node_modules/alsa/nodealsa/nodealsa.cc b/gpii/node_modules/alsa/nodealsa/nodealsa.cc index d885eae..b4a8ff7 100644 --- a/gpii/node_modules/alsa/nodealsa/nodealsa.cc +++ b/gpii/node_modules/alsa/nodealsa/nodealsa.cc @@ -7,12 +7,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ #include diff --git a/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js b/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js index 595c4d4..bd6c02c 100644 --- a/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js +++ b/gpii/node_modules/alsa/nodealsa/nodealsa_tests.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ "use strict"; diff --git a/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js b/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js index c556d8f..e44ae60 100644 --- a/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js +++ b/gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js @@ -1,13 +1,17 @@ /* -GPII Node.js ALSA Volume Bridge - -Copyright 2013 Emergya - -Licensed under the New BSD license. You may not use this file except in -compliance with this License. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt + GPII Node.js ALSA Volume Bridge + + Copyright 2013 Emergya + + Licensed under the New BSD license. You may not use this file except in + compliance with this License. + + You may obtain a copy of the License at + https://github.com/GPII/linux/blob/master/LICENSE.txt + + The research leading to these results has received funding from the European Union's + Seventh Framework Programme (FP7/2007-2013) + under grant agreement no. 289016. */ "use strict"; diff --git a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js index 379147c..8d14b7b 100644 --- a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ (function () { diff --git a/gpii/node_modules/gsettingsBridge/index.js b/gpii/node_modules/gsettingsBridge/index.js index 632ede7..e54c968 100644 --- a/gpii/node_modules/gsettingsBridge/index.js +++ b/gpii/node_modules/gsettingsBridge/index.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ require("./gsettings_bridge.js"); \ No newline at end of file diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc index 22914d1..ff79eb6 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc @@ -7,12 +7,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js index c5b1ccf..fbc3457 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ "use strict"; diff --git a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js index 8e9d345..9366d3b 100644 --- a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ "use strict"; diff --git a/gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh b/gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh index 88fc557..5a7665c 100755 --- a/gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh +++ b/gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh @@ -5,12 +5,12 @@ # Licensed under the New BSD license. You may not use this file except in # compliance with this License. # +# You may obtain a copy of the License at +# https://github.com/GPII/linux/blob/master/LICENSE.txt +# # The research leading to these results has received funding from the European Union's # Seventh Framework Programme (FP7/2007-2013) # under grant agreement no. 289016. -# -# You may obtain a copy of the License at -# https://github.com/GPII/universal/blob/master/LICENSE.txt #!/bin/bash LOC="/usr/share/glib-2.0/schemas" diff --git a/gpii/node_modules/orca/index.js b/gpii/node_modules/orca/index.js index eb8ab8f..b4b1c84 100644 --- a/gpii/node_modules/orca/index.js +++ b/gpii/node_modules/orca/index.js @@ -7,12 +7,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ require("./orcaSettingsHandler.js"); diff --git a/gpii/node_modules/orca/orcaSettingsHandler.js b/gpii/node_modules/orca/orcaSettingsHandler.js index 157593f..5adce53 100644 --- a/gpii/node_modules/orca/orcaSettingsHandler.js +++ b/gpii/node_modules/orca/orcaSettingsHandler.js @@ -7,12 +7,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ (function () { diff --git a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js index dd14ec6..fef1f70 100644 --- a/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js +++ b/gpii/node_modules/orca/test/orcaSettingsHandlerTests.js @@ -7,12 +7,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ "use strict"; diff --git a/gpii/node_modules/packagekit/index.js b/gpii/node_modules/packagekit/index.js index 7d248e0..240ebf0 100644 --- a/gpii/node_modules/packagekit/index.js +++ b/gpii/node_modules/packagekit/index.js @@ -7,7 +7,11 @@ * compliance with this License. * * You may obtain a copy of the License at - * https://github.com/gpii/universal/LICENSE.txt + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. */ var fluid = require("universal"); diff --git a/gpii/node_modules/packagekit/packageKitDeviceReporter.js b/gpii/node_modules/packagekit/packageKitDeviceReporter.js index e71d4b6..f113f27 100644 --- a/gpii/node_modules/packagekit/packageKitDeviceReporter.js +++ b/gpii/node_modules/packagekit/packageKitDeviceReporter.js @@ -7,7 +7,11 @@ * compliance with this License. * * You may obtain a copy of the License at - * https://github.com/gpii/universal/LICENSE.txt + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. */ (function () { diff --git a/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js b/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js index f272d1a..079057e 100644 --- a/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js +++ b/gpii/node_modules/packagekit/test/packageKitDeviceReporterTests.js @@ -7,7 +7,11 @@ * compliance with this License. * * You may obtain a copy of the License at - * https://github.com/gpii/universal/LICENSE.txt + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. */ "use strict"; diff --git a/gpii/node_modules/packagekit/test/packageKitModuleTests.js b/gpii/node_modules/packagekit/test/packageKitModuleTests.js index e36bd88..5d95122 100644 --- a/gpii/node_modules/packagekit/test/packageKitModuleTests.js +++ b/gpii/node_modules/packagekit/test/packageKitModuleTests.js @@ -7,7 +7,11 @@ * compliance with this License. * * You may obtain a copy of the License at - * https://github.com/gpii/universal/LICENSE.txt + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * + * The research leading to these results has received funding from the European Union's + * Seventh Framework Programme (FP7/2007-2013) + * under grant agreement no. 289016. */ "use strict"; diff --git a/gpii/node_modules/xrandr/index.js b/gpii/node_modules/xrandr/index.js index f120d37..3bf66be 100644 --- a/gpii/node_modules/xrandr/index.js +++ b/gpii/node_modules/xrandr/index.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ require("./xrandr_bridge.js"); diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc index 069ed37..124d48a 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr.cc @@ -7,12 +7,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ #include diff --git a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js index cacc60d..56358be 100644 --- a/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js +++ b/gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ "use strict"; diff --git a/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js b/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js index a6d1a9d..936929b 100644 --- a/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js +++ b/gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ "use strict"; diff --git a/gpii/node_modules/xrandr/xrandr_bridge.js b/gpii/node_modules/xrandr/xrandr_bridge.js index 10c4d5c..e53c213 100644 --- a/gpii/node_modules/xrandr/xrandr_bridge.js +++ b/gpii/node_modules/xrandr/xrandr_bridge.js @@ -6,12 +6,12 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ (function () { diff --git a/index.js b/index.js index 6e6114e..57c60ac 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ - /* +/* * GPII Linux Personalization Framework Node.js Index * * Copyright 2012 OCAD University @@ -7,14 +7,14 @@ * Licensed under the New BSD license. You may not use this file except in * compliance with this License. * + * You may obtain a copy of the License at + * https://github.com/GPII/linux/blob/master/LICENSE.txt + * * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt */ - + var fluid = require("universal"); fluid.module.register("gpii-linux", __dirname, require); diff --git a/tests/AcceptanceTests.js b/tests/AcceptanceTests.js index f2694a0..d1ca5f8 100644 --- a/tests/AcceptanceTests.js +++ b/tests/AcceptanceTests.js @@ -7,11 +7,11 @@ Copyright 2014 Lucendo Development Ltd. Licensed under the New BSD license. You may not use this file except in compliance with this License. +You may obtain a copy of the License at +https://github.com/GPII/linux/blob/master/LICENSE.txt + The research leading to these results has received funding from the European Union's Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016. - -You may obtain a copy of the License at -https://github.com/gpii/universal/LICENSE.txt */ "use strict"; diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh index 4209d89..f535d9a 100755 --- a/tests/UnitTests.sh +++ b/tests/UnitTests.sh @@ -7,11 +7,11 @@ # Licensed under the New BSD license. You may not use this file except in # compliance with this License. # +# You may obtain a copy of the License at +# https://github.com/GPII/linux/blob/master/LICENSE.txt +# # The research leading to these results has received funding from the European Union's # Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016. -# -# You may obtain a copy of the License at -# https://github.com/gpii/universal/LICENSE.txt pushd . cd ../gpii/node_modules/alsa/test diff --git a/usbDriveListener/gpii-usb-user-listener b/usbDriveListener/gpii-usb-user-listener index abc21da..6ac4626 100755 --- a/usbDriveListener/gpii-usb-user-listener +++ b/usbDriveListener/gpii-usb-user-listener @@ -8,12 +8,12 @@ # Licensed under the New BSD license. You may not use this file except in # compliance with this License. # +# You may obtain a copy of the License at +# https://github.com/GPII/linux/blob/master/LICENSE.txt +# # The research leading to these results has received funding from the European Union's # Seventh Framework Programme (FP7/2007-2013) # under grant agreement no. 289016. -# -# You may obtain a copy of the License at -# https://github.com/GPII/universal/blob/master/LICENSE.txt from gi.repository import GUdev from gi.repository import GLib From 9469f85d2c7b77f6031be908dbed25bcb8067974 Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Tue, 21 Jun 2016 13:56:21 -0300 Subject: [PATCH 288/319] GPII-1855 - Upgrade to Fedora 24 --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 85af431..e46ced3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,7 +24,7 @@ ram = ENV["VM_RAM"] || 2048 Vagrant.configure(2) do |config| - config.vm.box = "inclusivedesign/fedora23" + config.vm.box = "inclusivedesign/fedora24" # Your working directory will be synced to /home/vagrant/sync in the VM. config.vm.synced_folder ".", "#{app_directory}" From a4cc30cc4833441e69bb25594bc5b6149c599ded Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Fri, 24 Jun 2016 17:07:03 -0300 Subject: [PATCH 289/319] GPII-1854 - Disable 3D acceleration --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index e46ced3..2501642 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -52,7 +52,7 @@ Vagrant.configure(2) do |config| vm.customize ["modifyvm", :id, "--memory", ram] vm.customize ["modifyvm", :id, "--cpus", cpus] vm.customize ["modifyvm", :id, "--vram", "128"] - vm.customize ["modifyvm", :id, "--accelerate3d", "on"] + vm.customize ["modifyvm", :id, "--accelerate3d", "off"] vm.customize ["modifyvm", :id, "--audio", "null", "--audiocontroller", "ac97"] vm.customize ["modifyvm", :id, "--ioapic", "on"] vm.customize ["setextradata", "global", "GUI/SuppressMessages", "all"] From 6d44d33d31176845b791c9660e0cf429ebc283f2 Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Thu, 30 Jun 2016 15:42:16 -0300 Subject: [PATCH 290/319] Increase video memory from 128MB to 256MB --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 2501642..daf911e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -51,7 +51,7 @@ Vagrant.configure(2) do |config| config.vm.provider :virtualbox do |vm| vm.customize ["modifyvm", :id, "--memory", ram] vm.customize ["modifyvm", :id, "--cpus", cpus] - vm.customize ["modifyvm", :id, "--vram", "128"] + vm.customize ["modifyvm", :id, "--vram", "256"] vm.customize ["modifyvm", :id, "--accelerate3d", "off"] vm.customize ["modifyvm", :id, "--audio", "null", "--audiocontroller", "ac97"] vm.customize ["modifyvm", :id, "--ioapic", "on"] From a26f43bb06a33043826778a1c01710bb362ad906 Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Fri, 1 Jul 2016 00:56:42 +0100 Subject: [PATCH 291/319] GPII-1848: Updated dependency on universal to the matching one from GPII-1848's universal pull request --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5b984b5..4e752f0 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", "dependencies": { - "universal": "git://github.com/GPII/universal.git#c7ed823d5a7271e544820593b6b8ed045777b7d8" + "universal": "git://github.com/amb26/universal.git#1a97958b6a7669c2c9e11a96ebd6f407357a4f81" }, "devDependencies": { "grunt": "1.0.1", From ba99026264c1a9ce5794cee5dec36cf04f11b60d Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sun, 10 Jul 2016 10:54:59 +0100 Subject: [PATCH 292/319] GPII-1848: Updates universal dependency to latest project repo version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e752f0..f2f50ee 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", "dependencies": { - "universal": "git://github.com/amb26/universal.git#1a97958b6a7669c2c9e11a96ebd6f407357a4f81" + "universal": "gpii/universal#98561d07c0b49d4d565be9027adebf36c1d1fe82" }, "devDependencies": { "grunt": "1.0.1", From 339421eb065b781101cc98a2ded23310a56cbb07 Mon Sep 17 00:00:00 2001 From: Avtar Gill Date: Wed, 27 Jul 2016 17:21:12 -0400 Subject: [PATCH 293/319] GPII-1289: Makes unit tests shell script return accurate error codes --- tests/UnitTests.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh index f535d9a..d90fc1f 100755 --- a/tests/UnitTests.sh +++ b/tests/UnitTests.sh @@ -13,6 +13,10 @@ # The research leading to these results has received funding from the European Union's # Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016. +declare -i error_code + +trap 'error_code=$?' ERR EXIT + pushd . cd ../gpii/node_modules/alsa/test node alsaSettingsHandlerTests.js @@ -40,3 +44,9 @@ popd # These XRANDR tests crash out on my system (AMB - Fedora 19 64-bit in VMWare Workstation 10.0.1 on Windows 7 64-bit) node ../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js node ../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js + +if [ -n "$error_code" ]; then + exit 1 +else + exit 0 +fi From 33dcfd2aa3fc4d015aadb931c74fbfb597047586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Thu, 4 Aug 2016 03:00:40 +0200 Subject: [PATCH 294/319] GPII-1898: Update linux to node 6.x --- package.json | 6 +++--- provisioning/requirements.yml | 3 ++- provisioning/vars.yml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f2f50ee..4f3ef85 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,14 @@ "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", "dependencies": { - "universal": "gpii/universal#98561d07c0b49d4d565be9027adebf36c1d1fe82" + "universal": "javihernandez/universal#be9dce824ad6cb027e10f4eb9d57e52f6b4847d7" }, "devDependencies": { "grunt": "1.0.1", "fluid-grunt-eslint": "18.1.1", "grunt-jsonlint": "1.0.4", "grunt-shell": "1.3.0", - "nan": "2.1.0" + "nan": "2.4.0" }, "license" : "BSD-3-Clause", "keywords": [ @@ -29,6 +29,6 @@ "repository": "git://github.com/GPII/linux.git", "main": "./gpii/index.js", "engines": { - "node": ">=4.2.1" + "node": ">=6.3.1" } } diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 152e605..5fea31d 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -1,7 +1,8 @@ - src: https://github.com/idi-ops/ansible-facts name: facts -- src: https://github.com/idi-ops/ansible-nodejs +- src: https://github.com/javihernandez/ansible-nodejs + version: GPII-1898 name: nodejs - src: https://github.com/gpii-ops/ansible-gpii-framework diff --git a/provisioning/vars.yml b/provisioning/vars.yml index 779dd32..c8c92c3 100644 --- a/provisioning/vars.yml +++ b/provisioning/vars.yml @@ -9,7 +9,7 @@ nodejs_app_git_repo: https://github.com/gpii/linux.git nodejs_app_git_branch: master # Currently Node.js LTS (4.x or "Argon") is required by the GPII -nodejs_branch: lts +nodejs_branch: current # If a specific npm version is needed, specify it here #nodejs_npm_version: 1.4.28 From ddb1ce75d7dd2c50184cde1ee9d119e6477bb98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 7 Sep 2016 13:34:16 +0200 Subject: [PATCH 295/319] GPII-1898: Do not bump the minimum required version of node It still works with node 4.x series. Also, updated the reference to javihernandez/universal. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4f3ef85..e9d9ce9 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", "dependencies": { - "universal": "javihernandez/universal#be9dce824ad6cb027e10f4eb9d57e52f6b4847d7" + "universal": "javihernandez/universal#570143d4822ae1cd8a4b9e1ef27b0e82d84b7fe9" }, "devDependencies": { "grunt": "1.0.1", @@ -29,6 +29,6 @@ "repository": "git://github.com/GPII/linux.git", "main": "./gpii/index.js", "engines": { - "node": ">=6.3.1" + "node": ">=4.2.1" } } From ab31c55b3796c5355e36778eea5c8d43fcfad678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Hern=C3=A1ndez?= Date: Wed, 7 Sep 2016 13:37:57 +0200 Subject: [PATCH 296/319] GPII-1898: Revert reference to idi-ops/ansible-nodejs now that https://github.com/idi-ops/ansible-nodejs/pull/28 is merged in. --- provisioning/requirements.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 5fea31d..152e605 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -1,8 +1,7 @@ - src: https://github.com/idi-ops/ansible-facts name: facts -- src: https://github.com/javihernandez/ansible-nodejs - version: GPII-1898 +- src: https://github.com/idi-ops/ansible-nodejs name: nodejs - src: https://github.com/gpii-ops/ansible-gpii-framework From 21c01a45eb43a7cfdbcbbbcca2deda4cf97ed076 Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Thu, 22 Sep 2016 04:01:09 +0100 Subject: [PATCH 297/319] GPII-580: Added registration of Infusion ContextAwareness marker representing Linux platform for use in Journalling component and other contexts --- index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8cec7fb..cb2ad0b 100644 --- a/index.js +++ b/index.js @@ -21,13 +21,19 @@ var fluid = require("universal"); fluid.module.register("gpii-linux", __dirname, require); +fluid.contextAware.makeChecks({ + "gpii.contexts.linux": { + value: true + } +}); + // Settings Handlers -// + require("./gpii/node_modules/gsettingsBridge"); require("./gpii/node_modules/orca"); require("./gpii/node_modules/alsa"); require("./gpii/node_modules/xrandr"); // Device Reporters -// + require("./gpii/node_modules/packagekit"); From 48aadce0c20051dd20abb7b9b876c719a2bba8cb Mon Sep 17 00:00:00 2001 From: Antranig Basman Date: Tue, 27 Sep 2016 03:54:48 +0100 Subject: [PATCH 298/319] GPII-1898: Updated universal reference to merged GPII-1898 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e9d9ce9..f072857 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", "dependencies": { - "universal": "javihernandez/universal#570143d4822ae1cd8a4b9e1ef27b0e82d84b7fe9" + "universal": "GPII/universal#6495c46c3d3c800caffaea2424ee9abfdc4bcad1" }, "devDependencies": { "grunt": "1.0.1", From 9b8cc271fb88c8feeb7caca4fe19788f986eb543 Mon Sep 17 00:00:00 2001 From: Simon Bates Date: Fri, 4 Nov 2016 13:52:56 -0400 Subject: [PATCH 299/319] GPII-580: Update to latest universal --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f072857..ce76527 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", "dependencies": { - "universal": "GPII/universal#6495c46c3d3c800caffaea2424ee9abfdc4bcad1" + "universal": "GPII/universal#1a3434d970cb484956eb18310683bdfe473123d6" }, "devDependencies": { "grunt": "1.0.1", From 5414c52d6cfc586640ac87875cb05a3db6f1cc39 Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Fri, 4 Nov 2016 17:11:48 -0200 Subject: [PATCH 300/319] Switch node.js version from 'current' to 'lts' --- provisioning/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provisioning/vars.yml b/provisioning/vars.yml index c8c92c3..d3fe76c 100644 --- a/provisioning/vars.yml +++ b/provisioning/vars.yml @@ -8,8 +8,8 @@ nodejs_app_git_repo: https://github.com/gpii/linux.git nodejs_app_git_branch: master -# Currently Node.js LTS (4.x or "Argon") is required by the GPII -nodejs_branch: current +# Currently Node.js 6.x LTS is required by the GPII +nodejs_branch: lts # If a specific npm version is needed, specify it here #nodejs_npm_version: 1.4.28 From 8e1d9a98f29d83fb30f24f2614f32e01cd2b3817 Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Fri, 4 Nov 2016 17:32:08 -0200 Subject: [PATCH 301/319] GPII-2060 - Bind mount node_modules in /var/tmp --- Vagrantfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index daf911e..2178e57 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -29,6 +29,13 @@ Vagrant.configure(2) do |config| # Your working directory will be synced to /home/vagrant/sync in the VM. config.vm.synced_folder ".", "#{app_directory}" + # Mounts node_modules in /var/tmp to work around issues in the VirtualBox shared folders + config.vm.provision "shell", run: "always", inline: <<-SHELL + sudo mkdir -p /var/tmp/#{app_name}/node_modules #{app_directory}/node_modules + sudo chown vagrant:vagrant -R /var/tmp/#{app_name}/node_modules #{app_directory}/node_modules + sudo mount -o bind /var/tmp/#{app_name}/node_modules #{app_directory}/node_modules + SHELL + # List additional directories to sync to the VM in your "Vagrantfile.local" file # using the following format: # config.vm.synced_folder "../path/on/your/host/os/your-project", "/home/vagrant/sync/your-project" From b0b39beb0e45c92d572a1f856d710626d7afe0ad Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 13 Dec 2016 14:29:03 -0500 Subject: [PATCH 302/319] GPII-8: GSettings handler core dumps for single key functions. Modified the single key accessors to check that a setting's key is valid before trying to set/get the setting's value. --- .../gsettingsBridge/gsettings_bridge.js | 13 +++++++++++-- .../gsettingsBridge/tests/gsettingsTests.js | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js index 5550872..fd154a0 100644 --- a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js @@ -41,11 +41,20 @@ fluid.defaults("gpii.gsettings.getSingleKey", { }); gpii.gsettings.getSingleKey = function (schemaId, key) { - return nodeGSettings.get_gsetting(schemaId, key); + var keys = nodeGSettings.get_gsetting_keys(schemaId); + if (keys.indexOf(key) !== -1) { + return nodeGSettings.get_gsetting(schemaId, key); + } + else { + return undefined; + } }; gpii.gsettings.setSingleKey = function (schemaId, key, value) { - nodeGSettings.set_gsetting(schemaId, key, value); + var keys = nodeGSettings.get_gsetting_keys(schemaId); + if (keys.indexOf(key) !== -1) { + nodeGSettings.set_gsetting(schemaId, key, value); + } }; gpii.gsettings.get = function (settingsarray) { diff --git a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js index 7cf1b57..21929ce 100644 --- a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -193,6 +193,8 @@ jqUnit.test("Getting single keys via gsettings handler", function () { gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); jqUnit.assertEquals("Checking 'string' key", "abcdefg", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); + jqUnit.assertEquals("Checking non-existent' key", undefined, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "unicorn")); }); @@ -209,6 +211,10 @@ jqUnit.test("Setting single keys via gsettings handler", function () { gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "string-setting", "Absolutely awesome"); jqUnit.assertEquals("Checking 'string' key", "Absolutely awesome", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); + // set and check non-existent key + gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "unicorn", "Mythical"); + jqUnit.assertEquals("Checking non-existaent 'string' key", undefined, + gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "unicorn")); }); jqUnit.test("Setting multiple keys", function () { From b722bc67ad4bbc608e49ca8b0223a3e3ea65a288 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Tue, 13 Dec 2016 16:29:47 -0500 Subject: [PATCH 303/319] GPII-8: GSettings handler core dumps for single key functions. Updated unit tests to use 'assertUndefined' instead of 'assertEquals'. --- gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js index 21929ce..4f93ca0 100644 --- a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -193,7 +193,7 @@ jqUnit.test("Getting single keys via gsettings handler", function () { gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); jqUnit.assertEquals("Checking 'string' key", "abcdefg", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); - jqUnit.assertEquals("Checking non-existent' key", undefined, + jqUnit.assertUndefined("Checking non-existent' key", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "unicorn")); }); @@ -213,7 +213,7 @@ jqUnit.test("Setting single keys via gsettings handler", function () { gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); // set and check non-existent key gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "unicorn", "Mythical"); - jqUnit.assertEquals("Checking non-existaent 'string' key", undefined, + jqUnit.assertUndefined("Checking non-existaent 'string' key", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "unicorn")); }); From 5386407f0838605fe1294262685754755814d79a Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Wed, 1 Feb 2017 10:33:20 -0500 Subject: [PATCH 304/319] GPII-8: GSettings handler core dumps for single key functions Modified to address Javi's review. --- gpii/node_modules/gsettingsBridge/gsettings_bridge.js | 3 +-- gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js index fd154a0..8ce8681 100644 --- a/gpii/node_modules/gsettingsBridge/gsettings_bridge.js +++ b/gpii/node_modules/gsettingsBridge/gsettings_bridge.js @@ -44,8 +44,7 @@ gpii.gsettings.getSingleKey = function (schemaId, key) { var keys = nodeGSettings.get_gsetting_keys(schemaId); if (keys.indexOf(key) !== -1) { return nodeGSettings.get_gsetting(schemaId, key); - } - else { + } else { return undefined; } }; diff --git a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js index 4f93ca0..d052953 100644 --- a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -193,7 +193,7 @@ jqUnit.test("Getting single keys via gsettings handler", function () { gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "boolean-setting")); jqUnit.assertEquals("Checking 'string' key", "abcdefg", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "string-setting")); - jqUnit.assertUndefined("Checking non-existent' key", + jqUnit.assertUndefined("Checking non-existent 'string' key", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-get", "unicorn")); }); @@ -213,7 +213,7 @@ jqUnit.test("Setting single keys via gsettings handler", function () { gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "string-setting")); // set and check non-existent key gpii.gsettings.setSingleKey("net.gpii.testing.gsettings.single-set", "unicorn", "Mythical"); - jqUnit.assertUndefined("Checking non-existaent 'string' key", + jqUnit.assertUndefined("Checking non-existent 'string' key", gpii.gsettings.getSingleKey("net.gpii.testing.gsettings.single-set", "unicorn")); }); From d367637bd72d1742453ab80dd0313f4b108362a8 Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Tue, 11 Jul 2017 14:39:06 -0300 Subject: [PATCH 305/319] GPII-2158 - Update to Fedora 26 --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index daf911e..866c9c3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,7 +24,7 @@ ram = ENV["VM_RAM"] || 2048 Vagrant.configure(2) do |config| - config.vm.box = "inclusivedesign/fedora24" + config.vm.box = "inclusivedesign/fedora26" # Your working directory will be synced to /home/vagrant/sync in the VM. config.vm.synced_folder ".", "#{app_directory}" From aa022b6d41cfcad44c211849d7bcb8205dc1d6f8 Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Tue, 1 Aug 2017 11:43:15 +0200 Subject: [PATCH 306/319] GPII-2515: Added code coverage reporting and migrated test scripts from Grunt to npm. --- .gitignore | 1 + .istanbul.yml | 14 ++++ Gruntfile.js | 20 +---- README.md | 47 ++++++++--- .../gsettingsBridge/tests/gsettingsTests.js | 5 +- .../gsettingsBridge/tests/scripts/posttest.sh | 19 +++++ .../{runUnitTests.sh => scripts/pretest.sh} | 24 ++---- package.json | 79 +++++++++++-------- tests/UnitTests.js | 9 +++ tests/UnitTests.sh | 26 +----- 10 files changed, 143 insertions(+), 101 deletions(-) create mode 100644 .istanbul.yml create mode 100755 gpii/node_modules/gsettingsBridge/tests/scripts/posttest.sh rename gpii/node_modules/gsettingsBridge/tests/{runUnitTests.sh => scripts/pretest.sh} (65%) create mode 100644 tests/UnitTests.js diff --git a/.gitignore b/.gitignore index dff7f0f..1b8daaf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ gpii/node_modules/gsettingsBridge/nodegsettings/build/ gpii/node_modules/packagekit/nodepackagekit/build/ gpii/node_modules/xrandr/nodexrandr/build/ /node_modules/ +coverage diff --git a/.istanbul.yml b/.istanbul.yml new file mode 100644 index 0000000..bbec25a --- /dev/null +++ b/.istanbul.yml @@ -0,0 +1,14 @@ +# A common istanbul configuration file. Avoids generating reports, as we are collecting data from various runs, and +# will do that as a "posttest" step. You must explicitly generate a report and summary, see the package.json for an +# example command. +instrumentation: + root: . + include-pid: true + default-excludes: false + excludes: ["tests/**", "coverage/**", "instrumented/**", "node_modules/**"] + complete-copy: true +reporting: + dir: ./coverage + print: none + reports: + - none diff --git a/Gruntfile.js b/Gruntfile.js index 210bc36..43ce152 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,6 +3,7 @@ GPII Linux Personalization Framework Node.js Bootstrap Copyright 2014 RTF-US Copyright 2014 Emergya +Copyright 2017 Raising the Floor International Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -78,12 +79,6 @@ module.exports = function (grunt) { "sudo rm -f /usr/share/applications/gpii-usb-user-listener.desktop", "sudo rm -f -r /var/lib/gpii" ].join("&&") - }, - runAcceptanceTests: { - command: "vagrant ssh -c 'DISPLAY=:0 node /home/vagrant/sync/tests/AcceptanceTests.js'" - }, - runUnitTests: { - command: "vagrant ssh -c 'cd /home/vagrant/sync/tests/; DISPLAY=:0 ./UnitTests.sh'" } } }); @@ -119,17 +114,4 @@ module.exports = function (grunt) { grunt.registerTask("uninstall", "Uninstall system level GPII Components", function () { grunt.task.run("shell:uninstallUsbLib"); }); - - grunt.registerTask("unit-tests", "Run GPII unit tests", function () { - grunt.task.run("shell:runUnitTests"); - }); - - grunt.registerTask("acceptance-tests", "Run GPII acceptance tests", function () { - grunt.task.run("shell:runAcceptanceTests"); - }); - - grunt.registerTask("tests", "Run GPII unit and acceptance tests", function () { - grunt.task.run("shell:runUnitTests"); - grunt.task.run("shell:runAcceptanceTests"); - }); }; diff --git a/README.md b/README.md index 2add2ee..c6911bd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # GNU/Linux -This repository contains all of the platform-specific code required to run the GPII Personalization Framework on GNU/Linux with GNOME. +This repository contains all of the platform-specific code required to run the GPII Personalization Framework on +GNU/Linux with GNOME. The following components can be found in the repository: @@ -51,7 +52,9 @@ this may prompt you for sudo access. # Setting Up a Virtual Machine -This repository contains content that will allow you to automatically provision a development VM. A [Vagrantfile](http://docs.vagrantup.com/v2/vagrantfile/) is provided that downloads a [Fedora Vagrant box](https://github.com/idi-ops/packer-fedora), starts a VM, and deploys the GPII Framework on it. +This repository contains content that will allow you to automatically provision a development VM. A +[Vagrantfile](http://docs.vagrantup.com/v2/vagrantfile/) is provided that downloads a +[Fedora Vagrant box](https://github.com/idi-ops/packer-fedora), starts a VM, and deploys the GPII Framework on it. The ``provisioning`` directory contains these files: @@ -61,25 +64,51 @@ The ``provisioning`` directory contains these files: ## Requirements -Please ensure that the [QI Development Environments software requirements](https://github.com/GPII/qi-development-environments/blob/master/README.md#requirements) have been met. You will additionally need the following on your host operating system: +Please ensure that the +[QI Development Environments software requirements](https://github.com/GPII/qi-development-environments/blob/master/README.md#requirements) +have been met. You will additionally need the following on your host operating system: * [grunt-cli](https://github.com/gruntjs/grunt-cli) * At least 2GB of available storage space -## Getting Started +## Creating a VM In order to create a new VM you will need to issue the following command: vagrant up -By default the VM will use two processor cores and 2GB of RAM. Two environment variables can be passed to the ``vagrant up`` command to allocate more cores (``VM_CPUS=2``) and RAM (``VM_RAM=2048``). If this is your first time setting up this VM then the 2GB Fedora Vagrant box will be downloaded. +By default the VM will use two processor cores and 2GB of RAM. Two environment variables can be passed to the +``vagrant up`` command to allocate more cores (``VM_CPUS=2``) and RAM (``VM_RAM=2048``). If this is your first time +setting up this VM then the 2GB Fedora Vagrant box will be downloaded. -Once the box has been downloaded the provisioning process will ensure that project dependencies have been met and then the ``npm install`` and ``grunt --force build`` commands will be executed. If you reboot the VM the provisioner will not run again. However, you can use ``vagrant provision`` to trigger that process at any time. - -To run tests you can use the ``grunt tests`` command on your host which will run unit and acceptance tests in the VM. Or you could use ``grunt unit-tests`` and/or ``grunt acceptance-tests`` separately. +Once the box has been downloaded the provisioning process will ensure that project dependencies have been met and then +the ``npm install`` and ``grunt --force build`` commands will be executed. If you reboot the VM the provisioner will not +run again. However, you can use ``vagrant provision`` to trigger that process at any time. You can stop the VM using ``vagrant halt`` or delete it altogether using ``vagrant destroy``. +## Running Tests in the VM + +To run tests on the VM from the host machine, you can use the following commands: + +* ``npm run test:vagrant`` - Run all tests on the VM. +* ``npm run test:vagrantUnit`` - Run just the unit tests on the VM. +* ``npm run test:vagrantAcceptance`` - Run just the acceptance tests on the VM. + +You can also connect to the VM using the ``vagrant ssh`` command, and run the tests using one of the following commands: + +* ``npm test`` - Run all tests. +* ``npm run test:unit`` - Run all unit tests. +* ``npm run test:acceptance`` - Run the acceptance tests. + +## Coverage Reporting + +If you run the full suite of tests, a code coverage report will be generated in `coverage/lcov-report`, which can be +viewed with a browser. A summary of this report will be output to the console as well. + ## Notes -The entire Git working directory will be mounted at the ``/home/vagrant/sync`` path in the VM and bidirectionally synced with the host operating system. This means build artifacts created by processes in the VM will be exposed to the host. It will be safer if you commit to running build tasks such as ``npm install`` or ``grunt build`` in the VM and not attempt that on the host. +The entire Git working directory will be mounted at the ``/home/vagrant/sync`` path in the VM and bidirectionally synced +with the host operating system. This means build artifacts created by processes in the VM will be exposed to the host. +It will be safer if you commit to running build tasks such as ``npm install`` or ``grunt build`` in the VM and not +attempt that on the host. diff --git a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js index d052953..e39bc86 100644 --- a/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js +++ b/gpii/node_modules/gsettingsBridge/tests/gsettingsTests.js @@ -12,6 +12,9 @@ * The research leading to these results has received funding from the European Union's * Seventh Framework Programme (FP7/2007-2013) * under grant agreement no. 289016. + * + * NOTE: You must run `scripts/pretest.sh` before running these tests, and should run `scripts/posttest.sh` script after. + * */ "use strict"; @@ -183,8 +186,6 @@ var gpii8 = { } }; -jqUnit.module("Gsettings Handler Tests"); - jqUnit.test("Getting single keys via gsettings handler", function () { // First check reading single keys ... the default values: jqUnit.assertEquals("Checking 'double' key", 5.0, diff --git a/gpii/node_modules/gsettingsBridge/tests/scripts/posttest.sh b/gpii/node_modules/gsettingsBridge/tests/scripts/posttest.sh new file mode 100755 index 0000000..fb4a08f --- /dev/null +++ b/gpii/node_modules/gsettingsBridge/tests/scripts/posttest.sh @@ -0,0 +1,19 @@ +# Pretest cleanup steps for gsettings bridge +# +# Copyright 2017 Raising the Floor International +# +# Licensed under the New BSD license. You may not use this file except in +# compliance with this License. +# +# You may obtain a copy of the License at +# https://github.com/GPII/linux/blob/master/LICENSE.txt +# +#!/bin/bash +LOC="/usr/share/glib-2.0/schemas" + +#Delete the schemas when done and recompile: +sudo rm "$LOC/net.gpii.testing.gsettings.gschema.xml" +sudo glib-compile-schemas $LOC + + + diff --git a/gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh b/gpii/node_modules/gsettingsBridge/tests/scripts/pretest.sh similarity index 65% rename from gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh rename to gpii/node_modules/gsettingsBridge/tests/scripts/pretest.sh index 5a7665c..48f5943 100755 --- a/gpii/node_modules/gsettingsBridge/tests/runUnitTests.sh +++ b/gpii/node_modules/gsettingsBridge/tests/scripts/pretest.sh @@ -1,6 +1,6 @@ -# Unit test runner for gsettings bridge +# Pretest cleanup steps for gsettings bridge # -# Copyright 2012 Emergya +# Copyright 2017 Raising the Floor International # # Licensed under the New BSD license. You may not use this file except in # compliance with this License. @@ -8,15 +8,15 @@ # You may obtain a copy of the License at # https://github.com/GPII/linux/blob/master/LICENSE.txt # -# The research leading to these results has received funding from the European Union's -# Seventh Framework Programme (FP7/2007-2013) -# under grant agreement no. 289016. - #!/bin/bash LOC="/usr/share/glib-2.0/schemas" +SCRIPT_PATH=$(dirname "$0") + +echo SCRIPT PATH: $SCRIPT_PATH + # Copy schemas to global location and compile them -sudo cp data/net.gpii.testing.gsettings.gschema.xml $LOC +sudo cp $SCRIPT_PATH/../data/net.gpii.testing.gsettings.gschema.xml $LOC sudo glib-compile-schemas $LOC # Make sure they are reset in case they already existed @@ -27,13 +27,3 @@ gsettings reset-recursively net.gpii.testing.gsettings.multi-get2 gsettings reset-recursively net.gpii.testing.gsettings.multi-set1 gsettings reset-recursively net.gpii.testing.gsettings.multi-set2 gsettings reset-recursively net.gpii.testing.gsettings.multi-set3 - -#Run the tests: -node gsettingsTests.js - -#Delete the schemas when done and recompile: -sudo rm "$LOC/net.gpii.testing.gsettings.gschema.xml" -sudo glib-compile-schemas $LOC - - - diff --git a/package.json b/package.json index ce76527..b4c7060 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,49 @@ { - "name": "gpii-linux", - "description": "Components of the GPII personalization infrastructure for use on Linux", - "version": "0.3.0", - "author": "GPII", - "bugs": "http://issues.gpii.net/browse/GPII", - "homepage": "http://gpii.net/", - "dependencies": { - "universal": "GPII/universal#1a3434d970cb484956eb18310683bdfe473123d6" - }, - "devDependencies": { - "grunt": "1.0.1", - "fluid-grunt-eslint": "18.1.1", - "grunt-jsonlint": "1.0.4", - "grunt-shell": "1.3.0", - "nan": "2.4.0" - }, - "license" : "BSD-3-Clause", - "keywords": [ - "gpii", - "accessibility", - "settings", - "fluid", - "IoC", - "Inversion of Control", - "configuration", - "evented" - ], - "repository": "git://github.com/GPII/linux.git", - "main": "./gpii/index.js", - "engines": { - "node": ">=4.2.1" - } + "name": "gpii-linux", + "description": "Components of the GPII personalization infrastructure for use on Linux", + "version": "0.3.0", + "author": "GPII", + "bugs": "http://issues.gpii.net/browse/GPII", + "homepage": "http://gpii.net/", + "dependencies": { + "universal": "GPII/universal#1a3434d970cb484956eb18310683bdfe473123d6" + }, + "devDependencies": { + "fluid-grunt-eslint": "18.1.1", + "grunt": "1.0.1", + "grunt-jsonlint": "1.0.4", + "grunt-shell": "1.3.0", + "istanbul": "0.4.5", + "nan": "2.4.0", + "rimraf": "2.6.1" + }, + "license": "BSD-3-Clause", + "keywords": [ + "gpii", + "accessibility", + "settings", + "fluid", + "IoC", + "Inversion of Control", + "configuration", + "evented" + ], + "repository": "git://github.com/GPII/linux.git", + "main": "./gpii/index.js", + "engines": { + "node": ">=4.2.1" + }, + "scripts": { + "pretest": "node node_modules/rimraf/bin.js coverage/* reports/*", + "test": "npm run test:unit && npm run test:acceptance", + "test:unit": "npm run test:unit:pretest && npm run test:unit:run && npm run test:unit:posttest", + "test:unit:pretest": "/usr/bin/bash ./gpii/node_modules/gsettingsBridge/tests/scripts/pretest.sh", + "test:unit:run": "node node_modules/istanbul/lib/cli.js cover tests/UnitTests.js --include-pid", + "test:unit:posttest": "/usr/bin/bash ./gpii/node_modules/gsettingsBridge/tests/scripts/posttest.sh", + "test:acceptance": "node node_modules/istanbul/lib/cli.js cover tests/AcceptanceTests.js --include-pid", + "test:vagrant": "vagrant ssh -c 'cd /home/vagrant; DISPLAY=:0 npm test'", + "test:vagrantUnit": "vagrant ssh -c 'cd /home/vagrant; DISPLAY=:0 npm run test:unit'", + "test:vagrantAcceptance": "vagrant ssh -c 'cd /home/vagrant; DISPLAY=:0 npm test:acceptance'", + "posttest": "node node_modules/istanbul/lib/cli.js report lcov text-summary" + } } diff --git a/tests/UnitTests.js b/tests/UnitTests.js new file mode 100644 index 0000000..aa5812f --- /dev/null +++ b/tests/UnitTests.js @@ -0,0 +1,9 @@ +// Rollup to run all javascript-only unit tests. +"use strict"; +require("../gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js"); +require("../gpii/node_modules/orca/test/orcaSettingsHandlerTests.js"); +require("../gpii/node_modules/packagekit/test/all-tests.js"); +require("../gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test"); +require("../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js"); +require("../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js"); +require("../gpii/node_modules/gsettingsBridge/tests/gsettingsTests"); diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh index d90fc1f..2323818 100755 --- a/tests/UnitTests.sh +++ b/tests/UnitTests.sh @@ -17,34 +17,16 @@ declare -i error_code trap 'error_code=$?' ERR EXIT +# TODO: Convert this to a javascript-only approach so that we can test code coverage. pushd . -cd ../gpii/node_modules/alsa/test -node alsaSettingsHandlerTests.js -popd - -pushd . -cd ../gpii/node_modules/gsettingsBridge/tests +cd gpii/node_modules/gsettingsBridge/tests +# TODO: See if we can make this into a javascript-only approach ./runUnitTests.sh +# TODO: Produces no output when run on its own from the repo root. Investigate. cd ../nodegsettings node .//nodegsettings_tests.js popd -pushd . -cd ../gpii/node_modules/orca/test -node orcaSettingsHandlerTests.js -popd - -pushd . -cd ../gpii/node_modules/packagekit/test/ -node .//all-tests.js -cd ../nodepackagekit -node nodepackagekit_test.js -popd - -# These XRANDR tests crash out on my system (AMB - Fedora 19 64-bit in VMWare Workstation 10.0.1 on Windows 7 64-bit) -node ../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js -node ../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js - if [ -n "$error_code" ]; then exit 1 else From 7a00d8a0aa1f310278b86b40e911a216662bd120 Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Tue, 1 Aug 2017 13:28:27 +0200 Subject: [PATCH 307/319] GPII-2515: Updated universal to pick up new xrandr tests and istanbul to add anchors to line numbers. --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b4c7060..669f0aa 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,14 @@ "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", "dependencies": { - "universal": "GPII/universal#1a3434d970cb484956eb18310683bdfe473123d6" + "universal": "GPII/universal#06d5b9b672feecac88e2cf8e351248fad503a111" }, "devDependencies": { "fluid-grunt-eslint": "18.1.1", "grunt": "1.0.1", "grunt-jsonlint": "1.0.4", "grunt-shell": "1.3.0", - "istanbul": "0.4.5", + "istanbul": "git://github.com/the-t-in-rtf/istanbul#828eb930add7bd663ca20649a917f3f3829e48c5", "nan": "2.4.0", "rimraf": "2.6.1" }, @@ -41,9 +41,9 @@ "test:unit:run": "node node_modules/istanbul/lib/cli.js cover tests/UnitTests.js --include-pid", "test:unit:posttest": "/usr/bin/bash ./gpii/node_modules/gsettingsBridge/tests/scripts/posttest.sh", "test:acceptance": "node node_modules/istanbul/lib/cli.js cover tests/AcceptanceTests.js --include-pid", - "test:vagrant": "vagrant ssh -c 'cd /home/vagrant; DISPLAY=:0 npm test'", - "test:vagrantUnit": "vagrant ssh -c 'cd /home/vagrant; DISPLAY=:0 npm run test:unit'", - "test:vagrantAcceptance": "vagrant ssh -c 'cd /home/vagrant; DISPLAY=:0 npm test:acceptance'", + "test:vagrant": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm test'", + "test:vagrantUnit": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm run test:unit'", + "test:vagrantAcceptance": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm test:acceptance'", "posttest": "node node_modules/istanbul/lib/cli.js report lcov text-summary" } } From ef449335fddc5e1df7f97b8aab1b92be4d86a9a3 Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Wed, 2 Aug 2017 13:37:39 +0200 Subject: [PATCH 308/319] GPII-2515: Fixed typo in `test:vagrantAcceptance` script definition. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 669f0aa..dee5015 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "test:acceptance": "node node_modules/istanbul/lib/cli.js cover tests/AcceptanceTests.js --include-pid", "test:vagrant": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm test'", "test:vagrantUnit": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm run test:unit'", - "test:vagrantAcceptance": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm test:acceptance'", + "test:vagrantAcceptance": "vagrant ssh -c 'cd /home/vagrant/sync; npm install && DISPLAY=:0 npm run test:acceptance'", "posttest": "node node_modules/istanbul/lib/cli.js report lcov text-summary" } } From 3435914024c12377a5aa1f9a9df0d4cdcd94e422 Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Thu, 12 Oct 2017 13:50:11 +0200 Subject: [PATCH 309/319] GPII-2515: Removed unneeded shell test, now that the required setup is taken care of using npm scripts. --- tests/UnitTests.sh | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100755 tests/UnitTests.sh diff --git a/tests/UnitTests.sh b/tests/UnitTests.sh deleted file mode 100755 index 2323818..0000000 --- a/tests/UnitTests.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# GPII Unit Tests for Linux -# -# Copyright 2014 Lucendo Development Ltd. -# -# Licensed under the New BSD license. You may not use this file except in -# compliance with this License. -# -# You may obtain a copy of the License at -# https://github.com/GPII/linux/blob/master/LICENSE.txt -# -# The research leading to these results has received funding from the European Union's -# Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016. - -declare -i error_code - -trap 'error_code=$?' ERR EXIT - -# TODO: Convert this to a javascript-only approach so that we can test code coverage. -pushd . -cd gpii/node_modules/gsettingsBridge/tests -# TODO: See if we can make this into a javascript-only approach -./runUnitTests.sh -# TODO: Produces no output when run on its own from the repo root. Investigate. -cd ../nodegsettings -node .//nodegsettings_tests.js -popd - -if [ -n "$error_code" ]; then - exit 1 -else - exit 0 -fi From 868ebe3d7f5fb5fc6e93bbe335b268b6a17d2485 Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Thu, 12 Oct 2017 13:50:42 +0200 Subject: [PATCH 310/319] GPII-2515: Converted gsettings tests to use jqUnit. --- .../nodegsettings/nodegsettings_tests.js | 71 +++++++++---------- package.json | 1 + tests/UnitTests.js | 1 + 3 files changed, 35 insertions(+), 38 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js index fbc3457..7603294 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js @@ -16,28 +16,30 @@ "use strict"; -var assert = require("assert"); +var jqUnit = require("node-jqunit"); var gsettings = require("./build/Release/nodegsettings.node"); /* Common variables for all tests */ var keyScreenmag = "org.gnome.desktop.a11y.magnifier"; -/* Test getting and setting boolean values */ -var testBooleanValues = function () { +jqUnit.module("Node gsettings tests..."); + +jqUnit.test("Test getting and setting boolean values...", function () { var original = gsettings.get_gsetting(keyScreenmag, "show-cross-hairs"); - assert.deepEqual(typeof(original), "boolean", "We got a boolean as expected"); + jqUnit.assertDeepEq("We got a boolean as expected", "boolean", typeof(original)); + // assert.deepEqual(typeof(original), "boolean", "We got a boolean as expected"); var ret = gsettings.set_gsetting(keyScreenmag, "show-cross-hairs", true); - assert.ok(ret); + jqUnit.ok("Setting the value should succeed...", ret); var actual = gsettings.get_gsetting(keyScreenmag, "show-cross-hairs"); - assert.deepStrictEqual(actual, true, "We can set boolean values"); + jqUnit.assertEquals("We can set boolean values...", true, actual); ret = gsettings.set_gsetting(keyScreenmag, "show-cross-hairs", original); - assert.ok(ret); + jqUnit.ok("We can set the value back to its previous value...", ret); - // Todo need to set up an event for these assertions, they run too fast, + // TODO: We need to set up an event for these assertions, they run too fast, // and get the old value from gsettings before it's propagated. // exec('gsettings get '+keyScreenmag+' show-cross-hairs', function(res, out, err) { // testBooleanValuesCallback1 = true; @@ -48,57 +50,50 @@ var testBooleanValues = function () { // testBooleanValuesCallback2 = true; // assert.equal('false\n', out); // }); +}); -}; - -var testDecimalValues = function () { +jqUnit.test("Test getting and setting decimal values...", function () { var original = gsettings.get_gsetting(keyScreenmag, "mag-factor"); var ret = gsettings.set_gsetting(keyScreenmag, "mag-factor", 3.0); - assert.ok(ret); + jqUnit.ok("Setting the value should succeed...", ret); var actual = gsettings.get_gsetting(keyScreenmag, "mag-factor"); - assert.deepStrictEqual(actual, 3.0, "We can set decimal values"); + jqUnit.assertEquals("We can set decimal values", 3.0, actual); var ret2 = gsettings.set_gsetting(keyScreenmag, "mag-factor", 5.3); - assert.ok(ret2); + jqUnit.ok("Resetting the value should succeed...", ret2); actual = gsettings.get_gsetting(keyScreenmag, "mag-factor"); - assert.deepStrictEqual(actual, 5.3, "We can set decimal values"); + jqUnit.assertEquals("We can reset decimal values", 5.3, actual); var ret3 = gsettings.set_gsetting(keyScreenmag, "mag-factor", original); - assert.ok(ret3); -}; + jqUnit.ok("Setting the value should succeed...", ret3); +}); -var testStringValues = function () { +jqUnit.test("Test getting and setting string values...", function () { var original = gsettings.get_gsetting(keyScreenmag, "screen-position"); var ret = gsettings.set_gsetting(keyScreenmag, "screen-position", "left-half"); - assert.ok(ret); + jqUnit.ok("Setting the value should succeed...", ret); var actual = gsettings.get_gsetting(keyScreenmag, "screen-position"); - assert.deepStrictEqual(actual, "left-half", "We can set string values"); + jqUnit.assertEquals("We can set string values", "left-half", actual); var ret2 = gsettings.set_gsetting(keyScreenmag, "screen-position", original); - assert.ok(ret2); -}; + jqUnit.ok("Setting the value should succeed...", ret2); +}); -var testIntegerValues = function () { +jqUnit.test("Test getting and setting integer values...", function () { var original = gsettings.get_gsetting(keyScreenmag, "cross-hairs-thickness"); var ret = gsettings.set_gsetting(keyScreenmag, "cross-hairs-thickness", 7); - assert.ok(ret); + jqUnit.ok("Setting the value should succeed...", ret); var actual = gsettings.get_gsetting(keyScreenmag, "cross-hairs-thickness"); - assert.deepStrictEqual(actual, 7, "We can set integer values"); + jqUnit.assertEquals("We can set integer values", 7, actual); var ret2 = gsettings.set_gsetting(keyScreenmag, "cross-hairs-thickness", original); - assert.ok(ret2); -}; + jqUnit.ok("Setting the value should succeed...", ret2); +}); -var testListKeys = function () { +jqUnit.test("Test listing keys...", function () { var keys = gsettings.get_gsetting_keys(keyScreenmag); - assert.ok(Array.isArray(keys)); + jqUnit.ok("Requesting a list of keys should return the correct type of variable...", Array.isArray(keys)); + for (var i = 0; i < keys.length; i++) { - assert.ok("string", typeof(keys[i])); + jqUnit.assertEquals("Each value in the list should be a string...", "string", typeof (keys[i])); } -}; - -/* Run test functions */ -testBooleanValues(); -testDecimalValues(); -testStringValues(); -testIntegerValues(); -testListKeys(); +}); diff --git a/package.json b/package.json index dee5015..5459d8a 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "grunt-shell": "1.3.0", "istanbul": "git://github.com/the-t-in-rtf/istanbul#828eb930add7bd663ca20649a917f3f3829e48c5", "nan": "2.4.0", + "node-jqunit": "1.1.7", "rimraf": "2.6.1" }, "license": "BSD-3-Clause", diff --git a/tests/UnitTests.js b/tests/UnitTests.js index aa5812f..975da06 100644 --- a/tests/UnitTests.js +++ b/tests/UnitTests.js @@ -1,6 +1,7 @@ // Rollup to run all javascript-only unit tests. "use strict"; require("../gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js"); +require("../gpii/node_modules/gsettingsBridge/tests/gsettingsTests"); require("../gpii/node_modules/orca/test/orcaSettingsHandlerTests.js"); require("../gpii/node_modules/packagekit/test/all-tests.js"); require("../gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test"); From 17229e67b4513d364d86381e3b1de4e1ac840899 Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Thu, 12 Oct 2017 13:51:02 +0200 Subject: [PATCH 311/319] GPII-2515: Added additional ALSA tests per PR feedback. --- tests/UnitTests.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/UnitTests.js b/tests/UnitTests.js index 975da06..90aa385 100644 --- a/tests/UnitTests.js +++ b/tests/UnitTests.js @@ -1,5 +1,6 @@ // Rollup to run all javascript-only unit tests. "use strict"; +require("../gpii/node_modules/alsa/nodealsa/nodealsa_tests"); require("../gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js"); require("../gpii/node_modules/gsettingsBridge/tests/gsettingsTests"); require("../gpii/node_modules/orca/test/orcaSettingsHandlerTests.js"); From db4b892720304d42917bf6e9fc7ebb6ea2261d5b Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Thu, 12 Oct 2017 14:00:32 +0200 Subject: [PATCH 312/319] GPII-2515: Fixed calls to `ok` method to use `assertTrue`. --- .../nodegsettings/nodegsettings_tests.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js index 7603294..4046dd5 100644 --- a/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js +++ b/gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests.js @@ -31,13 +31,13 @@ jqUnit.test("Test getting and setting boolean values...", function () { // assert.deepEqual(typeof(original), "boolean", "We got a boolean as expected"); var ret = gsettings.set_gsetting(keyScreenmag, "show-cross-hairs", true); - jqUnit.ok("Setting the value should succeed...", ret); + jqUnit.assertTrue("Setting the value should succeed...", ret); var actual = gsettings.get_gsetting(keyScreenmag, "show-cross-hairs"); jqUnit.assertEquals("We can set boolean values...", true, actual); ret = gsettings.set_gsetting(keyScreenmag, "show-cross-hairs", original); - jqUnit.ok("We can set the value back to its previous value...", ret); + jqUnit.assertTrue("We can set the value back to its previous value...", ret); // TODO: We need to set up an event for these assertions, they run too fast, // and get the old value from gsettings before it's propagated. @@ -55,43 +55,43 @@ jqUnit.test("Test getting and setting boolean values...", function () { jqUnit.test("Test getting and setting decimal values...", function () { var original = gsettings.get_gsetting(keyScreenmag, "mag-factor"); var ret = gsettings.set_gsetting(keyScreenmag, "mag-factor", 3.0); - jqUnit.ok("Setting the value should succeed...", ret); + jqUnit.assertTrue("Setting the value should succeed...", ret); var actual = gsettings.get_gsetting(keyScreenmag, "mag-factor"); jqUnit.assertEquals("We can set decimal values", 3.0, actual); var ret2 = gsettings.set_gsetting(keyScreenmag, "mag-factor", 5.3); - jqUnit.ok("Resetting the value should succeed...", ret2); + jqUnit.assertTrue("Resetting the value should succeed...", ret2); actual = gsettings.get_gsetting(keyScreenmag, "mag-factor"); jqUnit.assertEquals("We can reset decimal values", 5.3, actual); var ret3 = gsettings.set_gsetting(keyScreenmag, "mag-factor", original); - jqUnit.ok("Setting the value should succeed...", ret3); + jqUnit.assertTrue("Setting the value should succeed...", ret3); }); jqUnit.test("Test getting and setting string values...", function () { var original = gsettings.get_gsetting(keyScreenmag, "screen-position"); var ret = gsettings.set_gsetting(keyScreenmag, "screen-position", "left-half"); - jqUnit.ok("Setting the value should succeed...", ret); + jqUnit.assertTrue("Setting the value should succeed...", ret); var actual = gsettings.get_gsetting(keyScreenmag, "screen-position"); jqUnit.assertEquals("We can set string values", "left-half", actual); var ret2 = gsettings.set_gsetting(keyScreenmag, "screen-position", original); - jqUnit.ok("Setting the value should succeed...", ret2); + jqUnit.assertTrue("Setting the value should succeed...", ret2); }); jqUnit.test("Test getting and setting integer values...", function () { var original = gsettings.get_gsetting(keyScreenmag, "cross-hairs-thickness"); var ret = gsettings.set_gsetting(keyScreenmag, "cross-hairs-thickness", 7); - jqUnit.ok("Setting the value should succeed...", ret); + jqUnit.assertTrue("Setting the value should succeed...", ret); var actual = gsettings.get_gsetting(keyScreenmag, "cross-hairs-thickness"); jqUnit.assertEquals("We can set integer values", 7, actual); var ret2 = gsettings.set_gsetting(keyScreenmag, "cross-hairs-thickness", original); - jqUnit.ok("Setting the value should succeed...", ret2); + jqUnit.assertTrue("Setting the value should succeed...", ret2); }); jqUnit.test("Test listing keys...", function () { var keys = gsettings.get_gsetting_keys(keyScreenmag); - jqUnit.ok("Requesting a list of keys should return the correct type of variable...", Array.isArray(keys)); + jqUnit.assertTrue("Requesting a list of keys should return the correct type of variable...", Array.isArray(keys)); for (var i = 0; i < keys.length; i++) { jqUnit.assertEquals("Each value in the list should be a string...", "string", typeof (keys[i])); From fe15eae090ea3dad80df8c2e66bb36bb21f33d90 Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Thu, 12 Oct 2017 14:01:06 +0200 Subject: [PATCH 313/319] GPII-2515: Added node gsettings tests to unit test rollup. --- tests/UnitTests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/UnitTests.js b/tests/UnitTests.js index 90aa385..0d144ae 100644 --- a/tests/UnitTests.js +++ b/tests/UnitTests.js @@ -2,10 +2,10 @@ "use strict"; require("../gpii/node_modules/alsa/nodealsa/nodealsa_tests"); require("../gpii/node_modules/alsa/test/alsaSettingsHandlerTests.js"); +require("../gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings_tests"); require("../gpii/node_modules/gsettingsBridge/tests/gsettingsTests"); require("../gpii/node_modules/orca/test/orcaSettingsHandlerTests.js"); -require("../gpii/node_modules/packagekit/test/all-tests.js"); require("../gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test"); +require("../gpii/node_modules/packagekit/test/all-tests.js"); require("../gpii/node_modules/xrandr/nodexrandr/nodexrandr_tests.js"); require("../gpii/node_modules/xrandr/test/xrandrSettingsHandlerTests.js"); -require("../gpii/node_modules/gsettingsBridge/tests/gsettingsTests"); From 8d3cc44b600952969bdf6783c82f7956a53e092c Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Mon, 20 Nov 2017 14:03:29 -0200 Subject: [PATCH 314/319] GPII-2713 - Upgrade to Fedora 27 --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 866c9c3..ca94ac4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,7 +24,7 @@ ram = ENV["VM_RAM"] || 2048 Vagrant.configure(2) do |config| - config.vm.box = "inclusivedesign/fedora26" + config.vm.box = "inclusivedesign/fedora27" # Your working directory will be synced to /home/vagrant/sync in the VM. config.vm.synced_folder ".", "#{app_directory}" From f1e851ba2e091882476fe5adf8dd14f942781fcc Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Thu, 15 Feb 2018 10:37:30 +0100 Subject: [PATCH 315/319] GPII-2515: Updated to latest universal master. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5459d8a..beb126c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "http://issues.gpii.net/browse/GPII", "homepage": "http://gpii.net/", "dependencies": { - "universal": "GPII/universal#06d5b9b672feecac88e2cf8e351248fad503a111" + "universal": "GPII/universal#08b73b801826be40f5516358b463d10d71260e9d" }, "devDependencies": { "fluid-grunt-eslint": "18.1.1", From 21b322b24c04ffb45f842b71a8a5efc581feb9d7 Mon Sep 17 00:00:00 2001 From: Tony Atkins Date: Thu, 15 Feb 2018 10:38:00 +0100 Subject: [PATCH 316/319] GPII-2515: Committed latest package lock file. --- package-lock.json | 5832 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 5832 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..3eaf0a1 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5832 @@ +{ + "name": "gpii-linux", + "version": "0.3.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "JSV": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", + "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=" + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "abstract-leveldown": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.4.1.tgz", + "integrity": "sha1-s7/tuITraToSd18MVenwpCDM7mQ=", + "requires": { + "xtend": "4.0.1" + } + }, + "accepts": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", + "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "requires": { + "mime-types": "2.1.17", + "negotiator": "0.6.1" + } + }, + "acorn": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.4.1.tgz", + "integrity": "sha512-XLmq3H/BVvW6/GbxKryGxWORz1ebilSsUDlyC27bXhWGWAZWkGwS6FLHjOlwFXNFoWFQEO/Df4u0YYd0K3BQgQ==" + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" + }, + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ajv-keywords": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" + }, + "ansi": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", + "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=" + }, + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.4" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", + "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "argsarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/argsarray/-/argsarray-0.0.1.tgz", + "integrity": "sha1-bnIHtOzbObCviDA/pa4ivajfYcs=" + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "array-index": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz", + "integrity": "sha1-7FanSe4QPk4Ix5C5w1PfFgVbl/k=", + "requires": { + "debug": "2.6.7", + "es6-symbol": "3.1.1" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=" + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + }, + "ast-types": { + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.9.6.tgz", + "integrity": "sha1-ECyenpAF0+fjgpvwxPok7oYu6bk=" + }, + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "attempt-x": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/attempt-x/-/attempt-x-1.1.1.tgz", + "integrity": "sha512-hIp37ojJRRW8ExWSxxLpkDHUufk/DFfsb7/cUC1cVbBg7JV4gJTkCTRa44dlL9e5jx1P3VNrjL7QOQfi4MyltA==" + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=" + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base62": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/base62/-/base62-0.1.1.tgz", + "integrity": "sha1-e0F0wvlESXU7EcJlHAg9qEGnsIQ=" + }, + "base64url": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-1.0.6.tgz", + "integrity": "sha1-1k03XWinxkDZEuI1jRcNylu1RoE=", + "requires": { + "concat-stream": "1.4.10", + "meow": "2.0.0" + } + }, + "basic-auth": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.0.4.tgz", + "integrity": "sha1-Awk1sB3nyblKgksp8/zLdQ06UpA=" + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "bindings": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz", + "integrity": "sha1-FK1hE4EtLTfXLme0ystLtyZQXxE=" + }, + "bl": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.1.tgz", + "integrity": "sha1-ysMo977kVzDUBLaSID/LWQ4XLV4=", + "requires": { + "readable-stream": "2.3.4" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", + "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "requires": { + "inherits": "2.0.3" + } + }, + "bluebird": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.1.tgz", + "integrity": "sha1-tzHd9I4t077awudeEhWhG8uR+gc=" + }, + "body-parser": { + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.17.2.tgz", + "integrity": "sha1-+IkqvI+eYn1Crtr7yma/WrmRBO4=", + "requires": { + "bytes": "2.4.0", + "content-type": "1.0.4", + "debug": "2.6.7", + "depd": "1.1.2", + "http-errors": "1.6.2", + "iconv-lite": "0.4.15", + "on-finished": "2.3.0", + "qs": "6.4.0", + "raw-body": "2.2.0", + "type-is": "1.6.15" + } + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-from": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-0.1.1.tgz", + "integrity": "sha1-V7GLHaChnsBvM4N6UnWiQjUb114=", + "requires": { + "is-array-buffer-x": "1.7.0" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "bytes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", + "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=" + }, + "cached-constructors-x": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cached-constructors-x/-/cached-constructors-x-1.0.0.tgz", + "integrity": "sha512-JVP0oilYlPgBTD8bkQ+of7hSIJRtydCCJiMtzdRMXVQ98gdj0NyrJTZzbu5wtlO26Ev/1HXRTtbBNsVlLJ3+3A==" + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + }, + "camelcase-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz", + "integrity": "sha1-vRoRv5sxoc5JNJOpMN4aC69K1+w=", + "requires": { + "camelcase": "1.2.1", + "map-obj": "1.0.1" + } + }, + "caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=" + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chai": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", + "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", + "requires": { + "assertion-error": "1.1.0", + "deep-eql": "0.1.3", + "type-detect": "1.0.0" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "chownr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=" + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + } + } + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "coffee-script": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.10.0.tgz", + "integrity": "sha1-EpOLz5vhlI+gBvkuDEyegXBRCMA=", + "dev": true + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", + "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==" + }, + "commoner": { + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/commoner/-/commoner-0.10.8.tgz", + "integrity": "sha1-NPw2cs0kOT6LtH5wyqApOBH08sU=", + "requires": { + "commander": "2.14.1", + "detective": "4.7.1", + "glob": "5.0.15", + "graceful-fs": "4.1.11", + "iconv-lite": "0.4.15", + "mkdirp": "0.5.1", + "private": "0.1.8", + "q": "1.5.1", + "recast": "0.11.23" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "compressible": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.12.tgz", + "integrity": "sha1-xZpcmdt2dn6YdlAOJx72OzSTvWY=", + "requires": { + "mime-db": "1.30.0" + } + }, + "compression": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.6.2.tgz", + "integrity": "sha1-zOsSHsydCcUtetDDNQ6pPd1AK8M=", + "requires": { + "accepts": "1.3.4", + "bytes": "2.3.0", + "compressible": "2.0.12", + "debug": "2.2.0", + "on-headers": "1.0.1", + "vary": "1.1.2" + }, + "dependencies": { + "bytes": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.3.0.tgz", + "integrity": "sha1-1baAoWW2IBc5rLYRVCqrwtjOsHA=" + }, + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.10.tgz", + "integrity": "sha1-rMO79WAsuMyYDGrIQPp9hgPj7zY=", + "requires": { + "inherits": "2.0.3", + "readable-stream": "1.1.14", + "typedarray": "0.0.6" + } + }, + "connect-ensure-login": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/connect-ensure-login/-/connect-ensure-login-0.1.1.tgz", + "integrity": "sha1-F03MUSQ7nqwj+NmCFa62aU4uihI=" + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.1.tgz", + "integrity": "sha1-aw7mqN7CegY69C0YilkswdcrpPQ=", + "requires": { + "cookie": "0.2.3", + "cookie-signature": "1.0.6" + }, + "dependencies": { + "cookie": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.2.3.tgz", + "integrity": "sha1-GllTavaFN6IReKATRvh8sFnSrlw=" + } + } + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "couchdb-calculate-session-id": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/couchdb-calculate-session-id/-/couchdb-calculate-session-id-1.1.2.tgz", + "integrity": "sha1-NkoVao23thIDleo+IQ8k7wwlWhw=", + "requires": { + "aproba": "1.2.0", + "base64url": "2.0.0", + "crypto-lite": "0.2.0" + }, + "dependencies": { + "base64url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", + "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" + }, + "crypto-lite": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/crypto-lite/-/crypto-lite-0.2.0.tgz", + "integrity": "sha1-OhTPYwOEYaXrhZRd54vwTeTar3M=" + } + } + }, + "couchdb-eval": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/couchdb-eval/-/couchdb-eval-1.0.6.tgz", + "integrity": "sha1-A85qFNpijJ+XtgJpBTv7/+nLNTk=", + "requires": { + "extend": "1.3.0", + "pouchdb-plugin-error": "1.0.1" + } + }, + "couchdb-objects": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/couchdb-objects/-/couchdb-objects-1.0.7.tgz", + "integrity": "sha1-Cn5AZ96eCMocV244IhQtKqVYBNg=", + "requires": { + "extend": "1.3.0", + "header-case-normalizer": "1.0.3", + "is-empty": "0.0.1", + "pouchdb-promise": "0.0.0", + "random-uuid-v4": "0.0.4" + }, + "dependencies": { + "bluebird": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz", + "integrity": "sha1-WYXsI8tv8aWDTMZEezxe8BD9Mho=" + }, + "lie": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/lie/-/lie-2.7.7.tgz", + "integrity": "sha1-fPlZvtSJWbBi8Drka7vzqsMCark=", + "requires": { + "immediate": "3.0.6" + } + }, + "pouchdb-promise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-0.0.0.tgz", + "integrity": "sha1-PAFOYndm2UW+PycOB5p9tNLRmCc=", + "requires": { + "bluebird": "1.2.4", + "lie": "2.7.7" + } + } + } + }, + "couchdb-render": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/couchdb-render/-/couchdb-render-1.0.1.tgz", + "integrity": "sha1-iS5aQEDb3A0HuODKEsD1erG7EC8=", + "requires": { + "couchdb-eval": "1.0.6", + "couchdb-resp-completer": "1.0.3", + "extend": "1.3.0", + "is-empty": "0.0.1", + "pouchdb-plugin-error": "1.0.1" + } + }, + "couchdb-resp-completer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/couchdb-resp-completer/-/couchdb-resp-completer-1.0.3.tgz", + "integrity": "sha1-qksMAr8JBv33Nn+/i96OCsUy0hM=", + "requires": { + "extend": "1.3.0", + "is-empty": "0.0.1", + "pouchdb-plugin-error": "1.0.1" + } + }, + "crc": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/crc/-/crc-3.4.4.tgz", + "integrity": "sha1-naHpgOO9RPxck79as9ozeNheRms=" + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "requires": { + "boom": "2.10.1" + } + }, + "crypto-lite": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/crypto-lite/-/crypto-lite-0.1.0.tgz", + "integrity": "sha1-l2ug9uu3PrWAZEvwjVPqhKxAxJA=" + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "1.0.2" + } + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "requires": { + "es5-ext": "0.10.38" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "dateformat": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", + "dev": true, + "requires": { + "get-stdin": "4.0.1", + "meow": "3.7.0" + }, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + } + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.4.0", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "debug": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", + "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "requires": { + "type-detect": "0.1.1" + }, + "dependencies": { + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=" + } + } + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" + }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=" + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "requires": { + "abstract-leveldown": "2.6.3" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "4.0.1" + } + } + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=" + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "detective": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", + "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", + "requires": { + "acorn": "5.4.1", + "defined": "1.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + } + } + }, + "double-ended-queue": { + "version": "2.1.0-0", + "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", + "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" + }, + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "requires": { + "readable-stream": "1.1.14" + } + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "1.4.0" + } + }, + "end-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/end-stream/-/end-stream-0.1.0.tgz", + "integrity": "sha1-MgA/P0OKKwFDFoE3+PpumGbIHtU=", + "requires": { + "write-stream": "0.4.3" + } + }, + "equals": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/equals/-/equals-1.0.5.tgz", + "integrity": "sha1-ISBi3eXhpRDZVfE1mO/MamIbas4=", + "requires": { + "jkroso-type": "1.1.1" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "requires": { + "prr": "1.0.1" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es3ify": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/es3ify/-/es3ify-0.1.4.tgz", + "integrity": "sha1-rZ+l3xrjTz8x4SEbWBiy1RB439E=", + "requires": { + "esprima-fb": "3001.1.0-dev-harmony-fb", + "jstransform": "3.0.0", + "through": "2.3.8" + } + }, + "es5-ext": { + "version": "0.10.38", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.38.tgz", + "integrity": "sha512-jCMyePo7AXbUESwbl8Qi01VSH2piY9s/a3rSU/5w/MlTIx8HPL1xn2InGN8ejt/xulcJgnTO7vqNtOAxzYd2Kg==", + "requires": { + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.38", + "es6-symbol": "3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.38", + "es6-iterator": "2.0.3", + "es6-set": "0.1.5", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.38", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.38" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.38", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "escope": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, + "requires": { + "es6-map": "0.1.5", + "es6-weak-map": "2.0.2", + "esrecurse": "4.2.0", + "estraverse": "4.2.0" + } + }, + "esmangle-evaluator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esmangle-evaluator/-/esmangle-evaluator-1.0.1.tgz", + "integrity": "sha1-Yg2GbvSGGzMR91dm1SqFcrs8YzY=" + }, + "espree": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.1.4.tgz", + "integrity": "sha1-BybXrIOvl6fISY2ps2OjYJ0qaKE=", + "dev": true, + "requires": { + "acorn": "3.3.0", + "acorn-jsx": "3.0.1" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "esprima-fb": { + "version": "3001.1.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz", + "integrity": "sha1-t303q8046gt3Qmu4vCkizmtCZBE=" + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "4.2.0", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.38" + } + }, + "eventemitter2": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", + "dev": true + }, + "execspawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/execspawn/-/execspawn-1.0.1.tgz", + "integrity": "sha1-gob53efOzeeQX73ATiTzaPI/jaY=", + "requires": { + "util-extend": "1.0.3" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, + "expand-template": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.0.tgz", + "integrity": "sha512-kkjwkMqj0h4w/sb32ERCDxCQkREMCAgS39DscDnSwDsbxnwwM1BTZySdC3Bn1lhY7vL08n9GoO/fVTynjDgRyQ==" + }, + "express": { + "version": "4.15.4", + "resolved": "https://registry.npmjs.org/express/-/express-4.15.4.tgz", + "integrity": "sha1-Ay4iU0ic+PzgJma+yj0R7XotrtE=", + "requires": { + "accepts": "1.3.4", + "array-flatten": "1.1.1", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.8", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.0.6", + "fresh": "0.5.0", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "1.1.5", + "qs": "6.5.0", + "range-parser": "1.2.0", + "send": "0.15.4", + "serve-static": "1.12.4", + "setprototypeof": "1.0.3", + "statuses": "1.3.1", + "type-is": "1.6.15", + "utils-merge": "1.0.0", + "vary": "1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + }, + "qs": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz", + "integrity": "sha512-fjVFjW9yhqMhVGwRExCXLhJKrLlkYSaxNWdyc9rmHlrVZbk35YHH312dFd7191uQeXkI3mKLZTIbSvIeFwFemg==" + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "express-pouchdb": { + "version": "git://github.com/the-t-in-rtf/express-pouchdb.git#df8e81f52bec90c36984bb6f148530f4e6c64bf7", + "requires": { + "basic-auth": "1.0.4", + "bluebird": "3.4.1", + "body-parser": "1.17.1", + "compression": "1.6.2", + "cookie-parser": "1.4.1", + "extend": "1.3.0", + "header-case-normalizer": "1.0.3", + "mkdirp": "0.5.1", + "multiparty": "3.3.2", + "node-uuid": "1.4.7", + "on-finished": "2.3.0", + "pouchdb-all-dbs": "git://github.com/the-t-in-rtf/pouchdb-all-dbs.git#d6a515d0e896d55ede815aaebfedccb5239064a3", + "pouchdb-auth": "2.1.1", + "pouchdb-find": "0.10.3", + "pouchdb-list": "1.1.0", + "pouchdb-replicator": "2.1.3", + "pouchdb-rewrite": "1.0.7", + "pouchdb-security": "1.2.6", + "pouchdb-show": "1.0.8", + "pouchdb-size": "1.2.2", + "pouchdb-update": "1.0.8", + "pouchdb-validation": "1.2.1", + "pouchdb-vhost": "1.0.2", + "pouchdb-wrappers": "1.3.6", + "raw-body": "2.1.7" + }, + "dependencies": { + "body-parser": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.17.1.tgz", + "integrity": "sha1-dbO8mN3W5+DY/+dQ36ylxmmT+kc=", + "requires": { + "bytes": "2.4.0", + "content-type": "1.0.4", + "debug": "2.6.1", + "depd": "1.1.2", + "http-errors": "1.6.2", + "iconv-lite": "0.4.15", + "on-finished": "2.3.0", + "qs": "6.4.0", + "raw-body": "2.2.0", + "type-is": "1.6.15" + }, + "dependencies": { + "raw-body": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.2.0.tgz", + "integrity": "sha1-mUl2z2pQlqQRYoQEkvC9xdbn+5Y=", + "requires": { + "bytes": "2.4.0", + "iconv-lite": "0.4.15", + "unpipe": "1.0.0" + } + } + } + }, + "debug": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "integrity": "sha1-eYVQkLosTjEVzH2HaUkdWPBJE1E=", + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" + }, + "node-uuid": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", + "integrity": "sha1-baWhdmjEs91ZYjvaEc9/pMH2Cm8=" + }, + "raw-body": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.1.7.tgz", + "integrity": "sha1-rf6s4uT7MJgFgBTQjActzFl1h3Q=", + "requires": { + "bytes": "2.4.0", + "iconv-lite": "0.4.13", + "unpipe": "1.0.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.13", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", + "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=" + } + } + } + } + }, + "express-session": { + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.15.4.tgz", + "integrity": "sha1-Xizc9t7+PB7aTpgPE7mGzFjPuVQ=", + "requires": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "crc": "3.4.4", + "debug": "2.6.8", + "depd": "1.1.2", + "on-headers": "1.0.1", + "parseurl": "1.3.2", + "uid-safe": "2.1.5", + "utils-merge": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "extend": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extend/-/extend-1.3.0.tgz", + "integrity": "sha1-0VFvsP9WJNLr+RI+odrFoZlABPg=" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "falafel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/falafel/-/falafel-1.2.0.tgz", + "integrity": "sha1-wY0k71CRF0pJfzGM0ksCaiXN2rQ=", + "requires": { + "acorn": "1.2.2", + "foreach": "2.0.5", + "isarray": "0.0.1", + "object-keys": "1.0.11" + }, + "dependencies": { + "acorn": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-1.2.2.tgz", + "integrity": "sha1-yM4n3grMdtiW0rH6099YjZ6C8BQ=" + } + } + }, + "fast-future": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fast-future/-/fast-future-1.0.2.tgz", + "integrity": "sha1-hDWpqqAteSSNF9cE52JZMB2ZKAo=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "file-entry-cache": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.3.1.tgz", + "integrity": "sha1-RMYepgeuS+nBQC9B9EJwy/4zT/g=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "finalhandler": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz", + "integrity": "sha1-AHrqM9Gk0+QgF/YkhIrVjSEvgU8=", + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.3.1", + "unpipe": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "findup-sync": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "dev": true, + "requires": { + "glob": "5.0.15" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "fluid-eslint": { + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/fluid-eslint/-/fluid-eslint-2.10.2.tgz", + "integrity": "sha1-/naYSwotFMZQ/dDRMow8y5ET+ew=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "concat-stream": "1.4.10", + "debug": "2.6.7", + "doctrine": "1.5.0", + "es6-map": "0.1.5", + "escope": "3.6.0", + "espree": "3.1.4", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "file-entry-cache": "1.3.1", + "glob": "7.1.2", + "globals": "9.18.0", + "ignore": "3.3.7", + "imurmurhash": "0.1.4", + "inquirer": "0.12.0", + "is-my-json-valid": "2.17.2", + "is-resolvable": "1.1.0", + "js-yaml": "3.10.0", + "json-stable-stringify": "1.0.1", + "lodash": "4.17.5", + "mkdirp": "0.5.1", + "optionator": "0.8.2", + "path-is-absolute": "1.0.1", + "path-is-inside": "1.0.2", + "pluralize": "1.2.1", + "progress": "1.1.8", + "require-uncached": "1.0.3", + "shelljs": "0.6.1", + "strip-json-comments": "1.0.4", + "table": "3.8.3", + "text-table": "0.2.0", + "user-home": "2.0.0" + }, + "dependencies": { + "strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true + } + } + }, + "fluid-grunt-eslint": { + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/fluid-grunt-eslint/-/fluid-grunt-eslint-18.1.1.tgz", + "integrity": "sha1-7bz9YFJU2LjvLPgJ5YOvIgGKgmk=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "fluid-eslint": "2.10.2" + } + }, + "fluid-resolve": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fluid-resolve/-/fluid-resolve-1.3.0.tgz", + "integrity": "sha1-ODAp6xphlpgCvYVoTI4obm0sDf0=" + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.17" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", + "integrity": "sha1-9HTKXmqSRtb9jglTz6m5yAWvp44=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "gauge": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", + "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", + "requires": { + "ansi": "0.3.1", + "has-unicode": "2.0.1", + "lodash.pad": "4.5.1", + "lodash.padend": "4.6.1", + "lodash.padstart": "4.6.1" + } + }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=" + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "requires": { + "is-property": "1.0.2" + } + }, + "get-folder-size": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/get-folder-size/-/get-folder-size-0.1.1.tgz", + "integrity": "sha1-0bhMUQC/lqfFE4DqPOBAAiEIqKA=", + "requires": { + "async": "0.9.2", + "minimist": "0.1.0" + }, + "dependencies": { + "minimist": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.1.0.tgz", + "integrity": "sha1-md9lelJXTCHJBXSX33QnkLK0wN4=" + } + } + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" + }, + "getobject": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", + "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "ghreleases": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ghreleases/-/ghreleases-1.0.7.tgz", + "integrity": "sha512-1lFGyLLF38Q6cFCDyebN5vzQ2P9DEaAgxPIDLmQwQDVDmUe2Wgv+6dhAIoHeA+My4HLpaJ+dKF73xtuykN2cbQ==", + "requires": { + "after": "0.8.2", + "ghrepos": "2.1.0", + "ghutils": "3.2.2", + "simple-mime": "0.1.0", + "url-template": "2.0.8", + "xtend": "4.0.1" + } + }, + "ghrepos": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ghrepos/-/ghrepos-2.1.0.tgz", + "integrity": "sha512-6GM0ohSDTAv7xD6GsKfxJiV/CajoofRyUwu0E8l29d1o6lFAUxmmyMP/FH33afA20ZrXzxxcTtN6TsYvudMoAg==", + "requires": { + "ghutils": "3.2.2" + } + }, + "ghutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/ghutils/-/ghutils-3.2.2.tgz", + "integrity": "sha512-6SqTlzs89EtYRlafY8oavTnn/vEErgRSnMsuFDwOzNgK34mpHXTBinh6rTx6xwqei3d3BWyrSTQ8uN9kPpEQtg==", + "requires": { + "jsonist": "2.1.0", + "xtend": "4.0.1" + } + }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "gpii-express": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/gpii-express/-/gpii-express-1.0.9.tgz", + "integrity": "sha1-uNu+biNjhRkYaK8nChSucQ4PMfo=", + "requires": { + "body-parser": "1.17.2", + "cookie-parser": "1.4.3", + "express": "4.15.3", + "express-session": "1.15.4", + "infusion": "3.0.0-dev.20170724T165035Z.eee50c1" + }, + "dependencies": { + "cookie-parser": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.3.tgz", + "integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=", + "requires": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6" + } + }, + "express": { + "version": "4.15.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.15.3.tgz", + "integrity": "sha1-urZdDwOqgMNYQIly/HAPkWlEtmI=", + "requires": { + "accepts": "1.3.4", + "array-flatten": "1.1.1", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.7", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.0.6", + "fresh": "0.5.0", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "1.1.5", + "qs": "6.4.0", + "range-parser": "1.2.0", + "send": "0.15.3", + "serve-static": "1.12.3", + "setprototypeof": "1.0.3", + "statuses": "1.3.1", + "type-is": "1.6.15", + "utils-merge": "1.0.0", + "vary": "1.1.2" + } + }, + "infusion": { + "version": "3.0.0-dev.20170724T165035Z.eee50c1", + "resolved": "https://registry.npmjs.org/infusion/-/infusion-3.0.0-dev.20170724T165035Z.eee50c1.tgz", + "integrity": "sha1-tF5RlzLPUF/xUE7QH1JCe1citEc=", + "requires": { + "fluid-resolve": "1.3.0" + } + }, + "send": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.3.tgz", + "integrity": "sha1-UBP5+ZAj31DRvZiSwZ4979HVMwk=", + "requires": { + "debug": "2.6.7", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.0", + "http-errors": "1.6.2", + "mime": "1.3.4", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + } + }, + "serve-static": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz", + "integrity": "sha1-n0uhni8wMMVH+K+ZEHg47DjVseI=", + "requires": { + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.15.3" + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "gpii-pouchdb": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/gpii-pouchdb/-/gpii-pouchdb-1.0.7.tgz", + "integrity": "sha1-Ok85Yly/ytce/lVaefsFVIFerWs=", + "requires": { + "body-parser": "1.17.2", + "express": "4.15.3", + "express-pouchdb": "git://github.com/the-t-in-rtf/express-pouchdb.git#df8e81f52bec90c36984bb6f148530f4e6c64bf7", + "gpii-express": "1.0.9", + "graceful-fs": "4.1.11", + "infusion": "3.0.0-dev.20170727T125648Z.47055ca", + "lie": "3.1.1", + "memdown": "1.2.4", + "pouchdb": "6.1.2", + "underscore-node": "0.1.2" + }, + "dependencies": { + "express": { + "version": "4.15.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.15.3.tgz", + "integrity": "sha1-urZdDwOqgMNYQIly/HAPkWlEtmI=", + "requires": { + "accepts": "1.3.4", + "array-flatten": "1.1.1", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.7", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.0.6", + "fresh": "0.5.0", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "1.1.5", + "qs": "6.4.0", + "range-parser": "1.2.0", + "send": "0.15.3", + "serve-static": "1.12.3", + "setprototypeof": "1.0.3", + "statuses": "1.3.1", + "type-is": "1.6.15", + "utils-merge": "1.0.0", + "vary": "1.1.2" + } + }, + "infusion": { + "version": "3.0.0-dev.20170727T125648Z.47055ca", + "resolved": "https://registry.npmjs.org/infusion/-/infusion-3.0.0-dev.20170727T125648Z.47055ca.tgz", + "integrity": "sha1-T0F2nj3l2basSdrdpOKI3LUccdU=", + "requires": { + "fluid-resolve": "1.3.0" + } + }, + "send": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.3.tgz", + "integrity": "sha1-UBP5+ZAj31DRvZiSwZ4979HVMwk=", + "requires": { + "debug": "2.6.7", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.0", + "http-errors": "1.6.2", + "mime": "1.3.4", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + } + }, + "serve-static": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz", + "integrity": "sha1-n0uhni8wMMVH+K+ZEHg47DjVseI=", + "requires": { + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.15.3" + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "grunt": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.1.tgz", + "integrity": "sha1-6HeHZOlEsY8yuw8QuQeEdcnftWs=", + "dev": true, + "requires": { + "coffee-script": "1.10.0", + "dateformat": "1.0.12", + "eventemitter2": "0.4.14", + "exit": "0.1.2", + "findup-sync": "0.3.0", + "glob": "7.0.6", + "grunt-cli": "1.2.0", + "grunt-known-options": "1.1.0", + "grunt-legacy-log": "1.0.0", + "grunt-legacy-util": "1.0.0", + "iconv-lite": "0.4.15", + "js-yaml": "3.5.5", + "minimatch": "3.0.4", + "nopt": "3.0.6", + "path-is-absolute": "1.0.1", + "rimraf": "2.2.8" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "grunt-cli": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", + "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", + "dev": true, + "requires": { + "findup-sync": "0.3.0", + "grunt-known-options": "1.1.0", + "nopt": "3.0.6", + "resolve": "1.1.7" + } + }, + "js-yaml": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz", + "integrity": "sha1-A3fDgBfKvHMisNH7zSWkkWQfL74=", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "2.7.3" + } + }, + "rimraf": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", + "dev": true + } + } + }, + "grunt-jsonlint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grunt-jsonlint/-/grunt-jsonlint-1.0.4.tgz", + "integrity": "sha1-tmMaKd57ervP2ENReqX1WeOhb3A=", + "dev": true, + "requires": { + "jsonlint": "1.6.0" + }, + "dependencies": { + "jsonlint": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.0.tgz", + "integrity": "sha1-iKpGvCiaesk7tGyuLVihh6m7SUo=", + "dev": true, + "requires": { + "JSV": "4.0.2", + "nomnom": "1.8.1" + } + } + } + }, + "grunt-known-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.0.tgz", + "integrity": "sha1-pCdO6zL6dl2lp6OxcSYXzjsUQUk=", + "dev": true + }, + "grunt-legacy-log": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-1.0.0.tgz", + "integrity": "sha1-+4bxgJhHvAfcR4Q/ns1srLYt8tU=", + "dev": true, + "requires": { + "colors": "1.1.2", + "grunt-legacy-log-utils": "1.0.0", + "hooker": "0.2.3", + "lodash": "3.10.1", + "underscore.string": "3.2.3" + }, + "dependencies": { + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + } + } + }, + "grunt-legacy-log-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-1.0.0.tgz", + "integrity": "sha1-p7ji0Ps1taUPSvmG/BEnSevJbz0=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "lodash": "4.3.0" + }, + "dependencies": { + "lodash": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz", + "integrity": "sha1-79nEpuxT87BUEkKZFcPkgk5NJaQ=", + "dev": true + } + } + }, + "grunt-legacy-util": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.0.0.tgz", + "integrity": "sha1-OGqnjcbtUJhsKxiVcmWxtIq7m4Y=", + "dev": true, + "requires": { + "async": "1.5.2", + "exit": "0.1.2", + "getobject": "0.1.0", + "hooker": "0.2.3", + "lodash": "4.3.0", + "underscore.string": "3.2.3", + "which": "1.2.14" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "lodash": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz", + "integrity": "sha1-79nEpuxT87BUEkKZFcPkgk5NJaQ=", + "dev": true + }, + "which": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", + "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + } + } + }, + "grunt-shell": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/grunt-shell/-/grunt-shell-1.3.0.tgz", + "integrity": "sha1-3lYGCpNN+OzuZAdLYcYwSQDXEVg=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "npm-run-path": "1.0.0", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "requires": { + "chalk": "1.1.3", + "commander": "2.14.1", + "is-my-json-valid": "2.17.2", + "pinkie-promise": "2.0.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-color": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=" + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "has-own-property-x": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/has-own-property-x/-/has-own-property-x-3.2.0.tgz", + "integrity": "sha512-HtRQTYpRFz/YVaQ7jh2mU5iorMAxFcML9FNOLMI1f8VNJ2K0hpOlXoi1a+nmVl6oUcGnhd6zYOFAVe7NUFStyQ==", + "requires": { + "cached-constructors-x": "1.0.0", + "to-object-x": "1.5.0", + "to-property-key-x": "2.0.2" + } + }, + "has-symbol-support-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.1.tgz", + "integrity": "sha512-JkaetveU7hFbqnAC1EV1sF4rlojU2D4Usc5CmS69l6NfmPDnpnFUegzFg33eDkkpNCxZ0mQp65HwUDrNFS/8MA==" + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "requires": { + "has-symbol-support-x": "1.4.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "header-case-normalizer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/header-case-normalizer/-/header-case-normalizer-1.0.3.tgz", + "integrity": "sha1-+x1MjQxhadyrT3x+IbGGpqIqwME=" + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" + }, + "hooker": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", + "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", + "dev": true + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "dev": true + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.4.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + } + } + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "hyperquest": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/hyperquest/-/hyperquest-2.1.3.tgz", + "integrity": "sha512-fUuDOrB47PqNK/BAMOS13v41UoaqIxqSLHX6CAbOD7OfT+/GCWO1/vPLfTNutOeXrv1ikuaZ3yux+33Z9vh+rw==", + "requires": { + "buffer-from": "0.1.1", + "duplexer2": "0.0.2", + "through2": "0.6.5" + } + }, + "iconv-lite": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz", + "integrity": "sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es=" + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "indent-string": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-1.2.2.tgz", + "integrity": "sha1-25m8xYPrarux5I3LsZmamGBBy2s=", + "requires": { + "get-stdin": "4.0.1", + "minimist": "1.2.0", + "repeating": "1.1.3" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, + "infinity-x": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/infinity-x/-/infinity-x-1.0.0.tgz", + "integrity": "sha512-wjy2TupBtZ+aAniKt+xs/PO0xOkuaL6wBysUKbgD7aL1PMW/qY5xXDG59zXZ7dU+gk3zwXOu4yIEWPCEFBTgHQ==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "infusion": { + "version": "3.0.0-dev.20170830T182157Z.392b2f8", + "resolved": "https://registry.npmjs.org/infusion/-/infusion-3.0.0-dev.20170830T182157Z.392b2f8.tgz", + "integrity": "sha1-9OuvAM/uGpxX0FbuYMXi7vFTLok=", + "requires": { + "fluid-resolve": "1.3.0" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "git://github.com/GPII/ini.git#be8a04aa22f5ad9321ebcbba7740314a53bc8ab2" + }, + "inline-process-browser": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/inline-process-browser/-/inline-process-browser-1.0.0.tgz", + "integrity": "sha1-RqYbFT3TybFiSxoAYm7bT39BTyI=", + "requires": { + "falafel": "1.2.0", + "through2": "0.6.5" + } + }, + "inquirer": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", + "dev": true, + "requires": { + "ansi-escapes": "1.4.0", + "ansi-regex": "2.1.1", + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "cli-width": "2.2.0", + "figures": "1.7.0", + "lodash": "4.17.5", + "readline2": "1.0.1", + "run-async": "0.1.0", + "rx-lite": "3.1.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "through": "2.3.8" + } + }, + "ipaddr.js": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.4.0.tgz", + "integrity": "sha1-KWrKh4qCGBbluF0KKFqZvP9FgvA=" + }, + "is-array": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-array/-/is-array-1.0.1.tgz", + "integrity": "sha1-6YUMwsyGDDvAl36EzPDdRkWEJ5o=" + }, + "is-array-buffer-x": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/is-array-buffer-x/-/is-array-buffer-x-1.7.0.tgz", + "integrity": "sha512-ufSZRMY2WZX5xyNvk0NOZAG7cgi35B/sGQDGqv8w0X7MoQ2GC9vedanJhuYTPaC4PUCqLQsda1w7NF+dPZmAJw==", + "requires": { + "attempt-x": "1.1.1", + "has-to-string-tag-x": "1.4.1", + "is-object-like-x": "1.6.0", + "object-get-own-property-descriptor-x": "3.2.0", + "to-string-tag-x": "1.4.2" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + }, + "is-empty": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/is-empty/-/is-empty-0.0.1.tgz", + "integrity": "sha1-Cf3D1kndpZaRVsCFOpt2vXgcWjM=" + }, + "is-falsey-x": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-falsey-x/-/is-falsey-x-1.0.1.tgz", + "integrity": "sha512-XWNZC4A+3FX1ECoMjspuEFgSdio82IWjqY/suE0gZ10QA7nzHd/KraRq7Tc5VEHtFRgTRyTdY6W+ykPrDnyoAQ==", + "requires": { + "to-boolean-x": "1.0.1" + } + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-finite-x": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-finite-x/-/is-finite-x-3.0.2.tgz", + "integrity": "sha512-HyFrxJZsgmP5RtR1PVlVvHSP4VslZOqr4uoq4x3rDrSOFaYp4R9tfmiWtAzQxPzixXhac3cYEno3NuVn0OHk2Q==", + "requires": { + "infinity-x": "1.0.0", + "is-nan-x": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-function-x": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/is-function-x/-/is-function-x-3.3.0.tgz", + "integrity": "sha512-SreSSU1dlgYaXR5c0mm4qJHKYHIiGiEY+7Cd8/aRLLoMP/VvofD2XcWgBnP833ajpU5XzXbUSpfysnfKZLJFlg==", + "requires": { + "attempt-x": "1.1.1", + "has-to-string-tag-x": "1.4.1", + "is-falsey-x": "1.0.1", + "is-primitive": "2.0.0", + "normalize-space-x": "3.0.0", + "replace-comments-x": "2.0.0", + "to-boolean-x": "1.0.1", + "to-string-tag-x": "1.4.2" + } + }, + "is-index-x": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-index-x/-/is-index-x-1.1.0.tgz", + "integrity": "sha512-qULKLMepQLGC8rSVdi8uF2vI4LiDrU9XSDg1D+Aa657GIB7GV1jHpga7uXgQvkt/cpQ5mVBHUFTpSehYSqT6+A==", + "requires": { + "math-clamp-x": "1.2.0", + "max-safe-integer": "1.0.1", + "to-integer-x": "3.0.0", + "to-number-x": "2.0.0", + "to-string-symbols-supported-x": "1.0.0" + } + }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==" + }, + "is-my-json-valid": { + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", + "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", + "requires": { + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "is-my-ip-valid": "1.0.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" + } + }, + "is-nan-x": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-nan-x/-/is-nan-x-1.0.1.tgz", + "integrity": "sha512-VfNJgfuT8USqKCYQss8g7sFvCzDnL+OOVMQoXhVoulZAyp0ZTj3oyZaaPrn2dxepAkKSQI2BiKHbBabX1DqVtw==" + }, + "is-nil-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/is-nil-x/-/is-nil-x-1.4.1.tgz", + "integrity": "sha512-cfTKWI5iSR04SSCzzugTH5tS2rYG7kwI8yl/AqWkyuxZ7k55cbA47Y7Lezdg1N9aaELd+UxLg628bdQeNQ6BUw==", + "requires": { + "lodash.isnull": "3.0.0", + "validate.io-undefined": "1.0.3" + } + }, + "is-object-like-x": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/is-object-like-x/-/is-object-like-x-1.6.0.tgz", + "integrity": "sha512-mc3dBMv1jEOdk0f1i2RkJFsZDux0MuHqGwHOoRo770ShUOf4VE6tWThAW8dAZARr9a5RN+iNX1yzMDA5ad1clQ==", + "requires": { + "is-function-x": "3.3.0", + "is-primitive": "2.0.0" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=" + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-string": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.4.tgz", + "integrity": "sha1-zDqbaYV9Yh6WNyWiTK7shzuCbmQ=" + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "istanbul": { + "version": "git://github.com/the-t-in-rtf/istanbul.git#828eb930add7bd663ca20649a917f3f3829e48c5", + "dev": true, + "requires": { + "abbrev": "1.0.9", + "async": "1.5.2", + "escodegen": "1.8.1", + "esprima": "2.7.3", + "glob": "5.0.15", + "handlebars": "4.0.11", + "js-yaml": "3.10.0", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "once": "1.4.0", + "resolve": "1.1.7", + "supports-color": "3.2.3", + "which": "1.3.0", + "wordwrap": "1.0.0" + }, + "dependencies": { + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "jkroso-type": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jkroso-type/-/jkroso-type-1.1.1.tgz", + "integrity": "sha1-vEztbWxF/gdFKCuvyGqfjE/JzmE=" + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + } + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonist": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/jsonist/-/jsonist-2.1.0.tgz", + "integrity": "sha1-RHek0WzTd/rsWNjPhwt+OS9tf+k=", + "requires": { + "bl": "1.2.1", + "hyperquest": "2.1.3", + "json-stringify-safe": "5.0.1", + "xtend": "4.0.1" + } + }, + "jsonlint": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.2.tgz", + "integrity": "sha1-VzcEUIX1XrRVxosf9OvAG9UOiDA=", + "requires": { + "JSV": "4.0.2", + "nomnom": "1.8.1" + } + }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "jstransform": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jstransform/-/jstransform-3.0.0.tgz", + "integrity": "sha1-olkats7o2XvzvoMNv6IxO4fNZAs=", + "requires": { + "base62": "0.1.1", + "esprima-fb": "3001.1.0-dev-harmony-fb", + "source-map": "0.1.31" + } + }, + "kettle": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/kettle/-/kettle-1.7.0.tgz", + "integrity": "sha1-Yb40SG6rp2LOV/MKR1cCR8ZIyvI=", + "requires": { + "body-parser": "1.17.2", + "cookie-parser": "1.4.3", + "express": "4.15.4", + "express-session": "1.15.5", + "fluid-resolve": "1.3.0", + "infusion": "3.0.0-dev.20170830T182157Z.392b2f8", + "json5": "0.5.1", + "jsonlint": "1.6.2", + "path-to-regexp": "1.7.0", + "serve-static": "1.12.3", + "ws": "3.1.0" + }, + "dependencies": { + "cookie-parser": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.3.tgz", + "integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=", + "requires": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6" + } + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + }, + "express-session": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.15.5.tgz", + "integrity": "sha512-BBVy6E/XqjB507wqe5T+7Ia2N/gtur/dT/fKmvGGKQqUrzI4dcBPGJgV4t2ciX7FoxZPhZcKTDTmb4+5nCyQOw==", + "requires": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "crc": "3.4.4", + "debug": "2.6.8", + "depd": "1.1.2", + "on-headers": "1.0.1", + "parseurl": "1.3.2", + "uid-safe": "2.1.5", + "utils-merge": "1.0.0" + } + }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "requires": { + "isarray": "0.0.1" + } + }, + "send": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.3.tgz", + "integrity": "sha1-UBP5+ZAj31DRvZiSwZ4979HVMwk=", + "requires": { + "debug": "2.6.7", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.0", + "http-errors": "1.6.2", + "mime": "1.3.4", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + }, + "dependencies": { + "debug": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", + "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "serve-static": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz", + "integrity": "sha1-n0uhni8wMMVH+K+ZEHg47DjVseI=", + "requires": { + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.15.3" + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "level-codec": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.0.tgz", + "integrity": "sha1-x1W2jQ1E/6Cxy6BEuPgaVaFK05s=" + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "0.1.7" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "2.0.3", + "level-errors": "1.0.5", + "readable-stream": "1.1.14", + "xtend": "4.0.1" + } + }, + "level-write-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/level-write-stream/-/level-write-stream-1.0.0.tgz", + "integrity": "sha1-P3+7Z5pVE3wP6zA97nZuEu4Twdw=", + "requires": { + "end-stream": "0.1.0" + } + }, + "leveldown": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-1.5.0.tgz", + "integrity": "sha1-a408vqekqJqkdERgfXNYIT5vy4E=", + "requires": { + "abstract-leveldown": "2.6.3", + "bindings": "1.2.1", + "fast-future": "1.0.2", + "nan": "2.4.0", + "prebuild": "4.5.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "4.0.1" + } + } + } + }, + "levelup": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.3.tgz", + "integrity": "sha1-v522K9thiNCOqqLvz2zDEZFvQf0=", + "requires": { + "deferred-leveldown": "1.2.2", + "level-codec": "6.1.0", + "level-errors": "1.0.5", + "level-iterator-stream": "1.3.1", + "prr": "1.0.1", + "semver": "5.1.1", + "xtend": "4.0.1" + }, + "dependencies": { + "level-codec": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-6.1.0.tgz", + "integrity": "sha1-9d8KmVgvdtrEOFUVGrb05NDWAEU=" + }, + "semver": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.1.1.tgz", + "integrity": "sha1-oykqNz5vPgeY2gsgZBuanFvEfhk=" + } + } + }, + "levn": { + "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" + } + }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "requires": { + "immediate": "3.0.6" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" + }, + "lodash.isnull": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash.isnull/-/lodash.isnull-3.0.0.tgz", + "integrity": "sha1-+vvlnqHcon7teGU0A53YTC4HxW4=" + }, + "lodash.pad": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.5.1.tgz", + "integrity": "sha1-QzCUmoM6fI2iLMIPaibE1Z3runA=" + }, + "lodash.padend": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", + "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=" + }, + "lodash.padstart": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.6.1.tgz", + "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=" + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "ltgt": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.1.3.tgz", + "integrity": "sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ=" + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" + }, + "math-clamp-x": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/math-clamp-x/-/math-clamp-x-1.2.0.tgz", + "integrity": "sha512-tqpjpBcIf9UulApz3EjWXqTZpMlr2vLN9PryC9ghoyCuRmqZaf3JJhPddzgQpJnKLi2QhoFnvKBFtJekAIBSYg==", + "requires": { + "to-number-x": "2.0.0" + } + }, + "math-sign-x": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/math-sign-x/-/math-sign-x-3.0.0.tgz", + "integrity": "sha512-OzPas41Pn4d16KHnaXmGxxY3/l3zK4OIXtmIwdhgZsxz4FDDcNnbrABYPg2vGfxIkaT9ezGnzDviRH7RfF44jQ==", + "requires": { + "is-nan-x": "1.0.1", + "to-number-x": "2.0.0" + } + }, + "max-safe-integer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/max-safe-integer/-/max-safe-integer-1.0.1.tgz", + "integrity": "sha1-84BgvixWPYwC5tSK85Ei/YO29BA=" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "memdown": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.2.4.tgz", + "integrity": "sha1-zZo0qvB01TRFonEQjrS43U7A8n8=", + "requires": { + "abstract-leveldown": "2.4.1", + "functional-red-black-tree": "1.0.1", + "immediate": "3.2.3", + "inherits": "2.0.3", + "ltgt": "2.1.3" + }, + "dependencies": { + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + } + } + }, + "meow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-2.0.0.tgz", + "integrity": "sha1-j1MKjs9dQNP0tN+Tw0cpAPuiqPE=", + "requires": { + "camelcase-keys": "1.0.0", + "indent-string": "1.2.2", + "minimist": "1.2.0", + "object-assign": "1.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "object-assign": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz", + "integrity": "sha1-5l3Idm07R7S4MHRlyDEdoDCwcKY=" + } + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=" + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "requires": { + "mime-db": "1.30.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "multiparty": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-3.3.2.tgz", + "integrity": "sha1-Nd5oBNwZZD5SSfPT473GyM4wHT8=", + "requires": { + "readable-stream": "1.1.14", + "stream-counter": "0.2.0" + } + }, + "mute-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", + "dev": true + }, + "nan": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.4.0.tgz", + "integrity": "sha1-+zxZ1F/k7/4hXwuJD4rfbrMtIjI=" + }, + "nan-x": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/nan-x/-/nan-x-1.0.0.tgz", + "integrity": "sha512-yw4Fhe2/UTzanQ4f0yHWkRnfTuHZFAi4GZDjXS4G+qv5BqXTqPJBbSxpa7MyyW9v4Y4ZySZQik1vcbNkhdnIOg==" + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "nock": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/nock/-/nock-9.1.0.tgz", + "integrity": "sha512-u9QOLOZP0DlcKzmAzCuX5PRsIhbiRJupR7hJn1cCCT7VW3ZKUrEH/oxGEtVA8Xbu4EmzH9d/VK0x/3FxCGRrRg==", + "requires": { + "chai": "3.5.0", + "debug": "2.6.7", + "deep-equal": "1.0.1", + "json-stringify-safe": "5.0.1", + "lodash": "4.17.5", + "mkdirp": "0.5.1", + "propagate": "0.4.0", + "qs": "6.4.0", + "semver": "5.4.1" + } + }, + "node-gyp": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.2.tgz", + "integrity": "sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA=", + "requires": { + "fstream": "1.0.11", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "npmlog": "2.0.4", + "osenv": "0.1.4", + "request": "2.79.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "which": "1.3.0" + }, + "dependencies": { + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" + } + } + }, + "node-jqunit": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/node-jqunit/-/node-jqunit-1.1.7.tgz", + "integrity": "sha1-p0Vla55y9G44f0mN+3AlxtNpqBk=", + "requires": { + "infusion": "3.0.0-dev.20170830T182157Z.392b2f8" + } + }, + "node-ninja": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/node-ninja/-/node-ninja-1.0.2.tgz", + "integrity": "sha1-IKCeV7kuLfWRmT1L8JisPnJwYrY=", + "requires": { + "fstream": "1.0.11", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "npmlog": "2.0.4", + "osenv": "0.1.4", + "path-array": "1.0.1", + "request": "2.79.0", + "rimraf": "2.6.1", + "semver": "5.4.1", + "tar": "2.2.1", + "which": "1.3.0" + } + }, + "node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=" + }, + "nomnom": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", + "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", + "requires": { + "chalk": "0.4.0", + "underscore": "1.6.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=" + }, + "chalk": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "requires": { + "ansi-styles": "1.0.0", + "has-color": "0.1.7", + "strip-ansi": "0.1.1" + } + }, + "strip-ansi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=" + } + } + }, + "noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "requires": { + "abbrev": "1.1.1" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "5.4.1", + "validate-npm-package-license": "3.0.1" + } + }, + "normalize-space-x": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-space-x/-/normalize-space-x-3.0.0.tgz", + "integrity": "sha512-tbCJerqZCCHPst4rRKgsTanLf45fjOyeAU5zE3mhDxJtFJKt66q39g2XArWhXelgTFVib8mNBUm6Wrd0LxYcfQ==", + "requires": { + "cached-constructors-x": "1.0.0", + "trim-x": "3.0.0", + "white-space-x": "3.0.0" + } + }, + "npm-run-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-1.0.0.tgz", + "integrity": "sha1-9cMr9ZX+ga6Sfa7FLoL4sACsPI8=", + "dev": true, + "requires": { + "path-key": "1.0.0" + } + }, + "npmlog": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", + "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", + "requires": { + "ansi": "0.3.1", + "are-we-there-yet": "1.1.4", + "gauge": "1.2.7" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "oauth2orize": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/oauth2orize/-/oauth2orize-1.8.0.tgz", + "integrity": "sha1-8t3AEV1jXQSAdGJJwA8OoanFG6g=", + "requires": { + "debug": "2.6.7", + "uid2": "0.0.3", + "utils-merge": "1.0.0" + } + }, + "object-assign": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz", + "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=" + }, + "object-get-own-property-descriptor-x": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/object-get-own-property-descriptor-x/-/object-get-own-property-descriptor-x-3.2.0.tgz", + "integrity": "sha512-Z/0fIrptD9YuzN+SNK/1kxAEaBcPQM4gSrtOSMSi9eplnL/AbyQcAyAlreAoAzmBon+DQ1Z+AdhxyQSvav5Fyg==", + "requires": { + "attempt-x": "1.1.1", + "has-own-property-x": "3.2.0", + "has-symbol-support-x": "1.4.1", + "is-falsey-x": "1.0.1", + "is-index-x": "1.1.0", + "is-primitive": "2.0.0", + "is-string": "1.0.4", + "property-is-enumerable-x": "1.1.0", + "to-object-x": "1.5.0", + "to-property-key-x": "2.0.2" + } + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "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=" + }, + "osenv": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "parse-int-x": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-int-x/-/parse-int-x-2.0.0.tgz", + "integrity": "sha512-NIMm52gmd1+0qxJK8lV3OZ4zzWpRH1xcz9xCHXl+DNzddwUdS4NEtd7BmTeK7iCIXoaK5e6BoDMHgieH2eNIhg==", + "requires": { + "cached-constructors-x": "1.0.0", + "nan-x": "1.0.0", + "to-string-x": "1.4.2", + "trim-left-x": "3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "passport": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/passport/-/passport-0.3.2.tgz", + "integrity": "sha1-ndAJ+RXo/glbASSgG4+C2gdRAQI=", + "requires": { + "passport-strategy": "1.0.0", + "pause": "0.0.1" + } + }, + "passport-oauth2-client-password": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/passport-oauth2-client-password/-/passport-oauth2-client-password-0.1.2.tgz", + "integrity": "sha1-TzeLZ4uS0W270jOmxwZSAJPlYbo=", + "requires": { + "passport-strategy": "1.0.0" + } + }, + "passport-strategy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", + "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" + }, + "path-array": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz", + "integrity": "sha1-fi8PNfB6IBUSK4aLfqwOssT+wnE=", + "requires": { + "array-index": "1.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-1.0.0.tgz", + "integrity": "sha1-XVPVeAGWRsDWiADbThRua9wqx68=", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "2.0.4" + } + }, + "pluralize": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", + "dev": true + }, + "pouchdb": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/pouchdb/-/pouchdb-6.1.2.tgz", + "integrity": "sha1-XOsxD3BfCn/SPSX+GjZfNrMKwos=", + "requires": { + "argsarray": "0.0.1", + "buffer-from": "0.1.1", + "clone-buffer": "1.0.0", + "debug": "2.6.0", + "double-ended-queue": "2.1.0-0", + "immediate": "3.0.6", + "inherits": "2.0.3", + "level-codec": "7.0.0", + "level-write-stream": "1.0.0", + "leveldown": "1.5.0", + "levelup": "1.3.3", + "lie": "3.1.0", + "ltgt": "2.1.2", + "readable-stream": "1.0.33", + "request": "2.79.0", + "scope-eval": "0.0.3", + "spark-md5": "3.0.0", + "through2": "2.0.1", + "vuvuzela": "1.0.3" + }, + "dependencies": { + "debug": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz", + "integrity": "sha1-vFlryr52F/Edn6FTYe3tVgi4SZs=", + "requires": { + "ms": "0.7.2" + } + }, + "lie": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.0.tgz", + "integrity": "sha1-ZeATnq75rnkaH1yMU2ksjTtHGPQ=", + "requires": { + "immediate": "3.0.6" + } + }, + "ltgt": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.1.2.tgz", + "integrity": "sha1-50cjJP7mkK/A1ez5AEA85XiKMR0=" + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "readable-stream": { + "version": "1.0.33", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", + "integrity": "sha1-OjYN1mwbHX/UcFOJhg7aHQ9hEmw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "spark-md5": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spark-md5/-/spark-md5-3.0.0.tgz", + "integrity": "sha1-NyIifFTi+vJLHcbZM8wUTm9xv+8=" + }, + "through2": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.1.tgz", + "integrity": "sha1-OE51MU1J8y3hLuu4E2uOtrXVnak=", + "requires": { + "readable-stream": "2.0.6", + "xtend": "4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } + } + } + } + } + }, + "pouchdb-all-dbs": { + "version": "git://github.com/the-t-in-rtf/pouchdb-all-dbs.git#d6a515d0e896d55ede815aaebfedccb5239064a3", + "requires": { + "argsarray": "0.0.1", + "es3ify": "0.1.4", + "infusion": "3.0.0-dev.20170727T125648Z.47055ca", + "inherits": "2.0.3", + "pouchdb-promise": "5.4.3", + "tiny-queue": "0.2.1" + }, + "dependencies": { + "infusion": { + "version": "3.0.0-dev.20170727T125648Z.47055ca", + "resolved": "https://registry.npmjs.org/infusion/-/infusion-3.0.0-dev.20170727T125648Z.47055ca.tgz", + "integrity": "sha1-T0F2nj3l2basSdrdpOKI3LUccdU=", + "requires": { + "fluid-resolve": "1.3.0" + } + } + } + }, + "pouchdb-auth": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pouchdb-auth/-/pouchdb-auth-2.1.1.tgz", + "integrity": "sha1-X04iFvQk3h1cpQ9LTOt2Jc1YllQ=", + "requires": { + "base64url": "1.0.6", + "couchdb-calculate-session-id": "1.1.2", + "crypto-lite": "0.1.0", + "pouchdb-bulkdocs-wrapper": "1.0.2", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-promise": "5.4.3", + "pouchdb-req-http-query": "1.0.4", + "pouchdb-system-db": "1.0.4", + "pouchdb-validation": "1.2.1", + "pouchdb-wrappers": "1.3.6", + "promise-nodify": "1.0.2", + "secure-random": "1.1.1" + } + }, + "pouchdb-bulkdocs-wrapper": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pouchdb-bulkdocs-wrapper/-/pouchdb-bulkdocs-wrapper-1.0.2.tgz", + "integrity": "sha1-DDYlGVg3F5IAYDKIEslHtqGvwhE=", + "requires": { + "pouchdb-promise": "0.0.0" + }, + "dependencies": { + "bluebird": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz", + "integrity": "sha1-WYXsI8tv8aWDTMZEezxe8BD9Mho=" + }, + "lie": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/lie/-/lie-2.7.7.tgz", + "integrity": "sha1-fPlZvtSJWbBi8Drka7vzqsMCark=", + "requires": { + "immediate": "3.0.6" + } + }, + "pouchdb-promise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-0.0.0.tgz", + "integrity": "sha1-PAFOYndm2UW+PycOB5p9tNLRmCc=", + "requires": { + "bluebird": "1.2.4", + "lie": "2.7.7" + } + } + } + }, + "pouchdb-changeslike-wrapper": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pouchdb-changeslike-wrapper/-/pouchdb-changeslike-wrapper-1.0.1.tgz", + "integrity": "sha1-OQuapX/hfyL/OmKBRh9q8OBAcTU=" + }, + "pouchdb-collate": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pouchdb-collate/-/pouchdb-collate-1.2.0.tgz", + "integrity": "sha1-yuO4MPyhJLf5fSMEbk+qMR7Dgow=" + }, + "pouchdb-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/pouchdb-extend/-/pouchdb-extend-0.1.2.tgz", + "integrity": "sha1-0c5RG/cE7S4p979CikFqz/+hJLg=" + }, + "pouchdb-find": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/pouchdb-find/-/pouchdb-find-0.10.3.tgz", + "integrity": "sha1-tg1B4doSPGMlzp1/P4bMOGQgt6Y=", + "requires": { + "argsarray": "0.0.1", + "debug": "2.6.7", + "inherits": "2.0.3", + "is-array": "1.0.1", + "pouchdb-collate": "1.2.0", + "pouchdb-extend": "0.1.2", + "pouchdb-promise": "5.4.0", + "pouchdb-upsert": "2.0.2", + "spark-md5": "0.0.5" + }, + "dependencies": { + "base62": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/base62/-/base62-1.2.7.tgz", + "integrity": "sha512-ck0nDbXLEq2nD5jIcEzdpk07sYQ5P6z4NMTIgeQCFr5CCRZzmgUPlOes4o0k5pvEUQJnKO/D079ybzjpjIKf2Q==" + }, + "es3ify": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/es3ify/-/es3ify-0.2.2.tgz", + "integrity": "sha1-Xa4+ZQ5b42hLiAZlE9Uo0JJimGI=", + "requires": { + "esprima": "2.7.3", + "jstransform": "11.0.3", + "through": "2.3.8" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" + }, + "jstransform": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/jstransform/-/jstransform-11.0.3.tgz", + "integrity": "sha1-CaeJk+CuTU70SH9hVakfYZDLQiM=", + "requires": { + "base62": "1.2.7", + "commoner": "0.10.8", + "esprima-fb": "15001.1.0-dev-harmony-fb", + "object-assign": "2.1.1", + "source-map": "0.4.4" + }, + "dependencies": { + "esprima-fb": { + "version": "15001.1.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz", + "integrity": "sha1-MKlHMDxrjV6VW+4rmbHSMyBqaQE=" + } + } + }, + "lie": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.0.4.tgz", + "integrity": "sha1-vHrh6+fxyN45r9zU94kHa0ew9jQ=", + "requires": { + "es3ify": "0.2.2", + "immediate": "3.0.6", + "inline-process-browser": "1.0.0", + "unreachable-branch-transform": "0.3.0" + } + }, + "pouchdb-promise": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-5.4.0.tgz", + "integrity": "sha1-4nesa9oayFBFl6u1xDp8Op5Whm8=", + "requires": { + "lie": "3.0.4" + } + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "pouchdb-list": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pouchdb-list/-/pouchdb-list-1.1.0.tgz", + "integrity": "sha1-PkYZk33XaqiQnqyT/ynAe/C5tFE=", + "requires": { + "couchdb-objects": "1.0.7", + "couchdb-render": "1.0.1", + "extend": "3.0.1", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-promise": "0.0.0", + "pouchdb-req-http-query": "1.0.4", + "promise-nodify": "1.0.2" + }, + "dependencies": { + "bluebird": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz", + "integrity": "sha1-WYXsI8tv8aWDTMZEezxe8BD9Mho=" + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "lie": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/lie/-/lie-2.7.7.tgz", + "integrity": "sha1-fPlZvtSJWbBi8Drka7vzqsMCark=", + "requires": { + "immediate": "3.0.6" + } + }, + "pouchdb-promise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-0.0.0.tgz", + "integrity": "sha1-PAFOYndm2UW+PycOB5p9tNLRmCc=", + "requires": { + "bluebird": "1.2.4", + "lie": "2.7.7" + } + } + } + }, + "pouchdb-plugin-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pouchdb-plugin-error/-/pouchdb-plugin-error-1.0.1.tgz", + "integrity": "sha1-xy8GAUEkqfqQOPyO2ifFizSIBco=" + }, + "pouchdb-promise": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-5.4.3.tgz", + "integrity": "sha1-Mx1nCxmJ1aA/JogRIU8n9UFQyys=", + "requires": { + "lie": "3.0.4" + }, + "dependencies": { + "base62": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/base62/-/base62-1.2.7.tgz", + "integrity": "sha512-ck0nDbXLEq2nD5jIcEzdpk07sYQ5P6z4NMTIgeQCFr5CCRZzmgUPlOes4o0k5pvEUQJnKO/D079ybzjpjIKf2Q==" + }, + "es3ify": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/es3ify/-/es3ify-0.2.2.tgz", + "integrity": "sha1-Xa4+ZQ5b42hLiAZlE9Uo0JJimGI=", + "requires": { + "esprima": "2.7.3", + "jstransform": "11.0.3", + "through": "2.3.8" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" + }, + "jstransform": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/jstransform/-/jstransform-11.0.3.tgz", + "integrity": "sha1-CaeJk+CuTU70SH9hVakfYZDLQiM=", + "requires": { + "base62": "1.2.7", + "commoner": "0.10.8", + "esprima-fb": "15001.1.0-dev-harmony-fb", + "object-assign": "2.1.1", + "source-map": "0.4.4" + }, + "dependencies": { + "esprima-fb": { + "version": "15001.1.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz", + "integrity": "sha1-MKlHMDxrjV6VW+4rmbHSMyBqaQE=" + } + } + }, + "lie": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.0.4.tgz", + "integrity": "sha1-vHrh6+fxyN45r9zU94kHa0ew9jQ=", + "requires": { + "es3ify": "0.2.2", + "immediate": "3.0.6", + "inline-process-browser": "1.0.0", + "unreachable-branch-transform": "0.3.0" + } + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "pouchdb-replicator": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/pouchdb-replicator/-/pouchdb-replicator-2.1.3.tgz", + "integrity": "sha1-pIfk/sCW+FSA+D6aKh8PuMpMFbk=", + "requires": { + "equals": "1.0.5", + "extend": "1.3.0", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-promise": "0.0.0", + "pouchdb-system-db": "1.0.4", + "pouchdb-validation": "1.2.1", + "promise-nodify": "1.0.2", + "random-uuid-v4": "0.0.4" + }, + "dependencies": { + "bluebird": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz", + "integrity": "sha1-WYXsI8tv8aWDTMZEezxe8BD9Mho=" + }, + "lie": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/lie/-/lie-2.7.7.tgz", + "integrity": "sha1-fPlZvtSJWbBi8Drka7vzqsMCark=", + "requires": { + "immediate": "3.0.6" + } + }, + "pouchdb-promise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-0.0.0.tgz", + "integrity": "sha1-PAFOYndm2UW+PycOB5p9tNLRmCc=", + "requires": { + "bluebird": "1.2.4", + "lie": "2.7.7" + } + } + } + }, + "pouchdb-req-http-query": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pouchdb-req-http-query/-/pouchdb-req-http-query-1.0.4.tgz", + "integrity": "sha1-d+c1xBBvO5clx9VZWakyM2TdI3E=", + "requires": { + "extend": "1.3.0", + "header-case-normalizer": "1.0.3", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-promise": "0.0.0", + "xmlhttprequest-cookie": "0.9.5" + }, + "dependencies": { + "bluebird": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz", + "integrity": "sha1-WYXsI8tv8aWDTMZEezxe8BD9Mho=" + }, + "lie": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/lie/-/lie-2.7.7.tgz", + "integrity": "sha1-fPlZvtSJWbBi8Drka7vzqsMCark=", + "requires": { + "immediate": "3.0.6" + } + }, + "pouchdb-promise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-0.0.0.tgz", + "integrity": "sha1-PAFOYndm2UW+PycOB5p9tNLRmCc=", + "requires": { + "bluebird": "1.2.4", + "lie": "2.7.7" + } + } + } + }, + "pouchdb-rewrite": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/pouchdb-rewrite/-/pouchdb-rewrite-1.0.7.tgz", + "integrity": "sha1-P5d+PfTJ5Uz3Xoct6ekR+HeQwtg=", + "requires": { + "couchdb-objects": "1.0.7", + "extend": "1.3.0", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-req-http-query": "1.0.4", + "pouchdb-route": "1.0.3", + "promise-nodify": "1.0.2" + } + }, + "pouchdb-route": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pouchdb-route/-/pouchdb-route-1.0.3.tgz", + "integrity": "sha1-5QIbdorffh9HUNlNlQ9Uqf1rU0A=", + "requires": { + "extend": "1.3.0", + "pouchdb-plugin-error": "1.0.1" + } + }, + "pouchdb-security": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/pouchdb-security/-/pouchdb-security-1.2.6.tgz", + "integrity": "sha1-OE/SiagD5xqYhTULq7SsERBEOQQ=", + "requires": { + "extend": "1.3.0", + "pouchdb-bulkdocs-wrapper": "1.0.2", + "pouchdb-changeslike-wrapper": "1.0.1", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-promise": "0.0.0", + "pouchdb-req-http-query": "1.0.4", + "pouchdb-wrappers": "1.3.6", + "promise-nodify": "1.0.2" + }, + "dependencies": { + "bluebird": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz", + "integrity": "sha1-WYXsI8tv8aWDTMZEezxe8BD9Mho=" + }, + "lie": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/lie/-/lie-2.7.7.tgz", + "integrity": "sha1-fPlZvtSJWbBi8Drka7vzqsMCark=", + "requires": { + "immediate": "3.0.6" + } + }, + "pouchdb-promise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-0.0.0.tgz", + "integrity": "sha1-PAFOYndm2UW+PycOB5p9tNLRmCc=", + "requires": { + "bluebird": "1.2.4", + "lie": "2.7.7" + } + } + } + }, + "pouchdb-show": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/pouchdb-show/-/pouchdb-show-1.0.8.tgz", + "integrity": "sha1-lQz8KHcMCqLbrJbydcgJU/5aJeY=", + "requires": { + "couchdb-objects": "1.0.7", + "couchdb-render": "1.0.1", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-promise": "0.0.0", + "pouchdb-req-http-query": "1.0.4", + "promise-nodify": "1.0.2" + }, + "dependencies": { + "bluebird": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz", + "integrity": "sha1-WYXsI8tv8aWDTMZEezxe8BD9Mho=" + }, + "lie": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/lie/-/lie-2.7.7.tgz", + "integrity": "sha1-fPlZvtSJWbBi8Drka7vzqsMCark=", + "requires": { + "immediate": "3.0.6" + } + }, + "pouchdb-promise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-0.0.0.tgz", + "integrity": "sha1-PAFOYndm2UW+PycOB5p9tNLRmCc=", + "requires": { + "bluebird": "1.2.4", + "lie": "2.7.7" + } + } + } + }, + "pouchdb-size": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/pouchdb-size/-/pouchdb-size-1.2.2.tgz", + "integrity": "sha1-EpFfE+nSQcsOcKZsGOfV/2mfEKg=", + "requires": { + "bluebird": "2.11.0", + "get-folder-size": "0.1.1", + "pouchdb-wrappers": "1.3.6", + "promise-nodify": "1.0.2" + }, + "dependencies": { + "bluebird": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=" + } + } + }, + "pouchdb-system-db": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pouchdb-system-db/-/pouchdb-system-db-1.0.4.tgz", + "integrity": "sha1-FQGNhxnwK8/Zy2nnJDuLCUF0uqI=", + "requires": { + "pouchdb-changeslike-wrapper": "1.0.1", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-security": "1.2.6", + "pouchdb-wrappers": "1.3.6" + } + }, + "pouchdb-update": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/pouchdb-update/-/pouchdb-update-1.0.8.tgz", + "integrity": "sha1-l+k9W619jSg+DRTeZTvOJMNheLQ=", + "requires": { + "couchdb-eval": "1.0.6", + "couchdb-objects": "1.0.7", + "couchdb-resp-completer": "1.0.3", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-promise": "0.0.0", + "pouchdb-req-http-query": "1.0.4", + "promise-nodify": "1.0.2" + }, + "dependencies": { + "bluebird": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz", + "integrity": "sha1-WYXsI8tv8aWDTMZEezxe8BD9Mho=" + }, + "lie": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/lie/-/lie-2.7.7.tgz", + "integrity": "sha1-fPlZvtSJWbBi8Drka7vzqsMCark=", + "requires": { + "immediate": "3.0.6" + } + }, + "pouchdb-promise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-0.0.0.tgz", + "integrity": "sha1-PAFOYndm2UW+PycOB5p9tNLRmCc=", + "requires": { + "bluebird": "1.2.4", + "lie": "2.7.7" + } + } + } + }, + "pouchdb-upsert": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/pouchdb-upsert/-/pouchdb-upsert-2.0.2.tgz", + "integrity": "sha1-x0bMmUXlLYx45C9jreBmZ3eZZxI=", + "requires": { + "pouchdb-promise": "5.4.3" + } + }, + "pouchdb-validation": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pouchdb-validation/-/pouchdb-validation-1.2.1.tgz", + "integrity": "sha1-YJISgmFbYNd/UYU3+QzAeRBpwCs=", + "requires": { + "couchdb-eval": "1.0.6", + "couchdb-objects": "1.0.7", + "pouchdb-bulkdocs-wrapper": "1.0.2", + "pouchdb-plugin-error": "1.0.1", + "pouchdb-promise": "0.0.0", + "pouchdb-wrappers": "1.3.6", + "random-uuid-v4": "0.0.4" + }, + "dependencies": { + "bluebird": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz", + "integrity": "sha1-WYXsI8tv8aWDTMZEezxe8BD9Mho=" + }, + "lie": { + "version": "2.7.7", + "resolved": "https://registry.npmjs.org/lie/-/lie-2.7.7.tgz", + "integrity": "sha1-fPlZvtSJWbBi8Drka7vzqsMCark=", + "requires": { + "immediate": "3.0.6" + } + }, + "pouchdb-promise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/pouchdb-promise/-/pouchdb-promise-0.0.0.tgz", + "integrity": "sha1-PAFOYndm2UW+PycOB5p9tNLRmCc=", + "requires": { + "bluebird": "1.2.4", + "lie": "2.7.7" + } + } + } + }, + "pouchdb-vhost": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pouchdb-vhost/-/pouchdb-vhost-1.0.2.tgz", + "integrity": "sha1-URUX2zx/X9WQ4+6LIOPvnolAD9Y=", + "requires": { + "pouchdb-route": "1.0.3", + "promise-nodify": "1.0.2" + } + }, + "pouchdb-wrappers": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/pouchdb-wrappers/-/pouchdb-wrappers-1.3.6.tgz", + "integrity": "sha1-8+EbZk6JqbMX54XJYVHMsXNvJdA=", + "requires": { + "promise-nodify": "1.0.2" + } + }, + "prebuild": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/prebuild/-/prebuild-4.5.0.tgz", + "integrity": "sha1-KqoN8gY7/4FKgDvU3JT/m2Tl3wA=", + "requires": { + "async": "1.5.2", + "execspawn": "1.0.1", + "expand-template": "1.1.0", + "ghreleases": "1.0.7", + "github-from-package": "0.0.0", + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "node-gyp": "3.6.2", + "node-ninja": "1.0.2", + "noop-logger": "0.1.1", + "npmlog": "2.0.4", + "os-homedir": "1.0.2", + "pump": "1.0.3", + "rc": "1.2.5", + "simple-get": "1.4.3", + "tar-fs": "1.16.0", + "tar-stream": "1.5.5", + "xtend": "4.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true + }, + "promise-nodify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise-nodify/-/promise-nodify-1.0.2.tgz", + "integrity": "sha1-DQ+xQ8M0ALAGG0flgSV1VwR9TFo=" + }, + "propagate": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-0.4.0.tgz", + "integrity": "sha1-8/zKCm/gZzanulcpZgaWF8EwtIE=" + }, + "property-is-enumerable-x": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/property-is-enumerable-x/-/property-is-enumerable-x-1.1.0.tgz", + "integrity": "sha512-22cKy3w3OpRswU6to9iKWDDlg+F9vF2REcwGlGW23jyLjHb1U/jJEWA44sWupOnkhGfDgotU6Lw+N2oyhNi+5A==", + "requires": { + "to-object-x": "1.5.0", + "to-property-key-x": "2.0.2" + } + }, + "proxy-addr": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.5.tgz", + "integrity": "sha1-ccDuOxAt4/IC87ZPYI0XP8uhqRg=", + "requires": { + "forwarded": "0.1.2", + "ipaddr.js": "1.4.0" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "pump": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "requires": { + "end-of-stream": "1.4.1", + "once": "1.4.0" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + }, + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" + }, + "random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" + }, + "random-uuid-v4": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/random-uuid-v4/-/random-uuid-v4-0.0.4.tgz", + "integrity": "sha1-ShibBWkJjbt6Q1sJVAH4geNh62o=" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.2.0.tgz", + "integrity": "sha1-mUl2z2pQlqQRYoQEkvC9xdbn+5Y=", + "requires": { + "bytes": "2.4.0", + "iconv-lite": "0.4.15", + "unpipe": "1.0.0" + } + }, + "rc": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.5.tgz", + "integrity": "sha1-J1zWh/bjs2zHVrqibf7oCnkDAf0=", + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "readline2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "mute-stream": "0.0.5" + } + }, + "recast": { + "version": "0.11.23", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz", + "integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=", + "requires": { + "ast-types": "0.9.6", + "esprima": "3.1.3", + "private": "0.1.8", + "source-map": "0.5.7" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + }, + "dependencies": { + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + } + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", + "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", + "requires": { + "is-finite": "1.0.2" + } + }, + "replace-comments-x": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/replace-comments-x/-/replace-comments-x-2.0.0.tgz", + "integrity": "sha512-+vMP4jqU+8HboLWms6YMNEiaZG5hh1oR6ENCnGYDF/UQ7aYiJUK/8tcl3+KZAHRCKKa3gqzrfiarlUBHQSgRlg==", + "requires": { + "require-coercible-to-string-x": "1.0.0", + "to-string-x": "1.4.2" + } + }, + "request": { + "version": "2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.11.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "2.0.6", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "qs": "6.3.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.4.3", + "uuid": "3.2.1" + }, + "dependencies": { + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "qs": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=" + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + } + } + }, + "require-coercible-to-string-x": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/require-coercible-to-string-x/-/require-coercible-to-string-x-1.0.0.tgz", + "integrity": "sha512-Rpfd4sMdflPAKecdKhfAtQHlZzzle4UMUgxJ01hXtTcNWMV8w9GeZnKhEyrT73kgrflBOP1zg41amUPZGcNspA==", + "requires": { + "require-object-coercible-x": "1.4.1", + "to-string-x": "1.4.2" + } + }, + "require-object-coercible-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/require-object-coercible-x/-/require-object-coercible-x-1.4.1.tgz", + "integrity": "sha512-0YHa2afepsLfQvwQ1P2XvDZnGOUia5sC07ZijIRU2dnsRxnuilXWF6B2CFaKGDA9eZl39lJHrXCDsnfgroRd6Q==", + "requires": { + "is-nil-x": "1.4.1" + } + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "requires": { + "glob": "7.1.2" + } + }, + "run-async": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", + "dev": true, + "requires": { + "once": "1.4.0" + } + }, + "rx-lite": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "sax": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/sax/-/sax-0.4.2.tgz", + "integrity": "sha1-OfO2AXM9a+yXEFskKipA/Wl4rDw=" + }, + "scope-eval": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/scope-eval/-/scope-eval-0.0.3.tgz", + "integrity": "sha1-Fm8szR83VEKd7FEYBVAfnWkjtew=" + }, + "secure-random": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/secure-random/-/secure-random-1.1.1.tgz", + "integrity": "sha1-CIDy2MUYX0vLRoQFjINrTdsHFFo=" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "send": { + "version": "0.15.4", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.4.tgz", + "integrity": "sha1-mF+qPihLAnPHkzZKNcZze9k5Bbk=", + "requires": { + "debug": "2.6.8", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.0", + "http-errors": "1.6.2", + "mime": "1.3.4", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "serve-static": { + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.4.tgz", + "integrity": "sha1-m2qpjutyU8Tu3Ewfb9vKYJkBqWE=", + "requires": { + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.15.4" + } + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + }, + "shelljs": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.1.tgz", + "integrity": "sha1-7GIRvtGSBEIIj+D3Cyg3Iy7SyKg=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "simple-get": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-1.4.3.tgz", + "integrity": "sha1-6XVe2kB+ltpAxeUVjJ6jezO+y+s=", + "requires": { + "once": "1.4.0", + "unzip-response": "1.0.2", + "xtend": "4.0.1" + } + }, + "simple-mime": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/simple-mime/-/simple-mime-0.1.0.tgz", + "integrity": "sha1-lfUXxPRm18/1YacfydqyWW6p7y4=" + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "requires": { + "hoek": "2.16.3" + } + }, + "source-map": { + "version": "0.1.31", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.31.tgz", + "integrity": "sha1-n3BNDWnZ4TioG63267T94z0VHGE=", + "requires": { + "amdefine": "1.0.1" + } + }, + "spark-md5": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/spark-md5/-/spark-md5-0.0.5.tgz", + "integrity": "sha1-kx2l47lR0GUn6bfZDf/1eLb83I4=" + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + }, + "stream-counter": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz", + "integrity": "sha1-3tJmVWMZyLDiIoErnPOyb6fZR94=", + "requires": { + "readable-stream": "1.1.14" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, + "table": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", + "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", + "dev": true, + "requires": { + "ajv": "4.11.8", + "ajv-keywords": "1.5.1", + "chalk": "1.1.3", + "lodash": "4.17.5", + "slice-ansi": "0.0.4", + "string-width": "2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-fs": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.0.tgz", + "integrity": "sha512-I9rb6v7mjWLtOfCau9eH5L7sLJyU2BnxtEZRQ5Mt+eRKmf1F0ohXmT/Jc3fr52kDvjJ/HV5MH3soQfPL5bQ0Yg==", + "requires": { + "chownr": "1.0.1", + "mkdirp": "0.5.1", + "pump": "1.0.3", + "tar-stream": "1.5.5" + } + }, + "tar-stream": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.5.tgz", + "integrity": "sha512-mQdgLPc/Vjfr3VWqWbfxW8yQNiJCbAZ+Gf6GDu1Cy0bdb33ofyiNGBtAY96jHFhDuivCwgW1H9DgTON+INiXgg==", + "requires": { + "bl": "1.2.1", + "end-of-stream": "1.4.1", + "readable-stream": "2.3.4", + "xtend": "4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", + "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + } + } + }, + "tiny-queue": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tiny-queue/-/tiny-queue-0.2.1.tgz", + "integrity": "sha1-JaZ/LG4lOyypQZd7XvdELvl6YEY=" + }, + "to-boolean-x": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-boolean-x/-/to-boolean-x-1.0.1.tgz", + "integrity": "sha512-PstxY3K6hVEHnY3FITs8XBoJbt0RI1e4MLIhAL9hWa3BtVLCrb86vU5z6lEKh7uZZjiPiLqIKMmfMro1nNgtXQ==" + }, + "to-integer-x": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/to-integer-x/-/to-integer-x-3.0.0.tgz", + "integrity": "sha512-794L2Lpwjtynm7RxahJi2YdbRY75gTxUW27TMuN26UgwPkmJb/+HPhkFEFbz+E4vNoiP0dxq5tq5fkXoXLaK/w==", + "requires": { + "is-finite-x": "3.0.2", + "is-nan-x": "1.0.1", + "math-sign-x": "3.0.0", + "to-number-x": "2.0.0" + } + }, + "to-number-x": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-number-x/-/to-number-x-2.0.0.tgz", + "integrity": "sha512-lGOnCoccUoSzjZ/9Uen8TC4+VFaQcFGhTroWTv2tYWxXgyJV1zqAZ8hEIMkez/Eo790fBMOjidTnQ/OJSCvAoQ==", + "requires": { + "cached-constructors-x": "1.0.0", + "nan-x": "1.0.0", + "parse-int-x": "2.0.0", + "to-primitive-x": "1.1.0", + "trim-x": "3.0.0" + } + }, + "to-object-x": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/to-object-x/-/to-object-x-1.5.0.tgz", + "integrity": "sha512-AKn5GQcdWky+s20vjWkt+Wa6y3dxQH3yQyMBhOfBOPldUwqwhgvlqcIg5H092ntNc+TX8/Cxzs1kMHH19pyCnA==", + "requires": { + "cached-constructors-x": "1.0.0", + "require-object-coercible-x": "1.4.1" + } + }, + "to-primitive-x": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/to-primitive-x/-/to-primitive-x-1.1.0.tgz", + "integrity": "sha512-gyMY0gi3wjK3e4MUBKqv9Zl8QGcWguIkaUr2VJmoBEsOpDcpDZSEyljR773eVG4maS48uX7muLkoQoh/BA82OQ==", + "requires": { + "has-symbol-support-x": "1.4.1", + "is-date-object": "1.0.1", + "is-function-x": "3.3.0", + "is-nil-x": "1.4.1", + "is-primitive": "2.0.0", + "is-symbol": "1.0.1", + "require-object-coercible-x": "1.4.1", + "validate.io-undefined": "1.0.3" + } + }, + "to-property-key-x": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-property-key-x/-/to-property-key-x-2.0.2.tgz", + "integrity": "sha512-YISLpZFYIazNm0P8hLsKEEUEZ3m8U3+eDysJZqTu3+B9tQp+2TrMpaEGT8Agh4fZ5LSoums60/glNEzk5ozqrg==", + "requires": { + "has-symbol-support-x": "1.4.1", + "to-primitive-x": "1.1.0", + "to-string-x": "1.4.2" + } + }, + "to-string-symbols-supported-x": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-string-symbols-supported-x/-/to-string-symbols-supported-x-1.0.0.tgz", + "integrity": "sha512-HbVH673pybrUmhzESGHUm17BBJvqb7BU8HciOvuEYm9ipuDyjmddhvkVqpVW6sM/C5/zhJo17n7O7I/24loJIQ==", + "requires": { + "cached-constructors-x": "1.0.0", + "has-symbol-support-x": "1.4.1", + "is-symbol": "1.0.1" + } + }, + "to-string-tag-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/to-string-tag-x/-/to-string-tag-x-1.4.2.tgz", + "integrity": "sha512-ytO9eLigxsQQLGuab0C1iSSTzKdJNVSlBg0Spg4J/rGAVrQJ5y774mo0SSzgGeTT4RJGGyJNfObXaTMzX0XDOQ==", + "requires": { + "lodash.isnull": "3.0.0", + "validate.io-undefined": "1.0.3" + } + }, + "to-string-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/to-string-x/-/to-string-x-1.4.2.tgz", + "integrity": "sha512-/WP5arlwtCpAAexCCHiQBW0eXwse84osWyP1Qtaz71nsYSuUpOkT6tBm8nQ4IIUfSh5hji0hDupUCD2xbbOL6A==", + "requires": { + "is-symbol": "1.0.1" + } + }, + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "requires": { + "punycode": "1.4.1" + } + }, + "trim-left-x": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-left-x/-/trim-left-x-3.0.0.tgz", + "integrity": "sha512-+m6cqkppI+CxQBTwWEZliOHpOBnCArGyMnS1WCLb6IRgukhTkiQu/TNEN5Lj2eM9jk8ewJsc7WxFZfmwNpRXWQ==", + "requires": { + "cached-constructors-x": "1.0.0", + "require-coercible-to-string-x": "1.0.0", + "white-space-x": "3.0.0" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "trim-right-x": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-right-x/-/trim-right-x-3.0.0.tgz", + "integrity": "sha512-iIqEsWEbWVodqdixJHi4FoayJkUxhoL4AvSNGp4FF4FfQKRPGizt8++/RnyC9od75y7P/S6EfONoVqP+NddiKA==", + "requires": { + "cached-constructors-x": "1.0.0", + "require-coercible-to-string-x": "1.0.0", + "white-space-x": "3.0.0" + } + }, + "trim-x": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-x/-/trim-x-3.0.0.tgz", + "integrity": "sha512-w8s38RAUScQ6t3XqMkS75iz5ZkIYLQpVnv2lp3IuTS36JdlVzC54oe6okOf4Wz3UH4rr3XAb2xR3kR5Xei82fw==", + "requires": { + "trim-left-x": "3.0.0", + "trim-right-x": "3.0.0" + } + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=" + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "type-check": { + "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" + } + }, + "type-detect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=" + }, + "type-is": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", + "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.17" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "optional": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "requires": { + "random-bytes": "1.0.0" + } + }, + "uid2": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", + "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=" + }, + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" + }, + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=" + }, + "underscore-node": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/underscore-node/-/underscore-node-0.1.2.tgz", + "integrity": "sha1-DOjHpXN8ptyOcTFdxNokaUnUgng=" + }, + "underscore.string": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.2.3.tgz", + "integrity": "sha1-gGmSYzZl1eX8tNsfs6hi62jp5to=", + "dev": true + }, + "universal": { + "version": "github:GPII/universal#08b73b801826be40f5516358b463d10d71260e9d", + "requires": { + "body-parser": "1.17.2", + "connect-ensure-login": "0.1.1", + "express": "4.15.4", + "fluid-resolve": "1.3.0", + "glob": "7.1.2", + "gpii-pouchdb": "1.0.7", + "infusion": "3.0.0-dev.20170830T182157Z.392b2f8", + "ini": "git://github.com/GPII/ini.git#be8a04aa22f5ad9321ebcbba7740314a53bc8ab2", + "json5": "0.5.1", + "kettle": "1.7.0", + "mkdirp": "0.5.1", + "nock": "9.1.0", + "node-jqunit": "1.1.7", + "node-uuid": "1.4.8", + "oauth2orize": "1.8.0", + "passport": "0.3.2", + "passport-oauth2-client-password": "0.1.2", + "rimraf": "2.6.1", + "semver": "5.4.1", + "write-file-atomic": "2.3.0", + "xml-mapping": "1.7.1" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "unreachable-branch-transform": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/unreachable-branch-transform/-/unreachable-branch-transform-0.3.0.tgz", + "integrity": "sha1-2ZzExudG0mSSiEW2EdtUsPNHTKo=", + "requires": { + "esmangle-evaluator": "1.0.1", + "recast": "0.10.43", + "through2": "0.6.5" + }, + "dependencies": { + "ast-types": { + "version": "0.8.15", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.8.15.tgz", + "integrity": "sha1-ju8IJ/BN/w7IhXupJavj/qYZTlI=" + }, + "esprima-fb": { + "version": "15001.1001.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz", + "integrity": "sha1-Q761fsJujPI3092LM+QlM1d/Jlk=" + }, + "recast": { + "version": "0.10.43", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.10.43.tgz", + "integrity": "sha1-uV1Q9tYHYaX2JS4V2AZ4FoSRzn8=", + "requires": { + "ast-types": "0.8.15", + "esprima-fb": "15001.1001.0-dev-harmony-fb", + "private": "0.1.8", + "source-map": "0.5.7" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "unzip-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-1.0.2.tgz", + "integrity": "sha1-uYTwh3/AqJwsdzzB73tbIytbBv4=" + }, + "url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=" + }, + "user-home": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "dev": true, + "requires": { + "os-homedir": "1.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "util-extend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", + "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=" + }, + "utils-merge": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", + "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=" + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "validate.io-undefined": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/validate.io-undefined/-/validate.io-undefined-1.0.3.tgz", + "integrity": "sha1-fif8uzFbhB54JDQxiXZxkp4gt/Q=" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "vuvuzela": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/vuvuzela/-/vuvuzela-1.0.3.tgz", + "integrity": "sha1-O+FF5YJxxzylUnndhR8SpoIRSws=" + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "requires": { + "isexe": "2.0.0" + } + }, + "white-space-x": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/white-space-x/-/white-space-x-3.0.0.tgz", + "integrity": "sha512-nMPVXGMdi/jQepXKryxqzEh/vCwdOYY/u6NZy40glMHvZfEr7/+vQKnDhEq4rZ1nniOFq9GWohQYB30uW/5Olg==" + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "write-file-atomic": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "signal-exit": "3.0.2" + } + }, + "write-stream": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/write-stream/-/write-stream-0.4.3.tgz", + "integrity": "sha1-g8yMA0fQr2BXqThitOOuAd5cgcE=", + "requires": { + "readable-stream": "0.0.4" + }, + "dependencies": { + "readable-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-0.0.4.tgz", + "integrity": "sha1-8y124/uGM0SlSNeZIwBxc2ZbO40=" + } + } + }, + "ws": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.1.0.tgz", + "integrity": "sha512-TU4/qKFlyQFqNITNWiqPCUY9GqlAhEotlzfcZcve6VT1YEngQl1dDMqwQQS3eMYruJ5r/UD3lcsWib6iVMDGDw==", + "requires": { + "safe-buffer": "5.1.1", + "ultron": "1.1.1" + } + }, + "xml-mapping": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/xml-mapping/-/xml-mapping-1.7.1.tgz", + "integrity": "sha1-ZWiWWeUIWDPH0r7FfawoQsy7woY=", + "requires": { + "sax": "0.4.2", + "xml-writer": "1.7.0" + } + }, + "xml-writer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/xml-writer/-/xml-writer-1.7.0.tgz", + "integrity": "sha1-t28dWRwWomNOvbcDx729D9aBkGU=" + }, + "xmlhttprequest": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" + }, + "xmlhttprequest-cookie": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/xmlhttprequest-cookie/-/xmlhttprequest-cookie-0.9.5.tgz", + "integrity": "sha512-22025VdbqwVoDs8szSGRcDAQxEoTMBbBTCd1H4wg/7zyFXz29EVzXUyLmx6tGuiX9SYK3pBBT5rLLn1hyLNX0Q==", + "requires": { + "xmlhttprequest": "1.8.0" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } +} From fefeb7cdf4fe96ffb3ebc8934e1d45cdbd77565e Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Mon, 2 Apr 2018 13:56:42 -0300 Subject: [PATCH 317/319] NOJIA - Fix Ansible inventory warning --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 866c9c3..be9d503 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -60,7 +60,7 @@ Vagrant.configure(2) do |config| config.vm.provision "shell", inline: <<-SHELL sudo ansible-galaxy install -fr /home/vagrant/sync/provisioning/requirements.yml - sudo PYTHONUNBUFFERED=1 ansible-playbook /home/vagrant/sync/provisioning/playbook.yml --tags="install,configure" + sudo PYTHONUNBUFFERED=1 ansible-playbook /home/vagrant/sync/provisioning/playbook.yml --tags="install,configure" --inventory="localhost," SHELL # Using config.vm.hostname to set the hostname on Fedora VMs seems to remove the string From f2b499759aad2a53296829fba9f3c74dc359ba7d Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Mon, 2 Apr 2018 14:17:55 -0300 Subject: [PATCH 318/319] NOJIRA - Fix Ansible inventory warning --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index be9d503..29519df 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -60,7 +60,7 @@ Vagrant.configure(2) do |config| config.vm.provision "shell", inline: <<-SHELL sudo ansible-galaxy install -fr /home/vagrant/sync/provisioning/requirements.yml - sudo PYTHONUNBUFFERED=1 ansible-playbook /home/vagrant/sync/provisioning/playbook.yml --tags="install,configure" --inventory="localhost," + sudo PYTHONUNBUFFERED=1 ansible-playbook /home/vagrant/sync/provisioning/playbook.yml --tags="install,configure" --inventory="localhost ansible_connection=local," SHELL # Using config.vm.hostname to set the hostname on Fedora VMs seems to remove the string From ac51566d66231ae05c0b9ec99acf6c4fd81678f8 Mon Sep 17 00:00:00 2001 From: Joseph Scheuhammer Date: Thu, 31 May 2018 15:07:04 -0400 Subject: [PATCH 319/319] GPII-3093: Unmask and enable packagekit.service for gpii-linux VM --- Vagrantfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 37e923f..10d6bd4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -77,4 +77,18 @@ Vagrant.configure(2) do |config| inline: "/usr/local/bin/edit-hosts.sh", run: "always" + # The Vagrant box is configured with packagekit service disabled and masked. + # Packagekit is needed by the linux implementation of the DeviceReporter -- re-enable + # here. If the service is running, the inline script below is a no-op. + # Note: unfortunately, the output on the command line is: + # default: Removed /etc/systemd/system/packagekit.service + # But, that actually means that the service is up and running. What it is + # saying is that the service has been unlinked from /dev/null, i.e. working. + config.vm.provision "shell", + run: "always", + inline: <<-SHELL + sudo systemctl unmask packagekit.service + sudo systemctl start packagekit.service + SHELL + end

    ' + http.STATUS_CODES[status] + '. Redirecting to ' + url + '